|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[225,5,6,7,18],{"+NIl":function($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){"use strict";j.defineMode("stex",function(k,D){"use strict";function R(l,r){l.cmdState.push(r)}function O(l){return l.cmdState.length>0?l.cmdState[l.cmdState.length-1]:null}function c(l){var r=l.cmdState.pop();r&&r.closeBracket()}function E(l){for(var r=l.cmdState,n=r.length-1;n>=0;n--){var a=r[n];if(a.name=="DEFAULT")continue;return a}return{styleIdentifier:function(){return null}}}function y(l,r,n){return function(){this.name=l,this.bracketNo=0,this.style=r,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var p={};p.importmodule=y("importmodule","tag",["string","builtin"]),p.documentclass=y("documentclass","tag",["","atom"]),p.usepackage=y("usepackage","tag",["atom"]),p.begin=y("begin","tag",["atom"]),p.end=y("end","tag",["atom"]),p.label=y("label","tag",["atom"]),p.ref=y("ref","tag",["atom"]),p.eqref=y("eqref","tag",["atom"]),p.cite=y("cite","tag",["atom"]),p.bibitem=y("bibitem","tag",["atom"]),p.Bibitem=y("Bibitem","tag",["atom"]),p.RBibitem=y("RBibitem","tag",["atom"]),p.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function u(l,r){l.f=r}function o(l,r){var n;if(l.match(/^\\[a-zA-Z@]+/)){var a=l.current().slice(1);return n=p.hasOwnProperty(a)?p[a]:p.DEFAULT,n=new n,R(r,n),u(r,s),n.style}if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/\\]/))return"tag";if(l.match("\\["))return u(r,function(f,h){return d(f,h,"\\]")}),"keyword";if(l.match("\\("))return u(r,function(f,h){return d(f,h,"\\)")}),"keyword";if(l.match("$$"))return u(r,function(f,h){return d(f,h,"$$")}),"keyword";if(l.match("$"))return u(r,function(f,h){return d(f,h,"$")}),"keyword";var i=l.next();if(i=="%")return l.skipToEnd(),"comment";if(i=="}"||i=="]"){if(n=O(r),n)n.closeBracket(i),u(r,s);else return"error";return"bracket"}else return i=="{"||i=="["?(n=p.DEFAULT,n=new n,R(r,n),"bracket"):/\d/.test(i)?(l.eatWhile(/[\w.%]/),"atom"):(l.eatWhile(/[\w\-_]/),n=E(r),n.name=="begin"&&(n.argument=l.current()),n.styleIdentifier())}function d(l,r,n){if(l.eatSpace())return null;if(n&&l.match(n))return u(r,o),"keyword";if(l.match(/^\\[a-zA-Z@]+/))return"tag";if(l.match(/^[a-zA-Z]+/))return"variable-2";if(l.match(/^\\[$&%#{}_]/))return"tag";if(l.match(/^\\[,;!\/]/))return"tag";if(l.match(/^[\^_&]/))return"tag";if(l.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(l.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=l.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(l.skipToEnd(),"comment"):"error"}function s(l,r){var n=l.peek(),a;return n=="{"||n=="["?(a=O(r),a.openBracket(n),l.eat(n),u(r,o),"bracket"):/[ \t\r]/.test(n)?(l.eat(n),null):(u(r,o),c(r),o(l,r))}return{startState:function(){var l=D.inMathMode?function(r,n){return d(r,n)}:o;return{cmdState:[],f:l}},copyState:function(l){return{cmdState:l.cmdState.slice(),f:l.f}},token:function(l,r){return r.f(l,r)},blankLine:function(l){l.f=o,l.cmdState.length=0},lineComment:"%"}}),j.defineMIME("text/x-stex","stex"),j.defineMIME("text/x-latex","stex")})},"/POA":function($e,ue,ie){!function(j,k){if(!0)$e.exports=k();else var D,R}(window,function(){return function(j){var k={};function D(R){if(k[R])return k[R].exports;var O=k[R]={i:R,l:!1,exports:{}};return j[R].call(O.exports,O,O.exports,D),O.l=!0,O.exports}return D.m=j,D.c=k,D.d=function(R,O,c){D.o(R,O)||Object.defineProperty(R,O,{enumerable:!0,get:c})},D.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},D.t=function(R,O){if(1&O&&(R=D(R)),8&O)return R;if(4&O&&typeof R=="object"&&R&&R.__esModule)return R;var c=Object.create(null);if(D.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:R}),2&O&&typeof R!="string")for(var E in R)D.d(c,E,function(y){return R[y]}.bind(null,E));return c},D.n=function(R){var O=R&&R.__esModule?function(){return R.default}:function(){return R};return D.d(O,"a",O),O},D.o=function(R,O){return Object.prototype.hasOwnProperty.call(R,O)},D.p="",D(D.s=34)}([function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.forwardEvent=k.EventEmitter=void 0;var R=function(){function O(){this._listeners=[],this._disposed=!1}return Object.defineProperty(O.prototype,"event",{get:function(){var c=this;return this._event||(this._event=function(E){return c._listeners.push(E),{dispose:function(){if(!c._disposed){for(var y=0;y<c._listeners.length;y++)if(c._listeners[y]===E)return void c._listeners.splice(y,1)}}}}),this._event},enumerable:!1,configurable:!0}),O.prototype.fire=function(c,E){for(var y=[],p=0;p<this._listeners.length;p++)y.push(this._listeners[p]);for(p=0;p<y.length;p++)y[p].call(void 0,c,E)},O.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},O}();k.EventEmitter=R,k.forwardEvent=function(O,c){return O(function(E){return c.fire(E)})}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.IUnicodeService=k.IOptionsService=k.ILogService=k.IInstantiationService=k.IDirtyRowService=k.ICharsetService=k.ICoreService=k.ICoreMouseService=k.IBufferService=void 0;var R=D(14);k.IBufferService=R.createDecorator("BufferService"),k.ICoreMouseService=R.createDecorator("CoreMouseService"),k.ICoreService=R.createDecorator("CoreService"),k.ICharsetService=R.createDecorator("CharsetService"),k.IDirtyRowService=R.createDecorator("DirtyRowService"),k.IInstantiationService=R.createDecorator("InstantiationService"),k.ILogService=R.createDecorator("LogService"),k.IOptionsService=R.createDecorator("OptionsService"),k.IUnicodeService=R.createDecorator("UnicodeService")},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.getDisposeArrayDisposable=k.disposeArray=k.Disposable=void 0;var R=function(){function c(){this._disposables=[],this._isDisposed=!1}return c.prototype.dispose=function(){this._isDisposed=!0;for(var E=0,y=this._disposables;E<y.length;E++)y[E].dispose();this._disposables.length=0},c.prototype.register=function(E){return this._disposables.push(E),E},c.prototype.unregister=function(E){var y=this._disposables.indexOf(E);y!==-1&&this._disposables.splice(y,1)},c}();function O(c){for(var E=0,y=c;E<y.length;E++)y[E].dispose();c.length=0}k.Disposable=R,k.disposeArray=O,k.getDisposeArrayDisposable=function(c){return{dispose:function(){return O(c)}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.WHITESPACE_CELL_CODE=k.WHITESPACE_CELL_WIDTH=k.WHITESPACE_CELL_CHAR=k.NULL_CELL_CODE=k.NULL_CELL_WIDTH=k.NULL_CELL_CHAR=k.CHAR_DATA_CODE_INDEX=k.CHAR_DATA_WIDTH_INDEX=k.CHAR_DATA_CHAR_INDEX=k.CHAR_DATA_ATTR_INDEX=k.DEFAULT_ATTR=k.DEFAULT_COLOR=void 0,k.DEFAULT_COLOR=256,k.DEFAULT_ATTR=256|k.DEFAULT_COLOR<<9,k.CHAR_DATA_ATTR_INDEX=0,k.CHAR_DATA_CHAR_INDEX=1,k.CHAR_DATA_WIDTH_INDEX=2,k.CHAR_DATA_CODE_INDEX=3,k.NULL_CELL_CHAR="",k.NULL_CELL_WIDTH=1,k.NULL_CELL_CODE=0,k.WHITESPACE_CELL_CHAR=" ",k.WHITESPACE_CELL_WIDTH=1,k.WHITESPACE_CELL_CODE=32},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,s){d.__proto__=s}||function(d,s){for(var l in s)s.hasOwnProperty(l)&&(d[l]=s[l])})(u,o)},function(u,o){function d(){this.constructor=u}R(u,o),u.prototype=o===null?Object.create(o):(d.prototype=o.prototype,new d)});Object.defineProperty(k,"__esModule",{value:!0}),k.CellData=void 0;var c=D(8),E=D(3),y=D(6),p=function(u){function o(){var d=u!==null&&u.apply(this,arguments)||this;return d.content=0,d.fg=0,d.bg=0,d.extended=new y.ExtendedAttrs,d.combinedData="",d}return O(o,u),o.fromCharData=function(d){var s=new o;return s.setFromCharData(d),s},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?c.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(d){this.fg=d[E.CHAR_DATA_ATTR_INDEX],this.bg=0;var s=!1;if(d[E.CHAR_DATA_CHAR_INDEX].length>2)s=!0;else if(d[E.CHAR_DATA_CHAR_INDEX].length===2){var l=d[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){var r=d[E.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(l-55296)+r-56320+65536|d[E.CHAR_DATA_WIDTH_INDEX]<<22:s=!0}else s=!0}else this.content=d[E.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|d[E.CHAR_DATA_WIDTH_INDEX]<<22;s&&(this.combinedData=d[E.CHAR_DATA_CHAR_INDEX],this.content=2097152|d[E.CHAR_DATA_WIDTH_INDEX]<<22)},o.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},o}(y.AttributeData);k.CellData=p},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ISoundService=k.ISelectionService=k.IRenderService=k.IMouseService=k.ICoreBrowserService=k.ICharSizeService=void 0;var R=D(14);k.ICharSizeService=R.createDecorator("CharSizeService"),k.ICoreBrowserService=R.createDecorator("CoreBrowserService"),k.IMouseService=R.createDecorator("MouseService"),k.IRenderService=R.createDecorator("RenderService"),k.ISelectionService=R.createDecorator("SelectionService"),k.ISoundService=R.createDecorator("SoundService")},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ExtendedAttrs=k.AttributeData=void 0;var R=function(){function c(){this.fg=0,this.bg=0,this.extended=new O}return c.toColorRGB=function(E){return[E>>>16&255,E>>>8&255,255&E]},c.fromColorRGB=function(E){return(255&E[0])<<16|(255&E[1])<<8|255&E[2]},c.prototype.clone=function(){var E=new c;return E.fg=this.fg,E.bg=this.bg,E.extended=this.extended.clone(),E},c.prototype.isInverse=function(){return 67108864&this.fg},c.prototype.isBold=function(){return 134217728&this.fg},c.prototype.isUnderline=function(){return 268435456&this.fg},c.prototype.isBlink=function(){return 536870912&this.fg},c.prototype.isInvisible=function(){return 1073741824&this.fg},c.prototype.isItalic=function(){return 67108864&this.bg},c.prototype.isDim=function(){return 134217728&this.bg},c.prototype.getFgColorMode=function(){return 50331648&this.fg},c.prototype.getBgColorMode=function(){return 50331648&this.bg},c.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},c.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},c.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},c.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},c.prototype.isFgDefault=function(){return(50331648&this.fg)==0},c.prototype.isBgDefault=function(){return(50331648&this.bg)==0},c.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},c.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},c.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},c.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},c.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},c.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()},c.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},c.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},c.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},c.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},c.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},c}();k.AttributeData=R;var O=function(){function c(E,y){E===void 0&&(E=0),y===void 0&&(y=-1),this.underlineStyle=E,this.underlineColor=y}return c.prototype.clone=function(){return new c(this.underlineStyle,this.underlineColor)},c.prototype.isEmpty=function(){return this.underlineStyle===0},c}();k.ExtendedAttrs=O},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.addDisposableDomListener=void 0,k.addDisposableDomListener=function(R,O,c,E){R.addEventListener(O,c,E);var y=!1;return{dispose:function(){y||(y=!0,R.removeEventListener(O,c,E))}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Utf8ToUtf32=k.StringToUtf32=k.utf32ToString=k.stringFromCodePoint=void 0,k.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},k.utf32ToString=function(c,E,y){E===void 0&&(E=0),y===void 0&&(y=c.length);for(var p="",u=E;u<y;++u){var o=c[u];o>65535?(o-=65536,p+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):p+=String.fromCharCode(o)}return p};var R=function(){function c(){this._interim=0}return c.prototype.clear=function(){this._interim=0},c.prototype.decode=function(E,y){var p=E.length;if(!p)return 0;var u=0,o=0;this._interim&&(56320<=(l=E.charCodeAt(o++))&&l<=57343?y[u++]=1024*(this._interim-55296)+l-56320+65536:(y[u++]=this._interim,y[u++]=l),this._interim=0);for(var d=o;d<p;++d){var s=E.charCodeAt(d);if(55296<=s&&s<=56319){if(++d>=p)return this._interim=s,u;var l;56320<=(l=E.charCodeAt(d))&&l<=57343?y[u++]=1024*(s-55296)+l-56320+65536:(y[u++]=s,y[u++]=l)}else y[u++]=s}return u},c}();k.StringToUtf32=R;var O=function(){function c(){this.interim=new Uint8Array(3)}return c.prototype.clear=function(){this.interim.fill(0)},c.prototype.decode=function(E,y){var p=E.length;if(!p)return 0;var u,o,d,s,l=0,r=0,n=0;if(this.interim[0]){var a=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;for(var f=0,h=void 0;(h=63&this.interim[++f])&&f<4;)i<<=6,i|=h;for(var w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,m=w-f;n<m;){if(n>=p)return 0;if((192&(h=E[n++]))!=128){n--,a=!0;break}this.interim[f++]=h,i<<=6,i|=63&h}a||(w===2?i<128?n--:y[l++]=i:w===3?i<2048||i>=55296&&i<=57343||(y[l++]=i):i<65536||i>1114111||(y[l++]=i)),this.interim.fill(0)}for(var T=p-4,A=n;A<p;){for(;!(!(A<T)||128&(u=E[A])||128&(o=E[A+1])||128&(d=E[A+2])||128&(s=E[A+3]));)y[l++]=u,y[l++]=o,y[l++]=d,y[l++]=s,A+=4;if((u=E[A++])<128)y[l++]=u;else if((224&u)==192){if(A>=p)return this.interim[0]=u,l;if((192&(o=E[A++]))!=128){A--;continue}if((r=(31&u)<<6|63&o)<128){A--;continue}y[l++]=r}else if((240&u)==224){if(A>=p)return this.interim[0]=u,l;if((192&(o=E[A++]))!=128){A--;continue}if(A>=p)return this.interim[0]=u,this.interim[1]=o,l;if((192&(d=E[A++]))!=128){A--;continue}if((r=(15&u)<<12|(63&o)<<6|63&d)<2048||r>=55296&&r<=57343)continue;y[l++]=r}else if((248&u)==240){if(A>=p)return this.interim[0]=u,l;if((192&(o=E[A++]))!=128){A--;continue}if(A>=p)return this.interim[0]=u,this.interim[1]=o,l;if((192&(d=E[A++]))!=128){A--;continue}if(A>=p)return this.interim[0]=u,this.interim[1]=o,this.interim[2]=d,l;if((192&(s=E[A++]))!=128){A--;continue}if((r=(7&u)<<18|(63&o)<<12|(63&d)<<6|63&s)<65536||r>1114111)continue;y[l++]=r}}return l},c}();k.Utf8ToUtf32=O},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CHAR_ATLAS_CELL_SPACING=k.DIM_OPACITY=k.INVERTED_DEFAULT_COLOR=void 0,k.INVERTED_DEFAULT_COLOR=257,k.DIM_OPACITY=.5,k.CHAR_ATLAS_CELL_SPACING=1},function(j,k,D){"use strict";var R,O,c,E;function y(u){var o=u.toString(16);return o.length<2?"0"+o:o}function p(u,o){return u<o?(o+.05)/(u+.05):(u+.05)/(o+.05)}Object.defineProperty(k,"__esModule",{value:!0}),k.contrastRatio=k.toPaddedHex=k.rgba=k.rgb=k.css=k.color=k.channels=void 0,function(u){u.toCss=function(o,d,s,l){return l!==void 0?"#"+y(o)+y(d)+y(s)+y(l):"#"+y(o)+y(d)+y(s)},u.toRgba=function(o,d,s,l){return l===void 0&&(l=255),(o<<24|d<<16|s<<8|l)>>>0}}(R=k.channels||(k.channels={})),(O=k.color||(k.color={})).blend=function(u,o){var d=(255&o.rgba)/255;if(d===1)return{css:o.css,rgba:o.rgba};var s=o.rgba>>24&255,l=o.rgba>>16&255,r=o.rgba>>8&255,n=u.rgba>>24&255,a=u.rgba>>16&255,i=u.rgba>>8&255,f=n+Math.round((s-n)*d),h=a+Math.round((l-a)*d),w=i+Math.round((r-i)*d);return{css:R.toCss(f,h,w),rgba:R.toRgba(f,h,w)}},O.isOpaque=function(u){return(255&u.rgba)==255},O.ensureContrastRatio=function(u,o,d){var s=E.ensureContrastRatio(u.rgba,o.rgba,d);if(s)return E.toColor(s>>24&255,s>>16&255,s>>8&255)},O.opaque=function(u){var o=(255|u.rgba)>>>0,d=E.toChannels(o),s=d[0],l=d[1],r=d[2];return{css:R.toCss(s,l,r),rgba:o}},O.opacity=function(u,o){var d=Math.round(255*o),s=E.toChannels(u.rgba),l=s[0],r=s[1],n=s[2];return{css:R.toCss(l,r,n,d),rgba:R.toRgba(l,r,n,d)}},(k.css||(k.css={})).toColor=function(u){switch(u.length){case 7:return{css:u,rgba:(parseInt(u.slice(1),16)<<8|255)>>>0};case 9:return{css:u,rgba:parseInt(u.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(u){function o(d,s,l){var r=d/255,n=s/255,a=l/255;return .2126*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4))}u.relativeLuminance=function(d){return o(d>>16&255,d>>8&255,255&d)},u.relativeLuminance2=o}(c=k.rgb||(k.rgb={})),function(u){function o(s,l,r){for(var n=s>>24&255,a=s>>16&255,i=s>>8&255,f=l>>24&255,h=l>>16&255,w=l>>8&255,m=p(c.relativeLuminance2(f,w,h),c.relativeLuminance2(n,a,i));m<r&&(f>0||h>0||w>0);)f-=Math.max(0,Math.ceil(.1*f)),h-=Math.max(0,Math.ceil(.1*h)),w-=Math.max(0,Math.ceil(.1*w)),m=p(c.relativeLuminance2(f,w,h),c.relativeLuminance2(n,a,i));return(f<<24|h<<16|w<<8|255)>>>0}function d(s,l,r){for(var n=s>>24&255,a=s>>16&255,i=s>>8&255,f=l>>24&255,h=l>>16&255,w=l>>8&255,m=p(c.relativeLuminance2(f,w,h),c.relativeLuminance2(n,a,i));m<r&&(f<255||h<255||w<255);)f=Math.min(255,f+Math.ceil(.1*(255-f))),h=Math.min(255,h+Math.ceil(.1*(255-h))),w=Math.min(255,w+Math.ceil(.1*(255-w))),m=p(c.relativeLuminance2(f,w,h),c.relativeLuminance2(n,a,i));return(f<<24|h<<16|w<<8|255)>>>0}u.ensureContrastRatio=function(s,l,r){var n=c.relativeLuminance(s>>8),a=c.relativeLuminance(l>>8);if(p(n,a)<r)return a<n?o(s,l,r):d(s,l,r)},u.reduceLuminance=o,u.increaseLuminance=d,u.toChannels=function(s){return[s>>24&255,s>>16&255,s>>8&255,255&s]},u.toColor=function(s,l,r){return{css:R.toCss(s,l,r),rgba:R.toRgba(s,l,r)}}}(E=k.rgba||(k.rgba={})),k.toPaddedHex=y,k.contrastRatio=p},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.isLinux=k.isWindows=k.isIphone=k.isIpad=k.isMac=k.isSafari=k.isFirefox=void 0;var R=typeof navigator=="undefined",O=R?"node":navigator.userAgent,c=R?"node":navigator.platform;function E(y,p){return y.indexOf(p)>=0}k.isFirefox=!!~O.indexOf("Firefox"),k.isSafari=/^((?!chrome|android).)*safari/i.test(O),k.isMac=E(["Macintosh","MacIntel","MacPPC","Mac68K"],c),k.isIpad=c==="iPad",k.isIphone=c==="iPhone",k.isWindows=E(["Windows","Win16","Win32","WinCE"],c),k.isLinux=c.indexOf("Linux")>=0},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.C1=k.C0=void 0,function(R){R.NUL="\0",R.SOH="",R.STX="",R.ETX="",R.EOT="",R.ENQ="",R.ACK="",R.BEL="\x07",R.BS="\b",R.HT=" ",R.LF=`
|
|
|
`,R.VT="\v",R.FF="\f",R.CR="\r",R.SO="",R.SI="",R.DLE="",R.DC1="",R.DC2="",R.DC3="",R.DC4="",R.NAK="",R.SYN="",R.ETB="",R.CAN="",R.EM="",R.SUB="",R.ESC="",R.FS="",R.GS="",R.RS="",R.US="",R.SP=" ",R.DEL="\x7F"}(k.C0||(k.C0={})),function(R){R.PAD="\x80",R.HOP="\x81",R.BPH="\x82",R.NBH="\x83",R.IND="\x84",R.NEL="\x85",R.SSA="\x86",R.ESA="\x87",R.HTS="\x88",R.HTJ="\x89",R.VTS="\x8A",R.PLD="\x8B",R.PLU="\x8C",R.RI="\x8D",R.SS2="\x8E",R.SS3="\x8F",R.DCS="\x90",R.PU1="\x91",R.PU2="\x92",R.STS="\x93",R.CCH="\x94",R.MW="\x95",R.SPA="\x96",R.EPA="\x97",R.SOS="\x98",R.SGCI="\x99",R.SCI="\x9A",R.CSI="\x9B",R.ST="\x9C",R.OSC="\x9D",R.PM="\x9E",R.APC="\x9F"}(k.C1||(k.C1={}))},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BaseRenderLayer=void 0;var R=D(3),O=D(9),c=D(25),E=D(6),y=D(28),p=D(10),u=D(17),o=function(){function d(s,l,r,n,a,i,f,h){this._container=s,this._alpha=n,this._colors=a,this._rendererId=i,this._bufferService=f,this._optionsService=h,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-"+l+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return d.prototype.dispose=function(){var s;u.removeElementFromParent(this._canvas),(s=this._charAtlas)===null||s===void 0||s.dispose()},d.prototype._initCanvas=function(){this._ctx=y.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},d.prototype.onOptionsChanged=function(){},d.prototype.onBlur=function(){},d.prototype.onFocus=function(){},d.prototype.onCursorMove=function(){},d.prototype.onGridChanged=function(s,l){},d.prototype.onSelectionChanged=function(s,l,r){r===void 0&&(r=!1)},d.prototype.setColors=function(s){this._refreshCharAtlas(s)},d.prototype._setTransparency=function(s){if(s!==this._alpha){var l=this._canvas;this._alpha=s,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,l),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},d.prototype._refreshCharAtlas=function(s){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=c.acquireCharAtlas(this._optionsService.options,this._rendererId,s,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},d.prototype.resize=function(s){this._scaledCellWidth=s.scaledCellWidth,this._scaledCellHeight=s.scaledCellHeight,this._scaledCharWidth=s.scaledCharWidth,this._scaledCharHeight=s.scaledCharHeight,this._scaledCharLeft=s.scaledCharLeft,this._scaledCharTop=s.scaledCharTop,this._canvas.width=s.scaledCanvasWidth,this._canvas.height=s.scaledCanvasHeight,this._canvas.style.width=s.canvasWidth+"px",this._canvas.style.height=s.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},d.prototype._fillCells=function(s,l,r,n){this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight)},d.prototype._fillBottomLineAtCells=function(s,l,r){r===void 0&&(r=1),this._ctx.fillRect(s*this._scaledCellWidth,(l+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},d.prototype._fillLeftLineAtCell=function(s,l,r){this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,window.devicePixelRatio*r,this._scaledCellHeight)},d.prototype._strokeRectAtCell=function(s,l,r,n){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(s*this._scaledCellWidth+window.devicePixelRatio/2,l*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,n*this._scaledCellHeight-window.devicePixelRatio)},d.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))},d.prototype._clearCells=function(s,l,r,n){this._alpha?this._ctx.clearRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(s*this._scaledCellWidth,l*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight))},d.prototype._fillCharTrueColor=function(s,l,r){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(r),this._ctx.fillText(s.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},d.prototype._drawChars=function(s,l,r){var n,a,i=this._getContrastColor(s);i||s.isFgRGB()||s.isBgRGB()?this._drawUncachedChars(s,l,r,i):(s.isInverse()?(n=s.isBgDefault()?O.INVERTED_DEFAULT_COLOR:s.getBgColor(),a=s.isFgDefault()?O.INVERTED_DEFAULT_COLOR:s.getFgColor()):(a=s.isBgDefault()?R.DEFAULT_COLOR:s.getBgColor(),n=s.isFgDefault()?R.DEFAULT_COLOR:s.getFgColor()),n+=this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&n<8?8:0,this._currentGlyphIdentifier.chars=s.getChars()||R.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=s.getCode()||R.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=a,this._currentGlyphIdentifier.fg=n,this._currentGlyphIdentifier.bold=!!s.isBold(),this._currentGlyphIdentifier.dim=!!s.isDim(),this._currentGlyphIdentifier.italic=!!s.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(s,l,r))},d.prototype._drawUncachedChars=function(s,l,r,n){if(this._ctx.save(),this._ctx.font=this._getFont(!!s.isBold(),!!s.isItalic()),this._ctx.textBaseline="middle",s.isInverse())if(n)this._ctx.fillStyle=n.css;else if(s.isBgDefault())this._ctx.fillStyle=p.color.opaque(this._colors.background).css;else if(s.isBgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(s.getBgColor()).join(",")+")";else{var a=s.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}else if(n)this._ctx.fillStyle=n.css;else if(s.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(s.isFgRGB())this._ctx.fillStyle="rgb("+E.AttributeData.toColorRGB(s.getFgColor()).join(",")+")";else{var i=s.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&i<8&&(i+=8),this._ctx.fillStyle=this._colors.ansi[i].css}this._clipRow(r),s.isDim()&&(this._ctx.globalAlpha=O.DIM_OPACITY),this._ctx.fillText(s.getChars(),l*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},d.prototype._clipRow=function(s){this._ctx.beginPath(),this._ctx.rect(0,s*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},d.prototype._getFont=function(s,l){return(l?"italic":"")+" "+(s?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},d.prototype._getContrastColor=function(s){if(this._optionsService.options.minimumContrastRatio!==1){var l=this._colors.contrastCache.getColor(s.bg,s.fg);if(l!==void 0)return l||void 0;var r=s.getFgColor(),n=s.getFgColorMode(),a=s.getBgColor(),i=s.getBgColorMode(),f=!!s.isInverse(),h=!!s.isInverse();if(f){var w=r;r=a,a=w;var m=n;n=i,i=m}var T=this._resolveBackgroundRgba(i,a,f),A=this._resolveForegroundRgba(n,r,f,h),x=p.rgba.ensureContrastRatio(T,A,this._optionsService.options.minimumContrastRatio);if(x){var b={css:p.channels.toCss(x>>24&255,x>>16&255,x>>8&255),rgba:x};return this._colors.contrastCache.setColor(s.bg,s.fg,b),b}this._colors.contrastCache.setColor(s.bg,s.fg,null)}},d.prototype._resolveBackgroundRgba=function(s,l,r){switch(s){case 16777216:case 33554432:return this._colors.ansi[l].rgba;case 50331648:return l<<8;case 0:default:return r?this._colors.foreground.rgba:this._colors.background.rgba}},d.prototype._resolveForegroundRgba=function(s,l,r,n){switch(s){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&n&&l<8&&(l+=8),this._colors.ansi[l].rgba;case 50331648:return l<<8;case 0:default:return r?this._colors.background.rgba:this._colors.foreground.rgba}},d}();k.BaseRenderLayer=o},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.createDecorator=k.getServiceDependencies=k.serviceRegistry=void 0;function R(O,c,E){c.di$target===c?c.di$dependencies.push({id:O,index:E}):(c.di$dependencies=[{id:O,index:E}],c.di$target=c)}k.serviceRegistry=new Map,k.getServiceDependencies=function(O){return O.di$dependencies||[]},k.createDecorator=function(O){if(k.serviceRegistry.has(O))return k.serviceRegistry.get(O);var c=function(E,y,p){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");R(c,E,p)};return c.toString=function(){return O},k.serviceRegistry.set(O,c),c}},function(j,k,D){"use strict";function R(O,c,E,y){if(E===void 0&&(E=0),y===void 0&&(y=O.length),E>=O.length)return O;E=(O.length+E)%O.length,y=y>=O.length?O.length:(O.length+y)%O.length;for(var p=E;p<y;++p)O[p]=c;return O}Object.defineProperty(k,"__esModule",{value:!0}),k.concat=k.fillFallback=k.fill=void 0,k.fill=function(O,c,E,y){return O.fill?O.fill(c,E,y):R(O,c,E,y)},k.fillFallback=R,k.concat=function(O,c){var E=new O.constructor(O.length+c.length);return E.set(O),E.set(c,O.length),E}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BufferLine=k.DEFAULT_ATTR_DATA=void 0;var R=D(8),O=D(3),c=D(4),E=D(6);k.DEFAULT_ATTR_DATA=Object.freeze(new E.AttributeData);var y=function(){function p(u,o,d){d===void 0&&(d=!1),this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);for(var s=o||c.CellData.fromCharData([0,O.NULL_CELL_CHAR,O.NULL_CELL_WIDTH,O.NULL_CELL_CODE]),l=0;l<u;++l)this.setCell(l,s);this.length=u}return p.prototype.get=function(u){var o=this._data[3*u+0],d=2097151&o;return[this._data[3*u+1],2097152&o?this._combined[u]:d?R.stringFromCodePoint(d):"",o>>22,2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):d]},p.prototype.set=function(u,o){this._data[3*u+1]=o[O.CHAR_DATA_ATTR_INDEX],o[O.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=o[1],this._data[3*u+0]=2097152|u|o[O.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=o[O.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[O.CHAR_DATA_WIDTH_INDEX]<<22},p.prototype.getWidth=function(u){return this._data[3*u+0]>>22},p.prototype.hasWidth=function(u){return 12582912&this._data[3*u+0]},p.prototype.getFg=function(u){return this._data[3*u+1]},p.prototype.getBg=function(u){return this._data[3*u+2]},p.prototype.hasContent=function(u){return 4194303&this._data[3*u+0]},p.prototype.getCodePoint=function(u){var o=this._data[3*u+0];return 2097152&o?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&o},p.prototype.isCombined=function(u){return 2097152&this._data[3*u+0]},p.prototype.getString=function(u){var o=this._data[3*u+0];return 2097152&o?this._combined[u]:2097151&o?R.stringFromCodePoint(2097151&o):""},p.prototype.loadCell=function(u,o){var d=3*u;return o.content=this._data[d+0],o.fg=this._data[d+1],o.bg=this._data[d+2],2097152&o.content&&(o.combinedData=this._combined[u]),268435456&o.bg&&(o.extended=this._extendedAttrs[u]),o},p.prototype.setCell=function(u,o){2097152&o.content&&(this._combined[u]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[u]=o.extended),this._data[3*u+0]=o.content,this._data[3*u+1]=o.fg,this._data[3*u+2]=o.bg},p.prototype.setCellFromCodePoint=function(u,o,d,s,l,r){268435456&l&&(this._extendedAttrs[u]=r),this._data[3*u+0]=o|d<<22,this._data[3*u+1]=s,this._data[3*u+2]=l},p.prototype.addCodepointToCell=function(u,o){var d=this._data[3*u+0];2097152&d?this._combined[u]+=R.stringFromCodePoint(o):(2097151&d?(this._combined[u]=R.stringFromCodePoint(2097151&d)+R.stringFromCodePoint(o),d&=-2097152,d|=2097152):d=o|1<<22,this._data[3*u+0]=d)},p.prototype.insertCells=function(u,o,d,s){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),o<this.length-u){for(var l=new c.CellData,r=this.length-u-o-1;r>=0;--r)this.setCell(u+o+r,this.loadCell(u+r,l));for(r=0;r<o;++r)this.setCell(u+r,d)}else for(r=u;r<this.length;++r)this.setCell(r,d);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs)},p.prototype.deleteCells=function(u,o,d,s){if(u%=this.length,o<this.length-u){for(var l=new c.CellData,r=0;r<this.length-u-o;++r)this.setCell(u+r,this.loadCell(u+o+r,l));for(r=this.length-o;r<this.length;++r)this.setCell(r,d)}else for(r=u;r<this.length;++r)this.setCell(r,d);u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodePoint(u,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs)},p.prototype.replaceCells=function(u,o,d,s){for(u&&this.getWidth(u-1)===2&&this.setCellFromCodePoint(u-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new E.ExtendedAttrs);u<o&&u<this.length;)this.setCell(u++,d)},p.prototype.resize=function(u,o){if(u!==this.length){if(u>this.length){var d=new Uint32Array(3*u);this.length&&(3*u<this._data.length?d.set(this._data.subarray(0,3*u)):d.set(this._data)),this._data=d;for(var s=this.length;s<u;++s)this.setCell(s,o)}else if(u){(d=new Uint32Array(3*u)).set(this._data.subarray(0,3*u)),this._data=d;var l=Object.keys(this._combined);for(s=0;s<l.length;s++){var r=parseInt(l[s],10);r>=u&&delete this._combined[r]}}else this._data=new Uint32Array(0),this._combined={};this.length=u}},p.prototype.fill=function(u){this._combined={},this._extendedAttrs={};for(var o=0;o<this.length;++o)this.setCell(o,u)},p.prototype.copyFrom=function(u){for(var o in this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={},u._combined)this._combined[o]=u._combined[o];for(var o in this._extendedAttrs={},u._extendedAttrs)this._extendedAttrs[o]=u._extendedAttrs[o];this.isWrapped=u.isWrapped},p.prototype.clone=function(){var u=new p(0);for(var o in u._data=new Uint32Array(this._data),u.length=this.length,this._combined)u._combined[o]=this._combined[o];for(var o in this._extendedAttrs)u._extendedAttrs[o]=this._extendedAttrs[o];return u.isWrapped=this.isWrapped,u},p.prototype.getTrimmedLength=function(){for(var u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0},p.prototype.copyCellsFrom=function(u,o,d,s,l){var r=u._data;if(l)for(var n=s-1;n>=0;n--)for(var a=0;a<3;a++)this._data[3*(d+n)+a]=r[3*(o+n)+a];else for(n=0;n<s;n++)for(a=0;a<3;a++)this._data[3*(d+n)+a]=r[3*(o+n)+a];var i=Object.keys(u._combined);for(a=0;a<i.length;a++){var f=parseInt(i[a],10);f>=o&&(this._combined[f-o+d]=u._combined[f])}},p.prototype.translateToString=function(u,o,d){u===void 0&&(u=!1),o===void 0&&(o=0),d===void 0&&(d=this.length),u&&(d=Math.min(d,this.getTrimmedLength()));for(var s="";o<d;){var l=this._data[3*o+0],r=2097151&l;s+=2097152&l?this._combined[o]:r?R.stringFromCodePoint(r):O.WHITESPACE_CELL_CHAR,o+=l>>22||1}return s},p}();k.BufferLine=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.removeElementFromParent=void 0,k.removeElementFromParent=function(){for(var R,O=[],c=0;c<arguments.length;c++)O[c]=arguments[c];for(var E=0,y=O;E<y.length;E++){var p=y[E];(R=p==null?void 0:p.parentElement)===null||R===void 0||R.removeChild(p)}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.tooMuchOutput=k.promptLabel=void 0,k.promptLabel="Terminal input",k.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(A,x){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,S){b.__proto__=S}||function(b,S){for(var C in S)S.hasOwnProperty(C)&&(b[C]=S[C])})(A,x)},function(A,x){function b(){this.constructor=A}R(A,x),A.prototype=x===null?Object.create(x):(b.prototype=x.prototype,new b)});Object.defineProperty(k,"__esModule",{value:!0}),k.InputHandler=k.WindowsOptionsReportType=void 0;var c,E=D(12),y=D(20),p=D(39),u=D(2),o=D(15),d=D(8),s=D(16),l=D(0),r=D(3),n=D(4),a=D(6),i=D(22),f=D(24),h={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function w(A,x){if(A>24)return x.setWinLines||!1;switch(A){case 1:return!!x.restoreWin;case 2:return!!x.minimizeWin;case 3:return!!x.setWinPosition;case 4:return!!x.setWinSizePixels;case 5:return!!x.raiseWin;case 6:return!!x.lowerWin;case 7:return!!x.refreshWin;case 8:return!!x.setWinSizeChars;case 9:return!!x.maximizeWin;case 10:return!!x.fullscreenWin;case 11:return!!x.getWinState;case 13:return!!x.getWinPosition;case 14:return!!x.getWinSizePixels;case 15:return!!x.getScreenSizePixels;case 16:return!!x.getCellSizePixels;case 18:return!!x.getWinSizeChars;case 19:return!!x.getScreenSizeChars;case 20:return!!x.getIconTitle;case 21:return!!x.getWinTitle;case 22:return!!x.pushTitle;case 23:return!!x.popTitle;case 24:return!!x.setWinLines}return!1}!function(A){A[A.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",A[A.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(c=k.WindowsOptionsReportType||(k.WindowsOptionsReportType={}));var m=function(){function A(x,b,S,C){this._bufferService=x,this._coreService=b,this._logService=S,this._optionsService=C,this._data=new Uint32Array(0)}return A.prototype.hook=function(x){this._data=new Uint32Array(0)},A.prototype.put=function(x,b,S){this._data=o.concat(this._data,x.subarray(b,S))},A.prototype.unhook=function(x){if(x){var b=d.utf32ToString(this._data);switch(this._data=new Uint32Array(0),b){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 S=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+S+E.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(E.C0.ESC+"P1$r0m"+E.C0.ESC+"\\");case" q":var C={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return C-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(E.C0.ESC+"P1$r"+C+" q"+E.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",b),this._coreService.triggerDataEvent(E.C0.ESC+"P0$r"+E.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},A}(),T=function(A){function x(b,S,C,g,M,I,P,B,H){H===void 0&&(H=new p.EscapeSequenceParser);var F=A.call(this)||this;F._bufferService=b,F._charsetService=S,F._coreService=C,F._dirtyRowService=g,F._logService=M,F._optionsService=I,F._coreMouseService=P,F._unicodeService=B,F._parser=H,F._parseBuffer=new Uint32Array(4096),F._stringDecoder=new d.StringToUtf32,F._utf8Decoder=new d.Utf8ToUtf32,F._workCell=new n.CellData,F._windowTitle="",F._iconName="",F._windowTitleStack=[],F._iconNameStack=[],F._curAttrData=s.DEFAULT_ATTR_DATA.clone(),F._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),F._onRequestBell=new l.EventEmitter,F._onRequestRefreshRows=new l.EventEmitter,F._onRequestReset=new l.EventEmitter,F._onRequestScroll=new l.EventEmitter,F._onRequestSyncScrollBar=new l.EventEmitter,F._onRequestWindowsOptionsReport=new l.EventEmitter,F._onA11yChar=new l.EventEmitter,F._onA11yTab=new l.EventEmitter,F._onCursorMove=new l.EventEmitter,F._onLineFeed=new l.EventEmitter,F._onScroll=new l.EventEmitter,F._onTitleChange=new l.EventEmitter,F.register(F._parser),F._parser.setCsiHandlerFallback(function(G,ee){F._logService.debug("Unknown CSI code: ",{identifier:F._parser.identToString(G),params:ee.toArray()})}),F._parser.setEscHandlerFallback(function(G){F._logService.debug("Unknown ESC code: ",{identifier:F._parser.identToString(G)})}),F._parser.setExecuteHandlerFallback(function(G){F._logService.debug("Unknown EXECUTE code: ",{code:G})}),F._parser.setOscHandlerFallback(function(G,ee,de){F._logService.debug("Unknown OSC code: ",{identifier:G,action:ee,data:de})}),F._parser.setDcsHandlerFallback(function(G,ee,de){ee==="HOOK"&&(de=de.toArray()),F._logService.debug("Unknown DCS code: ",{identifier:F._parser.identToString(G),action:ee,payload:de})}),F._parser.setPrintHandler(function(G,ee,de){return F.print(G,ee,de)}),F._parser.setCsiHandler({final:"@"},function(G){return F.insertChars(G)}),F._parser.setCsiHandler({intermediates:" ",final:"@"},function(G){return F.scrollLeft(G)}),F._parser.setCsiHandler({final:"A"},function(G){return F.cursorUp(G)}),F._parser.setCsiHandler({intermediates:" ",final:"A"},function(G){return F.scrollRight(G)}),F._parser.setCsiHandler({final:"B"},function(G){return F.cursorDown(G)}),F._parser.setCsiHandler({final:"C"},function(G){return F.cursorForward(G)}),F._parser.setCsiHandler({final:"D"},function(G){return F.cursorBackward(G)}),F._parser.setCsiHandler({final:"E"},function(G){return F.cursorNextLine(G)}),F._parser.setCsiHandler({final:"F"},function(G){return F.cursorPrecedingLine(G)}),F._parser.setCsiHandler({final:"G"},function(G){return F.cursorCharAbsolute(G)}),F._parser.setCsiHandler({final:"H"},function(G){return F.cursorPosition(G)}),F._parser.setCsiHandler({final:"I"},function(G){return F.cursorForwardTab(G)}),F._parser.setCsiHandler({final:"J"},function(G){return F.eraseInDisplay(G)}),F._parser.setCsiHandler({prefix:"?",final:"J"},function(G){return F.eraseInDisplay(G)}),F._parser.setCsiHandler({final:"K"},function(G){return F.eraseInLine(G)}),F._parser.setCsiHandler({prefix:"?",final:"K"},function(G){return F.eraseInLine(G)}),F._parser.setCsiHandler({final:"L"},function(G){return F.insertLines(G)}),F._parser.setCsiHandler({final:"M"},function(G){return F.deleteLines(G)}),F._parser.setCsiHandler({final:"P"},function(G){return F.deleteChars(G)}),F._parser.setCsiHandler({final:"S"},function(G){return F.scrollUp(G)}),F._parser.setCsiHandler({final:"T"},function(G){return F.scrollDown(G)}),F._parser.setCsiHandler({final:"X"},function(G){return F.eraseChars(G)}),F._parser.setCsiHandler({final:"Z"},function(G){return F.cursorBackwardTab(G)}),F._parser.setCsiHandler({final:"`"},function(G){return F.charPosAbsolute(G)}),F._parser.setCsiHandler({final:"a"},function(G){return F.hPositionRelative(G)}),F._parser.setCsiHandler({final:"b"},function(G){return F.repeatPrecedingCharacter(G)}),F._parser.setCsiHandler({final:"c"},function(G){return F.sendDeviceAttributesPrimary(G)}),F._parser.setCsiHandler({prefix:">",final:"c"},function(G){return F.sendDeviceAttributesSecondary(G)}),F._parser.setCsiHandler({final:"d"},function(G){return F.linePosAbsolute(G)}),F._parser.setCsiHandler({final:"e"},function(G){return F.vPositionRelative(G)}),F._parser.setCsiHandler({final:"f"},function(G){return F.hVPosition(G)}),F._parser.setCsiHandler({final:"g"},function(G){return F.tabClear(G)}),F._parser.setCsiHandler({final:"h"},function(G){return F.setMode(G)}),F._parser.setCsiHandler({prefix:"?",final:"h"},function(G){return F.setModePrivate(G)}),F._parser.setCsiHandler({final:"l"},function(G){return F.resetMode(G)}),F._parser.setCsiHandler({prefix:"?",final:"l"},function(G){return F.resetModePrivate(G)}),F._parser.setCsiHandler({final:"m"},function(G){return F.charAttributes(G)}),F._parser.setCsiHandler({final:"n"},function(G){return F.deviceStatus(G)}),F._parser.setCsiHandler({prefix:"?",final:"n"},function(G){return F.deviceStatusPrivate(G)}),F._parser.setCsiHandler({intermediates:"!",final:"p"},function(G){return F.softReset(G)}),F._parser.setCsiHandler({intermediates:" ",final:"q"},function(G){return F.setCursorStyle(G)}),F._parser.setCsiHandler({final:"r"},function(G){return F.setScrollRegion(G)}),F._parser.setCsiHandler({final:"s"},function(G){return F.saveCursor(G)}),F._parser.setCsiHandler({final:"t"},function(G){return F.windowOptions(G)}),F._parser.setCsiHandler({final:"u"},function(G){return F.restoreCursor(G)}),F._parser.setCsiHandler({intermediates:"'",final:"}"},function(G){return F.insertColumns(G)}),F._parser.setCsiHandler({intermediates:"'",final:"~"},function(G){return F.deleteColumns(G)}),F._parser.setExecuteHandler(E.C0.BEL,function(){return F.bell()}),F._parser.setExecuteHandler(E.C0.LF,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.VT,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.FF,function(){return F.lineFeed()}),F._parser.setExecuteHandler(E.C0.CR,function(){return F.carriageReturn()}),F._parser.setExecuteHandler(E.C0.BS,function(){return F.backspace()}),F._parser.setExecuteHandler(E.C0.HT,function(){return F.tab()}),F._parser.setExecuteHandler(E.C0.SO,function(){return F.shiftOut()}),F._parser.setExecuteHandler(E.C0.SI,function(){return F.shiftIn()}),F._parser.setExecuteHandler(E.C1.IND,function(){return F.index()}),F._parser.setExecuteHandler(E.C1.NEL,function(){return F.nextLine()}),F._parser.setExecuteHandler(E.C1.HTS,function(){return F.tabSet()}),F._parser.setOscHandler(0,new i.OscHandler(function(G){F.setTitle(G),F.setIconName(G)})),F._parser.setOscHandler(1,new i.OscHandler(function(G){return F.setIconName(G)})),F._parser.setOscHandler(2,new i.OscHandler(function(G){return F.setTitle(G)})),F._parser.setEscHandler({final:"7"},function(){return F.saveCursor()}),F._parser.setEscHandler({final:"8"},function(){return F.restoreCursor()}),F._parser.setEscHandler({final:"D"},function(){return F.index()}),F._parser.setEscHandler({final:"E"},function(){return F.nextLine()}),F._parser.setEscHandler({final:"H"},function(){return F.tabSet()}),F._parser.setEscHandler({final:"M"},function(){return F.reverseIndex()}),F._parser.setEscHandler({final:"="},function(){return F.keypadApplicationMode()}),F._parser.setEscHandler({final:">"},function(){return F.keypadNumericMode()}),F._parser.setEscHandler({final:"c"},function(){return F.fullReset()}),F._parser.setEscHandler({final:"n"},function(){return F.setgLevel(2)}),F._parser.setEscHandler({final:"o"},function(){return F.setgLevel(3)}),F._parser.setEscHandler({final:"|"},function(){return F.setgLevel(3)}),F._parser.setEscHandler({final:"}"},function(){return F.setgLevel(2)}),F._parser.setEscHandler({final:"~"},function(){return F.setgLevel(1)}),F._parser.setEscHandler({intermediates:"%",final:"@"},function(){return F.selectDefaultCharset()}),F._parser.setEscHandler({intermediates:"%",final:"G"},function(){return F.selectDefaultCharset()});var W=function(G){U._parser.setEscHandler({intermediates:"(",final:G},function(){return F.selectCharset("("+G)}),U._parser.setEscHandler({intermediates:")",final:G},function(){return F.selectCharset(")"+G)}),U._parser.setEscHandler({intermediates:"*",final:G},function(){return F.selectCharset("*"+G)}),U._parser.setEscHandler({intermediates:"+",final:G},function(){return F.selectCharset("+"+G)}),U._parser.setEscHandler({intermediates:"-",final:G},function(){return F.selectCharset("-"+G)}),U._parser.setEscHandler({intermediates:".",final:G},function(){return F.selectCharset("."+G)}),U._parser.setEscHandler({intermediates:"/",final:G},function(){return F.selectCharset("/"+G)})},U=this;for(var K in y.CHARSETS)W(K);return F._parser.setEscHandler({intermediates:"#",final:"8"},function(){return F.screenAlignmentPattern()}),F._parser.setErrorHandler(function(G){return F._logService.error("Parsing error: ",G),G}),F._parser.setDcsHandler({intermediates:"$",final:"q"},new m(F._bufferService,F._coreService,F._logService,F._optionsService)),F}return O(x,A),Object.defineProperty(x.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(x.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),x.prototype.dispose=function(){A.prototype.dispose.call(this)},x.prototype.parse=function(b){var S=this._bufferService.buffer,C=S.x,g=S.y;if(this._logService.debug("parsing data",b),this._parseBuffer.length<b.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(b.length,131072))),this._dirtyRowService.clearRange(),b.length>131072)for(var M=0;M<b.length;M+=131072){var I=M+131072<b.length?M+131072:b.length,P=typeof b=="string"?this._stringDecoder.decode(b.substring(M,I),this._parseBuffer):this._utf8Decoder.decode(b.subarray(M,I),this._parseBuffer);this._parser.parse(this._parseBuffer,P)}else P=typeof b=="string"?this._stringDecoder.decode(b,this._parseBuffer):this._utf8Decoder.decode(b,this._parseBuffer),this._parser.parse(this._parseBuffer,P);(S=this._bufferService.buffer).x===C&&S.y===g||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},x.prototype.print=function(b,S,C){var g,M,I=this._bufferService.buffer,P=this._charsetService.charset,B=this._optionsService.options.screenReaderMode,H=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,W=this._coreService.modes.insertMode,U=this._curAttrData,K=I.lines.get(I.ybase+I.y);this._dirtyRowService.markDirty(I.y),I.x&&C-S>0&&K.getWidth(I.x-1)===2&&K.setCellFromCodePoint(I.x-1,0,1,U.fg,U.bg,U.extended);for(var G=S;G<C;++G){if(g=b[G],M=this._unicodeService.wcwidth(g),g<127&&P){var ee=P[String.fromCharCode(g)];ee&&(g=ee.charCodeAt(0))}if(B&&this._onA11yChar.fire(d.stringFromCodePoint(g)),M||!I.x){if(I.x+M-1>=H){if(F){for(;I.x<H;)K.setCellFromCodePoint(I.x++,0,1,U.fg,U.bg,U.extended);I.x=0,I.y++,I.y===I.scrollBottom+1?(I.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(I.y>=this._bufferService.rows&&(I.y=this._bufferService.rows-1),I.lines.get(I.ybase+I.y).isWrapped=!0),K=I.lines.get(I.ybase+I.y)}else if(I.x=H-1,M===2)continue}if(W&&(K.insertCells(I.x,M,I.getNullCell(U),U),K.getWidth(H-1)===2&&K.setCellFromCodePoint(H-1,r.NULL_CELL_CODE,r.NULL_CELL_WIDTH,U.fg,U.bg,U.extended)),K.setCellFromCodePoint(I.x++,g,M,U.fg,U.bg,U.extended),M>0)for(;--M;)K.setCellFromCodePoint(I.x++,0,0,U.fg,U.bg,U.extended)}else K.getWidth(I.x-1)?K.addCodepointToCell(I.x-1,g):K.addCodepointToCell(I.x-2,g)}C-S>0&&(K.loadCell(I.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),I.x<H&&C-S>0&&K.getWidth(I.x)===0&&!K.hasContent(I.x)&&K.setCellFromCodePoint(I.x,0,1,U.fg,U.bg,U.extended),this._dirtyRowService.markDirty(I.y)},x.prototype.addCsiHandler=function(b,S){var C=this;return b.final!=="t"||b.prefix||b.intermediates?this._parser.addCsiHandler(b,S):this._parser.addCsiHandler(b,function(g){return!w(g.params[0],C._optionsService.options.windowOptions)||S(g)})},x.prototype.addDcsHandler=function(b,S){return this._parser.addDcsHandler(b,new f.DcsHandler(S))},x.prototype.addEscHandler=function(b,S){return this._parser.addEscHandler(b,S)},x.prototype.addOscHandler=function(b,S){return this._parser.addOscHandler(b,new i.OscHandler(S))},x.prototype.bell=function(){this._onRequestBell.fire()},x.prototype.lineFeed=function(){var b=this._bufferService.buffer;this._dirtyRowService.markDirty(b.y),this._optionsService.options.convertEol&&(b.x=0),b.y++,b.y===b.scrollBottom+1?(b.y--,this._onRequestScroll.fire(this._eraseAttrData())):b.y>=this._bufferService.rows&&(b.y=this._bufferService.rows-1),b.x>=this._bufferService.cols&&b.x--,this._dirtyRowService.markDirty(b.y),this._onLineFeed.fire()},x.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},x.prototype.backspace=function(){var b,S=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(S.x>0&&S.x--);if(this._restrictCursor(this._bufferService.cols),S.x>0)S.x--;else if(S.x===0&&S.y>S.scrollTop&&S.y<=S.scrollBottom&&((b=S.lines.get(S.ybase+S.y))===null||b===void 0?void 0:b.isWrapped)){S.lines.get(S.ybase+S.y).isWrapped=!1,S.y--,S.x=this._bufferService.cols-1;var C=S.lines.get(S.ybase+S.y);C.hasWidth(S.x)&&!C.hasContent(S.x)&&S.x--}this._restrictCursor()},x.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var b=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-b)}},x.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},x.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},x.prototype._restrictCursor=function(b){b===void 0&&(b=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(b,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)},x.prototype._setCursor=function(b,S){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=b,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+S):(this._bufferService.buffer.x=b,this._bufferService.buffer.y=S),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},x.prototype._moveCursor=function(b,S){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+b,this._bufferService.buffer.y+S)},x.prototype.cursorUp=function(b){var S=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;S>=0?this._moveCursor(0,-Math.min(S,b.params[0]||1)):this._moveCursor(0,-(b.params[0]||1))},x.prototype.cursorDown=function(b){var S=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;S>=0?this._moveCursor(0,Math.min(S,b.params[0]||1)):this._moveCursor(0,b.params[0]||1)},x.prototype.cursorForward=function(b){this._moveCursor(b.params[0]||1,0)},x.prototype.cursorBackward=function(b){this._moveCursor(-(b.params[0]||1),0)},x.prototype.cursorNextLine=function(b){this.cursorDown(b),this._bufferService.buffer.x=0},x.prototype.cursorPrecedingLine=function(b){this.cursorUp(b),this._bufferService.buffer.x=0},x.prototype.cursorCharAbsolute=function(b){this._setCursor((b.params[0]||1)-1,this._bufferService.buffer.y)},x.prototype.cursorPosition=function(b){this._setCursor(b.length>=2?(b.params[1]||1)-1:0,(b.params[0]||1)-1)},x.prototype.charPosAbsolute=function(b){this._setCursor((b.params[0]||1)-1,this._bufferService.buffer.y)},x.prototype.hPositionRelative=function(b){this._moveCursor(b.params[0]||1,0)},x.prototype.linePosAbsolute=function(b){this._setCursor(this._bufferService.buffer.x,(b.params[0]||1)-1)},x.prototype.vPositionRelative=function(b){this._moveCursor(0,b.params[0]||1)},x.prototype.hVPosition=function(b){this.cursorPosition(b)},x.prototype.tabClear=function(b){var S=b.params[0];S===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:S===3&&(this._bufferService.buffer.tabs={})},x.prototype.cursorForwardTab=function(b){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var S=b.params[0]||1;S--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},x.prototype.cursorBackwardTab=function(b){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var S=b.params[0]||1,C=this._bufferService.buffer;S--;)C.x=C.prevStop()},x.prototype._eraseInBufferLine=function(b,S,C,g){g===void 0&&(g=!1);var M=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+b);M.replaceCells(S,C,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),g&&(M.isWrapped=!1)},x.prototype._resetBufferLine=function(b){var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+b);S.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),S.isWrapped=!1},x.prototype.eraseInDisplay=function(b){var S;switch(this._restrictCursor(),b.params[0]){case 0:for(S=this._bufferService.buffer.y,this._dirtyRowService.markDirty(S),this._eraseInBufferLine(S++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);S<this._bufferService.rows;S++)this._resetBufferLine(S);this._dirtyRowService.markDirty(S);break;case 1:for(S=this._bufferService.buffer.y,this._dirtyRowService.markDirty(S),this._eraseInBufferLine(S,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(S+1).isWrapped=!1);S--;)this._resetBufferLine(S);this._dirtyRowService.markDirty(0);break;case 2:for(S=this._bufferService.rows,this._dirtyRowService.markDirty(S-1);S--;)this._resetBufferLine(S);this._dirtyRowService.markDirty(0);break;case 3:var C=this._bufferService.buffer.lines.length-this._bufferService.rows;C>0&&(this._bufferService.buffer.lines.trimStart(C),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-C,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-C,0),this._onScroll.fire(0))}},x.prototype.eraseInLine=function(b){switch(this._restrictCursor(),b.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)},x.prototype.insertLines=function(b){this._restrictCursor();var S=b.params[0]||1,C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var g=C.ybase+C.y,M=this._bufferService.rows-1-C.scrollBottom,I=this._bufferService.rows-1+C.ybase-M+1;S--;)C.lines.splice(I-1,1),C.lines.splice(g,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.y,C.scrollBottom),C.x=0}},x.prototype.deleteLines=function(b){this._restrictCursor();var S=b.params[0]||1,C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){var g,M=C.ybase+C.y;for(g=this._bufferService.rows-1-C.scrollBottom,g=this._bufferService.rows-1+C.ybase-g;S--;)C.lines.splice(M,1),C.lines.splice(g,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.y,C.scrollBottom),C.x=0}},x.prototype.insertChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.insertCells(this._bufferService.buffer.x,b.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.deleteChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.deleteCells(this._bufferService.buffer.x,b.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.scrollUp=function(b){for(var S=b.params[0]||1,C=this._bufferService.buffer;S--;)C.lines.splice(C.ybase+C.scrollTop,1),C.lines.splice(C.ybase+C.scrollBottom,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)},x.prototype.scrollDown=function(b){for(var S=b.params[0]||1,C=this._bufferService.buffer;S--;)C.lines.splice(C.ybase+C.scrollBottom,1),C.lines.splice(C.ybase+C.scrollTop,0,C.getBlankLine(s.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)},x.prototype.scrollLeft=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var C=b.params[0]||1,g=S.scrollTop;g<=S.scrollBottom;++g){var M=S.lines.get(S.ybase+g);M.deleteCells(0,C,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.scrollRight=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var C=b.params[0]||1,g=S.scrollTop;g<=S.scrollBottom;++g){var M=S.lines.get(S.ybase+g);M.insertCells(0,C,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.insertColumns=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var C=b.params[0]||1,g=S.scrollTop;g<=S.scrollBottom;++g){var M=this._bufferService.buffer.lines.get(S.ybase+g);M.insertCells(S.x,C,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.deleteColumns=function(b){var S=this._bufferService.buffer;if(!(S.y>S.scrollBottom||S.y<S.scrollTop)){for(var C=b.params[0]||1,g=S.scrollTop;g<=S.scrollBottom;++g){var M=S.lines.get(S.ybase+g);M.deleteCells(S.x,C,S.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom)}},x.prototype.eraseChars=function(b){this._restrictCursor();var S=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);S&&(S.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(b.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},x.prototype.repeatPrecedingCharacter=function(b){if(this._parser.precedingCodepoint){for(var S=b.params[0]||1,C=new Uint32Array(S),g=0;g<S;++g)C[g]=this._parser.precedingCodepoint;this.print(C,0,C.length)}},x.prototype.sendDeviceAttributesPrimary=function(b){b.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"))},x.prototype.sendDeviceAttributesSecondary=function(b){b.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(b.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.C0.ESC+"[>83;40003;0c"))},x.prototype._is=function(b){return(this._optionsService.options.termName+"").indexOf(b)===0},x.prototype.setMode=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 4:this._coreService.modes.insertMode=!0}},x.prototype.setModePrivate=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.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}},x.prototype.resetMode=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){case 4:this._coreService.modes.insertMode=!1}},x.prototype.resetModePrivate=function(b){for(var S=0;S<b.length;S++)switch(b.params[S]){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(),b.params[S]===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}},x.prototype._updateAttrColor=function(b,S,C,g,M){return S===2?(b|=50331648,b&=-16777216,b|=a.AttributeData.fromColorRGB([C,g,M])):S===5&&(b&=-50331904,b|=33554432|255&C),b},x.prototype._extractColor=function(b,S,C){var g=[0,0,-1,0,0,0],M=0,I=0;do{if(g[I+M]=b.params[S+I],b.hasSubParams(S+I)){var P=b.getSubParams(S+I),B=0;do g[1]===5&&(M=1),g[I+B+1+M]=P[B];while(++B<P.length&&B+I+1+M<g.length);break}if(g[1]===5&&I+M>=2||g[1]===2&&I+M>=5)break;g[1]&&(M=1)}while(++I+S<b.length&&I+M<g.length);for(B=2;B<g.length;++B)g[B]===-1&&(g[B]=0);switch(g[0]){case 38:C.fg=this._updateAttrColor(C.fg,g[1],g[3],g[4],g[5]);break;case 48:C.bg=this._updateAttrColor(C.bg,g[1],g[3],g[4],g[5]);break;case 58:C.extended=C.extended.clone(),C.extended.underlineColor=this._updateAttrColor(C.extended.underlineColor,g[1],g[3],g[4],g[5])}return I},x.prototype._processUnderline=function(b,S){S.extended=S.extended.clone(),(!~b||b>5)&&(b=1),S.extended.underlineStyle=b,S.fg|=268435456,b===0&&(S.fg&=-268435457),S.updateExtended()},x.prototype.charAttributes=function(b){if(b.length===1&&b.params[0]===0)return this._curAttrData.fg=s.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=s.DEFAULT_ATTR_DATA.bg);for(var S,C=b.length,g=this._curAttrData,M=0;M<C;M++)(S=b.params[M])>=30&&S<=37?(g.fg&=-50331904,g.fg|=16777216|S-30):S>=40&&S<=47?(g.bg&=-50331904,g.bg|=16777216|S-40):S>=90&&S<=97?(g.fg&=-50331904,g.fg|=16777224|S-90):S>=100&&S<=107?(g.bg&=-50331904,g.bg|=16777224|S-100):S===0?(g.fg=s.DEFAULT_ATTR_DATA.fg,g.bg=s.DEFAULT_ATTR_DATA.bg):S===1?g.fg|=134217728:S===3?g.bg|=67108864:S===4?(g.fg|=268435456,this._processUnderline(b.hasSubParams(M)?b.getSubParams(M)[0]:1,g)):S===5?g.fg|=536870912:S===7?g.fg|=67108864:S===8?g.fg|=1073741824:S===2?g.bg|=134217728:S===21?this._processUnderline(2,g):S===22?(g.fg&=-134217729,g.bg&=-134217729):S===23?g.bg&=-67108865:S===24?g.fg&=-268435457:S===25?g.fg&=-536870913:S===27?g.fg&=-67108865:S===28?g.fg&=-1073741825:S===39?(g.fg&=-67108864,g.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):S===49?(g.bg&=-67108864,g.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):S===38||S===48||S===58?M+=this._extractColor(b,M,g):S===59?(g.extended=g.extended.clone(),g.extended.underlineColor=-1,g.updateExtended()):S===100?(g.fg&=-67108864,g.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,g.bg&=-67108864,g.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",S)},x.prototype.deviceStatus=function(b){switch(b.params[0]){case 5:this._coreService.triggerDataEvent(E.C0.ESC+"[0n");break;case 6:var S=this._bufferService.buffer.y+1,C=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"["+S+";"+C+"R")}},x.prototype.deviceStatusPrivate=function(b){switch(b.params[0]){case 6:var S=this._bufferService.buffer.y+1,C=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(E.C0.ESC+"[?"+S+";"+C+"R")}},x.prototype.softReset=function(b){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.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},x.prototype.setCursorStyle=function(b){var S=b.params[0]||1;switch(S){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 C=S%2==1;this._optionsService.options.cursorBlink=C},x.prototype.setScrollRegion=function(b){var S,C=b.params[0]||1;(b.length<2||(S=b.params[1])>this._bufferService.rows||S===0)&&(S=this._bufferService.rows),S>C&&(this._bufferService.buffer.scrollTop=C-1,this._bufferService.buffer.scrollBottom=S-1,this._setCursor(0,0))},x.prototype.windowOptions=function(b){if(w(b.params[0],this._optionsService.options.windowOptions)){var S=b.length>1?b.params[1]:0;switch(b.params[0]){case 14:S!==2&&this._onRequestWindowsOptionsReport.fire(c.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(c.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:S!==0&&S!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),S!==0&&S!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:S!==0&&S!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),S!==0&&S!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},x.prototype.saveCursor=function(b){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},x.prototype.restoreCursor=function(b){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()},x.prototype.setTitle=function(b){this._windowTitle=b,this._onTitleChange.fire(b)},x.prototype.setIconName=function(b){this._iconName=b},x.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},x.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},x.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},x.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET)},x.prototype.selectCharset=function(b){b.length===2?b[0]!=="/"&&this._charsetService.setgCharset(h[b[0]],y.CHARSETS[b[1]]||y.DEFAULT_CHARSET):this.selectDefaultCharset()},x.prototype.index=function(){this._restrictCursor();var b=this._bufferService.buffer;this._bufferService.buffer.y++,b.y===b.scrollBottom+1?(b.y--,this._onRequestScroll.fire(this._eraseAttrData())):b.y>=this._bufferService.rows&&(b.y=this._bufferService.rows-1),this._restrictCursor()},x.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},x.prototype.reverseIndex=function(){this._restrictCursor();var b=this._bufferService.buffer;if(b.y===b.scrollTop){var S=b.scrollBottom-b.scrollTop;b.lines.shiftElements(b.ybase+b.y,S,1),b.lines.set(b.ybase+b.y,b.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(b.scrollTop,b.scrollBottom)}else b.y--,this._restrictCursor()},x.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},x.prototype.reset=function(){this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()},x.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},x.prototype.setgLevel=function(b){this._charsetService.setgLevel(b)},x.prototype.screenAlignmentPattern=function(){var b=new n.CellData;b.content=1<<22|"E".charCodeAt(0),b.fg=this._curAttrData.fg,b.bg=this._curAttrData.bg;var S=this._bufferService.buffer;this._setCursor(0,0);for(var C=0;C<this._bufferService.rows;++C){var g=S.ybase+S.y+C,M=S.lines.get(g);M&&(M.fill(b),M.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},x}(u.Disposable);k.InputHandler=T},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DEFAULT_CHARSET=k.CHARSETS=void 0,k.CHARSETS={},k.DEFAULT_CHARSET=k.CHARSETS.B,k.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"},k.CHARSETS.A={"#":"\xA3"},k.CHARSETS.B=void 0,k.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},k.CHARSETS.C=k.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},k.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},k.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},k.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},k.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},k.CHARSETS.E=k.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},k.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},k.CHARSETS.H=k.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},k.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Params=void 0;var R=function(){function O(c,E){if(c===void 0&&(c=32),E===void 0&&(E=32),this.maxLength=c,this.maxSubParamsLength=E,E>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(c),this.length=0,this._subParams=new Int32Array(E),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(c),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return O.fromArray=function(c){var E=new O;if(!c.length)return E;for(var y=c[0]instanceof Array?1:0;y<c.length;++y){var p=c[y];if(p instanceof Array)for(var u=0;u<p.length;++u)E.addSubParam(p[u]);else E.addParam(p)}return E},O.prototype.clone=function(){var c=new O(this.maxLength,this.maxSubParamsLength);return c.params.set(this.params),c.length=this.length,c._subParams.set(this._subParams),c._subParamsLength=this._subParamsLength,c._subParamsIdx.set(this._subParamsIdx),c._rejectDigits=this._rejectDigits,c._rejectSubDigits=this._rejectSubDigits,c._digitIsSub=this._digitIsSub,c},O.prototype.toArray=function(){for(var c=[],E=0;E<this.length;++E){c.push(this.params[E]);var y=this._subParamsIdx[E]>>8,p=255&this._subParamsIdx[E];p-y>0&&c.push(Array.prototype.slice.call(this._subParams,y,p))}return c},O.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},O.prototype.addParam=function(c){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=c>2147483647?2147483647:c}},O.prototype.addSubParam=function(c){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(c<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=c>2147483647?2147483647:c,this._subParamsIdx[this.length-1]++}},O.prototype.hasSubParams=function(c){return(255&this._subParamsIdx[c])-(this._subParamsIdx[c]>>8)>0},O.prototype.getSubParams=function(c){var E=this._subParamsIdx[c]>>8,y=255&this._subParamsIdx[c];return y-E>0?this._subParams.subarray(E,y):null},O.prototype.getSubParamsAll=function(){for(var c={},E=0;E<this.length;++E){var y=this._subParamsIdx[E]>>8,p=255&this._subParamsIdx[E];p-y>0&&(c[E]=this._subParams.slice(y,p))}return c},O.prototype.addDigit=function(c){var E;if(!(this._rejectDigits||!(E=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var y=this._digitIsSub?this._subParams:this.params,p=y[E-1];y[E-1]=~p?Math.min(10*p+c,2147483647):c}},O}();k.Params=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.OscHandler=k.OscParser=void 0;var R=D(23),O=D(8),c=function(){function y(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return y.prototype.addHandler=function(p,u){this._handlers[p]===void 0&&(this._handlers[p]=[]);var o=this._handlers[p];return o.push(u),{dispose:function(){var d=o.indexOf(u);d!==-1&&o.splice(d,1)}}},y.prototype.setHandler=function(p,u){this._handlers[p]=[u]},y.prototype.clearHandler=function(p){this._handlers[p]&&delete this._handlers[p]},y.prototype.setHandlerFallback=function(p){this._handlerFb=p},y.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},y.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},y.prototype._start=function(){var p=this._handlers[this._id];if(p)for(var u=p.length-1;u>=0;u--)p[u].start();else this._handlerFb(this._id,"START")},y.prototype._put=function(p,u,o){var d=this._handlers[this._id];if(d)for(var s=d.length-1;s>=0;s--)d[s].put(p,u,o);else this._handlerFb(this._id,"PUT",O.utf32ToString(p,u,o))},y.prototype._end=function(p){var u=this._handlers[this._id];if(u){for(var o=u.length-1;o>=0&&u[o].end(p)===!1;o--);for(o--;o>=0;o--)u[o].end(!1)}else this._handlerFb(this._id,"END",p)},y.prototype.start=function(){this.reset(),this._id=-1,this._state=1},y.prototype.put=function(p,u,o){if(this._state!==3){if(this._state===1)for(;u<o;){var d=p[u++];if(d===59){this._state=2,this._start();break}if(d<48||57<d)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+d-48}this._state===2&&o-u>0&&this._put(p,u,o)}},y.prototype.end=function(p){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(p)),this._id=-1,this._state=0)},y}();k.OscParser=c;var E=function(){function y(p){this._handler=p,this._data="",this._hitLimit=!1}return y.prototype.start=function(){this._data="",this._hitLimit=!1},y.prototype.put=function(p,u,o){this._hitLimit||(this._data+=O.utf32ToString(p,u,o),this._data.length>R.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},y.prototype.end=function(p){var u;return this._hitLimit?u=!1:p&&(u=this._handler(this._data)),this._data="",this._hitLimit=!1,u},y}();k.OscHandler=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.PAYLOAD_LIMIT=void 0,k.PAYLOAD_LIMIT=1e7},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DcsHandler=k.DcsParser=void 0;var R=D(8),O=D(21),c=D(23),E=[],y=function(){function u(){this._handlers=Object.create(null),this._active=E,this._ident=0,this._handlerFb=function(){}}return u.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},u.prototype.addHandler=function(o,d){this._handlers[o]===void 0&&(this._handlers[o]=[]);var s=this._handlers[o];return s.push(d),{dispose:function(){var l=s.indexOf(d);l!==-1&&s.splice(l,1)}}},u.prototype.setHandler=function(o,d){this._handlers[o]=[d]},u.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},u.prototype.setHandlerFallback=function(o){this._handlerFb=o},u.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=E,this._ident=0},u.prototype.hook=function(o,d){if(this.reset(),this._ident=o,this._active=this._handlers[o]||E,this._active.length)for(var s=this._active.length-1;s>=0;s--)this._active[s].hook(d);else this._handlerFb(this._ident,"HOOK",d)},u.prototype.put=function(o,d,s){if(this._active.length)for(var l=this._active.length-1;l>=0;l--)this._active[l].put(o,d,s);else this._handlerFb(this._ident,"PUT",R.utf32ToString(o,d,s))},u.prototype.unhook=function(o){if(this._active.length){for(var d=this._active.length-1;d>=0&&this._active[d].unhook(o)===!1;d--);for(d--;d>=0;d--)this._active[d].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",o);this._active=E,this._ident=0},u}();k.DcsParser=y;var p=function(){function u(o){this._handler=o,this._data="",this._hitLimit=!1}return u.prototype.hook=function(o){this._params=o.clone(),this._data="",this._hitLimit=!1},u.prototype.put=function(o,d,s){this._hitLimit||(this._data+=R.utf32ToString(o,d,s),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},u.prototype.unhook=function(o){var d;return this._hitLimit?d=!1:o&&(d=this._handler(this._data,this._params||new O.Params)),this._params=void 0,this._data="",this._hitLimit=!1,d},u}();k.DcsHandler=p},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.removeTerminalFromCache=k.acquireCharAtlas=void 0;var R=D(26),O=D(43),c=[];k.acquireCharAtlas=function(E,y,p,u,o){for(var d=R.generateConfig(u,o,E,p),s=0;s<c.length;s++){var l=(r=c[s]).ownedBy.indexOf(y);if(l>=0){if(R.configEquals(r.config,d))return r.atlas;r.ownedBy.length===1?(r.atlas.dispose(),c.splice(s,1)):r.ownedBy.splice(l,1);break}}for(s=0;s<c.length;s++){var r=c[s];if(R.configEquals(r.config,d))return r.ownedBy.push(y),r.atlas}var n={atlas:new O.DynamicCharAtlas(document,d),config:d,ownedBy:[y]};return c.push(n),n.atlas},k.removeTerminalFromCache=function(E){for(var y=0;y<c.length;y++){var p=c[y].ownedBy.indexOf(E);if(p!==-1){c[y].ownedBy.length===1?(c[y].atlas.dispose(),c.splice(y,1)):c[y].ownedBy.splice(p,1);break}}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.is256Color=k.configEquals=k.generateConfig=void 0;var R=D(3);k.generateConfig=function(O,c,E,y){var p={foreground:y.foreground,background:y.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:y.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:O,scaledCharHeight:c,fontFamily:E.fontFamily,fontSize:E.fontSize,fontWeight:E.fontWeight,fontWeightBold:E.fontWeightBold,allowTransparency:E.allowTransparency,colors:p}},k.configEquals=function(O,c){for(var E=0;E<O.colors.ansi.length;E++)if(O.colors.ansi[E].rgba!==c.colors.ansi[E].rgba)return!1;return O.devicePixelRatio===c.devicePixelRatio&&O.fontFamily===c.fontFamily&&O.fontSize===c.fontSize&&O.fontWeight===c.fontWeight&&O.fontWeightBold===c.fontWeightBold&&O.allowTransparency===c.allowTransparency&&O.scaledCharWidth===c.scaledCharWidth&&O.scaledCharHeight===c.scaledCharHeight&&O.colors.foreground===c.colors.foreground&&O.colors.background===c.colors.background},k.is256Color=function(O){return O<R.DEFAULT_COLOR}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ColorManager=k.DEFAULT_ANSI_COLORS=void 0;var R=D(10),O=D(45),c=R.css.toColor("#ffffff"),E=R.css.toColor("#000000"),y=R.css.toColor("#ffffff"),p=R.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};k.DEFAULT_ANSI_COLORS=function(){for(var d=[R.css.toColor("#2e3436"),R.css.toColor("#cc0000"),R.css.toColor("#4e9a06"),R.css.toColor("#c4a000"),R.css.toColor("#3465a4"),R.css.toColor("#75507b"),R.css.toColor("#06989a"),R.css.toColor("#d3d7cf"),R.css.toColor("#555753"),R.css.toColor("#ef2929"),R.css.toColor("#8ae234"),R.css.toColor("#fce94f"),R.css.toColor("#729fcf"),R.css.toColor("#ad7fa8"),R.css.toColor("#34e2e2"),R.css.toColor("#eeeeec")],s=[0,95,135,175,215,255],l=0;l<216;l++){var r=s[l/36%6|0],n=s[l/6%6|0],a=s[l%6];d.push({css:R.channels.toCss(r,n,a),rgba:R.channels.toRgba(r,n,a)})}for(l=0;l<24;l++){var i=8+10*l;d.push({css:R.channels.toCss(i,i,i),rgba:R.channels.toRgba(i,i,i)})}return d}();var o=function(){function d(s,l){this.allowTransparency=l;var r=s.createElement("canvas");r.width=1,r.height=1;var n=r.getContext("2d");if(!n)throw new Error("Could not get rendering context");this._ctx=n,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new O.ColorContrastCache,this.colors={foreground:c,background:E,cursor:y,cursorAccent:p,selectionTransparent:u,selectionOpaque:R.color.blend(E,u),ansi:k.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return d.prototype.onOptionsChange=function(s){s==="minimumContrastRatio"&&this._contrastCache.clear()},d.prototype.setTheme=function(s){(s===void 0&&(s={}),this.colors.foreground=this._parseColor(s.foreground,c),this.colors.background=this._parseColor(s.background,E),this.colors.cursor=this._parseColor(s.cursor,y,!0),this.colors.cursorAccent=this._parseColor(s.cursorAccent,p,!0),this.colors.selectionTransparent=this._parseColor(s.selection,u,!0),this.colors.selectionOpaque=R.color.blend(this.colors.background,this.colors.selectionTransparent),R.color.isOpaque(this.colors.selectionTransparent))&&(this.colors.selectionTransparent=R.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(s.black,k.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(s.red,k.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(s.green,k.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(s.yellow,k.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(s.blue,k.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(s.magenta,k.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(s.cyan,k.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(s.white,k.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(s.brightBlack,k.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(s.brightRed,k.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(s.brightGreen,k.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(s.brightYellow,k.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(s.brightBlue,k.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(s.brightMagenta,k.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(s.brightCyan,k.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(s.brightWhite,k.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},d.prototype._parseColor=function(s,l,r){if(r===void 0&&(r=this.allowTransparency),s===void 0)return l;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=s,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+s+" is invalid using fallback "+l.css),l;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;if(n[3]!==255){if(!r)return console.warn("Color: "+s+" is using transparency, but allowTransparency is false. Using fallback "+l.css+"."),l;var a=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(T){return Number(T)}),i=a[0],f=a[1],h=a[2],w=a[3],m=Math.round(255*w);return{rgba:R.channels.toRgba(i,f,h,m),css:s}}return{css:this._ctx.fillStyle,rgba:R.channels.toRgba(n[0],n[1],n[2],n[3])}},d}();k.ColorManager=o},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.throwIfFalsy=void 0,k.throwIfFalsy=function(R){if(!R)throw new Error("value must not be falsy");return R}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(o,d){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,l){s.__proto__=l}||function(s,l){for(var r in l)l.hasOwnProperty(r)&&(s[r]=l[r])})(o,d)},function(o,d){function s(){this.constructor=o}R(o,d),o.prototype=d===null?Object.create(d):(s.prototype=d.prototype,new s)});Object.defineProperty(k,"__esModule",{value:!0}),k.CharacterJoinerRegistry=k.JoinedCellData=void 0;var c=D(6),E=D(3),y=D(4),p=function(o){function d(s,l,r){var n=o.call(this)||this;return n.content=0,n.combinedData="",n.fg=s.fg,n.bg=s.bg,n.combinedData=l,n._width=r,n}return O(d,o),d.prototype.isCombined=function(){return 2097152},d.prototype.getWidth=function(){return this._width},d.prototype.getChars=function(){return this.combinedData},d.prototype.getCode=function(){return 2097151},d.prototype.setFromCharData=function(s){throw new Error("not implemented")},d.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},d}(c.AttributeData);k.JoinedCellData=p;var u=function(){function o(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}return o.prototype.registerCharacterJoiner=function(d){var s={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(s),s.id},o.prototype.deregisterCharacterJoiner=function(d){for(var s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===d)return this._characterJoiners.splice(s,1),!0;return!1},o.prototype.getJoinedCharacters=function(d){if(this._characterJoiners.length===0)return[];var s=this._bufferService.buffer.lines.get(d);if(!s||s.length===0)return[];for(var l=[],r=s.translateToString(!0),n=0,a=0,i=0,f=s.getFg(0),h=s.getBg(0),w=0;w<s.getTrimmedLength();w++)if(s.loadCell(w,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==f||this._workCell.bg!==h){if(w-n>1)for(var m=this._getJoinedRanges(r,i,a,s,n),T=0;T<m.length;T++)l.push(m[T]);n=w,i=a,f=this._workCell.fg,h=this._workCell.bg}a+=this._workCell.getChars().length||E.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-n>1)for(m=this._getJoinedRanges(r,i,a,s,n),T=0;T<m.length;T++)l.push(m[T]);return l},o.prototype._getJoinedRanges=function(d,s,l,r,n){for(var a=d.substring(s,l),i=this._characterJoiners[0].handler(a),f=1;f<this._characterJoiners.length;f++)for(var h=this._characterJoiners[f].handler(a),w=0;w<h.length;w++)o._mergeRanges(i,h[w]);return this._stringRangesToCellRanges(i,r,n),i},o.prototype._stringRangesToCellRanges=function(d,s,l){var r=0,n=!1,a=0,i=d[r];if(i){for(var f=l;f<this._bufferService.cols;f++){var h=s.getWidth(f),w=s.getString(f).length||E.WHITESPACE_CELL_CHAR.length;if(h!==0){if(!n&&i[0]<=a&&(i[0]=f,n=!0),i[1]<=a){if(i[1]=f,!(i=d[++r]))break;i[0]<=a?(i[0]=f,n=!0):n=!1}a+=w}}i&&(i[1]=this._bufferService.cols)}},o._mergeRanges=function(d,s){for(var l=!1,r=0;r<d.length;r++){var n=d[r];if(l){if(s[1]<=n[0])return d[r-1][1]=s[1],d;if(s[1]<=n[1])return d[r-1][1]=Math.max(s[1],n[1]),d.splice(r,1),d;d.splice(r,1),r--}else{if(s[1]<=n[0])return d.splice(r,0,s),d;if(s[1]<=n[1])return n[0]=Math.min(s[0],n[0]),d;s[0]<n[1]&&(n[0]=Math.min(s[0],n[0]),l=!0)}}return l?d[d.length-1][1]=s[1]:d.push(s),d},o}();k.CharacterJoinerRegistry=u},function(j,k,D){"use strict";function R(O,c){var E=c.getBoundingClientRect();return[O.clientX-E.left,O.clientY-E.top]}Object.defineProperty(k,"__esModule",{value:!0}),k.getRawByteCoords=k.getCoords=k.getCoordsRelativeToElement=void 0,k.getCoordsRelativeToElement=R,k.getCoords=function(O,c,E,y,p,u,o,d){if(p){var s=R(O,c);if(s)return s[0]=Math.ceil((s[0]+(d?u/2:0))/u),s[1]=Math.ceil(s[1]/o),s[0]=Math.min(Math.max(s[0],1),E+(d?1:0)),s[1]=Math.min(Math.max(s[1],1),y),s}},k.getRawByteCoords=function(O){if(O)return{x:O[0]+32,y:O[1]+32}}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.RenderDebouncer=void 0;var R=function(){function O(c){this._renderCallback=c}return O.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},O.prototype.refresh=function(c,E,y){var p=this;this._rowCount=y,c=c!==void 0?c:0,E=E!==void 0?E:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,E):E,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return p._innerRefresh()}))},O.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var c=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(c,E)}},O}();k.RenderDebouncer=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(E,y){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var o in u)u.hasOwnProperty(o)&&(p[o]=u[o])})(E,y)},function(E,y){function p(){this.constructor=E}R(E,y),E.prototype=y===null?Object.create(y):(p.prototype=y.prototype,new p)});Object.defineProperty(k,"__esModule",{value:!0}),k.ScreenDprMonitor=void 0;var c=function(E){function y(){var p=E!==null&&E.apply(this,arguments)||this;return p._currentDevicePixelRatio=window.devicePixelRatio,p}return O(y,E),y.prototype.setListener=function(p){var u=this;this._listener&&this.clearListener(),this._listener=p,this._outerListener=function(){u._listener&&(u._listener(window.devicePixelRatio,u._currentDevicePixelRatio),u._updateDpr())},this._updateDpr()},y.prototype.dispose=function(){E.prototype.dispose.call(this),this.clearListener()},y.prototype._updateDpr=function(){var p;this._outerListener&&((p=this._resolutionMediaMatchList)===null||p===void 0||p.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},y.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)},y}(D(2).Disposable);k.ScreenDprMonitor=c},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.clone=void 0,k.clone=function R(O,c){if(c===void 0&&(c=5),typeof O!="object")return O;var E=Array.isArray(O)?[]:{};for(var y in O)E[y]=c<=1?O[y]:O[y]?R(O[y],c-1):O[y];return E}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;var R=D(4),O=D(35),c=D(18),E=D(0),y=D(83),p=function(){function r(n){this._core=new O.Terminal(n),this._addonManager=new y.AddonManager}return r.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(r.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new s(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"unicode",{get:function(){return this._checkProposedApi(),new l(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._checkProposedApi(),new o(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),r.prototype.blur=function(){this._core.blur()},r.prototype.focus=function(){this._core.focus()},r.prototype.resize=function(n,a){this._verifyIntegers(n,a),this._core.resize(n,a)},r.prototype.open=function(n){this._core.open(n)},r.prototype.attachCustomKeyEventHandler=function(n){this._core.attachCustomKeyEventHandler(n)},r.prototype.registerLinkMatcher=function(n,a,i){return this._checkProposedApi(),this._core.registerLinkMatcher(n,a,i)},r.prototype.deregisterLinkMatcher=function(n){this._checkProposedApi(),this._core.deregisterLinkMatcher(n)},r.prototype.registerLinkProvider=function(n){return this._checkProposedApi(),this._core.registerLinkProvider(n)},r.prototype.registerCharacterJoiner=function(n){return this._checkProposedApi(),this._core.registerCharacterJoiner(n)},r.prototype.deregisterCharacterJoiner=function(n){this._checkProposedApi(),this._core.deregisterCharacterJoiner(n)},r.prototype.registerMarker=function(n){return this._checkProposedApi(),this._verifyIntegers(n),this._core.addMarker(n)},r.prototype.addMarker=function(n){return this.registerMarker(n)},r.prototype.hasSelection=function(){return this._core.hasSelection()},r.prototype.select=function(n,a,i){this._verifyIntegers(n,a,i),this._core.select(n,a,i)},r.prototype.getSelection=function(){return this._core.getSelection()},r.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},r.prototype.clearSelection=function(){this._core.clearSelection()},r.prototype.selectAll=function(){this._core.selectAll()},r.prototype.selectLines=function(n,a){this._verifyIntegers(n,a),this._core.selectLines(n,a)},r.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},r.prototype.scrollLines=function(n){this._verifyIntegers(n),this._core.scrollLines(n)},r.prototype.scrollPages=function(n){this._verifyIntegers(n),this._core.scrollPages(n)},r.prototype.scrollToTop=function(){this._core.scrollToTop()},r.prototype.scrollToBottom=function(){this._core.scrollToBottom()},r.prototype.scrollToLine=function(n){this._verifyIntegers(n),this._core.scrollToLine(n)},r.prototype.clear=function(){this._core.clear()},r.prototype.write=function(n,a){this._core.write(n,a)},r.prototype.writeUtf8=function(n,a){this._core.write(n,a)},r.prototype.writeln=function(n,a){this._core.write(n),this._core.write(`\r
|
|
|
`,a)},r.prototype.paste=function(n){this._core.paste(n)},r.prototype.getOption=function(n){return this._core.optionsService.getOption(n)},r.prototype.setOption=function(n,a){this._core.optionsService.setOption(n,a)},r.prototype.refresh=function(n,a){this._verifyIntegers(n,a),this._core.refresh(n,a)},r.prototype.reset=function(){this._core.reset()},r.prototype.loadAddon=function(n){return this._addonManager.loadAddon(this,n)},Object.defineProperty(r,"strings",{get:function(){return c},enumerable:!1,configurable:!0}),r.prototype._verifyIntegers=function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];for(var i=0,f=n;i<f.length;i++){var h=f[i];if(h===1/0||isNaN(h)||h%1!=0)throw new Error("This API only accepts integers")}},r}();k.Terminal=p;var u=function(){function r(n,a){this._buffer=n,this.type=a}return r.prototype.init=function(n){return this._buffer=n,this},Object.defineProperty(r.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),r.prototype.getLine=function(n){var a=this._buffer.lines.get(n);if(a)return new d(a)},r.prototype.getNullCell=function(){return new R.CellData},r}(),o=function(){function r(n){var a=this;this._buffers=n,this._onBufferChange=new E.EventEmitter,this._normal=new u(this._buffers.normal,"normal"),this._alternate=new u(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return a._onBufferChange.fire(a.active)})}return Object.defineProperty(r.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.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(r.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),r}(),d=function(){function r(n){this._line=n}return Object.defineProperty(r.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),r.prototype.getCell=function(n,a){if(!(n<0||n>=this._line.length))return a?(this._line.loadCell(n,a),a):this._line.loadCell(n,new R.CellData)},r.prototype.translateToString=function(n,a,i){return this._line.translateToString(n,a,i)},r}(),s=function(){function r(n){this._core=n}return r.prototype.registerCsiHandler=function(n,a){return this._core.addCsiHandler(n,function(i){return a(i.toArray())})},r.prototype.addCsiHandler=function(n,a){return this.registerCsiHandler(n,a)},r.prototype.registerDcsHandler=function(n,a){return this._core.addDcsHandler(n,function(i,f){return a(i,f.toArray())})},r.prototype.addDcsHandler=function(n,a){return this.registerDcsHandler(n,a)},r.prototype.registerEscHandler=function(n,a){return this._core.addEscHandler(n,a)},r.prototype.addEscHandler=function(n,a){return this.registerEscHandler(n,a)},r.prototype.registerOscHandler=function(n,a){return this._core.addOscHandler(n,a)},r.prototype.addOscHandler=function(n,a){return this.registerOscHandler(n,a)},r}(),l=function(){function r(n){this._core=n}return r.prototype.register=function(n){this._core.unicodeService.register(n)},Object.defineProperty(r.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(n){this._core.unicodeService.activeVersion=n},enumerable:!1,configurable:!0}),r}()},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(H,F){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(W,U){W.__proto__=U}||function(W,U){for(var K in U)U.hasOwnProperty(K)&&(W[K]=U[K])})(H,F)},function(H,F){function W(){this.constructor=H}R(H,F),H.prototype=F===null?Object.create(F):(W.prototype=F.prototype,new W)});Object.defineProperty(k,"__esModule",{value:!0}),k.Terminal=void 0;var c=D(36),E=D(37),y=D(38),p=D(12),u=D(19),o=D(40),d=D(50),s=D(51),l=D(11),r=D(7),n=D(18),a=D(54),i=D(55),f=D(56),h=D(57),w=D(59),m=D(0),T=D(16),A=D(27),x=D(60),b=D(5),S=D(61),C=D(62),g=D(63),M=D(64),I=D(65),P=typeof window!="undefined"?window.document:null,B=function(H){function F(W){W===void 0&&(W={});var U=H.call(this,W)||this;return U.browser=l,U._keyDownHandled=!1,U._onCursorMove=new m.EventEmitter,U._onKey=new m.EventEmitter,U._onRender=new m.EventEmitter,U._onSelectionChange=new m.EventEmitter,U._onTitleChange=new m.EventEmitter,U._onFocus=new m.EventEmitter,U._onBlur=new m.EventEmitter,U._onA11yCharEmitter=new m.EventEmitter,U._onA11yTabEmitter=new m.EventEmitter,U._setup(),U.linkifier=U._instantiationService.createInstance(d.Linkifier),U.linkifier2=U.register(U._instantiationService.createInstance(g.Linkifier2)),U.register(U._inputHandler.onRequestBell(function(){return U.bell()})),U.register(U._inputHandler.onRequestRefreshRows(function(K,G){return U.refresh(K,G)})),U.register(U._inputHandler.onRequestReset(function(){return U.reset()})),U.register(U._inputHandler.onRequestScroll(function(K,G){return U.scroll(K,G||void 0)})),U.register(U._inputHandler.onRequestWindowsOptionsReport(function(K){return U._reportWindowsOptions(K)})),U.register(m.forwardEvent(U._inputHandler.onCursorMove,U._onCursorMove)),U.register(m.forwardEvent(U._inputHandler.onTitleChange,U._onTitleChange)),U.register(m.forwardEvent(U._inputHandler.onA11yChar,U._onA11yCharEmitter)),U.register(m.forwardEvent(U._inputHandler.onA11yTab,U._onA11yTabEmitter)),U.register(U._bufferService.onResize(function(K){return U._afterResize(K.cols,K.rows)})),U}return O(F,H),Object.defineProperty(F.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),F.prototype.dispose=function(){var W,U,K;this._isDisposed||(H.prototype.dispose.call(this),(W=this._renderService)===null||W===void 0||W.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(K=(U=this.element)===null||U===void 0?void 0:U.parentNode)===null||K===void 0||K.removeChild(this.element))},F.prototype._setup=function(){H.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(F.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),F.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},F.prototype._updateOptions=function(W){var U,K,G,ee;switch(H.prototype._updateOptions.call(this,W),W){case"fontFamily":case"fontSize":(U=this._renderService)===null||U===void 0||U.clear(),(K=this._charSizeService)===null||K===void 0||K.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":(G=this.viewport)===null||G===void 0||G.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new f.AccessibilityManager(this,this._renderService)):((ee=this._accessibilityManager)===null||ee===void 0||ee.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},F.prototype._onTextAreaFocus=function(W){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(p.C0.ESC+"[I"),this.updateCursorStyle(W),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},F.prototype.blur=function(){var W;return(W=this.textarea)===null||W===void 0?void 0:W.blur()},F.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(p.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},F.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var W=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),U=this._bufferService.buffer.y*W,K=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=K+"px",this.textarea.style.top=U+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=W+"px",this.textarea.style.lineHeight=W+"px",this.textarea.style.zIndex="-5"}},F.prototype._initGlobal=function(){var W=this;this._bindKeys(),this.register(r.addDisposableDomListener(this.element,"copy",function(K){W.hasSelection()&&y.copyHandler(K,W._selectionService)}));var U=function(K){return y.handlePasteEvent(K,W.textarea,W._coreService)};this.register(r.addDisposableDomListener(this.textarea,"paste",U)),this.register(r.addDisposableDomListener(this.element,"paste",U)),l.isFirefox?this.register(r.addDisposableDomListener(this.element,"mousedown",function(K){K.button===2&&y.rightClickHandler(K,W.textarea,W.screenElement,W._selectionService,W.options.rightClickSelectsWord)})):this.register(r.addDisposableDomListener(this.element,"contextmenu",function(K){y.rightClickHandler(K,W.textarea,W.screenElement,W._selectionService,W.options.rightClickSelectsWord)})),l.isLinux&&this.register(r.addDisposableDomListener(this.element,"auxclick",function(K){K.button===1&&y.moveTextAreaUnderMouseCursor(K,W.textarea,W.screenElement)}))},F.prototype._bindKeys=function(){var W=this;this.register(r.addDisposableDomListener(this.textarea,"keyup",function(U){return W._keyUp(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"keydown",function(U){return W._keyDown(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"keypress",function(U){return W._keyPress(U)},!0)),this.register(r.addDisposableDomListener(this.textarea,"compositionstart",function(){return W._compositionHelper.compositionstart()})),this.register(r.addDisposableDomListener(this.textarea,"compositionupdate",function(U){return W._compositionHelper.compositionupdate(U)})),this.register(r.addDisposableDomListener(this.textarea,"compositionend",function(){return W._compositionHelper.compositionend()})),this.register(this.onRender(function(){return W._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(U){return W._queueLinkification(U.start,U.end)}))},F.prototype.open=function(W){var U=this;if(!W)throw new Error("Terminal requires a parent element.");P.body.contains(W)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=W.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"),W.appendChild(this.element);var K=P.createDocumentFragment();this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),K.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),K.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",n.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(r.addDisposableDomListener(this.textarea,"focus",function(de){return U._onTextAreaFocus(de)})),this.register(r.addDisposableDomListener(this.textarea,"blur",function(){return U._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var G=this._instantiationService.createInstance(M.CoreBrowserService,this.textarea);this._instantiationService.setService(b.ICoreBrowserService,G),this._charSizeService=this._instantiationService.createInstance(S.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(b.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(K),this._theme=this.options.theme||this._theme,this._colorManager=new A.ColorManager(P,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(de){return U._colorManager.onOptionsChange(de)})),this._colorManager.setTheme(this._theme);var ee=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(x.RenderService,ee,this.rows,this.screenElement)),this._instantiationService.setService(b.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(de){return U._onRender.fire(de)})),this.onResize(function(de){return U._renderService.resize(de.cols,de.rows)}),this._soundService=this._instantiationService.createInstance(a.SoundService),this._instantiationService.setService(b.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(b.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(E.Viewport,function(de,ge){return U.scrollLines(de,ge)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return U.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){U._renderService.onCursorMove(),U._syncTextArea()})),this.register(this.onResize(function(){return U._renderService.onResize(U.cols,U.rows)})),this.register(this.onBlur(function(){return U._renderService.onBlur()})),this.register(this.onFocus(function(){return U._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return U.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(s.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(b.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(de){return U.scrollLines(de.amount,de.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return U._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(de){return U._renderService.onSelectionChanged(de.start,de.end,de.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(de){U.textarea.value=de,U.textarea.focus(),U.textarea.select()})),this.register(this.onScroll(function(){U.viewport.syncScrollArea(),U._selectionService.refresh()})),this.register(r.addDisposableDomListener(this._viewportElement,"scroll",function(){return U._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(i.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return U._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(r.addDisposableDomListener(this.element,"mousedown",function(de){return U._selectionService.onMouseDown(de)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new f.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},F.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(h.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},F.prototype._setTheme=function(W){var U,K,G;this._theme=W,(U=this._colorManager)===null||U===void 0||U.setTheme(W),(K=this._renderService)===null||K===void 0||K.setColors(this._colorManager.colors),(G=this.viewport)===null||G===void 0||G.onThemeChange(this._colorManager.colors)},F.prototype.bindMouse=function(){var W=this,U=this,K=this.element;function G(Le){var Me,Pe,be=U._mouseService.getRawByteCoords(Le,U.screenElement,U.cols,U.rows);if(!be)return!1;switch(Le.overrideType||Le.type){case"mousemove":Pe=32,Le.buttons===void 0?(Me=3,Le.button!==void 0&&(Me=Le.button<3?Le.button:3)):Me=1&Le.buttons?0:4&Le.buttons?1:2&Le.buttons?2:3;break;case"mouseup":Pe=0,Me=Le.button<3?Le.button:3;break;case"mousedown":Pe=1,Me=Le.button<3?Le.button:3;break;case"wheel":Le.deltaY!==0&&(Pe=Le.deltaY<0?0:1),Me=4;break;default:return!1}return!(Pe===void 0||Me===void 0||Me>4)&&U._coreMouseService.triggerMouseEvent({col:be.x-33,row:be.y-33,button:Me,action:Pe,ctrl:Le.ctrlKey,alt:Le.altKey,shift:Le.shiftKey})}var ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},de=function(Le){return G(Le),Le.buttons||(W._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&W._document.removeEventListener("mousemove",ee.mousedrag)),W.cancel(Le)},ge=function(Le){return G(Le),Le.preventDefault(),W.cancel(Le)},Be=function(Le){Le.buttons&&G(Le)},Ue=function(Le){Le.buttons||G(Le)};this.register(this._coreMouseService.onProtocolChange(function(Le){Le?(W.optionsService.options.logLevel==="debug"&&W._logService.debug("Binding to mouse events:",W._coreMouseService.explainEvents(Le)),W.element.classList.add("enable-mouse-events"),W._selectionService.disable()):(W._logService.debug("Unbinding from mouse events."),W.element.classList.remove("enable-mouse-events"),W._selectionService.enable()),8&Le?ee.mousemove||(K.addEventListener("mousemove",Ue),ee.mousemove=Ue):(K.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&Le?ee.wheel||(K.addEventListener("wheel",ge,{passive:!1}),ee.wheel=ge):(K.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&Le?ee.mouseup||(ee.mouseup=de):(W._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&Le?ee.mousedrag||(ee.mousedrag=Be):(W._document.removeEventListener("mousemove",ee.mousedrag),ee.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(r.addDisposableDomListener(K,"mousedown",function(Le){if(Le.preventDefault(),W.focus(),W._coreMouseService.areMouseEventsActive&&!W._selectionService.shouldForceSelection(Le))return G(Le),ee.mouseup&&W._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&W._document.addEventListener("mousemove",ee.mousedrag),W.cancel(Le)})),this.register(r.addDisposableDomListener(K,"wheel",function(Le){if(!ee.wheel){if(!W.buffer.hasScrollback){var Me=W.viewport.getLinesScrolled(Le);if(Me===0)return;for(var Pe=p.C0.ESC+(W._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Le.deltaY<0?"A":"B"),be="",ke=0;ke<Math.abs(Me);ke++)be+=Pe;W._coreService.triggerDataEvent(be,!0)}}},{passive:!0})),this.register(r.addDisposableDomListener(K,"wheel",function(Le){if(!ee.wheel)return W.viewport.onWheel(Le)?void 0:W.cancel(Le)},{passive:!1})),this.register(r.addDisposableDomListener(K,"touchstart",function(Le){if(!W._coreMouseService.areMouseEventsActive)return W.viewport.onTouchStart(Le),W.cancel(Le)},{passive:!0})),this.register(r.addDisposableDomListener(K,"touchmove",function(Le){if(!W._coreMouseService.areMouseEventsActive)return W.viewport.onTouchMove(Le)?void 0:W.cancel(Le)},{passive:!1}))},F.prototype.refresh=function(W,U){var K;(K=this._renderService)===null||K===void 0||K.refreshRows(W,U)},F.prototype._queueLinkification=function(W,U){var K;(K=this.linkifier)===null||K===void 0||K.linkifyRows(W,U)},F.prototype.updateCursorStyle=function(W){this._selectionService&&this._selectionService.shouldColumnSelect(W)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},F.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},F.prototype.scrollLines=function(W,U){H.prototype.scrollLines.call(this,W,U),this.refresh(0,this.rows-1)},F.prototype.paste=function(W){y.paste(W,this.textarea,this._coreService)},F.prototype.attachCustomKeyEventHandler=function(W){this._customKeyEventHandler=W},F.prototype.registerLinkMatcher=function(W,U,K){var G=this.linkifier.registerLinkMatcher(W,U,K);return this.refresh(0,this.rows-1),G},F.prototype.deregisterLinkMatcher=function(W){this.linkifier.deregisterLinkMatcher(W)&&this.refresh(0,this.rows-1)},F.prototype.registerLinkProvider=function(W){return this.linkifier2.registerLinkProvider(W)},F.prototype.registerCharacterJoiner=function(W){var U=this._renderService.registerCharacterJoiner(W);return this.refresh(0,this.rows-1),U},F.prototype.deregisterCharacterJoiner=function(W){this._renderService.deregisterCharacterJoiner(W)&&this.refresh(0,this.rows-1)},Object.defineProperty(F.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),F.prototype.addMarker=function(W){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)},F.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},F.prototype.select=function(W,U,K){this._selectionService.setSelection(W,U,K)},F.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},F.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]}},F.prototype.clearSelection=function(){var W;(W=this._selectionService)===null||W===void 0||W.clearSelection()},F.prototype.selectAll=function(){var W;(W=this._selectionService)===null||W===void 0||W.selectAll()},F.prototype.selectLines=function(W,U){var K;(K=this._selectionService)===null||K===void 0||K.selectLines(W,U)},F.prototype._keyDown=function(W){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(!this._compositionHelper.keydown(W))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var U=w.evaluateKeyboardEvent(W,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),U.type===3||U.type===2){var K=this.rows-1;return this.scrollLines(U.type===2?-K:K),this.cancel(W,!0)}return U.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(U.cancel&&this.cancel(W,!0),!U.key||(U.key!==p.C0.ETX&&U.key!==p.C0.CR||(this.textarea.value=""),this._onKey.fire({key:U.key,domEvent:W}),this._showCursor(),this._coreService.triggerDataEvent(U.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(W,!0)))},F.prototype._isThirdLevelShift=function(W,U){var K=W.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||W.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey;return U.type==="keypress"?K:K&&(!U.keyCode||U.keyCode>47)},F.prototype._keyUp=function(W){this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W))},F.prototype._keyPress=function(W){var U;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)U=W.charCode;else if(W.which===null||W.which===void 0)U=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;U=W.which}return!(!U||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W))&&(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:W}),this._showCursor(),this._coreService.triggerDataEvent(U,!0),!0)},F.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},F.prototype.resize=function(W,U){W!==this.cols||U!==this.rows?H.prototype.resize.call(this,W,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},F.prototype._afterResize=function(W,U){var K,G;(K=this._charSizeService)===null||K===void 0||K.measure(),(G=this.viewport)===null||G===void 0||G.syncScrollArea(!0)},F.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 W=1;W<this.rows;W++)this.buffer.lines.push(this.buffer.getBlankLine(T.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},F.prototype.reset=function(){var W,U;this.options.rows=this.rows,this.options.cols=this.cols;var K=this._customKeyEventHandler;this._setup(),H.prototype.reset.call(this),(W=this._selectionService)===null||W===void 0||W.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1),(U=this.viewport)===null||U===void 0||U.syncScrollArea()},F.prototype._reportWindowsOptions=function(W){if(this._renderService)switch(W){case u.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var U=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),K=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(p.C0.ESC+"[4;"+K+";"+U+"t");break;case u.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var G=this._renderService.dimensions.scaledCellWidth.toFixed(0),ee=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(p.C0.ESC+"[6;"+ee+";"+G+"t")}},F.prototype.cancel=function(W,U){if(this.options.cancelEvents||U)return W.preventDefault(),W.stopPropagation(),!1},F.prototype._visualBell=function(){return!1},F.prototype._soundBell=function(){return this.options.bellStyle==="sound"},F}(I.CoreTerminal);k.Terminal=B},function(j,k,D){"use strict";var R=this&&this.__decorate||function(p,u,o,d){var s,l=arguments.length,r=l<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(p,u,o,d);else for(var n=p.length-1;n>=0;n--)(s=p[n])&&(r=(l<3?s(r):l>3?s(u,o,r):s(u,o))||r);return l>3&&r&&Object.defineProperty(u,o,r),r},O=this&&this.__param||function(p,u){return function(o,d){u(o,d,p)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CompositionHelper=void 0;var c=D(5),E=D(1),y=function(){function p(u,o,d,s,l,r){this._textarea=u,this._compositionView=o,this._bufferService=d,this._optionsService=s,this._charSizeService=l,this._coreService=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(p.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),p.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},p.prototype.compositionupdate=function(u){var o=this;this._compositionView.textContent=u.data,this.updateCompositionElements(),setTimeout(function(){o._compositionPosition.end=o._textarea.value.length},0)},p.prototype.compositionend=function(){this._finalizeComposition(!0)},p.prototype.keydown=function(u){if(this._isComposing||this._isSendingComposition){if(u.keyCode===229)return!1;if(u.keyCode===16||u.keyCode===17||u.keyCode===18)return!1;this._finalizeComposition(!1)}return u.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},p.prototype._finalizeComposition=function(u){var o=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,u){var d={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(o._isSendingComposition){o._isSendingComposition=!1;var l=void 0;l=o._isComposing?o._textarea.value.substring(d.start,d.end):o._textarea.value.substring(d.start),o._coreService.triggerDataEvent(l,!0)}},0)}else{this._isSendingComposition=!1;var s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}},p.prototype._handleAnyTextareaChanges=function(){var u=this,o=this._textarea.value;setTimeout(function(){if(!u._isComposing){var d=u._textarea.value.replace(o,"");d.length>0&&u._coreService.triggerDataEvent(d,!0)}},0)},p.prototype.updateCompositionElements=function(u){var o=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var d=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),s=this._bufferService.buffer.y*d,l=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=d+"px",this._compositionView.style.lineHeight=d+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var r=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=s+"px",this._textarea.style.width=r.width+"px",this._textarea.style.height=r.height+"px",this._textarea.style.lineHeight=r.height+"px"}u||setTimeout(function(){return o.updateCompositionElements(!0)},0)}},p=R([O(2,E.IBufferService),O(3,E.IOptionsService),O(4,c.ICharSizeService),O(5,E.ICoreService)],p)}();k.CompositionHelper=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),c=this&&this.__decorate||function(s,l,r,n){var a,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(a=s[h])&&(f=(i<3?a(f):i>3?a(l,r,f):a(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Viewport=void 0;var y=D(2),p=D(7),u=D(5),o=D(1),d=function(s){function l(r,n,a,i,f,h,w){var m=s.call(this)||this;return m._scrollLines=r,m._viewportElement=n,m._scrollArea=a,m._bufferService=i,m._optionsService=f,m._charSizeService=h,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(p.addDisposableDomListener(m._viewportElement,"scroll",m._onScroll.bind(m))),setTimeout(function(){return m.syncScrollArea()},0),m}return O(l,s),l.prototype.onThemeChange=function(r){this._viewportElement.style.backgroundColor=r.background.css},l.prototype._refresh=function(r){var n=this;if(r)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return n._innerRefresh()}))},l.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var r=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==r&&(this._lastRecordedBufferHeight=r,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==n&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=n),this._refreshAnimationFrame=null},l.prototype.syncScrollArea=function(r){if(r===void 0&&(r=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(r);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var n=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===n&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(r)}else this._refresh(r)},l.prototype._onScroll=function(r){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(n,!0)}},l.prototype._bubbleScroll=function(r,n){var a=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&a<this._lastRecordedBufferHeight)||(r.cancelable&&r.preventDefault(),!1)},l.prototype.onWheel=function(r){var n=this._getPixelsScrolled(r);return n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(r,n))},l.prototype._getPixelsScrolled=function(r){if(r.deltaY===0)return 0;var n=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n},l.prototype.getLinesScrolled=function(r){if(r.deltaY===0)return 0;var n=this._applyScrollModifier(r.deltaY,r);return r.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):r.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n},l.prototype._applyScrollModifier=function(r,n){var a=this._optionsService.options.fastScrollModifier;return a==="alt"&&n.altKey||a==="ctrl"&&n.ctrlKey||a==="shift"&&n.shiftKey?r*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:r*this._optionsService.options.scrollSensitivity},l.prototype.onTouchStart=function(r){this._lastTouchY=r.touches[0].pageY},l.prototype.onTouchMove=function(r){var n=this._lastTouchY-r.touches[0].pageY;return this._lastTouchY=r.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(r,n))},l=c([E(3,o.IBufferService),E(4,o.IOptionsService),E(5,u.ICharSizeService),E(6,u.IRenderService)],l)}(y.Disposable);k.Viewport=d},function(j,k,D){"use strict";function R(y){return y.replace(/\r?\n/g,"\r")}function O(y,p){return p?"[200~"+y+"[201~":y}function c(y,p,u){y=O(y=R(y),u.decPrivateModes.bracketedPasteMode),u.triggerDataEvent(y,!0),p.value=""}function E(y,p,u){var o=u.getBoundingClientRect(),d=y.clientX-o.left-10,s=y.clientY-o.top-10;p.style.width="20px",p.style.height="20px",p.style.left=d+"px",p.style.top=s+"px",p.style.zIndex="1000",p.focus()}Object.defineProperty(k,"__esModule",{value:!0}),k.rightClickHandler=k.moveTextAreaUnderMouseCursor=k.paste=k.handlePasteEvent=k.copyHandler=k.bracketTextForPaste=k.prepareTextForTerminal=void 0,k.prepareTextForTerminal=R,k.bracketTextForPaste=O,k.copyHandler=function(y,p){y.clipboardData&&y.clipboardData.setData("text/plain",p.selectionText),y.preventDefault()},k.handlePasteEvent=function(y,p,u){y.stopPropagation(),y.clipboardData&&c(y.clipboardData.getData("text/plain"),p,u)},k.paste=c,k.moveTextAreaUnderMouseCursor=E,k.rightClickHandler=function(y,p,u,o,d){E(y,p,u),d&&!o.isClickInSelection(y)&&o.selectWordAtCursor(y),p.value=o.selectionText,p.select()}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)});Object.defineProperty(k,"__esModule",{value:!0}),k.EscapeSequenceParser=k.VT500_TRANSITION_TABLE=k.TransitionTable=void 0;var c=D(2),E=D(15),y=D(21),p=D(22),u=D(24),o=function(){function s(l){this.table=new Uint8Array(l)}return s.prototype.setDefault=function(l,r){E.fill(this.table,l<<4|r)},s.prototype.add=function(l,r,n,a){this.table[r<<8|l]=n<<4|a},s.prototype.addMany=function(l,r,n,a){for(var i=0;i<l.length;i++)this.table[r<<8|l[i]]=n<<4|a},s}();k.TransitionTable=o,k.VT500_TRANSITION_TABLE=function(){var s=new o(4095),l=Array.apply(null,Array(256)).map(function(h,w){return w}),r=function(h,w){return l.slice(h,w)},n=r(32,127),a=r(0,24);a.push(25),a.push.apply(a,r(28,32));var i,f=r(0,14);for(i in s.setDefault(1,0),s.addMany(n,0,2,0),f)s.addMany([24,26,153,154],i,3,0),s.addMany(r(128,144),i,3,0),s.addMany(r(144,152),i,3,0),s.add(156,i,0,0),s.add(27,i,11,1),s.add(157,i,4,8),s.addMany([152,158,159],i,0,7),s.add(155,i,11,3),s.add(144,i,11,9);return s.addMany(a,0,3,0),s.addMany(a,1,3,1),s.add(127,1,0,1),s.addMany(a,8,0,8),s.addMany(a,3,3,3),s.add(127,3,0,3),s.addMany(a,4,3,4),s.add(127,4,0,4),s.addMany(a,6,3,6),s.addMany(a,5,3,5),s.add(127,5,0,5),s.addMany(a,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(n,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(r(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(n,7,0,7),s.addMany(a,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(r(64,127),3,7,0),s.addMany(r(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(r(48,60),4,8,4),s.addMany(r(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(r(32,64),6,0,6),s.add(127,6,0,6),s.addMany(r(64,127),6,0,0),s.addMany(r(32,48),3,9,5),s.addMany(r(32,48),5,9,5),s.addMany(r(48,64),5,0,6),s.addMany(r(64,127),5,7,0),s.addMany(r(32,48),4,9,5),s.addMany(r(32,48),1,9,2),s.addMany(r(32,48),2,9,2),s.addMany(r(48,127),2,10,0),s.addMany(r(48,80),1,10,0),s.addMany(r(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(r(96,127),1,10,0),s.add(80,1,11,9),s.addMany(a,9,0,9),s.add(127,9,0,9),s.addMany(r(28,32),9,0,9),s.addMany(r(32,48),9,9,12),s.addMany(r(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(a,11,0,11),s.addMany(r(32,128),11,0,11),s.addMany(r(28,32),11,0,11),s.addMany(a,10,0,10),s.add(127,10,0,10),s.addMany(r(28,32),10,0,10),s.addMany(r(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(r(32,48),10,9,12),s.addMany(a,12,0,12),s.add(127,12,0,12),s.addMany(r(28,32),12,0,12),s.addMany(r(32,48),12,9,12),s.addMany(r(48,64),12,0,11),s.addMany(r(64,127),12,12,13),s.addMany(r(64,127),10,12,13),s.addMany(r(64,127),9,12,13),s.addMany(a,13,13,13),s.addMany(n,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(160,0,2,0),s.add(160,8,5,8),s.add(160,6,0,6),s.add(160,11,0,11),s.add(160,13,13,13),s}();var d=function(s){function l(r){r===void 0&&(r=k.VT500_TRANSITION_TABLE);var n=s.call(this)||this;return n._transitions=r,n.initialState=0,n.currentState=n.initialState,n._params=new y.Params,n._params.addParam(0),n._collect=0,n.precedingCodepoint=0,n._printHandlerFb=function(a,i,f){},n._executeHandlerFb=function(a){},n._csiHandlerFb=function(a,i){},n._escHandlerFb=function(a){},n._errorHandlerFb=function(a){return a},n._printHandler=n._printHandlerFb,n._executeHandlers=Object.create(null),n._csiHandlers=Object.create(null),n._escHandlers=Object.create(null),n._oscParser=new p.OscParser,n._dcsParser=new u.DcsParser,n._errorHandler=n._errorHandlerFb,n.setEscHandler({final:"\\"},function(){}),n}return O(l,s),l.prototype._identifier=function(r,n){n===void 0&&(n=[64,126]);var a=0;if(r.prefix){if(r.prefix.length>1)throw new Error("only one byte as prefix supported");if((a=r.prefix.charCodeAt(0))&&60>a||a>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(r.intermediates){if(r.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var i=0;i<r.intermediates.length;++i){var f=r.intermediates.charCodeAt(i);if(32>f||f>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");a<<=8,a|=f}}if(r.final.length!==1)throw new Error("final must be a single byte");var h=r.final.charCodeAt(0);if(n[0]>h||h>n[1])throw new Error("final must be in range "+n[0]+" .. "+n[1]);return a<<=8,a|=h},l.prototype.identToString=function(r){for(var n=[];r;)n.push(String.fromCharCode(255&r)),r>>=8;return n.reverse().join("")},l.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},l.prototype.setPrintHandler=function(r){this._printHandler=r},l.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},l.prototype.addEscHandler=function(r,n){var a=this._identifier(r,[48,126]);this._escHandlers[a]===void 0&&(this._escHandlers[a]=[]);var i=this._escHandlers[a];return i.push(n),{dispose:function(){var f=i.indexOf(n);f!==-1&&i.splice(f,1)}}},l.prototype.setEscHandler=function(r,n){this._escHandlers[this._identifier(r,[48,126])]=[n]},l.prototype.clearEscHandler=function(r){this._escHandlers[this._identifier(r,[48,126])]&&delete this._escHandlers[this._identifier(r,[48,126])]},l.prototype.setEscHandlerFallback=function(r){this._escHandlerFb=r},l.prototype.setExecuteHandler=function(r,n){this._executeHandlers[r.charCodeAt(0)]=n},l.prototype.clearExecuteHandler=function(r){this._executeHandlers[r.charCodeAt(0)]&&delete this._executeHandlers[r.charCodeAt(0)]},l.prototype.setExecuteHandlerFallback=function(r){this._executeHandlerFb=r},l.prototype.addCsiHandler=function(r,n){var a=this._identifier(r);this._csiHandlers[a]===void 0&&(this._csiHandlers[a]=[]);var i=this._csiHandlers[a];return i.push(n),{dispose:function(){var f=i.indexOf(n);f!==-1&&i.splice(f,1)}}},l.prototype.setCsiHandler=function(r,n){this._csiHandlers[this._identifier(r)]=[n]},l.prototype.clearCsiHandler=function(r){this._csiHandlers[this._identifier(r)]&&delete this._csiHandlers[this._identifier(r)]},l.prototype.setCsiHandlerFallback=function(r){this._csiHandlerFb=r},l.prototype.addDcsHandler=function(r,n){return this._dcsParser.addHandler(this._identifier(r),n)},l.prototype.setDcsHandler=function(r,n){this._dcsParser.setHandler(this._identifier(r),n)},l.prototype.clearDcsHandler=function(r){this._dcsParser.clearHandler(this._identifier(r))},l.prototype.setDcsHandlerFallback=function(r){this._dcsParser.setHandlerFallback(r)},l.prototype.addOscHandler=function(r,n){return this._oscParser.addHandler(r,n)},l.prototype.setOscHandler=function(r,n){this._oscParser.setHandler(r,n)},l.prototype.clearOscHandler=function(r){this._oscParser.clearHandler(r)},l.prototype.setOscHandlerFallback=function(r){this._oscParser.setHandlerFallback(r)},l.prototype.setErrorHandler=function(r){this._errorHandler=r},l.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},l.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},l.prototype.parse=function(r,n){for(var a=0,i=0,f=this.currentState,h=this._oscParser,w=this._dcsParser,m=this._collect,T=this._params,A=this._transitions.table,x=0;x<n;++x){switch((i=A[f<<8|((a=r[x])<160?a:160)])>>4){case 2:for(var b=x+1;;++b){if(b>=n||(a=r[b])<32||a>126&&a<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(a=r[b])<32||a>126&&a<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(a=r[b])<32||a>126&&a<160){this._printHandler(r,x,b),x=b-1;break}if(++b>=n||(a=r[b])<32||a>126&&a<160){this._printHandler(r,x,b),x=b-1;break}}break;case 3:this._executeHandlers[a]?this._executeHandlers[a]():this._executeHandlerFb(a),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:x,code:a,currentState:f,collect:m,params:T,abort:!1}).abort)return;break;case 7:for(var S=this._csiHandlers[m<<8|a],C=S?S.length-1:-1;C>=0&&S[C](T)===!1;C--);C<0&&this._csiHandlerFb(m<<8|a,T),this.precedingCodepoint=0;break;case 8:do switch(a){case 59:T.addParam(0);break;case 58:T.addSubParam(-1);break;default:T.addDigit(a-48)}while(++x<n&&(a=r[x])>47&&a<60);x--;break;case 9:m<<=8,m|=a;break;case 10:for(var g=this._escHandlers[m<<8|a],M=g?g.length-1:-1;M>=0&&g[M]()===!1;M--);M<0&&this._escHandlerFb(m<<8|a),this.precedingCodepoint=0;break;case 11:T.reset(),T.addParam(0),m=0;break;case 12:w.hook(m<<8|a,T);break;case 13:for(var I=x+1;;++I)if(I>=n||(a=r[I])===24||a===26||a===27||a>127&&a<160){w.put(r,x,I),x=I-1;break}break;case 14:w.unhook(a!==24&&a!==26),a===27&&(i|=1),T.reset(),T.addParam(0),m=0,this.precedingCodepoint=0;break;case 4:h.start();break;case 5:for(var P=x+1;;P++)if(P>=n||(a=r[P])<32||a>127&&a<=159){h.put(r,x,P),x=P-1;break}break;case 6:h.end(a!==24&&a!==26),a===27&&(i|=1),T.reset(),T.addParam(0),m=0,this.precedingCodepoint=0}f=15&i}this._collect=m,this.currentState=f},l}(c.Disposable);k.EscapeSequenceParser=d},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(h,w){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,T){m.__proto__=T}||function(m,T){for(var A in T)T.hasOwnProperty(A)&&(m[A]=T[A])})(h,w)},function(h,w){function m(){this.constructor=h}R(h,w),h.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),c=this&&this.__decorate||function(h,w,m,T){var A,x=arguments.length,b=x<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,m):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,w,m,T);else for(var S=h.length-1;S>=0;S--)(A=h[S])&&(b=(x<3?A(b):x>3?A(w,m,b):A(w,m))||b);return x>3&&b&&Object.defineProperty(w,m,b),b},E=this&&this.__param||function(h,w){return function(m,T){w(m,T,h)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Renderer=void 0;var y=D(41),p=D(47),u=D(48),o=D(49),d=D(29),s=D(2),l=D(5),r=D(1),n=D(25),a=D(0),i=1,f=function(h){function w(m,T,A,x,b,S,C,g,M){var I=h.call(this)||this;I._colors=m,I._screenElement=T,I._bufferService=b,I._charSizeService=S,I._optionsService=C,I._id=i++,I._onRequestRedraw=new a.EventEmitter;var P=I._optionsService.options.allowTransparency;return I._characterJoinerRegistry=new d.CharacterJoinerRegistry(I._bufferService),I._renderLayers=[new y.TextRenderLayer(I._screenElement,0,I._colors,I._characterJoinerRegistry,P,I._id,I._bufferService,C),new p.SelectionRenderLayer(I._screenElement,1,I._colors,I._id,I._bufferService,C),new o.LinkRenderLayer(I._screenElement,2,I._colors,I._id,A,x,I._bufferService,C),new u.CursorRenderLayer(I._screenElement,3,I._colors,I._id,I._onRequestRedraw,I._bufferService,C,g,M)],I.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},I._devicePixelRatio=window.devicePixelRatio,I._updateDimensions(),I.onOptionsChanged(),I}return O(w,h),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){for(var m=0,T=this._renderLayers;m<T.length;m++)T[m].dispose();h.prototype.dispose.call(this),n.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 T=0,A=this._renderLayers;T<A.length;T++){var x=A[T];x.setColors(this._colors),x.reset()}},w.prototype.onResize=function(m,T){this._updateDimensions();for(var A=0,x=this._renderLayers;A<x.length;A++)x[A].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,T,A){A===void 0&&(A=!1),this._runOperation(function(x){return x.onSelectionChanged(m,T,A)})},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 T=0,A=this._renderLayers;T<A.length;T++)m(A[T])},w.prototype.renderRows=function(m,T){for(var A=0,x=this._renderLayers;A<x.length;A++)x[A].onGridChanged(m,T)},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=c([E(4,r.IBufferService),E(5,l.ICharSizeService),E(6,r.IOptionsService),E(7,r.ICoreService),E(8,l.ICoreBrowserService)],w)}(s.Disposable);k.Renderer=f},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)});Object.defineProperty(k,"__esModule",{value:!0}),k.TextRenderLayer=void 0;var c=D(42),E=D(13),y=D(6),p=D(3),u=D(29),o=D(4),d=function(s){function l(r,n,a,i,f,h,w,m){var T=s.call(this,r,"text",n,f,a,h,w,m)||this;return T._characterWidth=0,T._characterFont="",T._characterOverlapCache={},T._workCell=new o.CellData,T._state=new c.GridCache,T._characterJoinerRegistry=i,T}return O(l,s),l.prototype.resize=function(r){s.prototype.resize.call(this,r);var n=this._getFont(!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},l.prototype.reset=function(){this._state.clear(),this._clearAll()},l.prototype._forEachCell=function(r,n,a,i){for(var f=r;f<=n;f++)for(var h=f+this._bufferService.buffer.ydisp,w=this._bufferService.buffer.lines.get(h),m=a?a.getJoinedCharacters(h):[],T=0;T<this._bufferService.cols;T++){w.loadCell(T,this._workCell);var A=this._workCell,x=!1,b=T;if(A.getWidth()!==0){if(m.length>0&&T===m[0][0]){x=!0;var S=m.shift();A=new u.JoinedCellData(this._workCell,w.translateToString(!0,S[0],S[1]),S[1]-S[0]),b=S[1]-1}!x&&this._isOverlapping(A)&&b<w.length-1&&w.getCodePoint(b+1)===p.NULL_CELL_CODE&&(A.content&=-12582913,A.content|=2<<22),i(A,T,f),T=b}}},l.prototype._drawBackground=function(r,n){var a=this,i=this._ctx,f=this._bufferService.cols,h=0,w=0,m=null;i.save(),this._forEachCell(r,n,null,function(T,A,x){var b=null;T.isInverse()?b=T.isFgDefault()?a._colors.foreground.css:T.isFgRGB()?"rgb("+y.AttributeData.toColorRGB(T.getFgColor()).join(",")+")":a._colors.ansi[T.getFgColor()].css:T.isBgRGB()?b="rgb("+y.AttributeData.toColorRGB(T.getBgColor()).join(",")+")":T.isBgPalette()&&(b=a._colors.ansi[T.getBgColor()].css),m===null&&(h=A,w=x),x!==w?(i.fillStyle=m||"",a._fillCells(h,w,f-h,1),h=A,w=x):m!==b&&(i.fillStyle=m||"",a._fillCells(h,w,A-h,1),h=A,w=x),m=b}),m!==null&&(i.fillStyle=m,this._fillCells(h,w,f-h,1)),i.restore()},l.prototype._drawForeground=function(r,n){var a=this;this._forEachCell(r,n,this._characterJoinerRegistry,function(i,f,h){if(!i.isInvisible()&&(a._drawChars(i,f,h),i.isUnderline())){if(a._ctx.save(),i.isInverse())if(i.isBgDefault())a._ctx.fillStyle=a._colors.background.css;else if(i.isBgRGB())a._ctx.fillStyle="rgb("+y.AttributeData.toColorRGB(i.getBgColor()).join(",")+")";else{var w=i.getBgColor();a._optionsService.options.drawBoldTextInBrightColors&&i.isBold()&&w<8&&(w+=8),a._ctx.fillStyle=a._colors.ansi[w].css}else if(i.isFgDefault())a._ctx.fillStyle=a._colors.foreground.css;else if(i.isFgRGB())a._ctx.fillStyle="rgb("+y.AttributeData.toColorRGB(i.getFgColor()).join(",")+")";else{var m=i.getFgColor();a._optionsService.options.drawBoldTextInBrightColors&&i.isBold()&&m<8&&(m+=8),a._ctx.fillStyle=a._colors.ansi[m].css}a._fillBottomLineAtCells(f,h,i.getWidth()),a._ctx.restore()}})},l.prototype.onGridChanged=function(r,n){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,r,this._bufferService.cols,n-r+1),this._drawBackground(r,n),this._drawForeground(r,n))},l.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},l.prototype._isOverlapping=function(r){if(r.getWidth()!==1)return!1;if(r.getCode()<256)return!1;var n=r.getChars();if(this._characterOverlapCache.hasOwnProperty(n))return this._characterOverlapCache[n];this._ctx.save(),this._ctx.font=this._characterFont;var a=Math.floor(this._ctx.measureText(n).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[n]=a,a},l}(E.BaseRenderLayer);k.TextRenderLayer=d},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.GridCache=void 0;var R=function(){function O(){this.cache=[]}return O.prototype.resize=function(c,E){for(var y=0;y<c;y++){this.cache.length<=y&&this.cache.push([]);for(var p=this.cache[y].length;p<E;p++)this.cache[y].push(void 0);this.cache[y].length=E}this.cache.length=c},O.prototype.clear=function(){for(var c=0;c<this.cache.length;c++)for(var E=0;E<this.cache[c].length;E++)this.cache[c][E]=void 0},O}();k.GridCache=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(a,i){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,h){f.__proto__=h}||function(f,h){for(var w in h)h.hasOwnProperty(w)&&(f[w]=h[w])})(a,i)},function(a,i){function f(){this.constructor=a}R(a,i),a.prototype=i===null?Object.create(i):(f.prototype=i.prototype,new f)});Object.defineProperty(k,"__esModule",{value:!0}),k.NoneCharAtlas=k.DynamicCharAtlas=k.getGlyphCacheKey=void 0;var c=D(9),E=D(44),y=D(27),p=D(46),u=D(11),o=D(28),d=D(10),s={css:"rgba(0, 0, 0, 0)",rgba:0};function l(a){return a.code<<21|a.bg<<12|a.fg<<3|(a.bold?0:4)+(a.dim?0:2)+(a.italic?0:1)}k.getGlyphCacheKey=l;var r=function(a){function i(f,h){var w=a.call(this)||this;w._config=h,w._drawToCacheCount=0,w._glyphsWaitingOnBitmap=[],w._bitmapCommitTimeout=null,w._bitmap=null,w._cacheCanvas=f.createElement("canvas"),w._cacheCanvas.width=1024,w._cacheCanvas.height=1024,w._cacheCtx=o.throwIfFalsy(w._cacheCanvas.getContext("2d",{alpha:!0}));var m=f.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 T=w._width*w._height;return w._cacheMap=new p.LRUMap(T),w._cacheMap.prealloc(T),w}return O(i,a),i.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},i.prototype.beginFrame=function(){this._drawToCacheCount=0},i.prototype.draw=function(f,h,w,m){if(h.code===32)return!0;if(!this._canCache(h))return!1;var T=l(h),A=this._cacheMap.get(T);if(A!=null)return this._drawFromCache(f,A,w,m),!0;if(this._drawToCacheCount<100){var x=void 0;x=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var b=this._drawToCache(h,x);return this._cacheMap.set(T,b),this._drawFromCache(f,b,w,m),!0}return!1},i.prototype._canCache=function(f){return f.code<256},i.prototype._toCoordinateX=function(f){return f%this._width*this._config.scaledCharWidth},i.prototype._toCoordinateY=function(f){return Math.floor(f/this._width)*this._config.scaledCharHeight},i.prototype._drawFromCache=function(f,h,w,m){if(!h.isEmpty){var T=this._toCoordinateX(h.index),A=this._toCoordinateY(h.index);f.drawImage(h.inBitmap?this._bitmap:this._cacheCanvas,T,A,this._config.scaledCharWidth,this._config.scaledCharHeight,w,m,this._config.scaledCharWidth,this._config.scaledCharHeight)}},i.prototype._getColorFromAnsiIndex=function(f){return f<this._config.colors.ansi.length?this._config.colors.ansi[f]:y.DEFAULT_ANSI_COLORS[f]},i.prototype._getBackgroundColor=function(f){return this._config.allowTransparency?s:f.bg===c.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:f.bg<256?this._getColorFromAnsiIndex(f.bg):this._config.colors.background},i.prototype._getForegroundColor=function(f){return f.fg===c.INVERTED_DEFAULT_COLOR?d.color.opaque(this._config.colors.background):f.fg<256?this._getColorFromAnsiIndex(f.fg):this._config.colors.foreground},i.prototype._drawToCache=function(f,h){this._drawToCacheCount++,this._tmpCtx.save();var w=this._getBackgroundColor(f);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=f.bold?this._config.fontWeightBold:this._config.fontWeight,T=f.italic?"italic":"";this._tmpCtx.font=T+" "+m+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(f).css,f.dim&&(this._tmpCtx.globalAlpha=c.DIM_OPACITY),this._tmpCtx.fillText(f.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var A=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),x=!1;this._config.allowTransparency||(x=function(g,M){for(var I=!0,P=M.rgba>>>24,B=M.rgba>>>16&255,H=M.rgba>>>8&255,F=0;F<g.data.length;F+=4)g.data[F]===P&&g.data[F+1]===B&&g.data[F+2]===H?g.data[F+3]=0:I=!1;return I}(A,w));var b=this._toCoordinateX(h),S=this._toCoordinateY(h);this._cacheCtx.putImageData(A,b,S);var C={index:h,isEmpty:x,inBitmap:!1};return this._addGlyphToBitmap(C),C},i.prototype._addGlyphToBitmap=function(f){var h=this;!("createImageBitmap"in window)||u.isFirefox||u.isSafari||(this._glyphsWaitingOnBitmap.push(f),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return h._generateBitmap()},100)))},i.prototype._generateBitmap=function(){var f=this,h=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(w){f._bitmap=w;for(var m=0;m<h.length;m++)h[m].inBitmap=!0}),this._bitmapCommitTimeout=null},i}(E.BaseCharAtlas);k.DynamicCharAtlas=r;var n=function(a){function i(f,h){return a.call(this)||this}return O(i,a),i.prototype.draw=function(f,h,w,m){return!1},i}(E.BaseCharAtlas);k.NoneCharAtlas=n},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BaseCharAtlas=void 0;var R=function(){function O(){this._didWarmUp=!1}return O.prototype.dispose=function(){},O.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},O.prototype._doWarmUp=function(){},O.prototype.beginFrame=function(){},O}();k.BaseCharAtlas=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.ColorContrastCache=void 0;var R=function(){function O(){this._color={},this._rgba={}}return O.prototype.clear=function(){this._color={},this._rgba={}},O.prototype.setCss=function(c,E,y){this._rgba[c]||(this._rgba[c]={}),this._rgba[c][E]=y},O.prototype.getCss=function(c,E){return this._rgba[c]?this._rgba[c][E]:void 0},O.prototype.setColor=function(c,E,y){this._color[c]||(this._color[c]={}),this._color[c][E]=y},O.prototype.getColor=function(c,E){return this._color[c]?this._color[c][E]:void 0},O}();k.ColorContrastCache=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.LRUMap=void 0;var R=function(){function O(c){this.capacity=c,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return O.prototype._unlinkNode=function(c){var E=c.prev,y=c.next;c===this._head&&(this._head=y),c===this._tail&&(this._tail=E),E!==null&&(E.next=y),y!==null&&(y.prev=E)},O.prototype._appendNode=function(c){var E=this._tail;E!==null&&(E.next=c),c.prev=E,c.next=null,this._tail=c,this._head===null&&(this._head=c)},O.prototype.prealloc=function(c){for(var E=this._nodePool,y=0;y<c;y++)E.push({prev:null,next:null,key:null,value:null})},O.prototype.get=function(c){var E=this._map[c];return E!==void 0?(this._unlinkNode(E),this._appendNode(E),E.value):null},O.prototype.peekValue=function(c){var E=this._map[c];return E!==void 0?E.value:null},O.prototype.peek=function(){var c=this._head;return c===null?null:c.value},O.prototype.set=function(c,E){var y=this._map[c];if(y!==void 0)y=this._map[c],this._unlinkNode(y),y.value=E;else if(this.size>=this.capacity)y=this._head,this._unlinkNode(y),delete this._map[y.key],y.key=c,y.value=E,this._map[c]=y;else{var p=this._nodePool;p.length>0?((y=p.pop()).key=c,y.value=E):y={prev:null,next:null,key:c,value:E},this._map[c]=y,this.size++}this._appendNode(y)},O}();k.LRUMap=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(E,y){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,u){p.__proto__=u}||function(p,u){for(var o in u)u.hasOwnProperty(o)&&(p[o]=u[o])})(E,y)},function(E,y){function p(){this.constructor=E}R(E,y),E.prototype=y===null?Object.create(y):(p.prototype=y.prototype,new p)});Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionRenderLayer=void 0;var c=function(E){function y(p,u,o,d,s,l){var r=E.call(this,p,"selection",u,!0,o,d,s,l)||this;return r._clearState(),r}return O(y,E),y.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},y.prototype.resize=function(p){E.prototype.resize.call(this,p),this._clearState()},y.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},y.prototype.onSelectionChanged=function(p,u,o){if(this._didStateChange(p,u,o,this._bufferService.buffer.ydisp))if(this._clearAll(),p&&u){var d=p[1]-this._bufferService.buffer.ydisp,s=u[1]-this._bufferService.buffer.ydisp,l=Math.max(d,0),r=Math.min(s,this._bufferService.rows-1);if(!(l>=this._bufferService.rows||r<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,o){var n=p[0],a=u[0]-n,i=r-l+1;this._fillCells(n,l,a,i)}else{n=d===l?p[0]:0;var f=l===r?u[0]:this._bufferService.cols;this._fillCells(n,l,f-n,1);var h=Math.max(r-l-1,0);if(this._fillCells(0,l+1,this._bufferService.cols,h),l!==r){var w=s===r?u[0]:this._bufferService.cols;this._fillCells(0,r,w,1)}}this._state.start=[p[0],p[1]],this._state.end=[u[0],u[1]],this._state.columnSelectMode=o,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},y.prototype._didStateChange=function(p,u,o,d){return!this._areCoordinatesEqual(p,this._state.start)||!this._areCoordinatesEqual(u,this._state.end)||o!==this._state.columnSelectMode||d!==this._state.ydisp},y.prototype._areCoordinatesEqual=function(p,u){return!(!p||!u)&&p[0]===u[0]&&p[1]===u[1]},y}(D(13).BaseRenderLayer);k.SelectionRenderLayer=c},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,s){d.__proto__=s}||function(d,s){for(var l in s)s.hasOwnProperty(l)&&(d[l]=s[l])})(u,o)},function(u,o){function d(){this.constructor=u}R(u,o),u.prototype=o===null?Object.create(o):(d.prototype=o.prototype,new d)});Object.defineProperty(k,"__esModule",{value:!0}),k.CursorRenderLayer=void 0;var c=D(13),E=D(4),y=function(u){function o(d,s,l,r,n,a,i,f,h){var w=u.call(this,d,"cursor",s,!0,l,r,a,i)||this;return w._onRequestRedraw=n,w._coreService=f,w._coreBrowserService=h,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 O(o,u),o.prototype.resize=function(d){u.prototype.resize.call(this,d),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 d,s=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new p(this._coreBrowserService.isFocused,function(){s._render(!0)})):((d=this._cursorBlinkStateManager)===null||d===void 0||d.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(d,s){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},o.prototype._render=function(d){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,l=s-this._bufferService.buffer.ydisp;if(l<0||l>=this._bufferService.rows)this._clearCursor();else{var r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(r,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=this._optionsService.options.cursorStyle;return n&&n!=="block"?this._cursorRenderers[n](r,l,this._cell):this._renderBlurCursor(r,l,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=l,this._state.isFocused=!1,this._state.style=n,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===r&&this._state.y===l&&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"](r,l,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=l,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(d,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(d,s,this._optionsService.options.cursorWidth),this._ctx.restore()},o.prototype._renderBlockCursor=function(d,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(d,s,l.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(l,d,s),this._ctx.restore()},o.prototype._renderUnderlineCursor=function(d,s,l){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(d,s),this._ctx.restore()},o.prototype._renderBlurCursor=function(d,s,l){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(d,s,l.getWidth(),1),this._ctx.restore()},o}(c.BaseRenderLayer);k.CursorRenderLayer=y;var p=function(){function u(o,d){this._renderCallback=d,this.isCursorVisible=!0,o&&this._restartInterval()}return Object.defineProperty(u.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),u.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)},u.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})))},u.prototype._restartInterval=function(o){var d=this;o===void 0&&(o=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(d._animationTimeRestarted){var s=600-(Date.now()-d._animationTimeRestarted);if(d._animationTimeRestarted=void 0,s>0)return void d._restartInterval(s)}d.isCursorVisible=!1,d._animationFrame=window.requestAnimationFrame(function(){d._renderCallback(),d._animationFrame=void 0}),d._blinkInterval=window.setInterval(function(){if(d._animationTimeRestarted){var l=600-(Date.now()-d._animationTimeRestarted);return d._animationTimeRestarted=void 0,void d._restartInterval(l)}d.isCursorVisible=!d.isCursorVisible,d._animationFrame=window.requestAnimationFrame(function(){d._renderCallback(),d._animationFrame=void 0})},600)},o)},u.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)},u.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},u}()},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(u,o){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,s){d.__proto__=s}||function(d,s){for(var l in s)s.hasOwnProperty(l)&&(d[l]=s[l])})(u,o)},function(u,o){function d(){this.constructor=u}R(u,o),u.prototype=o===null?Object.create(o):(d.prototype=o.prototype,new d)});Object.defineProperty(k,"__esModule",{value:!0}),k.LinkRenderLayer=void 0;var c=D(13),E=D(9),y=D(26),p=function(u){function o(d,s,l,r,n,a,i,f){var h=u.call(this,d,"link",s,!0,l,r,i,f)||this;return n.onShowLinkUnderline(function(w){return h._onShowLinkUnderline(w)}),n.onHideLinkUnderline(function(w){return h._onHideLinkUnderline(w)}),a.onShowLinkUnderline(function(w){return h._onShowLinkUnderline(w)}),a.onHideLinkUnderline(function(w){return h._onHideLinkUnderline(w)}),h}return O(o,u),o.prototype.resize=function(d){u.prototype.resize.call(this,d),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 d=this._state.y2-this._state.y1-1;d>0&&this._clearCells(0,this._state.y1+1,this._state.cols,d),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},o.prototype._onShowLinkUnderline=function(d){if(d.fg===E.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:d.fg&&y.is256Color(d.fg)?this._ctx.fillStyle=this._colors.ansi[d.fg].css:this._ctx.fillStyle=this._colors.foreground.css,d.y1===d.y2)this._fillBottomLineAtCells(d.x1,d.y1,d.x2-d.x1);else{this._fillBottomLineAtCells(d.x1,d.y1,d.cols-d.x1);for(var s=d.y1+1;s<d.y2;s++)this._fillBottomLineAtCells(0,s,d.cols);this._fillBottomLineAtCells(0,d.y2,d.x2)}this._state=d},o.prototype._onHideLinkUnderline=function(d){this._clearCurrentLink()},o}(c.BaseRenderLayer);k.LinkRenderLayer=p},function(j,k,D){"use strict";var R=this&&this.__decorate||function(u,o,d,s){var l,r=arguments.length,n=r<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,d):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,o,d,s);else for(var a=u.length-1;a>=0;a--)(l=u[a])&&(n=(r<3?l(n):r>3?l(o,d,n):l(o,d))||n);return r>3&&n&&Object.defineProperty(o,d,n),n},O=this&&this.__param||function(u,o){return function(d,s){o(d,s,u)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseZone=k.Linkifier=void 0;var c=D(0),E=D(1),y=function(){function u(o,d,s){this._bufferService=o,this._logService=d,this._unicodeService=s,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new c.EventEmitter,this._onHideLinkUnderline=new c.EventEmitter,this._onLinkTooltip=new c.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(u.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),u.prototype.attachToDom=function(o,d){this._element=o,this._mouseZoneManager=d},u.prototype.linkifyRows=function(o,d){var s=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=o,this._rowsToLinkify.end=d):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,o),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,d)),this._mouseZoneManager.clearAll(o,d),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return s._linkifyRows()},u._timeBeforeLatency))},u.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var o=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var d=o.ydisp+this._rowsToLinkify.start;if(!(d>=o.lines.length)){for(var s=o.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,l=Math.ceil(2e3/this._bufferService.cols),r=this._bufferService.buffer.iterator(!1,d,s,l,l);r.hasNext();)for(var n=r.next(),a=0;a<this._linkMatchers.length;a++)this._doLinkifyRow(n.range.first,n.content,this._linkMatchers[a]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},u.prototype.registerLinkMatcher=function(o,d,s){if(s===void 0&&(s={}),!d)throw new Error("handler must be defined");var l={id:this._nextLinkMatcherId++,regex:o,handler:d,matchIndex:s.matchIndex,validationCallback:s.validationCallback,hoverTooltipCallback:s.tooltipCallback,hoverLeaveCallback:s.leaveCallback,willLinkActivate:s.willLinkActivate,priority:s.priority||0};return this._addLinkMatcherToList(l),l.id},u.prototype._addLinkMatcherToList=function(o){if(this._linkMatchers.length!==0){for(var d=this._linkMatchers.length-1;d>=0;d--)if(o.priority<=this._linkMatchers[d].priority)return void this._linkMatchers.splice(d+1,0,o);this._linkMatchers.splice(0,0,o)}else this._linkMatchers.push(o)},u.prototype.deregisterLinkMatcher=function(o){for(var d=0;d<this._linkMatchers.length;d++)if(this._linkMatchers[d].id===o)return this._linkMatchers.splice(d,1),!0;return!1},u.prototype._doLinkifyRow=function(o,d,s){for(var l,r=this,n=new RegExp(s.regex.source,(s.regex.flags||"")+"g"),a=-1,i=function(){var h=l[typeof s.matchIndex!="number"?0:s.matchIndex];if(!h)return f._logService.debug("match found without corresponding matchIndex",l,s),"break";if(a=d.indexOf(h,a+1),n.lastIndex=a+h.length,a<0)return"break";var w=f._bufferService.buffer.stringIndexToBufferIndex(o,a);if(w[0]<0)return"break";var m=f._bufferService.buffer.lines.get(w[0]);if(!m)return"break";var T=m.getFg(w[1]),A=T?T>>9&511:void 0;s.validationCallback?s.validationCallback(h,function(x){r._rowsTimeoutId||x&&r._addLink(w[1],w[0]-r._bufferService.buffer.ydisp,h,s,A)}):f._addLink(w[1],w[0]-f._bufferService.buffer.ydisp,h,s,A)},f=this;(l=n.exec(d))!==null&&!(i()==="break"););},u.prototype._addLink=function(o,d,s,l,r){var n=this;if(this._mouseZoneManager&&this._element){var a=this._unicodeService.getStringCellWidth(s),i=o%this._bufferService.cols,f=d+Math.floor(o/this._bufferService.cols),h=(i+a)%this._bufferService.cols,w=f+Math.floor((i+a)/this._bufferService.cols);h===0&&(h=this._bufferService.cols,w--),this._mouseZoneManager.add(new p(i+1,f+1,h+1,w+1,function(m){if(l.handler)return l.handler(m,s);var T=window.open();T?(T.opener=null,T.location.href=s):console.warn("Opening link blocked as opener could not be cleared")},function(){n._onShowLinkUnderline.fire(n._createLinkHoverEvent(i,f,h,w,r)),n._element.classList.add("xterm-cursor-pointer")},function(m){n._onLinkTooltip.fire(n._createLinkHoverEvent(i,f,h,w,r)),l.hoverTooltipCallback&&l.hoverTooltipCallback(m,s,{start:{x:i,y:f},end:{x:h,y:w}})},function(){n._onHideLinkUnderline.fire(n._createLinkHoverEvent(i,f,h,w,r)),n._element.classList.remove("xterm-cursor-pointer"),l.hoverLeaveCallback&&l.hoverLeaveCallback()},function(m){return!l.willLinkActivate||l.willLinkActivate(m,s)}))}},u.prototype._createLinkHoverEvent=function(o,d,s,l,r){return{x1:o,y1:d,x2:s,y2:l,cols:this._bufferService.cols,fg:r}},u._timeBeforeLatency=200,u=R([O(0,E.IBufferService),O(1,E.ILogService),O(2,E.IUnicodeService)],u)}();k.Linkifier=y;var p=function(u,o,d,s,l,r,n,a,i){this.x1=u,this.y1=o,this.x2=d,this.y2=s,this.clickCallback=l,this.hoverCallback=r,this.tooltipCallback=n,this.leaveCallback=a,this.willLinkActivate=i};k.MouseZone=p},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(h,w){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,T){m.__proto__=T}||function(m,T){for(var A in T)T.hasOwnProperty(A)&&(m[A]=T[A])})(h,w)},function(h,w){function m(){this.constructor=h}R(h,w),h.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),c=this&&this.__decorate||function(h,w,m,T){var A,x=arguments.length,b=x<3?w:T===null?T=Object.getOwnPropertyDescriptor(w,m):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(h,w,m,T);else for(var S=h.length-1;S>=0;S--)(A=h[S])&&(b=(x<3?A(b):x>3?A(w,m,b):A(w,m))||b);return x>3&&b&&Object.defineProperty(w,m,b),b},E=this&&this.__param||function(h,w){return function(m,T){w(m,T,h)}};Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionService=void 0;var y=D(11),p=D(52),u=D(4),o=D(0),d=D(5),s=D(1),l=D(30),r=D(53),n=D(2),a=String.fromCharCode(160),i=new RegExp(a,"g"),f=function(h){function w(m,T,A,x,b,S,C){var g=h.call(this)||this;return g._element=m,g._screenElement=T,g._bufferService=A,g._coreService=x,g._mouseService=b,g._optionsService=S,g._renderService=C,g._dragScrollAmount=0,g._enabled=!0,g._workCell=new u.CellData,g._mouseDownTimeStamp=0,g._onLinuxMouseSelection=g.register(new o.EventEmitter),g._onRedrawRequest=g.register(new o.EventEmitter),g._onSelectionChange=g.register(new o.EventEmitter),g._onRequestScrollLines=g.register(new o.EventEmitter),g._mouseMoveListener=function(M){return g._onMouseMove(M)},g._mouseUpListener=function(M){return g._onMouseUp(M)},g._coreService.onUserInput(function(){g.hasSelection&&g.clearSelection()}),g._trimListener=g._bufferService.buffer.lines.onTrim(function(M){return g._onTrim(M)}),g.register(g._bufferService.buffers.onBufferActivate(function(M){return g._onBufferActivate(M)})),g.enable(),g._model=new p.SelectionModel(g._bufferService),g._activeSelectionMode=0,g}return O(w,h),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,T=this._model.finalSelectionEnd;return!(!m||!T)&&(m[0]!==T[0]||m[1]!==T[1])},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!m||!T)return"";var A=this._bufferService.buffer,x=[];if(this._activeSelectionMode===3){if(m[0]===T[0])return"";for(var b=m[1];b<=T[1];b++){var S=A.translateBufferLineToString(b,!0,m[0],T[0]);x.push(S)}}else{var C=m[1]===T[1]?T[0]:void 0;for(x.push(A.translateBufferLineToString(m[1],!0,m[0],C)),b=m[1]+1;b<=T[1]-1;b++){var g=A.lines.get(b);S=A.translateBufferLineToString(b,!0),g&&g.isWrapped?x[x.length-1]+=S:x.push(S)}m[1]!==T[1]&&(g=A.lines.get(T[1]),S=A.translateBufferLineToString(T[1],!0,0,T[0]),g&&g.isWrapped?x[x.length-1]+=S:x.push(S))}return x.map(function(M){return M.replace(i," ")}).join(y.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 T=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return T._refresh()})),y.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 T=this._getMouseBufferCoords(m),A=this._model.finalSelectionStart,x=this._model.finalSelectionEnd;return!!(A&&x&&T)&&this._areCoordsInSelection(T,A,x)},w.prototype._areCoordsInSelection=function(m,T,A){return m[1]>T[1]&&m[1]<A[1]||T[1]===A[1]&&m[1]===T[1]&&m[0]>=T[0]&&m[0]<A[0]||T[1]<A[1]&&m[1]===A[1]&&m[0]<A[0]||T[1]<A[1]&&m[1]===T[1]&&m[0]>=T[0]},w.prototype.selectWordAtCursor=function(m){var T=this._getMouseBufferCoords(m);T&&(this._selectWordAt(T,!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,T){this._model.clearSelection(),m=Math.max(m,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()},w.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},w.prototype._getMouseBufferCoords=function(m){var T=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T},w.prototype._getMouseEventScrollAmount=function(m){var T=l.getCoordsRelativeToElement(m,this._screenElement)[1],A=this._renderService.dimensions.canvasHeight;return T>=0&&T<=A?0:(T>A&&(T-=A),T=Math.min(Math.max(T,-50),50),(T/=50)/Math.abs(T)+Math.round(14*T))},w.prototype.shouldForceSelection=function(m){return y.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 T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},w.prototype._onDoubleClick=function(m){var T=this._getMouseBufferCoords(m);T&&(this._activeSelectionMode=1,this._selectWordAt(T,!0))},w.prototype._onTripleClick=function(m){var T=this._getMouseBufferCoords(m);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))},w.prototype.shouldColumnSelect=function(m){return m.altKey&&!(y.isMac&&this._optionsService.options.macOptionClickForcesSelection)},w.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var T=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 A=this._bufferService.buffer;if(this._model.selectionEnd[1]<A.lines.length){var x=A.lines.get(this._model.selectionEnd[1]);x&&x.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}T&&T[0]===this._model.selectionEnd[0]&&T[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 T=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&m.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var A=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){var x=r.moveToCellSequence(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(x,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},w.prototype._onBufferActivate=function(m){var T=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(A){return T._onTrim(A)})},w.prototype._convertViewportColToCharacterIndex=function(m,T){for(var A=T[0],x=0;T[0]>=x;x++){var b=m.loadCell(x,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:b>1&&T[0]!==x&&(A+=b-1)}return A},w.prototype.setSelection=function(m,T,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,T],this._model.selectionStartLength=A,this.refresh()},w.prototype._getWordAt=function(m,T,A,x){if(A===void 0&&(A=!0),x===void 0&&(x=!0),!(m[0]>=this._bufferService.cols)){var b=this._bufferService.buffer,S=b.lines.get(m[1]);if(S){var C=b.translateBufferLineToString(m[1],!1),g=this._convertViewportColToCharacterIndex(S,m),M=g,I=m[0]-g,P=0,B=0,H=0,F=0;if(C.charAt(g)===" "){for(;g>0&&C.charAt(g-1)===" ";)g--;for(;M<C.length&&C.charAt(M+1)===" ";)M++}else{var W=m[0],U=m[0];S.getWidth(W)===0&&(P++,W--),S.getWidth(U)===2&&(B++,U++);var K=S.getString(U).length;for(K>1&&(F+=K-1,M+=K-1);W>0&&g>0&&!this._isCharWordSeparator(S.loadCell(W-1,this._workCell));){S.loadCell(W-1,this._workCell);var G=this._workCell.getChars().length;this._workCell.getWidth()===0?(P++,W--):G>1&&(H+=G-1,g-=G-1),g--,W--}for(;U<S.length&&M+1<C.length&&!this._isCharWordSeparator(S.loadCell(U+1,this._workCell));){S.loadCell(U+1,this._workCell);var ee=this._workCell.getChars().length;this._workCell.getWidth()===2?(B++,U++):ee>1&&(F+=ee-1,M+=ee-1),M++,U++}}M++;var de=g+I-P+H,ge=Math.min(this._bufferService.cols,M-g+P+B-H-F);if(T||C.slice(g,M).trim()!==""){if(A&&de===0&&S.getCodePoint(0)!==32){var Be=b.lines.get(m[1]-1);if(Be&&S.isWrapped&&Be.getCodePoint(this._bufferService.cols-1)!==32){var Ue=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Ue){var Le=this._bufferService.cols-Ue.start;de-=Le,ge+=Le}}}if(x&&de+ge===this._bufferService.cols&&S.getCodePoint(this._bufferService.cols-1)!==32){var Me=b.lines.get(m[1]+1);if(Me&&Me.isWrapped&&Me.getCodePoint(0)!==32){var Pe=this._getWordAt([0,m[1]+1],!1,!1,!0);Pe&&(ge+=Pe.length)}}return{start:de,length:ge}}}}},w.prototype._selectWordAt=function(m,T){var A=this._getWordAt(m,T);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[A.start,m[1]],this._model.selectionStartLength=A.length}},w.prototype._selectToWordAt=function(m){var T=this._getWordAt(m,!0);if(T){for(var A=m[1];T.start<0;)T.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,A]}},w.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},w.prototype._selectLineAt=function(m){var T=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,T.first],this._model.selectionEnd=[this._bufferService.cols,T.last],this._model.selectionStartLength=0},w=c([E(2,s.IBufferService),E(3,s.ICoreService),E(4,d.IMouseService),E(5,s.IOptionsService),E(6,d.IRenderService)],w)}(n.Disposable);k.SelectionService=f},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.SelectionModel=void 0;var R=function(){function O(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}return O.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(O.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(O.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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,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}),O.prototype.areSelectionValuesReversed=function(){var c=this.selectionStart,E=this.selectionEnd;return!(!c||!E)&&(c[1]>E[1]||c[1]===E[1]&&c[0]>E[0])},O.prototype.onTrim=function(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},O}();k.SelectionModel=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.moveToCellSequence=void 0;var R=D(12);function O(o,d,s,l){var r=o-c(s,o),n=d-c(s,d);return u(Math.abs(r-n)-function(a,i,f){for(var h=0,w=a-c(f,a),m=i-c(f,i),T=0;T<Math.abs(w-m);T++){var A=E(a,i)==="A"?-1:1,x=f.buffer.lines.get(w+A*T);x&&x.isWrapped&&h++}return h}(o,d,s),p(E(o,d),l))}function c(o,d){for(var s=0,l=o.buffer.lines.get(d),r=l&&l.isWrapped;r&&d>=0&&d<o.rows;)s++,r=(l=o.buffer.lines.get(--d))&&l.isWrapped;return s}function E(o,d){return o>d?"A":"B"}function y(o,d,s,l,r,n){for(var a=o,i=d,f="";a!==s||i!==l;)a+=r?1:-1,r&&a>n.cols-1?(f+=n.buffer.translateBufferLineToString(i,!1,o,a),a=0,o=0,i++):!r&&a<0&&(f+=n.buffer.translateBufferLineToString(i,!1,0,o+1),o=a=n.cols-1,i--);return f+n.buffer.translateBufferLineToString(i,!1,o,a)}function p(o,d){var s=d?"O":"[";return R.C0.ESC+s+o}function u(o,d){o=Math.floor(o);for(var s="",l=0;l<o;l++)s+=d;return s}k.moveToCellSequence=function(o,d,s,l){var r,n=s.buffer.x,a=s.buffer.y;if(!s.buffer.hasScrollback)return function(f,h,w,m,T,A){return O(h,m,T,A).length===0?"":u(y(f,h,f,h-c(T,h),!1,T).length,p("D",A))}(n,a,0,d,s,l)+O(a,d,s,l)+function(f,h,w,m,T,A){var x;x=O(h,m,T,A).length>0?m-c(T,m):h;var b=m,S=function(C,g,M,I,P,B){var H;return H=O(M,I,P,B).length>0?I-c(P,I):g,C<M&&H<=I||C>=M&&H<I?"C":"D"}(f,h,w,m,T,A);return u(y(f,x,w,b,S==="C",T).length,p(S,A))}(n,a,o,d,s,l);if(a===d)return r=n>o?"D":"C",u(Math.abs(n-o),p(r,l));r=a>d?"D":"C";var i=Math.abs(a-d);return u(function(f,h){return h.cols-f}(a>d?o:n,s)+(i-1)*s.cols+1+((a>d?n:o)-1),p(r,l))}},function(j,k,D){"use strict";var R=this&&this.__decorate||function(y,p,u,o){var d,s=arguments.length,l=s<3?p:o===null?o=Object.getOwnPropertyDescriptor(p,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(y,p,u,o);else for(var r=y.length-1;r>=0;r--)(d=y[r])&&(l=(s<3?d(l):s>3?d(p,u,l):d(p,u))||l);return s>3&&l&&Object.defineProperty(p,u,l),l},O=this&&this.__param||function(y,p){return function(u,o){p(u,o,y)}};Object.defineProperty(k,"__esModule",{value:!0}),k.SoundService=void 0;var c=D(1),E=function(){function y(p){this._optionsService=p}return Object.defineProperty(y,"audioContext",{get:function(){if(!y._audioContext){var p=window.AudioContext||window.webkitAudioContext;if(!p)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;y._audioContext=new p}return y._audioContext},enumerable:!1,configurable:!0}),y.prototype.playBellSound=function(){var p=y.audioContext;if(p){var u=p.createBufferSource();p.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(o){u.buffer=o,u.connect(p.destination),u.start(0)})}},y.prototype._base64ToArrayBuffer=function(p){for(var u=window.atob(p),o=u.length,d=new Uint8Array(o),s=0;s<o;s++)d[s]=u.charCodeAt(s);return d.buffer},y.prototype._removeMimeType=function(p){return p.split(",")[1]},y=R([O(0,c.IOptionsService)],y)}();k.SoundService=E},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),c=this&&this.__decorate||function(s,l,r,n){var a,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(a=s[h])&&(f=(i<3?a(f):i>3?a(l,r,f):a(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseZoneManager=void 0;var y=D(2),p=D(7),u=D(5),o=D(1),d=function(s){function l(r,n,a,i,f,h){var w=s.call(this)||this;return w._element=r,w._screenElement=n,w._bufferService=a,w._mouseService=i,w._selectionService=f,w._optionsService=h,w._zones=[],w._areZonesActive=!1,w._lastHoverCoords=[void 0,void 0],w._initialSelectionLength=0,w.register(p.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 O(l,s),l.prototype.dispose=function(){s.prototype.dispose.call(this),this._deactivate()},l.prototype.add=function(r){this._zones.push(r),this._zones.length===1&&this._activate()},l.prototype.clearAll=function(r,n){if(this._zones.length!==0){r&&n||(r=0,n=this._bufferService.rows-1);for(var a=0;a<this._zones.length;a++){var i=this._zones[a];(i.y1>r&&i.y1<=n+1||i.y2>r&&i.y2<=n+1||i.y1<r&&i.y2>n+1)&&(this._currentZone&&this._currentZone===i&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(a--,1))}this._zones.length===0&&this._deactivate()}},l.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))},l.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))},l.prototype._onMouseMove=function(r){this._lastHoverCoords[0]===r.pageX&&this._lastHoverCoords[1]===r.pageY||(this._onHover(r),this._lastHoverCoords=[r.pageX,r.pageY])},l.prototype._onHover=function(r){var n=this,a=this._findZoneEventAt(r);a!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),a&&(this._currentZone=a,a.hoverCallback&&a.hoverCallback(r),this._tooltipTimeout=window.setTimeout(function(){return n._onTooltip(r)},this._optionsService.options.linkTooltipHoverDuration)))},l.prototype._onTooltip=function(r){this._tooltipTimeout=void 0;var n=this._findZoneEventAt(r);n&&n.tooltipCallback&&n.tooltipCallback(r)},l.prototype._onMouseDown=function(r){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var n=this._findZoneEventAt(r);(n==null?void 0:n.willLinkActivate(r))&&(r.preventDefault(),r.stopImmediatePropagation())}},l.prototype._onMouseLeave=function(r){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},l.prototype._onClick=function(r){var n=this._findZoneEventAt(r),a=this._getSelectionLength();n&&a===this._initialSelectionLength&&(n.clickCallback(r),r.preventDefault(),r.stopImmediatePropagation())},l.prototype._getSelectionLength=function(){var r=this._selectionService.selectionText;return r?r.length:0},l.prototype._findZoneEventAt=function(r){var n=this._mouseService.getCoords(r,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(n)for(var a=n[0],i=n[1],f=0;f<this._zones.length;f++){var h=this._zones[f];if(h.y1===h.y2){if(i===h.y1&&a>=h.x1&&a<h.x2)return h}else if(i===h.y1&&a>=h.x1||i===h.y2&&a<h.x2||i>h.y1&&i<h.y2)return h}},l=c([E(2,o.IBufferService),E(3,u.IMouseService),E(4,u.ISelectionService),E(5,o.IOptionsService)],l)}(y.Disposable);k.MouseZoneManager=d},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(l,r){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)a.hasOwnProperty(i)&&(n[i]=a[i])})(l,r)},function(l,r){function n(){this.constructor=l}R(l,r),l.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)});Object.defineProperty(k,"__esModule",{value:!0}),k.AccessibilityManager=void 0;var c=D(18),E=D(11),y=D(31),p=D(7),u=D(2),o=D(32),d=D(17),s=function(l){function r(n,a){var i=l.call(this)||this;i._terminal=n,i._renderService=a,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowContainer.setAttribute("role","list"),i._rowElements=[];for(var f=0;f<i._terminal.rows;f++)i._rowElements[f]=i._createAccessibilityTreeNode(),i._rowContainer.appendChild(i._rowElements[f]);if(i._topBoundaryFocusListener=function(h){return i._onBoundaryFocus(h,0)},i._bottomBoundaryFocusListener=function(h){return i._onBoundaryFocus(h,1)},i._rowElements[0].addEventListener("focus",i._topBoundaryFocusListener),i._rowElements[i._rowElements.length-1].addEventListener("focus",i._bottomBoundaryFocusListener),i._refreshRowsDimensions(),i._accessibilityTreeRoot.appendChild(i._rowContainer),i._renderRowsDebouncer=new y.RenderDebouncer(i._renderRows.bind(i)),i._refreshRows(),i._liveRegion=document.createElement("div"),i._liveRegion.classList.add("live-region"),i._liveRegion.setAttribute("aria-live","assertive"),i._accessibilityTreeRoot.appendChild(i._liveRegion),!i._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return i._terminal.element.insertAdjacentElement("afterbegin",i._accessibilityTreeRoot),i.register(i._renderRowsDebouncer),i.register(i._terminal.onResize(function(h){return i._onResize(h.rows)})),i.register(i._terminal.onRender(function(h){return i._refreshRows(h.start,h.end)})),i.register(i._terminal.onScroll(function(){return i._refreshRows()})),i.register(i._terminal.onA11yChar(function(h){return i._onChar(h)})),i.register(i._terminal.onLineFeed(function(){return i._onChar(`
|
|
|
`)})),i.register(i._terminal.onA11yTab(function(h){return i._onTab(h)})),i.register(i._terminal.onKey(function(h){return i._onKey(h.key)})),i.register(i._terminal.onBlur(function(){return i._clearLiveRegion()})),i.register(i._renderService.onDimensionsChange(function(){return i._refreshRowsDimensions()})),i._screenDprMonitor=new o.ScreenDprMonitor,i.register(i._screenDprMonitor),i._screenDprMonitor.setListener(function(){return i._refreshRowsDimensions()}),i.register(p.addDisposableDomListener(window,"resize",function(){return i._refreshRowsDimensions()})),i}return O(r,l),r.prototype.dispose=function(){l.prototype.dispose.call(this),d.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},r.prototype._onBoundaryFocus=function(n,a){var i=n.target,f=this._rowElements[a===0?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(a===0?"1":""+this._terminal.buffer.lines.length)&&n.relatedTarget===f){var h,w;if(a===0?(h=i,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(h=this._rowElements.shift(),w=i,this._rowContainer.removeChild(h)),h.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),a===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(a===0?-1:1),this._rowElements[a===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}},r.prototype._onResize=function(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var a=this._rowContainer.children.length;a<this._terminal.rows;a++)this._rowElements[a]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[a]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},r.prototype._createAccessibilityTreeNode=function(){var n=document.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n},r.prototype._onTab=function(n){for(var a=0;a<n;a++)this._onChar(" ")},r.prototype._onChar=function(n){var a=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==n&&(this._charsToAnnounce+=n):this._charsToAnnounce+=n,n===`
|
|
|
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=c.tooMuchOutput)),E.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){a._accessibilityTreeRoot.appendChild(a._liveRegion)},0))},r.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,E.isMac&&d.removeElementFromParent(this._liveRegion)},r.prototype._onKey=function(n){this._clearLiveRegion(),this._charsToConsume.push(n)},r.prototype._refreshRows=function(n,a){this._renderRowsDebouncer.refresh(n,a,this._terminal.rows)},r.prototype._renderRows=function(n,a){for(var i=this._terminal.buffer,f=i.lines.length.toString(),h=n;h<=a;h++){var w=i.translateBufferLineToString(i.ydisp+h,!0),m=(i.ydisp+h+1).toString(),T=this._rowElements[h];T&&(w.length===0?T.innerHTML=" ":T.textContent=w,T.setAttribute("aria-posinset",m),T.setAttribute("aria-setsize",f))}this._announceCharacters()},r.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}},r.prototype._refreshRowDimensions=function(n){n.style.height=this._renderService.dimensions.actualCellHeight+"px"},r.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},r}(u.Disposable);k.AccessibilityManager=s},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(i,f){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,w){h.__proto__=w}||function(h,w){for(var m in w)w.hasOwnProperty(m)&&(h[m]=w[m])})(i,f)},function(i,f){function h(){this.constructor=i}R(i,f),i.prototype=f===null?Object.create(f):(h.prototype=f.prototype,new h)}),c=this&&this.__decorate||function(i,f,h,w){var m,T=arguments.length,A=T<3?f:w===null?w=Object.getOwnPropertyDescriptor(f,h):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(i,f,h,w);else for(var x=i.length-1;x>=0;x--)(m=i[x])&&(A=(T<3?m(A):T>3?m(f,h,A):m(f,h))||A);return T>3&&A&&Object.defineProperty(f,h,A),A},E=this&&this.__param||function(i,f){return function(h,w){f(h,w,i)}};Object.defineProperty(k,"__esModule",{value:!0}),k.DomRenderer=void 0;var y=D(58),p=D(9),u=D(2),o=D(5),d=D(1),s=D(0),l=D(10),r=D(17),n=1,a=function(i){function f(h,w,m,T,A,x,b,S,C){var g=i.call(this)||this;return g._colors=h,g._element=w,g._screenElement=m,g._viewportElement=T,g._linkifier=A,g._linkifier2=x,g._charSizeService=b,g._optionsService=S,g._bufferService=C,g._terminalClass=n++,g._rowElements=[],g._rowContainer=document.createElement("div"),g._rowContainer.classList.add("xterm-rows"),g._rowContainer.style.lineHeight="normal",g._rowContainer.setAttribute("aria-hidden","true"),g._refreshRowElements(g._bufferService.cols,g._bufferService.rows),g._selectionContainer=document.createElement("div"),g._selectionContainer.classList.add("xterm-selection"),g._selectionContainer.setAttribute("aria-hidden","true"),g.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},g._updateDimensions(),g._injectCss(),g._rowFactory=new y.DomRendererRowFactory(document,g._optionsService,g._colors),g._element.classList.add("xterm-dom-renderer-owner-"+g._terminalClass),g._screenElement.appendChild(g._rowContainer),g._screenElement.appendChild(g._selectionContainer),g._linkifier.onShowLinkUnderline(function(M){return g._onLinkHover(M)}),g._linkifier.onHideLinkUnderline(function(M){return g._onLinkLeave(M)}),g._linkifier2.onShowLinkUnderline(function(M){return g._onLinkHover(M)}),g._linkifier2.onHideLinkUnderline(function(M){return g._onLinkLeave(M)}),g}return O(f,i),Object.defineProperty(f.prototype,"onRequestRedraw",{get:function(){return new s.EventEmitter().event},enumerable:!1,configurable:!0}),f.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),r.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),i.prototype.dispose.call(this)},f.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 h=0,w=this._rowElements;h<w.length;h++){var m=w[h];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 T=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=T,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},f.prototype.setColors=function(h){this._colors=h,this._injectCss()},f.prototype._injectCss=function(){var h=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(."+y.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+y.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+y.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) ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_BLINK_CLASS+":not(."+y.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_BLINK_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+y.CURSOR_CLASS+"."+y.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+y.CURSOR_CLASS+"."+y.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,T){w+=h._terminalSelector+" .xterm-fg-"+T+" { color: "+m.css+"; }"+h._terminalSelector+" .xterm-bg-"+T+" { background-color: "+m.css+"; }"}),w+=this._terminalSelector+" .xterm-fg-"+p.INVERTED_DEFAULT_COLOR+" { color: "+l.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+p.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=w},f.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},f.prototype._refreshRowElements=function(h,w){for(var m=this._rowElements.length;m<=w;m++){var T=document.createElement("div");this._rowContainer.appendChild(T),this._rowElements.push(T)}for(;this._rowElements.length>w;)this._rowContainer.removeChild(this._rowElements.pop())},f.prototype.onResize=function(h,w){this._refreshRowElements(h,w),this._updateDimensions()},f.prototype.onCharSizeChanged=function(){this._updateDimensions()},f.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},f.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},f.prototype.onSelectionChanged=function(h,w,m){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(h&&w){var T=h[1]-this._bufferService.buffer.ydisp,A=w[1]-this._bufferService.buffer.ydisp,x=Math.max(T,0),b=Math.min(A,this._bufferService.rows-1);if(!(x>=this._bufferService.rows||b<0)){var S=document.createDocumentFragment();if(m)S.appendChild(this._createSelectionElement(x,h[0],w[0],b-x+1));else{var C=T===x?h[0]:0,g=x===b?w[0]:this._bufferService.cols;S.appendChild(this._createSelectionElement(x,C,g));var M=b-x-1;if(S.appendChild(this._createSelectionElement(x+1,0,this._bufferService.cols,M)),x!==b){var I=A===b?w[0]:this._bufferService.cols;S.appendChild(this._createSelectionElement(b,0,I))}}this._selectionContainer.appendChild(S)}}},f.prototype._createSelectionElement=function(h,w,m,T){T===void 0&&(T=1);var A=document.createElement("div");return A.style.height=T*this.dimensions.actualCellHeight+"px",A.style.top=h*this.dimensions.actualCellHeight+"px",A.style.left=w*this.dimensions.actualCellWidth+"px",A.style.width=this.dimensions.actualCellWidth*(m-w)+"px",A},f.prototype.onCursorMove=function(){},f.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},f.prototype.clear=function(){for(var h=0,w=this._rowElements;h<w.length;h++)w[h].innerHTML=""},f.prototype.renderRows=function(h,w){for(var m=this._bufferService.buffer.ybase+this._bufferService.buffer.y,T=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),A=this._optionsService.options.cursorBlink,x=h;x<=w;x++){var b=this._rowElements[x];b.innerHTML="";var S=x+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(S),g=this._optionsService.options.cursorStyle;b.appendChild(this._rowFactory.createRow(C,S===m,g,T,A,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(f.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),f.prototype.registerCharacterJoiner=function(h){return-1},f.prototype.deregisterCharacterJoiner=function(h){return!1},f.prototype._onLinkHover=function(h){this._setCellUnderline(h.x1,h.x2,h.y1,h.y2,h.cols,!0)},f.prototype._onLinkLeave=function(h){this._setCellUnderline(h.x1,h.x2,h.y1,h.y2,h.cols,!1)},f.prototype._setCellUnderline=function(h,w,m,T,A,x){for(;h!==w||m!==T;){var b=this._rowElements[m];if(!b)return;var S=b.children[h];S&&(S.style.textDecoration=x?"underline":"none"),++h>=A&&(h=0,m++)}},f=c([E(6,o.ICharSizeService),E(7,d.IOptionsService),E(8,d.IBufferService)],f)}(u.Disposable);k.DomRenderer=a},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.DomRendererRowFactory=k.CURSOR_STYLE_UNDERLINE_CLASS=k.CURSOR_STYLE_BAR_CLASS=k.CURSOR_STYLE_BLOCK_CLASS=k.CURSOR_BLINK_CLASS=k.CURSOR_CLASS=k.UNDERLINE_CLASS=k.ITALIC_CLASS=k.DIM_CLASS=k.BOLD_CLASS=void 0;var R=D(9),O=D(3),c=D(4),E=D(10);k.BOLD_CLASS="xterm-bold",k.DIM_CLASS="xterm-dim",k.ITALIC_CLASS="xterm-italic",k.UNDERLINE_CLASS="xterm-underline",k.CURSOR_CLASS="xterm-cursor",k.CURSOR_BLINK_CLASS="xterm-cursor-blink",k.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",k.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",k.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var y=function(){function u(o,d,s){this._document=o,this._optionsService=d,this._colors=s,this._workCell=new c.CellData}return u.prototype.setColors=function(o){this._colors=o},u.prototype.createRow=function(o,d,s,l,r,n,a){for(var i=this._document.createDocumentFragment(),f=0,h=Math.min(o.length,a)-1;h>=0;h--)if(o.loadCell(h,this._workCell).getCode()!==O.NULL_CELL_CODE||d&&h===l){f=h+1;break}for(h=0;h<f;h++){o.loadCell(h,this._workCell);var w=this._workCell.getWidth();if(w!==0){var m=this._document.createElement("span");if(w>1&&(m.style.width=n*w+"px"),d&&h===l)switch(m.classList.add(k.CURSOR_CLASS),r&&m.classList.add(k.CURSOR_BLINK_CLASS),s){case"bar":m.classList.add(k.CURSOR_STYLE_BAR_CLASS);break;case"underline":m.classList.add(k.CURSOR_STYLE_UNDERLINE_CLASS);break;default:m.classList.add(k.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&m.classList.add(k.BOLD_CLASS),this._workCell.isItalic()&&m.classList.add(k.ITALIC_CLASS),this._workCell.isDim()&&m.classList.add(k.DIM_CLASS),this._workCell.isUnderline()&&m.classList.add(k.UNDERLINE_CLASS),this._workCell.isInvisible()?m.textContent=O.WHITESPACE_CELL_CHAR:m.textContent=this._workCell.getChars()||O.WHITESPACE_CELL_CHAR;var T=this._workCell.getFgColor(),A=this._workCell.getFgColorMode(),x=this._workCell.getBgColor(),b=this._workCell.getBgColorMode(),S=!!this._workCell.isInverse();if(S){var C=T;T=x,x=C;var g=A;A=b,b=g}switch(A){case 16777216:case 33554432:this._workCell.isBold()&&T<8&&this._optionsService.options.drawBoldTextInBrightColors&&(T+=8),this._applyMinimumContrast(m,this._colors.background,this._colors.ansi[T])||m.classList.add("xterm-fg-"+T);break;case 50331648:var M=E.rgba.toColor(T>>16&255,T>>8&255,255&T);this._applyMinimumContrast(m,this._colors.background,M)||this._addStyle(m,"color:#"+p(T.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(m,this._colors.background,this._colors.foreground)||S&&m.classList.add("xterm-fg-"+R.INVERTED_DEFAULT_COLOR)}switch(b){case 16777216:case 33554432:m.classList.add("xterm-bg-"+x);break;case 50331648:this._addStyle(m,"background-color:#"+p(x.toString(16),"0",6));break;case 0:default:S&&m.classList.add("xterm-bg-"+R.INVERTED_DEFAULT_COLOR)}i.appendChild(m)}}return i},u.prototype._applyMinimumContrast=function(o,d,s){if(this._optionsService.options.minimumContrastRatio===1)return!1;var l=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return l===void 0&&(l=E.color.ensureContrastRatio(d,s,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,l!=null?l:null)),!!l&&(this._addStyle(o,"color:"+l.css),!0)},u.prototype._addStyle=function(o,d){o.setAttribute("style",""+(o.getAttribute("style")||"")+d+";")},u}();function p(u,o,d){for(;u.length<d;)u=o+u;return u}k.DomRendererRowFactory=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.evaluateKeyboardEvent=void 0;var R=D(12),O={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:["'",'"']};k.evaluateKeyboardEvent=function(c,E,y,p){var u={type:0,cancel:!1,key:void 0},o=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:c.key==="UIKeyInputUpArrow"?u.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A":c.key==="UIKeyInputLeftArrow"?u.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D":c.key==="UIKeyInputRightArrow"?u.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C":c.key==="UIKeyInputDownArrow"&&(u.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B");break;case 8:if(c.shiftKey){u.key=R.C0.BS;break}if(c.altKey){u.key=R.C0.ESC+R.C0.DEL;break}u.key=R.C0.DEL;break;case 9:if(c.shiftKey){u.key=R.C0.ESC+"[Z";break}u.key=R.C0.HT,u.cancel=!0;break;case 13:u.key=c.altKey?R.C0.ESC+R.C0.CR:R.C0.CR,u.cancel=!0;break;case 27:u.key=R.C0.ESC,c.altKey&&(u.key=R.C0.ESC+R.C0.ESC),u.cancel=!0;break;case 37:if(c.metaKey)break;o?(u.key=R.C0.ESC+"[1;"+(o+1)+"D",u.key===R.C0.ESC+"[1;3D"&&(u.key=R.C0.ESC+(y?"b":"[1;5D"))):u.key=E?R.C0.ESC+"OD":R.C0.ESC+"[D";break;case 39:if(c.metaKey)break;o?(u.key=R.C0.ESC+"[1;"+(o+1)+"C",u.key===R.C0.ESC+"[1;3C"&&(u.key=R.C0.ESC+(y?"f":"[1;5C"))):u.key=E?R.C0.ESC+"OC":R.C0.ESC+"[C";break;case 38:if(c.metaKey)break;o?(u.key=R.C0.ESC+"[1;"+(o+1)+"A",y||u.key!==R.C0.ESC+"[1;3A"||(u.key=R.C0.ESC+"[1;5A")):u.key=E?R.C0.ESC+"OA":R.C0.ESC+"[A";break;case 40:if(c.metaKey)break;o?(u.key=R.C0.ESC+"[1;"+(o+1)+"B",y||u.key!==R.C0.ESC+"[1;3B"||(u.key=R.C0.ESC+"[1;5B")):u.key=E?R.C0.ESC+"OB":R.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(u.key=R.C0.ESC+"[2~");break;case 46:u.key=o?R.C0.ESC+"[3;"+(o+1)+"~":R.C0.ESC+"[3~";break;case 36:u.key=o?R.C0.ESC+"[1;"+(o+1)+"H":E?R.C0.ESC+"OH":R.C0.ESC+"[H";break;case 35:u.key=o?R.C0.ESC+"[1;"+(o+1)+"F":E?R.C0.ESC+"OF":R.C0.ESC+"[F";break;case 33:c.shiftKey?u.type=2:u.key=R.C0.ESC+"[5~";break;case 34:c.shiftKey?u.type=3:u.key=R.C0.ESC+"[6~";break;case 112:u.key=o?R.C0.ESC+"[1;"+(o+1)+"P":R.C0.ESC+"OP";break;case 113:u.key=o?R.C0.ESC+"[1;"+(o+1)+"Q":R.C0.ESC+"OQ";break;case 114:u.key=o?R.C0.ESC+"[1;"+(o+1)+"R":R.C0.ESC+"OR";break;case 115:u.key=o?R.C0.ESC+"[1;"+(o+1)+"S":R.C0.ESC+"OS";break;case 116:u.key=o?R.C0.ESC+"[15;"+(o+1)+"~":R.C0.ESC+"[15~";break;case 117:u.key=o?R.C0.ESC+"[17;"+(o+1)+"~":R.C0.ESC+"[17~";break;case 118:u.key=o?R.C0.ESC+"[18;"+(o+1)+"~":R.C0.ESC+"[18~";break;case 119:u.key=o?R.C0.ESC+"[19;"+(o+1)+"~":R.C0.ESC+"[19~";break;case 120:u.key=o?R.C0.ESC+"[20;"+(o+1)+"~":R.C0.ESC+"[20~";break;case 121:u.key=o?R.C0.ESC+"[21;"+(o+1)+"~":R.C0.ESC+"[21~";break;case 122:u.key=o?R.C0.ESC+"[23;"+(o+1)+"~":R.C0.ESC+"[23~";break;case 123:u.key=o?R.C0.ESC+"[24;"+(o+1)+"~":R.C0.ESC+"[24~";break;default:if(!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)if(y&&!p||!c.altKey||c.metaKey)y&&!c.altKey&&!c.ctrlKey&&c.metaKey?c.keyCode===65&&(u.type=1):c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&c.keyCode>=48&&c.key.length===1?u.key=c.key:c.key&&c.ctrlKey&&c.key==="_"&&(u.key=R.C0.US);else{var d=O[c.keyCode],s=d&&d[c.shiftKey?1:0];if(s)u.key=R.C0.ESC+s;else if(c.keyCode>=65&&c.keyCode<=90){var l=c.ctrlKey?c.keyCode-64:c.keyCode+32;u.key=R.C0.ESC+String.fromCharCode(l)}}else c.keyCode>=65&&c.keyCode<=90?u.key=String.fromCharCode(c.keyCode-64):c.keyCode===32?u.key=R.C0.NUL:c.keyCode>=51&&c.keyCode<=55?u.key=String.fromCharCode(c.keyCode-51+27):c.keyCode===56?u.key=R.C0.DEL:c.keyCode===219?u.key=R.C0.ESC:c.keyCode===220?u.key=R.C0.FS:c.keyCode===221&&(u.key=R.C0.GS)}return u}},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(n,a){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,f){i.__proto__=f}||function(i,f){for(var h in f)f.hasOwnProperty(h)&&(i[h]=f[h])})(n,a)},function(n,a){function i(){this.constructor=n}R(n,a),n.prototype=a===null?Object.create(a):(i.prototype=a.prototype,new i)}),c=this&&this.__decorate||function(n,a,i,f){var h,w=arguments.length,m=w<3?a:f===null?f=Object.getOwnPropertyDescriptor(a,i):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,a,i,f);else for(var T=n.length-1;T>=0;T--)(h=n[T])&&(m=(w<3?h(m):w>3?h(a,i,m):h(a,i))||m);return w>3&&m&&Object.defineProperty(a,i,m),m},E=this&&this.__param||function(n,a){return function(i,f){a(i,f,n)}};Object.defineProperty(k,"__esModule",{value:!0}),k.RenderService=void 0;var y=D(31),p=D(0),u=D(2),o=D(32),d=D(7),s=D(1),l=D(5),r=function(n){function a(i,f,h,w,m,T){var A=n.call(this)||this;if(A._renderer=i,A._rowCount=f,A._isPaused=!1,A._needsFullRefresh=!1,A._isNextRenderRedrawOnly=!0,A._needsSelectionRefresh=!1,A._canvasWidth=0,A._canvasHeight=0,A._selectionState={start:void 0,end:void 0,columnSelectMode:!1},A._onDimensionsChange=new p.EventEmitter,A._onRender=new p.EventEmitter,A._onRefreshRequest=new p.EventEmitter,A.register({dispose:function(){return A._renderer.dispose()}}),A._renderDebouncer=new y.RenderDebouncer(function(b,S){return A._renderRows(b,S)}),A.register(A._renderDebouncer),A._screenDprMonitor=new o.ScreenDprMonitor,A._screenDprMonitor.setListener(function(){return A.onDevicePixelRatioChange()}),A.register(A._screenDprMonitor),A.register(T.onResize(function(b){return A._fullRefresh()})),A.register(w.onOptionChange(function(){return A._renderer.onOptionsChanged()})),A.register(m.onCharSizeChange(function(){return A.onCharSizeChanged()})),A._renderer.onRequestRedraw(function(b){return A.refreshRows(b.start,b.end,!0)}),A.register(d.addDisposableDomListener(window,"resize",function(){return A.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var x=new IntersectionObserver(function(b){return A._onIntersectionChange(b[b.length-1])},{threshold:0});x.observe(h),A.register({dispose:function(){return x.disconnect()}})}return A}return O(a,n),Object.defineProperty(a.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),a.prototype._onIntersectionChange=function(i){this._isPaused=i.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},a.prototype.refreshRows=function(i,f,h){h===void 0&&(h=!1),this._isPaused?this._needsFullRefresh=!0:(h||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,f,this._rowCount))},a.prototype._renderRows=function(i,f){this._renderer.renderRows(i,f),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:i,end:f}),this._isNextRenderRedrawOnly=!0},a.prototype.resize=function(i,f){this._rowCount=f,this._fireOnCanvasResize()},a.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},a.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},a.prototype.dispose=function(){n.prototype.dispose.call(this)},a.prototype.setRenderer=function(i){var f=this;this._renderer.dispose(),this._renderer=i,this._renderer.onRequestRedraw(function(h){return f.refreshRows(h.start,h.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},a.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},a.prototype.setColors=function(i){this._renderer.setColors(i),this._fullRefresh()},a.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},a.prototype.onResize=function(i,f){this._renderer.onResize(i,f),this._fullRefresh()},a.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},a.prototype.onBlur=function(){this._renderer.onBlur()},a.prototype.onFocus=function(){this._renderer.onFocus()},a.prototype.onSelectionChanged=function(i,f,h){this._selectionState.start=i,this._selectionState.end=f,this._selectionState.columnSelectMode=h,this._renderer.onSelectionChanged(i,f,h)},a.prototype.onCursorMove=function(){this._renderer.onCursorMove()},a.prototype.clear=function(){this._renderer.clear()},a.prototype.registerCharacterJoiner=function(i){return this._renderer.registerCharacterJoiner(i)},a.prototype.deregisterCharacterJoiner=function(i){return this._renderer.deregisterCharacterJoiner(i)},a=c([E(3,s.IOptionsService),E(4,l.ICharSizeService),E(5,s.IBufferService)],a)}(u.Disposable);k.RenderService=r},function(j,k,D){"use strict";var R=this&&this.__decorate||function(u,o,d,s){var l,r=arguments.length,n=r<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,d):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(u,o,d,s);else for(var a=u.length-1;a>=0;a--)(l=u[a])&&(n=(r<3?l(n):r>3?l(o,d,n):l(o,d))||n);return r>3&&n&&Object.defineProperty(o,d,n),n},O=this&&this.__param||function(u,o){return function(d,s){o(d,s,u)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CharSizeService=void 0;var c=D(1),E=D(0),y=function(){function u(o,d,s){this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=new E.EventEmitter,this._measureStrategy=new p(o,d,this._optionsService)}return Object.defineProperty(u.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),u.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())},u=R([O(2,c.IOptionsService)],u)}();k.CharSizeService=y;var p=function(){function u(o,d,s){this._document=o,this._parentElement=d,this._optionsService=s,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 u.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},u}()},function(j,k,D){"use strict";var R=this&&this.__decorate||function(p,u,o,d){var s,l=arguments.length,r=l<3?u:d===null?d=Object.getOwnPropertyDescriptor(u,o):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(p,u,o,d);else for(var n=p.length-1;n>=0;n--)(s=p[n])&&(r=(l<3?s(r):l>3?s(u,o,r):s(u,o))||r);return l>3&&r&&Object.defineProperty(u,o,r),r},O=this&&this.__param||function(p,u){return function(o,d){u(o,d,p)}};Object.defineProperty(k,"__esModule",{value:!0}),k.MouseService=void 0;var c=D(5),E=D(30),y=function(){function p(u,o){this._renderService=u,this._charSizeService=o}return p.prototype.getCoords=function(u,o,d,s,l){return E.getCoords(u,o,d,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,l)},p.prototype.getRawByteCoords=function(u,o,d,s){var l=this.getCoords(u,o,d,s);return E.getRawByteCoords(l)},p=R([O(0,c.IRenderService),O(1,c.ICharSizeService)],p)}();k.MouseService=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),c=this&&this.__decorate||function(s,l,r,n){var a,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(a=s[h])&&(f=(i<3?a(f):i>3?a(l,r,f):a(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.Linkifier2=void 0;var y=D(1),p=D(0),u=D(2),o=D(7),d=function(s){function l(r){var n=s.call(this)||this;return n._bufferService=r,n._linkProviders=[],n._linkCacheDisposables=[],n._isMouseOut=!0,n._activeLine=-1,n._onShowLinkUnderline=n.register(new p.EventEmitter),n._onHideLinkUnderline=n.register(new p.EventEmitter),n.register(u.getDisposeArrayDisposable(n._linkCacheDisposables)),n}return O(l,s),Object.defineProperty(l.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),l.prototype.registerLinkProvider=function(r){var n=this;return this._linkProviders.push(r),{dispose:function(){var a=n._linkProviders.indexOf(r);a!==-1&&n._linkProviders.splice(a,1)}}},l.prototype.attachToDom=function(r,n,a){var i=this;this._element=r,this._mouseService=n,this._renderService=a,this.register(o.addDisposableDomListener(this._element,"mouseleave",function(){i._isMouseOut=!0,i._clearCurrentLink()})),this.register(o.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(o.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},l.prototype._onMouseMove=function(r){if(this._lastMouseEvent=r,this._element&&this._mouseService){var n=this._positionFromMouseEvent(r,this._element,this._mouseService);if(n){this._isMouseOut=!1;for(var a=r.composedPath(),i=0;i<a.length;i++){var f=a[i];if(f.classList.contains("xterm"))break;if(f.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._onHover(n),this._lastBufferCell=n)}}},l.prototype._onHover=function(r){if(this._activeLine!==r.y)return this._clearCurrentLink(),void this._askForLink(r,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,r)||(this._clearCurrentLink(),this._askForLink(r,!0))},l.prototype._askForLink=function(r,n){var a=this;this._activeProviderReplies&&n||(this._activeProviderReplies=new Map,this._activeLine=r.y);var i=!1;this._linkProviders.forEach(function(f,h){var w;n?((w=a._activeProviderReplies)===null||w===void 0?void 0:w.get(h))&&(i=a._checkLinkProviderResult(h,r,i)):f.provideLinks(r.y,function(m){var T,A;if(!a._isMouseOut){var x=m==null?void 0:m.map(function(b){return{link:b}});(T=a._activeProviderReplies)===null||T===void 0||T.set(h,x),i=a._checkLinkProviderResult(h,r,i),((A=a._activeProviderReplies)===null||A===void 0?void 0:A.size)===a._linkProviders.length&&a._removeIntersectingLinks(r.y,a._activeProviderReplies)}})})},l.prototype._removeIntersectingLinks=function(r,n){for(var a=new Set,i=0;i<n.size;i++){var f=n.get(i);if(f)for(var h=0;h<f.length;h++)for(var w=f[h],m=w.link.range.start.y<r?0:w.link.range.start.x,T=w.link.range.end.y>r?this._bufferService.cols:w.link.range.end.x,A=m;A<=T;A++){if(a.has(A)){f.splice(h--,1);break}a.add(A)}}},l.prototype._checkLinkProviderResult=function(r,n,a){var i,f=this;if(!this._activeProviderReplies)return a;for(var h=this._activeProviderReplies.get(r),w=!1,m=0;m<r;m++)this._activeProviderReplies.has(m)&&!this._activeProviderReplies.get(m)||(w=!0);if(!w&&h){var T=h.find(function(x){return f._linkAtPosition(x.link,n)});T&&(a=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviders.length&&!a)for(m=0;m<this._activeProviderReplies.size;m++){var A=(i=this._activeProviderReplies.get(m))===null||i===void 0?void 0:i.find(function(x){return f._linkAtPosition(x.link,n)});if(A){a=!0,this._handleNewLink(A);break}}return a},l.prototype._onClick=function(r){if(this._element&&this._mouseService&&this._currentLink){var n=this._positionFromMouseEvent(r,this._element,this._mouseService);n&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(r,this._currentLink.link.text)}},l.prototype._clearCurrentLink=function(r,n){this._element&&this._currentLink&&this._lastMouseEvent&&(!r||!n||this._currentLink.link.range.start.y>=r&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,u.disposeArray(this._linkCacheDisposables))},l.prototype._handleNewLink=function(r){var n=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(r.link,a)&&(this._currentLink=r,this._currentLink.state={decorations:{underline:r.link.decorations===void 0||r.link.decorations.underline,pointerCursor:r.link.decorations===void 0||r.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,r.link,this._lastMouseEvent),r.link.decorations={},Object.defineProperties(r.link.decorations,{pointerCursor:{get:function(){var i,f;return(f=(i=n._currentLink)===null||i===void 0?void 0:i.state)===null||f===void 0?void 0:f.decorations.pointerCursor},set:function(i){var f,h;((f=n._currentLink)===null||f===void 0?void 0:f.state)&&n._currentLink.state.decorations.pointerCursor!==i&&(n._currentLink.state.decorations.pointerCursor=i,n._currentLink.state.isHovered&&((h=n._element)===null||h===void 0||h.classList.toggle("xterm-cursor-pointer",i)))}},underline:{get:function(){var i,f;return(f=(i=n._currentLink)===null||i===void 0?void 0:i.state)===null||f===void 0?void 0:f.decorations.underline},set:function(i){var f,h,w;((f=n._currentLink)===null||f===void 0?void 0:f.state)&&((w=(h=n._currentLink)===null||h===void 0?void 0:h.state)===null||w===void 0?void 0:w.decorations.underline)!==i&&(n._currentLink.state.decorations.underline=i,n._currentLink.state.isHovered&&n._fireUnderlineEvent(r.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(i){var f=i.start===0?0:i.start+1+n._bufferService.buffer.ydisp;n._clearCurrentLink(f,i.end+1+n._bufferService.buffer.ydisp)})))}},l.prototype._linkHover=function(r,n,a){var i;((i=this._currentLink)===null||i===void 0?void 0:i.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&r.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(a,n.text)},l.prototype._fireUnderlineEvent=function(r,n){var a=r.range,i=this._bufferService.buffer.ydisp,f=this._createLinkUnderlineEvent(a.start.x-1,a.start.y-i-1,a.end.x,a.end.y-i-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(f)},l.prototype._linkLeave=function(r,n,a){var i;((i=this._currentLink)===null||i===void 0?void 0:i.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&r.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(a,n.text)},l.prototype._linkAtPosition=function(r,n){var a=r.range.start.y===r.range.end.y,i=r.range.start.y<n.y,f=r.range.end.y>n.y;return(a&&r.range.start.x<=n.x&&r.range.end.x>=n.x||i&&r.range.end.x>=n.x||f&&r.range.start.x<=n.x||i&&f)&&r.range.start.y<=n.y&&r.range.end.y>=n.y},l.prototype._positionFromMouseEvent=function(r,n,a){var i=a.getCoords(r,n,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}},l.prototype._createLinkUnderlineEvent=function(r,n,a,i,f){return{x1:r,y1:n,x2:a,y2:i,cols:this._bufferService.cols,fg:f}},l=c([E(0,y.IBufferService)],l)}(u.Disposable);k.Linkifier2=d},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CoreBrowserService=void 0;var R=function(){function O(c){this._textarea=c}return Object.defineProperty(O.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),O}();k.CoreBrowserService=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(m,T){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,x){A.__proto__=x}||function(A,x){for(var b in x)x.hasOwnProperty(b)&&(A[b]=x[b])})(m,T)},function(m,T){function A(){this.constructor=m}R(m,T),m.prototype=T===null?Object.create(T):(A.prototype=T.prototype,new A)});Object.defineProperty(k,"__esModule",{value:!0}),k.CoreTerminal=void 0;var c=D(2),E=D(1),y=D(66),p=D(67),u=D(68),o=D(74),d=D(75),s=D(0),l=D(76),r=D(77),n=D(78),a=D(80),i=D(81),f=D(19),h=D(82),w=function(m){function T(A){var x=m.call(this)||this;return x._onBinary=new s.EventEmitter,x._onData=new s.EventEmitter,x._onLineFeed=new s.EventEmitter,x._onResize=new s.EventEmitter,x._onScroll=new s.EventEmitter,x._instantiationService=new y.InstantiationService,x.optionsService=new o.OptionsService(A),x._instantiationService.setService(E.IOptionsService,x.optionsService),x._bufferService=x.register(x._instantiationService.createInstance(u.BufferService)),x._instantiationService.setService(E.IBufferService,x._bufferService),x._logService=x._instantiationService.createInstance(p.LogService),x._instantiationService.setService(E.ILogService,x._logService),x._coreService=x.register(x._instantiationService.createInstance(d.CoreService,function(){return x.scrollToBottom()})),x._instantiationService.setService(E.ICoreService,x._coreService),x._coreMouseService=x._instantiationService.createInstance(l.CoreMouseService),x._instantiationService.setService(E.ICoreMouseService,x._coreMouseService),x._dirtyRowService=x._instantiationService.createInstance(r.DirtyRowService),x._instantiationService.setService(E.IDirtyRowService,x._dirtyRowService),x.unicodeService=x._instantiationService.createInstance(n.UnicodeService),x._instantiationService.setService(E.IUnicodeService,x.unicodeService),x._charsetService=x._instantiationService.createInstance(a.CharsetService),x._instantiationService.setService(E.ICharsetService,x._charsetService),x._inputHandler=new f.InputHandler(x._bufferService,x._charsetService,x._coreService,x._dirtyRowService,x._logService,x.optionsService,x._coreMouseService,x.unicodeService),x.register(s.forwardEvent(x._inputHandler.onLineFeed,x._onLineFeed)),x.register(x._inputHandler),x.register(s.forwardEvent(x._bufferService.onResize,x._onResize)),x.register(s.forwardEvent(x._coreService.onData,x._onData)),x.register(s.forwardEvent(x._coreService.onBinary,x._onBinary)),x.register(x.optionsService.onOptionChange(function(b){return x._updateOptions(b)})),x._writeBuffer=new h.WriteBuffer(function(b){return x._inputHandler.parse(b)}),x}return O(T,m),Object.defineProperty(T.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){var A;this._isDisposed||(m.prototype.dispose.call(this),(A=this._windowsMode)===null||A===void 0||A.dispose(),this._windowsMode=void 0)},T.prototype.write=function(A,x){this._writeBuffer.write(A,x)},T.prototype.writeSync=function(A){this._writeBuffer.writeSync(A)},T.prototype.resize=function(A,x){isNaN(A)||isNaN(x)||(A=Math.max(A,u.MINIMUM_COLS),x=Math.max(x,u.MINIMUM_ROWS),this._bufferService.resize(A,x))},T.prototype.scroll=function(A,x){x===void 0&&(x=!1);var b,S=this._bufferService.buffer;(b=this._cachedBlankLine)&&b.length===this.cols&&b.getFg(0)===A.fg&&b.getBg(0)===A.bg||(b=S.getBlankLine(A,x),this._cachedBlankLine=b),b.isWrapped=x;var C=S.ybase+S.scrollTop,g=S.ybase+S.scrollBottom;if(S.scrollTop===0){var M=S.lines.isFull;g===S.lines.length-1?M?S.lines.recycle().copyFrom(b):S.lines.push(b.clone()):S.lines.splice(g+1,0,b.clone()),M?this._bufferService.isUserScrolling&&(S.ydisp=Math.max(S.ydisp-1,0)):(S.ybase++,this._bufferService.isUserScrolling||S.ydisp++)}else{var I=g-C+1;S.lines.shiftElements(C+1,I-1,-1),S.lines.set(g,b.clone())}this._bufferService.isUserScrolling||(S.ydisp=S.ybase),this._dirtyRowService.markRangeDirty(S.scrollTop,S.scrollBottom),this._onScroll.fire(S.ydisp)},T.prototype.scrollLines=function(A,x){var b=this._bufferService.buffer;if(A<0){if(b.ydisp===0)return;this._bufferService.isUserScrolling=!0}else A+b.ydisp>=b.ybase&&(this._bufferService.isUserScrolling=!1);var S=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+A,b.ybase),0),S!==b.ydisp&&(x||this._onScroll.fire(b.ydisp))},T.prototype.scrollPages=function(A){this.scrollLines(A*(this.rows-1))},T.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},T.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},T.prototype.scrollToLine=function(A){var x=A-this._bufferService.buffer.ydisp;x!==0&&this.scrollLines(x)},T.prototype.addEscHandler=function(A,x){return this._inputHandler.addEscHandler(A,x)},T.prototype.addDcsHandler=function(A,x){return this._inputHandler.addDcsHandler(A,x)},T.prototype.addCsiHandler=function(A,x){return this._inputHandler.addCsiHandler(A,x)},T.prototype.addOscHandler=function(A,x){return this._inputHandler.addOscHandler(A,x)},T.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},T.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},T.prototype._updateOptions=function(A){var x;switch(A){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((x=this._windowsMode)===null||x===void 0||x.dispose(),this._windowsMode=void 0)}},T.prototype._enableWindowsMode=function(){var A=this;if(!this._windowsMode){var x=[];x.push(this.onLineFeed(i.updateWindowsModeWrappedState.bind(null,this._bufferService))),x.push(this.addCsiHandler({final:"H"},function(){return i.updateWindowsModeWrappedState(A._bufferService),!1})),this._windowsMode={dispose:function(){for(var b=0,S=x;b<S.length;b++)S[b].dispose()}}}},T}(c.Disposable);k.CoreTerminal=w},function(j,k,D){"use strict";var R=this&&this.__spreadArrays||function(){for(var p=0,u=0,o=arguments.length;u<o;u++)p+=arguments[u].length;var d=Array(p),s=0;for(u=0;u<o;u++)for(var l=arguments[u],r=0,n=l.length;r<n;r++,s++)d[s]=l[r];return d};Object.defineProperty(k,"__esModule",{value:!0}),k.InstantiationService=k.ServiceCollection=void 0;var O=D(1),c=D(14),E=function(){function p(){for(var u=[],o=0;o<arguments.length;o++)u[o]=arguments[o];this._entries=new Map;for(var d=0,s=u;d<s.length;d++){var l=s[d],r=l[0],n=l[1];this.set(r,n)}}return p.prototype.set=function(u,o){var d=this._entries.get(u);return this._entries.set(u,o),d},p.prototype.forEach=function(u){this._entries.forEach(function(o,d){return u(d,o)})},p.prototype.has=function(u){return this._entries.has(u)},p.prototype.get=function(u){return this._entries.get(u)},p}();k.ServiceCollection=E;var y=function(){function p(){this._services=new E,this._services.set(O.IInstantiationService,this)}return p.prototype.setService=function(u,o){this._services.set(u,o)},p.prototype.getService=function(u){return this._services.get(u)},p.prototype.createInstance=function(u){for(var o=[],d=1;d<arguments.length;d++)o[d-1]=arguments[d];for(var s=c.getServiceDependencies(u).sort(function(h,w){return h.index-w.index}),l=[],r=0,n=s;r<n.length;r++){var a=n[r],i=this._services.get(a.id);if(!i)throw new Error("[createInstance] "+u.name+" depends on UNKNOWN service "+a.id+".");l.push(i)}var f=s.length>0?s[0].index:o.length;if(o.length!==f)throw new Error("[createInstance] First service dependency of "+u.name+" at position "+(f+1)+" conflicts with "+o.length+" static arguments");return new(u.bind.apply(u,R([void 0],R(o,l))))},p}();k.InstantiationService=y},function(j,k,D){"use strict";var R=this&&this.__decorate||function(o,d,s,l){var r,n=arguments.length,a=n<3?d:l===null?l=Object.getOwnPropertyDescriptor(d,s):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,d,s,l);else for(var i=o.length-1;i>=0;i--)(r=o[i])&&(a=(n<3?r(a):n>3?r(d,s,a):r(d,s))||a);return n>3&&a&&Object.defineProperty(d,s,a),a},O=this&&this.__param||function(o,d){return function(s,l){d(s,l,o)}},c=this&&this.__spreadArrays||function(){for(var o=0,d=0,s=arguments.length;d<s;d++)o+=arguments[d].length;var l=Array(o),r=0;for(d=0;d<s;d++)for(var n=arguments[d],a=0,i=n.length;a<i;a++,r++)l[r]=n[a];return l};Object.defineProperty(k,"__esModule",{value:!0}),k.LogService=k.LogLevel=void 0;var E,y=D(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=k.LogLevel||(k.LogLevel={}));var p={debug:E.DEBUG,info:E.INFO,warn:E.WARN,error:E.ERROR,off:E.OFF},u=function(){function o(d){var s=this;this._optionsService=d,this._updateLogLevel(),this._optionsService.onOptionChange(function(l){l==="logLevel"&&s._updateLogLevel()})}return o.prototype._updateLogLevel=function(){this._logLevel=p[this._optionsService.options.logLevel]},o.prototype._evalLazyOptionalParams=function(d){for(var s=0;s<d.length;s++)typeof d[s]=="function"&&(d[s]=d[s]())},o.prototype._log=function(d,s,l){this._evalLazyOptionalParams(l),d.call.apply(d,c([console,"xterm.js: "+s],l))},o.prototype.debug=function(d){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.DEBUG&&this._log(console.log,d,s)},o.prototype.info=function(d){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.INFO&&this._log(console.info,d,s)},o.prototype.warn=function(d){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.WARN&&this._log(console.warn,d,s)},o.prototype.error=function(d){for(var s=[],l=1;l<arguments.length;l++)s[l-1]=arguments[l];this._logLevel<=E.ERROR&&this._log(console.error,d,s)},o=R([O(0,y.IOptionsService)],o)}();k.LogService=u},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(s,l){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)n.hasOwnProperty(a)&&(r[a]=n[a])})(s,l)},function(s,l){function r(){this.constructor=s}R(s,l),s.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),c=this&&this.__decorate||function(s,l,r,n){var a,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(a=s[h])&&(f=(i<3?a(f):i>3?a(l,r,f):a(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},E=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.BufferService=k.MINIMUM_ROWS=k.MINIMUM_COLS=void 0;var y=D(1),p=D(69),u=D(0),o=D(2);k.MINIMUM_COLS=2,k.MINIMUM_ROWS=1;var d=function(s){function l(r){var n=s.call(this)||this;return n._optionsService=r,n.isUserScrolling=!1,n._onResize=new u.EventEmitter,n.cols=Math.max(r.options.cols,k.MINIMUM_COLS),n.rows=Math.max(r.options.rows,k.MINIMUM_ROWS),n.buffers=new p.BufferSet(r,n),n}return O(l,s),Object.defineProperty(l.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),l.prototype.dispose=function(){s.prototype.dispose.call(this),this.buffers.dispose()},l.prototype.resize=function(r,n){this.cols=r,this.rows=n,this.buffers.resize(r,n),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:r,rows:n})},l.prototype.reset=function(){this.buffers.dispose(),this.buffers=new p.BufferSet(this._optionsService,this),this.isUserScrolling=!1},l=c([E(0,y.IOptionsService)],l)}(o.Disposable);k.BufferService=d},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(p,u){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,d){o.__proto__=d}||function(o,d){for(var s in d)d.hasOwnProperty(s)&&(o[s]=d[s])})(p,u)},function(p,u){function o(){this.constructor=p}R(p,u),p.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)});Object.defineProperty(k,"__esModule",{value:!0}),k.BufferSet=void 0;var c=D(70),E=D(0),y=function(p){function u(o,d){var s=p.call(this)||this;return s._onBufferActivate=s.register(new E.EventEmitter),s._normal=new c.Buffer(!0,o,d),s._normal.fillViewportRows(),s._alt=new c.Buffer(!1,o,d),s._activeBuffer=s._normal,s.setupTabStops(),s}return O(u,p),Object.defineProperty(u.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),u.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}))},u.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}))},u.prototype.resize=function(o,d){this._normal.resize(o,d),this._alt.resize(o,d)},u.prototype.setupTabStops=function(o){this._normal.setupTabStops(o),this._alt.setupTabStops(o)},u}(D(2).Disposable);k.BufferSet=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.BufferStringIterator=k.Buffer=k.MAX_BUFFER_SIZE=void 0;var R=D(71),O=D(16),c=D(4),E=D(3),y=D(72),p=D(73),u=D(20),o=D(6);k.MAX_BUFFER_SIZE=4294967295;var d=function(){function l(r,n,a){this._hasScrollback=r,this._optionsService=n,this._bufferService=a,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=O.DEFAULT_ATTR_DATA.clone(),this.savedCharset=u.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=c.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 R.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return l.prototype.getNullCell=function(r){return r?(this._nullCell.fg=r.fg,this._nullCell.bg=r.bg,this._nullCell.extended=r.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new o.ExtendedAttrs),this._nullCell},l.prototype.getWhitespaceCell=function(r){return r?(this._whitespaceCell.fg=r.fg,this._whitespaceCell.bg=r.bg,this._whitespaceCell.extended=r.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new o.ExtendedAttrs),this._whitespaceCell},l.prototype.getBlankLine=function(r,n){return new O.BufferLine(this._bufferService.cols,this.getNullCell(r),n)},Object.defineProperty(l.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var r=this.ybase+this.y-this.ydisp;return r>=0&&r<this._rows},enumerable:!1,configurable:!0}),l.prototype._getCorrectBufferLength=function(r){if(!this._hasScrollback)return r;var n=r+this._optionsService.options.scrollback;return n>k.MAX_BUFFER_SIZE?k.MAX_BUFFER_SIZE:n},l.prototype.fillViewportRows=function(r){if(this.lines.length===0){r===void 0&&(r=O.DEFAULT_ATTR_DATA);for(var n=this._rows;n--;)this.lines.push(this.getBlankLine(r))}},l.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new R.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},l.prototype.resize=function(r,n){var a=this.getNullCell(O.DEFAULT_ATTR_DATA),i=this._getCorrectBufferLength(n);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<r)for(var f=0;f<this.lines.length;f++)this.lines.get(f).resize(r,a);var h=0;if(this._rows<n)for(var w=this._rows;w<n;w++)this.lines.length<n+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new O.BufferLine(r,a)):this.ybase>0&&this.lines.length<=this.ybase+this.y+h+1?(this.ybase--,h++,this.ydisp>0&&this.ydisp--):this.lines.push(new O.BufferLine(r,a)));else for(w=this._rows;w>n;w--)this.lines.length>n+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){var m=this.lines.length-i;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=i}this.x=Math.min(this.x,r-1),this.y=Math.min(this.y,n-1),h&&(this.y+=h),this.savedX=Math.min(this.savedX,r-1),this.scrollTop=0}if(this.scrollBottom=n-1,this._isReflowEnabled&&(this._reflow(r,n),this._cols>r))for(f=0;f<this.lines.length;f++)this.lines.get(f).resize(r,a);this._cols=r,this._rows=n},Object.defineProperty(l.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),l.prototype._reflow=function(r,n){this._cols!==r&&(r>this._cols?this._reflowLarger(r,n):this._reflowSmaller(r,n))},l.prototype._reflowLarger=function(r,n){var a=y.reflowLargerGetLinesToRemove(this.lines,this._cols,r,this.ybase+this.y,this.getNullCell(O.DEFAULT_ATTR_DATA));if(a.length>0){var i=y.reflowLargerCreateNewLayout(this.lines,a);y.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(r,n,i.countRemoved)}},l.prototype._reflowLargerAdjustViewport=function(r,n,a){for(var i=this.getNullCell(O.DEFAULT_ATTR_DATA),f=a;f-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<n&&this.lines.push(new O.BufferLine(r,i))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-a,0)},l.prototype._reflowSmaller=function(r,n){for(var a=this.getNullCell(O.DEFAULT_ATTR_DATA),i=[],f=0,h=this.lines.length-1;h>=0;h--){var w=this.lines.get(h);if(!(!w||!w.isWrapped&&w.getTrimmedLength()<=r)){for(var m=[w];w.isWrapped&&h>0;)w=this.lines.get(--h),m.unshift(w);var T=this.ybase+this.y;if(!(T>=h&&T<h+m.length)){var A=m[m.length-1].getTrimmedLength(),x=y.reflowSmallerGetNewLineLengths(m,this._cols,r),b=x.length-m.length,S=void 0;S=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+b):Math.max(0,this.lines.length-this.lines.maxLength+b);for(var C=[],g=0;g<b;g++){var M=this.getBlankLine(O.DEFAULT_ATTR_DATA,!0);C.push(M)}C.length>0&&(i.push({start:h+m.length+f,newLines:C}),f+=C.length),m.push.apply(m,C);var I=x.length-1,P=x[I];P===0&&(P=x[--I]);for(var B=m.length-b-1,H=A;B>=0;){var F=Math.min(H,P);if(m[I].copyCellsFrom(m[B],H-F,P-F,F,!0),(P-=F)===0&&(P=x[--I]),(H-=F)===0){B--;var W=Math.max(B,0);H=y.getWrappedLineTrimmedLength(m,W,this._cols)}}for(g=0;g<m.length;g++)x[g]<r&&m[g].setCell(x[g],a);for(var U=b-S;U-- >0;)this.ybase===0?this.y<n-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-n&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+b,this.ybase+n-1)}}}if(i.length>0){var K=[],G=[];for(g=0;g<this.lines.length;g++)G.push(this.lines.get(g));var ee=this.lines.length,de=ee-1,ge=0,Be=i[ge];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);var Ue=0;for(g=Math.min(this.lines.maxLength-1,ee+f-1);g>=0;g--)if(Be&&Be.start>de+Ue){for(var Le=Be.newLines.length-1;Le>=0;Le--)this.lines.set(g--,Be.newLines[Le]);g++,K.push({index:de+1,amount:Be.newLines.length}),Ue+=Be.newLines.length,Be=i[++ge]}else this.lines.set(g,G[de--]);var Me=0;for(g=K.length-1;g>=0;g--)K[g].index+=Me,this.lines.onInsertEmitter.fire(K[g]),Me+=K[g].amount;var Pe=Math.max(0,ee+f-this.lines.maxLength);Pe>0&&this.lines.onTrimEmitter.fire(Pe)}},l.prototype.stringIndexToBufferIndex=function(r,n,a){for(a===void 0&&(a=!1);n;){var i=this.lines.get(r);if(!i)return[-1,-1];for(var f=a?i.getTrimmedLength():i.length,h=0;h<f;++h)if(i.get(h)[E.CHAR_DATA_WIDTH_INDEX]&&(n-=i.get(h)[E.CHAR_DATA_CHAR_INDEX].length||1),n<0)return[r,h];r++}return[r,0]},l.prototype.translateBufferLineToString=function(r,n,a,i){a===void 0&&(a=0);var f=this.lines.get(r);return f?f.translateToString(n,a,i):""},l.prototype.getWrappedRangeForLine=function(r){for(var n=r,a=r;n>0&&this.lines.get(n).isWrapped;)n--;for(;a+1<this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:n,last:a}},l.prototype.setupTabStops=function(r){for(r!=null?this.tabs[r]||(r=this.prevStop(r)):(this.tabs={},r=0);r<this._cols;r+=this._optionsService.options.tabStopWidth)this.tabs[r]=!0},l.prototype.prevStop=function(r){for(r==null&&(r=this.x);!this.tabs[--r]&&r>0;);return r>=this._cols?this._cols-1:r<0?0:r},l.prototype.nextStop=function(r){for(r==null&&(r=this.x);!this.tabs[++r]&&r<this._cols;);return r>=this._cols?this._cols-1:r<0?0:r},l.prototype.addMarker=function(r){var n=this,a=new p.Marker(r);return this.markers.push(a),a.register(this.lines.onTrim(function(i){a.line-=i,a.line<0&&a.dispose()})),a.register(this.lines.onInsert(function(i){a.line>=i.index&&(a.line+=i.amount)})),a.register(this.lines.onDelete(function(i){a.line>=i.index&&a.line<i.index+i.amount&&a.dispose(),a.line>i.index&&(a.line-=i.amount)})),a.register(a.onDispose(function(){return n._removeMarker(a)})),a},l.prototype._removeMarker=function(r){this.markers.splice(this.markers.indexOf(r),1)},l.prototype.iterator=function(r,n,a,i,f){return new s(this,r,n,a,i,f)},l}();k.Buffer=d;var s=function(){function l(r,n,a,i,f,h){a===void 0&&(a=0),i===void 0&&(i=r.lines.length),f===void 0&&(f=0),h===void 0&&(h=0),this._buffer=r,this._trimRight=n,this._startIndex=a,this._endIndex=i,this._startOverscan=f,this._endOverscan=h,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return l.prototype.hasNext=function(){return this._current<this._endIndex},l.prototype.next=function(){var r=this._buffer.getWrappedRangeForLine(this._current);r.first<this._startIndex-this._startOverscan&&(r.first=this._startIndex-this._startOverscan),r.last>this._endIndex+this._endOverscan&&(r.last=this._endIndex+this._endOverscan),r.first=Math.max(r.first,0),r.last=Math.min(r.last,this._buffer.lines.length);for(var n="",a=r.first;a<=r.last;++a)n+=this._buffer.translateBufferLineToString(a,this._trimRight);return this._current=r.last+1,{range:r,content:n}},l}();k.BufferStringIterator=s},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CircularList=void 0;var R=D(0),O=function(){function c(E){this._maxLength=E,this.onDeleteEmitter=new R.EventEmitter,this.onInsertEmitter=new R.EventEmitter,this.onTrimEmitter=new R.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(c.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"maxLength",{get:function(){return this._maxLength},set:function(E){if(this._maxLength!==E){for(var y=new Array(E),p=0;p<Math.min(E,this.length);p++)y[p]=this._array[this._getCyclicIndex(p)];this._array=y,this._maxLength=E,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"length",{get:function(){return this._length},set:function(E){if(E>this._length)for(var y=this._length;y<E;y++)this._array[y]=void 0;this._length=E},enumerable:!1,configurable:!0}),c.prototype.get=function(E){return this._array[this._getCyclicIndex(E)]},c.prototype.set=function(E,y){this._array[this._getCyclicIndex(E)]=y},c.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++},c.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(c.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),c.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},c.prototype.splice=function(E,y){for(var p=[],u=2;u<arguments.length;u++)p[u-2]=arguments[u];if(y){for(var o=E;o<this._length-y;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+y)];this._length-=y}for(o=this._length-1;o>=E;o--)this._array[this._getCyclicIndex(o+p.length)]=this._array[this._getCyclicIndex(o)];for(o=0;o<p.length;o++)this._array[this._getCyclicIndex(E+o)]=p[o];if(this._length+p.length>this._maxLength){var d=this._length+p.length-this._maxLength;this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)}else this._length+=p.length},c.prototype.trimStart=function(E){E>this._length&&(E=this._length),this._startIndex+=E,this._length-=E,this.onTrimEmitter.fire(E)},c.prototype.shiftElements=function(E,y,p){if(!(y<=0)){if(E<0||E>=this._length)throw new Error("start argument out of range");if(E+p<0)throw new Error("Cannot shift elements in list beyond index 0");if(p>0){for(var u=y-1;u>=0;u--)this.set(E+u+p,this.get(E+u));var o=E+y+p-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(u=0;u<y;u++)this.set(E+u+p,this.get(E+u))}},c.prototype._getCyclicIndex=function(E){return(this._startIndex+E)%this._maxLength},c}();k.CircularList=O},function(j,k,D){"use strict";function R(O,c,E){if(c===O.length-1)return O[c].getTrimmedLength();var y=!O[c].hasContent(E-1)&&O[c].getWidth(E-1)===1,p=O[c+1].getWidth(0)===2;return y&&p?E-1:E}Object.defineProperty(k,"__esModule",{value:!0}),k.getWrappedLineTrimmedLength=k.reflowSmallerGetNewLineLengths=k.reflowLargerApplyNewLayout=k.reflowLargerCreateNewLayout=k.reflowLargerGetLinesToRemove=void 0,k.reflowLargerGetLinesToRemove=function(O,c,E,y,p){for(var u=[],o=0;o<O.length-1;o++){var d=o,s=O.get(++d);if(s.isWrapped){for(var l=[O.get(o)];d<O.length&&s.isWrapped;)l.push(s),s=O.get(++d);if(y>=o&&y<d)o+=l.length-1;else{for(var r=0,n=R(l,r,c),a=1,i=0;a<l.length;){var f=R(l,a,c),h=f-i,w=E-n,m=Math.min(h,w);l[r].copyCellsFrom(l[a],i,n,m,!1),(n+=m)===E&&(r++,n=0),(i+=m)===f&&(a++,i=0),n===0&&r!==0&&l[r-1].getWidth(E-1)===2&&(l[r].copyCellsFrom(l[r-1],E-1,n++,1,!1),l[r-1].setCell(E-1,p))}l[r].replaceCells(n,E,p);for(var T=0,A=l.length-1;A>0&&(A>r||l[A].getTrimmedLength()===0);A--)T++;T>0&&(u.push(o+l.length-T),u.push(T)),o+=l.length-1}}}return u},k.reflowLargerCreateNewLayout=function(O,c){for(var E=[],y=0,p=c[y],u=0,o=0;o<O.length;o++)if(p===o){var d=c[++y];O.onDeleteEmitter.fire({index:o-u,amount:d}),o+=d-1,u+=d,p=c[++y]}else E.push(o);return{layout:E,countRemoved:u}},k.reflowLargerApplyNewLayout=function(O,c){for(var E=[],y=0;y<c.length;y++)E.push(O.get(c[y]));for(y=0;y<E.length;y++)O.set(y,E[y]);O.length=c.length},k.reflowSmallerGetNewLineLengths=function(O,c,E){for(var y=[],p=O.map(function(n,a){return R(O,a,c)}).reduce(function(n,a){return n+a}),u=0,o=0,d=0;d<p;){if(p-d<E){y.push(p-d);break}u+=E;var s=R(O,o,c);u>s&&(u-=s,o++);var l=O[o].getWidth(u-1)===2;l&&u--;var r=l?E-1:E;y.push(r),d+=r}return y},k.getWrappedLineTrimmedLength=R},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(y,p){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var d in o)o.hasOwnProperty(d)&&(u[d]=o[d])})(y,p)},function(y,p){function u(){this.constructor=y}R(y,p),y.prototype=p===null?Object.create(p):(u.prototype=p.prototype,new u)});Object.defineProperty(k,"__esModule",{value:!0}),k.Marker=void 0;var c=D(0),E=function(y){function p(u){var o=y.call(this)||this;return o.line=u,o._id=p._nextId++,o.isDisposed=!1,o._onDispose=new c.EventEmitter,o}return O(p,y),Object.defineProperty(p.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(p.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),p.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},p._nextId=1,p}(D(2).Disposable);k.Marker=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.OptionsService=k.DEFAULT_OPTIONS=k.DEFAULT_BELL_SOUND=void 0;var R=D(0),O=D(11),c=D(33);k.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",k.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:k.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:O.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var E=["cols","rows"],y=function(){function p(u){this._onOptionChange=new R.EventEmitter,this.options=c.clone(k.DEFAULT_OPTIONS);for(var o=0,d=Object.keys(u);o<d.length;o++){var s=d[o];if(s in this.options){var l=u[s];this.options[s]=l}}}return Object.defineProperty(p.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),p.prototype.setOption=function(u,o){if(!(u in k.DEFAULT_OPTIONS))throw new Error('No option with key "'+u+'"');if(E.indexOf(u)!==-1)throw new Error('Option "'+u+'" can only be set in the constructor');this.options[u]!==o&&(o=this._sanitizeAndValidateOption(u,o),this.options[u]!==o&&(this.options[u]=o,this._onOptionChange.fire(u)))},p.prototype._sanitizeAndValidateOption=function(u,o){switch(u){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":o||(o=k.DEFAULT_OPTIONS[u]);break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(u+" 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(u+" cannot be less than 0, value: "+o);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(u+" cannot be less than or equal to 0, value: "+o)}return o},p.prototype.getOption=function(u){if(!(u in k.DEFAULT_OPTIONS))throw new Error('No option with key "'+u+'"');return this.options[u]},p}();k.OptionsService=y},function(j,k,D){"use strict";var R,O=this&&this.__extends||(R=function(r,n){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var f in i)i.hasOwnProperty(f)&&(a[f]=i[f])})(r,n)},function(r,n){function a(){this.constructor=r}R(r,n),r.prototype=n===null?Object.create(n):(a.prototype=n.prototype,new a)}),c=this&&this.__decorate||function(r,n,a,i){var f,h=arguments.length,w=h<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,a):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(r,n,a,i);else for(var m=r.length-1;m>=0;m--)(f=r[m])&&(w=(h<3?f(w):h>3?f(n,a,w):f(n,a))||w);return h>3&&w&&Object.defineProperty(n,a,w),w},E=this&&this.__param||function(r,n){return function(a,i){n(a,i,r)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CoreService=void 0;var y=D(1),p=D(0),u=D(33),o=D(2),d=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),l=function(r){function n(a,i,f,h){var w=r.call(this)||this;return w._bufferService=i,w._logService=f,w._optionsService=h,w.isCursorInitialized=!1,w.isCursorHidden=!1,w._onData=w.register(new p.EventEmitter),w._onUserInput=w.register(new p.EventEmitter),w._onBinary=w.register(new p.EventEmitter),w._scrollToBottom=a,w.register({dispose:function(){return w._scrollToBottom=void 0}}),w.modes=u.clone(d),w.decPrivateModes=u.clone(s),w}return O(n,r),Object.defineProperty(n.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),n.prototype.reset=function(){this.modes=u.clone(d),this.decPrivateModes=u.clone(s)},n.prototype.triggerDataEvent=function(a,i){if(i===void 0&&(i=!1),!this._optionsService.options.disableStdin){var f=this._bufferService.buffer;f.ybase!==f.ydisp&&this._scrollToBottom(),i&&this._onUserInput.fire(),this._logService.debug('sending data "'+a+'"',function(){return a.split("").map(function(h){return h.charCodeAt(0)})}),this._onData.fire(a)}},n.prototype.triggerBinaryEvent=function(a){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+a+'"',function(){return a.split("").map(function(i){return i.charCodeAt(0)})}),this._onBinary.fire(a))},n=c([E(1,y.IBufferService),E(2,y.ILogService),E(3,y.IOptionsService)],n)}(o.Disposable);k.CoreService=l},function(j,k,D){"use strict";var R=this&&this.__decorate||function(s,l,r,n){var a,i=arguments.length,f=i<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,r):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(s,l,r,n);else for(var h=s.length-1;h>=0;h--)(a=s[h])&&(f=(i<3?a(f):i>3?a(l,r,f):a(l,r))||f);return i>3&&f&&Object.defineProperty(l,r,f),f},O=this&&this.__param||function(s,l){return function(r,n){l(r,n,s)}};Object.defineProperty(k,"__esModule",{value:!0}),k.CoreMouseService=void 0;var c=D(1),E=D(0),y={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(s){return s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)}},VT200:{events:19,restrict:function(s){return s.action!==32}},DRAG:{events:23,restrict:function(s){return s.action!==32||s.button!==3}},ANY:{events:31,restrict:function(s){return!0}}};function p(s,l){var r=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(r|=64,r|=s.action):(r|=3&s.button,4&s.button&&(r|=64),8&s.button&&(r|=128),s.action===32?r|=32:s.action!==0||l||(r|=3)),r}var u=String.fromCharCode,o={DEFAULT:function(s){var l=[p(s,!1)+32,s.col+32,s.row+32];return l[0]>255||l[1]>255||l[2]>255?"":"[M"+u(l[0])+u(l[1])+u(l[2])},SGR:function(s){var l=s.action===0&&s.button!==4?"m":"M";return"[<"+p(s,!0)+";"+s.col+";"+s.row+l}},d=function(){function s(l,r){this._bufferService=l,this._coreService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new E.EventEmitter,this._lastEvent=null;for(var n=0,a=Object.keys(y);n<a.length;n++){var i=a[n];this.addProtocol(i,y[i])}for(var f=0,h=Object.keys(o);f<h.length;f++){var w=h[f];this.addEncoding(w,o[w])}this.reset()}return s.prototype.addProtocol=function(l,r){this._protocols[l]=r},s.prototype.addEncoding=function(l,r){this._encodings[l]=r},Object.defineProperty(s.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(l){if(!this._protocols[l])throw new Error('unknown protocol "'+l+'"');this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(l){if(!this._encodings[l])throw new Error('unknown encoding "'+l+'"');this._activeEncoding=l},enumerable:!1,configurable:!0}),s.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(s.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),s.prototype.triggerMouseEvent=function(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows)return!1;if(l.button===4&&l.action===32)return!1;if(l.button===3&&l.action!==32)return!1;if(l.button!==4&&(l.action===2||l.action===3))return!1;if(l.col++,l.row++,l.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,l))return!1;if(!this._protocols[this._activeProtocol].restrict(l))return!1;var r=this._encodings[this._activeEncoding](l);return r&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(r):this._coreService.triggerDataEvent(r,!0)),this._lastEvent=l,!0},s.prototype.explainEvents=function(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}},s.prototype._compareEvents=function(l,r){return l.col===r.col&&(l.row===r.row&&(l.button===r.button&&(l.action===r.action&&(l.ctrl===r.ctrl&&l.alt===r.alt))))&&l.shift===r.shift},s=R([O(0,c.IBufferService),O(1,c.ICoreService)],s)}();k.CoreMouseService=d},function(j,k,D){"use strict";var R=this&&this.__decorate||function(y,p,u,o){var d,s=arguments.length,l=s<3?p:o===null?o=Object.getOwnPropertyDescriptor(p,u):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(y,p,u,o);else for(var r=y.length-1;r>=0;r--)(d=y[r])&&(l=(s<3?d(l):s>3?d(p,u,l):d(p,u))||l);return s>3&&l&&Object.defineProperty(p,u,l),l},O=this&&this.__param||function(y,p){return function(u,o){p(u,o,y)}};Object.defineProperty(k,"__esModule",{value:!0}),k.DirtyRowService=void 0;var c=D(1),E=function(){function y(p){this._bufferService=p,this.clearRange()}return Object.defineProperty(y.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(y.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),y.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},y.prototype.markDirty=function(p){p<this._start?this._start=p:p>this._end&&(this._end=p)},y.prototype.markRangeDirty=function(p,u){if(p>u){var o=p;p=u,u=o}p<this._start&&(this._start=p),u>this._end&&(this._end=u)},y.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},y=R([O(0,c.IBufferService)],y)}();k.DirtyRowService=E},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.UnicodeService=void 0;var R=D(0),O=D(79),c=function(){function E(){this._providers=Object.create(null),this._active="",this._onChange=new R.EventEmitter;var y=new O.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}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(y){if(!this._providers[y])throw new Error('unknown Unicode version "'+y+'"');this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)},enumerable:!1,configurable:!0}),E.prototype.register=function(y){this._providers[y.version]=y},E.prototype.wcwidth=function(y){return this._activeProvider.wcwidth(y)},E.prototype.getStringCellWidth=function(y){for(var p=0,u=y.length,o=0;o<u;++o){var d=y.charCodeAt(o);if(55296<=d&&d<=56319){if(++o>=u)return p+this.wcwidth(d);var s=y.charCodeAt(o);56320<=s&&s<=57343?d=1024*(d-55296)+s-56320+65536:p+=this.wcwidth(s)}p+=this.wcwidth(d)}return p},E}();k.UnicodeService=c},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.UnicodeV6=void 0;var R,O=D(15),c=[[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]],y=function(){function p(){if(this.version="6",!R){R=new Uint8Array(65536),O.fill(R,1),R[0]=0,O.fill(R,0,1,32),O.fill(R,0,127,160),O.fill(R,2,4352,4448),R[9001]=2,R[9002]=2,O.fill(R,2,11904,42192),R[12351]=1,O.fill(R,2,44032,55204),O.fill(R,2,63744,64256),O.fill(R,2,65040,65050),O.fill(R,2,65072,65136),O.fill(R,2,65280,65377),O.fill(R,2,65504,65511);for(var u=0;u<c.length;++u)O.fill(R,0,c[u][0],c[u][1]+1)}}return p.prototype.wcwidth=function(u){return u<32?0:u<127?1:u<65536?R[u]:function(o,d){var s,l=0,r=d.length-1;if(o<d[0][0]||o>d[r][1])return!1;for(;r>=l;)if(o>d[s=l+r>>1][1])l=s+1;else{if(!(o<d[s][0]))return!0;r=s-1}return!1}(u,E)?0:u>=131072&&u<=196605||u>=196608&&u<=262141?2:1},p}();k.UnicodeV6=y},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.CharsetService=void 0;var R=function(){function O(){this.glevel=0,this._charsets=[]}return O.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},O.prototype.setgLevel=function(c){this.glevel=c,this.charset=this._charsets[c]},O.prototype.setgCharset=function(c,E){this._charsets[c]=E,this.glevel===c&&(this.charset=E)},O}();k.CharsetService=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.updateWindowsModeWrappedState=void 0;var R=D(3);k.updateWindowsModeWrappedState=function(O){var c=O.buffer.lines.get(O.buffer.ybase+O.buffer.y-1),E=c==null?void 0:c.get(O.cols-1),y=O.buffer.lines.get(O.buffer.ybase+O.buffer.y);y&&E&&(y.isWrapped=E[R.CHAR_DATA_CODE_INDEX]!==R.NULL_CELL_CODE&&E[R.CHAR_DATA_CODE_INDEX]!==R.WHITESPACE_CELL_CODE)}},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.WriteBuffer=void 0;var R=function(){function O(c){this._action=c,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return O.prototype.writeSync=function(c){if(this._writeBuffer.length){for(var E=this._bufferOffset;E<this._writeBuffer.length;++E){var y=this._writeBuffer[E],p=this._callbacks[E];this._action(y),p&&p()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(c)},O.prototype.write=function(c,E){var y=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 y._innerWrite()})),this._pendingData+=c.length,this._writeBuffer.push(c),this._callbacks.push(E)},O.prototype._innerWrite=function(){for(var c=this,E=Date.now();this._writeBuffer.length>this._bufferOffset;){var y=this._writeBuffer[this._bufferOffset],p=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(y),this._pendingData-=y.length,p&&p(),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 c._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},O}();k.WriteBuffer=R},function(j,k,D){"use strict";Object.defineProperty(k,"__esModule",{value:!0}),k.AddonManager=void 0;var R=function(){function O(){this._addons=[]}return O.prototype.dispose=function(){for(var c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()},O.prototype.loadAddon=function(c,E){var y=this,p={instance:E,dispose:E.dispose,isDisposed:!1};this._addons.push(p),E.dispose=function(){return y._wrappedAddonDispose(p)},E.activate(c)},O.prototype._wrappedAddonDispose=function(c){if(!c.isDisposed){for(var E=-1,y=0;y<this._addons.length;y++)if(this._addons[y]===c){E=y;break}if(E===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(E,1)}},O}();k.AddonManager=R}])})},"07cG":function($e,ue,ie){$e.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":function($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){j.defineOption("placeholder","",function(y,p,u){var o=u&&u!=j.Init;if(p&&!o)y.on("blur",O),y.on("change",c),y.on("swapDoc",c),j.on(y.getInputField(),"compositionupdate",y.state.placeholderCompose=function(){R(y)}),c(y);else if(!p&&o){y.off("blur",O),y.off("change",c),y.off("swapDoc",c),j.off(y.getInputField(),"compositionupdate",y.state.placeholderCompose),k(y);var d=y.getWrapperElement();d.className=d.className.replace(" CodeMirror-empty","")}p&&!y.hasFocus()&&O(y)});function k(y){y.state.placeholder&&(y.state.placeholder.parentNode.removeChild(y.state.placeholder),y.state.placeholder=null)}function D(y){k(y);var p=y.state.placeholder=document.createElement("pre");p.style.cssText="height: 0; overflow: visible",p.style.direction=y.getOption("direction"),p.className="CodeMirror-placeholder CodeMirror-line-like";var u=y.getOption("placeholder");typeof u=="string"&&(u=document.createTextNode(u)),p.appendChild(u),y.display.lineSpace.insertBefore(p,y.display.lineSpace.firstChild)}function R(y){setTimeout(function(){var p=!1,u=y.getInputField();u.nodeName=="TEXTAREA"?p=!u.value:y.lineCount()==1&&(p=!/[^\u200b]/.test(u.querySelector(".CodeMirror-line").textContent)),p?D(y):k(y)},20)}function O(y){E(y)&&D(y)}function c(y){var p=y.getWrapperElement(),u=E(y);p.className=p.className.replace(" CodeMirror-empty","")+(u?" CodeMirror-empty":""),u?D(y):k(y)}function E(y){return y.lineCount()===1&&y.getLine(0)===""}})},"1dTM":function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=ie("GQ8N"),k=S(ie("Lo0S")),D=ie("VSMT"),R=ie("GdRQ"),O=ie("SZEN"),c=ie("vewr"),E=x(ie("YJ9k")),y=x(ie("MZdM")),p=x(ie("ItS6")),u=x(ie("whVF")),o=x(ie("Fv0C")),d=x(ie("LCi9")),s=x(ie("rwxt")),l=x(ie("Mmt2")),r=x(ie("iUHT")),n=x(ie("mHUz")),a=x(ie("P2ho")),i=ie("NBmB");ie("mdZa");var f=x(ie("34/K")),h=x(ie("hXwI")),w=x(ie("SgaC")),m=x(ie("3690")),T=x(ie("8K/p")),A=x(ie("xO64"));function x(Re){return Re&&Re.__esModule?Re:{default:Re}}function b(){if(typeof WeakMap!="function")return null;var Re=new WeakMap;return b=function(){return Re},Re}function S(Re){if(Re&&Re.__esModule)return Re;if(Re===null||C(Re)!=="object"&&typeof Re!="function")return{default:Re};var Se=b();if(Se&&Se.has(Re))return Se.get(Re);var Te={},Ee=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var $ in Re)if(Object.prototype.hasOwnProperty.call(Re,$)){var fe=Ee?Object.getOwnPropertyDescriptor(Re,$):null;fe&&(fe.get||fe.set)?Object.defineProperty(Te,$,fe):Te[$]=Re[$]}return Te.default=Re,Se&&Se.set(Re,Te),Te}function C(Re){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(Te){return typeof Te}:C=function(Te){return Te&&typeof Symbol=="function"&&Te.constructor===Symbol&&Te!==Symbol.prototype?"symbol":typeof Te},C(Re)}function g(Re,Se){if(!(Re instanceof Se))throw new TypeError("Cannot call a class as a function")}function M(Re,Se){for(var Te=0;Te<Se.length;Te++){var Ee=Se[Te];Ee.enumerable=Ee.enumerable||!1,Ee.configurable=!0,"value"in Ee&&(Ee.writable=!0),Object.defineProperty(Re,Ee.key,Ee)}}function I(Re,Se,Te){return Se&&M(Re.prototype,Se),Te&&M(Re,Te),Re}function P(Re,Se){if(typeof Se!="function"&&Se!==null)throw new TypeError("Super expression must either be null or a function");Re.prototype=Object.create(Se&&Se.prototype,{constructor:{value:Re,writable:!0,configurable:!0}}),Se&&B(Re,Se)}function B(Re,Se){return B=Object.setPrototypeOf||function(Ee,$){return Ee.__proto__=$,Ee},B(Re,Se)}function H(Re){var Se=U();return function(){var Ee=K(Re),$;if(Se){var fe=K(this).constructor;$=Reflect.construct(Ee,arguments,fe)}else $=Ee.apply(this,arguments);return F(this,$)}}function F(Re,Se){return Se&&(C(Se)==="object"||typeof Se=="function")?Se:W(Re)}function W(Re){if(Re===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Re}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(Re){return!1}}function K(Re){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(Te){return Te.__proto__||Object.getPrototypeOf(Te)},K(Re)}var G=3,ee="rgb(40, 40, 40)",de=17,ge=50,Be=19,Ue=75,Le=50,Me=1e3,Pe=50,be=1,ke=1<<1,te=1<<2,pe=1<<3,ae=1<<4,_e=1<<24,Ie=1<<25,Fe=1<<26,Xe=1<<27,Ge=1<<28,ze=function(Re){P(Te,Re);var Se=H(Te);function Te(Ee,$,fe){var J;if(g(this,Te),!Ee)throw new Error("Must specify target");if(!$)throw new Error("Must specify URL");J=Se.call(this),J._target=Ee,J._url=$,fe=fe||{},J._rfbCredentials=fe.credentials||{},J._shared="shared"in fe?!!fe.shared:!0,J._repeaterID=fe.repeaterID||"",J._wsProtocols=fe.wsProtocols||[],J._rfbConnectionState="",J._rfbInitState="",J._rfbAuthScheme=-1,J._rfbCleanDisconnect=!0,J._rfbVersion=0,J._rfbMaxVersion=3.8,J._rfbTightVNC=!1,J._rfbVeNCryptState=0,J._rfbXvpVer=0,J._fbWidth=0,J._fbHeight=0,J._fbName="",J._capabilities={power:!1},J._supportsFence=!1,J._supportsContinuousUpdates=!1,J._enabledContinuousUpdates=!1,J._supportsSetDesktopSize=!1,J._screenID=0,J._screenFlags=0,J._qemuExtKeyEventSupported=!1,J._clipboardText=null,J._clipboardServerCapabilitiesActions={},J._clipboardServerCapabilitiesFormats={},J._sock=null,J._display=null,J._flushing=!1,J._keyboard=null,J._gestures=null,J._disconnTimer=null,J._resizeTimeout=null,J._mouseMoveTimer=null,J._decoders={},J._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},J._mousePos={},J._mouseButtonMask=0,J._mouseLastMoveTime=0,J._viewportDragging=!1,J._viewportDragPos={},J._viewportHasMoved=!1,J._accumulatedWheelDeltaX=0,J._accumulatedWheelDeltaY=0,J._gestureLastTapTime=null,J._gestureFirstDoubleTapEv=null,J._gestureLastMagnitudeX=0,J._gestureLastMagnitudeY=0,J._eventHandlers={focusCanvas:J._focusCanvas.bind(W(J)),windowResize:J._windowResize.bind(W(J)),handleMouse:J._handleMouse.bind(W(J)),handleWheel:J._handleWheel.bind(W(J)),handleGesture:J._handleGesture.bind(W(J))},k.Debug(">> RFB.constructor"),J._screen=document.createElement("div"),J._screen.style.display="flex",J._screen.style.width="100%",J._screen.style.height="100%",J._screen.style.overflow="auto",J._screen.style.background=ee,J._canvas=document.createElement("canvas"),J._canvas.style.margin="auto",J._canvas.style.outline="none",J._canvas.style.flexShrink="0",J._canvas.width=0,J._canvas.height=0,J._canvas.tabIndex=-1,J._screen.appendChild(J._canvas),J._cursor=new s.default,J._cursorImage=Te.cursors.none,J._decoders[i.encodings.encodingRaw]=new f.default,J._decoders[i.encodings.encodingCopyRect]=new h.default,J._decoders[i.encodings.encodingRRE]=new w.default,J._decoders[i.encodings.encodingHextile]=new m.default,J._decoders[i.encodings.encodingTight]=new T.default,J._decoders[i.encodings.encodingTightPNG]=new A.default;try{J._display=new y.default(J._canvas)}catch(Ae){throw k.Error("Display exception: "+Ae),Ae}return J._display.onflush=J._onFlush.bind(W(J)),J._keyboard=new o.default(J._canvas),J._keyboard.onkeyevent=J._handleKeyEvent.bind(W(J)),J._gestures=new d.default,J._sock=new l.default,J._sock.on("message",function(){J._handleMessage()}),J._sock.on("open",function(){J._rfbConnectionState==="connecting"&&J._rfbInitState===""?(J._rfbInitState="ProtocolVersion",k.Debug("Starting VNC handshake")):J._fail("Unexpected server connection while "+J._rfbConnectionState)}),J._sock.on("close",function(Ae){k.Debug("WebSocket on-close event");var We="";Ae.code&&(We="(code: "+Ae.code,Ae.reason&&(We+=", reason: "+Ae.reason),We+=")");switch(J._rfbConnectionState){case"connecting":J._fail("Connection closed "+We);break;case"connected":J._updateConnectionState("disconnecting"),J._updateConnectionState("disconnected");break;case"disconnecting":J._updateConnectionState("disconnected");break;case"disconnected":J._fail("Unexpected server disconnect when already disconnected "+We);break;default:J._fail("Unexpected server disconnect before connecting "+We);break}J._sock.off("close")}),J._sock.on("error",function(Ae){return k.Warn("WebSocket on-error event")}),setTimeout(J._updateConnectionState.bind(W(J),"connecting")),k.Debug("<< RFB.constructor"),J.dragViewport=!1,J.focusOnClick=!0,J._viewOnly=!1,J._clipViewport=!1,J._scaleViewport=!1,J._resizeSession=!1,J._showDotCursor=!1,fe.showDotCursor!==void 0&&(k.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),J._showDotCursor=fe.showDotCursor),J._qualityLevel=6,J._compressionLevel=2,J}return I(Te,[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function($){this._rfbCredentials=$,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;k.Info("Sending Ctrl-Alt-Del"),this.sendKey(n.default.XK_Control_L,"ControlLeft",!0),this.sendKey(n.default.XK_Alt_L,"AltLeft",!0),this.sendKey(n.default.XK_Delete,"Delete",!0),this.sendKey(n.default.XK_Delete,"Delete",!1),this.sendKey(n.default.XK_Alt_L,"AltLeft",!1),this.sendKey(n.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($,fe,J){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(J===void 0){this.sendKey($,fe,!0),this.sendKey($,fe,!1);return}var Ae=a.default[fe];if(this._qemuExtKeyEventSupported&&Ae)$=$||0,k.Info("Sending key ("+(J?"down":"up")+"): keysym "+$+", scancode "+Ae),Te.messages.QEMUExtendedKeyEvent(this._sock,$,J,Ae);else{if(!$)return;k.Info("Sending keysym ("+(J?"down":"up")+"): "+$),Te.messages.keyEvent(this._sock,$,J?1:0)}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function($){if(this._rfbConnectionState!=="connected"||this._viewOnly)return;if(this._clipboardServerCapabilitiesFormats[be]&&this._clipboardServerCapabilitiesActions[Xe])this._clipboardText=$,Te.messages.extendedClipboardNotify(this._sock,[be]);else{for(var fe=new Uint8Array($.length),J=0;J<$.length;J++)fe[J]=$.charCodeAt(J);Te.messages.clientCutText(this._sock,fe)}}},{key:"_connect",value:function(){k.Debug(">> RFB.connect"),k.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch($){$.name==="SyntaxError"?this._fail("Invalid host or port ("+$+")"):this._fail("Error when opening socket ("+$+")")}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),k.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){k.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($){if(!($.name==="NotFoundError"))throw $}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),k.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function($){if(!this.focusOnClick)return;this.focus()}},{key:"_setDesktopName",value:function($){this._fbName=$,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function($){var fe=this;window.requestAnimationFrame(function(){fe._updateClip(),fe._updateScale()}),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var $=this._display.clipViewport,fe=this._clipViewport;if(this._scaleViewport&&(fe=!1),$!==fe&&(this._display.clipViewport=fe),fe){var J=this._screenSize();this._display.viewportChangeSize(J.w,J.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(!this._scaleViewport)this._display.scale=1;else{var $=this._screenSize();this._display.autoscale($.w,$.h)}this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,!this._resizeSession||this._viewOnly||!this._supportsSetDesktopSize)return;var $=this._screenSize();Te.messages.setDesktopSize(this._sock,Math.floor($.w),Math.floor($.h),this._screenID,this._screenFlags),k.Debug("Requested new desktop size: "+$.w+"x"+$.h)}},{key:"_screenSize",value:function(){var $=this._screen.getBoundingClientRect();return{w:$.width,h:$.height}}},{key:"_fixScrollbars",value:function(){var $=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=$}},{key:"_updateConnectionState",value:function($){var fe=this,J=this._rfbConnectionState;if($===J){k.Debug("Already in state '"+$+"', ignoring");return}if(J==="disconnected"){k.Error("Tried changing state of a disconnected RFB object");return}switch($){case"connected":if(J!=="connecting"){k.Error("Bad transition to connected state, previous connection state: "+J);return}break;case"disconnected":if(J!=="disconnecting"){k.Error("Bad transition to disconnected state, previous connection state: "+J);return}break;case"connecting":if(J!==""){k.Error("Bad transition to connecting state, previous connection state: "+J);return}break;case"disconnecting":if(J!=="connected"&&J!=="connecting"){k.Error("Bad transition to disconnecting state, previous connection state: "+J);return}break;default:k.Error("Unknown connection state: "+$);return}this._rfbConnectionState=$,k.Debug("New state '"+$+"', was '"+J+"'."),this._disconnTimer&&$!=="disconnecting"&&(k.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close"));switch($){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout(function(){k.Error("Disconnection timed out."),fe._updateConnectionState("disconnected")},G*1e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}));break}}},{key:"_fail",value:function($){switch(this._rfbConnectionState){case"disconnecting":k.Error("Failed when disconnecting: "+$);break;case"connected":k.Error("Failed while connected: "+$);break;case"connecting":k.Error("Failed when connecting: "+$);break;default:k.Error("RFB failure: "+$);break}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function($,fe){this._capabilities[$]=fe,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(this._sock.rQlen===0){k.Warn("handleMessage called on an empty receive queue");return}switch(this._rfbConnectionState){case"disconnected":k.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($,fe,J){this.sendKey($,fe,J)}},{key:"_handleMouse",value:function($){if($.type==="click"&&$.target!==this._canvas)return;if($.stopPropagation(),$.preventDefault(),$.type==="click"||$.type==="contextmenu")return;var fe=(0,O.clientToElement)($.clientX,$.clientY,this._canvas);switch($.type){case"mousedown":(0,c.setCapture)(this._canvas),this._handleMouseButton(fe.x,fe.y,!0,1<<$.button);break;case"mouseup":this._handleMouseButton(fe.x,fe.y,!1,1<<$.button);break;case"mousemove":this._handleMouseMove(fe.x,fe.y);break}}},{key:"_handleMouseButton",value:function($,fe,J,Ae){if(this.dragViewport)if(J&&!this._viewportDragging){this._viewportDragging=!0,this._viewportDragPos={x:$,y:fe},this._viewportHasMoved=!1;return}else{if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse($,fe,Ae)}this._mouseMoveTimer!==null&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse($,fe,this._mouseButtonMask)),J?this._mouseButtonMask|=Ae:this._mouseButtonMask&=~Ae,this._sendMouse($,fe,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function($,fe){var J=this;if(this._viewportDragging){var Ae=this._viewportDragPos.x-$,We=this._viewportDragPos.y-fe;(this._viewportHasMoved||Math.abs(Ae)>R.dragThreshold||Math.abs(We)>R.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:$,y:fe},this._display.viewportChangePos(Ae,We));return}if(this._mousePos={x:$,y:fe},this._mouseMoveTimer==null){var Ye=Date.now()-this._mouseLastMoveTime;Ye>de?(this._sendMouse($,fe,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout(function(){J._handleDelayedMouseMove()},de-Ye)}}},{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($,fe,J){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;Te.messages.pointerEvent(this._sock,this._display.absX($),this._display.absY(fe),J)}},{key:"_handleWheel",value:function($){if(this._rfbConnectionState!=="connected")return;if(this._viewOnly)return;$.stopPropagation(),$.preventDefault();var fe=(0,O.clientToElement)($.clientX,$.clientY,this._canvas),J=$.deltaX,Ae=$.deltaY;$.deltaMode!==0&&(J*=Be,Ae*=Be),this._accumulatedWheelDeltaX+=J,this._accumulatedWheelDeltaY+=Ae,Math.abs(this._accumulatedWheelDeltaX)>=ge&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(fe.x,fe.y,!0,1<<5),this._handleMouseButton(fe.x,fe.y,!1,1<<5)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(fe.x,fe.y,!0,1<<6),this._handleMouseButton(fe.x,fe.y,!1,1<<6)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=ge&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(fe.x,fe.y,!0,1<<3),this._handleMouseButton(fe.x,fe.y,!1,1<<3)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(fe.x,fe.y,!0,1<<4),this._handleMouseButton(fe.x,fe.y,!1,1<<4)),this._accumulatedWheelDeltaY=0)}},{key:"_fakeMouseMove",value:function($,fe,J){this._handleMouseMove(fe,J),this._cursor.move($.detail.clientX,$.detail.clientY)}},{key:"_handleTapEvent",value:function($,fe){var J=(0,O.clientToElement)($.detail.clientX,$.detail.clientY,this._canvas);if(this._gestureLastTapTime!==null&&Date.now()-this._gestureLastTapTime<Me&&this._gestureFirstDoubleTapEv.detail.type===$.detail.type){var Ae=this._gestureFirstDoubleTapEv.detail.clientX-$.detail.clientX,We=this._gestureFirstDoubleTapEv.detail.clientY-$.detail.clientY,Ye=Math.hypot(Ae,We);Ye<Pe?J=(0,O.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=$}else this._gestureFirstDoubleTapEv=$;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,fe),this._handleMouseButton(J.x,J.y,!1,fe)}},{key:"_handleGesture",value:function($){var fe,J=(0,O.clientToElement)($.detail.clientX,$.detail.clientY,this._canvas);switch($.type){case"gesturestart":switch($.detail.type){case"onetap":this._handleTapEvent($,1);break;case"twotap":this._handleTapEvent($,4);break;case"threetap":this._handleTapEvent($,2);break;case"drag":this._fakeMouseMove($,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,1);break;case"longpress":this._fakeMouseMove($,J.x,J.y),this._handleMouseButton(J.x,J.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=$.detail.magnitudeX,this._gestureLastMagnitudeY=$.detail.magnitudeY,this._fakeMouseMove($,J.x,J.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot($.detail.magnitudeX,$.detail.magnitudeY),this._fakeMouseMove($,J.x,J.y);break}break;case"gesturemove":switch($.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove($,J.x,J.y);break;case"twodrag":for(this._fakeMouseMove($,J.x,J.y);$.detail.magnitudeY-this._gestureLastMagnitudeY>Le;)this._handleMouseButton(J.x,J.y,!0,8),this._handleMouseButton(J.x,J.y,!1,8),this._gestureLastMagnitudeY+=Le;for(;$.detail.magnitudeY-this._gestureLastMagnitudeY<-Le;)this._handleMouseButton(J.x,J.y,!0,16),this._handleMouseButton(J.x,J.y,!1,16),this._gestureLastMagnitudeY-=Le;for(;$.detail.magnitudeX-this._gestureLastMagnitudeX>Le;)this._handleMouseButton(J.x,J.y,!0,32),this._handleMouseButton(J.x,J.y,!1,32),this._gestureLastMagnitudeX+=Le;for(;$.detail.magnitudeX-this._gestureLastMagnitudeX<-Le;)this._handleMouseButton(J.x,J.y,!0,64),this._handleMouseButton(J.x,J.y,!1,64),this._gestureLastMagnitudeX-=Le;break;case"pinch":if(this._fakeMouseMove($,J.x,J.y),fe=Math.hypot($.detail.magnitudeX,$.detail.magnitudeY),Math.abs(fe-this._gestureLastMagnitudeX)>Ue){for(this._handleKeyEvent(n.default.XK_Control_L,"ControlLeft",!0);fe-this._gestureLastMagnitudeX>Ue;)this._handleMouseButton(J.x,J.y,!0,8),this._handleMouseButton(J.x,J.y,!1,8),this._gestureLastMagnitudeX+=Ue;for(;fe-this._gestureLastMagnitudeX<-Ue;)this._handleMouseButton(J.x,J.y,!0,16),this._handleMouseButton(J.x,J.y,!1,16),this._gestureLastMagnitudeX-=Ue}this._handleKeyEvent(n.default.XK_Control_L,"ControlLeft",!1);break}break;case"gestureend":switch($.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove($,J.x,J.y),this._handleMouseButton(J.x,J.y,!1,1);break;case"longpress":this._fakeMouseMove($,J.x,J.y),this._handleMouseButton(J.x,J.y,!1,4);break}break}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var $=this._sock.rQshiftStr(12).substr(4,7);k.Info("Server ProtocolVersion: "+$);var fe=0;switch($){case"000.000":fe=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 "+$)}if(fe){for(var J="ID:"+this._repeaterID;J.length<250;)J+="\0";return this._sock.sendString(J),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var Ae="00"+parseInt(this._rfbVersion,10)+".00"+this._rfbVersion*10%10;this._sock.sendString("RFB "+Ae+`
|
|
|
`),k.Debug("Sent ProtocolVersion: "+Ae),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function $(Ae,We){for(var Ye=0;Ye<We.length;Ye++)if(We[Ye]===Ae)return!0;return!1}if(this._rfbVersion>=3.7){var fe=this._sock.rQshift8();if(this._sock.rQwait("security type",fe,1))return!1;if(fe===0)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var J=this._sock.rQshiftBytes(fe);if(k.Debug("Server security types: "+J),$(1,J))this._rfbAuthScheme=1;else if($(22,J))this._rfbAuthScheme=22;else if($(16,J))this._rfbAuthScheme=16;else if($(2,J))this._rfbAuthScheme=2;else if($(19,J))this._rfbAuthScheme=19;else return this._fail("Unsupported security types (types: "+J+")");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",k.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var $=this._sock.rQshift32(),fe="";if($>0){if(this._sock.rQwait("reason",$,4))return!1;fe=this._sock.rQshiftStr($)}return fe!==""?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:fe}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+fe+")")):(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 $=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString($),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(this._rfbVeNCryptState==0){if(this._sock.rQwait("vencrypt version",2))return!1;var $=this._sock.rQshift8(),fe=this._sock.rQshift8();if(!($==0&&fe==2))return this._fail("Unsupported VeNCrypt version "+$+"."+fe);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(this._rfbVeNCryptState==1){if(this._sock.rQwait("vencrypt ack",1))return!1;var J=this._sock.rQshift8();if(J!=0)return this._fail("VeNCrypt failure "+J);this._rfbVeNCryptState=2}if(this._rfbVeNCryptState==2){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var Ae=this._sock.rQshift8();if(Ae<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=Ae,this._rfbVeNCryptState=3}if(this._rfbVeNCryptState==3){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var We=[],Ye=0;Ye<this._rfbVeNCryptSubtypesLength;Ye++)We.push(this._sock.rQshift32());if(We.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 Ne=(0,D.encodeUTF8)(this._rfbCredentials.username),et=(0,D.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,Ne.length]),this._sock.send([0,0,0,et.length]),this._sock.sendString(Ne),this._sock.sendString(et),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 $=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),fe=Te.genDES(this._rfbCredentials.password,$);return this._sock.send(fe),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($){for(var fe={0:{vendor:"TGHT",signature:"NOTUNNEL"}},J={},Ae=0;Ae<$;Ae++){var We=this._sock.rQshift32(),Ye=this._sock.rQshiftStr(4),Ne=this._sock.rQshiftStr(8);J[We]={vendor:Ye,signature:Ne}}return k.Debug("Server Tight tunnel types: "+J),J[1]&&J[1].vendor==="SICR"&&J[1].signature==="SCHANNEL"&&(k.Debug("Detected Siemens server. Assuming NOTUNNEL support."),J[0]={vendor:"TGHT",signature:"NOTUNNEL"}),J[0]?J[0].vendor!=fe[0].vendor||J[0].signature!=fe[0].signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(k.Debug("Selected tunnel type: "+fe[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 $=this._sock.rQshift32();if($>0&&this._sock.rQwait("tunnel capabilities",16*$,4))return!1;if(this._rfbTightVNC=!0,$>0)return this._negotiateTightTunnels($),!1}if(this._sock.rQwait("sub auth count",4))return!1;var fe=this._sock.rQshift32();if(fe===0)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*fe,4))return!1;for(var J={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},Ae=[],We=0;We<fe;We++){this._sock.rQshift32();var Ye=this._sock.rQshiftStr(12);Ae.push(Ye)}k.Debug("Server Tight authentication types: "+Ae);for(var Ne in J)if(Ae.indexOf(Ne)!=-1){this._sock.send([0,0,0,J[Ne]]),k.Debug("Selected authentication type: "+Ne);switch(Ne){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: "+Ne+")")}}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 $=this._sock.rQshift32();return $===0?(this._rfbInitState="ClientInitialisation",k.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=$,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:$}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var $=this._sock.rQshift16(),fe=this._sock.rQshift16(),J=this._sock.rQshift8(),Ae=this._sock.rQshift8(),We=this._sock.rQshift8(),Ye=this._sock.rQshift8(),Ne=this._sock.rQshift16(),et=this._sock.rQshift16(),ne=this._sock.rQshift16(),xe=this._sock.rQshift8(),Oe=this._sock.rQshift8(),he=this._sock.rQshift8();this._sock.rQskipBytes(3);var ce=this._sock.rQshift32();if(this._sock.rQwait("server init name",ce,24))return!1;var le=this._sock.rQshiftStr(ce);if(le=(0,D.decodeUTF8)(le,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+ce))return!1;var Y=this._sock.rQshift16(),Z=this._sock.rQshift16(),z=this._sock.rQshift16();this._sock.rQskipBytes(2);var oe=(Y+Z+z)*16;if(this._sock.rQwait("TightVNC extended server init header",oe,32+ce))return!1;this._sock.rQskipBytes(16*Y),this._sock.rQskipBytes(16*Z),this._sock.rQskipBytes(16*z)}return k.Info("Screen: "+$+"x"+fe+", bpp: "+J+", depth: "+Ae+", bigEndian: "+We+", trueColor: "+Ye+", redMax: "+Ne+", greenMax: "+et+", blueMax: "+ne+", redShift: "+xe+", greenShift: "+Oe+", blueShift: "+he),this._setDesktopName(le),this._resize($,fe),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,this._fbName==="Intel(r) AMT KVM"&&(k.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),Te.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),Te.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var $=[];$.push(i.encodings.encodingCopyRect),this._fbDepth==24&&($.push(i.encodings.encodingTight),$.push(i.encodings.encodingTightPNG),$.push(i.encodings.encodingHextile),$.push(i.encodings.encodingRRE)),$.push(i.encodings.encodingRaw),$.push(i.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),$.push(i.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),$.push(i.encodings.pseudoEncodingDesktopSize),$.push(i.encodings.pseudoEncodingLastRect),$.push(i.encodings.pseudoEncodingQEMUExtendedKeyEvent),$.push(i.encodings.pseudoEncodingExtendedDesktopSize),$.push(i.encodings.pseudoEncodingXvp),$.push(i.encodings.pseudoEncodingFence),$.push(i.encodings.pseudoEncodingContinuousUpdates),$.push(i.encodings.pseudoEncodingDesktopName),$.push(i.encodings.pseudoEncodingExtendedClipboard),this._fbDepth==24&&($.push(i.encodings.pseudoEncodingVMwareCursor),$.push(i.encodings.pseudoEncodingCursor)),Te.messages.clientEncodings(this._sock,$)}},{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 k.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(k.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var $=this._sock.rQshift32();if($=(0,j.toSigned32bit)($),this._sock.rQwait("ServerCutText content",Math.abs($),8))return!1;if($>=0){var fe=this._sock.rQshiftStr($);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:fe}}))}else{$=Math.abs($);var J=this._sock.rQshift32(),Ae=J&65535,We=J&4278190080,Ye=!!(We&_e);if(Ye){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var Ne=0;Ne<=15;Ne++){var et=1<<Ne;Ae&et&&(this._clipboardServerCapabilitiesFormats[et]=!0,this._sock.rQshift32())}for(var ne=24;ne<=31;ne++){var xe=1<<ne;this._clipboardServerCapabilitiesActions[xe]=!!(We&xe)}var Oe=[_e,Ie,Fe,Xe,Ge];Te.messages.extendedClipboardCaps(this._sock,Oe,{extendedClipboardFormatText:0})}else if(We===Ie){if(this._viewOnly)return!0;this._clipboardText!=null&&this._clipboardServerCapabilitiesActions[Ge]&&(Ae&be&&Te.messages.extendedClipboardProvide(this._sock,[be],[this._clipboardText]))}else if(We===Fe){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Xe]&&(this._clipboardText!=null?Te.messages.extendedClipboardNotify(this._sock,[be]):Te.messages.extendedClipboardNotify(this._sock,[]))}else if(We===Xe){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[Ie]&&(Ae&be&&Te.messages.extendedClipboardRequest(this._sock,[be]))}else if(We===Ge){if(this._viewOnly)return!0;if(!(Ae&be))return!0;this._clipboardText=null;var he=this._sock.rQshiftBytes($-4),ce=new p.default,le=null;ce.setInput(he);for(var Y=0;Y<=15;Y++){var Z=1<<Y;if(Ae&Z){var z=0,oe=ce.inflate(4);z|=oe[0]<<24,z|=oe[1]<<16,z|=oe[2]<<8,z|=oe[3];var Ce=ce.inflate(z);Z===be&&(le=Ce)}}if(ce.setInput(null),le!==null){for(var X="",me=0;me<le.length;me++)X+=String.fromCharCode(le[me]);le=X,le=(0,D.decodeUTF8)(le),le.length>0&&le.charAt(le.length-1)==="\0"&&(le=le.slice(0,-1)),le=le.replace(`\r
|
|
|
`,`
|
|
|
`),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:le}}))}}else return this._fail("Unexpected action in extended clipboard message: "+We)}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var $=this._sock.rQshift32(),fe=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",fe,9))return!1;fe>64&&(k.Warn("Bad payload length ("+fe+") in fence response"),fe=64);var J=this._sock.rQshiftStr(fe);return this._supportsFence=!0,$&1<<31?($&=1<<0|1<<1,Te.messages.clientFence(this._sock,$,J),!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 $=this._sock.rQshift8(),fe=this._sock.rQshift8();switch(fe){case 0:k.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=$,k.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+fe+")");break}return!0}},{key:"_normalMsg",value:function(){var $;this._FBU.rects>0?$=0:$=this._sock.rQshift8();var fe,J;switch($){case 0:return J=this._framebufferUpdate(),J&&!this._enabledContinuousUpdates&&Te.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),J;case 1:return this._handleSetColourMapMsg();case 2:return k.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return fe=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,fe&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),k.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+$+")"),k.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 $=this._sock.rQshiftBytes(12);this._FBU.x=($[0]<<8)+$[1],this._FBU.y=($[2]<<8)+$[3],this._FBU.width=($[4]<<8)+$[5],this._FBU.height=($[6]<<8)+$[7],this._FBU.encoding=parseInt(($[8]<<24)+($[9]<<16)+($[10]<<8)+$[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 i.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case i.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case i.encodings.pseudoEncodingCursor:return this._handleCursor();case i.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{var $=document.createEvent("keyboardEvent");$.code!==void 0&&(this._qemuExtKeyEventSupported=!0)}catch(fe){}return!0;case i.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case i.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case i.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var $=this._FBU.x,fe=this._FBU.y,J=this._FBU.width,Ae=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var We=this._sock.rQshift8();this._sock.rQshift8();var Ye,Ne=4;if(We==0){var et=4294967040|0;if(Ye=new Array(J*Ae*Ne),this._sock.rQwait("VMware cursor classic encoding",J*Ae*Ne*2,2))return!1;for(var ne=new Array(J*Ae),xe=0;xe<J*Ae;xe++)ne[xe]=this._sock.rQshift32();for(var Oe=new Array(J*Ae),he=0;he<J*Ae;he++)Oe[he]=this._sock.rQshift32();for(var ce=0;ce<J*Ae;ce++)if(ne[ce]==0){var le=Oe[ce],Y=le>>8&255,Z=le>>16&255,z=le>>24&255;Ye[ce*Ne]=Y,Ye[ce*Ne+1]=Z,Ye[ce*Ne+2]=z,Ye[ce*Ne+3]=255}else(ne[ce]&et)==et?Oe[ce]==0?(Ye[ce*Ne]=0,Ye[ce*Ne+1]=0,Ye[ce*Ne+2]=0,Ye[ce*Ne+3]=0):((Oe[ce]&et)==et,Ye[ce*Ne]=0,Ye[ce*Ne+1]=0,Ye[ce*Ne+2]=0,Ye[ce*Ne+3]=255):(Ye[ce*Ne]=0,Ye[ce*Ne+1]=0,Ye[ce*Ne+2]=0,Ye[ce*Ne+3]=255)}else if(We==1){if(this._sock.rQwait("VMware cursor alpha encoding",J*Ae*4,2))return!1;Ye=new Array(J*Ae*Ne);for(var oe=0;oe<J*Ae;oe++){var Ce=this._sock.rQshift32();Ye[oe*4]=Ce>>24&255,Ye[oe*4+1]=Ce>>16&255,Ye[oe*4+2]=Ce>>8&255,Ye[oe*4+3]=Ce&255}}else return k.Warn("The given cursor type is not supported: "+We+" given."),!1;return this._updateCursor(Ye,$,fe,J,Ae),!0}},{key:"_handleCursor",value:function(){var $=this._FBU.x,fe=this._FBU.y,J=this._FBU.width,Ae=this._FBU.height,We=J*Ae*4,Ye=Math.ceil(J/8)*Ae,Ne=We+Ye;if(this._sock.rQwait("cursor encoding",Ne))return!1;for(var et=this._sock.rQshiftBytes(We),ne=this._sock.rQshiftBytes(Ye),xe=new Uint8Array(J*Ae*4),Oe=0,he=0;he<Ae;he++)for(var ce=0;ce<J;ce++){var le=he*Math.ceil(J/8)+Math.floor(ce/8),Y=ne[le]<<ce%8&128?255:0;xe[Oe]=et[Oe+2],xe[Oe+1]=et[Oe+1],xe[Oe+2]=et[Oe],xe[Oe+3]=Y,Oe+=4}return this._updateCursor(xe,$,fe,J,Ae),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var $=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",$,4))return!1;var fe=this._sock.rQshiftStr($);return fe=(0,D.decodeUTF8)(fe,!0),this._setDesktopName(fe),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var $=this._sock.rQpeek8(),fe=4+$*16;if(this._sock.rQwait("ExtendedDesktopSize",fe))return!1;var J=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,J&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var Ae=0;Ae<$;Ae+=1)Ae===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 We="";switch(this._FBU.y){case 1:We="Resize is administratively prohibited";break;case 2:We="Out of resources";break;case 3:We="Invalid screen layout";break;default:We="Unknown reason";break}k.Warn("Server did not accept the resize request: "+We)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var $=this._decoders[this._FBU.encoding];if(!$)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return $.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(fe){return this._fail("Error decoding rect: "+fe),!1}}},{key:"_updateContinuousUpdates",value:function(){if(!this._enabledContinuousUpdates)return;Te.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function($,fe){this._fbWidth=$,this._fbHeight=fe,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function($,fe){if(this._rfbXvpVer<$)return;k.Info("Sending XVP operation "+fe+" (version "+$+")"),Te.messages.xvpOp(this._sock,$,fe)}},{key:"_updateCursor",value:function($,fe,J,Ae,We){this._cursorImage={rgbaPixels:$,hotx:fe,hoty:J,w:Ae,h:We},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var $=3;$<this._cursorImage.rgbaPixels.length;$+=4)if(this._cursorImage.rgbaPixels[$])return!1;return!0}},{key:"_refreshCursor",value:function(){if(this._rfbConnectionState!=="connecting"&&this._rfbConnectionState!=="connected")return;var $=this._shouldShowDotCursor()?Te.cursors.dot:this._cursorImage;this._cursor.change($.rgbaPixels,$.hotx,$.hoty,$.w,$.h)}},{key:"viewOnly",get:function(){return this._viewOnly},set:function($){this._viewOnly=$,(this._rfbConnectionState==="connecting"||this._rfbConnectionState==="connected")&&($?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function($){k.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function($){this._clipViewport=$,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function($){this._scaleViewport=$,$&&this._clipViewport&&this._updateClip(),this._updateScale(),!$&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function($){this._resizeSession=$,$&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function($){this._showDotCursor=$,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function($){this._screen.style.background=$}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function($){if(!Number.isInteger($)||$<0||$>9){k.Error("qualityLevel must be an integer between 0 and 9");return}if(this._qualityLevel===$)return;this._qualityLevel=$,this._rfbConnectionState==="connected"&&this._sendEncodings()}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function($){if(!Number.isInteger($)||$<0||$>9){k.Error("compressionLevel must be an integer between 0 and 9");return}if(this._compressionLevel===$)return;this._compressionLevel=$,this._rfbConnectionState==="connected"&&this._sendEncodings()}}],[{key:"genDES",value:function($,fe){var J=$.split("").map(function(Ae){return Ae.charCodeAt(0)});return new r.default(J).encrypt(fe)}}]),Te}(E.default);ue.default=ze,ze.messages={keyEvent:function(Se,Te,Ee){var $=Se._sQ,fe=Se._sQlen;$[fe]=4,$[fe+1]=Ee,$[fe+2]=0,$[fe+3]=0,$[fe+4]=Te>>24,$[fe+5]=Te>>16,$[fe+6]=Te>>8,$[fe+7]=Te,Se._sQlen+=8,Se.flush()},QEMUExtendedKeyEvent:function(Se,Te,Ee,$){function fe(Ye){var Ne=$>>8,et=$&255;return Ne===224&&et<127?et|128:Ye}var J=Se._sQ,Ae=Se._sQlen;J[Ae]=255,J[Ae+1]=0,J[Ae+2]=Ee>>8,J[Ae+3]=Ee,J[Ae+4]=Te>>24,J[Ae+5]=Te>>16,J[Ae+6]=Te>>8,J[Ae+7]=Te;var We=fe($);J[Ae+8]=We>>24,J[Ae+9]=We>>16,J[Ae+10]=We>>8,J[Ae+11]=We,Se._sQlen+=12,Se.flush()},pointerEvent:function(Se,Te,Ee,$){var fe=Se._sQ,J=Se._sQlen;fe[J]=5,fe[J+1]=$,fe[J+2]=Te>>8,fe[J+3]=Te,fe[J+4]=Ee>>8,fe[J+5]=Ee,Se._sQlen+=6,Se.flush()},_buildExtendedClipboardFlags:function(Se,Te){for(var Ee=new Uint8Array(4),$=0,fe=0,J=0;J<Se.length;J++)fe|=Se[J];for(var Ae=0;Ae<Te.length;Ae++)$|=Te[Ae];return Ee[0]=fe>>24,Ee[1]=0,Ee[2]=0,Ee[3]=$,Ee},extendedClipboardProvide:function(Se,Te,Ee){for(var $=new u.default,fe=[],J=0;J<Te.length;J++){if(Te[J]!=be)throw new Error("Unsupported extended clipboard format for Provide message.");Ee[J]=Ee[J].replace(/\r\n|\r|\n/gm,`\r
|
|
|
`);var Ae=(0,D.encodeUTF8)(Ee[J]+"\0");fe.push(Ae.length>>24&255,Ae.length>>16&255,Ae.length>>8&255,Ae.length&255);for(var We=0;We<Ae.length;We++)fe.push(Ae.charCodeAt(We))}var Ye=$.deflate(new Uint8Array(fe)),Ne=new Uint8Array(4+Ye.length);Ne.set(ze.messages._buildExtendedClipboardFlags([Ge],Te)),Ne.set(Ye,4),ze.messages.clientCutText(Se,Ne,!0)},extendedClipboardNotify:function(Se,Te){var Ee=ze.messages._buildExtendedClipboardFlags([Xe],Te);ze.messages.clientCutText(Se,Ee,!0)},extendedClipboardRequest:function(Se,Te){var Ee=ze.messages._buildExtendedClipboardFlags([Ie],Te);ze.messages.clientCutText(Se,Ee,!0)},extendedClipboardCaps:function(Se,Te,Ee){var $=Object.keys(Ee),fe=new Uint8Array(4+4*$.length);$.map(function(We){return parseInt(We)}),$.sort(function(We,Ye){return We-Ye}),fe.set(ze.messages._buildExtendedClipboardFlags(Te,[]));for(var J=4,Ae=0;Ae<$.length;Ae++)fe[J]=Ee[$[Ae]]>>24,fe[J+1]=Ee[$[Ae]]>>16,fe[J+2]=Ee[$[Ae]]>>8,fe[J+3]=Ee[$[Ae]]>>0,J+=4,fe[3]|=1<<$[Ae];ze.messages.clientCutText(Se,fe,!0)},clientCutText:function(Se,Te){var Ee=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,$=Se._sQ,fe=Se._sQlen;$[fe]=6,$[fe+1]=0,$[fe+2]=0,$[fe+3]=0;var J;Ee?J=(0,j.toUnsigned32bit)(-Te.length):J=Te.length,$[fe+4]=J>>24,$[fe+5]=J>>16,$[fe+6]=J>>8,$[fe+7]=J,Se._sQlen+=8;for(var Ae=0,We=Te.length;We>0;){for(var Ye=Math.min(We,Se._sQbufferSize-Se._sQlen),Ne=0;Ne<Ye;Ne++)$[Se._sQlen+Ne]=Te[Ae+Ne];Se._sQlen+=Ye,Se.flush(),We-=Ye,Ae+=Ye}},setDesktopSize:function(Se,Te,Ee,$,fe){var J=Se._sQ,Ae=Se._sQlen;J[Ae]=251,J[Ae+1]=0,J[Ae+2]=Te>>8,J[Ae+3]=Te,J[Ae+4]=Ee>>8,J[Ae+5]=Ee,J[Ae+6]=1,J[Ae+7]=0,J[Ae+8]=$>>24,J[Ae+9]=$>>16,J[Ae+10]=$>>8,J[Ae+11]=$,J[Ae+12]=0,J[Ae+13]=0,J[Ae+14]=0,J[Ae+15]=0,J[Ae+16]=Te>>8,J[Ae+17]=Te,J[Ae+18]=Ee>>8,J[Ae+19]=Ee,J[Ae+20]=fe>>24,J[Ae+21]=fe>>16,J[Ae+22]=fe>>8,J[Ae+23]=fe,Se._sQlen+=24,Se.flush()},clientFence:function(Se,Te,Ee){var $=Se._sQ,fe=Se._sQlen;$[fe]=248,$[fe+1]=0,$[fe+2]=0,$[fe+3]=0,$[fe+4]=Te>>24,$[fe+5]=Te>>16,$[fe+6]=Te>>8,$[fe+7]=Te;var J=Ee.length;$[fe+8]=J;for(var Ae=0;Ae<J;Ae++)$[fe+9+Ae]=Ee.charCodeAt(Ae);Se._sQlen+=9+J,Se.flush()},enableContinuousUpdates:function(Se,Te,Ee,$,fe,J){var Ae=Se._sQ,We=Se._sQlen;Ae[We]=150,Ae[We+1]=Te,Ae[We+2]=Ee>>8,Ae[We+3]=Ee,Ae[We+4]=$>>8,Ae[We+5]=$,Ae[We+6]=fe>>8,Ae[We+7]=fe,Ae[We+8]=J>>8,Ae[We+9]=J,Se._sQlen+=10,Se.flush()},pixelFormat:function(Se,Te,Ee){var $=Se._sQ,fe=Se._sQlen,J;Te>16?J=32:Te>8?J=16:J=8;var Ae=Math.floor(Te/3);$[fe]=0,$[fe+1]=0,$[fe+2]=0,$[fe+3]=0,$[fe+4]=J,$[fe+5]=Te,$[fe+6]=0,$[fe+7]=Ee?1:0,$[fe+8]=0,$[fe+9]=(1<<Ae)-1,$[fe+10]=0,$[fe+11]=(1<<Ae)-1,$[fe+12]=0,$[fe+13]=(1<<Ae)-1,$[fe+14]=Ae*2,$[fe+15]=Ae*1,$[fe+16]=Ae*0,$[fe+17]=0,$[fe+18]=0,$[fe+19]=0,Se._sQlen+=20,Se.flush()},clientEncodings:function(Se,Te){var Ee=Se._sQ,$=Se._sQlen;Ee[$]=2,Ee[$+1]=0,Ee[$+2]=Te.length>>8,Ee[$+3]=Te.length;for(var fe=$+4,J=0;J<Te.length;J++){var Ae=Te[J];Ee[fe]=Ae>>24,Ee[fe+1]=Ae>>16,Ee[fe+2]=Ae>>8,Ee[fe+3]=Ae,fe+=4}Se._sQlen+=fe-$,Se.flush()},fbUpdateRequest:function(Se,Te,Ee,$,fe,J){var Ae=Se._sQ,We=Se._sQlen;typeof Ee=="undefined"&&(Ee=0),typeof $=="undefined"&&($=0),Ae[We]=3,Ae[We+1]=Te?1:0,Ae[We+2]=Ee>>8&255,Ae[We+3]=Ee&255,Ae[We+4]=$>>8&255,Ae[We+5]=$&255,Ae[We+6]=fe>>8&255,Ae[We+7]=fe&255,Ae[We+8]=J>>8&255,Ae[We+9]=J&255,Se._sQlen+=10,Se.flush()},xvpOp:function(Se,Te,Ee){var $=Se._sQ,fe=Se._sQlen;$[fe]=250,$[fe+1]=0,$[fe+2]=Te,$[fe+3]=Ee,Se._sQlen+=4,Se.flush()}},ze.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($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){"use strict";var k={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},D={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};j.defineMode("xml",function(R,O){var c=R.indentUnit,E={},y=O.htmlMode?k:D;for(var p in y)E[p]=y[p];for(var p in O)E[p]=O[p];var u,o;function d(g,M){function I(H){return M.tokenize=H,H(g,M)}var P=g.next();if(P=="<")return g.eat("!")?g.eat("[")?g.match("CDATA[")?I(r("atom","]]>")):null:g.match("--")?I(r("comment","-->")):g.match("DOCTYPE",!0,!0)?(g.eatWhile(/[\w\._\-]/),I(n(1))):null:g.eat("?")?(g.eatWhile(/[\w\._\-]/),M.tokenize=r("meta","?>"),"meta"):(u=g.eat("/")?"closeTag":"openTag",M.tokenize=s,"tag bracket");if(P=="&"){var B;return g.eat("#")?g.eat("x")?B=g.eatWhile(/[a-fA-F\d]/)&&g.eat(";"):B=g.eatWhile(/[\d]/)&&g.eat(";"):B=g.eatWhile(/[\w\.\-:]/)&&g.eat(";"),B?"atom":"error"}else return g.eatWhile(/[^&<]/),null}d.isInText=!0;function s(g,M){var I=g.next();if(I==">"||I=="/"&&g.eat(">"))return M.tokenize=d,u=I==">"?"endTag":"selfcloseTag","tag bracket";if(I=="=")return u="equals",null;if(I=="<"){M.tokenize=d,M.state=h,M.tagName=M.tagStart=null;var P=M.tokenize(g,M);return P?P+" tag error":"tag error"}else return/[\'\"]/.test(I)?(M.tokenize=l(I),M.stringStartCol=g.column(),M.tokenize(g,M)):(g.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function l(g){var M=function(I,P){for(;!I.eol();)if(I.next()==g){P.tokenize=s;break}return"string"};return M.isInAttribute=!0,M}function r(g,M){return function(I,P){for(;!I.eol();){if(I.match(M)){P.tokenize=d;break}I.next()}return g}}function n(g){return function(M,I){for(var P;(P=M.next())!=null;){if(P=="<")return I.tokenize=n(g+1),I.tokenize(M,I);if(P==">")if(g==1){I.tokenize=d;break}else return I.tokenize=n(g-1),I.tokenize(M,I)}return"meta"}}function a(g,M,I){this.prev=g.context,this.tagName=M,this.indent=g.indented,this.startOfLine=I,(E.doNotIndent.hasOwnProperty(M)||g.context&&g.context.noIndent)&&(this.noIndent=!0)}function i(g){g.context&&(g.context=g.context.prev)}function f(g,M){for(var I;;){if(!g.context)return;if(I=g.context.tagName,!E.contextGrabbers.hasOwnProperty(I)||!E.contextGrabbers[I].hasOwnProperty(M))return;i(g)}}function h(g,M,I){return g=="openTag"?(I.tagStart=M.column(),w):g=="closeTag"?m:h}function w(g,M,I){return g=="word"?(I.tagName=M.current(),o="tag",x):E.allowMissingTagName&&g=="endTag"?(o="tag bracket",x(g,M,I)):(o="error",w)}function m(g,M,I){if(g=="word"){var P=M.current();return I.context&&I.context.tagName!=P&&E.implicitlyClosed.hasOwnProperty(I.context.tagName)&&i(I),I.context&&I.context.tagName==P||E.matchClosing===!1?(o="tag",T):(o="tag error",A)}else return E.allowMissingTagName&&g=="endTag"?(o="tag bracket",T(g,M,I)):(o="error",A)}function T(g,M,I){return g!="endTag"?(o="error",T):(i(I),h)}function A(g,M,I){return o="error",T(g,M,I)}function x(g,M,I){if(g=="word")return o="attribute",b;if(g=="endTag"||g=="selfcloseTag"){var P=I.tagName,B=I.tagStart;return I.tagName=I.tagStart=null,g=="selfcloseTag"||E.autoSelfClosers.hasOwnProperty(P)?f(I,P):(f(I,P),I.context=new a(I,P,B==I.indented)),h}return o="error",x}function b(g,M,I){return g=="equals"?S:(E.allowMissing||(o="error"),x(g,M,I))}function S(g,M,I){return g=="string"?C:g=="word"&&E.allowUnquoted?(o="string",x):(o="error",x(g,M,I))}function C(g,M,I){return g=="string"?C:x(g,M,I)}return{startState:function(g){var M={tokenize:d,state:h,indented:g||0,tagName:null,tagStart:null,context:null};return g!=null&&(M.baseIndent=g),M},token:function(g,M){if(!M.tagName&&g.sol()&&(M.indented=g.indentation()),g.eatSpace())return null;u=null;var I=M.tokenize(g,M);return(I||u)&&I!="comment"&&(o=null,M.state=M.state(u||I,g,M),o&&(I=o=="error"?I+" error":o)),I},indent:function(g,M,I){var P=g.context;if(g.tokenize.isInAttribute)return g.tagStart==g.indented?g.stringStartCol+1:g.indented+c;if(P&&P.noIndent)return j.Pass;if(g.tokenize!=s&&g.tokenize!=d)return I?I.match(/^(\s*)/)[0].length:0;if(g.tagName)return E.multilineTagIndentPastTag!==!1?g.tagStart+g.tagName.length+2:g.tagStart+c*(E.multilineTagIndentFactor||1);if(E.alignCDATA&&/<!\[CDATA\[/.test(M))return 0;var B=M&&/^<(\/)?([\w_:\.-]*)/.exec(M);if(B&&B[1])for(;P;)if(P.tagName==B[2]){P=P.prev;break}else if(E.implicitlyClosed.hasOwnProperty(P.tagName))P=P.prev;else break;else if(B)for(;P;){var H=E.contextGrabbers[P.tagName];if(H&&H.hasOwnProperty(B[2]))P=P.prev;else break}for(;P&&P.prev&&!P.startOfLine;)P=P.prev;return P?P.indent+c:g.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:E.htmlMode?"html":"xml",helperType:E.htmlMode?"html":"xml",skipAttribute:function(g){g.state==S&&(g.state=x)},xmlCurrentTag:function(g){return g.tagName?{name:g.tagName,close:g.type=="closeTag"}:null},xmlCurrentContext:function(g){for(var M=[],I=g.context;I;I=I.prev)I.tagName&&M.push(I.tagName);return M.reverse()}}}),j.defineMIME("text/xml","xml"),j.defineMIME("application/xml","xml"),j.mimeModes.hasOwnProperty("text/html")||j.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"1q3G":function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=j;function j(){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($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(O,c){if(!(O instanceof c))throw new TypeError("Cannot call a class as a function")}function k(O,c){for(var E=0;E<c.length;E++){var y=c[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,c,E){return c&&k(O.prototype,c),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._lines=0}return D(O,[{key:"decodeRect",value:function(E,y,p,u,o,d,s){this._lines===0&&(this._lines=u);var l=s==8?1:4,r=p*l;if(o.rQwait("RAW",r))return!1;var n=y+(u-this._lines),a=Math.min(this._lines,Math.floor(o.rQlen/r)),i=o.rQ,f=o.rQi;if(s==8){for(var h=p*a,w=new Uint8Array(h*4),m=0;m<h;m++)w[m*4+0]=(i[f+m]>>0&3)*255/3,w[m*4+1]=(i[f+m]>>2&3)*255/3,w[m*4+2]=(i[f+m]>>4&3)*255/3,w[m*4+4]=0;i=w,f=0}return d.blitImage(E,n,p,a,i,f),o.rQskipBytes(a*r),this._lines-=a,!(this._lines>0)}}]),O}();ue.default=R},"3690":function($e,ue,ie){"use strict";function j(p){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(o){return typeof o}:j=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},j(p)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=R(ie("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var p=new WeakMap;return D=function(){return p},p}function R(p){if(p&&p.__esModule)return p;if(p===null||j(p)!=="object"&&typeof p!="function")return{default:p};var u=D();if(u&&u.has(p))return u.get(p);var o={},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in p)if(Object.prototype.hasOwnProperty.call(p,s)){var l=d?Object.getOwnPropertyDescriptor(p,s):null;l&&(l.get||l.set)?Object.defineProperty(o,s,l):o[s]=p[s]}return o.default=p,u&&u.set(p,o),o}function O(p,u){if(!(p instanceof u))throw new TypeError("Cannot call a class as a function")}function c(p,u){for(var o=0;o<u.length;o++){var d=u[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function E(p,u,o){return u&&c(p.prototype,u),o&&c(p,o),p}var y=function(){function p(){O(this,p),this._tiles=0,this._lastsubencoding=0}return E(p,[{key:"decodeRect",value:function(o,d,s,l,r,n,a){for(this._tiles===0&&(this._tilesX=Math.ceil(s/16),this._tilesY=Math.ceil(l/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var i=1;if(r.rQwait("HEXTILE",i))return!1;var f=r.rQ,h=r.rQi,w=f[h];if(w>30)throw new Error("Illegal hextile subencoding (subencoding: "+w+")");var m=this._totalTiles-this._tiles,T=m%this._tilesX,A=Math.floor(m/this._tilesX),x=o+T*16,b=d+A*16,S=Math.min(16,o+s-x),C=Math.min(16,d+l-b);if(w&1)i+=S*C*4;else if(w&2&&(i+=4),w&4&&(i+=4),w&8){if(i++,r.rQwait("HEXTILE",i))return!1;var g=f[h+i-1];w&16?i+=g*(4+2):i+=g*2}if(r.rQwait("HEXTILE",i))return!1;if(h++,w===0)this._lastsubencoding&1?k.Debug(" Ignoring blank after RAW"):n.fillRect(x,b,S,C,this._background);else if(w&1)n.blitImage(x,b,S,C,f,h),h+=i-1;else{if(w&2&&(this._background=[f[h],f[h+1],f[h+2],f[h+3]],h+=4),w&4&&(this._foreground=[f[h],f[h+1],f[h+2],f[h+3]],h+=4),n.startTile(x,b,S,C,this._background),w&8){var M=f[h];h++;for(var I=0;I<M;I++){var P=void 0;w&16?(P=[f[h],f[h+1],f[h+2],f[h+3]],h+=4):P=this._foreground;var B=f[h];h++;var H=B>>4,F=B&15,W=f[h];h++;var U=(W>>4)+1,K=(W&15)+1;n.subTile(H,F,U,K,P)}}n.finishTile()}r.rQi=h,this._lastsubencoding=w,this._tiles--}return!0}}]),p}();ue.default=y},"6BzB":function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.shrinkBuf=j,ue.arraySet=k,ue.flattenChunks=D,ue.Buf32=ue.Buf16=ue.Buf8=void 0;function j(E,y){return E.length===y?E:E.subarray?E.subarray(0,y):(E.length=y,E)}function k(E,y,p,u,o){if(y.subarray&&E.subarray){E.set(y.subarray(p,p+u),o);return}for(var d=0;d<u;d++)E[o+d]=y[p+d]}function D(E){var y,p,u,o,d,s;for(u=0,y=0,p=E.length;y<p;y++)u+=E[y].length;for(s=new Uint8Array(u),o=0,y=0,p=E.length;y<p;y++)d=E[y],s.set(d,o),o+=d.length;return s}var R=Uint8Array;ue.Buf8=R;var O=Uint16Array;ue.Buf16=O;var c=Int32Array;ue.Buf32=c},"6Qwc":function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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"};ue.default=j},"7ahc":function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return w});var j=ie("k1fw"),k=ie("0Owb"),D=ie("+L6B"),R=ie("2/Rp"),O=ie("y8nQ"),c=ie("Vl3Y"),E=ie("tJVT"),y=ie("OaEy"),p=ie("2fM7"),u=ie("q1tI"),o=ie.n(u),d=ie("VrN/"),s=ie.n(d),l=ie("p77/"),r=ie.n(l),n=ie("c5Ni"),a=ie.n(n),i=p.a.Option,f={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};ue.b=function(m){var T=m.callback,A=m.onCancel,x=Object(u.useState)("python"),b=Object(E.a)(x,2),S=b[0],C=b[1];function g(I){C(h[I][1])}function M(I){T(I)}return o.a.createElement(c.a,Object(k.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:M}),o.a.createElement(c.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},o.a.createElement(p.a,{onChange:g},Object.keys(h).map(function(I){return o.a.createElement(i,{key:I,value:I},h[I][0])}))),o.a.createElement(c.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:S})),o.a.createElement("div",{className:"flex-container flex-end"},o.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),o.a.createElement(R.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function w(m){var T=m.value,A=m.onChange,x=m.mode,b=m.options,S=b===void 0?{}:b,C=Object(u.useRef)(),g=Object(u.useState)(),M=Object(E.a)(g,2),I=M[0],P=M[1];return Object(u.useEffect)(function(){if(I){function B(H){var F=H.getValue();A&&A(F)}return I.on("change",B),function(){I.off("change",B)}}},[I,A]),Object(u.useEffect)(function(){I&&I.setOption("mode",x)},[I,x]),Object(u.useEffect)(function(){I&&((T!==I.getValue()||T==="")&&setTimeout(function(){I.setValue(T||" ")},300))},[I,T]),Object(u.useEffect)(function(){if(C.current&&!I){var B=s.a.fromTextArea(C.current,Object(j.a)({mode:x,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},S));P(B)}},[C.current,I]),o.a.createElement("div",{className:"my-codemirror-container"},o.a.createElement("textarea",{ref:C}))}},"7ixt":function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return D});var j={adjustX:1,adjustY:1},k=[0,0],D={left:{points:["cr","cl"],overflow:j,offset:[-4,0],targetOffset:k},right:{points:["cl","cr"],overflow:j,offset:[4,0],targetOffset:k},top:{points:["bc","tc"],overflow:j,offset:[0,-4],targetOffset:k},bottom:{points:["tc","bc"],overflow:j,offset:[0,4],targetOffset:k},topLeft:{points:["bl","tl"],overflow:j,offset:[0,-4],targetOffset:k},leftTop:{points:["tr","tl"],overflow:j,offset:[-4,0],targetOffset:k},topRight:{points:["br","tr"],overflow:j,offset:[0,-4],targetOffset:k},rightTop:{points:["tl","tr"],overflow:j,offset:[4,0],targetOffset:k},bottomRight:{points:["tr","br"],overflow:j,offset:[0,4],targetOffset:k},rightBottom:{points:["bl","br"],overflow:j,offset:[4,0],targetOffset:k},bottomLeft:{points:["tl","bl"],overflow:j,offset:[0,4],targetOffset:k},leftBottom:{points:["br","bl"],overflow:j,offset:[-4,0],targetOffset:k}},R=D},"8+yF":function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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},k={lookup:function(R){if(R>=32&&R<=255)return R;var O=j[R];return O!==void 0?O:16777216|R}};ue.default=k},"8CQX":function($e,ue,ie){"use strict";function j(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(n){return typeof n}:j=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j(l)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.getKeycode=o,ue.getKey=d,ue.getKeysym=s;var k=u(ie("mHUz")),D=u(ie("8+yF")),R=u(ie("6Qwc")),O=u(ie("gIYZ")),c=u(ie("mTgk")),E=p(ie("GdRQ"));function y(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return y=function(){return l},l}function p(l){if(l&&l.__esModule)return l;if(l===null||j(l)!=="object"&&typeof l!="function")return{default:l};var r=y();if(r&&r.has(l))return r.get(l);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in l)if(Object.prototype.hasOwnProperty.call(l,i)){var f=a?Object.getOwnPropertyDescriptor(l,i):null;f&&(f.get||f.set)?Object.defineProperty(n,i,f):n[i]=l[i]}return n.default=l,r&&r.set(l,n),n}function u(l){return l&&l.__esModule?l:{default:l}}function o(l){if(l.code){switch(l.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return l.code}if(l.type!=="keypress"&&l.keyCode in R.default){var r=R.default[l.keyCode];if(E.isMac()&&r==="ContextMenu"&&(r="MetaRight"),l.location===2)switch(r){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(l.location===3)switch(r){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 r}return"Unidentified"}function d(l){if(l.key!==void 0){switch(l.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 l.char}switch(l.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(l.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if(l.key==="\0"&&l.code==="NumpadDecimal")return"Delete";if(!E.isIE()&&!E.isEdge())return l.key;if(l.key.length!==1&&l.key!=="Unidentified")return l.key}var r=o(l);return r in O.default?O.default[r]:l.charCode?String.fromCharCode(l.charCode):"Unidentified"}function s(l){var r=d(l);if(r==="Unidentified")return null;if(r in c.default){var n=l.location;if(r==="Meta"&&n===0&&(n=2),r==="Clear"&&n===3){var a=o(l);a==="NumLock"&&(n=0)}if((n===void 0||n>3)&&(n=0),r==="Meta"){var i=o(l);if(i==="AltLeft")return k.default.XK_Meta_L;if(i==="AltRight")return k.default.XK_Meta_R}if(r==="Clear"){var f=o(l);if(f==="NumLock")return k.default.XK_Num_Lock}return c.default[r][n]}if(r.length!==1)return null;var h=r.charCodeAt();return h?D.default.lookup(h):null}},"8EBN":function($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){"use strict";j.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 k=0;k<j.modeInfo.length;k++){var D=j.modeInfo[k];D.mimes&&(D.mime=D.mimes[0])}j.findModeByMIME=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var c=j.modeInfo[O];if(c.mime==R)return c;if(c.mimes){for(var E=0;E<c.mimes.length;E++)if(c.mimes[E]==R)return c}}if(/\+xml$/.test(R))return j.findModeByMIME("application/xml");if(/\+json$/.test(R))return j.findModeByMIME("application/json")},j.findModeByExtension=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var c=j.modeInfo[O];if(c.ext){for(var E=0;E<c.ext.length;E++)if(c.ext[E]==R)return c}}},j.findModeByFileName=function(R){for(var O=0;O<j.modeInfo.length;O++){var c=j.modeInfo[O];if(c.file&&c.file.test(R))return c}var E=R.lastIndexOf("."),y=E>-1&&R.substring(E+1,R.length);if(y)return j.findModeByExtension(y)},j.findModeByName=function(R){R=R.toLowerCase();for(var O=0;O<j.modeInfo.length;O++){var c=j.modeInfo[O];if(c.name.toLowerCase()==R)return c;if(c.alias){for(var E=0;E<c.alias.length;E++)if(c.alias[E].toLowerCase()==R)return c}}}})},"8K/p":function($e,ue,ie){"use strict";function j(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(s){return typeof s}:j=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},j(o)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=c(ie("Lo0S")),D=R(ie("ItS6"));function R(o){return o&&o.__esModule?o:{default:o}}function O(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return O=function(){return o},o}function c(o){if(o&&o.__esModule)return o;if(o===null||j(o)!=="object"&&typeof o!="function")return{default:o};var d=O();if(d&&d.has(o))return d.get(o);var s={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r)){var n=l?Object.getOwnPropertyDescriptor(o,r):null;n&&(n.get||n.set)?Object.defineProperty(s,r,n):s[r]=o[r]}return s.default=o,d&&d.set(o,s),s}function E(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")}function y(o,d){for(var s=0;s<d.length;s++){var l=d[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(o,l.key,l)}}function p(o,d,s){return d&&y(o.prototype,d),s&&y(o,s),o}var u=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 d=0;d<4;d++)this._zlibs[d]=new D.default}return p(o,[{key:"decodeRect",value:function(s,l,r,n,a,i,f){if(this._ctl===null){if(a.rQwait("TIGHT compression-control",1))return!1;this._ctl=a.rQshift8();for(var h=0;h<4;h++)this._ctl>>h&1&&(this._zlibs[h].reset(),k.Info("Reset zlib stream "+h));this._ctl=this._ctl>>4}var w;if(this._ctl===8)w=this._fillRect(s,l,r,n,a,i,f);else if(this._ctl===9)w=this._jpegRect(s,l,r,n,a,i,f);else if(this._ctl===10)w=this._pngRect(s,l,r,n,a,i,f);else if((this._ctl&128)==0)w=this._basicRect(this._ctl,s,l,r,n,a,i,f);else throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");return w&&(this._ctl=null),w}},{key:"_fillRect",value:function(s,l,r,n,a,i,f){if(a.rQwait("TIGHT",3))return!1;var h=a.rQi,w=a.rQ;return i.fillRect(s,l,r,n,[w[h+2],w[h+1],w[h]],!1),a.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(s,l,r,n,a,i,f){var h=this._readData(a);return h===null?!1:(i.imageRect(s,l,r,n,"image/jpeg",h),!0)}},{key:"_pngRect",value:function(s,l,r,n,a,i,f){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(s,l,r,n,a,i,f,h){if(this._filter===null)if(s&4){if(i.rQwait("TIGHT",1))return!1;this._filter=i.rQshift8()}else this._filter=0;var w=s&3,m;switch(this._filter){case 0:m=this._copyFilter(w,l,r,n,a,i,f,h);break;case 1:m=this._paletteFilter(w,l,r,n,a,i,f,h);break;case 2:m=this._gradientFilter(w,l,r,n,a,i,f,h);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return m&&(this._filter=null),m}},{key:"_copyFilter",value:function(s,l,r,n,a,i,f,h){var w=n*a*3,m;if(w<12){if(i.rQwait("TIGHT",w))return!1;m=i.rQshiftBytes(w)}else{if(m=this._readData(i),m===null)return!1;this._zlibs[s].setInput(m),m=this._zlibs[s].inflate(w),this._zlibs[s].setInput(null)}return f.blitRgbImage(l,r,n,a,m,0,!1),!0}},{key:"_paletteFilter",value:function(s,l,r,n,a,i,f,h){if(this._numColors===0){if(i.rQwait("TIGHT palette",1))return!1;var w=i.rQpeek8()+1,m=w*3;if(i.rQwait("TIGHT palette",1+m))return!1;this._numColors=w,i.rQskipBytes(1),i.rQshiftTo(this._palette,m)}var T=this._numColors<=2?1:8,A=Math.floor((n*T+7)/8),x=A*a,b;if(x<12){if(i.rQwait("TIGHT",x))return!1;b=i.rQshiftBytes(x)}else{if(b=this._readData(i),b===null)return!1;this._zlibs[s].setInput(b),b=this._zlibs[s].inflate(x),this._zlibs[s].setInput(null)}return this._numColors==2?this._monoRect(l,r,n,a,b,this._palette,f):this._paletteRect(l,r,n,a,b,this._palette,f),this._numColors=0,!0}},{key:"_monoRect",value:function(s,l,r,n,a,i,f){for(var h=this._getScratchBuffer(r*n*4),w=Math.floor((r+7)/8),m=Math.floor(r/8),T=0;T<n;T++){var A=void 0,x=void 0,b=void 0;for(b=0;b<m;b++)for(var S=7;S>=0;S--)A=(T*r+b*8+7-S)*4,x=(a[T*w+b]>>S&1)*3,h[A]=i[x],h[A+1]=i[x+1],h[A+2]=i[x+2],h[A+3]=255;for(var C=7;C>=8-r%8;C--)A=(T*r+b*8+7-C)*4,x=(a[T*w+b]>>C&1)*3,h[A]=i[x],h[A+1]=i[x+1],h[A+2]=i[x+2],h[A+3]=255}f.blitRgbxImage(s,l,r,n,h,0,!1)}},{key:"_paletteRect",value:function(s,l,r,n,a,i,f){for(var h=this._getScratchBuffer(r*n*4),w=r*n*4,m=0,T=0;m<w;m+=4,T++){var A=a[T]*3;h[m]=i[A],h[m+1]=i[A+1],h[m+2]=i[A+2],h[m+3]=255}f.blitRgbxImage(s,l,r,n,h,0,!1)}},{key:"_gradientFilter",value:function(s,l,r,n,a,i,f,h){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(s){if(this._len===0){if(s.rQwait("TIGHT",3))return null;var l;l=s.rQshift8(),this._len=l&127,l&128&&(l=s.rQshift8(),this._len|=(l&127)<<7,l&128&&(l=s.rQshift8(),this._len|=l<<14))}if(s.rQwait("TIGHT",this._len))return null;var r=s.rQshiftBytes(this._len);return this._len=0,r}},{key:"_getScratchBuffer",value:function(s){return(!this._scratchBuffer||this._scratchBuffer.length<s)&&(this._scratchBuffer=new Uint8Array(s)),this._scratchBuffer}}]),o}();ue.default=u},"9Bee":function($e,ue,ie){"use strict";var j=ie("k1fw"),k=ie("tJVT"),D=ie("q1tI"),R=ie.n(D),O=ie("vg9a"),c=ie("DlQD"),E=ie.n(c),y=ie("rUJ1");function p(G,ee){var de=G.match(/^(\s+)(?:```)/);if(de===null)return ee;var ge=de[1];return ee.split(`
|
|
|
`).map(function(Be){var Ue=Be.match(/^\s+/);if(Ue===null)return Be;var Le=Object(k.a)(Ue,1),Me=Le[0];return Me.length>=ge.length?Be.slice(ge.length):Be}).join(`
|
|
|
`)}var u=[],o=["<ul>"],d=new E.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function l(){u.length=0,o=["<ul>"]}var r={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function n(G,ee,de,ge){if(ee>=G.length||G[ee].level<=de)return ee;var Be=G[ee];ge.push("<li><a href='#"+Be.anchor+"'>"+Be.text+"</a>"),ee++;var Ue=[];return ee=n(G,ee,Be.level,Ue),Ue.length>0&&(ge.push("<ul>"),Ue.forEach(function(Le){ge.push(Le)}),ge.push("</ul>")),ge.push("</li>"),ee=n(G,ee,de,ge),ee}function a(){return n(u,0,0,o),o.push("</ul>"),o.join("")}var i={heading:function(ee){var de=s.exec(ee);if(de)return{type:"heading",raw:de[0],depth:de[1].length,text:de[2]}},fences:function(ee){var de=this.rules.block.fences.exec(ee);if(de){var ge=de[0],Be=p(ge,de[3]||""),Ue=de[2]?de[2].trim():de[2];if(["latex","katex","math"].indexOf(Ue)>=0){var Le=w(),Me=Be;Be=Le,m[Le]={type:"block",expression:Me}}return{type:"code",raw:ge,lang:Ue,text:Be}}}},f=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,w=function(){return"__special_katext_id_".concat(h++,"__")},m={};function T(){return m}function A(){h=0,m={}}function x(G){return G=G.replace(f,function(ee,de){var ge=w();return m[ge]={type:"inline",expression:de},ge}),G}var b=d.listitem;d.listitem=function(G){return b(x(G))};var S=d.paragraph;d.paragraph=function(G){return S(x(G))};var C=d.tablecell;d.tablecell=function(G,ee){return C(x(G),ee)},d.code=function(G,ee,de){var ge=(ee||"").match(/\S*/)[0];return ge?["latex","katex","math"].indexOf(ge)>=0?"<p class='editormd-tex'>".concat(G,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(ee,'">').concat(de?G:Object(y.escape)(G,!0),`</code></pre>
|
|
|
`):'<pre class="prettyprint linenums"><code>'+(de?G:Object(y.escape)(G,!0))+"</code></pre>"},d.heading=function(G,ee,de){var ge=this.options.headerPrefix+de.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return u.push({anchor:ge,level:ee,text:G}),"<h"+ee+' id="'+ge+'">'+G+"</h"+ee+">"},E.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),E.a.use({tokenizer:i,renderer:d});var g=E.a,M=ie("SJMd"),I=ie("ulZh"),P=ie.n(I),B=ie("m3rI"),H=ie("Oy/b"),F=ie("p5ED"),W=/<pre[^>]*>/g;function U(G){var ee=document.createElement("div");return ee.innerHTML=G,ee.childNodes.length===0?"":ee.childNodes[0].nodeValue}var K=ue.a=function(G){var ee,de=G.value,ge=de===void 0?"":de,Be=G.className,Ue=G.showTextOnly,Le=G.showLines,Me=G.style,Pe=Me===void 0?{}:Me,be=G.stylesPrev,ke=be===void 0?{}:be,te=(ee=String(ge))===null||ee===void 0?void 0:ee.replace(/<script.*?>|<\/script>/gi,"").replace(/on\w+="[^"]*"/gi,""),pe=Object(D.useState)(""),ae=Object(k.a)(pe,2),_e=ae[0],Ie=ae[1],Fe=Object(D.useMemo)(function(){try{var Re=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Se=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Te=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;te=te.replace(Re,"("+B.a.API_SERVER+"/api/attachments/").replace(Se,'"'+B.a.API_SERVER+"/api/attachments/").replace(Te,'"'+B.a.API_SERVER+"/files/uploads/").replace(/\r\n/g,`
|
|
|
`),te=te.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`
|
|
|
`)}catch(J){}var Ee=g(te),$=T();if(te.match(/\[TOC\]/)&&(Ee=Ee.replace("<p>[TOC]</p>",a()),l()),Ee=Ee.replace(/(__special_katext_id_\d+__)/g,function(J,Ae){var We=$[Ae],Ye=We.type,Ne=We.expression;return Object(H.renderToString)(U(Ne)||"",{displayMode:Ye==="block",throwOnError:!1,output:"html"})}),Ee=Ee.replace(/▁/g,"\u2581\u2581\u2581"),A(),Ue){var fe=document.createElement("div");return fe.innerHTML=Ee,fe.innerText}return setTimeout(function(){return ze()},500),Ee},[te]),Xe=Object(D.useRef)();r.WebkitLineClamp=Le,Le&&(Pe=Object(j.a)(Object(j.a)({},Pe),r));function Ge(Re){var Se=Re.target;if(Se.tagName.toUpperCase()==="A"){var Te=Se.getAttribute("href");if(Te.indexOf("office")>-1)Re.preventDefault(),Ie(Te);else if(Te.startsWith("#")){Re.preventDefault();var Ee=document.getElementById(Te.replace("#",""));Ee&&Ee.scrollIntoView(!0)}}}var ze=function(){var Se,Te=(Se=Xe.current)===null||Se===void 0?void 0:Se.querySelectorAll("video");Te==null||Te.forEach(function(Ee){if(Ee.oncontextmenu=function(){return!1},Ee.src.indexOf(".m3u8")>-1&&!Ee.canPlayType("application/vnd.apple.mpegurl")){if(P.a.isSupported()){var $=new P.a;$.loadSource(Ee.src),$.attachMedia(Ee)}}})};return Object(D.useEffect)(function(){if(Xe.current&&Fe&&(Fe.match(W)&&window.PR.prettyPrint()),Xe.current)return Xe.current.addEventListener("click",Ge),function(){Xe.current.removeEventListener("click",Ge),A(),l()}},[Fe,Xe.current,Ge]),R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{ref:Xe,style:Object(j.a)({},Pe),className:"".concat(Be||""," markdown-body "),dangerouslySetInnerHTML:{__html:Fe}}),R.a.createElement(F.a,{close:!0,data:_e,type:_e!=null&&_e.length?"office":"",style:Object(j.a)({},ke),onClose:function(){return Ie("")}}))}},"9VGf":function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return D});var j=ie("q1tI"),k=ie.n(j);function D(R,O){var c=Object(j.useRef)();Object(j.useEffect)(function(){c.current=R}),Object(j.useEffect)(function(){function E(){c.current()}if(O!==null){var y=setInterval(E,O);return function(){return clearInterval(y)}}},[O])}},BU3w:function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return c});var j=ie("MNnm"),k="rc-util-key";function D(E){if(E.attachTo)return E.attachTo;var y=document.querySelector("head");return y||document.body}function R(E){var y,p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(j.a)())return null;var u=document.createElement("style");if((y=p.csp)===null||y===void 0?void 0:y.nonce){var o;u.nonce=(o=p.csp)===null||o===void 0?void 0:o.nonce}u.innerHTML=E;var d=D(p),s=d.firstChild;return p.prepend&&d.prepend?d.prepend(u):p.prepend&&s?d.insertBefore(u,s):d.appendChild(u),u}var O=new Map;function c(E,y){var p=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=D(p);if(!O.has(u)){var o=R("",p),d=o.parentNode;O.set(u,d),d.removeChild(o)}var s=Array.from(O.get(u).children).find(function(i){return i.tagName==="STYLE"&&i[k]===y});if(s){var l,r;if(((l=p.csp)===null||l===void 0?void 0:l.nonce)&&s.nonce!==((r=p.csp)===null||r===void 0?void 0:r.nonce)){var n;s.nonce=(n=p.csp)===null||n===void 0?void 0:n.nonce}return s.innerHTML!==E&&(s.innerHTML=E),s}var a=R(E,p);return a[k]=y,a}},Bd2K:function($e,ue,ie){(function(j){j(ie("VrN/"),ie("osHv"))})(function(j){j.defineOption("autoCloseTags",!1,function(p,u,o){if(o!=j.Init&&o&&p.removeKeyMap("autoCloseTags"),!u)return;var d={name:"autoCloseTags"};(typeof u!="object"||u.whenClosing!==!1)&&(d["'/'"]=function(s){return c(s)}),(typeof u!="object"||u.whenOpening!==!1)&&(d["'>'"]=function(s){return R(s)}),p.addKeyMap(d)});var k=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],D=["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 R(p){if(p.getOption("disableInput"))return j.Pass;for(var u=p.listSelections(),o=[],d=p.getOption("autoCloseTags"),s=0;s<u.length;s++){if(!u[s].empty())return j.Pass;var l=u[s].head,r=p.getTokenAt(l),n=j.innerMode(p.getMode(),r.state),a=n.state,i=n.mode.xmlCurrentTag&&n.mode.xmlCurrentTag(a),f=i&&i.name;if(!f)return j.Pass;var h=n.mode.configuration=="html",w=typeof d=="object"&&d.dontCloseTags||h&&k,m=typeof d=="object"&&d.indentTags||h&&D;r.end>l.ch&&(f=f.slice(0,f.length-r.end+l.ch));var T=f.toLowerCase();if(!f||r.type=="string"&&(r.end!=l.ch||!/[\"\']/.test(r.string.charAt(r.string.length-1))||r.string.length==1)||r.type=="tag"&&i.close||r.string.indexOf("/")==l.ch-r.start-1||w&&E(w,T)>-1||y(p,n.mode.xmlCurrentContext&&n.mode.xmlCurrentContext(a)||[],f,l,!0))return j.Pass;var A=typeof d=="object"&&d.emptyTags;if(A&&E(A,f)>-1){o[s]={text:"/>",newPos:j.Pos(l.line,l.ch+2)};continue}var x=m&&E(m,T)>-1;o[s]={indent:x,text:">"+(x?`
|
|
|
|
|
|
`:"")+"</"+f+">",newPos:x?j.Pos(l.line+1,0):j.Pos(l.line,l.ch+1)}}for(var b=typeof d=="object"&&d.dontIndentOnAutoClose,s=u.length-1;s>=0;s--){var S=o[s];p.replaceRange(S.text,u[s].head,u[s].anchor,"+insert");var C=p.listSelections().slice(0);C[s]={head:S.newPos,anchor:S.newPos},p.setSelections(C),!b&&S.indent&&(p.indentLine(S.newPos.line,null,!0),p.indentLine(S.newPos.line+1,null,!0))}}function O(p,u){for(var o=p.listSelections(),d=[],s=u?"/":"</",l=p.getOption("autoCloseTags"),r=typeof l=="object"&&l.dontIndentOnSlash,n=0;n<o.length;n++){if(!o[n].empty())return j.Pass;var a=o[n].head,i=p.getTokenAt(a),f=j.innerMode(p.getMode(),i.state),h=f.state;if(u&&(i.type=="string"||i.string.charAt(0)!="<"||i.start!=a.ch-1))return j.Pass;var w,m=f.mode.name!="xml"&&p.getMode().name=="htmlmixed";if(m&&f.mode.name=="javascript")w=s+"script";else if(m&&f.mode.name=="css")w=s+"style";else{var T=f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(h);if(!T||T.length&&y(p,T,T[T.length-1],a))return j.Pass;w=s+T[T.length-1]}p.getLine(a.line).charAt(i.end)!=">"&&(w+=">"),d[n]=w}if(p.replaceSelections(d),o=p.listSelections(),!r)for(var n=0;n<o.length;n++)(n==o.length-1||o[n].head.line<o[n+1].head.line)&&p.indentLine(o[n].head.line)}function c(p){return p.getOption("disableInput")?j.Pass:O(p,!0)}j.commands.closeTag=function(p){return O(p)};function E(p,u){if(p.indexOf)return p.indexOf(u);for(var o=0,d=p.length;o<d;++o)if(p[o]==u)return o;return-1}function y(p,u,o,d,s){if(!j.scanForClosingTag)return!1;var l=Math.min(p.lastLine()+1,d.line+500),r=j.scanForClosingTag(p,d,null,l);if(!r||r.tag!=o)return!1;for(var n=s?1:0,a=u.length-1;a>=0&&u[a]==o;a--)++n;d=r.to;for(var a=1;a<n;a++){var i=j.scanForClosingTag(p,d,null,l);if(!i||i.tag!=o)return!1;d=i.to}return!0}})},BjJ7:function($e,ue,ie){"use strict";ie.d(ue,"d",function(){return k}),ie.d(ue,"c",function(){return D}),ie.d(ue,"e",function(){return R}),ie.d(ue,"b",function(){return O}),ie.d(ue,"a",function(){return E});var j=ie("m3rI");function k(y){var p=!0;if(y.length>0){for(var u=0;u<y.length;u++)if(y[u].compile_success==0||!y[u].compile_success){p=!1;break}}else p=!1;return p}function D(y){for(var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",u=[],o=0;o<y.length;o++){var d=y[o],s=p?"".concat(p,"/").concat(d.name):"".concat(d.name);u.push({title:d.name,isLeaf:!(d.type==="tree"),key:s})}return u}function R(y,p,u){for(var o=0;o<y.length;o++){var d=y[o];if(d.key===p){d.children=u;break}d.children&&R(d.children,p,u)}return y}function O(y,p,u){var o;return function(){var d=this,s=arguments,l=function(){o=null,u||y.apply(d,s)},r=u&&!o;clearTimeout(o),o=setTimeout(l,p),r&&y.apply(d,s)}}var c=!0,E=j.a.API_SERVER},"C+DQ":function($e,ue,ie){},DlQD:function($e,ue,ie){(function(j,k){$e.exports=k()})(this,function(){"use strict";function j(he,ce){for(var le=0;le<ce.length;le++){var Y=ce[le];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(he,Y.key,Y)}}function k(he,ce,le){return ce&&j(he.prototype,ce),le&&j(he,le),he}function D(he,ce){if(!he)return;if(typeof he=="string")return R(he,ce);var le=Object.prototype.toString.call(he).slice(8,-1);if(le==="Object"&&he.constructor&&(le=he.constructor.name),le==="Map"||le==="Set")return Array.from(he);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return R(he,ce)}function R(he,ce){(ce==null||ce>he.length)&&(ce=he.length);for(var le=0,Y=new Array(ce);le<ce;le++)Y[le]=he[le];return Y}function O(he,ce){var le;if(typeof Symbol=="undefined"||he[Symbol.iterator]==null){if(Array.isArray(he)||(le=D(he))||ce&&he&&typeof he.length=="number"){le&&(he=le);var Y=0;return function(){return Y>=he.length?{done:!0}:{done:!1,value:he[Y++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return le=he[Symbol.iterator](),le.next.bind(le)}function c(he,ce){return ce={exports:{}},he(ce,ce.exports),ce.exports}var E=c(function(he){function ce(){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 le(Y){he.exports.defaults=Y}he.exports={defaults:ce(),getDefaults:ce,changeDefaults:le}}),y=E.defaults,p=E.getDefaults,u=E.changeDefaults,o=/[&<>"']/,d=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,r={"&":"&","<":"<",">":">",'"':""","'":"'"},n=function(ce){return r[ce]};function a(he,ce){if(ce){if(o.test(he))return he.replace(d,n)}else if(s.test(he))return he.replace(l,n);return he}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function f(he){return he.replace(i,function(ce,le){return le=le.toLowerCase(),le==="colon"?":":le.charAt(0)==="#"?le.charAt(1)==="x"?String.fromCharCode(parseInt(le.substring(2),16)):String.fromCharCode(+le.substring(1)):""})}var h=/(^|[^\[])\^/g;function w(he,ce){he=he.source||he,ce=ce||"";var le={replace:function(Z,z){return z=z.source||z,z=z.replace(h,"$1"),he=he.replace(Z,z),le},getRegex:function(){return new RegExp(he,ce)}};return le}var m=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(he,ce,le){if(he){var Y;try{Y=decodeURIComponent(f(le)).replace(m,"").toLowerCase()}catch(Z){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}ce&&!T.test(le)&&(le=g(ce,le));try{le=encodeURI(le).replace(/%25/g,"%")}catch(Z){return null}return le}var x={},b=/^[^:]+:\/*[^/]*$/,S=/^([^:]+:)[\s\S]*$/,C=/^([^:]+:\/*[^/]*)[\s\S]*$/;function g(he,ce){x[" "+he]||(b.test(he)?x[" "+he]=he+"/":x[" "+he]=B(he,"/",!0)),he=x[" "+he];var le=he.indexOf(":")===-1;return ce.substring(0,2)==="//"?le?ce:he.replace(S,"$1")+ce:ce.charAt(0)==="/"?le?ce:he.replace(C,"$1")+ce:he+ce}var M={exec:function(){}};function I(he){for(var ce=1,le,Y;ce<arguments.length;ce++){le=arguments[ce];for(Y in le)Object.prototype.hasOwnProperty.call(le,Y)&&(he[Y]=le[Y])}return he}function P(he,ce){var le=he.replace(/\|/g,function(z,oe,Ce){for(var X=!1,me=oe;--me>=0&&Ce[me]==="\\";)X=!X;return X?"|":" |"}),Y=le.split(/ \|/),Z=0;if(Y.length>ce)Y.splice(ce);else for(;Y.length<ce;)Y.push("");for(;Z<Y.length;Z++)Y[Z]=Y[Z].trim().replace(/\\\|/g,"|");return Y}function B(he,ce,le){var Y=he.length;if(Y===0)return"";for(var Z=0;Z<Y;){var z=he.charAt(Y-Z-1);if(z===ce&&!le)Z++;else if(z!==ce&&le)Z++;else break}return he.substr(0,Y-Z)}function H(he,ce){if(he.indexOf(ce[1])===-1)return-1;for(var le=he.length,Y=0,Z=0;Z<le;Z++)if(he[Z]==="\\")Z++;else if(he[Z]===ce[0])Y++;else if(he[Z]===ce[1]&&(Y--,Y<0))return Z;return-1}function F(he){he&&he.sanitize&&!he.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var W={escape:a,unescape:f,edit:w,cleanUrl:A,resolveUrl:g,noopTest:M,merge:I,splitCells:P,rtrim:B,findClosingBracket:H,checkSanitizeDeprecation:F},U=E.defaults,K=W.rtrim,G=W.splitCells,ee=W.escape,de=W.findClosingBracket;function ge(he,ce,le){var Y=ce.href,Z=ce.title?ee(ce.title):null,z=he[1].replace(/\\([\[\]])/g,"$1");return he[0].charAt(0)!=="!"?{type:"link",raw:le,href:Y,title:Z,text:z}:{type:"image",raw:le,href:Y,title:Z,text:ee(z)}}function Be(he,ce){var le=he.match(/^(\s+)(?:```)/);if(le===null)return ce;var Y=le[1];return ce.split(`
|
|
|
`).map(function(Z){var z=Z.match(/^\s+/);if(z===null)return Z;var oe=z[0];return oe.length>=Y.length?Z.slice(Y.length):Z}).join(`
|
|
|
`)}var Ue=function(){function he(le){this.options=le||U}var ce=he.prototype;return ce.space=function(Y){var Z=this.rules.block.newline.exec(Y);if(Z)return Z[0].length>1?{type:"space",raw:Z[0]}:{raw:`
|
|
|
`}},ce.code=function(Y,Z){var z=this.rules.block.code.exec(Y);if(z){var oe=Z[Z.length-1];if(oe&&oe.type==="paragraph")return{raw:z[0],text:z[0].trimRight()};var Ce=z[0].replace(/^ {4}/gm,"");return{type:"code",raw:z[0],codeBlockStyle:"indented",text:this.options.pedantic?Ce:K(Ce,`
|
|
|
`)}}},ce.fences=function(Y){var Z=this.rules.block.fences.exec(Y);if(Z){var z=Z[0],oe=Be(z,Z[3]||"");return{type:"code",raw:z,lang:Z[2]?Z[2].trim():Z[2],text:oe}}},ce.heading=function(Y){var Z=this.rules.block.heading.exec(Y);if(Z)return{type:"heading",raw:Z[0],depth:Z[1].length,text:Z[2]}},ce.nptable=function(Y){var Z=this.rules.block.nptable.exec(Y);if(Z){var z={type:"table",header:G(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
|
`):[],raw:Z[0]};if(z.header.length===z.align.length){var oe=z.align.length,Ce;for(Ce=0;Ce<oe;Ce++)/^ *-+: *$/.test(z.align[Ce])?z.align[Ce]="right":/^ *:-+: *$/.test(z.align[Ce])?z.align[Ce]="center":/^ *:-+ *$/.test(z.align[Ce])?z.align[Ce]="left":z.align[Ce]=null;for(oe=z.cells.length,Ce=0;Ce<oe;Ce++)z.cells[Ce]=G(z.cells[Ce],z.header.length);return z}}},ce.hr=function(Y){var Z=this.rules.block.hr.exec(Y);if(Z)return{type:"hr",raw:Z[0]}},ce.blockquote=function(Y){var Z=this.rules.block.blockquote.exec(Y);if(Z){var z=Z[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Z[0],text:z}}},ce.list=function(Y){var Z=this.rules.block.list.exec(Y);if(Z){for(var z=Z[0],oe=Z[2],Ce=oe.length>1,X=oe[oe.length-1]===")",me={type:"list",raw:z,ordered:Ce,start:Ce?+oe.slice(0,-1):"",loose:!1,items:[]},De=Z[0].match(this.rules.block.item),se=!1,ve,Ke,rt,qe,Je,lt,vt,ct=De.length,it=0;it<ct;it++)ve=De[it],z=ve,Ke=ve.length,ve=ve.replace(/^ *([*+-]|\d+[.)]) */,""),~ve.indexOf(`
|
|
|
`)&&(Ke-=ve.length,ve=this.options.pedantic?ve.replace(/^ {1,4}/gm,""):ve.replace(new RegExp("^ {1,"+Ke+"}","gm"),"")),it!==ct-1&&(rt=this.rules.block.bullet.exec(De[it+1])[0],(Ce?rt.length===1||!X&&rt[rt.length-1]===")":rt.length>1||this.options.smartLists&&rt!==oe)&&(qe=De.slice(it+1).join(`
|
|
|
`),me.raw=me.raw.substring(0,me.raw.length-qe.length),it=ct-1)),Je=se||/\n\n(?!\s*$)/.test(ve),it!==ct-1&&(se=ve.charAt(ve.length-1)===`
|
|
|
`,Je||(Je=se)),Je&&(me.loose=!0),lt=/^\[[ xX]\] /.test(ve),vt=void 0,lt&&(vt=ve[1]!==" ",ve=ve.replace(/^\[[ xX]\] +/,"")),me.items.push({type:"list_item",raw:z,task:lt,checked:vt,loose:Je,text:ve});return me}},ce.html=function(Y){var Z=this.rules.block.html.exec(Y);if(Z)return{type:this.options.sanitize?"paragraph":"html",raw:Z[0],pre:!this.options.sanitizer&&(Z[1]==="pre"||Z[1]==="script"||Z[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Z[0]):ee(Z[0]):Z[0]}},ce.def=function(Y){var Z=this.rules.block.def.exec(Y);if(Z){Z[3]&&(Z[3]=Z[3].substring(1,Z[3].length-1));var z=Z[1].toLowerCase().replace(/\s+/g," ");return{tag:z,raw:Z[0],href:Z[2],title:Z[3]}}},ce.table=function(Y){var Z=this.rules.block.table.exec(Y);if(Z){var z={type:"table",header:G(Z[1].replace(/^ *| *\| *$/g,"")),align:Z[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Z[3]?Z[3].replace(/\n$/,"").split(`
|
|
|
`):[]};if(z.header.length===z.align.length){z.raw=Z[0];var oe=z.align.length,Ce;for(Ce=0;Ce<oe;Ce++)/^ *-+: *$/.test(z.align[Ce])?z.align[Ce]="right":/^ *:-+: *$/.test(z.align[Ce])?z.align[Ce]="center":/^ *:-+ *$/.test(z.align[Ce])?z.align[Ce]="left":z.align[Ce]=null;for(oe=z.cells.length,Ce=0;Ce<oe;Ce++)z.cells[Ce]=G(z.cells[Ce].replace(/^ *\| *| *\| *$/g,""),z.header.length);return z}}},ce.lheading=function(Y){var Z=this.rules.block.lheading.exec(Y);if(Z)return{type:"heading",raw:Z[0],depth:Z[2].charAt(0)==="="?1:2,text:Z[1]}},ce.paragraph=function(Y){var Z=this.rules.block.paragraph.exec(Y);if(Z)return{type:"paragraph",raw:Z[0],text:Z[1].charAt(Z[1].length-1)===`
|
|
|
`?Z[1].slice(0,-1):Z[1]}},ce.text=function(Y,Z){var z=this.rules.block.text.exec(Y);if(z){var oe=Z[Z.length-1];return oe&&oe.type==="text"?{raw:z[0],text:z[0]}:{type:"text",raw:z[0],text:z[0]}}},ce.escape=function(Y){var Z=this.rules.inline.escape.exec(Y);if(Z)return{type:"escape",raw:Z[0],text:ee(Z[1])}},ce.tag=function(Y,Z,z){var oe=this.rules.inline.tag.exec(Y);if(oe)return!Z&&/^<a /i.test(oe[0])?Z=!0:Z&&/^<\/a>/i.test(oe[0])&&(Z=!1),!z&&/^<(pre|code|kbd|script)(\s|>)/i.test(oe[0])?z=!0:z&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(oe[0])&&(z=!1),{type:this.options.sanitize?"text":"html",raw:oe[0],inLink:Z,inRawBlock:z,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ee(oe[0]):oe[0]}},ce.link=function(Y){var Z=this.rules.inline.link.exec(Y);if(Z){var z=de(Z[2],"()");if(z>-1){var oe=Z[0].indexOf("!")===0?5:4,Ce=oe+Z[1].length+z;Z[2]=Z[2].substring(0,z),Z[0]=Z[0].substring(0,Ce).trim(),Z[3]=""}var X=Z[2],me="";if(this.options.pedantic){var De=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(X);De?(X=De[1],me=De[3]):me=""}else me=Z[3]?Z[3].slice(1,-1):"";X=X.trim().replace(/^<([\s\S]*)>$/,"$1");var se=ge(Z,{href:X&&X.replace(this.rules.inline._escapes,"$1"),title:me&&me.replace(this.rules.inline._escapes,"$1")},Z[0]);return se}},ce.reflink=function(Y,Z){var z;if((z=this.rules.inline.reflink.exec(Y))||(z=this.rules.inline.nolink.exec(Y))){var oe=(z[2]||z[1]).replace(/\s+/g," ");if(oe=Z[oe.toLowerCase()],!oe||!oe.href){var Ce=z[0].charAt(0);return{type:"text",raw:Ce,text:Ce}}var X=ge(z,oe,z[0]);return X}},ce.strong=function(Y,Z,z){z===void 0&&(z="");var oe=this.rules.inline.strong.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){Z=Z.slice(-1*Y.length);var Ce=oe[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Ce.lastIndex=0;for(var X;(oe=Ce.exec(Z))!=null;)if(X=this.rules.inline.strong.middle.exec(Z.slice(0,oe.index+3)),X)return{type:"strong",raw:Y.slice(0,X[0].length),text:Y.slice(2,X[0].length-2)}}},ce.em=function(Y,Z,z){z===void 0&&(z="");var oe=this.rules.inline.em.start.exec(Y);if(oe&&(!oe[1]||oe[1]&&(z===""||this.rules.inline.punctuation.exec(z)))){Z=Z.slice(-1*Y.length);var Ce=oe[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Ce.lastIndex=0;for(var X;(oe=Ce.exec(Z))!=null;)if(X=this.rules.inline.em.middle.exec(Z.slice(0,oe.index+2)),X)return{type:"em",raw:Y.slice(0,X[0].length),text:Y.slice(1,X[0].length-1)}}},ce.codespan=function(Y){var Z=this.rules.inline.code.exec(Y);if(Z){var z=Z[2].replace(/\n/g," "),oe=/[^ ]/.test(z),Ce=z.startsWith(" ")&&z.endsWith(" ");return oe&&Ce&&(z=z.substring(1,z.length-1)),z=ee(z,!0),{type:"codespan",raw:Z[0],text:z}}},ce.br=function(Y){var Z=this.rules.inline.br.exec(Y);if(Z)return{type:"br",raw:Z[0]}},ce.del=function(Y){var Z=this.rules.inline.del.exec(Y);if(Z)return{type:"del",raw:Z[0],text:Z[1]}},ce.autolink=function(Y,Z){var z=this.rules.inline.autolink.exec(Y);if(z){var oe,Ce;return z[2]==="@"?(oe=ee(this.options.mangle?Z(z[1]):z[1]),Ce="mailto:"+oe):(oe=ee(z[1]),Ce=oe),{type:"link",raw:z[0],text:oe,href:Ce,tokens:[{type:"text",raw:oe,text:oe}]}}},ce.url=function(Y,Z){var z;if(z=this.rules.inline.url.exec(Y)){var oe,Ce;if(z[2]==="@")oe=ee(this.options.mangle?Z(z[0]):z[0]),Ce="mailto:"+oe;else{var X;do X=z[0],z[0]=this.rules.inline._backpedal.exec(z[0])[0];while(X!==z[0]);oe=ee(z[0]),z[1]==="www."?Ce="http://"+oe:Ce=oe}return{type:"link",raw:z[0],text:oe,href:Ce,tokens:[{type:"text",raw:oe,text:oe}]}}},ce.inlineText=function(Y,Z,z){var oe=this.rules.inline.text.exec(Y);if(oe){var Ce;return Z?Ce=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(oe[0]):ee(oe[0]):oe[0]:Ce=ee(this.options.smartypants?z(oe[0]):oe[0]),{type:"text",raw:oe[0],text:Ce}}},he}(),Le=W.noopTest,Me=W.edit,Pe=W.merge,be={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:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Me(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Me(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Me(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._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",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Me(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Me(be._paragraph).replace("hr",be.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",be._tag).getRegex(),be.blockquote=Me(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Pe({},be),be.gfm=Pe({},be.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*|$)"}),be.gfm.nptable=Me(be.gfm.nptable).replace("hr",be.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",be._tag).getRegex(),be.gfm.table=Me(be.gfm.table).replace("hr",be.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",be._tag).getRegex(),be.pedantic=Pe({},be.normal,{html:Me(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._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:Le,paragraph:Me(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
|
|
|
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ke={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,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:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ke._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ke.punctuation=Me(ke.punctuation).replace(/punctuation/g,ke._punctuation).getRegex(),ke._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ke._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ke.em.start=Me(ke.em.start).replace(/punctuation/g,ke._punctuation).getRegex(),ke.em.middle=Me(ke.em.middle).replace(/punctuation/g,ke._punctuation).replace(/overlapSkip/g,ke._overlapSkip).getRegex(),ke.em.endAst=Me(ke.em.endAst,"g").replace(/punctuation/g,ke._punctuation).getRegex(),ke.em.endUnd=Me(ke.em.endUnd,"g").replace(/punctuation/g,ke._punctuation).getRegex(),ke.strong.start=Me(ke.strong.start).replace(/punctuation/g,ke._punctuation).getRegex(),ke.strong.middle=Me(ke.strong.middle).replace(/punctuation/g,ke._punctuation).replace(/blockSkip/g,ke._blockSkip).getRegex(),ke.strong.endAst=Me(ke.strong.endAst,"g").replace(/punctuation/g,ke._punctuation).getRegex(),ke.strong.endUnd=Me(ke.strong.endUnd,"g").replace(/punctuation/g,ke._punctuation).getRegex(),ke.blockSkip=Me(ke._blockSkip,"g").getRegex(),ke.overlapSkip=Me(ke._overlapSkip,"g").getRegex(),ke._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ke._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ke._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])?)+(?![-_])/,ke.autolink=Me(ke.autolink).replace("scheme",ke._scheme).replace("email",ke._email).getRegex(),ke._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ke.tag=Me(ke.tag).replace("comment",be._comment).replace("attribute",ke._attribute).getRegex(),ke._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ke._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ke._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ke.link=Me(ke.link).replace("label",ke._label).replace("href",ke._href).replace("title",ke._title).getRegex(),ke.reflink=Me(ke.reflink).replace("label",ke._label).getRegex(),ke.reflinkSearch=Me(ke.reflinkSearch,"g").replace("reflink",ke.reflink).replace("nolink",ke.nolink).getRegex(),ke.normal=Pe({},ke),ke.pedantic=Pe({},ke.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",ke._label).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ke._label).getRegex()}),ke.gfm=Pe({},ke.normal,{escape:Me(ke.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ke.gfm.url=Me(ke.gfm.url,"i").replace("email",ke.gfm._extended_email).getRegex(),ke.breaks=Pe({},ke.gfm,{br:Me(ke.br).replace("{2,}","*").getRegex(),text:Me(ke.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var te={block:be,inline:ke},pe=E.defaults,ae=te.block,_e=te.inline;function Ie(he){return he.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Fe(he){var ce="",le,Y,Z=he.length;for(le=0;le<Z;le++)Y=he.charCodeAt(le),Math.random()>.5&&(Y="x"+Y.toString(16)),ce+="&#"+Y+";";return ce}var Xe=function(){function he(le){this.tokens=[],this.tokens.links=Object.create(null),this.options=le||pe,this.options.tokenizer=this.options.tokenizer||new Ue,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:ae.normal,inline:_e.normal};this.options.pedantic?(Y.block=ae.pedantic,Y.inline=_e.pedantic):this.options.gfm&&(Y.block=ae.gfm,this.options.breaks?Y.inline=_e.breaks:Y.inline=_e.gfm),this.tokenizer.rules=Y}he.lex=function(Y,Z){var z=new he(Z);return z.lex(Y)};var ce=he.prototype;return ce.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
|
|
|
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(Y,Z,z){Z===void 0&&(Z=[]),z===void 0&&(z=!0),Y=Y.replace(/^ +$/gm,"");for(var oe,Ce,X,me;Y;){if(oe=this.tokenizer.space(Y)){Y=Y.substring(oe.raw.length),oe.type&&Z.push(oe);continue}if(oe=this.tokenizer.code(Y,Z)){Y=Y.substring(oe.raw.length),oe.type?Z.push(oe):(me=Z[Z.length-1],me.raw+=`
|
|
|
`+oe.raw,me.text+=`
|
|
|
`+oe.text);continue}if(oe=this.tokenizer.fences(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.heading(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.nptable(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.hr(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.blockquote(Y)){Y=Y.substring(oe.raw.length),oe.tokens=this.blockTokens(oe.text,[],z),Z.push(oe);continue}if(oe=this.tokenizer.list(Y)){for(Y=Y.substring(oe.raw.length),X=oe.items.length,Ce=0;Ce<X;Ce++)oe.items[Ce].tokens=this.blockTokens(oe.items[Ce].text,[],!1);Z.push(oe);continue}if(oe=this.tokenizer.html(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(z&&(oe=this.tokenizer.def(Y))){Y=Y.substring(oe.raw.length),this.tokens.links[oe.tag]||(this.tokens.links[oe.tag]={href:oe.href,title:oe.title});continue}if(oe=this.tokenizer.table(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.lheading(Y)){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(z&&(oe=this.tokenizer.paragraph(Y))){Y=Y.substring(oe.raw.length),Z.push(oe);continue}if(oe=this.tokenizer.text(Y,Z)){Y=Y.substring(oe.raw.length),oe.type?Z.push(oe):(me=Z[Z.length-1],me.raw+=`
|
|
|
`+oe.raw,me.text+=`
|
|
|
`+oe.text);continue}if(Y){var De="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(De);break}else throw new Error(De)}}return Z},ce.inline=function(Y){var Z,z,oe,Ce,X,me,De=Y.length;for(Z=0;Z<De;Z++){me=Y[Z];switch(me.type){case"paragraph":case"text":case"heading":{me.tokens=[],this.inlineTokens(me.text,me.tokens);break}case"table":{for(me.tokens={header:[],cells:[]},Ce=me.header.length,z=0;z<Ce;z++)me.tokens.header[z]=[],this.inlineTokens(me.header[z],me.tokens.header[z]);for(Ce=me.cells.length,z=0;z<Ce;z++)for(X=me.cells[z],me.tokens.cells[z]=[],oe=0;oe<X.length;oe++)me.tokens.cells[z][oe]=[],this.inlineTokens(X[oe],me.tokens.cells[z][oe]);break}case"blockquote":{this.inline(me.tokens);break}case"list":{for(Ce=me.items.length,z=0;z<Ce;z++)this.inline(me.items[z].tokens);break}}}return Y},ce.inlineTokens=function(Y,Z,z,oe,Ce){Z===void 0&&(Z=[]),z===void 0&&(z=!1),oe===void 0&&(oe=!1),Ce===void 0&&(Ce="");var X,me=Y,De;if(this.tokens.links){var se=Object.keys(this.tokens.links);if(se.length>0)for(;(De=this.tokenizer.rules.inline.reflinkSearch.exec(me))!=null;)se.includes(De[0].slice(De[0].lastIndexOf("[")+1,-1))&&(me=me.slice(0,De.index)+"["+"a".repeat(De[0].length-2)+"]"+me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(De=this.tokenizer.rules.inline.blockSkip.exec(me))!=null;)me=me.slice(0,De.index)+"["+"a".repeat(De[0].length-2)+"]"+me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(X=this.tokenizer.escape(Y)){Y=Y.substring(X.raw.length),Z.push(X);continue}if(X=this.tokenizer.tag(Y,z,oe)){Y=Y.substring(X.raw.length),z=X.inLink,oe=X.inRawBlock,Z.push(X);continue}if(X=this.tokenizer.link(Y)){Y=Y.substring(X.raw.length),X.type==="link"&&(X.tokens=this.inlineTokens(X.text,[],!0,oe)),Z.push(X);continue}if(X=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(X.raw.length),X.type==="link"&&(X.tokens=this.inlineTokens(X.text,[],!0,oe)),Z.push(X);continue}if(X=this.tokenizer.strong(Y,me,Ce)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),Z.push(X);continue}if(X=this.tokenizer.em(Y,me,Ce)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),Z.push(X);continue}if(X=this.tokenizer.codespan(Y)){Y=Y.substring(X.raw.length),Z.push(X);continue}if(X=this.tokenizer.br(Y)){Y=Y.substring(X.raw.length),Z.push(X);continue}if(X=this.tokenizer.del(Y)){Y=Y.substring(X.raw.length),X.tokens=this.inlineTokens(X.text,[],z,oe),Z.push(X);continue}if(X=this.tokenizer.autolink(Y,Fe)){Y=Y.substring(X.raw.length),Z.push(X);continue}if(!z&&(X=this.tokenizer.url(Y,Fe))){Y=Y.substring(X.raw.length),Z.push(X);continue}if(X=this.tokenizer.inlineText(Y,oe,Ie)){Y=Y.substring(X.raw.length),Ce=X.raw.slice(-1),Z.push(X);continue}if(Y){var ve="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(ve);break}else throw new Error(ve)}}return Z},k(he,null,[{key:"rules",get:function(){return{block:ae,inline:_e}}}]),he}(),Ge=E.defaults,ze=W.cleanUrl,Re=W.escape,Se=function(){function he(le){this.options=le||Ge}var ce=he.prototype;return ce.code=function(Y,Z,z){var oe=(Z||"").match(/\S*/)[0];if(this.options.highlight){var Ce=this.options.highlight(Y,oe);Ce!=null&&Ce!==Y&&(z=!0,Y=Ce)}return oe?'<pre><code class="'+this.options.langPrefix+Re(oe,!0)+'">'+(z?Y:Re(Y,!0))+`</code></pre>
|
|
|
`:"<pre><code>"+(z?Y:Re(Y,!0))+`</code></pre>
|
|
|
`},ce.blockquote=function(Y){return`<blockquote>
|
|
|
`+Y+`</blockquote>
|
|
|
`},ce.html=function(Y){return Y},ce.heading=function(Y,Z,z,oe){return this.options.headerIds?"<h"+Z+' id="'+this.options.headerPrefix+oe.slug(z)+'">'+Y+"</h"+Z+`>
|
|
|
`:"<h"+Z+">"+Y+"</h"+Z+`>
|
|
|
`},ce.hr=function(){return this.options.xhtml?`<hr/>
|
|
|
`:`<hr>
|
|
|
`},ce.list=function(Y,Z,z){var oe=Z?"ol":"ul",Ce=Z&&z!==1?' start="'+z+'"':"";return"<"+oe+Ce+`>
|
|
|
`+Y+"</"+oe+`>
|
|
|
`},ce.listitem=function(Y){return"<li>"+Y+`</li>
|
|
|
`},ce.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ce.paragraph=function(Y){return"<p>"+Y+`</p>
|
|
|
`},ce.table=function(Y,Z){return Z&&(Z="<tbody>"+Z+"</tbody>"),`<table>
|
|
|
<thead>
|
|
|
`+Y+`</thead>
|
|
|
`+Z+`</table>
|
|
|
`},ce.tablerow=function(Y){return`<tr>
|
|
|
`+Y+`</tr>
|
|
|
`},ce.tablecell=function(Y,Z){var z=Z.header?"th":"td",oe=Z.align?"<"+z+' align="'+Z.align+'">':"<"+z+">";return oe+Y+"</"+z+`>
|
|
|
`},ce.strong=function(Y){return"<strong>"+Y+"</strong>"},ce.em=function(Y){return"<em>"+Y+"</em>"},ce.codespan=function(Y){return"<code>"+Y+"</code>"},ce.br=function(){return this.options.xhtml?"<br/>":"<br>"},ce.del=function(Y){return"<del>"+Y+"</del>"},ce.link=function(Y,Z,z){if(Y=ze(this.options.sanitize,this.options.baseUrl,Y),Y===null)return z;var oe='<a href="'+Re(Y)+'"';return Z&&(oe+=' title="'+Z+'"'),oe+=">"+z+"</a>",oe},ce.image=function(Y,Z,z){if(Y=ze(this.options.sanitize,this.options.baseUrl,Y),Y===null)return z;var oe='<img src="'+Y+'" alt="'+z+'"';return Z&&(oe+=' title="'+Z+'"'),oe+=this.options.xhtml?"/>":">",oe},ce.text=function(Y){return Y},he}(),Te=function(){function he(){}var ce=he.prototype;return ce.strong=function(Y){return Y},ce.em=function(Y){return Y},ce.codespan=function(Y){return Y},ce.del=function(Y){return Y},ce.html=function(Y){return Y},ce.text=function(Y){return Y},ce.link=function(Y,Z,z){return""+z},ce.image=function(Y,Z,z){return""+z},ce.br=function(){return""},he}(),Ee=function(){function he(){this.seen={}}var ce=he.prototype;return ce.slug=function(Y){var Z=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Z)){var z=Z;do this.seen[z]++,Z=z+"-"+this.seen[z];while(this.seen.hasOwnProperty(Z))}return this.seen[Z]=0,Z},he}(),$=E.defaults,fe=W.unescape,J=function(){function he(le){this.options=le||$,this.options.renderer=this.options.renderer||new Se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Te,this.slugger=new Ee}he.parse=function(Y,Z){var z=new he(Z);return z.parse(Y)};var ce=he.prototype;return ce.parse=function(Y,Z){Z===void 0&&(Z=!0);var z="",oe,Ce,X,me,De,se,ve,Ke,rt,qe,Je,lt,vt,ct,it,yt,Tt,Ct,Ht=Y.length;for(oe=0;oe<Ht;oe++){qe=Y[oe];switch(qe.type){case"space":continue;case"hr":{z+=this.renderer.hr();continue}case"heading":{z+=this.renderer.heading(this.parseInline(qe.tokens),qe.depth,fe(this.parseInline(qe.tokens,this.textRenderer)),this.slugger);continue}case"code":{z+=this.renderer.code(qe.text,qe.lang,qe.escaped);continue}case"table":{for(Ke="",ve="",me=qe.header.length,Ce=0;Ce<me;Ce++)ve+=this.renderer.tablecell(this.parseInline(qe.tokens.header[Ce]),{header:!0,align:qe.align[Ce]});for(Ke+=this.renderer.tablerow(ve),rt="",me=qe.cells.length,Ce=0;Ce<me;Ce++){for(se=qe.tokens.cells[Ce],ve="",De=se.length,X=0;X<De;X++)ve+=this.renderer.tablecell(this.parseInline(se[X]),{header:!1,align:qe.align[X]});rt+=this.renderer.tablerow(ve)}z+=this.renderer.table(Ke,rt);continue}case"blockquote":{rt=this.parse(qe.tokens),z+=this.renderer.blockquote(rt);continue}case"list":{for(Je=qe.ordered,lt=qe.start,vt=qe.loose,me=qe.items.length,rt="",Ce=0;Ce<me;Ce++)it=qe.items[Ce],yt=it.checked,Tt=it.task,ct="",it.task&&(Ct=this.renderer.checkbox(yt),vt?it.tokens.length>0&&it.tokens[0].type==="text"?(it.tokens[0].text=Ct+" "+it.tokens[0].text,it.tokens[0].tokens&&it.tokens[0].tokens.length>0&&it.tokens[0].tokens[0].type==="text"&&(it.tokens[0].tokens[0].text=Ct+" "+it.tokens[0].tokens[0].text)):it.tokens.unshift({type:"text",text:Ct}):ct+=Ct),ct+=this.parse(it.tokens,vt),rt+=this.renderer.listitem(ct,Tt,yt);z+=this.renderer.list(rt,Je,lt);continue}case"html":{z+=this.renderer.html(qe.text);continue}case"paragraph":{z+=this.renderer.paragraph(this.parseInline(qe.tokens));continue}case"text":{for(rt=qe.tokens?this.parseInline(qe.tokens):qe.text;oe+1<Ht&&Y[oe+1].type==="text";)qe=Y[++oe],rt+=`
|
|
|
`+(qe.tokens?this.parseInline(qe.tokens):qe.text);z+=Z?this.renderer.paragraph(rt):rt;continue}default:{var Ut='Token with "'+qe.type+'" type was not found.';if(this.options.silent){console.error(Ut);return}else throw new Error(Ut)}}}return z},ce.parseInline=function(Y,Z){Z=Z||this.renderer;var z="",oe,Ce,X=Y.length;for(oe=0;oe<X;oe++){Ce=Y[oe];switch(Ce.type){case"escape":{z+=Z.text(Ce.text);break}case"html":{z+=Z.html(Ce.text);break}case"link":{z+=Z.link(Ce.href,Ce.title,this.parseInline(Ce.tokens,Z));break}case"image":{z+=Z.image(Ce.href,Ce.title,Ce.text);break}case"strong":{z+=Z.strong(this.parseInline(Ce.tokens,Z));break}case"em":{z+=Z.em(this.parseInline(Ce.tokens,Z));break}case"codespan":{z+=Z.codespan(Ce.text);break}case"br":{z+=Z.br();break}case"del":{z+=Z.del(this.parseInline(Ce.tokens,Z));break}case"text":{z+=Z.text(Ce.text);break}default:{var me='Token with "'+Ce.type+'" type was not found.';if(this.options.silent){console.error(me);return}else throw new Error(me)}}}return z},he}(),Ae=W.merge,We=W.checkSanitizeDeprecation,Ye=W.escape,Ne=E.getDefaults,et=E.changeDefaults,ne=E.defaults;function xe(he,ce,le){if(typeof he=="undefined"||he===null)throw new Error("marked(): input parameter is undefined or null");if(typeof he!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(he)+", string expected");if(typeof ce=="function"&&(le=ce,ce=null),ce=Ae({},xe.defaults,ce||{}),We(ce),le){var Y=ce.highlight,Z;try{Z=Xe.lex(he,ce)}catch(X){return le(X)}var z=function(me){var De;if(!me)try{De=J.parse(Z,ce)}catch(se){me=se}return ce.highlight=Y,me?le(me):le(null,De)};if(!Y||Y.length<3)return z();if(delete ce.highlight,!Z.length)return z();var oe=0;xe.walkTokens(Z,function(X){X.type==="code"&&(oe++,setTimeout(function(){Y(X.text,X.lang,function(me,De){if(me)return z(me);De!=null&&De!==X.text&&(X.text=De,X.escaped=!0),oe--,oe===0&&z()})},0))}),oe===0&&z();return}try{var Ce=Xe.lex(he,ce);return ce.walkTokens&&xe.walkTokens(Ce,ce.walkTokens),J.parse(Ce,ce)}catch(X){if(X.message+=`
|
|
|
Please report this to https://github.com/markedjs/marked.`,ce.silent)return"<p>An error occurred:</p><pre>"+Ye(X.message+"",!0)+"</pre>";throw X}}xe.options=xe.setOptions=function(he){return Ae(xe.defaults,he),et(xe.defaults),xe},xe.getDefaults=Ne,xe.defaults=ne,xe.use=function(he){var ce=Ae({},he);if(he.renderer&&function(){var Y=xe.defaults.renderer||new Se,Z=function(Ce){var X=Y[Ce];Y[Ce]=function(){for(var me=arguments.length,De=new Array(me),se=0;se<me;se++)De[se]=arguments[se];var ve=he.renderer[Ce].apply(Y,De);return ve===!1&&(ve=X.apply(Y,De)),ve}};for(var z in he.renderer)Z(z);ce.renderer=Y}(),he.tokenizer&&function(){var Y=xe.defaults.tokenizer||new Ue,Z=function(Ce){var X=Y[Ce];Y[Ce]=function(){for(var me=arguments.length,De=new Array(me),se=0;se<me;se++)De[se]=arguments[se];var ve=he.tokenizer[Ce].apply(Y,De);return ve===!1&&(ve=X.apply(Y,De)),ve}};for(var z in he.tokenizer)Z(z);ce.tokenizer=Y}(),he.walkTokens){var le=xe.defaults.walkTokens;ce.walkTokens=function(Y){he.walkTokens(Y),le&&le(Y)}}xe.setOptions(ce)},xe.walkTokens=function(he,ce){for(var le=O(he),Y;!(Y=le()).done;){var Z=Y.value;ce(Z);switch(Z.type){case"table":{for(var z=O(Z.tokens.header),oe;!(oe=z()).done;){var Ce=oe.value;xe.walkTokens(Ce,ce)}for(var X=O(Z.tokens.cells),me;!(me=X()).done;)for(var De=me.value,se=O(De),ve;!(ve=se()).done;){var Ke=ve.value;xe.walkTokens(Ke,ce)}break}case"list":{xe.walkTokens(Z.items,ce);break}default:Z.tokens&&xe.walkTokens(Z.tokens,ce)}}},xe.Parser=J,xe.parser=J.parse,xe.Renderer=Se,xe.TextRenderer=Te,xe.Lexer=Xe,xe.lexer=Xe.lex,xe.Tokenizer=Ue,xe.Slugger=Ee,xe.parse=xe;var Oe=xe;return Oe})},Dqnf:function($e,ue,ie){"use strict";var j=ie("k1fw"),k=ie("tJVT"),D=ie("rAM+"),R=ie("q1tI"),O=ie.n(R),c=ie("J66h"),E=ie.n(c),y=ie("/POA"),p=ie.n(y),u=ie("q7KB"),o=ie.n(u),d=ie("ER/M"),s=ie.n(d),l=ie("dhSg"),r=ie("bdgK");function n(f,h,w){var m=w._core._renderService.dimensions.actualCellWidth||9.5,T=w._core._renderService.dimensions.actualCellHeight||18,A=Math.floor(h/T),x=Math.floor(f/m);return[x,A]}function a(f,h){var w=new r.default(function(m){var T=Object(D.a)(m),A;try{for(T.s();!(A=T.n()).done;){var x=A.value;if(x.target.offsetHeight>0||x.target.offsetWidth>0){var b=n(x.target.offsetWidth,x.target.offsetHeight,f),S=Object(k.a)(b,2),C=S[0],g=S[1];console.log("cols, rows",C,g),l.a.publish("ssh-xterm-resize",{columns:C,rows:g,width:x.target.offsetWidth,height:x.target.offsetHeight}),f.resize(C,g);var M=c.Base64.decode("IA=="),I=c.Base64.decode("CBtbSw==");f.write(M),f.write(I)}}}catch(P){T.e(P)}finally{T.f()}});return w.observe(h),w}var i=3e4;ue.a=function(f){var h=f.sshConfigData,w=f.sid,m=Object(R.useState)(null),T=Object(k.a)(m,2),A=T[0],x=T[1],b=h.ws_url,S=h.password,C=h.port,g=Object(R.useRef)(),M=Object(R.useRef)(),I=Object(R.useRef)(!1);return Object(R.useEffect)(function(){if(g.current&&b){var P=new y.Terminal({fontSize:16,rendererType:"dom"});P.open(g.current),P.onData(function(H){M.current&&(M.current.readyState===1&&(M.current.send(JSON.stringify({tp:"client",data:H})),l.a.publish("on-operating-ssh")))}),P.write("Connecting..."),x(P);var B=a(P,g.current);return function(){P.dispose(),B.unobserve(g.current)}}},[b,g.current]),Object(R.useEffect)(function(){if(A&&b){function P(){var K=new WebSocket(b);M.current=K,K.onopen=function(){var G=A.element.parentElement;if(G){var ee=G.offsetWidth,de=G.offsetHeight;console.log("init",{tp:"init",data:Object(j.a)(Object(j.a)({},h),{},{secret:S,width:ee,height:de,rows:A.rows,columns:A.cols})}),K.send(JSON.stringify({tp:"init",data:Object(j.a)(Object(j.a)({},h),{},{secret:S,width:ee,height:de,rows:A.rows,columns:A.cols})}))}A.focus()},K.onerror=function(G){console.log("------in socket error----",G,K,b)},K.onmessage=function(G){I.current||(A.write("\r"),setTimeout(function(){},1e3)),I.current=!0,console.log("event:",G);var ee=c.Base64.decode(G.data.toString()),de=A._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",ee,de,A),A.write(ee)},K.onclose=function(G){B&&clearInterval(B),A.write(`\r
|
|
|
connection closed`)}}var B=setInterval(function(){M.current&&M.current.send(JSON.stringify({tp:"h"}))},i),H=l.a.subscribe("create-socket",function(K){w==K&&(M.current&&M.current.readyState===1?A.focus():P(),A.focus())}),F=l.a.subscribe("close-socket",function(K){w===K&&(M.current&&(M.current.close(),I.current=!1,A.clear()),M.current=null)}),W=l.a.subscribe("ssh-xterm-resize",function(K){M.current&&M.current.readyState===1&&M.current.send(JSON.stringify({tp:"resize",data:Object(j.a)({},K)}))}),U=l.a.subscribe("ssh-add-connect-time",function(){M.current&&M.current.readyState===1&&M.current.send(JSON.stringify({tp:"overtime"}))});return function(){F(),H(),W(),U(),M.current&&(M.current.close(),I.current=!1)}}},[A,b,C]),O.a.createElement("div",{ref:g,className:s.a["xterm-panel"]},b?null:O.a.createElement("p",{style:{color:"#fff"}},"\u6B63\u5728\u8FDE\u63A5\u547D\u4EE4\u884C\u670D\u52A1..."))}},ELLl:function($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){var k={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},D=j.Pos;j.defineOption("autoCloseBrackets",!1,function(r,n,a){a&&a!=j.Init&&(r.removeKeyMap(O),r.state.closeBrackets=null),n&&(c(R(n,"pairs")),r.state.closeBrackets=n,r.addKeyMap(O))});function R(r,n){return n=="pairs"&&typeof r=="string"?r:typeof r=="object"&&r[n]!=null?r[n]:k[n]}var O={Backspace:p,Enter:u};function c(r){for(var n=0;n<r.length;n++){var a=r.charAt(n),i="'"+a+"'";O[i]||(O[i]=E(a))}}c(k.pairs+"`");function E(r){return function(n){return d(n,r)}}function y(r){var n=r.state.closeBrackets;if(!n||n.override)return n;var a=r.getModeAt(r.getCursor());return a.closeBrackets||n}function p(r){var n=y(r);if(!n||r.getOption("disableInput"))return j.Pass;for(var a=R(n,"pairs"),i=r.listSelections(),f=0;f<i.length;f++){if(!i[f].empty())return j.Pass;var h=s(r,i[f].head);if(!h||a.indexOf(h)%2!=0)return j.Pass}for(var f=i.length-1;f>=0;f--){var w=i[f].head;r.replaceRange("",D(w.line,w.ch-1),D(w.line,w.ch+1),"+delete")}}function u(r){var n=y(r),a=n&&R(n,"explode");if(!a||r.getOption("disableInput"))return j.Pass;for(var i=r.listSelections(),f=0;f<i.length;f++){if(!i[f].empty())return j.Pass;var h=s(r,i[f].head);if(!h||a.indexOf(h)%2!=0)return j.Pass}r.operation(function(){var w=r.lineSeparator()||`
|
|
|
`;r.replaceSelection(w+w,null),r.execCommand("goCharLeft"),i=r.listSelections();for(var m=0;m<i.length;m++){var T=i[m].head.line;r.indentLine(T,null,!0),r.indentLine(T+1,null,!0)}})}function o(r){var n=j.cmpPos(r.anchor,r.head)>0;return{anchor:new D(r.anchor.line,r.anchor.ch+(n?-1:1)),head:new D(r.head.line,r.head.ch+(n?1:-1))}}function d(r,n){var a=y(r);if(!a||r.getOption("disableInput"))return j.Pass;var i=R(a,"pairs"),f=i.indexOf(n);if(f==-1)return j.Pass;for(var h=R(a,"closeBefore"),w=R(a,"triples"),m=i.charAt(f+1)==n,T=r.listSelections(),A=f%2==0,x,b=0;b<T.length;b++){var S=T[b],C=S.head,g,M=r.getRange(C,D(C.line,C.ch+1));if(A&&!S.empty())g="surround";else if((m||!A)&&M==n)m&&l(r,C)?g="both":w.indexOf(n)>=0&&r.getRange(C,D(C.line,C.ch+3))==n+n+n?g="skipThree":g="skip";else if(m&&C.ch>1&&w.indexOf(n)>=0&&r.getRange(D(C.line,C.ch-2),C)==n+n){if(C.ch>2&&/\bstring/.test(r.getTokenTypeAt(D(C.line,C.ch-2))))return j.Pass;g="addFour"}else if(m){var I=C.ch==0?" ":r.getRange(D(C.line,C.ch-1),C);if(!j.isWordChar(M)&&I!=n&&!j.isWordChar(I))g="both";else return j.Pass}else if(A&&(M.length===0||/\s/.test(M)||h.indexOf(M)>-1))g="both";else return j.Pass;if(!x)x=g;else if(x!=g)return j.Pass}var P=f%2?i.charAt(f-1):n,B=f%2?n:i.charAt(f+1);r.operation(function(){if(x=="skip")r.execCommand("goCharRight");else if(x=="skipThree")for(var H=0;H<3;H++)r.execCommand("goCharRight");else if(x=="surround"){for(var F=r.getSelections(),H=0;H<F.length;H++)F[H]=P+F[H]+B;r.replaceSelections(F,"around"),F=r.listSelections().slice();for(var H=0;H<F.length;H++)F[H]=o(F[H]);r.setSelections(F)}else x=="both"?(r.replaceSelection(P+B,null),r.triggerElectric(P+B),r.execCommand("goCharLeft")):x=="addFour"&&(r.replaceSelection(P+P+P+P,"before"),r.execCommand("goCharRight"))})}function s(r,n){var a=r.getRange(D(n.line,n.ch-1),D(n.line,n.ch+1));return a.length==2?a:null}function l(r,n){var a=r.getTokenAt(D(n.line,n.ch+1));return/\bstring/.test(a.type)&&a.start==n.ch&&(n.ch==0||!/\bstring/.test(r.getTokenTypeAt(n)))}})},"ER/M":function($e,ue,ie){$e.exports={"xterm-panel":"xterm-panel___2r2xx"}},Fv0C:function($e,ue,ie){"use strict";function j(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(n){return typeof n}:j=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},j(l)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=p(ie("Lo0S")),D=ie("vewr"),R=p(ie("8CQX")),O=E(ie("mHUz")),c=p(ie("GdRQ"));function E(l){return l&&l.__esModule?l:{default:l}}function y(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return y=function(){return l},l}function p(l){if(l&&l.__esModule)return l;if(l===null||j(l)!=="object"&&typeof l!="function")return{default:l};var r=y();if(r&&r.has(l))return r.get(l);var n={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in l)if(Object.prototype.hasOwnProperty.call(l,i)){var f=a?Object.getOwnPropertyDescriptor(l,i):null;f&&(f.get||f.set)?Object.defineProperty(n,i,f):n[i]=l[i]}return n.default=l,r&&r.set(l,n),n}function u(l,r){if(!(l instanceof r))throw new TypeError("Cannot call a class as a function")}function o(l,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,a.key,a)}}function d(l,r,n){return r&&o(l.prototype,r),n&&o(l,n),l}var s=function(){function l(r){u(this,l),this._target=r||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 d(l,[{key:"_sendKeyEvent",value:function(n,a,i){if(i)this._keyDownList[a]=n;else{if(!(a in this._keyDownList))return;delete this._keyDownList[a]}k.Debug("onkeyevent "+(i?"down":"up")+", keysym: "+n,", code: "+a),this.onkeyevent(n,a,i)}},{key:"_getKeyCode",value:function(n){var a=R.getKeycode(n);if(a!=="Unidentified")return a;if(n.keyCode&&n.type!=="keypress"&&n.keyCode!==229)return"Platform"+n.keyCode;if(n.keyIdentifier){if(n.keyIdentifier.substr(0,2)!=="U+")return n.keyIdentifier;var i=parseInt(n.keyIdentifier.substr(2),16),f=String.fromCharCode(i).toUpperCase();return"Platform"+f.charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(n){var a=this._getKeyCode(n),i=R.getKeysym(n);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),a==="AltRight"&&n.timeStamp-this._altGrCtrlTime<50?i=O.default.XK_ISO_Level3_Shift:this._sendKeyEvent(O.default.XK_Control_L,"ControlLeft",!0)),a==="Unidentified"){i&&(this._sendKeyEvent(i,a,!0),this._sendKeyEvent(i,a,!1)),(0,D.stopEvent)(n);return}if(c.isMac()||c.isIOS())switch(i){case O.default.XK_Super_L:i=O.default.XK_Alt_L;break;case O.default.XK_Super_R:i=O.default.XK_Super_L;break;case O.default.XK_Alt_L:i=O.default.XK_Mode_switch;break;case O.default.XK_Alt_R:i=O.default.XK_ISO_Level3_Shift;break}if(a in this._keyDownList&&(i=this._keyDownList[a]),(c.isMac()||c.isIOS())&&a==="CapsLock"){this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!1),(0,D.stopEvent)(n);return}if(!i&&(!n.key||c.isIE()||c.isEdge())){this._pendingKey=a,setTimeout(this._handleKeyPressTimeout.bind(this),10,n);return}if(this._pendingKey=null,(0,D.stopEvent)(n),a==="ControlLeft"&&c.isWindows()&&!("ControlLeft"in this._keyDownList)){this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),this._altGrCtrlTime=n.timeStamp;return}this._sendKeyEvent(i,a,!0)}},{key:"_handleKeyPress",value:function(n){if((0,D.stopEvent)(n),this._pendingKey===null)return;var a=this._getKeyCode(n),i=R.getKeysym(n);if(a!=="Unidentified"&&a!=this._pendingKey)return;if(a=this._pendingKey,this._pendingKey=null,!i){k.Info("keypress with no keysym:",n);return}this._sendKeyEvent(i,a,!0)}},{key:"_handleKeyPressTimeout",value:function(n){if(this._pendingKey===null)return;var a,i=this._pendingKey;if(this._pendingKey=null,n.keyCode>=48&&n.keyCode<=57)a=n.keyCode;else if(n.keyCode>=65&&n.keyCode<=90){var f=String.fromCharCode(n.keyCode);n.shiftKey?f=f.toUpperCase():f=f.toLowerCase(),a=f.charCodeAt()}else a=0;this._sendKeyEvent(a,i,!0)}},{key:"_handleKeyUp",value:function(n){(0,D.stopEvent)(n);var a=this._getKeyCode(n);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(O.default.XK_Control_L,"ControlLeft",!0)),(c.isMac()||c.isIOS())&&a==="CapsLock"){this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(O.default.XK_Caps_Lock,"CapsLock",!1);return}this._sendKeyEvent(this._keyDownList[a],a,!1),c.isWindows()&&(a==="ShiftLeft"||a==="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(O.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){k.Debug(">> Keyboard.allKeysUp");for(var n in this._keyDownList)this._sendKeyEvent(this._keyDownList[n],n,!1);k.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(n){if(n.skipCheckAlt)return;if(n.altKey)return;var a=this._target,i=this._keyDownList;["AltLeft","AltRight"].forEach(function(f){if(!(f in i))return;var h=new KeyboardEvent("keyup",{key:i[f],code:f});h.skipCheckAlt=!0,a.dispatchEvent(h)})}},{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),c.isWindows()&&c.isFirefox()){var n=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(a){return document.addEventListener(a,n,{capture:!0,passive:!0})})}}},{key:"ungrab",value:function(){if(c.isWindows()&&c.isFirefox()){var n=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach(function(a){return document.removeEventListener(a,n)})}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()}}]),l}();ue.default=s},GQ8N:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.toUnsigned32bit=j,ue.toSigned32bit=k;function j(D){return D>>>0}function k(D){return D|0}},GdRQ:function($e,ue,ie){"use strict";function j(A){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(b){return typeof b}:j=function(b){return b&&typeof Symbol=="function"&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b},j(A)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.isMac=a,ue.isWindows=i,ue.isIOS=f,ue.isSafari=h,ue.isIE=w,ue.isEdge=m,ue.isFirefox=T,ue.hasScrollbarGutter=ue.supportsImageMetadata=ue.supportsCursorURIs=ue.dragThreshold=ue.isTouchDevice=void 0;var k=R(ie("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var A=new WeakMap;return D=function(){return A},A}function R(A){if(A&&A.__esModule)return A;if(A===null||j(A)!=="object"&&typeof A!="function")return{default:A};var x=D();if(x&&x.has(A))return x.get(A);var b={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in A)if(Object.prototype.hasOwnProperty.call(A,C)){var g=S?Object.getOwnPropertyDescriptor(A,C):null;g&&(g.get||g.set)?Object.defineProperty(b,C,g):b[C]=A[C]}return b.default=A,x&&x.set(A,b),b}var O="ontouchstart"in document.documentElement||document.ontouchstart!==void 0||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;ue.isTouchDevice=O,window.addEventListener("touchstart",function A(){ue.isTouchDevice=O=!0,window.removeEventListener("touchstart",A,!1)},!1);var c=10*(window.devicePixelRatio||1);ue.dragThreshold=c;var E=!1;try{var y=document.createElement("canvas");y.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',y.style.cursor.indexOf("url")===0?(k.Info("Data URI scheme cursor supported"),E=!0):k.Warn("Data URI scheme cursor not supported")}catch(A){k.Error("Data URI scheme cursor test exception: "+A)}var p=E;ue.supportsCursorURIs=p;var u=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),u=!0}catch(A){}var o=u;ue.supportsImageMetadata=o;var d=!0;try{var s=document.createElement("div");s.style.visibility="hidden",s.style.overflow="scroll",document.body.appendChild(s);var l=document.createElement("div");s.appendChild(l);var r=s.offsetWidth-l.offsetWidth;s.parentNode.removeChild(s),d=r!=0}catch(A){k.Error("Scrollbar test exception: "+A)}var n=d;ue.hasScrollbarGutter=n;function a(){return navigator&&!!/mac/i.exec(navigator.platform)}function i(){return navigator&&!!/win/i.exec(navigator.platform)}function f(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))}function h(){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 T(){return navigator&&!!/firefox/i.exec(navigator.userAgent)}},Gytx:function($e,ue){$e.exports=function(j,k,D,R){var O=D?D.call(R,j,k):void 0;if(O!==void 0)return!!O;if(j===k)return!0;if(typeof j!="object"||!j||typeof k!="object"||!k)return!1;var c=Object.keys(j),E=Object.keys(k);if(c.length!==E.length)return!1;for(var y=Object.prototype.hasOwnProperty.bind(k),p=0;p<c.length;p++){var u=c[p];if(!y(u))return!1;var o=j[u],d=k[u];if(O=D?D.call(R,o,d,u):void 0,O===!1||O===void 0&&o!==d)return!1}return!0}},HmJG:function($e,ue,ie){},ItS6:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=ie("eP3c"),k=D(ie("1q3G"));function D(y){return y&&y.__esModule?y:{default:y}}function R(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function O(y,p){for(var u=0;u<p.length;u++){var o=p[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}function c(y,p,u){return p&&O(y.prototype,p),u&&O(y,u),y}var E=function(){function y(){R(this,y),this.strm=new k.default,this.chunkSize=1024*10*10,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,j.inflateInit)(this.strm,this.windowBits)}return c(y,[{key:"setInput",value:function(u){u?(this.strm.input=u,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(u){u>this.chunkSize&&(this.chunkSize=u,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=u;var o=(0,j.inflate)(this.strm,0);if(o<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=u)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,j.inflateReset)(this.strm)}}]),y}();ue.default=E},IxHN:function($e,ue,ie){"use strict";var j=ie("q1tI"),k=ie.n(j),D=ie("07cG"),R=ie.n(D);ue.a=function(O){var c=O.message,E=O.className,y=O.children,p=O.style,u=p===void 0?{}:p;return k.a.createElement("div",{className:"".concat(R.a.idsRingWrapper," ").concat(E)},k.a.createElement("div",{className:R.a.ldsRing},k.a.createElement("div",null),k.a.createElement("div",null),k.a.createElement("div",null),k.a.createElement("div",null)),c?k.a.createElement("p",{style:u},c):null,y)}},J66h:function($e,ue,ie){(function(j){var k,D;(function(R,O){$e.exports=O(R)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof j!="undefined"?j:this,function(R){"use strict";R=R||{};var O=R.Base64,c="2.6.4",E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=function(P){for(var B={},H=0,F=P.length;H<F;H++)B[P.charAt(H)]=H;return B}(E),p=String.fromCharCode,u=function(P){if(P.length<2){var B=P.charCodeAt(0);return B<128?P:B<2048?p(192|B>>>6)+p(128|B&63):p(224|B>>>12&15)+p(128|B>>>6&63)+p(128|B&63)}else{var B=65536+(P.charCodeAt(0)-55296)*1024+(P.charCodeAt(1)-56320);return p(240|B>>>18&7)+p(128|B>>>12&63)+p(128|B>>>6&63)+p(128|B&63)}},o=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,d=function(P){return P.replace(o,u)},s=function(P){var B=[0,2,1][P.length%3],H=P.charCodeAt(0)<<16|(P.length>1?P.charCodeAt(1):0)<<8|(P.length>2?P.charCodeAt(2):0),F=[E.charAt(H>>>18),E.charAt(H>>>12&63),B>=2?"=":E.charAt(H>>>6&63),B>=1?"=":E.charAt(H&63)];return F.join("")},l=R.btoa&&typeof R.btoa=="function"?function(P){return R.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,s)},r=function(P){return l(d(String(P)))},n=function(P){return P.replace(/[+\/]/g,function(B){return B=="+"?"-":"_"}).replace(/=/g,"")},a=function(P,B){return B?n(r(P)):r(P)},i=function(P){return a(P,!0)},f;R.Uint8Array&&(f=function(P,B){for(var H="",F=0,W=P.length;F<W;F+=3){var U=P[F],K=P[F+1],G=P[F+2],ee=U<<16|K<<8|G;H+=E.charAt(ee>>>18)+E.charAt(ee>>>12&63)+(typeof K!="undefined"?E.charAt(ee>>>6&63):"=")+(typeof G!="undefined"?E.charAt(ee&63):"=")}return B?n(H):H});var h=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=function(P){switch(P.length){case 4:var B=(7&P.charCodeAt(0))<<18|(63&P.charCodeAt(1))<<12|(63&P.charCodeAt(2))<<6|63&P.charCodeAt(3),H=B-65536;return p((H>>>10)+55296)+p((H&1023)+56320);case 3:return p((15&P.charCodeAt(0))<<12|(63&P.charCodeAt(1))<<6|63&P.charCodeAt(2));default:return p((31&P.charCodeAt(0))<<6|63&P.charCodeAt(1))}},m=function(P){return P.replace(h,w)},T=function(P){var B=P.length,H=B%4,F=(B>0?y[P.charAt(0)]<<18:0)|(B>1?y[P.charAt(1)]<<12:0)|(B>2?y[P.charAt(2)]<<6:0)|(B>3?y[P.charAt(3)]:0),W=[p(F>>>16),p(F>>>8&255),p(F&255)];return W.length-=[0,0,2,1][H],W.join("")},A=R.atob&&typeof R.atob=="function"?function(P){return R.atob(P)}:function(P){return P.replace(/\S{1,4}/g,T)},x=function(P){return A(String(P).replace(/[^A-Za-z0-9\+\/]/g,""))},b=function(P){return m(A(P))},S=function(P){return String(P).replace(/[-_]/g,function(B){return B=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},C=function(P){return b(S(P))},g;R.Uint8Array&&(g=function(P){return Uint8Array.from(x(S(P)),function(B){return B.charCodeAt(0)})});var M=function(){var P=R.Base64;return R.Base64=O,P};if(R.Base64={VERSION:c,atob:x,btoa:l,fromBase64:C,toBase64:a,utob:d,encode:a,encodeURI:i,btou:m,decode:C,noConflict:M,fromUint8Array:f,toUint8Array:g},typeof Object.defineProperty=="function"){var I=function(P){return{value:P,enumerable:!1,writable:!0,configurable:!0}};R.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",I(function(){return C(this)})),Object.defineProperty(String.prototype,"toBase64",I(function(P){return a(this,P)})),Object.defineProperty(String.prototype,"toBase64URI",I(function(){return a(this,!0)}))}}return R.Meteor&&(Base64=R.Base64),$e.exports?$e.exports.Base64=R.Base64:!(k=[],D=function(){return R.Base64}.apply(ue,k),D!==void 0&&($e.exports=D)),{Base64:R.Base64}})}).call(this,ie("IyRk"))},JSwD:function($e,ue,ie){"use strict";function j(n){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(i){return typeof i}:j=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},j(n)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=r;var k=R(ie("6BzB"));function D(){if(typeof WeakMap!="function")return null;var n=new WeakMap;return D=function(){return n},n}function R(n){if(n&&n.__esModule)return n;if(n===null||j(n)!=="object"&&typeof n!="function")return{default:n};var a=D();if(a&&a.has(n))return a.get(n);var i={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in n)if(Object.prototype.hasOwnProperty.call(n,h)){var w=f?Object.getOwnPropertyDescriptor(n,h):null;w&&(w.get||w.set)?Object.defineProperty(i,h,w):i[h]=n[h]}return i.default=n,a&&a.set(n,i),i}var O=15,c=852,E=592,y=0,p=1,u=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],d=[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],s=[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],l=[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 r(n,a,i,f,h,w,m,T){var A=T.bits,x=0,b=0,S=0,C=0,g=0,M=0,I=0,P=0,B=0,H=0,F,W,U,K,G,ee=null,de=0,ge,Be=new k.Buf16(O+1),Ue=new k.Buf16(O+1),Le=null,Me=0,Pe,be,ke;for(x=0;x<=O;x++)Be[x]=0;for(b=0;b<f;b++)Be[a[i+b]]++;for(g=A,C=O;C>=1&&!(Be[C]!==0);C--);if(g>C&&(g=C),C===0)return h[w++]=1<<24|64<<16|0,h[w++]=1<<24|64<<16|0,T.bits=1,0;for(S=1;S<C&&!(Be[S]!==0);S++);for(g<S&&(g=S),P=1,x=1;x<=O;x++)if(P<<=1,P-=Be[x],P<0)return-1;if(P>0&&(n===y||C!==1))return-1;for(Ue[1]=0,x=1;x<O;x++)Ue[x+1]=Ue[x]+Be[x];for(b=0;b<f;b++)a[i+b]!==0&&(m[Ue[a[i+b]]++]=b);if(n===y?(ee=Le=m,ge=19):n===p?(ee=o,de-=257,Le=d,Me-=257,ge=256):(ee=s,Le=l,ge=-1),H=0,b=0,x=S,G=w,M=g,I=0,U=-1,B=1<<g,K=B-1,n===p&&B>c||n===u&&B>E)return 1;for(;;){Pe=x-I,m[b]<ge?(be=0,ke=m[b]):m[b]>ge?(be=Le[Me+m[b]],ke=ee[de+m[b]]):(be=32+64,ke=0),F=1<<x-I,W=1<<M,S=W;do W-=F,h[G+(H>>I)+W]=Pe<<24|be<<16|ke|0;while(W!==0);for(F=1<<x-1;H&F;)F>>=1;if(F!==0?(H&=F-1,H+=F):H=0,b++,--Be[x]===0){if(x===C)break;x=a[i+m[b]]}if(x>g&&(H&K)!==U){for(I===0&&(I=g),G+=S,M=x-I,P=1<<M;M+I<C&&!(P-=Be[M+I],P<=0);)M++,P<<=1;if(B+=1<<M,n===p&&B>c||n===u&&B>E)return 1;U=H&K,h[U]=g<<24|M<<16|G-w|0}}return H!==0&&(h[G+H]=x-I<<24|64<<16|0),T.bits=g,0}},LCi9:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(h,w){if(!(h instanceof w))throw new TypeError("Cannot call a class as a function")}function k(h,w){for(var m=0;m<w.length;m++){var T=w[m];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(h,T.key,T)}}function D(h,w,m){return w&&k(h.prototype,w),m&&k(h,m),h}var R=0,O=1,c=2,E=4,y=8,p=16,u=32,o=64,d=127,s=50,l=90,r=250,n=1e3,a=1e3,i=50,f=function(){function h(){j(this,h),this._target=null,this._state=d,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}return D(h,[{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 T;m.stopPropagation(),m.preventDefault();switch(m.type){case"touchstart":T=this._touchStart;break;case"touchmove":T=this._touchMove;break;case"touchend":case"touchcancel":T=this._touchEnd;break}for(var A=0;A<m.changedTouches.length;A++){var x=m.changedTouches[A];T.call(this,x.identifier,x.clientX,x.clientY)}}},{key:"_touchStart",value:function(m,T,A){if(this._hasDetectedGesture()||this._state===R){this._ignored.push(m);return}if(this._tracked.length>0&&Date.now()-this._tracked[0].started>r){this._state=R,this._ignored.push(m);return}if(this._waitingRelease){this._state=R,this._ignored.push(m);return}this._tracked.push({id:m,started:Date.now(),active:!0,firstX:T,firstY:A,lastX:T,lastY:A,angle:0});switch(this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=~(O|y|p),this._stopLongpressTimeout();break;case 3:this._state&=~(c|u|o);break;default:this._state=R}}},{key:"_touchMove",value:function(m,T,A){var x=this._tracked.find(function(I){return I.id===m});if(x===void 0)return;x.lastX=T,x.lastY=A;var b=T-x.firstX,S=A-x.firstY;if((x.firstX!==x.lastX||x.firstY!==x.lastY)&&(x.angle=Math.atan2(S,b)*180/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(b,S)<s)return;if(this._state&=~(O|c|E|p),this._stopLongpressTimeout(),this._tracked.length!==1&&(this._state&=~y),this._tracked.length!==2&&(this._state&=~(u|o)),this._tracked.length===2){var C=this._tracked.find(function(I){return I.id!==m}),g=Math.hypot(C.firstX-C.lastX,C.firstY-C.lastY);if(g>s){var M=Math.abs(x.angle-C.angle);M=Math.abs((M+180)%360-180),M>l?this._state&=~u: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,T,A){if(this._ignored.indexOf(m)!==-1){this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&this._tracked.length===0&&(this._state=d,this._waitingRelease=!1);return}if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=R),!this._hasDetectedGesture()&&(this._state&=~(y|u|o),this._state&=~p,this._stopLongpressTimeout(),!this._waitingRelease)){this._releaseStart=Date.now(),this._waitingRelease=!0;switch(this._tracked.length){case 1:this._state&=~(c|E);break;case 2:this._state&=~(O|E);break}}if(this._waitingRelease){Date.now()-this._releaseStart>r&&(this._state=R),this._tracked.some(function(S){return Date.now()-S.started>n})&&(this._state=R);var x=this._tracked.find(function(S){return S.id===m});if(x.active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(this._state!==R)return}this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var b=0;b<this._tracked.length;b++)this._tracked[b].active&&this._ignored.push(this._tracked[b].id);this._tracked=[],this._state=R,this._ignored.indexOf(m)!==-1&&this._ignored.splice(this._ignored.indexOf(m),1),this._ignored.length===0&&(this._state=d,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return this._state===R||this._state&this._state-1?!1:!(this._state&(O|c|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()},a)}},{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=p,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var m=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout(function(){return m._twoTouchTimeout()},i)}},{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(),T=Math.abs(m.x),A=Math.abs(m.y),x=this._getAverageDistance(),b=Math.abs(Math.hypot(x.first.x,x.first.y)-Math.hypot(x.last.x,x.last.y));A<b&&T<b?this._state=o:this._state=u,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(m){var T={type:this._stateToGesture(this._state)},A=this._getPosition(),x=A.last;m==="gesturestart"&&(x=A.first);switch(this._state){case u:case o:x=A.first;break}if(T.clientX=x.x,T.clientY=x.y,this._state===o){var b=this._getAverageDistance();m==="gesturestart"?(T.magnitudeX=b.first.x,T.magnitudeY=b.first.y):(T.magnitudeX=b.last.x,T.magnitudeY=b.last.y)}else if(this._state===u)if(m==="gesturestart")T.magnitudeX=0,T.magnitudeY=0;else{var S=this._getAverageMovement();T.magnitudeX=S.x,T.magnitudeY=S.y}var C=new CustomEvent(m,{detail:T});this._target.dispatchEvent(C)}},{key:"_stateToGesture",value:function(m){switch(m){case O:return"onetap";case c:return"twotap";case E:return"threetap";case y:return"drag";case p:return"longpress";case u: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,T=0,A=0,x=0,b=0,S=0;S<this._tracked.length;S++)T+=this._tracked[S].firstX,A+=this._tracked[S].firstY,x+=this._tracked[S].lastX,b+=this._tracked[S].lastY;return{first:{x:T/m,y:A/m},last:{x:x/m,y:b/m}}}},{key:"_getAverageMovement",value:function(){if(this._tracked.length===0)throw new Error("Failed to get gesture movement, no tracked touches");var m,T;m=T=0;for(var A=this._tracked.length,x=0;x<this._tracked.length;x++)m+=this._tracked[x].lastX-this._tracked[x].firstX,T+=this._tracked[x].lastY-this._tracked[x].firstY;return{x:m/A,y:T/A}}},{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],T=this._tracked[this._tracked.length-1],A=Math.abs(T.firstX-m.firstX),x=Math.abs(T.firstY-m.firstY),b=Math.abs(T.lastX-m.lastX),S=Math.abs(T.lastY-m.lastY);return{first:{x:A,y:x},last:{x:b,y:S}}}}]),h}();ue.default=f},LdHM:function($e,ue,ie){"use strict";ie.d(ue,"b",function(){return h}),ie.d(ue,"a",function(){return m});var j=ie("1OyB"),k=ie("vuIU"),D=ie("Ji7U"),R=ie("LK+K"),O=ie("q1tI"),c=ie("rePB"),E=ie("Ff2n"),y=ie("ODXe"),p=ie("4IlW"),u=ie("bX4T"),o=ie("YrtM"),d=ie("TSYQ"),s=ie.n(d),l=ie("+nKL"),r=ie("8OUc"),n=function(G,ee){var de=G.prefixCls,ge=G.id,Be=G.flattenOptions,Ue=G.childrenAsData,Le=G.values,Me=G.searchValue,Pe=G.multiple,be=G.defaultActiveFirstOption,ke=G.height,te=G.itemHeight,pe=G.notFoundContent,ae=G.open,_e=G.menuItemSelectedIcon,Ie=G.virtual,Fe=G.onSelect,Xe=G.onToggleOpen,Ge=G.onActiveValue,ze=G.onScroll,Re=G.onMouseEnter,Se="".concat(de,"-item"),Te=Object(o.a)(function(){return Be},[ae,Be],function(Oe,he){return he[0]&&Oe[1]!==he[1]}),Ee=O.useRef(null),$=function(he){he.preventDefault()},fe=function(he){Ee.current&&Ee.current.scrollTo({index:he})},J=function(he){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,le=Te.length,Y=0;Y<le;Y+=1){var Z=(he+Y*ce+le)%le,z=Te[Z],oe=z.group,Ce=z.data;if(!oe&&!Ce.disabled)return Z}return-1},Ae=O.useState(function(){return J(0)}),We=Object(y.a)(Ae,2),Ye=We[0],Ne=We[1],et=function(he){Ne(he);var ce=Te[he];if(!ce){Ge(null,-1);return}Ge(ce.data.value,he)};O.useEffect(function(){et(be!==!1?J(0):-1)},[Te.length,Me]),O.useEffect(function(){var Oe=setTimeout(function(){if(!Pe&&ae&&Le.size===1){var he=Array.from(Le)[0],ce=Te.findIndex(function(le){var Y=le.data;return Y.value===he});et(ce),fe(ce)}});return function(){return clearTimeout(Oe)}},[ae]);var ne=function(he){he!==void 0&&Fe(he,{selected:!Le.has(he)}),Pe||Xe(!1)};if(O.useImperativeHandle(ee,function(){return{onKeyDown:function(he){var ce=he.which;switch(ce){case p.a.UP:case p.a.DOWN:{var le=0;if(ce===p.a.UP?le=-1:ce===p.a.DOWN&&(le=1),le!==0){var Y=J(Ye+le,le);fe(Y),et(Y)}break}case p.a.ENTER:{var Z=Te[Ye];Z&&!Z.data.disabled?ne(Z.data.value):ne(void 0),ae&&he.preventDefault();break}case p.a.ESC:Xe(!1)}},onKeyUp:function(){},scrollTo:function(he){fe(he)}}}),Te.length===0)return O.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),className:"".concat(Se,"-empty"),onMouseDown:$},pe);function xe(Oe){var he=Te[Oe];if(!he)return null;var ce=he.data||{},le=ce.value,Y=ce.label,Z=ce.children,z=Object(u.a)(ce,!0),oe=Ue?Z:Y;return he?O.createElement("div",Object.assign({"aria-label":typeof oe=="string"?oe:null},z,{key:Oe,role:"option",id:"".concat(ge,"_list_").concat(Oe),"aria-selected":Le.has(le)}),le):null}return O.createElement(O.Fragment,null,O.createElement("div",{role:"listbox",id:"".concat(ge,"_list"),style:{height:0,width:0,overflow:"hidden"}},xe(Ye-1),xe(Ye),xe(Ye+1)),O.createElement(l.a,{itemKey:"key",ref:Ee,data:Te,height:ke,itemHeight:te,fullHeight:!1,onMouseDown:$,onScroll:ze,virtual:Ie,onMouseEnter:Re},function(Oe,he){var ce,le=Oe.group,Y=Oe.groupOption,Z=Oe.data,z=Z.label,oe=Z.key;if(le)return O.createElement("div",{className:s()(Se,"".concat(Se,"-group"))},z!==void 0?z:oe);var Ce=Z.disabled,X=Z.value,me=Z.title,De=Z.children,se=Z.style,ve=Z.className,Ke=Object(E.a)(Z,["disabled","value","title","children","style","className"]),rt=Le.has(X),qe="".concat(Se,"-option"),Je=s()(Se,qe,ve,(ce={},Object(c.a)(ce,"".concat(qe,"-grouped"),Y),Object(c.a)(ce,"".concat(qe,"-active"),Ye===he&&!Ce),Object(c.a)(ce,"".concat(qe,"-disabled"),Ce),Object(c.a)(ce,"".concat(qe,"-selected"),rt),ce)),lt=Ue?De:z,vt=!_e||typeof _e=="function"||rt;return O.createElement("div",Object.assign({},Ke,{"aria-selected":rt,className:Je,title:me,onMouseMove:function(){if(Ye===he||Ce)return;et(he)},onClick:function(){Ce||ne(X)},style:se}),O.createElement("div",{className:"".concat(qe,"-content")},lt||X),O.isValidElement(_e)||rt,vt&&O.createElement(r.a,{className:"".concat(Se,"-option-state"),customizeIcon:_e,customizeIconProps:{isSelected:rt}},rt?"\u2713":null))}))},a=O.forwardRef(n);a.displayName="OptionList";var i=a,f=function(){return null};f.isSelectOption=!0;var h=f,w=function(){return null};w.isSelectOptGroup=!0;var m=w,T=ie("VTBJ"),A=ie("Zm9Q");function x(K){var G=K.key,ee=K.props,de=ee.children,ge=ee.value,Be=Object(E.a)(ee,["children","value"]);return Object(T.a)({key:G,value:ge!==void 0?ge:G,children:de},Be)}function b(K){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(K).map(function(ee,de){if(!O.isValidElement(ee)||!ee.type)return null;var ge=ee.type.isSelectOptGroup,Be=ee.key,Ue=ee.props,Le=Ue.children,Me=Object(E.a)(Ue,["children"]);return G||!ge?x(ee):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(Be===null?de:Be,"__"),label:Be},Me),{},{options:b(Le)})}).filter(function(ee){return ee})}var S=ie("2Qr1"),C=ie("qNPg"),g=ie("U8pU"),M=ie("Kwbf"),I=ie("WKfj");function P(K){var G=K.mode,ee=K.options,de=K.children,ge=K.backfill,Be=K.allowClear,Ue=K.placeholder,Le=K.getInputElement,Me=K.showSearch,Pe=K.onSearch,be=K.defaultOpen,ke=K.autoFocus,te=K.labelInValue,pe=K.value,ae=K.inputValue,_e=K.optionLabelProp,Ie=G==="multiple"||G==="tags",Fe=Me!==void 0?Me:Ie||G==="combobox",Xe=ee||b(de);if(Object(M.a)(G!=="tags"||Xe.every(function(Se){return!Se.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),G==="tags"||G==="combobox"){var Ge=Xe.some(function(Se){return Se.options?Se.options.some(function(Te){return typeof("value"in Te?Te.value:Te.key)=="number"}):typeof("value"in Se?Se.value:Se.key)=="number"});Object(M.a)(!Ge,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(M.a)(G!=="combobox"||!_e,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(M.a)(G==="combobox"||!ge,"`backfill` only works with `combobox` mode."),Object(M.a)(G==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(M.b)(G!=="combobox"||!Le||!Be||!Ue,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Pe&&!Fe&&G!=="combobox"&&G!=="tags"&&Object(M.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(M.b)(!be||ke,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),pe!=null){var ze=Object(I.d)(pe);Object(M.a)(!te||ze.every(function(Se){return Object(g.a)(Se)==="object"&&("key"in Se||"value"in Se)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(M.a)(!Ie||Array.isArray(pe),"`value` should be array when `mode` is `multiple` or `tags`")}if(de){var Re=null;Object(A.a)(de).some(function(Se){if(!O.isValidElement(Se)||!Se.type)return!1;var Te=Se.type;if(Te.isSelectOption)return!1;if(Te.isSelectOptGroup){var Ee=Object(A.a)(Se.props.children).every(function($){return!O.isValidElement($)||!Se.type||$.type.isSelectOption?!0:(Re=$.type,!1)});return!Ee}return Re=Te,!0}),Re&&Object(M.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Re.displayName||Re.name||Re,"`.")),Object(M.a)(ae===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var B=P,H=Object(C.a)({prefixCls:"rc-select",components:{optionList:i},convertChildrenToData:b,flattenOptions:S.d,getLabeledValue:S.e,filterOptions:S.b,isValueDisabled:S.g,findValueOption:S.c,warningProps:B,fillOptionsWithMissingValue:S.a}),F=function(K){Object(D.a)(ee,K);var G=Object(R.a)(ee);function ee(){var de;return Object(j.a)(this,ee),de=G.apply(this,arguments),de.selectRef=O.createRef(),de.focus=function(){de.selectRef.current.focus()},de.blur=function(){de.selectRef.current.blur()},de}return Object(k.a)(ee,[{key:"render",value:function(){return O.createElement(H,Object.assign({ref:this.selectRef},this.props))}}]),ee}(O.Component);F.Option=h,F.OptGroup=m;var W=F,U=ue.c=W},Lmeb:function($e,ue,ie){},Lo0S:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.initLogging=c,ue.getLogging=E,ue.Error=ue.Warn=ue.Info=ue.Debug=void 0;var j="warn",k=function(){};ue.Debug=k;var D=function(){};ue.Info=D;var R=function(){};ue.Warn=R;var O=function(){};ue.Error=O;function c(y){if(typeof y=="undefined"?y=j:j=y,ue.Debug=k=ue.Info=D=ue.Warn=R=ue.Error=O=function(){},typeof window.console!="undefined")switch(y){case"debug":ue.Debug=k=console.debug.bind(window.console);case"info":ue.Info=D=console.info.bind(window.console);case"warn":ue.Warn=R=console.warn.bind(window.console);case"error":ue.Error=O=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+y+"'")}}function E(){return j}c()},M8RZ:function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return p});var j=ie("fWQN"),k=ie("mtLc"),D=ie("yKVA"),R=ie("879j"),O=ie("q1tI"),c=ie.n(O),E=ie("i8i4"),y=ie.n(E),p=function(u){Object(D.a)(d,u);var o=Object(R.a)(d);function d(s){var l;Object(j.a)(this,d),l=o.call(this,s);var r=window.document;return l.node=r.createElement("div"),r.body.appendChild(l.node),l}return Object(k.a)(d,[{key:"render",value:function(){var l=this.props.children;return Object(E.createPortal)(l,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),d}(c.a.Component)},MZdM:function($e,ue,ie){"use strict";function j(s){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(r){return typeof r}:j=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},j(s)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=y(ie("Lo0S")),D=c(ie("N/zr")),R=ie("GdRQ"),O=ie("GQ8N");function c(s){return s&&s.__esModule?s:{default:s}}function E(){if(typeof WeakMap!="function")return null;var s=new WeakMap;return E=function(){return s},s}function y(s){if(s&&s.__esModule)return s;if(s===null||j(s)!=="object"&&typeof s!="function")return{default:s};var l=E();if(l&&l.has(s))return l.get(s);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in s)if(Object.prototype.hasOwnProperty.call(s,a)){var i=n?Object.getOwnPropertyDescriptor(s,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=s[a]}return r.default=s,l&&l.set(s,r),r}function p(s,l){if(!(s instanceof l))throw new TypeError("Cannot call a class as a function")}function u(s,l){for(var r=0;r<l.length;r++){var n=l[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function o(s,l,r){return l&&u(s.prototype,l),r&&u(s,r),s}var d=function(){function s(l){if(p(this,s),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,k.Debug(">> Display.constructor"),this._target=l,!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},k.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),k.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}return o(s,[{key:"viewportChangePos",value:function(r,n){var a=this._viewportLoc;r=Math.floor(r),n=Math.floor(n),this._clipViewport||(r=-a.w,n=-a.h);var i=a.x+a.w-1,f=a.y+a.h-1;if(r<0&&a.x+r<0&&(r=-a.x),i+r>=this._fbWidth&&(r-=i+r-this._fbWidth+1),a.y+n<0&&(n=-a.y),f+n>=this._fbHeight&&(n-=f+n-this._fbHeight+1),r===0&&n===0)return;k.Debug("viewportChange deltaX: "+r+", deltaY: "+n),a.x+=r,a.y+=n,this._damage(a.x,a.y,a.w,a.h),this.flip()}},{key:"viewportChangeSize",value:function(r,n){(!this._clipViewport||typeof r=="undefined"||typeof n=="undefined")&&(k.Debug("Setting viewport to full display region"),r=this._fbWidth,n=this._fbHeight),r=Math.floor(r),n=Math.floor(n),r>this._fbWidth&&(r=this._fbWidth),n>this._fbHeight&&(n=this._fbHeight);var a=this._viewportLoc;if(a.w!==r||a.h!==n){a.w=r,a.h=n;var i=this._target;i.width=r,i.height=n,this.viewportChangePos(0,0),this._damage(a.x,a.y,a.w,a.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(r){return this._scale===0?0:(0,O.toSigned32bit)(r/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(r){return this._scale===0?0:(0,O.toSigned32bit)(r/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(r,n){this._prevDrawStyle="",this._fbWidth=r,this._fbHeight=n;var a=this._backbuffer;if(a.width!==r||a.height!==n){var i=null;a.width>0&&a.height>0&&(i=this._drawCtx.getImageData(0,0,a.width,a.height)),a.width!==r&&(a.width=r),a.height!==n&&(a.height=n),i&&this._drawCtx.putImageData(i,0,0)}var f=this._viewportLoc;this.viewportChangeSize(f.w,f.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(r,n,a,i){r<this._damageBounds.left&&(this._damageBounds.left=r),n<this._damageBounds.top&&(this._damageBounds.top=n),r+a>this._damageBounds.right&&(this._damageBounds.right=r+a),n+i>this._damageBounds.bottom&&(this._damageBounds.bottom=n+i)}},{key:"flip",value:function(r){if(this._renderQ.length!==0&&!r)this._renderQPush({type:"flip"});else{var n=this._damageBounds.left,a=this._damageBounds.top,i=this._damageBounds.right-n,f=this._damageBounds.bottom-a,h=n-this._viewportLoc.x,w=a-this._viewportLoc.y;h<0&&(i+=h,n-=h,h=0),w<0&&(f+=w,a-=w,w=0),h+i>this._viewportLoc.w&&(i=this._viewportLoc.w-h),w+f>this._viewportLoc.h&&(f=this._viewportLoc.h-w),i>0&&f>0&&this._targetCtx.drawImage(this._backbuffer,n,a,i,f,h,w,i,f),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(r,n,a,i,f,h){this._renderQ.length!==0&&!h?this._renderQPush({type:"fill",x:r,y:n,width:a,height:i,color:f}):(this._setFillColor(f),this._drawCtx.fillRect(r,n,a,i),this._damage(r,n,a,i))}},{key:"copyImage",value:function(r,n,a,i,f,h,w){this._renderQ.length!==0&&!w?this._renderQPush({type:"copy",oldX:r,oldY:n,x:a,y:i,width:f,height:h}):(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,r,n,f,h,a,i,f,h),this._damage(a,i,f,h))}},{key:"imageRect",value:function(r,n,a,i,f,h){if(a===0||i===0)return;var w=new Image;w.src="data: "+f+";base64,"+D.default.encode(h),this._renderQPush({type:"img",img:w,x:r,y:n,width:a,height:i})}},{key:"startTile",value:function(r,n,a,i,f){this._tileX=r,this._tileY=n,a===16&&i===16?this._tile=this._tile16x16:this._tile=this._drawCtx.createImageData(a,i);for(var h=f[2],w=f[1],m=f[0],T=this._tile.data,A=0;A<a*i*4;A+=4)T[A]=h,T[A+1]=w,T[A+2]=m,T[A+3]=255}},{key:"subTile",value:function(r,n,a,i,f){for(var h=f[2],w=f[1],m=f[0],T=r+a,A=n+i,x=this._tile.data,b=this._tile.width,S=n;S<A;S++)for(var C=r;C<T;C++){var g=(C+S*b)*4;x[g]=h,x[g+1]=w,x[g+2]=m,x[g+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(r,n,a,i,f,h,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(a*i*4);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blit",data:m,x:r,y:n,width:a,height:i})}else this._bgrxImageData(r,n,a,i,f,h)}},{key:"blitRgbImage",value:function(r,n,a,i,f,h,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(a*i*3);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blitRgb",data:m,x:r,y:n,width:a,height:i})}else this._rgbImageData(r,n,a,i,f,h)}},{key:"blitRgbxImage",value:function(r,n,a,i,f,h,w){if(this._renderQ.length!==0&&!w){var m=new Uint8Array(a*i*4);m.set(new Uint8Array(f.buffer,0,m.length)),this._renderQPush({type:"blitRgbx",data:m,x:r,y:n,width:a,height:i})}else this._rgbxImageData(r,n,a,i,f,h)}},{key:"drawImage",value:function(r,n,a){this._drawCtx.drawImage(r,n,a),this._damage(n,a,r.width,r.height)}},{key:"autoscale",value:function(r,n){var a;if(r===0||n===0)a=0;else{var i=this._viewportLoc,f=r/n,h=i.w/i.h;h>=f?a=r/i.w:a=n/i.h}this._rescale(a)}},{key:"_rescale",value:function(r){this._scale=r;var n=this._viewportLoc,a=r*n.w+"px",i=r*n.h+"px";(this._target.style.width!==a||this._target.style.height!==i)&&(this._target.style.width=a,this._target.style.height=i)}},{key:"_setFillColor",value:function(r){var n="rgb("+r[2]+","+r[1]+","+r[0]+")";n!==this._prevDrawStyle&&(this._drawCtx.fillStyle=n,this._prevDrawStyle=n)}},{key:"_rgbImageData",value:function(r,n,a,i,f,h){for(var w=this._drawCtx.createImageData(a,i),m=w.data,T=0,A=h;T<a*i*4;T+=4,A+=3)m[T]=f[A],m[T+1]=f[A+1],m[T+2]=f[A+2],m[T+3]=255;this._drawCtx.putImageData(w,r,n),this._damage(r,n,w.width,w.height)}},{key:"_bgrxImageData",value:function(r,n,a,i,f,h){for(var w=this._drawCtx.createImageData(a,i),m=w.data,T=0,A=h;T<a*i*4;T+=4,A+=4)m[T]=f[A+2],m[T+1]=f[A+1],m[T+2]=f[A],m[T+3]=255;this._drawCtx.putImageData(w,r,n),this._damage(r,n,w.width,w.height)}},{key:"_rgbxImageData",value:function(r,n,a,i,f,h){var w;R.supportsImageMetadata?w=new ImageData(new Uint8ClampedArray(f.buffer,f.byteOffset,a*i*4),a,i):(w=this._drawCtx.createImageData(a,i),w.data.set(new Uint8ClampedArray(f.buffer,f.byteOffset,a*i*4))),this._drawCtx.putImageData(w,r,n),this._damage(r,n,w.width,w.height)}},{key:"_renderQPush",value:function(r){this._renderQ.push(r),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 r=!0;r&&this._renderQ.length>0;){var n=this._renderQ[0];switch(n.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(n.oldX,n.oldY,n.x,n.y,n.width,n.height,!0);break;case"fill":this.fillRect(n.x,n.y,n.width,n.height,n.color,!0);break;case"blit":this.blitImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"blitRgb":this.blitRgbImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(n.x,n.y,n.width,n.height,n.data,0,!0);break;case"img":if(n.img.complete&&n.img.width!==0&&n.img.height!==0){if(n.img.width!==n.width||n.img.height!==n.height){k.Error("Decoded image has incorrect dimensions. Got "+n.img.width+"x"+n.img.height+". Expected "+n.width+"x"+n.height+".");return}this.drawImage(n.img,n.x,n.y)}else n.img._noVNCDisplay=this,n.img.addEventListener("load",this._resumeRenderQ),r=!1;break}r&&this._renderQ.shift()}this._renderQ.length===0&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(r){this._rescale(r)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(r){this._clipViewport=r;var n=this._viewportLoc;this.viewportChangeSize(n.w,n.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}]),s}();ue.default=d},Mmt2:function($e,ue,ie){"use strict";function j(o){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(s){return typeof s}:j=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},j(o)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=R(ie("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var o=new WeakMap;return D=function(){return o},o}function R(o){if(o&&o.__esModule)return o;if(o===null||j(o)!=="object"&&typeof o!="function")return{default:o};var d=D();if(d&&d.has(o))return d.get(o);var s={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r)){var n=l?Object.getOwnPropertyDescriptor(o,r):null;n&&(n.get||n.set)?Object.defineProperty(s,r,n):s[r]=o[r]}return s.default=o,d&&d.set(o,s),s}function O(o,d){if(!(o instanceof d))throw new TypeError("Cannot call a class as a function")}function c(o,d){for(var s=0;s<d.length;s++){var l=d[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(o,l.key,l)}}function E(o,d,s){return d&&c(o.prototype,d),s&&c(o,s),o}var y=!1,p=40*1024*1024,u=function(){function o(){O(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(s){this._rQi+=s}},{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(s){for(var l=0,r=s-1;r>=0;r--)l+=this._rQ[this._rQi++]<<r*8;return l}},{key:"rQshiftStr",value:function(s){typeof s=="undefined"&&(s=this.rQlen);for(var l="",r=0;r<s;r+=4096){var n=this.rQshiftBytes(Math.min(4096,s-r));l+=String.fromCharCode.apply(null,n)}return l}},{key:"rQshiftBytes",value:function(s){return typeof s=="undefined"&&(s=this.rQlen),this._rQi+=s,new Uint8Array(this._rQ.buffer,this._rQi-s,s)}},{key:"rQshiftTo",value:function(s,l){l===void 0&&(l=this.rQlen),s.set(new Uint8Array(this._rQ.buffer,this._rQi,l)),this._rQi+=l}},{key:"rQslice",value:function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+s,l-s)}},{key:"rQwait",value:function(s,l,r){if(this.rQlen<l){if(r){if(this._rQi<r)throw new Error("rQwait cannot backup "+r+" bytes");this._rQi-=r}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(s){this._sQ.set(s,this._sQlen),this._sQlen+=s.length,this.flush()}},{key:"sendString",value:function(s){this.send(s.split("").map(function(l){return l.charCodeAt(0)}))}},{key:"off",value:function(s){this._eventHandlers[s]=function(){}}},{key:"on",value:function(s,l){this._eventHandlers[s]=l}},{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(s,l){var r=this;this.init(),this._websocket=new WebSocket(s,l),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){k.Debug(">> WebSock.onopen"),r._websocket.protocol&&k.Info("Server choose sub-protocol: "+r._websocket.protocol),r._eventHandlers.open(),k.Debug("<< WebSock.onopen")},this._websocket.onclose=function(n){k.Debug(">> WebSock.onclose"),r._eventHandlers.close(n),k.Debug("<< WebSock.onclose")},this._websocket.onerror=function(n){k.Debug(">> WebSock.onerror: "+n),r._eventHandlers.error(n),k.Debug("<< WebSock.onerror: "+n)}}},{key:"close",value:function(){this._websocket&&((this._websocket.readyState===WebSocket.OPEN||this._websocket.readyState===WebSocket.CONNECTING)&&(k.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(s){var l=(this._rQlen-this._rQi+s)*8,r=this._rQbufferSize<l;if(r&&(this._rQbufferSize=Math.max(this._rQbufferSize*2,l)),this._rQbufferSize>p&&(this._rQbufferSize=p,this._rQbufferSize-this.rQlen<s))throw new Error("Receive Queue buffer exceeded "+p+" bytes, and the new message could not fit");if(r){var n=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(n,this._rQi,this._rQlen-this._rQi))}else y?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(s){var l=new Uint8Array(s);l.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(l.length),this._rQ.set(l,this._rQlen),this._rQlen+=l.length}},{key:"_recvMessage",value:function(s){this._DecodeMessage(s.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):k.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(s){this._rQi=s}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}]),o}();ue.default=u},"N/zr":function($e,ue,ie){"use strict";function j(c){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(y){return typeof y}:j=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},j(c)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var k=R(ie("Lo0S"));function D(){if(typeof WeakMap!="function")return null;var c=new WeakMap;return D=function(){return c},c}function R(c){if(c&&c.__esModule)return c;if(c===null||j(c)!=="object"&&typeof c!="function")return{default:c};var E=D();if(E&&E.has(c))return E.get(c);var y={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in c)if(Object.prototype.hasOwnProperty.call(c,u)){var o=p?Object.getOwnPropertyDescriptor(c,u):null;o&&(o.get||o.set)?Object.defineProperty(y,u,o):y[u]=c[u]}return y.default=c,E&&E.set(c,y),y}var O={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(E){"use strict";for(var y="",p=E.length,u=p%3,o=0;o<p-2;o+=3)y+=this.toBase64Table[E[o]>>2],y+=this.toBase64Table[((E[o]&3)<<4)+(E[o+1]>>4)],y+=this.toBase64Table[((E[o+1]&15)<<2)+(E[o+2]>>6)],y+=this.toBase64Table[E[o+2]&63];var d=p-u;return u===2?(y+=this.toBase64Table[E[d]>>2],y+=this.toBase64Table[((E[d]&3)<<4)+(E[d+1]>>4)],y+=this.toBase64Table[(E[d+1]&15)<<2],y+=this.toBase64Table[64]):u===1&&(y+=this.toBase64Table[E[d]>>2],y+=this.toBase64Table[(E[d]&3)<<4],y+=this.toBase64Table[64],y+=this.toBase64Table[64]),y},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 y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,p=E.indexOf("=")-y;p<0&&(p=E.length-y);for(var u=(p>>2)*3+Math.floor(p%4/1.5),o=new Array(u),d=0,s=0,l=0,r=y;r<E.length;r++){var n=this.toBinaryTable[E.charCodeAt(r)&127],a=E.charAt(r)===this.base64Pad;if(n===-1){k.Error("Illegal character code "+E.charCodeAt(r)+" at position "+r);continue}s=s<<6|n,d+=6,d>=8&&(d-=8,a||(o[l++]=s>>d&255),s&=(1<<d)-1)}if(d){var i=new Error("Corrupted base64 string");throw i.name="Base64-Error",i}return o}};ue.default=O},NBmB:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.encodingName=k,ue.encodings=void 0;var j={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};ue.encodings=j;function k(D){switch(D){case j.encodingRaw:return"Raw";case j.encodingCopyRect:return"CopyRect";case j.encodingRRE:return"RRE";case j.encodingHextile:return"Hextile";case j.encodingTight:return"Tight";case j.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+D+"]"}}},OLES:function($e,ue,ie){"use strict";var j=ie("U8pU"),k=ie("VTBJ"),D=ie("Ff2n"),R=ie("q1tI"),O=ie("uciX"),c=ie("7ixt"),E=function(s){var l=s.overlay,r=s.prefixCls,n=s.id,a=s.overlayInnerStyle;return R.createElement("div",{className:"".concat(r,"-inner"),id:n,role:"tooltip",style:a},typeof l=="function"?l():l)},y=E,p=function(s,l){var r=s.overlayClassName,n=s.trigger,a=n===void 0?["hover"]:n,i=s.mouseEnterDelay,f=i===void 0?0:i,h=s.mouseLeaveDelay,w=h===void 0?.1:h,m=s.overlayStyle,T=s.prefixCls,A=T===void 0?"rc-tooltip":T,x=s.children,b=s.onVisibleChange,S=s.afterVisibleChange,C=s.transitionName,g=s.animation,M=s.placement,I=M===void 0?"right":M,P=s.align,B=P===void 0?{}:P,H=s.destroyTooltipOnHide,F=H===void 0?!1:H,W=s.defaultVisible,U=s.getTooltipContainer,K=s.overlayInnerStyle,G=Object(D.a)(s,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),ee=Object(R.useRef)(null);Object(R.useImperativeHandle)(l,function(){return ee.current});var de=Object(k.a)({},G);"visible"in s&&(de.popupVisible=s.visible);var ge=function(){var Pe=s.arrowContent,be=Pe===void 0?null:Pe,ke=s.overlay,te=s.id;return[R.createElement("div",{className:"".concat(A,"-arrow"),key:"arrow"},be),R.createElement(y,{key:"content",prefixCls:A,id:te,overlay:ke,overlayInnerStyle:K})]},Be=!1,Ue=!1;if(typeof F=="boolean")Be=F;else if(F&&Object(j.a)(F)==="object"){var Le=F.keepParent;Be=Le===!0,Ue=Le===!1}return R.createElement(O.a,Object.assign({popupClassName:r,prefixCls:A,popup:ge,action:a,builtinPlacements:c.a,popupPlacement:I,ref:ee,popupAlign:B,getPopupContainer:U,onPopupVisibleChange:b,afterPopupVisibleChange:S,popupTransitionName:C,popupAnimation:g,defaultPopupVisible:W,destroyPopupOnHide:Be,autoDestroy:Ue,mouseLeaveDelay:w,popupStyle:m,mouseEnterDelay:f},de),x)},u=Object(R.forwardRef)(p),o=ue.a=u},Ot1p:function($e,ue,ie){"use strict";var j=ie("2qtc"),k=ie("kLXV"),D=ie("rAM+"),R=ie("miYZ"),O=ie("tsqr"),c=ie("tJVT"),E=ie("jrin"),y=ie("q1tI"),p=ie.n(y),u=ie("VrN/"),o=ie.n(u),d=ie("bdgK"),s=ie("p77/"),l=ie("Bd2K"),r=ie("ELLl"),n=ie("19Vz"),a=ie("lZu9"),i=ie("+NIl"),f=ie("kSUc"),h=ie("9Bee"),w=function(le){var Y=le.value,Z=Y===void 0?"":Y,z=le.className,oe=le.showTextOnly,Ce=le.showLines,X=le.style,me=X===void 0?{}:X,De=Object(y.useMemo)(function(){return""},[Z]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:De}}))},m=ie("0Owb"),T=ie("dejd"),A=ie("C+DQ"),x=[{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 b(le){var Y=le.onActionCallback,Z=le.title,z=le.icon,oe=le.actionName,Ce=le.className,X=Ce===void 0?"":Ce,me=le.children;function De(){Y(oe)}return p.a.createElement("a",{title:Z,className:X,onClick:De},p.a.createElement("i",{className:"md-iconfont ".concat(z)}),me)}var S=function(le){var Y=le.watch,Z=le.showNullButton,z=le.onActionCallback,oe=le.fullScreen,Ce=le.insertTemp,X=le.hidetoolBar,me=[].concat(x,[{title:"".concat(Y?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Y?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!X&&me.map(function(De,se){return p.a.createElement("li",{key:se},De.actionName?p.a.createElement(b,Object(m.a)({},De,{onActionCallback:z})):p.a.createElement("span",{className:"v-line"}))}),Z?p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:z},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Ce&&p.a.createElement("li",null,p.a.createElement(b,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Ce),onActionCallback:z},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(b,{icon:"".concat(oe?"icon-shrink":"icon-enlarge"),title:oe?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:z})))},C=ie("M8RZ"),g=ie("+L6B"),M=ie("2/Rp"),I=ie("y8nQ"),P=ie("Vl3Y"),B=ie("5NDa"),H=ie("5rEg"),F={labelCol:{span:4},wrapperCol:{span:20}},W=function(le){var Y=le.callback,Z=le.onCancel;function z(oe){Y(oe)}return p.a.createElement(P.a,Object(m.a)({},F,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:z}),p.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(H.a,null)),p.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(H.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(M.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(M.a,{type:"ghost",onClick:Z},"\u53D6\u6D88")))},U=ie("7ahc"),K=ie("HmJG"),G=ie("BjJ7"),ee=P.a.useForm,de={width:280,marginRight:10},ge={labelCol:{span:5},wrapperCol:{span:19}},Be=function(le){var Y=le.callback,Z=le.onCancel,z=ee(),oe=Object(c.a)(z,1),Ce=oe[0];function X(se){Y(se)}function me(se,ve){Ce.setFieldsValue({src:"/api/attachments/".concat(se.id),type:ve.type})}function De(se){var ve=se.target.files[0];Le(ve,me)}return p.a.createElement(P.a,Object(m.a)({form:Ce},ge,{className:"upload-image-panel",onFinish:X}),p.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(H.a,{style:de})),p.a.createElement(Ue,{onFileChange:De}))),p.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u63CF\u8FF0"}]},p.a.createElement(H.a,{style:{width:264}})),p.a.createElement(P.a.Item,{style:{textAlign:"right"}},p.a.createElement(M.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(M.a,{type:"ghost",onClick:Z},"\u53D6\u6D88")))};function Ue(le){var Y=le.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Y}))}function Le(le,Y){if(!le)throw new String("\u6CA1\u6709\u6587\u4EF6");var Z=new FormData;Z.append("editormd-image-file",le),Z.append("file_param_name","editormd-image-file"),Z.append("byxhr","true");var z=new window.XMLHttpRequest;z.withCredentials=!0,z.addEventListener("load",function(oe){Y(JSON.parse(oe.target.responseText),le)},!1),z.addEventListener("error",function(oe){console.error(oe)},!1),z.open("POST","".concat(G.a,"/api/attachments.json")),z.send(Z)}var Me=ie("giR+"),Pe=ie("fyUT"),be=ie("7Kak"),ke=ie("9yH6"),te=ke.a.Group,pe={margin:"0 8px"},ae=function(le){var Y=le.callback,Z=le.onCancel;function z(oe){Y(oe)}return p.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:z},p.a.createElement("div",{className:"flex-container"},p.a.createElement("span",{style:pe},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:pe},"\u884C\u6570"),p.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(Pe.a,null)),p.a.createElement("span",{style:pe},"\u5217\u6570"),p.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(Pe.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12}},p.a.createElement("span",{style:pe},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(P.a.Item,{name:"align"},p.a.createElement(te,null,p.a.createElement(ke.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(ke.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(ke.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(ke.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(M.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(M.a,{type:"ghost",onClick:Z},"\u53D6\u6D88")))},_e=ie("m3rI"),Ie=ie("wMS7"),Fe=ie.n(Ie),Xe="link",Ge="upload-image",ze="code-block",Re="add-table",Se="------------",Te={default:Se,left:":".concat(Se),center:":".concat(Se,":"),right:"".concat(Se,":")},Ee=ie("9VGf"),$,fe;function J(){}var Ae=0,We=1e4,Ye="\u2581",Ne=`
|
|
|
**\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 et(le){return/^\d+$/.test(le)?"".concat(le,"px"):le}var ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,xe=ne?"Cmd":"Ctrl",Oe=($={},Object(E.a)($,xe+"-B","bold"),Object(E.a)($,xe+"-I","italic"),$),he=(fe={},Object(E.a)(fe,Xe,"\u6DFB\u52A0\u94FE\u63A5"),Object(E.a)(fe,ze,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(E.a)(fe,Ge,"\u6DFB\u52A0\u56FE\u7247"),Object(E.a)(fe,Re,"\u6DFB\u52A0\u8868\u683C"),fe),ce=ue.a=function(le){var Y=le.defaultValue,Z=Y===void 0?"":Y,z=le.onChange,oe=le.width,Ce=oe===void 0?"100%":oe,X=le.height,me=X===void 0?400:X,De=le.miniToolbar,se=De===void 0?!1:De,ve=le.isFocus,Ke=ve===void 0?!1:ve,rt=le.watch,qe=le.insertTemp,Je=le.mode,lt=Je===void 0?"markdown":Je,vt=le.id,ct=vt===void 0?"markdown-editor-id":vt,it=le.showResizeBar,yt=it===void 0?!1:it,Tt=le.noStorage,Ct=Tt===void 0?!1:Tt,Ht=le.showNullButton,Ut=Ht===void 0?!1:Ht,Ot=le.hidetoolBar,It=Ot===void 0?!1:Ot,Rt=le.fullScreen,$t=Rt===void 0?!1:Rt,Lt=le.onBlur,dt=le.onCMBeforeChange,sr=le.onFullScreen,zr=le.className,_r=zr===void 0?"":zr,kt=le.disablePaste,Lr=kt===void 0?!1:kt,Pr=le.placeholder,Or=Pr===void 0?"":Pr,tt=le.values,bt=tt===void 0?"":tt,kr=Object(y.useState)(null),Mr=Object(c.a)(kr,2),at=Mr[0],Gr=Mr[1],An=Object(y.useState)(Z),_t=Object(c.a)(An,2),hr=_t[0],Xr=_t[1],Vr=Object(y.useState)(rt),pr=Object(c.a)(Vr,2),Ir=pr[0],gt=pr[1],Ve=Object(y.useState)($t),ft=Object(c.a)(Ve,2),pt=ft[0],Mt=ft[1],mr=Object(y.useState)(""),er=Object(c.a)(mr,2),Wt=er[0],Bt=er[1],Ln=Object(y.useState)(0),Tr=Object(c.a)(Ln,2),Fr=Tr[0],yr=Tr[1],Ti=Object(y.useState)(me),Ci=Object(c.a)(Ti,2),pn=Ci[0],rn=Ci[1],$i=Object(y.useState)(!1),Ai=Object(c.a)($i,2),Ka=Ai[0],qn=Ai[1],Yr=Object(y.useRef)(),kn=Object(y.useRef)(),Rn=Object(y.useRef)(),mn=Object(y.useRef)();Object(y.useEffect)(function(){Xr(bt),at==null||at.setValue(bt)},[bt]),Object(y.useEffect)(function(){sr==null||sr(pt)},[pt]),Object(y.useEffect)(function(){if(Yr.current){var Et=o.a.fromTextArea(Yr.current,{mode:lt,lineNumbers:!se,lineWrapping:!0,value:Z,autoCloseTags:!0,autoCloseBrackets:!0});Ke&&Et.focus();function St(wt,Dt){if(Lr){Dt.preventDefault();return}var Ft=Dt.clipboardData;if(Ft){var Xt=Ft.types.toString(),Gt=Ft.items,tr=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];if(Xt==="Files"||Ft.types.indexOf("Files")>-1){if(Dt.preventDefault(),lt=="stex")return;try{var rr,qr=Gt[1];((rr=Gt[0])===null||rr===void 0?void 0:rr.kind)==="file"&&(qr=Gt[0]);var Qt=qr.getAsFile(),an=Qt.name.split(".").pop();Le(Qt,function(cr){if(cr.id){var Zr,$r,Jn;(Qt==null||((Zr=Qt.type)===null||Zr===void 0)?void 0:Zr.indexOf("image"))>-1?Et.replaceSelection(".concat(cr.content_type,")")):(Qt==null||(($r=Qt.type)===null||$r===void 0)?void 0:$r.indexOf("video"))>-1?Et.replaceSelection('<video width="100%" controls src="'.concat(_e.a.API_SERVER,"/api/attachments/").concat(cr.id,'"></video>')):(Qt==null||((Jn=Qt.type)===null||Jn===void 0)?void 0:Jn.indexOf("pdf"))>-1?Et.replaceSelection('<a href="'.concat(_e.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(Qt.type,'&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):tr.includes(an)?Et.replaceSelection('<a href="'.concat(_e.a.API_SERVER,"/api/attachments/").concat(cr.id,'?type=office&disposition=inline" target="_blank">').concat(Qt.name,"</a>")):Et.replaceSelection("[".concat(Qt.name,"](").concat(_e.a.API_SERVER,"/api/attachments/").concat(cr.id,"?type=").concat(cr.content_type,")"))}else(cr==null?void 0:cr.status)===401&&(document.location.href="/user/login")})}catch(cr){O.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return Et.on("paste",St),Gr(Et),function(){Et.off("paste",St)}}},[]);var Zn=Object(y.useCallback)(function(){if(kn.current)try{}catch(Et){console.log(Et,"---- to set md editor body height")}},[pn,kn,pt]);Object(y.useEffect)(function(){function Et(){var wt=new d.default(function(Dt){var Ft=Object(D.a)(Dt),Xt;try{for(Ft.s();!(Xt=Ft.n()).done;){var Gt=Xt.value;(Gt.target.offsetHeight>0||Gt.target.offsetWidth>0)&&(Zn(),at.setSize("100%","100%"),at.refresh())}}catch(tr){Ft.e(tr)}finally{Ft.f()}});return wt.observe(Yr.current.parentElement),wt}if(at){var St=Et();return function(){St.unobserve(Yr.current.parentElement)}}},[at,Zn]),Object(y.useEffect)(function(){if(at){for(var Et=[],St=function(){var Gt=Dt[wt];Ft=Object(c.a)(Gt,2);var tr=Ft[0],rr=Ft[1],qr=Object(E.a)({},tr,function(){gn(rr)});Et.push(qr),at.addKeyMap(qr)},wt=0,Dt=Object.entries(Oe);wt<Dt.length;wt++){var Ft;St()}return function(){var Xt=Object(D.a)(Et),Gt;try{for(Xt.s();!(Gt=Xt.n()).done;){var tr=Gt.value;at.removeKeyMap(tr)}}catch(rr){Xt.e(rr)}finally{Xt.f()}}}},[at]),Object(y.useEffect)(function(){$t!==pt&&Mt($t)},[$t]),Object(Ee.a)(function(){if(!Ct&&Fr>0){var Et=new Date().getTime(),St=window.sessionStorage.getItem(ct);Et>=Fr+We&&(!St||St!==hr)&&(window.sessionStorage.setItem(ct,hr),qn(!0))}},We),Object(y.useEffect)(function(){gt(rt)},[at,rt]),Object(y.useEffect)(function(){at&&(Ke&&at.focus())},[at,Ke]),Object(y.useEffect)(function(){if(Ir&&at){var Et=at.getScrollerElement();function St(wt){var Dt=wt.target;if(mn.current){var Ft=Dt.scrollTop/Dt.scrollHeight;mn.current.scrollTop=mn.current.scrollHeight*Ft}}return Et.addEventListener("scroll",St),function(){Et.removeEventListener("scroll",St)}}},[at,Ir]),Object(y.useEffect)(function(){if(at&&dt){function Et(St,wt){dt(St,wt)}return at.on("beforeChange",Et),function(){at.off("beforeChange",Et)}}},[at,dt]),Object(y.useEffect)(function(){if(at&&Lt){function Et(){Lt(at.getValue())}return at.on("blur",Et),function(){at.off("blur",Et)}}},[at,Lt]),Object(y.useEffect)(function(){if(at){function Et(St){var wt=Fe.a.sanitize(St.getValue());Xr(wt),yr(new Date().getTime()),St.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),z&&z(wt)}return at.on("change",Et),function(){at.off("change",Et)}}},[at,z]),Object(y.useEffect)(function(){at&&(Z==null?(at.setValue(""),Xr("")):Z!==at.getValue()&&(at.setValue(Z),Xr(Z),at.setCursor(at.lineCount(),0)))},[at,Z]);var gn=Object(y.useCallback)(function(Et){var St=at.getCursor(),wt=at.getSelection(),Dt=wt.split(`
|
|
|
`);switch(Et){case"bold":return at.replaceSelection("**"+wt+"**"),wt===""&&at.setCursor(St.line,St.ch+2),at.focus();case"italic":return at.replaceSelection("*"+wt+"*"),wt===""&&at.setCursor(St.line,St.ch+1),at.focus();case"code":return at.replaceSelection("`"+wt+"`"),wt===""&&at.setCursor(St.line,St.ch+1),at.focus();case"inline-latex":return at.replaceSelection("`$$"+wt+"$$`"),wt===""&&at.setCursor(St.line,St.ch+3),at.focus();case"latex":return at.replaceSelection("```latex\n"+wt+"\n```"),at.setCursor(St.line+1,wt.length+1),at.focus();case"line-break":return at.replaceSelection(`<br/>
|
|
|
`),at.focus();case"list-ul":return wt===""?at.replaceSelection("- "+wt):at.replaceSelection(Dt.map(function(Ft){return Ft===""?"":"- ".concat(Ft)}).join(`
|
|
|
`)),at.focus();case"list-ol":return wt===""?at.replaceSelection("1. "+wt):at.replaceSelection(Dt.map(function(Ft,Xt){return Ft===""?"":"".concat(Xt+1,". ").concat(Ft)}).join(`
|
|
|
`)),at.focus();case"add-null-ch":return wt===""&&at.setCursor(St.line,St.ch+1),at.replaceSelection(Ye),at.focus();case"inster-template-1":return wt===""&&at.setCursor(St.line,St.ch),at.replaceSelection(Ne),at.focus();case"eraser":return at.setValue(""),at.focus();case"trigger-watch":return gt(!Ir),at.focus();case"trigger-full-screen":return Mt(!pt),at.focus();case Xe:Bt(Xe);return;case ze:Bt(ze);return;case Ge:Bt(Ge);return;case Re:Bt(Re);return;default:throw new Error}},[at,Ir,pt]),Qr=Object(y.useCallback)(function(Et){Bt("");switch(Wt){case Xe:var St=Et.title,wt=Et.link;return at.replaceSelection("[".concat(St,"](").concat(wt,")")),at.focus();case ze:var Dt=Et.language,Ft=Et.content;return at.replaceSelection(["```"+Dt,Ft,"```"].join(`
|
|
|
`)),at.focus();case Ge:var Xt=Et.src,Gt=Et.alt;return at.replaceSelection(".concat(Xt,' "').concat(Gt,'" )')),at.focus();case Re:for(var tr=Et.row,rr=Et.col,qr=Et.align,Qt=`
|
|
|
`,an=0;an<tr;an++){for(var cr=[],Zr=[],$r=0;$r<rr;$r++)an===1&&Zr.push(Te[qr]),cr.push(" ");an===1&&(Qt+="| ".concat(Zr.join(" | "),` |
|
|
|
`)),Qt+="| ".concat(cr.join(rr===1?"":" | "),` |
|
|
|
`)}return at.replaceSelection(Qt+`
|
|
|
`),at.focus();default:throw new Error}},[at,Wt]),$n=Object(y.useMemo)(function(){switch(Wt){case Xe:return p.a.createElement(W,{callback:Qr,onCancel:nn});case ze:return p.a.createElement(U.b,{callback:Qr,onCancel:nn});case Ge:return p.a.createElement(Be,{callback:Qr,onCancel:nn});case Re:return p.a.createElement(ae,{callback:Qr,onCancel:nn});default:return null}},[Wt]);function nn(){Bt("")}Object(y.useEffect)(function(){if(Rn.current){var Et=Rn.current,St=!1,wt=0;function Dt(Gt){St=!0,wt=Gt.pageY}function Ft(){St=!1}function Xt(Gt){if(St){var tr=Gt.pageY-wt;tr<0&&(tr=0),tr>300&&(tr=300);var rr=me+tr+"px";rn(rr)}}return Et.addEventListener("mousedown",Dt),document.addEventListener("mousemove",Xt),document.addEventListener("mouseup",Ft),function(){Et.removeEventListener("mousedown",Dt),document.removeEventListener("mousemove",Xt),document.removeEventListener("mouseup",Ft)}}},[at,Rn]),Object(y.useEffect)(function(){rn(me)},[me]);var Li=et(Ce),Dn=et(pn),Ji={width:Li,height:Dn},ea=Object(y.useMemo)(function(){if(Fr){var Et=new Date(Fr),St=Et.getHours(),wt=Et.getMinutes(),Dt=Et.getSeconds();return St=St<10?"0"+St:St,wt=wt<10?"0"+wt:wt,Dt=Dt<10?"0"+Dt:Dt,"".concat(St,":").concat(wt,":").concat(Dt)}return 0},[Fr]);function Nr(){window.sessionStorage.removeItem(ct),qn(!1),yr(0)}function Ba(){qn(!1),yr(0),at.setValue(window.sessionStorage.getItem(ct))}return p.a.createElement(y.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:kn},p.a.createElement("div",{className:"markdown-editor-container ".concat(_r," ").concat(Ir?"on-preview":""," ").concat(se?"mini":""," ").concat(pt?"full-screen":""),style:Ji},p.a.createElement(S,{insertTemp:qe,watch:Ir,fullScreen:pt,showNullButton:Ut,onActionCallback:gn,hidetoolBar:It}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Yr,placeholder:Or})),Ir?p.a.createElement("div",{ref:mn,className:"preview-container"},lt==="stex"&&p.a.createElement(w,{value:hr}),lt!=="stex"&&p.a.createElement(h.a,{value:hr})):null))),yt?p.a.createElement("a",{ref:Rn,className:"editor-resize"}):null,p.a.createElement(C.a,null,he[Wt]?p.a.createElement(k.a,{centered:!0,title:he[Wt],visible:!0,onCancel:nn,footer:null},$n):null))}},P2ho:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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};ue.default=j},QV2g:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=j;function j(){for(var R,O=[],c=0;c<256;c++){R=c;for(var E=0;E<8;E++)R=R&1?3988292384^R>>>1:R>>>1;O[c]=R}return O}var k=j();function D(R,O,c,E){var y=k,p=E+c;R^=-1;for(var u=E;u<p;u++)R=R>>>8^y[(R^O[u])&255];return R^-1}},SJMd:function($e,ue){/**
|
|
|
* @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 ie,j,k,D=!1,R,O;window.PR_SHOULD_USE_CONTINUATION=!0;var c,E;(function(){var y=window,p=["break,continue,do,else,for,if,return,while"],u=[p,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],o=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],d=[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"],s=[o,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],l=[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"],r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",n=[o,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",i=[p,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],f=[p,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],h=[p,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],w=[d,l,s,n,a,i,f,h],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",A="kwd",x="com",b="typ",S="lit",C="pun",g="pln",M="tag",I="dec",P="src",B="atn",H="atv",F="nocode",W="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(Fe){for(var Xe=0,Ge=!1,ze=!1,Re=0,Se=Fe.length;Re<Se;++Re){var Te=Fe[Re];if(Te.ignoreCase)ze=!0;else if(/[a-z]/i.test(Te.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ge=!0,ze=!1;break}}var Ee={b:8,t:9,n:10,v:11,f:12,r:13};function $(Ye){var Ne=Ye.charCodeAt(0);if(Ne!==92)return Ne;var et=Ye.charAt(1);return Ne=Ee[et],Ne||("0"<=et&&et<="7"?parseInt(Ye.substring(1),8):et==="u"||et==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function fe(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Ne=String.fromCharCode(Ye);return Ne==="\\"||Ne==="-"||Ne==="]"||Ne==="^"?"\\"+Ne:Ne}function J(Ye){var Ne=Ye.substring(1,Ye.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")),et=[],ne=Ne[0]==="^",xe=["["];ne&&xe.push("^");for(var Oe=ne?1:0,he=Ne.length;Oe<he;++Oe){var ce=Ne[Oe];if(/\\[bdsw]/i.test(ce))xe.push(ce);else{var le=$(ce),Y;Oe+2<he&&Ne[Oe+1]==="-"?(Y=$(Ne[Oe+2]),Oe+=2):Y=le,et.push([le,Y]),Y<65||le>122||(Y<65||le>90||et.push([Math.max(65,le)|32,Math.min(Y,90)|32]),Y<97||le>122||et.push([Math.max(97,le)&~32,Math.min(Y,122)&~32]))}}et.sort(function(Ce,X){return Ce[0]-X[0]||X[1]-Ce[1]});for(var Z=[],z=[],Oe=0;Oe<et.length;++Oe){var oe=et[Oe];oe[0]<=z[1]+1?z[1]=Math.max(z[1],oe[1]):Z.push(z=oe)}for(var Oe=0;Oe<Z.length;++Oe){var oe=Z[Oe];xe.push(fe(oe[0])),oe[1]>oe[0]&&(oe[1]+1>oe[0]&&xe.push("-"),xe.push(fe(oe[1])))}return xe.push("]"),xe.join("")}function Ae(Ye){for(var Ne=Ye.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")),et=Ne.length,ne=[],xe=0,Oe=0;xe<et;++xe){var he=Ne[xe];if(he==="(")++Oe;else if(he.charAt(0)==="\\"){var ce=+he.substring(1);ce&&(ce<=Oe?ne[ce]=-1:Ne[xe]=fe(ce))}}for(var xe=1;xe<ne.length;++xe)ne[xe]===-1&&(ne[xe]=++Xe);for(var xe=0,Oe=0;xe<et;++xe){var he=Ne[xe];if(he==="(")++Oe,ne[Oe]||(Ne[xe]="(?:");else if(he.charAt(0)==="\\"){var ce=+he.substring(1);ce&&ce<=Oe&&(Ne[xe]="\\"+ne[ce])}}for(var xe=0;xe<et;++xe)Ne[xe]==="^"&&Ne[xe+1]!=="^"&&(Ne[xe]="");if(Ye.ignoreCase&&Ge)for(var xe=0;xe<et;++xe){var he=Ne[xe],le=he.charAt(0);he.length>=2&&le==="["?Ne[xe]=J(he):le!=="\\"&&(Ne[xe]=he.replace(/[a-zA-Z]/g,function(z){var oe=z.charCodeAt(0);return"["+String.fromCharCode(oe&~32,oe|32)+"]"}))}return Ne.join("")}for(var We=[],Re=0,Se=Fe.length;Re<Se;++Re){var Te=Fe[Re];if(Te.global||Te.multiline)throw new Error(""+Te);We.push("(?:"+Ae(Te)+")")}return new RegExp(We.join("|"),ze?"gi":"g")}function K(Fe,Xe){var Ge=/(?:^|\s)nocode(?:\s|$)/,ze=[],Re=0,Se=[],Te=0;function Ee($){var fe=$.nodeType;if(fe==1){if(Ge.test($.className))return;for(var J=$.firstChild;J;J=J.nextSibling)Ee(J);var Ae=$.nodeName.toLowerCase();(Ae==="br"||Ae==="li")&&(ze[Te]=`
|
|
|
`,Se[Te<<1]=Re++,Se[Te++<<1|1]=$)}else if(fe==3||fe==4){var We=$.nodeValue;We.length&&(Xe?We=We.replace(/\r\n?/g,`
|
|
|
`):We=We.replace(/[ \t\r\n]+/g," "),ze[Te]=We,Se[Te<<1]=Re,Re+=We.length,Se[Te++<<1|1]=$)}}return Ee(Fe),{sourceCode:ze.join("").replace(/\n$/,""),spans:Se}}function G(Fe,Xe,Ge,ze,Re){if(!Ge)return;var Se={sourceNode:Fe,pre:1,langExtension:null,numberLines:null,sourceCode:Ge,spans:null,basePos:Xe,decorations:null};ze(Se),Re.push.apply(Re,Se.decorations)}var ee=/\S/;function de(Fe){for(var Xe=void 0,Ge=Fe.firstChild;Ge;Ge=Ge.nextSibling){var ze=Ge.nodeType;Xe=ze===1?Xe?Fe:Ge:ze===3&&ee.test(Ge.nodeValue)?Fe:Xe}return Xe===Fe?void 0:Xe}function ge(Fe,Xe){var Ge={},ze;(function(){for(var Te=Fe.concat(Xe),Ee=[],$={},fe=0,J=Te.length;fe<J;++fe){var Ae=Te[fe],We=Ae[3];if(We)for(var Ye=We.length;--Ye>=0;)Ge[We.charAt(Ye)]=Ae;var Ne=Ae[1],et=""+Ne;$.hasOwnProperty(et)||(Ee.push(Ne),$[et]=null)}Ee.push(/[\0-\uffff]/),ze=U(Ee)})();var Re=Xe.length,Se=function(Te){for(var Ee=Te.sourceCode,$=Te.basePos,fe=Te.sourceNode,J=[$,g],Ae=0,We=Ee.match(ze)||[],Ye={},Ne=0,et=We.length;Ne<et;++Ne){var ne=We[Ne],xe=Ye[ne],Oe=void 0,he;if(typeof xe=="string")he=!1;else{var ce=Ge[ne.charAt(0)];if(ce)Oe=ne.match(ce[1]),xe=ce[0];else{for(var le=0;le<Re;++le)if(ce=Xe[le],Oe=ne.match(ce[1]),Oe){xe=ce[0];break}Oe||(xe=g)}he=xe.length>=5&&xe.substring(0,5)==="lang-",he&&!(Oe&&typeof Oe[1]=="string")&&(he=!1,xe=P),he||(Ye[ne]=xe)}var Y=Ae;if(Ae+=ne.length,!he)J.push($+Y,xe);else{var Z=Oe[1],z=ne.indexOf(Z),oe=z+Z.length;Oe[2]&&(oe=ne.length-Oe[2].length,z=oe-Z.length);var Ce=xe.substring(5);G(fe,$+Y,ne.substring(0,z),Se,J),G(fe,$+Y+z,Z,ke(Ce,Z),J),G(fe,$+Y+oe,ne.substring(oe),Se,J)}}Te.decorations=J};return Se}function Be(Fe){var Xe=[],Ge=[];Fe.tripleQuotedStrings?Xe.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Fe.multiLineStrings?Xe.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Xe.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Fe.verbatimStrings&&Ge.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var ze=Fe.hashComments;ze&&(Fe.cStyleComments?(ze>1?Xe.push([x,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Xe.push([x,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ge.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Xe.push([x,/^#[^\r\n]*/,null,"#"])),Fe.cStyleComments&&(Ge.push([x,/^\/\/[^\r\n]*/,null]),Ge.push([x,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Re=Fe.regexLiterals;if(Re){var Se=Re>1?"":`
|
|
|
\r`,Te=Se?".":"[\\S\\s]",Ee="/(?=[^/*"+Se+"])(?:[^/\\x5B\\x5C"+Se+"]|\\x5C"+Te+"|\\x5B(?:[^\\x5C\\x5D"+Se+"]|\\x5C"+Te+")*(?:\\x5D|$))+/";Ge.push(["lang-regex",RegExp("^"+W+"("+Ee+")")])}var $=Fe.types;$&&Ge.push([b,$]);var fe=(""+Fe.keywords).replace(/^ | $/g,"");fe.length&&Ge.push([A,new RegExp("^(?:"+fe.replace(/[\s,]+/g,"|")+")\\b"),null]),Xe.push([g,/^\s+/,null,` \r
|
|
|
\xA0`]);var J="^.[^\\s\\w.$@'\"`/\\\\]*";return Fe.regexLiterals&&(J+="(?!s*/)"),Ge.push([S,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[g,/^[a-z_$][a-z_$@0-9]*/i,null],[S,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[g,/^\\[\s\S]?/,null],[C,new RegExp(J),null]),ge(Xe,Ge)}var Ue=Be({keywords:w,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(Fe,Xe,Ge){for(var ze=/(?:^|\s)nocode(?:\s|$)/,Re=/\r\n?|\n/,Se=Fe.ownerDocument,Te=Se.createElement("li");Fe.firstChild;)Te.appendChild(Fe.firstChild);var Ee=[Te];function $(Ne){var et=Ne.nodeType;if(et==1&&!ze.test(Ne.className))if(Ne.nodeName==="br")fe(Ne),Ne.parentNode&&Ne.parentNode.removeChild(Ne);else for(var ne=Ne.firstChild;ne;ne=ne.nextSibling)$(ne);else if((et==3||et==4)&&Ge){var xe=Ne.nodeValue,Oe=xe.match(Re);if(Oe){var he=xe.substring(0,Oe.index);Ne.nodeValue=he;var ce=xe.substring(Oe.index+Oe[0].length);if(ce){var le=Ne.parentNode;le.insertBefore(Se.createTextNode(ce),Ne.nextSibling)}fe(Ne),he||Ne.parentNode.removeChild(Ne)}}}function fe(Ne){for(;!Ne.nextSibling;)if(Ne=Ne.parentNode,!Ne)return;function et(Oe,he){var ce=he?Oe.cloneNode(!1):Oe,le=Oe.parentNode;if(le){var Y=et(le,1),Z=Oe.nextSibling;Y.appendChild(ce);for(var z=Z;z;z=Z)Z=z.nextSibling,Y.appendChild(z)}return ce}for(var ne=et(Ne.nextSibling,0),xe;(xe=ne.parentNode)&&xe.nodeType===1;)ne=xe;Ee.push(ne)}for(var J=0;J<Ee.length;++J)$(Ee[J]);Xe===(Xe|0)&&Ee[0].setAttribute("value",Xe);var Ae=Se.createElement("ol");Ae.className="linenums";for(var We=Math.max(0,Xe-1|0)||0,J=0,Ye=Ee.length;J<Ye;++J)Te=Ee[J],Te.className="L"+(J+We)%10,Te.firstChild||Te.appendChild(Se.createTextNode("\xA0")),Ae.appendChild(Te);Fe.appendChild(Ae)}function Me(Fe){var Xe=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Xe=Xe&&+Xe[1]<=8;var Ge=/\n/g,ze=Fe.sourceCode,Re=ze.length,Se=0,Te=Fe.spans,Ee=Te.length,$=0,fe=Fe.decorations,J=fe.length,Ae=0;fe[J]=Re;var We,Ye;for(Ye=We=0;Ye<J;)fe[Ye]!==fe[Ye+2]?(fe[We++]=fe[Ye++],fe[We++]=fe[Ye++]):Ye+=2;for(J=We,Ye=We=0;Ye<J;){for(var Ne=fe[Ye],et=fe[Ye+1],ne=Ye+2;ne+2<=J&&fe[ne+1]===et;)ne+=2;fe[We++]=Ne,fe[We++]=et,Ye=ne}J=fe.length=We;var xe=Fe.sourceNode,Oe="";xe&&(Oe=xe.style.display,xe.style.display="none");try{for(var he=null;$<Ee;){var ce=Te[$],le=Te[$+2]||Re,Y=fe[Ae+2]||Re,ne=Math.min(le,Y),Z=Te[$+1],z;if(Z.nodeType!==1&&(z=ze.substring(Se,ne))){Xe&&(z=z.replace(Ge,"\r")),Z.nodeValue=z;var oe=Z.ownerDocument,Ce=oe.createElement("span");Ce.className=fe[Ae+1];var X=Z.parentNode;X.replaceChild(Ce,Z),Ce.appendChild(Z),Se<le&&(Te[$+1]=Z=oe.createTextNode(ze.substring(ne,le)),X.insertBefore(Z,Ce.nextSibling))}Se=ne,Se>=le&&($+=2),Se>=Y&&(Ae+=2)}}finally{xe&&(xe.style.display=Oe)}}var Pe={};function be(Fe,Xe){for(var Ge=Xe.length;--Ge>=0;){var ze=Xe[Ge];Pe.hasOwnProperty(ze)?y.console&&console.warn("cannot override language handler %s",ze):Pe[ze]=Fe}}function ke(Fe,Xe){return Fe&&Pe.hasOwnProperty(Fe)||(Fe=/^\s*</.test(Xe)?"default-markup":"default-code"),Pe[Fe]}be(Ue,["default-code"]),be(ge([],[[g,/^[^<?]+/],[I,/^<!\w[^>]*(?:>|$)/],[x,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[C,/^(?:<[%?]|[%?]>)/],["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"]),be(ge([[g,/^[\s]+/,null,` \r
|
|
|
`],[H,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[M,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[B,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[C,/^[=<>\/]+/],["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"]),be(ge([],[[H,/^[\s\S]+/]]),["uq.val"]),be(Be({keywords:d,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),be(Be({keywords:"null,true,false"}),["json"]),be(Be({keywords:l,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),be(Be({keywords:s,cStyleComments:!0}),["java"]),be(Be({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(Be({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(Be({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(Be({keywords:f,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(Be({keywords:n,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(Be({keywords:r,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(ge([],[[T,/^[\s\S]+/]]),["regex"]);function te(Fe){var Xe=Fe.langExtension;try{var Ge=K(Fe.sourceNode,Fe.pre),ze=Ge.sourceCode;Fe.sourceCode=ze,Fe.spans=Ge.spans,Fe.basePos=0,ke(Xe,ze)(Fe),Me(Fe)}catch(Re){y.console&&console.log(Re&&Re.stack||Re)}}function pe(Fe,Xe,Ge){var ze=Ge||!1,Re=Xe||null,Se=document.createElement("div");Se.innerHTML="<pre>"+Fe+"</pre>",Se=Se.firstChild,ze&&Le(Se,ze,!0);var Te={langExtension:Re,numberLines:ze,sourceNode:Se,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return te(Te),Se.innerHTML}function ae(Fe,Xe){var Ge=Xe||document.body,ze=Ge.ownerDocument||document;function Re(ce){return Ge.getElementsByTagName(ce)}for(var Se=[Re("pre"),Re("code"),Re("xmp")],Te=[],Ee=0;Ee<Se.length;++Ee)for(var $=0,fe=Se[Ee].length;$<fe;++$)Te.push(Se[Ee][$]);Se=null;var J=Date;J.now||(J={now:function(){return+new Date}});var Ae=0,We=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,Ne=/\bprettyprinted\b/,et=/pre|xmp/i,ne=/^code$/i,xe=/^(?:pre|code|xmp)$/i,Oe={};function he(){for(var ce=y.PR_SHOULD_USE_CONTINUATION?J.now()+250:Infinity;Ae<Te.length&&J.now()<ce;Ae++){for(var le=Te[Ae],Y=Oe,Z=le;Z=Z.previousSibling;){var z=Z.nodeType,oe=(z===7||z===8)&&Z.nodeValue;if(oe?!/^\??prettify\b/.test(oe):z!==3||/\S/.test(Z.nodeValue))break;if(oe){Y={},oe.replace(/\b(\w+)=([\w:.%+-]+)/g,function(ct,it,yt){Y[it]=yt});break}}var Ce=le.className;if((Y!==Oe||Ye.test(Ce))&&!Ne.test(Ce)){for(var X=!1,me=le.parentNode;me;me=me.parentNode){var De=me.tagName;if(xe.test(De)&&me.className&&Ye.test(me.className)){X=!0;break}}if(!X){le.className+=" prettyprinted";var se=Y.lang;if(!se){se=Ce.match(We);var ve;!se&&(ve=de(le))&&ne.test(ve.tagName)&&(se=ve.className.match(We)),se&&(se=se[1])}var Ke;if(et.test(le.tagName))Ke=1;else{var rt=le.currentStyle,qe=ze.defaultView,Je=rt?rt.whiteSpace:qe&&qe.getComputedStyle?qe.getComputedStyle(le,null).getPropertyValue("white-space"):0;Ke=Je&&Je.substring(0,3)==="pre"}var lt=Y.linenums;(lt=lt==="true"||+lt)||(lt=Ce.match(/\blinenums\b(?::(\d+))?/),lt=lt?lt[1]&<[1].length?+lt[1]:!0:!1),lt&&Le(le,lt,Ke);var vt={langExtension:se,sourceNode:le,numberLines:lt,pre:Ke,sourceCode:null,basePos:null,spans:null,decorations:null};te(vt)}}}Ae<Te.length?y.setTimeout(he,250):typeof Fe=="function"&&Fe()}he()}var _e=y.PR={createSimpleLexer:ge,registerLangHandler:be,sourceDecorator:Be,PR_ATTRIB_NAME:B,PR_ATTRIB_VALUE:H,PR_COMMENT:x,PR_DECLARATION:I,PR_KEYWORD:A,PR_LITERAL:S,PR_NOCODE:F,PR_PLAIN:g,PR_PUNCTUATION:C,PR_SOURCE:P,PR_STRING:T,PR_TAG:M,PR_TYPE:b,prettyPrintOne:D?y.prettyPrintOne=pe:c=pe,prettyPrint:E=D?y.prettyPrint=ae:E=ae},Ie=y.define;typeof Ie=="function"&&Ie.amd&&Ie("google-code-prettify",[],function(){return _e})})()},SZEN:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.clientToElement=j;function j(k,D,R){var O=R.getBoundingClientRect(),c={x:0,y:0};return k<O.left?c.x=0:k>=O.right?c.x=O.width-1:c.x=k-O.left,D<O.top?c.y=0:D>=O.bottom?c.y=O.height-1:c.y=D-O.top,c}},SgaC:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(O,c){if(!(O instanceof c))throw new TypeError("Cannot call a class as a function")}function k(O,c){for(var E=0;E<c.length;E++){var y=c[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,c,E){return c&&k(O.prototype,c),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._subrects=0}return D(O,[{key:"decodeRect",value:function(E,y,p,u,o,d,s){if(this._subrects===0){if(o.rQwait("RRE",4+4))return!1;this._subrects=o.rQshift32();var l=o.rQshiftBytes(4);d.fillRect(E,y,p,u,l)}for(;this._subrects>0;){if(o.rQwait("RRE",4+8))return!1;var r=o.rQshiftBytes(4),n=o.rQshift16(),a=o.rQshift16(),i=o.rQshift16(),f=o.rQshift16();d.fillRect(E+n,y+a,i,f,r),this._subrects--}return!0}}]),O}();ue.default=R},VSMT:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.decodeUTF8=j,ue.encodeUTF8=k;function j(D){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;try{return decodeURIComponent(escape(D))}catch(O){if(O instanceof URIError&&R)return D;throw O}}function k(D){return unescape(encodeURIComponent(D))}},"VaU+":function($e,ue,ie){$e.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($e,ue,ie){(function(j,k){$e.exports=k()})(this,function(){"use strict";var j=navigator.userAgent,k=navigator.platform,D=/gecko\/\d/i.test(j),R=/MSIE \d/.test(j),O=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(j),c=/Edge\/(\d+)/.exec(j),E=R||O||c,y=E&&(R?document.documentMode||6:+(c||O)[1]),p=!c&&/WebKit\//.test(j),u=p&&/Qt\/\d+\.\d+/.test(j),o=!c&&/Chrome\//.test(j),d=/Opera\//.test(j),s=/Apple Computer/.test(navigator.vendor),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(j),r=/PhantomJS/.test(j),n=!c&&/AppleWebKit/.test(j)&&/Mobile\/\w+/.test(j),a=/Android/.test(j),i=n||a||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(j),f=n||/Mac/.test(k),h=/\bCrOS\b/.test(j),w=/win/i.test(k),m=d&&j.match(/Version\/(\d*\.\d*)/);m&&(m=Number(m[1])),m&&m>=15&&(d=!1,p=!0);var T=f&&(u||d&&(m==null||m<12.11)),A=D||E&&y>=9;function x(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,t){var _=e.className,v=x(t).exec(_);if(v){var L=_.slice(v.index+v[0].length);e.className=_.slice(0,v.index)+(L?v[1]+L:"")}};function S(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function C(e,t){return S(e).appendChild(t)}function g(e,t,_,v){var L=document.createElement(e);if(_&&(L.className=_),v&&(L.style.cssText=v),typeof t=="string")L.appendChild(document.createTextNode(t));else if(t)for(var N=0;N<t.length;++N)L.appendChild(t[N]);return L}function M(e,t,_,v){var L=g(e,t,_,v);return L.setAttribute("role","presentation"),L}var I;document.createRange?I=function(e,t,_,v){var L=document.createRange();return L.setEnd(v||e,_),L.setStart(e,t),L}:I=function(e,t,_){var v=document.body.createTextRange();try{v.moveToElementText(e.parentNode)}catch(L){return v}return v.collapse(!0),v.moveEnd("character",_),v.moveStart("character",t),v};function P(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function B(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function H(e,t){var _=e.className;x(t).test(_)||(e.className+=(_?" ":"")+t)}function F(e,t){for(var _=e.split(" "),v=0;v<_.length;v++)_[v]&&!x(_[v]).test(t)&&(t+=" "+_[v]);return t}var W=function(e){e.select()};n?W=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:E&&(W=function(e){try{e.select()}catch(t){}});function U(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function K(e,t,_){t||(t={});for(var v in e)e.hasOwnProperty(v)&&(_!==!1||!t.hasOwnProperty(v))&&(t[v]=e[v]);return t}function G(e,t,_,v,L){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var N=v||0,V=L||0;;){var Q=e.indexOf(" ",N);if(Q<0||Q>=t)return V+(t-N);V+=Q-N,V+=_-V%_,N=Q+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=U(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var _=+new Date+e;(!this.id||_<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=_)};function de(e,t){for(var _=0;_<e.length;++_)if(e[_]==t)return _;return-1}var ge=50,Be={toString:function(){return"CodeMirror.Pass"}},Ue={scroll:!1},Le={origin:"*mouse"},Me={origin:"+move"};function Pe(e,t,_){for(var v=0,L=0;;){var N=e.indexOf(" ",v);N==-1&&(N=e.length);var V=N-v;if(N==e.length||L+V>=t)return v+Math.min(V,t-L);if(L+=N-v,L+=_-L%_,v=N+1,L>=t)return v}}var be=[""];function ke(e){for(;be.length<=e;)be.push(te(be)+" ");return be[e]}function te(e){return e[e.length-1]}function pe(e,t){for(var _=[],v=0;v<e.length;v++)_[v]=t(e[v],v);return _}function ae(e,t,_){for(var v=0,L=_(t);v<e.length&&_(e[v])<=L;)v++;e.splice(v,0,t)}function _e(){}function Ie(e,t){var _;return Object.create?_=Object.create(e):(_e.prototype=e,_=new _e),t&&K(t,_),_}var Fe=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Xe(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Fe.test(e))}function Ge(e,t){return t?t.source.indexOf("\\w")>-1&&Xe(e)?!0:t.test(e):Xe(e)}function ze(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Se(e){return e.charCodeAt(0)>=768&&Re.test(e)}function Te(e,t,_){for(;(_<0?t>0:t<e.length)&&Se(e.charAt(t));)t+=_;return t}function Ee(e,t,_){for(var v=t>_?-1:1;;){if(t==_)return t;var L=(t+_)/2,N=v<0?Math.ceil(L):Math.floor(L);if(N==t)return e(N)?t:_;e(N)?_=N:t=N+v}}function $(e,t,_,v){if(!e)return v(t,_,"ltr",0);for(var L=!1,N=0;N<e.length;++N){var V=e[N];(V.from<_&&V.to>t||t==_&&V.to==t)&&(v(Math.max(V.from,t),Math.min(V.to,_),V.level==1?"rtl":"ltr",N),L=!0)}L||v(t,_,"ltr")}var fe=null;function J(e,t,_){var v;fe=null;for(var L=0;L<e.length;++L){var N=e[L];if(N.from<t&&N.to>t)return L;N.to==t&&(N.from!=N.to&&_=="before"?v=L:fe=L),N.from==t&&(N.from!=N.to&&_!="before"?v=L:fe=L)}return v!=null?v:fe}var Ae=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function _(re){return re<=247?e.charAt(re):1424<=re&&re<=1524?"R":1536<=re&&re<=1785?t.charAt(re-1536):1774<=re&&re<=2220?"r":8192<=re&&re<=8203?"w":re==8204?"b":"L"}var v=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,L=/[stwN]/,N=/[LRr]/,V=/[Lb1n]/,Q=/[1n]/;function q(re,ye,we){this.level=re,this.from=ye,this.to=we}return function(re,ye){var we=ye=="ltr"?"L":"R";if(re.length==0||ye=="ltr"&&!v.test(re))return!1;for(var je=re.length,He=[],Qe=0;Qe<je;++Qe)He.push(_(re.charCodeAt(Qe)));for(var Ze=0,nt=we;Ze<je;++Ze){var ot=He[Ze];ot=="m"?He[Ze]=nt:nt=ot}for(var ut=0,st=we;ut<je;++ut){var ht=He[ut];ht=="1"&&st=="r"?He[ut]="n":N.test(ht)&&(st=ht,ht=="r"&&(He[ut]="R"))}for(var xt=1,mt=He[0];xt<je-1;++xt){var At=He[xt];At=="+"&&mt=="1"&&He[xt+1]=="1"?He[xt]="1":At==","&&mt==He[xt+1]&&(mt=="1"||mt=="n")&&(He[xt]=mt),mt=At}for(var Kt=0;Kt<je;++Kt){var ar=He[Kt];if(ar==",")He[Kt]="N";else if(ar=="%"){var zt=void 0;for(zt=Kt+1;zt<je&&He[zt]=="%";++zt);for(var Ar=Kt&&He[Kt-1]=="!"||zt<je&&He[zt]=="1"?"1":"N",Er=Kt;Er<zt;++Er)He[Er]=Ar;Kt=zt-1}}for(var qt=0,Sr=we;qt<je;++qt){var ur=He[qt];Sr=="L"&&ur=="1"?He[qt]="L":N.test(ur)&&(Sr=ur)}for(var Jt=0;Jt<je;++Jt)if(L.test(He[Jt])){var Zt=void 0;for(Zt=Jt+1;Zt<je&&L.test(He[Zt]);++Zt);for(var Vt=(Jt?He[Jt-1]:we)=="L",wr=(Zt<je?He[Zt]:we)=="L",Yn=Vt==wr?Vt?"L":"R":we,hn=Jt;hn<Zt;++hn)He[hn]=Yn;Jt=Zt-1}for(var fr=[],Wr,or=0;or<je;)if(V.test(He[or])){var Na=or;for(++or;or<je&&V.test(He[or]);++or);fr.push(new q(0,Na,or))}else{var tn=or,Tn=fr.length,Cn=ye=="rtl"?1:0;for(++or;or<je&&He[or]!="L";++or);for(var vr=tn;vr<or;)if(Q.test(He[vr])){tn<vr&&(fr.splice(Tn,0,new q(1,tn,vr)),Tn+=Cn);var Qn=vr;for(++vr;vr<or&&Q.test(He[vr]);++vr);fr.splice(Tn,0,new q(2,Qn,vr)),Tn+=Cn,tn=vr}else++vr;tn<or&&fr.splice(Tn,0,new q(1,tn,or))}return ye=="ltr"&&(fr[0].level==1&&(Wr=re.match(/^\s+/))&&(fr[0].from=Wr[0].length,fr.unshift(new q(0,0,Wr[0].length))),te(fr).level==1&&(Wr=re.match(/\s+$/))&&(te(fr).to-=Wr[0].length,fr.push(new q(0,je-Wr[0].length,je)))),ye=="rtl"?fr.reverse():fr}}();function We(e,t){var _=e.order;return _==null&&(_=e.order=Ae(e.text,t)),_}var Ye=[],Ne=function(e,t,_){if(e.addEventListener)e.addEventListener(t,_,!1);else if(e.attachEvent)e.attachEvent("on"+t,_);else{var v=e._handlers||(e._handlers={});v[t]=(v[t]||Ye).concat(_)}};function et(e,t){return e._handlers&&e._handlers[t]||Ye}function ne(e,t,_){if(e.removeEventListener)e.removeEventListener(t,_,!1);else if(e.detachEvent)e.detachEvent("on"+t,_);else{var v=e._handlers,L=v&&v[t];if(L){var N=de(L,_);N>-1&&(v[t]=L.slice(0,N).concat(L.slice(N+1)))}}}function xe(e,t){var _=et(e,t);if(!_.length)return;for(var v=Array.prototype.slice.call(arguments,2),L=0;L<_.length;++L)_[L].apply(null,v)}function Oe(e,t,_){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),xe(e,_||t.type,e,t),z(t)||t.codemirrorIgnore}function he(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;for(var _=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),v=0;v<t.length;++v)de(_,t[v])==-1&&_.push(t[v])}function ce(e,t){return et(e,t).length>0}function le(e){e.prototype.on=function(t,_){Ne(this,t,_)},e.prototype.off=function(t,_){ne(this,t,_)}}function Y(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Z(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function z(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function oe(e){Y(e),Z(e)}function Ce(e){return e.target||e.srcElement}function X(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),f&&e.ctrlKey&&t==1&&(t=3),t}var me=function(){if(E&&y<9)return!1;var e=g("div");return"draggable"in e||"dragDrop"in e}(),De;function se(e){if(De==null){var t=g("span","\u200B");C(e,g("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(De=t.offsetWidth<=1&&t.offsetHeight>2&&!(E&&y<8))}var _=De?g("span","\u200B"):g("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return _.setAttribute("cm-text",""),_}var ve;function Ke(e){if(ve!=null)return ve;var t=C(e,document.createTextNode("A\u062EA")),_=I(t,0,1).getBoundingClientRect(),v=I(t,1,2).getBoundingClientRect();return S(e),!_||_.left==_.right?!1:ve=v.right-_.right<3}var rt=`
|
|
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,_=[],v=e.length;t<=v;){var L=e.indexOf(`
|
|
|
`,t);L==-1&&(L=e.length);var N=e.slice(t,e.charAt(L-1)=="\r"?L-1:L),V=N.indexOf("\r");V!=-1?(_.push(N.slice(0,V)),t+=V+1):(_.push(N),t=L+1)}return _}:function(e){return e.split(/\r\n?|\n/)},qe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(_){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Je=function(){var e=g("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),lt=null;function vt(e){if(lt!=null)return lt;var t=C(e,g("span","x")),_=t.getBoundingClientRect(),v=I(t,0,1).getBoundingClientRect();return lt=Math.abs(_.left-v.left)>1}var ct={},it={};function yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ct[e]=t}function Tt(e,t){it[e]=t}function Ct(e){if(typeof e=="string"&&it.hasOwnProperty(e))e=it[e];else if(e&&typeof e.name=="string"&&it.hasOwnProperty(e.name)){var t=it[e.name];typeof t=="string"&&(t={name:t}),e=Ie(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ct("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ct("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ht(e,t){t=Ct(t);var _=ct[t.name];if(!_)return Ht(e,"text/plain");var v=_(e,t);if(Ut.hasOwnProperty(t.name)){var L=Ut[t.name];for(var N in L){if(!L.hasOwnProperty(N))continue;v.hasOwnProperty(N)&&(v["_"+N]=v[N]),v[N]=L[N]}}if(v.name=t.name,t.helperType&&(v.helperType=t.helperType),t.modeProps)for(var V in t.modeProps)v[V]=t.modeProps[V];return v}var Ut={};function Ot(e,t){var _=Ut.hasOwnProperty(e)?Ut[e]:Ut[e]={};K(t,_)}function It(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var _={};for(var v in t){var L=t[v];L instanceof Array&&(L=L.concat([])),_[v]=L}return _}function Rt(e,t){for(var _;e.innerMode&&!(_=e.innerMode(t),!_||_.mode==e);)t=_.state,e=_.mode;return _||{mode:e,state:t}}function $t(e,t,_){return e.startState?e.startState(t,_):!0}var Lt=function(e,t,_){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=_};Lt.prototype.eol=function(){return this.pos>=this.string.length},Lt.prototype.sol=function(){return this.pos==this.lineStart},Lt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Lt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Lt.prototype.eat=function(e){var t=this.string.charAt(this.pos),_;if(typeof e=="string"?_=t==e:_=t&&(e.test?e.test(t):e(t)),_)return++this.pos,t},Lt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Lt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Lt.prototype.skipToEnd=function(){this.pos=this.string.length},Lt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Lt.prototype.backUp=function(e){this.pos-=e},Lt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=G(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Lt.prototype.indentation=function(){return G(this.string,null,this.tabSize)-(this.lineStart?G(this.string,this.lineStart,this.tabSize):0)},Lt.prototype.match=function(e,t,_){if(typeof e=="string"){var v=function(V){return _?V.toLowerCase():V},L=this.string.substr(this.pos,e.length);if(v(L)==v(e))return t!==!1&&(this.pos+=e.length),!0}else{var N=this.string.slice(this.pos).match(e);return N&&N.index>0?null:(N&&t!==!1&&(this.pos+=N[0].length),N)}},Lt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Lt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Lt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Lt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function dt(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var _=e;!_.lines;)for(var v=0;;++v){var L=_.children[v],N=L.chunkSize();if(t<N){_=L;break}t-=N}return _.lines[t]}function sr(e,t,_){var v=[],L=t.line;return e.iter(t.line,_.line+1,function(N){var V=N.text;L==_.line&&(V=V.slice(0,_.ch)),L==t.line&&(V=V.slice(t.ch)),v.push(V),++L}),v}function zr(e,t,_){var v=[];return e.iter(t,_,function(L){v.push(L.text)}),v}function _r(e,t){var _=t-e.height;if(_)for(var v=e;v;v=v.parent)v.height+=_}function kt(e){if(e.parent==null)return null;for(var t=e.parent,_=de(t.lines,e),v=t.parent;v;t=v,v=v.parent)for(var L=0;!(v.children[L]==t);++L)_+=v.children[L].chunkSize();return _+t.first}function Lr(e,t){var _=e.first;e:do{for(var v=0;v<e.children.length;++v){var L=e.children[v],N=L.height;if(t<N){e=L;continue e}t-=N,_+=L.chunkSize()}return _}while(!e.lines);for(var V=0;V<e.lines.length;++V){var Q=e.lines[V],q=Q.height;if(t<q)break;t-=q}return _+V}function Pr(e,t){return t>=e.first&&t<e.first+e.size}function Or(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function tt(e,t,_){if(_===void 0&&(_=null),!(this instanceof tt))return new tt(e,t,_);this.line=e,this.ch=t,this.sticky=_}function bt(e,t){return e.line-t.line||e.ch-t.ch}function kr(e,t){return e.sticky==t.sticky&&bt(e,t)==0}function Mr(e){return tt(e.line,e.ch)}function at(e,t){return bt(e,t)<0?t:e}function Gr(e,t){return bt(e,t)<0?e:t}function An(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function _t(e,t){if(t.line<e.first)return tt(e.first,0);var _=e.first+e.size-1;return t.line>_?tt(_,dt(e,_).text.length):hr(t,dt(e,t.line).text.length)}function hr(e,t){var _=e.ch;return _==null||_>t?tt(e.line,t):_<0?tt(e.line,0):e}function Xr(e,t){for(var _=[],v=0;v<t.length;v++)_[v]=_t(e,t[v]);return _}var Vr=function(e,t){this.state=e,this.lookAhead=t},pr=function(e,t,_,v){this.state=t,this.doc=e,this.line=_,this.maxLookAhead=v||0,this.baseTokens=null,this.baseTokenPos=1};pr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pr.fromSaved=function(e,t,_){return t instanceof Vr?new pr(e,It(e.mode,t.state),_,t.lookAhead):new pr(e,It(e.mode,t),_)},pr.prototype.save=function(e){var t=e!==!1?It(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Vr(t,this.maxLookAhead):t};function Ir(e,t,_,v){var L=[e.state.modeGen],N={};Bt(e,t.text,e.doc.mode,_,function(re,ye){return L.push(re,ye)},N,v);for(var V=_.state,Q=function(re){_.baseTokens=L;var ye=e.state.overlays[re],we=1,je=0;_.state=!0,Bt(e,t.text,ye.mode,_,function(He,Qe){for(var Ze=we;je<He;){var nt=L[we];nt>He&&L.splice(we,1,He,L[we+1],nt),we+=2,je=Math.min(He,nt)}if(!Qe)return;if(ye.opaque)L.splice(Ze,we-Ze,He,"overlay "+Qe),we=Ze+2;else for(;Ze<we;Ze+=2){var ot=L[Ze+1];L[Ze+1]=(ot?ot+" ":"")+"overlay "+Qe}},N),_.state=V,_.baseTokens=null,_.baseTokenPos=1},q=0;q<e.state.overlays.length;++q)Q(q);return{styles:L,classes:N.bgClass||N.textClass?N:null}}function gt(e,t,_){if(!t.styles||t.styles[0]!=e.state.modeGen){var v=Ve(e,kt(t)),L=t.text.length>e.options.maxHighlightLength&&It(e.doc.mode,v.state),N=Ir(e,t,v);L&&(v.state=L),t.stateAfter=v.save(!L),t.styles=N.styles,N.classes?t.styleClasses=N.classes:t.styleClasses&&(t.styleClasses=null),_===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ve(e,t,_){var v=e.doc,L=e.display;if(!v.mode.startState)return new pr(v,!0,t);var N=Ln(e,t,_),V=N>v.first&&dt(v,N-1).stateAfter,Q=V?pr.fromSaved(v,V,N):new pr(v,$t(v.mode),N);return v.iter(N,t,function(q){ft(e,q.text,Q);var re=Q.line;q.stateAfter=re==t-1||re%5==0||re>=L.viewFrom&&re<L.viewTo?Q.save():null,Q.nextLine()}),_&&(v.modeFrontier=Q.line),Q}function ft(e,t,_,v){var L=e.doc.mode,N=new Lt(t,e.options.tabSize,_);for(N.start=N.pos=v||0,t==""&&pt(L,_.state);!N.eol();)Mt(L,N,_.state),N.start=N.pos}function pt(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var _=Rt(e,t);if(_.mode.blankLine)return _.mode.blankLine(_.state)}function Mt(e,t,_,v){for(var L=0;L<10;L++){v&&(v[0]=Rt(e,_).mode);var N=e.token(t,_);if(t.pos>t.start)return N}throw new Error("Mode "+e.name+" failed to advance stream.")}var mr=function(e,t,_){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=_};function er(e,t,_,v){var L=e.doc,N=L.mode,V;t=_t(L,t);var Q=dt(L,t.line),q=Ve(e,t.line,_),re=new Lt(Q.text,e.options.tabSize,q),ye;for(v&&(ye=[]);(v||re.pos<t.ch)&&!re.eol();)re.start=re.pos,V=Mt(N,re,q.state),v&&ye.push(new mr(re,V,It(L.mode,q.state)));return v?ye:new mr(re,V,q.state)}function Wt(e,t){if(e)for(;;){var _=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!_)break;e=e.slice(0,_.index)+e.slice(_.index+_[0].length);var v=_[1]?"bgClass":"textClass";t[v]==null?t[v]=_[2]:new RegExp("(?:^|\\s)"+_[2]+"(?:$|\\s)").test(t[v])||(t[v]+=" "+_[2])}return e}function Bt(e,t,_,v,L,N,V){var Q=_.flattenSpans;Q==null&&(Q=e.options.flattenSpans);var q=0,re=null,ye=new Lt(t,e.options.tabSize,v),we,je=e.options.addModeClass&&[null];for(t==""&&Wt(pt(_,v.state),N);!ye.eol();){if(ye.pos>e.options.maxHighlightLength?(Q=!1,V&&ft(e,t,v,ye.pos),ye.pos=t.length,we=null):we=Wt(Mt(_,ye,v.state,je),N),je){var He=je[0].name;He&&(we="m-"+(we?He+" "+we:He))}if(!Q||re!=we){for(;q<ye.start;)q=Math.min(ye.start,q+5e3),L(q,re);re=we}ye.start=ye.pos}for(;q<ye.pos;){var Qe=Math.min(ye.pos,q+5e3);L(Qe,re),q=Qe}}function Ln(e,t,_){for(var v,L,N=e.doc,V=_?-1:t-(e.doc.mode.innerMode?1e3:100),Q=t;Q>V;--Q){if(Q<=N.first)return N.first;var q=dt(N,Q-1),re=q.stateAfter;if(re&&(!_||Q+(re instanceof Vr?re.lookAhead:0)<=N.modeFrontier))return Q;var ye=G(q.text,null,e.options.tabSize);(L==null||v>ye)&&(L=Q-1,v=ye)}return L}function Tr(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontier<t-10)return;for(var _=e.first,v=t-1;v>_;v--){var L=dt(e,v).stateAfter;if(L&&(!(L instanceof Vr)||v+L.lookAhead<t)){_=v+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,_)}var Fr=!1,yr=!1;function Ti(){Fr=!0}function Ci(){yr=!0}function pn(e,t,_){this.marker=e,this.from=t,this.to=_}function rn(e,t){if(e)for(var _=0;_<e.length;++_){var v=e[_];if(v.marker==t)return v}}function $i(e,t){for(var _,v=0;v<e.length;++v)e[v]!=t&&(_||(_=[])).push(e[v]);return _}function Ai(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ka(e,t,_){var v;if(e)for(var L=0;L<e.length;++L){var N=e[L],V=N.marker,Q=N.from==null||(V.inclusiveLeft?N.from<=t:N.from<t);if(Q||N.from==t&&V.type=="bookmark"&&(!_||!N.marker.insertLeft)){var q=N.to==null||(V.inclusiveRight?N.to>=t:N.to>t);(v||(v=[])).push(new pn(V,N.from,q?null:N.to))}}return v}function qn(e,t,_){var v;if(e)for(var L=0;L<e.length;++L){var N=e[L],V=N.marker,Q=N.to==null||(V.inclusiveRight?N.to>=t:N.to>t);if(Q||N.from==t&&V.type=="bookmark"&&(!_||N.marker.insertLeft)){var q=N.from==null||(V.inclusiveLeft?N.from<=t:N.from<t);(v||(v=[])).push(new pn(V,q?null:N.from-t,N.to==null?null:N.to-t))}}return v}function Yr(e,t){if(t.full)return null;var _=Pr(e,t.from.line)&&dt(e,t.from.line).markedSpans,v=Pr(e,t.to.line)&&dt(e,t.to.line).markedSpans;if(!_&&!v)return null;var L=t.from.ch,N=t.to.ch,V=bt(t.from,t.to)==0,Q=Ka(_,L,V),q=qn(v,N,V),re=t.text.length==1,ye=te(t.text).length+(re?L:0);if(Q)for(var we=0;we<Q.length;++we){var je=Q[we];if(je.to==null){var He=rn(q,je.marker);He?re&&(je.to=He.to==null?null:He.to+ye):je.to=L}}if(q)for(var Qe=0;Qe<q.length;++Qe){var Ze=q[Qe];if(Ze.to!=null&&(Ze.to+=ye),Ze.from==null){var nt=rn(Q,Ze.marker);nt||(Ze.from=ye,re&&(Q||(Q=[])).push(Ze))}else Ze.from+=ye,re&&(Q||(Q=[])).push(Ze)}Q&&(Q=kn(Q)),q&&q!=Q&&(q=kn(q));var ot=[Q];if(!re){var ut=t.text.length-2,st;if(ut>0&&Q)for(var ht=0;ht<Q.length;++ht)Q[ht].to==null&&(st||(st=[])).push(new pn(Q[ht].marker,null,null));for(var xt=0;xt<ut;++xt)ot.push(st);ot.push(q)}return ot}function kn(e){for(var t=0;t<e.length;++t){var _=e[t];_.from!=null&&_.from==_.to&&_.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Rn(e,t,_){var v=null;if(e.iter(t.line,_.line+1,function(He){if(He.markedSpans)for(var Qe=0;Qe<He.markedSpans.length;++Qe){var Ze=He.markedSpans[Qe].marker;Ze.readOnly&&(!v||de(v,Ze)==-1)&&(v||(v=[])).push(Ze)}}),!v)return null;for(var L=[{from:t,to:_}],N=0;N<v.length;++N)for(var V=v[N],Q=V.find(0),q=0;q<L.length;++q){var re=L[q];if(bt(re.to,Q.from)<0||bt(re.from,Q.to)>0)continue;var ye=[q,1],we=bt(re.from,Q.from),je=bt(re.to,Q.to);(we<0||!V.inclusiveLeft&&!we)&&ye.push({from:re.from,to:Q.from}),(je>0||!V.inclusiveRight&&!je)&&ye.push({from:Q.to,to:re.to}),L.splice.apply(L,ye),q+=ye.length-3}return L}function mn(e){var t=e.markedSpans;if(!t)return;for(var _=0;_<t.length;++_)t[_].marker.detachLine(e);e.markedSpans=null}function Zn(e,t){if(!t)return;for(var _=0;_<t.length;++_)t[_].marker.attachLine(e);e.markedSpans=t}function gn(e){return e.inclusiveLeft?-1:0}function Qr(e){return e.inclusiveRight?1:0}function $n(e,t){var _=e.lines.length-t.lines.length;if(_!=0)return _;var v=e.find(),L=t.find(),N=bt(v.from,L.from)||gn(e)-gn(t);if(N)return-N;var V=bt(v.to,L.to)||Qr(e)-Qr(t);return V||t.id-e.id}function nn(e,t){var _=yr&&e.markedSpans,v;if(_)for(var L=void 0,N=0;N<_.length;++N)L=_[N],L.marker.collapsed&&(t?L.from:L.to)==null&&(!v||$n(v,L.marker)<0)&&(v=L.marker);return v}function Li(e){return nn(e,!0)}function Dn(e){return nn(e,!1)}function Ji(e,t){var _=yr&&e.markedSpans,v;if(_)for(var L=0;L<_.length;++L){var N=_[L];N.marker.collapsed&&(N.from==null||N.from<t)&&(N.to==null||N.to>t)&&(!v||$n(v,N.marker)<0)&&(v=N.marker)}return v}function ea(e,t,_,v,L){var N=dt(e,t),V=yr&&N.markedSpans;if(V)for(var Q=0;Q<V.length;++Q){var q=V[Q];if(!q.marker.collapsed)continue;var re=q.marker.find(0),ye=bt(re.from,_)||gn(q.marker)-gn(L),we=bt(re.to,v)||Qr(q.marker)-Qr(L);if(ye>=0&&we<=0||ye<=0&&we>=0)continue;if(ye<=0&&(q.marker.inclusiveRight&&L.inclusiveLeft?bt(re.to,_)>=0:bt(re.to,_)>0)||ye>=0&&(q.marker.inclusiveRight&&L.inclusiveLeft?bt(re.from,v)<=0:bt(re.from,v)<0))return!0}}function Nr(e){for(var t;t=Li(e);)e=t.find(-1,!0).line;return e}function Ba(e){for(var t;t=Dn(e);)e=t.find(1,!0).line;return e}function Et(e){for(var t,_;t=Dn(e);)e=t.find(1,!0).line,(_||(_=[])).push(e);return _}function St(e,t){var _=dt(e,t),v=Nr(_);return _==v?t:kt(v)}function wt(e,t){if(t>e.lastLine())return t;var _=dt(e,t),v;if(!Dt(e,_))return t;for(;v=Dn(_);)_=v.find(1,!0).line;return kt(_)+1}function Dt(e,t){var _=yr&&t.markedSpans;if(_)for(var v=void 0,L=0;L<_.length;++L){if(v=_[L],!v.marker.collapsed)continue;if(v.from==null)return!0;if(v.marker.widgetNode)continue;if(v.from==0&&v.marker.inclusiveLeft&&Ft(e,t,v))return!0}}function Ft(e,t,_){if(_.to==null){var v=_.marker.find(1,!0);return Ft(e,v.line,rn(v.line.markedSpans,_.marker))}if(_.marker.inclusiveRight&&_.to==t.text.length)return!0;for(var L=void 0,N=0;N<t.markedSpans.length;++N)if(L=t.markedSpans[N],L.marker.collapsed&&!L.marker.widgetNode&&L.from==_.to&&(L.to==null||L.to!=_.from)&&(L.marker.inclusiveLeft||_.marker.inclusiveRight)&&Ft(e,t,L))return!0}function Xt(e){e=Nr(e);for(var t=0,_=e.parent,v=0;v<_.lines.length;++v){var L=_.lines[v];if(L==e)break;t+=L.height}for(var N=_.parent;N;_=N,N=_.parent)for(var V=0;V<N.children.length;++V){var Q=N.children[V];if(Q==_)break;t+=Q.height}return t}function Gt(e){if(e.height==0)return 0;for(var t=e.text.length,_,v=e;_=Li(v);){var L=_.find(0,!0);v=L.from.line,t+=L.from.ch-L.to.ch}for(v=e;_=Dn(v);){var N=_.find(0,!0);t-=v.text.length-N.from.ch,v=N.to.line,t+=v.text.length-N.to.ch}return t}function tr(e){var t=e.display,_=e.doc;t.maxLine=dt(_,_.first),t.maxLineLength=Gt(t.maxLine),t.maxLineChanged=!0,_.iter(function(v){var L=Gt(v);L>t.maxLineLength&&(t.maxLineLength=L,t.maxLine=v)})}var rr=function(e,t,_){this.text=e,Zn(this,t),this.height=_?_(this):1};rr.prototype.lineNo=function(){return kt(this)},le(rr);function qr(e,t,_,v){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),mn(e),Zn(e,_);var L=v?v(e):1;L!=e.height&&_r(e,L)}function Qt(e){e.parent=null,mn(e)}var an={},cr={};function Zr(e,t){if(!e||/^\s*$/.test(e))return null;var _=t.addModeClass?cr:an;return _[e]||(_[e]=e.replace(/\S+/g,"cm-$&"))}function $r(e,t){var _=M("span",null,null,p?"padding-right: .1px":null),v={pre:M("pre",[_],"CodeMirror-line"),content:_,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var L=0;L<=(t.rest?t.rest.length:0);L++){var N=L?t.rest[L-1]:t.line,V=void 0;v.pos=0,v.addToken=Ts,Ke(e.display.measure)&&(V=We(N,e.doc.direction))&&(v.addToken=As(v.addToken,V)),v.map=[];var Q=t!=e.display.externalMeasured&&kt(N);Ls(N,v,gt(e,N,Q)),N.styleClasses&&(N.styleClasses.bgClass&&(v.bgClass=F(N.styleClasses.bgClass,v.bgClass||"")),N.styleClasses.textClass&&(v.textClass=F(N.styleClasses.textClass,v.textClass||""))),v.map.length==0&&v.map.push(0,0,v.content.appendChild(se(e.display.measure))),L==0?(t.measure.map=v.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(v.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(p){var q=v.content.lastChild;(/\bcm-tab\b/.test(q.className)||q.querySelector&&q.querySelector(".cm-tab"))&&(v.content.className="cm-tab-wrap-hack")}return xe(e,"renderLine",e,t.line,v.pre),v.pre.className&&(v.textClass=F(v.pre.className,v.textClass||"")),v}function Jn(e){var t=g("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Ts(e,t,_,v,L,N,V){if(!t)return;var Q=e.splitSpaces?Cs(t,e.trailingSpace):t,q=e.cm.state.specialChars,re=!1,ye;if(!q.test(t))e.col+=t.length,ye=document.createTextNode(Q),e.map.push(e.pos,e.pos+t.length,ye),E&&y<9&&(re=!0),e.pos+=t.length;else{ye=document.createDocumentFragment();for(var we=0;;){q.lastIndex=we;var je=q.exec(t),He=je?je.index-we:t.length-we;if(He){var Qe=document.createTextNode(Q.slice(we,we+He));E&&y<9?ye.appendChild(g("span",[Qe])):ye.appendChild(Qe),e.map.push(e.pos,e.pos+He,Qe),e.col+=He,e.pos+=He}if(!je)break;we+=He+1;var Ze=void 0;if(je[0]==" "){var nt=e.cm.options.tabSize,ot=nt-e.col%nt;Ze=ye.appendChild(g("span",ke(ot),"cm-tab")),Ze.setAttribute("role","presentation"),Ze.setAttribute("cm-text"," "),e.col+=ot}else je[0]=="\r"||je[0]==`
|
|
|
`?(Ze=ye.appendChild(g("span",je[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Ze.setAttribute("cm-text",je[0]),e.col+=1):(Ze=e.cm.options.specialCharPlaceholder(je[0]),Ze.setAttribute("cm-text",je[0]),E&&y<9?ye.appendChild(g("span",[Ze])):ye.appendChild(Ze),e.col+=1);e.map.push(e.pos,e.pos+1,Ze),e.pos++}}if(e.trailingSpace=Q.charCodeAt(t.length-1)==32,_||v||L||re||N||V){var ut=_||"";v&&(ut+=v),L&&(ut+=L);var st=g("span",[ye],ut,N);if(V)for(var ht in V)V.hasOwnProperty(ht)&&ht!="style"&&ht!="class"&&st.setAttribute(ht,V[ht]);return e.content.appendChild(st)}e.content.appendChild(ye)}function Cs(e,t){if(e.length>1&&!/ /.test(e))return e;for(var _=t,v="",L=0;L<e.length;L++){var N=e.charAt(L);N==" "&&_&&(L==e.length-1||e.charCodeAt(L+1)==32)&&(N="\xA0"),v+=N,_=N==" "}return v}function As(e,t){return function(_,v,L,N,V,Q,q){L=L?L+" cm-force-border":"cm-force-border";for(var re=_.pos,ye=re+v.length;;){for(var we=void 0,je=0;je<t.length&&!(we=t[je],we.to>re&&we.from<=re);je++);if(we.to>=ye)return e(_,v,L,N,V,Q,q);e(_,v.slice(0,we.to-re),L,N,null,Q,q),N=null,v=v.slice(we.to-re),re=we.to}}}function Xa(e,t,_,v){var L=!v&&_.widgetNode;L&&e.map.push(e.pos,e.pos+t,L),!v&&e.cm.display.input.needsContentAttribute&&(L||(L=e.content.appendChild(document.createElement("span"))),L.setAttribute("cm-marker",_.id)),L&&(e.cm.display.input.setUneditable(L),e.content.appendChild(L)),e.pos+=t,e.trailingSpace=!1}function Ls(e,t,_){var v=e.markedSpans,L=e.text,N=0;if(!v){for(var V=1;V<_.length;V+=2)t.addToken(t,L.slice(N,N=_[V]),Zr(_[V+1],t.cm.options));return}for(var Q=L.length,q=0,re=1,ye="",we,je,He=0,Qe,Ze,nt,ot,ut;;){if(He==q){Qe=Ze=nt=je="",ut=null,ot=null,He=Infinity;for(var st=[],ht=void 0,xt=0;xt<v.length;++xt){var mt=v[xt],At=mt.marker;if(At.type=="bookmark"&&mt.from==q&&At.widgetNode)st.push(At);else if(mt.from<=q&&(mt.to==null||mt.to>q||At.collapsed&&mt.to==q&&mt.from==q)){if(mt.to!=null&&mt.to!=q&&He>mt.to&&(He=mt.to,Ze=""),At.className&&(Qe+=" "+At.className),At.css&&(je=(je?je+";":"")+At.css),At.startStyle&&mt.from==q&&(nt+=" "+At.startStyle),At.endStyle&&mt.to==He&&(ht||(ht=[])).push(At.endStyle,mt.to),At.title&&((ut||(ut={})).title=At.title),At.attributes)for(var Kt in At.attributes)(ut||(ut={}))[Kt]=At.attributes[Kt];At.collapsed&&(!ot||$n(ot.marker,At)<0)&&(ot=mt)}else mt.from>q&&He>mt.from&&(He=mt.from)}if(ht)for(var ar=0;ar<ht.length;ar+=2)ht[ar+1]==He&&(Ze+=" "+ht[ar]);if(!ot||ot.from==q)for(var zt=0;zt<st.length;++zt)Xa(t,0,st[zt]);if(ot&&(ot.from||0)==q){if(Xa(t,(ot.to==null?Q+1:ot.to)-q,ot.marker,ot.from==null),ot.to==null)return;ot.to==q&&(ot=!1)}}if(q>=Q)break;for(var Ar=Math.min(Q,He);;){if(ye){var Er=q+ye.length;if(!ot){var qt=Er>Ar?ye.slice(0,Ar-q):ye;t.addToken(t,qt,we?we+Qe:Qe,nt,q+qt.length==He?Ze:"",je,ut)}if(Er>=Ar){ye=ye.slice(Ar-q),q=Ar;break}q=Er,nt=""}ye=L.slice(N,N=_[re++]),we=Zr(_[re++],t.cm.options)}}}function Ha(e,t,_){this.line=t,this.rest=Et(t),this.size=this.rest?kt(te(this.rest))-_+1:1,this.node=this.text=null,this.hidden=Dt(e,t)}function ki(e,t,_){for(var v=[],L,N=t;N<_;N=L){var V=new Ha(e.doc,dt(e.doc,N),N);L=N+V.size,v.push(V)}return v}var On=null;function ks(e){On?On.ops.push(e):e.ownsGroup=On={ops:[e],delayedCallbacks:[]}}function Rs(e){var t=e.delayedCallbacks,_=0;do{for(;_<t.length;_++)t[_].call(null);for(var v=0;v<e.ops.length;v++){var L=e.ops[v];if(L.cursorActivityHandlers)for(;L.cursorActivityCalled<L.cursorActivityHandlers.length;)L.cursorActivityHandlers[L.cursorActivityCalled++].call(null,L.cm)}}while(_<t.length)}function Ds(e,t){var _=e.ownsGroup;if(!_)return;try{Rs(_)}finally{On=null,t(_)}}var ei=null;function lr(e,t){var _=et(e,t);if(!_.length)return;var v=Array.prototype.slice.call(arguments,2),L;On?L=On.delayedCallbacks:ei?L=ei:(L=ei=[],setTimeout(Os,0));for(var N=function(Q){L.push(function(){return _[Q].apply(null,v)})},V=0;V<_.length;++V)N(V)}function Os(){var e=ei;ei=null;for(var t=0;t<e.length;++t)e[t]()}function ja(e,t,_,v){for(var L=0;L<t.changes.length;L++){var N=t.changes[L];N=="text"?Is(e,t):N=="gutter"?za(e,t,_,v):N=="class"?ta(e,t):N=="widget"&&Ps(e,t,v)}t.changes=null}function ti(e){return e.node==e.text&&(e.node=g("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),E&&y<8&&(e.node.style.zIndex=2)),e.node}function Ms(e,t){var _=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(_&&(_+=" CodeMirror-linebackground"),t.background)_?t.background.className=_:(t.background.parentNode.removeChild(t.background),t.background=null);else if(_){var v=ti(t);t.background=v.insertBefore(g("div",null,_),v.firstChild),e.display.input.setUneditable(t.background)}}function Wa(e,t){var _=e.display.externalMeasured;return _&&_.line==t.line?(e.display.externalMeasured=null,t.measure=_.measure,_.built):$r(e,t)}function Is(e,t){var _=t.text.className,v=Wa(e,t);t.text==t.node&&(t.node=v.pre),t.text.parentNode.replaceChild(v.pre,t.text),t.text=v.pre,v.bgClass!=t.bgClass||v.textClass!=t.textClass?(t.bgClass=v.bgClass,t.textClass=v.textClass,ta(e,t)):_&&(t.text.className=_)}function ta(e,t){Ms(e,t),t.line.wrapClass?ti(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var _=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=_||""}function za(e,t,_,v){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var L=ti(t);t.gutterBackground=g("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?v.fixedPos:-v.gutterTotalWidth)+"px; width: "+v.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),L.insertBefore(t.gutterBackground,t.text)}var N=t.line.gutterMarkers;if(e.options.lineNumbers||N){var V=ti(t),Q=t.gutter=g("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?v.fixedPos:-v.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Q),V.insertBefore(Q,t.text),t.line.gutterClass&&(Q.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!N||!N["CodeMirror-linenumbers"])&&(t.lineNumber=Q.appendChild(g("div",Or(e.options,_),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+v.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),N)for(var q=0;q<e.display.gutterSpecs.length;++q){var re=e.display.gutterSpecs[q].className,ye=N.hasOwnProperty(re)&&N[re];ye&&Q.appendChild(g("div",[ye],"CodeMirror-gutter-elt","left: "+v.gutterLeft[re]+"px; width: "+v.gutterWidth[re]+"px"))}}}function Ps(e,t,_){t.alignable&&(t.alignable=null);for(var v=x("CodeMirror-linewidget"),L=t.node.firstChild,N=void 0;L;L=N)N=L.nextSibling,v.test(L.className)&&t.node.removeChild(L);Ga(e,t,_)}function Fs(e,t,_,v){var L=Wa(e,t);return t.text=t.node=L.pre,L.bgClass&&(t.bgClass=L.bgClass),L.textClass&&(t.textClass=L.textClass),ta(e,t),za(e,t,_,v),Ga(e,t,v),t.node}function Ga(e,t,_){if(Va(e,t.line,t,_,!0),t.rest)for(var v=0;v<t.rest.length;v++)Va(e,t.rest[v],t,_,!1)}function Va(e,t,_,v,L){if(!t.widgets)return;for(var N=ti(_),V=0,Q=t.widgets;V<Q.length;++V){var q=Q[V],re=g("div",[q.node],"CodeMirror-linewidget"+(q.className?" "+q.className:""));q.handleMouseEvents||re.setAttribute("cm-ignore-events","true"),Ns(q,re,_,v),e.display.input.setUneditable(re),L&&q.above?N.insertBefore(re,_.gutter||_.text):N.appendChild(re),lr(q,"redraw")}}function Ns(e,t,_,v){if(e.noHScroll){(_.alignable||(_.alignable=[])).push(t);var L=v.wrapperWidth;t.style.left=v.fixedPos+"px",e.coverGutter||(L-=v.gutterTotalWidth,t.style.paddingLeft=v.gutterTotalWidth+"px"),t.style.width=L+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-v.gutterTotalWidth+"px"))}function ri(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!P(document.body,e.node)){var _="position: relative;";e.coverGutter&&(_+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(_+="width: "+t.display.wrapper.clientWidth+"px;"),C(t.display.measure,g("div",[e.node],null,_))}return e.height=e.node.parentNode.offsetHeight}function Jr(e,t){for(var _=Ce(t);_!=e.wrapper;_=_.parentNode)if(!_||_.nodeType==1&&_.getAttribute("cm-ignore-events")=="true"||_.parentNode==e.sizer&&_!=e.mover)return!0}function Ri(e){return e.lineSpace.offsetTop}function ra(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ya(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=C(e.measure,g("pre","x","CodeMirror-line-like")),_=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,v={left:parseInt(_.paddingLeft),right:parseInt(_.paddingRight)};return!isNaN(v.left)&&!isNaN(v.right)&&(e.cachedPaddingH=v),v}function Hr(e){return ge-e.display.nativeBarWidth}function vn(e){return e.display.scroller.clientWidth-Hr(e)-e.display.barWidth}function na(e){return e.display.scroller.clientHeight-Hr(e)-e.display.barHeight}function Us(e,t,_){var v=e.options.lineWrapping,L=v&&vn(e);if(!t.measure.heights||v&&t.measure.width!=L){var N=t.measure.heights=[];if(v){t.measure.width=L;for(var V=t.text.firstChild.getClientRects(),Q=0;Q<V.length-1;Q++){var q=V[Q],re=V[Q+1];Math.abs(q.bottom-re.bottom)>2&&N.push((q.bottom+re.top)/2-_.top)}}N.push(_.bottom-_.top)}}function Qa(e,t,_){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var v=0;v<e.rest.length;v++)if(e.rest[v]==t)return{map:e.measure.maps[v],cache:e.measure.caches[v]};for(var L=0;L<e.rest.length;L++)if(kt(e.rest[L])>_)return{map:e.measure.maps[L],cache:e.measure.caches[L],before:!0}}function Ks(e,t){t=Nr(t);var _=kt(t),v=e.display.externalMeasured=new Ha(e.doc,t,_);v.lineN=_;var L=v.built=$r(e,v);return v.text=L.pre,C(e.display.lineMeasure,L.pre),v}function qa(e,t,_,v){return jr(e,Mn(e,t),_,v)}function ia(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[bn(e,t)];var _=e.display.externalMeasured;if(_&&t>=_.lineN&&t<_.lineN+_.size)return _}function Mn(e,t){var _=kt(t),v=ia(e,_);v&&!v.text?v=null:v&&v.changes&&(ja(e,v,_,ca(e)),e.curOp.forceUpdate=!0),v||(v=Ks(e,t));var L=Qa(v,t,_);return{line:t,view:v,rect:null,map:L.map,cache:L.cache,before:L.before,hasHeights:!1}}function jr(e,t,_,v,L){t.before&&(_=-1);var N=_+(v||""),V;return t.cache.hasOwnProperty(N)?V=t.cache[N]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Us(e,t.view,t.rect),t.hasHeights=!0),V=Xs(e,t,_,v),V.bogus||(t.cache[N]=V)),{left:V.left,right:V.right,top:L?V.rtop:V.top,bottom:L?V.rbottom:V.bottom}}var Za={left:0,right:0,top:0,bottom:0};function $a(e,t,_){for(var v,L,N,V,Q,q,re=0;re<e.length;re+=3)if(Q=e[re],q=e[re+1],t<Q?(L=0,N=1,V="left"):t<q?(L=t-Q,N=L+1):(re==e.length-3||t==q&&e[re+3]>t)&&(N=q-Q,L=N-1,t>=q&&(V="right")),L!=null){if(v=e[re+2],Q==q&&_==(v.insertLeft?"left":"right")&&(V=_),_=="left"&&L==0)for(;re&&e[re-2]==e[re-3]&&e[re-1].insertLeft;)v=e[(re-=3)+2],V="left";if(_=="right"&&L==q-Q)for(;re<e.length-3&&e[re+3]==e[re+4]&&!e[re+5].insertLeft;)v=e[(re+=3)+2],V="right";break}return{node:v,start:L,end:N,collapse:V,coverStart:Q,coverEnd:q}}function Bs(e,t){var _=Za;if(t=="left")for(var v=0;v<e.length&&!((_=e[v]).left!=_.right);v++);else for(var L=e.length-1;L>=0&&!((_=e[L]).left!=_.right);L--);return _}function Xs(e,t,_,v){var L=$a(t.map,_,v),N=L.node,V=L.start,Q=L.end,q=L.collapse,re;if(N.nodeType==3){for(var ye=0;ye<4;ye++){for(;V&&Se(t.line.text.charAt(L.coverStart+V));)--V;for(;L.coverStart+Q<L.coverEnd&&Se(t.line.text.charAt(L.coverStart+Q));)++Q;if(E&&y<9&&V==0&&Q==L.coverEnd-L.coverStart?re=N.parentNode.getBoundingClientRect():re=Bs(I(N,V,Q).getClientRects(),v),re.left||re.right||V==0)break;Q=V,V=V-1,q="right"}E&&y<11&&(re=Hs(e.display.measure,re))}else{V>0&&(q=v="right");var we;e.options.lineWrapping&&(we=N.getClientRects()).length>1?re=we[v=="right"?we.length-1:0]:re=N.getBoundingClientRect()}if(E&&y<9&&!V&&(!re||!re.left&&!re.right)){var je=N.parentNode.getClientRects()[0];je?re={left:je.left,right:je.left+Pn(e.display),top:je.top,bottom:je.bottom}:re=Za}for(var He=re.top-t.rect.top,Qe=re.bottom-t.rect.top,Ze=(He+Qe)/2,nt=t.view.measure.heights,ot=0;ot<nt.length-1&&!(Ze<nt[ot]);ot++);var ut=ot?nt[ot-1]:0,st=nt[ot],ht={left:(q=="right"?re.right:re.left)-t.rect.left,right:(q=="left"?re.left:re.right)-t.rect.left,top:ut,bottom:st};return!re.left&&!re.right&&(ht.bogus=!0),e.options.singleCursorHeightPerLine||(ht.rtop=He,ht.rbottom=Qe),ht}function Hs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!vt(e))return t;var _=screen.logicalXDPI/screen.deviceXDPI,v=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*_,right:t.right*_,top:t.top*v,bottom:t.bottom*v}}function Ja(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function eo(e){e.display.externalMeasure=null,S(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ja(e.display.view[t])}function ni(e){eo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function to(){return o&&a?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ro(){return o&&a?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function aa(e){var t=0;if(e.widgets)for(var _=0;_<e.widgets.length;++_)e.widgets[_].above&&(t+=ri(e.widgets[_]));return t}function Di(e,t,_,v,L){if(!L){var N=aa(t);_.top+=N,_.bottom+=N}if(v=="line")return _;v||(v="local");var V=Xt(t);if(v=="local"?V+=Ri(e.display):V-=e.display.viewOffset,v=="page"||v=="window"){var Q=e.display.lineSpace.getBoundingClientRect();V+=Q.top+(v=="window"?0:ro());var q=Q.left+(v=="window"?0:to());_.left+=q,_.right+=q}return _.top+=V,_.bottom+=V,_}function no(e,t,_){if(_=="div")return t;var v=t.left,L=t.top;if(_=="page")v-=to(),L-=ro();else if(_=="local"||!_){var N=e.display.sizer.getBoundingClientRect();v+=N.left,L+=N.top}var V=e.display.lineSpace.getBoundingClientRect();return{left:v-V.left,top:L-V.top}}function oa(e,t,_,v,L){return v||(v=dt(e.doc,t.line)),Di(e,v,qa(e,v,t.ch,L),_)}function Ur(e,t,_,v,L,N){v=v||dt(e.doc,t.line),L||(L=Mn(e,v));function V(Qe,Ze){var nt=jr(e,L,Qe,Ze?"right":"left",N);return Ze?nt.left=nt.right:nt.right=nt.left,Di(e,v,nt,_)}var Q=We(v,e.doc.direction),q=t.ch,re=t.sticky;if(q>=v.text.length?(q=v.text.length,re="before"):q<=0&&(q=0,re="after"),!Q)return V(re=="before"?q-1:q,re=="before");function ye(Qe,Ze,nt){var ot=Q[Ze],ut=ot.level==1;return V(nt?Qe-1:Qe,ut!=nt)}var we=J(Q,q,re),je=fe,He=ye(q,we,re=="before");return je!=null&&(He.other=ye(q,je,re!="before")),He}function io(e,t){var _=0;t=_t(e.doc,t),e.options.lineWrapping||(_=Pn(e.display)*t.ch);var v=dt(e.doc,t.line),L=Xt(v)+Ri(e.display);return{left:_,right:_,top:L,bottom:L+v.height}}function sa(e,t,_,v,L){var N=tt(e,t,_);return N.xRel=L,v&&(N.outside=v),N}function la(e,t,_){var v=e.doc;if(_+=e.display.viewOffset,_<0)return sa(v.first,0,null,-1,-1);var L=Lr(v,_),N=v.first+v.size-1;if(L>N)return sa(v.first+v.size-1,dt(v,N).text.length,null,1,1);t<0&&(t=0);for(var V=dt(v,L);;){var Q=js(e,V,L,t,_),q=Ji(V,Q.ch+(Q.xRel>0||Q.outside>0?1:0));if(!q)return Q;var re=q.find(1);if(re.line==L)return re;V=dt(v,L=re.line)}}function ao(e,t,_,v){v-=aa(t);var L=t.text.length,N=Ee(function(V){return jr(e,_,V-1).bottom<=v},L,0);return L=Ee(function(V){return jr(e,_,V).top>v},N,L),{begin:N,end:L}}function oo(e,t,_,v){_||(_=Mn(e,t));var L=Di(e,t,jr(e,_,v),"line").top;return ao(e,t,_,L)}function ua(e,t,_,v){return e.bottom<=_?!1:e.top>_?!0:(v?e.left:e.right)>t}function js(e,t,_,v,L){L-=Xt(t);var N=Mn(e,t),V=aa(t),Q=0,q=t.text.length,re=!0,ye=We(t,e.doc.direction);if(ye){var we=(e.options.lineWrapping?zs:Ws)(e,t,_,N,ye,v,L);re=we.level!=1,Q=re?we.from:we.to-1,q=re?we.to:we.from-1}var je=null,He=null,Qe=Ee(function(xt){var mt=jr(e,N,xt);return mt.top+=V,mt.bottom+=V,ua(mt,v,L,!1)?(mt.top<=L&&mt.left<=v&&(je=xt,He=mt),!0):!1},Q,q),Ze,nt,ot=!1;if(He){var ut=v-He.left<He.right-v,st=ut==re;Qe=je+(st?0:1),nt=st?"after":"before",Ze=ut?He.left:He.right}else{!re&&(Qe==q||Qe==Q)&&Qe++,nt=Qe==0?"after":Qe==t.text.length?"before":jr(e,N,Qe-(re?1:0)).bottom+V<=L==re?"after":"before";var ht=Ur(e,tt(_,Qe,nt),"line",t,N);Ze=ht.left,ot=L<ht.top?-1:L>=ht.bottom?1:0}return Qe=Te(t.text,Qe,1),sa(_,Qe,nt,ot,v-Ze)}function Ws(e,t,_,v,L,N,V){var Q=Ee(function(we){var je=L[we],He=je.level!=1;return ua(Ur(e,tt(_,He?je.to:je.from,He?"before":"after"),"line",t,v),N,V,!0)},0,L.length-1),q=L[Q];if(Q>0){var re=q.level!=1,ye=Ur(e,tt(_,re?q.from:q.to,re?"after":"before"),"line",t,v);ua(ye,N,V,!0)&&ye.top>V&&(q=L[Q-1])}return q}function zs(e,t,_,v,L,N,V){var Q=ao(e,t,v,V),q=Q.begin,re=Q.end;/\s/.test(t.text.charAt(re-1))&&re--;for(var ye=null,we=null,je=0;je<L.length;je++){var He=L[je];if(He.from>=re||He.to<=q)continue;var Qe=He.level!=1,Ze=jr(e,v,Qe?Math.min(re,He.to)-1:Math.max(q,He.from)).right,nt=Ze<N?N-Ze+1e9:Ze-N;(!ye||we>nt)&&(ye=He,we=nt)}return ye||(ye=L[L.length-1]),ye.from<q&&(ye={from:q,to:ye.to,level:ye.level}),ye.to>re&&(ye={from:ye.from,to:re,level:ye.level}),ye}var _n;function In(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(_n==null){_n=g("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)_n.appendChild(document.createTextNode("x")),_n.appendChild(g("br"));_n.appendChild(document.createTextNode("x"))}C(e.measure,_n);var _=_n.offsetHeight/50;return _>3&&(e.cachedTextHeight=_),S(e.measure),_||1}function Pn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=g("span","xxxxxxxxxx"),_=g("pre",[t],"CodeMirror-line-like");C(e.measure,_);var v=t.getBoundingClientRect(),L=(v.right-v.left)/10;return L>2&&(e.cachedCharWidth=L),L||10}function ca(e){for(var t=e.display,_={},v={},L=t.gutters.clientLeft,N=t.gutters.firstChild,V=0;N;N=N.nextSibling,++V){var Q=e.display.gutterSpecs[V].className;_[Q]=N.offsetLeft+N.clientLeft+L,v[Q]=N.clientWidth}return{fixedPos:da(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:_,gutterWidth:v,wrapperWidth:t.wrapper.clientWidth}}function da(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function so(e){var t=In(e.display),_=e.options.lineWrapping,v=_&&Math.max(5,e.display.scroller.clientWidth/Pn(e.display)-3);return function(L){if(Dt(e.doc,L))return 0;var N=0;if(L.widgets)for(var V=0;V<L.widgets.length;V++)L.widgets[V].height&&(N+=L.widgets[V].height);return _?N+(Math.ceil(L.text.length/v)||1)*t:N+t}}function fa(e){var t=e.doc,_=so(e);t.iter(function(v){var L=_(v);L!=v.height&&_r(v,L)})}function yn(e,t,_,v){var L=e.display;if(!_&&Ce(t).getAttribute("cm-not-content")=="true")return null;var N,V,Q=L.lineSpace.getBoundingClientRect();try{N=t.clientX-Q.left,V=t.clientY-Q.top}catch(we){return null}var q=la(e,N,V),re;if(v&&q.xRel>0&&(re=dt(e.doc,q.line).text).length==q.ch){var ye=G(re,re.length,e.options.tabSize)-re.length;q=tt(q.line,Math.max(0,Math.round((N-Ya(e.display).left)/Pn(e.display))-ye))}return q}function bn(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var _=e.display.view,v=0;v<_.length;v++)if(t-=_[v].size,t<0)return v}function br(e,t,_,v){t==null&&(t=e.doc.first),_==null&&(_=e.doc.first+e.doc.size),v||(v=0);var L=e.display;if(v&&_<L.viewTo&&(L.updateLineNumbers==null||L.updateLineNumbers>t)&&(L.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=L.viewTo)yr&&St(e.doc,t)<L.viewTo&&sn(e);else if(_<=L.viewFrom)yr&&wt(e.doc,_+v)>L.viewFrom?sn(e):(L.viewFrom+=v,L.viewTo+=v);else if(t<=L.viewFrom&&_>=L.viewTo)sn(e);else if(t<=L.viewFrom){var N=Oi(e,_,_+v,1);N?(L.view=L.view.slice(N.index),L.viewFrom=N.lineN,L.viewTo+=v):sn(e)}else if(_>=L.viewTo){var V=Oi(e,t,t,-1);V?(L.view=L.view.slice(0,V.index),L.viewTo=V.lineN):sn(e)}else{var Q=Oi(e,t,t,-1),q=Oi(e,_,_+v,1);Q&&q?(L.view=L.view.slice(0,Q.index).concat(ki(e,Q.lineN,q.lineN)).concat(L.view.slice(q.index)),L.viewTo+=v):sn(e)}var re=L.externalMeasured;re&&(_<re.lineN?re.lineN+=v:t<re.lineN+re.size&&(L.externalMeasured=null))}function on(e,t,_){e.curOp.viewChanged=!0;var v=e.display,L=e.display.externalMeasured;if(L&&t>=L.lineN&&t<L.lineN+L.size&&(v.externalMeasured=null),t<v.viewFrom||t>=v.viewTo)return;var N=v.view[bn(e,t)];if(N.node==null)return;var V=N.changes||(N.changes=[]);de(V,_)==-1&&V.push(_)}function sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oi(e,t,_,v){var L=bn(e,t),N,V=e.display.view;if(!yr||_==e.doc.first+e.doc.size)return{index:L,lineN:_};for(var Q=e.display.viewFrom,q=0;q<L;q++)Q+=V[q].size;if(Q!=t){if(v>0){if(L==V.length-1)return null;N=Q+V[L].size-t,L++}else N=Q-t;t+=N,_+=N}for(;St(e.doc,_)!=_;){if(L==(v<0?0:V.length-1))return null;_+=v*V[L-(v<0?1:0)].size,L+=v}return{index:L,lineN:_}}function Gs(e,t,_){var v=e.display,L=v.view;L.length==0||t>=v.viewTo||_<=v.viewFrom?(v.view=ki(e,t,_),v.viewFrom=t):(v.viewFrom>t?v.view=ki(e,t,v.viewFrom).concat(v.view):v.viewFrom<t&&(v.view=v.view.slice(bn(e,t))),v.viewFrom=t,v.viewTo<_?v.view=v.view.concat(ki(e,v.viewTo,_)):v.viewTo>_&&(v.view=v.view.slice(0,bn(e,_)))),v.viewTo=_}function lo(e){for(var t=e.display.view,_=0,v=0;v<t.length;v++){var L=t[v];!L.hidden&&(!L.node||L.changes)&&++_}return _}function ii(e){e.display.input.showSelection(e.display.input.prepareSelection())}function uo(e,t){t===void 0&&(t=!0);for(var _=e.doc,v={},L=v.cursors=document.createDocumentFragment(),N=v.selection=document.createDocumentFragment(),V=0;V<_.sel.ranges.length;V++){if(!t&&V==_.sel.primIndex)continue;var Q=_.sel.ranges[V];if(Q.from().line>=e.display.viewTo||Q.to().line<e.display.viewFrom)continue;var q=Q.empty();(q||e.options.showCursorWhenSelecting)&&co(e,Q.head,L),q||Vs(e,Q,N)}return v}function co(e,t,_){var v=Ur(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),L=_.appendChild(g("div","\xA0","CodeMirror-cursor"));if(L.style.left=v.left+"px",L.style.top=v.top+"px",L.style.height=Math.max(0,v.bottom-v.top)*e.options.cursorHeight+"px",v.other){var N=_.appendChild(g("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));N.style.display="",N.style.left=v.other.left+"px",N.style.top=v.other.top+"px",N.style.height=(v.other.bottom-v.other.top)*.85+"px"}}function Mi(e,t){return e.top-t.top||e.left-t.left}function Vs(e,t,_){var v=e.display,L=e.doc,N=document.createDocumentFragment(),V=Ya(e.display),Q=V.left,q=Math.max(v.sizerWidth,vn(e)-v.sizer.offsetLeft)-V.right,re=L.direction=="ltr";function ye(st,ht,xt,mt){ht<0&&(ht=0),ht=Math.round(ht),mt=Math.round(mt),N.appendChild(g("div",null,"CodeMirror-selected","position: absolute; left: "+st+`px;
|
|
|
top: `+ht+"px; width: "+(xt==null?q-st:xt)+`px;
|
|
|
height: `+(mt-ht)+"px"))}function we(st,ht,xt){var mt=dt(L,st),At=mt.text.length,Kt,ar;function zt(qt,Sr){return oa(e,tt(st,qt),"div",mt,Sr)}function Ar(qt,Sr,ur){var Jt=oo(e,mt,null,qt),Zt=Sr=="ltr"==(ur=="after")?"left":"right",Vt=ur=="after"?Jt.begin:Jt.end-(/\s/.test(mt.text.charAt(Jt.end-1))?2:1);return zt(Vt,Zt)[Zt]}var Er=We(mt,L.direction);return $(Er,ht||0,xt==null?At:xt,function(qt,Sr,ur,Jt){var Zt=ur=="ltr",Vt=zt(qt,Zt?"left":"right"),wr=zt(Sr-1,Zt?"right":"left"),Yn=ht==null&&qt==0,hn=xt==null&&Sr==At,fr=Jt==0,Wr=!Er||Jt==Er.length-1;if(wr.top-Vt.top<=3){var or=(re?Yn:hn)&&fr,Na=(re?hn:Yn)&&Wr,tn=or?Q:(Zt?Vt:wr).left,Tn=Na?q:(Zt?wr:Vt).right;ye(tn,Vt.top,Tn-tn,Vt.bottom)}else{var Cn,vr,Qn,Ua;Zt?(Cn=re&&Yn&&fr?Q:Vt.left,vr=re?q:Ar(qt,ur,"before"),Qn=re?Q:Ar(Sr,ur,"after"),Ua=re&&hn&&Wr?q:wr.right):(Cn=re?Ar(qt,ur,"before"):Q,vr=!re&&Yn&&fr?q:Vt.right,Qn=!re&&hn&&Wr?Q:wr.left,Ua=re?Ar(Sr,ur,"after"):q),ye(Cn,Vt.top,vr-Cn,Vt.bottom),Vt.bottom<wr.top&&ye(Q,Vt.bottom,null,wr.top),ye(Qn,wr.top,Ua-Qn,wr.bottom)}(!Kt||Mi(Vt,Kt)<0)&&(Kt=Vt),Mi(wr,Kt)<0&&(Kt=wr),(!ar||Mi(Vt,ar)<0)&&(ar=Vt),Mi(wr,ar)<0&&(ar=wr)}),{start:Kt,end:ar}}var je=t.from(),He=t.to();if(je.line==He.line)we(je.line,je.ch,He.ch);else{var Qe=dt(L,je.line),Ze=dt(L,He.line),nt=Nr(Qe)==Nr(Ze),ot=we(je.line,je.ch,nt?Qe.text.length+1:null).end,ut=we(He.line,nt?0:null,He.ch).start;nt&&(ot.top<ut.top-2?(ye(ot.right,ot.top,null,ot.bottom),ye(Q,ut.top,ut.left,ut.bottom)):ye(ot.right,ot.top,ut.left-ot.right,ot.bottom)),ot.bottom<ut.top&&ye(Q,ot.bottom,null,ut.top)}_.appendChild(N)}function ha(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var _=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Fn(e),t.cursorDiv.style.visibility=(_=!_)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function fo(e){e.state.focused||(e.display.input.focus(),pa(e))}function ho(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Fn(e))},100)}function pa(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(xe(e,"focus",e,t),e.state.focused=!0,H(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),p&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ha(e)}function Fn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(xe(e,"blur",e,t),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ii(e){for(var t=e.display,_=t.lineDiv.offsetTop,v=0;v<t.view.length;v++){var L=t.view[v],N=e.options.lineWrapping,V=void 0,Q=0;if(L.hidden)continue;if(E&&y<8){var q=L.node.offsetTop+L.node.offsetHeight;V=q-_,_=q}else{var re=L.node.getBoundingClientRect();V=re.bottom-re.top,!N&&L.text.firstChild&&(Q=L.text.firstChild.getBoundingClientRect().right-re.left-1)}var ye=L.line.height-V;if((ye>.005||ye<-.005)&&(_r(L.line,V),po(L.line),L.rest))for(var we=0;we<L.rest.length;we++)po(L.rest[we]);if(Q>e.display.sizerWidth){var je=Math.ceil(Q/Pn(e.display));je>e.display.maxLineLength&&(e.display.maxLineLength=je,e.display.maxLine=L.line,e.display.maxLineChanged=!0)}}}function po(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var _=e.widgets[t],v=_.node.parentNode;v&&(_.height=v.offsetHeight)}}function Pi(e,t,_){var v=_&&_.top!=null?Math.max(0,_.top):e.scroller.scrollTop;v=Math.floor(v-Ri(e));var L=_&&_.bottom!=null?_.bottom:v+e.wrapper.clientHeight,N=Lr(t,v),V=Lr(t,L);if(_&&_.ensure){var Q=_.ensure.from.line,q=_.ensure.to.line;Q<N?(N=Q,V=Lr(t,Xt(dt(t,Q))+e.wrapper.clientHeight)):Math.min(q,t.lastLine())>=V&&(N=Lr(t,Xt(dt(t,q))-e.wrapper.clientHeight),V=q)}return{from:N,to:Math.max(V,N+1)}}function Ys(e,t){if(Oe(e,"scrollCursorIntoView"))return;var _=e.display,v=_.sizer.getBoundingClientRect(),L=null;if(t.top+v.top<0?L=!0:t.bottom+v.top>(window.innerHeight||document.documentElement.clientHeight)&&(L=!1),L!=null&&!r){var N=g("div","\u200B",null,`position: absolute;
|
|
|
top: `+(t.top-_.viewOffset-Ri(e.display))+`px;
|
|
|
height: `+(t.bottom-t.top+Hr(e)+_.barHeight)+`px;
|
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(N),N.scrollIntoView(L),e.display.lineSpace.removeChild(N)}}function Qs(e,t,_,v){v==null&&(v=0);var L;!e.options.lineWrapping&&t==_&&(t=t.ch?tt(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,_=t.sticky=="before"?tt(t.line,t.ch+1,"before"):t);for(var N=0;N<5;N++){var V=!1,Q=Ur(e,t),q=!_||_==t?Q:Ur(e,_);L={left:Math.min(Q.left,q.left),top:Math.min(Q.top,q.top)-v,right:Math.max(Q.left,q.left),bottom:Math.max(Q.bottom,q.bottom)+v};var re=ma(e,L),ye=e.doc.scrollTop,we=e.doc.scrollLeft;if(re.scrollTop!=null&&(oi(e,re.scrollTop),Math.abs(e.doc.scrollTop-ye)>1&&(V=!0)),re.scrollLeft!=null&&(xn(e,re.scrollLeft),Math.abs(e.doc.scrollLeft-we)>1&&(V=!0)),!V)break}return L}function qs(e,t){var _=ma(e,t);_.scrollTop!=null&&oi(e,_.scrollTop),_.scrollLeft!=null&&xn(e,_.scrollLeft)}function ma(e,t){var _=e.display,v=In(e.display);t.top<0&&(t.top=0);var L=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:_.scroller.scrollTop,N=na(e),V={};t.bottom-t.top>N&&(t.bottom=t.top+N);var Q=e.doc.height+ra(_),q=t.top<v,re=t.bottom>Q-v;if(t.top<L)V.scrollTop=q?0:t.top;else if(t.bottom>L+N){var ye=Math.min(t.top,(re?Q:t.bottom)-N);ye!=L&&(V.scrollTop=ye)}var we=e.options.fixedGutter?0:_.gutters.offsetWidth,je=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:_.scroller.scrollLeft-we,He=vn(e)-_.gutters.offsetWidth,Qe=t.right-t.left>He;return Qe&&(t.right=t.left+He),t.left<10?V.scrollLeft=0:t.left<je?V.scrollLeft=Math.max(0,t.left+we-(Qe?0:10)):t.right>He+je-3&&(V.scrollLeft=t.right+(Qe?0:10)-He),V}function ga(e,t){if(t==null)return;Fi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Nn(e){Fi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ai(e,t,_){(t!=null||_!=null)&&Fi(e),t!=null&&(e.curOp.scrollLeft=t),_!=null&&(e.curOp.scrollTop=_)}function Zs(e,t){Fi(e),e.curOp.scrollToPos=t}function Fi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var _=io(e,t.from),v=io(e,t.to);mo(e,_,v,t.margin)}}function mo(e,t,_,v){var L=ma(e,{left:Math.min(t.left,_.left),top:Math.min(t.top,_.top)-v,right:Math.max(t.right,_.right),bottom:Math.max(t.bottom,_.bottom)+v});ai(e,L.scrollLeft,L.scrollTop)}function oi(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;D||_a(e,{top:t}),go(e,t,!0),D&&_a(e),ui(e,100)}function go(e,t,_){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!_)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function xn(e,t,_,v){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(_?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!v)return;e.doc.scrollLeft=t,xo(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function si(e){var t=e.display,_=t.gutters.offsetWidth,v=Math.round(e.doc.height+ra(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?_:0,docHeight:v,scrollHeight:v+Hr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:_}}var En=function(e,t,_){this.cm=_;var v=this.vert=g("div",[g("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),L=this.horiz=g("div",[g("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");v.tabIndex=L.tabIndex=-1,e(v),e(L),Ne(v,"scroll",function(){v.clientHeight&&t(v.scrollTop,"vertical")}),Ne(L,"scroll",function(){L.clientWidth&&t(L.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,E&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};En.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,_=e.scrollHeight>e.clientHeight+1,v=e.nativeBarWidth;if(_){this.vert.style.display="block",this.vert.style.bottom=t?v+"px":"0";var L=e.viewHeight-(t?v:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+L)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=_?v+"px":"0",this.horiz.style.left=e.barLeft+"px";var N=e.viewWidth-e.barLeft-(_?v:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+N)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(v==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:_?v:0,bottom:t?v:0}},En.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},En.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},En.prototype.zeroWidthHack=function(){var e=f&&!l?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},En.prototype.enableZeroWidthBar=function(e,t,_){e.style.pointerEvents="auto";function v(){var L=e.getBoundingClientRect(),N=_=="vert"?document.elementFromPoint(L.right-1,(L.top+L.bottom)/2):document.elementFromPoint((L.right+L.left)/2,L.bottom-1);N!=e?e.style.pointerEvents="none":t.set(1e3,v)}t.set(1e3,v)},En.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var li=function(){};li.prototype.update=function(){return{bottom:0,right:0}},li.prototype.setScrollLeft=function(){},li.prototype.setScrollTop=function(){},li.prototype.clear=function(){};function Un(e,t){t||(t=si(e));var _=e.display.barWidth,v=e.display.barHeight;vo(e,t);for(var L=0;L<4&&_!=e.display.barWidth||v!=e.display.barHeight;L++)_!=e.display.barWidth&&e.options.lineWrapping&&Ii(e),vo(e,si(e)),_=e.display.barWidth,v=e.display.barHeight}function vo(e,t){var _=e.display,v=_.scrollbars.update(t);_.sizer.style.paddingRight=(_.barWidth=v.right)+"px",_.sizer.style.paddingBottom=(_.barHeight=v.bottom)+"px",_.heightForcer.style.borderBottom=v.bottom+"px solid transparent",v.right&&v.bottom?(_.scrollbarFiller.style.display="block",_.scrollbarFiller.style.height=v.bottom+"px",_.scrollbarFiller.style.width=v.right+"px"):_.scrollbarFiller.style.display="",v.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(_.gutterFiller.style.display="block",_.gutterFiller.style.height=v.bottom+"px",_.gutterFiller.style.width=t.gutterWidth+"px"):_.gutterFiller.style.display=""}var _o={native:En,null:li};function yo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new _o[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ne(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,_){_=="horizontal"?xn(e,t):oi(e,t)},e),e.display.scrollbars.addClass&&H(e.display.wrapper,e.display.scrollbars.addClass)}var $s=0;function Sn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$s},ks(e.curOp)}function wn(e){var t=e.curOp;t&&Ds(t,function(_){for(var v=0;v<_.ops.length;v++)_.ops[v].cm.curOp=null;Js(_)})}function Js(e){for(var t=e.ops,_=0;_<t.length;_++)el(t[_]);for(var v=0;v<t.length;v++)tl(t[v]);for(var L=0;L<t.length;L++)rl(t[L]);for(var N=0;N<t.length;N++)nl(t[N]);for(var V=0;V<t.length;V++)il(t[V])}function el(e){var t=e.cm,_=t.display;ol(t),e.updateMaxLine&&tr(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<_.viewFrom||e.scrollToPos.to.line>=_.viewTo)||_.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ni(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&va(e.cm,e.update)}function rl(e){var t=e.cm,_=t.display;e.updatedDisplay&&Ii(t),e.barMeasure=si(t),_.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=qa(t,_.maxLine,_.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(_.scroller.clientWidth,_.sizer.offsetLeft+e.adjustWidthTo+Hr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,_.sizer.offsetLeft+e.adjustWidthTo-vn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=_.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&xn(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var _=e.focus&&e.focus==B();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,_),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Un(t,e.barMeasure),e.updatedDisplay&&ba(t,e.barMeasure),e.selectionChanged&&ha(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),_&&fo(e.cm)}function il(e){var t=e.cm,_=t.display,v=t.doc;if(e.updatedDisplay&&bo(t,e.update),_.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(_.wheelStartX=_.wheelStartY=null),e.scrollTop!=null&&go(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&xn(t,e.scrollLeft,!0,!0),e.scrollToPos){var L=Qs(t,_t(v,e.scrollToPos.from),_t(v,e.scrollToPos.to),e.scrollToPos.margin);Ys(t,L)}var N=e.maybeHiddenMarkers,V=e.maybeUnhiddenMarkers;if(N)for(var Q=0;Q<N.length;++Q)N[Q].lines.length||xe(N[Q],"hide");if(V)for(var q=0;q<V.length;++q)V[q].lines.length&&xe(V[q],"unhide");_.wrapper.offsetHeight&&(v.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&xe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Cr(e,t){if(e.curOp)return t();Sn(e);try{return t()}finally{wn(e)}}function nr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Sn(e);try{return t.apply(e,arguments)}finally{wn(e)}}}function gr(e){return function(){if(this.curOp)return e.apply(this,arguments);Sn(this);try{return e.apply(this,arguments)}finally{wn(this)}}}function ir(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Sn(t);try{return e.apply(this,arguments)}finally{wn(t)}}}function ui(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,U(al,e))}function al(e){var t=e.doc;if(t.highlightFrontier>=e.display.viewTo)return;var _=+new Date+e.options.workTime,v=Ve(e,t.highlightFrontier),L=[];t.iter(v.line,Math.min(t.first+t.size,e.display.viewTo+500),function(N){if(v.line>=e.display.viewFrom){var V=N.styles,Q=N.text.length>e.options.maxHighlightLength?It(t.mode,v.state):null,q=Ir(e,N,v,!0);Q&&(v.state=Q),N.styles=q.styles;var re=N.styleClasses,ye=q.classes;ye?N.styleClasses=ye:re&&(N.styleClasses=null);for(var we=!V||V.length!=N.styles.length||re!=ye&&(!re||!ye||re.bgClass!=ye.bgClass||re.textClass!=ye.textClass),je=0;!we&&je<V.length;++je)we=V[je]!=N.styles[je];we&&L.push(v.line),N.stateAfter=v.save(),v.nextLine()}else N.text.length<=e.options.maxHighlightLength&&ft(e,N.text,v),N.stateAfter=v.line%5==0?v.save():null,v.nextLine();if(+new Date>_)return ui(e,e.options.workDelay),!0}),t.highlightFrontier=v.line,t.modeFrontier=Math.max(t.modeFrontier,v.line),L.length&&Cr(e,function(){for(var N=0;N<L.length;N++)on(e,L[N],"text")})}var Ni=function(e,t,_){var v=e.display;this.viewport=t,this.visible=Pi(v,e.doc,t),this.editorIsHidden=!v.wrapper.offsetWidth,this.wrapperHeight=v.wrapper.clientHeight,this.wrapperWidth=v.wrapper.clientWidth,this.oldDisplayWidth=vn(e),this.force=_,this.dims=ca(e),this.events=[]};Ni.prototype.signal=function(e,t){ce(e,t)&&this.events.push(arguments)},Ni.prototype.finish=function(){for(var e=0;e<this.events.length;e++)xe.apply(null,this.events[e])};function ol(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Hr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Hr(e)+"px",t.scrollbarsClipped=!0)}function sl(e){if(e.hasFocus())return null;var t=B();if(!t||!P(e.display.lineDiv,t))return null;var _={activeElt:t};if(window.getSelection){var v=window.getSelection();v.anchorNode&&v.extend&&P(e.display.lineDiv,v.anchorNode)&&(_.anchorNode=v.anchorNode,_.anchorOffset=v.anchorOffset,_.focusNode=v.focusNode,_.focusOffset=v.focusOffset)}return _}function ll(e){if(!e||!e.activeElt||e.activeElt==B())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&P(document.body,e.anchorNode)&&P(document.body,e.focusNode)){var t=window.getSelection(),_=document.createRange();_.setEnd(e.anchorNode,e.anchorOffset),_.collapse(!1),t.removeAllRanges(),t.addRange(_),t.extend(e.focusNode,e.focusOffset)}}function va(e,t){var _=e.display,v=e.doc;if(t.editorIsHidden)return sn(e),!1;if(!t.force&&t.visible.from>=_.viewFrom&&t.visible.to<=_.viewTo&&(_.updateLineNumbers==null||_.updateLineNumbers>=_.viewTo)&&_.renderedView==_.view&&lo(e)==0)return!1;Eo(e)&&(sn(e),t.dims=ca(e));var L=v.first+v.size,N=Math.max(t.visible.from-e.options.viewportMargin,v.first),V=Math.min(L,t.visible.to+e.options.viewportMargin);_.viewFrom<N&&N-_.viewFrom<20&&(N=Math.max(v.first,_.viewFrom)),_.viewTo>V&&_.viewTo-V<20&&(V=Math.min(L,_.viewTo)),yr&&(N=St(e.doc,N),V=wt(e.doc,V));var Q=N!=_.viewFrom||V!=_.viewTo||_.lastWrapHeight!=t.wrapperHeight||_.lastWrapWidth!=t.wrapperWidth;Gs(e,N,V),_.viewOffset=Xt(dt(e.doc,_.viewFrom)),e.display.mover.style.top=_.viewOffset+"px";var q=lo(e);if(!Q&&q==0&&!t.force&&_.renderedView==_.view&&(_.updateLineNumbers==null||_.updateLineNumbers>=_.viewTo))return!1;var re=sl(e);return q>4&&(_.lineDiv.style.display="none"),ul(e,_.updateLineNumbers,t.dims),q>4&&(_.lineDiv.style.display=""),_.renderedView=_.view,ll(re),S(_.cursorDiv),S(_.selectionDiv),_.gutters.style.height=_.sizer.style.minHeight=0,Q&&(_.lastWrapHeight=t.wrapperHeight,_.lastWrapWidth=t.wrapperWidth,ui(e,400)),_.updateLineNumbers=null,!0}function bo(e,t){for(var _=t.viewport,v=!0;;v=!1){if(!v||!e.options.lineWrapping||t.oldDisplayWidth==vn(e)){if(_&&_.top!=null&&(_={top:Math.min(e.doc.height+ra(e.display)-na(e),_.top)}),t.visible=Pi(e.display,e.doc,_),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else v&&(t.visible=Pi(e.display,e.doc,_));if(!va(e,t))break;Ii(e);var L=si(e);ii(e),Un(e,L),ba(e,L),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function _a(e,t){var _=new Ni(e,t);if(va(e,_)){Ii(e),bo(e,_);var v=si(e);ii(e),Un(e,v),ba(e,v),_.finish()}}function ul(e,t,_){var v=e.display,L=e.options.lineNumbers,N=v.lineDiv,V=N.firstChild;function Q(Qe){var Ze=Qe.nextSibling;return p&&f&&e.display.currentWheelTarget==Qe?Qe.style.display="none":Qe.parentNode.removeChild(Qe),Ze}for(var q=v.view,re=v.viewFrom,ye=0;ye<q.length;ye++){var we=q[ye];if(!we.hidden)if(!we.node||we.node.parentNode!=N){var je=Fs(e,we,re,_);N.insertBefore(je,V)}else{for(;V!=we.node;)V=Q(V);var He=L&&t!=null&&t<=re&&we.lineNumber;we.changes&&(de(we.changes,"gutter")>-1&&(He=!1),ja(e,we,re,_)),He&&(S(we.lineNumber),we.lineNumber.appendChild(document.createTextNode(Or(e.options,re)))),V=we.node.nextSibling}re+=we.size}for(;V;)V=Q(V)}function ya(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function ba(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Hr(e)+"px"}function xo(e){var t=e.display,_=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var v=da(t)-t.scroller.scrollLeft+e.doc.scrollLeft,L=t.gutters.offsetWidth,N=v+"px",V=0;V<_.length;V++)if(!_[V].hidden){e.options.fixedGutter&&(_[V].gutter&&(_[V].gutter.style.left=N),_[V].gutterBackground&&(_[V].gutterBackground.style.left=N));var Q=_[V].alignable;if(Q)for(var q=0;q<Q.length;q++)Q[q].style.left=N}e.options.fixedGutter&&(t.gutters.style.left=v+L+"px")}function Eo(e){if(!e.options.lineNumbers)return!1;var t=e.doc,_=Or(e.options,t.first+t.size-1),v=e.display;if(_.length!=v.lineNumChars){var L=v.measure.appendChild(g("div",[g("div",_)],"CodeMirror-linenumber CodeMirror-gutter-elt")),N=L.firstChild.offsetWidth,V=L.offsetWidth-N;return v.lineGutter.style.width="",v.lineNumInnerWidth=Math.max(N,v.lineGutter.offsetWidth-V)+1,v.lineNumWidth=v.lineNumInnerWidth+V,v.lineNumChars=v.lineNumInnerWidth?_.length:-1,v.lineGutter.style.width=v.lineNumWidth+"px",ya(e.display),!0}return!1}function xa(e,t){for(var _=[],v=!1,L=0;L<e.length;L++){var N=e[L],V=null;if(typeof N!="string"&&(V=N.style,N=N.className),N=="CodeMirror-linenumbers")if(t)v=!0;else continue;_.push({className:N,style:V})}return t&&!v&&_.push({className:"CodeMirror-linenumbers",style:null}),_}function So(e){var t=e.gutters,_=e.gutterSpecs;S(t),e.lineGutter=null;for(var v=0;v<_.length;++v){var L=_[v],N=L.className,V=L.style,Q=t.appendChild(g("div",null,"CodeMirror-gutter "+N));V&&(Q.style.cssText=V),N=="CodeMirror-linenumbers"&&(e.lineGutter=Q,Q.style.width=(e.lineNumWidth||1)+"px")}t.style.display=_.length?"":"none",ya(e)}function ci(e){So(e.display),br(e),xo(e)}function cl(e,t,_,v){var L=this;this.input=_,L.scrollbarFiller=g("div",null,"CodeMirror-scrollbar-filler"),L.scrollbarFiller.setAttribute("cm-not-content","true"),L.gutterFiller=g("div",null,"CodeMirror-gutter-filler"),L.gutterFiller.setAttribute("cm-not-content","true"),L.lineDiv=M("div",null,"CodeMirror-code"),L.selectionDiv=g("div",null,null,"position: relative; z-index: 1"),L.cursorDiv=g("div",null,"CodeMirror-cursors"),L.measure=g("div",null,"CodeMirror-measure"),L.lineMeasure=g("div",null,"CodeMirror-measure"),L.lineSpace=M("div",[L.measure,L.lineMeasure,L.selectionDiv,L.cursorDiv,L.lineDiv],null,"position: relative; outline: none");var N=M("div",[L.lineSpace],"CodeMirror-lines");L.mover=g("div",[N],null,"position: relative"),L.sizer=g("div",[L.mover],"CodeMirror-sizer"),L.sizerWidth=null,L.heightForcer=g("div",null,null,"position: absolute; height: "+ge+"px; width: 1px;"),L.gutters=g("div",null,"CodeMirror-gutters"),L.lineGutter=null,L.scroller=g("div",[L.sizer,L.heightForcer,L.gutters],"CodeMirror-scroll"),L.scroller.setAttribute("tabIndex","-1"),L.wrapper=g("div",[L.scrollbarFiller,L.gutterFiller,L.scroller],"CodeMirror"),E&&y<8&&(L.gutters.style.zIndex=-1,L.scroller.style.paddingRight=0),!p&&!(D&&i)&&(L.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(L.wrapper):e(L.wrapper)),L.viewFrom=L.viewTo=t.first,L.reportedViewFrom=L.reportedViewTo=t.first,L.view=[],L.renderedView=null,L.externalMeasured=null,L.viewOffset=0,L.lastWrapHeight=L.lastWrapWidth=0,L.updateLineNumbers=null,L.nativeBarWidth=L.barHeight=L.barWidth=0,L.scrollbarsClipped=!1,L.lineNumWidth=L.lineNumInnerWidth=L.lineNumChars=null,L.alignWidgets=!1,L.cachedCharWidth=L.cachedTextHeight=L.cachedPaddingH=null,L.maxLine=null,L.maxLineLength=0,L.maxLineChanged=!1,L.wheelDX=L.wheelDY=L.wheelStartX=L.wheelStartY=null,L.shift=!1,L.selForContextMenu=null,L.activeTouch=null,L.gutterSpecs=xa(v.gutters,v.lineNumbers),So(L),_.init(L)}var Ui=0,Rr=null;E?Rr=-.53:D?Rr=15:o?Rr=-.7:s&&(Rr=-1/3);function wo(e){var t=e.wheelDeltaX,_=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),_==null&&e.detail&&e.axis==e.VERTICAL_AXIS?_=e.detail:_==null&&(_=e.wheelDelta),{x:t,y:_}}function dl(e){var t=wo(e);return t.x*=Rr,t.y*=Rr,t}function To(e,t){var _=wo(t),v=_.x,L=_.y,N=e.display,V=N.scroller,Q=V.scrollWidth>V.clientWidth,q=V.scrollHeight>V.clientHeight;if(!(v&&Q||L&&q))return;if(L&&f&&p){e:for(var re=t.target,ye=N.view;re!=V;re=re.parentNode)for(var we=0;we<ye.length;we++)if(ye[we].node==re){e.display.currentWheelTarget=re;break e}}if(v&&!D&&!d&&Rr!=null){L&&q&&oi(e,Math.max(0,V.scrollTop+L*Rr)),xn(e,Math.max(0,V.scrollLeft+v*Rr)),(!L||L&&q)&&Y(t),N.wheelStartX=null;return}if(L&&Rr!=null){var je=L*Rr,He=e.doc.scrollTop,Qe=He+N.wrapper.clientHeight;je<0?He=Math.max(0,He+je-50):Qe=Math.min(e.doc.height,Qe+je+50),_a(e,{top:He,bottom:Qe})}Ui<20&&(N.wheelStartX==null?(N.wheelStartX=V.scrollLeft,N.wheelStartY=V.scrollTop,N.wheelDX=v,N.wheelDY=L,setTimeout(function(){if(N.wheelStartX==null)return;var Ze=V.scrollLeft-N.wheelStartX,nt=V.scrollTop-N.wheelStartY,ot=nt&&N.wheelDY&&nt/N.wheelDY||Ze&&N.wheelDX&&Ze/N.wheelDX;if(N.wheelStartX=N.wheelStartY=null,!ot)return;Rr=(Rr*Ui+ot)/(Ui+1),++Ui},200)):(N.wheelDX+=v,N.wheelDY+=L))}var Dr=function(e,t){this.ranges=e,this.primIndex=t};Dr.prototype.primary=function(){return this.ranges[this.primIndex]},Dr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var _=this.ranges[t],v=e.ranges[t];if(!kr(_.anchor,v.anchor)||!kr(_.head,v.head))return!1}return!0},Dr.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Pt(Mr(this.ranges[t].anchor),Mr(this.ranges[t].head));return new Dr(e,this.primIndex)},Dr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Dr.prototype.contains=function(e,t){t||(t=e);for(var _=0;_<this.ranges.length;_++){var v=this.ranges[_];if(bt(t,v.from())>=0&&bt(e,v.to())<=0)return _}return-1};var Pt=function(e,t){this.anchor=e,this.head=t};Pt.prototype.from=function(){return Gr(this.anchor,this.head)},Pt.prototype.to=function(){return at(this.anchor,this.head)},Pt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Kr(e,t,_){var v=e&&e.options.selectionsMayTouch,L=t[_];t.sort(function(je,He){return bt(je.from(),He.from())}),_=de(t,L);for(var N=1;N<t.length;N++){var V=t[N],Q=t[N-1],q=bt(Q.to(),V.from());if(v&&!V.empty()?q>0:q>=0){var re=Gr(Q.from(),V.from()),ye=at(Q.to(),V.to()),we=Q.empty()?V.from()==V.head:Q.from()==Q.head;N<=_&&--_,t.splice(--N,2,new Pt(we?ye:re,we?re:ye))}}return new Dr(t,_)}function ln(e,t){return new Dr([new Pt(e,t||e)],0)}function un(e){return e.text?tt(e.from.line+e.text.length-1,te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Co(e,t){if(bt(e,t.from)<0)return e;if(bt(e,t.to)<=0)return un(t);var _=e.line+t.text.length-(t.to.line-t.from.line)-1,v=e.ch;return e.line==t.to.line&&(v+=un(t).ch-t.to.ch),tt(_,v)}function Ea(e,t){for(var _=[],v=0;v<e.sel.ranges.length;v++){var L=e.sel.ranges[v];_.push(new Pt(Co(L.anchor,t),Co(L.head,t)))}return Kr(e.cm,_,e.sel.primIndex)}function Ao(e,t,_){return e.line==t.line?tt(_.line,e.ch-t.ch+_.ch):tt(_.line+(e.line-t.line),e.ch)}function fl(e,t,_){for(var v=[],L=tt(e.first,0),N=L,V=0;V<t.length;V++){var Q=t[V],q=Ao(Q.from,L,N),re=Ao(un(Q),L,N);if(L=Q.to,N=re,_=="around"){var ye=e.sel.ranges[V],we=bt(ye.head,ye.anchor)<0;v[V]=new Pt(we?re:q,we?q:re)}else v[V]=new Pt(q,q)}return new Dr(v,e.sel.primIndex)}function Sa(e){e.doc.mode=Ht(e.options,e.doc.modeOption),di(e)}function di(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ui(e,100),e.state.modeGen++,e.curOp&&br(e)}function Lo(e,t){return t.from.ch==0&&t.to.ch==0&&te(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function wa(e,t,_,v){function L(ut){return _?_[ut]:null}function N(ut,st,ht){qr(ut,st,ht,v),lr(ut,"change",ut,t)}function V(ut,st){for(var ht=[],xt=ut;xt<st;++xt)ht.push(new rr(re[xt],L(xt),v));return ht}var Q=t.from,q=t.to,re=t.text,ye=dt(e,Q.line),we=dt(e,q.line),je=te(re),He=L(re.length-1),Qe=q.line-Q.line;if(t.full)e.insert(0,V(0,re.length)),e.remove(re.length,e.size-re.length);else if(Lo(e,t)){var Ze=V(0,re.length-1);N(we,we.text,He),Qe&&e.remove(Q.line,Qe),Ze.length&&e.insert(Q.line,Ze)}else if(ye==we)if(re.length==1)N(ye,ye.text.slice(0,Q.ch)+je+ye.text.slice(q.ch),He);else{var nt=V(1,re.length-1);nt.push(new rr(je+ye.text.slice(q.ch),He,v)),N(ye,ye.text.slice(0,Q.ch)+re[0],L(0)),e.insert(Q.line+1,nt)}else if(re.length==1)N(ye,ye.text.slice(0,Q.ch)+re[0]+we.text.slice(q.ch),L(0)),e.remove(Q.line+1,Qe);else{N(ye,ye.text.slice(0,Q.ch)+re[0],L(0)),N(we,je+we.text.slice(q.ch),He);var ot=V(1,re.length-1);Qe>1&&e.remove(Q.line+1,Qe-1),e.insert(Q.line+1,ot)}lr(e,"change",e,t)}function cn(e,t,_){function v(L,N,V){if(L.linked)for(var Q=0;Q<L.linked.length;++Q){var q=L.linked[Q];if(q.doc==N)continue;var re=V&&q.sharedHist;if(_&&!re)continue;t(q.doc,re),v(q.doc,L,re)}}v(e,null,!0)}function ko(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,fa(e),Sa(e),Ro(e),e.options.lineWrapping||tr(e),e.options.mode=t.modeOption,br(e)}function Ro(e){(e.doc.direction=="rtl"?H:b)(e.display.lineDiv,"CodeMirror-rtl")}function hl(e){Cr(e,function(){Ro(e),br(e)})}function Ki(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 Ta(e,t){var _={from:Mr(t.from),to:un(t),text:sr(e,t.from,t.to)};return Mo(e,_,t.from.line,t.to.line+1),cn(e,function(v){return Mo(v,_,t.from.line,t.to.line+1)},!0),_}function Do(e){for(;e.length;){var t=te(e);if(t.ranges)e.pop();else break}}function pl(e,t){if(t)return Do(e.done),te(e.done);if(e.done.length&&!te(e.done).ranges)return te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),te(e.done)}function Oo(e,t,_,v){var L=e.history;L.undone.length=0;var N=+new Date,V,Q;if((L.lastOp==v||L.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&L.lastModTime>N-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(V=pl(L,L.lastOp==v)))Q=te(V.changes),bt(t.from,t.to)==0&&bt(t.from,Q.to)==0?Q.to=un(t):V.changes.push(Ta(e,t));else{var q=te(L.done);for((!q||!q.ranges)&&Bi(e.sel,L.done),V={changes:[Ta(e,t)],generation:L.generation},L.done.push(V);L.done.length>L.undoDepth;)L.done.shift(),L.done[0].ranges||L.done.shift()}L.done.push(_),L.generation=++L.maxGeneration,L.lastModTime=L.lastSelTime=N,L.lastOp=L.lastSelOp=v,L.lastOrigin=L.lastSelOrigin=t.origin,Q||xe(e,"historyAdded")}function ml(e,t,_,v){var L=t.charAt(0);return L=="*"||L=="+"&&_.ranges.length==v.ranges.length&&_.somethingSelected()==v.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,_,v){var L=e.history,N=v&&v.origin;_==L.lastSelOp||N&&L.lastSelOrigin==N&&(L.lastModTime==L.lastSelTime&&L.lastOrigin==N||ml(e,N,te(L.done),t))?L.done[L.done.length-1]=t:Bi(t,L.done),L.lastSelTime=+new Date,L.lastSelOrigin=N,L.lastSelOp=_,v&&v.clearRedo!==!1&&Do(L.undone)}function Bi(e,t){var _=te(t);_&&_.ranges&&_.equals(e)||t.push(e)}function Mo(e,t,_,v){var L=t["spans_"+e.id],N=0;e.iter(Math.max(e.first,_),Math.min(e.first+e.size,v),function(V){V.markedSpans&&((L||(L=t["spans_"+e.id]={}))[N]=V.markedSpans),++N})}function vl(e){if(!e)return null;for(var t,_=0;_<e.length;++_)e[_].marker.explicitlyCleared?t||(t=e.slice(0,_)):t&&t.push(e[_]);return t?t.length?t:null:e}function _l(e,t){var _=t["spans_"+e.id];if(!_)return null;for(var v=[],L=0;L<t.text.length;++L)v.push(vl(_[L]));return v}function Io(e,t){var _=_l(e,t),v=Yr(e,t);if(!_)return v;if(!v)return _;for(var L=0;L<_.length;++L){var N=_[L],V=v[L];if(N&&V){e:for(var Q=0;Q<V.length;++Q){for(var q=V[Q],re=0;re<N.length;++re)if(N[re].marker==q.marker)continue e;N.push(q)}}else V&&(_[L]=V)}return _}function Kn(e,t,_){for(var v=[],L=0;L<e.length;++L){var N=e[L];if(N.ranges){v.push(_?Dr.prototype.deepCopy.call(N):N);continue}var V=N.changes,Q=[];v.push({changes:Q});for(var q=0;q<V.length;++q){var re=V[q],ye=void 0;if(Q.push({from:re.from,to:re.to,text:re.text}),t)for(var we in re)(ye=we.match(/^spans_(\d+)$/))&&(de(t,Number(ye[1]))>-1&&(te(Q)[we]=re[we],delete re[we]))}}return v}function Ca(e,t,_,v){if(v){var L=e.anchor;if(_){var N=bt(t,L)<0;N!=bt(_,L)<0?(L=t,t=_):N!=bt(t,_)<0&&(t=_)}return new Pt(L,t)}else return new Pt(_||t,t)}function Xi(e,t,_,v,L){L==null&&(L=e.cm&&(e.cm.display.shift||e.extend)),dr(e,new Dr([Ca(e.sel.primary(),t,_,L)],0),v)}function Po(e,t,_){for(var v=[],L=e.cm&&(e.cm.display.shift||e.extend),N=0;N<e.sel.ranges.length;N++)v[N]=Ca(e.sel.ranges[N],t[N],null,L);var V=Kr(e.cm,v,e.sel.primIndex);dr(e,V,_)}function Aa(e,t,_,v){var L=e.sel.ranges.slice(0);L[t]=_,dr(e,Kr(e.cm,L,e.sel.primIndex),v)}function Fo(e,t,_,v){dr(e,ln(t,_),v)}function yl(e,t,_){var v={ranges:t.ranges,update:function(L){this.ranges=[];for(var N=0;N<L.length;N++)this.ranges[N]=new Pt(_t(e,L[N].anchor),_t(e,L[N].head))},origin:_&&_.origin};return xe(e,"beforeSelectionChange",e,v),e.cm&&xe(e.cm,"beforeSelectionChange",e.cm,v),v.ranges!=t.ranges?Kr(e.cm,v.ranges,v.ranges.length-1):t}function No(e,t,_){var v=e.history.done,L=te(v);L&&L.ranges?(v[v.length-1]=t,Hi(e,t,_)):dr(e,t,_)}function dr(e,t,_){Hi(e,t,_),gl(e,e.sel,e.cm?e.cm.curOp.id:NaN,_)}function Hi(e,t,_){(ce(e,"beforeSelectionChange")||e.cm&&ce(e.cm,"beforeSelectionChange"))&&(t=yl(e,t,_));var v=_&&_.bias||(bt(t.primary().head,e.sel.primary().head)<0?-1:1);Uo(e,Bo(e,t,v,!0)),!(_&&_.scroll===!1)&&e.cm&&Nn(e.cm)}function Uo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,he(e.cm)),lr(e,"cursorActivity",e)}function Ko(e){Uo(e,Bo(e,e.sel,null,!1))}function Bo(e,t,_,v){for(var L,N=0;N<t.ranges.length;N++){var V=t.ranges[N],Q=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[N],q=ji(e,V.anchor,Q&&Q.anchor,_,v),re=ji(e,V.head,Q&&Q.head,_,v);(L||q!=V.anchor||re!=V.head)&&(L||(L=t.ranges.slice(0,N)),L[N]=new Pt(q,re))}return L?Kr(e.cm,L,t.primIndex):t}function Bn(e,t,_,v,L){var N=dt(e,t.line);if(N.markedSpans)for(var V=0;V<N.markedSpans.length;++V){var Q=N.markedSpans[V],q=Q.marker,re="selectLeft"in q?!q.selectLeft:q.inclusiveLeft,ye="selectRight"in q?!q.selectRight:q.inclusiveRight;if((Q.from==null||(re?Q.from<=t.ch:Q.from<t.ch))&&(Q.to==null||(ye?Q.to>=t.ch:Q.to>t.ch))){if(L&&(xe(q,"beforeCursorEnter"),q.explicitlyCleared))if(N.markedSpans){--V;continue}else break;if(!q.atomic)continue;if(_){var we=q.find(v<0?1:-1),je=void 0;if((v<0?ye:re)&&(we=Xo(e,we,-v,we&&we.line==t.line?N:null)),we&&we.line==t.line&&(je=bt(we,_))&&(v<0?je<0:je>0))return Bn(e,we,t,v,L)}var He=q.find(v<0?-1:1);return(v<0?re:ye)&&(He=Xo(e,He,v,He.line==t.line?N:null)),He?Bn(e,He,t,v,L):null}}return t}function ji(e,t,_,v,L){var N=v||1,V=Bn(e,t,_,N,L)||!L&&Bn(e,t,_,N,!0)||Bn(e,t,_,-N,L)||!L&&Bn(e,t,_,-N,!0);return V||(e.cantEdit=!0,tt(e.first,0))}function Xo(e,t,_,v){return _<0&&t.ch==0?t.line>e.first?_t(e,tt(t.line-1)):null:_>0&&t.ch==(v||dt(e,t.line)).text.length?t.line<e.first+e.size-1?tt(t.line+1,0):null:new tt(t.line,t.ch+_)}function Ho(e){e.setSelection(tt(e.firstLine(),0),tt(e.lastLine()),Ue)}function jo(e,t,_){var v={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return v.canceled=!0}};return _&&(v.update=function(L,N,V,Q){L&&(v.from=_t(e,L)),N&&(v.to=_t(e,N)),V&&(v.text=V),Q!==void 0&&(v.origin=Q)}),xe(e,"beforeChange",e,v),e.cm&&xe(e.cm,"beforeChange",e.cm,v),v.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:v.from,to:v.to,text:v.text,origin:v.origin}}function Xn(e,t,_){if(e.cm){if(!e.cm.curOp)return nr(e.cm,Xn)(e,t,_);if(e.cm.state.suppressEdits)return}if((ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"))&&(t=jo(e,t,!0),!t))return;var v=Fr&&!_&&Rn(e,t.from,t.to);if(v)for(var L=v.length-1;L>=0;--L)Wo(e,{from:v[L].from,to:v[L].to,text:L?[""]:t.text,origin:t.origin});else Wo(e,t)}function Wo(e,t){if(t.text.length==1&&t.text[0]==""&&bt(t.from,t.to)==0)return;var _=Ea(e,t);Oo(e,t,_,e.cm?e.cm.curOp.id:NaN),fi(e,t,_,Yr(e,t));var v=[];cn(e,function(L,N){!N&&de(v,L.history)==-1&&(Yo(L.history,t),v.push(L.history)),fi(L,t,null,Yr(L,t))})}function Wi(e,t,_){var v=e.cm&&e.cm.state.suppressEdits;if(v&&!_)return;for(var L=e.history,N,V=e.sel,Q=t=="undo"?L.done:L.undone,q=t=="undo"?L.undone:L.done,re=0;re<Q.length&&!(N=Q[re],_?N.ranges&&!N.equals(e.sel):!N.ranges);re++);if(re==Q.length)return;for(L.lastOrigin=L.lastSelOrigin=null;;)if(N=Q.pop(),N.ranges){if(Bi(N,q),_&&!N.equals(e.sel)){dr(e,N,{clearRedo:!1});return}V=N}else if(v){Q.push(N);return}else break;var ye=[];Bi(V,q),q.push({changes:ye,generation:L.generation}),L.generation=N.generation||++L.maxGeneration;for(var we=ce(e,"beforeChange")||e.cm&&ce(e.cm,"beforeChange"),je=function(Ze){var nt=N.changes[Ze];if(nt.origin=t,we&&!jo(e,nt,!1))return Q.length=0,{};ye.push(Ta(e,nt));var ot=Ze?Ea(e,nt):te(Q);fi(e,nt,ot,Io(e,nt)),!Ze&&e.cm&&e.cm.scrollIntoView({from:nt.from,to:un(nt)});var ut=[];cn(e,function(st,ht){!ht&&de(ut,st.history)==-1&&(Yo(st.history,nt),ut.push(st.history)),fi(st,nt,null,Io(st,nt))})},He=N.changes.length-1;He>=0;--He){var Qe=je(He);if(Qe)return Qe.v}}function zo(e,t){if(t==0)return;if(e.first+=t,e.sel=new Dr(pe(e.sel.ranges,function(L){return new Pt(tt(L.anchor.line+t,L.anchor.ch),tt(L.head.line+t,L.head.ch))}),e.sel.primIndex),e.cm){br(e.cm,e.first,e.first-t,t);for(var _=e.cm.display,v=_.viewFrom;v<_.viewTo;v++)on(e.cm,v,"gutter")}}function fi(e,t,_,v){if(e.cm&&!e.cm.curOp)return nr(e.cm,fi)(e,t,_,v);if(t.to.line<e.first){zo(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var L=t.text.length-1-(e.first-t.from.line);zo(e,L),t={from:tt(e.first,0),to:tt(t.to.line+L,t.to.ch),text:[te(t.text)],origin:t.origin}}var N=e.lastLine();t.to.line>N&&(t={from:t.from,to:tt(N,dt(e,N).text.length),text:[t.text[0]],origin:t.origin}),t.removed=sr(e,t.from,t.to),_||(_=Ea(e,t)),e.cm?bl(e.cm,t,v):wa(e,t,v),Hi(e,_,Ue),e.cantEdit&&ji(e,tt(e.firstLine(),0))&&(e.cantEdit=!1)}function bl(e,t,_){var v=e.doc,L=e.display,N=t.from,V=t.to,Q=!1,q=N.line;e.options.lineWrapping||(q=kt(Nr(dt(v,N.line))),v.iter(q,V.line+1,function(He){if(He==L.maxLine)return Q=!0,!0})),v.sel.contains(t.from,t.to)>-1&&he(e),wa(v,t,_,so(e)),e.options.lineWrapping||(v.iter(q,N.line+t.text.length,function(He){var Qe=Gt(He);Qe>L.maxLineLength&&(L.maxLine=He,L.maxLineLength=Qe,L.maxLineChanged=!0,Q=!1)}),Q&&(e.curOp.updateMaxLine=!0)),Tr(v,N.line),ui(e,400);var re=t.text.length-(V.line-N.line)-1;t.full?br(e):N.line==V.line&&t.text.length==1&&!Lo(e.doc,t)?on(e,N.line,"text"):br(e,N.line,V.line+1,re);var ye=ce(e,"changes"),we=ce(e,"change");if(we||ye){var je={from:N,to:V,text:t.text,removed:t.removed,origin:t.origin};we&&lr(e,"change",e,je),ye&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(je)}e.display.selForContextMenu=null}function Hn(e,t,_,v,L){var N;v||(v=_),bt(v,_)<0&&(N=[v,_],_=N[0],v=N[1]),typeof t=="string"&&(t=e.splitLines(t)),Xn(e,{from:_,to:v,text:t,origin:L})}function Go(e,t,_,v){_<e.line?e.line+=v:t<e.line&&(e.line=t,e.ch=0)}function Vo(e,t,_,v){for(var L=0;L<e.length;++L){var N=e[L],V=!0;if(N.ranges){N.copied||(N=e[L]=N.deepCopy(),N.copied=!0);for(var Q=0;Q<N.ranges.length;Q++)Go(N.ranges[Q].anchor,t,_,v),Go(N.ranges[Q].head,t,_,v);continue}for(var q=0;q<N.changes.length;++q){var re=N.changes[q];if(_<re.from.line)re.from=tt(re.from.line+v,re.from.ch),re.to=tt(re.to.line+v,re.to.ch);else if(t<=re.to.line){V=!1;break}}V||(e.splice(0,L+1),L=0)}}function Yo(e,t){var _=t.from.line,v=t.to.line,L=t.text.length-(v-_)-1;Vo(e.done,_,v,L),Vo(e.undone,_,v,L)}function hi(e,t,_,v){var L=t,N=t;return typeof t=="number"?N=dt(e,An(e,t)):L=kt(t),L==null?null:(v(N,L)&&e.cm&&on(e.cm,L,_),N)}function pi(e){this.lines=e,this.parent=null;for(var t=0,_=0;_<e.length;++_)e[_].parent=this,t+=e[_].height;this.height=t}pi.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var _=e,v=e+t;_<v;++_){var L=this.lines[_];this.height-=L.height,Qt(L),lr(L,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,_){this.height+=_,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var v=0;v<t.length;++v)t[v].parent=this},iterN:function(e,t,_){for(var v=e+t;e<v;++e)if(_(this.lines[e]))return!0}};function mi(e){this.children=e;for(var t=0,_=0,v=0;v<e.length;++v){var L=e[v];t+=L.chunkSize(),_+=L.height,L.parent=this}this.size=t,this.height=_,this.parent=null}mi.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var _=0;_<this.children.length;++_){var v=this.children[_],L=v.chunkSize();if(e<L){var N=Math.min(t,L-e),V=v.height;if(v.removeInner(e,N),this.height-=V-v.height,L==N&&(this.children.splice(_--,1),v.parent=null),(t-=N)==0)break;e=0}else e-=L}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof pi))){var Q=[];this.collapse(Q),this.children=[new pi(Q)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,_){this.size+=t.length,this.height+=_;for(var v=0;v<this.children.length;++v){var L=this.children[v],N=L.chunkSize();if(e<=N){if(L.insertInner(e,t,_),L.lines&&L.lines.length>50){for(var V=L.lines.length%25+25,Q=V;Q<L.lines.length;){var q=new pi(L.lines.slice(Q,Q+=25));L.height-=q.height,this.children.splice(++v,0,q),q.parent=this}L.lines=L.lines.slice(0,V),this.maybeSpill()}break}e-=N}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),_=new mi(t);if(e.parent){e.size-=_.size,e.height-=_.height;var L=de(e.parent.children,e);e.parent.children.splice(L+1,0,_)}else{var v=new mi(e.children);v.parent=e,e.children=[v,_],e=v}_.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,_){for(var v=0;v<this.children.length;++v){var L=this.children[v],N=L.chunkSize();if(e<N){var V=Math.min(t,N-e);if(L.iterN(e,V,_))return!0;if((t-=V)==0)break;e=0}else e-=N}}};var gi=function(e,t,_){if(_)for(var v in _)_.hasOwnProperty(v)&&(this[v]=_[v]);this.doc=e,this.node=t};gi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,_=this.line,v=kt(_);if(v==null||!t)return;for(var L=0;L<t.length;++L)t[L]==this&&t.splice(L--,1);t.length||(_.widgets=null);var N=ri(this);_r(_,Math.max(0,_.height-N)),e&&(Cr(e,function(){Qo(e,_,-N),on(e,v,"widget")}),lr(e,"lineWidgetCleared",e,this,v))},gi.prototype.changed=function(){var e=this,t=this.height,_=this.doc.cm,v=this.line;this.height=null;var L=ri(this)-t;if(!L)return;Dt(this.doc,v)||_r(v,v.height+L),_&&Cr(_,function(){_.curOp.forceUpdate=!0,Qo(_,v,L),lr(_,"lineWidgetChanged",_,e,kt(v))})},le(gi);function Qo(e,t,_){Xt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ga(e,_)}function xl(e,t,_,v){var L=new gi(e,_,v),N=e.cm;return N&&L.noHScroll&&(N.display.alignWidgets=!0),hi(e,t,"widget",function(V){var Q=V.widgets||(V.widgets=[]);if(L.insertAt==null?Q.push(L):Q.splice(Math.min(Q.length-1,Math.max(0,L.insertAt)),0,L),L.line=V,N&&!Dt(e,V)){var q=Xt(V)<e.scrollTop;_r(V,V.height+ri(L)),q&&ga(N,L.height),N.curOp.forceUpdate=!0}return!0}),N&&lr(N,"lineWidgetAdded",N,L,typeof t=="number"?t:kt(t)),L}var qo=0,dn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++qo};dn.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;if(t&&Sn(e),ce(this,"clear")){var _=this.find();_&&lr(this,"clear",_.from,_.to)}for(var v=null,L=null,N=0;N<this.lines.length;++N){var V=this.lines[N],Q=rn(V.markedSpans,this);e&&!this.collapsed?on(e,kt(V),"text"):e&&(Q.to!=null&&(L=kt(V)),Q.from!=null&&(v=kt(V))),V.markedSpans=$i(V.markedSpans,Q),Q.from==null&&this.collapsed&&!Dt(this.doc,V)&&e&&_r(V,In(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var q=0;q<this.lines.length;++q){var re=Nr(this.lines[q]),ye=Gt(re);ye>e.display.maxLineLength&&(e.display.maxLine=re,e.display.maxLineLength=ye,e.display.maxLineChanged=!0)}v!=null&&e&&this.collapsed&&br(e,v,L+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ko(e.doc)),e&&lr(e,"markerCleared",e,this,v,L),t&&wn(e),this.parent&&this.parent.clear()},dn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var _,v,L=0;L<this.lines.length;++L){var N=this.lines[L],V=rn(N.markedSpans,this);if(V.from!=null&&(_=tt(t?N:kt(N),V.from),e==-1))return _;if(V.to!=null&&(v=tt(t?N:kt(N),V.to),e==1))return v}return _&&{from:_,to:v}},dn.prototype.changed=function(){var e=this,t=this.find(-1,!0),_=this,v=this.doc.cm;if(!t||!v)return;Cr(v,function(){var L=t.line,N=kt(t.line),V=ia(v,N);if(V&&(Ja(V),v.curOp.selectionChanged=v.curOp.forceUpdate=!0),v.curOp.updateMaxLine=!0,!Dt(_.doc,L)&&_.height!=null){var Q=_.height;_.height=null;var q=ri(_)-Q;q&&_r(L,L.height+q)}lr(v,"markerChanged",v,e)})},dn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||de(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},dn.prototype.detachLine=function(e){if(this.lines.splice(de(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},le(dn);function jn(e,t,_,v,L){if(v&&v.shared)return El(e,t,_,v,L);if(e.cm&&!e.cm.curOp)return nr(e.cm,jn)(e,t,_,v,L);var N=new dn(e,L),V=bt(t,_);if(v&&K(v,N,!1),V>0||V==0&&N.clearWhenEmpty!==!1)return N;if(N.replacedWith&&(N.collapsed=!0,N.widgetNode=M("span",[N.replacedWith],"CodeMirror-widget"),v.handleMouseEvents||N.widgetNode.setAttribute("cm-ignore-events","true"),v.insertLeft&&(N.widgetNode.insertLeft=!0)),N.collapsed){if(ea(e,t.line,t,_,N)||t.line!=_.line&&ea(e,_.line,t,_,N))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ci()}N.addToHistory&&Oo(e,{from:t,to:_,origin:"markText"},e.sel,NaN);var Q=t.line,q=e.cm,re;if(e.iter(Q,_.line+1,function(we){q&&N.collapsed&&!q.options.lineWrapping&&Nr(we)==q.display.maxLine&&(re=!0),N.collapsed&&Q!=t.line&&_r(we,0),Ai(we,new pn(N,Q==t.line?t.ch:null,Q==_.line?_.ch:null)),++Q}),N.collapsed&&e.iter(t.line,_.line+1,function(we){Dt(e,we)&&_r(we,0)}),N.clearOnEnter&&Ne(N,"beforeCursorEnter",function(){return N.clear()}),N.readOnly&&(Ti(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),N.collapsed&&(N.id=++qo,N.atomic=!0),q){if(re&&(q.curOp.updateMaxLine=!0),N.collapsed)br(q,t.line,_.line+1);else if(N.className||N.startStyle||N.endStyle||N.css||N.attributes||N.title)for(var ye=t.line;ye<=_.line;ye++)on(q,ye,"text");N.atomic&&Ko(q.doc),lr(q,"markerAdded",q,N)}return N}var vi=function(e,t){this.markers=e,this.primary=t;for(var _=0;_<e.length;++_)e[_].parent=this};vi.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();lr(this,"clear")},vi.prototype.find=function(e,t){return this.primary.find(e,t)},le(vi);function El(e,t,_,v,L){v=K(v),v.shared=!1;var N=[jn(e,t,_,v,L)],V=N[0],Q=v.widgetNode;return cn(e,function(q){Q&&(v.widgetNode=Q.cloneNode(!0)),N.push(jn(q,_t(q,t),_t(q,_),v,L));for(var re=0;re<q.linked.length;++re)if(q.linked[re].isParent)return;V=te(N)}),new vi(N,V)}function Zo(e){return e.findMarks(tt(e.first,0),e.clipPos(tt(e.lastLine())),function(t){return t.parent})}function Sl(e,t){for(var _=0;_<t.length;_++){var v=t[_],L=v.find(),N=e.clipPos(L.from),V=e.clipPos(L.to);if(bt(N,V)){var Q=jn(e,N,V,v.primary,v.primary.type);v.markers.push(Q),Q.parent=v}}}function wl(e){for(var t=function(v){var L=e[v],N=[L.primary.doc];cn(L.primary.doc,function(q){return N.push(q)});for(var V=0;V<L.markers.length;V++){var Q=L.markers[V];de(N,Q.doc)==-1&&(Q.parent=null,L.markers.splice(V--,1))}},_=0;_<e.length;_++)t(_)}var Tl=0,xr=function(e,t,_,v,L){if(!(this instanceof xr))return new xr(e,t,_,v,L);_==null&&(_=0),mi.call(this,[new pi([new rr("",null)])]),this.first=_,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=_;var N=tt(_,0);this.sel=ln(N),this.history=new Ki(null),this.id=++Tl,this.modeOption=t,this.lineSep=v,this.direction=L=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),wa(this,{from:N,to:N,text:e}),dr(this,ln(N),Ue)};xr.prototype=Ie(mi.prototype,{constructor:xr,iter:function(e,t,_){_?this.iterN(e-this.first,t-e,_):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var _=0,v=0;v<t.length;++v)_+=t[v].height;this.insertInner(e-this.first,t,_)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=zr(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ir(function(e){var t=tt(this.first,0),_=this.first+this.size-1;Xn(this,{from:t,to:tt(_,dt(this,_).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ai(this.cm,0,0),dr(this,ln(t),Ue)}),replaceRange:function(e,t,_,v){t=_t(this,t),_=_?_t(this,_):t,Hn(this,e,t,_,v)},getRange:function(e,t,_){var v=sr(this,_t(this,e),_t(this,t));return _===!1?v:v.join(_||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Pr(this,e))return dt(this,e)},getLineNumber:function(e){return kt(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=dt(this,e)),Nr(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return _t(this,e)},getCursor:function(e){var t=this.sel.primary(),_;return e==null||e=="head"?_=t.head:e=="anchor"?_=t.anchor:e=="end"||e=="to"||e===!1?_=t.to():_=t.from(),_},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ir(function(e,t,_){Fo(this,_t(this,typeof e=="number"?tt(e,t||0):e),null,_)}),setSelection:ir(function(e,t,_){Fo(this,_t(this,e),_t(this,t||e),_)}),extendSelection:ir(function(e,t,_){Xi(this,_t(this,e),t&&_t(this,t),_)}),extendSelections:ir(function(e,t){Po(this,Xr(this,e),t)}),extendSelectionsBy:ir(function(e,t){var _=pe(this.sel.ranges,e);Po(this,Xr(this,_),t)}),setSelections:ir(function(e,t,_){if(!e.length)return;for(var v=[],L=0;L<e.length;L++)v[L]=new Pt(_t(this,e[L].anchor),_t(this,e[L].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),dr(this,Kr(this.cm,v,t),_)}),addSelection:ir(function(e,t,_){var v=this.sel.ranges.slice(0);v.push(new Pt(_t(this,e),_t(this,t||e))),dr(this,Kr(this.cm,v,v.length-1),_)}),getSelection:function(e){for(var t=this.sel.ranges,_,v=0;v<t.length;v++){var L=sr(this,t[v].from(),t[v].to());_=_?_.concat(L):L}return e===!1?_:_.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],_=this.sel.ranges,v=0;v<_.length;v++){var L=sr(this,_[v].from(),_[v].to());e!==!1&&(L=L.join(e||this.lineSeparator())),t[v]=L}return t},replaceSelection:function(e,t,_){for(var v=[],L=0;L<this.sel.ranges.length;L++)v[L]=e;this.replaceSelections(v,t,_||"+input")},replaceSelections:ir(function(e,t,_){for(var v=[],L=this.sel,N=0;N<L.ranges.length;N++){var V=L.ranges[N];v[N]={from:V.from(),to:V.to(),text:this.splitLines(e[N]),origin:_}}for(var Q=t&&t!="end"&&fl(this,v,t),q=v.length-1;q>=0;q--)Xn(this,v[q]);Q?No(this,Q):this.cm&&Nn(this.cm)}),undo:ir(function(){Wi(this,"undo")}),redo:ir(function(){Wi(this,"redo")}),undoSelection:ir(function(){Wi(this,"undo",!0)}),redoSelection:ir(function(){Wi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,_=0,v=0;v<e.done.length;v++)e.done[v].ranges||++t;for(var L=0;L<e.undone.length;L++)e.undone[L].ranges||++_;return{undo:t,redo:_}},clearHistory:function(){var e=this;this.history=new Ki(this.history.maxGeneration),cn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Kn(this.history.done),undone:Kn(this.history.undone)}},setHistory:function(e){var t=this.history=new Ki(this.history.maxGeneration);t.done=Kn(e.done.slice(0),null,!0),t.undone=Kn(e.undone.slice(0),null,!0)},setGutterMarker:ir(function(e,t,_){return hi(this,e,"gutter",function(v){var L=v.gutterMarkers||(v.gutterMarkers={});return L[t]=_,!_&&ze(L)&&(v.gutterMarkers=null),!0})}),clearGutter:ir(function(e){var t=this;this.iter(function(_){_.gutterMarkers&&_.gutterMarkers[e]&&hi(t,_,"gutter",function(){return _.gutterMarkers[e]=null,ze(_.gutterMarkers)&&(_.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Pr(this,e))return null;if(t=e,e=dt(this,e),!e)return null}else if(t=kt(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ir(function(e,t,_){return hi(this,e,t=="gutter"?"gutter":"class",function(v){var L=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!v[L])v[L]=_;else{if(x(_).test(v[L]))return!1;v[L]+=" "+_}return!0})}),removeLineClass:ir(function(e,t,_){return hi(this,e,t=="gutter"?"gutter":"class",function(v){var L=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",N=v[L];if(N)if(_==null)v[L]=null;else{var V=N.match(x(_));if(!V)return!1;var Q=V.index+V[0].length;v[L]=N.slice(0,V.index)+(!V.index||Q==N.length?"":" ")+N.slice(Q)||null}else return!1;return!0})}),addLineWidget:ir(function(e,t,_){return xl(this,e,t,_)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,_){return jn(this,_t(this,e),_t(this,t),_,_&&_.type||"range")},setBookmark:function(e,t){var _={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=_t(this,e),jn(this,e,e,_,"bookmark")},findMarksAt:function(e){e=_t(this,e);var t=[],_=dt(this,e.line).markedSpans;if(_)for(var v=0;v<_.length;++v){var L=_[v];(L.from==null||L.from<=e.ch)&&(L.to==null||L.to>=e.ch)&&t.push(L.marker.parent||L.marker)}return t},findMarks:function(e,t,_){e=_t(this,e),t=_t(this,t);var v=[],L=e.line;return this.iter(e.line,t.line+1,function(N){var V=N.markedSpans;if(V)for(var Q=0;Q<V.length;Q++){var q=V[Q];!(q.to!=null&&L==e.line&&e.ch>=q.to||q.from==null&&L!=e.line||q.from!=null&&L==t.line&&q.from>=t.ch)&&(!_||_(q.marker))&&v.push(q.marker.parent||q.marker)}++L}),v},getAllMarks:function(){var e=[];return this.iter(function(t){var _=t.markedSpans;if(_)for(var v=0;v<_.length;++v)_[v].from!=null&&e.push(_[v].marker)}),e},posFromIndex:function(e){var t,_=this.first,v=this.lineSeparator().length;return this.iter(function(L){var N=L.text.length+v;if(N>e)return t=e,!0;e-=N,++_}),_t(this,tt(_,t))},indexFromPos:function(e){e=_t(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var _=this.lineSeparator().length;return this.iter(this.first,e.line,function(v){t+=v.text.length+_}),t},copy:function(e){var t=new xr(zr(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,_=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<_&&(_=e.to);var v=new xr(zr(this,t,_),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(v.history=this.history),(this.linked||(this.linked=[])).push({doc:v,sharedHist:e.sharedHist}),v.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Sl(v,Zo(this)),v},unlinkDoc:function(e){if(e instanceof jt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var _=this.linked[t];if(_.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),wl(Zo(this));break}if(e.history==this.history){var v=[e.id];cn(e,function(L){return v.push(L.id)},!0),e.history=new Ki(null),e.history.done=Kn(this.history.done,v),e.history.undone=Kn(this.history.undone,v)}},iterLinkedDocs:function(e){cn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):rt(e)},lineSeparator:function(){return this.lineSep||`
|
|
|
`},setDirection:ir(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&hl(this.cm)})}),xr.prototype.eachLine=xr.prototype.iter;var $o=0;function Cl(e){var t=this;if(Jo(t),Oe(t,e)||Jr(t.display,e))return;Y(e),E&&($o=+new Date);var _=yn(t,e,!0),v=e.dataTransfer.files;if(!_||t.isReadOnly())return;if(v&&v.length&&window.FileReader&&window.File)for(var L=v.length,N=Array(L),V=0,Q=function(){++V==L&&nr(t,function(){_=_t(t.doc,_);var He={from:_,to:_,text:t.doc.splitLines(N.filter(function(Qe){return Qe!=null}).join(t.doc.lineSeparator())),origin:"paste"};Xn(t.doc,He),No(t.doc,ln(_t(t.doc,_),_t(t.doc,un(He))))})()},q=function(He,Qe){if(t.options.allowDropFileTypes&&de(t.options.allowDropFileTypes,He.type)==-1){Q();return}var Ze=new FileReader;Ze.onerror=function(){return Q()},Ze.onload=function(){var nt=Ze.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(nt)){Q();return}N[Qe]=nt,Q()},Ze.readAsText(He)},re=0;re<v.length;re++)q(v[re],re);else{if(t.state.draggingText&&t.doc.sel.contains(_)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var ye=e.dataTransfer.getData("Text");if(ye){var we;if(t.state.draggingText&&!t.state.draggingText.copy&&(we=t.listSelections()),Hi(t.doc,ln(_,_)),we)for(var je=0;je<we.length;++je)Hn(t.doc,"",we[je].anchor,we[je].head,"drag");t.replaceSelection(ye,"around","paste"),t.display.input.focus()}}catch(He){}}}function Al(e,t){if(E&&(!e.state.draggingText||+new Date-$o<100)){oe(t);return}if(Oe(e,t)||Jr(e.display,t))return;if(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!s){var _=g("img",null,null,"position: fixed; left: 0; top: 0;");_.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(_.width=_.height=1,e.display.wrapper.appendChild(_),_._top=_.offsetTop),t.dataTransfer.setDragImage(_,0,0),d&&_.parentNode.removeChild(_)}}function Ll(e,t){var _=yn(e,t);if(!_)return;var v=document.createDocumentFragment();co(e,_,v),e.display.dragCursor||(e.display.dragCursor=g("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),C(e.display.dragCursor,v)}function Jo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function es(e){if(!document.getElementsByClassName)return;for(var t=document.getElementsByClassName("CodeMirror"),_=[],v=0;v<t.length;v++){var L=t[v].CodeMirror;L&&_.push(L)}_.length&&_[0].operation(function(){for(var N=0;N<_.length;N++)e(_[N])})}var ts=!1;function kl(){if(ts)return;Rl(),ts=!0}function Rl(){var e;Ne(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,es(Dl)},100))}),Ne(window,"blur",function(){return es(Fn)})}function Dl(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var fn={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"},_i=0;_i<10;_i++)fn[_i+48]=fn[_i+96]=String(_i);for(var zi=65;zi<=90;zi++)fn[zi]=String.fromCharCode(zi);for(var yi=1;yi<=12;yi++)fn[yi+111]=fn[yi+63235]="F"+yi;var en={};en.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"},en.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"},en.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"},en.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"]},en.default=f?en.macDefault:en.pcDefault;function Ol(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var _,v,L,N,V=0;V<t.length-1;V++){var Q=t[V];if(/^(cmd|meta|m)$/i.test(Q))N=!0;else if(/^a(lt)?$/i.test(Q))_=!0;else if(/^(c|ctrl|control)$/i.test(Q))v=!0;else if(/^s(hift)?$/i.test(Q))L=!0;else throw new Error("Unrecognized modifier name: "+Q)}return _&&(e="Alt-"+e),v&&(e="Ctrl-"+e),N&&(e="Cmd-"+e),L&&(e="Shift-"+e),e}function Ml(e){var t={};for(var _ in e)if(e.hasOwnProperty(_)){var v=e[_];if(/^(name|fallthrough|(de|at)tach)$/.test(_))continue;if(v=="..."){delete e[_];continue}for(var L=pe(_.split(" "),Ol),N=0;N<L.length;N++){var V=void 0,Q=void 0;N==L.length-1?(Q=L.join(" "),V=v):(Q=L.slice(0,N+1).join(" "),V="...");var q=t[Q];if(!q)t[Q]=V;else if(q!=V)throw new Error("Inconsistent bindings for "+Q)}delete e[_]}for(var re in t)e[re]=t[re];return e}function Wn(e,t,_,v){t=Gi(t);var L=t.call?t.call(e,v):t[e];if(L===!1)return"nothing";if(L==="...")return"multi";if(L!=null&&_(L))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Wn(e,t.fallthrough,_,v);for(var N=0;N<t.fallthrough.length;N++){var V=Wn(e,t.fallthrough[N],_,v);if(V)return V}}}function rs(e){var t=typeof e=="string"?e:fn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function ns(e,t,_){var v=e;return t.altKey&&v!="Alt"&&(e="Alt-"+e),(T?t.metaKey:t.ctrlKey)&&v!="Ctrl"&&(e="Ctrl-"+e),(T?t.ctrlKey:t.metaKey)&&v!="Mod"&&(e="Cmd-"+e),!_&&t.shiftKey&&v!="Shift"&&(e="Shift-"+e),e}function is(e,t){if(d&&e.keyCode==34&&e.char)return!1;var _=fn[e.keyCode];return _==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(_=e.code),ns(_,e,t))}function Gi(e){return typeof e=="string"?en[e]:e}function zn(e,t){for(var _=e.doc.sel.ranges,v=[],L=0;L<_.length;L++){for(var N=t(_[L]);v.length&&bt(N.from,te(v).to)<=0;){var V=v.pop();if(bt(V.from,N.from)<0){N.from=V.from;break}}v.push(N)}Cr(e,function(){for(var Q=v.length-1;Q>=0;Q--)Hn(e.doc,"",v[Q].from,v[Q].to,"+delete");Nn(e)})}function La(e,t,_){var v=Te(e.text,t+_,_);return v<0||v>e.text.length?null:v}function ka(e,t,_){var v=La(e,t.ch,_);return v==null?null:new tt(t.line,v,_<0?"after":"before")}function Ra(e,t,_,v,L){if(e){t.doc.direction=="rtl"&&(L=-L);var N=We(_,t.doc.direction);if(N){var V=L<0?te(N):N[0],Q=L<0==(V.level==1),q=Q?"after":"before",re;if(V.level>0||t.doc.direction=="rtl"){var ye=Mn(t,_);re=L<0?_.text.length-1:0;var we=jr(t,ye,re).top;re=Ee(function(je){return jr(t,ye,je).top==we},L<0==(V.level==1)?V.from:V.to-1,re),q=="before"&&(re=La(_,re,1))}else re=L<0?V.to:V.from;return new tt(v,re,q)}}return new tt(v,L<0?_.text.length:0,L<0?"before":"after")}function Il(e,t,_,v){var L=We(t,e.doc.direction);if(!L)return ka(t,_,v);_.ch>=t.text.length?(_.ch=t.text.length,_.sticky="before"):_.ch<=0&&(_.ch=0,_.sticky="after");var N=J(L,_.ch,_.sticky),V=L[N];if(e.doc.direction=="ltr"&&V.level%2==0&&(v>0?V.to>_.ch:V.from<_.ch))return ka(t,_,v);var Q=function(ot,ut){return La(t,ot instanceof tt?ot.ch:ot,ut)},q,re=function(ot){return e.options.lineWrapping?(q=q||Mn(e,t),oo(e,t,q,ot)):{begin:0,end:t.text.length}},ye=re(_.sticky=="before"?Q(_,-1):_.ch);if(e.doc.direction=="rtl"||V.level==1){var we=V.level==1==v<0,je=Q(_,we?1:-1);if(je!=null&&(we?je<=V.to&&je<=ye.end:je>=V.from&&je>=ye.begin)){var He=we?"before":"after";return new tt(_.line,je,He)}}var Qe=function(ot,ut,st){for(var ht=function(Kt,ar){return ar?new tt(_.line,Q(Kt,1),"before"):new tt(_.line,Kt,"after")};ot>=0&&ot<L.length;ot+=ut){var xt=L[ot],mt=ut>0==(xt.level!=1),At=mt?st.begin:Q(st.end,-1);if(xt.from<=At&&At<xt.to)return ht(At,mt);if(At=mt?xt.from:Q(xt.to,-1),st.begin<=At&&At<st.end)return ht(At,mt)}},Ze=Qe(N+v,v,ye);if(Ze)return Ze;var nt=v>0?ye.end:Q(ye.begin,-1);return nt!=null&&!(v>0&&nt==t.text.length)&&(Ze=Qe(v>0?0:L.length-1,v,re(nt)),Ze)?Ze:null}var bi={selectAll:Ho,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ue)},killLine:function(e){return zn(e,function(t){if(t.empty()){var _=dt(e.doc,t.head.line).text.length;return t.head.ch==_&&t.head.line<e.lastLine()?{from:t.head,to:tt(t.head.line+1,0)}:{from:t.head,to:tt(t.head.line,_)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return zn(e,function(t){return{from:tt(t.from().line,0),to:_t(e.doc,tt(t.to().line+1,0))}})},delLineLeft:function(e){return zn(e,function(t){return{from:tt(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return zn(e,function(t){var _=e.charCoords(t.head,"div").top+5,v=e.coordsChar({left:0,top:_},"div");return{from:v,to:t.from()}})},delWrappedLineRight:function(e){return zn(e,function(t){var _=e.charCoords(t.head,"div").top+5,v=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:_},"div");return{from:t.from(),to:v}})},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(tt(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(tt(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return as(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return os(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Pl(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:_},"div")},Me)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:_},"div")},Me)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var _=e.cursorCoords(t.head,"div").top+5,v=e.coordsChar({left:0,top:_},"div");return v.ch<e.getLine(v.line).search(/\S/)?os(e,t.head):v},Me)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],_=e.listSelections(),v=e.options.tabSize,L=0;L<_.length;L++){var N=_[L].from(),V=G(e.getLine(N.line),N.ch,v);t.push(ke(v-V%v))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Cr(e,function(){for(var t=e.listSelections(),_=[],v=0;v<t.length;v++){if(!t[v].empty())continue;var L=t[v].head,N=dt(e.doc,L.line).text;if(N){if(L.ch==N.length&&(L=new tt(L.line,L.ch-1)),L.ch>0)L=new tt(L.line,L.ch+1),e.replaceRange(N.charAt(L.ch-1)+N.charAt(L.ch-2),tt(L.line,L.ch-2),L,"+transpose");else if(L.line>e.doc.first){var V=dt(e.doc,L.line-1).text;V&&(L=new tt(L.line,1),e.replaceRange(N.charAt(0)+e.doc.lineSeparator()+V.charAt(V.length-1),tt(L.line-1,V.length-1),L,"+transpose"))}}_.push(new Pt(L,L))}e.setSelections(_)})},newlineAndIndent:function(e){return Cr(e,function(){for(var t=e.listSelections(),_=t.length-1;_>=0;_--)e.replaceRange(e.doc.lineSeparator(),t[_].anchor,t[_].head,"+input");t=e.listSelections();for(var v=0;v<t.length;v++)e.indentLine(t[v].from().line,null,!0);Nn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function as(e,t){var _=dt(e.doc,t),v=Nr(_);return v!=_&&(t=kt(v)),Ra(!0,e,v,t,1)}function Pl(e,t){var _=dt(e.doc,t),v=Ba(_);return v!=_&&(t=kt(v)),Ra(!0,e,_,t,-1)}function os(e,t){var _=as(e,t.line),v=dt(e.doc,_.line),L=We(v,e.doc.direction);if(!L||L[0].level==0){var N=Math.max(_.ch,v.text.search(/\S/)),V=t.line==_.line&&t.ch<=N&&t.ch;return tt(_.line,V?0:N,_.sticky)}return _}function Vi(e,t,_){if(typeof t=="string"&&(t=bi[t],!t))return!1;e.display.input.ensurePolled();var v=e.display.shift,L=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),_&&(e.display.shift=!1),L=t(e)!=Be}finally{e.display.shift=v,e.state.suppressEdits=!1}return L}function Fl(e,t,_){for(var v=0;v<e.state.keyMaps.length;v++){var L=Wn(t,e.state.keyMaps[v],_,e);if(L)return L}return e.options.extraKeys&&Wn(t,e.options.extraKeys,_,e)||Wn(t,e.options.keyMap,_,e)}var Nl=new ee;function xi(e,t,_,v){var L=e.state.keySeq;if(L){if(rs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Nl.set(50,function(){e.state.keySeq==L&&(e.state.keySeq=null,e.display.input.reset())}),ss(e,L+" "+t,_,v))return!0}return ss(e,t,_,v)}function ss(e,t,_,v){var L=Fl(e,t,v);return L=="multi"&&(e.state.keySeq=t),L=="handled"&&lr(e,"keyHandled",e,t,_),(L=="handled"||L=="multi")&&(Y(_),ha(e)),!!L}function ls(e,t){var _=is(t,!0);return _?t.shiftKey&&!e.state.keySeq?xi(e,"Shift-"+_,t,function(v){return Vi(e,v,!0)})||xi(e,_,t,function(v){if(typeof v=="string"?/^go[A-Z]/.test(v):v.motion)return Vi(e,v)}):xi(e,_,t,function(v){return Vi(e,v)}):!1}function Ul(e,t,_){return xi(e,"'"+_+"'",t,function(v){return Vi(e,v,!0)})}var Da=null;function us(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(t.curOp.focus=B(),Oe(t,e))return;E&&y<11&&e.keyCode==27&&(e.returnValue=!1);var _=e.keyCode;t.display.shift=_==16||e.shiftKey;var v=ls(t,e);d&&(Da=v?_:null,!v&&_==88&&!Je&&(f?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),D&&!f&&!v&&_==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),_==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Kl(t)}function Kl(e){var t=e.display.lineDiv;H(t,"CodeMirror-crosshair");function _(v){(v.keyCode==18||!v.altKey)&&(b(t,"CodeMirror-crosshair"),ne(document,"keyup",_),ne(document,"mouseover",_))}Ne(document,"keyup",_),Ne(document,"mouseover",_)}function cs(e){e.keyCode==16&&(this.doc.sel.shift=!1),Oe(this,e)}function ds(e){var t=this;if(e.target&&e.target!=t.display.input.getField())return;if(Jr(t.display,e)||Oe(t,e)||e.ctrlKey&&!e.altKey||f&&e.metaKey)return;var _=e.keyCode,v=e.charCode;if(d&&_==Da){Da=null,Y(e);return}if(d&&(!e.which||e.which<10)&&ls(t,e))return;var L=String.fromCharCode(v==null?_:v);if(L=="\b")return;if(Ul(t,e,L))return;t.display.input.onKeyPress(e)}var Bl=400,Oa=function(e,t,_){this.time=e,this.pos=t,this.button=_};Oa.prototype.compare=function(e,t,_){return this.time+Bl>e&&bt(t,this.pos)==0&&_==this.button};var Ei,Si;function Xl(e,t){var _=+new Date;return Si&&Si.compare(_,e,t)?(Ei=Si=null,"triple"):Ei&&Ei.compare(_,e,t)?(Si=new Oa(_,e,t),Ei=null,"double"):(Ei=new Oa(_,e,t),Si=null,"single")}function fs(e){var t=this,_=t.display;if(Oe(t,e)||_.activeTouch&&_.input.supportsTouch())return;if(_.input.ensurePolled(),_.shift=e.shiftKey,Jr(_,e)){p||(_.scroller.draggable=!1,setTimeout(function(){return _.scroller.draggable=!0},100));return}if(Ma(t,e))return;var v=yn(t,e),L=X(e),N=v?Xl(v,L):"single";if(window.focus(),L==1&&t.state.selectingText&&t.state.selectingText(e),v&&Hl(t,L,v,N,e))return;L==1?v?Wl(t,v,N,e):Ce(e)==_.scroller&&Y(e):L==2?(v&&Xi(t.doc,v),setTimeout(function(){return _.input.focus()},20)):L==3&&(A?t.display.input.onContextMenu(e):ho(t))}function Hl(e,t,_,v,L){var N="Click";return v=="double"?N="Double"+N:v=="triple"&&(N="Triple"+N),N=(t==1?"Left":t==2?"Middle":"Right")+N,xi(e,ns(N,L),L,function(V){if(typeof V=="string"&&(V=bi[V]),!V)return!1;var Q=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Q=V(e,_)!=Be}finally{e.state.suppressEdits=!1}return Q})}function jl(e,t,_){var v=e.getOption("configureMouse"),L=v?v(e,t,_):{};if(L.unit==null){var N=h?_.shiftKey&&_.metaKey:_.altKey;L.unit=N?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(L.extend==null||e.doc.extend)&&(L.extend=e.doc.extend||_.shiftKey),L.addNew==null&&(L.addNew=f?_.metaKey:_.ctrlKey),L.moveOnDrag==null&&(L.moveOnDrag=!(f?_.altKey:_.ctrlKey)),L}function Wl(e,t,_,v){E?setTimeout(U(fo,e),0):e.curOp.focus=B();var L=jl(e,_,v),N=e.doc.sel,V;e.options.dragDrop&&me&&!e.isReadOnly()&&_=="single"&&(V=N.contains(t))>-1&&(bt((V=N.ranges[V]).from(),t)<0||t.xRel>0)&&(bt(V.to(),t)>0||t.xRel<0)?zl(e,v,t,L):Gl(e,v,t,L)}function zl(e,t,_,v){var L=e.display,N=!1,V=nr(e,function(re){p&&(L.scroller.draggable=!1),e.state.draggingText=!1,ne(L.wrapper.ownerDocument,"mouseup",V),ne(L.wrapper.ownerDocument,"mousemove",Q),ne(L.scroller,"dragstart",q),ne(L.scroller,"drop",V),N||(Y(re),v.addNew||Xi(e.doc,_,null,null,v.extend),p&&!s||E&&y==9?setTimeout(function(){L.wrapper.ownerDocument.body.focus({preventScroll:!0}),L.input.focus()},20):L.input.focus())}),Q=function(re){N=N||Math.abs(t.clientX-re.clientX)+Math.abs(t.clientY-re.clientY)>=10},q=function(){return N=!0};p&&(L.scroller.draggable=!0),e.state.draggingText=V,V.copy=!v.moveOnDrag,L.scroller.dragDrop&&L.scroller.dragDrop(),Ne(L.wrapper.ownerDocument,"mouseup",V),Ne(L.wrapper.ownerDocument,"mousemove",Q),Ne(L.scroller,"dragstart",q),Ne(L.scroller,"drop",V),ho(e),setTimeout(function(){return L.input.focus()},20)}function hs(e,t,_){if(_=="char")return new Pt(t,t);if(_=="word")return e.findWordAt(t);if(_=="line")return new Pt(tt(t.line,0),_t(e.doc,tt(t.line+1,0)));var v=_(e,t);return new Pt(v.from,v.to)}function Gl(e,t,_,v){var L=e.display,N=e.doc;Y(t);var V,Q,q=N.sel,re=q.ranges;if(v.addNew&&!v.extend?(Q=N.sel.contains(_),Q>-1?V=re[Q]:V=new Pt(_,_)):(V=N.sel.primary(),Q=N.sel.primIndex),v.unit=="rectangle")v.addNew||(V=new Pt(_,_)),_=yn(e,t,!0,!0),Q=-1;else{var ye=hs(e,_,v.unit);v.extend?V=Ca(V,ye.anchor,ye.head,v.extend):V=ye}v.addNew?Q==-1?(Q=re.length,dr(N,Kr(e,re.concat([V]),Q),{scroll:!1,origin:"*mouse"})):re.length>1&&re[Q].empty()&&v.unit=="char"&&!v.extend?(dr(N,Kr(e,re.slice(0,Q).concat(re.slice(Q+1)),0),{scroll:!1,origin:"*mouse"}),q=N.sel):Aa(N,Q,V,Le):(Q=0,dr(N,new Dr([V],0),Le),q=N.sel);var we=_;function je(st){if(bt(we,st)==0)return;if(we=st,v.unit=="rectangle"){for(var ht=[],xt=e.options.tabSize,mt=G(dt(N,_.line).text,_.ch,xt),At=G(dt(N,st.line).text,st.ch,xt),Kt=Math.min(mt,At),ar=Math.max(mt,At),zt=Math.min(_.line,st.line),Ar=Math.min(e.lastLine(),Math.max(_.line,st.line));zt<=Ar;zt++){var Er=dt(N,zt).text,qt=Pe(Er,Kt,xt);Kt==ar?ht.push(new Pt(tt(zt,qt),tt(zt,qt))):Er.length>qt&&ht.push(new Pt(tt(zt,qt),tt(zt,Pe(Er,ar,xt))))}ht.length||ht.push(new Pt(_,_)),dr(N,Kr(e,q.ranges.slice(0,Q).concat(ht),Q),{origin:"*mouse",scroll:!1}),e.scrollIntoView(st)}else{var Sr=V,ur=hs(e,st,v.unit),Jt=Sr.anchor,Zt;bt(ur.anchor,Jt)>0?(Zt=ur.head,Jt=Gr(Sr.from(),ur.anchor)):(Zt=ur.anchor,Jt=at(Sr.to(),ur.head));var Vt=q.ranges.slice(0);Vt[Q]=Vl(e,new Pt(_t(N,Jt),Zt)),dr(N,Kr(e,Vt,Q),Le)}}var He=L.wrapper.getBoundingClientRect(),Qe=0;function Ze(st){var ht=++Qe,xt=yn(e,st,!0,v.unit=="rectangle");if(!xt)return;if(bt(xt,we)!=0){e.curOp.focus=B(),je(xt);var mt=Pi(L,N);(xt.line>=mt.to||xt.line<mt.from)&&setTimeout(nr(e,function(){Qe==ht&&Ze(st)}),150)}else{var At=st.clientY<He.top?-20:st.clientY>He.bottom?20:0;At&&setTimeout(nr(e,function(){if(Qe!=ht)return;L.scroller.scrollTop+=At,Ze(st)}),50)}}function nt(st){e.state.selectingText=!1,Qe=Infinity,st&&(Y(st),L.input.focus()),ne(L.wrapper.ownerDocument,"mousemove",ot),ne(L.wrapper.ownerDocument,"mouseup",ut),N.history.lastSelOrigin=null}var ot=nr(e,function(st){st.buttons===0||!X(st)?nt(st):Ze(st)}),ut=nr(e,nt);e.state.selectingText=ut,Ne(L.wrapper.ownerDocument,"mousemove",ot),Ne(L.wrapper.ownerDocument,"mouseup",ut)}function Vl(e,t){var _=t.anchor,v=t.head,L=dt(e.doc,_.line);if(bt(_,v)==0&&_.sticky==v.sticky)return t;var N=We(L);if(!N)return t;var V=J(N,_.ch,_.sticky),Q=N[V];if(Q.from!=_.ch&&Q.to!=_.ch)return t;var q=V+(Q.from==_.ch==(Q.level!=1)?0:1);if(q==0||q==N.length)return t;var re;if(v.line!=_.line)re=(v.line-_.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var ye=J(N,v.ch,v.sticky),we=ye-V||(v.ch-_.ch)*(Q.level==1?-1:1);ye==q-1||ye==q?re=we<0:re=we>0}var je=N[q+(re?-1:0)],He=re==(je.level==1),Qe=He?je.from:je.to,Ze=He?"after":"before";return _.ch==Qe&&_.sticky==Ze?t:new Pt(new tt(_.line,Qe,Ze),v)}function ps(e,t,_,v){var L,N;if(t.touches)L=t.touches[0].clientX,N=t.touches[0].clientY;else try{L=t.clientX,N=t.clientY}catch(je){return!1}if(L>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;v&&Y(t);var V=e.display,Q=V.lineDiv.getBoundingClientRect();if(N>Q.bottom||!ce(e,_))return z(t);N-=Q.top-V.viewOffset;for(var q=0;q<e.display.gutterSpecs.length;++q){var re=V.gutters.childNodes[q];if(re&&re.getBoundingClientRect().right>=L){var ye=Lr(e.doc,N),we=e.display.gutterSpecs[q];return xe(e,_,e,ye,we.className,t),z(t)}}}function Ma(e,t){return ps(e,t,"gutterClick",!0)}function ms(e,t){if(Jr(e.display,t)||Yl(e,t))return;if(Oe(e,t,"contextmenu"))return;A||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(e,"gutterContextMenu")?ps(e,t,"gutterContextMenu",!1):!1}function gs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ni(e)}var Gn={toString:function(){return"CodeMirror.Init"}},vs={},Yi={};function Ql(e){var t=e.optionHandlers;function _(v,L,N,V){e.defaults[v]=L,N&&(t[v]=V?function(Q,q,re){re!=Gn&&N(Q,q,re)}:N)}e.defineOption=_,e.Init=Gn,_("value","",function(v,L){return v.setValue(L)},!0),_("mode",null,function(v,L){v.doc.modeOption=L,Sa(v)},!0),_("indentUnit",2,Sa,!0),_("indentWithTabs",!1),_("smartIndent",!0),_("tabSize",4,function(v){di(v),ni(v),br(v)},!0),_("lineSeparator",null,function(v,L){if(v.doc.lineSep=L,!L)return;var N=[],V=v.doc.first;v.doc.iter(function(q){for(var re=0;;){var ye=q.text.indexOf(L,re);if(ye==-1)break;re=ye+L.length,N.push(tt(V,ye))}V++});for(var Q=N.length-1;Q>=0;Q--)Hn(v.doc,L,N[Q],tt(N[Q].line,N[Q].ch+L.length))}),_("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(v,L,N){v.state.specialChars=new RegExp(L.source+(L.test(" ")?"":"| "),"g"),N!=Gn&&v.refresh()}),_("specialCharPlaceholder",Jn,function(v){return v.refresh()},!0),_("electricChars",!0),_("inputStyle",i?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),_("spellcheck",!1,function(v,L){return v.getInputField().spellcheck=L},!0),_("autocorrect",!1,function(v,L){return v.getInputField().autocorrect=L},!0),_("autocapitalize",!1,function(v,L){return v.getInputField().autocapitalize=L},!0),_("rtlMoveVisually",!w),_("wholeLineUpdateBefore",!0),_("theme","default",function(v){gs(v),ci(v)},!0),_("keyMap","default",function(v,L,N){var V=Gi(L),Q=N!=Gn&&Gi(N);Q&&Q.detach&&Q.detach(v,V),V.attach&&V.attach(v,Q||null)}),_("extraKeys",null),_("configureMouse",null),_("lineWrapping",!1,Zl,!0),_("gutters",[],function(v,L){v.display.gutterSpecs=xa(L,v.options.lineNumbers),ci(v)},!0),_("fixedGutter",!0,function(v,L){v.display.gutters.style.left=L?da(v.display)+"px":"0",v.refresh()},!0),_("coverGutterNextToScrollbar",!1,function(v){return Un(v)},!0),_("scrollbarStyle","native",function(v){yo(v),Un(v),v.display.scrollbars.setScrollTop(v.doc.scrollTop),v.display.scrollbars.setScrollLeft(v.doc.scrollLeft)},!0),_("lineNumbers",!1,function(v,L){v.display.gutterSpecs=xa(v.options.gutters,L),ci(v)},!0),_("firstLineNumber",1,ci,!0),_("lineNumberFormatter",function(v){return v},ci,!0),_("showCursorWhenSelecting",!1,ii,!0),_("resetSelectionOnContextMenu",!0),_("lineWiseCopyCut",!0),_("pasteLinesPerSelection",!0),_("selectionsMayTouch",!1),_("readOnly",!1,function(v,L){L=="nocursor"&&(Fn(v),v.display.input.blur()),v.display.input.readOnlyChanged(L)}),_("screenReaderLabel",null,function(v,L){L=L===""?null:L,v.display.input.screenReaderLabelChanged(L)}),_("disableInput",!1,function(v,L){L||v.display.input.reset()},!0),_("dragDrop",!0,ql),_("allowDropFileTypes",null),_("cursorBlinkRate",530),_("cursorScrollMargin",0),_("cursorHeight",1,ii,!0),_("singleCursorHeightPerLine",!0,ii,!0),_("workTime",100),_("workDelay",100),_("flattenSpans",!0,di,!0),_("addModeClass",!1,di,!0),_("pollInterval",100),_("undoDepth",200,function(v,L){return v.doc.history.undoDepth=L}),_("historyEventDelay",1250),_("viewportMargin",10,function(v){return v.refresh()},!0),_("maxHighlightLength",1e4,di,!0),_("moveInputWithCursor",!0,function(v,L){L||v.display.input.resetPosition()}),_("tabindex",null,function(v,L){return v.display.input.getField().tabIndex=L||""}),_("autofocus",null),_("direction","ltr",function(v,L){return v.doc.setDirection(L)},!0),_("phrases",null)}function ql(e,t,_){var v=_&&_!=Gn;if(!t!=!v){var L=e.display.dragFunctions,N=t?Ne:ne;N(e.display.scroller,"dragstart",L.start),N(e.display.scroller,"dragenter",L.enter),N(e.display.scroller,"dragover",L.over),N(e.display.scroller,"dragleave",L.leave),N(e.display.scroller,"drop",L.drop)}}function Zl(e){e.options.lineWrapping?(H(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),tr(e)),fa(e),br(e),ni(e),setTimeout(function(){return Un(e)},100)}function jt(e,t){var _=this;if(!(this instanceof jt))return new jt(e,t);this.options=t=t?K(t):{},K(vs,t,!1);var v=t.value;typeof v=="string"?v=new xr(v,t.mode,null,t.lineSeparator,t.direction):t.mode&&(v.modeOption=t.mode),this.doc=v;var L=new jt.inputStyles[t.inputStyle](this),N=this.display=new cl(e,v,L,t);N.wrapper.CodeMirror=this,gs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),yo(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 ee,keySeq:null,specialChars:null},t.autofocus&&!i&&N.input.focus(),E&&y<11&&setTimeout(function(){return _.display.input.reset(!0)},20),$l(this),kl(),Sn(this),this.curOp.forceUpdate=!0,ko(this,v),t.autofocus&&!i||this.hasFocus()?setTimeout(function(){_.hasFocus()&&!_.state.focused&&pa(_)},20):Fn(this);for(var V in Yi)Yi.hasOwnProperty(V)&&Yi[V](this,t[V],Gn);Eo(this),t.finishInit&&t.finishInit(this);for(var Q=0;Q<Ia.length;++Q)Ia[Q](this);wn(this),p&&t.lineWrapping&&getComputedStyle(N.lineDiv).textRendering=="optimizelegibility"&&(N.lineDiv.style.textRendering="auto")}jt.defaults=vs,jt.optionHandlers=Yi;function $l(e){var t=e.display;Ne(t.scroller,"mousedown",nr(e,fs)),E&&y<11?Ne(t.scroller,"dblclick",nr(e,function(q){if(Oe(e,q))return;var re=yn(e,q);if(!re||Ma(e,q)||Jr(e.display,q))return;Y(q);var ye=e.findWordAt(re);Xi(e.doc,ye.anchor,ye.head)})):Ne(t.scroller,"dblclick",function(q){return Oe(e,q)||Y(q)}),Ne(t.scroller,"contextmenu",function(q){return ms(e,q)}),Ne(t.input.getField(),"contextmenu",function(q){t.scroller.contains(q.target)||ms(e,q)});var _,v={end:0};function L(){t.activeTouch&&(_=setTimeout(function(){return t.activeTouch=null},1e3),v=t.activeTouch,v.end=+new Date)}function N(q){if(q.touches.length!=1)return!1;var re=q.touches[0];return re.radiusX<=1&&re.radiusY<=1}function V(q,re){if(re.left==null)return!0;var ye=re.left-q.left,we=re.top-q.top;return ye*ye+we*we>20*20}Ne(t.scroller,"touchstart",function(q){if(!Oe(e,q)&&!N(q)&&!Ma(e,q)){t.input.ensurePolled(),clearTimeout(_);var re=+new Date;t.activeTouch={start:re,moved:!1,prev:re-v.end<=300?v:null},q.touches.length==1&&(t.activeTouch.left=q.touches[0].pageX,t.activeTouch.top=q.touches[0].pageY)}}),Ne(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ne(t.scroller,"touchend",function(q){var re=t.activeTouch;if(re&&!Jr(t,q)&&re.left!=null&&!re.moved&&new Date-re.start<300){var ye=e.coordsChar(t.activeTouch,"page"),we;!re.prev||V(re,re.prev)?we=new Pt(ye,ye):!re.prev.prev||V(re,re.prev.prev)?we=e.findWordAt(ye):we=new Pt(tt(ye.line,0),_t(e.doc,tt(ye.line+1,0))),e.setSelection(we.anchor,we.head),e.focus(),Y(q)}L()}),Ne(t.scroller,"touchcancel",L),Ne(t.scroller,"scroll",function(){t.scroller.clientHeight&&(oi(e,t.scroller.scrollTop),xn(e,t.scroller.scrollLeft,!0),xe(e,"scroll",e))}),Ne(t.scroller,"mousewheel",function(q){return To(e,q)}),Ne(t.scroller,"DOMMouseScroll",function(q){return To(e,q)}),Ne(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(q){Oe(e,q)||oe(q)},over:function(q){Oe(e,q)||(Ll(e,q),oe(q))},start:function(q){return Al(e,q)},drop:nr(e,Cl),leave:function(q){Oe(e,q)||Jo(e)}};var Q=t.input.getField();Ne(Q,"keyup",function(q){return cs.call(e,q)}),Ne(Q,"keydown",nr(e,us)),Ne(Q,"keypress",nr(e,ds)),Ne(Q,"focus",function(q){return pa(e,q)}),Ne(Q,"blur",function(q){return Fn(e,q)})}var Ia=[];jt.defineInitHook=function(e){return Ia.push(e)};function wi(e,t,_,v){var L=e.doc,N;_==null&&(_="add"),_=="smart"&&(L.mode.indent?N=Ve(e,t).state:_="prev");var V=e.options.tabSize,Q=dt(L,t),q=G(Q.text,null,V);Q.stateAfter&&(Q.stateAfter=null);var re=Q.text.match(/^\s*/)[0],ye;if(!v&&!/\S/.test(Q.text))ye=0,_="not";else if(_=="smart"&&(ye=L.mode.indent(N,Q.text.slice(re.length),Q.text),ye==Be||ye>150)){if(!v)return;_="prev"}_=="prev"?t>L.first?ye=G(dt(L,t-1).text,null,V):ye=0:_=="add"?ye=q+e.options.indentUnit:_=="subtract"?ye=q-e.options.indentUnit:typeof _=="number"&&(ye=q+_),ye=Math.max(0,ye);var we="",je=0;if(e.options.indentWithTabs)for(var He=Math.floor(ye/V);He;--He)je+=V,we+=" ";if(je<ye&&(we+=ke(ye-je)),we!=re)return Hn(L,we,tt(t,0),tt(t,re.length),"+input"),Q.stateAfter=null,!0;for(var Qe=0;Qe<L.sel.ranges.length;Qe++){var Ze=L.sel.ranges[Qe];if(Ze.head.line==t&&Ze.head.ch<re.length){var nt=tt(t,re.length);Aa(L,Qe,new Pt(nt,nt));break}}}var Br=null;function Qi(e){Br=e}function Pa(e,t,_,v,L){var N=e.doc;e.display.shift=!1,v||(v=N.sel);var V=+new Date-200,Q=L=="paste"||e.state.pasteIncoming>V,q=rt(t),re=null;if(Q&&v.ranges.length>1)if(Br&&Br.text.join(`
|
|
|
`)==t){if(v.ranges.length%Br.text.length==0){re=[];for(var ye=0;ye<Br.text.length;ye++)re.push(N.splitLines(Br.text[ye]))}}else q.length==v.ranges.length&&e.options.pasteLinesPerSelection&&(re=pe(q,function(ot){return[ot]}));for(var we=e.curOp.updateInput,je=v.ranges.length-1;je>=0;je--){var He=v.ranges[je],Qe=He.from(),Ze=He.to();He.empty()&&(_&&_>0?Qe=tt(Qe.line,Qe.ch-_):e.state.overwrite&&!Q?Ze=tt(Ze.line,Math.min(dt(N,Ze.line).text.length,Ze.ch+te(q).length)):Q&&Br&&Br.lineWise&&Br.text.join(`
|
|
|
`)==q.join(`
|
|
|
`)&&(Qe=Ze=tt(Qe.line,0)));var nt={from:Qe,to:Ze,text:re?re[je%re.length]:q,origin:L||(Q?"paste":e.state.cutIncoming>V?"cut":"+input")};Xn(e.doc,nt),lr(e,"inputRead",e,nt)}t&&!Q&&ys(e,t),Nn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=we),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function _s(e,t){var _=e.clipboardData&&e.clipboardData.getData("Text");if(_)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Cr(t,function(){return Pa(t,_,0,null,"paste")}),!0}function ys(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var _=e.doc.sel,v=_.ranges.length-1;v>=0;v--){var L=_.ranges[v];if(L.head.ch>100||v&&_.ranges[v-1].head.line==L.head.line)continue;var N=e.getModeAt(L.head),V=!1;if(N.electricChars){for(var Q=0;Q<N.electricChars.length;Q++)if(t.indexOf(N.electricChars.charAt(Q))>-1){V=wi(e,L.head.line,"smart");break}}else N.electricInput&&(N.electricInput.test(dt(e.doc,L.head.line).text.slice(0,L.head.ch))&&(V=wi(e,L.head.line,"smart")));V&&lr(e,"electricInput",e,L.head.line)}}function bs(e){for(var t=[],_=[],v=0;v<e.doc.sel.ranges.length;v++){var L=e.doc.sel.ranges[v].head.line,N={anchor:tt(L,0),head:tt(L+1,0)};_.push(N),t.push(e.getRange(N.anchor,N.head))}return{text:t,ranges:_}}function xs(e,t,_,v){e.setAttribute("autocorrect",_?"":"off"),e.setAttribute("autocapitalize",v?"":"off"),e.setAttribute("spellcheck",!!t)}function Es(){var e=g("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=g("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return p?e.style.width="1000px":e.setAttribute("wrap","off"),n&&(e.style.border="1px solid black"),xs(e),t}function Jl(e){var t=e.optionHandlers,_=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(v,L){var N=this.options,V=N[v];if(N[v]==L&&v!="mode")return;N[v]=L,t.hasOwnProperty(v)&&nr(this,t[v])(this,L,V),xe(this,"optionChange",this,v)},getOption:function(v){return this.options[v]},getDoc:function(){return this.doc},addKeyMap:function(v,L){this.state.keyMaps[L?"push":"unshift"](Gi(v))},removeKeyMap:function(v){for(var L=this.state.keyMaps,N=0;N<L.length;++N)if(L[N]==v||L[N].name==v)return L.splice(N,1),!0},addOverlay:gr(function(v,L){var N=v.token?v:e.getMode(this.options,v);if(N.startState)throw new Error("Overlays may not be stateful.");ae(this.state.overlays,{mode:N,modeSpec:v,opaque:L&&L.opaque,priority:L&&L.priority||0},function(V){return V.priority}),this.state.modeGen++,br(this)}),removeOverlay:gr(function(v){for(var L=this.state.overlays,N=0;N<L.length;++N){var V=L[N].modeSpec;if(V==v||typeof v=="string"&&V.name==v){L.splice(N,1),this.state.modeGen++,br(this);return}}}),indentLine:gr(function(v,L,N){typeof L!="string"&&typeof L!="number"&&(L==null?L=this.options.smartIndent?"smart":"prev":L=L?"add":"subtract"),Pr(this.doc,v)&&wi(this,v,L,N)}),indentSelection:gr(function(v){for(var L=this.doc.sel.ranges,N=-1,V=0;V<L.length;V++){var Q=L[V];if(Q.empty())Q.head.line>N&&(wi(this,Q.head.line,v,!0),N=Q.head.line,V==this.doc.sel.primIndex&&Nn(this));else{var q=Q.from(),re=Q.to(),ye=Math.max(N,q.line);N=Math.min(this.lastLine(),re.line-(re.ch?0:1))+1;for(var we=ye;we<N;++we)wi(this,we,v);var je=this.doc.sel.ranges;q.ch==0&&L.length==je.length&&je[V].from().ch>0&&Aa(this.doc,V,new Pt(q,je[V].to()),Ue)}}}),getTokenAt:function(v,L){return er(this,v,L)},getLineTokens:function(v,L){return er(this,tt(v),L,!0)},getTokenTypeAt:function(v){v=_t(this.doc,v);var L=gt(this,dt(this.doc,v.line)),N=0,V=(L.length-1)/2,Q=v.ch,q;if(Q==0)q=L[2];else for(;;){var re=N+V>>1;if((re?L[re*2-1]:0)>=Q)V=re;else if(L[re*2+1]<Q)N=re+1;else{q=L[re*2+2];break}}var ye=q?q.indexOf("overlay "):-1;return ye<0?q:ye==0?null:q.slice(0,ye-1)},getModeAt:function(v){var L=this.doc.mode;return L.innerMode?e.innerMode(L,this.getTokenAt(v).state).mode:L},getHelper:function(v,L){return this.getHelpers(v,L)[0]},getHelpers:function(v,L){var N=[];if(!_.hasOwnProperty(L))return N;var V=_[L],Q=this.getModeAt(v);if(typeof Q[L]=="string")V[Q[L]]&&N.push(V[Q[L]]);else if(Q[L])for(var q=0;q<Q[L].length;q++){var re=V[Q[L][q]];re&&N.push(re)}else Q.helperType&&V[Q.helperType]?N.push(V[Q.helperType]):V[Q.name]&&N.push(V[Q.name]);for(var ye=0;ye<V._global.length;ye++){var we=V._global[ye];we.pred(Q,this)&&de(N,we.val)==-1&&N.push(we.val)}return N},getStateAfter:function(v,L){var N=this.doc;return v=An(N,v==null?N.first+N.size-1:v),Ve(this,v+1,L).state},cursorCoords:function(v,L){var N,V=this.doc.sel.primary();return v==null?N=V.head:typeof v=="object"?N=_t(this.doc,v):N=v?V.from():V.to(),Ur(this,N,L||"page")},charCoords:function(v,L){return oa(this,_t(this.doc,v),L||"page")},coordsChar:function(v,L){return v=no(this,v,L||"page"),la(this,v.left,v.top)},lineAtHeight:function(v,L){return v=no(this,{top:v,left:0},L||"page").top,Lr(this.doc,v+this.display.viewOffset)},heightAtLine:function(v,L,N){var V=!1,Q;if(typeof v=="number"){var q=this.doc.first+this.doc.size-1;v<this.doc.first?v=this.doc.first:v>q&&(v=q,V=!0),Q=dt(this.doc,v)}else Q=v;return Di(this,Q,{top:0,left:0},L||"page",N||V).top+(V?this.doc.height-Xt(Q):0)},defaultTextHeight:function(){return In(this.display)},defaultCharWidth:function(){return Pn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(v,L,N,V,Q){var q=this.display;v=Ur(this,_t(this.doc,v));var re=v.bottom,ye=v.left;if(L.style.position="absolute",L.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(L),q.sizer.appendChild(L),V=="over")re=v.top;else if(V=="above"||V=="near"){var we=Math.max(q.wrapper.clientHeight,this.doc.height),je=Math.max(q.sizer.clientWidth,q.lineSpace.clientWidth);(V=="above"||v.bottom+L.offsetHeight>we)&&v.top>L.offsetHeight?re=v.top-L.offsetHeight:v.bottom+L.offsetHeight<=we&&(re=v.bottom),ye+L.offsetWidth>je&&(ye=je-L.offsetWidth)}L.style.top=re+"px",L.style.left=L.style.right="",Q=="right"?(ye=q.sizer.clientWidth-L.offsetWidth,L.style.right="0px"):(Q=="left"?ye=0:Q=="middle"&&(ye=(q.sizer.clientWidth-L.offsetWidth)/2),L.style.left=ye+"px"),N&&qs(this,{left:ye,top:re,right:ye+L.offsetWidth,bottom:re+L.offsetHeight})},triggerOnKeyDown:gr(us),triggerOnKeyPress:gr(ds),triggerOnKeyUp:cs,triggerOnMouseDown:gr(fs),execCommand:function(v){if(bi.hasOwnProperty(v))return bi[v].call(null,this)},triggerElectric:gr(function(v){ys(this,v)}),findPosH:function(v,L,N,V){var Q=1;L<0&&(Q=-1,L=-L);for(var q=_t(this.doc,v),re=0;re<L&&!(q=Fa(this.doc,q,Q,N,V),q.hitSide);++re);return q},moveH:gr(function(v,L){var N=this;this.extendSelectionsBy(function(V){return N.display.shift||N.doc.extend||V.empty()?Fa(N.doc,V.head,v,L,N.options.rtlMoveVisually):v<0?V.from():V.to()},Me)}),deleteH:gr(function(v,L){var N=this.doc.sel,V=this.doc;N.somethingSelected()?V.replaceSelection("",null,"+delete"):zn(this,function(Q){var q=Fa(V,Q.head,v,L,!1);return v<0?{from:q,to:Q.head}:{from:Q.head,to:q}})}),findPosV:function(v,L,N,V){var Q=1,q=V;L<0&&(Q=-1,L=-L);for(var re=_t(this.doc,v),ye=0;ye<L;++ye){var we=Ur(this,re,"div");if(q==null?q=we.left:we.left=q,re=Ss(this,we,Q,N),re.hitSide)break}return re},moveV:gr(function(v,L){var N=this,V=this.doc,Q=[],q=!this.display.shift&&!V.extend&&V.sel.somethingSelected();if(V.extendSelectionsBy(function(ye){if(q)return v<0?ye.from():ye.to();var we=Ur(N,ye.head,"div");ye.goalColumn!=null&&(we.left=ye.goalColumn),Q.push(we.left);var je=Ss(N,we,v,L);return L=="page"&&ye==V.sel.primary()&&ga(N,oa(N,je,"div").top-we.top),je},Me),Q.length)for(var re=0;re<V.sel.ranges.length;re++)V.sel.ranges[re].goalColumn=Q[re]}),findWordAt:function(v){var L=this.doc,N=dt(L,v.line).text,V=v.ch,Q=v.ch;if(N){var q=this.getHelper(v,"wordChars");(v.sticky=="before"||Q==N.length)&&V?--V:++Q;for(var re=N.charAt(V),ye=Ge(re,q)?function(we){return Ge(we,q)}:/\s/.test(re)?function(we){return/\s/.test(we)}:function(we){return!/\s/.test(we)&&!Ge(we)};V>0&&ye(N.charAt(V-1));)--V;for(;Q<N.length&&ye(N.charAt(Q));)++Q}return new Pt(tt(v.line,V),tt(v.line,Q))},toggleOverwrite:function(v){if(v!=null&&v==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?H(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),xe(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==B()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:gr(function(v,L){ai(this,v,L)}),getScrollInfo:function(){var v=this.display.scroller;return{left:v.scrollLeft,top:v.scrollTop,height:v.scrollHeight-Hr(this)-this.display.barHeight,width:v.scrollWidth-Hr(this)-this.display.barWidth,clientHeight:na(this),clientWidth:vn(this)}},scrollIntoView:gr(function(v,L){v==null?(v={from:this.doc.sel.primary().head,to:null},L==null&&(L=this.options.cursorScrollMargin)):typeof v=="number"?v={from:tt(v,0),to:null}:v.from==null&&(v={from:v,to:null}),v.to||(v.to=v.from),v.margin=L||0,v.from.line!=null?Zs(this,v):mo(this,v.from,v.to,v.margin)}),setSize:gr(function(v,L){var N=this,V=function(q){return typeof q=="number"||/^\d+$/.test(String(q))?q+"px":q};v!=null&&(this.display.wrapper.style.width=V(v)),L!=null&&(this.display.wrapper.style.height=V(L)),this.options.lineWrapping&&eo(this);var Q=this.display.viewFrom;this.doc.iter(Q,this.display.viewTo,function(q){if(q.widgets){for(var re=0;re<q.widgets.length;re++)if(q.widgets[re].noHScroll){on(N,Q,"widget");break}}++Q}),this.curOp.forceUpdate=!0,xe(this,"refresh",this)}),operation:function(v){return Cr(this,v)},startOperation:function(){return Sn(this)},endOperation:function(){return wn(this)},refresh:gr(function(){var v=this.display.cachedTextHeight;br(this),this.curOp.forceUpdate=!0,ni(this),ai(this,this.doc.scrollLeft,this.doc.scrollTop),ya(this.display),(v==null||Math.abs(v-In(this.display))>.5||this.options.lineWrapping)&&fa(this),xe(this,"refresh",this)}),swapDoc:gr(function(v){var L=this.doc;return L.cm=null,this.state.selectingText&&this.state.selectingText(),ko(this,v),ni(this),this.display.input.reset(),ai(this,v.scrollLeft,v.scrollTop),this.curOp.forceScroll=!0,lr(this,"swapDoc",this,L),L}),phrase:function(v){var L=this.options.phrases;return L&&Object.prototype.hasOwnProperty.call(L,v)?L[v]:v},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}},le(e),e.registerHelper=function(v,L,N){_.hasOwnProperty(v)||(_[v]=e[v]={_global:[]}),_[v][L]=N},e.registerGlobalHelper=function(v,L,N,V){e.registerHelper(v,L,V),_[v]._global.push({pred:N,val:V})}}function Fa(e,t,_,v,L){var N=t,V=_,Q=dt(e,t.line),q=L&&e.direction=="rtl"?-_:_;function re(){var ut=t.line+q;return ut<e.first||ut>=e.first+e.size?!1:(t=new tt(ut,t.ch,t.sticky),Q=dt(e,ut))}function ye(ut){var st;if(v=="codepoint"){var ht=Q.text.charCodeAt(t.ch+(v>0?0:-1));isNaN(ht)?st=null:st=new tt(t.line,Math.max(0,Math.min(Q.text.length,t.ch+_*(ht>=55296&&ht<56320?2:1))),-_)}else L?st=Il(e.cm,Q,t,_):st=ka(Q,t,_);if(st==null)if(!ut&&re())t=Ra(L,e.cm,Q,t.line,q);else return!1;else t=st;return!0}if(v=="char"||v=="codepoint")ye();else if(v=="column")ye(!0);else if(v=="word"||v=="group")for(var we=null,je=v=="group",He=e.cm&&e.cm.getHelper(t,"wordChars"),Qe=!0;!(_<0&&!ye(!Qe));Qe=!1){var Ze=Q.text.charAt(t.ch)||`
|
|
|
`,nt=Ge(Ze,He)?"w":je&&Ze==`
|
|
|
`?"n":!je||/\s/.test(Ze)?null:"p";if(je&&!Qe&&!nt&&(nt="s"),we&&we!=nt){_<0&&(_=1,ye(),t.sticky="after");break}if(nt&&(we=nt),_>0&&!ye(!Qe))break}var ot=ji(e,t,N,V,!0);return kr(N,ot)&&(ot.hitSide=!0),ot}function Ss(e,t,_,v){var L=e.doc,N=t.left,V;if(v=="page"){var Q=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),q=Math.max(Q-.5*In(e.display),3);V=(_>0?t.bottom:t.top)+_*q}else v=="line"&&(V=_>0?t.bottom+3:t.top-3);for(var re;!(re=la(e,N,V),!re.outside);){if(_<0?V<=0:V>=L.height){re.hitSide=!0;break}V+=_*5}return re}var Nt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Nt.prototype.init=function(e){var t=this,_=this,v=_.cm,L=_.div=e.lineDiv;xs(L,v.options.spellcheck,v.options.autocorrect,v.options.autocapitalize);function N(Q){for(var q=Q.target;q;q=q.parentNode){if(q==L)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(q.className))break}return!1}Ne(L,"paste",function(Q){if(!N(Q)||Oe(v,Q)||_s(Q,v))return;y<=11&&setTimeout(nr(v,function(){return t.updateFromDOM()}),20)}),Ne(L,"compositionstart",function(Q){t.composing={data:Q.data,done:!1}}),Ne(L,"compositionupdate",function(Q){t.composing||(t.composing={data:Q.data,done:!1})}),Ne(L,"compositionend",function(Q){t.composing&&(Q.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ne(L,"touchstart",function(){return _.forceCompositionEnd()}),Ne(L,"input",function(){t.composing||t.readFromDOMSoon()});function V(Q){if(!N(Q)||Oe(v,Q))return;if(v.somethingSelected())Qi({lineWise:!1,text:v.getSelections()}),Q.type=="cut"&&v.replaceSelection("",null,"cut");else if(v.options.lineWiseCopyCut){var q=bs(v);Qi({lineWise:!0,text:q.text}),Q.type=="cut"&&v.operation(function(){v.setSelections(q.ranges,0,Ue),v.replaceSelection("",null,"cut")})}else return;if(Q.clipboardData){Q.clipboardData.clearData();var re=Br.text.join(`
|
|
|
`);if(Q.clipboardData.setData("Text",re),Q.clipboardData.getData("Text")==re){Q.preventDefault();return}}var ye=Es(),we=ye.firstChild;v.display.lineSpace.insertBefore(ye,v.display.lineSpace.firstChild),we.value=Br.text.join(`
|
|
|
`);var je=document.activeElement;W(we),setTimeout(function(){v.display.lineSpace.removeChild(ye),je.focus(),je==L&&_.showPrimarySelection()},50)}Ne(L,"copy",V),Ne(L,"cut",V)},Nt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Nt.prototype.prepareSelection=function(){var e=uo(this.cm,!1);return e.focus=document.activeElement==this.div,e},Nt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Nt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Nt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,_=t.doc.sel.primary(),v=_.from(),L=_.to();if(t.display.viewTo==t.display.viewFrom||v.line>=t.display.viewTo||L.line<t.display.viewFrom){e.removeAllRanges();return}var N=qi(t,e.anchorNode,e.anchorOffset),V=qi(t,e.focusNode,e.focusOffset);if(N&&!N.bad&&V&&!V.bad&&bt(Gr(N,V),v)==0&&bt(at(N,V),L)==0)return;var Q=t.display.view,q=v.line>=t.display.viewFrom&&ws(t,v)||{node:Q[0].measure.map[2],offset:0},re=L.line<t.display.viewTo&&ws(t,L);if(!re){var ye=Q[Q.length-1].measure,we=ye.maps?ye.maps[ye.maps.length-1]:ye.map;re={node:we[we.length-1],offset:we[we.length-2]-we[we.length-3]}}if(!q||!re){e.removeAllRanges();return}var je=e.rangeCount&&e.getRangeAt(0),He;try{He=I(q.node,q.offset,re.offset,re.node)}catch(Qe){}He&&(!D&&t.state.focused?(e.collapse(q.node,q.offset),He.collapsed||(e.removeAllRanges(),e.addRange(He))):(e.removeAllRanges(),e.addRange(He)),je&&e.anchorNode==null?e.addRange(je):D&&this.startGracePeriod()),this.rememberSelection()},Nt.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)},Nt.prototype.showMultipleSelections=function(e){C(this.cm.display.cursorDiv,e.cursors),C(this.cm.display.selectionDiv,e.selection)},Nt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Nt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return P(this.div,t)},Nt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Nt.prototype.blur=function(){this.div.blur()},Nt.prototype.getField=function(){return this.div},Nt.prototype.supportsTouch=function(){return!0},Nt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Cr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)},Nt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Nt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),t=this.cm;if(a&&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 _=qi(t,e.anchorNode,e.anchorOffset),v=qi(t,e.focusNode,e.focusOffset);_&&v&&Cr(t,function(){dr(t.doc,ln(_,v),Ue),(_.bad||v.bad)&&(t.curOp.selectionChanged=!0)})},Nt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,_=e.doc.sel.primary(),v=_.from(),L=_.to();if(v.ch==0&&v.line>e.firstLine()&&(v=tt(v.line-1,dt(e.doc,v.line-1).length)),L.ch==dt(e.doc,L.line).text.length&&L.line<e.lastLine()&&(L=tt(L.line+1,0)),v.line<t.viewFrom||L.line>t.viewTo-1)return!1;var N,V,Q;v.line==t.viewFrom||(N=bn(e,v.line))==0?(V=kt(t.view[0].line),Q=t.view[0].node):(V=kt(t.view[N].line),Q=t.view[N-1].node.nextSibling);var q=bn(e,L.line),re,ye;if(q==t.view.length-1?(re=t.viewTo-1,ye=t.lineDiv.lastChild):(re=kt(t.view[q+1].line)-1,ye=t.view[q+1].node.previousSibling),!Q)return!1;for(var we=e.doc.splitLines(tu(e,Q,ye,V,re)),je=sr(e.doc,tt(V,0),tt(re,dt(e.doc,re).text.length));we.length>1&&je.length>1;)if(te(we)==te(je))we.pop(),je.pop(),re--;else if(we[0]==je[0])we.shift(),je.shift(),V++;else break;for(var He=0,Qe=0,Ze=we[0],nt=je[0],ot=Math.min(Ze.length,nt.length);He<ot&&Ze.charCodeAt(He)==nt.charCodeAt(He);)++He;for(var ut=te(we),st=te(je),ht=Math.min(ut.length-(we.length==1?He:0),st.length-(je.length==1?He:0));Qe<ht&&ut.charCodeAt(ut.length-Qe-1)==st.charCodeAt(st.length-Qe-1);)++Qe;if(we.length==1&&je.length==1&&V==v.line)for(;He&&He>v.ch&&ut.charCodeAt(ut.length-Qe-1)==st.charCodeAt(st.length-Qe-1);)He--,Qe++;we[we.length-1]=ut.slice(0,ut.length-Qe).replace(/^\u200b+/,""),we[0]=we[0].slice(He).replace(/\u200b+$/,"");var xt=tt(V,He),mt=tt(re,je.length?te(je).length-Qe:0);if(we.length>1||we[0]||bt(xt,mt))return Hn(e.doc,we,xt,mt,"+input"),!0},Nt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Nt.prototype.reset=function(){this.forceCompositionEnd()},Nt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Nt.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)},Nt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Cr(this.cm,function(){return br(e.cm)})},Nt.prototype.setUneditable=function(e){e.contentEditable="false"},Nt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||nr(this.cm,Pa)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Nt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Nt.prototype.onContextMenu=function(){},Nt.prototype.resetPosition=function(){},Nt.prototype.needsContentAttribute=!0;function ws(e,t){var _=ia(e,t.line);if(!_||_.hidden)return null;var v=dt(e.doc,t.line),L=Qa(_,v,t.line),N=We(v,e.doc.direction),V="left";if(N){var Q=J(N,t.ch);V=Q%2?"right":"left"}var q=$a(L.map,t.ch,V);return q.offset=q.collapse=="right"?q.end:q.start,q}function eu(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Vn(e,t){return t&&(e.bad=!0),e}function tu(e,t,_,v,L){var N="",V=!1,Q=e.doc.lineSeparator(),q=!1;function re(He){return function(Qe){return Qe.id==He}}function ye(){V&&(N+=Q,q&&(N+=Q),V=q=!1)}function we(He){He&&(ye(),N+=He)}function je(He){if(He.nodeType==1){var Qe=He.getAttribute("cm-text");if(Qe){we(Qe);return}var Ze=He.getAttribute("cm-marker"),nt;if(Ze){var ot=e.findMarks(tt(v,0),tt(L+1,0),re(+Ze));ot.length&&(nt=ot[0].find(0))&&we(sr(e.doc,nt.from,nt.to).join(Q));return}if(He.getAttribute("contenteditable")=="false")return;var ut=/^(pre|div|p|li|table|br)$/i.test(He.nodeName);if(!/^br$/i.test(He.nodeName)&&He.textContent.length==0)return;ut&&ye();for(var st=0;st<He.childNodes.length;st++)je(He.childNodes[st]);/^(pre|p)$/i.test(He.nodeName)&&(q=!0),ut&&(V=!0)}else He.nodeType==3&&we(He.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(je(t),t==_);)t=t.nextSibling,q=!1;return N}function qi(e,t,_){var v;if(t==e.display.lineDiv){if(v=e.display.lineDiv.childNodes[_],!v)return Vn(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,_=0}else for(v=t;;v=v.parentNode){if(!v||v==e.display.lineDiv)return null;if(v.parentNode&&v.parentNode==e.display.lineDiv)break}for(var L=0;L<e.display.view.length;L++){var N=e.display.view[L];if(N.node==v)return ru(N,t,_)}}function ru(e,t,_){var v=e.text.firstChild,L=!1;if(!t||!P(v,t))return Vn(tt(kt(e.line),0),!0);if(t==v&&(L=!0,t=v.childNodes[_],_=0,!t)){var N=e.rest?te(e.rest):e.line;return Vn(tt(kt(N),N.text.length),L)}var V=t.nodeType==3?t:null,Q=t;for(!V&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(V=t.firstChild,_&&(_=V.nodeValue.length));Q.parentNode!=v;)Q=Q.parentNode;var q=e.measure,re=q.maps;function ye(nt,ot,ut){for(var st=-1;st<(re?re.length:0);st++)for(var ht=st<0?q.map:re[st],xt=0;xt<ht.length;xt+=3){var mt=ht[xt+2];if(mt==nt||mt==ot){var At=kt(st<0?e.line:e.rest[st]),Kt=ht[xt]+ut;return(ut<0||mt!=nt)&&(Kt=ht[xt+(ut?1:0)]),tt(At,Kt)}}}var we=ye(V,Q,_);if(we)return Vn(we,L);for(var je=Q.nextSibling,He=V?V.nodeValue.length-_:0;je;je=je.nextSibling){if(we=ye(je,je.firstChild,0),we)return Vn(tt(we.line,we.ch-He),L);He+=je.textContent.length}for(var Qe=Q.previousSibling,Ze=_;Qe;Qe=Qe.previousSibling){if(we=ye(Qe,Qe.firstChild,-1),we)return Vn(tt(we.line,we.ch+Ze),L);Ze+=Qe.textContent.length}}var Yt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ee,this.hasSelection=!1,this.composing=null};Yt.prototype.init=function(e){var t=this,_=this,v=this.cm;this.createField(e);var L=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),n&&(L.style.width="0px"),Ne(L,"input",function(){E&&y>=9&&t.hasSelection&&(t.hasSelection=null),_.poll()}),Ne(L,"paste",function(V){if(Oe(v,V)||_s(V,v))return;v.state.pasteIncoming=+new Date,_.fastPoll()});function N(V){if(Oe(v,V))return;if(v.somethingSelected())Qi({lineWise:!1,text:v.getSelections()});else if(v.options.lineWiseCopyCut){var Q=bs(v);Qi({lineWise:!0,text:Q.text}),V.type=="cut"?v.setSelections(Q.ranges,null,Ue):(_.prevInput="",L.value=Q.text.join(`
|
|
|
`),W(L))}else return;V.type=="cut"&&(v.state.cutIncoming=+new Date)}Ne(L,"cut",N),Ne(L,"copy",N),Ne(e.scroller,"paste",function(V){if(Jr(e,V)||Oe(v,V))return;if(!L.dispatchEvent){v.state.pasteIncoming=+new Date,_.focus();return}var Q=new Event("paste");Q.clipboardData=V.clipboardData,L.dispatchEvent(Q)}),Ne(e.lineSpace,"selectstart",function(V){Jr(e,V)||Y(V)}),Ne(L,"compositionstart",function(){var V=v.getCursor("from");_.composing&&_.composing.range.clear(),_.composing={start:V,range:v.markText(V,v.getCursor("to"),{className:"CodeMirror-composing"})}}),Ne(L,"compositionend",function(){_.composing&&(_.poll(),_.composing.range.clear(),_.composing=null)})},Yt.prototype.createField=function(e){this.wrapper=Es(),this.textarea=this.wrapper.firstChild},Yt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Yt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,_=e.doc,v=uo(e);if(e.options.moveInputWithCursor){var L=Ur(e,_.sel.primary().head,"div"),N=t.wrapper.getBoundingClientRect(),V=t.lineDiv.getBoundingClientRect();v.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,L.top+V.top-N.top)),v.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,L.left+V.left-N.left))}return v},Yt.prototype.showSelection=function(e){var t=this.cm,_=t.display;C(_.cursorDiv,e.cursors),C(_.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Yt.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var _=t.getSelection();this.textarea.value=_,t.state.focused&&W(this.textarea),E&&y>=9&&(this.hasSelection=_)}else e||(this.prevInput=this.textarea.value="",E&&y>=9&&(this.hasSelection=null))},Yt.prototype.getField=function(){return this.textarea},Yt.prototype.supportsTouch=function(){return!1},Yt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!i||B()!=this.textarea))try{this.textarea.focus()}catch(e){}},Yt.prototype.blur=function(){this.textarea.blur()},Yt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Yt.prototype.receivedFocus=function(){this.slowPoll()},Yt.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()})},Yt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function _(){var v=t.poll();!v&&!e?(e=!0,t.polling.set(60,_)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,_)},Yt.prototype.poll=function(){var e=this,t=this.cm,_=this.textarea,v=this.prevInput;if(this.contextMenuPending||!t.state.focused||qe(_)&&!v&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var L=_.value;if(L==v&&!t.somethingSelected())return!1;if(E&&y>=9&&this.hasSelection===L||f&&/[\uf700-\uf7ff]/.test(L))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var N=L.charCodeAt(0);if(N==8203&&!v&&(v="\u200B"),N==8666)return this.reset(),this.cm.execCommand("undo")}for(var V=0,Q=Math.min(v.length,L.length);V<Q&&v.charCodeAt(V)==L.charCodeAt(V);)++V;return Cr(t,function(){Pa(t,L.slice(V),v.length-V,null,e.composing?"*compose":null),L.length>1e3||L.indexOf(`
|
|
|
`)>-1?_.value=e.prevInput="":e.prevInput=L,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Yt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Yt.prototype.onKeyPress=function(){E&&y>=9&&(this.hasSelection=null),this.fastPoll()},Yt.prototype.onContextMenu=function(e){var t=this,_=t.cm,v=_.display,L=t.textarea;t.contextMenuPending&&t.contextMenuPending();var N=yn(_,e),V=v.scroller.scrollTop;if(!N||d)return;var Q=_.options.resetSelectionOnContextMenu;Q&&_.doc.sel.contains(N)==-1&&nr(_,dr)(_.doc,ln(N),Ue);var q=L.style.cssText,re=t.wrapper.style.cssText,ye=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",L.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
top: `+(e.clientY-ye.top-5)+"px; left: "+(e.clientX-ye.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 we;p&&(we=window.scrollY),v.input.focus(),p&&window.scrollTo(null,we),v.input.reset(),_.somethingSelected()||(L.value=t.prevInput=" "),t.contextMenuPending=He,v.selForContextMenu=_.doc.sel,clearTimeout(v.detectingSelectAll);function je(){if(L.selectionStart!=null){var Ze=_.somethingSelected(),nt="\u200B"+(Ze?L.value:"");L.value="\u21DA",L.value=nt,t.prevInput=Ze?"":"\u200B",L.selectionStart=1,L.selectionEnd=nt.length,v.selForContextMenu=_.doc.sel}}function He(){if(t.contextMenuPending!=He)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=re,L.style.cssText=q,E&&y<9&&v.scrollbars.setScrollTop(v.scroller.scrollTop=V),L.selectionStart!=null){(!E||E&&y<9)&&je();var Ze=0,nt=function(){v.selForContextMenu==_.doc.sel&&L.selectionStart==0&&L.selectionEnd>0&&t.prevInput=="\u200B"?nr(_,Ho)(_):Ze++<10?v.detectingSelectAll=setTimeout(nt,500):(v.selForContextMenu=null,v.input.reset())};v.detectingSelectAll=setTimeout(nt,200)}}if(E&&y>=9&&je(),A){oe(e);var Qe=function(){ne(window,"mouseup",Qe),setTimeout(He,20)};Ne(window,"mouseup",Qe)}else setTimeout(He,50)},Yt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Yt.prototype.setUneditable=function(){},Yt.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?K(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var _=B();t.autofocus=_==e||e.getAttribute("autofocus")!=null&&_==document.body}function v(){e.value=Q.getValue()}var L;if(e.form&&(Ne(e.form,"submit",v),!t.leaveSubmitMethodAlone)){var N=e.form;L=N.submit;try{var V=N.submit=function(){v(),N.submit=L,N.submit(),N.submit=V}}catch(q){}}t.finishInit=function(q){q.save=v,q.getTextArea=function(){return e},q.toTextArea=function(){q.toTextArea=isNaN,v(),e.parentNode.removeChild(q.getWrapperElement()),e.style.display="",e.form&&(ne(e.form,"submit",v),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=L))}},e.style.display="none";var Q=jt(function(q){return e.parentNode.insertBefore(q,e.nextSibling)},t);return Q}function iu(e){e.off=ne,e.on=Ne,e.wheelEventPixels=dl,e.Doc=xr,e.splitLines=rt,e.countColumn=G,e.findColumn=Pe,e.isWordChar=Xe,e.Pass=Be,e.signal=xe,e.Line=rr,e.changeEnd=un,e.scrollbarModel=_o,e.Pos=tt,e.cmpPos=bt,e.modes=ct,e.mimeModes=it,e.resolveMode=Ct,e.getMode=Ht,e.modeExtensions=Ut,e.extendMode=Ot,e.copyState=It,e.startState=$t,e.innerMode=Rt,e.commands=bi,e.keyMap=en,e.keyName=is,e.isModifierKey=rs,e.lookupKey=Wn,e.normalizeKeyMap=Ml,e.StringStream=Lt,e.SharedTextMarker=vi,e.TextMarker=dn,e.LineWidget=gi,e.e_preventDefault=Y,e.e_stopPropagation=Z,e.e_stop=oe,e.addClass=H,e.contains=P,e.rmClass=b,e.keyNames=fn}Ql(jt),Jl(jt);var au="iter insert remove copy getEditor constructor".split(" ");for(var Zi in xr.prototype)xr.prototype.hasOwnProperty(Zi)&&de(au,Zi)<0&&(jt.prototype[Zi]=function(e){return function(){return e.apply(this.doc,arguments)}}(xr.prototype[Zi]));return le(xr),jt.inputStyles={textarea:Yt,contenteditable:Nt},jt.defineMode=function(e){!jt.defaults.mode&&e!="null"&&(jt.defaults.mode=e),yt.apply(this,arguments)},jt.defineMIME=Tt,jt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),jt.defineMIME("text/plain","null"),jt.defineExtension=function(e,t){jt.prototype[e]=t},jt.defineDocExtension=function(e,t){xr.prototype[e]=t},jt.fromTextArea=nu,iu(jt),jt.version="5.58.2",jt})},Y1PL:function($e,ue,ie){"use strict";ie.r(ue),ie.d(ue,"ResizableTextArea",function(){return de});var j=ie("wx14"),k=ie("1OyB"),D=ie("vuIU"),R=ie("Ji7U"),O=ie("LK+K"),c=ie("q1tI"),E=ie("VTBJ"),y=ie("rePB"),p=ie("Zm9Q"),u=ie("Kwbf"),o=ie("c+Xe"),d=ie("m+aA"),s=ie("bdgK"),l=new Map;function r(Ue){Ue.forEach(function(Le){var Me,Pe=Le.target;(Me=l.get(Pe))===null||Me===void 0||Me.forEach(function(be){return be(Pe)})})}var n=new s.default(r),a=null,i=null;function f(Ue,Le){l.has(Ue)||(l.set(Ue,new Set),n.observe(Ue)),l.get(Ue).add(Le)}function h(Ue,Le){l.has(Ue)&&(l.get(Ue).delete(Le),l.get(Ue).size||(n.unobserve(Ue),l.delete(Ue)))}var w=function(Ue){Object(R.a)(Me,Ue);var Le=Object(O.a)(Me);function Me(){return Object(k.a)(this,Me),Le.apply(this,arguments)}return Object(D.a)(Me,[{key:"render",value:function(){return this.props.children}}]),Me}(c.Component),m=c.createContext(null);function T(Ue){var Le=Ue.children,Me=Ue.onBatchResize,Pe=c.useRef(0),be=c.useRef([]),ke=c.useContext(m),te=c.useCallback(function(pe,ae,_e){Pe.current+=1;var Ie=Pe.current;be.current.push({size:pe,element:ae,data:_e}),Promise.resolve().then(function(){Ie===Pe.current&&(Me==null||Me(be.current),be.current=[])}),ke==null||ke(pe,ae,_e)},[Me,ke]);return c.createElement(m.Provider,{value:te},Le)}function A(Ue){var Le=Ue.children,Me=Ue.disabled,Pe=c.useRef(null),be=c.useRef(null),ke=c.useContext(m),te=c.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),pe=c.isValidElement(Le)&&Object(o.c)(Le),ae=pe?Le.ref:null,_e=c.useMemo(function(){return Object(o.a)(ae,Pe)},[ae,Pe]),Ie=c.useRef(Ue);Ie.current=Ue;var Fe=c.useCallback(function(Xe){var Ge=Ie.current,ze=Ge.onResize,Re=Ge.data,Se=Xe.getBoundingClientRect(),Te=Se.width,Ee=Se.height,$=Xe.offsetWidth,fe=Xe.offsetHeight,J=Math.floor(Te),Ae=Math.floor(Ee);if(te.current.width!==J||te.current.height!==Ae||te.current.offsetWidth!==$||te.current.offsetHeight!==fe){var We={width:J,height:Ae,offsetWidth:$,offsetHeight:fe};te.current=We;var Ye=$===Math.round(Te)?Te:$,Ne=fe===Math.round(Ee)?Ee:fe,et=Object(E.a)(Object(E.a)({},We),{},{offsetWidth:Ye,offsetHeight:Ne});ke==null||ke(et,Xe,Re),ze&&Promise.resolve().then(function(){ze(et,Xe)})}},[]);return c.useEffect(function(){var Xe=Object(d.a)(Pe.current)||Object(d.a)(be.current);return Xe&&!Me&&f(Xe,Fe),function(){return h(Xe,Fe)}},[Pe.current,Me]),c.createElement(w,{ref:be},pe?c.cloneElement(Le,{ref:_e}):Le)}var x="rc-observer-key";function b(Ue){var Le=Ue.children,Me=Object(p.a)(Le);return Me.map(function(Pe,be){var ke=(Pe==null?void 0:Pe.key)||"".concat(x,"-").concat(be);return c.createElement(A,Object(j.a)({},Ue,{key:ke}),Pe)})}b.Collection=T;var S=b,C=ie("bT9E"),g=ie("TSYQ"),M=ie.n(g),I=`
|
|
|
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"],B={},H;function F(Ue){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=Ue.getAttribute("id")||Ue.getAttribute("data-reactid")||Ue.getAttribute("name");if(Le&&B[Me])return B[Me];var Pe=window.getComputedStyle(Ue),be=Pe.getPropertyValue("box-sizing")||Pe.getPropertyValue("-moz-box-sizing")||Pe.getPropertyValue("-webkit-box-sizing"),ke=parseFloat(Pe.getPropertyValue("padding-bottom"))+parseFloat(Pe.getPropertyValue("padding-top")),te=parseFloat(Pe.getPropertyValue("border-bottom-width"))+parseFloat(Pe.getPropertyValue("border-top-width")),pe=P.map(function(_e){return"".concat(_e,":").concat(Pe.getPropertyValue(_e))}).join(";"),ae={sizingStyle:pe,paddingSize:ke,borderSize:te,boxSizing:be};return Le&&Me&&(B[Me]=ae),ae}function W(Ue){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Me=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Pe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;H||(H=document.createElement("textarea"),H.setAttribute("tab-index","-1"),H.setAttribute("aria-hidden","true"),document.body.appendChild(H)),Ue.getAttribute("wrap")?H.setAttribute("wrap",Ue.getAttribute("wrap")):H.removeAttribute("wrap");var be=F(Ue,Le),ke=be.paddingSize,te=be.borderSize,pe=be.boxSizing,ae=be.sizingStyle;H.setAttribute("style","".concat(ae,";").concat(I)),H.value=Ue.value||Ue.placeholder||"";var _e=Number.MIN_SAFE_INTEGER,Ie=Number.MAX_SAFE_INTEGER,Fe=H.scrollHeight,Xe;if(pe==="border-box"?Fe+=te:pe==="content-box"&&(Fe-=ke),Me!==null||Pe!==null){H.value=" ";var Ge=H.scrollHeight-ke;Me!==null&&(_e=Ge*Me,pe==="border-box"&&(_e=_e+ke+te),Fe=Math.max(_e,Fe)),Pe!==null&&(Ie=Ge*Pe,pe==="border-box"&&(Ie=Ie+ke+te),Xe=Fe>Ie?"":"hidden",Fe=Math.min(Ie,Fe))}return{height:Fe,minHeight:_e,maxHeight:Ie,overflowY:Xe,resize:"none"}}var U=ie("Gytx"),K=ie.n(U),G;(function(Ue){Ue[Ue.NONE=0]="NONE",Ue[Ue.RESIZING=1]="RESIZING",Ue[Ue.RESIZED=2]="RESIZED"})(G||(G={}));var ee=function(Ue){Object(R.a)(Me,Ue);var Le=Object(O.a)(Me);function Me(Pe){var be;return Object(k.a)(this,Me),be=Le.call(this,Pe),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(ke){be.textArea=ke},be.handleResize=function(ke){var te=be.state.resizeStatus,pe=be.props,ae=pe.autoSize,_e=pe.onResize;if(te!==G.NONE)return;typeof _e=="function"&&_e(ke),ae&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var ke=be.props.autoSize;if(!ke||!be.textArea)return;var te=ke.minRows,pe=ke.maxRows,ae=W(be.textArea,!1,te,pe);be.setState({textareaStyles:ae,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:G.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:G.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var ke=be.props,te=ke.prefixCls,pe=te===void 0?"rc-textarea":te,ae=ke.autoSize,_e=ke.onResize,Ie=ke.className,Fe=ke.disabled,Xe=be.state,Ge=Xe.textareaStyles,ze=Xe.resizeStatus,Re=Object(C.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Se=M()(pe,Ie,Object(y.a)({},"".concat(pe,"-disabled"),Fe));"value"in Re&&(Re.value=Re.value||"");var Te=Object(E.a)(Object(E.a)(Object(E.a)({},be.props.style),Ge),ze===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return c.createElement(S,{onResize:be.handleResize,disabled:!(ae||_e)},c.createElement("textarea",Object(j.a)({},Re,{className:Se,style:Te,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:G.NONE},be}return Object(D.a)(Me,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!K()(be.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 be=this.textArea.selectionStart,ke=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,ke)}}catch(te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Me}(c.Component),de=ee,ge=function(Ue){Object(R.a)(Me,Ue);var Le=Object(O.a)(Me);function Me(Pe){var be;Object(k.a)(this,Me),be=Le.call(this,Pe),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(te){be.resizableTextArea=te},be.handleChange=function(te){var pe=be.props.onChange;be.setValue(te.target.value,function(){be.resizableTextArea.resizeTextarea()}),pe&&pe(te)},be.handleKeyDown=function(te){var pe=be.props,ae=pe.onPressEnter,_e=pe.onKeyDown;te.keyCode===13&&ae&&ae(te),_e&&_e(te)};var ke=typeof Pe.value=="undefined"||Pe.value===null?Pe.defaultValue:Pe.value;return be.state={value:ke},be}return Object(D.a)(Me,[{key:"setValue",value:function(be,ke){"value"in this.props||this.setState({value:be},ke)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return c.createElement(de,Object(j.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Me}(c.Component),Be=ue.default=ge},YJ9k:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(O,c){if(!(O instanceof c))throw new TypeError("Cannot call a class as a function")}function k(O,c){for(var E=0;E<c.length;E++){var y=c[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,c,E){return c&&k(O.prototype,c),E&&k(O,E),O}var R=function(){function O(){j(this,O),this._listeners=new Map}return D(O,[{key:"addEventListener",value:function(E,y){this._listeners.has(E)||this._listeners.set(E,new Set),this._listeners.get(E).add(y)}},{key:"removeEventListener",value:function(E,y){this._listeners.has(E)&&this._listeners.get(E).delete(y)}},{key:"dispatchEvent",value:function(E){var y=this;return this._listeners.has(E.type)?(this._listeners.get(E.type).forEach(function(p){return p.call(y,E)}),!E.defaultPrevented):!0}}]),O}();ue.default=R},ZW9T:function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return w});var j=ie("k1fw"),k=ie("miYZ"),D=ie("tsqr"),R=ie("rAM+"),O=ie("tJVT"),c=ie("PpiC"),E=ie("q1tI"),y=ie.n(E),p=ie("bdgK");function u(m,T,A,x,b){var S=T.getWordUntilPosition(A),C={startLineNumber:A.lineNumber,endLineNumber:A.lineNumber,startColumn:S.startColumn,endColumn:S.endColumn},g=x.map(function(M){return{label:M,kind:m.languages.CompletionItemKind.Keyword,insertText:M,insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:C}});return b.map(function(M){g.push(Object(j.a)(Object(j.a)({},M),{},{range:C}))}),g}var o=function(m){var T={label:"ifelse",kind:m.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
|
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},A=["auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while","inline","restrict","_Bool","_Complex","_Imaginary","_Alignas","_Alignof","_Atomic","_Static_assert","_Noreturn","_Thread_local","_Generic"];m.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(C,g){var M=u(m,C,g,A,[T]);return{suggestions:M}}});var x=["False","None","True","and","as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield"];m.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(C,g){var M=[{label:"print",kind:m.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join(`
|
|
|
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=u(m,C,g,x,M);return{suggestions:I}}});var b=["abstract","assert","boolean","break","byte","case","catch","char","class","const","continue","default","do","double","else","enum","extends","final","finally","float","for","goto","if","implements","import","instance of","int","interface","long","native","new","package","private","protected","public","return","strictfp","short","static","super","switch","synchronized","this","throw","throws","transient","try","void","volatile","while"];m.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(C,g){var M=[T,{label:"main",kind:m.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {"," $0","}"].join(`
|
|
|
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:m.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join(`
|
|
|
`),insertTextRules:m.languages.CompletionItemInsertTextRule.InsertAsSnippet}],I=u(m,C,g,b,M);return{suggestions:I}}})},d="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",s=ie("LvDl");function l(m){return/^\d+$/.test(m)?"".concat(m,"px"):m}function r(){}var n=!1,a={"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 i(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],T=m;if(Array.isArray(m)){for(var A=0;A<m.length;A++){var x=a[m[A]];if(x)return x}return T[0]}return a[T]||T}var f=null,h=ue.b=function(m){var T=m.width,A=T===void 0?"100%":T,x=m.height,b=x===void 0?"100%":x,S=m.value,C=m.language,g=C===void 0?"javascript":C,M=m.style,I=M===void 0?{}:M,P=m.options,B=P===void 0?{}:P,H=m.overrideServices,F=H===void 0?{}:H,W=m.theme,U=W===void 0?"vs-dark":W,K=m.onEditBlur,G=m.onSave,ee=m.autoHeight,de=ee===void 0?!1:ee,ge=m.forbidCopy,Be=ge===void 0?!1:ge,Ue=m.onChange,Le=Ue===void 0?r:Ue,Me=m.editorDidMount,Pe=Me===void 0?r:Me,be=m.onFocus,ke=be===void 0?r:be,te=m.filename,pe=te===void 0?"educoder.txt":te,ae=Object(c.a)(m,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),_e=Object(E.useRef)(),Ie=Object(E.useRef)({}),Fe=Object(E.useRef)(),Xe=Object(E.useRef)(!1),Ge=Object(E.useRef)(),ze=Object(E.useState)(!1),Re=Object(O.a)(ze,2),Se=Re[0],Te=Re[1];function Ee(){var z;return _e.current&&(z=new p.default(function(oe){var Ce=Object(R.a)(oe),X;try{for(Ce.s();!(X=Ce.n()).done;){var me=X.value;(me.target.offsetHeight>0||me.target.offsetWidth>0)&&Ie.current.instance.layout()}}catch(De){Ce.e(De)}finally{Ce.f()}}),z.observe(_e.current)),z}function $(){D.b.warn(decodeURIComponent(d))}var fe=function(){var oe=Ie.current.instance;if(S!=null&&oe&&Se){var Ce=oe.getModel();Ce&&S!==Ce.getValue()&&(n=!0,Ce.setValue(S),oe.layout(),n=!1)}};Object(E.useEffect)(function(){Fe.current&&clearTimeout(Fe.current),Fe.current=setTimeout(function(){fe()},500)},[S,Se,Ie.current]);function J(){var z=Ie.current.instance;if(z){var oe=z.getSelection(),Ce=Ie.current.pastePos||{},X=new f.Range(Ce.startLineNumber||oe.endLineNumber,Ce.startColumn||oe.endColumn,Ce.endLineNumber||oe.endLineNumber,Ce.endColumn||oe.endColumn);setTimeout(function(){z.executeEdits("",[{range:X,text:""}])},300)}}function Ae(z){(window.navigator.platform.match("Mac")?z.metaKey:z.ctrlKey)&&z.keyCode==83&&(z.preventDefault(),G())}var We=function(){if(de&&Ie.current.instance){var oe=Ie.current.instance.getContentHeight();Y(oe<b?b:oe)}else Y(b)};function Ye(z){var oe=document.createEvent("MouseEvents");oe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),z.dispatchEvent(oe)}function Ne(z,oe){var Ce=window.URL||window.webkitURL||window,X=new Blob([oe]),me=document.createElementNS("http://www.w3.org/1999/xhtml","a");me.href=Ce.createObjectURL(X),me.download=z,Ye(me)}Object(E.useEffect)(function(){We()},[We]),Object(E.useEffect)(function(){_e.current&&!Se&&ie.e(26).then(ie.t.bind(null,"M/lh",7)).then(function(z){try{f=z,Ie.current.instance=f.editor.create(_e.current,{value:S,language:i(g),theme:U,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},F);var oe=Ie.current.instance;if(Pe(oe,f),setTimeout(function(){We(),Ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ne(pe||"educoder.txt",oe.getValue())}})},500),Ie.current.subscription=oe.onDidChangeModelContent(function(X){Xe.current?clearTimeout(Ge.current):(We(),Le(oe.getValue(),X)),Ge.current=setTimeout(function(){Xe.current=!1},500)}),window.Monaco||o(f),Be&&(oe.addCommand(f.KeyMod.CtrlCmd|f.KeyMod.Shift|f.KeyCode.KEY_V,function(){return $(),null}),oe.addCommand(f.KeyMod.CtrlCmd|f.KeyCode.KEY_C,function(){return $(),null})),window.Monaco=f,K&&oe.onDidBlurEditorWidget(function(){K(oe.getValue())}),ke&&oe.onDidFocusEditorText(function(){ke(oe.getValue())}),Be){oe.addCommand(f.KeyMod.CtrlCmd|f.KeyCode.KEY_V,function(){return $(),null}),oe.onDidPaste(function(X){Ie.current.pastePos=X});try{window.addEventListener("paste",J)}catch(X){}}var Ce=Ee();return Te(!0),function(){var X=Ie.current.instance;X.dispose();var me=X.getModel();me&&me.dispose(),Ie.current.subscription&&Ie.current.subscription.dispose(),Be&&window.removeEventListener("paste",J),Ce.unobserve(_e.current)}}catch(X){}})},[]),Object(E.useEffect)(function(){var z=Ie.current.instance;if(z&&Se)return document.addEventListener("keydown",Ae,!1),function(){document.removeEventListener("keydown",Ae)}},[G,Se]),Object(E.useEffect)(function(){var z=Ie.current.instance;if(z&&Se){var oe=i(g);f.editor.setModelLanguage(z.getModel(),oe),console.log("language:",g,z.getModel(),oe)}},[g,Se]),Object(E.useEffect)(function(){var z=Ie.current.instance;z&&Se&&f.editor.setTheme(U)},[U,Se]),Object(E.useEffect)(function(){var z=Ie.current.instance;z&&Se&&(z.updateOptions(Object(j.a)({},B)),setTimeout(function(){z.getModel().updateOptions(Object(j.a)({},B))},200))},[JSON.stringify(B),Se]),Object(E.useEffect)(function(){var z=Ie.current.instance;z&&Se&&z.layout()},[A,b,Se]);var et=Object(E.useState)(l(A)),ne=Object(O.a)(et,2),xe=ne[0],Oe=ne[1],he=Object(E.useState)(l(b)),ce=Object(O.a)(he,2),le=ce[0],Y=ce[1],Z=Object(j.a)(Object(j.a)({},I),{},{width:xe,height:le});return y.a.createElement("div",{className:"my-monaco-editor",ref:_e,style:Z})};function w(m){var T=m.width,A=T===void 0?"100%":T,x=m.height,b=x===void 0?"100%":x,S=m.original,C=m.modified,g=m.language,M=m.options,I=M===void 0?{}:M,P=Object(E.useRef)(),B=Object(E.useState)(null),H=Object(O.a)(B,2),F=H[0],W=H[1];function U(de){var ge;return P.current&&(ge=new p.default(function(Be){var Ue=Object(R.a)(Be),Le;try{for(Ue.s();!(Le=Ue.n()).done;){var Me=Le.value;(Me.target.offsetHeight>0||Me.target.offsetWidth>0)&&de.layout()}}catch(Pe){Ue.e(Pe)}finally{Ue.f()}}),ge.observe(P.current)),ge}Object(E.useEffect)(function(){P.current&&ie.e(26).then(ie.t.bind(null,"M/lh",7)).then(function(de){f=de;var ge=f.editor.createDiffEditor(P.current,Object(j.a)(Object(j.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},I),{},{wordWrap:!0}));W(ge);var Be=U(ge);return function(){ge.dispose();var Ue=ge.getModel();Ue&&Ue.dispose(),Be.unobserve(P.current)}})},[]),Object(E.useEffect)(function(){F&&F.setModel({original:f.editor.createModel(S,g),modified:f.editor.createModel(C,g)})},[S,C,g,F]);var K=l(A),G=l(b),ee={width:K,height:G};return y.a.createElement("div",{className:"my-diff-editor",ref:P,style:ee})}},ZpRC:function($e,ue,ie){"use strict";function j(o){return typeof o=="object"&&o!=null&&o.nodeType===1}function k(o,d){return(!d||o!=="hidden")&&o!=="visible"&&o!=="clip"}function D(o,d){if(o.clientHeight<o.scrollHeight||o.clientWidth<o.scrollWidth){var s=getComputedStyle(o,null);return k(s.overflowY,d)||k(s.overflowX,d)||function(l){var r=function(n){if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch(a){return null}}(l);return!!r&&(r.clientHeight<l.scrollHeight||r.clientWidth<l.scrollWidth)}(o)}return!1}function R(o,d,s,l,r,n,a,i){return n<o&&a>d||n>o&&a<d?0:n<=o&&i<=s||a>=d&&i>=s?n-o-l:a>d&&i<s||n<o&&i>s?a-d+r:0}var O=function(o,d){var s=window,l=d.scrollMode,r=d.block,n=d.inline,a=d.boundary,i=d.skipOverflowHiddenElements,f=typeof a=="function"?a:function(Ge){return Ge!==a};if(!j(o))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,w=[],m=o;j(m)&&f(m);){if((m=m.parentElement)===h){w.push(m);break}m!=null&&m===document.body&&D(m)&&!D(document.documentElement)||m!=null&&D(m,i)&&w.push(m)}for(var T=s.visualViewport?s.visualViewport.width:innerWidth,A=s.visualViewport?s.visualViewport.height:innerHeight,x=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,S=o.getBoundingClientRect(),C=S.height,g=S.width,M=S.top,I=S.right,P=S.bottom,B=S.left,H=r==="start"||r==="nearest"?M:r==="end"?P:M+C/2,F=n==="center"?B+g/2:n==="end"?I:B,W=[],U=0;U<w.length;U++){var K=w[U],G=K.getBoundingClientRect(),ee=G.height,de=G.width,ge=G.top,Be=G.right,Ue=G.bottom,Le=G.left;if(l==="if-needed"&&M>=0&&B>=0&&P<=A&&I<=T&&M>=ge&&P<=Ue&&B>=Le&&I<=Be)return W;var Me=getComputedStyle(K),Pe=parseInt(Me.borderLeftWidth,10),be=parseInt(Me.borderTopWidth,10),ke=parseInt(Me.borderRightWidth,10),te=parseInt(Me.borderBottomWidth,10),pe=0,ae=0,_e="offsetWidth"in K?K.offsetWidth-K.clientWidth-Pe-ke:0,Ie="offsetHeight"in K?K.offsetHeight-K.clientHeight-be-te:0;if(h===K)pe=r==="start"?H:r==="end"?H-A:r==="nearest"?R(b,b+A,A,be,te,b+H,b+H+C,C):H-A/2,ae=n==="start"?F:n==="center"?F-T/2:n==="end"?F-T:R(x,x+T,T,Pe,ke,x+F,x+F+g,g),pe=Math.max(0,pe+b),ae=Math.max(0,ae+x);else{pe=r==="start"?H-ge-be:r==="end"?H-Ue+te+Ie:r==="nearest"?R(ge,Ue,ee,be,te+Ie,H,H+C,C):H-(ge+ee/2)+Ie/2,ae=n==="start"?F-Le-Pe:n==="center"?F-(Le+de/2)+_e/2:n==="end"?F-Be+ke+_e:R(Le,Be,de,Pe,ke+_e,F,F+g,g);var Fe=K.scrollLeft,Xe=K.scrollTop;H+=Xe-(pe=Math.max(0,Math.min(Xe+pe,K.scrollHeight-ee+Ie))),F+=Fe-(ae=Math.max(0,Math.min(Fe+ae,K.scrollWidth-de+_e)))}W.push({el:K,top:pe,left:ae})}return W};function c(o){return o===Object(o)&&Object.keys(o).length!==0}function E(o,d){d===void 0&&(d="auto");var s="scrollBehavior"in document.body.style;o.forEach(function(l){var r=l.el,n=l.top,a=l.left;r.scroll&&s?r.scroll({top:n,left:a,behavior:d}):(r.scrollTop=n,r.scrollLeft=a)})}function y(o){return o===!1?{block:"end",inline:"nearest"}:c(o)?o:{block:"start",inline:"nearest"}}function p(o,d){var s=!o.ownerDocument.documentElement.contains(o);if(c(d)&&typeof d.behavior=="function")return d.behavior(s?[]:O(o,d));if(s)return;var l=y(d);return E(O(o,l),l.behavior)}var u=ue.a=p},Zss7:function($e,ue,ie){var j;(function(k){var D=/^\s+/,R=/\s+$/,O=0,c=k.round,E=k.min,y=k.max,p=k.random;function u(te,pe){if(te=te||"",pe=pe||{},te instanceof u)return te;if(!(this instanceof u))return new u(te,pe);var ae=o(te);this._originalInput=te,this._r=ae.r,this._g=ae.g,this._b=ae.b,this._a=ae.a,this._roundA=c(100*this._a)/100,this._format=pe.format||ae.format,this._gradientType=pe.gradientType,this._r<1&&(this._r=c(this._r)),this._g<1&&(this._g=c(this._g)),this._b<1&&(this._b=c(this._b)),this._ok=ae.ok,this._tc_id=O++}u.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 te=this.toRgb();return(te.r*299+te.g*587+te.b*114)/1e3},getLuminance:function(){var te=this.toRgb(),pe,ae,_e,Ie,Fe,Xe;return pe=te.r/255,ae=te.g/255,_e=te.b/255,pe<=.03928?Ie=pe/12.92:Ie=k.pow((pe+.055)/1.055,2.4),ae<=.03928?Fe=ae/12.92:Fe=k.pow((ae+.055)/1.055,2.4),_e<=.03928?Xe=_e/12.92:Xe=k.pow((_e+.055)/1.055,2.4),.2126*Ie+.7152*Fe+.0722*Xe},setAlpha:function(te){return this._a=W(te),this._roundA=c(100*this._a)/100,this},toHsv:function(){var te=r(this._r,this._g,this._b);return{h:te.h*360,s:te.s,v:te.v,a:this._a}},toHsvString:function(){var te=r(this._r,this._g,this._b),pe=c(te.h*360),ae=c(te.s*100),_e=c(te.v*100);return this._a==1?"hsv("+pe+", "+ae+"%, "+_e+"%)":"hsva("+pe+", "+ae+"%, "+_e+"%, "+this._roundA+")"},toHsl:function(){var te=s(this._r,this._g,this._b);return{h:te.h*360,s:te.s,l:te.l,a:this._a}},toHslString:function(){var te=s(this._r,this._g,this._b),pe=c(te.h*360),ae=c(te.s*100),_e=c(te.l*100);return this._a==1?"hsl("+pe+", "+ae+"%, "+_e+"%)":"hsla("+pe+", "+ae+"%, "+_e+"%, "+this._roundA+")"},toHex:function(te){return a(this._r,this._g,this._b,te)},toHexString:function(te){return"#"+this.toHex(te)},toHex8:function(te){return i(this._r,this._g,this._b,this._a,te)},toHex8String:function(te){return"#"+this.toHex8(te)},toRgb:function(){return{r:c(this._r),g:c(this._g),b:c(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+c(this._r)+", "+c(this._g)+", "+c(this._b)+")":"rgba("+c(this._r)+", "+c(this._g)+", "+c(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:c(U(this._r,255)*100)+"%",g:c(U(this._g,255)*100)+"%",b:c(U(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+c(U(this._r,255)*100)+"%, "+c(U(this._g,255)*100)+"%, "+c(U(this._b,255)*100)+"%)":"rgba("+c(U(this._r,255)*100)+"%, "+c(U(this._g,255)*100)+"%, "+c(U(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:H[a(this._r,this._g,this._b,!0)]||!1},toFilter:function(te){var pe="#"+f(this._r,this._g,this._b,this._a),ae=pe,_e=this._gradientType?"GradientType = 1, ":"";if(te){var Ie=u(te);ae="#"+f(Ie._r,Ie._g,Ie._b,Ie._a)}return"progid:DXImageTransform.Microsoft.gradient("+_e+"startColorstr="+pe+",endColorstr="+ae+")"},toString:function(te){var pe=!!te;te=te||this._format;var ae=!1,_e=this._a<1&&this._a>=0,Ie=!pe&&_e&&(te==="hex"||te==="hex6"||te==="hex3"||te==="hex4"||te==="hex8"||te==="name");return Ie?te==="name"&&this._a===0?this.toName():this.toRgbString():(te==="rgb"&&(ae=this.toRgbString()),te==="prgb"&&(ae=this.toPercentageRgbString()),(te==="hex"||te==="hex6")&&(ae=this.toHexString()),te==="hex3"&&(ae=this.toHexString(!0)),te==="hex4"&&(ae=this.toHex8String(!0)),te==="hex8"&&(ae=this.toHex8String()),te==="name"&&(ae=this.toName()),te==="hsl"&&(ae=this.toHslString()),te==="hsv"&&(ae=this.toHsvString()),ae||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(te,pe){var ae=te.apply(null,[this].concat([].slice.call(pe)));return this._r=ae._r,this._g=ae._g,this._b=ae._b,this.setAlpha(ae._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(w,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(te,pe){return te.apply(null,[this].concat([].slice.call(pe)))},analogous:function(){return this._applyCombination(I,arguments)},complement:function(){return this._applyCombination(S,arguments)},monochromatic:function(){return this._applyCombination(P,arguments)},splitcomplement:function(){return this._applyCombination(M,arguments)},triad:function(){return this._applyCombination(C,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},u.fromRatio=function(te,pe){if(typeof te=="object"){var ae={};for(var _e in te)te.hasOwnProperty(_e)&&(_e==="a"?ae[_e]=te[_e]:ae[_e]=Be(te[_e]));te=ae}return u(te,pe)};function o(te){var pe={r:0,g:0,b:0},ae=1,_e=null,Ie=null,Fe=null,Xe=!1,Ge=!1;return typeof te=="string"&&(te=be(te)),typeof te=="object"&&(Pe(te.r)&&Pe(te.g)&&Pe(te.b)?(pe=d(te.r,te.g,te.b),Xe=!0,Ge=String(te.r).substr(-1)==="%"?"prgb":"rgb"):Pe(te.h)&&Pe(te.s)&&Pe(te.v)?(_e=Be(te.s),Ie=Be(te.v),pe=n(te.h,_e,Ie),Xe=!0,Ge="hsv"):Pe(te.h)&&Pe(te.s)&&Pe(te.l)&&(_e=Be(te.s),Fe=Be(te.l),pe=l(te.h,_e,Fe),Xe=!0,Ge="hsl"),te.hasOwnProperty("a")&&(ae=te.a)),ae=W(ae),{ok:Xe,format:te.format||Ge,r:E(255,y(pe.r,0)),g:E(255,y(pe.g,0)),b:E(255,y(pe.b,0)),a:ae}}function d(te,pe,ae){return{r:U(te,255)*255,g:U(pe,255)*255,b:U(ae,255)*255}}function s(te,pe,ae){te=U(te,255),pe=U(pe,255),ae=U(ae,255);var _e=y(te,pe,ae),Ie=E(te,pe,ae),Fe,Xe,Ge=(_e+Ie)/2;if(_e==Ie)Fe=Xe=0;else{var ze=_e-Ie;Xe=Ge>.5?ze/(2-_e-Ie):ze/(_e+Ie);switch(_e){case te:Fe=(pe-ae)/ze+(pe<ae?6:0);break;case pe:Fe=(ae-te)/ze+2;break;case ae:Fe=(te-pe)/ze+4;break}Fe/=6}return{h:Fe,s:Xe,l:Ge}}function l(te,pe,ae){var _e,Ie,Fe;te=U(te,360),pe=U(pe,100),ae=U(ae,100);function Xe(Re,Se,Te){return Te<0&&(Te+=1),Te>1&&(Te-=1),Te<1/6?Re+(Se-Re)*6*Te:Te<1/2?Se:Te<2/3?Re+(Se-Re)*(2/3-Te)*6:Re}if(pe===0)_e=Ie=Fe=ae;else{var Ge=ae<.5?ae*(1+pe):ae+pe-ae*pe,ze=2*ae-Ge;_e=Xe(ze,Ge,te+1/3),Ie=Xe(ze,Ge,te),Fe=Xe(ze,Ge,te-1/3)}return{r:_e*255,g:Ie*255,b:Fe*255}}function r(te,pe,ae){te=U(te,255),pe=U(pe,255),ae=U(ae,255);var _e=y(te,pe,ae),Ie=E(te,pe,ae),Fe,Xe,Ge=_e,ze=_e-Ie;if(Xe=_e===0?0:ze/_e,_e==Ie)Fe=0;else{switch(_e){case te:Fe=(pe-ae)/ze+(pe<ae?6:0);break;case pe:Fe=(ae-te)/ze+2;break;case ae:Fe=(te-pe)/ze+4;break}Fe/=6}return{h:Fe,s:Xe,v:Ge}}function n(te,pe,ae){te=U(te,360)*6,pe=U(pe,100),ae=U(ae,100);var _e=k.floor(te),Ie=te-_e,Fe=ae*(1-pe),Xe=ae*(1-Ie*pe),Ge=ae*(1-(1-Ie)*pe),ze=_e%6,Re=[ae,Xe,Fe,Fe,Ge,ae][ze],Se=[Ge,ae,ae,Xe,Fe,Fe][ze],Te=[Fe,Fe,Ge,ae,ae,Xe][ze];return{r:Re*255,g:Se*255,b:Te*255}}function a(te,pe,ae,_e){var Ie=[ge(c(te).toString(16)),ge(c(pe).toString(16)),ge(c(ae).toString(16))];return _e&&Ie[0].charAt(0)==Ie[0].charAt(1)&&Ie[1].charAt(0)==Ie[1].charAt(1)&&Ie[2].charAt(0)==Ie[2].charAt(1)?Ie[0].charAt(0)+Ie[1].charAt(0)+Ie[2].charAt(0):Ie.join("")}function i(te,pe,ae,_e,Ie){var Fe=[ge(c(te).toString(16)),ge(c(pe).toString(16)),ge(c(ae).toString(16)),ge(Ue(_e))];return Ie&&Fe[0].charAt(0)==Fe[0].charAt(1)&&Fe[1].charAt(0)==Fe[1].charAt(1)&&Fe[2].charAt(0)==Fe[2].charAt(1)&&Fe[3].charAt(0)==Fe[3].charAt(1)?Fe[0].charAt(0)+Fe[1].charAt(0)+Fe[2].charAt(0)+Fe[3].charAt(0):Fe.join("")}function f(te,pe,ae,_e){var Ie=[ge(Ue(_e)),ge(c(te).toString(16)),ge(c(pe).toString(16)),ge(c(ae).toString(16))];return Ie.join("")}u.equals=function(te,pe){return!te||!pe?!1:u(te).toRgbString()==u(pe).toRgbString()},u.random=function(){return u.fromRatio({r:p(),g:p(),b:p()})};function h(te,pe){pe=pe===0?0:pe||10;var ae=u(te).toHsl();return ae.s-=pe/100,ae.s=K(ae.s),u(ae)}function w(te,pe){pe=pe===0?0:pe||10;var ae=u(te).toHsl();return ae.s+=pe/100,ae.s=K(ae.s),u(ae)}function m(te){return u(te).desaturate(100)}function T(te,pe){pe=pe===0?0:pe||10;var ae=u(te).toHsl();return ae.l+=pe/100,ae.l=K(ae.l),u(ae)}function A(te,pe){pe=pe===0?0:pe||10;var ae=u(te).toRgb();return ae.r=y(0,E(255,ae.r-c(255*-(pe/100)))),ae.g=y(0,E(255,ae.g-c(255*-(pe/100)))),ae.b=y(0,E(255,ae.b-c(255*-(pe/100)))),u(ae)}function x(te,pe){pe=pe===0?0:pe||10;var ae=u(te).toHsl();return ae.l-=pe/100,ae.l=K(ae.l),u(ae)}function b(te,pe){var ae=u(te).toHsl(),_e=(ae.h+pe)%360;return ae.h=_e<0?360+_e:_e,u(ae)}function S(te){var pe=u(te).toHsl();return pe.h=(pe.h+180)%360,u(pe)}function C(te){var pe=u(te).toHsl(),ae=pe.h;return[u(te),u({h:(ae+120)%360,s:pe.s,l:pe.l}),u({h:(ae+240)%360,s:pe.s,l:pe.l})]}function g(te){var pe=u(te).toHsl(),ae=pe.h;return[u(te),u({h:(ae+90)%360,s:pe.s,l:pe.l}),u({h:(ae+180)%360,s:pe.s,l:pe.l}),u({h:(ae+270)%360,s:pe.s,l:pe.l})]}function M(te){var pe=u(te).toHsl(),ae=pe.h;return[u(te),u({h:(ae+72)%360,s:pe.s,l:pe.l}),u({h:(ae+216)%360,s:pe.s,l:pe.l})]}function I(te,pe,ae){pe=pe||6,ae=ae||30;var _e=u(te).toHsl(),Ie=360/ae,Fe=[u(te)];for(_e.h=(_e.h-(Ie*pe>>1)+720)%360;--pe;)_e.h=(_e.h+Ie)%360,Fe.push(u(_e));return Fe}function P(te,pe){pe=pe||6;for(var ae=u(te).toHsv(),_e=ae.h,Ie=ae.s,Fe=ae.v,Xe=[],Ge=1/pe;pe--;)Xe.push(u({h:_e,s:Ie,v:Fe})),Fe=(Fe+Ge)%1;return Xe}u.mix=function(te,pe,ae){ae=ae===0?0:ae||50;var _e=u(te).toRgb(),Ie=u(pe).toRgb(),Fe=ae/100,Xe={r:(Ie.r-_e.r)*Fe+_e.r,g:(Ie.g-_e.g)*Fe+_e.g,b:(Ie.b-_e.b)*Fe+_e.b,a:(Ie.a-_e.a)*Fe+_e.a};return u(Xe)},u.readability=function(te,pe){var ae=u(te),_e=u(pe);return(k.max(ae.getLuminance(),_e.getLuminance())+.05)/(k.min(ae.getLuminance(),_e.getLuminance())+.05)},u.isReadable=function(te,pe,ae){var _e=u.readability(te,pe),Ie,Fe;Fe=!1,Ie=ke(ae);switch(Ie.level+Ie.size){case"AAsmall":case"AAAlarge":Fe=_e>=4.5;break;case"AAlarge":Fe=_e>=3;break;case"AAAsmall":Fe=_e>=7;break}return Fe},u.mostReadable=function(te,pe,ae){var _e=null,Ie=0,Fe,Xe,Ge,ze;ae=ae||{},Xe=ae.includeFallbackColors,Ge=ae.level,ze=ae.size;for(var Re=0;Re<pe.length;Re++)Fe=u.readability(te,pe[Re]),Fe>Ie&&(Ie=Fe,_e=u(pe[Re]));return u.isReadable(te,_e,{level:Ge,size:ze})||!Xe?_e:(ae.includeFallbackColors=!1,u.mostReadable(te,["#fff","#000"],ae))};var B=u.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"},H=u.hexNames=F(B);function F(te){var pe={};for(var ae in te)te.hasOwnProperty(ae)&&(pe[te[ae]]=ae);return pe}function W(te){return te=parseFloat(te),(isNaN(te)||te<0||te>1)&&(te=1),te}function U(te,pe){ee(te)&&(te="100%");var ae=de(te);return te=E(pe,y(0,parseFloat(te))),ae&&(te=parseInt(te*pe,10)/100),k.abs(te-pe)<1e-6?1:te%pe/parseFloat(pe)}function K(te){return E(1,y(0,te))}function G(te){return parseInt(te,16)}function ee(te){return typeof te=="string"&&te.indexOf(".")!=-1&&parseFloat(te)===1}function de(te){return typeof te=="string"&&te.indexOf("%")!=-1}function ge(te){return te.length==1?"0"+te:""+te}function Be(te){return te<=1&&(te=te*100+"%"),te}function Ue(te){return k.round(parseFloat(te)*255).toString(16)}function Le(te){return G(te)/255}var Me=function(){var te="[-\\+]?\\d+%?",pe="[-\\+]?\\d*\\.\\d+%?",ae="(?:"+pe+")|(?:"+te+")",_e="[\\s|\\(]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")\\s*\\)?",Ie="[\\s|\\(]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")[,|\\s]+("+ae+")\\s*\\)?";return{CSS_UNIT:new RegExp(ae),rgb:new RegExp("rgb"+_e),rgba:new RegExp("rgba"+Ie),hsl:new RegExp("hsl"+_e),hsla:new RegExp("hsla"+Ie),hsv:new RegExp("hsv"+_e),hsva:new RegExp("hsva"+Ie),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 Pe(te){return!!Me.CSS_UNIT.exec(te)}function be(te){te=te.replace(D,"").replace(R,"").toLowerCase();var pe=!1;if(B[te])te=B[te],pe=!0;else if(te=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ae;return(ae=Me.rgb.exec(te))?{r:ae[1],g:ae[2],b:ae[3]}:(ae=Me.rgba.exec(te))?{r:ae[1],g:ae[2],b:ae[3],a:ae[4]}:(ae=Me.hsl.exec(te))?{h:ae[1],s:ae[2],l:ae[3]}:(ae=Me.hsla.exec(te))?{h:ae[1],s:ae[2],l:ae[3],a:ae[4]}:(ae=Me.hsv.exec(te))?{h:ae[1],s:ae[2],v:ae[3]}:(ae=Me.hsva.exec(te))?{h:ae[1],s:ae[2],v:ae[3],a:ae[4]}:(ae=Me.hex8.exec(te))?{r:G(ae[1]),g:G(ae[2]),b:G(ae[3]),a:Le(ae[4]),format:pe?"name":"hex8"}:(ae=Me.hex6.exec(te))?{r:G(ae[1]),g:G(ae[2]),b:G(ae[3]),format:pe?"name":"hex"}:(ae=Me.hex4.exec(te))?{r:G(ae[1]+""+ae[1]),g:G(ae[2]+""+ae[2]),b:G(ae[3]+""+ae[3]),a:Le(ae[4]+""+ae[4]),format:pe?"name":"hex8"}:(ae=Me.hex3.exec(te))?{r:G(ae[1]+""+ae[1]),g:G(ae[2]+""+ae[2]),b:G(ae[3]+""+ae[3]),format:pe?"name":"hex"}:!1}function ke(te){var pe,ae;return te=te||{level:"AA",size:"small"},pe=(te.level||"AA").toUpperCase(),ae=(te.size||"small").toLowerCase(),pe!=="AA"&&pe!=="AAA"&&(pe="AA"),ae!=="small"&&ae!=="large"&&(ae="small"),{level:pe,size:ae}}$e.exports?$e.exports=u:!(j=function(){return u}.call(ue,ie,ue,$e),j!==void 0&&($e.exports=j))})(Math)},bT9E:function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return k});var j=ie("VTBJ");function k(D,R){var O=Object(j.a)({},D);return Array.isArray(R)&&R.forEach(function(c){delete O[c]}),O}},c5Ni:function($e,ue,ie){},c5fP:function($e,ue,ie){"use strict";function j(ne){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(Oe){return typeof Oe}:j=function(Oe){return Oe&&typeof Symbol=="function"&&Oe.constructor===Symbol&&Oe!==Symbol.prototype?"symbol":typeof Oe},j(ne)}Object.defineProperty(ue,"__esModule",{value:!0}),ue._tr_init=Ae,ue._tr_stored_block=We,ue._tr_flush_block=Ne,ue._tr_tally=et,ue._tr_align=Ye;var k=R(ie("6BzB"));function D(){if(typeof WeakMap!="function")return null;var ne=new WeakMap;return D=function(){return ne},ne}function R(ne){if(ne&&ne.__esModule)return ne;if(ne===null||j(ne)!=="object"&&typeof ne!="function")return{default:ne};var xe=D();if(xe&&xe.has(ne))return xe.get(ne);var Oe={},he=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ce in ne)if(Object.prototype.hasOwnProperty.call(ne,ce)){var le=he?Object.getOwnPropertyDescriptor(ne,ce):null;le&&(le.get||le.set)?Object.defineProperty(Oe,ce,le):Oe[ce]=ne[ce]}return Oe.default=ne,xe&&xe.set(ne,Oe),Oe}var O=4,c=0,E=1,y=2;function p(ne){for(var xe=ne.length;--xe>=0;)ne[xe]=0}var u=0,o=1,d=2,s=3,l=258,r=29,n=256,a=n+1+r,i=30,f=19,h=2*a+1,w=15,m=16,T=7,A=256,x=16,b=17,S=18,C=[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],g=[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],M=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=512,B=new Array((a+2)*2);p(B);var H=new Array(i*2);p(H);var F=new Array(P);p(F);var W=new Array(l-s+1);p(W);var U=new Array(r);p(U);var K=new Array(i);p(K);function G(ne,xe,Oe,he,ce){this.static_tree=ne,this.extra_bits=xe,this.extra_base=Oe,this.elems=he,this.max_length=ce,this.has_stree=ne&&ne.length}var ee,de,ge;function Be(ne,xe){this.dyn_tree=ne,this.max_code=0,this.stat_desc=xe}function Ue(ne){return ne<256?F[ne]:F[256+(ne>>>7)]}function Le(ne,xe){ne.pending_buf[ne.pending++]=xe&255,ne.pending_buf[ne.pending++]=xe>>>8&255}function Me(ne,xe,Oe){ne.bi_valid>m-Oe?(ne.bi_buf|=xe<<ne.bi_valid&65535,Le(ne,ne.bi_buf),ne.bi_buf=xe>>m-ne.bi_valid,ne.bi_valid+=Oe-m):(ne.bi_buf|=xe<<ne.bi_valid&65535,ne.bi_valid+=Oe)}function Pe(ne,xe,Oe){Me(ne,Oe[xe*2],Oe[xe*2+1])}function be(ne,xe){var Oe=0;do Oe|=ne&1,ne>>>=1,Oe<<=1;while(--xe>0);return Oe>>>1}function ke(ne){ne.bi_valid===16?(Le(ne,ne.bi_buf),ne.bi_buf=0,ne.bi_valid=0):ne.bi_valid>=8&&(ne.pending_buf[ne.pending++]=ne.bi_buf&255,ne.bi_buf>>=8,ne.bi_valid-=8)}function te(ne,xe){var Oe=xe.dyn_tree,he=xe.max_code,ce=xe.stat_desc.static_tree,le=xe.stat_desc.has_stree,Y=xe.stat_desc.extra_bits,Z=xe.stat_desc.extra_base,z=xe.stat_desc.max_length,oe,Ce,X,me,De,se,ve=0;for(me=0;me<=w;me++)ne.bl_count[me]=0;for(Oe[ne.heap[ne.heap_max]*2+1]=0,oe=ne.heap_max+1;oe<h;oe++){if(Ce=ne.heap[oe],me=Oe[Oe[Ce*2+1]*2+1]+1,me>z&&(me=z,ve++),Oe[Ce*2+1]=me,Ce>he)continue;ne.bl_count[me]++,De=0,Ce>=Z&&(De=Y[Ce-Z]),se=Oe[Ce*2],ne.opt_len+=se*(me+De),le&&(ne.static_len+=se*(ce[Ce*2+1]+De))}if(ve===0)return;do{for(me=z-1;ne.bl_count[me]===0;)me--;ne.bl_count[me]--,ne.bl_count[me+1]+=2,ne.bl_count[z]--,ve-=2}while(ve>0);for(me=z;me!==0;me--)for(Ce=ne.bl_count[me];Ce!==0;){if(X=ne.heap[--oe],X>he)continue;Oe[X*2+1]!==me&&(ne.opt_len+=(me-Oe[X*2+1])*Oe[X*2],Oe[X*2+1]=me),Ce--}}function pe(ne,xe,Oe){var he=new Array(w+1),ce=0,le,Y;for(le=1;le<=w;le++)he[le]=ce=ce+Oe[le-1]<<1;for(Y=0;Y<=xe;Y++){var Z=ne[Y*2+1];if(Z===0)continue;ne[Y*2]=be(he[Z]++,Z)}}function ae(){var ne,xe,Oe,he,ce,le=new Array(w+1);for(Oe=0,he=0;he<r-1;he++)for(U[he]=Oe,ne=0;ne<1<<C[he];ne++)W[Oe++]=he;for(W[Oe-1]=he,ce=0,he=0;he<16;he++)for(K[he]=ce,ne=0;ne<1<<g[he];ne++)F[ce++]=he;for(ce>>=7;he<i;he++)for(K[he]=ce<<7,ne=0;ne<1<<g[he]-7;ne++)F[256+ce++]=he;for(xe=0;xe<=w;xe++)le[xe]=0;for(ne=0;ne<=143;)B[ne*2+1]=8,ne++,le[8]++;for(;ne<=255;)B[ne*2+1]=9,ne++,le[9]++;for(;ne<=279;)B[ne*2+1]=7,ne++,le[7]++;for(;ne<=287;)B[ne*2+1]=8,ne++,le[8]++;for(pe(B,a+1,le),ne=0;ne<i;ne++)H[ne*2+1]=5,H[ne*2]=be(ne,5);ee=new G(B,C,n+1,a,w),de=new G(H,g,0,i,w),ge=new G(new Array(0),M,0,f,T)}function _e(ne){var xe;for(xe=0;xe<a;xe++)ne.dyn_ltree[xe*2]=0;for(xe=0;xe<i;xe++)ne.dyn_dtree[xe*2]=0;for(xe=0;xe<f;xe++)ne.bl_tree[xe*2]=0;ne.dyn_ltree[A*2]=1,ne.opt_len=ne.static_len=0,ne.last_lit=ne.matches=0}function Ie(ne){ne.bi_valid>8?Le(ne,ne.bi_buf):ne.bi_valid>0&&(ne.pending_buf[ne.pending++]=ne.bi_buf),ne.bi_buf=0,ne.bi_valid=0}function Fe(ne,xe,Oe,he){Ie(ne),he&&(Le(ne,Oe),Le(ne,~Oe)),k.arraySet(ne.pending_buf,ne.window,xe,Oe,ne.pending),ne.pending+=Oe}function Xe(ne,xe,Oe,he){var ce=xe*2,le=Oe*2;return ne[ce]<ne[le]||ne[ce]===ne[le]&&he[xe]<=he[Oe]}function Ge(ne,xe,Oe){for(var he=ne.heap[Oe],ce=Oe<<1;ce<=ne.heap_len&&!(ce<ne.heap_len&&Xe(xe,ne.heap[ce+1],ne.heap[ce],ne.depth)&&ce++,Xe(xe,he,ne.heap[ce],ne.depth));)ne.heap[Oe]=ne.heap[ce],Oe=ce,ce<<=1;ne.heap[Oe]=he}function ze(ne,xe,Oe){var he,ce,le=0,Y,Z;if(ne.last_lit!==0)do he=ne.pending_buf[ne.d_buf+le*2]<<8|ne.pending_buf[ne.d_buf+le*2+1],ce=ne.pending_buf[ne.l_buf+le],le++,he===0?Pe(ne,ce,xe):(Y=W[ce],Pe(ne,Y+n+1,xe),Z=C[Y],Z!==0&&(ce-=U[Y],Me(ne,ce,Z)),he--,Y=Ue(he),Pe(ne,Y,Oe),Z=g[Y],Z!==0&&(he-=K[Y],Me(ne,he,Z)));while(le<ne.last_lit);Pe(ne,A,xe)}function Re(ne,xe){var Oe=xe.dyn_tree,he=xe.stat_desc.static_tree,ce=xe.stat_desc.has_stree,le=xe.stat_desc.elems,Y,Z,z=-1,oe;for(ne.heap_len=0,ne.heap_max=h,Y=0;Y<le;Y++)Oe[Y*2]!==0?(ne.heap[++ne.heap_len]=z=Y,ne.depth[Y]=0):Oe[Y*2+1]=0;for(;ne.heap_len<2;)oe=ne.heap[++ne.heap_len]=z<2?++z:0,Oe[oe*2]=1,ne.depth[oe]=0,ne.opt_len--,ce&&(ne.static_len-=he[oe*2+1]);for(xe.max_code=z,Y=ne.heap_len>>1;Y>=1;Y--)Ge(ne,Oe,Y);oe=le;do Y=ne.heap[1],ne.heap[1]=ne.heap[ne.heap_len--],Ge(ne,Oe,1),Z=ne.heap[1],ne.heap[--ne.heap_max]=Y,ne.heap[--ne.heap_max]=Z,Oe[oe*2]=Oe[Y*2]+Oe[Z*2],ne.depth[oe]=(ne.depth[Y]>=ne.depth[Z]?ne.depth[Y]:ne.depth[Z])+1,Oe[Y*2+1]=Oe[Z*2+1]=oe,ne.heap[1]=oe++,Ge(ne,Oe,1);while(ne.heap_len>=2);ne.heap[--ne.heap_max]=ne.heap[1],te(ne,xe),pe(Oe,z,ne.bl_count)}function Se(ne,xe,Oe){var he,ce=-1,le,Y=xe[0*2+1],Z=0,z=7,oe=4;for(Y===0&&(z=138,oe=3),xe[(Oe+1)*2+1]=65535,he=0;he<=Oe;he++){if(le=Y,Y=xe[(he+1)*2+1],++Z<z&&le===Y)continue;Z<oe?ne.bl_tree[le*2]+=Z:le!==0?(le!==ce&&ne.bl_tree[le*2]++,ne.bl_tree[x*2]++):Z<=10?ne.bl_tree[b*2]++:ne.bl_tree[S*2]++,Z=0,ce=le,Y===0?(z=138,oe=3):le===Y?(z=6,oe=3):(z=7,oe=4)}}function Te(ne,xe,Oe){var he,ce=-1,le,Y=xe[0*2+1],Z=0,z=7,oe=4;for(Y===0&&(z=138,oe=3),he=0;he<=Oe;he++){if(le=Y,Y=xe[(he+1)*2+1],++Z<z&&le===Y)continue;if(Z<oe)do Pe(ne,le,ne.bl_tree);while(--Z!==0);else le!==0?(le!==ce&&(Pe(ne,le,ne.bl_tree),Z--),Pe(ne,x,ne.bl_tree),Me(ne,Z-3,2)):Z<=10?(Pe(ne,b,ne.bl_tree),Me(ne,Z-3,3)):(Pe(ne,S,ne.bl_tree),Me(ne,Z-11,7));Z=0,ce=le,Y===0?(z=138,oe=3):le===Y?(z=6,oe=3):(z=7,oe=4)}}function Ee(ne){var xe;for(Se(ne,ne.dyn_ltree,ne.l_desc.max_code),Se(ne,ne.dyn_dtree,ne.d_desc.max_code),Re(ne,ne.bl_desc),xe=f-1;xe>=3&&!(ne.bl_tree[I[xe]*2+1]!==0);xe--);return ne.opt_len+=3*(xe+1)+5+5+4,xe}function $(ne,xe,Oe,he){var ce;for(Me(ne,xe-257,5),Me(ne,Oe-1,5),Me(ne,he-4,4),ce=0;ce<he;ce++)Me(ne,ne.bl_tree[I[ce]*2+1],3);Te(ne,ne.dyn_ltree,xe-1),Te(ne,ne.dyn_dtree,Oe-1)}function fe(ne){var xe=4093624447,Oe;for(Oe=0;Oe<=31;Oe++,xe>>>=1)if(xe&1&&ne.dyn_ltree[Oe*2]!==0)return c;if(ne.dyn_ltree[9*2]!==0||ne.dyn_ltree[10*2]!==0||ne.dyn_ltree[13*2]!==0)return E;for(Oe=32;Oe<n;Oe++)if(ne.dyn_ltree[Oe*2]!==0)return E;return c}var J=!1;function Ae(ne){J||(ae(),J=!0),ne.l_desc=new Be(ne.dyn_ltree,ee),ne.d_desc=new Be(ne.dyn_dtree,de),ne.bl_desc=new Be(ne.bl_tree,ge),ne.bi_buf=0,ne.bi_valid=0,_e(ne)}function We(ne,xe,Oe,he){Me(ne,(u<<1)+(he?1:0),3),Fe(ne,xe,Oe,!0)}function Ye(ne){Me(ne,o<<1,3),Pe(ne,A,B),ke(ne)}function Ne(ne,xe,Oe,he){var ce,le,Y=0;ne.level>0?(ne.strm.data_type===y&&(ne.strm.data_type=fe(ne)),Re(ne,ne.l_desc),Re(ne,ne.d_desc),Y=Ee(ne),ce=ne.opt_len+3+7>>>3,le=ne.static_len+3+7>>>3,le<=ce&&(ce=le)):ce=le=Oe+5,Oe+4<=ce&&xe!==-1?We(ne,xe,Oe,he):ne.strategy===O||le===ce?(Me(ne,(o<<1)+(he?1:0),3),ze(ne,B,H)):(Me(ne,(d<<1)+(he?1:0),3),$(ne,ne.l_desc.max_code+1,ne.d_desc.max_code+1,Y+1),ze(ne,ne.dyn_ltree,ne.dyn_dtree)),_e(ne),he&&Ie(ne)}function et(ne,xe,Oe){return ne.pending_buf[ne.d_buf+ne.last_lit*2]=xe>>>8&255,ne.pending_buf[ne.d_buf+ne.last_lit*2+1]=xe&255,ne.pending_buf[ne.l_buf+ne.last_lit]=Oe&255,ne.last_lit++,xe===0?ne.dyn_ltree[Oe*2]++:(ne.matches++,xe--,ne.dyn_ltree[(W[Oe]+n+1)*2]++,ne.dyn_dtree[Ue(xe)*2]++),ne.last_lit===ne.lit_bufsize-1}},dejd:function($e,ue,ie){},dmUQ:function($e,ue,ie){"use strict";var j=ie("Ff2n"),k=ie("rePB"),D=ie("1OyB"),R=ie("vuIU"),O=ie("Ji7U"),c=ie("md7G"),E=ie("foSv"),y=ie("q1tI"),p=ie.n(y),u=ie("TSYQ"),o=ie.n(u),d=ie("4IlW");function s(C,g){var M=Object.keys(C);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(C);g&&(I=I.filter(function(P){return Object.getOwnPropertyDescriptor(C,P).enumerable})),M.push.apply(M,I)}return M}function l(C){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?s(Object(M),!0).forEach(function(I){Object(k.a)(C,I,M[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(M)):s(Object(M)).forEach(function(I){Object.defineProperty(C,I,Object.getOwnPropertyDescriptor(M,I))})}return C}function r(C){var g=n();return function(){var I=Object(E.a)(C),P;if(g){var B=Object(E.a)(this).constructor;P=Reflect.construct(I,arguments,B)}else P=I.apply(this,arguments);return Object(c.a)(this,P)}}function n(){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(C){return!1}}function a(){}function i(C){C.preventDefault()}var f=function(g){return g.replace(/[^\w.-]+/g,"")},h=200,w=600,m=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(g){return g!=null},A=function(g,M){return M===g||typeof M=="number"&&typeof g=="number"&&isNaN(M)&&isNaN(g)},x=function(C){Object(O.a)(M,C);var g=r(M);function M(I){var P;Object(D.a)(this,M),P=g.call(this,I),P.onKeyDown=function(F){var W=P.props,U=W.onKeyDown,K=W.onPressEnter;if(F.keyCode===d.a.UP){var G=P.getRatio(F);P.up(F,G,null),P.stop()}else if(F.keyCode===d.a.DOWN){var ee=P.getRatio(F);P.down(F,ee,null),P.stop()}else F.keyCode===d.a.ENTER&&K&&K(F);if(P.recordCursorPosition(),P.lastKeyCode=F.keyCode,U){for(var de=arguments.length,ge=new Array(de>1?de-1:0),Be=1;Be<de;Be++)ge[Be-1]=arguments[Be];U.apply(void 0,[F].concat(ge))}},P.onKeyUp=function(F){var W=P.props.onKeyUp;if(P.stop(),P.recordCursorPosition(),W){for(var U=arguments.length,K=new Array(U>1?U-1:0),G=1;G<U;G++)K[G-1]=arguments[G];W.apply(void 0,[F].concat(K))}},P.onChange=function(F){var W=P.props.onChange;P.state.focused&&(P.inputting=!0),P.rawInput=P.props.parser(P.getValueFromEvent(F)),P.setState({inputValue:P.rawInput}),W(P.toNumber(P.rawInput))},P.onMouseUp=function(){var F=P.props.onMouseUp;P.recordCursorPosition(),F&&F.apply(void 0,arguments)},P.onFocus=function(){var F;P.setState({focused:!0}),(F=P.props).onFocus.apply(F,arguments)},P.onBlur=function(){var F=P.props.onBlur;P.inputting=!1,P.setState({focused:!1});var W=P.getCurrentValidValue(P.state.inputValue),U=P.setValue(W,a);if(F){var K=P.input.value,G=P.getInputDisplayValue({focus:!1,value:U});P.input.value=G&&Number(G),F.apply(void 0,arguments),P.input.value=K}},P.getRatio=function(F){var W=1;return F.metaKey||F.ctrlKey?W=.1:F.shiftKey&&(W=10),W},P.getFullNum=function(F){return isNaN(F)?F:/e/i.test(String(F))?Number(F).toFixed(18).replace(/\.?0+$/,""):F},P.getPrecision=function(F){if(T(P.props.precision))return P.props.precision;var W=String(F);if(W.indexOf("e-")>=0)return parseInt(W.slice(W.indexOf("e-")+2),10);var U=0;return W.indexOf(".")>=0&&(U=W.length-W.indexOf(".")-1),U},P.getInputDisplayValue=function(F){var W=F||P.state,U=W.focused,K=W.inputValue,G=W.value,ee;U?ee=K:ee=P.toPrecisionAsStep(G),ee==null&&(ee="");var de=P.formatWrapper(ee);return T(P.props.decimalSeparator)&&(de=de.toString().replace(".",P.props.decimalSeparator)),de},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(F){}},P.restoreByAfter=function(F){if(F===void 0)return!1;var W=P.input.value,U=W.lastIndexOf(F);if(U===-1)return!1;var K=P.cursorBefore.length;return P.lastKeyCode===d.a.DELETE&&P.cursorBefore.charAt(K-1)===F[0]?(P.fixCaret(K,K),!0):U+F.length===W.length?(P.fixCaret(U,U),!0):!1},P.partRestoreByAfter=function(F){return F===void 0?!1:Array.prototype.some.call(F,function(W,U){var K=F.substring(U);return P.restoreByAfter(K)})},P.isNotCompleteNumber=function(F){return isNaN(F)||F===""||F===null||F&&F.toString().indexOf(".")===F.toString().length-1},P.stop=function(){P.autoStepTimer&&clearTimeout(P.autoStepTimer)},P.down=function(F,W,U){P.pressingUpOrDown=!0,P.step("down",F,W,U)},P.up=function(F,W,U){P.pressingUpOrDown=!0,P.step("up",F,W,U)},P.saveInput=function(F){P.input=F};var B=I.value;B===void 0&&(B=I.defaultValue),P.state={focused:I.autoFocus};var H=P.getValidValue(P.toNumber(B));return P.state=l(l({},P.state),{},{inputValue:P.toPrecisionAsStep(H),value:H}),P}return Object(R.a)(M,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(P){var B=this.props,H=B.value,F=B.onChange,W=B.max,U=B.min,K=this.state.focused;if(P){if(!A(P.value,H)||!A(P.max,W)||!A(P.min,U)){var G=K?H:this.getValidValue(H),ee;this.pressingUpOrDown?ee=G:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(G),this.setState({value:G,inputValue:ee})}var de="value"in this.props?H:this.state.value;"max"in this.props&&P.max!==W&&typeof de=="number"&&de>W&&F&&F(W),"min"in this.props&&P.min!==U&&typeof de=="number"&&de<U&&F&&F(U)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ge=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===d.a.BACKSPACE?ge=this.cursorStart-1:this.lastKeyCode===d.a.DELETE&&(ge=this.cursorStart):ge=this.input.value.length,this.fixCaret(ge,ge)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case d.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case d.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(Be){}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 B=P;return B===""?B="":this.isNotCompleteNumber(parseFloat(B))?B=this.state.value:B=this.getValidValue(B),this.toNumber(B)}},{key:"getValueFromEvent",value:function(P){var B=P.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(B=B.replace(this.props.decimalSeparator,".")),B}},{key:"getValidValue",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,F=parseFloat(P);return isNaN(F)?P:(F<B&&(F=B),F>H&&(F=H),F)}},{key:"setValue",value:function(P,B){var H=this.props.precision,F=this.isNotCompleteNumber(parseFloat(P))?null:parseFloat(P),W=this.state.value,U=W===void 0?null:W,K=this.state.inputValue,G=K===void 0?null:K,ee=typeof F=="number"?F.toFixed(H):"".concat(F),de=F!==U||ee!=="".concat(G);return"value"in this.props?(G=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:G},B)):this.setState({value:F,inputValue:this.toPrecisionAsStep(P)},B),de&&this.props.onChange(F),F}},{key:"getMaxPrecision",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.props,F=H.precision,W=H.step;if(T(F))return F;var U=this.getPrecision(B),K=this.getPrecision(W),G=this.getPrecision(P);return P?Math.max(G,U+K):U+K}},{key:"getPrecisionFactor",value:function(P){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,H=this.getMaxPrecision(P,B);return Math.pow(10,H)}},{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 B=Math.abs(this.getMaxPrecision(P));return isNaN(B)?P.toString():Number(P).toFixed(B)}},{key:"toNumber",value:function(P){var B=this.props.precision,H=this.state.focused,F=P&&P.length>16&&H;return this.isNotCompleteNumber(P)||F?P:T(B)?Math.round(P*Math.pow(10,B))/Math.pow(10,B):Number(P)}},{key:"upStep",value:function(P,B){var H=this.props.step,F=this.getPrecisionFactor(P,B),W=Math.abs(this.getMaxPrecision(P,B)),U=((F*P+F*H*B)/F).toFixed(W);return this.toNumber(U)}},{key:"downStep",value:function(P,B){var H=this.props.step,F=this.getPrecisionFactor(P,B),W=Math.abs(this.getMaxPrecision(P,B)),U=((F*P-F*H*B)/F).toFixed(W);return this.toNumber(U)}},{key:"step",value:function(P,B){var H=this,F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,W=arguments.length>3?arguments[3]:void 0;this.stop(),B&&(B.persist(),B.preventDefault());var U=this.props;if(U.disabled)return;var K=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(K))return;var G=this["".concat(P,"Step")](K,F),ee=G>U.max||G<U.min;if(G>U.max?G=U.max:G<U.min&&(G=U.min),this.setValue(G,null),this.setState({focused:!0},function(){H.pressingUpOrDown=!1}),ee)return;this.autoStepTimer=setTimeout(function(){H[P](B,F,!0)},W?h:w)}},{key:"fixCaret",value:function(P,B){if(P===void 0||B===void 0||!this.input||!this.input.value)return;try{var H=this.input.selectionStart,F=this.input.selectionEnd;(P!==H||B!==F)&&this.input.setSelectionRange(P,B)}catch(W){}}},{key:"render",value:function(){var P,B=this.props,H=B.prefixCls,F=B.disabled,W=B.readOnly,U=B.useTouch,K=B.autoComplete,G=B.upHandler,ee=B.downHandler,de=B.className,ge=B.max,Be=B.min,Ue=B.style,Le=B.title,Me=B.onMouseEnter,Pe=B.onMouseLeave,be=B.onMouseOver,ke=B.onMouseOut,te=B.required,pe=B.onClick,ae=B.tabIndex,_e=B.type,Ie=B.placeholder,Fe=B.id,Xe=B.inputMode,Ge=B.pattern,ze=B.step,Re=B.maxLength,Se=B.autoFocus,Te=B.name,Ee=B.onPaste,$=B.onInput,fe=Object(j.a)(B,["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"]),J=this.state,Ae=J.value,We=J.focused,Ye=o()(H,(P={},Object(k.a)(P,de,!!de),Object(k.a)(P,"".concat(H,"-disabled"),F),Object(k.a)(P,"".concat(H,"-focused"),We),P)),Ne={};Object.keys(fe).forEach(function(oe){(oe.substr(0,5)==="data-"||oe.substr(0,5)==="aria-"||oe==="role")&&(Ne[oe]=fe[oe])});var et=!W&&!F,ne=this.getInputDisplayValue(null),xe=(Ae||Ae===0)&&(isNaN(Ae)||Number(Ae)>=ge),Oe=(Ae||Ae===0)&&(isNaN(Ae)||Number(Ae)<=Be),he=xe||F||W,ce=Oe||F||W,le=o()("".concat(H,"-handler"),"".concat(H,"-handler-up"),Object(k.a)({},"".concat(H,"-handler-up-disabled"),he)),Y=o()("".concat(H,"-handler"),"".concat(H,"-handler-down"),Object(k.a)({},"".concat(H,"-handler-down-disabled"),ce)),Z=U?{onTouchStart:he?a:this.up,onTouchEnd:this.stop}:{onMouseDown:he?a:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},z=U?{onTouchStart:ce?a:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?a:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return p.a.createElement("div",{className:Ye,style:Ue,title:Le,onMouseEnter:Me,onMouseLeave:Pe,onMouseOver:be,onMouseOut:ke,onFocus:function(){return null},onBlur:function(){return null}},p.a.createElement("div",{className:"".concat(H,"-handler-wrap")},p.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Increase Value","aria-disabled":he,className:le}),G||p.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-up-inner"),onClick:i})),p.a.createElement("span",Object.assign({unselectable:"on"},z,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:Y}),ee||p.a.createElement("span",{unselectable:"on",className:"".concat(H,"-handler-down-inner"),onClick:i}))),p.a.createElement("div",{className:"".concat(H,"-input-wrap")},p.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Be,"aria-valuemax":ge,"aria-valuenow":Ae,required:te,type:_e,placeholder:Ie,onPaste:Ee,onClick:pe,onMouseUp:this.onMouseUp,className:"".concat(H,"-input"),tabIndex:ae,autoComplete:K,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:et?this.onKeyDown:a,onKeyUp:et?this.onKeyUp:a,autoFocus:Se,maxLength:Re,readOnly:W,disabled:F,max:ge,min:Be,step:ze,name:Te,title:Le,id:Fe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ne),pattern:Ge,inputMode:Xe,onInput:$},Ne))))}}]),M}(p.a.Component);x.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:m,min:-m,step:1,style:{},onChange:a,onKeyDown:a,onPressEnter:a,onFocus:a,onBlur:a,parser:f,required:!1,autoComplete:"off"};var b=x,S=ue.a=b},eP3c:function($e,ue,ie){"use strict";function j(Y){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(z){return typeof z}:j=function(z){return z&&typeof Symbol=="function"&&z.constructor===Symbol&&z!==Symbol.prototype?"symbol":typeof z},j(Y)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.inflateReset=$,ue.inflateReset2=fe,ue.inflateResetKeep=Ee,ue.inflateInit=Ae,ue.inflateInit2=J,ue.inflate=xe,ue.inflateEnd=Oe,ue.inflateGetHeader=he,ue.inflateSetDictionary=ce,ue.inflateInfo=ue.Z_DEFLATED=ue.Z_BUF_ERROR=ue.Z_MEM_ERROR=ue.Z_DATA_ERROR=ue.Z_STREAM_ERROR=ue.Z_NEED_DICT=ue.Z_STREAM_END=ue.Z_OK=ue.Z_TREES=ue.Z_BLOCK=ue.Z_FINISH=void 0;var k=p(ie("6BzB")),D=E(ie("xlC8")),R=E(ie("QV2g")),O=E(ie("sjKO")),c=E(ie("JSwD"));function E(Y){return Y&&Y.__esModule?Y:{default:Y}}function y(){if(typeof WeakMap!="function")return null;var Y=new WeakMap;return y=function(){return Y},Y}function p(Y){if(Y&&Y.__esModule)return Y;if(Y===null||j(Y)!=="object"&&typeof Y!="function")return{default:Y};var Z=y();if(Z&&Z.has(Y))return Z.get(Y);var z={},oe=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Ce in Y)if(Object.prototype.hasOwnProperty.call(Y,Ce)){var X=oe?Object.getOwnPropertyDescriptor(Y,Ce):null;X&&(X.get||X.set)?Object.defineProperty(z,Ce,X):z[Ce]=Y[Ce]}return z.default=Y,Z&&Z.set(Y,z),z}var u=0,o=1,d=2,s=4;ue.Z_FINISH=s;var l=5;ue.Z_BLOCK=l;var r=6;ue.Z_TREES=r;var n=0;ue.Z_OK=n;var a=1;ue.Z_STREAM_END=a;var i=2;ue.Z_NEED_DICT=i;var f=-2;ue.Z_STREAM_ERROR=f;var h=-3;ue.Z_DATA_ERROR=h;var w=-4;ue.Z_MEM_ERROR=w;var m=-5;ue.Z_BUF_ERROR=m;var T=8;ue.Z_DEFLATED=T;var A=1,x=2,b=3,S=4,C=5,g=6,M=7,I=8,P=9,B=10,H=11,F=12,W=13,U=14,K=15,G=16,ee=17,de=18,ge=19,Be=20,Ue=21,Le=22,Me=23,Pe=24,be=25,ke=26,te=27,pe=28,ae=29,_e=30,Ie=31,Fe=32,Xe=852,Ge=592,ze=15,Re=ze;function Se(Y){return(Y>>>24&255)+(Y>>>8&65280)+((Y&65280)<<8)+((Y&255)<<24)}function Te(){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 k.Buf16(320),this.work=new k.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ee(Y){var Z;return!Y||!Y.state?f:(Z=Y.state,Y.total_in=Y.total_out=Z.total=0,Y.msg="",Z.wrap&&(Y.adler=Z.wrap&1),Z.mode=A,Z.last=0,Z.havedict=0,Z.dmax=32768,Z.head=null,Z.hold=0,Z.bits=0,Z.lencode=Z.lendyn=new k.Buf32(Xe),Z.distcode=Z.distdyn=new k.Buf32(Ge),Z.sane=1,Z.back=-1,n)}function $(Y){var Z;return!Y||!Y.state?f:(Z=Y.state,Z.wsize=0,Z.whave=0,Z.wnext=0,Ee(Y))}function fe(Y,Z){var z,oe;return!Y||!Y.state?f:(oe=Y.state,Z<0?(z=0,Z=-Z):(z=(Z>>4)+1,Z<48&&(Z&=15)),Z&&(Z<8||Z>15)?f:(oe.window!==null&&oe.wbits!==Z&&(oe.window=null),oe.wrap=z,oe.wbits=Z,$(Y)))}function J(Y,Z){var z,oe;return Y?(oe=new Te,Y.state=oe,oe.window=null,z=fe(Y,Z),z!==n&&(Y.state=null),z):f}function Ae(Y){return J(Y,Re)}var We=!0,Ye,Ne;function et(Y){if(We){var Z;for(Ye=new k.Buf32(512),Ne=new k.Buf32(32),Z=0;Z<144;)Y.lens[Z++]=8;for(;Z<256;)Y.lens[Z++]=9;for(;Z<280;)Y.lens[Z++]=7;for(;Z<288;)Y.lens[Z++]=8;for((0,c.default)(o,Y.lens,0,288,Ye,0,Y.work,{bits:9}),Z=0;Z<32;)Y.lens[Z++]=5;(0,c.default)(d,Y.lens,0,32,Ne,0,Y.work,{bits:5}),We=!1}Y.lencode=Ye,Y.lenbits=9,Y.distcode=Ne,Y.distbits=5}function ne(Y,Z,z,oe){var Ce,X=Y.state;return X.window===null&&(X.wsize=1<<X.wbits,X.wnext=0,X.whave=0,X.window=new k.Buf8(X.wsize)),oe>=X.wsize?(k.arraySet(X.window,Z,z-X.wsize,X.wsize,0),X.wnext=0,X.whave=X.wsize):(Ce=X.wsize-X.wnext,Ce>oe&&(Ce=oe),k.arraySet(X.window,Z,z-oe,Ce,X.wnext),oe-=Ce,oe?(k.arraySet(X.window,Z,z-oe,oe,0),X.wnext=oe,X.whave=X.wsize):(X.wnext+=Ce,X.wnext===X.wsize&&(X.wnext=0),X.whave<X.wsize&&(X.whave+=Ce))),0}function xe(Y,Z){var z,oe,Ce,X,me,De,se,ve,Ke,rt,qe,Je,lt,vt,ct=0,it,yt,Tt,Ct,Ht,Ut,Ot,It,Rt=new k.Buf8(4),$t,Lt,dt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!Y||!Y.state||!Y.output||!Y.input&&Y.avail_in!==0)return f;z=Y.state,z.mode===F&&(z.mode=W),me=Y.next_out,Ce=Y.output,se=Y.avail_out,X=Y.next_in,oe=Y.input,De=Y.avail_in,ve=z.hold,Ke=z.bits,rt=De,qe=se,It=n;e:for(;;)switch(z.mode){case A:if(z.wrap===0){z.mode=W;break}for(;Ke<16;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(z.wrap&2&&ve===35615){z.check=0,Rt[0]=ve&255,Rt[1]=ve>>>8&255,z.check=(0,R.default)(z.check,Rt,2,0),ve=0,Ke=0,z.mode=x;break}if(z.flags=0,z.head&&(z.head.done=!1),!(z.wrap&1)||(((ve&255)<<8)+(ve>>8))%31){Y.msg="incorrect header check",z.mode=_e;break}if((ve&15)!==T){Y.msg="unknown compression method",z.mode=_e;break}if(ve>>>=4,Ke-=4,Ot=(ve&15)+8,z.wbits===0)z.wbits=Ot;else if(Ot>z.wbits){Y.msg="invalid window size",z.mode=_e;break}z.dmax=1<<Ot,Y.adler=z.check=1,z.mode=ve&512?B:F,ve=0,Ke=0;break;case x:for(;Ke<16;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(z.flags=ve,(z.flags&255)!==T){Y.msg="unknown compression method",z.mode=_e;break}if(z.flags&57344){Y.msg="unknown header flags set",z.mode=_e;break}z.head&&(z.head.text=ve>>8&1),z.flags&512&&(Rt[0]=ve&255,Rt[1]=ve>>>8&255,z.check=(0,R.default)(z.check,Rt,2,0)),ve=0,Ke=0,z.mode=b;case b:for(;Ke<32;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.head&&(z.head.time=ve),z.flags&512&&(Rt[0]=ve&255,Rt[1]=ve>>>8&255,Rt[2]=ve>>>16&255,Rt[3]=ve>>>24&255,z.check=(0,R.default)(z.check,Rt,4,0)),ve=0,Ke=0,z.mode=S;case S:for(;Ke<16;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.head&&(z.head.xflags=ve&255,z.head.os=ve>>8),z.flags&512&&(Rt[0]=ve&255,Rt[1]=ve>>>8&255,z.check=(0,R.default)(z.check,Rt,2,0)),ve=0,Ke=0,z.mode=C;case C:if(z.flags&1024){for(;Ke<16;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.length=ve,z.head&&(z.head.extra_len=ve),z.flags&512&&(Rt[0]=ve&255,Rt[1]=ve>>>8&255,z.check=(0,R.default)(z.check,Rt,2,0)),ve=0,Ke=0}else z.head&&(z.head.extra=null);z.mode=g;case g:if(z.flags&1024&&(Je=z.length,Je>De&&(Je=De),Je&&(z.head&&(Ot=z.head.extra_len-z.length,z.head.extra||(z.head.extra=new Array(z.head.extra_len)),k.arraySet(z.head.extra,oe,X,Je,Ot)),z.flags&512&&(z.check=(0,R.default)(z.check,oe,Je,X)),De-=Je,X+=Je,z.length-=Je),z.length))break e;z.length=0,z.mode=M;case M:if(z.flags&2048){if(De===0)break e;Je=0;do Ot=oe[X+Je++],z.head&&Ot&&z.length<65536&&(z.head.name+=String.fromCharCode(Ot));while(Ot&&Je<De);if(z.flags&512&&(z.check=(0,R.default)(z.check,oe,Je,X)),De-=Je,X+=Je,Ot)break e}else z.head&&(z.head.name=null);z.length=0,z.mode=I;case I:if(z.flags&4096){if(De===0)break e;Je=0;do Ot=oe[X+Je++],z.head&&Ot&&z.length<65536&&(z.head.comment+=String.fromCharCode(Ot));while(Ot&&Je<De);if(z.flags&512&&(z.check=(0,R.default)(z.check,oe,Je,X)),De-=Je,X+=Je,Ot)break e}else z.head&&(z.head.comment=null);z.mode=P;case P:if(z.flags&512){for(;Ke<16;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(ve!==(z.check&65535)){Y.msg="header crc mismatch",z.mode=_e;break}ve=0,Ke=0}z.head&&(z.head.hcrc=z.flags>>9&1,z.head.done=!0),Y.adler=z.check=0,z.mode=F;break;case B:for(;Ke<32;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}Y.adler=z.check=Se(ve),ve=0,Ke=0,z.mode=H;case H:if(z.havedict===0)return Y.next_out=me,Y.avail_out=se,Y.next_in=X,Y.avail_in=De,z.hold=ve,z.bits=Ke,i;Y.adler=z.check=1,z.mode=F;case F:if(Z===l||Z===r)break e;case W:if(z.last){ve>>>=Ke&7,Ke-=Ke&7,z.mode=te;break}for(;Ke<3;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.last=ve&1,ve>>>=1,Ke-=1;switch(ve&3){case 0:z.mode=U;break;case 1:if(et(z),z.mode=Be,Z===r){ve>>>=2,Ke-=2;break e}break;case 2:z.mode=ee;break;case 3:Y.msg="invalid block type",z.mode=_e}ve>>>=2,Ke-=2;break;case U:for(ve>>>=Ke&7,Ke-=Ke&7;Ke<32;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if((ve&65535)!==(ve>>>16^65535)){Y.msg="invalid stored block lengths",z.mode=_e;break}if(z.length=ve&65535,ve=0,Ke=0,z.mode=K,Z===r)break e;case K:z.mode=G;case G:if(Je=z.length,Je){if(Je>De&&(Je=De),Je>se&&(Je=se),Je===0)break e;k.arraySet(Ce,oe,X,Je,me),De-=Je,X+=Je,se-=Je,me+=Je,z.length-=Je;break}z.mode=F;break;case ee:for(;Ke<14;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(z.nlen=(ve&31)+257,ve>>>=5,Ke-=5,z.ndist=(ve&31)+1,ve>>>=5,Ke-=5,z.ncode=(ve&15)+4,ve>>>=4,Ke-=4,z.nlen>286||z.ndist>30){Y.msg="too many length or distance symbols",z.mode=_e;break}z.have=0,z.mode=de;case de:for(;z.have<z.ncode;){for(;Ke<3;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.lens[dt[z.have++]]=ve&7,ve>>>=3,Ke-=3}for(;z.have<19;)z.lens[dt[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,$t={bits:z.lenbits},It=(0,c.default)(u,z.lens,0,19,z.lencode,0,z.work,$t),z.lenbits=$t.bits,It){Y.msg="invalid code lengths set",z.mode=_e;break}z.have=0,z.mode=ge;case ge:for(;z.have<z.nlen+z.ndist;){for(;!(ct=z.lencode[ve&(1<<z.lenbits)-1],it=ct>>>24,yt=ct>>>16&255,Tt=ct&65535,it<=Ke);){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(Tt<16)ve>>>=it,Ke-=it,z.lens[z.have++]=Tt;else{if(Tt===16){for(Lt=it+2;Ke<Lt;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(ve>>>=it,Ke-=it,z.have===0){Y.msg="invalid bit length repeat",z.mode=_e;break}Ot=z.lens[z.have-1],Je=3+(ve&3),ve>>>=2,Ke-=2}else if(Tt===17){for(Lt=it+3;Ke<Lt;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}ve>>>=it,Ke-=it,Ot=0,Je=3+(ve&7),ve>>>=3,Ke-=3}else{for(Lt=it+7;Ke<Lt;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}ve>>>=it,Ke-=it,Ot=0,Je=11+(ve&127),ve>>>=7,Ke-=7}if(z.have+Je>z.nlen+z.ndist){Y.msg="invalid bit length repeat",z.mode=_e;break}for(;Je--;)z.lens[z.have++]=Ot}}if(z.mode===_e)break;if(z.lens[256]===0){Y.msg="invalid code -- missing end-of-block",z.mode=_e;break}if(z.lenbits=9,$t={bits:z.lenbits},It=(0,c.default)(o,z.lens,0,z.nlen,z.lencode,0,z.work,$t),z.lenbits=$t.bits,It){Y.msg="invalid literal/lengths set",z.mode=_e;break}if(z.distbits=6,z.distcode=z.distdyn,$t={bits:z.distbits},It=(0,c.default)(d,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,$t),z.distbits=$t.bits,It){Y.msg="invalid distances set",z.mode=_e;break}if(z.mode=Be,Z===r)break e;case Be:z.mode=Ue;case Ue:if(De>=6&&se>=258){Y.next_out=me,Y.avail_out=se,Y.next_in=X,Y.avail_in=De,z.hold=ve,z.bits=Ke,(0,O.default)(Y,qe),me=Y.next_out,Ce=Y.output,se=Y.avail_out,X=Y.next_in,oe=Y.input,De=Y.avail_in,ve=z.hold,Ke=z.bits,z.mode===F&&(z.back=-1);break}for(z.back=0;!(ct=z.lencode[ve&(1<<z.lenbits)-1],it=ct>>>24,yt=ct>>>16&255,Tt=ct&65535,it<=Ke);){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(yt&&(yt&240)===0){for(Ct=it,Ht=yt,Ut=Tt;!(ct=z.lencode[Ut+((ve&(1<<Ct+Ht)-1)>>Ct)],it=ct>>>24,yt=ct>>>16&255,Tt=ct&65535,Ct+it<=Ke);){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}ve>>>=Ct,Ke-=Ct,z.back+=Ct}if(ve>>>=it,Ke-=it,z.back+=it,z.length=Tt,yt===0){z.mode=ke;break}if(yt&32){z.back=-1,z.mode=F;break}if(yt&64){Y.msg="invalid literal/length code",z.mode=_e;break}z.extra=yt&15,z.mode=Le;case Le:if(z.extra){for(Lt=z.extra;Ke<Lt;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.length+=ve&(1<<z.extra)-1,ve>>>=z.extra,Ke-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=Me;case Me:for(;!(ct=z.distcode[ve&(1<<z.distbits)-1],it=ct>>>24,yt=ct>>>16&255,Tt=ct&65535,it<=Ke);){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if((yt&240)===0){for(Ct=it,Ht=yt,Ut=Tt;!(ct=z.distcode[Ut+((ve&(1<<Ct+Ht)-1)>>Ct)],it=ct>>>24,yt=ct>>>16&255,Tt=ct&65535,Ct+it<=Ke);){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}ve>>>=Ct,Ke-=Ct,z.back+=Ct}if(ve>>>=it,Ke-=it,z.back+=it,yt&64){Y.msg="invalid distance code",z.mode=_e;break}z.offset=Tt,z.extra=yt&15,z.mode=Pe;case Pe:if(z.extra){for(Lt=z.extra;Ke<Lt;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}z.offset+=ve&(1<<z.extra)-1,ve>>>=z.extra,Ke-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){Y.msg="invalid distance too far back",z.mode=_e;break}z.mode=be;case be:if(se===0)break e;if(Je=qe-se,z.offset>Je){if(Je=z.offset-Je,Je>z.whave&&z.sane){Y.msg="invalid distance too far back",z.mode=_e;break}Je>z.wnext?(Je-=z.wnext,lt=z.wsize-Je):lt=z.wnext-Je,Je>z.length&&(Je=z.length),vt=z.window}else vt=Ce,lt=me-z.offset,Je=z.length;Je>se&&(Je=se),se-=Je,z.length-=Je;do Ce[me++]=vt[lt++];while(--Je);z.length===0&&(z.mode=Ue);break;case ke:if(se===0)break e;Ce[me++]=z.length,se--,z.mode=Ue;break;case te:if(z.wrap){for(;Ke<32;){if(De===0)break e;De--,ve|=oe[X++]<<Ke,Ke+=8}if(qe-=se,Y.total_out+=qe,z.total+=qe,qe&&(Y.adler=z.check=z.flags?(0,R.default)(z.check,Ce,qe,me-qe):(0,D.default)(z.check,Ce,qe,me-qe)),qe=se,(z.flags?ve:Se(ve))!==z.check){Y.msg="incorrect data check",z.mode=_e;break}ve=0,Ke=0}z.mode=pe;case pe:if(z.wrap&&z.flags){for(;Ke<32;){if(De===0)break e;De--,ve+=oe[X++]<<Ke,Ke+=8}if(ve!==(z.total&4294967295)){Y.msg="incorrect length check",z.mode=_e;break}ve=0,Ke=0}z.mode=ae;case ae:It=a;break e;case _e:It=h;break e;case Ie:return w;case Fe:default:return f}return Y.next_out=me,Y.avail_out=se,Y.next_in=X,Y.avail_in=De,z.hold=ve,z.bits=Ke,(z.wsize||qe!==Y.avail_out&&z.mode<_e&&(z.mode<te||Z!==s))&&ne(Y,Y.output,Y.next_out,qe-Y.avail_out)?(z.mode=Ie,w):(rt-=Y.avail_in,qe-=Y.avail_out,Y.total_in+=rt,Y.total_out+=qe,z.total+=qe,z.wrap&&qe&&(Y.adler=z.check=z.flags?(0,R.default)(z.check,Ce,qe,Y.next_out-qe):(0,D.default)(z.check,Ce,qe,Y.next_out-qe)),Y.data_type=z.bits+(z.last?64:0)+(z.mode===F?128:0)+(z.mode===Be||z.mode===K?256:0),(rt===0&&qe===0||Z===s)&&It===n&&(It=m),It)}function Oe(Y){if(!Y||!Y.state)return f;var Z=Y.state;return Z.window&&(Z.window=null),Y.state=null,n}function he(Y,Z){var z;return!Y||!Y.state?f:(z=Y.state,(z.wrap&2)===0?f:(z.head=Z,Z.done=!1,n))}function ce(Y,Z){var z=Z.length,oe,Ce,X;return!Y||!Y.state?f:(oe=Y.state,oe.wrap!==0&&oe.mode!==H?f:oe.mode===H&&(Ce=1,Ce=(0,D.default)(Ce,Z,z,0),Ce!==oe.check)?h:(X=ne(Y,Z,z,z),X?(oe.mode=Ie,w):(oe.havedict=1,n)))}var le="pako inflate (from Nodeca project)";ue.inflateInfo=le},gIYZ:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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"};ue.default=j},h78n:function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return P});var j=ie("q1tI"),k=ie.n(j),D=ie("TSYQ"),R=ie.n(D),O={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},c=function(F){var W=F.map(function(){return Object(j.useRef)()}),U=Object(j.useRef)();return Object(j.useEffect)(function(){var K=Date.now(),G=!1;Object.keys(W).forEach(function(ee){var de=W[ee].current;if(!de)return;G=!0;var ge=de.style;ge.transitionDuration=".3s, .3s, .3s, .06s",U.current&&K-U.current<100&&(ge.transitionDuration="0s, 0s")}),G&&(U.current=Date.now())}),[W]};function E(){return E=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var W=arguments[F];for(var U in W)Object.prototype.hasOwnProperty.call(W,U)&&(H[U]=W[U])}return H},E.apply(this,arguments)}function y(H,F){return s(H)||d(H,F)||u(H,F)||p()}function p(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(H,F){if(!H)return;if(typeof H=="string")return o(H,F);var W=Object.prototype.toString.call(H).slice(8,-1);if(W==="Object"&&H.constructor&&(W=H.constructor.name),W==="Map"||W==="Set")return Array.from(H);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return o(H,F)}function o(H,F){(F==null||F>H.length)&&(F=H.length);for(var W=0,U=new Array(F);W<F;W++)U[W]=H[W];return U}function d(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var W=[],U=!0,K=!1,G=void 0;try{for(var ee=H[Symbol.iterator](),de;!(U=(de=ee.next()).done)&&!(W.push(de.value),F&&W.length===F);U=!0);}catch(ge){K=!0,G=ge}finally{try{!U&&ee.return!=null&&ee.return()}finally{if(K)throw G}}return W}function s(H){if(Array.isArray(H))return H}function l(H,F){if(H==null)return{};var W=r(H,F),U,K;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(H);for(K=0;K<G.length;K++){if(U=G[K],F.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,U))continue;W[U]=H[U]}}return W}function r(H,F){if(H==null)return{};var W={},U=Object.keys(H),K,G;for(G=0;G<U.length;G++){if(K=U[G],F.indexOf(K)>=0)continue;W[K]=H[K]}return W}var n=function(F){var W=F.className,U=F.percent,K=F.prefixCls,G=F.strokeColor,ee=F.strokeLinecap,de=F.strokeWidth,ge=F.style,Be=F.trailColor,Ue=F.trailWidth,Le=F.transition,Me=l(F,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Me.gapPosition;var Pe=Array.isArray(U)?U:[U],be=Array.isArray(G)?G:[G],ke=c(Pe),te=y(ke,1),pe=te[0],ae=de/2,_e=100-de/2,Ie="M ".concat(ee==="round"?ae:0,",").concat(ae,`
|
|
|
L `).concat(ee==="round"?_e:100,",").concat(ae),Fe="0 0 100 ".concat(de),Xe=0;return k.a.createElement("svg",E({className:R()("".concat(K,"-line"),W),viewBox:Fe,preserveAspectRatio:"none",style:ge},Me),k.a.createElement("path",{className:"".concat(K,"-line-trail"),d:Ie,strokeLinecap:ee,stroke:Be,strokeWidth:Ue||de,fillOpacity:"0"}),Pe.map(function(Ge,ze){var Re={strokeDasharray:"".concat(Ge,"px, 100px"),strokeDashoffset:"-".concat(Xe,"px"),transition:Le||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Se=be[ze]||be[be.length-1];return Xe+=Ge,k.a.createElement("path",{key:ze,className:"".concat(K,"-line-path"),d:Ie,strokeLinecap:ee,stroke:Se,strokeWidth:de,fillOpacity:"0",ref:pe[ze],style:Re})}))};n.defaultProps=O;var a=n;function i(){return i=Object.assign||function(H){for(var F=1;F<arguments.length;F++){var W=arguments[F];for(var U in W)Object.prototype.hasOwnProperty.call(W,U)&&(H[U]=W[U])}return H},i.apply(this,arguments)}function f(H,F){return A(H)||T(H,F)||w(H,F)||h()}function h(){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(H,F){if(!H)return;if(typeof H=="string")return m(H,F);var W=Object.prototype.toString.call(H).slice(8,-1);if(W==="Object"&&H.constructor&&(W=H.constructor.name),W==="Map"||W==="Set")return Array.from(H);if(W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W))return m(H,F)}function m(H,F){(F==null||F>H.length)&&(F=H.length);for(var W=0,U=new Array(F);W<F;W++)U[W]=H[W];return U}function T(H,F){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(H)))return;var W=[],U=!0,K=!1,G=void 0;try{for(var ee=H[Symbol.iterator](),de;!(U=(de=ee.next()).done)&&!(W.push(de.value),F&&W.length===F);U=!0);}catch(ge){K=!0,G=ge}finally{try{!U&&ee.return!=null&&ee.return()}finally{if(K)throw G}}return W}function A(H){if(Array.isArray(H))return H}function x(H,F){if(H==null)return{};var W=b(H,F),U,K;if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(H);for(K=0;K<G.length;K++){if(U=G[K],F.indexOf(U)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(H,U))continue;W[U]=H[U]}}return W}function b(H,F){if(H==null)return{};var W={},U=Object.keys(H),K,G;for(G=0;G<U.length;G++){if(K=U[G],F.indexOf(K)>=0)continue;W[K]=H[K]}return W}var S=0;function C(H){return+H.replace("%","")}function g(H){return Array.isArray(H)?H:[H]}function M(H,F,W,U){var K=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,G=arguments.length>5?arguments[5]:void 0,ee=50-U/2,de=0,ge=-ee,Be=0,Ue=-2*ee;switch(G){case"left":de=-ee,ge=0,Be=2*ee,Ue=0;break;case"right":de=ee,ge=0,Be=-2*ee,Ue=0;break;case"bottom":ge=ee,Ue=2*ee;break;default:}var Le="M 50,50 m ".concat(de,",").concat(ge,`
|
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(Be,",").concat(-Ue,`
|
|
|
a `).concat(ee,",").concat(ee," 0 1 1 ").concat(-Be,",").concat(Ue),Me=Math.PI*2*ee,Pe={stroke:W,strokeDasharray:"".concat(F/100*(Me-K),"px ").concat(Me,"px"),strokeDashoffset:"-".concat(K/2+H/100*(Me-K),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Le,pathStyle:Pe}}var I=function(F){var W=F.prefixCls,U=F.strokeWidth,K=F.trailWidth,G=F.gapDegree,ee=F.gapPosition,de=F.trailColor,ge=F.strokeLinecap,Be=F.style,Ue=F.className,Le=F.strokeColor,Me=F.percent,Pe=x(F,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),be=Object(j.useMemo)(function(){return S+=1,S},[]),ke=M(0,100,de,U,G,ee),te=ke.pathString,pe=ke.pathStyle,ae=g(Me),_e=g(Le),Ie=_e.find(function(Re){return Object.prototype.toString.call(Re)==="[object Object]"}),Fe=c(ae),Xe=f(Fe,1),Ge=Xe[0],ze=function(){var Se=0;return ae.map(function(Te,Ee){var $=_e[Ee]||_e[_e.length-1],fe=Object.prototype.toString.call($)==="[object Object]"?"url(#".concat(W,"-gradient-").concat(be,")"):"",J=M(Se,Te,$,U,G,ee);return Se+=Te,k.a.createElement("path",{key:Ee,className:"".concat(W,"-circle-path"),d:J.pathString,stroke:fe,strokeLinecap:ge,strokeWidth:U,opacity:Te===0?0:1,fillOpacity:"0",style:J.pathStyle,ref:Ge[Ee]})})};return k.a.createElement("svg",i({className:R()("".concat(W,"-circle"),Ue),viewBox:"0 0 100 100",style:Be},Pe),Ie&&k.a.createElement("defs",null,k.a.createElement("linearGradient",{id:"".concat(W,"-gradient-").concat(be),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ie).sort(function(Re,Se){return C(Re)-C(Se)}).map(function(Re,Se){return k.a.createElement("stop",{key:Se,offset:Re,stopColor:Ie[Re]})}))),k.a.createElement("path",{className:"".concat(W,"-circle-trail"),d:te,stroke:de,strokeLinecap:ge,strokeWidth:K||U,fillOpacity:"0",style:pe}),ze().reverse())};I.defaultProps=O;var P=I,B={Line:a,Circle:P}},hXwI:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(O,c){if(!(O instanceof c))throw new TypeError("Cannot call a class as a function")}function k(O,c){for(var E=0;E<c.length;E++){var y=c[E];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(O,y.key,y)}}function D(O,c,E){return c&&k(O.prototype,c),E&&k(O,E),O}var R=function(){function O(){j(this,O)}return D(O,[{key:"decodeRect",value:function(E,y,p,u,o,d,s){if(o.rQwait("COPYRECT",4))return!1;var l=o.rQshift16(),r=o.rQshift16();return d.copyImage(l,r,E,y,p,u),!0}}]),O}();ue.default=R},iJb0:function($e,ue,ie){"use strict";ie.r(ue);var j=ie("+L6B"),k=ie("2/Rp"),D=ie("miYZ"),R=ie("tsqr"),O=ie("14J3"),c=ie("BMrR"),E=ie("jCWc"),y=ie("kPKH"),p=ie("k1fw"),u=ie("9og8"),o=ie("2qtc"),d=ie("kLXV"),s=ie("tJVT"),l=ie("PpiC"),r=ie("aHsQ"),n=ie("sGsY"),a=ie("WmNS"),i=ie.n(a),f=ie("q1tI"),h=ie.n(f),w=ie("9kvl"),m=ie("Lmeb"),T=ie("Ot1p"),A=ie("Dqnf"),x=ie("dhSg"),b=ie("MXD1"),S=ie("CFYs"),C=ie("rAM+"),g=ie("IxHN"),M=ie("bdgK"),I=ie("M8RZ"),P=ie("Ty5D"),B=ie("1dTM"),H=ie.n(B),F=ie("HBuW"),W=ie("VaU+"),U=ie.n(W),K=ie("ye1Q"),G=h.a.createElement(K.a,{style:{fontSize:24},spin:!0});function ee(te){return te.replace(/\\u([\dA-Za-z]{4})/g,function(pe,ae){return String.fromCharCode(parseInt("0x"+ae))})}function de(te){te||(te=window.location.search);var pe=te.substr(1),ae={};return pe.split("&").forEach(function(_e){var Ie=_e.split("=");ae[Ie[0]]=decodeURIComponent(Ie[1])}),ae}var ge={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"\u5B9E\u9A8C\u73AF\u5883\u51C6\u5907\u4E2D"},Be;(function(te){te[te.SET_LOADING=0]="SET_LOADING",te[te.SET_IS_LARGE=1]="SET_IS_LARGE",te[te.SET_MES=2]="SET_MES",te[te.SET_STATE=3]="SET_STATE",te[te.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",te[te.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"})(Be||(Be={}));function Ue(te,pe){switch(pe.type){case Be.SET_LOADING:return Object(p.a)(Object(p.a)({},te),{},{loading:pe.payload});case Be.SET_IS_LARGE:return Object(p.a)(Object(p.a)({},te),{},{isLarge:pe.payload});case Be.SET_MES:return Object(p.a)(Object(p.a)({},te),{},{mes:pe.payload});case Be.SET_STATE:return Object(p.a)(Object(p.a)({},te),pe.payload);case Be.SET_TRANSFER_CONTENT:return Object(p.a)(Object(p.a)({},te),{},{transferContent:pe.payload});case Be.SHOW_CLIPBOARD_BOX:return Object(p.a)(Object(p.a)({},te),{},{showClipBoardBox:pe.payload});default:throw new Error}}var Le=function(te){var pe=te.vnc_url,ae=te.window_vnc_url,_e=te.taskId,Ie=Object(f.useRef)(),Fe=Object(f.useRef)(),Xe=Object(f.useReducer)(Ue,ge),Ge=Object(s.a)(Xe,2),ze=Ge[0],Re=Ge[1],Se=Object(f.useState)(0),Te=Object(s.a)(Se,2),Ee=Te[0],$=Te[1],fe=ze.mes,J=ze.loading,Ae=ze.showClipBoardBox,We=ze.isLarge,Ye=ze.transferContent,Ne=Object(f.useState)(0),et=Object(s.a)(Ne,2),ne=et[0],xe=et[1],Oe,he=Object(f.useRef)(),ce=Object(P.i)();function le(){Re({type:Be.SHOW_CLIPBOARD_BOX,payload:!1})}function Y(){Re({type:Be.SET_IS_LARGE,payload:!We})}function Z(X){var me;return Ie.current&&(me=new M.default(function(De){var se=Object(C.a)(De),ve;try{for(se.s();!(ve=se.n()).done;){var Ke=ve.value;(Ke.target.offsetHeight>0||Ke.target.offsetWidth>0)&&X._eventHandlers.windowResize()}}catch(rt){se.e(rt)}finally{se.f()}}),me.observe(Ie.current)),me}var z=function(){var X=Object(u.a)(i.a.mark(function me(){var De;return i.a.wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return ve.next=2,Object(F.nb)(Object(p.a)({},ce));case 2:if(De=ve.sent,!((De==null?void 0:De.status)===-3)){ve.next=5;break}return ve.abrupt("return",new Promise(function(){var Ke=Object(u.a)(i.a.mark(function rt(qe,Je){return i.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:d.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 ct=Object(u.a)(i.a.mark(function yt(){return i.a.wrap(function(Ct){for(;;)switch(Ct.prev=Ct.next){case 0:return clearTimeout(Oe),xe(0),z(),Ct.abrupt("return");case 4:case"end":return Ct.stop()}},yt)}));function it(){return ct.apply(this,arguments)}return it}()});case 1:case"end":return vt.stop()}},rt)}));return function(rt,qe){return Ke.apply(this,arguments)}}()));case 5:if(!((De==null?void 0:De.status)===-1)){ve.next=7;break}throw new String(De==null?void 0:De.message);case 7:return x.a.publish("update-windows-time",De==null?void 0:De.data),ve.abrupt("return",De);case 9:case"end":return ve.stop()}},me)}));return function(){return X.apply(this,arguments)}}();Object(f.useEffect)(function(){return he.current=setTimeout(function(){d.a.confirm({title:h.a.createElement(h.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(){x.a.publish("delayed-time",1),$(Ee+1)}})},1e3*60*60),function(){clearTimeout(he.current)}},[]),Object(f.useEffect)(function(){var X,me;function De(Je){ae&&(R.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"),Re({type:Be.SET_LOADING,payload:!0}),$(Ee+1))}function se(){clearTimeout(Oe),xe(100),setTimeout(function(){Re({type:Be.SET_LOADING,payload:!1})},1300),x.a.subscribe("send-ctrl-alt-delete",function(){var Je;(Je=X)===null||Je===void 0||Je.sendCtrlAltDel()})}function ve(Je){var lt=ee(Je.detail.text);Re({type:Be.SET_TRANSFER_CONTENT,payload:lt})}if((ae||pe)&&Ie.current){new Promise(Object(u.a)(i.a.mark(function Je(){var lt,vt,ct,it,yt,Tt,Ct,Ht,Ut,Ot;return i.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return lt=de(),vt="",Rt.next=4,z();case 4:it=Rt.sent,ae?(ct="Edu123",vt=decodeURIComponent(it==null||((yt=it.data)===null||yt===void 0)?void 0:yt.vnc_url)):(Ct=new URL(it==null||((Tt=it.data)===null||Tt===void 0)?void 0:Tt.vnc_url),Ht=Ct.protocol,Ut=Ct.searchParams,Ot=Ct.host,ct=Ut.get("password"),vt="".concat(Ht==="https:"?"wss":"ws","://").concat(Ot,"/").concat(lt.path||"websockify")),X=new H.a(Ie.current,vt,{credentials:{password:ct},wsProtocols:["binary"]}),me=Z(X),X.viewOnly=lt.view_only||!1,ae?X.scaleViewport=!0:X.scaleViewport=lt.scale||!1,X.scaleViewport=lt.scale||!0,X.resizeSession=!0,Fe.current=X,X.addEventListener("disconnect",De),X.addEventListener("connect",se),X.addEventListener("clipboard",ve);case 16:case"end":return Rt.stop()}},Je)})));var Ke=x.a.subscribe("vnc-reseting",function(){Re({type:Be.SET_STATE,payload:{loading:!0,mes:"\u5B9E\u9A8C\u73AF\u5883\u91CD\u7F6E\u4E2D"}})}),rt=x.a.subscribe("vnc-enlarge",function(){Re({type:Be.SET_IS_LARGE,payload:!0})}),qe=x.a.subscribe("show-clipboard-box",function(){Re({type:Be.SHOW_CLIPBOARD_BOX,payload:!0})});return xe(0),function(){var Je,lt,vt,ct;(Je=X)===null||Je===void 0||Je.removeEventListener("disconnect",De),(lt=X)===null||lt===void 0||lt.removeEventListener("connect",se),(vt=X)===null||vt===void 0||vt.removeEventListener("clipboard",ve),Ke(),rt(),qe(),(ct=me)===null||ct===void 0||ct.unobserve(Ie.current)}}},[pe,ae,Ee]);function oe(X){var me;(me=Fe.current)===null||me===void 0||me.clipboardPasteFrom(X),Re({type:Be.SET_TRANSFER_CONTENT,payload:X}),R.b.success("\u4FDD\u5B58\u6210\u529F\uFF01\u4F60\u53EF\u4EE5\u5728\u5B9E\u9A8C\u73AF\u5883\u4E2D\u7C98\u8D34\u8BE5\u5185\u5BB9"),le()}Object(f.useEffect)(function(){ne==0&&Ce()},[ne]);var Ce=function X(){ne>99?ne=99:(ne=ne+1,Oe=setTimeout(function(){X()},1500)),ne<100&&xe(ne)};return h.a.createElement(f.Fragment,null,h.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(ae?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(We?"full-screen":"")},h.a.createElement("a",{className:"btn-vnc-resize",onClick:Y},h.a.createElement("i",{className:"iconfont ".concat(We?"icon-tuichuquanping1":"icon-quanping1")})),J?h.a.createElement(g.a,{className:U.a.spin,message:fe,style:{color:"#0152d9"}},h.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},h.a.createElement(S.a,{percent:ne,format:function(me){return h.a.createElement("span",{className:"c-white"},me,"%")}}))):null,h.a.createElement("div",{ref:Ie,className:"vnc-panel ".concat(J?"hide":"animated fadeIn")})),h.a.createElement(I.a,null))},Me=ie("m3rI"),Pe=n.a.Countdown,be=function(pe){var ae,_e,Ie=pe.shixunsDetail,Fe=pe.globalSetting,Xe=pe.loading,Ge=pe.dispatch,ze=pe.user,Re=pe.history,Se=Object(l.a)(pe,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),Te=Object(f.useState)({}),Ee=Object(s.a)(Te,2),$=Ee[0],fe=Ee[1],J=Object(f.useState)(400),Ae=Object(s.a)(J,2),We=Ae[0],Ye=Ae[1],Ne=Object(f.useState)(!1),et=Object(s.a)(Ne,2),ne=et[0],xe=et[1],Oe=Object(f.useState)(""),he=Object(s.a)(Oe,2),ce=he[0],le=he[1],Y=Object(f.useState)(Date.now()+1e3*60*60),Z=Object(s.a)(Y,2),z=Z[0],oe=Z[1],Ce=Se.match.params,X=Se.location.query,me=Object(f.useState)(!1),De=Object(s.a)(me,2),se=De[0],ve=De[1],Ke=Ie.mirrorApplies,rt=Object(f.useRef)();Object(f.useEffect)(function(){return Ge({type:"globalSetting/headerFooterToggle",payload:!1}),Je(),lt(),window.addEventListener("resize",Je),x.a.subscribe("delayed-time",function(){oe(Date.now()+1e3*60*60)}),function(){window.removeEventListener("resize",Je),clearTimeout(rt.current),Ge({type:"globalSetting/headerFooterToggle",payload:!0})}},[]),Object(f.useEffect)(function(){$.host&&setTimeout(function(){x.a.publish("create-socket",1)},1500)},[$]),Object(f.useEffect)(function(){Ke.webssh&&(qe(),rt.current=setTimeout(function(){d.a.confirm({title:h.a.createElement(h.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(){x.a.publish("ssh-add-connect-time",{}),x.a.publish("delayed-time",1)}})},1e3*60*60)),Ke.id&&Je()},[Ke]);var qe=function(){var vt=Object(u.a)(i.a.mark(function ct(){var it;return i.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(F.ob)(Object(p.a)({},Ce));case 2:it=Tt.sent,fe(Object(p.a)({},it));case 4:case"end":return Tt.stop()}},ct)}));return function(){return vt.apply(this,arguments)}}(),Je=function(){var ct=window.innerHeight;Ye(ct-(Ke.audit_remark?400:270))},lt=function(){var vt=Object(u.a)(i.a.mark(function ct(){return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:Ge({type:"shixunsDetail/getMirrorApplies",payload:Object(p.a)({},Ce)});case 1:case"end":return yt.stop()}},ct)}));return function(){return vt.apply(this,arguments)}}();return console.log(ze==null?void 0:ze.userInfo),h.a.createElement("section",{className:U.a.wrp},h.a.createElement("header",{className:U.a.header},h.a.createElement(c.a,{align:"middle"},h.a.createElement(y.a,{flex:"1"},h.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",height:"40",src:"".concat(Me.a.IMG_SERVER,"/images/").concat(ze==null||((ae=ze.userInfo)===null||ae===void 0)?void 0:ae.image_url),width:"40",style:{borderRadius:"50%"}}),h.a.createElement("span",{className:"ml10"},ze==null||((_e=ze.userInfo)===null||_e===void 0)?void 0:_e.real_name)),h.a.createElement(y.a,{flex:"1"},h.a.createElement("span",{className:"mr10 font18"},Ke.name)),h.a.createElement(y.a,null,h.a.createElement("span",null,"\u5269\u4F59\u65F6\u957F:",h.a.createElement(Pe,{className:U.a.cuttDown,value:z,format:"mm:ss",valueStyle:{color:"#FFF"}})),h.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){d.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 it;Re.push("/users/".concat((it=ze.userInfo)===null||it===void 0?void 0:it.login,"/experiment-img"))}})}})))),h.a.createElement("aside",{className:U.a.container},h.a.createElement(c.a,null,h.a.createElement(y.a,{style:{position:"relative",width:se?"0%":"40%"}},h.a.createElement("section",{className:"".concat(U.a.info," ml40 mr40"),style:{display:se?"none":"flex"}},h.a.createElement("aside",null,h.a.createElement(c.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},h.a.createElement(y.a,{className:"font18"},"\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E ",h.a.createElement("span",{className:"font16 ml20 c-grey-999"},"\u8BF7\u6309\u6A21\u677F\u586B\u5199\u5B9E\u9A8C\u73AF\u5883\u8BF4\u660E"))),h.a.createElement("aside",{className:"mt30 flex1"},h.a.createElement(T.a,{height:We,defaultValue:Ke.description||"",onChange:function(ct){return le(ct)}}),Ke.audit_remark&&h.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\uFF1A",h.a.createElement("span",{className:"c-red"},Ke.audit_remark))),h.a.createElement("aside",{className:"mb20"},h.a.createElement(c.a,{justify:"center",gutter:[20,20],className:U.a.buttons},h.a.createElement(y.a,null,h.a.createElement(k.a,{type:"primary",size:"large",loading:ne,onClick:Object(u.a)(i.a.mark(function vt(){var ct;return i.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return xe(!0),d.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(){}}),yt.next=4,Object(F.qb)(Object(p.a)(Object(p.a)({},Ce),{},{description:ce}));case 4:ct=yt.sent,(ct==null?void 0:ct.status)===0&&R.b.success("\u4FDD\u5B58\u6210\u529F"),xe(!1);case 7:case"end":return yt.stop()}},vt)}))},"\u4FDD\u5B58")),h.a.createElement(y.a,null,h.a.createElement(k.a,{type:"primary",ghost:!0,size:"large",onClick:Object(u.a)(i.a.mark(function vt(){return i.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:d.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 yt=Object(u.a)(i.a.mark(function Ct(){var Ht,Ut;return i.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(F.pb)(Object(p.a)(Object(p.a)({},Ce),{},{description:ce}));case 2:Ht=It.sent,(Ht==null?void 0:Ht.status)===0&&(Re.push("/users/".concat((Ut=ze.userInfo)===null||Ut===void 0?void 0:Ut.login,"/experiment-img")),R.b.success("\u7533\u8BF7\u53D1\u5E03\u6210\u529F"));case 4:case"end":return It.stop()}},Ct)}));function Tt(){return yt.apply(this,arguments)}return Tt}()});case 1:case"end":return it.stop()}},vt)}))},"\u7533\u8BF7\u53D1\u5E03")))))),h.a.createElement("div",{className:se?U.a.elseShrink:U.a.shrink,onClick:function(){return ve(!se)}},h.a.createElement("i",{className:"iconfont icon-cela"}))),h.a.createElement(y.a,{style:{background:"#000",width:se?"100%":"60%"}},h.a.createElement("div",null,h.a.createElement("aside",{className:U.a.fullBtn},h.a.createElement("span",{className:"icon-quanping"})),Ke.webssh&&h.a.createElement(A.a,{sshConfigData:$,sid:1}),((Ke==null?void 0:Ke.vnc)||(Ke==null?void 0:Ke.windows))&&h.a.createElement(Le,{taskId:Ke.type==="windows"?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:Ke.vnc,window_vnc_url:Ke.windows}))))))},ke=ue.default=Object(w.a)(function(te){var pe=te.shixunsDetail,ae=te.loading,_e=te.user,Ie=te.globalSetting;return{shixunsDetail:pe,globalSetting:Ie,user:_e,loading:ae.models.shixunsDetail}})(be)},iUHT:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;function j(m,T){if(!(m instanceof T))throw new TypeError("Cannot call a class as a function")}function k(m,T){for(var A=0;A<T.length;A++){var x=T[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,x.key,x)}}function D(m,T,A){return T&&k(m.prototype,T),A&&k(m,A),m}var R=[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],O=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=0,E,y,p,u,o,d;E=1<<16,y=1<<24,p=E|y,u=1<<2,o=1<<10,d=u|o;var s=[p|o,c|c,E|c,p|d,p|u,E|d,c|u,E|c,c|o,p|o,p|d,c|o,y|d,p|u,y|c,c|u,c|d,y|o,y|o,E|o,E|o,p|c,p|c,y|d,E|u,y|u,y|u,E|u,c|c,c|d,E|d,y|c,E|c,p|d,c|u,p|c,p|o,y|c,y|c,c|o,p|u,E|c,E|o,y|u,c|o,c|u,y|d,E|d,p|d,E|u,p|c,y|d,y|u,c|d,E|d,p|o,c|d,y|o,y|o,c|c,E|u,E|o,c|c,p|u];E=1<<20,y=1<<31,p=E|y,u=1<<5,o=1<<15,d=u|o;var l=[p|d,y|o,c|o,E|d,E|c,c|u,p|u,y|d,y|u,p|d,p|o,y|c,y|o,E|c,c|u,p|u,E|o,E|u,y|d,c|c,y|c,c|o,E|d,p|c,E|u,y|u,c|c,E|o,c|d,p|o,p|c,c|d,c|c,E|d,p|u,E|c,y|d,p|c,p|o,c|o,p|c,y|o,c|u,p|d,E|d,c|u,c|o,y|c,c|d,p|o,E|c,y|u,E|u,y|d,y|u,E|u,E|o,c|c,y|o,c|d,y|c,p|u,p|d,E|o];E=1<<17,y=1<<27,p=E|y,u=1<<3,o=1<<9,d=u|o;var r=[c|d,p|o,c|c,p|u,y|o,c|c,E|d,y|o,E|u,y|u,y|u,E|c,p|d,E|u,p|c,c|d,y|c,c|u,p|o,c|o,E|o,p|c,p|u,E|d,y|d,E|o,E|c,y|d,c|u,p|d,c|o,y|c,p|o,y|c,E|u,c|d,E|c,p|o,y|o,c|c,c|o,E|u,p|d,y|o,y|u,c|o,c|c,p|u,y|d,E|c,y|c,p|d,c|u,E|d,E|o,y|u,p|c,y|d,c|d,p|c,E|d,c|u,p|u,E|o];E=1<<13,y=1<<23,p=E|y,u=1<<0,o=1<<7,d=u|o;var n=[p|u,E|d,E|d,c|o,p|o,y|d,y|u,E|u,c|c,p|c,p|c,p|d,c|d,c|c,y|o,y|u,c|u,E|c,y|c,p|u,c|o,y|c,E|u,E|o,y|d,c|u,E|o,y|o,E|c,p|o,p|d,c|d,y|o,y|u,p|c,p|d,c|d,c|c,c|c,p|c,E|o,y|o,y|d,c|u,p|u,E|d,E|d,c|o,p|d,c|d,c|u,E|c,y|u,E|u,p|o,y|d,E|u,E|o,y|c,p|u,c|o,y|c,E|c,p|o];E=1<<25,y=1<<30,p=E|y,u=1<<8,o=1<<19,d=u|o;var a=[c|u,E|d,E|o,p|u,c|o,c|u,y|c,E|o,y|d,c|o,E|u,y|d,p|u,p|o,c|d,y|c,E|c,y|o,y|o,c|c,y|u,p|d,p|d,E|u,p|o,y|u,c|c,p|c,E|d,E|c,p|c,c|d,c|o,p|u,c|u,E|c,y|c,E|o,p|u,y|d,E|u,y|c,p|o,E|d,y|d,c|u,E|c,p|o,p|d,c|d,p|c,p|d,E|o,c|c,y|o,p|c,c|d,E|u,y|u,c|o,c|c,y|o,E|d,y|u];E=1<<22,y=1<<29,p=E|y,u=1<<4,o=1<<14,d=u|o;var i=[y|u,p|c,c|o,p|d,p|c,c|u,p|d,E|c,y|o,E|d,E|c,y|u,E|u,y|o,y|c,c|d,c|c,E|u,y|d,c|o,E|o,y|d,c|u,p|u,p|u,c|c,E|d,p|o,c|d,E|o,p|o,y|c,y|o,c|u,p|u,E|o,p|d,E|c,c|d,y|u,E|c,y|o,y|c,c|d,y|u,p|d,E|o,p|c,E|d,p|o,c|c,p|u,c|u,c|o,p|c,E|d,c|o,E|u,y|d,c|c,p|o,y|c,E|u,y|d];E=1<<21,y=1<<26,p=E|y,u=1<<1,o=1<<11,d=u|o;var f=[E|c,p|u,y|d,c|c,c|o,y|d,E|d,p|o,p|d,E|c,c|c,y|u,c|u,y|c,p|u,c|d,y|o,E|d,E|u,y|o,y|u,p|c,p|o,E|u,p|c,c|o,c|d,p|d,E|o,c|u,y|c,E|o,y|c,E|o,E|c,y|d,y|d,p|u,p|u,c|u,E|u,y|c,y|o,E|c,p|o,c|d,E|d,p|o,c|d,y|u,p|d,p|c,E|o,c|c,c|u,p|d,c|c,E|d,p|c,c|o,y|u,y|o,c|o,E|u];E=1<<18,y=1<<28,p=E|y,u=1<<6,o=1<<12,d=u|o;var h=[y|d,c|o,E|c,p|d,y|c,y|d,c|u,y|c,E|u,p|c,p|d,E|o,p|o,E|d,c|o,c|u,p|c,y|u,y|o,c|d,E|o,E|u,p|u,p|o,c|d,c|c,c|c,p|u,y|u,y|o,E|d,E|c,E|d,E|c,p|o,c|o,c|u,p|u,c|o,E|d,y|o,c|u,y|u,p|c,p|u,y|c,E|c,y|d,c|c,p|d,E|u,y|u,p|c,y|o,y|d,c|c,p|d,E|o,E|o,c|d,c|d,E|u,y|c,p|o],w=function(){function m(T){j(this,m),this.keys=[];for(var A=[],x=[],b=[],S=0,C=56;S<56;++S,C-=8){C+=C<-5?65:C<-3?31:C<-1?63:C===27?35:0;var g=C&7;A[S]=(T[C>>>3]&1<<g)!==0?1:0}for(var M=0;M<16;++M){var I=M<<1,P=I+1;b[I]=b[P]=0;for(var B=28;B<59;B+=28)for(var H=B-28;H<B;++H){var F=H+O[M];x[H]=F<B?A[F]:A[F-28]}for(var W=0;W<24;++W)x[R[W]]!==0&&(b[I]|=1<<23-W),x[R[W+24]]!==0&&(b[P]|=1<<23-W)}for(var U=0,K=0,G=0;U<16;++U){var ee=b[K++],de=b[K++];this.keys[G]=(ee&16515072)<<6,this.keys[G]|=(ee&4032)<<10,this.keys[G]|=(de&16515072)>>>10,this.keys[G]|=(de&4032)>>>6,++G,this.keys[G]=(ee&258048)<<12,this.keys[G]|=(ee&63)<<16,this.keys[G]|=(de&258048)>>>4,this.keys[G]|=de&63,++G}}return D(m,[{key:"enc8",value:function(A){var x=A.slice(),b=0,S,C,g;S=x[b++]<<24|x[b++]<<16|x[b++]<<8|x[b++],C=x[b++]<<24|x[b++]<<16|x[b++]<<8|x[b++],g=(S>>>4^C)&252645135,C^=g,S^=g<<4,g=(S>>>16^C)&65535,C^=g,S^=g<<16,g=(C>>>2^S)&858993459,S^=g,C^=g<<2,g=(C>>>8^S)&16711935,S^=g,C^=g<<8,C=C<<1|C>>>31&1,g=(S^C)&2863311530,S^=g,C^=g,S=S<<1|S>>>31&1;for(var M=0,I=0;M<8;++M){g=C<<28|C>>>4,g^=this.keys[I++];var P=f[g&63];P|=a[g>>>8&63],P|=r[g>>>16&63],P|=s[g>>>24&63],g=C^this.keys[I++],P|=h[g&63],P|=i[g>>>8&63],P|=n[g>>>16&63],P|=l[g>>>24&63],S^=P,g=S<<28|S>>>4,g^=this.keys[I++],P=f[g&63],P|=a[g>>>8&63],P|=r[g>>>16&63],P|=s[g>>>24&63],g=S^this.keys[I++],P|=h[g&63],P|=i[g>>>8&63],P|=n[g>>>16&63],P|=l[g>>>24&63],C^=P}for(C=C<<31|C>>>1,g=(S^C)&2863311530,S^=g,C^=g,S=S<<31|S>>>1,g=(S>>>8^C)&16711935,C^=g,S^=g<<8,g=(S>>>2^C)&858993459,C^=g,S^=g<<2,g=(C>>>16^S)&65535,S^=g,C^=g<<16,g=(C>>>4^S)&252645135,S^=g,C^=g<<4,g=[C,S],b=0;b<8;b++)x[b]=(g[b>>>2]>>>8*(3-b%4))%256,x[b]<0&&(x[b]+=256);return x}},{key:"encrypt",value:function(A){return this.enc8(A.slice(0,8)).concat(this.enc8(A.slice(8,16)))}}]),m}();ue.default=w},kSUc:function($e,ue,ie){},lNSK:function($e,ue,ie){"use strict";function j(X){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?j=function(De){return typeof De}:j=function(De){return De&&typeof Symbol=="function"&&De.constructor===Symbol&&De!==Symbol.prototype?"symbol":typeof De},j(X)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.deflateInit=Y,ue.deflateInit2=le,ue.deflateReset=he,ue.deflateResetKeep=Oe,ue.deflateSetHeader=ce,ue.deflate=Z,ue.deflateEnd=z,ue.deflateSetDictionary=oe,ue.deflateInfo=ue.Z_DEFLATED=ue.Z_UNKNOWN=ue.Z_DEFAULT_STRATEGY=ue.Z_FIXED=ue.Z_RLE=ue.Z_HUFFMAN_ONLY=ue.Z_FILTERED=ue.Z_DEFAULT_COMPRESSION=ue.Z_BUF_ERROR=ue.Z_DATA_ERROR=ue.Z_STREAM_ERROR=ue.Z_STREAM_END=ue.Z_OK=ue.Z_BLOCK=ue.Z_FINISH=ue.Z_FULL_FLUSH=ue.Z_PARTIAL_FLUSH=ue.Z_NO_FLUSH=void 0;var k=p(ie("6BzB")),D=p(ie("c5fP")),R=E(ie("xlC8")),O=E(ie("QV2g")),c=E(ie("xSIq"));function E(X){return X&&X.__esModule?X:{default:X}}function y(){if(typeof WeakMap!="function")return null;var X=new WeakMap;return y=function(){return X},X}function p(X){if(X&&X.__esModule)return X;if(X===null||j(X)!=="object"&&typeof X!="function")return{default:X};var me=y();if(me&&me.has(X))return me.get(X);var De={},se=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ve in X)if(Object.prototype.hasOwnProperty.call(X,ve)){var Ke=se?Object.getOwnPropertyDescriptor(X,ve):null;Ke&&(Ke.get||Ke.set)?Object.defineProperty(De,ve,Ke):De[ve]=X[ve]}return De.default=X,me&&me.set(X,De),De}var u=0;ue.Z_NO_FLUSH=u;var o=1;ue.Z_PARTIAL_FLUSH=o;var d=3;ue.Z_FULL_FLUSH=d;var s=4;ue.Z_FINISH=s;var l=5;ue.Z_BLOCK=l;var r=0;ue.Z_OK=r;var n=1;ue.Z_STREAM_END=n;var a=-2;ue.Z_STREAM_ERROR=a;var i=-3;ue.Z_DATA_ERROR=i;var f=-5;ue.Z_BUF_ERROR=f;var h=-1;ue.Z_DEFAULT_COMPRESSION=h;var w=1;ue.Z_FILTERED=w;var m=2;ue.Z_HUFFMAN_ONLY=m;var T=3;ue.Z_RLE=T;var A=4;ue.Z_FIXED=A;var x=0;ue.Z_DEFAULT_STRATEGY=x;var b=2;ue.Z_UNKNOWN=b;var S=8;ue.Z_DEFLATED=S;var C=9,g=15,M=8,I=29,P=256,B=P+1+I,H=30,F=19,W=2*B+1,U=15,K=3,G=258,ee=G+K+1,de=32,ge=42,Be=69,Ue=73,Le=91,Me=103,Pe=113,be=666,ke=1,te=2,pe=3,ae=4,_e=3;function Ie(X,me){return X.msg=c.default[me],me}function Fe(X){return(X<<1)-(X>4?9:0)}function Xe(X){for(var me=X.length;--me>=0;)X[me]=0}function Ge(X){var me=X.state,De=me.pending;if(De>X.avail_out&&(De=X.avail_out),De===0)return;k.arraySet(X.output,me.pending_buf,me.pending_out,De,X.next_out),X.next_out+=De,me.pending_out+=De,X.total_out+=De,X.avail_out-=De,me.pending-=De,me.pending===0&&(me.pending_out=0)}function ze(X,me){D._tr_flush_block(X,X.block_start>=0?X.block_start:-1,X.strstart-X.block_start,me),X.block_start=X.strstart,Ge(X.strm)}function Re(X,me){X.pending_buf[X.pending++]=me}function Se(X,me){X.pending_buf[X.pending++]=me>>>8&255,X.pending_buf[X.pending++]=me&255}function Te(X,me,De,se){var ve=X.avail_in;return ve>se&&(ve=se),ve===0?0:(X.avail_in-=ve,k.arraySet(me,X.input,X.next_in,ve,De),X.state.wrap===1?X.adler=(0,R.default)(X.adler,me,ve,De):X.state.wrap===2&&(X.adler=(0,O.default)(X.adler,me,ve,De)),X.next_in+=ve,X.total_in+=ve,ve)}function Ee(X,me){var De=X.max_chain_length,se=X.strstart,ve,Ke,rt=X.prev_length,qe=X.nice_match,Je=X.strstart>X.w_size-ee?X.strstart-(X.w_size-ee):0,lt=X.window,vt=X.w_mask,ct=X.prev,it=X.strstart+G,yt=lt[se+rt-1],Tt=lt[se+rt];X.prev_length>=X.good_match&&(De>>=2),qe>X.lookahead&&(qe=X.lookahead);do{if(ve=me,lt[ve+rt]!==Tt||lt[ve+rt-1]!==yt||lt[ve]!==lt[se]||lt[++ve]!==lt[se+1])continue;se+=2,ve++;do;while(lt[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&<[++se]===lt[++ve]&&se<it);if(Ke=G-(it-se),se=it-G,Ke>rt){if(X.match_start=me,rt=Ke,Ke>=qe)break;yt=lt[se+rt-1],Tt=lt[se+rt]}}while((me=ct[me&vt])>Je&&--De!==0);return rt<=X.lookahead?rt:X.lookahead}function $(X){var me=X.w_size,De,se,ve,Ke,rt;do{if(Ke=X.window_size-X.lookahead-X.strstart,X.strstart>=me+(me-ee)){k.arraySet(X.window,X.window,me,me,0),X.match_start-=me,X.strstart-=me,X.block_start-=me,se=X.hash_size,De=se;do ve=X.head[--De],X.head[De]=ve>=me?ve-me:0;while(--se);se=me,De=se;do ve=X.prev[--De],X.prev[De]=ve>=me?ve-me:0;while(--se);Ke+=me}if(X.strm.avail_in===0)break;if(se=Te(X.strm,X.window,X.strstart+X.lookahead,Ke),X.lookahead+=se,X.lookahead+X.insert>=K)for(rt=X.strstart-X.insert,X.ins_h=X.window[rt],X.ins_h=(X.ins_h<<X.hash_shift^X.window[rt+1])&X.hash_mask;X.insert&&!(X.ins_h=(X.ins_h<<X.hash_shift^X.window[rt+K-1])&X.hash_mask,X.prev[rt&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=rt,rt++,X.insert--,X.lookahead+X.insert<K););}while(X.lookahead<ee&&X.strm.avail_in!==0)}function fe(X,me){var De=65535;for(De>X.pending_buf_size-5&&(De=X.pending_buf_size-5);;){if(X.lookahead<=1){if($(X),X.lookahead===0&&me===u)return ke;if(X.lookahead===0)break}X.strstart+=X.lookahead,X.lookahead=0;var se=X.block_start+De;if((X.strstart===0||X.strstart>=se)&&(X.lookahead=X.strstart-se,X.strstart=se,ze(X,!1),X.strm.avail_out===0))return ke;if(X.strstart-X.block_start>=X.w_size-ee&&(ze(X,!1),X.strm.avail_out===0))return ke}return X.insert=0,me===s?(ze(X,!0),X.strm.avail_out===0?pe:ae):(X.strstart>X.block_start&&(ze(X,!1),X.strm.avail_out===0),ke)}function J(X,me){for(var De,se;;){if(X.lookahead<ee){if($(X),X.lookahead<ee&&me===u)return ke;if(X.lookahead===0)break}if(De=0,X.lookahead>=K&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,De=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart),De!==0&&X.strstart-De<=X.w_size-ee&&(X.match_length=Ee(X,De)),X.match_length>=K)if(se=D._tr_tally(X,X.strstart-X.match_start,X.match_length-K),X.lookahead-=X.match_length,X.match_length<=X.max_lazy_match&&X.lookahead>=K){X.match_length--;do X.strstart++,X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,De=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart;while(--X.match_length!==0);X.strstart++}else X.strstart+=X.match_length,X.match_length=0,X.ins_h=X.window[X.strstart],X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+1])&X.hash_mask;else se=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++;if(se&&(ze(X,!1),X.strm.avail_out===0))return ke}return X.insert=X.strstart<K-1?X.strstart:K-1,me===s?(ze(X,!0),X.strm.avail_out===0?pe:ae):X.last_lit&&(ze(X,!1),X.strm.avail_out===0)?ke:te}function Ae(X,me){for(var De,se,ve;;){if(X.lookahead<ee){if($(X),X.lookahead<ee&&me===u)return ke;if(X.lookahead===0)break}if(De=0,X.lookahead>=K&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,De=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart),X.prev_length=X.match_length,X.prev_match=X.match_start,X.match_length=K-1,De!==0&&X.prev_length<X.max_lazy_match&&X.strstart-De<=X.w_size-ee&&(X.match_length=Ee(X,De),X.match_length<=5&&(X.strategy===w||X.match_length===K&&X.strstart-X.match_start>4096)&&(X.match_length=K-1)),X.prev_length>=K&&X.match_length<=X.prev_length){ve=X.strstart+X.lookahead-K,se=D._tr_tally(X,X.strstart-1-X.prev_match,X.prev_length-K),X.lookahead-=X.prev_length-1,X.prev_length-=2;do++X.strstart<=ve&&(X.ins_h=(X.ins_h<<X.hash_shift^X.window[X.strstart+K-1])&X.hash_mask,De=X.prev[X.strstart&X.w_mask]=X.head[X.ins_h],X.head[X.ins_h]=X.strstart);while(--X.prev_length!==0);if(X.match_available=0,X.match_length=K-1,X.strstart++,se&&(ze(X,!1),X.strm.avail_out===0))return ke}else if(X.match_available){if(se=D._tr_tally(X,0,X.window[X.strstart-1]),se&&ze(X,!1),X.strstart++,X.lookahead--,X.strm.avail_out===0)return ke}else X.match_available=1,X.strstart++,X.lookahead--}return X.match_available&&(se=D._tr_tally(X,0,X.window[X.strstart-1]),X.match_available=0),X.insert=X.strstart<K-1?X.strstart:K-1,me===s?(ze(X,!0),X.strm.avail_out===0?pe:ae):X.last_lit&&(ze(X,!1),X.strm.avail_out===0)?ke:te}function We(X,me){for(var De,se,ve,Ke,rt=X.window;;){if(X.lookahead<=G){if($(X),X.lookahead<=G&&me===u)return ke;if(X.lookahead===0)break}if(X.match_length=0,X.lookahead>=K&&X.strstart>0&&(ve=X.strstart-1,se=rt[ve],se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve])){Ke=X.strstart+G;do;while(se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&se===rt[++ve]&&ve<Ke);X.match_length=G-(Ke-ve),X.match_length>X.lookahead&&(X.match_length=X.lookahead)}if(X.match_length>=K?(De=D._tr_tally(X,1,X.match_length-K),X.lookahead-=X.match_length,X.strstart+=X.match_length,X.match_length=0):(De=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++),De&&(ze(X,!1),X.strm.avail_out===0))return ke}return X.insert=0,me===s?(ze(X,!0),X.strm.avail_out===0?pe:ae):X.last_lit&&(ze(X,!1),X.strm.avail_out===0)?ke:te}function Ye(X,me){for(var De;;){if(X.lookahead===0&&($(X),X.lookahead===0)){if(me===u)return ke;break}if(X.match_length=0,De=D._tr_tally(X,0,X.window[X.strstart]),X.lookahead--,X.strstart++,De&&(ze(X,!1),X.strm.avail_out===0))return ke}return X.insert=0,me===s?(ze(X,!0),X.strm.avail_out===0?pe:ae):X.last_lit&&(ze(X,!1),X.strm.avail_out===0)?ke:te}function Ne(X,me,De,se,ve){this.good_length=X,this.max_lazy=me,this.nice_length=De,this.max_chain=se,this.func=ve}var et;et=[new Ne(0,0,0,0,fe),new Ne(4,4,8,4,J),new Ne(4,5,16,8,J),new Ne(4,6,32,32,J),new Ne(4,4,16,16,Ae),new Ne(8,16,32,32,Ae),new Ne(8,16,128,128,Ae),new Ne(8,32,128,256,Ae),new Ne(32,128,258,1024,Ae),new Ne(32,258,258,4096,Ae)];function ne(X){X.window_size=2*X.w_size,Xe(X.head),X.max_lazy_match=et[X.level].max_lazy,X.good_match=et[X.level].good_length,X.nice_match=et[X.level].nice_length,X.max_chain_length=et[X.level].max_chain,X.strstart=0,X.block_start=0,X.lookahead=0,X.insert=0,X.match_length=X.prev_length=K-1,X.match_available=0,X.ins_h=0}function xe(){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=S,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 k.Buf16(W*2),this.dyn_dtree=new k.Buf16((2*H+1)*2),this.bl_tree=new k.Buf16((2*F+1)*2),Xe(this.dyn_ltree),Xe(this.dyn_dtree),Xe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new k.Buf16(U+1),this.heap=new k.Buf16(2*B+1),Xe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new k.Buf16(2*B+1),Xe(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 Oe(X){var me;return!X||!X.state?Ie(X,a):(X.total_in=X.total_out=0,X.data_type=b,me=X.state,me.pending=0,me.pending_out=0,me.wrap<0&&(me.wrap=-me.wrap),me.status=me.wrap?ge:Pe,X.adler=me.wrap===2?0:1,me.last_flush=u,D._tr_init(me),r)}function he(X){var me=Oe(X);return me===r&&ne(X.state),me}function ce(X,me){return!X||!X.state||X.state.wrap!==2?a:(X.state.gzhead=me,r)}function le(X,me,De,se,ve,Ke){if(!X)return a;var rt=1;if(me===h&&(me=6),se<0?(rt=0,se=-se):se>15&&(rt=2,se-=16),ve<1||ve>C||De!==S||se<8||se>15||me<0||me>9||Ke<0||Ke>A)return Ie(X,a);se===8&&(se=9);var qe=new xe;return X.state=qe,qe.strm=X,qe.wrap=rt,qe.gzhead=null,qe.w_bits=se,qe.w_size=1<<qe.w_bits,qe.w_mask=qe.w_size-1,qe.hash_bits=ve+7,qe.hash_size=1<<qe.hash_bits,qe.hash_mask=qe.hash_size-1,qe.hash_shift=~~((qe.hash_bits+K-1)/K),qe.window=new k.Buf8(qe.w_size*2),qe.head=new k.Buf16(qe.hash_size),qe.prev=new k.Buf16(qe.w_size),qe.lit_bufsize=1<<ve+6,qe.pending_buf_size=qe.lit_bufsize*4,qe.pending_buf=new k.Buf8(qe.pending_buf_size),qe.d_buf=1*qe.lit_bufsize,qe.l_buf=(1+2)*qe.lit_bufsize,qe.level=me,qe.strategy=Ke,qe.method=De,he(X)}function Y(X,me){return le(X,me,S,g,M,x)}function Z(X,me){var De,se,ve,Ke;if(!X||!X.state||me>l||me<0)return X?Ie(X,a):a;if(se=X.state,!X.output||!X.input&&X.avail_in!==0||se.status===be&&me!==s)return Ie(X,X.avail_out===0?f:a);if(se.strm=X,De=se.last_flush,se.last_flush=me,se.status===ge)if(se.wrap===2)X.adler=0,Re(se,31),Re(se,139),Re(se,8),se.gzhead?(Re(se,(se.gzhead.text?1:0)+(se.gzhead.hcrc?2:0)+(se.gzhead.extra?4:0)+(se.gzhead.name?8:0)+(se.gzhead.comment?16:0)),Re(se,se.gzhead.time&255),Re(se,se.gzhead.time>>8&255),Re(se,se.gzhead.time>>16&255),Re(se,se.gzhead.time>>24&255),Re(se,se.level===9?2:se.strategy>=m||se.level<2?4:0),Re(se,se.gzhead.os&255),se.gzhead.extra&&se.gzhead.extra.length&&(Re(se,se.gzhead.extra.length&255),Re(se,se.gzhead.extra.length>>8&255)),se.gzhead.hcrc&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending,0)),se.gzindex=0,se.status=Be):(Re(se,0),Re(se,0),Re(se,0),Re(se,0),Re(se,0),Re(se,se.level===9?2:se.strategy>=m||se.level<2?4:0),Re(se,_e),se.status=Pe);else{var rt=S+(se.w_bits-8<<4)<<8,qe=-1;se.strategy>=m||se.level<2?qe=0:se.level<6?qe=1:se.level===6?qe=2:qe=3,rt|=qe<<6,se.strstart!==0&&(rt|=de),rt+=31-rt%31,se.status=Pe,Se(se,rt),se.strstart!==0&&(Se(se,X.adler>>>16),Se(se,X.adler&65535)),X.adler=1}if(se.status===Be)if(se.gzhead.extra){for(ve=se.pending;se.gzindex<(se.gzhead.extra.length&65535)&&!(se.pending===se.pending_buf_size&&(se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),Ge(X),ve=se.pending,se.pending===se.pending_buf_size));)Re(se,se.gzhead.extra[se.gzindex]&255),se.gzindex++;se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),se.gzindex===se.gzhead.extra.length&&(se.gzindex=0,se.status=Ue)}else se.status=Ue;if(se.status===Ue)if(se.gzhead.name){ve=se.pending;do{if(se.pending===se.pending_buf_size&&(se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),Ge(X),ve=se.pending,se.pending===se.pending_buf_size)){Ke=1;break}se.gzindex<se.gzhead.name.length?Ke=se.gzhead.name.charCodeAt(se.gzindex++)&255:Ke=0,Re(se,Ke)}while(Ke!==0);se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),Ke===0&&(se.gzindex=0,se.status=Le)}else se.status=Le;if(se.status===Le)if(se.gzhead.comment){ve=se.pending;do{if(se.pending===se.pending_buf_size&&(se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),Ge(X),ve=se.pending,se.pending===se.pending_buf_size)){Ke=1;break}se.gzindex<se.gzhead.comment.length?Ke=se.gzhead.comment.charCodeAt(se.gzindex++)&255:Ke=0,Re(se,Ke)}while(Ke!==0);se.gzhead.hcrc&&se.pending>ve&&(X.adler=(0,O.default)(X.adler,se.pending_buf,se.pending-ve,ve)),Ke===0&&(se.status=Me)}else se.status=Me;if(se.status===Me&&(se.gzhead.hcrc?(se.pending+2>se.pending_buf_size&&Ge(X),se.pending+2<=se.pending_buf_size&&(Re(se,X.adler&255),Re(se,X.adler>>8&255),X.adler=0,se.status=Pe)):se.status=Pe),se.pending!==0){if(Ge(X),X.avail_out===0)return se.last_flush=-1,r}else if(X.avail_in===0&&Fe(me)<=Fe(De)&&me!==s)return Ie(X,f);if(se.status===be&&X.avail_in!==0)return Ie(X,f);if(X.avail_in!==0||se.lookahead!==0||me!==u&&se.status!==be){var Je=se.strategy===m?Ye(se,me):se.strategy===T?We(se,me):et[se.level].func(se,me);if((Je===pe||Je===ae)&&(se.status=be),Je===ke||Je===pe)return X.avail_out===0&&(se.last_flush=-1),r;if(Je===te&&(me===o?D._tr_align(se):me!==l&&(D._tr_stored_block(se,0,0,!1),me===d&&(Xe(se.head),se.lookahead===0&&(se.strstart=0,se.block_start=0,se.insert=0))),Ge(X),X.avail_out===0))return se.last_flush=-1,r}return me!==s?r:se.wrap<=0?n:(se.wrap===2?(Re(se,X.adler&255),Re(se,X.adler>>8&255),Re(se,X.adler>>16&255),Re(se,X.adler>>24&255),Re(se,X.total_in&255),Re(se,X.total_in>>8&255),Re(se,X.total_in>>16&255),Re(se,X.total_in>>24&255)):(Se(se,X.adler>>>16),Se(se,X.adler&65535)),Ge(X),se.wrap>0&&(se.wrap=-se.wrap),se.pending!==0?r:n)}function z(X){var me;return!X||!X.state?a:(me=X.state.status,me!==ge&&me!==Be&&me!==Ue&&me!==Le&&me!==Me&&me!==Pe&&me!==be?Ie(X,a):(X.state=null,me===Pe?Ie(X,i):r))}function oe(X,me){var De=me.length,se,ve,Ke,rt,qe,Je,lt,vt;if(!X||!X.state)return a;if(se=X.state,rt=se.wrap,rt===2||rt===1&&se.status!==ge||se.lookahead)return a;for(rt===1&&(X.adler=(0,R.default)(X.adler,me,De,0)),se.wrap=0,De>=se.w_size&&(rt===0&&(Xe(se.head),se.strstart=0,se.block_start=0,se.insert=0),vt=new k.Buf8(se.w_size),k.arraySet(vt,me,De-se.w_size,se.w_size,0),me=vt,De=se.w_size),qe=X.avail_in,Je=X.next_in,lt=X.input,X.avail_in=De,X.next_in=0,X.input=me,$(se);se.lookahead>=K;){ve=se.strstart,Ke=se.lookahead-(K-1);do se.ins_h=(se.ins_h<<se.hash_shift^se.window[ve+K-1])&se.hash_mask,se.prev[ve&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ve,ve++;while(--Ke);se.strstart=ve,se.lookahead=K-1,$(se)}return se.strstart+=se.lookahead,se.block_start=se.strstart,se.insert=se.lookahead,se.lookahead=0,se.match_length=se.prev_length=K-1,se.match_available=0,X.next_in=Je,X.input=lt,X.avail_in=qe,se.wrap=rt,r}var Ce="pako deflate (from Nodeca project)";ue.deflateInfo=Ce},lZu9:function($e,ue,ie){(function(j){j(ie("VrN/"),ie("1eCo"),ie("8EBN"))})(function(j){"use strict";j.defineMode("markdown",function(k,D){var R=j.getMode(k,"text/html"),O=R.name=="null";function c(U){if(j.findModeByName){var K=j.findModeByName(U);K&&(U=K.mime||K.mimes[0])}var G=j.getMode(k,U);return G.name=="null"?null:G}D.highlightFormatting===void 0&&(D.highlightFormatting=!1),D.maxBlockquoteDepth===void 0&&(D.maxBlockquoteDepth=0),D.taskLists===void 0&&(D.taskLists=!1),D.strikethrough===void 0&&(D.strikethrough=!1),D.emoji===void 0&&(D.emoji=!1),D.fencedCodeBlockHighlighting===void 0&&(D.fencedCodeBlockHighlighting=!0),D.fencedCodeBlockDefaultMode===void 0&&(D.fencedCodeBlockDefaultMode="text/plain"),D.xml===void 0&&(D.xml=!0),D.tokenTypeOverrides===void 0&&(D.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 y in E)E.hasOwnProperty(y)&&D.tokenTypeOverrides[y]&&(E[y]=D.tokenTypeOverrides[y]);var p=/^([*\-_])(?:\s*\1){2,}\s*$/,u=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,o=/^\[(x| )\](?=\s)/i,d=D.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,s=/^ {0,3}(?:\={1,}|-{2,})\s*$/,l=/^[^#!\[\]*_\\<>` "'(~:]+/,r=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,n=/^\s*\[[^\]]+?\]:.*$/,a=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,i=" ";function f(U,K,G){return K.f=K.inline=G,G(U,K)}function h(U,K,G){return K.f=K.block=G,G(U,K)}function w(U){return!U||!/\S/.test(U.string)}function m(U){if(U.linkTitle=!1,U.linkHref=!1,U.linkText=!1,U.em=!1,U.strong=!1,U.strikethrough=!1,U.quote=0,U.indentedCode=!1,U.f==A){var K=O;if(!K){var G=j.innerMode(R,U.htmlState);K=G.mode.name=="xml"&&G.state.tagStart===null&&!G.state.context&&G.state.tokenize.isInText}K&&(U.f=C,U.block=T,U.htmlState=null)}return U.trailingSpace=0,U.trailingSpaceNewLine=!1,U.prevLine=U.thisLine,U.thisLine={stream:null},null}function T(U,K){var G=U.column()===K.indentation,ee=w(K.prevLine.stream),de=K.indentedCode,ge=K.prevLine.hr,Be=K.list!==!1,Ue=(K.listStack[K.listStack.length-1]||0)+3;K.indentedCode=!1;var Le=K.indentation;if(K.indentationDiff===null&&(K.indentationDiff=K.indentation,Be)){for(K.list=null;Le<K.listStack[K.listStack.length-1];)K.listStack.pop(),K.listStack.length?K.indentation=K.listStack[K.listStack.length-1]:K.list=!1;K.list!==!1&&(K.indentationDiff=Le-K.listStack[K.listStack.length-1])}var Me=!ee&&!ge&&!K.prevLine.header&&(!Be||!de)&&!K.prevLine.fencedCodeEnd,Pe=(K.list===!1||ge||ee)&&K.indentation<=Ue&&U.match(p),be=null;if(K.indentationDiff>=4&&(de||K.prevLine.fencedCodeEnd||K.prevLine.header||ee))return U.skipToEnd(),K.indentedCode=!0,E.code;if(U.eatSpace())return null;if(G&&K.indentation<=Ue&&(be=U.match(d))&&be[1].length<=6)return K.quote=0,K.header=be[1].length,K.thisLine.header=!0,D.highlightFormatting&&(K.formatting="header"),K.f=K.inline,b(K);if(K.indentation<=Ue&&U.eat(">"))return K.quote=G?1:K.quote+1,D.highlightFormatting&&(K.formatting="quote"),U.eatSpace(),b(K);if(!Pe&&!K.setext&&G&&K.indentation<=Ue&&(be=U.match(u))){var ke=be[1]?"ol":"ul";return K.indentation=Le+U.current().length,K.list=!0,K.quote=0,K.listStack.push(K.indentation),K.em=!1,K.strong=!1,K.code=!1,K.strikethrough=!1,D.taskLists&&U.match(o,!1)&&(K.taskList=!0),K.f=K.inline,D.highlightFormatting&&(K.formatting=["list","list-"+ke]),b(K)}else{if(G&&K.indentation<=Ue&&(be=U.match(r,!0)))return K.quote=0,K.fencedEndRE=new RegExp(be[1]+"+ *$"),K.localMode=D.fencedCodeBlockHighlighting&&c(be[2]||D.fencedCodeBlockDefaultMode),K.localMode&&(K.localState=j.startState(K.localMode)),K.f=K.block=x,D.highlightFormatting&&(K.formatting="code-block"),K.code=-1,b(K);if(K.setext||(!Me||!Be)&&!K.quote&&K.list===!1&&!K.code&&!Pe&&!n.test(U.string)&&(be=U.lookAhead(1))&&(be=be.match(s)))return K.setext?(K.header=K.setext,K.setext=0,U.skipToEnd(),D.highlightFormatting&&(K.formatting="header")):(K.header=be[0].charAt(0)=="="?1:2,K.setext=K.header),K.thisLine.header=!0,K.f=K.inline,b(K);if(Pe)return U.skipToEnd(),K.hr=!0,K.thisLine.hr=!0,E.hr;if(U.peek()==="[")return f(U,K,B)}return f(U,K,K.inline)}function A(U,K){var G=R.token(U,K.htmlState);if(!O){var ee=j.innerMode(R,K.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||K.md_inside&&U.current().indexOf(">")>-1)&&(K.f=C,K.block=T,K.htmlState=null)}return G}function x(U,K){var G=K.listStack[K.listStack.length-1]||0,ee=K.indentation<G,de=G+3;if(K.fencedEndRE&&K.indentation<=de&&(ee||U.match(K.fencedEndRE))){D.highlightFormatting&&(K.formatting="code-block");var ge;return ee||(ge=b(K)),K.localMode=K.localState=null,K.block=T,K.f=C,K.fencedEndRE=null,K.code=0,K.thisLine.fencedCodeEnd=!0,ee?h(U,K,K.block):ge}else return K.localMode?K.localMode.token(U,K.localState):(U.skipToEnd(),E.code)}function b(U){var K=[];if(U.formatting){K.push(E.formatting),typeof U.formatting=="string"&&(U.formatting=[U.formatting]);for(var G=0;G<U.formatting.length;G++)K.push(E.formatting+"-"+U.formatting[G]),U.formatting[G]==="header"&&K.push(E.formatting+"-"+U.formatting[G]+"-"+U.header),U.formatting[G]==="quote"&&(!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?K.push(E.formatting+"-"+U.formatting[G]+"-"+U.quote):K.push("error"))}if(U.taskOpen)return K.push("meta"),K.length?K.join(" "):null;if(U.taskClosed)return K.push("property"),K.length?K.join(" "):null;if(U.linkHref?K.push(E.linkHref,"url"):(U.strong&&K.push(E.strong),U.em&&K.push(E.em),U.strikethrough&&K.push(E.strikethrough),U.emoji&&K.push(E.emoji),U.linkText&&K.push(E.linkText),U.code&&K.push(E.code),U.image&&K.push(E.image),U.imageAltText&&K.push(E.imageAltText,"link"),U.imageMarker&&K.push(E.imageMarker)),U.header&&K.push(E.header,E.header+"-"+U.header),U.quote&&(K.push(E.quote),!D.maxBlockquoteDepth||D.maxBlockquoteDepth>=U.quote?K.push(E.quote+"-"+U.quote):K.push(E.quote+"-"+D.maxBlockquoteDepth)),U.list!==!1){var ee=(U.listStack.length-1)%3;ee?ee===1?K.push(E.list2):K.push(E.list3):K.push(E.list1)}return U.trailingSpaceNewLine?K.push("trailing-space-new-line"):U.trailingSpace&&K.push("trailing-space-"+(U.trailingSpace%2?"a":"b")),K.length?K.join(" "):null}function S(U,K){return U.match(l,!0)?b(K):void 0}function C(U,K){var G=K.text(U,K);if(typeof G!="undefined")return G;if(K.list)return K.list=null,b(K);if(K.taskList){var ee=U.match(o,!0)[1]===" ";return ee?K.taskOpen=!0:K.taskClosed=!0,D.highlightFormatting&&(K.formatting="task"),K.taskList=!1,b(K)}if(K.taskOpen=!1,K.taskClosed=!1,K.header&&U.match(/^#+$/,!0))return D.highlightFormatting&&(K.formatting="header"),b(K);var de=U.next();if(K.linkTitle){K.linkTitle=!1;var ge=de;de==="("&&(ge=")"),ge=(ge+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Be="^\\s*(?:[^"+ge+"\\\\]+|\\\\\\\\|\\\\.)"+ge;if(U.match(new RegExp(Be),!0))return E.linkHref}if(de==="`"){var Ue=K.formatting;D.highlightFormatting&&(K.formatting="code"),U.eatWhile("`");var Le=U.current().length;if(K.code==0&&(!K.quote||Le==1))return K.code=Le,b(K);if(Le==K.code){var Me=b(K);return K.code=0,Me}else return K.formatting=Ue,b(K)}else if(K.code)return b(K);if(de==="\\"&&(U.next(),D.highlightFormatting)){var Pe=b(K),be=E.formatting+"-escape";return Pe?Pe+" "+be:be}if(de==="!"&&U.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return K.imageMarker=!0,K.image=!0,D.highlightFormatting&&(K.formatting="image"),b(K);if(de==="["&&K.imageMarker&&U.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return K.imageMarker=!1,K.imageAltText=!0,D.highlightFormatting&&(K.formatting="image"),b(K);if(de==="]"&&K.imageAltText){D.highlightFormatting&&(K.formatting="image");var Pe=b(K);return K.imageAltText=!1,K.image=!1,K.inline=K.f=M,Pe}if(de==="["&&!K.image)return K.linkText&&U.match(/^.*?\]/)||(K.linkText=!0,D.highlightFormatting&&(K.formatting="link")),b(K);if(de==="]"&&K.linkText){D.highlightFormatting&&(K.formatting="link");var Pe=b(K);return K.linkText=!1,K.inline=K.f=U.match(/\(.*?\)| ?\[.*?\]/,!1)?M:C,Pe}if(de==="<"&&U.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){K.f=K.inline=g,D.highlightFormatting&&(K.formatting="link");var Pe=b(K);return Pe?Pe+=" ":Pe="",Pe+E.linkInline}if(de==="<"&&U.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){K.f=K.inline=g,D.highlightFormatting&&(K.formatting="link");var Pe=b(K);return Pe?Pe+=" ":Pe="",Pe+E.linkEmail}if(D.xml&&de==="<"&&U.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ke=U.string.indexOf(">",U.pos);if(ke!=-1){var te=U.string.substring(U.start,ke);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(te)&&(K.md_inside=!0)}return U.backUp(1),K.htmlState=j.startState(R),h(U,K,A)}if(D.xml&&de==="<"&&U.match(/^\/\w*?>/))return K.md_inside=!1,"tag";if(de==="*"||de==="_"){for(var pe=1,ae=U.pos==1?" ":U.string.charAt(U.pos-2);pe<3&&U.eat(de);)pe++;var _e=U.peek()||" ",Ie=!/\s/.test(_e)&&(!a.test(_e)||/\s/.test(ae)||a.test(ae)),Fe=!/\s/.test(ae)&&(!a.test(ae)||/\s/.test(_e)||a.test(_e)),Xe=null,Ge=null;if(pe%2&&(!K.em&&Ie&&(de==="*"||!Fe||a.test(ae))?Xe=!0:K.em==de&&Fe&&(de==="*"||!Ie||a.test(_e))&&(Xe=!1)),pe>1&&(!K.strong&&Ie&&(de==="*"||!Fe||a.test(ae))?Ge=!0:K.strong==de&&Fe&&(de==="*"||!Ie||a.test(_e))&&(Ge=!1)),Ge!=null||Xe!=null){D.highlightFormatting&&(K.formatting=Xe==null?"strong":Ge==null?"em":"strong em"),Xe===!0&&(K.em=de),Ge===!0&&(K.strong=de);var Me=b(K);return Xe===!1&&(K.em=!1),Ge===!1&&(K.strong=!1),Me}}else if(de===" "&&(U.eat("*")||U.eat("_"))){if(U.peek()===" ")return b(K);U.backUp(1)}if(D.strikethrough){if(de==="~"&&U.eatWhile(de)){if(K.strikethrough){D.highlightFormatting&&(K.formatting="strikethrough");var Me=b(K);return K.strikethrough=!1,Me}else if(U.match(/^[^\s]/,!1))return K.strikethrough=!0,D.highlightFormatting&&(K.formatting="strikethrough"),b(K)}else if(de===" "&&U.match(/^~~/,!0)){if(U.peek()===" ")return b(K);U.backUp(2)}}if(D.emoji&&de===":"&&U.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){K.emoji=!0,D.highlightFormatting&&(K.formatting="emoji");var ze=b(K);return K.emoji=!1,ze}return de===" "&&(U.match(/^ +$/,!1)?K.trailingSpace++:K.trailingSpace&&(K.trailingSpaceNewLine=!0)),b(K)}function g(U,K){var G=U.next();if(G===">"){K.f=K.inline=C,D.highlightFormatting&&(K.formatting="link");var ee=b(K);return ee?ee+=" ":ee="",ee+E.linkInline}return U.match(/^[^>]+/,!0),E.linkInline}function M(U,K){if(U.eatSpace())return null;var G=U.next();return G==="("||G==="["?(K.f=K.inline=P(G==="("?")":"]"),D.highlightFormatting&&(K.formatting="link-string"),K.linkHref=!0,b(K)):"error"}var I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function P(U){return function(K,G){var ee=K.next();if(ee===U){G.f=G.inline=C,D.highlightFormatting&&(G.formatting="link-string");var de=b(G);return G.linkHref=!1,de}return K.match(I[U]),G.linkHref=!0,b(G)}}function B(U,K){return U.match(/^([^\]\\]|\\.)*\]:/,!1)?(K.f=H,U.next(),D.highlightFormatting&&(K.formatting="link"),K.linkText=!0,b(K)):f(U,K,C)}function H(U,K){if(U.match(/^\]:/,!0)){K.f=K.inline=F,D.highlightFormatting&&(K.formatting="link");var G=b(K);return K.linkText=!1,G}return U.match(/^([^\]\\]|\\.)+/,!0),E.linkText}function F(U,K){return U.eatSpace()?null:(U.match(/^[^\s]+/,!0),U.peek()===void 0?K.linkTitle=!0:U.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),K.f=K.inline=C,E.linkHref+" url")}var W={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,htmlState:null,indentation:0,inline:C,text:S,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(U){return{f:U.f,prevLine:U.prevLine,thisLine:U.thisLine,block:U.block,htmlState:U.htmlState&&j.copyState(R,U.htmlState),indentation:U.indentation,localMode:U.localMode,localState:U.localMode?j.copyState(U.localMode,U.localState):null,inline:U.inline,text:U.text,formatting:!1,linkText:U.linkText,linkTitle:U.linkTitle,linkHref:U.linkHref,code:U.code,em:U.em,strong:U.strong,strikethrough:U.strikethrough,emoji:U.emoji,header:U.header,setext:U.setext,hr:U.hr,taskList:U.taskList,list:U.list,listStack:U.listStack.slice(0),quote:U.quote,indentedCode:U.indentedCode,trailingSpace:U.trailingSpace,trailingSpaceNewLine:U.trailingSpaceNewLine,md_inside:U.md_inside,fencedEndRE:U.fencedEndRE}},token:function(U,K){if(K.formatting=!1,U!=K.thisLine.stream){if(K.header=0,K.hr=!1,U.match(/^\s*$/,!0))return m(K),null;if(K.prevLine=K.thisLine,K.thisLine={stream:U},K.taskList=!1,K.trailingSpace=0,K.trailingSpaceNewLine=!1,!K.localState&&(K.f=K.block,K.f!=A)){var G=U.match(/^\s*/,!0)[0].replace(/\t/g,i).length;if(K.indentation=G,K.indentationDiff=null,G>0)return null}}return K.f(U,K)},innerMode:function(U){return U.block==A?{state:U.htmlState,mode:R}:U.localState?{state:U.localState,mode:U.localMode}:{state:U,mode:W}},indent:function(U,K,G){return U.block==A&&R.indent?R.indent(U.htmlState,K,G):U.localState&&U.localMode.indent?U.localMode.indent(U.localState,K,G):j.Pass},blankLine:m,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return W},"xml"),j.defineMIME("text/markdown","markdown"),j.defineMIME("text/x-markdown","markdown")})},mHUz:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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};ue.default=j},mTgk:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=k(ie("mHUz"));function k(y){return y&&y.__esModule?y:{default:y}}var D={};function R(y,p){if(p===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[p,p,p,p]}function O(y,p,u){if(p===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(u===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[p,p,u,p]}function c(y,p,u){if(p===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(u===void 0)throw new Error('Undefined keysym for key "'+y+'"');if(y in D)throw new Error('Duplicate entry for key "'+y+'"');D[y]=[p,p,p,u]}O("Alt",j.default.XK_Alt_L,j.default.XK_Alt_R),R("AltGraph",j.default.XK_ISO_Level3_Shift),R("CapsLock",j.default.XK_Caps_Lock),O("Control",j.default.XK_Control_L,j.default.XK_Control_R),O("Meta",j.default.XK_Super_L,j.default.XK_Super_R),R("NumLock",j.default.XK_Num_Lock),R("ScrollLock",j.default.XK_Scroll_Lock),O("Shift",j.default.XK_Shift_L,j.default.XK_Shift_R),c("Enter",j.default.XK_Return,j.default.XK_KP_Enter),R("Tab",j.default.XK_Tab),c(" ",j.default.XK_space,j.default.XK_KP_Space),c("ArrowDown",j.default.XK_Down,j.default.XK_KP_Down),c("ArrowUp",j.default.XK_Up,j.default.XK_KP_Up),c("ArrowLeft",j.default.XK_Left,j.default.XK_KP_Left),c("ArrowRight",j.default.XK_Right,j.default.XK_KP_Right),c("End",j.default.XK_End,j.default.XK_KP_End),c("Home",j.default.XK_Home,j.default.XK_KP_Home),c("PageDown",j.default.XK_Next,j.default.XK_KP_Next),c("PageUp",j.default.XK_Prior,j.default.XK_KP_Prior),R("Backspace",j.default.XK_BackSpace),c("Clear",j.default.XK_Clear,j.default.XK_KP_Begin),R("Copy",j.default.XF86XK_Copy),R("Cut",j.default.XF86XK_Cut),c("Delete",j.default.XK_Delete,j.default.XK_KP_Delete),c("Insert",j.default.XK_Insert,j.default.XK_KP_Insert),R("Paste",j.default.XF86XK_Paste),R("Redo",j.default.XK_Redo),R("Undo",j.default.XK_Undo),R("Cancel",j.default.XK_Cancel),R("ContextMenu",j.default.XK_Menu),R("Escape",j.default.XK_Escape),R("Execute",j.default.XK_Execute),R("Find",j.default.XK_Find),R("Help",j.default.XK_Help),R("Pause",j.default.XK_Pause),R("Select",j.default.XK_Select),R("ZoomIn",j.default.XF86XK_ZoomIn),R("ZoomOut",j.default.XF86XK_ZoomOut),R("BrightnessDown",j.default.XF86XK_MonBrightnessDown),R("BrightnessUp",j.default.XF86XK_MonBrightnessUp),R("Eject",j.default.XF86XK_Eject),R("LogOff",j.default.XF86XK_LogOff),R("Power",j.default.XF86XK_PowerOff),R("PowerOff",j.default.XF86XK_PowerDown),R("PrintScreen",j.default.XK_Print),R("Hibernate",j.default.XF86XK_Hibernate),R("Standby",j.default.XF86XK_Standby),R("WakeUp",j.default.XF86XK_WakeUp),R("AllCandidates",j.default.XK_MultipleCandidate),R("Alphanumeric",j.default.XK_Eisu_Shift),R("CodeInput",j.default.XK_Codeinput),R("Compose",j.default.XK_Multi_key),R("Convert",j.default.XK_Henkan),R("GroupFirst",j.default.XK_ISO_First_Group),R("GroupLast",j.default.XK_ISO_Last_Group),R("GroupNext",j.default.XK_ISO_Next_Group),R("GroupPrevious",j.default.XK_ISO_Prev_Group),R("NonConvert",j.default.XK_Muhenkan),R("PreviousCandidate",j.default.XK_PreviousCandidate),R("SingleCandidate",j.default.XK_SingleCandidate),R("HangulMode",j.default.XK_Hangul),R("HanjaMode",j.default.XK_Hangul_Hanja),R("JunjuaMode",j.default.XK_Hangul_Jeonja),R("Eisu",j.default.XK_Eisu_toggle),R("Hankaku",j.default.XK_Hankaku),R("Hiragana",j.default.XK_Hiragana),R("HiraganaKatakana",j.default.XK_Hiragana_Katakana),R("KanaMode",j.default.XK_Kana_Shift),R("KanjiMode",j.default.XK_Kanji),R("Katakana",j.default.XK_Katakana),R("Romaji",j.default.XK_Romaji),R("Zenkaku",j.default.XK_Zenkaku),R("ZenkakuHanaku",j.default.XK_Zenkaku_Hankaku),R("F1",j.default.XK_F1),R("F2",j.default.XK_F2),R("F3",j.default.XK_F3),R("F4",j.default.XK_F4),R("F5",j.default.XK_F5),R("F6",j.default.XK_F6),R("F7",j.default.XK_F7),R("F8",j.default.XK_F8),R("F9",j.default.XK_F9),R("F10",j.default.XK_F10),R("F11",j.default.XK_F11),R("F12",j.default.XK_F12),R("F13",j.default.XK_F13),R("F14",j.default.XK_F14),R("F15",j.default.XK_F15),R("F16",j.default.XK_F16),R("F17",j.default.XK_F17),R("F18",j.default.XK_F18),R("F19",j.default.XK_F19),R("F20",j.default.XK_F20),R("F21",j.default.XK_F21),R("F22",j.default.XK_F22),R("F23",j.default.XK_F23),R("F24",j.default.XK_F24),R("F25",j.default.XK_F25),R("F26",j.default.XK_F26),R("F27",j.default.XK_F27),R("F28",j.default.XK_F28),R("F29",j.default.XK_F29),R("F30",j.default.XK_F30),R("F31",j.default.XK_F31),R("F32",j.default.XK_F32),R("F33",j.default.XK_F33),R("F34",j.default.XK_F34),R("F35",j.default.XK_F35),R("Close",j.default.XF86XK_Close),R("MailForward",j.default.XF86XK_MailForward),R("MailReply",j.default.XF86XK_Reply),R("MailSend",j.default.XF86XK_Send),R("MediaFastForward",j.default.XF86XK_AudioForward),R("MediaPause",j.default.XF86XK_AudioPause),R("MediaPlay",j.default.XF86XK_AudioPlay),R("MediaRecord",j.default.XF86XK_AudioRecord),R("MediaRewind",j.default.XF86XK_AudioRewind),R("MediaStop",j.default.XF86XK_AudioStop),R("MediaTrackNext",j.default.XF86XK_AudioNext),R("MediaTrackPrevious",j.default.XF86XK_AudioPrev),R("New",j.default.XF86XK_New),R("Open",j.default.XF86XK_Open),R("Print",j.default.XK_Print),R("Save",j.default.XF86XK_Save),R("SpellCheck",j.default.XF86XK_Spell),R("AudioVolumeDown",j.default.XF86XK_AudioLowerVolume),R("AudioVolumeUp",j.default.XF86XK_AudioRaiseVolume),R("AudioVolumeMute",j.default.XF86XK_AudioMute),R("MicrophoneVolumeMute",j.default.XF86XK_AudioMicMute),R("LaunchApplication1",j.default.XF86XK_MyComputer),R("LaunchApplication2",j.default.XF86XK_Calculator),R("LaunchCalendar",j.default.XF86XK_Calendar),R("LaunchMail",j.default.XF86XK_Mail),R("LaunchMediaPlayer",j.default.XF86XK_AudioMedia),R("LaunchMusicPlayer",j.default.XF86XK_Music),R("LaunchPhone",j.default.XF86XK_Phone),R("LaunchScreenSaver",j.default.XF86XK_ScreenSaver),R("LaunchSpreadsheet",j.default.XF86XK_Excel),R("LaunchWebBrowser",j.default.XF86XK_WWW),R("LaunchWebCam",j.default.XF86XK_WebCam),R("LaunchWordProcessor",j.default.XF86XK_Word),R("BrowserBack",j.default.XF86XK_Back),R("BrowserFavorites",j.default.XF86XK_Favorites),R("BrowserForward",j.default.XF86XK_Forward),R("BrowserHome",j.default.XF86XK_HomePage),R("BrowserRefresh",j.default.XF86XK_Refresh),R("BrowserSearch",j.default.XF86XK_Search),R("BrowserStop",j.default.XF86XK_Stop),R("Dimmer",j.default.XF86XK_BrightnessAdjust),R("MediaAudioTrack",j.default.XF86XK_AudioCycleTrack),R("RandomToggle",j.default.XF86XK_AudioRandomPlay),R("SplitScreenToggle",j.default.XF86XK_SplitScreen),R("Subtitle",j.default.XF86XK_Subtitle),R("VideoModeNext",j.default.XF86XK_Next_VMode),c("=",j.default.XK_equal,j.default.XK_KP_Equal),c("+",j.default.XK_plus,j.default.XK_KP_Add),c("-",j.default.XK_minus,j.default.XK_KP_Subtract),c("*",j.default.XK_asterisk,j.default.XK_KP_Multiply),c("/",j.default.XK_slash,j.default.XK_KP_Divide),c(".",j.default.XK_period,j.default.XK_KP_Decimal),c(",",j.default.XK_comma,j.default.XK_KP_Separator),c("0",j.default.XK_0,j.default.XK_KP_0),c("1",j.default.XK_1,j.default.XK_KP_1),c("2",j.default.XK_2,j.default.XK_KP_2),c("3",j.default.XK_3,j.default.XK_KP_3),c("4",j.default.XK_4,j.default.XK_KP_4),c("5",j.default.XK_5,j.default.XK_KP_5),c("6",j.default.XK_6,j.default.XK_KP_6),c("7",j.default.XK_7,j.default.XK_KP_7),c("8",j.default.XK_8,j.default.XK_KP_8),c("9",j.default.XK_9,j.default.XK_KP_9);var E=D;ue.default=E},mdZa:function($e,ue,ie){"use strict";typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(k,D){"use strict";if(k==null)throw new TypeError("Cannot convert undefined or null to object");for(var R=Object(k),O=1;O<arguments.length;O++){var c=arguments[O];if(c!=null)for(var E in c)Object.prototype.hasOwnProperty.call(c,E)&&(R[E]=c[E])}return R},writable:!0,configurable:!0}),function(){function j(k,D){D=D||{bubbles:!1,cancelable:!1,detail:void 0};var R=document.createEvent("CustomEvent");return R.initCustomEvent(k,D.bubbles,D.cancelable,D.detail),R}j.prototype=window.Event.prototype,typeof window.CustomEvent!="function"&&(window.CustomEvent=j)}(),Number.isInteger=Number.isInteger||function(k){return typeof k=="number"&&isFinite(k)&&Math.floor(k)===k}},osHv:function($e,ue,ie){(function(j){j(ie("VrN/"))})(function(j){"use strict";var k=j.Pos;function D(a,i){return a.line-i.line||a.ch-i.ch}var R="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",O=R+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",c=new RegExp("<(/?)(["+R+"]["+O+"]*)","g");function E(a,i,f,h){this.line=i,this.ch=f,this.cm=a,this.text=a.getLine(i),this.min=h?Math.max(h.from,a.firstLine()):a.firstLine(),this.max=h?Math.min(h.to-1,a.lastLine()):a.lastLine()}function y(a,i){var f=a.cm.getTokenTypeAt(k(a.line,i));return f&&/\btag\b/.test(f)}function p(a){return a.line>=a.max?void 0:(a.ch=0,a.text=a.cm.getLine(++a.line),!0)}function u(a){return a.line<=a.min?void 0:(a.text=a.cm.getLine(--a.line),a.ch=a.text.length,!0)}function o(a){for(;;){var i=a.text.indexOf(">",a.ch);if(i==-1){if(p(a))continue;return}if(!y(a,i+1)){a.ch=i+1;continue}var f=a.text.lastIndexOf("/",i),h=f>-1&&!/\S/.test(a.text.slice(f+1,i));return a.ch=i+1,h?"selfClose":"regular"}}function d(a){for(;;){var i=a.ch?a.text.lastIndexOf("<",a.ch-1):-1;if(i==-1){if(u(a))continue;return}if(!y(a,i+1)){a.ch=i;continue}c.lastIndex=i,a.ch=i;var f=c.exec(a.text);if(f&&f.index==i)return f}}function s(a){for(;;){c.lastIndex=a.ch;var i=c.exec(a.text);if(!i){if(p(a))continue;return}if(!y(a,i.index+1)){a.ch=i.index+1;continue}return a.ch=i.index+i[0].length,i}}function l(a){for(;;){var i=a.ch?a.text.lastIndexOf(">",a.ch-1):-1;if(i==-1){if(u(a))continue;return}if(!y(a,i+1)){a.ch=i;continue}var f=a.text.lastIndexOf("/",i),h=f>-1&&!/\S/.test(a.text.slice(f+1,i));return a.ch=i+1,h?"selfClose":"regular"}}function r(a,i){for(var f=[];;){var h=s(a),w,m=a.line,T=a.ch-(h?h[0].length:0);if(!h||!(w=o(a)))return;if(w=="selfClose")continue;if(h[1]){for(var A=f.length-1;A>=0;--A)if(f[A]==h[2]){f.length=A;break}if(A<0&&(!i||i==h[2]))return{tag:h[2],from:k(m,T),to:k(a.line,a.ch)}}else f.push(h[2])}}function n(a,i){for(var f=[];;){var h=l(a);if(!h)return;if(h=="selfClose"){d(a);continue}var w=a.line,m=a.ch,T=d(a);if(!T)return;if(T[1])f.push(T[2]);else{for(var A=f.length-1;A>=0;--A)if(f[A]==T[2]){f.length=A;break}if(A<0&&(!i||i==T[2]))return{tag:T[2],from:k(a.line,a.ch),to:k(w,m)}}}}j.registerHelper("fold","xml",function(a,i){for(var f=new E(a,i.line,0);;){var h=s(f);if(!h||f.line!=i.line)return;var w=o(f);if(!w)return;if(!h[1]&&w!="selfClose"){var m=k(f.line,f.ch),T=r(f,h[2]);return T&&D(T.from,m)>0?{from:m,to:T.from}:null}}}),j.findMatchingTag=function(a,i,f){var h=new E(a,i.line,i.ch,f);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var w=o(h),m=w&&k(h.line,h.ch),T=w&&d(h);if(!w||!T||D(h,i)>0)return;var A={from:k(h.line,h.ch),to:m,tag:T[2]};return w=="selfClose"?{open:A,close:null,at:"open"}:T[1]?{open:n(h,T[2]),close:A,at:"close"}:(h=new E(a,m.line,m.ch,f),{open:A,close:r(h,T[2]),at:"open"})},j.findEnclosingTag=function(a,i,f,h){for(var w=new E(a,i.line,i.ch,f);;){var m=n(w,h);if(!m)break;var T=new E(a,i.line,i.ch,f),A=r(T,m.tag);if(A)return{open:m,close:A}}},j.scanForClosingTag=function(a,i,f,h){var w=new E(a,i.line,i.ch,h?{from:0,to:h}:null);return r(w,f)}})},p5ED:function($e,ue,ie){"use strict";var j=ie("+L6B"),k=ie("2/Rp"),D=ie("5Dmo"),R=ie("3S7+"),O=ie("k1fw"),c=ie("tJVT"),E=ie("q1tI"),y=ie.n(E),p=ie("vHTk"),u=ie.n(p),o=ie("yEEn"),d=ie("ZW9T"),s=ie("1vsH");ue.a=function(l){var r=l.name,n=l.data,a=l.theme,i=l.type,f=l.filename,h=l.monacoEditor,w=l.className,m=l.style,T=l.close,A=l.onClose,x=l.hasMask,b=Object(E.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),S=Object(c.a)(b,2),C=S[0],g=S[1],M=Object(E.useState)(""),I=Object(c.a)(M,2),P=I[0],B=I[1],H=Object(E.useRef)();f&&(h.filename=f),Object(E.useEffect)(function(){var U,K,G=(U=document.cookie)===null||U===void 0||((K=U.replace(/\s/g,""))===null||K===void 0)?void 0:K.split(";");G==null||G.map(function(ee){var de=ee.split("=");de[0]==="_educoder_session"&&B(de[1])})},[]);var F=function(){if(n.startsWith("http")||n.startsWith("/")){W();return}Object(s.y)(f||"educoder",n,f)},W=function(){Object(s.w)(f||r,n)};return console.log("data:",n,"fileanme:",f," name:",r),y.a.createElement("div",{style:Object(O.a)({},m||{}),className:"".concat(x&&u.a.bgBlack," ").concat(i?u.a.wrp:"hide")},T&&y.a.createElement("div",{className:u.a.close,ref:H},y.a.createElement(R.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return H.current}},y.a.createElement("span",{onClick:W},y.a.createElement("i",{className:"icon-quxiaozhiding"}))),y.a.createElement(R.a,{title:"\u5173\u95ED",getPopupContainer:function(){return H.current}},y.a.createElement("span",{className:"",onClick:A},y.a.createElement("i",{className:"icon-guanbi1"})))),y.a.createElement("div",{className:"".concat(u.a[w]," ").concat(w," ").concat(u.a.monaco," ").concat(i==="txt"?"show":"hide")},i==="txt"&&y.a.createElement(d.b,h)),i==="audio"&&y.a.createElement("audio",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?n:"data:audio/mp3;base64,").concat(n),autoPlay:!0}),i==="video"&&y.a.createElement(y.a.Fragment,null,n!=null&&n.startsWith("/")?y.a.createElement("video",{controls:!0,src:"".concat(n),autoPlay:!0}):y.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(n),autoPlay:!0})),i==="pdf"&&y.a.createElement("embed",{className:u.a.embed,src:n}),i==="image"&&y.a.createElement(y.a.Fragment,null,y.a.createElement("img",{src:"".concat(n!=null&&n.startsWith("/")||(n==null?void 0:n.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(n)})),i==="other"&&y.a.createElement("div",null,y.a.createElement(k.a,{type:"primary",size:"large",onClick:F},y.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(i==="download"||i==="office")&&y.a.createElement(k.a,{type:"primary",size:"large",onClick:F},y.a.createElement(o.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function($e,ue,ie){},q7KB:function($e,ue,ie){},"rAM+":function($e,ue,ie){"use strict";ie.d(ue,"a",function(){return k});var j=ie("Qw5x");function k(D,R){var O;if(typeof Symbol=="undefined"||D[Symbol.iterator]==null){if(Array.isArray(D)||(O=Object(j.a)(D))||R&&D&&typeof D.length=="number"){O&&(D=O);var c=0,E=function(){};return{s:E,n:function(){return c>=D.length?{done:!0}:{done:!1,value:D[c++]}},e:function(d){throw d},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 y=!0,p=!1,u;return{s:function(){O=D[Symbol.iterator]()},n:function(){var d=O.next();return y=d.done,d},e:function(d){p=!0,u=d},f:function(){try{!y&&O.return!=null&&O.return()}finally{if(p)throw u}}}}},rUJ1:function($e,ue){const ie=/[&<>"']/,j=/[&<>"']/g,k=/[<>"']|&(?!#?\w+;)/,D=/[<>"']|&(?!#?\w+;)/g,R={"&":"&","<":"<",">":">",'"':""","'":"'"},O=x=>R[x];function c(x,b){if(b){if(ie.test(x))return x.replace(j,O)}else if(k.test(x))return x.replace(D,O);return x}const E=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function y(x){return x.replace(E,(b,S)=>(S=S.toLowerCase(),S==="colon"?":":S.charAt(0)==="#"?S.charAt(1)==="x"?String.fromCharCode(parseInt(S.substring(2),16)):String.fromCharCode(+S.substring(1)):""))}const p=/(^|[^\[])\^/g;function u(x,b){x=x.source||x,b=b||"";const S={replace:(C,g)=>(g=g.source||g,g=g.replace(p,"$1"),x=x.replace(C,g),S),getRegex:()=>new RegExp(x,b)};return S}const o=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function s(x,b,S){if(x){let C;try{C=decodeURIComponent(y(S)).replace(o,"").toLowerCase()}catch(g){return null}if(C.indexOf("javascript:")===0||C.indexOf("vbscript:")===0||C.indexOf("data:")===0)return null}b&&!d.test(S)&&(S=i(b,S));try{S=encodeURI(S).replace(/%25/g,"%")}catch(C){return null}return S}const l={},r=/^[^:]+:\/*[^/]*$/,n=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(x,b){l[" "+x]||(r.test(x)?l[" "+x]=x+"/":l[" "+x]=m(x,"/",!0)),x=l[" "+x];const S=x.indexOf(":")===-1;return b.substring(0,2)==="//"?S?b:x.replace(n,"$1")+b:b.charAt(0)==="/"?S?b:x.replace(a,"$1")+b:x+b}const f={exec:function(){}};function h(x){let b=1,S,C;for(;b<arguments.length;b++){S=arguments[b];for(C in S)Object.prototype.hasOwnProperty.call(S,C)&&(x[C]=S[C])}return x}function w(x,b){const S=x.replace(/\|/g,(M,I,P)=>{let B=!1,H=I;for(;--H>=0&&P[H]==="\\";)B=!B;return B?"|":" |"}),C=S.split(/ \|/);let g=0;if(C.length>b)C.splice(b);else for(;C.length<b;)C.push("");for(;g<C.length;g++)C[g]=C[g].trim().replace(/\\\|/g,"|");return C}function m(x,b,S){const C=x.length;if(C===0)return"";let g=0;for(;g<C;){const M=x.charAt(C-g-1);if(M===b&&!S)g++;else if(M!==b&&S)g++;else break}return x.substr(0,C-g)}function T(x,b){if(x.indexOf(b[1])===-1)return-1;const S=x.length;let C=0,g=0;for(;g<S;g++)if(x[g]==="\\")g++;else if(x[g]===b[0])C++;else if(x[g]===b[1]&&(C--,C<0))return g;return-1}function A(x){x&&x.sanitize&&!x.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")}$e.exports={escape:c,unescape:y,edit:u,cleanUrl:s,resolveUrl:i,noopTest:f,merge:h,splitCells:w,rtrim:m,findClosingBracket:T,checkSanitizeDeprecation:A}},rwxt:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=ie("GdRQ");function k(E,y){if(!(E instanceof y))throw new TypeError("Cannot call a class as a function")}function D(E,y){for(var p=0;p<y.length;p++){var u=y[p];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(E,u.key,u)}}function R(E,y,p){return y&&D(E.prototype,y),p&&D(E,p),E}var O=!j.supportsCursorURIs||j.isTouchDevice,c=function(){function E(){k(this,E),this._target=null,this._canvas=document.createElement("canvas"),O&&(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 R(E,[{key:"attach",value:function(p){if(this._target&&this.detach(),this._target=p,O){document.body.appendChild(this._canvas);var u={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,u),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,u),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,u),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,u)}this.clear()}},{key:"detach",value:function(){if(!this._target)return;if(O){var p={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,p),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,p),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,p),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,p),document.body.removeChild(this._canvas)}this._target=null}},{key:"change",value:function(p,u,o,d,s){if(d===0||s===0){this.clear();return}this._position.x=this._position.x+this._hotSpot.x-u,this._position.y=this._position.y+this._hotSpot.y-o,this._hotSpot.x=u,this._hotSpot.y=o;var l=this._canvas.getContext("2d");this._canvas.width=d,this._canvas.height=s;var r;try{r=new ImageData(new Uint8ClampedArray(p),d,s)}catch(a){r=l.createImageData(d,s),r.data.set(new Uint8ClampedArray(p))}if(l.clearRect(0,0,d,s),l.putImageData(r,0,0),O)this._updatePosition();else{var n=this._canvas.toDataURL();this._target.style.cursor="url("+n+")"+u+" "+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(p,u){if(!O)return;window.visualViewport?(this._position.x=p+window.visualViewport.offsetLeft,this._position.y=u+window.visualViewport.offsetTop):(this._position.x=p,this._position.y=u),this._updatePosition();var o=document.elementFromPoint(p,u);this._updateVisibility(o)}},{key:"_handleMouseOver",value:function(p){this._handleMouseMove(p)}},{key:"_handleMouseLeave",value:function(p){this._updateVisibility(p.relatedTarget)}},{key:"_handleMouseMove",value:function(p){this._updateVisibility(p.target),this._position.x=p.clientX-this._hotSpot.x,this._position.y=p.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(p){var u=this,o=document.elementFromPoint(p.clientX,p.clientY);this._updateVisibility(o),this._captureIsActive()&&window.setTimeout(function(){if(!u._target)return;o=document.elementFromPoint(p.clientX,p.clientY),u._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(p){return p?p===this._target?!0:this._target.contains(p)?!(window.getComputedStyle(p).cursor!=="none"):!1:!1}},{key:"_updateVisibility",value:function(p){this._captureIsActive()&&(p=document.captureElement),this._shouldShowCursor(p)?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}();ue.default=c},sjKO:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=D;var j=30,k=12;function D(R,O){var c,E,y,p,u,o,d,s,l,r,n,a,i,f,h,w,m,T,A,x,b,S,C,g,M;c=R.state,E=R.next_in,g=R.input,y=E+(R.avail_in-5),p=R.next_out,M=R.output,u=p-(O-R.avail_out),o=p+(R.avail_out-257),d=c.dmax,s=c.wsize,l=c.whave,r=c.wnext,n=c.window,a=c.hold,i=c.bits,f=c.lencode,h=c.distcode,w=(1<<c.lenbits)-1,m=(1<<c.distbits)-1;e:do{i<15&&(a+=g[E++]<<i,i+=8,a+=g[E++]<<i,i+=8),T=f[a&w];t:for(;;){if(A=T>>>24,a>>>=A,i-=A,A=T>>>16&255,A===0)M[p++]=T&65535;else if(A&16){x=T&65535,A&=15,A&&(i<A&&(a+=g[E++]<<i,i+=8),x+=a&(1<<A)-1,a>>>=A,i-=A),i<15&&(a+=g[E++]<<i,i+=8,a+=g[E++]<<i,i+=8),T=h[a&m];r:for(;;){if(A=T>>>24,a>>>=A,i-=A,A=T>>>16&255,A&16){if(b=T&65535,A&=15,i<A&&(a+=g[E++]<<i,i+=8,i<A&&(a+=g[E++]<<i,i+=8)),b+=a&(1<<A)-1,b>d){R.msg="invalid distance too far back",c.mode=j;break e}if(a>>>=A,i-=A,A=p-u,b>A){if(A=b-A,A>l&&c.sane){R.msg="invalid distance too far back",c.mode=j;break e}if(S=0,C=n,r===0){if(S+=s-A,A<x){x-=A;do M[p++]=n[S++];while(--A);S=p-b,C=M}}else if(r<A){if(S+=s+r-A,A-=r,A<x){x-=A;do M[p++]=n[S++];while(--A);if(S=0,r<x){A=r,x-=A;do M[p++]=n[S++];while(--A);S=p-b,C=M}}}else if(S+=r-A,A<x){x-=A;do M[p++]=n[S++];while(--A);S=p-b,C=M}for(;x>2;)M[p++]=C[S++],M[p++]=C[S++],M[p++]=C[S++],x-=3;x&&(M[p++]=C[S++],x>1&&(M[p++]=C[S++]))}else{S=p-b;do M[p++]=M[S++],M[p++]=M[S++],M[p++]=M[S++],x-=3;while(x>2);x&&(M[p++]=M[S++],x>1&&(M[p++]=M[S++]))}}else if((A&64)===0){T=h[(T&65535)+(a&(1<<A)-1)];continue r}else{R.msg="invalid distance code",c.mode=j;break e}break}}else if((A&64)===0){T=f[(T&65535)+(a&(1<<A)-1)];continue t}else if(A&32){c.mode=k;break e}else{R.msg="invalid literal/length code",c.mode=j;break e}break}}while(E<y&&p<o);x=i>>3,E-=x,i-=x<<3,a&=(1<<i)-1,R.next_in=E,R.next_out=p,R.avail_in=E<y?5+(y-E):5-(E-y),R.avail_out=p<o?257+(o-p):257-(p-o),c.hold=a,c.bits=i;return}},ulZh:function($e,ue,ie){typeof window!="undefined"&&function(k,D){$e.exports=D()}(this,function(){return function(j){var k={};function D(R){if(k[R])return k[R].exports;var O=k[R]={i:R,l:!1,exports:{}};return j[R].call(O.exports,O,O.exports,D),O.l=!0,O.exports}return D.m=j,D.c=k,D.d=function(R,O,c){D.o(R,O)||Object.defineProperty(R,O,{enumerable:!0,get:c})},D.r=function(R){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(R,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(R,"__esModule",{value:!0})},D.t=function(R,O){if(O&1&&(R=D(R)),O&8)return R;if(O&4&&typeof R=="object"&&R&&R.__esModule)return R;var c=Object.create(null);if(D.r(c),Object.defineProperty(c,"default",{enumerable:!0,value:R}),O&2&&typeof R!="string")for(var E in R)D.d(c,E,function(y){return R[y]}.bind(null,E));return c},D.n=function(R){var O=R&&R.__esModule?function(){return R.default}:function(){return R};return D.d(O,"a",O),O},D.o=function(R,O){return Object.prototype.hasOwnProperty.call(R,O)},D.p="/dist/",D(D.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(j,k,D){"use strict";var R=Object.prototype.hasOwnProperty,O="~";function c(){}Object.create&&(c.prototype=Object.create(null),new c().__proto__||(O=!1));function E(o,d,s){this.fn=o,this.context=d,this.once=s||!1}function y(o,d,s,l,r){if(typeof s!="function")throw new TypeError("The listener must be a function");var n=new E(s,l||o,r),a=O?O+d:d;return o._events[a]?o._events[a].fn?o._events[a]=[o._events[a],n]:o._events[a].push(n):(o._events[a]=n,o._eventsCount++),o}function p(o,d){--o._eventsCount===0?o._events=new c:delete o._events[d]}function u(){this._events=new c,this._eventsCount=0}u.prototype.eventNames=function(){var d=[],s,l;if(this._eventsCount===0)return d;for(l in s=this._events)R.call(s,l)&&d.push(O?l.slice(1):l);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(s)):d},u.prototype.listeners=function(d){var s=O?O+d:d,l=this._events[s];if(!l)return[];if(l.fn)return[l.fn];for(var r=0,n=l.length,a=new Array(n);r<n;r++)a[r]=l[r].fn;return a},u.prototype.listenerCount=function(d){var s=O?O+d:d,l=this._events[s];return l?l.fn?1:l.length:0},u.prototype.emit=function(d,s,l,r,n,a){var i=O?O+d:d;if(!this._events[i])return!1;var f=this._events[i],h=arguments.length,w,m;if(f.fn){f.once&&this.removeListener(d,f.fn,void 0,!0);switch(h){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,s),!0;case 3:return f.fn.call(f.context,s,l),!0;case 4:return f.fn.call(f.context,s,l,r),!0;case 5:return f.fn.call(f.context,s,l,r,n),!0;case 6:return f.fn.call(f.context,s,l,r,n,a),!0}for(m=1,w=new Array(h-1);m<h;m++)w[m-1]=arguments[m];f.fn.apply(f.context,w)}else{var T=f.length,A;for(m=0;m<T;m++){f[m].once&&this.removeListener(d,f[m].fn,void 0,!0);switch(h){case 1:f[m].fn.call(f[m].context);break;case 2:f[m].fn.call(f[m].context,s);break;case 3:f[m].fn.call(f[m].context,s,l);break;case 4:f[m].fn.call(f[m].context,s,l,r);break;default:if(!w)for(A=1,w=new Array(h-1);A<h;A++)w[A-1]=arguments[A];f[m].fn.apply(f[m].context,w)}}}return!0},u.prototype.on=function(d,s,l){return y(this,d,s,l,!1)},u.prototype.once=function(d,s,l){return y(this,d,s,l,!0)},u.prototype.removeListener=function(d,s,l,r){var n=O?O+d:d;if(!this._events[n])return this;if(!s)return p(this,n),this;var a=this._events[n];if(a.fn)a.fn===s&&(!r||a.once)&&(!l||a.context===l)&&p(this,n);else{for(var i=0,f=[],h=a.length;i<h;i++)(a[i].fn!==s||r&&!a[i].once||l&&a[i].context!==l)&&f.push(a[i]);f.length?this._events[n]=f.length===1?f[0]:f:p(this,n)}return this},u.prototype.removeAllListeners=function(d){var s;return d?(s=O?O+d:d,this._events[s]&&p(this,s)):(this._events=new c,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=O,u.EventEmitter=u,j.exports=u},"./node_modules/url-toolkit/src/url-toolkit.js":function(j,k,D){(function(R){var O=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,c=/^([^\/?#]*)([^]*)$/,E=/(?:\/|^)\.(?=\/)/g,y=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,p={buildAbsoluteURL:function(u,o,d){if(d=d||{},u=u.trim(),o=o.trim(),!o){if(!d.alwaysNormalize)return u;var s=p.parseURL(u);if(!s)throw new Error("Error trying to parse base URL.");return s.path=p.normalizePath(s.path),p.buildURLFromParts(s)}var l=p.parseURL(o);if(!l)throw new Error("Error trying to parse relative URL.");if(l.scheme)return d.alwaysNormalize?(l.path=p.normalizePath(l.path),p.buildURLFromParts(l)):o;var r=p.parseURL(u);if(!r)throw new Error("Error trying to parse base URL.");if(!r.netLoc&&r.path&&r.path[0]!=="/"){var n=c.exec(r.path);r.netLoc=n[1],r.path=n[2]}r.netLoc&&!r.path&&(r.path="/");var a={scheme:r.scheme,netLoc:l.netLoc,path:null,params:l.params,query:l.query,fragment:l.fragment};if(!l.netLoc&&(a.netLoc=r.netLoc,l.path[0]!=="/"))if(!l.path)a.path=r.path,l.params||(a.params=r.params,l.query||(a.query=r.query));else{var i=r.path,f=i.substring(0,i.lastIndexOf("/")+1)+l.path;a.path=p.normalizePath(f)}return a.path===null&&(a.path=d.alwaysNormalize?p.normalizePath(l.path):l.path),p.buildURLFromParts(a)},parseURL:function(u){var o=O.exec(u);return o?{scheme:o[1]||"",netLoc:o[2]||"",path:o[3]||"",params:o[4]||"",query:o[5]||"",fragment:o[6]||""}:null},normalizePath:function(u){for(u=u.split("").reverse().join("").replace(E,"");u.length!==(u=u.replace(y,"")).length;);return u.split("").reverse().join("")},buildURLFromParts:function(u){return u.scheme+u.netLoc+u.path+u.params+u.query+u.fragment}};j.exports=p})(this)},"./node_modules/webworkify-webpack/index.js":function(j,k,D){function R(d){var s={};function l(n){if(s[n])return s[n].exports;var a=s[n]={i:n,l:!1,exports:{}};return d[n].call(a.exports,a,a.exports,l),a.l=!0,a.exports}l.m=d,l.c=s,l.i=function(n){return n},l.d=function(n,a,i){l.o(n,a)||Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:i})},l.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},l.n=function(n){var a=n&&n.__esModule?function(){return n.default}:function(){return n};return l.d(a,"a",a),a},l.o=function(n,a){return Object.prototype.hasOwnProperty.call(n,a)},l.p="/",l.oe=function(n){throw console.error(n),n};var r=l(l.s=ENTRY_MODULE);return r.default||r}var O="[\\.|\\-|\\+|\\w|/|@]+",c="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+O+").*?\\)";function E(d){return(d+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function y(d){return!isNaN(1*d)}function p(d,s,l){var r={};r[l]=[];var n=s.toString(),a=n.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return r;for(var i=a[1],f=new RegExp("(\\\\n|\\W)"+E(i)+c,"g"),h;h=f.exec(n);){if(h[3]==="dll-reference")continue;r[l].push(h[3])}for(f=new RegExp("\\("+E(i)+'\\("(dll-reference\\s('+O+'))"\\)\\)'+c,"g");h=f.exec(n);)d[h[2]]||(r[l].push(h[1]),d[h[2]]=D(h[1]).m),r[h[2]]=r[h[2]]||[],r[h[2]].push(h[4]);for(var w=Object.keys(r),m=0;m<w.length;m++)for(var T=0;T<r[w[m]].length;T++)y(r[w[m]][T])&&(r[w[m]][T]=1*r[w[m]][T]);return r}function u(d){var s=Object.keys(d);return s.reduce(function(l,r){return l||d[r].length>0},!1)}function o(d,s){for(var l={main:[s]},r={main:[]},n={main:{}};u(l);)for(var a=Object.keys(l),i=0;i<a.length;i++){var f=a[i],h=l[f],w=h.pop();if(n[f]=n[f]||{},n[f][w]||!d[f][w])continue;n[f][w]=!0,r[f]=r[f]||[],r[f].push(w);for(var m=p(d,d[f][w],f),T=Object.keys(m),A=0;A<T.length;A++)l[T[A]]=l[T[A]]||[],l[T[A]]=l[T[A]].concat(m[T[A]])}return r}j.exports=function(d,s){s=s||{};var l={main:D.m},r=s.all?{main:Object.keys(l.main)}:o(l,d),n="";Object.keys(r).filter(function(w){return w!=="main"}).forEach(function(w){for(var m=0;r[w][m];)m++;r[w].push(m),l[w][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",n=n+"var "+w+" = ("+R.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+r[w].map(function(T){return""+JSON.stringify(T)+": "+l[w][T].toString()}).join(",")+`});
|
|
|
`}),n=n+"new (("+R.toString().replace("ENTRY_MODULE",JSON.stringify(d))+")({"+r.main.map(function(w){return""+JSON.stringify(w)+": "+l.main[w].toString()}).join(",")+"}))(self);";var a=new window.Blob([n],{type:"text/javascript"});if(s.bare)return a;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,f=i.createObjectURL(a),h=new window.Worker(f);return h.objectURL=f,h}},"./src/config.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"hlsDefaultConfig",function(){return A}),D.d(k,"mergeConfig",function(){return b}),D.d(k,"enableStreamingMode",function(){return S});var R=D("./src/controller/abr-controller.ts"),O=D("./src/controller/audio-stream-controller.ts"),c=D("./src/controller/audio-track-controller.ts"),E=D("./src/controller/subtitle-stream-controller.ts"),y=D("./src/controller/subtitle-track-controller.ts"),p=D("./src/controller/buffer-controller.ts"),u=D("./src/controller/timeline-controller.ts"),o=D("./src/controller/cap-level-controller.ts"),d=D("./src/controller/fps-controller.ts"),s=D("./src/controller/eme-controller.ts"),l=D("./src/controller/cmcd-controller.ts"),r=D("./src/utils/xhr-loader.ts"),n=D("./src/utils/fetch-loader.ts"),a=D("./src/utils/cues.ts"),i=D("./src/utils/mediakeys-helper.ts"),f=D("./src/utils/logger.ts");function h(){return h=Object.assign||function(C){for(var g=1;g<arguments.length;g++){var M=arguments[g];for(var I in M)Object.prototype.hasOwnProperty.call(M,I)&&(C[I]=M[I])}return C},h.apply(this,arguments)}function w(C,g){var M=Object.keys(C);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(C);g&&(I=I.filter(function(P){return Object.getOwnPropertyDescriptor(C,P).enumerable})),M.push.apply(M,I)}return M}function m(C){for(var g=1;g<arguments.length;g++){var M=arguments[g]!=null?arguments[g]:{};g%2?w(Object(M),!0).forEach(function(I){T(C,I,M[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(M)):w(Object(M)).forEach(function(I){Object.defineProperty(C,I,Object.getOwnPropertyDescriptor(M,I))})}return C}function T(C,g,M){return g in C?Object.defineProperty(C,g,{value:M,enumerable:!0,configurable:!0,writable:!0}):C[g]=M,C}var A=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:r.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:R.default,bufferController:p.default,capLevelController:o.default,fpsController:d.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},x()),{},{subtitleStreamController:E.SubtitleStreamController,subtitleTrackController:y.default,timelineController:u.TimelineController,audioStreamController:O.default,audioTrackController:c.default,emeController:s.default,cmcdController:l.default});function x(){return{cueHandler:a.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function b(C,g){if((g.liveSyncDurationCount||g.liveMaxLatencyDurationCount)&&(g.liveSyncDuration||g.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(g.liveMaxLatencyDurationCount!==void 0&&(g.liveSyncDurationCount===void 0||g.liveMaxLatencyDurationCount<=g.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(g.liveMaxLatencyDuration!==void 0&&(g.liveSyncDuration===void 0||g.liveMaxLatencyDuration<=g.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},C,g)}function S(C){var g=C.loader;if(g!==n.default&&g!==r.default)f.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),C.progressive=!1;else{var M=Object(n.fetchSupported)();M&&(C.loader=n.default,C.progressive=!0,C.enableSoftwareAES=!0,f.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/utils/ewma-bandwidth-estimator.ts"),c=D("./src/events.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/errors.ts"),p=D("./src/types/loader.ts"),u=D("./src/utils/logger.ts");function o(l,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,a.key,a)}}function d(l,r,n){return r&&o(l.prototype,r),n&&o(l,n),l}var s=function(){function l(n){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=n;var a=n.config;this.bwEstimator=new O.default(a.abrEwmaSlowVoD,a.abrEwmaFastVoD,a.abrEwmaDefaultEstimate),this.registerListeners()}var r=l.prototype;return r.registerListeners=function(){var a=this.hls;a.on(c.Events.FRAG_LOADING,this.onFragLoading,this),a.on(c.Events.FRAG_LOADED,this.onFragLoaded,this),a.on(c.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.on(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.on(c.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var a=this.hls;a.off(c.Events.FRAG_LOADING,this.onFragLoading,this),a.off(c.Events.FRAG_LOADED,this.onFragLoaded,this),a.off(c.Events.FRAG_BUFFERED,this.onFragBuffered,this),a.off(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),a.off(c.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},r.onFragLoading=function(a,i){var f=i.frag;if(f.type===p.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=f,this.partCurrent=(h=i.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},r.onLevelLoaded=function(a,i){var f=this.hls.config;i.details.live?this.bwEstimator.update(f.abrEwmaSlowLive,f.abrEwmaFastLive):this.bwEstimator.update(f.abrEwmaSlowVoD,f.abrEwmaFastVoD)},r._abandonRulesCheck=function(){var a=this.fragCurrent,i=this.partCurrent,f=this.hls,h=f.autoLevelEnabled,w=f.config,m=f.media;if(!a||!m)return;var T=i?i.stats:a.stats,A=i?i.duration:a.duration;if(T.aborted){u.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||m.paused||!m.playbackRate||!m.readyState)return;var x=performance.now()-T.loading.start,b=Math.abs(m.playbackRate);if(x<=500*A/b)return;var S=f.levels,C=f.minAutoLevel,g=S[a.level],M=T.total||Math.max(T.loaded,Math.round(A*g.maxBitrate/8)),I=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/x),P=(M-T.loaded)/I,B=m.currentTime,H=(E.BufferHelper.bufferInfo(m,B,w.maxBufferHole).end-B)/b;if(H>=2*A/b||P<=H)return;var F=Number.POSITIVE_INFINITY,W;for(W=a.level-1;W>C;W--){var U=S[W].maxBitrate;if(F=A*U/(8*.8*I),F<H)break}if(F>=P)return;var K=this.bwEstimator.getEstimate();u.logger.warn("Fragment "+a.sn+(i?" part "+i.index:"")+" of level "+a.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
|
|
|
Current BW estimate: `+(Object(R.isFiniteNumber)(K)?(K/1024).toFixed(3):"Unknown")+` Kb/s
|
|
|
Estimated load time for current fragment: `+P.toFixed(3)+` s
|
|
|
Estimated load time for the next fragment: `+F.toFixed(3)+` s
|
|
|
Time to underbuffer: `+H.toFixed(3)+" s"),f.nextLoadLevel=W,this.bwEstimator.sample(x,T.loaded),this.clearTimer(),a.loader&&(this.fragCurrent=this.partCurrent=null,a.loader.abort()),f.trigger(c.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:a,part:i,stats:T})},r.onFragLoaded=function(a,i){var f=i.frag,h=i.part;if(f.type===p.PlaylistLevelType.MAIN&&Object(R.isFiniteNumber)(f.sn)){var w=h?h.stats:f.stats,m=h?h.duration:f.duration;if(this.clearTimer(),this.lastLoadedFragLevel=f.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[f.level],A=(T.loaded?T.loaded.bytes:0)+w.loaded,x=(T.loaded?T.loaded.duration:0)+m;T.loaded={bytes:A,duration:x},T.realBitrate=Math.round(8*A/x)}if(f.bitrateTest){var b={stats:w,frag:f,part:h,id:f.type};this.onFragBuffered(c.Events.FRAG_BUFFERED,b),f.bitrateTest=!1}}},r.onFragBuffered=function(a,i){var f=i.frag,h=i.part,w=h?h.stats:f.stats;if(w.aborted)return;if(f.type!==p.PlaylistLevelType.MAIN||f.sn==="initSegment")return;var m=w.parsing.end-w.loading.start;this.bwEstimator.sample(m,w.loaded),w.bwEstimate=this.bwEstimator.getEstimate(),f.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},r.onError=function(a,i){switch(i.details){case y.ErrorDetails.FRAG_LOAD_ERROR:case y.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},r.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},r.getNextABRAutoLevel=function(){var a=this.fragCurrent,i=this.partCurrent,f=this.hls,h=f.maxAutoLevel,w=f.config,m=f.minAutoLevel,T=f.media,A=i?i.duration:a?a.duration:0,x=T?T.currentTime:0,b=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,S=this.bwEstimator?this.bwEstimator.getEstimate():w.abrEwmaDefaultEstimate,C=(E.BufferHelper.bufferInfo(T,x,w.maxBufferHole).end-x)/b,g=this.findBestLevel(S,m,h,C,w.abrBandWidthFactor,w.abrBandWidthUpFactor);if(g>=0)return g;u.logger.trace((C?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var M=A?Math.min(A,w.maxStarvationDelay):w.maxStarvationDelay,I=w.abrBandWidthFactor,P=w.abrBandWidthUpFactor;if(!C){var B=this.bitrateTestDelay;if(B){var H=A?Math.min(A,w.maxLoadingDelay):w.maxLoadingDelay;M=H-B,u.logger.trace("bitrate test took "+Math.round(1e3*B)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*M)+" ms"),I=P=1}}return g=this.findBestLevel(S,m,h,C+M,I,P),Math.max(g,0)},r.findBestLevel=function(a,i,f,h,w,m){for(var T,A=this.fragCurrent,x=this.partCurrent,b=this.lastLoadedFragLevel,S=this.hls.levels,C=S[b],g=!!(C!=null&&(T=C.details)!==null&&T!==void 0&&T.live),M=C==null?void 0:C.codecSet,I=x?x.duration:A?A.duration:0,P=f;P>=i;P--){var B=S[P];if(!B||M&&B.codecSet!==M)continue;var H=B.details,F=(x?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||I,W=void 0;P<=b?W=w*a:W=m*a;var U=S[P].maxBitrate,K=U*F/W;if(u.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+P+"/"+Math.round(W)+"/"+U+"/"+F+"/"+h+"/"+K),W>U&&(!K||g&&!this.bitrateTestDelay||K<h))return P}return-1},d(l,[{key:"nextAutoLevel",get:function(){var a=this._nextAutoLevel,i=this.bwEstimator;if(a!==-1&&(!i||!i.canEstimate()))return a;var f=this.getNextABRAutoLevel();return a!==-1&&(f=Math.min(a,f)),f},set:function(a){this._nextAutoLevel=a}}]),l}();k.default=s},"./src/controller/audio-stream-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/controller/base-stream-controller.ts"),c=D("./src/events.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/controller/fragment-tracker.ts"),p=D("./src/types/level.ts"),u=D("./src/types/loader.ts"),o=D("./src/loader/fragment.ts"),d=D("./src/demux/chunk-cache.ts"),s=D("./src/demux/transmuxer-interface.ts"),l=D("./src/types/transmuxer.ts"),r=D("./src/controller/fragment-finders.ts"),n=D("./src/utils/discontinuities.ts"),a=D("./src/errors.ts"),i=D("./src/utils/logger.ts");function f(){return f=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(A[S]=b[S])}return A},f.apply(this,arguments)}function h(A,x){A.prototype=Object.create(x.prototype),A.prototype.constructor=A,w(A,x)}function w(A,x){return w=Object.setPrototypeOf||function(S,C){return S.__proto__=C,S},w(A,x)}var m=100,T=function(A){h(x,A);function x(S,C){var g;return g=A.call(this,S,C,"[audio-stream-controller]")||this,g.videoBuffer=null,g.videoTrackCC=-1,g.waitingVideoCC=-1,g.audioSwitch=!1,g.trackId=-1,g.waitingData=null,g.mainDetails=null,g.bufferFlushed=!1,g._registerListeners(),g}var b=x.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var C=this.hls;C.on(c.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.on(c.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.on(c.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.on(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(c.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),C.on(c.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.on(c.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),C.on(c.Events.ERROR,this.onError,this),C.on(c.Events.BUFFER_RESET,this.onBufferReset,this),C.on(c.Events.BUFFER_CREATED,this.onBufferCreated,this),C.on(c.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.on(c.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),C.on(c.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var C=this.hls;C.off(c.Events.MEDIA_ATTACHED,this.onMediaAttached,this),C.off(c.Events.MEDIA_DETACHING,this.onMediaDetaching,this),C.off(c.Events.MANIFEST_LOADING,this.onManifestLoading,this),C.off(c.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(c.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),C.off(c.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),C.off(c.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),C.off(c.Events.ERROR,this.onError,this),C.off(c.Events.BUFFER_RESET,this.onBufferReset,this),C.off(c.Events.BUFFER_CREATED,this.onBufferCreated,this),C.off(c.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),C.off(c.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),C.off(c.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(C,g){var M=g.frag,I=g.id,P=g.initPTS;if(I==="main"){var B=M.cc;this.initPTS[M.cc]=P,this.log("InitPTS for cc: "+B+" found from main: "+P),this.videoTrackCC=B,this.state===O.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(C){if(!this.levels){this.startPosition=C,this.state=O.State.STOPPED;return}var g=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,g>0&&C===-1?(this.log("Override startPosition with lastCurrentTime @"+g.toFixed(3)),this.state=O.State.IDLE):(this.loadedmetadata=!1,this.state=O.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=C,this.tick()},b.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_TRACK:{var C,g=this.levels,M=this.trackId,I=g==null||((C=g[M])===null||C===void 0)?void 0:C.details;if(I){if(this.waitForCdnTuneIn(I))break;this.state=O.State.WAITING_INIT_PTS}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var P,B=performance.now(),H=this.retryDate;(!H||B>=H||(P=this.media)!==null&&P!==void 0&&P.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=O.State.IDLE);break}case O.State.WAITING_INIT_PTS:{var F=this.waitingData;if(F){var W=F.frag,U=F.part,K=F.cache,G=F.complete;if(this.initPTS[W.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.FRAG_LOADING;var ee=K.flush(),de={frag:W,part:U,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(de),G&&A.prototype._handleFragmentLoadComplete.call(this,de)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+W.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ge=this.getLoadPosition(),Be=E.BufferHelper.bufferInfo(this.mediaBuffer,ge,this.config.maxBufferHole),Ue=Object(r.fragmentWithinToleranceTest)(Be.end,this.config.maxFragLookUpTolerance,W);Ue<0&&(i.logger.log("Waiting fragment cc ("+W.cc+") @ "+W.start+" cancelled because another fragment at "+Be.end+" is needed"),this.clearWaitingFragment())}}else this.state=O.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var C=this.waitingData;C&&(this.fragmentTracker.removeFragment(C.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=O.State.IDLE)},b.onTickEnd=function(){var C=this.media;if(!C||!C.readyState)return;var g=this.mediaBuffer?this.mediaBuffer:C,M=g.buffered;!this.loadedmetadata&&M.length&&(this.loadedmetadata=!0),this.lastCurrentTime=C.currentTime},b.doTickIdle=function(){var C,g,M=this.hls,I=this.levels,P=this.media,B=this.trackId,H=M.config;if(!I||!I[B])return;if(!P&&(this.startFragRequested||!H.startFragPrefetch))return;var F=I[B],W=F.details;if(!W||W.live&&this.levelLastLoaded!==B||this.waitForCdnTuneIn(W)){this.state=O.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,o.ElementaryStreamTypes.AUDIO,u.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,u.PlaylistLevelType.AUDIO);if(U===null)return;var K=U.len,G=this.getMaxBufferLength(),ee=this.audioSwitch;if(K>=G&&!ee)return;if(!ee&&this._streamEnded(U,W)){M.trigger(c.Events.BUFFER_EOS,{type:"audio"}),this.state=O.State.ENDED;return}var de=W.fragments,ge=de[0].start,Be=U.end;if(ee){var Ue=this.getLoadPosition();Be=Ue,W.PTSKnown&&Ue<ge&&((U.end>ge||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),P.currentTime=ge+.05))}var Le=this.getNextFragment(Be,W);if(!Le){this.bufferFlushed=!0;return}((C=Le.decryptdata)===null||C===void 0?void 0:C.keyFormat)==="identity"&&!((g=Le.decryptdata)!==null&&g!==void 0&&g.key)?this.loadKey(Le,W):this.loadFragment(Le,W,Be)},b.getMaxBufferLength=function(){var C=A.prototype.getMaxBufferLength.call(this),g=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,u.PlaylistLevelType.MAIN);return g===null?C:Math.max(C,g.len)},b.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(C,g){var M=g.audioTracks;this.resetTransmuxer(),this.levels=M.map(function(I){return new p.Level(I)})},b.onAudioTrackSwitching=function(C,g){var M=!!g.url;this.trackId=g.id;var I=this.fragCurrent;I!=null&&I.loader&&I.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),M?this.setInterval(m):this.resetTransmuxer(),M?(this.audioSwitch=!0,this.state=O.State.IDLE):this.state=O.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(C,g){this.mainDetails=g.details},b.onAudioTrackLoaded=function(C,g){var M,I=this.levels,P=g.details,B=g.id;if(!I){this.warn("Audio tracks were reset while loading level "+B);return}this.log("Track "+B+" loaded ["+P.startSN+","+P.endSN+"],duration:"+P.totalduration);var H=I[B],F=0;if(P.live||(M=H.details)!==null&&M!==void 0&&M.live){var W=this.mainDetails;if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed||!W)return;!H.details&&P.hasProgramDateTime&&W.hasProgramDateTime?(Object(n.alignMediaPlaylistByPDT)(P,W),F=P.fragments[0].start):F=this.alignPlaylists(P,H.details)}H.details=P,this.levelLastLoaded=B,!this.startFragRequested&&(this.mainDetails||!P.live)&&this.setStartPosition(H.details,F),this.state===O.State.WAITING_TRACK&&!this.waitForCdnTuneIn(P)&&(this.state=O.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(C){var g,M=C.frag,I=C.part,P=C.payload,B=this.config,H=this.trackId,F=this.levels;if(!F){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+M.sn+" of level "+M.level+" will not be buffered");return}var W=F[H];console.assert(W,"Audio track is defined on fragment load progress");var U=W.details;console.assert(U,"Audio track details are defined on fragment load progress");var K=B.defaultAudioCodec||W.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new s.default(this.hls,u.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[M.cc],de=(g=M.initSegment)===null||g===void 0?void 0:g.data;if(ee!==void 0){var ge=!1,Be=I?I.index:-1,Ue=Be!==-1,Le=new l.ChunkMetadata(M.level,M.sn,M.stats.chunkCount,P.byteLength,Be,Ue);G.push(P,de,K,"",M,I,U.totalduration,ge,Le,ee)}else{i.logger.log("Unknown video PTS for cc "+M.cc+", waiting for video PTS before demuxing audio frag "+M.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+H);var Me=this.waitingData=this.waitingData||{frag:M,part:I,cache:new d.default,complete:!1},Pe=Me.cache;Pe.push(new Uint8Array(P)),this.waitingVideoCC=this.videoTrackCC,this.state=O.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(C){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,C)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(C,g){var M=g.tracks.audio;M&&(this.mediaBuffer=M.buffer),g.tracks.video&&(this.videoBuffer=g.tracks.video.buffer)},b.onFragBuffered=function(C,g){var M=g.frag,I=g.part;if(M.type!==u.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(M)){this.warn("Fragment "+M.sn+(I?" p: "+I.index:"")+" of level "+M.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}M.sn!=="initSegment"&&(this.fragPrevious=M,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(c.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(M,I)},b.onError=function(C,g){switch(g.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.AUDIO,g);break;case a.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case a.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==O.State.ERROR&&this.state!==O.State.STOPPED&&(this.state=g.fatal?O.State.ERROR:O.State.IDLE,this.warn(g.details+" while loading frag, switching to "+this.state+" state"));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(g.parent==="audio"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var M=!0,I=this.getFwdBufferInfo(this.mediaBuffer,u.PlaylistLevelType.AUDIO);I&&I.len>.5&&(M=!this.reduceMaxBufferLength(I.len)),M&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(C,g){var M=g.type;M===o.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(C){var g,M="audio",I=this.hls,P=C.remuxResult,B=C.chunkMeta,H=this.getCurrentContext(B);if(!H){this.warn("The loading context changed while buffering fragment "+B.sn+" of level "+B.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(B.level);return}var F=H.frag,W=H.part,U=P.audio,K=P.text,G=P.id3,ee=P.initSegment;if(this.fragContextChanged(F))return;if(this.state=O.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,F,B),I.trigger(c.Events.FRAG_PARSING_INIT_SEGMENT,{frag:F,id:M,tracks:ee.tracks})),U){var de=U.startPTS,ge=U.endPTS,Be=U.startDTS,Ue=U.endDTS;W&&(W.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:de,endPTS:ge,startDTS:Be,endDTS:Ue}),F.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,de,ge,Be,Ue),this.bufferFragmentData(U,F,W,B)}if(G!=null&&(g=G.samples)!==null&&g!==void 0&&g.length){var Le=f({frag:F,id:M},G);I.trigger(c.Events.FRAG_PARSING_METADATA,Le)}if(K){var Me=f({frag:F,id:M},K);I.trigger(c.Events.FRAG_PARSING_USERDATA,Me)}},b._bufferInitSegment=function(C,g,M){if(this.state!==O.State.PARSING)return;C.video&&delete C.video;var I=C.audio;if(!I)return;I.levelCodec=I.codec,I.id="audio",this.log("Init audio buffer, container:"+I.container+", codecs[parsed]=["+I.codec+"]"),this.hls.trigger(c.Events.BUFFER_CODECS,C);var P=I.initSegment;if(P!=null&&P.byteLength){var B={type:"audio",frag:g,part:null,chunkMeta:M,parent:g.type,data:P};this.hls.trigger(c.Events.BUFFER_APPENDING,B)}this.tick()},b.loadFragment=function(C,g,M){var I=this.fragmentTracker.getState(C);this.fragCurrent=C,(this.audioSwitch||I===y.FragmentState.NOT_LOADED||I===y.FragmentState.PARTIAL)&&(C.sn==="initSegment"?this._loadInitSegment(C):g.live&&!Object(R.isFiniteNumber)(this.initPTS[C.cc])?(this.log("Waiting for video PTS in continuity counter "+C.cc+" of live stream before loading audio fragment "+C.sn+" of level "+this.trackId),this.state=O.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,C,g,M)))},b.completeAudioSwitch=function(){var C=this.hls,g=this.media,M=this.trackId;g&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,C.trigger(c.Events.AUDIO_TRACK_SWITCHED,{id:M})},x}(O.default);k.default=T},"./src/controller/audio-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/errors.ts"),c=D("./src/controller/base-playlist-controller.ts"),E=D("./src/types/loader.ts");function y(s,l){for(var r=0;r<l.length;r++){var n=l[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(s,n.key,n)}}function p(s,l,r){return l&&y(s.prototype,l),r&&y(s,r),s}function u(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,o(s,l)}function o(s,l){return o=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},o(s,l)}var d=function(s){u(l,s);function l(n){var a;return a=s.call(this,n,"[audio-track-controller]")||this,a.tracks=[],a.groupId=null,a.tracksInGroup=[],a.trackId=-1,a.trackName="",a.selectDefaultTrack=!0,a.registerListeners(),a}var r=l.prototype;return r.registerListeners=function(){var a=this.hls;a.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),a.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.on(R.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var a=this.hls;a.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),a.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),a.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),a.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),a.off(R.Events.ERROR,this.onError,this)},r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,s.prototype.destroy.call(this)},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},r.onManifestParsed=function(a,i){this.tracks=i.audioTracks||[]},r.onAudioTrackLoaded=function(a,i){var f=i.id,h=i.details,w=this.tracksInGroup[f];if(!w){this.warn("Invalid audio track id "+f);return}var m=w.details;w.details=i.details,this.log("audioTrack "+f+" loaded ["+h.startSN+"-"+h.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,i,m))},r.onLevelLoading=function(a,i){this.switchLevel(i.level)},r.onLevelSwitching=function(a,i){this.switchLevel(i.level)},r.switchLevel=function(a){var i=this.hls.levels[a];if(!(i!=null&&i.audioGroupIds))return;var f=i.audioGroupIds[i.urlId];if(this.groupId!==f){this.groupId=f;var h=this.tracks.filter(function(m){return!f||m.groupId===f});this.selectDefaultTrack&&!h.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var w={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(R.Events.AUDIO_TRACKS_UPDATED,w),this.selectInitialTrack()}},r.onError=function(a,i){if(s.prototype.onError.call(this,a,i),i.fatal||!i.context)return;i.context.type===E.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},r.setAudioTrack=function(a){var i=this.tracksInGroup;if(a<0||a>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var f=i[this.trackId];this.log("Now switching to audio-track index "+a);var h=i[a],w=h.id,m=h.groupId,T=m===void 0?"":m,A=h.name,x=h.type,b=h.url;if(this.trackId=a,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHING,{id:w,groupId:T,name:A,type:x,url:b}),h.details&&!h.details.live)return;var S=this.switchParams(h.url,f==null?void 0:f.details);this.loadPlaylist(S)},r.selectInitialTrack=function(){var a=this.tracksInGroup;console.assert(a.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,f=this.findTrackId(i)||this.findTrackId();f!==-1?this.setAudioTrack(f):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},r.findTrackId=function(a){for(var i=this.tracksInGroup,f=0;f<i.length;f++){var h=i[f];if((!this.selectDefaultTrack||h.default)&&(!a||a===h.name))return h.id}return-1},r.loadPlaylist=function(a){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var f=i.id,h=i.groupId,w=i.url;if(a)try{w=a.addDirectives(w)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+f),this.clearTimer(),this.hls.trigger(R.Events.AUDIO_TRACK_LOADING,{url:w,id:f,groupId:h,deliveryDirectives:a||null})}},p(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(a){this.selectDefaultTrack=!1,this.setAudioTrack(a)}}]),l}(c.default);k.default=d},"./src/controller/base-playlist-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return p});var R=D("./src/polyfills/number.ts"),O=D("./src/types/level.ts"),c=D("./src/controller/level-helper.ts"),E=D("./src/utils/logger.ts"),y=D("./src/errors.ts"),p=function(){function u(d,s){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,s+":"),this.warn=E.logger.warn.bind(E.logger,s+":"),this.hls=d}var o=u.prototype;return o.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},o.onError=function(s,l){l.fatal&&l.type===y.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(s,l){var r=l==null?void 0:l.renditionReports;if(r)for(var n=0;n<r.length;n++){var a=r[n],i=""+a.URI;if(i===s.substr(-i.length)){var f=parseInt(a["LAST-MSN"]),h=parseInt(a["LAST-PART"]);if(l&&this.hls.config.lowLatencyMode){var w=Math.min(l.age-l.partTarget,l.targetduration);h!==void 0&&w>l.partTarget&&(h+=1)}if(Object(R.isFiniteNumber)(f))return new O.HlsUrlParameters(f,Object(R.isFiniteNumber)(h)?h:void 0,O.HlsSkip.No)}}},o.loadPlaylist=function(s){},o.shouldLoadTrack=function(s){return this.canLoad&&s&&!!s.url&&(!s.details||s.details.live)},o.playlistLoaded=function(s,l,r){var n=this,a=l.details,i=l.stats,f=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(a.advancedDateTime=Date.now()-f,a.live||r!=null&&r.live){if(a.reloaded(r),r&&this.log("live playlist "+s+" "+(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:"MISSED")),r&&a.fragments.length>0&&Object(c.mergeDetails)(r,a),!this.canLoad||!a.live)return;var h,w=void 0,m=void 0;if(a.canBlockReload&&a.endSN&&a.advanced){var T=this.hls.config.lowLatencyMode,A=a.lastPartSn,x=a.endSN,b=a.lastPartIndex,S=b!==-1,C=A===x,g=T?0:b;S?(w=C?x+1:A,m=C?g:b+1):w=x+1;var M=a.age,I=M+a.ageHeader,P=Math.min(I-a.partTarget,a.targetduration*1.5);if(P>0){if(r&&P>r.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+r.tuneInGoal+" to: "+P+" with playlist age: "+a.age),P=0;else{var B=Math.floor(P/a.targetduration);if(w+=B,m!==void 0){var H=Math.round(P%a.targetduration/a.partTarget);m+=H}this.log("CDN Tune-in age: "+a.ageHeader+"s last advanced "+M.toFixed(2)+"s goal: "+P+" skip sn "+B+" to part "+m)}a.tuneInGoal=P}if(h=this.getDeliveryDirectives(a,l.deliveryDirectives,w,m),T||!C){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(a,l.deliveryDirectives,w,m);var F=Object(c.computeReloadInterval)(a,i);w!==void 0&&a.canBlockReload&&(F-=a.partTarget||1),this.log("reload live playlist "+s+" in "+Math.round(F)+" ms"),this.timer=self.setTimeout(function(){return n.loadPlaylist(h)},F)}else this.clearTimer()},o.getDeliveryDirectives=function(s,l,r,n){var a=Object(O.getSkipValue)(s,r);return l!=null&&l.skip&&s.deltaUpdateFailed&&(r=l.msn,n=l.part,a=O.HlsSkip.No),new O.HlsUrlParameters(r,n,a)},o.retryLoadingOrFail=function(s){var l=this,r=this.hls.config,n=this.retryCount<r.levelLoadingMaxRetry;if(n){var a;if(this.retryCount++,s.details.indexOf("LoadTimeOut")>-1&&(a=s.context)!==null&&a!==void 0&&a.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+s.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return l.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+s.details+'"')}}else this.warn('cannot recover from error "'+s.details+'"'),this.clearTimer(),s.fatal=!0;return n},u}()},"./src/controller/base-stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"State",function(){return x}),D.d(k,"default",function(){return b});var R=D("./src/polyfills/number.ts"),O=D("./src/task-loop.ts"),c=D("./src/controller/fragment-tracker.ts"),E=D("./src/utils/buffer-helper.ts"),y=D("./src/utils/logger.ts"),p=D("./src/events.ts"),u=D("./src/errors.ts"),o=D("./src/types/transmuxer.ts"),d=D("./src/utils/mp4-tools.ts"),s=D("./src/utils/discontinuities.ts"),l=D("./src/controller/fragment-finders.ts"),r=D("./src/controller/level-helper.ts"),n=D("./src/loader/fragment-loader.ts"),a=D("./src/crypt/decrypter.ts"),i=D("./src/utils/time-ranges.ts"),f=D("./src/types/loader.ts");function h(S,C){for(var g=0;g<C.length;g++){var M=C[g];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(S,M.key,M)}}function w(S,C,g){return C&&h(S.prototype,C),g&&h(S,g),S}function m(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function T(S,C){S.prototype=Object.create(C.prototype),S.prototype.constructor=S,A(S,C)}function A(S,C){return A=Object.setPrototypeOf||function(M,I){return M.__proto__=I,M},A(S,C)}var x={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"},b=function(S){T(C,S);function C(M,I,P){var B;return B=S.call(this)||this,B.hls=void 0,B.fragPrevious=null,B.fragCurrent=null,B.fragmentTracker=void 0,B.transmuxer=null,B._state=x.STOPPED,B.media=void 0,B.mediaBuffer=void 0,B.config=void 0,B.bitrateTest=!1,B.lastCurrentTime=0,B.nextLoadPosition=0,B.startPosition=0,B.loadedmetadata=!1,B.fragLoadError=0,B.retryDate=0,B.levels=null,B.fragmentLoader=void 0,B.levelLastLoaded=null,B.startFragRequested=!1,B.decrypter=void 0,B.initPTS=[],B.onvseeking=null,B.onvended=null,B.logPrefix="",B.log=void 0,B.warn=void 0,B.logPrefix=P,B.log=y.logger.log.bind(y.logger,P+":"),B.warn=y.logger.warn.bind(y.logger,P+":"),B.hls=M,B.fragmentLoader=new n.default(M.config),B.fragmentTracker=I,B.config=M.config,B.decrypter=new a.default(M,M.config),M.on(p.Events.KEY_LOADED,B.onKeyLoaded,m(B)),B}var g=C.prototype;return g.doTick=function(){this.onTickEnd()},g.onTickEnd=function(){},g.startLoad=function(I){},g.stopLoad=function(){this.fragmentLoader.abort();var I=this.fragCurrent;I&&this.fragmentTracker.removeFragment(I),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=x.STOPPED},g._streamEnded=function(I,P){var B=this.fragCurrent,H=this.fragmentTracker;if(!P.live&&B&&B.sn===P.endSN&&!I.nextStart){var F=H.getState(B);return F===c.FragmentState.PARTIAL||F===c.FragmentState.OK}return!1},g.onMediaAttached=function(I,P){var B=this.media=this.mediaBuffer=P.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),B.addEventListener("seeking",this.onvseeking),B.addEventListener("ended",this.onvended);var H=this.config;this.levels&&H.autoStartLoad&&this.state===x.STOPPED&&this.startLoad(H.startPosition)},g.onMediaDetaching=function(){var I=this.media;I!=null&&I.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),I&&(I.removeEventListener("seeking",this.onvseeking),I.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},g.onMediaSeeking=function(){var I=this.config,P=this.fragCurrent,B=this.media,H=this.mediaBuffer,F=this.state,W=B?B.currentTime:0,U=E.BufferHelper.bufferInfo(H||B,W,I.maxBufferHole);if(this.log("media seeking to "+(Object(R.isFiniteNumber)(W)?W.toFixed(3):W)+", state: "+F),F===x.ENDED)this.resetLoadingState();else if(P&&!U.len){var K=I.maxFragLookUpTolerance,G=P.start-K,ee=P.start+P.duration+K,de=W>ee;(W<G||de)&&(de&&P.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),P.loader.abort()),this.resetLoadingState())}B&&(this.lastCurrentTime=W),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=W),this.tickImmediate()},g.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},g.onKeyLoaded=function(I,P){if(this.state!==x.KEY_LOADING||P.frag!==this.fragCurrent||!this.levels)return;this.state=x.IDLE;var B=this.levels[P.frag.level].details;B&&this.loadFragment(P.frag,B,P.frag.start)},g.onHandlerDestroying=function(){this.stopLoad(),S.prototype.onHandlerDestroying.call(this)},g.onHandlerDestroyed=function(){this.state=x.STOPPED,this.hls.off(p.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,S.prototype.onHandlerDestroyed.call(this)},g.loadKey=function(I,P){this.log("Loading key for "+I.sn+" of ["+P.startSN+"-"+P.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+I.level),this.state=x.KEY_LOADING,this.fragCurrent=I,this.hls.trigger(p.Events.KEY_LOADING,{frag:I})},g.loadFragment=function(I,P,B){this._loadFragForPlayback(I,P,B)},g._loadFragForPlayback=function(I,P,B){var H=this,F=function(U){if(H.fragContextChanged(I)){H.warn("Fragment "+I.sn+(U.part?" p: "+U.part.index:"")+" of level "+I.level+" was dropped during download."),H.fragmentTracker.removeFragment(I);return}I.stats.chunkCount++,H._handleFragmentLoadProgress(U)};this._doFragLoad(I,P,B,F).then(function(W){if(!W)return;H.fragLoadError=0;var U=H.state;if(H.fragContextChanged(I)){(U===x.FRAG_LOADING||U===x.BACKTRACKING||!H.fragCurrent&&U===x.PARSING)&&(H.fragmentTracker.removeFragment(I),H.state=x.IDLE);return}if("payload"in W&&(H.log("Loaded fragment "+I.sn+" of level "+I.level),H.hls.trigger(p.Events.FRAG_LOADED,W),H.state===x.BACKTRACKING)){H.fragmentTracker.backtrack(I,W),H.resetFragmentLoading(I);return}H._handleFragmentLoadComplete(W)}).catch(function(W){H.warn(W),H.resetFragmentLoading(I)})},g.flushMainBuffer=function(I,P,B){if(B===void 0&&(B=null),!(I-P))return;var H={startOffset:I,endOffset:P,type:B};this.fragLoadError=0,this.hls.trigger(p.Events.BUFFER_FLUSHING,H)},g._loadInitSegment=function(I){var P=this;this._doFragLoad(I).then(function(B){if(!B||P.fragContextChanged(I)||!P.levels)throw new Error("init load aborted");return B}).then(function(B){var H=P.hls,F=B.payload,W=I.decryptdata;if(F&&F.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var U=self.performance.now();return P.decrypter.webCryptoDecrypt(new Uint8Array(F),W.key.buffer,W.iv.buffer).then(function(K){var G=self.performance.now();return H.trigger(p.Events.FRAG_DECRYPTED,{frag:I,payload:K,stats:{tstart:U,tdecrypt:G}}),B.payload=K,B})}return B}).then(function(B){var H=P.fragCurrent,F=P.hls,W=P.levels;if(!W)throw new Error("init load aborted, missing levels");var U=W[I.level].details;console.assert(U,"Level details are defined when init segment is loaded");var K=I.stats;P.state=x.IDLE,P.fragLoadError=0,I.data=new Uint8Array(B.payload),K.parsing.start=K.buffering.start=self.performance.now(),K.parsing.end=K.buffering.end=self.performance.now(),B.frag===H&&F.trigger(p.Events.FRAG_BUFFERED,{stats:K,frag:H,part:null,id:I.type}),P.tick()}).catch(function(B){P.warn(B),P.resetFragmentLoading(I)})},g.fragContextChanged=function(I){var P=this.fragCurrent;return!I||!P||I.level!==P.level||I.sn!==P.sn||I.urlId!==P.urlId},g.fragBufferedComplete=function(I,P){var B=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+I.type+" sn: "+I.sn+(P?" part: "+P.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+I.level+" "+i.default.toString(E.BufferHelper.getBuffered(B))),this.state=x.IDLE,this.tick()},g._handleFragmentLoadComplete=function(I){var P=this.transmuxer;if(!P)return;var B=I.frag,H=I.part,F=I.partsLoaded,W=!F||F.length===0||F.some(function(K){return!K}),U=new o.ChunkMetadata(B.level,B.sn,B.stats.chunkCount+1,0,H?H.index:-1,!W);P.flush(U)},g._handleFragmentLoadProgress=function(I){},g._doFragLoad=function(I,P,B,H){var F=this;if(B===void 0&&(B=null),!this.levels)throw new Error("frag load aborted, missing levels");if(B=Math.max(I.start,B||0),this.config.lowLatencyMode&&P){var W=P.partList;if(W&&H){B>I.end&&P.fragmentHint&&(I=P.fragmentHint);var U=this.getNextPart(W,I,B);if(U>-1){var K=W[U];return this.log("Loading part sn: "+I.sn+" p: "+K.index+" cc: "+I.cc+" of playlist ["+P.startSN+"-"+P.endSN+"] parts [0-"+U+"-"+(W.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+I.level+", target: "+parseFloat(B.toFixed(3))),this.nextLoadPosition=K.start+K.duration,this.state=x.FRAG_LOADING,this.hls.trigger(p.Events.FRAG_LOADING,{frag:I,part:W[U],targetBufferTime:B}),this.doFragPartsLoad(I,W,U,H).catch(function(G){return F.handleFragLoadError(G)})}else if(!I.url||this.loadedEndOfParts(W,B))return Promise.resolve(null)}}return this.log("Loading fragment "+I.sn+" cc: "+I.cc+" "+(P?"of ["+P.startSN+"-"+P.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+I.level+", target: "+parseFloat(B.toFixed(3))),Object(R.isFiniteNumber)(I.sn)&&!this.bitrateTest&&(this.nextLoadPosition=I.start+I.duration),this.state=x.FRAG_LOADING,this.hls.trigger(p.Events.FRAG_LOADING,{frag:I,targetBufferTime:B}),this.fragmentLoader.load(I,H).catch(function(G){return F.handleFragLoadError(G)})},g.doFragPartsLoad=function(I,P,B,H){var F=this;return new Promise(function(W,U){var K=[],G=function ee(de){var ge=P[de];F.fragmentLoader.loadPart(I,ge,H).then(function(Be){K[ge.index]=Be;var Ue=Be.part;F.hls.trigger(p.Events.FRAG_LOADED,Be);var Le=P[de+1];if(Le&&Le.fragment===I)ee(de+1);else return W({frag:I,part:Ue,partsLoaded:K})}).catch(U)};G(B)})},g.handleFragLoadError=function(I){var P=I.data;return P&&P.details===u.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(P.frag,P.part):this.hls.trigger(p.Events.ERROR,P),null},g._handleTransmuxerFlush=function(I){var P=this.getCurrentContext(I);if(!P||this.state!==x.PARSING){this.fragCurrent||(this.state=x.IDLE);return}var B=P.frag,H=P.part,F=P.level,W=self.performance.now();B.stats.parsing.end=W,H&&(H.stats.parsing.end=W),this.updateLevelTiming(B,H,F,I.partial)},g.getCurrentContext=function(I){var P=this.levels,B=I.level,H=I.sn,F=I.part;if(!P||!P[B])return this.warn("Levels object was unset while buffering fragment "+H+" of level "+B+". The current chunk will not be buffered."),null;var W=P[B],U=F>-1?Object(r.getPartWith)(W,H,F):null,K=U?U.fragment:Object(r.getFragmentWithSN)(W,H,this.fragCurrent);return K?{frag:K,part:U,level:W}:null},g.bufferFragmentData=function(I,P,B,H){if(!I||this.state!==x.PARSING)return;var F=I.data1,W=I.data2,U=F;if(F&&W&&(U=Object(d.appendUint8Array)(F,W)),!U||!U.length)return;var K={type:I.type,frag:P,part:B,chunkMeta:H,parent:P.type,data:U};this.hls.trigger(p.Events.BUFFER_APPENDING,K),I.dropped&&I.independent&&!B&&this.flushBufferGap(P)},g.flushBufferGap=function(I){var P=this.media;if(!P)return;if(!E.BufferHelper.isBuffered(P,P.currentTime)){this.flushMainBuffer(0,I.start);return}var B=P.currentTime,H=E.BufferHelper.bufferInfo(P,B,0),F=I.duration,W=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),U=Math.max(Math.min(I.start-W,H.end-W),B+W);I.start-U>W&&this.flushMainBuffer(U,I.start)},g.getFwdBufferInfo=function(I,P){var B=this.config,H=this.getLoadPosition();if(!Object(R.isFiniteNumber)(H))return null;var F=E.BufferHelper.bufferInfo(I,H,B.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var W=this.fragmentTracker.getBufferedFrag(H,P);if(W&&F.nextStart<W.end)return E.BufferHelper.bufferInfo(I,H,Math.max(F.nextStart,B.maxBufferHole))}return F},g.getMaxBufferLength=function(I){var P=this.config,B;return I?B=Math.max(8*P.maxBufferSize/I,P.maxBufferLength):B=P.maxBufferLength,Math.min(B,P.maxMaxBufferLength)},g.reduceMaxBufferLength=function(I){var P=this.config,B=I||P.maxBufferLength;return P.maxMaxBufferLength>=B?(P.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+P.maxMaxBufferLength+"s"),!0):!1},g.getNextFragment=function(I,P){var B,H,F=P.fragments,W=F.length;if(!W)return null;var U=this.config,K=F[0].start,G;if(P.live){var ee=U.initialLiveManifestSize;if(W<ee)return this.warn("Not enough fragments to start playback (have: "+W+", need: "+ee+")"),null;!P.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(P,F),this.startPosition=G?this.hls.liveSyncPosition||G.start:I)}else I<=K&&(G=F[0]);if(!G){var de=U.lowLatencyMode?P.partEnd:P.fragmentEnd;G=this.getFragmentAtPosition(I,de,P)}return(B=G)!==null&&B!==void 0&&B.initSegment&&!((H=G)!==null&&H!==void 0&&H.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},g.getNextPart=function(I,P,B){for(var H=-1,F=!1,W=!0,U=0,K=I.length;U<K;U++){var G=I[U];if(W=W&&!G.independent,H>-1&&B<G.start)break;var ee=G.loaded;!ee&&(F||G.independent||W)&&G.fragment===P&&(H=U),F=ee}return H},g.loadedEndOfParts=function(I,P){var B=I[I.length-1];return B&&P>B.start&&B.loaded},g.getInitialLiveFragment=function(I,P){var B=this.fragPrevious,H=null;if(B){if(I.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+B.programDateTime),H=Object(l.findFragmentByPDT)(P,B.endProgramDateTime,this.config.maxFragLookUpTolerance)),!H){var F=B.sn+1;if(F>=I.startSN&&F<=I.endSN){var W=P[F-I.startSN];B.cc===W.cc&&(H=W,this.log("Live playlist, switching playlist, load frag with next SN: "+H.sn))}H||(H=Object(l.findFragWithCC)(P,B.cc),H&&this.log("Live playlist, switching playlist, load frag with same CC: "+H.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(H=this.getFragmentAtPosition(U,this.bitrateTest?I.fragmentEnd:I.edge,I))}return H},g.getFragmentAtPosition=function(I,P,B){var H=this.config,F=this.fragPrevious,W=B.fragments,U=B.endSN,K=B.fragmentHint,G=H.maxFragLookUpTolerance,ee=!!(H.lowLatencyMode&&B.partList&&K);ee&&K&&!this.bitrateTest&&(W=W.concat(K),U=K.sn);var de;if(I<P){var ge=I>P-G?0:G;de=Object(l.findFragmentByPTS)(F,W,I,ge)}else de=W[W.length-1];if(de){var Be=de.sn-B.startSN,Ue=F&&de.level===F.level,Le=W[Be+1],Me=this.fragmentTracker.getState(de);if(Me===c.FragmentState.BACKTRACKED){de=null;for(var Pe=Be;W[Pe]&&this.fragmentTracker.getState(W[Pe])===c.FragmentState.BACKTRACKED;)F?de=W[Pe--]:de=W[--Pe];de||(de=Le)}else F&&de.sn===F.sn&&!ee&&(Ue&&(de.sn<U&&this.fragmentTracker.getState(Le)!==c.FragmentState.OK?(this.log("SN "+de.sn+" just loaded, load next one: "+Le.sn),de=Le):de=null))}return de},g.synchronizeToLiveEdge=function(I){var P=this.config,B=this.media;if(!B)return;var H=this.hls.liveSyncPosition,F=B.currentTime,W=I.fragments[0].start,U=I.edge,K=F>=W-P.maxFragLookUpTolerance&&F<=U;if(H!==null&&B.duration>H&&(F<H||!K)){var G=P.liveMaxLatencyDuration!==void 0?P.liveMaxLatencyDuration:P.liveMaxLatencyDurationCount*I.targetduration;(!K&&B.readyState<4||F<U-G)&&(this.loadedmetadata||(this.nextLoadPosition=H),B.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+H.toFixed(3)),B.currentTime=H))}},g.alignPlaylists=function(I,P){var B=this.levels,H=this.levelLastLoaded,F=this.fragPrevious,W=H!==null?B[H]:null,U=I.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var K=I.fragments[0].start,G=!P,ee=I.alignedSliding&&Object(R.isFiniteNumber)(K);if(G||!ee&&!K){Object(s.alignStream)(F,W,I);var de=I.fragments[0].start;return this.log("Live playlist sliding: "+de.toFixed(2)+" start-sn: "+(P?P.startSN:"na")+"->"+I.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+U),de}return K},g.waitForCdnTuneIn=function(I){var P=3;return I.live&&I.canBlockReload&&I.tuneInGoal>Math.max(I.partHoldBack,I.partTarget*P)},g.setStartPosition=function(I,P){var B=this.startPosition;if(B<P&&(B=-1),B===-1||this.lastCurrentTime===-1){var H=I.startTimeOffset;Object(R.isFiniteNumber)(H)?(B=P+H,H<0&&(B+=I.totalduration),B=Math.min(Math.max(P,B),P+I.totalduration),this.log("Start time offset "+H+" found in playlist, adjust startPosition to "+B),this.startPosition=B):I.live?B=this.hls.liveSyncPosition||P:this.startPosition=B=0,this.lastCurrentTime=B}this.nextLoadPosition=B},g.getLoadPosition=function(){var I=this.media,P=0;return this.loadedmetadata&&I?P=I.currentTime:this.nextLoadPosition&&(P=this.nextLoadPosition),P},g.handleFragLoadAborted=function(I,P){this.transmuxer&&I.sn!=="initSegment"&&I.stats.aborted&&(this.warn("Fragment "+I.sn+(P?" part"+P.index:"")+" of level "+I.level+" was aborted"),this.resetFragmentLoading(I))},g.resetFragmentLoading=function(I){(!this.fragCurrent||!this.fragContextChanged(I))&&(this.state=x.IDLE)},g.onFragmentOrKeyLoadError=function(I,P){if(P.fatal)return;var B=P.frag;if(!B||B.type!==I)return;var H=this.fragCurrent;console.assert(H&&B.sn===H.sn&&B.level===H.level&&B.urlId===H.urlId,"Frag load error must match current frag to retry");var F=this.config;if(this.fragLoadError+1<=F.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(B.level))return;var W=Math.min(Math.pow(2,this.fragLoadError)*F.fragLoadingRetryDelay,F.fragLoadingMaxRetryTimeout);this.warn("Fragment "+B.sn+" of "+I+" "+B.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=x.FRAG_LOADING_WAITING_RETRY}else P.levelRetry?(I===f.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=x.IDLE):(y.logger.error(P.details+" reaches max retry, redispatch as fatal ..."),P.fatal=!0,this.hls.stopLoad(),this.state=x.ERROR)},g.afterBufferFlushed=function(I,P,B){if(!I)return;var H=E.BufferHelper.getBuffered(I);this.fragmentTracker.detectEvictedFragments(P,H,B),this.state===x.ENDED&&this.resetLoadingState()},g.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=x.IDLE},g.resetLiveStartWhenNotLoaded=function(I){if(!this.loadedmetadata){this.startFragRequested=!1;var P=this.levels?this.levels[I].details:null;if(P!=null&&P.live)return this.startPosition=-1,this.setStartPosition(P,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},g.updateLevelTiming=function(I,P,B,H){var F=this,W=B.details;console.assert(!!W,"level.details must be defined");var U=Object.keys(I.elementaryStreams).reduce(function(K,G){var ee=I.elementaryStreams[G];if(ee){var de=ee.endPTS-ee.startPTS;if(de<=0)return F.warn("Could not parse fragment "+I.sn+" "+G+" duration reliably ("+de+") resetting transmuxer to fallback to playlist timing"),F.resetTransmuxer(),K||!1;var ge=H?0:Object(r.updateFragPTSDTS)(W,I,ee.startPTS,ee.endPTS,ee.startDTS,ee.endDTS);return F.hls.trigger(p.Events.LEVEL_PTS_UPDATED,{details:W,level:B,drift:ge,type:G,frag:I,start:ee.startPTS,end:ee.endPTS}),!0}return K},!1);U?(this.state=x.PARSED,this.hls.trigger(p.Events.FRAG_PARSED,{frag:I,part:P})):this.resetLoadingState()},g.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},w(C,[{key:"state",get:function(){return this._state},set:function(I){var P=this._state;P!==I&&(this._state=I,this.log(P+"->"+I))}}]),C}(O.default)},"./src/controller/buffer-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),c=D("./src/utils/logger.ts"),E=D("./src/errors.ts"),y=D("./src/utils/buffer-helper.ts"),p=D("./src/utils/mediasource-helper.ts"),u=D("./src/loader/fragment.ts"),o=D("./src/controller/buffer-operation-queue.ts"),d=Object(p.getMediaSource)(),s=/([ha]vc.)(?:\.[^.,]+)+/,l=function(){function r(a){var i=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var f=i.hls,h=i.media,w=i.mediaSource;c.logger.log("[buffer-controller]: Media source opened"),h&&(i.updateMediaElementDuration(),f.trigger(O.Events.MEDIA_ATTACHED,{media:h})),w&&w.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){c.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){c.logger.log("[buffer-controller]: Media source ended")},this.hls=a,this._initSourceBuffer(),this.registerListeners()}var n=r.prototype;return n.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},n.destroy=function(){this.unregisterListeners(),this.details=null},n.registerListeners=function(){var i=this.hls;i.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(O.Events.BUFFER_RESET,this.onBufferReset,this),i.on(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(O.Events.BUFFER_EOS,this.onBufferEos,this),i.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(O.Events.FRAG_PARSED,this.onFragParsed,this),i.on(O.Events.FRAG_CHANGED,this.onFragChanged,this)},n.unregisterListeners=function(){var i=this.hls;i.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(O.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(O.Events.BUFFER_RESET,this.onBufferReset,this),i.off(O.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(O.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(O.Events.BUFFER_EOS,this.onBufferEos,this),i.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(O.Events.FRAG_PARSED,this.onFragParsed,this),i.off(O.Events.FRAG_CHANGED,this.onFragChanged,this)},n._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new o.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},n.onManifestParsed=function(i,f){var h=2;(f.audio&&!f.video||!f.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,c.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},n.onMediaAttaching=function(i,f){var h=this.media=f.media;if(h&&d){var w=this.mediaSource=new d;w.addEventListener("sourceopen",this._onMediaSourceOpen),w.addEventListener("sourceended",this._onMediaSourceEnded),w.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(w),this._objectUrl=h.src}},n.onMediaDetaching=function(){var i=this.media,f=this.mediaSource,h=this._objectUrl;if(f){if(c.logger.log("[buffer-controller]: media source detaching"),f.readyState==="open")try{f.endOfStream()}catch(w){c.logger.warn("[buffer-controller]: onMediaDetaching: "+w.message+" while calling endOfStream")}this.onBufferReset(),f.removeEventListener("sourceopen",this._onMediaSourceOpen),f.removeEventListener("sourceended",this._onMediaSourceEnded),f.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(h&&self.URL.revokeObjectURL(h),i.src===h?(i.removeAttribute("src"),i.load()):c.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(O.Events.MEDIA_DETACHED,void 0)},n.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(f){var h=i.sourceBuffer[f];try{h&&(i.removeBufferListeners(f),i.mediaSource&&i.mediaSource.removeSourceBuffer(h),i.sourceBuffer[f]=void 0)}catch(w){c.logger.warn("[buffer-controller]: Failed to reset the "+f+" buffer",w)}}),this._initSourceBuffer()},n.onBufferCodecs=function(i,f){var h=this,w=this.getSourceBufferTypes().length;if(Object.keys(f).forEach(function(m){if(w){var T=h.tracks[m];if(T&&typeof T.buffer.changeType=="function"){var A=f[m],x=A.codec,b=A.levelCodec,S=A.container,C=(T.levelCodec||T.codec).replace(s,"$1"),g=(b||x).replace(s,"$1");if(C!==g){var M=S+";codecs="+(b||x);h.appendChangeType(m,M)}}}else h.pendingTracks[m]=f[m]}),w)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},n.appendChangeType=function(i,f){var h=this,w=this.operationQueue,m={execute:function(){var A=h.sourceBuffer[i];A&&(c.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+f),A.changeType(f)),w.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(A){c.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",A)}};w.append(m,i)},n.onBufferAppending=function(i,f){var h=this,w=this.hls,m=this.operationQueue,T=this.tracks,A=f.data,x=f.type,b=f.frag,S=f.part,C=f.chunkMeta,g=C.buffering[x],M=self.performance.now();g.start=M;var I=b.stats.buffering,P=S?S.stats.buffering:null;I.start===0&&(I.start=M),P&&P.start===0&&(P.start=M);var B=T.audio,H=x==="audio"&&C.id===1&&(B==null?void 0:B.container)==="audio/mpeg",F={execute:function(){if(g.executeStart=self.performance.now(),H){var U=h.sourceBuffer[x];if(U){var K=b.start-U.timestampOffset;Math.abs(K)>=.1&&(c.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+K+") sn: "+b.sn+")"),U.timestampOffset=b.start)}}h.appendExecutor(A,x)},onStart:function(){},onComplete:function(){var U=self.performance.now();g.executeEnd=g.end=U,I.first===0&&(I.first=U),P&&P.first===0&&(P.first=U);var K=h.sourceBuffer,G={};for(var ee in K)G[ee]=y.BufferHelper.getBuffered(K[ee]);h.appendError=0,h.hls.trigger(O.Events.BUFFER_APPENDED,{type:x,frag:b,part:S,chunkMeta:C,parent:b.type,timeRanges:G})},onError:function(U){c.logger.error("[buffer-controller]: Error encountered while trying to append to the "+x+" SourceBuffer",U);var K={type:E.ErrorTypes.MEDIA_ERROR,parent:b.type,details:E.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?K.details=E.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,K.details=E.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>w.config.appendErrorMaxRetry&&(c.logger.error("[buffer-controller]: Failed "+w.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),K.fatal=!0)),w.trigger(O.Events.ERROR,K)}};m.append(F,x)},n.onBufferFlushing=function(i,f){var h=this,w=this.operationQueue,m=function(A){return{execute:h.removeExecutor.bind(h,A,f.startOffset,f.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(O.Events.BUFFER_FLUSHED,{type:A})},onError:function(b){c.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",b)}}};f.type?w.append(m(f.type),f.type):this.getSourceBufferTypes().forEach(function(T){w.append(m(T),T)})},n.onFragParsed=function(i,f){var h=this,w=f.frag,m=f.part,T=[],A=m?m.elementaryStreams:w.elementaryStreams;A[u.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(A[u.ElementaryStreamTypes.AUDIO]&&T.push("audio"),A[u.ElementaryStreamTypes.VIDEO]&&T.push("video"));var x=function(){var S=self.performance.now();w.stats.buffering.end=S,m&&(m.stats.buffering.end=S);var C=m?m.stats:w.stats;h.hls.trigger(O.Events.FRAG_BUFFERED,{frag:w,part:m,stats:C,id:w.type})};T.length===0&&c.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+w.type+" level: "+w.level+" sn: "+w.sn),this.blockBuffers(x,T)},n.onFragChanged=function(i,f){this.flushBackBuffer()},n.onBufferEos=function(i,f){var h=this,w=this.getSourceBufferTypes().reduce(function(m,T){var A=h.sourceBuffer[T];return(!f.type||f.type===T)&&(A&&!A.ended&&(A.ended=!0,c.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),m&&!!(!A||A.ended)},!0);w&&this.blockBuffers(function(){var m=h.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},n.onLevelUpdated=function(i,f){var h=f.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},n.flushBackBuffer=function(){var i=this.hls,f=this.details,h=this.media,w=this.sourceBuffer;if(!h||f===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var T=f.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(R.isFiniteNumber)(T)||T<0)return;var A=h.currentTime,x=f.levelTargetDuration,b=Math.max(T,x),S=Math.floor(A/x)*x-b;m.forEach(function(C){var g=w[C];if(g){var M=y.BufferHelper.getBuffered(g);M.length>0&&S>M.start(0)&&(i.trigger(O.Events.BACK_BUFFER_REACHED,{bufferEnd:S}),f.live&&i.trigger(O.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:S}),i.trigger(O.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:S,type:C}))}})},n.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,f=this.hls,h=this.media,w=this.mediaSource,m=i.fragments[0].start+i.totalduration,T=h.duration,A=Object(R.isFiniteNumber)(w.duration)?w.duration:0;i.live&&f.config.liveDurationInfinity?(c.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),w.duration=Infinity,this.updateSeekableRange(i)):(m>A&&m>T||!Object(R.isFiniteNumber)(T))&&(c.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),w.duration=m)},n.updateSeekableRange=function(i){var f=this.mediaSource,h=i.fragments,w=h.length;if(w&&i.live&&f!==null&&f!==void 0&&f.setLiveSeekableRange){var m=Math.max(0,h[0].start),T=Math.max(m,m+i.totalduration);f.setLiveSeekableRange(m,T)}},n.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,f=this.operationQueue,h=this.pendingTracks,w=Object.keys(h).length;if(w&&!i||w===2){this.createSourceBuffers(h),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(O.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(T){f.executeNext(T)})}},n.createSourceBuffers=function(i){var f=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var w=0;for(var m in i)if(!f[m]){var T=i[m];if(!T)throw Error("source buffer exists for track "+m+", however track does not");var A=T.levelCodec||T.codec,x=T.container+";codecs="+A;c.logger.log("[buffer-controller]: creating sourceBuffer("+x+")");try{var b=f[m]=h.addSourceBuffer(x),S=m;this.addBufferListener(S,"updatestart",this._onSBUpdateStart),this.addBufferListener(S,"updateend",this._onSBUpdateEnd),this.addBufferListener(S,"error",this._onSBUpdateError),this.tracks[m]={buffer:b,codec:A,container:T.container,levelCodec:T.levelCodec,id:T.id},w++}catch(C){c.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+C.message),this.hls.trigger(O.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:C,mimeType:x})}}w&&this.hls.trigger(O.Events.BUFFER_CREATED,{tracks:this.tracks})},n._onSBUpdateStart=function(i){var f=this.operationQueue,h=f.current(i);h.onStart()},n._onSBUpdateEnd=function(i){var f=this.operationQueue,h=f.current(i);h.onComplete(),f.shiftAndExecuteNext(i)},n._onSBUpdateError=function(i,f){c.logger.error("[buffer-controller]: "+i+" SourceBuffer error",f),this.hls.trigger(O.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(i);h&&h.onError(f)},n.removeExecutor=function(i,f,h){var w=this.media,m=this.mediaSource,T=this.operationQueue,A=this.sourceBuffer,x=A[i];if(!w||!m||!x){c.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(i);return}var b=Object(R.isFiniteNumber)(w.duration)?w.duration:Infinity,S=Object(R.isFiniteNumber)(m.duration)?m.duration:Infinity,C=Math.max(0,f),g=Math.min(h,b,S);g>C?(c.logger.log("[buffer-controller]: Removing ["+C+","+g+"] from the "+i+" SourceBuffer"),console.assert(!x.updating,i+" sourceBuffer must not be updating"),x.remove(C,g)):T.shiftAndExecuteNext(i)},n.appendExecutor=function(i,f){var h=this.operationQueue,w=this.sourceBuffer,m=w[f];if(!m){c.logger.warn("[buffer-controller]: Attempting to append to the "+f+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(f);return}m.ended=!1,console.assert(!m.updating,f+" sourceBuffer must not be updating"),m.appendBuffer(i)},n.blockBuffers=function(i,f){var h=this;if(f===void 0&&(f=this.getSourceBufferTypes()),!f.length){c.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var w=this.operationQueue,m=f.map(function(T){return w.appendBlocker(T)});Promise.all(m).then(function(){i(),f.forEach(function(T){var A=h.sourceBuffer[T];(!A||!A.updating)&&w.shiftAndExecuteNext(T)})})},n.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},n.addBufferListener=function(i,f,h){var w=this.sourceBuffer[i];if(!w)return;var m=h.bind(this,i);this.listeners[i].push({event:f,listener:m}),w.addEventListener(f,m)},n.removeBufferListeners=function(i){var f=this.sourceBuffer[i];if(!f)return;this.listeners[i].forEach(function(h){f.removeEventListener(h.event,h.listener)})},r}()},"./src/controller/buffer-operation-queue.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return O});var R=D("./src/utils/logger.ts"),O=function(){function c(y){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=y}var E=c.prototype;return E.append=function(p,u){var o=this.queues[u];o.push(p),o.length===1&&this.buffers[u]&&this.executeNext(u)},E.insertAbort=function(p,u){var o=this.queues[u];o.unshift(p),this.executeNext(u)},E.appendBlocker=function(p){var u,o=new Promise(function(s){u=s}),d={execute:u,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(d,p),o},E.executeNext=function(p){var u=this.buffers,o=this.queues,d=u[p],s=o[p];if(s.length){var l=s[0];try{l.execute()}catch(r){R.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),l.onError(r),(!d||!d.updating)&&(s.shift(),this.executeNext(p))}}},E.shiftAndExecuteNext=function(p){this.queues[p].shift(),this.executeNext(p)},E.current=function(p){return this.queues[p][0]},c}()},"./src/controller/cap-level-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts");function O(y,p){for(var u=0;u<p.length;u++){var o=p[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}function c(y,p,u){return p&&O(y.prototype,p),u&&O(y,u),y}var E=function(){function y(u){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=u,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var p=y.prototype;return p.setStreamController=function(o){this.streamController=o},p.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},p.registerListeners=function(){var o=this.hls;o.on(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},p.unregisterListener=function(){var o=this.hls;o.off(R.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),o.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(R.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},p.onFpsDropLevelCapping=function(o,d){y.isLevelAllowed(d.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(d.droppedLevel)},p.onMediaAttaching=function(o,d){this.media=d.media instanceof HTMLVideoElement?d.media:null},p.onManifestParsed=function(o,d){var s=this.hls;this.restrictedLevels=[],this.firstLevel=d.firstLevel,s.config.capLevelToPlayerSize&&d.video&&this.startCapping()},p.onBufferCodecs=function(o,d){var s=this.hls;s.config.capLevelToPlayerSize&&d.video&&this.startCapping()},p.onMediaDetaching=function(){this.stopCapping()},p.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var o=this.hls.levels;if(o.length){var d=this.hls;d.autoLevelCapping=this.getMaxLevel(o.length-1),d.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=d.autoLevelCapping}}},p.getMaxLevel=function(o){var d=this,s=this.hls.levels;if(!s.length)return-1;var l=s.filter(function(r,n){return y.isLevelAllowed(n,d.restrictedLevels)&&n<=o});return this.clientRect=null,y.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},p.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},p.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},p.getDimensions=function(){if(this.clientRect)return this.clientRect;var o=this.media,d={width:0,height:0};if(o){var s=o.getBoundingClientRect();d.width=s.width,d.height=s.height,!d.width&&!d.height&&(d.width=s.right-s.left||o.width||0,d.height=s.bottom-s.top||o.height||0)}return this.clientRect=d,d},y.isLevelAllowed=function(o,d){return d===void 0&&(d=[]),d.indexOf(o)===-1},y.getMaxLevelByMediaSize=function(o,d,s){if(!o||!o.length)return-1;for(var l=function(f,h){return h?f.width!==h.width||f.height!==h.height:!0},r=o.length-1,n=0;n<o.length;n+=1){var a=o[n];if((a.width>=d||a.height>=s)&&l(a,o[n+1])){r=n;break}}return r},c(y,[{key:"mediaWidth",get:function(){return this.getDimensions().width*y.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*y.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var o=1;try{o=self.devicePixelRatio}catch(d){}return o}}]),y}();k.default=E},"./src/controller/cmcd-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./src/events.ts"),O=D("./src/types/cmcd.ts"),c=D("./src/utils/buffer-helper.ts"),E=D("./src/utils/logger.ts");function y(r,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function p(r,n,a){return n&&y(r.prototype,n),a&&y(r,a),r}function u(r,n){var a=typeof Symbol!="undefined"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=o(r))||n&&r&&typeof r.length=="number"){a&&(r=a);var i=0;return function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(r,n){if(!r)return;if(typeof r=="string")return d(r,n);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return d(r,n)}function d(r,n){(n==null||n>r.length)&&(n=r.length);for(var a=0,i=new Array(n);a<n;a++)i[a]=r[a];return i}function s(){return s=Object.assign||function(r){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(r[i]=a[i])}return r},s.apply(this,arguments)}var l=function(){function r(a){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(w){try{i.apply(w,{ot:O.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(m){E.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(w){try{var m=w.frag,T=i.hls.levels[m.level],A=i.getObjectType(m),x={d:m.duration*1e3,ot:A};(A===O.CMCDObjectType.VIDEO||A===O.CMCDObjectType.AUDIO||A==O.CMCDObjectType.MUXED)&&(x.br=T.bitrate/1e3,x.tb=i.getTopBandwidth(A),x.bl=i.getBufferLength(A)),i.apply(w,x)}catch(b){E.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=a;var f=this.config=a.config,h=f.cmcd;h!=null&&(f.pLoader=this.createPlaylistLoader(),f.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||r.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var n=r.prototype;return n.registerListeners=function(){var i=this.hls;i.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this)},n.unregisterListeners=function(){var i=this.hls;i.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},n.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},n.onMediaAttached=function(i,f){this.media=f.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},n.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},n.onBufferCreated=function(i,f){var h,w;this.audioBuffer=(h=f.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(w=f.tracks.video)===null||w===void 0?void 0:w.buffer},n.createData=function(){var i;return{v:O.CMCDVersion,sf:O.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},n.apply=function(i,f){f===void 0&&(f={}),s(f,this.createData());var h=f.ot===O.CMCDObjectType.INIT||f.ot===O.CMCDObjectType.VIDEO||f.ot===O.CMCDObjectType.MUXED;if(this.starved&&h&&(f.bs=!0,f.su=!0,this.starved=!1),f.su==null&&(f.su=this.buffering),this.useHeaders){var w=r.toHeaders(f);if(!Object.keys(w).length)return;i.headers||(i.headers={}),s(i.headers,w)}else{var m=r.toQuery(f);if(!m)return;i.url=r.appendQueryToUri(i.url,m)}},n.getObjectType=function(i){var f=i.type;return f==="subtitle"?O.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?O.CMCDObjectType.INIT:f==="audio"?O.CMCDObjectType.AUDIO:f==="main"?this.hls.audioTracks.length?O.CMCDObjectType.VIDEO:O.CMCDObjectType.MUXED:void 0},n.getTopBandwidth=function(i){for(var f=0,h=i===O.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,w=u(h),m;!(m=w()).done;){var T=m.value;T.bitrate>f&&(f=T.bitrate)}return f>0?f:NaN},n.getBufferLength=function(i){var f=this.hls.media,h=i===O.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!f)return NaN;var w=c.BufferHelper.bufferInfo(h,f.currentTime,this.config.maxBufferHole);return w.len*1e3},n.createPlaylistLoader=function(){var i=this.config.pLoader,f=this.applyPlaylistData,h=i||this.config.loader;return function(){function w(T){this.loader=void 0,this.loader=new h(T)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(A,x,b){f(A),this.loader.load(A,x,b)},p(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},n.createFragmentLoader=function(){var i=this.config.fLoader,f=this.applyFragmentData,h=i||this.config.loader;return function(){function w(T){this.loader=void 0,this.loader=new h(T)}var m=w.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(A,x,b){f(A),this.loader.load(A,x,b)},p(w,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),w}()},r.uuid=function(){var i=URL.createObjectURL(new Blob),f=i.toString();return URL.revokeObjectURL(i),f.substr(f.lastIndexOf("/")+1)},r.serialize=function(i){for(var f=[],h=function(H){return!Number.isNaN(H)&&H!=null&&H!==""&&H!==!1},w=function(H){return Math.round(H)},m=function(H){return w(H/100)*100},T=function(H){return encodeURIComponent(H)},A={br:w,d:w,bl:m,dl:m,mtp:m,nor:T,rtp:m,tb:w},x=Object.keys(i||{}).sort(),b=u(x),S;!(S=b()).done;){var C=S.value,g=i[C];if(!h(g))continue;if(C==="v"&&g===1)continue;if(C=="pr"&&g===1)continue;var M=A[C];M&&(g=M(g));var I=typeof g,P=void 0;C==="ot"||C==="sf"||C==="st"?P=C+"="+g:I==="boolean"?P=C:I==="number"?P=C+"="+g:P=C+"="+JSON.stringify(g),f.push(P)}return f.join(",")},r.toHeaders=function(i){for(var f=Object.keys(i),h={},w=["Object","Request","Session","Status"],m=[{},{},{},{}],T={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},A=0,x=f;A<x.length;A++){var b=x[A],S=T[b]!=null?T[b]:1;m[S][b]=i[b]}for(var C=0;C<m.length;C++){var g=r.serialize(m[C]);g&&(h["CMCD-"+w[C]]=g)}return h},r.toQuery=function(i){return"CMCD="+encodeURIComponent(r.serialize(i))},r.appendQueryToUri=function(i,f){if(!f)return i;var h=i.includes("?")?"&":"?";return""+i+h+f},r}()},"./src/controller/eme-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/errors.ts"),c=D("./src/utils/logger.ts"),E=D("./src/utils/mediakeys-helper.ts");function y(l,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,a.key,a)}}function p(l,r,n){return r&&y(l.prototype,r),n&&y(l,n),l}var u=3,o=function(r,n,a){var i={audioCapabilities:[],videoCapabilities:[]};return r.forEach(function(f){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+f+'"',robustness:a.audioRobustness||""})}),n.forEach(function(f){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+f+'"',robustness:a.videoRobustness||""})}),[i]},d=function(r,n,a,i){switch(r){case E.KeySystems.WIDEVINE:return o(n,a,i);default:throw new Error("Unknown key-system: "+r)}},s=function(){function l(n){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=n,this._config=n.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var r=l.prototype;return r.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},r._registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r._unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(R.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this)},r.getLicenseServerUrl=function(a){switch(a){case E.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+a+'"')},r._attemptKeySystemAccess=function(a,i,f){var h=this,w=d(a,i,f,this._drmSystemOptions);c.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(a,w);this.mediaKeysPromise=m.then(function(T){return h._onMediaKeySystemAccessObtained(a,T)}),m.catch(function(T){c.logger.error('Failed to obtain key-system "'+a+'" access:',T)})},r._onMediaKeySystemAccessObtained=function(a,i){var f=this;c.logger.log('Access for key-system "'+a+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:a};this._mediaKeysList.push(h);var w=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(m){return h.mediaKeys=m,c.logger.log('Media-keys created for key-system "'+a+'"'),f._onMediaKeysCreated(),m});return w.catch(function(m){c.logger.error("Failed to create media-keys:",m)}),w},r._onMediaKeysCreated=function(){var a=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),a._onNewMediaKeySession(i.mediaKeysSession))})},r._onNewMediaKeySession=function(a){var i=this;c.logger.log("New key-system session "+a.sessionId),a.addEventListener("message",function(f){i._onKeySessionMessage(a,f.message)},!1)},r._onKeySessionMessage=function(a,i){c.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(f){c.logger.log("Received license data (length: "+(f&&f.byteLength)+"), updating key-session"),a.update(f)})},r.onMediaEncrypted=function(a){var i=this;if(c.logger.log('Media is encrypted using "'+a.initDataType+'" init data type'),!this.mediaKeysPromise){c.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var f=function(w){if(!i._media)return;i._attemptSetMediaKeys(w),i._generateRequestWithPreferredKeySession(a.initDataType,a.initData)};this.mediaKeysPromise.then(f).catch(f)},r._attemptSetMediaKeys=function(a){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){c.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}c.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},r._generateRequestWithPreferredKeySession=function(a,i){var f=this,h=this._mediaKeysList[0];if(!h){c.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){c.logger.warn("Key-Session already initialized but requested again");return}var w=h.mediaKeysSession;if(!w){c.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){c.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}c.logger.log('Generating key-session request for "'+a+'" init data type'),h.mediaKeysSessionInitialized=!0,w.generateRequest(a,i).then(function(){c.logger.debug("Key-session generation succeeded")}).catch(function(m){c.logger.error("Error generating key-session request:",m),f.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},r._createLicenseXhr=function(a,i,f){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,a,i,f);var w=this._licenseXhrSetup;if(w)try{w.call(this.hls,h,a),w=void 0}catch(m){c.logger.error(m)}try{h.readyState||h.open("POST",a,!0),w&&w.call(this.hls,h,a)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return h},r._onLicenseRequestReadyStageChange=function(a,i,f,h){switch(a.readyState){case 4:if(a.status===200){this._requestLicenseFailureCount=0,c.logger.log("License request succeeded");var w=a.response,m=this._licenseResponseCallback;if(m)try{w=m.call(this.hls,a,i)}catch(A){c.logger.error(A)}h(w)}else{if(c.logger.error("License Request XHR failed ("+i+"). Status: "+a.status+" ("+a.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>u){this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=u-this._requestLicenseFailureCount+1;c.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(f,h)}break}},r._generateLicenseRequestChallenge=function(a,i){switch(a.mediaKeySystemDomain){case E.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+a.mediaKeySystemDomain)},r._requestLicense=function(a,i){c.logger.log("Requesting content license for key-system");var f=this._mediaKeysList[0];if(!f){c.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(f.mediaKeySystemDomain),w=this._createLicenseXhr(h,a,i);c.logger.log("Sending license request to URL: "+h);var m=this._generateLicenseRequestChallenge(f,a);w.send(m)}catch(T){c.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.KEY_SYSTEM_ERROR,details:O.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},r.onMediaAttached=function(a,i){if(!this._emeEnabled)return;var f=i.media;this._media=f,f.addEventListener("encrypted",this._onMediaEncrypted)},r.onMediaDetached=function(){var a=this._media,i=this._mediaKeysList;if(!a)return;a.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(f){if(f.mediaKeysSession)return f.mediaKeysSession.close().catch(function(){})})).then(function(){return a.setMediaKeys(null)}).catch(function(){})},r.onManifestParsed=function(a,i){if(!this._emeEnabled)return;var f=i.levels.map(function(w){return w.audioCodec}).filter(function(w){return!!w}),h=i.levels.map(function(w){return w.videoCodec}).filter(function(w){return!!w});this._attemptKeySystemAccess(E.KeySystems.WIDEVINE,f,h)},p(l,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),l}();k.default=s},"./src/controller/fps-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/logger.ts"),c=function(){function E(p){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=p,this.registerListeners()}var y=E.prototype;return y.setStreamController=function(u){this.streamController=u},y.registerListeners=function(){this.hls.on(R.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},y.unregisterListeners=function(){this.hls.off(R.Events.MEDIA_ATTACHING,this.onMediaAttaching)},y.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},y.onMediaAttaching=function(u,o){var d=this.hls.config;if(d.capLevelOnFPSDrop){var s=o.media instanceof self.HTMLVideoElement?o.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),d.fpsDroppedMonitoringPeriod)}},y.checkFPS=function(u,o,d){var s=performance.now();if(o){if(this.lastTime){var l=s-this.lastTime,r=d-this.lastDroppedFrames,n=o-this.lastDecodedFrames,a=1e3*r/l,i=this.hls;if(i.trigger(R.Events.FPS_DROP,{currentDropped:r,currentDecoded:n,totalDroppedFrames:d}),a>0&&r>i.config.fpsDroppedMonitoringThreshold*n){var f=i.currentLevel;O.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+f),f>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=f)&&(f=f-1,i.trigger(R.Events.FPS_DROP_LEVEL_CAPPING,{level:f,droppedLevel:i.currentLevel}),i.autoLevelCapping=f,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=d,this.lastDecodedFrames=o}},y.checkFPSInterval=function(){var u=this.media;if(u)if(this.isVideoPlaybackQualityAvailable){var o=u.getVideoPlaybackQuality();this.checkFPS(u,o.totalVideoFrames,o.droppedVideoFrames)}else this.checkFPS(u,u.webkitDecodedFrameCount,u.webkitDroppedFrameCount)},E}();k.default=c},"./src/controller/fragment-finders.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"findFragmentByPDT",function(){return c}),D.d(k,"findFragmentByPTS",function(){return E}),D.d(k,"fragmentWithinToleranceTest",function(){return y}),D.d(k,"pdtWithinToleranceTest",function(){return p}),D.d(k,"findFragWithCC",function(){return u});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/binary-search.ts");function c(o,d,s){if(d===null||!Array.isArray(o)||!o.length||!Object(R.isFiniteNumber)(d))return null;var l=o[0].programDateTime;if(d<(l||0))return null;var r=o[o.length-1].endProgramDateTime;if(d>=(r||0))return null;s=s||0;for(var n=0;n<o.length;++n){var a=o[n];if(p(d,s,a))return a}return null}function E(o,d,s,l){s===void 0&&(s=0),l===void 0&&(l=0);var r=null;if(o?r=d[o.sn-d[0].sn+1]||null:s===0&&d[0].start===0&&(r=d[0]),r&&y(s,l,r)===0)return r;var n=O.default.search(d,y.bind(null,s,l));return n||r}function y(o,d,s){o===void 0&&(o=0),d===void 0&&(d=0);var l=Math.min(d,s.duration+(s.deltaPTS?s.deltaPTS:0));return s.start+s.duration-l<=o?1:s.start-l>o&&s.start?-1:0}function p(o,d,s){var l=Math.min(d,s.duration+(s.deltaPTS?s.deltaPTS:0))*1e3,r=s.endProgramDateTime||0;return r-l>o}function u(o,d){return O.default.search(o,function(s){return s.cc<d?1:s.cc>d?-1:0})}},"./src/controller/fragment-tracker.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"FragmentState",function(){return c}),D.d(k,"FragmentTracker",function(){return E});var R=D("./src/events.ts"),O=D("./src/types/loader.ts"),c;(function(u){u.NOT_LOADED="NOT_LOADED",u.BACKTRACKED="BACKTRACKED",u.APPENDING="APPENDING",u.PARTIAL="PARTIAL",u.OK="OK"})(c||(c={}));var E=function(){function u(d){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=d,this._registerListeners()}var o=u.prototype;return o._registerListeners=function(){var s=this.hls;s.on(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this)},o._unregisterListeners=function(){var s=this.hls;s.off(R.Events.BUFFER_APPENDED,this.onBufferAppended,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this)},o.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},o.getAppendedFrag=function(s,l){if(l===O.PlaylistLevelType.MAIN){var r=this.activeFragment,n=this.activeParts;if(!r)return null;if(n)for(var a=n.length;a--;){var i=n[a],f=i?i.end:r.appendedPTS;if(i.start<=s&&f!==void 0&&s<=f)return a>9&&(this.activeParts=n.slice(a-9)),i}else if(r.start<=s&&r.appendedPTS!==void 0&&s<=r.appendedPTS)return r}return this.getBufferedFrag(s,l)},o.getBufferedFrag=function(s,l){for(var r=this.fragments,n=Object.keys(r),a=n.length;a--;){var i=r[n[a]];if((i==null?void 0:i.body.type)===l&&i.buffered){var f=i.body;if(f.start<=s&&s<=f.end)return f}}return null},o.detectEvictedFragments=function(s,l,r){var n=this;Object.keys(this.fragments).forEach(function(a){var i=n.fragments[a];if(!i)return;if(!i.buffered){i.body.type===r&&n.removeFragment(i.body);return}var f=i.range[s];if(!f)return;f.time.some(function(h){var w=!n.isTimeBuffered(h.startPTS,h.endPTS,l);return w&&n.removeFragment(i.body),w})})},o.detectPartialFragments=function(s){var l=this,r=this.timeRanges,n=s.frag,a=s.part;if(!r||n.sn==="initSegment")return;var i=p(n),f=this.fragments[i];if(!f)return;Object.keys(r).forEach(function(h){var w=n.elementaryStreams[h];if(!w)return;var m=r[h],T=a!==null||w.partial===!0;f.range[h]=l.getBufferedTimes(n,a,T,m)}),f.backtrack=f.loaded=null,Object.keys(f.range).length?f.buffered=!0:this.removeFragment(f.body)},o.fragBuffered=function(s){var l=p(s),r=this.fragments[l];r&&(r.backtrack=r.loaded=null,r.buffered=!0)},o.getBufferedTimes=function(s,l,r,n){for(var a={time:[],partial:r},i=l?l.start:s.start,f=l?l.end:s.end,h=s.minEndPTS||f,w=s.maxStartPTS||i,m=0;m<n.length;m++){var T=n.start(m)-this.bufferPadding,A=n.end(m)+this.bufferPadding;if(w>=T&&h<=A){a.time.push({startPTS:Math.max(i,n.start(m)),endPTS:Math.min(f,n.end(m))});break}else if(i<A&&f>T)a.partial=!0,a.time.push({startPTS:Math.max(i,n.start(m)),endPTS:Math.min(f,n.end(m))});else if(f<=T)break}return a},o.getPartialFragment=function(s){var l=null,r,n,a,i=0,f=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(w){var m=h[w];if(!m)return;y(m)&&(n=m.body.start-f,a=m.body.end+f,s>=n&&s<=a&&(r=Math.min(s-n,a-s),i<=r&&(l=m.body,i=r)))}),l},o.getState=function(s){var l=p(s),r=this.fragments[l];return r?r.buffered?y(r)?c.PARTIAL:c.OK:r.backtrack?c.BACKTRACKED:c.APPENDING:c.NOT_LOADED},o.backtrack=function(s,l){var r=p(s),n=this.fragments[r];if(!n||n.backtrack)return null;var a=n.backtrack=l||n.loaded;return n.loaded=null,a},o.getBacktrackData=function(s){var l=p(s),r=this.fragments[l];if(r){var n,a=r.backtrack;if(a!=null&&(n=a.payload)!==null&&n!==void 0&&n.byteLength)return a;this.removeFragment(s)}return null},o.isTimeBuffered=function(s,l,r){for(var n,a,i=0;i<r.length;i++){if(n=r.start(i)-this.bufferPadding,a=r.end(i)+this.bufferPadding,s>=n&&l<=a)return!0;if(l<=n)return!1}return!1},o.onFragLoaded=function(s,l){var r=l.frag,n=l.part;if(r.sn==="initSegment"||r.bitrateTest||n)return;var a=p(r);this.fragments[a]={body:r,loaded:l,backtrack:null,buffered:!1,range:Object.create(null)}},o.onBufferAppended=function(s,l){var r=this,n=l.frag,a=l.part,i=l.timeRanges;if(n.type===O.PlaylistLevelType.MAIN)if(this.activeFragment=n,a){var f=this.activeParts;f||(this.activeParts=f=[]),f.push(a)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(h){var w=i[h];if(r.detectEvictedFragments(h,w),!a)for(var m=0;m<w.length;m++)n.appendedPTS=Math.max(w.end(m),n.appendedPTS||0)})},o.onFragBuffered=function(s,l){this.detectPartialFragments(l)},o.hasFragment=function(s){var l=p(s);return!!this.fragments[l]},o.removeFragmentsInRange=function(s,l,r){var n=this;Object.keys(this.fragments).forEach(function(a){var i=n.fragments[a];if(!i)return;if(i.buffered){var f=i.body;f.type===r&&f.start<l&&f.end>s&&n.removeFragment(f)}})},o.removeFragment=function(s){var l=p(s);s.stats.loaded=0,s.clearElementaryStreamInfo(),delete this.fragments[l]},o.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},u}();function y(u){var o,d;return u.buffered&&(((o=u.range.video)===null||o===void 0?void 0:o.partial)||((d=u.range.audio)===null||d===void 0?void 0:d.partial))}function p(u){return u.type+"_"+u.level+"_"+u.urlId+"_"+u.sn}},"./src/controller/gap-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"STALL_MINIMUM_DURATION_MS",function(){return y}),D.d(k,"MAX_START_GAP_JUMP",function(){return p}),D.d(k,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return u}),D.d(k,"SKIP_BUFFER_RANGE_START",function(){return o}),D.d(k,"default",function(){return d});var R=D("./src/utils/buffer-helper.ts"),O=D("./src/errors.ts"),c=D("./src/events.ts"),E=D("./src/utils/logger.ts"),y=250,p=2,u=.1,o=.05,d=function(){function s(r,n,a,i){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=r,this.media=n,this.fragmentTracker=a,this.hls=i}var l=s.prototype;return l.destroy=function(){this.hls=this.fragmentTracker=this.media=null},l.poll=function(n){var a=this.config,i=this.media,f=this.stalled,h=i.currentTime,w=i.seeking,m=this.seeking&&!w,T=!this.seeking&&w;if(this.seeking=w,h!==n){if(this.moved=!0,f!==null){if(this.stallReported){var A=self.performance.now()-f;E.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||m)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!R.BufferHelper.getBuffered(i).length)return;var x=R.BufferHelper.bufferInfo(i,h,0),b=x.len>0,S=x.nextStart||0;if(!b&&!S)return;if(w){var C=x.len>p,g=!S||S-h>p&&!this.fragmentTracker.getPartialFragment(h);if(C||g)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var M,I=Math.max(S,x.start||0)-h,P=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,B=P==null||((M=P.details)===null||M===void 0)?void 0:M.live,H=B?P.details.targetduration*2:p;if(I>0&&I<=H){this._trySkipBufferHole(null);return}}var F=self.performance.now();if(f===null){this.stalled=F;return}var W=F-f;!w&&W>=y&&this._reportStall(x.len);var U=R.BufferHelper.bufferInfo(i,h,a.maxBufferHole);this._tryFixBufferStall(U,W)},l._tryFixBufferStall=function(n,a){var i=this.config,f=this.fragmentTracker,h=this.media,w=h.currentTime,m=f.getPartialFragment(w);if(m){var T=this._trySkipBufferHole(m);if(T)return}n.len>i.maxBufferHole&&a>i.highBufferWatchdogPeriod*1e3&&(E.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},l._reportStall=function(n){var a=this.hls,i=this.media,f=this.stallReported;f||(this.stallReported=!0,E.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+n+")"),a.trigger(c.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:n}))},l._trySkipBufferHole=function(n){for(var a=this.config,i=this.hls,f=this.media,h=f.currentTime,w=0,m=R.BufferHelper.getBuffered(f),T=0;T<m.length;T++){var A=m.start(T);if(h+a.maxBufferHole>=w&&h<A){var x=Math.max(A+o,f.currentTime+u);return E.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+x),this.moved=!0,this.stalled=null,f.currentTime=x,n&&i.trigger(c.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+x,frag:n}),x}w=m.end(T)}return 0},l._tryNudgeBuffer=function(){var n=this.config,a=this.hls,i=this.media,f=i.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<n.nudgeMaxRetry){var w=f+h*n.nudgeOffset;E.logger.warn("Nudging 'currentTime' from "+f+" to "+w),i.currentTime=w,a.trigger(c.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else E.logger.error("Playhead still not moving while enough data buffered @"+f+" after "+n.nudgeMaxRetry+" nudges"),a.trigger(c.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},s}()},"./src/controller/id3-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/texttrack-utils.ts"),c=D("./src/demux/id3.ts"),E=.25,y=function(){function p(o){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=o,this._registerListeners()}var u=p.prototype;return u.destroy=function(){this._unregisterListeners()},u._registerListeners=function(){var d=this.hls;d.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.on(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u._unregisterListeners=function(){var d=this.hls;d.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),d.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),d.off(R.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),d.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},u.onMediaAttached=function(d,s){this.media=s.media},u.onMediaDetaching=function(){if(!this.id3Track)return;Object(O.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},u.getID3Track=function(d){if(!this.media)return;for(var s=0;s<d.length;s++){var l=d[s];if(l.kind==="metadata"&&l.label==="id3")return Object(O.sendAddTrackEvent)(l,this.media),l}return this.media.addTextTrack("metadata","id3")},u.onFragParsingMetadata=function(d,s){if(!this.media)return;var l=s.frag,r=s.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,a=0;a<r.length;a++){var i=c.getID3Frames(r[a].data);if(i){var f=r[a].pts,h=a<r.length-1?r[a+1].pts:l.end,w=h-f;w<=0&&(h=f+E);for(var m=0;m<i.length;m++){var T=i[m];if(!c.isTimeStampFrame(T)){var A=new n(f,h,"");A.value=T,this.id3Track.addCue(A)}}}}},u.onBufferFlushing=function(d,s){var l=s.startOffset,r=s.endOffset,n=s.type;if(!n||n==="audio"){var a=this.id3Track;a&&Object(O.removeCuesInRange)(a,l,r)}},p}();k.default=y},"./src/controller/latency-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return p});var R=D("./src/errors.ts"),O=D("./src/events.ts"),c=D("./src/utils/logger.ts");function E(u,o){for(var d=0;d<o.length;d++){var s=o[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function y(u,o,d){return o&&E(u.prototype,o),d&&E(u,d),u}var p=function(){function u(d){var s=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 s.timeupdate()},this.hls=d,this.config=d.config,this.registerListeners()}var o=u.prototype;return o.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},o.registerListeners=function(){this.hls.on(O.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(O.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){this.hls.off(O.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(O.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(O.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(O.Events.ERROR,this.onError)},o.onMediaAttached=function(s,l){this.media=l.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(s,l){var r=l.details;this.levelDetails=r,r.advanced&&this.timeupdate(),!r.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},o.onError=function(s,l){if(l.details!==R.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,c.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},o.timeupdate=function(){var s=this.media,l=this.levelDetails;if(!s||!l)return;this.currentTime=s.currentTime;var r=this.computeLatency();if(r===null)return;this._latency=r;var n=this.config,a=n.lowLatencyMode,i=n.maxLiveSyncPlaybackRate;if(!a||i===1)return;var f=this.targetLatency;if(f===null)return;var h=r-f,w=Math.min(this.maxLatency,f+l.targetduration),m=h<w;if(l.live&&m&&h>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,i)),A=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;s.playbackRate=Math.min(T,Math.max(1,A))}else s.playbackRate!==1&&s.playbackRate!==0&&(s.playbackRate=1)},o.estimateLiveEdge=function(){var s=this.levelDetails;return s===null?null:s.edge+s.age},o.computeLatency=function(){var s=this.estimateLiveEdge();return s===null?null:s-this.currentTime},y(u,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var s=this.config,l=this.levelDetails;return s.liveMaxLatencyDuration!==void 0?s.liveMaxLatencyDuration:l?s.liveMaxLatencyDurationCount*l.targetduration:0}},{key:"targetLatency",get:function(){var s=this.levelDetails;if(s===null)return null;var l=s.holdBack,r=s.partHoldBack,n=s.targetduration,a=this.config,i=a.liveSyncDuration,f=a.liveSyncDurationCount,h=a.lowLatencyMode,w=this.hls.userConfig,m=h&&r||l;(w.liveSyncDuration||w.liveSyncDurationCount||m===0)&&(m=i!==void 0?i:f*n);var T=n,A=1;return m+Math.min(this.stallCount*A,T)}},{key:"liveSyncPosition",get:function(){var s=this.estimateLiveEdge(),l=this.targetLatency,r=this.levelDetails;if(s===null||l===null||r===null)return null;var n=r.edge,a=s-l-this.edgeStalled,i=n-r.totalduration,f=n-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(i,a),f)}},{key:"drift",get:function(){var s=this.levelDetails;return s===null?1:s.drift}},{key:"edgeStalled",get:function(){var s=this.levelDetails;if(s===null)return 0;var l=(this.config.lowLatencyMode&&s.partTarget||s.targetduration)*3;return Math.max(s.age-l,0)}},{key:"forwardBufferLength",get:function(){var s=this.media,l=this.levelDetails;if(!s||!l)return 0;var r=s.buffered.length;return r?s.buffered.end(r-1):l.edge-this.currentTime}}]),u}()},"./src/controller/level-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return a});var R=D("./src/types/level.ts"),O=D("./src/events.ts"),c=D("./src/errors.ts"),E=D("./src/utils/codecs.ts"),y=D("./src/controller/level-helper.ts"),p=D("./src/controller/base-playlist-controller.ts"),u=D("./src/types/loader.ts");function o(){return o=Object.assign||function(i){for(var f=1;f<arguments.length;f++){var h=arguments[f];for(var w in h)Object.prototype.hasOwnProperty.call(h,w)&&(i[w]=h[w])}return i},o.apply(this,arguments)}function d(i,f){for(var h=0;h<f.length;h++){var w=f[h];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(i,w.key,w)}}function s(i,f,h){return f&&d(i.prototype,f),h&&d(i,h),i}function l(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,r(i,f)}function r(i,f){return r=Object.setPrototypeOf||function(w,m){return w.__proto__=m,w},r(i,f)}var n=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),a=function(i){l(f,i);function f(w){var m;return m=i.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 h=f.prototype;return h._registerListeners=function(){var m=this.hls;m.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(O.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var m=this.hls;m.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(O.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(O.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(O.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},h.startLoad=function(){var m=this._levels;m.forEach(function(T){T.loadError=0}),i.prototype.startLoad.call(this)},h.onManifestLoaded=function(m,T){var A=[],x=[],b=[],S,C={},g,M=!1,I=!1,P=!1;if(T.levels.forEach(function(W){var U=W.attrs;M=M||!!(W.width&&W.height),I=I||!!W.videoCodec,P=P||!!W.audioCodec,n&&W.audioCodec&&W.audioCodec.indexOf("mp4a.40.34")!==-1&&(W.audioCodec=void 0);var K=W.bitrate+"-"+W.attrs.RESOLUTION+"-"+W.attrs.CODECS;g=C[K],g?g.url.push(W.url):(g=new R.Level(W),C[K]=g,A.push(g)),U&&(U.AUDIO&&Object(y.addGroupId)(g,"audio",U.AUDIO),U.SUBTITLES&&Object(y.addGroupId)(g,"text",U.SUBTITLES))}),(M||I)&&P&&(A=A.filter(function(W){var U=W.videoCodec,K=W.width,G=W.height;return!!U||!!(K&&G)})),A=A.filter(function(W){var U=W.audioCodec,K=W.videoCodec;return(!U||Object(E.isCodecSupportedInMp4)(U,"audio"))&&(!K||Object(E.isCodecSupportedInMp4)(K,"video"))}),T.audioTracks&&(x=T.audioTracks.filter(function(W){return!W.audioCodec||Object(E.isCodecSupportedInMp4)(W.audioCodec,"audio")}),Object(y.assignTrackIdsByGroup)(x)),T.subtitles&&(b=T.subtitles,Object(y.assignTrackIdsByGroup)(b)),A.length>0){S=A[0].bitrate,A.sort(function(W,U){return W.bitrate-U.bitrate}),this._levels=A;for(var B=0;B<A.length;B++)if(A[B].bitrate===S){this._firstLevel=B,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+S);break}var H=P&&!I,F={levels:A,audioTracks:x,subtitleTracks:b,firstLevel:this._firstLevel,stats:T.stats,audio:P,video:I,altAudio:!H&&x.some(function(W){return!!W.url})};this.hls.trigger(O.Events.MANIFEST_PARSED,F),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(O.Events.ERROR,{type:c.ErrorTypes.MEDIA_ERROR,details:c.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(m,T){if(i.prototype.onError.call(this,m,T),T.fatal)return;var A=T.context,x=this._levels[this.currentLevelIndex];if(A&&(A.type===u.PlaylistContextType.AUDIO_TRACK&&x.audioGroupIds&&A.groupId===x.audioGroupIds[x.urlId]||A.type===u.PlaylistContextType.SUBTITLE_TRACK&&x.textGroupIds&&A.groupId===x.textGroupIds[x.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,S=!0,C;switch(T.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:if(T.frag){var g=this._levels[T.frag.level];g?(g.fragmentError++,g.fragmentError>this.hls.config.fragLoadingMaxRetry&&(C=T.frag.level)):C=T.frag.level}break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(S=!1),C=A.level),b=!0;break;case c.ErrorDetails.REMUX_ALLOC_ERROR:C=T.level,b=!0;break}C!==void 0&&this.recoverLevel(T,C,b,S)},h.recoverLevel=function(m,T,A,x){var b=m.details,S=this._levels[T];if(S.loadError++,A){var C=this.retryLoadingOrFail(m);if(C)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(x){var g=S.url.length;if(g>1&&S.loadError<g)m.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var M=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==M&&this._levels[M].loadError===0&&(this.warn(b+": switch to "+M),m.levelRetry=!0,this.hls.nextAutoLevel=M)}}},h.redundantFailover=function(m){var T=this._levels[m],A=T.url.length;if(A>1){var x=(T.urlId+1)%A;this.warn("Switching to redundant URL-id "+x),this._levels.forEach(function(b){b.urlId=x}),this.level=m}},h.onFragLoaded=function(m,T){var A=T.frag;if(A!==void 0&&A.type===u.PlaylistLevelType.MAIN){var x=this._levels[A.level];x!==void 0&&(x.fragmentError=0,x.loadError=0)}},h.onLevelLoaded=function(m,T){var A,x=T.level,b=T.details,S=this._levels[x];if(!S){var C;this.warn("Invalid level index "+x),(C=T.deliveryDirectives)!==null&&C!==void 0&&C.skip&&(b.deltaUpdateFailed=!0);return}x===this.currentLevelIndex?(S.fragmentError===0&&(S.loadError=0,this.retryCount=0),this.playlistLoaded(x,T,S.details)):(A=T.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(b.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(m,T){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var x=-1,b=this.hls.audioTracks[T.id].groupId,S=0;S<A.audioGroupIds.length;S++)if(A.audioGroupIds[S]===b){x=S;break}x!==A.urlId&&(A.urlId=x,this.startLoad())}},h.loadPlaylist=function(m){var T=this.currentLevelIndex,A=this._levels[T];if(this.canLoad&&A&&A.url.length>0){var x=A.urlId,b=A.url[x];if(m)try{b=m.addDirectives(b)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Attempt loading level index "+T+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+x+" "+b),this.clearTimer(),this.hls.trigger(O.Events.LEVEL_LOADING,{url:b,level:T,id:x,deliveryDirectives:m||null})}},h.removeLevel=function(m,T){var A=function(S,C){return C!==T},x=this._levels.filter(function(b,S){return S!==m?!0:b.url.length>1&&T!==void 0?(b.url=b.url.filter(A),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(A)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(A)),b.urlId=0,!0):!1}).map(function(b,S){var C=b.details;return C!=null&&C.fragments&&C.fragments.forEach(function(g){g.level=S}),b});this._levels=x,this.hls.trigger(O.Events.LEVELS_UPDATED,{levels:x})},s(f,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var T,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===m&&(T=A[m])!==null&&T!==void 0&&T.details)return;if(m<0||m>=A.length){var x=m<0;if(this.hls.trigger(O.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:x,reason:"invalid level idx"}),x)return;m=Math.min(m,A.length-1)}this.clearTimer();var b=this.currentLevelIndex,S=A[b],C=A[m];this.log("switching to level "+m+" from "+b),this.currentLevelIndex=m;var g=o({},C,{level:m,maxBitrate:C.maxBitrate,uri:C.uri,urlId:C.urlId});delete g._urlId,this.hls.trigger(O.Events.LEVEL_SWITCHING,g);var M=C.details;if(!M||M.live){var I=this.switchParams(C.uri,S==null?void 0:S.details);this.loadPlaylist(I)}}},{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)}}]),f}(p.default)},"./src/controller/level-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"addGroupId",function(){return c}),D.d(k,"assignTrackIdsByGroup",function(){return E}),D.d(k,"updatePTS",function(){return y}),D.d(k,"updateFragPTSDTS",function(){return u}),D.d(k,"mergeDetails",function(){return o}),D.d(k,"mapPartIntersection",function(){return d}),D.d(k,"mapFragmentIntersection",function(){return s}),D.d(k,"adjustSliding",function(){return l}),D.d(k,"addSliding",function(){return r}),D.d(k,"computeReloadInterval",function(){return n}),D.d(k,"getFragmentWithSN",function(){return a}),D.d(k,"getPartWith",function(){return i});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/logger.ts");function c(f,h,w){switch(h){case"audio":f.audioGroupIds||(f.audioGroupIds=[]),f.audioGroupIds.push(w);break;case"text":f.textGroupIds||(f.textGroupIds=[]),f.textGroupIds.push(w);break}}function E(f){var h={};f.forEach(function(w){var m=w.groupId||"";w.id=h[m]=h[m]||0,h[m]++})}function y(f,h,w){var m=f[h],T=f[w];p(m,T)}function p(f,h){var w=h.startPTS;if(Object(R.isFiniteNumber)(w)){var m=0,T;h.sn>f.sn?(m=w-f.start,T=f):(m=f.start-w,T=h),T.duration!==m&&(T.duration=m)}else if(h.sn>f.sn){var A=f.cc===h.cc;A&&f.minEndPTS?h.start=f.start+(f.minEndPTS-f.start):h.start=f.start+f.duration}else h.start=Math.max(f.start-h.duration,0)}function u(f,h,w,m,T,A){var x=m-w;x<=0&&(O.logger.warn("Fragment should have a positive duration",h),m=w+h.duration,A=T+h.duration);var b=w,S=m,C=h.startPTS,g=h.endPTS;if(Object(R.isFiniteNumber)(C)){var M=Math.abs(C-w);Object(R.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(M,h.deltaPTS):h.deltaPTS=M,b=Math.max(w,C),w=Math.min(w,C),T=Math.min(T,h.startDTS),S=Math.min(m,g),m=Math.max(m,g),A=Math.max(A,h.endDTS)}h.duration=m-w;var I=w-h.start;h.appendedPTS=m,h.start=h.startPTS=w,h.maxStartPTS=b,h.startDTS=T,h.endPTS=m,h.minEndPTS=S,h.endDTS=A;var P=h.sn;if(!f||P<f.startSN||P>f.endSN)return 0;var B,H=P-f.startSN,F=f.fragments;for(F[H]=h,B=H;B>0;B--)p(F[B],F[B-1]);for(B=H;B<F.length-1;B++)p(F[B],F[B+1]);return f.fragmentHint&&p(F[F.length-1],f.fragmentHint),f.PTSKnown=f.alignedSliding=!0,I}function o(f,h){for(var w=null,m=f.fragments,T=m.length-1;T>=0;T--){var A=m[T].initSegment;if(A){w=A;break}}f.fragmentHint&&delete f.fragmentHint.endPTS;var x=0,b;if(s(f,h,function(B,H){B.relurl&&(x=B.cc-H.cc),Object(R.isFiniteNumber)(B.startPTS)&&Object(R.isFiniteNumber)(B.endPTS)&&(H.start=H.startPTS=B.startPTS,H.startDTS=B.startDTS,H.appendedPTS=B.appendedPTS,H.maxStartPTS=B.maxStartPTS,H.endPTS=B.endPTS,H.endDTS=B.endDTS,H.minEndPTS=B.minEndPTS,H.duration=B.endPTS-B.startPTS,H.duration&&(b=H),h.PTSKnown=h.alignedSliding=!0),H.elementaryStreams=B.elementaryStreams,H.loader=B.loader,H.stats=B.stats,H.urlId=B.urlId,B.initSegment&&(H.initSegment=B.initSegment,w=B.initSegment)}),w){var S=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;S.forEach(function(B){var H;(!B.initSegment||B.initSegment.relurl===((H=w)===null||H===void 0?void 0:H.relurl))&&(B.initSegment=w)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(B){return!B}),h.deltaUpdateFailed)){O.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var C=h.skippedSegments;C--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var g=h.fragments;if(x){O.logger.warn("discontinuity sliding from playlist, take drift into account");for(var M=0;M<g.length;M++)g[M].cc+=x}h.skippedSegments&&(h.startCC=h.fragments[0].cc),d(f.partList,h.partList,function(B,H){H.elementaryStreams=B.elementaryStreams,H.stats=B.stats}),b?u(h,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):l(f,h),g.length&&(h.totalduration=h.edge-g[0].start),h.driftStartTime=f.driftStartTime,h.driftStart=f.driftStart;var I=h.advancedDateTime;if(h.advanced&&I){var P=h.edge;h.driftStart||(h.driftStartTime=I,h.driftStart=P),h.driftEndTime=I,h.driftEnd=P}else h.driftEndTime=f.driftEndTime,h.driftEnd=f.driftEnd,h.advancedDateTime=f.advancedDateTime}function d(f,h,w){if(f&&h)for(var m=0,T=0,A=f.length;T<=A;T++){var x=f[T],b=h[T+m];x&&b&&x.index===b.index&&x.fragment.sn===b.fragment.sn?w(x,b):m--}}function s(f,h,w){for(var m=h.skippedSegments,T=Math.max(f.startSN,h.startSN)-h.startSN,A=(f.fragmentHint?1:0)+(m?h.endSN:Math.min(f.endSN,h.endSN))-h.startSN,x=h.startSN-f.startSN,b=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,S=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,C=T;C<=A;C++){var g=S[x+C],M=b[C];m&&!M&&C<m&&(M=h.fragments[C]=g),g&&M&&w(g,M)}}function l(f,h){var w=h.startSN+h.skippedSegments-f.startSN,m=f.fragments;if(w<0||w>=m.length)return;r(h,m[w].start)}function r(f,h){if(h){for(var w=f.fragments,m=f.skippedSegments;m<w.length;m++)w[m].start+=h;f.fragmentHint&&(f.fragmentHint.start+=h)}}function n(f,h){var w=1e3*f.levelTargetDuration,m=w/2,T=f.age,A=T>0&&T<w*3,x=h.loading.end-h.loading.start,b,S=f.availabilityDelay;if(f.updated===!1)if(A){var C=333*f.misses;b=Math.max(Math.min(m,x*2),C),f.availabilityDelay=(f.availabilityDelay||0)+b}else b=m;else A?(S=Math.min(S||w/2,T),f.availabilityDelay=S,b=S+w-T):b=w-x;return Math.round(b)}function a(f,h,w){if(!f||!f.details)return null;var m=f.details,T=m.fragments[h-m.startSN];return T||(T=m.fragmentHint,T&&T.sn===h?T:h<m.startSN&&w&&w.sn===h?w:null)}function i(f,h,w){if(!f||!f.details)return null;var m=f.details.partList;if(m)for(var T=m.length;T--;){var A=m[T];if(A.index===w&&A.fragment.sn===h)return A}return null}},"./src/controller/stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return m});var R=D("./src/polyfills/number.ts"),O=D("./src/controller/base-stream-controller.ts"),c=D("./src/is-supported.ts"),E=D("./src/events.ts"),y=D("./src/utils/buffer-helper.ts"),p=D("./src/controller/fragment-tracker.ts"),u=D("./src/types/loader.ts"),o=D("./src/loader/fragment.ts"),d=D("./src/demux/transmuxer-interface.ts"),s=D("./src/types/transmuxer.ts"),l=D("./src/controller/gap-controller.ts"),r=D("./src/errors.ts"),n=D("./src/utils/logger.ts");function a(T,A){for(var x=0;x<A.length;x++){var b=A[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(T,b.key,b)}}function i(T,A,x){return A&&a(T.prototype,A),x&&a(T,x),T}function f(T,A){T.prototype=Object.create(A.prototype),T.prototype.constructor=T,h(T,A)}function h(T,A){return h=Object.setPrototypeOf||function(b,S){return b.__proto__=S,b},h(T,A)}var w=100,m=function(T){f(A,T);function A(b,S){var C;return C=T.call(this,b,S,"[stream-controller]")||this,C.audioCodecSwap=!1,C.gapController=null,C.level=-1,C._forceStartLoad=!1,C.altAudio=!1,C.audioOnly=!1,C.fragPlaying=null,C.onvplaying=null,C.onvseeked=null,C.fragLastKbps=0,C.stalled=!1,C.couldBacktrack=!1,C.audioCodecSwitch=!1,C.videoBuffer=null,C._registerListeners(),C}var x=A.prototype;return x._registerListeners=function(){var S=this.hls;S.on(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.on(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.on(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.on(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.on(E.Events.LEVEL_LOADING,this.onLevelLoading,this),S.on(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.on(E.Events.ERROR,this.onError,this),S.on(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.on(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(E.Events.BUFFER_CREATED,this.onBufferCreated,this),S.on(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.on(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.on(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var S=this.hls;S.off(E.Events.MEDIA_ATTACHED,this.onMediaAttached,this),S.off(E.Events.MEDIA_DETACHING,this.onMediaDetaching,this),S.off(E.Events.MANIFEST_LOADING,this.onManifestLoading,this),S.off(E.Events.MANIFEST_PARSED,this.onManifestParsed,this),S.off(E.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(E.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),S.off(E.Events.ERROR,this.onError,this),S.off(E.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),S.off(E.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(E.Events.BUFFER_CREATED,this.onBufferCreated,this),S.off(E.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),S.off(E.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),S.off(E.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},x.startLoad=function(S){if(this.levels){var C=this.lastCurrentTime,g=this.hls;if(this.stopLoad(),this.setInterval(w),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var M=g.startLevel;M===-1&&(g.config.testBandwidth?(M=0,this.bitrateTest=!0):M=g.nextAutoLevel),this.level=g.nextLoadLevel=M,this.loadedmetadata=!1}C>0&&S===-1&&(this.log("Override startPosition with lastCurrentTime @"+C.toFixed(3)),S=C),this.state=O.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=S,this.tick()}else this._forceStartLoad=!0,this.state=O.State.STOPPED},x.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},x.doTick=function(){switch(this.state){case O.State.IDLE:this.doTickIdle();break;case O.State.WAITING_LEVEL:{var S,C=this.levels,g=this.level,M=C==null||((S=C[g])===null||S===void 0)?void 0:S.details;if(M&&(!M.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(M))break;this.state=O.State.IDLE;break}break}case O.State.FRAG_LOADING_WAITING_RETRY:{var I,P=self.performance.now(),B=this.retryDate;(!B||P>=B||(I=this.media)!==null&&I!==void 0&&I.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=O.State.IDLE)}break;default:break}this.onTickEnd()},x.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},x.doTickIdle=function(){var S,C,g=this.hls,M=this.levelLastLoaded,I=this.levels,P=this.media,B=g.config,H=g.nextLoadLevel;if(M===null||!P&&(this.startFragRequested||!B.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!I||!I[H])return;var F=I[H];this.level=g.nextLoadLevel=H;var W=F.details;if(!W||this.state===O.State.WAITING_LEVEL||W.live&&this.levelLastLoaded!==H){this.state=O.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:P,u.PlaylistLevelType.MAIN);if(U===null)return;var K=U.len,G=this.getMaxBufferLength(F.maxBitrate);if(K>=G)return;if(this._streamEnded(U,W)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(E.Events.BUFFER_EOS,ee),this.state=O.State.ENDED;return}var de=U.end,ge=this.getNextFragment(de,W);if(this.couldBacktrack&&!this.fragPrevious&&ge&&ge.sn!=="initSegment"){var Be=ge.sn-W.startSN;Be>1&&(ge=W.fragments[Be-1],this.fragmentTracker.removeFragment(ge))}if(ge&&this.fragmentTracker.getState(ge)===p.FragmentState.OK&&this.nextLoadPosition>de){var Ue=this.audioOnly&&!this.altAudio?o.ElementaryStreamTypes.AUDIO:o.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(P,Ue,u.PlaylistLevelType.MAIN),ge=this.getNextFragment(this.nextLoadPosition,W)}if(!ge)return;ge.initSegment&&!ge.initSegment.data&&!this.bitrateTest&&(ge=ge.initSegment),((S=ge.decryptdata)===null||S===void 0?void 0:S.keyFormat)==="identity"&&!((C=ge.decryptdata)!==null&&C!==void 0&&C.key)?this.loadKey(ge,W):this.loadFragment(ge,W,de)},x.loadFragment=function(S,C,g){var M,I=this.fragmentTracker.getState(S);if(this.fragCurrent=S,I===p.FragmentState.BACKTRACKED){var P=this.fragmentTracker.getBacktrackData(S);if(P){this._handleFragmentLoadProgress(P),this._handleFragmentLoadComplete(P);return}else I=p.FragmentState.NOT_LOADED}I===p.FragmentState.NOT_LOADED||I===p.FragmentState.PARTIAL?S.sn==="initSegment"?this._loadInitSegment(S):this.bitrateTest?(S.bitrateTest=!0,this.log("Fragment "+S.sn+" of level "+S.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(S)):(this.startFragRequested=!0,T.prototype.loadFragment.call(this,S,C,g)):I===p.FragmentState.APPENDING?this.reduceMaxBufferLength(S.duration)&&this.fragmentTracker.removeFragment(S):((M=this.media)===null||M===void 0?void 0:M.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},x.getAppendedFrag=function(S){var C=this.fragmentTracker.getAppendedFrag(S,u.PlaylistLevelType.MAIN);return C&&"fragment"in C?C.fragment:C},x.getBufferedFrag=function(S){return this.fragmentTracker.getBufferedFrag(S,u.PlaylistLevelType.MAIN)},x.followingBufferedFrag=function(S){return S?this.getBufferedFrag(S.end+.5):null},x.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},x.nextLevelSwitch=function(){var S=this.levels,C=this.media;if(C!=null&&C.readyState){var g,M=this.getAppendedFrag(C.currentTime);if(M&&M.start>1&&this.flushMainBuffer(0,M.start-1),!C.paused&&S){var I=this.hls.nextLoadLevel,P=S[I],B=this.fragLastKbps;B&&this.fragCurrent?g=this.fragCurrent.duration*P.maxBitrate/(1e3*B)+1:g=0}else g=0;var H=this.getBufferedFrag(C.currentTime+g);if(H){var F=this.followingBufferedFrag(H);if(F){this.abortCurrentFrag();var W=F.maxStartPTS?F.maxStartPTS:F.start,U=F.duration,K=Math.max(H.end,W+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(K,Number.POSITIVE_INFINITY)}}}},x.abortCurrentFrag=function(){var S=this.fragCurrent;this.fragCurrent=null,S!=null&&S.loader&&S.loader.abort(),this.state===O.State.KEY_LOADING&&(this.state=O.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},x.flushMainBuffer=function(S,C){T.prototype.flushMainBuffer.call(this,S,C,this.altAudio?"video":null)},x.onMediaAttached=function(S,C){T.prototype.onMediaAttached.call(this,S,C);var g=C.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),g.addEventListener("playing",this.onvplaying),g.addEventListener("seeked",this.onvseeked),this.gapController=new l.default(this.config,g,this.fragmentTracker,this.hls)},x.onMediaDetaching=function(){var S=this.media;S&&(S.removeEventListener("playing",this.onvplaying),S.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),T.prototype.onMediaDetaching.call(this)},x.onMediaPlaying=function(){this.tick()},x.onMediaSeeked=function(){var S=this.media,C=S?S.currentTime:null;Object(R.isFiniteNumber)(C)&&this.log("Media seeked to "+C.toFixed(3)),this.tick()},x.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},x.onManifestParsed=function(S,C){var g=!1,M=!1,I;C.levels.forEach(function(P){I=P.audioCodec,I&&(I.indexOf("mp4a.40.2")!==-1&&(g=!0),I.indexOf("mp4a.40.5")!==-1&&(M=!0))}),this.audioCodecSwitch=g&&M&&!Object(c.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=C.levels,this.startFragRequested=!1},x.onLevelLoading=function(S,C){var g=this.levels;if(!g||this.state!==O.State.IDLE)return;var M=g[C.level];(!M.details||M.details.live&&this.levelLastLoaded!==C.level||this.waitForCdnTuneIn(M.details))&&(this.state=O.State.WAITING_LEVEL)},x.onLevelLoaded=function(S,C){var g,M=this.levels,I=C.level,P=C.details,B=P.totalduration;if(!M){this.warn("Levels were reset while loading level "+I);return}this.log("Level "+I+" loaded ["+P.startSN+","+P.endSN+"], cc ["+P.startCC+", "+P.endCC+"] duration:"+B);var H=this.fragCurrent;H&&(this.state===O.State.FRAG_LOADING||this.state===O.State.FRAG_LOADING_WAITING_RETRY)&&(H.level!==C.level&&H.loader&&(this.state=O.State.IDLE,H.loader.abort()));var F=M[I],W=0;if(P.live||(g=F.details)!==null&&g!==void 0&&g.live){if(P.fragments[0]||(P.deltaUpdateFailed=!0),P.deltaUpdateFailed)return;W=this.alignPlaylists(P,F.details)}if(F.details=P,this.levelLastLoaded=I,this.hls.trigger(E.Events.LEVEL_UPDATED,{details:P,level:I}),this.state===O.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(P))return;this.state=O.State.IDLE}this.startFragRequested?P.live&&this.synchronizeToLiveEdge(P):this.setStartPosition(P,W),this.tick()},x._handleFragmentLoadProgress=function(S){var C,g=S.frag,M=S.part,I=S.payload,P=this.levels;if(!P){this.warn("Levels were reset while fragment load was in progress. Fragment "+g.sn+" of level "+g.level+" will not be buffered");return}var B=P[g.level],H=B.details;if(!H){this.warn("Dropping fragment "+g.sn+" of level "+g.level+" after level details were reset");return}var F=B.videoCodec,W=H.PTSKnown||!H.live,U=(C=g.initSegment)===null||C===void 0?void 0:C.data,K=this._getAudioCodec(B),G=this.transmuxer=this.transmuxer||new d.default(this.hls,u.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=M?M.index:-1,de=ee!==-1,ge=new s.ChunkMetadata(g.level,g.sn,g.stats.chunkCount,I.byteLength,ee,de),Be=this.initPTS[g.cc];G.push(I,U,K,F,g,M,H.totalduration,W,ge,Be)},x.onAudioTrackSwitching=function(S,C){var g=this.altAudio,M=!!C.url,I=C.id;if(!M){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var 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 B=this.hls;g&&B.trigger(E.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),B.trigger(E.Events.AUDIO_TRACK_SWITCHED,{id:I})}},x.onAudioTrackSwitched=function(S,C){var g=C.id,M=!!this.hls.audioTracks[g].url;if(M){var I=this.videoBuffer;I&&this.mediaBuffer!==I&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=I)}this.altAudio=M,this.tick()},x.onBufferCreated=function(S,C){var g=C.tracks,M,I,P=!1;for(var B in g){var H=g[B];if(H.id==="main"){if(I=B,M=H,B==="video"){var F=g[B];F&&(this.videoBuffer=F.buffer)}}else P=!0}P&&M?(this.log("Alternate track found, use "+I+".buffered to schedule main fragment loading"),this.mediaBuffer=M.buffer):this.mediaBuffer=this.media},x.onFragBuffered=function(S,C){var g=C.frag,M=C.part;if(g&&g.type!==u.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(g)){this.warn("Fragment "+g.sn+(M?" p: "+M.index:"")+" of level "+g.level+" finished buffering, but was aborted. state: "+this.state),this.state===O.State.PARSED&&(this.state=O.State.IDLE);return}var I=M?M.stats:g.stats;this.fragLastKbps=Math.round(8*I.total/(I.buffering.end-I.loading.first)),g.sn!=="initSegment"&&(this.fragPrevious=g),this.fragBufferedComplete(g,M)},x.onError=function(S,C){switch(C.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(u.PlaylistLevelType.MAIN,C);break;case r.ErrorDetails.LEVEL_LOAD_ERROR:case r.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==O.State.ERROR&&(C.fatal?(this.warn(""+C.details),this.state=O.State.ERROR):!C.levelRetry&&this.state===O.State.WAITING_LEVEL&&(this.state=O.State.IDLE));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(C.parent==="main"&&(this.state===O.State.PARSING||this.state===O.State.PARSED)){var g=!0,M=this.getFwdBufferInfo(this.media,u.PlaylistLevelType.MAIN);M&&M.len>.5&&(g=!this.reduceMaxBufferLength(M.len)),g&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},x.checkBuffer=function(){var S=this.media,C=this.gapController;if(!S||!C||!S.readyState)return;var g=y.BufferHelper.getBuffered(S);!this.loadedmetadata&&g.length?(this.loadedmetadata=!0,this.seekToStartPos()):C.poll(this.lastCurrentTime),this.lastCurrentTime=S.currentTime},x.onFragLoadEmergencyAborted=function(){this.state=O.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},x.onBufferFlushed=function(S,C){var g=C.type;if(g!==o.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var M=(g===o.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(M,g,u.PlaylistLevelType.MAIN)}},x.onLevelsUpdated=function(S,C){this.levels=C.levels},x.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},x.seekToStartPos=function(){var S=this.media,C=S.currentTime,g=this.startPosition;if(g>=0&&C<g){if(S.seeking){n.logger.log("could not seek to "+g+", already seeking at "+C);return}var M=y.BufferHelper.getBuffered(S),I=M.length?M.start(0):0,P=I-g;P>0&&(P<this.config.maxBufferHole||P<this.config.maxFragLookUpTolerance)&&(n.logger.log("adjusting start position by "+P+" to match buffer start"),g+=P,this.startPosition=g),this.log("seek to target start position "+g+" from current time "+C),S.currentTime=g}},x._getAudioCodec=function(S){var C=this.config.defaultAudioCodec||S.audioCodec;return this.audioCodecSwap&&C&&(this.log("Swapping audio codec"),C.indexOf("mp4a.40.5")!==-1?C="mp4a.40.2":C="mp4a.40.5"),C},x._loadBitrateTestFrag=function(S){var C=this;this._doFragLoad(S).then(function(g){var M=C.hls;if(!g||M.nextLoadLevel||C.fragContextChanged(S))return;C.fragLoadError=0,C.state=O.State.IDLE,C.startFragRequested=!1,C.bitrateTest=!1;var I=S.stats;I.parsing.start=I.parsing.end=I.buffering.start=I.buffering.end=self.performance.now(),M.trigger(E.Events.FRAG_LOADED,g)})},x._handleTransmuxComplete=function(S){var C,g="main",M=this.hls,I=S.remuxResult,P=S.chunkMeta,B=this.getCurrentContext(P);if(!B){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 H=B.frag,F=B.part,W=B.level,U=I.video,K=I.text,G=I.id3,ee=I.initSegment,de=this.altAudio?void 0:I.audio;if(this.fragContextChanged(H))return;if(this.state=O.State.PARSING,ee){ee.tracks&&(this._bufferInitSegment(W,ee.tracks,H,P),M.trigger(E.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:g,tracks:ee.tracks}));var ge=ee.initPTS,Be=ee.timescale;Object(R.isFiniteNumber)(ge)&&(this.initPTS[H.cc]=ge,M.trigger(E.Events.INIT_PTS_FOUND,{frag:H,id:g,initPTS:ge,timescale:Be}))}if(U&&I.independent!==!1){if(W.details){var Ue=U.startPTS,Le=U.endPTS,Me=U.startDTS,Pe=U.endDTS;if(F)F.elementaryStreams[U.type]={startPTS:Ue,endPTS:Le,startDTS:Me,endDTS:Pe};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<Ue){this.backtrack(H);return}H.setElementaryStreamInfo(U.type,H.start,Le,H.start,Pe,!0)}H.setElementaryStreamInfo(U.type,Ue,Le,Me,Pe),this.bufferFragmentData(U,H,F,P)}}else if(I.independent===!1){this.backtrack(H);return}if(de){var ke=de.startPTS,te=de.endPTS,pe=de.startDTS,ae=de.endDTS;F&&(F.elementaryStreams[o.ElementaryStreamTypes.AUDIO]={startPTS:ke,endPTS:te,startDTS:pe,endDTS:ae}),H.setElementaryStreamInfo(o.ElementaryStreamTypes.AUDIO,ke,te,pe,ae),this.bufferFragmentData(de,H,F,P)}if(G!=null&&(C=G.samples)!==null&&C!==void 0&&C.length){var _e={frag:H,id:g,samples:G.samples};M.trigger(E.Events.FRAG_PARSING_METADATA,_e)}if(K){var Ie={frag:H,id:g,samples:K.samples};M.trigger(E.Events.FRAG_PARSING_USERDATA,Ie)}},x._bufferInitSegment=function(S,C,g,M){var I=this;if(this.state!==O.State.PARSING)return;this.audioOnly=!!C.audio&&!C.video,this.altAudio&&!this.audioOnly&&delete C.audio;var P=C.audio,B=C.video,H=C.audiovideo;if(P){var F=S.audioCodec,W=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(F&&(F.indexOf("mp4a.40.5")!==-1?F="mp4a.40.2":F="mp4a.40.5"),P.metadata.channelCount!==1&&W.indexOf("firefox")===-1&&(F="mp4a.40.5")),W.indexOf("android")!==-1&&P.container!=="audio/mpeg"&&(F="mp4a.40.2",this.log("Android: force audio codec to "+F)),S.audioCodec&&S.audioCodec!==F&&this.log('Swapping manifest audio codec "'+S.audioCodec+'" for "'+F+'"'),P.levelCodec=F,P.id="main",this.log("Init audio buffer, container:"+P.container+", codecs[selected/level/parsed]=["+(F||"")+"/"+(S.audioCodec||"")+"/"+P.codec+"]")}B&&(B.levelCodec=S.videoCodec,B.id="main",this.log("Init video buffer, container:"+B.container+", codecs[level/parsed]=["+(S.videoCodec||"")+"/"+B.codec+"]")),H&&this.log("Init audiovideo buffer, container:"+H.container+", codecs[level/parsed]=["+(S.attrs.CODECS||"")+"/"+H.codec+"]"),this.hls.trigger(E.Events.BUFFER_CODECS,C),Object.keys(C).forEach(function(U){var K=C[U],G=K.initSegment;G!=null&&G.byteLength&&I.hls.trigger(E.Events.BUFFER_APPENDING,{type:U,data:G,frag:g,part:null,chunkMeta:M,parent:g.type})}),this.tick()},x.backtrack=function(S){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(S);var C=this.fragmentTracker.backtrack(S);this.fragPrevious=null,this.nextLoadPosition=S.start,C?this.resetFragmentLoading(S):this.state=O.State.BACKTRACKING},x.checkFragmentChanged=function(){var S=this.media,C=null;if(S&&S.readyState>1&&S.seeking===!1){var g=S.currentTime;if(y.BufferHelper.isBuffered(S,g)?C=this.getAppendedFrag(g):y.BufferHelper.isBuffered(S,g+.1)&&(C=this.getAppendedFrag(g+.1)),C){var M=this.fragPlaying,I=C.level;(!M||C.sn!==M.sn||M.level!==I||C.urlId!==M.urlId)&&(this.hls.trigger(E.Events.FRAG_CHANGED,{frag:C}),(!M||M.level!==I)&&this.hls.trigger(E.Events.LEVEL_SWITCHED,{level:I}),this.fragPlaying=C)}}},i(A,[{key:"nextLevel",get:function(){var S=this.nextBufferedFrag;return S?S.level:-1}},{key:"currentLevel",get:function(){var S=this.media;if(S){var C=this.getAppendedFrag(S.currentTime);if(C)return C.level}return-1}},{key:"nextBufferedFrag",get:function(){var S=this.media;if(S){var C=this.getAppendedFrag(S.currentTime);return this.followingBufferedFrag(C)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(O.default)},"./src/controller/subtitle-stream-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"SubtitleStreamController",function(){return f});var R=D("./src/events.ts"),O=D("./src/utils/logger.ts"),c=D("./src/utils/buffer-helper.ts"),E=D("./src/controller/fragment-finders.ts"),y=D("./src/utils/discontinuities.ts"),p=D("./src/controller/level-helper.ts"),u=D("./src/controller/fragment-tracker.ts"),o=D("./src/controller/base-stream-controller.ts"),d=D("./src/types/loader.ts"),s=D("./src/types/level.ts");function l(h,w){for(var m=0;m<w.length;m++){var T=w[m];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(h,T.key,T)}}function r(h,w,m){return w&&l(h.prototype,w),m&&l(h,m),h}function n(h,w){h.prototype=Object.create(w.prototype),h.prototype.constructor=h,a(h,w)}function a(h,w){return a=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},a(h,w)}var i=500,f=function(h){n(w,h);function w(T,A){var x;return x=h.call(this,T,A,"[subtitle-stream-controller]")||this,x.levels=[],x.currentTrackId=-1,x.tracksBuffered=[],x.mainDetails=null,x._registerListeners(),x}var m=w.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var A=this.hls;A.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(R.Events.ERROR,this.onError,this),A.on(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var A=this.hls;A.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(R.Events.ERROR,this.onError,this),A.off(R.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(R.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(R.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(R.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=o.State.IDLE,this.setInterval(i),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(A,x){this.mainDetails=x.details},m.onSubtitleFragProcessed=function(A,x){var b=x.frag,S=x.success;if(this.fragPrevious=b,this.state=o.State.IDLE,!S)return;var C=this.tracksBuffered[this.currentTrackId];if(!C)return;for(var g,M=b.start,I=0;I<C.length;I++)if(M>=C[I].start&&M<=C[I].end){g=C[I];break}var P=b.start+b.duration;g?g.end=P:(g={start:M,end:P},C.push(g)),this.fragmentTracker.fragBuffered(b)},m.onBufferFlushing=function(A,x){var b=x.startOffset,S=x.endOffset;if(b===0&&S!==Number.POSITIVE_INFINITY){var C=this.currentTrackId,g=this.levels;if(!g.length||!g[C]||!g[C].details)return;var M=g[C].details,I=M.targetduration,P=S-I;if(P<=0)return;x.endOffsetSubtitles=Math.max(0,P),this.tracksBuffered.forEach(function(B){for(var H=0;H<B.length;){if(B[H].end<=P){B.shift();continue}else if(B[H].start<P)B[H].start=P;else break;H++}}),this.fragmentTracker.removeFragmentsInRange(b,P,d.PlaylistLevelType.SUBTITLE)}},m.onError=function(A,x){var b,S=x.frag;if(!S||S.type!==d.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=o.State.IDLE},m.onSubtitleTracksUpdated=function(A,x){var b=this,S=x.subtitleTracks;this.tracksBuffered=[],this.levels=S.map(function(C){return new s.Level(C)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(C){b.tracksBuffered[C.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(A,x){if(this.currentTrackId=x.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(i)},m.onSubtitleTrackLoaded=function(A,x){var b,S=x.details,C=x.id,g=this.currentTrackId,M=this.levels;if(!M.length)return;var I=M[g];if(C>=M.length||C!==g||!I)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,S.live||(b=I.details)!==null&&b!==void 0&&b.live){var P=this.mainDetails;if(S.deltaUpdateFailed||!P)return;var B=P.fragments[0];if(!I.details)S.hasProgramDateTime&&P.hasProgramDateTime?Object(y.alignMediaPlaylistByPDT)(S,P):B&&Object(p.addSliding)(S,B.start);else{var H=this.alignPlaylists(S,I.details);H===0&&B&&Object(p.addSliding)(S,B.start)}}if(I.details=S,this.levelLastLoaded=C,this.tick(),S.live&&!this.fragCurrent&&this.media&&this.state===o.State.IDLE){var F=Object(E.findFragmentByPTS)(null,S.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),I.details=void 0)}},m._handleFragmentLoadComplete=function(A){var x=A.frag,b=A.payload,S=x.decryptdata,C=this.hls;if(this.fragContextChanged(x))return;if(b&&b.byteLength>0&&S&&S.key&&S.iv&&S.method==="AES-128"){var g=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),S.key.buffer,S.iv.buffer).then(function(M){var I=performance.now();C.trigger(R.Events.FRAG_DECRYPTED,{frag:x,payload:M,stats:{tstart:g,tdecrypt:I}})})}},m.doTick=function(){if(!this.media){this.state=o.State.IDLE;return}if(this.state===o.State.IDLE){var A,x=this.currentTrackId,b=this.levels;if(!b.length||!b[x]||!b[x].details)return;var S=b[x].details,C=S.targetduration,g=this.config,M=this.media,I=c.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,M.currentTime-C,g.maxBufferHole),P=I.end,B=I.len,H=this.getMaxBufferLength()+C;if(B>H)return;console.assert(S,"Subtitle track details are defined on idle subtitle stream controller tick");var F=S.fragments,W=F.length,U=S.edge,K,G=this.fragPrevious;if(P<U){var ee=g.maxFragLookUpTolerance;G&&S.hasProgramDateTime&&(K=Object(E.findFragmentByPDT)(F,G.endProgramDateTime,ee)),K||(K=Object(E.findFragmentByPTS)(G,F,P,ee),!K&&G&&G.start<F[0].start&&(K=F[0]))}else K=F[W-1];(A=K)!==null&&A!==void 0&&A.encrypted?(O.logger.log("Loading key for "+K.sn),this.state=o.State.KEY_LOADING,this.hls.trigger(R.Events.KEY_LOADING,{frag:K})):K&&this.fragmentTracker.getState(K)===u.FragmentState.NOT_LOADED&&this.loadFragment(K,S,P)}},m.loadFragment=function(A,x,b){this.fragCurrent=A,h.prototype.loadFragment.call(this,A,x,b)},r(w,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),w}(o.default)},"./src/controller/subtitle-track-controller.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/events.ts"),O=D("./src/utils/texttrack-utils.ts"),c=D("./src/controller/base-playlist-controller.ts"),E=D("./src/types/loader.ts");function y(l,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(l,a.key,a)}}function p(l,r,n){return r&&y(l.prototype,r),n&&y(l,n),l}function u(l,r){l.prototype=Object.create(r.prototype),l.prototype.constructor=l,o(l,r)}function o(l,r){return o=Object.setPrototypeOf||function(a,i){return a.__proto__=i,a},o(l,r)}var d=function(l){u(r,l);function r(a){var i;return i=l.call(this,a,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var n=r.prototype;return n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},n.registerListeners=function(){var i=this.hls;i.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(R.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(R.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var i=this.hls;i.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(R.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(R.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(R.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(R.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(R.Events.ERROR,this.onError,this)},n.onMediaAttached=function(i,f){if(this.media=f.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)},n.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},n.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var i=s(this.media.textTracks);i.forEach(function(f){Object(O.clearCurrentCues)(f)}),this.subtitleTrack=-1,this.media=null},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},n.onManifestParsed=function(i,f){this.tracks=f.subtitleTracks},n.onSubtitleTrackLoaded=function(i,f){var h=f.id,w=f.details,m=this.trackId,T=this.tracksInGroup[m];if(!T){this.warn("Invalid subtitle track id "+h);return}var A=T.details;T.details=f.details,this.log("subtitle track "+h+" loaded ["+w.startSN+"-"+w.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,f,A))},n.onLevelLoading=function(i,f){this.switchLevel(f.level)},n.onLevelSwitching=function(i,f){this.switchLevel(f.level)},n.switchLevel=function(i){var f=this.hls.levels[i];if(!(f!=null&&f.textGroupIds))return;var h=f.textGroupIds[f.urlId];if(this.groupId!==h){var w=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(x){return!h||x.groupId===h});this.tracksInGroup=m;var T=this.findTrackId(w==null?void 0:w.name)||this.findTrackId();this.groupId=h;var A={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(R.Events.SUBTITLE_TRACKS_UPDATED,A),T!==-1&&this.setSubtitleTrack(T,w)}},n.findTrackId=function(i){for(var f=this.tracksInGroup,h=0;h<f.length;h++){var w=f[h];if((!this.selectDefaultTrack||w.default)&&(!i||i===w.name))return w.id}return-1},n.onError=function(i,f){if(l.prototype.onError.call(this,i,f),f.fatal||!f.context)return;f.context.type===E.PlaylistContextType.SUBTITLE_TRACK&&f.context.id===this.trackId&&f.context.groupId===this.groupId&&this.retryLoadingOrFail(f)},n.loadPlaylist=function(i){var f=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(f)){var h=f.id,w=f.groupId,m=f.url;if(i)try{m=i.addDirectives(m)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(R.Events.SUBTITLE_TRACK_LOADING,{url:m,id:h,groupId:w,deliveryDirectives:i||null})}},n.toggleTrackModes=function(i){var f=this,h=this.media,w=this.subtitleDisplay,m=this.trackId;if(!h)return;var T=s(h.textTracks),A=T.filter(function(S){return S.groupId===f.groupId});if(i===-1)[].slice.call(T).forEach(function(S){S.mode="disabled"});else{var x=A[m];x&&(x.mode="disabled")}var b=A[i];b&&(b.mode=w?"showing":"hidden")},n.setSubtitleTrack=function(i,f){var h,w=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(h=w[i])!==null&&h!==void 0&&h.details)||i<-1||i>=w.length)return;this.clearTimer();var m=w[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,m){var T=m.id,A=m.groupId,x=A===void 0?"":A,b=m.name,S=m.type,C=m.url;this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:x,name:b,type:S,url:C});var g=this.switchParams(m.url,f==null?void 0:f.details);this.loadPlaylist(g)}else this.hls.trigger(R.Events.SUBTITLE_TRACK_SWITCH,{id:i})},n.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,f=s(this.media.textTracks),h=0;h<f.length;h++)if(f[h].mode==="hidden")i=h;else if(f[h].mode==="showing"){i=h;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},p(r,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var f=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,f)}}]),r}(c.default);function s(l){for(var r=[],n=0;n<l.length;n++){var a=l[n];a.kind==="subtitles"&&a.label&&r.push(l[n])}return r}k.default=d},"./src/controller/timeline-controller.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"TimelineController",function(){return s});var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),c=D("./src/utils/cea-608-parser.ts"),E=D("./src/utils/output-filter.ts"),y=D("./src/utils/webvtt-parser.ts"),p=D("./src/utils/texttrack-utils.ts"),u=D("./src/utils/imsc1-ttml-parser.ts"),o=D("./src/types/loader.ts"),d=D("./src/utils/logger.ts"),s=function(){function a(f){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=n(),this.captionsProperties=void 0,this.hls=f,this.config=f.config,this.Cues=f.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 h=new E.default(this,"textTrack1"),w=new E.default(this,"textTrack2"),m=new E.default(this,"textTrack3"),T=new E.default(this,"textTrack4");this.cea608Parser1=new c.default(1,h,w),this.cea608Parser2=new c.default(3,m,T)}f.on(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.on(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.on(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.on(O.Events.FRAG_LOADING,this.onFragLoading,this),f.on(O.Events.FRAG_LOADED,this.onFragLoaded,this),f.on(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.on(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.on(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.on(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.on(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=a.prototype;return i.destroy=function(){var h=this.hls;h.off(O.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(O.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(O.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(O.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(O.Events.FRAG_LOADING,this.onFragLoading,this),h.off(O.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(O.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(O.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(O.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(O.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(O.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(h,w,m,T,A){for(var x=!1,b=A.length;b--;){var S=A[b],C=r(S[0],S[1],w,m);if(C>=0&&(S[0]=Math.min(S[0],w),S[1]=Math.max(S[1],m),x=!0,C/(m-w)>.5))return}if(x||A.push([w,m]),this.config.renderTextTracksNatively){var g=this.captionsTracks[h];this.Cues.newCue(g,w,m,T)}else{var M=this.Cues.newCue(null,w,m,T);this.hls.trigger(O.Events.CUES_PARSED,{type:"captions",cues:M,track:h})}},i.onInitPtsFound=function(h,w){var m=this,T=w.frag,A=w.id,x=w.initPTS,b=w.timescale,S=this.unparsedVttFrags;A==="main"&&(this.initPTS[T.cc]=x,this.timescale[T.cc]=b),S.length&&(this.unparsedVttFrags=[],S.forEach(function(C){m.onFragLoaded(O.Events.FRAG_LOADED,C)}))},i.getExistingTrack=function(h){var w=this.media;if(w)for(var m=0;m<w.textTracks.length;m++){var T=w.textTracks[m];if(T[h])return T}return null},i.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},i.createNativeTrack=function(h){if(this.captionsTracks[h])return;var w=this.captionsProperties,m=this.captionsTracks,T=this.media,A=w[h],x=A.label,b=A.languageCode,S=this.getExistingTrack(h);if(S)m[h]=S,Object(p.clearCurrentCues)(m[h]),Object(p.sendAddTrackEvent)(m[h],T);else{var C=this.createTextTrack("captions",x,b);C&&(C[h]=!0,m[h]=C)}},i.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var w=this.captionsProperties[h];if(!w)return;var m=w.label,T={_id:h,label:m,kind:"captions",default:w.media?!!w.media.default:!1,closedCaptions:w.media};this.nonNativeCaptionsTracks[h]=T,this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},i.createTextTrack=function(h,w,m){var T=this.media;return T?T.addTextTrack(h,w,m):void 0},i.onMediaAttaching=function(h,w){this.media=w.media,this._cleanTracks()},i.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(w){Object(p.clearCurrentCues)(h[w]),delete h[w]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=n(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var h=this.media;if(!h)return;var w=h.textTracks;if(w)for(var m=0;m<w.length;m++)Object(p.clearCurrentCues)(w[m])},i.onSubtitleTracksUpdated=function(h,w){var m=this;this.textTracks=[];var T=w.subtitleTracks||[],A=T.some(function(C){return C.textCodec===u.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var x=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(C,g){var M;if(g<b.length){for(var I=null,P=0;P<b.length;P++)if(l(b[P],C)){I=b[P];break}I&&(M=I)}M?Object(p.clearCurrentCues)(M):(M=m.createTextTrack("subtitles",C.name,C.lang),M&&(M.mode="disabled")),M&&(M.groupId=C.groupId,m.textTracks.push(M))})}else if(!x&&this.tracks&&this.tracks.length){var S=this.tracks.map(function(C){return{label:C.name,kind:C.type.toLowerCase(),default:C.default,subtitleTrack:C}});this.hls.trigger(O.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:S})}}},i.onManifestLoaded=function(h,w){var m=this;this.config.enableCEA708Captions&&w.captions&&w.captions.forEach(function(T){var A=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!A)return;var x="textTrack"+A[1],b=m.captionsProperties[x];if(!b)return;b.label=T.name,T.lang&&(b.languageCode=T.lang),b.media=T})},i.onFragLoading=function(h,w){var m=this.cea608Parser1,T=this.cea608Parser2,A=this.lastSn,x=this.lastPartIndex;if(!this.enabled||!(m&&T))return;if(w.frag.type===o.PlaylistLevelType.MAIN){var b,S,C=w.frag.sn,g=(b=w==null||((S=w.part)===null||S===void 0)?void 0:S.index)!=null?b:-1;C===A+1||C===A&&g===x+1||(m.reset(),T.reset()),this.lastSn=C,this.lastPartIndex=g}},i.onFragLoaded=function(h,w){var m=w.frag,T=w.payload,A=this.initPTS,x=this.unparsedVttFrags;if(m.type===o.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(R.isFiniteNumber)(A[m.cc])){x.push(w),A.length&&this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var b=m.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var S=this.tracks[m.level],C=this.vttCCs;C[m.cc]||(C[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),S&&S.textCodec===u.IMSC1_CODEC?this._parseIMSC1(m,T):this._parseVTTs(m,T,C)}}else this.hls.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(h,w){var m=this,T=this.hls;Object(u.parseIMSC1)(w,this.initPTS[h.cc],this.timescale[h.cc],function(A){m._appendCues(A,h.level),T.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(A){d.logger.log("Failed to parse IMSC1: "+A),T.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:A})})},i._parseVTTs=function(h,w,m){var T=this,A=this.hls;Object(y.parseWebVTT)(w,this.initPTS[h.cc],this.timescale[h.cc],m,h.cc,h.start,function(x){T._appendCues(x,h.level),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(x){T._fallbackToIMSC1(h,w),d.logger.log("Failed to parse VTT cue: "+x),A.trigger(O.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:x})})},i._fallbackToIMSC1=function(h,w){var m=this,T=this.tracks[h.level];T.textCodec||Object(u.parseIMSC1)(w,this.initPTS[h.cc],this.timescale[h.cc],function(){T.textCodec=u.IMSC1_CODEC,m._parseIMSC1(h,w)},function(){T.textCodec="wvtt"})},i._appendCues=function(h,w){var m=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[w];if(T.mode==="disabled")return;h.forEach(function(b){return Object(p.addCueToTrack)(T,b)})}else{var A=this.tracks[w],x=A.default?"default":"subtitles"+w;m.trigger(O.Events.CUES_PARSED,{type:"subtitles",cues:h,track:x})}},i.onFragDecrypted=function(h,w){var m=w.frag;if(m.type===o.PlaylistLevelType.SUBTITLE){if(!Object(R.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(w);return}this.onFragLoaded(O.Events.FRAG_LOADED,w)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(h,w){var m=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(m&&T))return;for(var A=0;A<w.samples.length;A++){var x=w.samples[A].bytes;if(x){var b=this.extractCea608Data(x);m.addData(w.samples[A].pts,b[0]),T.addData(w.samples[A].pts,b[1])}}},i.onBufferFlushing=function(h,w){var m=w.startOffset,T=w.endOffset,A=w.endOffsetSubtitles,x=w.type,b=this.media;if(!b||b.currentTime<T)return;if(!x||x==="video"){var S=this.captionsTracks;Object.keys(S).forEach(function(g){return Object(p.removeCuesInRange)(S[g],m,T)})}if(this.config.renderTextTracksNatively&&(m===0&&A!==void 0)){var C=this.textTracks;Object.keys(C).forEach(function(g){return Object(p.removeCuesInRange)(C[g],m,A)})}},i.extractCea608Data=function(h){for(var w=h[0]&31,m=2,T=[[],[]],A=0;A<w;A++){var x=h[m++],b=127&h[m++],S=127&h[m++],C=(4&x)!==0,g=3&x;if(b===0&&S===0)continue;C&&((g===0||g===1)&&(T[g].push(b),T[g].push(S)))}return T},a}();function l(a,i){return a&&a.label===i.name&&!(a.textTrack1||a.textTrack2)}function r(a,i,f,h){return Math.min(i,h)-Math.max(a,f)}function n(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.subtle=void 0,this.aesIV=void 0,this.subtle=E,this.aesIV=y}var c=O.prototype;return c.decrypt=function(y,p){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},p,y)},O}()},"./src/crypt/aes-decryptor.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"removePadding",function(){return O}),D.d(k,"default",function(){return c});var R=D("./src/utils/typed-array.ts");function O(E){var y=E.byteLength,p=y&&new DataView(E.buffer).getUint8(y-1);return p?Object(R.sliceUint8)(E,0,y-p):E}var c=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 y=E.prototype;return y.uint8ArrayToUint32Array_=function(u){for(var o=new DataView(u),d=new Uint32Array(4),s=0;s<4;s++)d[s]=o.getUint32(s*4);return d},y.initTable=function(){var u=this.sBox,o=this.invSBox,d=this.subMix,s=d[0],l=d[1],r=d[2],n=d[3],a=this.invSubMix,i=a[0],f=a[1],h=a[2],w=a[3],m=new Uint32Array(256),T=0,A=0,x=0;for(x=0;x<256;x++)x<128?m[x]=x<<1:m[x]=x<<1^283;for(x=0;x<256;x++){var b=A^A<<1^A<<2^A<<3^A<<4;b=b>>>8^b&255^99,u[T]=b,o[b]=T;var S=m[T],C=m[S],g=m[C],M=m[b]*257^b*16843008;s[T]=M<<24|M>>>8,l[T]=M<<16|M>>>16,r[T]=M<<8|M>>>24,n[T]=M,M=g*16843009^C*65537^S*257^T*16843008,i[b]=M<<24|M>>>8,f[b]=M<<16|M>>>16,h[b]=M<<8|M>>>24,w[b]=M,T?(T=S^m[m[m[g^S]]],A^=m[m[A]]):T=A=1}},y.expandKey=function(u){for(var o=this.uint8ArrayToUint32Array_(u),d=!0,s=0;s<o.length&&d;)d=o[s]===this.key[s],s++;if(d)return;this.key=o;var l=this.keySize=o.length;if(l!==4&&l!==6&&l!==8)throw new Error("Invalid aes key size="+l);var r=this.ksRows=(l+6+1)*4,n,a,i=this.keySchedule=new Uint32Array(r),f=this.invKeySchedule=new Uint32Array(r),h=this.sBox,w=this.rcon,m=this.invSubMix,T=m[0],A=m[1],x=m[2],b=m[3],S,C;for(n=0;n<r;n++){if(n<l){S=i[n]=o[n];continue}C=S,n%l===0?(C=C<<8|C>>>24,C=h[C>>>24]<<24|h[C>>>16&255]<<16|h[C>>>8&255]<<8|h[C&255],C^=w[n/l|0]<<24):l>6&&n%l===4&&(C=h[C>>>24]<<24|h[C>>>16&255]<<16|h[C>>>8&255]<<8|h[C&255]),i[n]=S=(i[n-l]^C)>>>0}for(a=0;a<r;a++)n=r-a,a&3?C=i[n]:C=i[n-4],a<4||n<=4?f[a]=C:f[a]=T[h[C>>>24]]^A[h[C>>>16&255]]^x[h[C>>>8&255]]^b[h[C&255]],f[a]=f[a]>>>0},y.networkToHostOrderSwap=function(u){return u<<24|(u&65280)<<8|(u&16711680)>>8|u>>>24},y.decrypt=function(u,o,d){for(var s=this.keySize+6,l=this.invKeySchedule,r=this.invSBox,n=this.invSubMix,a=n[0],i=n[1],f=n[2],h=n[3],w=this.uint8ArrayToUint32Array_(d),m=w[0],T=w[1],A=w[2],x=w[3],b=new Int32Array(u),S=new Int32Array(b.length),C,g,M,I,P,B,H,F,W,U,K,G,ee,de,ge=this.networkToHostOrderSwap;o<b.length;){for(W=ge(b[o]),U=ge(b[o+1]),K=ge(b[o+2]),G=ge(b[o+3]),P=W^l[0],B=G^l[1],H=K^l[2],F=U^l[3],ee=4,de=1;de<s;de++)C=a[P>>>24]^i[B>>16&255]^f[H>>8&255]^h[F&255]^l[ee],g=a[B>>>24]^i[H>>16&255]^f[F>>8&255]^h[P&255]^l[ee+1],M=a[H>>>24]^i[F>>16&255]^f[P>>8&255]^h[B&255]^l[ee+2],I=a[F>>>24]^i[P>>16&255]^f[B>>8&255]^h[H&255]^l[ee+3],P=C,B=g,H=M,F=I,ee=ee+4;C=r[P>>>24]<<24^r[B>>16&255]<<16^r[H>>8&255]<<8^r[F&255]^l[ee],g=r[B>>>24]<<24^r[H>>16&255]<<16^r[F>>8&255]<<8^r[P&255]^l[ee+1],M=r[H>>>24]<<24^r[F>>16&255]<<16^r[P>>8&255]<<8^r[B&255]^l[ee+2],I=r[F>>>24]<<24^r[P>>16&255]<<16^r[B>>8&255]<<8^r[H&255]^l[ee+3],S[o]=ge(C^m),S[o+1]=ge(I^T),S[o+2]=ge(M^A),S[o+3]=ge(g^x),m=W,T=U,A=K,x=G,o=o+4}return S.buffer},E}()},"./src/crypt/decrypter.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return o});var R=D("./src/crypt/aes-crypto.ts"),O=D("./src/crypt/fast-aes-key.ts"),c=D("./src/crypt/aes-decryptor.ts"),E=D("./src/utils/logger.ts"),y=D("./src/utils/mp4-tools.ts"),p=D("./src/utils/typed-array.ts"),u=16,o=function(){function d(l,r,n){var a=n===void 0?{}:n,i=a.removePKCS7Padding,f=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=l,this.config=r,this.removePKCS7Padding=f,f)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(w){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var s=d.prototype;return s.destroy=function(){this.observer=null},s.isSync=function(){return this.config.enableSoftwareAES},s.flush=function(){var r=this.currentResult;if(!r){this.reset();return}var n=new Uint8Array(r);return this.reset(),this.removePKCS7Padding?Object(c.removePadding)(n):n},s.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},s.decrypt=function(r,n,a,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(r),n,a);var f=this.flush();f&&i(f.buffer)}else this.webCryptoDecrypt(new Uint8Array(r),n,a).then(i)},s.softwareDecrypt=function(r,n,a){var i=this.currentIV,f=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(r=Object(y.appendUint8Array)(h,r),this.remainderData=null);var w=this.getValidChunk(r);if(!w.length)return null;i&&(a=i);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new c.default),m.expandKey(n);var T=f;return this.currentResult=m.decrypt(w.buffer,0,a),this.currentIV=Object(p.sliceUint8)(w,-16).buffer,T||null},s.webCryptoDecrypt=function(r,n,a){var i=this,f=this.subtle;return(this.key!==n||!this.fastAesKey)&&(this.key=n,this.fastAesKey=new O.default(f,n)),this.fastAesKey.expandKey().then(function(h){if(!f)return Promise.reject(new Error("web crypto not initialized"));var w=new R.default(f,a);return w.decrypt(r.buffer,h)}).catch(function(h){return i.onWebCryptoError(h,r,n,a)})},s.onWebCryptoError=function(r,n,a,i){return E.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",r),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(n,a,i)},s.getValidChunk=function(r){var n=r,a=r.length-r.length%u;return a!==r.length&&(n=Object(p.sliceUint8)(r,0,a),this.remainderData=Object(p.sliceUint8)(r,a)),n},s.logOnce=function(r){if(!this.logEnabled)return;E.logger.log("[decrypter.ts]: "+r),this.logEnabled=!1},d}()},"./src/crypt/fast-aes-key.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.subtle=void 0,this.key=void 0,this.subtle=E,this.key=y}var c=O.prototype;return c.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},O}()},"./src/demux/aacdemuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/demux/base-audio-demuxer.ts"),O=D("./src/demux/adts.ts"),c=D("./src/utils/logger.ts"),E=D("./src/demux/id3.ts");function y(o,d){o.prototype=Object.create(d.prototype),o.prototype.constructor=o,p(o,d)}function p(o,d){return p=Object.setPrototypeOf||function(l,r){return l.__proto__=r,l},p(o,d)}var u=function(o){y(d,o);function d(l,r){var n;return n=o.call(this)||this,n.observer=void 0,n.config=void 0,n.observer=l,n.config=r,n}var s=d.prototype;return s.resetInitSegment=function(r,n,a){o.prototype.resetInitSegment.call(this,r,n,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:r,duration:a,inputTimeScale:9e4,dropped:0}},d.probe=function(r){if(!r)return!1;for(var n=E.getID3Data(r,0)||[],a=n.length,i=r.length;a<i;a++)if(O.probe(r,a))return c.logger.log("ADTS sync word found !"),!0;return!1},s.canParse=function(r,n){return O.canParse(r,n)},s.appendFrame=function(r,n,a){O.initTrackConfig(r,this.observer,n,a,r.manifestCodec);var i=O.appendFrame(r,n,a,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},d}(R.default);u.minProbeByteLength=9,k.default=u},"./src/demux/adts.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"getAudioConfig",function(){return E}),D.d(k,"isHeaderPattern",function(){return y}),D.d(k,"getHeaderLength",function(){return p}),D.d(k,"getFullFrameLength",function(){return u}),D.d(k,"canGetFrameLength",function(){return o}),D.d(k,"isHeader",function(){return d}),D.d(k,"canParse",function(){return s}),D.d(k,"probe",function(){return l}),D.d(k,"initTrackConfig",function(){return r}),D.d(k,"getFrameDuration",function(){return n}),D.d(k,"parseFrameHeader",function(){return a}),D.d(k,"appendFrame",function(){return i});var R=D("./src/utils/logger.ts"),O=D("./src/errors.ts"),c=D("./src/events.ts");function E(f,h,w,m){var T,A,x,b,S=navigator.userAgent.toLowerCase(),C=m,g=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((h[w+2]&192)>>>6)+1;var M=(h[w+2]&60)>>>2;if(M>g.length-1){f.trigger(c.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+M});return}return x=(h[w+2]&1)<<2,x|=(h[w+3]&192)>>>6,R.logger.log("manifest codec:"+m+", ADTS type:"+T+", samplingIndex:"+M),/firefox/i.test(S)?M>=6?(T=5,b=new Array(4),A=M-3):(T=2,b=new Array(2),A=M):S.indexOf("android")!==-1?(T=2,b=new Array(2),A=M):(T=5,b=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&M>=6?A=M-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(M>=6&&x===1||/vivaldi/i.test(S))||!m&&x===1)&&(T=2,b=new Array(2)),A=M)),b[0]=T<<3,b[0]|=(M&14)>>1,b[1]|=(M&1)<<7,b[1]|=x<<3,T===5&&(b[1]|=(A&14)>>1,b[2]=(A&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:g[M],channelCount:x,codec:"mp4a.40."+T,manifestCodec:C}}function y(f,h){return f[h]===255&&(f[h+1]&246)===240}function p(f,h){return f[h+1]&1?7:9}function u(f,h){return(f[h+3]&3)<<11|f[h+4]<<3|(f[h+5]&224)>>>5}function o(f,h){return h+5<f.length}function d(f,h){return h+1<f.length&&y(f,h)}function s(f,h){return o(f,h)&&y(f,h)&&u(f,h)<=f.length-h}function l(f,h){if(d(f,h)){var w=p(f,h);if(h+w>=f.length)return!1;var m=u(f,h);if(m<=w)return!1;var T=h+m;return T===f.length||d(f,T)}return!1}function r(f,h,w,m,T){if(!f.samplerate){var A=E(h,w,m,T);if(!A)return;f.config=A.config,f.samplerate=A.samplerate,f.channelCount=A.channelCount,f.codec=A.codec,f.manifestCodec=A.manifestCodec,R.logger.log("parsed codec:"+f.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function n(f){return 1024*9e4/f}function a(f,h,w,m,T){var A=p(f,h),x=u(f,h);if(x-=A,x>0){var b=w+m*T;return{headerLength:A,frameLength:x,stamp:b}}}function i(f,h,w,m,T){var A=n(f.samplerate),x=a(h,w,m,T,A);if(x){var b=x.frameLength,S=x.headerLength,C=x.stamp,g=S+b,M=Math.max(0,w+g-h.length),I;M?(I=new Uint8Array(g-S),I.set(h.subarray(w+S,h.length),0)):I=h.subarray(w+S,w+g);var P={unit:I,pts:C};return M||f.samples.push(P),{sample:P,length:g,missing:M}}}},"./src/demux/base-audio-demuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"initPTSFn",function(){return u});var R=D("./src/polyfills/number.ts"),O=D("./src/demux/id3.ts"),c=D("./src/demux/dummy-demuxed-track.ts"),E=D("./src/utils/mp4-tools.ts"),y=D("./src/utils/typed-array.ts"),p=function(){function o(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var d=o.prototype;return d.resetInitSegment=function(l,r,n){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},d.resetTimeStamp=function(){},d.resetContiguity=function(){},d.canParse=function(l,r){return!1},d.appendFrame=function(l,r,n){},d.demux=function(l,r){this.cachedData&&(l=Object(E.appendUint8Array)(this.cachedData,l),this.cachedData=null);var n=O.getID3Data(l,0),a=n?n.length:0,i,f,h=this._audioTrack,w=this._id3Track,m=n?O.getTimeStamp(n):void 0,T=l.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=u(m,r)),n&&n.length>0&&w.samples.push({pts:this.initPTS,dts:this.initPTS,data:n}),f=this.initPTS;a<T;){if(this.canParse(l,a)){var A=this.appendFrame(h,l,a);A?(this.frameIndex++,f=A.sample.pts,a+=A.length,i=a):a=T}else O.canParse(l,a)?(n=O.getID3Data(l,a),w.samples.push({pts:f,dts:f,data:n}),a+=n.length,i=a):a++;if(a===T&&i!==T){var x=Object(y.sliceUint8)(l,i);this.cachedData?this.cachedData=Object(E.appendUint8Array)(this.cachedData,x):this.cachedData=x}}return{audioTrack:h,avcTrack:Object(c.dummyTrack)(),id3Track:w,textTrack:Object(c.dummyTrack)()}},d.demuxSampleAes=function(l,r,n){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},d.flush=function(l){var r=this.cachedData;return r&&(this.cachedData=null,this.demux(r,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(c.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(c.dummyTrack)()}},d.destroy=function(){},o}(),u=function(d,s){return Object(R.isFiniteNumber)(d)?d*90:s*9e4};k.default=p},"./src/demux/chunk-cache.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function c(){this.chunks=[],this.dataLength=0}var E=c.prototype;return E.push=function(p){this.chunks.push(p),this.dataLength+=p.length},E.flush=function(){var p=this.chunks,u=this.dataLength,o;if(p.length)p.length===1?o=p[0]:o=O(p,u);else return new Uint8Array(0);return this.reset(),o},E.reset=function(){this.chunks.length=0,this.dataLength=0},c}();function O(c,E){for(var y=new Uint8Array(E),p=0,u=0;u<c.length;u++){var o=c[u];y.set(o,p),p+=o.length}return y}},"./src/demux/dummy-demuxed-track.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"dummyTrack",function(){return R});function R(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/logger.ts"),O=function(){function c(y){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=y,this.bytesAvailable=y.byteLength,this.word=0,this.bitsAvailable=0}var E=c.prototype;return E.loadWord=function(){var p=this.data,u=this.bytesAvailable,o=p.byteLength-u,d=new Uint8Array(4),s=Math.min(4,u);if(s===0)throw new Error("no bytes available");d.set(p.subarray(o,o+s)),this.word=new DataView(d.buffer).getUint32(0),this.bitsAvailable=s*8,this.bytesAvailable-=s},E.skipBits=function(p){var u;this.bitsAvailable>p?(this.word<<=p,this.bitsAvailable-=p):(p-=this.bitsAvailable,u=p>>3,p-=u>>3,this.bytesAvailable-=u,this.loadWord(),this.word<<=p,this.bitsAvailable-=p)},E.readBits=function(p){var u=Math.min(this.bitsAvailable,p),o=this.word>>>32-u;return p>32&&R.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=u,this.bitsAvailable>0?this.word<<=u:this.bytesAvailable>0&&this.loadWord(),u=p-u,u>0&&this.bitsAvailable?o<<u|this.readBits(u):o},E.skipLZ=function(){var p;for(p=0;p<this.bitsAvailable;++p)if((this.word&2147483648>>>p)!==0)return this.word<<=p,this.bitsAvailable-=p,p;return this.loadWord(),p+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var p=this.skipLZ();return this.readBits(p+1)-1},E.readEG=function(){var p=this.readUEG();return 1&p?1+p>>>1:-1*(p>>>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(p){for(var u=8,o=8,d,s=0;s<p;s++)o!==0&&(d=this.readEG(),o=(u+d+256)%256),u=o===0?u:o},E.readSPS=function(){var p=0,u=0,o=0,d=0,s,l,r,n=this.readUByte.bind(this),a=this.readBits.bind(this),i=this.readUEG.bind(this),f=this.readBoolean.bind(this),h=this.skipBits.bind(this),w=this.skipEG.bind(this),m=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);n();var A=n();if(a(5),h(3),n(),m(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var x=i();if(x===3&&h(1),m(),m(),h(1),f())for(l=x!==3?8:12,r=0;r<l;r++)f()&&(r<6?T(16):T(64))}m();var b=i();if(b===0)i();else if(b===1)for(h(1),w(),w(),s=i(),r=0;r<s;r++)w();m(),h(1);var S=i(),C=i(),g=a(1);g===0&&h(1),h(1),f()&&(p=i(),u=i(),o=i(),d=i());var M=[1,1];if(f()&&f()){var I=n();switch(I){case 1:M=[1,1];break;case 2:M=[12,11];break;case 3:M=[10,11];break;case 4:M=[16,11];break;case 5:M=[40,33];break;case 6:M=[24,11];break;case 7:M=[20,11];break;case 8:M=[32,11];break;case 9:M=[80,33];break;case 10:M=[18,11];break;case 11:M=[15,11];break;case 12:M=[64,33];break;case 13:M=[160,99];break;case 14:M=[4,3];break;case 15:M=[3,2];break;case 16:M=[2,1];break;case 255:{M=[n()<<8|n(),n()<<8|n()];break}}}return{width:Math.ceil((S+1)*16-p*2-u*2),height:(2-g)*(C+1)*16-(g?2:4)*(o+d),pixelRatio:M}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},c}();k.default=O},"./src/demux/id3.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isHeader",function(){return R}),D.d(k,"isFooter",function(){return O}),D.d(k,"getID3Data",function(){return c}),D.d(k,"canParse",function(){return y}),D.d(k,"getTimeStamp",function(){return p}),D.d(k,"isTimeStampFrame",function(){return u}),D.d(k,"getID3Frames",function(){return d}),D.d(k,"decodeFrame",function(){return s}),D.d(k,"utf8ArrayToStr",function(){return i}),D.d(k,"testables",function(){return f});var R=function(T,A){return A+10<=T.length&&(T[A]===73&&T[A+1]===68&&T[A+2]===51&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},O=function(T,A){return A+10<=T.length&&(T[A]===51&&T[A+1]===68&&T[A+2]===73&&(T[A+3]<255&&T[A+4]<255&&(T[A+6]<128&&T[A+7]<128&&T[A+8]<128&&T[A+9]<128)))},c=function(T,A){for(var x=A,b=0;R(T,A);){b+=10;var S=E(T,A+6);b+=S,O(T,A+10)&&(b+=10),A+=b}return b>0?T.subarray(x,x+b):void 0},E=function(T,A){var x=0;return x=(T[A]&127)<<21,x|=(T[A+1]&127)<<14,x|=(T[A+2]&127)<<7,x|=T[A+3]&127,x},y=function(T,A){return R(T,A)&&E(T,A+6)+10<=T.length-A},p=function(T){for(var A=d(T),x=0;x<A.length;x++){var b=A[x];if(u(b))return a(b)}return},u=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},o=function(T){var A=String.fromCharCode(T[0],T[1],T[2],T[3]),x=E(T,4),b=10;return{type:A,size:x,data:T.subarray(b,b+x)}},d=function(T){for(var A=0,x=[];R(T,A);){var b=E(T,A+6);A+=10;for(var S=A+b;A+8<S;){var C=o(T.subarray(A)),g=s(C);g&&x.push(g),A+=C.size+10}O(T,A)&&(A+=10)}return x},s=function(T){return T.type==="PRIV"?l(T):T.type[0]==="W"?n(T):r(T)},l=function(T){if(T.size<2)return;var A=i(T.data,!0),x=new Uint8Array(T.data.subarray(A.length+1));return{key:T.type,info:A,data:x.buffer}},r=function(T){if(T.size<2)return;if(T.type==="TXXX"){var A=1,x=i(T.data.subarray(A),!0);A+=x.length+1;var b=i(T.data.subarray(A));return{key:T.type,info:x,data:b}}var S=i(T.data.subarray(1));return{key:T.type,data:S}},n=function(T){if(T.type==="WXXX"){if(T.size<2)return;var A=1,x=i(T.data.subarray(A),!0);A+=x.length+1;var b=i(T.data.subarray(A));return{key:T.type,info:x,data:b}}var S=i(T.data);return{key:T.type,data:S}},a=function(T){if(T.data.byteLength===8){var A=new Uint8Array(T.data),x=A[3]&1,b=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return b/=45,x&&(b+=4772185884e-2),Math.round(b)}return},i=function(T,A){A===void 0&&(A=!1);var x=w();if(x){var b=x.decode(T);if(A){var S=b.indexOf("\0");return S!==-1?b.substring(0,S):b}return b.replace(/\0/g,"")}for(var C=T.length,g,M,I,P="",B=0;B<C;){if(g=T[B++],g===0&&A)return P;if(g===0||g===3)continue;switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:P+=String.fromCharCode(g);break;case 12:case 13:M=T[B++],P+=String.fromCharCode((g&31)<<6|M&63);break;case 14:M=T[B++],I=T[B++],P+=String.fromCharCode((g&15)<<12|(M&63)<<6|(I&63)<<0);break;default:}}return P},f={decodeTextFrame:r},h;function w(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/demux/base-audio-demuxer.ts"),O=D("./src/demux/id3.ts"),c=D("./src/utils/logger.ts"),E=D("./src/demux/mpegaudio.ts");function y(o,d){o.prototype=Object.create(d.prototype),o.prototype.constructor=o,p(o,d)}function p(o,d){return p=Object.setPrototypeOf||function(l,r){return l.__proto__=r,l},p(o,d)}var u=function(o){y(d,o);function d(){return o.apply(this,arguments)||this}var s=d.prototype;return s.resetInitSegment=function(r,n,a){o.prototype.resetInitSegment.call(this,r,n,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:r,duration:a,inputTimeScale:9e4,dropped:0}},d.probe=function(r){if(!r)return!1;for(var n=O.getID3Data(r,0)||[],a=n.length,i=r.length;a<i;a++)if(E.probe(r,a))return c.logger.log("MPEG Audio sync word found !"),!0;return!1},s.canParse=function(r,n){return E.canParse(r,n)},s.appendFrame=function(r,n,a){return this.initPTS===null?void 0:E.appendFrame(r,n,a,this.initPTS,this.frameIndex)},d}(R.default);u.minProbeByteLength=4,k.default=u},"./src/demux/mp4demuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/mp4-tools.ts"),O=D("./src/demux/dummy-demuxed-track.ts"),c=function(){function E(p,u){this.remainderData=null,this.config=void 0,this.config=u}var y=E.prototype;return y.resetTimeStamp=function(){},y.resetInitSegment=function(){},y.resetContiguity=function(){},E.probe=function(u){return Object(R.findBox)({data:u,start:0,end:Math.min(u.length,16384)},["moof"]).length>0},y.demux=function(u){var o=u,d=Object(O.dummyTrack)();if(this.config.progressive){this.remainderData&&(o=Object(R.appendUint8Array)(this.remainderData,u));var s=Object(R.segmentValidRange)(o);this.remainderData=s.remainder,d.samples=s.valid||new Uint8Array}else d.samples=o;return{audioTrack:Object(O.dummyTrack)(),avcTrack:d,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},y.flush=function(){var u=Object(O.dummyTrack)();return u.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(O.dummyTrack)(),avcTrack:u,id3Track:Object(O.dummyTrack)(),textTrack:Object(O.dummyTrack)()}},y.demuxSampleAes=function(u,o,d){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},y.destroy=function(){},E}();c.minProbeByteLength=1024,k.default=c},"./src/demux/mpegaudio.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"appendFrame",function(){return p}),D.d(k,"parseHeader",function(){return u}),D.d(k,"isHeaderPattern",function(){return o}),D.d(k,"isHeader",function(){return d}),D.d(k,"canParse",function(){return s}),D.d(k,"probe",function(){return l});var R=null,O=[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],c=[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]],y=[0,1,1,4];function p(r,n,a,i,f){if(a+24>n.length)return;var h=u(n,a);if(h&&a+h.frameLength<=n.length){var w=h.samplesPerFrame*9e4/h.sampleRate,m=i+f*w,T={unit:n.subarray(a,a+h.frameLength),pts:m,dts:m};return r.config=[],r.channelCount=h.channelCount,r.samplerate=h.sampleRate,r.samples.push(T),{sample:T,length:h.frameLength,missing:0}}}function u(r,n){var a=r[n+1]>>3&3,i=r[n+1]>>1&3,f=r[n+2]>>4&15,h=r[n+2]>>2&3;if(a!==1&&f!==0&&f!==15&&h!==3){var w=r[n+2]>>1&1,m=r[n+3]>>6,T=a===3?3-i:i===3?3:4,A=O[T*14+f-1]*1e3,x=a===3?0:a===2?1:2,b=c[x*3+h],S=m===3?1:2,C=E[a][i],g=y[i],M=C*8*g,I=Math.floor(C*A/b+w)*g;if(R===null){var P=navigator.userAgent||"",B=P.match(/Chrome\/(\d+)/i);R=B?parseInt(B[1]):0}var H=!!R&&R<=87;return H&&i===2&&A>=224e3&&m===0&&(r[n+3]=r[n+3]|128),{sampleRate:b,channelCount:S,frameLength:I,samplesPerFrame:M}}}function o(r,n){return r[n]===255&&(r[n+1]&224)===224&&(r[n+1]&6)!==0}function d(r,n){return n+1<r.length&&o(r,n)}function s(r,n){var a=4;return o(r,n)&&a<=r.length-n}function l(r,n){if(n+1<r.length&&o(r,n)){var a=4,i=u(r,n),f=a;i!=null&&i.frameLength&&(f=i.frameLength);var h=n+f;return h===r.length||d(r,h)}return!1}},"./src/demux/sample-aes.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/crypt/decrypter.ts"),O=D("./src/demux/tsdemuxer.ts"),c=function(){function E(p,u,o){this.keyData=void 0,this.decrypter=void 0,this.keyData=o,this.decrypter=new R.default(p,u,{removePKCS7Padding:!1})}var y=E.prototype;return y.decryptBuffer=function(u,o){this.decrypter.decrypt(u,this.keyData.key.buffer,this.keyData.iv.buffer,o)},y.decryptAacSample=function(u,o,d,s){var l=u[o].unit,r=l.subarray(16,l.length-l.length%16),n=r.buffer.slice(r.byteOffset,r.byteOffset+r.length),a=this;this.decryptBuffer(n,function(i){var f=new Uint8Array(i);l.set(f,16),s||a.decryptAacSamples(u,o+1,d)})},y.decryptAacSamples=function(u,o,d){for(;;o++){if(o>=u.length){d();return}if(u[o].unit.length<32)continue;var s=this.decrypter.isSync();if(this.decryptAacSample(u,o,d,s),!s)return}},y.getAvcEncryptedData=function(u){for(var o=Math.floor((u.length-48)/160)*16+16,d=new Int8Array(o),s=0,l=32;l<=u.length-16;l+=160,s+=16)d.set(u.subarray(l,l+16),s);return d},y.getAvcDecryptedUnit=function(u,o){for(var d=new Uint8Array(o),s=0,l=32;l<=u.length-16;l+=160,s+=16)u.set(d.subarray(s,s+16),l);return u},y.decryptAvcSample=function(u,o,d,s,l,r){var n=Object(O.discardEPB)(l.data),a=this.getAvcEncryptedData(n),i=this;this.decryptBuffer(a.buffer,function(f){l.data=i.getAvcDecryptedUnit(n,f),r||i.decryptAvcSamples(u,o,d+1,s)})},y.decryptAvcSamples=function(u,o,d,s){if(u instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;o++,d=0){if(o>=u.length){s();return}for(var l=u[o].units;!(d>=l.length);d++){var r=l[d];if(r.data.length<=48||r.type!==1&&r.type!==5)continue;var n=this.decrypter.isSync();if(this.decryptAvcSample(u,o,d,s,r,n),!n)return}}},E}();k.default=c},"./src/demux/transmuxer-interface.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l});var R=D("./node_modules/webworkify-webpack/index.js"),O=D.n(R),c=D("./src/events.ts"),E=D("./src/demux/transmuxer.ts"),y=D("./src/utils/logger.ts"),p=D("./src/errors.ts"),u=D("./src/utils/mediasource-helper.ts"),o=D("./node_modules/eventemitter3/index.js"),d=D.n(o),s=Object(u.getMediaSource)()||{isTypeSupported:function(){return!1}},l=function(){function r(a,i,f,h){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=a,this.id=i,this.onTransmuxComplete=f,this.onFlush=h;var m=a.config,T=function(C,g){g=g||{},g.frag=w.frag,g.id=w.id,a.trigger(C,g)};this.observer=new o.EventEmitter,this.observer.on(c.Events.FRAG_DECRYPTED,T),this.observer.on(c.Events.ERROR,T);var A={mp4:s.isTypeSupported("video/mp4"),mpeg:s.isTypeSupported("audio/mpeg"),mp3:s.isTypeSupported('audio/mp4; codecs="mp3"')},x=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){y.logger.log("demuxing in webworker");var b;try{b=this.worker=R("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(S){a.trigger(c.Events.ERROR,{type:p.ErrorTypes.OTHER_ERROR,details:p.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(S.message+" ("+S.filename+":"+S.lineno+")")})},b.postMessage({cmd:"init",typeSupported:A,vendor:x,id:i,config:JSON.stringify(m)})}catch(S){y.logger.warn("Error in worker:",S),y.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new E.default(this.observer,A,m,x,i),this.worker=null}}else this.transmuxer=new E.default(this.observer,A,m,x,i)}var n=r.prototype;return n.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var f=this.transmuxer;f&&(f.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},n.push=function(i,f,h,w,m,T,A,x,b,S){var C=this;b.transmuxing.start=self.performance.now();var g=this.transmuxer,M=this.worker,I=T?T.start:m.start,P=m.decryptdata,B=this.frag,H=!(B&&m.cc===B.cc),F=!(B&&b.level===B.level),W=B?b.sn-B.sn:-1,U=this.part?b.part-this.part.index:1,K=!F&&(W===1||W===0&&U===1),G=self.performance.now();(F||W||m.stats.parsing.start===0)&&(m.stats.parsing.start=G),T&&(U||!K)&&(T.stats.parsing.start=G);var ee=new E.TransmuxState(H,K,x,F,I);if(!K||H){y.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
|
|
|
discontinuity: `+H+`
|
|
|
trackSwitch: `+F+`
|
|
|
contiguous: `+K+`
|
|
|
accurateTimeOffset: `+x+`
|
|
|
timeOffset: `+I);var de=new E.TransmuxConfig(h,w,f,A,S);this.configureTransmuxer(de)}if(this.frag=m,this.part=T,M)M.postMessage({cmd:"demux",data:i,decryptdata:P,chunkMeta:b,state:ee},i instanceof ArrayBuffer?[i]:[]);else if(g){var ge=g.push(i,P,b,ee);Object(E.isPromise)(ge)?ge.then(function(Be){C.handleTransmuxComplete(Be)}):this.handleTransmuxComplete(ge)}},n.flush=function(i){var f=this;i.transmuxing.start=self.performance.now();var h=this.transmuxer,w=this.worker;if(w)w.postMessage({cmd:"flush",chunkMeta:i});else if(h){var m=h.flush(i);Object(E.isPromise)(m)?m.then(function(T){f.handleFlushResult(T,i)}):this.handleFlushResult(m,i)}},n.handleFlushResult=function(i,f){var h=this;i.forEach(function(w){h.handleTransmuxComplete(w)}),this.onFlush(f)},n.onWorkerMessage=function(i){var f=i.data,h=this.hls;switch(f.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(f.data);break}case"flush":{this.onFlush(f.data);break}default:{f.data=f.data||{},f.data.frag=this.frag,f.data.id=this.id,h.trigger(f.event,f.data);break}}},n.configureTransmuxer=function(i){var f=this.worker,h=this.transmuxer;f?f.postMessage({cmd:"configure",config:i}):h&&h.configure(i)},n.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},r}()},"./src/demux/transmuxer-worker.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return p});var R=D("./src/demux/transmuxer.ts"),O=D("./src/events.ts"),c=D("./src/utils/logger.ts"),E=D("./node_modules/eventemitter3/index.js"),y=D.n(E);function p(l){var r=new E.EventEmitter,n=function(i,f){l.postMessage({event:i,data:f})};r.on(O.Events.FRAG_DECRYPTED,n),r.on(O.Events.ERROR,n),l.addEventListener("message",function(a){var i=a.data;switch(i.cmd){case"init":{var f=JSON.parse(i.config);l.transmuxer=new R.default(r,i.typeSupported,f,i.vendor,i.id),Object(c.enableLogs)(f.debug),n("init",null);break}case"configure":{l.transmuxer.configure(i.config);break}case"demux":{var h=l.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(R.isPromise)(h)?h.then(function(T){u(l,T)}):u(l,h);break}case"flush":{var w=i.chunkMeta,m=l.transmuxer.flush(w);Object(R.isPromise)(m)?m.then(function(T){d(l,T,w)}):d(l,m,w);break}default:break}})}function u(l,r){if(s(r.remuxResult))return;var n=[],a=r.remuxResult,i=a.audio,f=a.video;i&&o(n,i),f&&o(n,f),l.postMessage({event:"transmuxComplete",data:r},n)}function o(l,r){r.data1&&l.push(r.data1.buffer),r.data2&&l.push(r.data2.buffer)}function d(l,r,n){r.forEach(function(a){u(l,a)}),l.postMessage({event:"flush",data:n})}function s(l){return!l.audio&&!l.video&&!l.text&&!l.id3&&!l.initSegment}},"./src/demux/transmuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f}),D.d(k,"isPromise",function(){return m}),D.d(k,"TransmuxConfig",function(){return T}),D.d(k,"TransmuxState",function(){return A});var R=D("./src/events.ts"),O=D("./src/errors.ts"),c=D("./src/crypt/decrypter.ts"),E=D("./src/demux/aacdemuxer.ts"),y=D("./src/demux/mp4demuxer.ts"),p=D("./src/demux/tsdemuxer.ts"),u=D("./src/demux/mp3demuxer.ts"),o=D("./src/remux/mp4-remuxer.ts"),d=D("./src/remux/passthrough-remuxer.ts"),s=D("./src/demux/chunk-cache.ts"),l=D("./src/utils/mp4-tools.ts"),r=D("./src/utils/logger.ts"),n;try{n=self.performance.now.bind(self.performance)}catch(x){r.logger.debug("Unable to use Performance API on this environment"),n=self.Date.now}var a=[{demux:p.default,remux:o.default},{demux:y.default,remux:d.default},{demux:E.default,remux:o.default},{demux:u.default,remux:o.default}],i=1024;a.forEach(function(x){var b=x.demux;i=Math.max(i,b.minProbeByteLength)});var f=function(){function x(S,C,g,M,I){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 s.default,this.observer=S,this.typeSupported=C,this.config=g,this.vendor=M,this.id=I}var b=x.prototype;return b.configure=function(C){this.transmuxConfig=C,this.decrypter&&this.decrypter.reset()},b.push=function(C,g,M,I){var P=this,B=M.transmuxing;B.executeStart=n();var H=new Uint8Array(C),F=this.cache,W=this.config,U=this.currentTransmuxState,K=this.transmuxConfig;I&&(this.currentTransmuxState=I);var G=h(H,g);if(G&&G.method==="AES-128"){var ee=this.getDecrypter();if(W.enableSoftwareAES){var de=ee.softwareDecrypt(H,G.key.buffer,G.iv.buffer);if(!de)return B.executeEnd=n(),w(M);H=new Uint8Array(de)}else return this.decryptionPromise=ee.webCryptoDecrypt(H,G.key.buffer,G.iv.buffer).then(function(Xe){var Ge=P.push(Xe,null,M);return P.decryptionPromise=null,Ge}),this.decryptionPromise}var ge=I||U,Be=ge.contiguous,Ue=ge.discontinuity,Le=ge.trackSwitch,Me=ge.accurateTimeOffset,Pe=ge.timeOffset,be=K.audioCodec,ke=K.videoCodec,te=K.defaultInitPts,pe=K.duration,ae=K.initSegmentData;if((Ue||Le)&&this.resetInitSegment(ae,be,ke,pe),Ue&&this.resetInitialTimestamp(te),Be||this.resetContiguity(),this.needsProbing(H,Ue,Le)){if(F.dataLength){var _e=F.flush();H=Object(l.appendUint8Array)(_e,H)}this.configureTransmuxer(H,K)}var Ie=this.transmux(H,G,Pe,Me,M),Fe=this.currentTransmuxState;return Fe.contiguous=!0,Fe.discontinuity=!1,Fe.trackSwitch=!1,B.executeEnd=n(),Ie},b.flush=function(C){var g=this,M=C.transmuxing;M.executeStart=n();var I=this.decrypter,P=this.cache,B=this.currentTransmuxState,H=this.decryptionPromise;if(H)return H.then(function(){return g.flush(C)});var F=[],W=B.timeOffset;if(I){var U=I.flush();U&&F.push(this.push(U,null,C))}var K=P.dataLength;P.reset();var G=this.demuxer,ee=this.remuxer;if(!G||!ee)return K>=i&&this.observer.emit(R.Events.ERROR,R.Events.ERROR,{type:O.ErrorTypes.MEDIA_ERROR,details:O.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),M.executeEnd=n(),[w(C)];var de=G.flush(W);return m(de)?de.then(function(ge){return g.flushRemux(F,ge,C),F}):(this.flushRemux(F,de,C),F)},b.flushRemux=function(C,g,M){var I=g.audioTrack,P=g.avcTrack,B=g.id3Track,H=g.textTrack,F=this.currentTransmuxState,W=F.accurateTimeOffset,U=F.timeOffset;r.logger.log("[transmuxer.ts]: Flushed fragment "+M.sn+(M.part>-1?" p: "+M.part:"")+" of level "+M.level);var K=this.remuxer.remux(I,P,B,H,U,W,!0,this.id);C.push({remuxResult:K,chunkMeta:M}),M.transmuxing.executeEnd=n()},b.resetInitialTimestamp=function(C){var g=this.demuxer,M=this.remuxer;if(!g||!M)return;g.resetTimeStamp(C),M.resetTimeStamp(C)},b.resetContiguity=function(){var C=this.demuxer,g=this.remuxer;if(!C||!g)return;C.resetContiguity(),g.resetNextTimestamp()},b.resetInitSegment=function(C,g,M,I){var P=this.demuxer,B=this.remuxer;if(!P||!B)return;P.resetInitSegment(g,M,I),B.resetInitSegment(C,g,M)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(C,g,M,I,P){var B;return g&&g.method==="SAMPLE-AES"?B=this.transmuxSampleAes(C,g,M,I,P):B=this.transmuxUnencrypted(C,M,I,P),B},b.transmuxUnencrypted=function(C,g,M,I){var P=this.demuxer.demux(C,g,!1,!this.config.progressive),B=P.audioTrack,H=P.avcTrack,F=P.id3Track,W=P.textTrack,U=this.remuxer.remux(B,H,F,W,g,M,!1,this.id);return{remuxResult:U,chunkMeta:I}},b.transmuxSampleAes=function(C,g,M,I,P){var B=this;return this.demuxer.demuxSampleAes(C,g,M).then(function(H){var F=B.remuxer.remux(H.audioTrack,H.avcTrack,H.id3Track,H.textTrack,M,I,!1,B.id);return{remuxResult:F,chunkMeta:P}})},b.configureTransmuxer=function(C,g){for(var M=this.config,I=this.observer,P=this.typeSupported,B=this.vendor,H=g.audioCodec,F=g.defaultInitPts,W=g.duration,U=g.initSegmentData,K=g.videoCodec,G,ee=0,de=a.length;ee<de;ee++)if(a[ee].demux.probe(C)){G=a[ee];break}G||(r.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:y.default,remux:d.default});var ge=this.demuxer,Be=this.remuxer,Ue=G.remux,Le=G.demux;(!Be||!(Be instanceof Ue))&&(this.remuxer=new Ue(I,M,P,B)),(!ge||!(ge instanceof Le))&&(this.demuxer=new Le(I,M,P),this.probe=Le.probe),this.resetInitSegment(U,H,K,W),this.resetInitialTimestamp(F)},b.needsProbing=function(C,g,M){return!this.demuxer||!this.remuxer||g||M},b.getDecrypter=function(){var C=this.decrypter;return C||(C=this.decrypter=new c.default(this.observer,this.config)),C},x}();function h(x,b){var S=null;return x.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(S=b),S}var w=function(b){return{remuxResult:{},chunkMeta:b}};function m(x){return"then"in x&&x.then instanceof Function}var T=function(b,S,C,g,M){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=S,this.initSegmentData=C,this.duration=g,this.defaultInitPts=M},A=function(b,S,C,g,M){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=S,this.accurateTimeOffset=C,this.trackSwitch=g,this.timeOffset=M}},"./src/demux/tsdemuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"discardEPB",function(){return w});var R=D("./src/demux/adts.ts"),O=D("./src/demux/mpegaudio.ts"),c=D("./src/demux/exp-golomb.ts"),E=D("./src/demux/id3.ts"),y=D("./src/demux/sample-aes.ts"),p=D("./src/events.ts"),u=D("./src/utils/mp4-tools.ts"),o=D("./src/utils/logger.ts"),d=D("./src/errors.ts"),s={video:1,audio:2,id3:3,text:4},l=function(){function m(A,x,b){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=A,this.config=x,this.typeSupported=b}m.probe=function(x){var b=m.syncOffset(x);return b<0?!1:(b&&o.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},m.syncOffset=function(x){for(var b=Math.min(1e3,x.length-3*188),S=0;S<b;){if(x[S]===71&&x[S+188]===71&&x[S+2*188]===71)return S;S++}return-1},m.createTrack=function(x,b){return{container:x==="video"||x==="audio"?"video/mp2t":void 0,type:x,id:s[x],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:x==="audio"?b:void 0}};var T=m.prototype;return T.resetInitSegment=function(x,b,S){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",S),this._audioTrack=m.createTrack("audio",S),this._id3Track=m.createTrack("id3",S),this._txtTrack=m.createTrack("text",S),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=x,this.videoCodec=b,this._duration=S},T.resetTimeStamp=function(){},T.resetContiguity=function(){var x=this._audioTrack,b=this._avcTrack,S=this._id3Track;x&&(x.pesData=null),b&&(b.pesData=null),S&&(S.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},T.demux=function(x,b,S,C){S===void 0&&(S=!1),C===void 0&&(C=!1),S||(this.sampleAes=null);var g,M=this._avcTrack,I=this._audioTrack,P=this._id3Track,B=M.pid,H=M.pesData,F=I.pid,W=P.pid,U=I.pesData,K=P.pesData,G=!1,ee=this.pmtParsed,de=this._pmtId,ge=x.length;if(this.remainderData&&(x=Object(u.appendUint8Array)(this.remainderData,x),ge=x.length,this.remainderData=null),ge<188&&!C)return this.remainderData=x,{audioTrack:I,avcTrack:M,id3Track:P,textTrack:this._txtTrack};var Be=Math.max(0,m.syncOffset(x));ge-=(ge+Be)%188,ge<x.byteLength&&!C&&(this.remainderData=new Uint8Array(x.buffer,ge,x.buffer.byteLength-ge));for(var Ue=Be;Ue<ge;Ue+=188)if(x[Ue]===71){var Le=!!(x[Ue+1]&64),Me=((x[Ue+1]&31)<<8)+x[Ue+2],Pe=(x[Ue+3]&48)>>4,be=void 0;if(Pe>1){if(be=Ue+5+x[Ue+4],be===Ue+188)continue}else be=Ue+4;switch(Me){case B:Le&&(H&&(g=i(H))&&this.parseAVCPES(g,!1),H={data:[],size:0}),H&&(H.data.push(x.subarray(be,Ue+188)),H.size+=Ue+188-be);break;case F:Le&&(U&&(g=i(U))&&(I.isAAC?this.parseAACPES(g):this.parseMPEGPES(g)),U={data:[],size:0}),U&&(U.data.push(x.subarray(be,Ue+188)),U.size+=Ue+188-be);break;case W:Le&&(K&&(g=i(K))&&this.parseID3PES(g),K={data:[],size:0}),K&&(K.data.push(x.subarray(be,Ue+188)),K.size+=Ue+188-be);break;case 0:Le&&(be+=x[be]+1),de=this._pmtId=n(x,be);break;case de:{Le&&(be+=x[be]+1);var ke=a(x,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,S);B=ke.avc,B>0&&(M.pid=B),F=ke.audio,F>0&&(I.pid=F,I.isAAC=ke.isAAC),W=ke.id3,W>0&&(P.pid=W),G&&!ee&&(o.logger.log("reparse from beginning"),G=!1,Ue=Be-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(p.Events.ERROR,p.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});M.pesData=H,I.pesData=U,P.pesData=K;var te={audioTrack:I,avcTrack:M,id3Track:P,textTrack:this._txtTrack};return C&&this.extractRemainingSamples(te),te},T.flush=function(){var x=this.remainderData;this.remainderData=null;var b;return x?b=this.demux(x,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},T.extractRemainingSamples=function(x){var b=x.audioTrack,S=x.avcTrack,C=x.id3Track,g=S.pesData,M=b.pesData,I=C.pesData,P;g&&(P=i(g))?(this.parseAVCPES(P,!0),S.pesData=null):S.pesData=g,M&&(P=i(M))?(b.isAAC?this.parseAACPES(P):this.parseMPEGPES(P),b.pesData=null):(M!=null&&M.size&&o.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=M),I&&(P=i(I))?(this.parseID3PES(P),C.pesData=null):C.pesData=I},T.demuxSampleAes=function(x,b,S){var C=this.demux(x,S,!0,!this.config.progressive),g=this.sampleAes=new y.default(this.observer,this.config,b);return this.decrypt(C,g)},T.decrypt=function(x,b){return new Promise(function(S){var C=x.audioTrack,g=x.avcTrack;C.samples&&C.isAAC?b.decryptAacSamples(C.samples,0,function(){g.samples?b.decryptAvcSamples(g.samples,0,0,function(){S(x)}):S(x)}):g.samples&&b.decryptAvcSamples(g.samples,0,0,function(){S(x)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(x,b){var S=this,C=this._avcTrack,g=this.parseAVCNALu(x.data),M=!1,I=this.avcSample,P,B=!1;x.data=null,I&&g.length&&!C.audFound&&(f(I,C),I=this.avcSample=r(!1,x.pts,x.dts,"")),g.forEach(function(H){switch(H.type){case 1:{P=!0,I||(I=S.avcSample=r(!0,x.pts,x.dts,"")),M&&(I.debug+="NDR "),I.frame=!0;var F=H.data;if(B&&F.length>4){var W=new c.default(F).readSliceType();(W===2||W===4||W===7||W===9)&&(I.key=!0)}break}case 5:P=!0,I||(I=S.avcSample=r(!0,x.pts,x.dts,"")),M&&(I.debug+="IDR "),I.key=!0,I.frame=!0;break;case 6:{P=!0,M&&I&&(I.debug+="SEI ");var U=new c.default(w(H.data));U.readUByte();for(var K=0,G=0,ee=!1,de=0;!ee&&U.bytesAvailable>1;){K=0;do de=U.readUByte(),K+=de;while(de===255);G=0;do de=U.readUByte(),G+=de;while(de===255);if(K===4&&U.bytesAvailable!==0){ee=!0;var ge=U.readUByte();if(ge===181){var Be=U.readUShort();if(Be===49){var Ue=U.readUInt();if(Ue===1195456820){var Le=U.readUByte();if(Le===3){for(var Me=U.readUByte(),Pe=U.readUByte(),be=31&Me,ke=[Me,Pe],te=0;te<be;te++)ke.push(U.readUByte()),ke.push(U.readUByte()),ke.push(U.readUByte());h(S._txtTrack.samples,{type:3,pts:x.pts,bytes:ke})}}}}}else if(K===5&&U.bytesAvailable!==0){if(ee=!0,G>16){for(var pe=[],ae=0;ae<16;ae++)pe.push(U.readUByte().toString(16)),(ae===3||ae===5||ae===7||ae===9)&&pe.push("-");for(var _e=G-16,Ie=new Uint8Array(_e),Fe=0;Fe<_e;Fe++)Ie[Fe]=U.readUByte();h(S._txtTrack.samples,{pts:x.pts,payloadType:K,uuid:pe.join(""),userData:Object(E.utf8ArrayToStr)(Ie),userDataBytes:Ie})}}else if(G<U.bytesAvailable)for(var Xe=0;Xe<G;Xe++)U.readUByte()}break}case 7:if(P=!0,B=!0,M&&I&&(I.debug+="SPS "),!C.sps){var Ge=new c.default(H.data),ze=Ge.readSPS();C.width=ze.width,C.height=ze.height,C.pixelRatio=ze.pixelRatio,C.sps=[H.data],C.duration=S._duration;for(var Re=H.data.subarray(1,4),Se="avc1.",Te=0;Te<3;Te++){var Ee=Re[Te].toString(16);Ee.length<2&&(Ee="0"+Ee),Se+=Ee}C.codec=Se}break;case 8:P=!0,M&&I&&(I.debug+="PPS "),C.pps||(C.pps=[H.data]);break;case 9:P=!1,C.audFound=!0,I&&f(I,C),I=S.avcSample=r(!1,x.pts,x.dts,M?"AUD ":"");break;case 12:P=!1;break;default:P=!1,I&&(I.debug+="unknown NAL "+H.type+" ");break}if(I&&P){var $=I.units;$.push(H)}}),b&&I&&(f(I,C),this.avcSample=null)},T.getLastNalUnit=function(){var x,b=this.avcSample,S;if(!b||b.units.length===0){var C=this._avcTrack.samples;b=C[C.length-1]}if((x=b)!==null&&x!==void 0&&x.units){var g=b.units;S=g[g.length-1]}return S},T.parseAVCNALu=function(x){var b=x.byteLength,S=this._avcTrack,C=S.naluState||0,g=C,M=[],I=0,P,B,H,F=-1,W=0;for(C===-1&&(F=0,W=x[0]&31,C=0,I=1);I<b;){if(P=x[I++],!C){C=P?0:1;continue}if(C===1){C=P?0:2;continue}if(!P)C=3;else if(P===1){if(F>=0){var U={data:x.subarray(F,I-C-1),type:W};M.push(U)}else{var K=this.getLastNalUnit();if(K&&(g&&I<=4-g&&(K.state&&(K.data=K.data.subarray(0,K.data.byteLength-g))),B=I-C-1,B>0)){var G=new Uint8Array(K.data.byteLength+B);G.set(K.data,0),G.set(x.subarray(0,B),K.data.byteLength),K.data=G,K.state=0}}I<b?(H=x[I]&31,F=I,W=H,C=0):C=-1}else C=0}if(F>=0&&C>=0){var ee={data:x.subarray(F,b),type:W,state:C};M.push(ee)}if(M.length===0){var de=this.getLastNalUnit();if(de){var ge=new Uint8Array(de.data.byteLength+x.byteLength);ge.set(de.data,0),ge.set(x,de.data.byteLength),de.data=ge}}return S.naluState=C,M},T.parseAACPES=function(x){var b=0,S=this._audioTrack,C=this.aacOverFlow,g=x.data;if(C){this.aacOverFlow=null;var M=C.sample.unit.byteLength,I=Math.min(C.missing,M),P=M-I;C.sample.unit.set(g.subarray(0,I),P),S.samples.push(C.sample),b=C.missing}var B,H;for(B=b,H=g.length;B<H-1&&!R.isHeader(g,B);B++);if(B!==b){var F,W;if(B<H-1?(F="AAC PES did not start with ADTS header,offset:"+B,W=!1):(F="no ADTS header found in AAC PES",W=!0),o.logger.warn("parsing error:"+F),this.observer.emit(p.Events.ERROR,p.Events.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:W,reason:F}),W)return}R.initTrackConfig(S,this.observer,g,B,this.audioCodec);var U;if(x.pts!==void 0)U=x.pts;else if(C){var K=R.getFrameDuration(S.samplerate);U=C.sample.pts+K}else{o.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;B<H;)if(R.isHeader(g,B)){if(B+5<H){var ee=R.appendFrame(S,g,B,U,G);if(ee)if(ee.missing)this.aacOverFlow=ee;else{B+=ee.length,G++;continue}}break}else B++},T.parseMPEGPES=function(x){var b=x.data,S=b.length,C=0,g=0,M=x.pts;if(M===void 0){o.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;g<S;)if(O.isHeader(b,g)){var I=O.appendFrame(this._audioTrack,b,g,M,C);if(I)g+=I.length,C++;else break}else g++},T.parseID3PES=function(x){if(x.pts===void 0){o.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(x)},m}();l.minProbeByteLength=188;function r(m,T,A,x){return{key:m,frame:!1,pts:T,dts:A,units:[],debug:x,length:0}}function n(m,T){return(m[T+10]&31)<<8|m[T+11]}function a(m,T,A,x){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},S=(m[T+1]&15)<<8|m[T+2],C=T+3+S-4,g=(m[T+10]&15)<<8|m[T+11];for(T+=12+g;T<C;){var M=(m[T+1]&31)<<8|m[T+2];switch(m[T]){case 207:if(!x){o.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=M);break;case 21:b.id3===-1&&(b.id3=M);break;case 219:if(!x){o.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=M);break;case 3:case 4:A?b.audio===-1&&(b.audio=M,b.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}T+=((m[T+3]&15)<<8|m[T+4])+5}return b}function i(m){var T=0,A,x,b,S,C,g=m.data;if(!m||m.size===0)return null;for(;g[0].length<19&&g.length>1;){var M=new Uint8Array(g[0].length+g[1].length);M.set(g[0]),M.set(g[1],g[0].length),g[0]=M,g.splice(1,1)}A=g[0];var I=(A[0]<<16)+(A[1]<<8)+A[2];if(I===1){if(x=(A[4]<<8)+A[5],x&&x>m.size-6)return null;var P=A[7];P&192&&(S=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,P&64?(C=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,S-C>60*9e4&&(o.logger.warn(Math.round((S-C)/9e4)+"s delta between PTS and DTS, align them"),S=C)):C=S),b=A[8];var B=b+9;if(m.size<=B)return null;m.size-=B;for(var H=new Uint8Array(m.size),F=0,W=g.length;F<W;F++){A=g[F];var U=A.byteLength;if(B)if(B>U){B-=U;continue}else A=A.subarray(B),U-=B,B=0;H.set(A,T),T+=U}return x&&(x-=b+3),{data:H,pts:S,dts:C,len:x}}return null}function f(m,T){if(m.units.length&&m.frame){if(m.pts===void 0){var A=T.samples,x=A.length;if(x){var b=A[x-1];m.pts=b.pts,m.dts=b.dts}else{T.dropped++;return}}T.samples.push(m)}m.debug.length&&o.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function h(m,T){var A=m.length;if(A>0){if(T.pts>=m[A-1].pts)m.push(T);else for(var x=A-1;x>=0;x--)if(T.pts<m[x].pts){m.splice(x,0,T);break}}else m.push(T)}function w(m){for(var T=m.byteLength,A=[],x=1;x<T-2;)m[x]===0&&m[x+1]===0&&m[x+2]===3?(A.push(x+2),x+=2):x++;if(A.length===0)return m;var b=T-A.length,S=new Uint8Array(b),C=0;for(x=0;x<b;C++,x++)C===A[0]&&(C++,A.shift()),S[x]=m[C];return S}k.default=l},"./src/errors.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ErrorTypes",function(){return R}),D.d(k,"ErrorDetails",function(){return O});var R;(function(c){c.NETWORK_ERROR="networkError",c.MEDIA_ERROR="mediaError",c.KEY_SYSTEM_ERROR="keySystemError",c.MUX_ERROR="muxError",c.OTHER_ERROR="otherError"})(R||(R={}));var O;(function(c){c.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",c.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",c.KEY_SYSTEM_NO_SESSION="keySystemNoSession",c.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",c.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",c.MANIFEST_LOAD_ERROR="manifestLoadError",c.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",c.MANIFEST_PARSING_ERROR="manifestParsingError",c.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",c.LEVEL_EMPTY_ERROR="levelEmptyError",c.LEVEL_LOAD_ERROR="levelLoadError",c.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",c.LEVEL_SWITCH_ERROR="levelSwitchError",c.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",c.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",c.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",c.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",c.FRAG_LOAD_ERROR="fragLoadError",c.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",c.FRAG_DECRYPT_ERROR="fragDecryptError",c.FRAG_PARSING_ERROR="fragParsingError",c.REMUX_ALLOC_ERROR="remuxAllocError",c.KEY_LOAD_ERROR="keyLoadError",c.KEY_LOAD_TIMEOUT="keyLoadTimeOut",c.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",c.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",c.BUFFER_APPEND_ERROR="bufferAppendError",c.BUFFER_APPENDING_ERROR="bufferAppendingError",c.BUFFER_STALLED_ERROR="bufferStalledError",c.BUFFER_FULL_ERROR="bufferFullError",c.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",c.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",c.INTERNAL_EXCEPTION="internalException",c.INTERNAL_ABORTED="aborted",c.UNKNOWN="unknown"})(O||(O={}))},"./src/events.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"Events",function(){return R});var R;(function(O){O.MEDIA_ATTACHING="hlsMediaAttaching",O.MEDIA_ATTACHED="hlsMediaAttached",O.MEDIA_DETACHING="hlsMediaDetaching",O.MEDIA_DETACHED="hlsMediaDetached",O.BUFFER_RESET="hlsBufferReset",O.BUFFER_CODECS="hlsBufferCodecs",O.BUFFER_CREATED="hlsBufferCreated",O.BUFFER_APPENDING="hlsBufferAppending",O.BUFFER_APPENDED="hlsBufferAppended",O.BUFFER_EOS="hlsBufferEos",O.BUFFER_FLUSHING="hlsBufferFlushing",O.BUFFER_FLUSHED="hlsBufferFlushed",O.MANIFEST_LOADING="hlsManifestLoading",O.MANIFEST_LOADED="hlsManifestLoaded",O.MANIFEST_PARSED="hlsManifestParsed",O.LEVEL_SWITCHING="hlsLevelSwitching",O.LEVEL_SWITCHED="hlsLevelSwitched",O.LEVEL_LOADING="hlsLevelLoading",O.LEVEL_LOADED="hlsLevelLoaded",O.LEVEL_UPDATED="hlsLevelUpdated",O.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",O.LEVELS_UPDATED="hlsLevelsUpdated",O.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",O.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",O.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",O.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",O.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",O.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",O.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",O.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",O.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",O.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",O.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",O.CUES_PARSED="hlsCuesParsed",O.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",O.INIT_PTS_FOUND="hlsInitPtsFound",O.FRAG_LOADING="hlsFragLoading",O.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",O.FRAG_LOADED="hlsFragLoaded",O.FRAG_DECRYPTED="hlsFragDecrypted",O.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",O.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",O.FRAG_PARSING_METADATA="hlsFragParsingMetadata",O.FRAG_PARSED="hlsFragParsed",O.FRAG_BUFFERED="hlsFragBuffered",O.FRAG_CHANGED="hlsFragChanged",O.FPS_DROP="hlsFpsDrop",O.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",O.ERROR="hlsError",O.DESTROYING="hlsDestroying",O.KEY_LOADING="hlsKeyLoading",O.KEY_LOADED="hlsKeyLoaded",O.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",O.BACK_BUFFER_REACHED="hlsBackBufferReached"})(R||(R={}))},"./src/hls.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return m});var R=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(R),c=D("./src/loader/playlist-loader.ts"),E=D("./src/loader/key-loader.ts"),y=D("./src/controller/id3-track-controller.ts"),p=D("./src/controller/latency-controller.ts"),u=D("./src/controller/level-controller.ts"),o=D("./src/controller/fragment-tracker.ts"),d=D("./src/controller/stream-controller.ts"),s=D("./src/is-supported.ts"),l=D("./src/utils/logger.ts"),r=D("./src/config.ts"),n=D("./node_modules/eventemitter3/index.js"),a=D.n(n),i=D("./src/events.ts"),f=D("./src/errors.ts");function h(T,A){for(var x=0;x<A.length;x++){var b=A[x];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(T,b.key,b)}}function w(T,A,x){return A&&h(T.prototype,A),x&&h(T,x),T}var m=function(){T.isSupported=function(){return Object(s.isSupported)()};function T(x){x===void 0&&(x={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new n.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 b=this.config=Object(r.mergeConfig)(T.DefaultConfig,x);this.userConfig=x,Object(l.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(r.enableStreamingMode)(b);var S=b.abrController,C=b.bufferController,g=b.capLevelController,M=b.fpsController,I=this.abrController=new S(this),P=this.bufferController=new C(this),B=this.capLevelController=new g(this),H=new M(this),F=new c.default(this),W=new E.default(this),U=new y.default(this),K=this.levelController=new u.default(this),G=new o.FragmentTracker(this),ee=this.streamController=new d.default(this,G);B.setStreamController(ee),H.setStreamController(ee);var de=[K,ee];this.networkControllers=de;var ge=[F,W,I,P,B,H,U,G];this.audioTrackController=this.createController(b.audioTrackController,null,de),this.createController(b.audioStreamController,G,de),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,de),this.createController(b.subtitleStreamController,G,de),this.createController(b.timelineController,null,ge),this.emeController=this.createController(b.emeController,null,ge),this.cmcdController=this.createController(b.cmcdController,null,ge),this.latencyController=this.createController(p.default,null,ge),this.coreComponents=ge}var A=T.prototype;return A.createController=function(b,S,C){if(b){var g=S?new b(this,S):new b(this);return C&&C.push(g),g}return null},A.on=function(b,S,C){C===void 0&&(C=this),this._emitter.on(b,S,C)},A.once=function(b,S,C){C===void 0&&(C=this),this._emitter.once(b,S,C)},A.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},A.off=function(b,S,C,g){C===void 0&&(C=this),this._emitter.off(b,S,C,g)},A.listeners=function(b){return this._emitter.listeners(b)},A.emit=function(b,S,C){return this._emitter.emit(b,S,C)},A.trigger=function(b,S){if(this.config.debug)return this.emit(b,b,S);try{return this.emit(b,b,S)}catch(C){l.logger.error("An internal error happened while handling event "+b+'. Error message: "'+C.message+'". Here is a stacktrace:',C),this.trigger(i.Events.ERROR,{type:f.ErrorTypes.OTHER_ERROR,details:f.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:C})}return!1},A.listenerCount=function(b){return this._emitter.listenerCount(b)},A.destroy=function(){l.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},A.attachMedia=function(b){l.logger.log("attachMedia"),this._media=b,this.trigger(i.Events.MEDIA_ATTACHING,{media:b})},A.detachMedia=function(){l.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(b){this.stopLoad();var S=this.media,C=this.url,g=this.url=R.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});l.logger.log("loadSource:"+g),S&&C&&C!==g&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(S)),this.trigger(i.Events.MANIFEST_LOADING,{url:b})},A.startLoad=function(b){b===void 0&&(b=-1),l.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(S){S.startLoad(b)})},A.stopLoad=function(){l.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},A.swapAudioCodec=function(){l.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){l.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},A.removeLevel=function(b,S){S===void 0&&(S=0),this.levelController.removeLevel(b,S)},w(T,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){l.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){l.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){l.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){l.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){l.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var S=!!b;S!==this.config.capLevelToPlayerSize&&(S?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=S)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(l.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,S=this.config.minAutoBitrate;if(!b)return 0;for(var C=b.length,g=0;g<C;g++)if(b[g].maxBitrate>S)return g;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,S=this.autoLevelCapping,C;return S===-1&&b&&b.length?C=b.length-1:C=S,C}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var S=this.audioTrackController;S&&(S.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var S=this.subtitleTrackController;S&&(S.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var S=this.subtitleTrackController;S&&(S.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return i.Events}},{key:"ErrorTypes",get:function(){return f.ErrorTypes}},{key:"ErrorDetails",get:function(){return f.ErrorDetails}},{key:"DefaultConfig",get:function(){return T.defaultConfig?T.defaultConfig:r.hlsDefaultConfig},set:function(b){T.defaultConfig=b}}]),T}();m.defaultConfig=void 0},"./src/is-supported.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isSupported",function(){return c}),D.d(k,"changeTypeSupported",function(){return E});var R=D("./src/utils/mediasource-helper.ts");function O(){return self.SourceBuffer||self.WebKitSourceBuffer}function c(){var y=Object(R.getMediaSource)();if(!y)return!1;var p=O(),u=y&&typeof y.isTypeSupported=="function"&&y.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),o=!p||p.prototype&&typeof p.prototype.appendBuffer=="function"&&typeof p.prototype.remove=="function";return!!u&&!!o}function E(){var y,p=O();return typeof(p==null||((y=p.prototype)===null||y===void 0)?void 0:y.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return l}),D.d(k,"LoadError",function(){return n});var R=D("./src/polyfills/number.ts"),O=D("./src/errors.ts");function c(a,i){a.prototype=Object.create(i.prototype),a.prototype.constructor=a,o(a,i)}function E(a){var i=typeof Map=="function"?new Map:void 0;return E=function(h){if(h===null||!u(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(h))return i.get(h);i.set(h,w)}function w(){return y(h,arguments,d(this).constructor)}return w.prototype=Object.create(h.prototype,{constructor:{value:w,enumerable:!1,writable:!0,configurable:!0}}),o(w,h)},E(a)}function y(a,i,f){return p()?y=Reflect.construct:y=function(w,m,T){var A=[null];A.push.apply(A,m);var x=Function.bind.apply(w,A),b=new x;return T&&o(b,T.prototype),b},y.apply(null,arguments)}function p(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}function u(a){return Function.toString.call(a).indexOf("[native code]")!==-1}function o(a,i){return o=Object.setPrototypeOf||function(h,w){return h.__proto__=w,h},o(a,i)}function d(a){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},d(a)}var s=Math.pow(2,17),l=function(){function a(f){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=f}var i=a.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(h,w){var m=this,T=h.url;if(!T)return Promise.reject(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var A=this.config,x=A.fLoader,b=A.loader;return new Promise(function(S,C){m.loader&&m.loader.destroy();var g=m.loader=h.loader=x?new x(A):new b(A),M=r(h),I={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:s};h.stats=g.stats,g.load(M,I,{onSuccess:function(B,H,F,W){m.resetLoader(h,g),S({frag:h,part:null,payload:B.data,networkDetails:W})},onError:function(B,H,F){m.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:B,networkDetails:F}))},onAbort:function(B,H,F){m.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:F}))},onTimeout:function(B,H,F){m.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:F}))},onProgress:function(B,H,F,W){w&&w({frag:h,part:null,payload:F,networkDetails:W})}})})},i.loadPart=function(h,w,m){var T=this;this.abort();var A=this.config,x=A.fLoader,b=A.loader;return new Promise(function(S,C){T.loader&&T.loader.destroy();var g=T.loader=h.loader=x?new x(A):new b(A),M=r(h,w),I={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:s};w.stats=g.stats,g.load(M,I,{onSuccess:function(B,H,F,W){T.resetLoader(h,g),T.updateStatsFromPart(h,w);var U={frag:h,part:w,payload:B.data,networkDetails:W};m(U),S(U)},onError:function(B,H,F){T.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:w,response:B,networkDetails:F}))},onAbort:function(B,H,F){h.stats.aborted=w.stats.aborted,T.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:w,networkDetails:F}))},onTimeout:function(B,H,F){T.resetLoader(h,g),C(new n({type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:w,networkDetails:F}))}})})},i.updateStatsFromPart=function(h,w){var m=h.stats,T=w.stats,A=T.total;if(m.loaded+=T.loaded,A){var x=Math.round(h.duration/w.duration),b=Math.min(Math.round(m.loaded/A),x),S=x-b,C=S*Math.round(m.loaded/b);m.total=m.loaded+C}else m.total=Math.max(m.loaded,m.total);var g=m.loading,M=T.loading;g.start?g.first+=M.first-M.start:(g.start=M.start,g.first=M.first),g.end=M.end},i.resetLoader=function(h,w){h.loader=null,this.loader===w&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),w.destroy()},a}();function r(a,i){i===void 0&&(i=null);var f=i||a,h={frag:a,part:i,responseType:"arraybuffer",url:f.url,headers:{},rangeStart:0,rangeEnd:0},w=f.byteRangeStartOffset,m=f.byteRangeEndOffset;return Object(R.isFiniteNumber)(w)&&Object(R.isFiniteNumber)(m)&&(h.rangeStart=w,h.rangeEnd=m),h}var n=function(a){c(i,a);function i(f){for(var h,w=arguments.length,m=new Array(w>1?w-1:0),T=1;T<w;T++)m[T-1]=arguments[T];return h=a.call.apply(a,[this].concat(m))||this,h.data=void 0,h.data=f,h}return i}(E(Error))},"./src/loader/fragment.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ElementaryStreamTypes",function(){return l}),D.d(k,"BaseSegment",function(){return r}),D.d(k,"Fragment",function(){return n}),D.d(k,"Part",function(){return a});var R=D("./src/polyfills/number.ts"),O=D("./node_modules/url-toolkit/src/url-toolkit.js"),c=D.n(O),E=D("./src/utils/logger.ts"),y=D("./src/loader/level-key.ts"),p=D("./src/loader/load-stats.ts");function u(i,f){i.prototype=Object.create(f.prototype),i.prototype.constructor=i,o(i,f)}function o(i,f){return o=Object.setPrototypeOf||function(w,m){return w.__proto__=m,w},o(i,f)}function d(i,f){for(var h=0;h<f.length;h++){var w=f[h];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(i,w.key,w)}}function s(i,f,h){return f&&d(i.prototype,f),h&&d(i,h),i}var l;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(l||(l={}));var r=function(){function i(h){var w;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(w={},w[l.AUDIO]=null,w[l.VIDEO]=null,w[l.AUDIOVIDEO]=null,w),this.baseurl=h}var f=i.prototype;return f.setByteRange=function(w,m){var T=w.split("@",2),A=[];T.length===1?A[0]=m?m.byteRangeEndOffset:0:A[0]=parseInt(T[1]),A[1]=parseInt(T[0])+A[0],this._byteRange=A},s(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(O.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(w){this._url=w}}]),i}(),n=function(i){u(f,i);function f(w,m){var T;return T=i.call(this,m)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new p.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=w,T}var h=f.prototype;return h.createInitializationVector=function(m){for(var T=new Uint8Array(16),A=12;A<16;A++)T[A]=m>>8*(15-A)&255;return T},h.setDecryptDataFromLevelKey=function(m,T){var A=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(A=y.LevelKey.fromURI(m.uri),A.method=m.method,A.iv=this.createInitializationVector(T),A.keyFormat="identity"),A},h.setElementaryStreamInfo=function(m,T,A,x,b,S){S===void 0&&(S=!1);var C=this.elementaryStreams,g=C[m];if(!g){C[m]={startPTS:T,endPTS:A,startDTS:x,endDTS:b,partial:S};return}g.startPTS=Math.min(g.startPTS,T),g.endPTS=Math.max(g.endPTS,A),g.startDTS=Math.min(g.startDTS,x),g.endDTS=Math.max(g.endDTS,b)},h.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[l.AUDIO]=null,m[l.VIDEO]=null,m[l.AUDIOVIDEO]=null},s(f,[{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(R.isFiniteNumber)(this.programDateTime))return null;var m=Object(R.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)}}]),f}(r),a=function(i){u(f,i);function f(h,w,m,T,A){var x;x=i.call(this,m)||this,x.fragOffset=0,x.duration=0,x.gap=!1,x.independent=!1,x.relurl=void 0,x.fragment=void 0,x.index=void 0,x.stats=new p.LoadStats,x.duration=h.decimalFloatingPoint("DURATION"),x.gap=h.bool("GAP"),x.independent=h.bool("INDEPENDENT"),x.relurl=h.enumeratedString("URI"),x.fragment=w,x.index=T;var b=h.enumeratedString("BYTERANGE");return b&&x.setByteRange(b,A),A&&(x.fragOffset=A.fragOffset+A.duration),x}return s(f,[{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)}}]),f}(r)},"./src/loader/key-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return E});var R=D("./src/events.ts"),O=D("./src/errors.ts"),c=D("./src/utils/logger.ts"),E=function(){function y(u){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=u,this._registerListeners()}var p=y.prototype;return p._registerListeners=function(){this.hls.on(R.Events.KEY_LOADING,this.onKeyLoading,this)},p._unregisterListeners=function(){this.hls.off(R.Events.KEY_LOADING,this.onKeyLoading)},p.destroy=function(){this._unregisterListeners();for(var o in this.loaders){var d=this.loaders[o];d&&d.destroy()}this.loaders={}},p.onKeyLoading=function(o,d){var s=d.frag,l=s.type,r=this.loaders[l];if(!s.decryptdata){c.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var n=s.decryptdata.uri;if(n!==this.decrypturl||this.decryptkey===null){var a=this.hls.config;if(r&&(c.logger.warn("abort previous key loader for type:"+l),r.abort()),!n){c.logger.warn("key uri is falsy");return}var i=a.loader,f=s.loader=this.loaders[l]=new i(a);this.decrypturl=n,this.decryptkey=null;var h={url:n,frag:s,responseType:"arraybuffer"},w={timeout:a.fragLoadingTimeOut,maxRetry:0,retryDelay:a.fragLoadingRetryDelay,maxRetryDelay:a.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};f.load(h,w,m)}else this.decryptkey&&(s.decryptdata.key=this.decryptkey,this.hls.trigger(R.Events.KEY_LOADED,{frag:s}))},p.loadsuccess=function(o,d,s){var l=s.frag;if(!l.decryptdata){c.logger.error("after key load, decryptdata unset");return}this.decryptkey=l.decryptdata.key=new Uint8Array(o.data),l.loader=null,delete this.loaders[l.type],this.hls.trigger(R.Events.KEY_LOADED,{frag:l})},p.loaderror=function(o,d){var s=d.frag,l=s.loader;l&&l.abort(),delete this.loaders[s.type],this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:s,response:o})},p.loadtimeout=function(o,d){var s=d.frag,l=s.loader;l&&l.abort(),delete this.loaders[s.type],this.hls.trigger(R.Events.ERROR,{type:O.ErrorTypes.NETWORK_ERROR,details:O.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:s})},y}()},"./src/loader/level-details.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"LevelDetails",function(){return y});var R=D("./src/polyfills/number.ts");function O(p,u){for(var o=0;o<u.length;o++){var d=u[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function c(p,u,o){return u&&O(p.prototype,u),o&&O(p,o),p}var E=10,y=function(){function p(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 u=p.prototype;return u.reloaded=function(d){if(!d){this.advanced=!0,this.updated=!0;return}var s=this.lastPartSn-d.lastPartSn,l=this.lastPartIndex-d.lastPartIndex;this.updated=this.endSN!==d.endSN||!!l||!!s,this.advanced=this.endSN>d.endSN||s>0||s===0&&l>0,this.updated||this.advanced?this.misses=Math.floor(d.misses*.6):this.misses=d.misses+1,this.availabilityDelay=d.availabilityDelay},c(p,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(R.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||E}},{key:"drift",get:function(){var d=this.driftEndTime-this.driftStartTime;if(d>0){var s=this.driftEnd-this.driftStart;return s*1e3/d}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var d;return(d=this.fragments)!==null&&d!==void 0&&d.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 d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var d;return(d=this.partList)!==null&&d!==void 0&&d.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),p}()},"./src/loader/level-key.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"LevelKey",function(){return y});var R=D("./node_modules/url-toolkit/src/url-toolkit.js"),O=D.n(R);function c(p,u){for(var o=0;o<u.length;o++){var d=u[o];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(p,d.key,d)}}function E(p,u,o){return u&&c(p.prototype,u),o&&c(p,o),p}var y=function(){p.fromURL=function(o,d){return new p(o,d)},p.fromURI=function(o){return new p(o)};function p(u,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(R.buildAbsoluteURL)(u,o,{alwaysNormalize:!0}):this._uri=u}return E(p,[{key:"uri",get:function(){return this._uri}}]),p}()},"./src/loader/load-stats.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"LoadStats",function(){return R});var R=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(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f});var R=D("./src/polyfills/number.ts"),O=D("./node_modules/url-toolkit/src/url-toolkit.js"),c=D.n(O),E=D("./src/loader/fragment.ts"),y=D("./src/loader/level-details.ts"),p=D("./src/loader/level-key.ts"),u=D("./src/utils/attr-list.ts"),o=D("./src/utils/logger.ts"),d=D("./src/utils/codecs.ts"),s=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,l=/#EXT-X-MEDIA:(.*)/g,r=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),n=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),a=/\.(mp4|m4s|m4v|m4a)$/i;function i(A){var x,b;return a.test((x=(b=O.parseURL(A))===null||b===void 0?void 0:b.path)!=null?x:"")}var f=function(){function A(){}return A.findGroup=function(b,S){for(var C=0;C<b.length;C++){var g=b[C];if(g.id===S)return g}},A.convertAVC1ToAVCOTI=function(b){var S=b.split(".");if(S.length>2){var C=S.shift()+".";return C+=parseInt(S.shift()).toString(16),C+=("000"+parseInt(S.shift()).toString(16)).substr(-4),C}return b},A.resolve=function(b,S){return O.buildAbsoluteURL(S,b,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(b,S){var C=[],g={},M=!1;s.lastIndex=0;for(var I;(I=s.exec(b))!=null;)if(I[1]){var P=new u.AttrList(I[1]),B={attrs:P,bitrate:P.decimalInteger("AVERAGE-BANDWIDTH")||P.decimalInteger("BANDWIDTH"),name:P.NAME,url:A.resolve(I[2],S)},H=P.decimalResolution("RESOLUTION");H&&(B.width=H.width,B.height=H.height),h((P.CODECS||"").split(/[ ,]+/).filter(function(W){return W}),B),B.videoCodec&&B.videoCodec.indexOf("avc1")!==-1&&(B.videoCodec=A.convertAVC1ToAVCOTI(B.videoCodec)),C.push(B)}else if(I[3]){var F=new u.AttrList(I[3]);F["DATA-ID"]&&(M=!0,g[F["DATA-ID"]]=F)}return{levels:C,sessionData:M?g:null}},A.parseMasterPlaylistMedia=function(b,S,C,g){g===void 0&&(g=[]);var M,I=[],P=0;for(l.lastIndex=0;(M=l.exec(b))!==null;){var B=new u.AttrList(M[1]);if(B.TYPE===C){var H={attrs:B,bitrate:0,id:P++,groupId:B["GROUP-ID"],instreamId:B["INSTREAM-ID"],name:B.NAME||B.LANGUAGE||"",type:C,default:B.bool("DEFAULT"),autoselect:B.bool("AUTOSELECT"),forced:B.bool("FORCED"),lang:B.LANGUAGE,url:B.URI?A.resolve(B.URI,S):""};if(g.length){var F=A.findGroup(g,H.groupId)||g[0];w(H,F,"audioCodec"),w(H,F,"textCodec")}I.push(H)}}return I},A.parseLevelPlaylist=function(b,S,C,g,M){var I=new y.LevelDetails(S),P=I.fragments,B=null,H=0,F=0,W=0,U=0,K=null,G=new E.Fragment(g,S),ee,de,ge,Be=-1,Ue=!1;for(r.lastIndex=0,I.m3u8=b;(ee=r.exec(b))!==null;){Ue&&(Ue=!1,G=new E.Fragment(g,S),G.start=W,G.sn=H,G.cc=U,G.level=C,B&&(G.initSegment=B,G.rawProgramDateTime=B.rawProgramDateTime));var Le=ee[1];if(Le){G.duration=parseFloat(Le);var Me=(" "+ee[2]).slice(1);G.title=Me||null,G.tagList.push(Me?["INF",Le,Me]:["INF",Le])}else if(ee[3])Object(R.isFiniteNumber)(G.duration)&&(G.start=W,ge&&(G.levelkey=ge),G.sn=H,G.level=C,G.cc=U,G.urlId=M,P.push(G),G.relurl=(" "+ee[3]).slice(1),T(G,K),K=G,W+=G.duration,H++,F=0,Ue=!0);else if(ee[4]){var Pe=(" "+ee[4]).slice(1);K?G.setByteRange(Pe,K):G.setByteRange(Pe)}else if(ee[5])G.rawProgramDateTime=(" "+ee[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),Be===-1&&(Be=P.length);else{if(ee=ee[0].match(n),!ee){o.logger.warn("No matches on slow regex match for level playlist!");continue}for(de=1;de<ee.length&&!(typeof ee[de]!="undefined");de++);var be=(" "+ee[de]).slice(1),ke=(" "+ee[de+1]).slice(1),te=ee[de+2]?(" "+ee[de+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":I.type=ke.toUpperCase();break;case"MEDIA-SEQUENCE":H=I.startSN=parseInt(ke);break;case"SKIP":{var pe=new u.AttrList(ke),ae=pe.decimalInteger("SKIPPED-SEGMENTS");if(Object(R.isFiniteNumber)(ae)){I.skippedSegments=ae;for(var _e=ae;_e--;)P.unshift(null);H+=ae}var Ie=pe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ie&&(I.recentlyRemovedDateranges=Ie.split(" "));break}case"TARGETDURATION":I.targetduration=parseFloat(ke);break;case"VERSION":I.version=parseInt(ke);break;case"EXTM3U":break;case"ENDLIST":I.live=!1;break;case"#":(ke||te)&&G.tagList.push(te?[ke,te]:[ke]);break;case"DIS":U++;case"GAP":G.tagList.push([be]);break;case"BITRATE":G.tagList.push([be,ke]);break;case"DISCONTINUITY-SEQ":U=parseInt(ke);break;case"KEY":{var Fe,Xe=new u.AttrList(ke),Ge=Xe.enumeratedString("METHOD"),ze=Xe.URI,Re=Xe.hexadecimalInteger("IV"),Se=Xe.enumeratedString("KEYFORMATVERSIONS"),Te=Xe.enumeratedString("KEYID"),Ee=(Fe=Xe.enumeratedString("KEYFORMAT"))!=null?Fe:"identity",$=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if($.indexOf(Ee)>-1){o.logger.warn("Keyformat "+Ee+" is not supported from the manifest");continue}else if(Ee!=="identity")continue;Ge&&(ge=p.LevelKey.fromURL(S,ze),ze&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ge)>=0&&(ge.method=Ge,ge.keyFormat=Ee,Te&&(ge.keyID=Te),Se&&(ge.keyFormatVersions=Se),ge.iv=Re));break}case"START":{var fe=new u.AttrList(ke),J=fe.decimalFloatingPoint("TIME-OFFSET");Object(R.isFiniteNumber)(J)&&(I.startTimeOffset=J);break}case"MAP":{var Ae=new u.AttrList(ke);G.relurl=Ae.URI,Ae.BYTERANGE&&G.setByteRange(Ae.BYTERANGE),G.level=C,G.sn="initSegment",ge&&(G.levelkey=ge),G.initSegment=null,B=G,Ue=!0;break}case"SERVER-CONTROL":{var We=new u.AttrList(ke);I.canBlockReload=We.bool("CAN-BLOCK-RELOAD"),I.canSkipUntil=We.optionalFloat("CAN-SKIP-UNTIL",0),I.canSkipDateRanges=I.canSkipUntil>0&&We.bool("CAN-SKIP-DATERANGES"),I.partHoldBack=We.optionalFloat("PART-HOLD-BACK",0),I.holdBack=We.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new u.AttrList(ke);I.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ne=I.partList;Ne||(Ne=I.partList=[]);var et=F>0?Ne[Ne.length-1]:void 0,ne=F++,xe=new E.Part(new u.AttrList(ke),G,S,ne,et);Ne.push(xe),G.duration+=xe.duration;break}case"PRELOAD-HINT":{var Oe=new u.AttrList(ke);I.preloadHint=Oe;break}case"RENDITION-REPORT":{var he=new u.AttrList(ke);I.renditionReports=I.renditionReports||[],I.renditionReports.push(he);break}default:o.logger.warn("line parsed but not handled: "+ee);break}}}K&&!K.relurl?(P.pop(),W-=K.duration,I.partList&&(I.fragmentHint=K)):I.partList&&(T(G,K),G.cc=U,I.fragmentHint=G);var ce=P.length,le=P[0],Y=P[ce-1];if(W+=I.skippedSegments*I.targetduration,W>0&&ce&&Y){I.averagetargetduration=W/ce;var Z=Y.sn;I.endSN=Z!=="initSegment"?Z:0,le&&(I.startCC=le.cc,le.initSegment||I.fragments.every(function(z){return z.relurl&&i(z.relurl)})&&(o.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new E.Fragment(g,S),G.relurl=Y.relurl,G.level=C,G.sn="initSegment",le.initSegment=G,I.needSidxRanges=!0))}else I.endSN=0,I.startCC=0;return I.fragmentHint&&(W+=I.fragmentHint.duration),I.totalduration=W,I.endCC=U,Be>0&&m(P,Be),I},A}();function h(A,x){["video","audio","text"].forEach(function(b){var S=A.filter(function(g){return Object(d.isCodecType)(g,b)});if(S.length){var C=S.filter(function(g){return g.lastIndexOf("avc1",0)===0||g.lastIndexOf("mp4a",0)===0});x[b+"Codec"]=C.length>0?C[0]:S[0],A=A.filter(function(g){return S.indexOf(g)===-1})}}),x.unknownCodecs=A}function w(A,x,b){var S=x[b];S&&(A[b]=S)}function m(A,x){for(var b=A[x],S=x;S--;){var C=A[S];if(!C)return;C.programDateTime=b.programDateTime-C.duration*1e3,b=C}}function T(A,x){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):x!=null&&x.programDateTime&&(A.programDateTime=x.endProgramDateTime),Object(R.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/events.ts"),c=D("./src/errors.ts"),E=D("./src/utils/logger.ts"),y=D("./src/utils/mp4-tools.ts"),p=D("./src/loader/m3u8-parser.ts"),u=D("./src/types/loader.ts"),o=D("./src/utils/attr-list.ts");function d(r){var n=r.type;switch(n){case u.PlaylistContextType.AUDIO_TRACK:return u.PlaylistLevelType.AUDIO;case u.PlaylistContextType.SUBTITLE_TRACK:return u.PlaylistLevelType.SUBTITLE;default:return u.PlaylistLevelType.MAIN}}function s(r,n){var a=r.url;return(a===void 0||a.indexOf("data:")===0)&&(a=n.url),a}var l=function(){function r(a){this.hls=void 0,this.loaders=Object.create(null),this.hls=a,this.registerListeners()}var n=r.prototype;return n.registerListeners=function(){var i=this.hls;i.on(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(O.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.unregisterListeners=function(){var i=this.hls;i.off(O.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(O.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(O.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(O.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.createInternalLoader=function(i){var f=this.hls.config,h=f.pLoader,w=f.loader,m=h||w,T=new m(f);return i.loader=T,this.loaders[i.type]=T,T},n.getInternalLoader=function(i){return this.loaders[i.type]},n.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},n.destroyInternalLoaders=function(){for(var i in this.loaders){var f=this.loaders[i];f&&f.destroy(),this.resetInternalLoader(i)}},n.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},n.onManifestLoading=function(i,f){var h=f.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:u.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},n.onLevelLoading=function(i,f){var h=f.id,w=f.level,m=f.url,T=f.deliveryDirectives;this.load({id:h,groupId:null,level:w,responseType:"text",type:u.PlaylistContextType.LEVEL,url:m,deliveryDirectives:T})},n.onAudioTrackLoading=function(i,f){var h=f.id,w=f.groupId,m=f.url,T=f.deliveryDirectives;this.load({id:h,groupId:w,level:null,responseType:"text",type:u.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:T})},n.onSubtitleTrackLoading=function(i,f){var h=f.id,w=f.groupId,m=f.url,T=f.deliveryDirectives;this.load({id:h,groupId:w,level:null,responseType:"text",type:u.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:T})},n.load=function(i){var f,h=this.hls.config,w=this.getInternalLoader(i);if(w){var m=w.context;if(m&&m.url===i.url){E.logger.trace("[playlist-loader]: playlist request ongoing");return}E.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),w.abort()}var T,A,x,b;switch(i.type){case u.PlaylistContextType.MANIFEST:T=h.manifestLoadingMaxRetry,A=h.manifestLoadingTimeOut,x=h.manifestLoadingRetryDelay,b=h.manifestLoadingMaxRetryTimeout;break;case u.PlaylistContextType.LEVEL:case u.PlaylistContextType.AUDIO_TRACK:case u.PlaylistContextType.SUBTITLE_TRACK:T=0,A=h.levelLoadingTimeOut;break;default:T=h.levelLoadingMaxRetry,A=h.levelLoadingTimeOut,x=h.levelLoadingRetryDelay,b=h.levelLoadingMaxRetryTimeout;break}if(w=this.createInternalLoader(i),(f=i.deliveryDirectives)!==null&&f!==void 0&&f.part){var S;if(i.type===u.PlaylistContextType.LEVEL&&i.level!==null?S=this.hls.levels[i.level].details:i.type===u.PlaylistContextType.AUDIO_TRACK&&i.id!==null?S=this.hls.audioTracks[i.id].details:i.type===u.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(S=this.hls.subtitleTracks[i.id].details),S){var C=S.partTarget,g=S.targetduration;C&&g&&(A=Math.min(Math.max(C*3,g*.8)*1e3,A))}}var M={timeout:A,maxRetry:T,retryDelay:x,maxRetryDelay:b,highWaterMark:0},I={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};w.load(i,M,I)},n.loadsuccess=function(i,f,h,w){if(w===void 0&&(w=null),h.isSidxRequest){this.handleSidxRequest(i,h),this.handlePlaylistLoaded(i,f,h,w);return}this.resetInternalLoader(h.type);var m=i.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,h,"no EXTM3U delimiter",w);return}f.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,f,h,w):this.handleMasterPlaylist(i,f,h,w)},n.loaderror=function(i,f,h){h===void 0&&(h=null),this.handleNetworkError(f,h,!1,i)},n.loadtimeout=function(i,f,h){h===void 0&&(h=null),this.handleNetworkError(f,h,!0)},n.handleMasterPlaylist=function(i,f,h,w){var m=this.hls,T=i.data,A=s(i,h),x=p.default.parseMasterPlaylist(T,A),b=x.levels,S=x.sessionData;if(!b.length){this.handleManifestParsingError(i,h,"no level found in manifest",w);return}var C=b.map(function(H){return{id:H.attrs.AUDIO,audioCodec:H.audioCodec}}),g=b.map(function(H){return{id:H.attrs.SUBTITLES,textCodec:H.textCodec}}),M=p.default.parseMasterPlaylistMedia(T,A,"AUDIO",C),I=p.default.parseMasterPlaylistMedia(T,A,"SUBTITLES",g),P=p.default.parseMasterPlaylistMedia(T,A,"CLOSED-CAPTIONS");if(M.length){var B=M.some(function(H){return!H.url});!B&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(E.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),M.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new o.AttrList({}),bitrate:0,url:""}))}m.trigger(O.Events.MANIFEST_LOADED,{levels:b,audioTracks:M,subtitles:I,captions:P,url:A,stats:f,networkDetails:w,sessionData:S})},n.handleTrackOrLevelPlaylist=function(i,f,h,w){var m=this.hls,T=h.id,A=h.level,x=h.type,b=s(i,h),S=Object(R.isFiniteNumber)(T)?T:0,C=Object(R.isFiniteNumber)(A)?A:S,g=d(h),M=p.default.parseLevelPlaylist(i.data,b,C,g,S);if(!M.fragments.length){m.trigger(O.Events.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(x===u.PlaylistContextType.MANIFEST){var I={attrs:new o.AttrList({}),bitrate:0,details:M,name:"",url:b};m.trigger(O.Events.MANIFEST_LOADED,{levels:[I],audioTracks:[],url:b,stats:f,networkDetails:w,sessionData:null})}if(f.parsing.end=performance.now(),M.needSidxRanges){var P,B=(P=M.fragments[0].initSegment)===null||P===void 0?void 0:P.url;this.load({url:B,isSidxRequest:!0,type:x,level:A,levelDetails:M,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=M,this.handlePlaylistLoaded(i,f,h,w)},n.handleSidxRequest=function(i,f){var h=Object(y.parseSegmentIndex)(new Uint8Array(i.data));if(!h)return;var w=h.references,m=f.levelDetails;w.forEach(function(T,A){var x=T.info,b=m.fragments[A];b.byteRange.length===0&&b.setByteRange(String(1+x.end-x.start)+"@"+String(x.start)),b.initSegment&&b.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},n.handleManifestParsingError=function(i,f,h,w){this.hls.trigger(O.Events.ERROR,{type:c.ErrorTypes.NETWORK_ERROR,details:c.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:f.type===u.PlaylistContextType.MANIFEST,url:i.url,reason:h,response:i,context:f,networkDetails:w})},n.handleNetworkError=function(i,f,h,w){h===void 0&&(h=!1),E.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var m=c.ErrorDetails.UNKNOWN,T=!1,A=this.getInternalLoader(i);switch(i.type){case u.PlaylistContextType.MANIFEST:m=h?c.ErrorDetails.MANIFEST_LOAD_TIMEOUT:c.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case u.PlaylistContextType.LEVEL:m=h?c.ErrorDetails.LEVEL_LOAD_TIMEOUT:c.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case u.PlaylistContextType.AUDIO_TRACK:m=h?c.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:c.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case u.PlaylistContextType.SUBTITLE_TRACK:m=h?c.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:c.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}A&&this.resetInternalLoader(i.type);var x={type:c.ErrorTypes.NETWORK_ERROR,details:m,fatal:T,url:i.url,loader:A,context:i,networkDetails:f};w&&(x.response=w),this.hls.trigger(O.Events.ERROR,x)},n.handlePlaylistLoaded=function(i,f,h,w){var m=h.type,T=h.level,A=h.id,x=h.groupId,b=h.loader,S=h.levelDetails,C=h.deliveryDirectives;if(!(S!=null&&S.targetduration)){this.handleManifestParsingError(i,h,"invalid target duration",w);return}if(!b)return;S.live&&(b.getCacheAge&&(S.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(S.ageHeader))&&(S.ageHeader=0));switch(m){case u.PlaylistContextType.MANIFEST:case u.PlaylistContextType.LEVEL:this.hls.trigger(O.Events.LEVEL_LOADED,{details:S,level:T||0,id:A||0,stats:f,networkDetails:w,deliveryDirectives:C});break;case u.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(O.Events.AUDIO_TRACK_LOADED,{details:S,id:A||0,groupId:x||"",stats:f,networkDetails:w,deliveryDirectives:C});break;case u.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(O.Events.SUBTITLE_TRACK_LOADED,{details:S,id:A||0,groupId:x||"",stats:f,networkDetails:w,deliveryDirectives:C});break}},r}();k.default=l},"./src/polyfills/number.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isFiniteNumber",function(){return R}),D.d(k,"MAX_SAFE_INTEGER",function(){return O});var R=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)},O=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(j,k,D){"use strict";D.r(k);var R=function(){function O(){}return O.getSilentFrame=function(E,y){switch(E){case"mp4a.40.2":if(y===1)return new Uint8Array([0,200,0,128,35,128]);if(y===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(y===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(y===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(y===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(y===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(y===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(y===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(y===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},O}();k.default=R},"./src/remux/mp4-generator.ts":function(j,k,D){"use strict";D.r(k);var R=Math.pow(2,32)-1,O=function(){function c(){}return c.init=function(){c.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 y;for(y in c.types)c.types.hasOwnProperty(y)&&(c.types[y]=[y.charCodeAt(0),y.charCodeAt(1),y.charCodeAt(2),y.charCodeAt(3)]);var p=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),u=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]);c.HDLR_TYPES={video:p,audio:u};var o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),d=new Uint8Array([0,0,0,0,0,0,0,0]);c.STTS=c.STSC=c.STCO=d,c.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),c.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),c.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),c.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),r=new Uint8Array([0,0,0,1]);c.FTYP=c.box(c.types.ftyp,s,r,s,l),c.DINF=c.box(c.types.dinf,c.box(c.types.dref,o))},c.box=function(y){for(var p=8,u=arguments.length,o=new Array(u>1?u-1:0),d=1;d<u;d++)o[d-1]=arguments[d];for(var s=o.length,l=s;s--;)p+=o[s].byteLength;var r=new Uint8Array(p);for(r[0]=p>>24&255,r[1]=p>>16&255,r[2]=p>>8&255,r[3]=p&255,r.set(y,4),s=0,p=8;s<l;s++)r.set(o[s],p),p+=o[s].byteLength;return r},c.hdlr=function(y){return c.box(c.types.hdlr,c.HDLR_TYPES[y])},c.mdat=function(y){return c.box(c.types.mdat,y)},c.mdhd=function(y,p){p*=y;var u=Math.floor(p/(R+1)),o=Math.floor(p%(R+1));return c.box(c.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,u>>24,u>>16&255,u>>8&255,u&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))},c.mdia=function(y){return c.box(c.types.mdia,c.mdhd(y.timescale,y.duration),c.hdlr(y.type),c.minf(y))},c.mfhd=function(y){return c.box(c.types.mfhd,new Uint8Array([0,0,0,0,y>>24,y>>16&255,y>>8&255,y&255]))},c.minf=function(y){return y.type==="audio"?c.box(c.types.minf,c.box(c.types.smhd,c.SMHD),c.DINF,c.stbl(y)):c.box(c.types.minf,c.box(c.types.vmhd,c.VMHD),c.DINF,c.stbl(y))},c.moof=function(y,p,u){return c.box(c.types.moof,c.mfhd(y),c.traf(u,p))},c.moov=function(y){for(var p=y.length,u=[];p--;)u[p]=c.trak(y[p]);return c.box.apply(null,[c.types.moov,c.mvhd(y[0].timescale,y[0].duration)].concat(u).concat(c.mvex(y)))},c.mvex=function(y){for(var p=y.length,u=[];p--;)u[p]=c.trex(y[p]);return c.box.apply(null,[c.types.mvex].concat(u))},c.mvhd=function(y,p){p*=y;var u=Math.floor(p/(R+1)),o=Math.floor(p%(R+1)),d=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,y>>24&255,y>>16&255,y>>8&255,y&255,u>>24,u>>16&255,u>>8&255,u&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 c.box(c.types.mvhd,d)},c.sdtp=function(y){var p=y.samples||[],u=new Uint8Array(4+p.length),o,d;for(o=0;o<p.length;o++)d=p[o].flags,u[o+4]=d.dependsOn<<4|d.isDependedOn<<2|d.hasRedundancy;return c.box(c.types.sdtp,u)},c.stbl=function(y){return c.box(c.types.stbl,c.stsd(y),c.box(c.types.stts,c.STTS),c.box(c.types.stsc,c.STSC),c.box(c.types.stsz,c.STSZ),c.box(c.types.stco,c.STCO))},c.avc1=function(y){var p=[],u=[],o,d,s;for(o=0;o<y.sps.length;o++)d=y.sps[o],s=d.byteLength,p.push(s>>>8&255),p.push(s&255),p=p.concat(Array.prototype.slice.call(d));for(o=0;o<y.pps.length;o++)d=y.pps[o],s=d.byteLength,u.push(s>>>8&255),u.push(s&255),u=u.concat(Array.prototype.slice.call(d));var l=c.box(c.types.avcC,new Uint8Array([1,p[3],p[4],p[5],252|3,224|y.sps.length].concat(p).concat([y.pps.length]).concat(u))),r=y.width,n=y.height,a=y.pixelRatio[0],i=y.pixelRatio[1];return c.box(c.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,r>>8&255,r&255,n>>8&255,n&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]),l,c.box(c.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),c.box(c.types.pasp,new Uint8Array([a>>24,a>>16&255,a>>8&255,a&255,i>>24,i>>16&255,i>>8&255,i&255])))},c.esds=function(y){var p=y.config.length;return new Uint8Array([0,0,0,0,3,23+p,0,1,0,4,15+p,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([p]).concat(y.config).concat([6,1,2]))},c.mp4a=function(y){var p=y.samplerate;return c.box(c.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,p>>8&255,p&255,0,0]),c.box(c.types.esds,c.esds(y)))},c.mp3=function(y){var p=y.samplerate;return c.box(c.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,y.channelCount,0,16,0,0,0,0,p>>8&255,p&255,0,0]))},c.stsd=function(y){return y.type==="audio"?!y.isAAC&&y.codec==="mp3"?c.box(c.types.stsd,c.STSD,c.mp3(y)):c.box(c.types.stsd,c.STSD,c.mp4a(y)):c.box(c.types.stsd,c.STSD,c.avc1(y))},c.tkhd=function(y){var p=y.id,u=y.duration*y.timescale,o=y.width,d=y.height,s=Math.floor(u/(R+1)),l=Math.floor(u%(R+1));return c.box(c.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,p>>24&255,p>>16&255,p>>8&255,p&255,0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255,l>>24,l>>16&255,l>>8&255,l&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,d>>8&255,d&255,0,0]))},c.traf=function(y,p){var u=c.sdtp(y),o=y.id,d=Math.floor(p/(R+1)),s=Math.floor(p%(R+1));return c.box(c.types.traf,c.box(c.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),c.box(c.types.tfdt,new Uint8Array([1,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,s>>24,s>>16&255,s>>8&255,s&255])),c.trun(y,u.length+16+20+8+16+8+8),u)},c.trak=function(y){return y.duration=y.duration||4294967295,c.box(c.types.trak,c.tkhd(y),c.mdia(y))},c.trex=function(y){var p=y.id;return c.box(c.types.trex,new Uint8Array([0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},c.trun=function(y,p){var u=y.samples||[],o=u.length,d=12+16*o,s=new Uint8Array(d),l,r,n,a,i,f;for(p+=8+d,s.set([0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,p>>>24&255,p>>>16&255,p>>>8&255,p&255],0),l=0;l<o;l++)r=u[l],n=r.duration,a=r.size,i=r.flags,f=r.cts,s.set([n>>>24&255,n>>>16&255,n>>>8&255,n&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,f>>>24&255,f>>>16&255,f>>>8&255,f&255],12+16*l);return c.box(c.types.trun,s)},c.initSegment=function(y){c.types||c.init();var p=c.moov(y),u=new Uint8Array(c.FTYP.byteLength+p.byteLength);return u.set(c.FTYP),u.set(p,c.FTYP.byteLength),u},c}();O.types=void 0,O.HDLR_TYPES=void 0,O.STTS=void 0,O.STSC=void 0,O.STCO=void 0,O.STSZ=void 0,O.VMHD=void 0,O.SMHD=void 0,O.STSD=void 0,O.FTYP=void 0,O.DINF=void 0,k.default=O},"./src/remux/mp4-remuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return f}),D.d(k,"normalizePts",function(){return h});var R=D("./src/polyfills/number.ts"),O=D("./src/remux/aac-helper.ts"),c=D("./src/remux/mp4-generator.ts"),E=D("./src/events.ts"),y=D("./src/errors.ts"),p=D("./src/utils/logger.ts"),u=D("./src/types/loader.ts"),o=D("./src/utils/timescale-conversion.ts");function d(){return d=Object.assign||function(A){for(var x=1;x<arguments.length;x++){var b=arguments[x];for(var S in b)Object.prototype.hasOwnProperty.call(b,S)&&(A[S]=b[S])}return A},d.apply(this,arguments)}var s=10*1e3,l=1024,r=1152,n=null,a=null,i=!1,f=function(){function A(b,S,C,g){if(g===void 0&&(g=""),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=b,this.config=S,this.typeSupported=C,this.ISGenerated=!1,n===null){var M=navigator.userAgent||"",I=M.match(/Chrome\/(\d+)/i);n=I?parseInt(I[1]):0}if(a===null){var P=navigator.userAgent.match(/Safari\/(\d+)/i);a=P?parseInt(P[1]):0}i=!!n&&n<75||!!a&&a<600}var x=A.prototype;return x.destroy=function(){},x.resetTimeStamp=function(S){p.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=S},x.resetNextTimestamp=function(){p.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},x.resetInitSegment=function(){p.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},x.getVideoStartPts=function(S){var C=!1,g=S.reduce(function(M,I){var P=I.pts-M;return P<-4294967296?(C=!0,h(M,I.pts)):P>0?M:I.pts},S[0].pts);return C&&p.logger.debug("PTS rollover detected"),g},x.remux=function(S,C,g,M,I,P,B,H){var F,W,U,K,G,ee,de=I,ge=I,Be=S.pid>-1,Ue=C.pid>-1,Le=C.samples.length,Me=S.samples.length>0,Pe=Le>1,be=(!Be||Me)&&(!Ue||Pe)||this.ISGenerated||B;if(be){this.ISGenerated||(U=this.generateIS(S,C,I));var ke=this.isVideoContiguous,te=-1;if(Pe&&(te=w(C.samples),!ke&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,te>0){p.logger.warn("[mp4-remuxer]: Dropped "+te+" out of "+Le+" video samples due to a missing keyframe");var pe=this.getVideoStartPts(C.samples);C.samples=C.samples.slice(te),C.dropped+=te,ge+=(C.samples[0].pts-pe)/(C.timescale||9e4)}else te===-1&&(p.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),ee=!1);if(this.ISGenerated){if(Me&&Pe){var ae=this.getVideoStartPts(C.samples),_e=h(S.samples[0].pts,ae)-ae,Ie=_e/C.inputTimeScale;de+=Math.max(0,Ie),ge+=Math.max(0,-Ie)}if(Me){if(S.samplerate||(p.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(S,C,I)),W=this.remuxAudio(S,de,this.isAudioContiguous,P,Ue||Pe||H===u.PlaylistLevelType.AUDIO?ge:void 0),Pe){var Fe=W?W.endPTS-W.startPTS:0;C.inputTimeScale||(p.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(S,C,I)),F=this.remuxVideo(C,ge,ke,Fe)}}else Pe&&(F=this.remuxVideo(C,ge,ke,0));F&&(F.firstKeyFrame=te,F.independent=te!==-1)}}return this.ISGenerated&&(g.samples.length&&(G=this.remuxID3(g,I)),M.samples.length&&(K=this.remuxText(M,I))),{audio:W,video:F,initSegment:U,independent:ee,text:K,id3:G}},x.generateIS=function(S,C,g){var M=S.samples,I=C.samples,P=this.typeSupported,B={},H=!Object(R.isFiniteNumber)(this._initPTS),F="audio/mp4",W,U,K;if(H&&(W=U=Infinity),S.config&&M.length&&(S.timescale=S.samplerate,S.isAAC||(P.mpeg?(F="audio/mpeg",S.codec=""):P.mp3&&(S.codec="mp3")),B.audio={id:"audio",container:F,codec:S.codec,initSegment:!S.isAAC&&P.mpeg?new Uint8Array(0):c.default.initSegment([S]),metadata:{channelCount:S.channelCount}},H&&(K=S.inputTimeScale,W=U=M[0].pts-Math.round(K*g))),C.sps&&C.pps&&I.length&&(C.timescale=C.inputTimeScale,B.video={id:"main",container:"video/mp4",codec:C.codec,initSegment:c.default.initSegment([C]),metadata:{width:C.width,height:C.height}},H)){K=C.inputTimeScale;var G=this.getVideoStartPts(I),ee=Math.round(K*g);U=Math.min(U,h(I[0].dts,G)-ee),W=Math.min(W,G-ee)}if(Object.keys(B).length)return this.ISGenerated=!0,H&&(this._initPTS=W,this._initDTS=U),{tracks:B,initPTS:W,timescale:K}},x.remuxVideo=function(S,C,g,M){var I=S.inputTimeScale,P=S.samples,B=[],H=P.length,F=this._initPTS,W=this.nextAvcDts,U=8,K,G,ee,de=Number.POSITIVE_INFINITY,ge=Number.NEGATIVE_INFINITY,Be=0,Ue=!1;if(!g||W===null){var Le=C*I,Me=P[0].pts-h(P[0].dts,P[0].pts);W=Le-Me}for(var Pe=0;Pe<H;Pe++){var be=P[Pe];if(be.pts=h(be.pts-F,W),be.dts=h(be.dts-F,W),be.dts>be.pts){var ke=9e4*.2;Be=Math.max(Math.min(Be,be.pts-be.dts),-1*ke)}be.dts<P[Pe>0?Pe-1:Pe].dts&&(Ue=!0)}Ue&&P.sort(function(Ke,rt){var qe=Ke.dts-rt.dts,Je=Ke.pts-rt.pts;return qe||Je}),G=P[0].dts,ee=P[P.length-1].dts;var te=Math.round((ee-G)/(H-1));if(Be<0){if(Be<te*-2){p.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(o.toMsFromMpegTsClock)(-te,!0)+" ms");for(var pe=Be,ae=0;ae<H;ae++)P[ae].dts=pe=Math.max(pe,P[ae].pts-te),P[ae].pts=Math.max(pe,P[ae].pts)}else{p.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(o.toMsFromMpegTsClock)(Be,!0)+" ms to overcome this issue");for(var _e=0;_e<H;_e++)P[_e].dts=P[_e].dts+Be}G=P[0].dts}if(g){var Ie=G-W,Fe=Ie>te,Xe=Ie<-1;if(Fe||Xe){Fe?p.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(Ie,!0)+" ms ("+Ie+"dts) hole between fragments detected, filling it"):p.logger.warn("AVC: "+Object(o.toMsFromMpegTsClock)(-Ie,!0)+" ms ("+Ie+"dts) overlapping between fragments detected"),G=W;var Ge=P[0].pts-Ie;P[0].dts=G,P[0].pts=Ge,p.logger.log("Video: First PTS/DTS adjusted: "+Object(o.toMsFromMpegTsClock)(Ge,!0)+"/"+Object(o.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(o.toMsFromMpegTsClock)(Ie,!0)+" ms")}}i&&(G=Math.max(0,G));for(var ze=0,Re=0,Se=0;Se<H;Se++){for(var Te=P[Se],Ee=Te.units,$=Ee.length,fe=0,J=0;J<$;J++)fe+=Ee[J].data.length;Re+=fe,ze+=$,Te.length=fe,Te.dts=Math.max(Te.dts,G),Te.pts=Math.max(Te.pts,Te.dts,0),de=Math.min(Te.pts,de),ge=Math.max(Te.pts,ge)}ee=P[H-1].dts;var Ae=Re+4*ze+8,We;try{We=new Uint8Array(Ae)}catch(Ke){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Ae,reason:"fail allocating video mdat "+Ae});return}var Ye=new DataView(We.buffer);Ye.setUint32(0,Ae),We.set(c.default.types.mdat,4);for(var Ne=0;Ne<H;Ne++){for(var et=P[Ne],ne=et.units,xe=0,Oe=0,he=ne.length;Oe<he;Oe++){var ce=ne[Oe],le=ce.data,Y=ce.data.byteLength;Ye.setUint32(U,Y),U+=4,We.set(le,U),U+=Y,xe+=4+Y}if(Ne<H-1)K=P[Ne+1].dts-et.dts;else{var Z=this.config,z=et.dts-P[Ne>0?Ne-1:Ne].dts;if(Z.stretchShortVideoTrack&&this.nextAudioPts!==null){var oe=Math.floor(Z.maxBufferHole*I),Ce=(M?de+M*I:this.nextAudioPts)-et.pts;Ce>oe?(K=Ce-z,K<0&&(K=z),p.logger.log("[mp4-remuxer]: It is approximately "+Ce/90+" ms to the next segment; using duration "+K/90+" ms for the last video frame.")):K=z}else K=z}var X=Math.round(et.pts-et.dts);B.push(new m(et.key,K,xe,X))}if(B.length&&n&&n<70){var me=B[0].flags;me.dependsOn=2,me.isNonSync=0}console.assert(K!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=W=ee+K,this.isVideoContiguous=!0;var De=c.default.moof(S.sequenceNumber++,G,d({},S,{samples:B})),se="video",ve={data1:De,data2:We,startPTS:de/I,endPTS:(ge+K)/I,startDTS:G/I,endDTS:W/I,type:se,hasAudio:!1,hasVideo:!0,nb:B.length,dropped:S.dropped};return S.samples=[],S.dropped=0,console.assert(We.length,"MDAT length must not be zero"),ve},x.remuxAudio=function(S,C,g,M,I){var P=S.inputTimeScale,B=S.samplerate?S.samplerate:P,H=P/B,F=S.isAAC?l:r,W=F*H,U=this._initPTS,K=!S.isAAC&&this.typeSupported.mpeg,G=[],ee=S.samples,de=K?0:8,ge=this.nextAudioPts||-1,Be=C*P;if(this.isAudioContiguous=g=g||ee.length&&ge>0&&(M&&Math.abs(Be-ge)<9e3||Math.abs(h(ee[0].pts-U,Be)-ge)<20*W),ee.forEach(function(le){le.pts=h(le.pts-U,Be)}),!g||ge<0){if(ee=ee.filter(function(le){return le.pts>=0}),!ee.length)return;I===0?ge=0:M?ge=Math.max(0,Be):ge=ee[0].pts}if(S.isAAC)for(var Ue=I!==void 0,Le=this.config.maxAudioFramesDrift,Me=0,Pe=ge;Me<ee.length;Me++){var be=ee[Me],ke=be.pts,te=ke-Pe,pe=Math.abs(1e3*te/P);if(te<=-Le*W&&Ue)Me===0&&(p.logger.warn("Audio frame @ "+(ke/P).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*te/P)+" ms."),this.nextAudioPts=ge=Pe=ke);else if(te>=Le*W&&pe<s&&Ue){var ae=Math.round(te/W);Pe=ke-ae*W,Pe<0&&(ae--,Pe+=W),Me===0&&(this.nextAudioPts=ge=Pe),p.logger.warn("[mp4-remuxer]: Injecting "+ae+" audio frame @ "+(Pe/P).toFixed(3)+"s due to "+Math.round(1e3*te/P)+" ms gap.");for(var _e=0;_e<ae;_e++){var Ie=Math.max(Pe,0),Fe=O.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);Fe||(p.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Fe=be.unit.subarray()),ee.splice(Me,0,{unit:Fe,pts:Ie}),Pe+=W,Me++}}be.pts=Pe,Pe+=W}for(var Xe=null,Ge=null,ze,Re=0,Se=ee.length;Se--;)Re+=ee[Se].unit.byteLength;for(var Te=0,Ee=ee.length;Te<Ee;Te++){var $=ee[Te],fe=$.unit,J=$.pts;if(Ge!==null){var Ae=G[Te-1];Ae.duration=Math.round((J-Ge)/H)}else if(g&&S.isAAC&&(J=ge),Xe=J,Re>0){Re+=de;try{ze=new Uint8Array(Re)}catch(le){this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:y.ErrorTypes.MUX_ERROR,details:y.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Re,reason:"fail allocating audio mdat "+Re});return}if(!K){var We=new DataView(ze.buffer);We.setUint32(0,Re),ze.set(c.default.types.mdat,4)}}else return;ze.set(fe,de);var Ye=fe.byteLength;de+=Ye,G.push(new m(!0,F,Ye,0)),Ge=J}var Ne=G.length;if(!Ne)return;var et=G[G.length-1];this.nextAudioPts=ge=Ge+H*et.duration;var ne=K?new Uint8Array(0):c.default.moof(S.sequenceNumber++,Xe/H,d({},S,{samples:G}));S.samples=[];var xe=Xe/P,Oe=ge/P,he="audio",ce={data1:ne,data2:ze,startPTS:xe,endPTS:Oe,startDTS:xe,endDTS:Oe,type:he,hasAudio:!0,hasVideo:!1,nb:Ne};return this.isAudioContiguous=!0,console.assert(ze.length,"MDAT length must not be zero"),ce},x.remuxEmptyAudio=function(S,C,g,M){var I=S.inputTimeScale,P=S.samplerate?S.samplerate:I,B=I/P,H=this.nextAudioPts,F=(H!==null?H:M.startDTS*I)+this._initDTS,W=M.endDTS*I+this._initDTS,U=B*l,K=Math.ceil((W-F)/U),G=O.default.getSilentFrame(S.manifestCodec||S.codec,S.channelCount);if(p.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){p.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],de=0;de<K;de++){var ge=F+de*U;ee.push({unit:G,pts:ge,dts:ge})}return S.samples=ee,this.remuxAudio(S,C,g,!1)},x.remuxID3=function(S,C){var g=S.samples.length;if(!g)return;for(var M=S.inputTimeScale,I=this._initPTS,P=this._initDTS,B=0;B<g;B++){var H=S.samples[B];H.pts=h(H.pts-I,C*M)/M,H.dts=h(H.dts-P,C*M)/M}var F=S.samples;return S.samples=[],{samples:F}},x.remuxText=function(S,C){var g=S.samples.length;if(!g)return;for(var M=S.inputTimeScale,I=this._initPTS,P=0;P<g;P++){var B=S.samples[P];B.pts=h(B.pts-I,C*M)/M}S.samples.sort(function(F,W){return F.pts-W.pts});var H=S.samples;return S.samples=[],{samples:H}},A}();function h(A,x){var b;if(x===null)return A;for(x<A?b=-8589934592:b=8589934592;Math.abs(A-x)>4294967296;)A+=b;return A}function w(A){for(var x=0;x<A.length;x++)if(A[x].key)return x;return-1}var m=function(x,b,S,C){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=S,this.cts=C,this.flags=new T(x)},T=function(x){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=x?2:1,this.isNonSync=x?0:1}},"./src/remux/passthrough-remuxer.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/polyfills/number.ts"),O=D("./src/utils/mp4-tools.ts"),c=D("./src/loader/fragment.ts"),E=D("./src/utils/logger.ts"),y=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 d=o.prototype;return d.destroy=function(){},d.resetTimeStamp=function(l){this.initPTS=l,this.lastEndDTS=null},d.resetNextTimestamp=function(){this.lastEndDTS=null},d.resetInitSegment=function(l,r,n){this.audioCodec=r,this.videoCodec=n,this.generateInitSegment(l),this.emitInitSegment=!0},d.generateInitSegment=function(l){var r=this.audioCodec,n=this.videoCodec;if(!l||!l.byteLength){this.initTracks=void 0,this.initData=void 0;return}var a=this.initData=Object(O.parseInitSegment)(l);r||(r=u(a.audio,c.ElementaryStreamTypes.AUDIO)),n||(n=u(a.video,c.ElementaryStreamTypes.VIDEO));var i={};a.audio&&a.video?i.audiovideo={container:"video/mp4",codec:r+","+n,initSegment:l,id:"main"}:a.audio?i.audio={container:"audio/mp4",codec:r,initSegment:l,id:"audio"}:a.video?i.video={container:"video/mp4",codec:n,initSegment:l,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},d.remux=function(l,r,n,a,i){var f=this.initPTS,h=this.lastEndDTS,w={audio:void 0,video:void 0,text:a,id3:n,initSegment:void 0};Object(R.isFiniteNumber)(h)||(h=this.lastEndDTS=i||0);var m=r.samples;if(!m||!m.length)return w;var T={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(m),A=this.initData),!A||!A.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),w;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(R.isFiniteNumber)(f)||(this.initPTS=T.initPTS=f=p(A,m,h));var x=Object(O.getDuration)(m,A),b=h,S=x+b;Object(O.offsetStartDTS)(A,m,f),x>0?this.lastEndDTS=S:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var C=!!A.audio,g=!!A.video,M="";C&&(M+="audio"),g&&(M+="video");var I={data1:m,startPTS:b,startDTS:b,endPTS:S,endDTS:S,type:M,hasAudio:C,hasVideo:g,nb:1,dropped:0};return w.audio=I.type==="audio"?I:void 0,w.video=I.type!=="audio"?I:void 0,w.text=a,w.id3=n,w.initSegment=T,w},o}(),p=function(d,s,l){return Object(O.getStartDTS)(d,s)-l};function u(o,d){var s=o==null?void 0:o.codec;return s&&s.length>4?s:s==="hvc1"?"hvc1.1.c.L120.90":s==="av01"?"av01.0.04M.08":s==="avc1"||d===c.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}k.default=y},"./src/task-loop.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var c=O.prototype;return c.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},c.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},c.onHandlerDestroyed=function(){},c.hasInterval=function(){return!!this._tickInterval},c.hasNextTick=function(){return!!this._tickTimer},c.setInterval=function(y){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,y),!0)},c.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},c.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},c.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},c.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},c.doTick=function(){},O}()},"./src/types/cmcd.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"CMCDVersion",function(){return R}),D.d(k,"CMCDObjectType",function(){return O}),D.d(k,"CMCDStreamingFormat",function(){return c}),D.d(k,"CMCDStreamType",function(){return E});var R=1,O;(function(y){y.MANIFEST="m",y.AUDIO="a",y.VIDEO="v",y.MUXED="av",y.INIT="i",y.CAPTION="c",y.TIMED_TEXT="tt",y.KEY="k",y.OTHER="o"})(O||(O={}));var c;(function(y){y.DASH="d",y.HLS="h",y.SMOOTH="s",y.OTHER="o"})(c||(c={}));var E;(function(y){y.VOD="v",y.LIVE="l"})(E||(E={}))},"./src/types/level.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"HlsSkip",function(){return c}),D.d(k,"getSkipValue",function(){return E}),D.d(k,"HlsUrlParameters",function(){return y}),D.d(k,"Level",function(){return p});function R(u,o){for(var d=0;d<o.length;d++){var s=o[d];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(u,s.key,s)}}function O(u,o,d){return o&&R(u.prototype,o),d&&R(u,d),u}var c;(function(u){u.No="",u.Yes="YES",u.v2="v2"})(c||(c={}));function E(u,o){var d=u.canSkipUntil,s=u.canSkipDateRanges,l=u.endSN,r=o!==void 0?o-l:0;return d&&r<d?s?c.v2:c.Yes:c.No}var y=function(){function u(d,s,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=d,this.part=s,this.skip=l}var o=u.prototype;return o.addDirectives=function(s){var l=new self.URL(s);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.toString()},u}(),p=function(){function u(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(d){return d}).join(",").replace(/\.[^.,]+/g,"")}return O(u,[{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(d){var s=d%this.url.length;this._urlId!==s&&(this.details=void 0,this._urlId=s)}}]),u}()},"./src/types/loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"PlaylistContextType",function(){return R}),D.d(k,"PlaylistLevelType",function(){return O});var R;(function(c){c.MANIFEST="manifest",c.LEVEL="level",c.AUDIO_TRACK="audioTrack",c.SUBTITLE_TRACK="subtitleTrack"})(R||(R={}));var O;(function(c){c.MAIN="main",c.AUDIO="audio",c.SUBTITLE="subtitle"})(O||(O={}))},"./src/types/transmuxer.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"ChunkMetadata",function(){return R});var R=function(E,y,p,u,o,d){u===void 0&&(u=0),o===void 0&&(o=-1),d===void 0&&(d=!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=O(),this.buffering={audio:O(),video:O(),audiovideo:O()},this.level=E,this.sn=y,this.id=p,this.size=u,this.part=o,this.partial=d};function O(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"AttrList",function(){return c});var R=/^(\d+)x(\d+)$/,O=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,c=function(){function E(p){typeof p=="string"&&(p=E.parseAttrList(p));for(var u in p)p.hasOwnProperty(u)&&(this[u]=p[u])}var y=E.prototype;return y.decimalInteger=function(u){var o=parseInt(this[u],10);return o>Number.MAX_SAFE_INTEGER?Infinity:o},y.hexadecimalInteger=function(u){if(this[u]){var o=(this[u]||"0x").slice(2);o=(o.length&1?"0":"")+o;for(var d=new Uint8Array(o.length/2),s=0;s<o.length/2;s++)d[s]=parseInt(o.slice(s*2,s*2+2),16);return d}else return null},y.hexadecimalIntegerAsNumber=function(u){var o=parseInt(this[u],16);return o>Number.MAX_SAFE_INTEGER?Infinity:o},y.decimalFloatingPoint=function(u){return parseFloat(this[u])},y.optionalFloat=function(u,o){var d=this[u];return d?parseFloat(d):o},y.enumeratedString=function(u){return this[u]},y.bool=function(u){return this[u]==="YES"},y.decimalResolution=function(u){var o=R.exec(this[u]);return o===null?void 0:{width:parseInt(o[1],10),height:parseInt(o[2],10)}},E.parseAttrList=function(u){var o,d={},s='"';for(O.lastIndex=0;(o=O.exec(u))!==null;){var l=o[2];l.indexOf(s)===0&&l.lastIndexOf(s)===l.length-1&&(l=l.slice(1,-1)),d[o[1]]=l}return d},E}()},"./src/utils/binary-search.ts":function(j,k,D){"use strict";D.r(k);var R={search:function(c,E){for(var y=0,p=c.length-1,u=null,o=null;y<=p;){u=(y+p)/2|0,o=c[u];var d=E(o);if(d>0)y=u+1;else if(d<0)p=u-1;else return o}return null}};k.default=R},"./src/utils/buffer-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"BufferHelper",function(){return c});var R=D("./src/utils/logger.ts"),O={length:0,start:function(){return 0},end:function(){return 0}},c=function(){function E(){}return E.isBuffered=function(p,u){try{if(p){for(var o=E.getBuffered(p),d=0;d<o.length;d++)if(u>=o.start(d)&&u<=o.end(d))return!0}}catch(s){}return!1},E.bufferInfo=function(p,u,o){try{if(p){var d=E.getBuffered(p),s=[],l;for(l=0;l<d.length;l++)s.push({start:d.start(l),end:d.end(l)});return this.bufferedInfo(s,u,o)}}catch(r){}return{len:0,start:u,end:u,nextStart:void 0}},E.bufferedInfo=function(p,u,o){u=Math.max(0,u),p.sort(function(T,A){var x=T.start-A.start;return x||A.end-T.end});var d=[];if(o)for(var s=0;s<p.length;s++){var l=d.length;if(l){var r=d[l-1].end;p[s].start-r<o?p[s].end>r&&(d[l-1].end=p[s].end):d.push(p[s])}else d.push(p[s])}else d=p;for(var n=0,a,i=u,f=u,h=0;h<d.length;h++){var w=d[h].start,m=d[h].end;if(u+o>=w&&u<m)i=w,f=m,n=f-u;else if(u+o<w){a=w;break}}return{len:n,start:i||0,end:f||0,nextStart:a}},E.getBuffered=function(p){try{return p.buffered}catch(u){return R.logger.log("failed to get media.buffered",u),O}},E}()},"./src/utils/cea-608-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"Row",function(){return f}),D.d(k,"CaptionScreen",function(){return h});var R=D("./src/utils/logger.ts"),O={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},c=function(S){var C=S;return O.hasOwnProperty(S)&&(C=O[S]),String.fromCharCode(C)},E=15,y=100,p={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={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},d={25:2,26:4,29:6,30:8,31:10,27:13,28:15},s=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],l;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(l||(l={}));var r=function(){function b(){this.time=null,this.verboseLevel=l.ERROR}var S=b.prototype;return S.log=function(g,M){this.verboseLevel>=g&&R.logger.log(this.time+" ["+g+"] "+M)},b}(),n=function(S){for(var C=[],g=0;g<S.length;g++)C.push(S[g].toString(16));return C},a=function(){function b(C,g,M,I,P){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=C||"white",this.underline=g||!1,this.italics=M||!1,this.background=I||"black",this.flash=P||!1}var S=b.prototype;return S.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},S.setStyles=function(g){for(var M=["foreground","underline","italics","background","flash"],I=0;I<M.length;I++){var P=M[I];g.hasOwnProperty(P)&&(this[P]=g[P])}},S.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},S.equals=function(g){return this.foreground===g.foreground&&this.underline===g.underline&&this.italics===g.italics&&this.background===g.background&&this.flash===g.flash},S.copy=function(g){this.foreground=g.foreground,this.underline=g.underline,this.italics=g.italics,this.background=g.background,this.flash=g.flash},S.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),i=function(){function b(C,g,M,I,P,B){this.uchar=void 0,this.penState=void 0,this.uchar=C||" ",this.penState=new a(g,M,I,P,B)}var S=b.prototype;return S.reset=function(){this.uchar=" ",this.penState.reset()},S.setChar=function(g,M){this.uchar=g,this.penState.copy(M)},S.setPenState=function(g){this.penState.copy(g)},S.equals=function(g){return this.uchar===g.uchar&&this.penState.equals(g.penState)},S.copy=function(g){this.uchar=g.uchar,this.penState.copy(g.penState)},S.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),f=function(){function b(C){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var g=0;g<y;g++)this.chars.push(new i);this.logger=C,this.pos=0,this.currPenState=new a}var S=b.prototype;return S.equals=function(g){for(var M=!0,I=0;I<y;I++)if(!this.chars[I].equals(g.chars[I])){M=!1;break}return M},S.copy=function(g){for(var M=0;M<y;M++)this.chars[M].copy(g.chars[M])},S.isEmpty=function(){for(var g=!0,M=0;M<y;M++)if(!this.chars[M].isEmpty()){g=!1;break}return g},S.setCursor=function(g){this.pos!==g&&(this.pos=g),this.pos<0?(this.logger.log(l.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>y&&(this.logger.log(l.DEBUG,"Too large cursor position "+this.pos),this.pos=y)},S.moveCursor=function(g){var M=this.pos+g;if(g>1)for(var I=this.pos+1;I<M+1;I++)this.chars[I].setPenState(this.currPenState);this.setCursor(M)},S.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},S.insertChar=function(g){g>=144&&this.backSpace();var M=c(g);if(this.pos>=y){this.logger.log(l.ERROR,"Cannot insert "+g.toString(16)+" ("+M+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(M,this.currPenState),this.moveCursor(1)},S.clearFromPos=function(g){var M;for(M=g;M<y;M++)this.chars[M].reset()},S.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},S.clearToEndOfRow=function(){this.clearFromPos(this.pos)},S.getTextString=function(){for(var g=[],M=!0,I=0;I<y;I++){var P=this.chars[I].uchar;P!==" "&&(M=!1),g.push(P)}return M?"":g.join("")},S.setPenStyles=function(g){this.currPenState.setStyles(g);var M=this.chars[this.pos];M.setPenState(this.currPenState)},b}(),h=function(){function b(C){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var g=0;g<E;g++)this.rows.push(new f(C));this.logger=C,this.currRow=E-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var S=b.prototype;return S.reset=function(){for(var g=0;g<E;g++)this.rows[g].clear();this.currRow=E-1},S.equals=function(g){for(var M=!0,I=0;I<E;I++)if(!this.rows[I].equals(g.rows[I])){M=!1;break}return M},S.copy=function(g){for(var M=0;M<E;M++)this.rows[M].copy(g.rows[M])},S.isEmpty=function(){for(var g=!0,M=0;M<E;M++)if(!this.rows[M].isEmpty()){g=!1;break}return g},S.backSpace=function(){var g=this.rows[this.currRow];g.backSpace()},S.clearToEndOfRow=function(){var g=this.rows[this.currRow];g.clearToEndOfRow()},S.insertChar=function(g){var M=this.rows[this.currRow];M.insertChar(g)},S.setPen=function(g){var M=this.rows[this.currRow];M.setPenStyles(g)},S.moveCursor=function(g){var M=this.rows[this.currRow];M.moveCursor(g)},S.setCursor=function(g){this.logger.log(l.INFO,"setCursor: "+g);var M=this.rows[this.currRow];M.setCursor(g)},S.setPAC=function(g){this.logger.log(l.INFO,"pacData = "+JSON.stringify(g));var M=g.row-1;if(this.nrRollUpRows&&M<this.nrRollUpRows-1&&(M=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==M){for(var I=0;I<E;I++)this.rows[I].clear();var P=this.currRow+1-this.nrRollUpRows,B=this.lastOutputScreen;if(B){var H=B.rows[P].cueStartTime,F=this.logger.time;if(H&&F!==null&&H<F)for(var W=0;W<this.nrRollUpRows;W++)this.rows[M-this.nrRollUpRows+W+1].copy(B.rows[P+W])}}this.currRow=M;var U=this.rows[this.currRow];if(g.indent!==null){var K=g.indent,G=Math.max(K-1,0);U.setCursor(g.indent),g.color=U.chars[G].penState.foreground}var ee={foreground:g.color,underline:g.underline,italics:g.italics,background:"black",flash:!1};this.setPen(ee)},S.setBkgData=function(g){this.logger.log(l.INFO,"bkgData = "+JSON.stringify(g)),this.backSpace(),this.setPen(g),this.insertChar(32)},S.setRollUpRows=function(g){this.nrRollUpRows=g},S.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(l.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(l.TEXT,this.getDisplayText());var g=this.currRow+1-this.nrRollUpRows,M=this.rows.splice(g,1)[0];M.clear(),this.rows.splice(this.currRow,0,M),this.logger.log(l.INFO,"Rolling up")},S.getDisplayText=function(g){g=g||!1;for(var M=[],I="",P=-1,B=0;B<E;B++){var H=this.rows[B].getTextString();H&&(P=B+1,g?M.push("Row "+P+": '"+H+"'"):M.push(H.trim()))}return M.length>0&&(g?I="["+M.join(" | ")+"]":I=M.join(`
|
|
|
`)),I},S.getTextAndFormat=function(){return this.rows},b}(),w=function(){function b(C,g,M){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=C,this.outputFilter=g,this.mode=null,this.verbose=0,this.displayedMemory=new h(M),this.nonDisplayedMemory=new h(M),this.lastOutputScreen=new h(M),this.currRollUpRow=this.displayedMemory.rows[E-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=M}var S=b.prototype;return S.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},S.getHandler=function(){return this.outputFilter},S.setHandler=function(g){this.outputFilter=g},S.setPAC=function(g){this.writeScreen.setPAC(g)},S.setBkgData=function(g){this.writeScreen.setBkgData(g)},S.setMode=function(g){if(g===this.mode)return;this.mode=g,this.logger.log(l.INFO,"MODE="+g),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=g},S.insertChars=function(g){for(var M=0;M<g.length;M++)this.writeScreen.insertChar(g[M]);var I=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(l.INFO,I+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(l.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},S.ccRCL=function(){this.logger.log(l.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},S.ccBS=function(){if(this.logger.log(l.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},S.ccAOF=function(){},S.ccAON=function(){},S.ccDER=function(){this.logger.log(l.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},S.ccRU=function(g){this.logger.log(l.INFO,"RU("+g+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(g)},S.ccFON=function(){this.logger.log(l.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},S.ccRDC=function(){this.logger.log(l.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},S.ccTR=function(){this.logger.log(l.INFO,"TR"),this.setMode("MODE_TEXT")},S.ccRTD=function(){this.logger.log(l.INFO,"RTD"),this.setMode("MODE_TEXT")},S.ccEDM=function(){this.logger.log(l.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},S.ccCR=function(){this.logger.log(l.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},S.ccENM=function(){this.logger.log(l.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},S.ccEOC=function(){if(this.logger.log(l.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var g=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=g,this.writeScreen=this.nonDisplayedMemory,this.logger.log(l.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},S.ccTO=function(g){this.logger.log(l.INFO,"TO("+g+") - Tab Offset"),this.writeScreen.moveCursor(g)},S.ccMIDROW=function(g){var M={flash:!1};if(M.underline=g%2===1,M.italics=g>=46,M.italics)M.foreground="white";else{var I=Math.floor(g/2)-16,P=["white","green","blue","cyan","red","yellow","magenta"];M.foreground=P[I]}this.logger.log(l.INFO,"MIDROW: "+JSON.stringify(M)),this.writeScreen.setPen(M)},S.outputDataUpdate=function(g){g===void 0&&(g=!1);var M=this.logger.time;if(M===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=M:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,M,this.lastOutputScreen),g&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:M),this.lastOutputScreen.copy(this.displayedMemory))},S.cueSplitAtTime=function(g){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,g,this.displayedMemory),this.cueStartTime=g))},b}(),m=function(){function b(C,g,M){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var I=new r;this.channels=[null,new w(C,g,I),new w(C+1,M,I)],this.cmdHistory=x(),this.logger=I}var S=b.prototype;return S.getHandler=function(g){return this.channels[g].getHandler()},S.setHandler=function(g,M){this.channels[g].setHandler(M)},S.addData=function(g,M){var I,P,B,H=!1;this.logger.time=g;for(var F=0;F<M.length;F+=2){if(P=M[F]&127,B=M[F+1]&127,P===0&&B===0)continue;if(this.logger.log(l.DATA,"["+n([M[F],M[F+1]])+"] -> ("+n([P,B])+")"),I=this.parseCmd(P,B),I||(I=this.parseMidrow(P,B)),I||(I=this.parsePAC(P,B)),I||(I=this.parseBackgroundAttributes(P,B)),!I&&(H=this.parseChars(P,B),H)){var W=this.currentChannel;if(W&&W>0){var U=this.channels[W];U.insertChars(H)}else this.logger.log(l.WARNING,"No channel found yet. TEXT-MODE?")}!I&&!H&&this.logger.log(l.WARNING,"Couldn't parse cleaned data "+n([P,B])+" orig: "+n([M[F],M[F+1]]))}},S.parseCmd=function(g,M){var I=this.cmdHistory,P=(g===20||g===28||g===21||g===29)&&M>=32&&M<=47,B=(g===23||g===31)&&M>=33&&M<=35;if(!(P||B))return!1;if(A(g,M,I))return T(null,null,I),this.logger.log(l.DEBUG,"Repeated command ("+n([g,M])+") is dropped"),!0;var H=g===20||g===21||g===23?1:2,F=this.channels[H];return g===20||g===21||g===28||g===29?M===32?F.ccRCL():M===33?F.ccBS():M===34?F.ccAOF():M===35?F.ccAON():M===36?F.ccDER():M===37?F.ccRU(2):M===38?F.ccRU(3):M===39?F.ccRU(4):M===40?F.ccFON():M===41?F.ccRDC():M===42?F.ccTR():M===43?F.ccRTD():M===44?F.ccEDM():M===45?F.ccCR():M===46?F.ccENM():M===47&&F.ccEOC():F.ccTO(M-32),T(g,M,I),this.currentChannel=H,!0},S.parseMidrow=function(g,M){var I=0;if((g===17||g===25)&&M>=32&&M<=47){if(g===17?I=1:I=2,I!==this.currentChannel)return this.logger.log(l.ERROR,"Mismatch channel in midrow parsing"),!1;var P=this.channels[I];return P?(P.ccMIDROW(M),this.logger.log(l.DEBUG,"MIDROW ("+n([g,M])+")"),!0):!1}return!1},S.parsePAC=function(g,M){var I,P=this.cmdHistory,B=(g>=17&&g<=23||g>=25&&g<=31)&&M>=64&&M<=127,H=(g===16||g===24)&&M>=64&&M<=95;if(!(B||H))return!1;if(A(g,M,P))return T(null,null,P),!0;var F=g<=23?1:2;M>=64&&M<=95?I=F===1?p[g]:o[g]:I=F===1?u[g]:d[g];var W=this.channels[F];return W?(W.setPAC(this.interpretPAC(I,M)),T(g,M,P),this.currentChannel=F,!0):!1},S.interpretPAC=function(g,M){var I,P={color:null,italics:!1,indent:null,underline:!1,row:g};return M>95?I=M-96:I=M-64,P.underline=(I&1)===1,I<=13?P.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(I/2)]:I<=15?(P.italics=!0,P.color="white"):P.indent=Math.floor((I-16)/2)*4,P},S.parseChars=function(g,M){var I,P=null,B=null;if(g>=25?(I=2,B=g-8):(I=1,B=g),B>=17&&B<=19){var H;B===17?H=M+80:B===18?H=M+112:H=M+144,this.logger.log(l.INFO,"Special char '"+c(H)+"' in channel "+I),P=[H]}else g>=32&&g<=127&&(P=M===0?[g]:[g,M]);if(P){var F=n(P);this.logger.log(l.DEBUG,"Char codes = "+F.join(",")),T(g,M,this.cmdHistory)}return P},S.parseBackgroundAttributes=function(g,M){var I=(g===16||g===24)&&M>=32&&M<=47,P=(g===23||g===31)&&M>=45&&M<=47;if(!(I||P))return!1;var B,H={};g===16||g===24?(B=Math.floor((M-32)/2),H.background=s[B],M%2===1&&(H.background=H.background+"_semi")):M===45?H.background="transparent":(H.foreground="black",M===47&&(H.underline=!0));var F=g<=23?1:2,W=this.channels[F];return W.setBkgData(H),T(g,M,this.cmdHistory),!0},S.reset=function(){for(var g=0;g<Object.keys(this.channels).length;g++){var M=this.channels[g];M&&M.reset()}this.cmdHistory=x()},S.cueSplitAtTime=function(g){for(var M=0;M<this.channels.length;M++){var I=this.channels[M];I&&I.cueSplitAtTime(g)}},b}();function T(b,S,C){C.a=b,C.b=S}function A(b,S,C){return C.a===b&&C.b===S}function x(){return{a:null,b:null}}k.default=m},"./src/utils/codecs.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"isCodecType",function(){return O}),D.d(k,"isCodecSupportedInMp4",function(){return c});var R={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 O(E,y){var p=R[y];return!!p&&p[E.slice(0,4)]===!0}function c(E,y){return MediaSource.isTypeSupported((y||"video")+'/mp4;codecs="'+E+'"')}},"./src/utils/cues.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/vttparser.ts"),O=D("./src/utils/webvtt-parser.ts"),c=D("./src/utils/texttrack-utils.ts"),E=/\s/,y={newCue:function(u,o,d,s){for(var l=[],r,n,a,i,f,h=self.VTTCue||self.TextTrackCue,w=0;w<s.rows.length;w++)if(r=s.rows[w],a=!0,i=0,f="",!r.isEmpty()){for(var m=0;m<r.chars.length;m++)E.test(r.chars[m].uchar)&&a?i++:(f+=r.chars[m].uchar,a=!1);r.cueStartTime=o,o===d&&(d+=1e-4),i>=16?i--:i++;var T=Object(R.fixLineBreaks)(f.trim()),A=Object(O.generateCueId)(o,d,T);(!u||!u.cues||!u.cues.getCueById(A))&&(n=new h(o,d,T),n.id=A,n.line=w+1,n.align="left",n.position=10+Math.min(80,Math.floor(i*8/32)*10),l.push(n))}return u&&l.length&&(l.sort(function(x,b){return x.line==="auto"||b.line==="auto"?0:x.line>8&&b.line>8?b.line-x.line:x.line-b.line}),l.forEach(function(x){return Object(c.addCueToTrack)(u,x)})),l}};k.default=y},"./src/utils/discontinuities.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"findFirstFragWithCC",function(){return E}),D.d(k,"shouldAlignOnDiscontinuities",function(){return y}),D.d(k,"findDiscontinuousReferenceFrag",function(){return p}),D.d(k,"adjustSlidingStart",function(){return o}),D.d(k,"alignStream",function(){return d}),D.d(k,"alignPDT",function(){return l}),D.d(k,"alignFragmentByPDTDelta",function(){return r}),D.d(k,"alignMediaPlaylistByPDT",function(){return n});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/logger.ts"),c=D("./src/controller/level-helper.ts");function E(a,i){for(var f=null,h=0,w=a.length;h<w;h++){var m=a[h];if(m&&m.cc===i){f=m;break}}return f}function y(a,i,f){return!!(i.details&&(f.endCC>f.startCC||a&&a.cc<f.startCC))}function p(a,i){var f=a.fragments,h=i.fragments;if(!h.length||!f.length){O.logger.log("No fragments to align");return}var w=E(f,h[0].cc);if(!w||w&&!w.startPTS){O.logger.log("No frag in previous level to align on");return}return w}function u(a,i){if(a){var f=a.start+i;a.start=a.startPTS=f,a.endPTS=f+a.duration}}function o(a,i){for(var f=i.fragments,h=0,w=f.length;h<w;h++)u(f[h],a);i.fragmentHint&&u(i.fragmentHint,a),i.alignedSliding=!0}function d(a,i,f){if(!i)return;s(a,f,i),!f.alignedSliding&&i.details&&l(f,i.details),!f.alignedSliding&&i.details&&!f.skippedSegments&&Object(c.adjustSliding)(i.details,f)}function s(a,i,f){if(y(a,f,i)){var h=p(f.details,i);h&&Object(R.isFiniteNumber)(h.start)&&(O.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),o(h.start,i))}}function l(a,i){if(!i.fragments.length||!a.hasProgramDateTime||!i.hasProgramDateTime)return;var f=i.fragments[0].programDateTime,h=a.fragments[0].programDateTime,w=(h-f)/1e3+i.fragments[0].start;w&&Object(R.isFiniteNumber)(w)&&(O.logger.log("Adjusting PTS using programDateTime delta "+(h-f)+"ms, sliding:"+w.toFixed(3)+" "+a.url+" "),o(w,a))}function r(a,i){var f=a.programDateTime;if(!f)return;var h=(f-i)/1e3;a.start=a.startPTS=h,a.endPTS=h+a.duration}function n(a,i){if(!i.fragments.length||!a.hasProgramDateTime||!i.hasProgramDateTime)return;var f=i.fragments[0].programDateTime,h=i.fragments[0].start,w=f-h*1e3;a.fragments.forEach(function(m){r(m,w)}),a.fragmentHint&&r(a.fragmentHint,w),a.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/ewma.ts"),O=function(){function c(y,p,u){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=u,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new R.default(y),this.fast_=new R.default(p)}var E=c.prototype;return E.update=function(p,u){var o=this.slow_,d=this.fast_;this.slow_.halfLife!==p&&(this.slow_=new R.default(p,o.getEstimate(),o.getTotalWeight())),this.fast_.halfLife!==u&&(this.fast_=new R.default(u,d.getEstimate(),d.getTotalWeight()))},E.sample=function(p,u){p=Math.max(p,this.minDelayMs_);var o=8*u,d=p/1e3,s=o/d;this.fast_.sample(d,s),this.slow_.sample(d,s)},E.canEstimate=function(){var p=this.fast_;return p&&p.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},c}();k.default=O},"./src/utils/ewma.ts":function(j,k,D){"use strict";D.r(k);var R=function(){function O(E,y,p){y===void 0&&(y=0),p===void 0&&(p=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_=y,this.totalWeight_=p}var c=O.prototype;return c.sample=function(y,p){var u=Math.pow(this.alpha_,y);this.estimate_=p*(1-u)+u*this.estimate_,this.totalWeight_+=y},c.getTotalWeight=function(){return this.totalWeight_},c.getEstimate=function(){if(this.alpha_){var y=1-Math.pow(this.alpha_,this.totalWeight_);if(y)return this.estimate_/y}return this.estimate_},O}();k.default=R},"./src/utils/fetch-loader.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"fetchSupported",function(){return r});var R=D("./src/polyfills/number.ts"),O=D("./src/loader/load-stats.ts"),c=D("./src/demux/chunk-cache.ts");function E(h,w){h.prototype=Object.create(w.prototype),h.prototype.constructor=h,d(h,w)}function y(h){var w=typeof Map=="function"?new Map:void 0;return y=function(T){if(T===null||!o(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w!="undefined"){if(w.has(T))return w.get(T);w.set(T,A)}function A(){return p(T,arguments,s(this).constructor)}return A.prototype=Object.create(T.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),d(A,T)},y(h)}function p(h,w,m){return u()?p=Reflect.construct:p=function(A,x,b){var S=[null];S.push.apply(S,x);var C=Function.bind.apply(A,S),g=new C;return b&&d(g,b.prototype),g},p.apply(null,arguments)}function u(){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(h){return!1}}function o(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function d(h,w){return d=Object.setPrototypeOf||function(T,A){return T.__proto__=A,T},d(h,w)}function s(h){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},s(h)}function l(){return l=Object.assign||function(h){for(var w=1;w<arguments.length;w++){var m=arguments[w];for(var T in m)Object.prototype.hasOwnProperty.call(m,T)&&(h[T]=m[T])}return h},l.apply(this,arguments)}function r(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var n=function(){function h(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||i,this.controller=new self.AbortController,this.stats=new O.LoadStats}var w=h.prototype;return w.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},w.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},w.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},w.load=function(T,A,x){var b=this,S=this.stats;if(S.loading.start)throw new Error("Loader can only be used once.");S.loading.start=self.performance.now();var C=a(T,this.controller.signal),g=x.onProgress,M=T.responseType==="arraybuffer",I=M?"byteLength":"length";this.context=T,this.config=A,this.callbacks=x,this.request=this.fetchSetup(T,C),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),x.onTimeout(S,T,b.response)},A.timeout),self.fetch(this.request).then(function(P){if(b.response=b.loader=P,!P.ok){var B=P.status,H=P.statusText;throw new f(H||"fetch, bad network response",B,P)}return S.loading.first=Math.max(self.performance.now(),S.loading.start),S.total=parseInt(P.headers.get("Content-Length")||"0"),g&&Object(R.isFiniteNumber)(A.highWaterMark)?b.loadProgressively(P,S,T,A.highWaterMark,g):M?P.arrayBuffer():P.text()}).then(function(P){var B=b.response;self.clearTimeout(b.requestTimeout),S.loading.end=Math.max(self.performance.now(),S.loading.first),S.loaded=S.total=P[I];var H={url:B.url,data:P};g&&!Object(R.isFiniteNumber)(A.highWaterMark)&&g(S,T,P,B),x.onSuccess(H,S,T,B)}).catch(function(P){if(self.clearTimeout(b.requestTimeout),S.aborted)return;var B=P.code||0;x.onError({code:B,text:P.message},T,P.details)})},w.getCacheAge=function(){var T=null;if(this.response){var A=this.response.headers.get("age");T=A?parseFloat(A):null}return T},w.loadProgressively=function(T,A,x,b,S){b===void 0&&(b=0);var C=new c.default,g=T.body.getReader(),M=function I(){return g.read().then(function(P){if(P.done)return C.dataLength&&S(A,x,C.flush(),T),Promise.resolve(new ArrayBuffer(0));var B=P.value,H=B.length;return A.loaded+=H,H<b||C.dataLength?(C.push(B),C.dataLength>=b&&S(A,x,C.flush(),T)):S(A,x,B,T),I()}).catch(function(){return Promise.reject()})};return M()},h}();function a(h,w){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:w,headers:new self.Headers(l({},h.headers))};return h.rangeEnd&&m.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),m}function i(h,w){return new self.Request(h.url,w)}var f=function(h){E(w,h);function w(m,T,A){var x;return x=h.call(this,m)||this,x.code=void 0,x.details=void 0,x.code=T,x.details=A,x}return w}(y(Error));k.default=n},"./src/utils/imsc1-ttml-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"IMSC1_CODEC",function(){return o}),D.d(k,"parseIMSC1",function(){return r});var R=D("./src/utils/mp4-tools.ts"),O=D("./src/utils/vttparser.ts"),c=D("./src/utils/vttcue.ts"),E=D("./src/demux/id3.ts"),y=D("./src/utils/timescale-conversion.ts"),p=D("./src/utils/webvtt-parser.ts");function u(){return u=Object.assign||function(b){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var g in C)Object.prototype.hasOwnProperty.call(C,g)&&(b[g]=C[g])}return b},u.apply(this,arguments)}var o="stpp.ttml.im1t",d=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,s=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,l={left:"start",center:"center",right:"end",start:"start",end:"end"};function r(b,S,C,g,M){var I=Object(R.findBox)(new Uint8Array(b),["mdat"]);if(I.length===0){M(new Error("Could not parse IMSC1 mdat"));return}var P=I[0],B=Object(E.utf8ArrayToStr)(new Uint8Array(b,P.start,P.end-P.start)),H=Object(y.toTimescaleFromScale)(S,1,C);try{g(n(B,H))}catch(F){M(F)}}function n(b,S){var C=new DOMParser,g=C.parseFromString(b,"text/xml"),M=g.getElementsByTagName("tt")[0];if(!M)throw new Error("Invalid ttml");var I={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},P=Object.keys(I).reduce(function(U,K){return U[K]=M.getAttribute("ttp:"+K)||I[K],U},{}),B=M.getAttribute("xml:space")!=="preserve",H=i(a(M,"styling","style")),F=i(a(M,"layout","region")),W=a(M,"body","[begin]");return[].map.call(W,function(U){var K=f(U,B);if(!K||!U.hasAttribute("begin"))return null;var G=T(U.getAttribute("begin"),P),ee=T(U.getAttribute("dur"),P),de=T(U.getAttribute("end"),P);if(G===null)throw m(U);if(de===null){if(ee===null)throw m(U);de=G+ee}var ge=new c.default(G-S,de-S,K);ge.id=Object(p.generateCueId)(ge.startTime,ge.endTime,ge.text);var Be=F[U.getAttribute("region")],Ue=H[U.getAttribute("style")];ge.position=10,ge.size=80;var Le=h(Be,Ue),Me=Le.textAlign;if(Me){var Pe=l[Me];Pe&&(ge.lineAlign=Pe),ge.align=Me}return u(ge,Le),ge}).filter(function(U){return U!==null})}function a(b,S,C){var g=b.getElementsByTagName(S)[0];return g?[].slice.call(g.querySelectorAll(C)):[]}function i(b){return b.reduce(function(S,C){var g=C.getAttribute("xml:id");return g&&(S[g]=C),S},{})}function f(b,S){return[].slice.call(b.childNodes).reduce(function(C,g,M){var I;return g.nodeName==="br"&&M?C+`
|
|
|
`:(I=g.childNodes)!==null&&I!==void 0&&I.length?f(g,S):S?C+g.textContent.trim().replace(/\s+/g," "):C+g.textContent},"")}function h(b,S){var C="http://www.w3.org/ns/ttml#styling",g=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return g.reduce(function(M,I){var P=w(S,C,I)||w(b,C,I);return P&&(M[I]=P),M},{})}function w(b,S,C){return b.hasAttributeNS(S,C)?b.getAttributeNS(S,C):null}function m(b){return new Error("Could not parse ttml timestamp "+b)}function T(b,S){if(!b)return null;var C=Object(O.parseTimeStamp)(b);return C===null&&(d.test(b)?C=A(b,S):s.test(b)&&(C=x(b,S))),C}function A(b,S){var C=d.exec(b),g=(C[4]|0)+(C[5]|0)/S.subFrameRate;return(C[1]|0)*3600+(C[2]|0)*60+(C[3]|0)+g/S.frameRate}function x(b,S){var C=s.exec(b),g=Number(C[1]),M=C[2];switch(M){case"h":return g*3600;case"m":return g*60;case"ms":return g*1e3;case"f":return g/S.frameRate;case"t":return g/S.tickRate}return g}},"./src/utils/logger.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"enableLogs",function(){return p}),D.d(k,"logger",function(){return u});var R=function(){},O={trace:R,debug:R,log:R,warn:R,info:R,error:R},c=O;function E(o){var d=self.console[o];return d?d.bind(self.console,"["+o+"] >"):R}function y(o){for(var d=arguments.length,s=new Array(d>1?d-1:0),l=1;l<d;l++)s[l-1]=arguments[l];s.forEach(function(r){c[r]=o[r]?o[r].bind(o):E(r)})}function p(o){if(self.console&&o===!0||typeof o=="object"){y(o,"debug","log","info","warn","error");try{c.log()}catch(d){c=O}}else c=O}var u=c},"./src/utils/mediakeys-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"KeySystems",function(){return R}),D.d(k,"requestMediaKeySystemAccess",function(){return O});var R;(function(c){c.WIDEVINE="com.widevine.alpha",c.PLAYREADY="com.microsoft.playready"})(R||(R={}));var O=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"getMediaSource",function(){return R});function R(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"bin2str",function(){return y}),D.d(k,"readUint16",function(){return p}),D.d(k,"readUint32",function(){return u}),D.d(k,"writeUint32",function(){return o}),D.d(k,"findBox",function(){return d}),D.d(k,"parseSegmentIndex",function(){return s}),D.d(k,"parseInitSegment",function(){return l}),D.d(k,"getStartDTS",function(){return r}),D.d(k,"getDuration",function(){return n}),D.d(k,"computeRawDurationFromSamples",function(){return a}),D.d(k,"offsetStartDTS",function(){return i}),D.d(k,"segmentValidRange",function(){return f}),D.d(k,"appendUint8Array",function(){return h});var R=D("./src/utils/typed-array.ts"),O=D("./src/loader/fragment.ts"),c=Math.pow(2,32)-1,E=[].push;function y(w){return String.fromCharCode.apply(null,w)}function p(w,m){"data"in w&&(m+=w.start,w=w.data);var T=w[m]<<8|w[m+1];return T<0?65536+T:T}function u(w,m){"data"in w&&(m+=w.start,w=w.data);var T=w[m]<<24|w[m+1]<<16|w[m+2]<<8|w[m+3];return T<0?4294967296+T:T}function o(w,m,T){"data"in w&&(m+=w.start,w=w.data),w[m]=T>>24,w[m+1]=T>>16&255,w[m+2]=T>>8&255,w[m+3]=T&255}function d(w,m){var T=[];if(!m.length)return T;var A,x,b;"data"in w?(A=w.data,x=w.start,b=w.end):(A=w,x=0,b=A.byteLength);for(var S=x;S<b;){var C=u(A,S),g=y(A.subarray(S+4,S+8)),M=C>1?S+C:b;if(g===m[0])if(m.length===1)T.push({data:A,start:S+8,end:M});else{var I=d({data:A,start:S+8,end:M},m.slice(1));I.length&&E.apply(T,I)}S=M}return T}function s(w){var m=d(w,["moov"]),T=m[0],A=T?T.end:null,x=d(w,["sidx"]);if(!x||!x[0])return null;var b=[],S=x[0],C=S.data[0],g=C===0?8:16,M=u(S,g);g+=4;var I=0,P=0;C===0?g+=8:g+=16,g+=2;var B=S.end+P,H=p(S,g);g+=2;for(var F=0;F<H;F++){var W=g,U=u(S,W);W+=4;var K=U&2147483647,G=(U&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=u(S,W);W+=4,b.push({referenceSize:K,subsegmentDuration:ee,info:{duration:ee/M,start:B,end:B+K-1}}),B+=K,W+=4,g=W}return{earliestPresentationTime:I,timescale:M,version:C,referencesCount:H,references:b,moovEndOffset:A}}function l(w){for(var m=[],T=d(w,["moov","trak"]),A=0;A<T.length;A++){var x=T[A],b=d(x,["tkhd"])[0];if(b){var S=b.data[b.start],C=S===0?12:20,g=u(b,C),M=d(x,["mdia","mdhd"])[0];if(M){S=M.data[M.start],C=S===0?12:20;var I=u(M,C),P=d(x,["mdia","hdlr"])[0];if(P){var B=y(P.data.subarray(P.start+8,P.start+12)),H={soun:O.ElementaryStreamTypes.AUDIO,vide:O.ElementaryStreamTypes.VIDEO}[B];if(H){var F=d(x,["mdia","minf","stbl","stsd"])[0],W=void 0;F&&(W=y(F.data.subarray(F.start+12,F.start+16))),m[g]={timescale:I,type:H},m[H]={timescale:I,id:g,codec:W}}}}}}var U=d(w,["moov","mvex","trex"]);return U.forEach(function(K){var G=u(K,4),ee=m[G];ee&&(ee.default={duration:u(K,12),flags:u(K,20)})}),m}function r(w,m){return d(m,["moof","traf"]).reduce(function(T,A){var x=d(A,["tfdt"])[0],b=x.data[x.start],S=d(A,["tfhd"]).reduce(function(C,g){var M=u(g,4),I=w[M];if(I){var P=u(x,4);b===1&&(P*=Math.pow(2,32),P+=u(x,8));var B=I.timescale||9e4,H=P/B;if(isFinite(H)&&(C===null||H<C))return H}return C},null);return S!==null&&isFinite(S)&&(T===null||S<T)?S:T},null)||0}function n(w,m){for(var T=0,A=0,x=0,b=d(w,["moof","traf"]),S=0;S<b.length;S++){var C=b[S],g=d(C,["tfhd"])[0],M=u(g,4),I=m[M];if(!I)continue;var P=I.default,B=u(g,0)|(P==null?void 0:P.flags),H=P==null?void 0:P.duration;B&8&&(B&2?H=u(g,12):H=u(g,8));for(var F=I.timescale||9e4,W=d(C,["trun"]),U=0;U<W.length;U++){if(H){var K=u(W[U],4);T=H*K}else T=a(W[U]);I.type===O.ElementaryStreamTypes.VIDEO?A+=T/F:I.type===O.ElementaryStreamTypes.AUDIO&&(x+=T/F)}}if(A===0&&x===0){var G=s(w);if(G!=null&&G.references)return G.references.reduce(function(ee,de){return ee+de.info.duration||0},0)}return A||x}function a(w){var m=u(w,0),T=8;m&1&&(T+=4),m&4&&(T+=4);for(var A=0,x=u(w,4),b=0;b<x;b++){if(m&256){var S=u(w,T);A+=S,T+=4}m&512&&(T+=4),m&1024&&(T+=4),m&2048&&(T+=4)}return A}function i(w,m,T){d(m,["moof","traf"]).forEach(function(A){d(A,["tfhd"]).forEach(function(x){var b=u(x,4),S=w[b];if(!S)return;var C=S.timescale||9e4;d(A,["tfdt"]).forEach(function(g){var M=g.data[g.start],I=u(g,4);if(M===0)o(g,4,I-T*C);else{I*=Math.pow(2,32),I+=u(g,8),I-=T*C,I=Math.max(I,0);var P=Math.floor(I/(c+1)),B=Math.floor(I%(c+1));o(g,4,P),o(g,8,B)}})})})}function f(w){var m={valid:null,remainder:null},T=d(w,["moof"]);if(T){if(T.length<2)return m.remainder=w,m}else return m;var A=T[T.length-1];return m.valid=Object(R.sliceUint8)(w,0,A.start-8),m.remainder=Object(R.sliceUint8)(w,A.start-8),m}function h(w,m){var T=new Uint8Array(w.length+m.length);return T.set(w),T.set(m,w.length),T}},"./src/utils/output-filter.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"default",function(){return R});var R=function(){function O(E,y){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=E,this.trackName=y}var c=O.prototype;return c.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},c.newCue=function(y,p,u){(this.startTime===null||this.startTime>y)&&(this.startTime=y),this.endTime=p,this.screen=u,this.timelineController.createCaptionsTrack(this.trackName)},c.reset=function(){this.cueRanges=[]},O}()},"./src/utils/texttrack-utils.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"sendAddTrackEvent",function(){return O}),D.d(k,"addCueToTrack",function(){return c}),D.d(k,"clearCurrentCues",function(){return E}),D.d(k,"removeCuesInRange",function(){return y}),D.d(k,"getCuesInRange",function(){return u});var R=D("./src/utils/logger.ts");function O(o,d){var s;try{s=new Event("addtrack")}catch(l){s=document.createEvent("Event"),s.initEvent("addtrack",!1,!1)}s.track=o,d.dispatchEvent(s)}function c(o,d){var s=o.mode;if(s==="disabled"&&(o.mode="hidden"),o.cues&&!o.cues.getCueById(d.id))try{if(o.addCue(d),!o.cues.getCueById(d.id))throw new Error("addCue is failed for: "+d)}catch(r){R.logger.debug("[texttrack-utils]: "+r);var l=new self.TextTrackCue(d.startTime,d.endTime,d.text);l.id=d.id,o.addCue(l)}s==="disabled"&&(o.mode=s)}function E(o){var d=o.mode;if(d==="disabled"&&(o.mode="hidden"),o.cues)for(var s=o.cues.length;s--;)o.removeCue(o.cues[s]);d==="disabled"&&(o.mode=d)}function y(o,d,s){var l=o.mode;if(l==="disabled"&&(o.mode="hidden"),o.cues&&o.cues.length>0)for(var r=u(o.cues,d,s),n=0;n<r.length;n++)o.removeCue(r[n]);l==="disabled"&&(o.mode=l)}function p(o,d){if(d<o[0].startTime)return 0;var s=o.length-1;if(d>o[s].endTime)return-1;for(var l=0,r=s;l<=r;){var n=Math.floor((r+l)/2);if(d<o[n].startTime)r=n-1;else if(d>o[n].startTime&&l<s)l=n+1;else return n}return o[l].startTime-d<d-o[r].startTime?l:r}function u(o,d,s){var l=[],r=p(o,d);if(r>-1)for(var n=r,a=o.length;n<a;n++){var i=o[n];if(i.startTime>=d&&i.endTime<=s)l.push(i);else if(i.startTime>s)return l}return l}},"./src/utils/time-ranges.ts":function(j,k,D){"use strict";D.r(k);var R={toString:function(c){for(var E="",y=c.length,p=0;p<y;p++)E+="["+c.start(p).toFixed(3)+","+c.end(p).toFixed(3)+"]";return E}};k.default=R},"./src/utils/timescale-conversion.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"toTimescaleFromBase",function(){return O}),D.d(k,"toTimescaleFromScale",function(){return c}),D.d(k,"toMsFromMpegTsClock",function(){return E}),D.d(k,"toMpegTsClockFromTimescale",function(){return y});var R=9e4;function O(p,u,o,d){o===void 0&&(o=1),d===void 0&&(d=!1);var s=p*u*o;return d?Math.round(s):s}function c(p,u,o,d){return o===void 0&&(o=1),d===void 0&&(d=!1),O(p,u,1/o,d)}function E(p,u){return u===void 0&&(u=!1),O(p,1e3,1/R,u)}function y(p,u){return u===void 0&&(u=1),O(p,R,1/u)}},"./src/utils/typed-array.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"sliceUint8",function(){return R});function R(O,c,E){return Uint8Array.prototype.slice?O.slice(c,E):new Uint8Array(Array.prototype.slice.call(O,c,E))}},"./src/utils/vttcue.ts":function(j,k,D){"use strict";D.r(k),k.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var R=["","lr","rl"],O=["start","middle","end","left","right"];function c(o,d){if(typeof d!="string")return!1;if(!Array.isArray(o))return!1;var s=d.toLowerCase();return~o.indexOf(s)?s:!1}function E(o){return c(R,o)}function y(o){return c(O,o)}function p(o){for(var d=arguments.length,s=new Array(d>1?d-1:0),l=1;l<d;l++)s[l-1]=arguments[l];for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)o[a]=n[a]}return o}function u(o,d,s){var l=this,r={enumerable:!0};l.hasBeenReset=!1;var n="",a=!1,i=o,f=d,h=s,w=null,m="",T=!0,A="auto",x="start",b=50,S="middle",C=50,g="middle";Object.defineProperty(l,"id",p({},r,{get:function(){return n},set:function(I){n=""+I}})),Object.defineProperty(l,"pauseOnExit",p({},r,{get:function(){return a},set:function(I){a=!!I}})),Object.defineProperty(l,"startTime",p({},r,{get:function(){return i},set:function(I){if(typeof I!="number")throw new TypeError("Start time must be set to a number.");i=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"endTime",p({},r,{get:function(){return f},set:function(I){if(typeof I!="number")throw new TypeError("End time must be set to a number.");f=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"text",p({},r,{get:function(){return h},set:function(I){h=""+I,this.hasBeenReset=!0}})),Object.defineProperty(l,"region",p({},r,{get:function(){return w},set:function(I){w=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"vertical",p({},r,{get:function(){return m},set:function(I){var P=E(I);if(P===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"snapToLines",p({},r,{get:function(){return T},set:function(I){T=!!I,this.hasBeenReset=!0}})),Object.defineProperty(l,"line",p({},r,{get:function(){return A},set:function(I){if(typeof I!="number"&&I!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"lineAlign",p({},r,{get:function(){return x},set:function(I){var P=y(I);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");x=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"position",p({},r,{get:function(){return b},set:function(I){if(I<0||I>100)throw new Error("Position must be between 0 and 100.");b=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"positionAlign",p({},r,{get:function(){return S},set:function(I){var P=y(I);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");S=P,this.hasBeenReset=!0}})),Object.defineProperty(l,"size",p({},r,{get:function(){return C},set:function(I){if(I<0||I>100)throw new Error("Size must be between 0 and 100.");C=I,this.hasBeenReset=!0}})),Object.defineProperty(l,"align",p({},r,{get:function(){return g},set:function(I){var P=y(I);if(!P)throw new SyntaxError("An invalid or illegal string was specified.");g=P,this.hasBeenReset=!0}})),l.displayState=void 0}return u.prototype.getCueAsHTML=function(){var o=self.WebVTT;return o.convertCueToDOMTree(self,this.text)},u}()},"./src/utils/vttparser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"parseTimeStamp",function(){return c}),D.d(k,"fixLineBreaks",function(){return d}),D.d(k,"VTTParser",function(){return s});var R=D("./src/utils/vttcue.ts"),O=function(){function l(){}var r=l.prototype;return r.decode=function(a,i){if(!a)return"";if(typeof a!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))},l}();function c(l){function r(a,i,f,h){return(a|0)*3600+(i|0)*60+(f|0)+parseFloat(h||0)}var n=l.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return n?parseFloat(n[2])>59?r(n[2],n[3],0,n[4]):r(n[1],n[2],n[3],n[4]):null}var E=function(){function l(){this.values=Object.create(null)}var r=l.prototype;return r.set=function(a,i){!this.get(a)&&i!==""&&(this.values[a]=i)},r.get=function(a,i,f){return f?this.has(a)?this.values[a]:i[f]:this.has(a)?this.values[a]:i},r.has=function(a){return a in this.values},r.alt=function(a,i,f){for(var h=0;h<f.length;++h)if(i===f[h]){this.set(a,i);break}},r.integer=function(a,i){/^-?\d+$/.test(i)&&this.set(a,parseInt(i,10))},r.percent=function(a,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var f=parseFloat(i);if(f>=0&&f<=100)return this.set(a,f),!0}return!1},l}();function y(l,r,n,a){var i=a?l.split(a):[l];for(var f in i){if(typeof i[f]!="string")continue;var h=i[f].split(n);if(h.length!==2)continue;var w=h[0],m=h[1];r(w,m)}}var p=new R.default(0,0,""),u=p.align==="middle"?"middle":"center";function o(l,r,n){var a=l;function i(){var w=c(l);if(w===null)throw new Error("Malformed timestamp: "+a);return l=l.replace(/^[^\sa-zA-Z-]+/,""),w}function f(w,m){var T=new E;y(w,function(b,S){var C;switch(b){case"region":for(var g=n.length-1;g>=0;g--)if(n[g].id===S){T.set(b,n[g].region);break}break;case"vertical":T.alt(b,S,["rl","lr"]);break;case"line":C=S.split(","),T.integer(b,C[0]),T.percent(b,C[0])&&T.set("snapToLines",!1),T.alt(b,C[0],["auto"]),C.length===2&&T.alt("lineAlign",C[1],["start",u,"end"]);break;case"position":C=S.split(","),T.percent(b,C[0]),C.length===2&&T.alt("positionAlign",C[1],["start",u,"end","line-left","line-right","auto"]);break;case"size":T.percent(b,S);break;case"align":T.alt(b,S,["start",u,"end","left","right"]);break}},/:/,/\s/),m.region=T.get("region",null),m.vertical=T.get("vertical","");var A=T.get("line","auto");A==="auto"&&p.line===-1&&(A=-1),m.line=A,m.lineAlign=T.get("lineAlign","start"),m.snapToLines=T.get("snapToLines",!0),m.size=T.get("size",100),m.align=T.get("align",u);var x=T.get("position","auto");x==="auto"&&p.position===50&&(x=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=x}function h(){l=l.replace(/^\s+/,"")}if(h(),r.startTime=i(),h(),l.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+a);l=l.substr(3),h(),r.endTime=i(),h(),f(l,r)}function d(l){return l.replace(/<br(?: \/)?>/gi,`
|
|
|
`)}var s=function(){function l(){this.state="INITIAL",this.buffer="",this.decoder=new O,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var r=l.prototype;return r.parse=function(a){var i=this;a&&(i.buffer+=i.decoder.decode(a,{stream:!0}));function f(){var x=i.buffer,b=0;for(x=d(x);b<x.length&&x[b]!=="\r"&&x[b]!==`
|
|
|
`;)++b;var S=x.substr(0,b);return x[b]==="\r"&&++b,x[b]===`
|
|
|
`&&++b,i.buffer=x.substr(b),S}function h(x){y(x,function(b,S){},/:/)}try{var w="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;w=f();var m=w.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var T=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;T?T=!1:w=f();switch(i.state){case"HEADER":/:/.test(w)?h(w):w||(i.state="ID");continue;case"NOTE":w||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(w)){i.state="NOTE";break}if(!w)continue;if(i.cue=new R.default(0,0,""),i.state="CUE",w.indexOf("-->")===-1){i.cue.id=w;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{o(w,i.cue,i.regionList)}catch(x){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var A=w.indexOf("-->")!==-1;if(!w||A&&(T=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
|
|
|
`),i.cue.text+=w}continue;case"BADCUE":w||(i.state="ID")}}}catch(x){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},r.flush=function(){var a=this;try{if((a.cue||a.state==="HEADER")&&(a.buffer+=`
|
|
|
|
|
|
`,a.parse()),a.state==="INITIAL"||a.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){a.onparsingerror&&a.onparsingerror(i)}return a.onflush&&a.onflush(),this},l}()},"./src/utils/webvtt-parser.ts":function(j,k,D){"use strict";D.r(k),D.d(k,"generateCueId",function(){return s}),D.d(k,"parseWebVTT",function(){return r});var R=D("./src/polyfills/number.ts"),O=D("./src/utils/vttparser.ts"),c=D("./src/demux/id3.ts"),E=D("./src/utils/timescale-conversion.ts"),y=D("./src/remux/mp4-remuxer.ts"),p=/\r\n|\n\r|\n|\r/g,u=function(a,i,f){return f===void 0&&(f=0),a.substr(f,i.length)===i},o=function(a){var i=parseInt(a.substr(-3)),f=parseInt(a.substr(-6,2)),h=parseInt(a.substr(-9,2)),w=a.length>9?parseInt(a.substr(0,a.indexOf(":"))):0;if(!Object(R.isFiniteNumber)(i)||!Object(R.isFiniteNumber)(f)||!Object(R.isFiniteNumber)(h)||!Object(R.isFiniteNumber)(w))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+a);return i+=1e3*f,i+=60*1e3*h,i+=60*60*1e3*w,i},d=function(a){for(var i=5381,f=a.length;f;)i=i*33^a.charCodeAt(--f);return(i>>>0).toString()};function s(n,a,i){return d(n.toString())+d(a.toString())+d(i)}var l=function(a,i,f){var h=a[i],w=a[h.prevCC];if(!w||!w.new&&h.new){a.ccOffset=a.presentationOffset=h.start,h.new=!1;return}for(;(m=w)!==null&&m!==void 0&&m.new;){var m;a.ccOffset+=h.start-w.start,h.new=!1,h=w,w=a[h.prevCC]}a.presentationOffset=f};function r(n,a,i,f,h,w,m,T){var A=new O.VTTParser,x=Object(c.utf8ArrayToStr)(new Uint8Array(n)).trim().replace(p,`
|
|
|
`).split(`
|
|
|
`),b=[],S=Object(E.toMpegTsClockFromTimescale)(a,i),C="00:00.000",g=0,M=0,I,P=!0,B=!1;A.oncue=function(H){var F=f[h],W=f.ccOffset,U=(g-S)/9e4;if(F!=null&&F.new&&(M!==void 0?W=f.ccOffset=F.start:l(f,h,U)),U&&(W=U-f.presentationOffset),B){var K=H.endTime-H.startTime,G=Object(y.normalizePts)((H.startTime+W-M)*9e4,w*9e4)/9e4;H.startTime=G,H.endTime=G+K}var ee=H.text.trim();H.text=decodeURIComponent(encodeURIComponent(ee)),H.id||(H.id=s(H.startTime,H.endTime,ee)),H.endTime>0&&b.push(H)},A.onparsingerror=function(H){I=H},A.onflush=function(){if(I){T(I);return}m(b)},x.forEach(function(H){if(P)if(u(H,"X-TIMESTAMP-MAP=")){P=!1,B=!0,H.substr(16).split(",").forEach(function(F){u(F,"LOCAL:")?C=F.substr(6):u(F,"MPEGTS:")&&(g=parseInt(F.substr(7)))});try{M=o(C)/1e3}catch(F){B=!1,I=F}return}else H===""&&(P=!1);A.parse(H+`
|
|
|
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(j,k,D){"use strict";D.r(k);var R=D("./src/utils/logger.ts"),O=D("./src/loader/load-stats.ts"),c=/^age:\s*[\d.]+\s*$/m,E=function(){function y(u){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=u?u.xhrSetup:null,this.stats=new O.LoadStats,this.retryDelay=0}var p=y.prototype;return p.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},p.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()))},p.abort=function(){var o;this.abortInternal(),(o=this.callbacks)!==null&&o!==void 0&&o.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},p.load=function(o,d,s){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=d,this.callbacks=s,this.retryDelay=d.retryDelay,this.loadInternal()},p.loadInternal=function(){var o=this.config,d=this.context;if(!o)return;var s=this.loader=new self.XMLHttpRequest,l=this.stats;l.loading.first=0,l.loaded=0;var r=this.xhrSetup;try{if(r)try{r(s,d.url)}catch(i){s.open("GET",d.url,!0),r(s,d.url)}s.readyState||s.open("GET",d.url,!0);var n=this.context.headers;if(n)for(var a in n)s.setRequestHeader(a,n[a])}catch(i){this.callbacks.onError({code:s.status,text:i.message},d,s);return}d.rangeEnd&&s.setRequestHeader("Range","bytes="+d.rangeStart+"-"+(d.rangeEnd-1)),s.onreadystatechange=this.readystatechange.bind(this),s.onprogress=this.loadprogress.bind(this),s.responseType=d.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout),s.send()},p.readystatechange=function(){var o=this.context,d=this.loader,s=this.stats;if(!o||!d)return;var l=d.readyState,r=this.config;if(s.aborted)return;if(l>=2)if(self.clearTimeout(this.requestTimeout),s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start)),l===4){d.onreadystatechange=null,d.onprogress=null;var n=d.status;if(n>=200&&n<300){s.loading.end=Math.max(self.performance.now(),s.loading.first);var a,i;if(o.responseType==="arraybuffer"?(a=d.response,i=a.byteLength):(a=d.responseText,i=a.length),s.loaded=s.total=i,!this.callbacks)return;var f=this.callbacks.onProgress;if(f&&f(s,o,a,d),!this.callbacks)return;var h={url:d.responseURL,data:a};this.callbacks.onSuccess(h,s,o,d)}else s.retry>=r.maxRetry||n>=400&&n<499?(R.logger.error(n+" while loading "+o.url),this.callbacks.onError({code:n,text:d.statusText},o,d)):(R.logger.warn(n+" 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,r.maxRetryDelay),s.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout)},p.loadtimeout=function(){R.logger.warn("timeout while loading "+this.context.url);var o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))},p.loadprogress=function(o){var d=this.stats;d.loaded=o.loaded,o.lengthComputable&&(d.total=o.total)},p.getCacheAge=function(){var o=null;if(this.loader&&c.test(this.loader.getAllResponseHeaders())){var d=this.loader.getResponseHeader("age");o=d?parseFloat(d):null}return o},y}();k.default=E}}).default})},vHTk:function($e,ue,ie){$e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.getPointerEvent=j,ue.stopEvent=k,ue.setCapture=y,ue.releaseCapture=p;function j(u){return u.changedTouches?u.changedTouches[0]:u.touches?u.touches[0]:u}function k(u){u.stopPropagation(),u.preventDefault()}var D=!1,R=null;document.captureElement=null;function O(u){if(D)return;var o=new u.constructor(u.type,u);D=!0,document.captureElement?document.captureElement.dispatchEvent(o):R.dispatchEvent(o),D=!1,u.stopPropagation(),o.defaultPrevented&&u.preventDefault(),u.type==="mouseup"&&p()}function c(){var u=document.getElementById("noVNC_mouse_capture_elem");u.style.cursor=window.getComputedStyle(document.captureElement).cursor}var E=new MutationObserver(c);function y(u){if(u.setCapture)u.setCapture(),document.captureElement=u,u.addEventListener("mouseup",p);else{p();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",O),o.addEventListener("mousemove",O),o.addEventListener("mouseup",O)),document.captureElement=u,E.observe(u,{attributes:!0}),c(),o.style.display="",window.addEventListener("mousemove",O),window.addEventListener("mouseup",O)}}function p(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;R=document.captureElement,document.captureElement=null,E.disconnect();var u=document.getElementById("noVNC_mouse_capture_elem");u.style.display="none",window.removeEventListener("mousemove",O),window.removeEventListener("mouseup",O)}}},wMS7:function($e,ue,ie){/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */(function(j,k){$e.exports=k()})(this,function(){"use strict";function j(ae){if(Array.isArray(ae)){for(var _e=0,Ie=Array(ae.length);_e<ae.length;_e++)Ie[_e]=ae[_e];return Ie}else return Array.from(ae)}var k=Object.hasOwnProperty,D=Object.setPrototypeOf,R=Object.isFrozen,O=Object.keys,c=Object.freeze,E=Object.seal,y=Object.create,p=typeof Reflect!="undefined"&&Reflect,u=p.apply,o=p.construct;u||(u=function(_e,Ie,Fe){return _e.apply(Ie,Fe)}),c||(c=function(_e){return _e}),E||(E=function(_e){return _e}),o||(o=function(_e,Ie){return new(Function.prototype.bind.apply(_e,[null].concat(j(Ie))))});var d=b(Array.prototype.forEach),s=b(Array.prototype.indexOf),l=b(Array.prototype.join),r=b(Array.prototype.pop),n=b(Array.prototype.push),a=b(Array.prototype.slice),i=b(String.prototype.toLowerCase),f=b(String.prototype.match),h=b(String.prototype.replace),w=b(String.prototype.indexOf),m=b(String.prototype.trim),T=b(RegExp.prototype.test),A=S(RegExp),x=S(TypeError);function b(ae){return function(_e){for(var Ie=arguments.length,Fe=Array(Ie>1?Ie-1:0),Xe=1;Xe<Ie;Xe++)Fe[Xe-1]=arguments[Xe];return u(ae,_e,Fe)}}function S(ae){return function(){for(var _e=arguments.length,Ie=Array(_e),Fe=0;Fe<_e;Fe++)Ie[Fe]=arguments[Fe];return o(ae,Ie)}}function C(ae,_e){D&&D(ae,null);for(var Ie=_e.length;Ie--;){var Fe=_e[Ie];if(typeof Fe=="string"){var Xe=i(Fe);Xe!==Fe&&(R(_e)||(_e[Ie]=Xe),Fe=Xe)}ae[Fe]=!0}return ae}function g(ae){var _e=y(null),Ie=void 0;for(Ie in ae)u(k,ae,[Ie])&&(_e[Ie]=ae[Ie]);return _e}var M=c(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),I=c(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),P=c(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),B=c(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),H=c(["#text"]),F=c(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),W=c(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),U=c(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=c(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),G=E(/\{\{[\s\S]*|[\s\S]*\}\}/gm),ee=E(/<%[\s\S]*|[\s\S]*%>/gm),de=E(/^data-[\-\w.\u00B7-\uFFFF]/),ge=E(/^aria-[\-\w]+$/),Be=E(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ue=E(/^(?:\w+script|data):/i),Le=E(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ae){return typeof ae}:function(ae){return ae&&typeof Symbol=="function"&&ae.constructor===Symbol&&ae!==Symbol.prototype?"symbol":typeof ae};function Pe(ae){if(Array.isArray(ae)){for(var _e=0,Ie=Array(ae.length);_e<ae.length;_e++)Ie[_e]=ae[_e];return Ie}else return Array.from(ae)}var be=function(){return typeof window=="undefined"?null:window},ke=function(_e,Ie){if((typeof _e=="undefined"?"undefined":Me(_e))!=="object"||typeof _e.createPolicy!="function")return null;var Fe=null,Xe="data-tt-policy-suffix";Ie.currentScript&&Ie.currentScript.hasAttribute(Xe)&&(Fe=Ie.currentScript.getAttribute(Xe));var Ge="dompurify"+(Fe?"#"+Fe:"");try{return _e.createPolicy(Ge,{createHTML:function(Re){return Re}})}catch(ze){return console.warn("TrustedTypes policy "+Ge+" could not be created."),null}};function te(){var ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:be(),_e=function(Ve){return te(Ve)};if(_e.version="2.0.15",_e.removed=[],!ae||!ae.document||ae.document.nodeType!==9)return _e.isSupported=!1,_e;var Ie=ae.document,Fe=!1,Xe=ae.document,Ge=ae.DocumentFragment,ze=ae.HTMLTemplateElement,Re=ae.Node,Se=ae.NodeFilter,Te=ae.NamedNodeMap,Ee=Te===void 0?ae.NamedNodeMap||ae.MozNamedAttrMap:Te,$=ae.Text,fe=ae.Comment,J=ae.DOMParser,Ae=ae.trustedTypes;if(typeof ze=="function"){var We=Xe.createElement("template");We.content&&We.content.ownerDocument&&(Xe=We.content.ownerDocument)}var Ye=ke(Ae,Ie),Ne=Ye&&Rt?Ye.createHTML(""):"",et=Xe,ne=et.implementation,xe=et.createNodeIterator,Oe=et.getElementsByTagName,he=et.createDocumentFragment,ce=Ie.importNode,le=g(Xe).documentMode?Xe.documentMode:{},Y={};_e.isSupported=ne&&typeof ne.createHTMLDocument!="undefined"&&le!==9;var Z=G,z=ee,oe=de,Ce=ge,X=Ue,me=Le,De=Be,se=null,ve=C({},[].concat(Pe(M),Pe(I),Pe(P),Pe(B),Pe(H))),Ke=null,rt=C({},[].concat(Pe(F),Pe(W),Pe(U),Pe(K))),qe=null,Je=null,lt=!0,vt=!0,ct=!1,it=!1,yt=!1,Tt=!1,Ct=!1,Ht=!1,Ut=!1,Ot=!1,It=!1,Rt=!1,$t=!0,Lt=!0,dt=!1,sr={},zr=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),_r=null,kt=C({},["audio","video","img","source","image","track"]),Lr=null,Pr=C({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Or=null,tt=Xe.createElement("form"),bt=function(Ve){if(Or&&Or===Ve)return;(!Ve||(typeof Ve=="undefined"?"undefined":Me(Ve))!=="object")&&(Ve={}),Ve=g(Ve),se="ALLOWED_TAGS"in Ve?C({},Ve.ALLOWED_TAGS):ve,Ke="ALLOWED_ATTR"in Ve?C({},Ve.ALLOWED_ATTR):rt,Lr="ADD_URI_SAFE_ATTR"in Ve?C(g(Pr),Ve.ADD_URI_SAFE_ATTR):Pr,_r="ADD_DATA_URI_TAGS"in Ve?C(g(kt),Ve.ADD_DATA_URI_TAGS):kt,qe="FORBID_TAGS"in Ve?C({},Ve.FORBID_TAGS):{},Je="FORBID_ATTR"in Ve?C({},Ve.FORBID_ATTR):{},sr="USE_PROFILES"in Ve?Ve.USE_PROFILES:!1,lt=Ve.ALLOW_ARIA_ATTR!==!1,vt=Ve.ALLOW_DATA_ATTR!==!1,ct=Ve.ALLOW_UNKNOWN_PROTOCOLS||!1,it=Ve.SAFE_FOR_JQUERY||!1,yt=Ve.SAFE_FOR_TEMPLATES||!1,Tt=Ve.WHOLE_DOCUMENT||!1,Ut=Ve.RETURN_DOM||!1,Ot=Ve.RETURN_DOM_FRAGMENT||!1,It=Ve.RETURN_DOM_IMPORT||!1,Rt=Ve.RETURN_TRUSTED_TYPE||!1,Ht=Ve.FORCE_BODY||!1,$t=Ve.SANITIZE_DOM!==!1,Lt=Ve.KEEP_CONTENT!==!1,dt=Ve.IN_PLACE||!1,De=Ve.ALLOWED_URI_REGEXP||De,yt&&(vt=!1),Ot&&(Ut=!0),sr&&(se=C({},[].concat(Pe(H))),Ke=[],sr.html===!0&&(C(se,M),C(Ke,F)),sr.svg===!0&&(C(se,I),C(Ke,W),C(Ke,K)),sr.svgFilters===!0&&(C(se,P),C(Ke,W),C(Ke,K)),sr.mathMl===!0&&(C(se,B),C(Ke,U),C(Ke,K))),Ve.ADD_TAGS&&(se===ve&&(se=g(se)),C(se,Ve.ADD_TAGS)),Ve.ADD_ATTR&&(Ke===rt&&(Ke=g(Ke)),C(Ke,Ve.ADD_ATTR)),Ve.ADD_URI_SAFE_ATTR&&C(Lr,Ve.ADD_URI_SAFE_ATTR),Lt&&(se["#text"]=!0),Tt&&C(se,["html","head","body"]),se.table&&(C(se,["tbody"]),delete qe.tbody),c&&c(Ve),Or=Ve},kr=function(Ve){n(_e.removed,{element:Ve});try{Ve.parentNode.removeChild(Ve)}catch(ft){Ve.outerHTML=Ne}},Mr=function(Ve,ft){try{n(_e.removed,{attribute:ft.getAttributeNode(Ve),from:ft})}catch(pt){n(_e.removed,{attribute:null,from:ft})}ft.removeAttribute(Ve)},at=function(Ve){var ft=void 0,pt=void 0;if(Ht)Ve="<remove></remove>"+Ve;else{var Mt=f(Ve,/^[\r\n\t ]+/);pt=Mt&&Mt[0]}var mr=Ye?Ye.createHTML(Ve):Ve;try{ft=new J().parseFromString(mr,"text/html")}catch(Bt){}if(Fe&&C(qe,["title"]),!ft||!ft.documentElement){ft=ne.createHTMLDocument("");var er=ft,Wt=er.body;Wt.parentNode.removeChild(Wt.parentNode.firstElementChild),Wt.outerHTML=mr}return Ve&&pt&&ft.body.insertBefore(Xe.createTextNode(pt),ft.body.childNodes[0]||null),Oe.call(ft,Tt?"html":"body")[0]};_e.isSupported&&function(){try{var gt=at("<x/><title></title><img>");T(/<\/title/,gt.querySelector("title").innerHTML)&&(Fe=!0)}catch(Ve){}}();var Gr=function(Ve){return xe.call(Ve.ownerDocument||Ve,Ve,Se.SHOW_ELEMENT|Se.SHOW_COMMENT|Se.SHOW_TEXT,function(){return Se.FILTER_ACCEPT},!1)},An=function(Ve){return Ve instanceof $||Ve instanceof fe?!1:typeof Ve.nodeName!="string"||typeof Ve.textContent!="string"||typeof Ve.removeChild!="function"||!(Ve.attributes instanceof Ee)||typeof Ve.removeAttribute!="function"||typeof Ve.setAttribute!="function"||typeof Ve.namespaceURI!="string"},_t=function(Ve){return(typeof Re=="undefined"?"undefined":Me(Re))==="object"?Ve instanceof Re:Ve&&(typeof Ve=="undefined"?"undefined":Me(Ve))==="object"&&typeof Ve.nodeType=="number"&&typeof Ve.nodeName=="string"},hr=function(Ve,ft,pt){if(!Y[Ve])return;d(Y[Ve],function(Mt){Mt.call(_e,ft,pt,Or)})},Xr=function(Ve){var ft=void 0;if(hr("beforeSanitizeElements",Ve,null),An(Ve))return kr(Ve),!0;if(f(Ve.nodeName,/[\u0080-\uFFFF]/))return kr(Ve),!0;var pt=i(Ve.nodeName);if(hr("uponSanitizeElement",Ve,{tagName:pt,allowedTags:se}),(pt==="svg"||pt==="math")&&Ve.querySelectorAll("p, br").length!==0)return kr(Ve),!0;if(!se[pt]||qe[pt]){if(Lt&&!zr[pt]&&typeof Ve.insertAdjacentHTML=="function")try{var Mt=Ve.innerHTML;Ve.insertAdjacentHTML("AfterEnd",Ye?Ye.createHTML(Mt):Mt)}catch(mr){}return kr(Ve),!0}return pt==="noscript"&&T(/<\/noscript/i,Ve.innerHTML)||pt==="noembed"&&T(/<\/noembed/i,Ve.innerHTML)?(kr(Ve),!0):(it&&!_t(Ve.firstElementChild)&&(!_t(Ve.content)||!_t(Ve.content.firstElementChild))&&T(/</g,Ve.textContent)&&(n(_e.removed,{element:Ve.cloneNode()}),Ve.innerHTML?Ve.innerHTML=h(Ve.innerHTML,/</g,"<"):Ve.innerHTML=h(Ve.textContent,/</g,"<")),yt&&Ve.nodeType===3&&(ft=Ve.textContent,ft=h(ft,Z," "),ft=h(ft,z," "),Ve.textContent!==ft&&(n(_e.removed,{element:Ve.cloneNode()}),Ve.textContent=ft)),hr("afterSanitizeElements",Ve,null),!1)},Vr=function(Ve,ft,pt){if($t&&(ft==="id"||ft==="name")&&(pt in Xe||pt in tt))return!1;if(!(vt&&T(oe,ft))){if(!(lt&&T(Ce,ft))){if(!Ke[ft]||Je[ft])return!1;if(!Lr[ft]){if(!T(De,h(pt,me,""))){if(!((ft==="src"||ft==="xlink:href"||ft==="href")&&Ve!=="script"&&w(pt,"data:")===0&&_r[Ve])){if(!(ct&&!T(X,h(pt,me,"")))){if(pt)return!1}}}}}}return!0},pr=function(Ve){var ft=void 0,pt=void 0,Mt=void 0,mr=void 0,er=void 0;hr("beforeSanitizeAttributes",Ve,null);var Wt=Ve.attributes;if(!Wt)return;var Bt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ke};for(er=Wt.length;er--;){ft=Wt[er];var Ln=ft,Tr=Ln.name,Fr=Ln.namespaceURI;if(pt=m(ft.value),Mt=i(Tr),Bt.attrName=Mt,Bt.attrValue=pt,Bt.keepAttr=!0,Bt.forceKeepAttr=void 0,hr("uponSanitizeAttribute",Ve,Bt),pt=Bt.attrValue,Bt.forceKeepAttr)continue;if(Mt==="name"&&Ve.nodeName==="IMG"&&Wt.id)mr=Wt.id,Wt=a(Wt,[]),Mr("id",Ve),Mr(Tr,Ve),s(Wt,mr)>er&&Ve.setAttribute("id",mr.value);else{if(Ve.nodeName==="INPUT"&&Mt==="type"&&pt==="file"&&Bt.keepAttr&&(Ke[Mt]||!Je[Mt]))continue;Tr==="id"&&Ve.setAttribute(Tr,""),Mr(Tr,Ve)}if(!Bt.keepAttr)continue;if(it&&T(/\/>/i,pt)){Mr(Tr,Ve);continue}if(T(/svg|math/i,Ve.namespaceURI)&&T(A("</("+l(O(zr),"|")+")","i"),pt)){Mr(Tr,Ve);continue}yt&&(pt=h(pt,Z," "),pt=h(pt,z," "));var yr=Ve.nodeName.toLowerCase();if(!Vr(yr,Mt,pt))continue;try{Fr?Ve.setAttributeNS(Fr,Tr,pt):Ve.setAttribute(Tr,pt),r(_e.removed)}catch(Ti){}}hr("afterSanitizeAttributes",Ve,null)},Ir=function gt(Ve){var ft=void 0,pt=Gr(Ve);for(hr("beforeSanitizeShadowDOM",Ve,null);ft=pt.nextNode();){if(hr("uponSanitizeShadowNode",ft,null),Xr(ft))continue;ft.content instanceof Ge&>(ft.content),pr(ft)}hr("afterSanitizeShadowDOM",Ve,null)};return _e.sanitize=function(gt,Ve){var ft=void 0,pt=void 0,Mt=void 0,mr=void 0,er=void 0;if(gt||(gt="<!-->"),typeof gt!="string"&&!_t(gt)){if(typeof gt.toString!="function")throw x("toString is not a function");if(gt=gt.toString(),typeof gt!="string")throw x("dirty is not a string, aborting")}if(!_e.isSupported){if(Me(ae.toStaticHTML)==="object"||typeof ae.toStaticHTML=="function"){if(typeof gt=="string")return ae.toStaticHTML(gt);if(_t(gt))return ae.toStaticHTML(gt.outerHTML)}return gt}if(Ct||bt(Ve),_e.removed=[],typeof gt=="string"&&(dt=!1),!dt)if(gt instanceof Re)ft=at("<!-->"),pt=ft.ownerDocument.importNode(gt,!0),pt.nodeType===1&&pt.nodeName==="BODY"||pt.nodeName==="HTML"?ft=pt:ft.appendChild(pt);else{if(!Ut&&!yt&&!Tt&>.indexOf("<")===-1)return Ye&&Rt?Ye.createHTML(gt):gt;if(ft=at(gt),!ft)return Ut?null:Ne}ft&&Ht&&kr(ft.firstChild);for(var Wt=Gr(dt?gt:ft);Mt=Wt.nextNode();){if(Mt.nodeType===3&&Mt===mr)continue;if(Xr(Mt))continue;Mt.content instanceof Ge&&Ir(Mt.content),pr(Mt),mr=Mt}if(mr=null,dt)return gt;if(Ut){if(Ot)for(er=he.call(ft.ownerDocument);ft.firstChild;)er.appendChild(ft.firstChild);else er=ft;return It&&(er=ce.call(Ie,er,!0)),er}var Bt=Tt?ft.outerHTML:ft.innerHTML;return yt&&(Bt=h(Bt,Z," "),Bt=h(Bt,z," ")),Ye&&Rt?Ye.createHTML(Bt):Bt},_e.setConfig=function(gt){bt(gt),Ct=!0},_e.clearConfig=function(){Or=null,Ct=!1},_e.isValidAttribute=function(gt,Ve,ft){Or||bt({});var pt=i(gt),Mt=i(Ve);return Vr(pt,Mt,ft)},_e.addHook=function(gt,Ve){if(typeof Ve!="function")return;Y[gt]=Y[gt]||[],n(Y[gt],Ve)},_e.removeHook=function(gt){Y[gt]&&r(Y[gt])},_e.removeHooks=function(gt){Y[gt]&&(Y[gt]=[])},_e.removeAllHooks=function(){Y={}},_e}var pe=te();return pe})},whVF:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=ie("lNSK"),k=D(ie("1q3G"));function D(y){return y&&y.__esModule?y:{default:y}}function R(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function O(y,p){for(var u=0;u<p.length;u++){var o=p[u];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(y,o.key,o)}}function c(y,p,u){return p&&O(y.prototype,p),u&&O(y,u),y}var E=function(){function y(){R(this,y),this.strm=new k.default,this.chunkSize=1024*10*10,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,j.deflateInit)(this.strm,this.windowBits)}return c(y,[{key:"deflate",value:function(u){this.strm.input=u,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,j.deflate)(this.strm,j.Z_FULL_FLUSH),d=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 s=[d],l=d.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,o=(0,j.deflate)(this.strm,j.Z_FULL_FLUSH),o<0)throw new Error("zlib deflate failed");var r=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);l+=r.length,s.push(r)}while(this.strm.avail_in>0);for(var n=new Uint8Array(l),a=0,i=0;i<s.length;i++)n.set(s[i],a),a+=s[i].length;d=n}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,d}}]),y}();ue.default=E},xO64:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j=k(ie("8K/p"));function k(r){return r&&r.__esModule?r:{default:r}}function D(r){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?D=function(a){return typeof a}:D=function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},D(r)}function R(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}function O(r,n){for(var a=0;a<n.length;a++){var i=n[a];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(r,i.key,i)}}function c(r,n,a){return n&&O(r.prototype,n),a&&O(r,a),r}function E(r,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(n&&n.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),n&&y(r,n)}function y(r,n){return y=Object.setPrototypeOf||function(i,f){return i.__proto__=f,i},y(r,n)}function p(r){var n=d();return function(){var i=s(r),f;if(n){var h=s(this).constructor;f=Reflect.construct(i,arguments,h)}else f=i.apply(this,arguments);return u(this,f)}}function u(r,n){return n&&(D(n)==="object"||typeof n=="function")?n:o(r)}function o(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function d(){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(r){return!1}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},s(r)}var l=function(r){E(a,r);var n=p(a);function a(){return R(this,a),n.apply(this,arguments)}return c(a,[{key:"_pngRect",value:function(f,h,w,m,T,A,x){var b=this._readData(T);return b===null?!1:(A.imageRect(f,h,w,m,"image/png",b),!0)}},{key:"_basicRect",value:function(f,h,w,m,T,A,x,b){throw new Error("BasicCompression received in TightPNG rect")}}]),a}(j.default);ue.default=l},xSIq:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=void 0;var j={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"};ue.default=j},xlC8:function($e,ue,ie){"use strict";Object.defineProperty(ue,"__esModule",{value:!0}),ue.default=j;function j(k,D,R,O){for(var c=k&65535|0,E=k>>>16&65535|0,y=0;R!==0;){y=R>2e3?2e3:R,R-=y;do c=c+D[O++]|0,E=E+c|0;while(--y);c%=65521,E%=65521}return c|E<<16|0}}}]);
|