|
|
(window.webpackJsonp=window.webpackJsonp||[]).push([[231,5,6,7,19],{"+NIl":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){"use strict";e.defineMode("stex",(function(e,t){function i(e,t){e.cmdState.push(t)}function r(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function n(e,t,i){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=i,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var s={};function o(e,t){e.f=t}function a(e,t){var n;if(e.match(/^\\[a-zA-Z@]+/)){var a=e.current().slice(1);return i(t,n=new(n=s.hasOwnProperty(a)?s[a]:s.DEFAULT)),o(t,c),n.style}if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/\\]/))return"tag";if(e.match("\\["))return o(t,(function(e,t){return l(e,t,"\\]")})),"keyword";if(e.match("\\("))return o(t,(function(e,t){return l(e,t,"\\)")})),"keyword";if(e.match("$$"))return o(t,(function(e,t){return l(e,t,"$$")})),"keyword";if(e.match("$"))return o(t,(function(e,t){return l(e,t,"$")})),"keyword";var u=e.next();return"%"==u?(e.skipToEnd(),"comment"):"}"==u||"]"==u?(n=r(t))?(n.closeBracket(u),o(t,c),"bracket"):"error":"{"==u||"["==u?(i(t,n=new(n=s.DEFAULT)),"bracket"):/\d/.test(u)?(e.eatWhile(/[\w.%]/),"atom"):(e.eatWhile(/[\w\-_]/),"begin"==(n=function(e){for(var t=e.cmdState,i=t.length-1;i>=0;i--){var r=t[i];if("DEFAULT"!=r.name)return r}return{styleIdentifier:function(){return null}}}(t)).name&&(n.argument=e.current()),n.styleIdentifier())}function l(e,t,i){if(e.eatSpace())return null;if(i&&e.match(i))return o(t,a),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=e.next();return"{"==r||"}"==r||"["==r||"]"==r||"("==r||")"==r?"bracket":"%"==r?(e.skipToEnd(),"comment"):"error"}function c(e,t){var i=e.peek();return"{"==i||"["==i?(r(t).openBracket(i),e.eat(i),o(t,a),"bracket"):/[ \t\r]/.test(i)?(e.eat(i),null):(o(t,a),function(e){var t=e.cmdState.pop();t&&t.closeBracket()}(t),a(e,t))}return s.importmodule=n("importmodule","tag",["string","builtin"]),s.documentclass=n("documentclass","tag",["","atom"]),s.usepackage=n("usepackage","tag",["atom"]),s.begin=n("begin","tag",["atom"]),s.end=n("end","tag",["atom"]),s.label=n("label","tag",["atom"]),s.ref=n("ref","tag",["atom"]),s.eqref=n("eqref","tag",["atom"]),s.cite=n("cite","tag",["atom"]),s.bibitem=n("bibitem","tag",["atom"]),s.Bibitem=n("Bibitem","tag",["atom"]),s.RBibitem=n("RBibitem","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:t.inMathMode?function(e,t){return l(e,t)}:a}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=a,e.cmdState.length=0},lineComment:"%"}})),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}(i(/*! ../../lib/codemirror */"VrN/"))},"/POA":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/xterm/lib/xterm.js ***!
|
|
|
\*****************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: Terminal */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){window,e.exports=function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=34)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.forwardEvent=t.EventEmitter=void 0;var r=function(){function e(){this._listeners=[],this._disposed=!1}return Object.defineProperty(e.prototype,"event",{get:function(){var e=this;return this._event||(this._event=function(t){return e._listeners.push(t),{dispose:function(){if(!e._disposed)for(var i=0;i<e._listeners.length;i++)if(e._listeners[i]===t)return void e._listeners.splice(i,1)}}}),this._event},enumerable:!1,configurable:!0}),e.prototype.fire=function(e,t){for(var i=[],r=0;r<this._listeners.length;r++)i.push(this._listeners[r]);for(r=0;r<i.length;r++)i[r].call(void 0,e,t)},e.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},e}();t.EventEmitter=r,t.forwardEvent=function(e,t){return e((function(e){return t.fire(e)}))}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IUnicodeService=t.IOptionsService=t.ILogService=t.IInstantiationService=t.IDirtyRowService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;var r=i(14);t.IBufferService=r.createDecorator("BufferService"),t.ICoreMouseService=r.createDecorator("CoreMouseService"),t.ICoreService=r.createDecorator("CoreService"),t.ICharsetService=r.createDecorator("CharsetService"),t.IDirtyRowService=r.createDecorator("DirtyRowService"),t.IInstantiationService=r.createDecorator("InstantiationService"),t.ILogService=r.createDecorator("LogService"),t.IOptionsService=r.createDecorator("OptionsService"),t.IUnicodeService=r.createDecorator("UnicodeService")},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.Disposable=void 0;var r=function(){function e(){this._disposables=[],this._isDisposed=!1}return e.prototype.dispose=function(){this._isDisposed=!0;for(var e=0,t=this._disposables;e<t.length;e++)t[e].dispose();this._disposables.length=0},e.prototype.register=function(e){return this._disposables.push(e),e},e.prototype.unregister=function(e){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)},e}();function n(e){for(var t=0,i=e;t<i.length;t++)i[t].dispose();e.length=0}t.Disposable=r,t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:function(){return n(e)}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;var s=i(8),o=i(3),a=i(6),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.content=0,t.fg=0,t.bg=0,t.extended=new a.ExtendedAttrs,t.combinedData="",t}return n(t,e),t.fromCharData=function(e){var i=new t;return i.setFromCharData(e),i},t.prototype.isCombined=function(){return 2097152&this.content},t.prototype.getWidth=function(){return this.content>>22},t.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.stringFromCodePoint(2097151&this.content):""},t.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},t.prototype.setFromCharData=function(e){this.fg=e[o.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(e[o.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[o.CHAR_DATA_CHAR_INDEX].length){var i=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){var r=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(i-55296)+r-56320+65536|e[o.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[o.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[o.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[o.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[o.CHAR_DATA_WIDTH_INDEX]<<22)},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(a.AttributeData);t.CellData=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ISoundService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;var r=i(14);t.ICharSizeService=r.createDecorator("CharSizeService"),t.ICoreBrowserService=r.createDecorator("CoreBrowserService"),t.IMouseService=r.createDecorator("MouseService"),t.IRenderService=r.createDecorator("RenderService"),t.ISelectionService=r.createDecorator("SelectionService"),t.ISoundService=r.createDecorator("SoundService")},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;var r=function(){function e(){this.fg=0,this.bg=0,this.extended=new n}return e.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},e.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},e.prototype.clone=function(){var t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t},e.prototype.isInverse=function(){return 67108864&this.fg},e.prototype.isBold=function(){return 134217728&this.fg},e.prototype.isUnderline=function(){return 268435456&this.fg},e.prototype.isBlink=function(){return 536870912&this.fg},e.prototype.isInvisible=function(){return 1073741824&this.fg},e.prototype.isItalic=function(){return 67108864&this.bg},e.prototype.isDim=function(){return 134217728&this.bg},e.prototype.getFgColorMode=function(){return 50331648&this.fg},e.prototype.getBgColorMode=function(){return 50331648&this.bg},e.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},e.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},e.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},e.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},e.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},e.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},e.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},e.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},e.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},e.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},e.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},e.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()},e.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},e.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()},e.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()},e.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()},e.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},e}();t.AttributeData=r;var n=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=-1),this.underlineStyle=e,this.underlineColor=t}return e.prototype.clone=function(){return new e(this.underlineStyle,this.underlineColor)},e.prototype.isEmpty=function(){return 0===this.underlineStyle},e}();t.ExtendedAttrs=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,r){e.addEventListener(t,i,r);var n=!1;return{dispose:function(){n||(n=!0,e.removeEventListener(t,i,r))}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n<i;++n){var s=e[n];s>65535?(s-=65536,r+=String.fromCharCode(55296+(s>>10))+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r};var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var s=n;s<i;++s){var o=e.charCodeAt(s);if(55296<=o&&o<=56319){if(++s>=i)return this._interim=o,r;var a;56320<=(a=e.charCodeAt(s))&&a<=57343?t[r++]=1024*(o-55296)+a-56320+65536:(t[r++]=o,t[r++]=a)}else t[r++]=o}return r},e}();t.StringToUtf32=r;var n=function(){function e(){this.interim=new Uint8Array(3)}return e.prototype.clear=function(){this.interim.fill(0)},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,s,o,a=0,l=0,c=0;if(this.interim[0]){var u=!1,h=this.interim[0];h&=192==(224&h)?31:224==(240&h)?15:7;for(var d=0,f=void 0;(f=63&this.interim[++d])&&d<4;)h<<=6,h|=f;for(var p=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,g=p-d;c<g;){if(c>=i)return 0;if(128!=(192&(f=e[c++]))){c--,u=!0;break}this.interim[d++]=f,h<<=6,h|=63&f}u||(2===p?h<128?c--:t[a++]=h:3===p?h<2048||h>=55296&&h<=57343||(t[a++]=h):h<65536||h>1114111||(t[a++]=h)),this.interim.fill(0)}for(var v=i-4,m=c;m<i;){for(;!(!(m<v)||128&(r=e[m])||128&(n=e[m+1])||128&(s=e[m+2])||128&(o=e[m+3]));)t[a++]=r,t[a++]=n,t[a++]=s,t[a++]=o,m+=4;if((r=e[m++])<128)t[a++]=r;else if(192==(224&r)){if(m>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[m++]))){m--;continue}if((l=(31&r)<<6|63&n)<128){m--;continue}t[a++]=l}else if(224==(240&r)){if(m>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[m++]))){m--;continue}if(m>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(s=e[m++]))){m--;continue}if((l=(15&r)<<12|(63&n)<<6|63&s)<2048||l>=55296&&l<=57343)continue;t[a++]=l}else if(240==(248&r)){if(m>=i)return this.interim[0]=r,a;if(128!=(192&(n=e[m++]))){m--;continue}if(m>=i)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(s=e[m++]))){m--;continue}if(m>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=s,a;if(128!=(192&(o=e[m++]))){m--;continue}if((l=(7&r)<<18|(63&n)<<12|(63&s)<<6|63&o)<65536||l>1114111)continue;t[a++]=l}}return a},e}();t.Utf8ToUtf32=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHAR_ATLAS_CELL_SPACING=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0,t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,i){"use strict";var r,n,s,o;function a(e){var t=e.toString(16);return t.length<2?"0"+t:t}function l(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=void 0,function(e){e.toCss=function(e,t,i,r){return void 0!==r?"#"+a(e)+a(t)+a(i)+a(r):"#"+a(e)+a(t)+a(i)},e.toRgba=function(e,t,i,r){return void 0===r&&(r=255),(e<<24|t<<16|i<<8|r)>>>0}}(r=t.channels||(t.channels={})),(n=t.color||(t.color={})).blend=function(e,t){var i=(255&t.rgba)/255;if(1===i)return{css:t.css,rgba:t.rgba};var n=t.rgba>>24&255,s=t.rgba>>16&255,o=t.rgba>>8&255,a=e.rgba>>24&255,l=e.rgba>>16&255,c=e.rgba>>8&255,u=a+Math.round((n-a)*i),h=l+Math.round((s-l)*i),d=c+Math.round((o-c)*i);return{css:r.toCss(u,h,d),rgba:r.toRgba(u,h,d)}},n.isOpaque=function(e){return 255==(255&e.rgba)},n.ensureContrastRatio=function(e,t,i){var r=o.ensureContrastRatio(e.rgba,t.rgba,i);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},n.opaque=function(e){var t=(255|e.rgba)>>>0,i=o.toChannels(t),n=i[0],s=i[1],a=i[2];return{css:r.toCss(n,s,a),rgba:t}},n.opacity=function(e,t){var i=Math.round(255*t),n=o.toChannels(e.rgba),s=n[0],a=n[1],l=n[2];return{css:r.toCss(s,a,l,i),rgba:r.toRgba(s,a,l,i)}},(t.css||(t.css={})).toColor=function(e){switch(e.length){case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(e){function t(e,t,i){var r=e/255,n=t/255,s=i/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*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(s=t.rgb||(t.rgb={})),function(e){function t(e,t,i){for(var r=e>>24&255,n=e>>16&255,o=e>>8&255,a=t>>24&255,c=t>>16&255,u=t>>8&255,h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(r,n,o));h<i&&(a>0||c>0||u>0);)a-=Math.max(0,Math.ceil(.1*a)),c-=Math.max(0,Math.ceil(.1*c)),u-=Math.max(0,Math.ceil(.1*u)),h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(r,n,o));return(a<<24|c<<16|u<<8|255)>>>0}function i(e,t,i){for(var r=e>>24&255,n=e>>16&255,o=e>>8&255,a=t>>24&255,c=t>>16&255,u=t>>8&255,h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(r,n,o));h<i&&(a<255||c<255||u<255);)a=Math.min(255,a+Math.ceil(.1*(255-a))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=Math.min(255,u+Math.ceil(.1*(255-u))),h=l(s.relativeLuminance2(a,u,c),s.relativeLuminance2(r,n,o));return(a<<24|c<<16|u<<8|255)>>>0}e.ensureContrastRatio=function(e,r,n){var o=s.relativeLuminance(e>>8),a=s.relativeLuminance(r>>8);if(l(o,a)<n)return a<o?t(e,r,n):i(e,r,n)},e.reduceLuminance=t,e.increaseLuminance=i,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},e.toColor=function(e,t,i){return{css:r.toCss(e,t,i),rgba:r.toRgba(e,t,i)}}}(o=t.rgba||(t.rgba={})),t.toPaddedHex=a,t.contrastRatio=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.isSafari=t.isFirefox=void 0;var r="undefined"==typeof navigator,n=r?"node":navigator.userAgent,s=r?"node":navigator.platform;function o(e,t){return e.indexOf(t)>=0}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=o(["Macintosh","MacIntel","MacPPC","Mac68K"],s),t.isIpad="iPad"===s,t.isIphone="iPhone"===s,t.isWindows=o(["Windows","Win16","Win32","WinCE"],s),t.isLinux=s.indexOf("Linux")>=0},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(t.C0||(t.C0={})),function(e){e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""}(t.C1||(t.C1={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRenderLayer=void 0;var r=i(3),n=i(9),s=i(25),o=i(6),a=i(28),l=i(10),c=i(17),u=function(){function e(e,t,i,r,n,s,o,a){this._container=e,this._alpha=r,this._colors=n,this._rendererId=s,this._bufferService=o,this._optionsService=a,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-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return e.prototype.dispose=function(){var e;c.removeElementFromParent(this._canvas),null===(e=this._charAtlas)||void 0===e||e.dispose()},e.prototype._initCanvas=function(){this._ctx=a.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},e.prototype.onOptionsChanged=function(){},e.prototype.onBlur=function(){},e.prototype.onFocus=function(){},e.prototype.onCursorMove=function(){},e.prototype.onGridChanged=function(e,t){},e.prototype.onSelectionChanged=function(e,t,i){void 0===i&&(i=!1)},e.prototype.setColors=function(e){this._refreshCharAtlas(e)},e.prototype._setTransparency=function(e){if(e!==this._alpha){var t=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},e.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=s.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},e.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},e.prototype._fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},e.prototype._fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},e.prototype._fillLeftLineAtCell=function(e,t,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*i,this._scaledCellHeight)},e.prototype._strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},e.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))},e.prototype._clearCells=function(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},e.prototype._fillCharTrueColor=function(e,t,i){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(i),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},e.prototype._drawChars=function(e,t,i){var s,o,a=this._getContrastColor(e);a||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,i,a):(e.isInverse()?(s=e.isBgDefault()?n.INVERTED_DEFAULT_COLOR:e.getBgColor(),o=e.isFgDefault()?n.INVERTED_DEFAULT_COLOR:e.getFgColor()):(o=e.isBgDefault()?r.DEFAULT_COLOR:e.getBgColor(),s=e.isFgDefault()?r.DEFAULT_COLOR:e.getFgColor()),s+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||r.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||r.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=o,this._currentGlyphIdentifier.fg=s,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i))},e.prototype._drawUncachedChars=function(e,t,i,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(r)this._ctx.fillStyle=r.css;else if(e.isBgDefault())this._ctx.fillStyle=l.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var s=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}else if(r)this._ctx.fillStyle=r.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var a=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}this._clipRow(i),e.isDim()&&(this._ctx.globalAlpha=n.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},e.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},e.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},e.prototype._getContrastColor=function(e){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var i=e.getFgColor(),r=e.getFgColorMode(),n=e.getBgColor(),s=e.getBgColorMode(),o=!!e.isInverse(),a=!!e.isInverse();if(o){var c=i;i=n,n=c;var u=r;r=s,s=u}var h=this._resolveBackgroundRgba(s,n,o),d=this._resolveForegroundRgba(r,i,o,a),f=l.rgba.ensureContrastRatio(h,d,this._optionsService.options.minimumContrastRatio);if(f){var p={css:l.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,p),p}this._colors.contrastCache.setColor(e.bg,e.fg,null)}},e.prototype._resolveBackgroundRgba=function(e,t,i){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return i?this._colors.foreground.rgba:this._colors.background.rgba}},e.prototype._resolveForegroundRgba=function(e,t,i,r){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;case 0:default:return i?this._colors.background.rgba:this._colors.foreground.rgba}},e}();t.BaseRenderLayer=u},function(e,t,i){"use strict";function r(e,t,i){t.di$target===t?t.di$dependencies.push({id:e,index:i}):(t.di$dependencies=[{id:e,index:i}],t.di$target=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0,t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e.di$dependencies||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var i=function(e,t,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");r(i,e,n)};return i.toString=function(){return e},t.serviceRegistry.set(e,i),i}},function(e,t,i){"use strict";function r(e,t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=e.length),i>=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n<r;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.concat=t.fillFallback=t.fill=void 0,t.fill=function(e,t,i,n){return e.fill?e.fill(t,i,n):r(e,t,i,n)},t.fillFallback=r,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;var r=i(8),n=i(3),s=i(4),o=i(6);t.DEFAULT_ATTR_DATA=Object.freeze(new o.AttributeData);var a=function(){function e(e,t,i){void 0===i&&(i=!1),this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);for(var r=t||s.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]),o=0;o<e;++o)this.setCell(o,r);this.length=e}return e.prototype.get=function(e){var t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?r.stringFromCodePoint(i):"",t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},e.prototype.set=function(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22},e.prototype.getWidth=function(e){return this._data[3*e+0]>>22},e.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},e.prototype.getFg=function(e){return this._data[3*e+1]},e.prototype.getBg=function(e){return this._data[3*e+2]},e.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},e.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},e.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},e.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?r.stringFromCodePoint(2097151&t):""},e.prototype.loadCell=function(e,t){var i=3*e;return t.content=this._data[i+0],t.fg=this._data[i+1],t.bg=this._data[i+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t},e.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},e.prototype.setCellFromCodePoint=function(e,t,i,r,n,s){268435456&n&&(this._extendedAttrs[e]=s),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=n},e.prototype.addCodepointToCell=function(e,t){var i=this._data[3*e+0];2097152&i?this._combined[e]+=r.stringFromCodePoint(t):(2097151&i?(this._combined[e]=r.stringFromCodePoint(2097151&i)+r.stringFromCodePoint(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)},e.prototype.insertCells=function(e,t,i,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs),t<this.length-e){for(var n=new s.CellData,a=this.length-e-t-1;a>=0;--a)this.setCell(e+t+a,this.loadCell(e+a,n));for(a=0;a<t;++a)this.setCell(e+a,i)}else for(a=e;a<this.length;++a)this.setCell(a,i);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs)},e.prototype.deleteCells=function(e,t,i,r){if(e%=this.length,t<this.length-e){for(var n=new s.CellData,a=0;a<this.length-e-t;++a)this.setCell(e+a,this.loadCell(e+t+a,n));for(a=this.length-t;a<this.length;++a)this.setCell(a,i)}else for(a=e;a<this.length;++a)this.setCell(a,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs)},e.prototype.replaceCells=function(e,t,i,r){for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null==r?void 0:r.fg)||0,(null==r?void 0:r.bg)||0,(null==r?void 0:r.extended)||new o.ExtendedAttrs);e<t&&e<this.length;)this.setCell(e++,i)},e.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var i=new Uint32Array(3*e);this.length&&(3*e<this._data.length?i.set(this._data.subarray(0,3*e)):i.set(this._data)),this._data=i;for(var r=this.length;r<e;++r)this.setCell(r,t)}else if(e){(i=new Uint32Array(3*e)).set(this._data.subarray(0,3*e)),this._data=i;var n=Object.keys(this._combined);for(r=0;r<n.length;r++){var s=parseInt(n[r],10);s>=e&&delete this._combined[s]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},e.prototype.fill=function(e){this._combined={},this._extendedAttrs={};for(var t=0;t<this.length;++t)this.setCell(t,e)},e.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];for(var t in this._extendedAttrs={},e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped},e.prototype.clone=function(){var t=new e(0);for(var i in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[i]=this._combined[i];for(var i in this._extendedAttrs)t._extendedAttrs[i]=this._extendedAttrs[i];return t.isWrapped=this.isWrapped,t},e.prototype.getTrimmedLength=function(){for(var e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0},e.prototype.copyCellsFrom=function(e,t,i,r,n){var s=e._data;if(n)for(var o=r-1;o>=0;o--)for(var a=0;a<3;a++)this._data[3*(i+o)+a]=s[3*(t+o)+a];else for(o=0;o<r;o++)for(a=0;a<3;a++)this._data[3*(i+o)+a]=s[3*(t+o)+a];var l=Object.keys(e._combined);for(a=0;a<l.length;a++){var c=parseInt(l[a],10);c>=t&&(this._combined[c-t+i]=e._combined[c])}},e.prototype.translateToString=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===i&&(i=this.length),e&&(i=Math.min(i,this.getTrimmedLength()));for(var s="";t<i;){var o=this._data[3*t+0],a=2097151&o;s+=2097152&o?this._combined[t]:a?r.stringFromCodePoint(a):n.WHITESPACE_CELL_CHAR,t+=o>>22||1}return s},e}();t.BufferLine=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeElementFromParent=void 0,t.removeElementFromParent=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];for(var r=0,n=t;r<n.length;r++){var s=n[r];null===(e=null==s?void 0:s.parentElement)||void 0===e||e.removeChild(s)}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;var s,o=i(12),a=i(20),l=i(39),c=i(2),u=i(15),h=i(8),d=i(16),f=i(0),p=i(3),g=i(4),v=i(6),m=i(22),y=i(24),_={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function b(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(s=t.WindowsOptionsReportType||(t.WindowsOptionsReportType={}));var S=function(){function e(e,t,i,r){this._bufferService=e,this._coreService=t,this._logService=i,this._optionsService=r,this._data=new Uint32Array(0)}return e.prototype.hook=function(e){this._data=new Uint32Array(0)},e.prototype.put=function(e,t,i){this._data=u.concat(this._data,e.subarray(t,i))},e.prototype.unhook=function(e){if(e){var t=h.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._coreService.triggerDataEvent(o.C0.ESC+'P1$r0"q'+o.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(o.C0.ESC+'P1$r61;1"p'+o.C0.ESC+"\\");case"r":var i=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(o.C0.ESC+"P1$r"+i+o.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(o.C0.ESC+"P1$r0m"+o.C0.ESC+"\\");case" q":var r={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return r-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(o.C0.ESC+"P1$r"+r+" q"+o.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(o.C0.ESC+"P0$r"+o.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},e}(),C=function(e){function t(t,i,r,n,s,c,u,p,v){void 0===v&&(v=new l.EscapeSequenceParser);var y=e.call(this)||this;y._bufferService=t,y._charsetService=i,y._coreService=r,y._dirtyRowService=n,y._logService=s,y._optionsService=c,y._coreMouseService=u,y._unicodeService=p,y._parser=v,y._parseBuffer=new Uint32Array(4096),y._stringDecoder=new h.StringToUtf32,y._utf8Decoder=new h.Utf8ToUtf32,y._workCell=new g.CellData,y._windowTitle="",y._iconName="",y._windowTitleStack=[],y._iconNameStack=[],y._curAttrData=d.DEFAULT_ATTR_DATA.clone(),y._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone(),y._onRequestBell=new f.EventEmitter,y._onRequestRefreshRows=new f.EventEmitter,y._onRequestReset=new f.EventEmitter,y._onRequestScroll=new f.EventEmitter,y._onRequestSyncScrollBar=new f.EventEmitter,y._onRequestWindowsOptionsReport=new f.EventEmitter,y._onA11yChar=new f.EventEmitter,y._onA11yTab=new f.EventEmitter,y._onCursorMove=new f.EventEmitter,y._onLineFeed=new f.EventEmitter,y._onScroll=new f.EventEmitter,y._onTitleChange=new f.EventEmitter,y.register(y._parser),y._parser.setCsiHandlerFallback((function(e,t){y._logService.debug("Unknown CSI code: ",{identifier:y._parser.identToString(e),params:t.toArray()})})),y._parser.setEscHandlerFallback((function(e){y._logService.debug("Unknown ESC code: ",{identifier:y._parser.identToString(e)})})),y._parser.setExecuteHandlerFallback((function(e){y._logService.debug("Unknown EXECUTE code: ",{code:e})})),y._parser.setOscHandlerFallback((function(e,t,i){y._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),y._parser.setDcsHandlerFallback((function(e,t,i){"HOOK"===t&&(i=i.toArray()),y._logService.debug("Unknown DCS code: ",{identifier:y._parser.identToString(e),action:t,payload:i})})),y._parser.setPrintHandler((function(e,t,i){return y.print(e,t,i)})),y._parser.setCsiHandler({final:"@"},(function(e){return y.insertChars(e)})),y._parser.setCsiHandler({intermediates:" ",final:"@"},(function(e){return y.scrollLeft(e)})),y._parser.setCsiHandler({final:"A"},(function(e){return y.cursorUp(e)})),y._parser.setCsiHandler({intermediates:" ",final:"A"},(function(e){return y.scrollRight(e)})),y._parser.setCsiHandler({final:"B"},(function(e){return y.cursorDown(e)})),y._parser.setCsiHandler({final:"C"},(function(e){return y.cursorForward(e)})),y._parser.setCsiHandler({final:"D"},(function(e){return y.cursorBackward(e)})),y._parser.setCsiHandler({final:"E"},(function(e){return y.cursorNextLine(e)})),y._parser.setCsiHandler({final:"F"},(function(e){return y.cursorPrecedingLine(e)})),y._parser.setCsiHandler({final:"G"},(function(e){return y.cursorCharAbsolute(e)})),y._parser.setCsiHandler({final:"H"},(function(e){return y.cursorPosition(e)})),y._parser.setCsiHandler({final:"I"},(function(e){return y.cursorForwardTab(e)})),y._parser.setCsiHandler({final:"J"},(function(e){return y.eraseInDisplay(e)})),y._parser.setCsiHandler({prefix:"?",final:"J"},(function(e){return y.eraseInDisplay(e)})),y._parser.setCsiHandler({final:"K"},(function(e){return y.eraseInLine(e)})),y._parser.setCsiHandler({prefix:"?",final:"K"},(function(e){return y.eraseInLine(e)})),y._parser.setCsiHandler({final:"L"},(function(e){return y.insertLines(e)})),y._parser.setCsiHandler({final:"M"},(function(e){return y.deleteLines(e)})),y._parser.setCsiHandler({final:"P"},(function(e){return y.deleteChars(e)})),y._parser.setCsiHandler({final:"S"},(function(e){return y.scrollUp(e)})),y._parser.setCsiHandler({final:"T"},(function(e){return y.scrollDown(e)})),y._parser.setCsiHandler({final:"X"},(function(e){return y.eraseChars(e)})),y._parser.setCsiHandler({final:"Z"},(function(e){return y.cursorBackwardTab(e)})),y._parser.setCsiHandler({final:"`"},(function(e){return y.charPosAbsolute(e)})),y._parser.setCsiHandler({final:"a"},(function(e){return y.hPositionRelative(e)})),y._parser.setCsiHandler({final:"b"},(function(e){return y.repeatPrecedingCharacter(e)})),y._parser.setCsiHandler({final:"c"},(function(e){return y.sendDeviceAttributesPrimary(e)})),y._parser.setCsiHandler({prefix:">",final:"c"},(function(e){return y.sendDeviceAttributesSecondary(e)})),y._parser.setCsiHandler({final:"d"},(function(e){return y.linePosAbsolute(e)})),y._parser.setCsiHandler({final:"e"},(function(e){return y.vPositionRelative(e)})),y._parser.setCsiHandler({final:"f"},(function(e){return y.hVPosition(e)})),y._parser.setCsiHandler({final:"g"},(function(e){return y.tabClear(e)})),y._parser.setCsiHandler({final:"h"},(function(e){return y.setMode(e)})),y._parser.setCsiHandler({prefix:"?",final:"h"},(function(e){return y.setModePrivate(e)})),y._parser.setCsiHandler({final:"l"},(function(e){return y.resetMode(e)})),y._parser.setCsiHandler({prefix:"?",final:"l"},(function(e){return y.resetModePrivate(e)})),y._parser.setCsiHandler({final:"m"},(function(e){return y.charAttributes(e)})),y._parser.setCsiHandler({final:"n"},(function(e){return y.deviceStatus(e)})),y._parser.setCsiHandler({prefix:"?",final:"n"},(function(e){return y.deviceStatusPrivate(e)})),y._parser.setCsiHandler({intermediates:"!",final:"p"},(function(e){return y.softReset(e)})),y._parser.setCsiHandler({intermediates:" ",final:"q"},(function(e){return y.setCursorStyle(e)})),y._parser.setCsiHandler({final:"r"},(function(e){return y.setScrollRegion(e)})),y._parser.setCsiHandler({final:"s"},(function(e){return y.saveCursor(e)})),y._parser.setCsiHandler({final:"t"},(function(e){return y.windowOptions(e)})),y._parser.setCsiHandler({final:"u"},(function(e){return y.restoreCursor(e)})),y._parser.setCsiHandler({intermediates:"'",final:"}"},(function(e){return y.insertColumns(e)})),y._parser.setCsiHandler({intermediates:"'",final:"~"},(function(e){return y.deleteColumns(e)})),y._parser.setExecuteHandler(o.C0.BEL,(function(){return y.bell()})),y._parser.setExecuteHandler(o.C0.LF,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(o.C0.VT,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(o.C0.FF,(function(){return y.lineFeed()})),y._parser.setExecuteHandler(o.C0.CR,(function(){return y.carriageReturn()})),y._parser.setExecuteHandler(o.C0.BS,(function(){return y.backspace()})),y._parser.setExecuteHandler(o.C0.HT,(function(){return y.tab()})),y._parser.setExecuteHandler(o.C0.SO,(function(){return y.shiftOut()})),y._parser.setExecuteHandler(o.C0.SI,(function(){return y.shiftIn()})),y._parser.setExecuteHandler(o.C1.IND,(function(){return y.index()})),y._parser.setExecuteHandler(o.C1.NEL,(function(){return y.nextLine()})),y._parser.setExecuteHandler(o.C1.HTS,(function(){return y.tabSet()})),y._parser.setOscHandler(0,new m.OscHandler((function(e){y.setTitle(e),y.setIconName(e)}))),y._parser.setOscHandler(1,new m.OscHandler((function(e){return y.setIconName(e)}))),y._parser.setOscHandler(2,new m.OscHandler((function(e){return y.setTitle(e)}))),y._parser.setEscHandler({final:"7"},(function(){return y.saveCursor()})),y._parser.setEscHandler({final:"8"},(function(){return y.restoreCursor()})),y._parser.setEscHandler({final:"D"},(function(){return y.index()})),y._parser.setEscHandler({final:"E"},(function(){return y.nextLine()})),y._parser.setEscHandler({final:"H"},(function(){return y.tabSet()})),y._parser.setEscHandler({final:"M"},(function(){return y.reverseIndex()})),y._parser.setEscHandler({final:"="},(function(){return y.keypadApplicationMode()})),y._parser.setEscHandler({final:">"},(function(){return y.keypadNumericMode()})),y._parser.setEscHandler({final:"c"},(function(){return y.fullReset()})),y._parser.setEscHandler({final:"n"},(function(){return y.setgLevel(2)})),y._parser.setEscHandler({final:"o"},(function(){return y.setgLevel(3)})),y._parser.setEscHandler({final:"|"},(function(){return y.setgLevel(3)})),y._parser.setEscHandler({final:"}"},(function(){return y.setgLevel(2)})),y._parser.setEscHandler({final:"~"},(function(){return y.setgLevel(1)})),y._parser.setEscHandler({intermediates:"%",final:"@"},(function(){return y.selectDefaultCharset()})),y._parser.setEscHandler({intermediates:"%",final:"G"},(function(){return y.selectDefaultCharset()}));var _=function(e){b._parser.setEscHandler({intermediates:"(",final:e},(function(){return y.selectCharset("("+e)})),b._parser.setEscHandler({intermediates:")",final:e},(function(){return y.selectCharset(")"+e)})),b._parser.setEscHandler({intermediates:"*",final:e},(function(){return y.selectCharset("*"+e)})),b._parser.setEscHandler({intermediates:"+",final:e},(function(){return y.selectCharset("+"+e)})),b._parser.setEscHandler({intermediates:"-",final:e},(function(){return y.selectCharset("-"+e)})),b._parser.setEscHandler({intermediates:".",final:e},(function(){return y.selectCharset("."+e)})),b._parser.setEscHandler({intermediates:"/",final:e},(function(){return y.selectCharset("/"+e)}))},b=this;for(var C in a.CHARSETS)_(C);return y._parser.setEscHandler({intermediates:"#",final:"8"},(function(){return y.screenAlignmentPattern()})),y._parser.setErrorHandler((function(e){return y._logService.error("Parsing error: ",e),e})),y._parser.setDcsHandler({intermediates:"$",final:"q"},new S(y._bufferService,y._coreService,y._logService,y._optionsService)),y}return n(t,e),Object.defineProperty(t.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.parse=function(e){var t=this._bufferService.buffer,i=t.x,r=t.y;if(this._logService.debug("parsing data",e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),this._dirtyRowService.clearRange(),e.length>131072)for(var n=0;n<e.length;n+=131072){var s=n+131072<e.length?n+131072:e.length,o="string"==typeof e?this._stringDecoder.decode(e.substring(n,s),this._parseBuffer):this._utf8Decoder.decode(e.subarray(n,s),this._parseBuffer);this._parser.parse(this._parseBuffer,o)}else o="string"==typeof e?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer),this._parser.parse(this._parseBuffer,o);(t=this._bufferService.buffer).x===i&&t.y===r||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},t.prototype.print=function(e,t,i){var r,n,s=this._bufferService.buffer,o=this._charsetService.charset,a=this._optionsService.options.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,f=s.lines.get(s.ybase+s.y);this._dirtyRowService.markDirty(s.y),s.x&&i-t>0&&2===f.getWidth(s.x-1)&&f.setCellFromCodePoint(s.x-1,0,1,d.fg,d.bg,d.extended);for(var g=t;g<i;++g){if(r=e[g],n=this._unicodeService.wcwidth(r),r<127&&o){var v=o[String.fromCharCode(r)];v&&(r=v.charCodeAt(0))}if(a&&this._onA11yChar.fire(h.stringFromCodePoint(r)),n||!s.x){if(s.x+n-1>=l)if(c){for(;s.x<l;)f.setCellFromCodePoint(s.x++,0,1,d.fg,d.bg,d.extended);s.x=0,s.y++,s.y===s.scrollBottom+1?(s.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(s.y>=this._bufferService.rows&&(s.y=this._bufferService.rows-1),s.lines.get(s.ybase+s.y).isWrapped=!0),f=s.lines.get(s.ybase+s.y)}else if(s.x=l-1,2===n)continue;if(u&&(f.insertCells(s.x,n,s.getNullCell(d),d),2===f.getWidth(l-1)&&f.setCellFromCodePoint(l-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,d.fg,d.bg,d.extended)),f.setCellFromCodePoint(s.x++,r,n,d.fg,d.bg,d.extended),n>0)for(;--n;)f.setCellFromCodePoint(s.x++,0,0,d.fg,d.bg,d.extended)}else f.getWidth(s.x-1)?f.addCodepointToCell(s.x-1,r):f.addCodepointToCell(s.x-2,r)}i-t>0&&(f.loadCell(s.x-1,this._workCell),2===this._workCell.getWidth()||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),s.x<l&&i-t>0&&0===f.getWidth(s.x)&&!f.hasContent(s.x)&&f.setCellFromCodePoint(s.x,0,1,d.fg,d.bg,d.extended),this._dirtyRowService.markDirty(s.y)},t.prototype.addCsiHandler=function(e,t){var i=this;return"t"!==e.final||e.prefix||e.intermediates?this._parser.addCsiHandler(e,t):this._parser.addCsiHandler(e,(function(e){return!b(e.params[0],i._optionsService.options.windowOptions)||t(e)}))},t.prototype.addDcsHandler=function(e,t){return this._parser.addDcsHandler(e,new y.DcsHandler(t))},t.prototype.addEscHandler=function(e,t){return this._parser.addEscHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,new m.OscHandler(t))},t.prototype.bell=function(){this._onRequestBell.fire()},t.prototype.lineFeed=function(){var e=this._bufferService.buffer;this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},t.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},t.prototype.backspace=function(){var e,t=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(t.x>0&&t.x--);if(this._restrictCursor(this._bufferService.cols),t.x>0)t.x--;else if(0===t.x&&t.y>t.scrollTop&&t.y<=t.scrollBottom&&(null===(e=t.lines.get(t.ybase+t.y))||void 0===e?void 0:e.isWrapped)){t.lines.get(t.ybase+t.y).isWrapped=!1,t.y--,t.x=this._bufferService.cols-1;var i=t.lines.get(t.ybase+t.y);i.hasWidth(t.x)&&!i.hasContent(t.x)&&t.x--}this._restrictCursor()},t.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var e=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-e)}},t.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},t.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},t.prototype._restrictCursor=function(e){void 0===e&&(e=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(e,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)},t.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},t.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},t.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1))},t.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1)},t.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},t.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},t.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},t.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.cursorPosition=function(e){this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},t.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},t.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},t.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},t.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},t.prototype.hVPosition=function(e){this.cursorPosition(e)},t.prototype.tabClear=function(e){var t=e.params[0];0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={})},t.prototype.cursorForwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},t.prototype.cursorBackwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.x=i.prevStop()},t.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);n.replaceCells(t,i,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),r&&(n.isWrapped=!1)},t.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},t.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t<this._bufferService.rows;t++)this._resetBufferLine(t);this._dirtyRowService.markDirty(t);break;case 1:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(t=this._bufferService.rows,this._dirtyRowService.markDirty(t-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var i=this._bufferService.buffer.lines.length-this._bufferService.rows;i>0&&(this._bufferService.buffer.lines.trimStart(i),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-i,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-i,0),this._onScroll.fire(0))}},t.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.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)},t.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,i=this._bufferService.buffer;if(!(i.y>i.scrollBottom||i.y<i.scrollTop)){for(var r=i.ybase+i.y,n=this._bufferService.rows-1-i.scrollBottom,s=this._bufferService.rows-1+i.ybase-n+1;t--;)i.lines.splice(s-1,1),i.lines.splice(r,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},t.prototype.deleteLines=function(e){this._restrictCursor();var t=e.params[0]||1,i=this._bufferService.buffer;if(!(i.y>i.scrollBottom||i.y<i.scrollTop)){var r,n=i.ybase+i.y;for(r=this._bufferService.rows-1-i.scrollBottom,r=this._bufferService.rows-1+i.ybase-r;t--;)i.lines.splice(n,1),i.lines.splice(r,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},t.prototype.insertChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.insertCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.deleteChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.deleteCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.scrollUp=function(e){for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.lines.splice(i.ybase+i.scrollTop,1),i.lines.splice(i.ybase+i.scrollBottom,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom)},t.prototype.scrollDown=function(e){for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.lines.splice(i.ybase+i.scrollBottom,1),i.lines.splice(i.ybase+i.scrollTop,0,i.getBlankLine(d.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom)},t.prototype.scrollLeft=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.deleteCells(0,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.scrollRight=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.insertCells(0,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.insertColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=this._bufferService.buffer.lines.get(t.ybase+r);n.insertCells(t.x,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.deleteColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.deleteCells(t.x,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},t.prototype.eraseChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);t&&(t.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(e.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},t.prototype.repeatPrecedingCharacter=function(e){if(this._parser.precedingCodepoint){for(var t=e.params[0]||1,i=new Uint32Array(t),r=0;r<t;++r)i[r]=this._parser.precedingCodepoint;this.print(i,0,i.length)}},t.prototype.sendDeviceAttributesPrimary=function(e){e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(o.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(o.C0.ESC+"[?6c"))},t.prototype.sendDeviceAttributesSecondary=function(e){e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(o.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(o.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(o.C0.ESC+"[>83;40003;0c"))},t.prototype._is=function(e){return 0===(this._optionsService.options.termName+"").indexOf(e)},t.prototype.setMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0}},t.prototype.setModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,a.DEFAULT_CHARSET),this._charsetService.setgCharset(1,a.DEFAULT_CHARSET),this._charsetService.setgCharset(2,a.DEFAULT_CHARSET),this._charsetService.setgCharset(3,a.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}},t.prototype.resetMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1}},t.prototype.resetModePrivate=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[t]&&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}},t.prototype._updateAttrColor=function(e,t,i,r,n){return 2===t?(e|=50331648,e&=-16777216,e|=v.AttributeData.fromColorRGB([i,r,n])):5===t&&(e&=-50331904,e|=33554432|255&i),e},t.prototype._extractColor=function(e,t,i){var r=[0,0,-1,0,0,0],n=0,s=0;do{if(r[s+n]=e.params[t+s],e.hasSubParams(t+s)){var o=e.getSubParams(t+s),a=0;do{5===r[1]&&(n=1),r[s+a+1+n]=o[a]}while(++a<o.length&&a+s+1+n<r.length);break}if(5===r[1]&&s+n>=2||2===r[1]&&s+n>=5)break;r[1]&&(n=1)}while(++s+t<e.length&&s+n<r.length);for(a=2;a<r.length;++a)-1===r[a]&&(r[a]=0);switch(r[0]){case 38:i.fg=this._updateAttrColor(i.fg,r[1],r[3],r[4],r[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,r[1],r[3],r[4],r[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,r[1],r[3],r[4],r[5])}return s},t.prototype._processUnderline=function(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()},t.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=d.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=d.DEFAULT_ATTR_DATA.bg);for(var t,i=e.length,r=this._curAttrData,n=0;n<i;n++)(t=e.params[n])>=30&&t<=37?(r.fg&=-50331904,r.fg|=16777216|t-30):t>=40&&t<=47?(r.bg&=-50331904,r.bg|=16777216|t-40):t>=90&&t<=97?(r.fg&=-50331904,r.fg|=16777224|t-90):t>=100&&t<=107?(r.bg&=-50331904,r.bg|=16777224|t-100):0===t?(r.fg=d.DEFAULT_ATTR_DATA.fg,r.bg=d.DEFAULT_ATTR_DATA.bg):1===t?r.fg|=134217728:3===t?r.bg|=67108864:4===t?(r.fg|=268435456,this._processUnderline(e.hasSubParams(n)?e.getSubParams(n)[0]:1,r)):5===t?r.fg|=536870912:7===t?r.fg|=67108864:8===t?r.fg|=1073741824:2===t?r.bg|=134217728:21===t?this._processUnderline(2,r):22===t?(r.fg&=-134217729,r.bg&=-134217729):23===t?r.bg&=-67108865:24===t?r.fg&=-268435457:25===t?r.fg&=-536870913:27===t?r.fg&=-67108865:28===t?r.fg&=-1073741825:39===t?(r.fg&=-67108864,r.fg|=16777215&d.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):38===t||48===t||58===t?n+=this._extractColor(e,n,r):59===t?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):100===t?(r.fg&=-67108864,r.fg|=16777215&d.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&d.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t)},t.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(o.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,i=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(o.C0.ESC+"["+t+";"+i+"R")}},t.prototype.deviceStatusPrivate=function(e){switch(e.params[0]){case 6:var t=this._bufferService.buffer.y+1,i=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(o.C0.ESC+"[?"+t+";"+i+"R")}},t.prototype.softReset=function(e){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=d.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},t.prototype.setCursorStyle=function(e){var t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var i=t%2==1;this._optionsService.options.cursorBlink=i},t.prototype.setScrollRegion=function(e){var t,i=e.params[0]||1;(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),t>i&&(this._bufferService.buffer.scrollTop=i-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0))},t.prototype.windowOptions=function(e){if(b(e.params[0],this._optionsService.options.windowOptions)){var t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(s.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(s.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(o.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},t.prototype.saveCursor=function(e){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},t.prototype.restoreCursor=function(e){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()},t.prototype.setTitle=function(e){this._windowTitle=e,this._onTitleChange.fire(e)},t.prototype.setIconName=function(e){this._iconName=e},t.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},t.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},t.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},t.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,a.DEFAULT_CHARSET)},t.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._charsetService.setgCharset(_[e[0]],a.CHARSETS[e[1]]||a.DEFAULT_CHARSET):this.selectDefaultCharset()},t.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._onRequestScroll.fire(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor()},t.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},t.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.ybase+e.y,t,1),e.lines.set(e.ybase+e.y,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor()},t.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},t.prototype.reset=function(){this._curAttrData=d.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=d.DEFAULT_ATTR_DATA.clone()},t.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},t.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},t.prototype.screenAlignmentPattern=function(){var e=new g.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var i=0;i<this._bufferService.rows;++i){var r=t.ybase+t.y+i,n=t.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},t}(c.Disposable);t.InputHandler=C},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;var r=function(){function e(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=e,this.maxSubParamsLength=t,t>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return e.fromArray=function(t){var i=new e;if(!t.length)return i;for(var r=t[0]instanceof Array?1:0;r<t.length;++r){var n=t[r];if(n instanceof Array)for(var s=0;s<n.length;++s)i.addSubParam(n[s]);else i.addParam(n)}return i},e.prototype.clone=function(){var t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t},e.prototype.toArray=function(){for(var e=[],t=0;t<this.length;++t){e.push(this.params[t]);var i=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,r))}return e},e.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},e.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>2147483647?2147483647:e}},e.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>2147483647?2147483647:e,this._subParamsIdx[this.length-1]++}},e.prototype.hasSubParams=function(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0},e.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null},e.prototype.getSubParamsAll=function(){for(var e={},t=0;t<this.length;++t){var i=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-i>0&&(e[t]=this._subParams.slice(i,r))}return e},e.prototype.addDigit=function(e){var t;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var i=this._digitIsSub?this._subParams:this.params,r=i[t-1];i[t-1]=~r?Math.min(10*r+e,2147483647):e}},e}();t.Params=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;var r=i(23),n=i(8),s=function(){function e(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var i=this._handlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.reset=function(){2===this._state&&this.end(!1),this._id=-1,this._state=0},e.prototype._start=function(){var e=this._handlers[this._id];if(e)for(var t=e.length-1;t>=0;t--)e[t].start();else this._handlerFb(this._id,"START")},e.prototype._put=function(e,t,i){var r=this._handlers[this._id];if(r)for(var s=r.length-1;s>=0;s--)r[s].put(e,t,i);else this._handlerFb(this._id,"PUT",n.utf32ToString(e,t,i))},e.prototype._end=function(e){var t=this._handlers[this._id];if(t){for(var i=t.length-1;i>=0&&!1===t[i].end(e);i--);for(i--;i>=0;i--)t[i].end(!1)}else this._handlerFb(this._id,"END",e)},e.prototype.start=function(){this.reset(),this._id=-1,this._state=1},e.prototype.put=function(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){var r=e[t++];if(59===r){this._state=2,this._start();break}if(r<48||57<r)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+r-48}2===this._state&&i-t>0&&this._put(e,t,i)}},e.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._id=-1,this._state=0)},e}();t.OscParser=s;var o=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.start=function(){this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,i){this._hitLimit||(this._data+=n.utf32ToString(e,t,i),this._data.length>r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},e}();t.OscHandler=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;var r=i(8),n=i(21),s=i(23),o=[],a=function(){function e(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=function(){}}return e.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},e.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var i=this._handlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},e.prototype.setHandler=function(e,t){this._handlers[e]=[t]},e.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},e.prototype.setHandlerFallback=function(e){this._handlerFb=e},e.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=o,this._ident=0},e.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(var i=this._active.length-1;i>=0;i--)this._active[i].hook(t);else this._handlerFb(this._ident,"HOOK",t)},e.prototype.put=function(e,t,i){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,i);else this._handlerFb(this._ident,"PUT",r.utf32ToString(e,t,i))},e.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;t>=0&&!1===this._active[t].unhook(e);t--);for(t--;t>=0;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0},e}();t.DcsParser=a;var l=function(){function e(e){this._handler=e,this._data="",this._hitLimit=!1}return e.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},e.prototype.put=function(e,t,i){this._hitLimit||(this._data+=r.utf32ToString(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},e.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params||new n.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},e}();t.DcsHandler=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.removeTerminalFromCache=t.acquireCharAtlas=void 0;var r=i(26),n=i(43),s=[];t.acquireCharAtlas=function(e,t,i,o,a){for(var l=r.generateConfig(o,a,e,i),c=0;c<s.length;c++){var u=(h=s[c]).ownedBy.indexOf(t);if(u>=0){if(r.configEquals(h.config,l))return h.atlas;1===h.ownedBy.length?(h.atlas.dispose(),s.splice(c,1)):h.ownedBy.splice(u,1);break}}for(c=0;c<s.length;c++){var h=s[c];if(r.configEquals(h.config,l))return h.ownedBy.push(t),h.atlas}var d={atlas:new n.DynamicCharAtlas(document,l),config:l,ownedBy:[t]};return s.push(d),d.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<s.length;t++){var i=s[t].ownedBy.indexOf(e);if(-1!==i){1===s[t].ownedBy.length?(s[t].atlas.dispose(),s.splice(t,1)):s[t].ownedBy.splice(i,1);break}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.is256Color=t.configEquals=t.generateConfig=void 0;var r=i(3);t.generateConfig=function(e,t,i,r){var n={foreground:r.foreground,background:r.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:r.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontWeightBold:i.fontWeightBold,allowTransparency:i.allowTransparency,colors:n}},t.configEquals=function(e,t){for(var i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<r.DEFAULT_COLOR}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorManager=t.DEFAULT_ANSI_COLORS=void 0;var r=i(10),n=i(45),s=r.css.toColor("#ffffff"),o=r.css.toColor("#000000"),a=r.css.toColor("#ffffff"),l=r.css.toColor("#000000"),c={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=function(){for(var e=[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")],t=[0,95,135,175,215,255],i=0;i<216;i++){var n=t[i/36%6|0],s=t[i/6%6|0],o=t[i%6];e.push({css:r.channels.toCss(n,s,o),rgba:r.channels.toRgba(n,s,o)})}for(i=0;i<24;i++){var a=8+10*i;e.push({css:r.channels.toCss(a,a,a),rgba:r.channels.toRgba(a,a,a)})}return e}();var u=function(){function e(e,i){this.allowTransparency=i;var u=e.createElement("canvas");u.width=1,u.height=1;var h=u.getContext("2d");if(!h)throw new Error("Could not get rendering context");this._ctx=h,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new n.ColorContrastCache,this.colors={foreground:s,background:o,cursor:a,cursorAccent:l,selectionTransparent:c,selectionOpaque:r.color.blend(o,c),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return e.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},e.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,s),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,l,!0),this.colors.selectionTransparent=this._parseColor(e.selection,c,!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(e.black,t.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,t.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,t.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,t.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,t.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,t.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,t.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,t.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},e.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;if(255!==n[3]){if(!i)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;var s=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map((function(e){return Number(e)})),o=s[0],a=s[1],l=s[2],c=s[3],u=Math.round(255*c);return{rgba:r.channels.toRgba(o,a,l,u),css:e}}return{css:this._ctx.fillStyle,rgba:r.channels.toRgba(n[0],n[1],n[2],n[3])}},e}();t.ColorManager=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerRegistry=t.JoinedCellData=void 0;var s=i(6),o=i(3),a=i(4),l=function(e){function t(t,i,r){var n=e.call(this)||this;return n.content=0,n.combinedData="",n.fg=t.fg,n.bg=t.bg,n.combinedData=i,n._width=r,n}return n(t,e),t.prototype.isCombined=function(){return 2097152},t.prototype.getWidth=function(){return this._width},t.prototype.getChars=function(){return this.combinedData},t.prototype.getCode=function(){return 2097151},t.prototype.setFromCharData=function(e){throw new Error("not implemented")},t.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},t}(s.AttributeData);t.JoinedCellData=l;var c=function(){function e(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}return e.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},e.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},e.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];for(var i=[],r=t.translateToString(!0),n=0,s=0,a=0,l=t.getFg(0),c=t.getBg(0),u=0;u<t.getTrimmedLength();u++)if(t.loadCell(u,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==l||this._workCell.bg!==c){if(u-n>1)for(var h=this._getJoinedRanges(r,a,s,t,n),d=0;d<h.length;d++)i.push(h[d]);n=u,a=s,l=this._workCell.fg,c=this._workCell.bg}s+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-n>1)for(h=this._getJoinedRanges(r,a,s,t,n),d=0;d<h.length;d++)i.push(h[d]);return i},e.prototype._getJoinedRanges=function(t,i,r,n,s){for(var o=t.substring(i,r),a=this._characterJoiners[0].handler(o),l=1;l<this._characterJoiners.length;l++)for(var c=this._characterJoiners[l].handler(o),u=0;u<c.length;u++)e._mergeRanges(a,c[u]);return this._stringRangesToCellRanges(a,n,s),a},e.prototype._stringRangesToCellRanges=function(e,t,i){var r=0,n=!1,s=0,a=e[r];if(a){for(var l=i;l<this._bufferService.cols;l++){var c=t.getWidth(l),u=t.getString(l).length||o.WHITESPACE_CELL_CHAR.length;if(0!==c){if(!n&&a[0]<=s&&(a[0]=l,n=!0),a[1]<=s){if(a[1]=l,!(a=e[++r]))break;a[0]<=s?(a[0]=l,n=!0):n=!1}s+=u}}a&&(a[1]=this._bufferService.cols)}},e._mergeRanges=function(e,t){for(var i=!1,r=0;r<e.length;r++){var n=e[r];if(i){if(t[1]<=n[0])return e[r-1][1]=t[1],e;if(t[1]<=n[1])return e[r-1][1]=Math.max(t[1],n[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=n[0])return e.splice(r,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e},e}();t.CharacterJoinerRegistry=c},function(e,t,i){"use strict";function r(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getRawByteCoords=t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=r,t.getCoords=function(e,t,i,n,s,o,a,l){if(s){var c=r(e,t);if(c)return c[0]=Math.ceil((c[0]+(l?o/2:0))/o),c[1]=Math.ceil(c[1]/a),c[0]=Math.min(Math.max(c[0],1),i+(l?1:0)),c[1]=Math.min(Math.max(c[1],1),n),c}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0;var r=function(){function e(e){this._renderCallback=e}return e.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.refresh=function(e,t,i){var r=this;this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return r._innerRefresh()})))},e.prototype._innerRefresh=function(){if(void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount){var e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(e,t)}},e}();t.RenderDebouncer=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.ScreenDprMonitor=void 0;var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}return n(t,e),t.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.clearListener()},t.prototype._updateDpr=function(){var e;this._outerListener&&(null===(e=this._resolutionMediaMatchList)||void 0===e||e.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},t.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)},t}(i(2).Disposable);t.ScreenDprMonitor=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i){if(void 0===i&&(i=5),"object"!=typeof t)return t;var r=Array.isArray(t)?[]:{};for(var n in t)r[n]=i<=1?t[n]:t[n]?e(t[n],i-1):t[n];return r}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var r=i(4),n=i(35),s=i(18),o=i(0),a=i(83),l=function(){function e(e){this._core=new n.Terminal(e),this._addonManager=new a.AddonManager}return e.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(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new d(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new f(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),new u(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},e.prototype.open=function(e){this._core.open(e)},e.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},e.prototype.registerLinkMatcher=function(e,t,i){return this._checkProposedApi(),this._core.registerLinkMatcher(e,t,i)},e.prototype.deregisterLinkMatcher=function(e){this._checkProposedApi(),this._core.deregisterLinkMatcher(e)},e.prototype.registerLinkProvider=function(e){return this._checkProposedApi(),this._core.registerLinkProvider(e)},e.prototype.registerCharacterJoiner=function(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)},e.prototype.deregisterCharacterJoiner=function(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)},e.prototype.registerMarker=function(e){return this._checkProposedApi(),this._verifyIntegers(e),this._core.addMarker(e)},e.prototype.addMarker=function(e){return this.registerMarker(e)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},e.prototype.scrollPages=function(e){this._verifyIntegers(e),this._core.scrollPages(e)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(e){this._verifyIntegers(e),this._core.scrollToLine(e)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(e,t){this._core.write(e,t)},e.prototype.writeUtf8=function(e,t){this._core.write(e,t)},e.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},e.prototype.paste=function(e){this._core.paste(e)},e.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},e.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},e.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(e,"strings",{get:function(){return s},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var i=0,r=e;i<r.length;i++){var n=r[i];if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}},e}();t.Terminal=l;var c=function(){function e(e,t){this._buffer=e,this.type=t}return e.prototype.init=function(e){return this._buffer=e,this},Object.defineProperty(e.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),e.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new h(t)},e.prototype.getNullCell=function(){return new r.CellData},e}(),u=function(){function e(e){var t=this;this._buffers=e,this._onBufferChange=new o.EventEmitter,this._normal=new c(this._buffers.normal,"normal"),this._alternate=new c(this._buffers.alt,"alternate"),this._buffers.onBufferActivate((function(){return t._onBufferChange.fire(t.active)}))}return Object.defineProperty(e.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.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(e.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),e}(),h=function(){function e(e){this._line=e}return Object.defineProperty(e.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),e.prototype.getCell=function(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)},e.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},e}(),d=function(){function e(e){this._core=e}return e.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,(function(e){return t(e.toArray())}))},e.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},e.prototype.registerDcsHandler=function(e,t){return this._core.addDcsHandler(e,(function(e,i){return t(e,i.toArray())}))},e.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},e.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},e.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},e.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},e}(),f=function(){function e(e){this._core=e}return e.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!1,configurable:!0}),e}()},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;var s=i(36),o=i(37),a=i(38),l=i(12),c=i(19),u=i(40),h=i(50),d=i(51),f=i(11),p=i(7),g=i(18),v=i(54),m=i(55),y=i(56),_=i(57),b=i(59),S=i(0),C=i(16),w=i(27),k=i(60),x=i(5),E=i(61),T=i(62),L=i(63),A=i(64),R=i(65),D="undefined"!=typeof window?window.document:null,O=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,t)||this;return i.browser=f,i._keyDownHandled=!1,i._onCursorMove=new S.EventEmitter,i._onKey=new S.EventEmitter,i._onRender=new S.EventEmitter,i._onSelectionChange=new S.EventEmitter,i._onTitleChange=new S.EventEmitter,i._onFocus=new S.EventEmitter,i._onBlur=new S.EventEmitter,i._onA11yCharEmitter=new S.EventEmitter,i._onA11yTabEmitter=new S.EventEmitter,i._setup(),i.linkifier=i._instantiationService.createInstance(h.Linkifier),i.linkifier2=i.register(i._instantiationService.createInstance(L.Linkifier2)),i.register(i._inputHandler.onRequestBell((function(){return i.bell()}))),i.register(i._inputHandler.onRequestRefreshRows((function(e,t){return i.refresh(e,t)}))),i.register(i._inputHandler.onRequestReset((function(){return i.reset()}))),i.register(i._inputHandler.onRequestScroll((function(e,t){return i.scroll(e,t||void 0)}))),i.register(i._inputHandler.onRequestWindowsOptionsReport((function(e){return i._reportWindowsOptions(e)}))),i.register(S.forwardEvent(i._inputHandler.onCursorMove,i._onCursorMove)),i.register(S.forwardEvent(i._inputHandler.onTitleChange,i._onTitleChange)),i.register(S.forwardEvent(i._inputHandler.onA11yChar,i._onA11yCharEmitter)),i.register(S.forwardEvent(i._inputHandler.onA11yTab,i._onA11yTabEmitter)),i.register(i._bufferService.onResize((function(e){return i._afterResize(e.cols,e.rows)}))),i}return n(t,e),Object.defineProperty(t.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var t,i,r;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._renderService)||void 0===t||t.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},null===(r=null===(i=this.element)||void 0===i?void 0:i.parentNode)||void 0===r||r.removeChild(this.element))},t.prototype._setup=function(){e.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(t.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),t.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},t.prototype._updateOptions=function(t){var i,r,n,s;switch(e.prototype._updateOptions.call(this,t),t){case"fontFamily":case"fontSize":null===(i=this._renderService)||void 0===i||i.clear(),null===(r=this._charSizeService)||void 0===r||r.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":null===(n=this.viewport)||void 0===n||n.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)):(null===(s=this._accessibilityManager)||void 0===s||s.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},t.prototype._onTextAreaFocus=function(e){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(l.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},t.prototype.blur=function(){var e;return null===(e=this.textarea)||void 0===e?void 0:e.blur()},t.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(l.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},t.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var e=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),t=this._bufferService.buffer.y*e,i=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=i+"px",this.textarea.style.top=t+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=e+"px",this.textarea.style.lineHeight=e+"px",this.textarea.style.zIndex="-5"}},t.prototype._initGlobal=function(){var e=this;this._bindKeys(),this.register(p.addDisposableDomListener(this.element,"copy",(function(t){e.hasSelection()&&a.copyHandler(t,e._selectionService)})));var t=function(t){return a.handlePasteEvent(t,e.textarea,e._coreService)};this.register(p.addDisposableDomListener(this.textarea,"paste",t)),this.register(p.addDisposableDomListener(this.element,"paste",t)),f.isFirefox?this.register(p.addDisposableDomListener(this.element,"mousedown",(function(t){2===t.button&&a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))):this.register(p.addDisposableDomListener(this.element,"contextmenu",(function(t){a.rightClickHandler(t,e.textarea,e.screenElement,e._selectionService,e.options.rightClickSelectsWord)}))),f.isLinux&&this.register(p.addDisposableDomListener(this.element,"auxclick",(function(t){1===t.button&&a.moveTextAreaUnderMouseCursor(t,e.textarea,e.screenElement)})))},t.prototype._bindKeys=function(){var e=this;this.register(p.addDisposableDomListener(this.textarea,"keyup",(function(t){return e._keyUp(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"keydown",(function(t){return e._keyDown(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"keypress",(function(t){return e._keyPress(t)}),!0)),this.register(p.addDisposableDomListener(this.textarea,"compositionstart",(function(){return e._compositionHelper.compositionstart()}))),this.register(p.addDisposableDomListener(this.textarea,"compositionupdate",(function(t){return e._compositionHelper.compositionupdate(t)}))),this.register(p.addDisposableDomListener(this.textarea,"compositionend",(function(){return e._compositionHelper.compositionend()}))),this.register(this.onRender((function(){return e._compositionHelper.updateCompositionElements()}))),this.register(this.onRender((function(t){return e._queueLinkification(t.start,t.end)})))},t.prototype.open=function(e){var t=this;if(!e)throw new Error("Terminal requires a parent element.");D.body.contains(e)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.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"),e.appendChild(this.element);var i=D.createDocumentFragment();this._viewportElement=D.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=D.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=D.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=D.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this.textarea=D.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(p.addDisposableDomListener(this.textarea,"focus",(function(e){return t._onTextAreaFocus(e)}))),this.register(p.addDisposableDomListener(this.textarea,"blur",(function(){return t._onTextAreaBlur()}))),this._helperContainer.appendChild(this.textarea);var r=this._instantiationService.createInstance(A.CoreBrowserService,this.textarea);this._instantiationService.setService(x.ICoreBrowserService,r),this._charSizeService=this._instantiationService.createInstance(E.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._compositionView=D.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(i),this._theme=this.options.theme||this._theme,this._colorManager=new w.ColorManager(D,this.options.allowTransparency),this.register(this.optionsService.onOptionChange((function(e){return t._colorManager.onOptionsChange(e)}))),this._colorManager.setTheme(this._theme);var n=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(k.RenderService,n,this.rows,this.screenElement)),this._instantiationService.setService(x.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange((function(e){return t._onRender.fire(e)}))),this.onResize((function(e){return t._renderService.resize(e.cols,e.rows)})),this._soundService=this._instantiationService.createInstance(v.SoundService),this._instantiationService.setService(x.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(T.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(o.Viewport,(function(e,i){return t.scrollLines(e,i)}),this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar((function(){return t.viewport.syncScrollArea()}))),this.register(this.viewport),this.register(this.onCursorMove((function(){t._renderService.onCursorMove(),t._syncTextArea()}))),this.register(this.onResize((function(){return t._renderService.onResize(t.cols,t.rows)}))),this.register(this.onBlur((function(){return t._renderService.onBlur()}))),this.register(this.onFocus((function(){return t._renderService.onFocus()}))),this.register(this._renderService.onDimensionsChange((function(){return t.viewport.syncScrollArea()}))),this._selectionService=this.register(this._instantiationService.createInstance(d.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((function(e){return t.scrollLines(e.amount,e.suppressScrollEvent)}))),this.register(this._selectionService.onSelectionChange((function(){return t._onSelectionChange.fire()}))),this.register(this._selectionService.onRequestRedraw((function(e){return t._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)}))),this.register(this._selectionService.onLinuxMouseSelection((function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()}))),this.register(this.onScroll((function(){t.viewport.syncScrollArea(),t._selectionService.refresh()}))),this.register(p.addDisposableDomListener(this._viewportElement,"scroll",(function(){return t._selectionService.refresh()}))),this._mouseZoneManager=this._instantiationService.createInstance(m.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return t._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(p.addDisposableDomListener(this.element,"mousedown",(function(e){return t._selectionService.onMouseDown(e)}))),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},t.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(u.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(_.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},t.prototype._setTheme=function(e){var t,i,r;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(i=this._renderService)||void 0===i||i.setColors(this._colorManager.colors),null===(r=this.viewport)||void 0===r||r.onThemeChange(this._colorManager.colors)},t.prototype.bindMouse=function(){var e=this,t=this,i=this.element;function r(e){var i,r,n=t._mouseService.getRawByteCoords(e,t.screenElement,t.cols,t.rows);if(!n)return!1;switch(e.overrideType||e.type){case"mousemove":r=32,void 0===e.buttons?(i=3,void 0!==e.button&&(i=e.button<3?e.button:3)):i=1&e.buttons?0:4&e.buttons?1:2&e.buttons?2:3;break;case"mouseup":r=0,i=e.button<3?e.button:3;break;case"mousedown":r=1,i=e.button<3?e.button:3;break;case"wheel":0!==e.deltaY&&(r=e.deltaY<0?0:1),i=4;break;default:return!1}return!(void 0===r||void 0===i||i>4)&&t._coreMouseService.triggerMouseEvent({col:n.x-33,row:n.y-33,button:i,action:r,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}var n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},s=function(t){return r(t),t.buttons||(e._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.removeEventListener("mousemove",n.mousedrag)),e.cancel(t)},o=function(t){return r(t),t.preventDefault(),e.cancel(t)},a=function(e){e.buttons&&r(e)},c=function(e){e.buttons||r(e)};this.register(this._coreMouseService.onProtocolChange((function(t){t?("debug"===e.optionsService.options.logLevel&&e._logService.debug("Binding to mouse events:",e._coreMouseService.explainEvents(t)),e.element.classList.add("enable-mouse-events"),e._selectionService.disable()):(e._logService.debug("Unbinding from mouse events."),e.element.classList.remove("enable-mouse-events"),e._selectionService.enable()),8&t?n.mousemove||(i.addEventListener("mousemove",c),n.mousemove=c):(i.removeEventListener("mousemove",n.mousemove),n.mousemove=null),16&t?n.wheel||(i.addEventListener("wheel",o,{passive:!1}),n.wheel=o):(i.removeEventListener("wheel",n.wheel),n.wheel=null),2&t?n.mouseup||(n.mouseup=s):(e._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),4&t?n.mousedrag||(n.mousedrag=a):(e._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)}))),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(p.addDisposableDomListener(i,"mousedown",(function(t){if(t.preventDefault(),e.focus(),e._coreMouseService.areMouseEventsActive&&!e._selectionService.shouldForceSelection(t))return r(t),n.mouseup&&e._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&e._document.addEventListener("mousemove",n.mousedrag),e.cancel(t)}))),this.register(p.addDisposableDomListener(i,"wheel",(function(t){if(n.wheel);else if(!e.buffer.hasScrollback){var i=e.viewport.getLinesScrolled(t);if(0===i)return;for(var r=l.C0.ESC+(e._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(t.deltaY<0?"A":"B"),s="",o=0;o<Math.abs(i);o++)s+=r;e._coreService.triggerDataEvent(s,!0)}}),{passive:!0})),this.register(p.addDisposableDomListener(i,"wheel",(function(t){if(!n.wheel)return e.viewport.onWheel(t)?void 0:e.cancel(t)}),{passive:!1})),this.register(p.addDisposableDomListener(i,"touchstart",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchStart(t),e.cancel(t)}),{passive:!0})),this.register(p.addDisposableDomListener(i,"touchmove",(function(t){if(!e._coreMouseService.areMouseEventsActive)return e.viewport.onTouchMove(t)?void 0:e.cancel(t)}),{passive:!1}))},t.prototype.refresh=function(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)},t.prototype._queueLinkification=function(e,t){var i;null===(i=this.linkifier)||void 0===i||i.linkifyRows(e,t)},t.prototype.updateCursorStyle=function(e){this._selectionService&&this._selectionService.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},t.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},t.prototype.scrollLines=function(t,i){e.prototype.scrollLines.call(this,t,i),this.refresh(0,this.rows-1)},t.prototype.paste=function(e){a.paste(e,this.textarea,this._coreService)},t.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},t.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},t.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},t.prototype.registerLinkProvider=function(e){return this.linkifier2.registerLinkProvider(e)},t.prototype.registerCharacterJoiner=function(e){var t=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},t.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(t.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),t.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},t.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},t.prototype.select=function(e,t,i){this._selectionService.setSelection(e,t,i)},t.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},t.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]}},t.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},t.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},t.prototype.selectLines=function(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)},t.prototype._keyDown=function(e){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=b.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===t.type||2===t.type){var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)}return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(t.key!==l.C0.ETX&&t.key!==l.C0.CR||(this.textarea.value=""),this._onKey.fire({key:t.key,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0)))},t.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)},t.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e))},t.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this._coreService.triggerDataEvent(t,!0),0))},t.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},t.prototype.resize=function(t,i){t!==this.cols||i!==this.rows?e.prototype.resize.call(this,t,i):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},t.prototype._afterResize=function(e,t){var i,r;null===(i=this._charSizeService)||void 0===i||i.measure(),null===(r=this.viewport)||void 0===r||r.syncScrollArea(!0)},t.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){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 e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(C.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},t.prototype.reset=function(){var t,i;this.options.rows=this.rows,this.options.cols=this.cols;var r=this._customKeyEventHandler;this._setup(),e.prototype.reset.call(this),null===(t=this._selectionService)||void 0===t||t.reset(),this._customKeyEventHandler=r,this.refresh(0,this.rows-1),null===(i=this.viewport)||void 0===i||i.syncScrollArea()},t.prototype._reportWindowsOptions=function(e){if(this._renderService)switch(e){case c.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var t=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),i=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(l.C0.ESC+"[4;"+i+";"+t+"t");break;case c.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var r=this._renderService.dimensions.scaledCellWidth.toFixed(0),n=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(l.C0.ESC+"[6;"+n+";"+r+"t")}},t.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},t.prototype._visualBell=function(){return!1},t.prototype._soundBell=function(){return"sound"===this.options.bellStyle},t}(R.CoreTerminal);t.Terminal=O},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;var s=i(5),o=i(1),a=function(){function e(e,t,i,r,n,s){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._charSizeService=n,this._coreService=s,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(e.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((function(){t._compositionPosition.end=t._textarea.value.length}),0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((function(){var e;t._isSendingComposition&&(t._isSendingComposition=!1,e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._coreService.triggerDataEvent(e,!0))}),0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},e.prototype._handleAnyTextareaChanges=function(){var e=this,t=this._textarea.value;setTimeout((function(){if(!e._isComposing){var i=e._textarea.value.replace(t,"");i.length>0&&e._coreService.triggerDataEvent(i,!0)}}),0)},e.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var i=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),r=this._bufferService.buffer.y*i,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var s=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=s.width+"px",this._textarea.style.height=s.height+"px",this._textarea.style.lineHeight=s.height+"px"}e||setTimeout((function(){return t.updateCompositionElements(!0)}),0)}},r([n(2,o.IBufferService),n(3,o.IOptionsService),n(4,s.ICharSizeService),n(5,o.ICoreService)],e)}();t.CompositionHelper=a},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;var a=i(2),l=i(7),c=i(5),u=i(1),h=function(e){function t(t,i,r,n,s,o,a){var c=e.call(this)||this;return c._scrollLines=t,c._viewportElement=i,c._scrollArea=r,c._bufferService=n,c._optionsService=s,c._charSizeService=o,c._renderService=a,c.scrollBarWidth=0,c._currentRowHeight=0,c._lastRecordedBufferLength=0,c._lastRecordedViewportHeight=0,c._lastRecordedBufferHeight=0,c._lastTouchY=0,c._lastScrollTop=0,c._wheelPartialScroll=0,c._refreshAnimationFrame=null,c._ignoreNextScrollEvent=!1,c.scrollBarWidth=c._viewportElement.offsetWidth-c._scrollArea.offsetWidth||15,c.register(l.addDisposableDomListener(c._viewportElement,"scroll",c._onScroll.bind(c))),setTimeout((function(){return c.syncScrollArea()}),0),c}return n(t,e),t.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},t.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},t.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},t.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},t.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t,!0)}},t.prototype._bubbleScroll=function(e,t){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)},t.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},t.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t},t.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},t.prototype._applyScrollModifier=function(e,t){var i=this._optionsService.options.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},t.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},t.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},s([o(3,u.IBufferService),o(4,u.IOptionsService),o(5,c.ICharSizeService),o(6,c.IRenderService)],t)}(a.Disposable);t.Viewport=h},function(e,t,i){"use strict";function r(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"[200~"+e+"[201~":e}function s(e,t,i){e=n(e=r(e),i.decPrivateModes.bracketedPasteMode),i.triggerDataEvent(e,!0),t.value=""}function o(e,t,i){var r=i.getBoundingClientRect(),n=e.clientX-r.left-10,s=e.clientY-r.top-10;t.style.width="20px",t.style.height="20px",t.style.left=n+"px",t.style.top=s+"px",t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=r,t.bracketTextForPaste=n,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i){e.stopPropagation(),e.clipboardData&&s(e.clipboardData.getData("text/plain"),t,i)},t.paste=s,t.moveTextAreaUnderMouseCursor=o,t.rightClickHandler=function(e,t,i,r,n){o(e,t,i),n&&!r.isClickInSelection(e)&&r.selectWordAtCursor(e),t.value=r.selectionText,t.select()}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;var s=i(2),o=i(15),a=i(21),l=i(22),c=i(24),u=function(){function e(e){this.table=new Uint8Array(e)}return e.prototype.setDefault=function(e,t){o.fill(this.table,e<<4|t)},e.prototype.add=function(e,t,i,r){this.table[t<<8|e]=i<<4|r},e.prototype.addMany=function(e,t,i,r){for(var n=0;n<e.length;n++)this.table[t<<8|e[n]]=i<<4|r},e}();t.TransitionTable=u,t.VT500_TRANSITION_TABLE=function(){var e=new u(4095),t=Array.apply(null,Array(256)).map((function(e,t){return t})),i=function(e,i){return t.slice(e,i)},r=i(32,127),n=i(0,24);n.push(25),n.push.apply(n,i(28,32));var s,o=i(0,14);for(s in e.setDefault(1,0),e.addMany(r,0,2,0),o)e.addMany([24,26,153,154],s,3,0),e.addMany(i(128,144),s,3,0),e.addMany(i(144,152),s,3,0),e.add(156,s,0,0),e.add(27,s,11,1),e.add(157,s,4,8),e.addMany([152,158,159],s,0,7),e.add(155,s,11,3),e.add(144,s,11,9);return e.addMany(n,0,3,0),e.addMany(n,1,3,1),e.add(127,1,0,1),e.addMany(n,8,0,8),e.addMany(n,3,3,3),e.add(127,3,0,3),e.addMany(n,4,3,4),e.add(127,4,0,4),e.addMany(n,6,3,6),e.addMany(n,5,3,5),e.add(127,5,0,5),e.addMany(n,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(n,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(n,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(n,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(n,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(n,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(n,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();var h=function(e){function i(i){void 0===i&&(i=t.VT500_TRANSITION_TABLE);var r=e.call(this)||this;return r._transitions=i,r.initialState=0,r.currentState=r.initialState,r._params=new a.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(e,t,i){},r._executeHandlerFb=function(e){},r._csiHandlerFb=function(e,t){},r._escHandlerFb=function(e){},r._errorHandlerFb=function(e){return e},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscParser=new l.OscParser,r._dcsParser=new c.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},(function(){})),r}return n(i,e),i.prototype._identifier=function(e,t){void 0===t&&(t=[64,126]);var i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if((i=e.prefix.charCodeAt(0))&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var r=0;r<e.intermediates.length;++r){var n=e.intermediates.charCodeAt(r);if(32>n||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(1!==e.final.length)throw new Error("final must be a single byte");var s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(i<<=8)|s},i.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},i.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},i.prototype.setPrintHandler=function(e){this._printHandler=e},i.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},i.prototype.addEscHandler=function(e,t){var i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);var r=this._escHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},i.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},i.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},i.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},i.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},i.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},i.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},i.prototype.addCsiHandler=function(e,t){var i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);var r=this._csiHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},i.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},i.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},i.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},i.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},i.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},i.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},i.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},i.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},i.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},i.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},i.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},i.prototype.setErrorHandler=function(e){this._errorHandler=e},i.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},i.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},i.prototype.parse=function(e,t){for(var i=0,r=0,n=this.currentState,s=this._oscParser,o=this._dcsParser,a=this._collect,l=this._params,c=this._transitions.table,u=0;u<t;++u){switch((r=c[n<<8|((i=e[u])<160?i:160)])>>4){case 2:for(var h=u+1;;++h){if(h>=t||(i=e[h])<32||i>126&&i<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(i=e[h])<32||i>126&&i<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(i=e[h])<32||i>126&&i<160){this._printHandler(e,u,h),u=h-1;break}if(++h>=t||(i=e[h])<32||i>126&&i<160){this._printHandler(e,u,h),u=h-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:u,code:i,currentState:n,collect:a,params:l,abort:!1}).abort)return;break;case 7:for(var d=this._csiHandlers[a<<8|i],f=d?d.length-1:-1;f>=0&&!1===d[f](l);f--);f<0&&this._csiHandlerFb(a<<8|i,l),this.precedingCodepoint=0;break;case 8:do{switch(i){case 59:l.addParam(0);break;case 58:l.addSubParam(-1);break;default:l.addDigit(i-48)}}while(++u<t&&(i=e[u])>47&&i<60);u--;break;case 9:a<<=8,a|=i;break;case 10:for(var p=this._escHandlers[a<<8|i],g=p?p.length-1:-1;g>=0&&!1===p[g]();g--);g<0&&this._escHandlerFb(a<<8|i),this.precedingCodepoint=0;break;case 11:l.reset(),l.addParam(0),a=0;break;case 12:o.hook(a<<8|i,l);break;case 13:for(var v=u+1;;++v)if(v>=t||24===(i=e[v])||26===i||27===i||i>127&&i<160){o.put(e,u,v),u=v-1;break}break;case 14:o.unhook(24!==i&&26!==i),27===i&&(r|=1),l.reset(),l.addParam(0),a=0,this.precedingCodepoint=0;break;case 4:s.start();break;case 5:for(var m=u+1;;m++)if(m>=t||(i=e[m])<32||i>127&&i<=159){s.put(e,u,m),u=m-1;break}break;case 6:s.end(24!==i&&26!==i),27===i&&(r|=1),l.reset(),l.addParam(0),a=0,this.precedingCodepoint=0}n=15&r}this._collect=a,this.currentState=n},i}(s.Disposable);t.EscapeSequenceParser=h},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Renderer=void 0;var a=i(41),l=i(47),c=i(48),u=i(49),h=i(29),d=i(2),f=i(5),p=i(1),g=i(25),v=i(0),m=1,y=function(e){function t(t,i,r,n,s,o,d,f,p){var g=e.call(this)||this;g._colors=t,g._screenElement=i,g._bufferService=s,g._charSizeService=o,g._optionsService=d,g._id=m++,g._onRequestRedraw=new v.EventEmitter;var y=g._optionsService.options.allowTransparency;return g._characterJoinerRegistry=new h.CharacterJoinerRegistry(g._bufferService),g._renderLayers=[new a.TextRenderLayer(g._screenElement,0,g._colors,g._characterJoinerRegistry,y,g._id,g._bufferService,d),new l.SelectionRenderLayer(g._screenElement,1,g._colors,g._id,g._bufferService,d),new u.LinkRenderLayer(g._screenElement,2,g._colors,g._id,r,n,g._bufferService,d),new c.CursorRenderLayer(g._screenElement,3,g._colors,g._id,g._onRequestRedraw,g._bufferService,d,f,p)],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._devicePixelRatio=window.devicePixelRatio,g._updateDimensions(),g.onOptionsChanged(),g}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){for(var t=0,i=this._renderLayers;t<i.length;t++)i[t].dispose();e.prototype.dispose.call(this),g.removeTerminalFromCache(this._id)},t.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},t.prototype.setColors=function(e){this._colors=e;for(var t=0,i=this._renderLayers;t<i.length;t++){var r=i[t];r.setColors(this._colors),r.reset()}},t.prototype.onResize=function(e,t){this._updateDimensions();for(var i=0,r=this._renderLayers;i<r.length;i++)r[i].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},t.prototype.onBlur=function(){this._runOperation((function(e){return e.onBlur()}))},t.prototype.onFocus=function(){this._runOperation((function(e){return e.onFocus()}))},t.prototype.onSelectionChanged=function(e,t,i){void 0===i&&(i=!1),this._runOperation((function(r){return r.onSelectionChanged(e,t,i)}))},t.prototype.onCursorMove=function(){this._runOperation((function(e){return e.onCursorMove()}))},t.prototype.onOptionsChanged=function(){this._runOperation((function(e){return e.onOptionsChanged()}))},t.prototype.clear=function(){this._runOperation((function(e){return e.reset()}))},t.prototype._runOperation=function(e){for(var t=0,i=this._renderLayers;t<i.length;t++)e(i[t])},t.prototype.renderRows=function(e,t){for(var i=0,r=this._renderLayers;i<r.length;i++)r[i].onGridChanged(e,t)},t.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=1===this._optionsService.options.lineHeight?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)},t.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},s([o(4,p.IBufferService),o(5,f.ICharSizeService),o(6,p.IOptionsService),o(7,p.ICoreService),o(8,f.ICoreBrowserService)],t)}(d.Disposable);t.Renderer=y},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.TextRenderLayer=void 0;var s=i(42),o=i(13),a=i(6),l=i(3),c=i(29),u=i(4),h=function(e){function t(t,i,r,n,o,a,l,c){var h=e.call(this,t,"text",i,o,r,a,l,c)||this;return h._characterWidth=0,h._characterFont="",h._characterOverlapCache={},h._workCell=new u.CellData,h._state=new s.GridCache,h._characterJoinerRegistry=n,h}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t);var i=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===i||(this._characterWidth=t.scaledCharWidth,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},t.prototype.reset=function(){this._state.clear(),this._clearAll()},t.prototype._forEachCell=function(e,t,i,r){for(var n=e;n<=t;n++)for(var s=n+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.lines.get(s),a=i?i.getJoinedCharacters(s):[],u=0;u<this._bufferService.cols;u++){o.loadCell(u,this._workCell);var h=this._workCell,d=!1,f=u;if(0!==h.getWidth()){if(a.length>0&&u===a[0][0]){d=!0;var p=a.shift();h=new c.JoinedCellData(this._workCell,o.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1}!d&&this._isOverlapping(h)&&f<o.length-1&&o.getCodePoint(f+1)===l.NULL_CELL_CODE&&(h.content&=-12582913,h.content|=2<<22),r(h,u,n),u=f}}},t.prototype._drawBackground=function(e,t){var i=this,r=this._ctx,n=this._bufferService.cols,s=0,o=0,l=null;r.save(),this._forEachCell(e,t,null,(function(e,t,c){var u=null;e.isInverse()?u=e.isFgDefault()?i._colors.foreground.css:e.isFgRGB()?"rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":i._colors.ansi[e.getFgColor()].css:e.isBgRGB()?u="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(u=i._colors.ansi[e.getBgColor()].css),null===l&&(s=t,o=c),c!==o?(r.fillStyle=l||"",i._fillCells(s,o,n-s,1),s=t,o=c):l!==u&&(r.fillStyle=l||"",i._fillCells(s,o,t-s,1),s=t,o=c),l=u})),null!==l&&(r.fillStyle=l,this._fillCells(s,o,n-s,1)),r.restore()},t.prototype._drawForeground=function(e,t){var i=this;this._forEachCell(e,t,this._characterJoinerRegistry,(function(e,t,r){if(!e.isInvisible()&&(i._drawChars(e,t,r),e.isUnderline())){if(i._ctx.save(),e.isInverse())if(e.isBgDefault())i._ctx.fillStyle=i._colors.background.css;else if(e.isBgRGB())i._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();i._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),i._ctx.fillStyle=i._colors.ansi[n].css}else if(e.isFgDefault())i._ctx.fillStyle=i._colors.foreground.css;else if(e.isFgRGB())i._ctx.fillStyle="rgb("+a.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var s=e.getFgColor();i._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&s<8&&(s+=8),i._ctx.fillStyle=i._colors.ansi[s].css}i._fillBottomLineAtCells(t,r,e.getWidth()),i._ctx.restore()}}))},t.prototype.onGridChanged=function(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))},t.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},t.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i,i},t}(o.BaseRenderLayer);t.TextRenderLayer=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GridCache=void 0;var r=function(){function e(){this.cache=[]}return e.prototype.resize=function(e,t){for(var i=0;i<e;i++){this.cache.length<=i&&this.cache.push([]);for(var r=this.cache[i].length;r<t;r++)this.cache[i].push(void 0);this.cache[i].length=t}this.cache.length=e},e.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0},e}();t.GridCache=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.NoneCharAtlas=t.DynamicCharAtlas=t.getGlyphCacheKey=void 0;var s=i(9),o=i(44),a=i(27),l=i(46),c=i(11),u=i(28),h=i(10),d={css:"rgba(0, 0, 0, 0)",rgba:0};function f(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=f;var p=function(e){function t(t,i){var r=e.call(this)||this;r._config=i,r._drawToCacheCount=0,r._glyphsWaitingOnBitmap=[],r._bitmapCommitTimeout=null,r._bitmap=null,r._cacheCanvas=t.createElement("canvas"),r._cacheCanvas.width=1024,r._cacheCanvas.height=1024,r._cacheCtx=u.throwIfFalsy(r._cacheCanvas.getContext("2d",{alpha:!0}));var n=t.createElement("canvas");n.width=r._config.scaledCharWidth,n.height=r._config.scaledCharHeight,r._tmpCtx=u.throwIfFalsy(n.getContext("2d",{alpha:r._config.allowTransparency})),r._width=Math.floor(1024/r._config.scaledCharWidth),r._height=Math.floor(1024/r._config.scaledCharHeight);var s=r._width*r._height;return r._cacheMap=new l.LRUMap(s),r._cacheMap.prealloc(s),r}return n(t,e),t.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},t.prototype.beginFrame=function(){this._drawToCacheCount=0},t.prototype.draw=function(e,t,i,r){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=f(t),s=this._cacheMap.get(n);if(null!=s)return this._drawFromCache(e,s,i,r),!0;if(this._drawToCacheCount<100){var o;o=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,o);return this._cacheMap.set(n,a),this._drawFromCache(e,a,i,r),!0}return!1},t.prototype._canCache=function(e){return e.code<256},t.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},t.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},t.prototype._drawFromCache=function(e,t,i,r){if(!t.isEmpty){var n=this._toCoordinateX(t.index),s=this._toCoordinateY(t.index);e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,s,this._config.scaledCharWidth,this._config.scaledCharHeight,i,r,this._config.scaledCharWidth,this._config.scaledCharHeight)}},t.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:a.DEFAULT_ANSI_COLORS[e]},t.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?d:e.bg===s.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},t.prototype._getForegroundColor=function(e){return e.fg===s.INVERTED_DEFAULT_COLOR?h.color.opaque(this._config.colors.background):e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},t.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var i=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=i.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var r=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+r+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=s.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var o=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),a=!1;this._config.allowTransparency||(a=function(e,t){for(var i=!0,r=t.rgba>>>24,n=t.rgba>>>16&255,s=t.rgba>>>8&255,o=0;o<e.data.length;o+=4)e.data[o]===r&&e.data[o+1]===n&&e.data[o+2]===s?e.data[o+3]=0:i=!1;return i}(o,i));var l=this._toCoordinateX(t),c=this._toCoordinateY(t);this._cacheCtx.putImageData(o,l,c);var u={index:t,isEmpty:a,inBitmap:!1};return this._addGlyphToBitmap(u),u},t.prototype._addGlyphToBitmap=function(e){var t=this;!("createImageBitmap"in window)||c.isFirefox||c.isSafari||(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout((function(){return t._generateBitmap()}),100)))},t.prototype._generateBitmap=function(){var e=this,t=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then((function(i){e._bitmap=i;for(var r=0;r<t.length;r++)t[r].inBitmap=!0})),this._bitmapCommitTimeout=null},t}(o.BaseCharAtlas);t.DynamicCharAtlas=p;var g=function(e){function t(t,i){return e.call(this)||this}return n(t,e),t.prototype.draw=function(e,t,i,r){return!1},t}(o.BaseCharAtlas);t.NoneCharAtlas=g},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseCharAtlas=void 0;var r=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();t.BaseCharAtlas=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;var r=function(){function e(){this._color={},this._rgba={}}return e.prototype.clear=function(){this._color={},this._rgba={}},e.prototype.setCss=function(e,t,i){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=i},e.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},e.prototype.setColor=function(e,t,i){this._color[e]||(this._color[e]={}),this._color[e][t]=i},e.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},e}();t.ColorContrastCache=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUMap=void 0;var r=function(){function e(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return e.prototype._unlinkNode=function(e){var t=e.prev,i=e.next;e===this._head&&(this._head=i),e===this._tail&&(this._tail=t),null!==t&&(t.next=i),null!==i&&(i.prev=t)},e.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},e.prototype.prealloc=function(e){for(var t=this._nodePool,i=0;i<e;i++)t.push({prev:null,next:null,key:null,value:null})},e.prototype.get=function(e){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},e.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},e.prototype.peek=function(){var e=this._head;return null===e?null:e.value},e.prototype.set=function(e,t){var i=this._map[e];if(void 0!==i)i=this._map[e],this._unlinkNode(i),i.value=t;else if(this.size>=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;r.length>0?((i=r.pop()).key=e,i.value=t):i={prev:null,next:null,key:e,value:t},this._map[e]=i,this.size++}this._appendNode(i)},e}();t.LRUMap=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionRenderLayer=void 0;var s=function(e){function t(t,i,r,n,s,o){var a=e.call(this,t,"selection",i,!0,r,n,s,o)||this;return a._clearState(),a}return n(t,e),t.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._clearState()},t.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},t.prototype.onSelectionChanged=function(e,t,i){if(this._didStateChange(e,t,i,this._bufferService.buffer.ydisp))if(this._clearAll(),e&&t){var r=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,s=Math.max(r,0),o=Math.min(n,this._bufferService.rows-1);if(!(s>=this._bufferService.rows||o<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,i){var a=e[0],l=t[0]-a,c=o-s+1;this._fillCells(a,s,l,c)}else{a=r===s?e[0]:0;var u=s===o?t[0]:this._bufferService.cols;this._fillCells(a,s,u-a,1);var h=Math.max(o-s-1,0);if(this._fillCells(0,s+1,this._bufferService.cols,h),s!==o){var d=n===o?t[0]:this._bufferService.cols;this._fillCells(0,o,d,1)}}this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=i,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},t.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},t.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},t}(i(13).BaseRenderLayer);t.SelectionRenderLayer=s},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.CursorRenderLayer=void 0;var s=i(13),o=i(4),a=function(e){function t(t,i,r,n,s,a,l,c,u){var h=e.call(this,t,"cursor",i,!0,r,n,a,l)||this;return h._onRequestRedraw=s,h._coreService=c,h._coreBrowserService=u,h._cell=new o.CellData,h._state={x:0,y:0,isFocused:!1,style:"",width:0},h._cursorRenderers={bar:h._renderBarCursor.bind(h),block:h._renderBlockCursor.bind(h),underline:h._renderUnderlineCursor.bind(h)},h}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},t.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(this._coreBrowserService.isFocused,(function(){t._render(!0)}))):(null===(e=this._cursorBlinkStateManager)||void 0===e||e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)this._clearCursor();else{var r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(t).loadCell(r,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var n=this._optionsService.options.cursorStyle;return n&&"block"!==n?this._cursorRenderers[n](r,i,this._cell):this._renderBlurCursor(r,i,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=i,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===i&&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,i,this._cell),this._ctx.restore(),this._state.x=r,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},t.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})},t.prototype._renderBarCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,i.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(i,e,t),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},t.prototype._renderBlurCursor=function(e,t,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,i.getWidth(),1),this._ctx.restore()},t}(s.BaseRenderLayer);t.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=void 0}))))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,e>0)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0})),t._blinkInterval=window.setInterval((function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame((function(){t._renderCallback(),t._animationFrame=void 0}))}),600)}),e)},e.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)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.LinkRenderLayer=void 0;var s=i(13),o=i(9),a=i(26),l=function(e){function t(t,i,r,n,s,o,a,l){var c=e.call(this,t,"link",i,!0,r,n,a,l)||this;return s.onShowLinkUnderline((function(e){return c._onShowLinkUnderline(e)})),s.onHideLinkUnderline((function(e){return c._onHideLinkUnderline(e)})),o.onShowLinkUnderline((function(e){return c._onShowLinkUnderline(e)})),o.onHideLinkUnderline((function(e){return c._onHideLinkUnderline(e)})),c}return n(t,e),t.prototype.resize=function(t){e.prototype.resize.call(this,t),this._state=void 0},t.prototype.reset=function(){this._clearCurrentLink()},t.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},t.prototype._onShowLinkUnderline=function(e){if(e.fg===o.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},t.prototype._onHideLinkUnderline=function(e){this._clearCurrentLink()},t}(s.BaseRenderLayer);t.LinkRenderLayer=l},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZone=t.Linkifier=void 0;var s=i(0),o=i(1),a=function(){function e(e,t,i){this._bufferService=e,this._logService=t,this._unicodeService=i,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new s.EventEmitter,this._onHideLinkUnderline=new s.EventEmitter,this._onLinkTooltip=new s.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(e.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),e.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},e.prototype.linkifyRows=function(t,i){var r=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=i):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,i)),this._mouseZoneManager.clearAll(t,i),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return r._linkifyRows()}),e._timeBeforeLatency))},e.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var i=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,r=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,t,i,r,r);n.hasNext();)for(var s=n.next(),o=0;o<this._linkMatchers.length;o++)this._doLinkifyRow(s.range.first,s.content,this._linkMatchers[o]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},e.prototype.registerLinkMatcher=function(e,t,i){if(void 0===i&&(i={}),!t)throw new Error("handler must be defined");var r={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:i.matchIndex,validationCallback:i.validationCallback,hoverTooltipCallback:i.tooltipCallback,hoverLeaveCallback:i.leaveCallback,willLinkActivate:i.willLinkActivate,priority:i.priority||0};return this._addLinkMatcherToList(r),r.id},e.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;t>=0;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},e.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},e.prototype._doLinkifyRow=function(e,t,i){for(var r,n=this,s=new RegExp(i.regex.source,(i.regex.flags||"")+"g"),o=-1,a=function(){var a=r["number"!=typeof i.matchIndex?0:i.matchIndex];if(!a)return l._logService.debug("match found without corresponding matchIndex",r,i),"break";if(o=t.indexOf(a,o+1),s.lastIndex=o+a.length,o<0)return"break";var c=l._bufferService.buffer.stringIndexToBufferIndex(e,o);if(c[0]<0)return"break";var u=l._bufferService.buffer.lines.get(c[0]);if(!u)return"break";var h=u.getFg(c[1]),d=h?h>>9&511:void 0;i.validationCallback?i.validationCallback(a,(function(e){n._rowsTimeoutId||e&&n._addLink(c[1],c[0]-n._bufferService.buffer.ydisp,a,i,d)})):l._addLink(c[1],c[0]-l._bufferService.buffer.ydisp,a,i,d)},l=this;null!==(r=s.exec(t))&&"break"!==a(););},e.prototype._addLink=function(e,t,i,r,n){var s=this;if(this._mouseZoneManager&&this._element){var o=this._unicodeService.getStringCellWidth(i),a=e%this._bufferService.cols,c=t+Math.floor(e/this._bufferService.cols),u=(a+o)%this._bufferService.cols,h=c+Math.floor((a+o)/this._bufferService.cols);0===u&&(u=this._bufferService.cols,h--),this._mouseZoneManager.add(new l(a+1,c+1,u+1,h+1,(function(e){if(r.handler)return r.handler(e,i);var t=window.open();t?(t.opener=null,t.location.href=i):console.warn("Opening link blocked as opener could not be cleared")}),(function(){s._onShowLinkUnderline.fire(s._createLinkHoverEvent(a,c,u,h,n)),s._element.classList.add("xterm-cursor-pointer")}),(function(e){s._onLinkTooltip.fire(s._createLinkHoverEvent(a,c,u,h,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i,{start:{x:a,y:c},end:{x:u,y:h}})}),(function(){s._onHideLinkUnderline.fire(s._createLinkHoverEvent(a,c,u,h,n)),s._element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()}),(function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)})))}},e.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:n}},e._timeBeforeLatency=200,e=r([n(0,o.IBufferService),n(1,o.ILogService),n(2,o.IUnicodeService)],e)}();t.Linkifier=a;var l=function(e,t,i,r,n,s,o,a,l){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=s,this.tooltipCallback=o,this.leaveCallback=a,this.willLinkActivate=l};t.MouseZone=l},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;var a=i(11),l=i(52),c=i(4),u=i(0),h=i(5),d=i(1),f=i(30),p=i(53),g=i(2),v=String.fromCharCode(160),m=new RegExp(v,"g"),y=function(e){function t(t,i,r,n,s,o,a){var h=e.call(this)||this;return h._element=t,h._screenElement=i,h._bufferService=r,h._coreService=n,h._mouseService=s,h._optionsService=o,h._renderService=a,h._dragScrollAmount=0,h._enabled=!0,h._workCell=new c.CellData,h._mouseDownTimeStamp=0,h._onLinuxMouseSelection=h.register(new u.EventEmitter),h._onRedrawRequest=h.register(new u.EventEmitter),h._onSelectionChange=h.register(new u.EventEmitter),h._onRequestScrollLines=h.register(new u.EventEmitter),h._mouseMoveListener=function(e){return h._onMouseMove(e)},h._mouseUpListener=function(e){return h._onMouseUp(e)},h._coreService.onUserInput((function(){h.hasSelection&&h.clearSelection()})),h._trimListener=h._bufferService.buffer.lines.onTrim((function(e){return h._onTrim(e)})),h.register(h._bufferService.buffers.onBufferActivate((function(e){return h._onBufferActivate(e)}))),h.enable(),h._model=new l.SelectionModel(h._bufferService),h._activeSelectionMode=0,h}return n(t,e),Object.defineProperty(t.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._removeMouseDownListeners()},t.prototype.reset=function(){this.clearSelection()},t.prototype.disable=function(){this.clearSelection(),this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},Object.defineProperty(t.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=this._bufferService.buffer,r=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var s=i.translateBufferLineToString(n,!0,e[0],t[0]);r.push(s)}}else{var o=e[1]===t[1]?t[0]:void 0;for(r.push(i.translateBufferLineToString(e[1],!0,e[0],o)),n=e[1]+1;n<=t[1]-1;n++){var l=i.lines.get(n);s=i.translateBufferLineToString(n,!0),l&&l.isWrapped?r[r.length-1]+=s:r.push(s)}e[1]!==t[1]&&(l=i.lines.get(t[1]),s=i.translateBufferLineToString(t[1],!0,0,t[0]),l&&l.isWrapped?r[r.length-1]+=s:r.push(s))}return r.map((function(e){return e.replace(m," ")})).join(a.isWindows?"\r\n":"\n")},enumerable:!1,configurable:!0}),t.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},t.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame((function(){return t._refresh()}))),a.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},t.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},t.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(i&&r&&t)&&this._areCoordsInSelection(t,i,r)},t.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&e[0]>=t[0]},t.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},t.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},t.prototype._getMouseEventScrollAmount=function(e){var t=f.getCoordsRelativeToElement(e,this._screenElement)[1],i=this._renderService.dimensions.canvasHeight;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},t.prototype.shouldForceSelection=function(e){return a.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},t.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},t.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval((function(){return e._dragScroll()}),50)},t.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},t.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},t.prototype._onSingleClick=function(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),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]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},t.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},t.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},t.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._optionsService.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){var r=i.lines.get(this._model.selectionEnd[1]);r&&0===r.hasWidth(this._model.selectionEnd[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)}},t.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var e=this._bufferService.buffer;this._dragScrollAmount>0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}},t.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&void 0!==i[0]&&void 0!==i[1]){var r=p.moveToCellSequence(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},t.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((function(e){return t._onTrim(e)}))},t.prototype._convertViewportColToCharacterIndex=function(e,t){for(var i=t[0],r=0;t[0]>=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:n>1&&t[0]!==r&&(i+=n-1)}return i},t.prototype.setSelection=function(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh()},t.prototype._getWordAt=function(e,t,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),!(e[0]>=this._bufferService.cols)){var n=this._bufferService.buffer,s=n.lines.get(e[1]);if(s){var o=n.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(s,e),l=a,c=e[0]-a,u=0,h=0,d=0,f=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;l<o.length&&" "===o.charAt(l+1);)l++}else{var p=e[0],g=e[0];0===s.getWidth(p)&&(u++,p--),2===s.getWidth(g)&&(h++,g++);var v=s.getString(g).length;for(v>1&&(f+=v-1,l+=v-1);p>0&&a>0&&!this._isCharWordSeparator(s.loadCell(p-1,this._workCell));){s.loadCell(p-1,this._workCell);var m=this._workCell.getChars().length;0===this._workCell.getWidth()?(u++,p--):m>1&&(d+=m-1,a-=m-1),a--,p--}for(;g<s.length&&l+1<o.length&&!this._isCharWordSeparator(s.loadCell(g+1,this._workCell));){s.loadCell(g+1,this._workCell);var y=this._workCell.getChars().length;2===this._workCell.getWidth()?(h++,g++):y>1&&(f+=y-1,l+=y-1),l++,g++}}l++;var _=a+c-u+d,b=Math.min(this._bufferService.cols,l-a+u+h-d-f);if(t||""!==o.slice(a,l).trim()){if(i&&0===_&&32!==s.getCodePoint(0)){var S=n.lines.get(e[1]-1);if(S&&s.isWrapped&&32!==S.getCodePoint(this._bufferService.cols-1)){var C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){var w=this._bufferService.cols-C.start;_-=w,b+=w}}}if(r&&_+b===this._bufferService.cols&&32!==s.getCodePoint(this._bufferService.cols-1)){var k=n.lines.get(e[1]+1);if(k&&k.isWrapped&&32!==k.getCodePoint(0)){var x=this._getWordAt([0,e[1]+1],!1,!1,!0);x&&(b+=x.length)}}return{start:_,length:b}}}}},t.prototype._selectWordAt=function(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}},t.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var i=e[1];t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},t.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&this._optionsService.options.wordSeparator.indexOf(e.getChars())>=0},t.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.last],this._model.selectionStartLength=0},s([o(2,d.IBufferService),o(3,d.ICoreService),o(4,h.IMouseService),o(5,d.IOptionsService),o(6,h.IRenderService)],t)}(g.Disposable);t.SelectionService=y},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0;var r=function(){function e(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}return e.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.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(e.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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,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}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;var r=i(12);function n(e,t,i,r){var n=e-s(i,e),a=t-s(i,t);return c(Math.abs(n-a)-function(e,t,i){for(var r=0,n=e-s(i,e),a=t-s(i,t),l=0;l<Math.abs(n-a);l++){var c="A"===o(e,t)?-1:1,u=i.buffer.lines.get(n+c*l);u&&u.isWrapped&&r++}return r}(e,t,i),l(o(e,t),r))}function s(e,t){for(var i=0,r=e.buffer.lines.get(t),n=r&&r.isWrapped;n&&t>=0&&t<e.rows;)i++,n=(r=e.buffer.lines.get(--t))&&r.isWrapped;return i}function o(e,t){return e>t?"A":"B"}function a(e,t,i,r,n,s){for(var o=e,a=t,l="";o!==i||a!==r;)o+=n?1:-1,n&&o>s.cols-1?(l+=s.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!n&&o<0&&(l+=s.buffer.translateBufferLineToString(a,!1,0,e+1),e=o=s.cols-1,a--);return l+s.buffer.translateBufferLineToString(a,!1,e,o)}function l(e,t){var i=t?"O":"[";return r.C0.ESC+i+e}function c(e,t){e=Math.floor(e);for(var i="",r=0;r<e;r++)i+=t;return i}t.moveToCellSequence=function(e,t,i,r){var o,u=i.buffer.x,h=i.buffer.y;if(!i.buffer.hasScrollback)return function(e,t,i,r,o,u){return 0===n(t,r,o,u).length?"":c(a(e,t,e,t-s(o,t),!1,o).length,l("D",u))}(u,h,0,t,i,r)+n(h,t,i,r)+function(e,t,i,r,o,u){var h;h=n(t,r,o,u).length>0?r-s(o,r):t;var d=r,f=function(e,t,i,r,o,a){var l;return l=n(i,r,o,a).length>0?r-s(o,r):t,e<i&&l<=r||e>=i&&l<r?"C":"D"}(e,t,i,r,o,u);return c(a(e,h,i,d,"C"===f,o).length,l(f,u))}(u,h,e,t,i,r);if(h===t)return o=u>e?"D":"C",c(Math.abs(u-e),l(o,r));o=h>t?"D":"C";var d=Math.abs(h-t);return c(function(e,t){return t.cols-e}(h>t?e:u,i)+(d-1)*i.cols+1+((h>t?u:e)-1),l(o,r))}},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SoundService=void 0;var s=i(1),o=function(){function e(e){this._optionsService=e}return Object.defineProperty(e,"audioContext",{get:function(){if(!e._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;e._audioContext=new t}return e._audioContext},enumerable:!1,configurable:!0}),e.prototype.playBellSound=function(){var t=e.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),(function(e){i.buffer=e,i.connect(t.destination),i.start(0)}))}},e.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;n<i;n++)r[n]=t.charCodeAt(n);return r.buffer},e.prototype._removeMimeType=function(e){return e.split(",")[1]},e=r([n(0,s.IOptionsService)],e)}();t.SoundService=o},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseZoneManager=void 0;var a=i(2),l=i(7),c=i(5),u=i(1),h=function(e){function t(t,i,r,n,s,o){var a=e.call(this)||this;return a._element=t,a._screenElement=i,a._bufferService=r,a._mouseService=n,a._selectionService=s,a._optionsService=o,a._zones=[],a._areZonesActive=!1,a._lastHoverCoords=[void 0,void 0],a._initialSelectionLength=0,a.register(l.addDisposableDomListener(a._element,"mousedown",(function(e){return a._onMouseDown(e)}))),a._mouseMoveListener=function(e){return a._onMouseMove(e)},a._mouseLeaveListener=function(e){return a._onMouseLeave(e)},a._clickListener=function(e){return a._onClick(e)},a}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._deactivate()},t.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},t.prototype.clearAll=function(e,t){if(0!==this._zones.length){e&&t||(e=0,t=this._bufferService.rows-1);for(var i=0;i<this._zones.length;i++){var r=this._zones[i];(r.y1>e&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1<e&&r.y2>t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},t.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))},t.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))},t.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},t.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&(this._currentZone=i,i.hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=window.setTimeout((function(){return t._onTooltip(e)}),this._optionsService.options.linkTooltipHoverDuration)))},t.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},t.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(null==t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},t.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},t.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._getSelectionLength();t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},t.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},t.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var i=t[0],r=t[1],n=0;n<this._zones.length;n++){var s=this._zones[n];if(s.y1===s.y2){if(r===s.y1&&i>=s.x1&&i<s.x2)return s}else if(r===s.y1&&i>=s.x1||r===s.y2&&i<s.x2||r>s.y1&&r<s.y2)return s}},s([o(2,u.IBufferService),o(3,c.IMouseService),o(4,c.ISelectionService),o(5,u.IOptionsService)],t)}(a.Disposable);t.MouseZoneManager=h},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;var s=i(18),o=i(11),a=i(31),l=i(7),c=i(2),u=i(32),h=i(17),d=function(e){function t(t,i){var r=e.call(this)||this;r._terminal=t,r._renderService=i,r._liveRegionLineCount=0,r._charsToConsume=[],r._charsToAnnounce="",r._accessibilityTreeRoot=document.createElement("div"),r._accessibilityTreeRoot.classList.add("xterm-accessibility"),r._rowContainer=document.createElement("div"),r._rowContainer.classList.add("xterm-accessibility-tree"),r._rowContainer.setAttribute("role","list"),r._rowElements=[];for(var n=0;n<r._terminal.rows;n++)r._rowElements[n]=r._createAccessibilityTreeNode(),r._rowContainer.appendChild(r._rowElements[n]);if(r._topBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,0)},r._bottomBoundaryFocusListener=function(e){return r._onBoundaryFocus(e,1)},r._rowElements[0].addEventListener("focus",r._topBoundaryFocusListener),r._rowElements[r._rowElements.length-1].addEventListener("focus",r._bottomBoundaryFocusListener),r._refreshRowsDimensions(),r._accessibilityTreeRoot.appendChild(r._rowContainer),r._renderRowsDebouncer=new a.RenderDebouncer(r._renderRows.bind(r)),r._refreshRows(),r._liveRegion=document.createElement("div"),r._liveRegion.classList.add("live-region"),r._liveRegion.setAttribute("aria-live","assertive"),r._accessibilityTreeRoot.appendChild(r._liveRegion),!r._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return r._terminal.element.insertAdjacentElement("afterbegin",r._accessibilityTreeRoot),r.register(r._renderRowsDebouncer),r.register(r._terminal.onResize((function(e){return r._onResize(e.rows)}))),r.register(r._terminal.onRender((function(e){return r._refreshRows(e.start,e.end)}))),r.register(r._terminal.onScroll((function(){return r._refreshRows()}))),r.register(r._terminal.onA11yChar((function(e){return r._onChar(e)}))),r.register(r._terminal.onLineFeed((function(){return r._onChar("\n")}))),r.register(r._terminal.onA11yTab((function(e){return r._onTab(e)}))),r.register(r._terminal.onKey((function(e){return r._onKey(e.key)}))),r.register(r._terminal.onBlur((function(){return r._clearLiveRegion()}))),r.register(r._renderService.onDimensionsChange((function(){return r._refreshRowsDimensions()}))),r._screenDprMonitor=new u.ScreenDprMonitor,r.register(r._screenDprMonitor),r._screenDprMonitor.setListener((function(){return r._refreshRowsDimensions()})),r.register(l.addDisposableDomListener(window,"resize",(function(){return r._refreshRowsDimensions()}))),r}return n(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),h.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(e,t){var i=e.target,r=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===r){var n,s;if(0===t?(n=i,s=this._rowElements.pop(),this._rowContainer.removeChild(s)):(n=this._rowElements.shift(),s=i,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),s.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var o=this._createAccessibilityTreeNode();this._rowElements.unshift(o),this._rowContainer.insertAdjacentElement("afterbegin",o)}else o=this._createAccessibilityTreeNode(),this._rowElements.push(o),this._rowContainer.appendChild(o);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}},t.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},t.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},t.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),o.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout((function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)}),0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,o.isMac&&h.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},t.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},t.prototype._renderRows=function(e,t){for(var i=this._terminal.buffer,r=i.lines.length.toString(),n=e;n<=t;n++){var s=i.translateBufferLineToString(i.ydisp+n,!0),o=(i.ydisp+n+1).toString(),a=this._rowElements[n];a&&(0===s.length?a.innerHTML=" ":a.textContent=s,a.setAttribute("aria-posinset",o),a.setAttribute("aria-setsize",r))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},t.prototype._refreshRowDimensions=function(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(c.Disposable);t.AccessibilityManager=d},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;var a=i(58),l=i(9),c=i(2),u=i(5),h=i(1),d=i(0),f=i(10),p=i(17),g=1,v=function(e){function t(t,i,r,n,s,o,l,c,u){var h=e.call(this)||this;return h._colors=t,h._element=i,h._screenElement=r,h._viewportElement=n,h._linkifier=s,h._linkifier2=o,h._charSizeService=l,h._optionsService=c,h._bufferService=u,h._terminalClass=g++,h._rowElements=[],h._rowContainer=document.createElement("div"),h._rowContainer.classList.add("xterm-rows"),h._rowContainer.style.lineHeight="normal",h._rowContainer.setAttribute("aria-hidden","true"),h._refreshRowElements(h._bufferService.cols,h._bufferService.rows),h._selectionContainer=document.createElement("div"),h._selectionContainer.classList.add("xterm-selection"),h._selectionContainer.setAttribute("aria-hidden","true"),h.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},h._updateDimensions(),h._injectCss(),h._rowFactory=new a.DomRendererRowFactory(document,h._optionsService,h._colors),h._element.classList.add("xterm-dom-renderer-owner-"+h._terminalClass),h._screenElement.appendChild(h._rowContainer),h._screenElement.appendChild(h._selectionContainer),h._linkifier.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h._linkifier2.onShowLinkUnderline((function(e){return h._onLinkHover(e)})),h._linkifier2.onHideLinkUnderline((function(e){return h._onLinkLeave(e)})),h}return n(t,e),Object.defineProperty(t.prototype,"onRequestRedraw",{get:function(){return(new d.EventEmitter).event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),p.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),e.prototype.dispose.call(this)},t.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 e=0,t=this._rowElements;e<t.length;e++){var i=t[e];i.style.width=this.dimensions.canvasWidth+"px",i.style.height=this.dimensions.actualCellHeight+"px",i.style.lineHeight=this.dimensions.actualCellHeight+"px",i.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var r=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=r,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},t.prototype.setColors=function(e){this._colors=e,this._injectCss()},t.prototype._injectCss=function(){var e=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var t=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";t+=this._terminalSelector+" span:not(."+a.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+a.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+a.ITALIC_CLASS+" { font-style: italic;}",t+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",t+="@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+"; }}",t+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+":not(."+a.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_BLINK_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+a.CURSOR_CLASS+"."+a.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",t+=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(i,r){t+=e._terminalSelector+" .xterm-fg-"+r+" { color: "+i.css+"; }"+e._terminalSelector+" .xterm-bg-"+r+" { background-color: "+i.css+"; }"})),t+=this._terminalSelector+" .xterm-fg-"+l.INVERTED_DEFAULT_COLOR+" { color: "+f.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+l.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=t},t.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},t.prototype._refreshRowElements=function(e,t){for(var i=this._rowElements.length;i<=t;i++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())},t.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},t.prototype.onCharSizeChanged=function(){this._updateDimensions()},t.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},t.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},t.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,s=Math.max(r,0),o=Math.min(n,this._bufferService.rows-1);if(!(s>=this._bufferService.rows||o<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(s,e[0],t[0],o-s+1));else{var l=r===s?e[0]:0,c=s===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,l,c));var u=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._bufferService.cols,u)),s!==o){var h=n===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,h))}}this._selectionContainer.appendChild(a)}}},t.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},t.prototype.onCursorMove=function(){},t.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},t.prototype.clear=function(){for(var e=0,t=this._rowElements;e<t.length;e++)t[e].innerHTML=""},t.prototype.renderRows=function(e,t){for(var i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._optionsService.options.cursorBlink,s=e;s<=t;s++){var o=this._rowElements[s];o.innerHTML="";var a=s+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.lines.get(a),c=this._optionsService.options.cursorStyle;o.appendChild(this._rowFactory.createRow(l,a===i,c,r,n,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(t.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),t.prototype.registerCharacterJoiner=function(e){return-1},t.prototype.deregisterCharacterJoiner=function(e){return!1},t.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},t.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},t.prototype._setCellUnderline=function(e,t,i,r,n,s){for(;e!==t||i!==r;){var o=this._rowElements[i];if(!o)return;var a=o.children[e];a&&(a.style.textDecoration=s?"underline":"none"),++e>=n&&(e=0,i++)}},s([o(6,u.ICharSizeService),o(7,h.IOptionsService),o(8,h.IBufferService)],t)}(c.Disposable);t.DomRenderer=v},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=t.CURSOR_STYLE_UNDERLINE_CLASS=t.CURSOR_STYLE_BAR_CLASS=t.CURSOR_STYLE_BLOCK_CLASS=t.CURSOR_BLINK_CLASS=t.CURSOR_CLASS=t.UNDERLINE_CLASS=t.ITALIC_CLASS=t.DIM_CLASS=t.BOLD_CLASS=void 0;var r=i(9),n=i(3),s=i(4),o=i(10);t.BOLD_CLASS="xterm-bold",t.DIM_CLASS="xterm-dim",t.ITALIC_CLASS="xterm-italic",t.UNDERLINE_CLASS="xterm-underline",t.CURSOR_CLASS="xterm-cursor",t.CURSOR_BLINK_CLASS="xterm-cursor-blink",t.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",t.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",t.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var a=function(){function e(e,t,i){this._document=e,this._optionsService=t,this._colors=i,this._workCell=new s.CellData}return e.prototype.setColors=function(e){this._colors=e},e.prototype.createRow=function(e,i,s,a,c,u,h){for(var d=this._document.createDocumentFragment(),f=0,p=Math.min(e.length,h)-1;p>=0;p--)if(e.loadCell(p,this._workCell).getCode()!==n.NULL_CELL_CODE||i&&p===a){f=p+1;break}for(p=0;p<f;p++){e.loadCell(p,this._workCell);var g=this._workCell.getWidth();if(0!==g){var v=this._document.createElement("span");if(g>1&&(v.style.width=u*g+"px"),i&&p===a)switch(v.classList.add(t.CURSOR_CLASS),c&&v.classList.add(t.CURSOR_BLINK_CLASS),s){case"bar":v.classList.add(t.CURSOR_STYLE_BAR_CLASS);break;case"underline":v.classList.add(t.CURSOR_STYLE_UNDERLINE_CLASS);break;default:v.classList.add(t.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&v.classList.add(t.BOLD_CLASS),this._workCell.isItalic()&&v.classList.add(t.ITALIC_CLASS),this._workCell.isDim()&&v.classList.add(t.DIM_CLASS),this._workCell.isUnderline()&&v.classList.add(t.UNDERLINE_CLASS),this._workCell.isInvisible()?v.textContent=n.WHITESPACE_CELL_CHAR:v.textContent=this._workCell.getChars()||n.WHITESPACE_CELL_CHAR;var m=this._workCell.getFgColor(),y=this._workCell.getFgColorMode(),_=this._workCell.getBgColor(),b=this._workCell.getBgColorMode(),S=!!this._workCell.isInverse();if(S){var C=m;m=_,_=C;var w=y;y=b,b=w}switch(y){case 16777216:case 33554432:this._workCell.isBold()&&m<8&&this._optionsService.options.drawBoldTextInBrightColors&&(m+=8),this._applyMinimumContrast(v,this._colors.background,this._colors.ansi[m])||v.classList.add("xterm-fg-"+m);break;case 50331648:var k=o.rgba.toColor(m>>16&255,m>>8&255,255&m);this._applyMinimumContrast(v,this._colors.background,k)||this._addStyle(v,"color:#"+l(m.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(v,this._colors.background,this._colors.foreground)||S&&v.classList.add("xterm-fg-"+r.INVERTED_DEFAULT_COLOR)}switch(b){case 16777216:case 33554432:v.classList.add("xterm-bg-"+_);break;case 50331648:this._addStyle(v,"background-color:#"+l(_.toString(16),"0",6));break;case 0:default:S&&v.classList.add("xterm-bg-"+r.INVERTED_DEFAULT_COLOR)}d.appendChild(v)}}return d},e.prototype._applyMinimumContrast=function(e,t,i){if(1===this._optionsService.options.minimumContrastRatio)return!1;var r=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===r&&(r=o.color.ensureContrastRatio(t,i,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=r?r:null)),!!r&&(this._addStyle(e,"color:"+r.css),!0)},e.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},e}();function l(e,t,i){for(;e.length<i;)e=t+e;return e}t.DomRendererRowFactory=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;var r=i(12),n={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:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,s){var o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(e.shiftKey){o.key=r.C0.BS;break}if(e.altKey){o.key=r.C0.ESC+r.C0.DEL;break}o.key=r.C0.DEL;break;case 9:if(e.shiftKey){o.key=r.C0.ESC+"[Z";break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=r.C0.ESC+"[1;"+(a+1)+"D",o.key===r.C0.ESC+"[1;3D"&&(o.key=r.C0.ESC+(i?"b":"[1;5D"))):o.key=t?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=r.C0.ESC+"[1;"+(a+1)+"C",o.key===r.C0.ESC+"[1;3C"&&(o.key=r.C0.ESC+(i?"f":"[1;5C"))):o.key=t?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=r.C0.ESC+"[1;"+(a+1)+"A",i||o.key!==r.C0.ESC+"[1;3A"||(o.key=r.C0.ESC+"[1;5A")):o.key=t?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=r.C0.ESC+"[1;"+(a+1)+"B",i||o.key!==r.C0.ESC+"[1;3B"||(o.key=r.C0.ESC+"[1;5B")):o.key=t?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+"[2~");break;case 46:o.key=a?r.C0.ESC+"[3;"+(a+1)+"~":r.C0.ESC+"[3~";break;case 36:o.key=a?r.C0.ESC+"[1;"+(a+1)+"H":t?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:o.key=a?r.C0.ESC+"[1;"+(a+1)+"F":t?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:o.key=r.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:o.key=r.C0.ESC+"[6~";break;case 112:o.key=a?r.C0.ESC+"[1;"+(a+1)+"P":r.C0.ESC+"OP";break;case 113:o.key=a?r.C0.ESC+"[1;"+(a+1)+"Q":r.C0.ESC+"OQ";break;case 114:o.key=a?r.C0.ESC+"[1;"+(a+1)+"R":r.C0.ESC+"OR";break;case 115:o.key=a?r.C0.ESC+"[1;"+(a+1)+"S":r.C0.ESC+"OS";break;case 116:o.key=a?r.C0.ESC+"[15;"+(a+1)+"~":r.C0.ESC+"[15~";break;case 117:o.key=a?r.C0.ESC+"[17;"+(a+1)+"~":r.C0.ESC+"[17~";break;case 118:o.key=a?r.C0.ESC+"[18;"+(a+1)+"~":r.C0.ESC+"[18~";break;case 119:o.key=a?r.C0.ESC+"[19;"+(a+1)+"~":r.C0.ESC+"[19~";break;case 120:o.key=a?r.C0.ESC+"[20;"+(a+1)+"~":r.C0.ESC+"[20~";break;case 121:o.key=a?r.C0.ESC+"[21;"+(a+1)+"~":r.C0.ESC+"[21~";break;case 122:o.key=a?r.C0.ESC+"[23;"+(a+1)+"~":r.C0.ESC+"[23~";break;case 123:o.key=a?r.C0.ESC+"[24;"+(a+1)+"~":r.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!s||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(o.key=r.C0.US);else{var l=n[e.keyCode],c=l&&l[e.shiftKey?1:0];if(c)o.key=r.C0.ESC+c;else if(e.keyCode>=65&&e.keyCode<=90){var u=e.ctrlKey?e.keyCode-64:e.keyCode+32;o.key=r.C0.ESC+String.fromCharCode(u)}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=r.C0.DEL:219===e.keyCode?o.key=r.C0.ESC:220===e.keyCode?o.key=r.C0.FS:221===e.keyCode&&(o.key=r.C0.GS)}return o}},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;var a=i(31),l=i(0),c=i(2),u=i(32),h=i(7),d=i(1),f=i(5),p=function(e){function t(t,i,r,n,s,o){var c=e.call(this)||this;if(c._renderer=t,c._rowCount=i,c._isPaused=!1,c._needsFullRefresh=!1,c._isNextRenderRedrawOnly=!0,c._needsSelectionRefresh=!1,c._canvasWidth=0,c._canvasHeight=0,c._selectionState={start:void 0,end:void 0,columnSelectMode:!1},c._onDimensionsChange=new l.EventEmitter,c._onRender=new l.EventEmitter,c._onRefreshRequest=new l.EventEmitter,c.register({dispose:function(){return c._renderer.dispose()}}),c._renderDebouncer=new a.RenderDebouncer((function(e,t){return c._renderRows(e,t)})),c.register(c._renderDebouncer),c._screenDprMonitor=new u.ScreenDprMonitor,c._screenDprMonitor.setListener((function(){return c.onDevicePixelRatioChange()})),c.register(c._screenDprMonitor),c.register(o.onResize((function(e){return c._fullRefresh()}))),c.register(n.onOptionChange((function(){return c._renderer.onOptionsChanged()}))),c.register(s.onCharSizeChange((function(){return c.onCharSizeChanged()}))),c._renderer.onRequestRedraw((function(e){return c.refreshRows(e.start,e.end,!0)})),c.register(h.addDisposableDomListener(window,"resize",(function(){return c.onDevicePixelRatioChange()}))),"IntersectionObserver"in window){var d=new IntersectionObserver((function(e){return c._onIntersectionChange(e[e.length-1])}),{threshold:0});d.observe(r),c.register({dispose:function(){return d.disconnect()}})}return c}return n(t,e),Object.defineProperty(t.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),t.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},t.prototype.refreshRows=function(e,t,i){void 0===i&&(i=!1),this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))},t.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0},t.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},t.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},t.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRedraw((function(e){return t.refreshRows(e.start,e.end,!0)})),this._needsSelectionRefresh=!0,this._fullRefresh()},t.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},t.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},t.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},t.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},t.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},t.prototype.onBlur=function(){this._renderer.onBlur()},t.prototype.onFocus=function(){this._renderer.onFocus()},t.prototype.onSelectionChanged=function(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.onSelectionChanged(e,t,i)},t.prototype.onCursorMove=function(){this._renderer.onCursorMove()},t.prototype.clear=function(){this._renderer.clear()},t.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},t.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},s([o(3,d.IOptionsService),o(4,f.ICharSizeService),o(5,d.IBufferService)],t)}(c.Disposable);t.RenderService=p},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;var s=i(1),o=i(0),a=function(){function e(e,t,i){this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new o.EventEmitter,this._measureStrategy=new l(e,t,this._optionsService)}return Object.defineProperty(e.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),e.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},r([n(2,s.IOptionsService)],e)}();t.CharSizeService=a;var l=function(){function e(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,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 e.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},e}()},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;var s=i(5),o=i(30),a=function(){function e(e,t){this._renderService=e,this._charSizeService=t}return e.prototype.getCoords=function(e,t,i,r,n){return o.getCoords(e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},e.prototype.getRawByteCoords=function(e,t,i,r){var n=this.getCoords(e,t,i,r);return o.getRawByteCoords(n)},r([n(0,s.IRenderService),n(1,s.ICharSizeService)],e)}();t.MouseService=a},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier2=void 0;var a=i(1),l=i(0),c=i(2),u=i(7),h=function(e){function t(t){var i=e.call(this)||this;return i._bufferService=t,i._linkProviders=[],i._linkCacheDisposables=[],i._isMouseOut=!0,i._activeLine=-1,i._onShowLinkUnderline=i.register(new l.EventEmitter),i._onHideLinkUnderline=i.register(new l.EventEmitter),i.register(c.getDisposeArrayDisposable(i._linkCacheDisposables)),i}return n(t,e),Object.defineProperty(t.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),t.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var i=t._linkProviders.indexOf(e);-1!==i&&t._linkProviders.splice(i,1)}}},t.prototype.attachToDom=function(e,t,i){var r=this;this._element=e,this._mouseService=t,this._renderService=i,this.register(u.addDisposableDomListener(this._element,"mouseleave",(function(){r._isMouseOut=!0,r._clearCurrentLink()}))),this.register(u.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(u.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},t.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var i=e.composedPath(),r=0;r<i.length;r++){var n=i[r];if(n.classList.contains("xterm"))break;if(n.classList.contains("xterm-hover"))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._onHover(t),this._lastBufferCell=t)}}},t.prototype._onHover=function(e){if(this._activeLine!==e.y)return this._clearCurrentLink(),void this._askForLink(e,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))},t.prototype._askForLink=function(e,t){var i=this;this._activeProviderReplies&&t||(this._activeProviderReplies=new Map,this._activeLine=e.y);var r=!1;this._linkProviders.forEach((function(n,s){var o;t?(null===(o=i._activeProviderReplies)||void 0===o?void 0:o.get(s))&&(r=i._checkLinkProviderResult(s,e,r)):n.provideLinks(e.y,(function(t){var n,o;if(!i._isMouseOut){var a=null==t?void 0:t.map((function(e){return{link:e}}));null===(n=i._activeProviderReplies)||void 0===n||n.set(s,a),r=i._checkLinkProviderResult(s,e,r),(null===(o=i._activeProviderReplies)||void 0===o?void 0:o.size)===i._linkProviders.length&&i._removeIntersectingLinks(e.y,i._activeProviderReplies)}}))}))},t.prototype._removeIntersectingLinks=function(e,t){for(var i=new Set,r=0;r<t.size;r++){var n=t.get(r);if(n)for(var s=0;s<n.length;s++)for(var o=n[s],a=o.link.range.start.y<e?0:o.link.range.start.x,l=o.link.range.end.y>e?this._bufferService.cols:o.link.range.end.x,c=a;c<=l;c++){if(i.has(c)){n.splice(s--,1);break}i.add(c)}}},t.prototype._checkLinkProviderResult=function(e,t,i){var r,n=this;if(!this._activeProviderReplies)return i;for(var s=this._activeProviderReplies.get(e),o=!1,a=0;a<e;a++)this._activeProviderReplies.has(a)&&!this._activeProviderReplies.get(a)||(o=!0);if(!o&&s){var l=s.find((function(e){return n._linkAtPosition(e.link,t)}));l&&(i=!0,this._handleNewLink(l))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(a=0;a<this._activeProviderReplies.size;a++){var c=null===(r=this._activeProviderReplies.get(a))||void 0===r?void 0:r.find((function(e){return n._linkAtPosition(e.link,t)}));if(c){i=!0,this._handleNewLink(c);break}}return i},t.prototype._onClick=function(e){if(this._element&&this._mouseService&&this._currentLink){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}},t.prototype._clearCurrentLink=function(e,t){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,c.disposeArray(this._linkCacheDisposables))},t.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(e.link,i)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var e,i;return null===(i=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===i?void 0:i.decorations.pointerCursor},set:function(e){var i,r;(null===(i=t._currentLink)||void 0===i?void 0:i.state)&&t._currentLink.state.decorations.pointerCursor!==e&&(t._currentLink.state.decorations.pointerCursor=e,t._currentLink.state.isHovered&&(null===(r=t._element)||void 0===r||r.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:function(){var e,i;return null===(i=null===(e=t._currentLink)||void 0===e?void 0:e.state)||void 0===i?void 0:i.decorations.underline},set:function(i){var r,n,s;(null===(r=t._currentLink)||void 0===r?void 0:r.state)&&(null===(s=null===(n=t._currentLink)||void 0===n?void 0:n.state)||void 0===s?void 0:s.decorations.underline)!==i&&(t._currentLink.state.decorations.underline=i,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,i))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange((function(e){var i=0===e.start?0:e.start+1+t._bufferService.buffer.ydisp;t._clearCurrentLink(i,e.end+1+t._bufferService.buffer.ydisp)}))))}},t.prototype._linkHover=function(e,t,i){var r;(null===(r=this._currentLink)||void 0===r?void 0:r.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)},t.prototype._fireUnderlineEvent=function(e,t){var i=e.range,r=this._bufferService.buffer.ydisp,n=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-r-1,i.end.x,i.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(n)},t.prototype._linkLeave=function(e,t,i){var r;(null===(r=this._currentLink)||void 0===r?void 0:r.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)},t.prototype._linkAtPosition=function(e,t){var i=e.range.start.y===e.range.end.y,r=e.range.start.y<t.y,n=e.range.end.y>t.y;return(i&&e.range.start.x<=t.x&&e.range.end.x>=t.x||r&&e.range.end.x>=t.x||n&&e.range.start.x<=t.x||r&&n)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},t.prototype._positionFromMouseEvent=function(e,t,i){var r=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}},t.prototype._createLinkUnderlineEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:n}},s([o(0,a.IBufferService)],t)}(c.Disposable);t.Linkifier2=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;var r=function(){function e(e){this._textarea=e}return Object.defineProperty(e.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),e}();t.CoreBrowserService=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;var s=i(2),o=i(1),a=i(66),l=i(67),c=i(68),u=i(74),h=i(75),d=i(0),f=i(76),p=i(77),g=i(78),v=i(80),m=i(81),y=i(19),_=i(82),b=function(e){function t(t){var i=e.call(this)||this;return i._onBinary=new d.EventEmitter,i._onData=new d.EventEmitter,i._onLineFeed=new d.EventEmitter,i._onResize=new d.EventEmitter,i._onScroll=new d.EventEmitter,i._instantiationService=new a.InstantiationService,i.optionsService=new u.OptionsService(t),i._instantiationService.setService(o.IOptionsService,i.optionsService),i._bufferService=i.register(i._instantiationService.createInstance(c.BufferService)),i._instantiationService.setService(o.IBufferService,i._bufferService),i._logService=i._instantiationService.createInstance(l.LogService),i._instantiationService.setService(o.ILogService,i._logService),i._coreService=i.register(i._instantiationService.createInstance(h.CoreService,(function(){return i.scrollToBottom()}))),i._instantiationService.setService(o.ICoreService,i._coreService),i._coreMouseService=i._instantiationService.createInstance(f.CoreMouseService),i._instantiationService.setService(o.ICoreMouseService,i._coreMouseService),i._dirtyRowService=i._instantiationService.createInstance(p.DirtyRowService),i._instantiationService.setService(o.IDirtyRowService,i._dirtyRowService),i.unicodeService=i._instantiationService.createInstance(g.UnicodeService),i._instantiationService.setService(o.IUnicodeService,i.unicodeService),i._charsetService=i._instantiationService.createInstance(v.CharsetService),i._instantiationService.setService(o.ICharsetService,i._charsetService),i._inputHandler=new y.InputHandler(i._bufferService,i._charsetService,i._coreService,i._dirtyRowService,i._logService,i.optionsService,i._coreMouseService,i.unicodeService),i.register(d.forwardEvent(i._inputHandler.onLineFeed,i._onLineFeed)),i.register(i._inputHandler),i.register(d.forwardEvent(i._bufferService.onResize,i._onResize)),i.register(d.forwardEvent(i._coreService.onData,i._onData)),i.register(d.forwardEvent(i._coreService.onBinary,i._onBinary)),i.register(i.optionsService.onOptionChange((function(e){return i._updateOptions(e)}))),i._writeBuffer=new _.WriteBuffer((function(e){return i._inputHandler.parse(e)})),i}return n(t,e),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 t;this._isDisposed||(e.prototype.dispose.call(this),null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)},t.prototype.write=function(e,t){this._writeBuffer.write(e,t)},t.prototype.writeSync=function(e){this._writeBuffer.writeSync(e)},t.prototype.resize=function(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,c.MINIMUM_COLS),t=Math.max(t,c.MINIMUM_ROWS),this._bufferService.resize(e,t))},t.prototype.scroll=function(e,t){void 0===t&&(t=!1);var i,r=this._bufferService.buffer;(i=this._cachedBlankLine)&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=r.getBlankLine(e,t),this._cachedBlankLine=i),i.isWrapped=t;var n=r.ybase+r.scrollTop,s=r.ybase+r.scrollBottom;if(0===r.scrollTop){var o=r.lines.isFull;s===r.lines.length-1?o?r.lines.recycle().copyFrom(i):r.lines.push(i.clone()):r.lines.splice(s+1,0,i.clone()),o?this._bufferService.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this._bufferService.isUserScrolling||r.ydisp++)}else{var a=s-n+1;r.lines.shiftElements(n+1,a-1,-1),r.lines.set(s,i.clone())}this._bufferService.isUserScrolling||(r.ydisp=r.ybase),this._dirtyRowService.markRangeDirty(r.scrollTop,r.scrollBottom),this._onScroll.fire(r.ydisp)},t.prototype.scrollLines=function(e,t){var i=this._bufferService.buffer;if(e<0){if(0===i.ydisp)return;this._bufferService.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this._bufferService.isUserScrolling=!1);var r=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),r!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))},t.prototype.scrollPages=function(e){this.scrollLines(e*(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(e){var t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)},t.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},t.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},t.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},t.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},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(e){var t;switch(e){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():(null===(t=this._windowsMode)||void 0===t||t.dispose(),this._windowsMode=void 0)}},t.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},(function(){return m.updateWindowsModeWrappedState(e._bufferService),!1}))),this._windowsMode={dispose:function(){for(var e=0,i=t;e<i.length;e++)i[e].dispose()}}}},t}(s.Disposable);t.CoreTerminal=b},function(e,t,i){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)r[n]=s[o];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;var n=i(1),s=i(14),o=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._entries=new Map;for(var i=0,r=e;i<r.length;i++){var n=r[i],s=n[0],o=n[1];this.set(s,o)}}return e.prototype.set=function(e,t){var i=this._entries.get(e);return this._entries.set(e,t),i},e.prototype.forEach=function(e){this._entries.forEach((function(t,i){return e(i,t)}))},e.prototype.has=function(e){return this._entries.has(e)},e.prototype.get=function(e){return this._entries.get(e)},e}();t.ServiceCollection=o;var a=function(){function e(){this._services=new o,this._services.set(n.IInstantiationService,this)}return e.prototype.setService=function(e,t){this._services.set(e,t)},e.prototype.getService=function(e){return this._services.get(e)},e.prototype.createInstance=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var n=s.getServiceDependencies(e).sort((function(e,t){return e.index-t.index})),o=[],a=0,l=n;a<l.length;a++){var c=l[a],u=this._services.get(c.id);if(!u)throw new Error("[createInstance] "+e.name+" depends on UNKNOWN service "+c.id+".");o.push(u)}var h=n.length>0?n[0].index:t.length;if(t.length!==h)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(h+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,r([void 0],r(t,o))))},e}();t.InstantiationService=a},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}},s=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)r[n]=s[o];return r};Object.defineProperty(t,"__esModule",{value:!0}),t.LogService=t.LogLevel=void 0;var o,a=i(1);!function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"}(o=t.LogLevel||(t.LogLevel={}));var l={debug:o.DEBUG,info:o.INFO,warn:o.WARN,error:o.ERROR,off:o.OFF},c=function(){function e(e){var t=this;this._optionsService=e,this._updateLogLevel(),this._optionsService.onOptionChange((function(e){"logLevel"===e&&t._updateLogLevel()}))}return e.prototype._updateLogLevel=function(){this._logLevel=l[this._optionsService.options.logLevel]},e.prototype._evalLazyOptionalParams=function(e){for(var t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())},e.prototype._log=function(e,t,i){this._evalLazyOptionalParams(i),e.call.apply(e,s([console,"xterm.js: "+t],i))},e.prototype.debug=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=o.DEBUG&&this._log(console.log,e,t)},e.prototype.info=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=o.INFO&&this._log(console.info,e,t)},e.prototype.warn=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=o.WARN&&this._log(console.warn,e,t)},e.prototype.error=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=o.ERROR&&this._log(console.error,e,t)},r([n(0,a.IOptionsService)],e)}();t.LogService=c},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;var a=i(1),l=i(69),c=i(0),u=i(2);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;var h=function(e){function i(i){var r=e.call(this)||this;return r._optionsService=i,r.isUserScrolling=!1,r._onResize=new c.EventEmitter,r.cols=Math.max(i.options.cols,t.MINIMUM_COLS),r.rows=Math.max(i.options.rows,t.MINIMUM_ROWS),r.buffers=new l.BufferSet(i,r),r}return n(i,e),Object.defineProperty(i.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){e.prototype.dispose.call(this),this.buffers.dispose()},i.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},i.prototype.reset=function(){this.buffers.dispose(),this.buffers=new l.BufferSet(this._optionsService,this),this.isUserScrolling=!1},s([o(0,a.IOptionsService)],i)}(u.Disposable);t.BufferService=h},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;var s=i(70),o=i(0),a=function(e){function t(t,i){var r=e.call(this)||this;return r._onBufferActivate=r.register(new o.EventEmitter),r._normal=new s.Buffer(!0,t,i),r._normal.fillViewportRows(),r._alt=new s.Buffer(!1,t,i),r._activeBuffer=r._normal,r.setupTabStops(),r}return n(t,e),Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),t.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}))},t.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),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}))},t.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},t.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},t}(i(2).Disposable);t.BufferSet=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferStringIterator=t.Buffer=t.MAX_BUFFER_SIZE=void 0;var r=i(71),n=i(16),s=i(4),o=i(3),a=i(72),l=i(73),c=i(20),u=i(6);t.MAX_BUFFER_SIZE=4294967295;var h=function(){function e(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=n.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=s.CellData.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),this._whitespaceCell=s.CellData.fromCharData([0,o.WHITESPACE_CELL_CHAR,o.WHITESPACE_CELL_WIDTH,o.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 e.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell},e.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell},e.prototype.getBlankLine=function(e,t){return new n.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(e.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows},enumerable:!1,configurable:!0}),e.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var i=e+this._optionsService.options.scrollback;return i>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=n.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.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()},e.prototype.resize=function(e,t){var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols<e)for(var s=0;s<this.lines.length;s++)this.lines.get(s).resize(e,i);var o=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new n.BufferLine(e,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,this.ydisp>0&&this.ydisp--):this.lines.push(new n.BufferLine(e,i)));else for(a=this._rows;a>t;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){var l=this.lines.length-r;l>0&&(this.lines.trimStart(l),this.ybase=Math.max(this.ybase-l,0),this.ydisp=Math.max(this.ydisp-l,0),this.savedY=Math.max(this.savedY-l,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(s=0;s<this.lines.length;s++)this.lines.get(s).resize(e,i);this._cols=e,this._rows=t},Object.defineProperty(e.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),e.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var i=a.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(n.DEFAULT_ATTR_DATA));if(i.length>0){var r=a.reflowLargerCreateNewLayout(this.lines,i);a.reflowLargerApplyNewLayout(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}},e.prototype._reflowLargerAdjustViewport=function(e,t,i){for(var r=this.getNullCell(n.DEFAULT_ATTR_DATA),s=i;s-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new n.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)},e.prototype._reflowSmaller=function(e,t){for(var i=this.getNullCell(n.DEFAULT_ATTR_DATA),r=[],s=0,o=this.lines.length-1;o>=0;o--){var l=this.lines.get(o);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=e)){for(var c=[l];l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);var u=this.ybase+this.y;if(!(u>=o&&u<o+c.length)){var h,d=c[c.length-1].getTrimmedLength(),f=a.reflowSmallerGetNewLineLengths(c,this._cols,e),p=f.length-c.length;h=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);for(var g=[],v=0;v<p;v++){var m=this.getBlankLine(n.DEFAULT_ATTR_DATA,!0);g.push(m)}g.length>0&&(r.push({start:o+c.length+s,newLines:g}),s+=g.length),c.push.apply(c,g);var y=f.length-1,_=f[y];0===_&&(_=f[--y]);for(var b=c.length-p-1,S=d;b>=0;){var C=Math.min(S,_);if(c[y].copyCellsFrom(c[b],S-C,_-C,C,!0),0==(_-=C)&&(_=f[--y]),0==(S-=C)){b--;var w=Math.max(b,0);S=a.getWrappedLineTrimmedLength(c,w,this._cols)}}for(v=0;v<c.length;v++)f[v]<e&&c[v].setCell(f[v],i);for(var k=p-h;k-- >0;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+s)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}}}if(r.length>0){var x=[],E=[];for(v=0;v<this.lines.length;v++)E.push(this.lines.get(v));var T=this.lines.length,L=T-1,A=0,R=r[A];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+s);var D=0;for(v=Math.min(this.lines.maxLength-1,T+s-1);v>=0;v--)if(R&&R.start>L+D){for(var O=R.newLines.length-1;O>=0;O--)this.lines.set(v--,R.newLines[O]);v++,x.push({index:L+1,amount:R.newLines.length}),D+=R.newLines.length,R=r[++A]}else this.lines.set(v,E[L--]);var M=0;for(v=x.length-1;v>=0;v--)x[v].index+=M,this.lines.onInsertEmitter.fire(x[v]),M+=x[v].amount;var I=Math.max(0,T+s-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}},e.prototype.stringIndexToBufferIndex=function(e,t,i){for(void 0===i&&(i=!1);t;){var r=this.lines.get(e);if(!r)return[-1,-1];for(var n=i?r.getTrimmedLength():r.length,s=0;s<n;++s)if(r.get(s)[o.CHAR_DATA_WIDTH_INDEX]&&(t-=r.get(s)[o.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,s];e++}return[e,0]},e.prototype.translateBufferLineToString=function(e,t,i,r){void 0===i&&(i=0);var n=this.lines.get(e);return n?n.translateToString(t,i,r):""},e.prototype.getWrappedRangeForLine=function(e){for(var t=e,i=e;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}},e.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.options.tabStopWidth)this.tabs[e]=!0},e.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,i=new l.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim((function(e){i.line-=e,i.line<0&&i.dispose()}))),i.register(this.lines.onInsert((function(e){i.line>=e.index&&(i.line+=e.amount)}))),i.register(this.lines.onDelete((function(e){i.line>=e.index&&i.line<e.index+e.amount&&i.dispose(),i.line>e.index&&(i.line-=e.amount)}))),i.register(i.onDispose((function(){return t._removeMarker(i)}))),i},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,i,r,n){return new d(this,e,t,i,r,n)},e}();t.Buffer=h;var d=function(){function e(e,t,i,r,n,s){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===s&&(s=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=s,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._current<this._endIndex},e.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();t.BufferStringIterator=d},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;var r=i(0),n=function(){function e(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(e.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),i=0;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!1,configurable:!0}),e.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},e.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},e.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++},e.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(e.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),e.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},e.prototype.splice=function(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(this._length+i.length>this._maxLength){var s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},e.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(var r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));var n=e+t+i-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r<t;r++)this.set(e+r+i,this.get(e+r))}},e.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},e}();t.CircularList=n},function(e,t,i){"use strict";function r(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();var r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),n=2===e[t+1].getWidth(0);return r&&n?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,i,n,s){for(var o=[],a=0;a<e.length-1;a++){var l=a,c=e.get(++l);if(c.isWrapped){for(var u=[e.get(a)];l<e.length&&c.isWrapped;)u.push(c),c=e.get(++l);if(n>=a&&n<l)a+=u.length-1;else{for(var h=0,d=r(u,h,t),f=1,p=0;f<u.length;){var g=r(u,f,t),v=g-p,m=i-d,y=Math.min(v,m);u[h].copyCellsFrom(u[f],p,d,y,!1),(d+=y)===i&&(h++,d=0),(p+=y)===g&&(f++,p=0),0===d&&0!==h&&2===u[h-1].getWidth(i-1)&&(u[h].copyCellsFrom(u[h-1],i-1,d++,1,!1),u[h-1].setCell(i-1,s))}u[h].replaceCells(d,i,s);for(var _=0,b=u.length-1;b>0&&(b>h||0===u[b].getTrimmedLength());b--)_++;_>0&&(o.push(a+u.length-_),o.push(_)),a+=u.length-1}}}return o},t.reflowLargerCreateNewLayout=function(e,t){for(var i=[],r=0,n=t[r],s=0,o=0;o<e.length;o++)if(n===o){var a=t[++r];e.onDeleteEmitter.fire({index:o-s,amount:a}),o+=a-1,s+=a,n=t[++r]}else i.push(o);return{layout:i,countRemoved:s}},t.reflowLargerApplyNewLayout=function(e,t){for(var i=[],r=0;r<t.length;r++)i.push(e.get(t[r]));for(r=0;r<i.length;r++)e.set(r,i[r]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,i){for(var n=[],s=e.map((function(i,n){return r(e,n,t)})).reduce((function(e,t){return e+t})),o=0,a=0,l=0;l<s;){if(s-l<i){n.push(s-l);break}o+=i;var c=r(e,a,t);o>c&&(o-=c,a++);var u=2===e[a].getWidth(o-1);u&&o--;var h=u?i-1:i;n.push(h),l+=h}return n},t.getWrappedLineTrimmedLength=r},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;var s=i(0),o=function(e){function t(i){var r=e.call(this)||this;return r.line=i,r._id=t._nextId++,r.isDisposed=!1,r._onDispose=new s.EventEmitter,r}return n(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},t._nextId=1,t}(i(2).Disposable);t.Marker=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=t.DEFAULT_BELL_SOUND=void 0;var r=i(0),n=i(11),s=i(33);t.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",t.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:t.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:n.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var o=["cols","rows"],a=function(){function e(e){this._onOptionChange=new r.EventEmitter,this.options=s.clone(t.DEFAULT_OPTIONS);for(var i=0,n=Object.keys(e);i<n.length;i++){var o=n[i];if(o in this.options){var a=e[o];this.options[o]=a}}}return Object.defineProperty(e.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),e.prototype.setOption=function(e,i){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');if(-1!==o.indexOf(e))throw new Error('Option "'+e+'" can only be set in the constructor');this.options[e]!==i&&(i=this._sanitizeAndValidateOption(e,i),this.options[e]!==i&&(this.options[e]=i,this._onOptionChange.fire(e)))},e.prototype._sanitizeAndValidateOption=function(e,i){switch(e){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(e+" cannot be less than 1, value: "+i);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+i);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+i)}return i},e.prototype.getOption=function(e){if(!(e in t.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');return this.options[e]},e}();t.OptionsService=a},function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),s=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},o=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;var a=i(1),l=i(0),c=i(33),u=i(2),h=Object.freeze({insertMode:!1}),d=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),f=function(e){function t(t,i,r,n){var s=e.call(this)||this;return s._bufferService=i,s._logService=r,s._optionsService=n,s.isCursorInitialized=!1,s.isCursorHidden=!1,s._onData=s.register(new l.EventEmitter),s._onUserInput=s.register(new l.EventEmitter),s._onBinary=s.register(new l.EventEmitter),s._scrollToBottom=t,s.register({dispose:function(){return s._scrollToBottom=void 0}}),s.modes=c.clone(h),s.decPrivateModes=c.clone(d),s}return n(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=c.clone(h),this.decPrivateModes=c.clone(d)},t.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var i=this._bufferService.buffer;i.ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onData.fire(e)}},t.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',(function(){return e.split("").map((function(e){return e.charCodeAt(0)}))})),this._onBinary.fire(e))},s([o(1,a.IBufferService),o(2,a.ILogService),o(3,a.IOptionsService)],t)}(u.Disposable);t.CoreService=f},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;var s=i(1),o=i(0),a={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function l(e,t){var i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}var c=String.fromCharCode,u={DEFAULT:function(e){var t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":"[M"+c(t[0])+c(t[1])+c(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+l(e,!0)+";"+e.col+";"+e.row+t}},h=function(){function e(e,t){this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new o.EventEmitter,this._lastEvent=null;for(var i=0,r=Object.keys(a);i<r.length;i++){var n=r[i];this.addProtocol(n,a[n])}for(var s=0,l=Object.keys(u);s<l.length;s++){var c=l[s];this.addEncoding(c,u[c])}this.reset()}return e.prototype.addProtocol=function(e,t){this._protocols[e]=t},e.prototype.addEncoding=function(e,t){this._encodings[e]=t},Object.defineProperty(e.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(e){if(!this._protocols[e])throw new Error('unknown protocol "'+e+'"');this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"areMouseEventsActive",{get:function(){return 0!==this._protocols[this._activeProtocol].events},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(e){if(!this._encodings[e])throw new Error('unknown encoding "'+e+'"');this._activeEncoding=e},enumerable:!1,configurable:!0}),e.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(e.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),e.prototype.triggerMouseEvent=function(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},e.prototype.explainEvents=function(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}},e.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},r([n(0,s.IBufferService),n(1,s.ICoreService)],e)}();t.CoreMouseService=h},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(o=(s<3?n(o):s>3?n(t,i,o):n(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},n=this&&this.__param||function(e,t){return function(i,r){t(i,r,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DirtyRowService=void 0;var s=i(1),o=function(){function e(e){this._bufferService=e,this.clearRange()}return Object.defineProperty(e.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),e.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},e.prototype.markDirty=function(e){e<this._start?this._start=e:e>this._end&&(this._end=e)},e.prototype.markRangeDirty=function(e,t){if(e>t){var i=e;e=t,t=i}e<this._start&&(this._start=e),t>this._end&&(this._end=t)},e.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},r([n(0,s.IBufferService)],e)}();t.DirtyRowService=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;var r=i(0),n=i(79),s=function(){function e(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new n.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}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(e){if(!this._providers[e])throw new Error('unknown Unicode version "'+e+'"');this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)},enumerable:!1,configurable:!0}),e.prototype.register=function(e){this._providers[e.version]=e},e.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},e.prototype.getStringCellWidth=function(e){for(var t=0,i=e.length,r=0;r<i;++r){var n=e.charCodeAt(r);if(55296<=n&&n<=56319){if(++r>=i)return t+this.wcwidth(n);var s=e.charCodeAt(r);56320<=s&&s<=57343?n=1024*(n-55296)+s-56320+65536:t+=this.wcwidth(s)}t+=this.wcwidth(n)}return t},e}();t.UnicodeService=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;var r,n=i(15),s=[[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]],o=[[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]],a=function(){function e(){if(this.version="6",!r){r=new Uint8Array(65536),n.fill(r,1),r[0]=0,n.fill(r,0,1,32),n.fill(r,0,127,160),n.fill(r,2,4352,4448),r[9001]=2,r[9002]=2,n.fill(r,2,11904,42192),r[12351]=1,n.fill(r,2,44032,55204),n.fill(r,2,63744,64256),n.fill(r,2,65040,65050),n.fill(r,2,65072,65136),n.fill(r,2,65280,65377),n.fill(r,2,65504,65511);for(var e=0;e<s.length;++e)n.fill(r,0,s[e][0],s[e][1]+1)}}return e.prototype.wcwidth=function(e){return e<32?0:e<127?1:e<65536?r[e]:function(e,t){var i,r=0,n=t.length-1;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(e>t[i=r+n>>1][1])r=i+1;else{if(!(e<t[i][0]))return!0;n=i-1}return!1}(e,o)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1},e}();t.UnicodeV6=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0;var r=function(){function e(){this.glevel=0,this._charsets=[]}return e.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},e.prototype.setgLevel=function(e){this.glevel=e,this.charset=this._charsets[e]},e.prototype.setgCharset=function(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)},e}();t.CharsetService=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;var r=i(3);t.updateWindowsModeWrappedState=function(e){var t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=null==t?void 0:t.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&i&&(n.isWrapped=i[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&i[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;var r=function(){function e(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return e.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;t<this._writeBuffer.length;++t){var i=this._writeBuffer[t],r=this._callbacks[t];this._action(i),r&&r()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(e)},e.prototype.write=function(e,t){var i=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 i._innerWrite()}))),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},e.prototype._innerWrite=function(){for(var e=this,t=Date.now();this._writeBuffer.length>this._bufferOffset;){var i=this._writeBuffer[this._bufferOffset],r=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(i),this._pendingData-=i.length,r&&r(),Date.now()-t>=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 e._innerWrite()}),0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},e}();t.WriteBuffer=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0;var r=function(){function e(){this._addons=[]}return e.prototype.dispose=function(){for(var e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()},e.prototype.loadAddon=function(e,t){var i=this,r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=function(){return i._wrappedAddonDispose(r)},t.activate(e)},e.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},e}();t.AddonManager=r}])},"07cG":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/components/Spinner/index.less?modules ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports={ldsRing:"ldsRing___2F8W7",idsRingWrapper:"idsRingWrapper___fC2cF",ldsring:"ldsring___3A88y"}},"19Vz":
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
|
|
|
\**************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function i(e){t(e);var i=e.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=e.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),i.appendChild(r),e.display.lineSpace.insertBefore(i,e.display.lineSpace.firstChild)}function r(e){s(e)&&i(e)}function n(e){var r=e.getWrapperElement(),n=s(e);r.className=r.className.replace(" CodeMirror-empty","")+(n?" CodeMirror-empty":""),n?i(e):t(e)}function s(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",(function(s,o,a){var l=a&&a!=e.Init;if(o&&!l)s.on("blur",r),s.on("change",n),s.on("swapDoc",n),e.on(s.getInputField(),"compositionupdate",s.state.placeholderCompose=function(){!function(e){setTimeout((function(){var r=!1,n=e.getInputField();"TEXTAREA"==n.nodeName?r=!n.value:1==e.lineCount()&&(r=!/[^\u200b]/.test(n.querySelector(".CodeMirror-line").textContent)),r?i(e):t(e)}),20)}(s)}),n(s);else if(!o&&l){s.off("blur",r),s.off("change",n),s.off("swapDoc",n),e.off(s.getInputField(),"compositionupdate",s.state.placeholderCompose),t(s);var c=s.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}o&&!s.hasFocus()&&r(s)}))}(i(/*! ../../lib/codemirror */"VrN/"))},"1dTM":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/rfb.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(/*! ./util/int.js */"GQ8N"),n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==A(e)&&"function"!=typeof e)return{default:e};var t=L();if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=r?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(i,n,s):i[n]=e[n]}i.default=e,t&&t.set(e,i);return i}(i(/*! ./util/logging.js */"Lo0S")),s=i(/*! ./util/strings.js */"VSMT"),o=i(/*! ./util/browser.js */"GdRQ"),a=i(/*! ./util/element.js */"SZEN"),l=i(/*! ./util/events.js */"vewr"),c=T(i(/*! ./util/eventtarget.js */"YJ9k")),u=T(i(/*! ./display.js */"MZdM")),h=T(i(/*! ./inflator.js */"ItS6")),d=T(i(/*! ./deflator.js */"whVF")),f=T(i(/*! ./input/keyboard.js */"Fv0C")),p=T(i(/*! ./input/gesturehandler.js */"LCi9")),g=T(i(/*! ./util/cursor.js */"rwxt")),v=T(i(/*! ./websock.js */"Mmt2")),m=T(i(/*! ./des.js */"iUHT")),y=T(i(/*! ./input/keysym.js */"mHUz")),_=T(i(/*! ./input/xtscancodes.js */"P2ho")),b=i(/*! ./encodings.js */"NBmB");i(/*! ./util/polyfill.js */"mdZa");var S=T(i(/*! ./decoders/raw.js */"34/K")),C=T(i(/*! ./decoders/copyrect.js */"hXwI")),w=T(i(/*! ./decoders/rre.js */"SgaC")),k=T(i(/*! ./decoders/hextile.js */"3690")),x=T(i(/*! ./decoders/tight.js */"8K/p")),E=T(i(/*! ./decoders/tightpng.js */"xO64"));function T(e){return e&&e.__esModule?e:{default:e}}function L(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return L=function(){return e},e}function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=P(e);if(t){var n=P(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return M(this,i)}}function M(e,t){return!t||"object"!==A(t)&&"function"!=typeof t?I(e):t}function I(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var F=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(T,e);var t,i,c,d=O(T);function T(e,t,i){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,T),!e)throw new Error("Must specify target");if(!t)throw new Error("Must specify URL");(r=d.call(this))._target=e,r._url=t,i=i||{},r._rfbCredentials=i.credentials||{},r._shared=!("shared"in i)||!!i.shared,r._repeaterID=i.repeaterID||"",r._wsProtocols=i.wsProtocols||[],r._rfbConnectionState="",r._rfbInitState="",r._rfbAuthScheme=-1,r._rfbCleanDisconnect=!0,r._rfbVersion=0,r._rfbMaxVersion=3.8,r._rfbTightVNC=!1,r._rfbVeNCryptState=0,r._rfbXvpVer=0,r._fbWidth=0,r._fbHeight=0,r._fbName="",r._capabilities={power:!1},r._supportsFence=!1,r._supportsContinuousUpdates=!1,r._enabledContinuousUpdates=!1,r._supportsSetDesktopSize=!1,r._screenID=0,r._screenFlags=0,r._qemuExtKeyEventSupported=!1,r._clipboardText=null,r._clipboardServerCapabilitiesActions={},r._clipboardServerCapabilitiesFormats={},r._sock=null,r._display=null,r._flushing=!1,r._keyboard=null,r._gestures=null,r._disconnTimer=null,r._resizeTimeout=null,r._mouseMoveTimer=null,r._decoders={},r._FBU={rects:0,x:0,y:0,width:0,height:0,encoding:null},r._mousePos={},r._mouseButtonMask=0,r._mouseLastMoveTime=0,r._viewportDragging=!1,r._viewportDragPos={},r._viewportHasMoved=!1,r._accumulatedWheelDeltaX=0,r._accumulatedWheelDeltaY=0,r._gestureLastTapTime=null,r._gestureFirstDoubleTapEv=null,r._gestureLastMagnitudeX=0,r._gestureLastMagnitudeY=0,r._eventHandlers={focusCanvas:r._focusCanvas.bind(I(r)),windowResize:r._windowResize.bind(I(r)),handleMouse:r._handleMouse.bind(I(r)),handleWheel:r._handleWheel.bind(I(r)),handleGesture:r._handleGesture.bind(I(r))},n.Debug(">> RFB.constructor"),r._screen=document.createElement("div"),r._screen.style.display="flex",r._screen.style.width="100%",r._screen.style.height="100%",r._screen.style.overflow="auto",r._screen.style.background="rgb(40, 40, 40)",r._canvas=document.createElement("canvas"),r._canvas.style.margin="auto",r._canvas.style.outline="none",r._canvas.style.flexShrink="0",r._canvas.width=0,r._canvas.height=0,r._canvas.tabIndex=-1,r._screen.appendChild(r._canvas),r._cursor=new g.default,r._cursorImage=T.cursors.none,r._decoders[b.encodings.encodingRaw]=new S.default,r._decoders[b.encodings.encodingCopyRect]=new C.default,r._decoders[b.encodings.encodingRRE]=new w.default,r._decoders[b.encodings.encodingHextile]=new k.default,r._decoders[b.encodings.encodingTight]=new x.default,r._decoders[b.encodings.encodingTightPNG]=new E.default;try{r._display=new u.default(r._canvas)}catch(e){throw n.Error("Display exception: "+e),e}return r._display.onflush=r._onFlush.bind(I(r)),r._keyboard=new f.default(r._canvas),r._keyboard.onkeyevent=r._handleKeyEvent.bind(I(r)),r._gestures=new p.default,r._sock=new v.default,r._sock.on("message",(function(){r._handleMessage()})),r._sock.on("open",(function(){"connecting"===r._rfbConnectionState&&""===r._rfbInitState?(r._rfbInitState="ProtocolVersion",n.Debug("Starting VNC handshake")):r._fail("Unexpected server connection while "+r._rfbConnectionState)})),r._sock.on("close",(function(e){n.Debug("WebSocket on-close event");var t="";switch(e.code&&(t="(code: "+e.code,e.reason&&(t+=", reason: "+e.reason),t+=")"),r._rfbConnectionState){case"connecting":r._fail("Connection closed "+t);break;case"connected":r._updateConnectionState("disconnecting"),r._updateConnectionState("disconnected");break;case"disconnecting":r._updateConnectionState("disconnected");break;case"disconnected":r._fail("Unexpected server disconnect when already disconnected "+t);break;default:r._fail("Unexpected server disconnect before connecting "+t)}r._sock.off("close")})),r._sock.on("error",(function(e){return n.Warn("WebSocket on-error event")})),setTimeout(r._updateConnectionState.bind(I(r),"connecting")),n.Debug("<< RFB.constructor"),r.dragViewport=!1,r.focusOnClick=!0,r._viewOnly=!1,r._clipViewport=!1,r._scaleViewport=!1,r._resizeSession=!1,r._showDotCursor=!1,void 0!==i.showDotCursor&&(n.Warn("Specifying showDotCursor as a RFB constructor argument is deprecated"),r._showDotCursor=i.showDotCursor),r._qualityLevel=6,r._compressionLevel=2,r}return t=T,c=[{key:"genDES",value:function(e,t){var i=e.split("").map((function(e){return e.charCodeAt(0)}));return new m.default(i).encrypt(t)}}],(i=[{key:"disconnect",value:function(){this._updateConnectionState("disconnecting"),this._sock.off("error"),this._sock.off("message"),this._sock.off("open")}},{key:"sendCredentials",value:function(e){this._rfbCredentials=e,setTimeout(this._initMsg.bind(this),0)}},{key:"sendCtrlAltDel",value:function(){"connected"!==this._rfbConnectionState||this._viewOnly||(n.Info("Sending Ctrl-Alt-Del"),this.sendKey(y.default.XK_Control_L,"ControlLeft",!0),this.sendKey(y.default.XK_Alt_L,"AltLeft",!0),this.sendKey(y.default.XK_Delete,"Delete",!0),this.sendKey(y.default.XK_Delete,"Delete",!1),this.sendKey(y.default.XK_Alt_L,"AltLeft",!1),this.sendKey(y.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(e,t,i){if("connected"===this._rfbConnectionState&&!this._viewOnly){if(void 0===i)return this.sendKey(e,t,!0),void this.sendKey(e,t,!1);var r=_.default[t];if(this._qemuExtKeyEventSupported&&r)e=e||0,n.Info("Sending key ("+(i?"down":"up")+"): keysym "+e+", scancode "+r),T.messages.QEMUExtendedKeyEvent(this._sock,e,i,r);else{if(!e)return;n.Info("Sending keysym ("+(i?"down":"up")+"): "+e),T.messages.keyEvent(this._sock,e,i?1:0)}}}},{key:"focus",value:function(){this._canvas.focus()}},{key:"blur",value:function(){this._canvas.blur()}},{key:"clipboardPasteFrom",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly)if(this._clipboardServerCapabilitiesFormats[1]&&this._clipboardServerCapabilitiesActions[1<<27])this._clipboardText=e,T.messages.extendedClipboardNotify(this._sock,[1]);else{for(var t=new Uint8Array(e.length),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);T.messages.clientCutText(this._sock,t)}}},{key:"_connect",value:function(){n.Debug(">> RFB.connect"),n.Info("connecting to "+this._url);try{this._sock.open(this._url,this._wsProtocols)}catch(e){"SyntaxError"===e.name?this._fail("Invalid host or port ("+e+")"):this._fail("Error when opening socket ("+e+")")}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),n.Debug("<< RFB.connect")}},{key:"_disconnect",value:function(){n.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(e){if("NotFoundError"!==e.name)throw e}clearTimeout(this._resizeTimeout),clearTimeout(this._mouseMoveTimer),n.Debug("<< RFB.disconnect")}},{key:"_focusCanvas",value:function(e){this.focusOnClick&&this.focus()}},{key:"_setDesktopName",value:function(e){this._fbName=e,this.dispatchEvent(new CustomEvent("desktopname",{detail:{name:this._fbName}}))}},{key:"_windowResize",value:function(e){var t=this;window.requestAnimationFrame((function(){t._updateClip(),t._updateScale()})),this._resizeSession&&(clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(this._requestRemoteResize.bind(this),500))}},{key:"_updateClip",value:function(){var e=this._display.clipViewport,t=this._clipViewport;if(this._scaleViewport&&(t=!1),e!==t&&(this._display.clipViewport=t),t){var i=this._screenSize();this._display.viewportChangeSize(i.w,i.h),this._fixScrollbars()}}},{key:"_updateScale",value:function(){if(this._scaleViewport){var e=this._screenSize();this._display.autoscale(e.w,e.h)}else this._display.scale=1;this._fixScrollbars()}},{key:"_requestRemoteResize",value:function(){if(clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeSession&&!this._viewOnly&&this._supportsSetDesktopSize){var e=this._screenSize();T.messages.setDesktopSize(this._sock,Math.floor(e.w),Math.floor(e.h),this._screenID,this._screenFlags),n.Debug("Requested new desktop size: "+e.w+"x"+e.h)}}},{key:"_screenSize",value:function(){var e=this._screen.getBoundingClientRect();return{w:e.width,h:e.height}}},{key:"_fixScrollbars",value:function(){var e=this._screen.style.overflow;this._screen.style.overflow="hidden",this._screen.getBoundingClientRect(),this._screen.style.overflow=e}},{key:"_updateConnectionState",value:function(e){var t=this,i=this._rfbConnectionState;if(e!==i)if("disconnected"!==i){switch(e){case"connected":if("connecting"!==i)return void n.Error("Bad transition to connected state, previous connection state: "+i);break;case"disconnected":if("disconnecting"!==i)return void n.Error("Bad transition to disconnected state, previous connection state: "+i);break;case"connecting":if(""!==i)return void n.Error("Bad transition to connecting state, previous connection state: "+i);break;case"disconnecting":if("connected"!==i&&"connecting"!==i)return void n.Error("Bad transition to disconnecting state, previous connection state: "+i);break;default:return void n.Error("Unknown connection state: "+e)}switch(this._rfbConnectionState=e,n.Debug("New state '"+e+"', was '"+i+"'."),this._disconnTimer&&"disconnecting"!==e&&(n.Debug("Clearing disconnect timer"),clearTimeout(this._disconnTimer),this._disconnTimer=null,this._sock.off("close")),e){case"connecting":this._connect();break;case"connected":this.dispatchEvent(new CustomEvent("connect",{detail:{}}));break;case"disconnecting":this._disconnect(),this._disconnTimer=setTimeout((function(){n.Error("Disconnection timed out."),t._updateConnectionState("disconnected")}),3e3);break;case"disconnected":this.dispatchEvent(new CustomEvent("disconnect",{detail:{clean:this._rfbCleanDisconnect}}))}}else n.Error("Tried changing state of a disconnected RFB object");else n.Debug("Already in state '"+e+"', ignoring")}},{key:"_fail",value:function(e){switch(this._rfbConnectionState){case"disconnecting":n.Error("Failed when disconnecting: "+e);break;case"connected":n.Error("Failed while connected: "+e);break;case"connecting":n.Error("Failed when connecting: "+e);break;default:n.Error("RFB failure: "+e)}return this._rfbCleanDisconnect=!1,this._updateConnectionState("disconnecting"),this._updateConnectionState("disconnected"),!1}},{key:"_setCapability",value:function(e,t){this._capabilities[e]=t,this.dispatchEvent(new CustomEvent("capabilities",{detail:{capabilities:this._capabilities}}))}},{key:"_handleMessage",value:function(){if(0!==this._sock.rQlen)switch(this._rfbConnectionState){case"disconnected":n.Error("Got data while disconnected");break;case"connected":for(;!this._flushing&&this._normalMsg()&&0!==this._sock.rQlen;);break;default:this._initMsg()}else n.Warn("handleMessage called on an empty receive queue")}},{key:"_handleKeyEvent",value:function(e,t,i){this.sendKey(e,t,i)}},{key:"_handleMouse",value:function(e){if(("click"!==e.type||e.target===this._canvas)&&(e.stopPropagation(),e.preventDefault(),"click"!==e.type&&"contextmenu"!==e.type)){var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas);switch(e.type){case"mousedown":(0,l.setCapture)(this._canvas),this._handleMouseButton(t.x,t.y,!0,1<<e.button);break;case"mouseup":this._handleMouseButton(t.x,t.y,!1,1<<e.button);break;case"mousemove":this._handleMouseMove(t.x,t.y)}}}},{key:"_handleMouseButton",value:function(e,t,i,r){if(this.dragViewport){if(i&&!this._viewportDragging)return this._viewportDragging=!0,this._viewportDragPos={x:e,y:t},void(this._viewportHasMoved=!1);if(this._viewportDragging=!1,this._viewportHasMoved)return;this._sendMouse(e,t,r)}null!==this._mouseMoveTimer&&(clearTimeout(this._mouseMoveTimer),this._mouseMoveTimer=null,this._sendMouse(e,t,this._mouseButtonMask)),i?this._mouseButtonMask|=r:this._mouseButtonMask&=~r,this._sendMouse(e,t,this._mouseButtonMask)}},{key:"_handleMouseMove",value:function(e,t){var i=this;if(this._viewportDragging){var r=this._viewportDragPos.x-e,n=this._viewportDragPos.y-t;(this._viewportHasMoved||Math.abs(r)>o.dragThreshold||Math.abs(n)>o.dragThreshold)&&(this._viewportHasMoved=!0,this._viewportDragPos={x:e,y:t},this._display.viewportChangePos(r,n))}else if(this._mousePos={x:e,y:t},null==this._mouseMoveTimer){var s=Date.now()-this._mouseLastMoveTime;s>17?(this._sendMouse(e,t,this._mouseButtonMask),this._mouseLastMoveTime=Date.now()):this._mouseMoveTimer=setTimeout((function(){i._handleDelayedMouseMove()}),17-s)}}},{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(e,t,i){"connected"===this._rfbConnectionState&&(this._viewOnly||T.messages.pointerEvent(this._sock,this._display.absX(e),this._display.absY(t),i))}},{key:"_handleWheel",value:function(e){if("connected"===this._rfbConnectionState&&!this._viewOnly){e.stopPropagation(),e.preventDefault();var t=(0,a.clientToElement)(e.clientX,e.clientY,this._canvas),i=e.deltaX,r=e.deltaY;0!==e.deltaMode&&(i*=19,r*=19),this._accumulatedWheelDeltaX+=i,this._accumulatedWheelDeltaY+=r,Math.abs(this._accumulatedWheelDeltaX)>=50&&(this._accumulatedWheelDeltaX<0?(this._handleMouseButton(t.x,t.y,!0,32),this._handleMouseButton(t.x,t.y,!1,32)):this._accumulatedWheelDeltaX>0&&(this._handleMouseButton(t.x,t.y,!0,64),this._handleMouseButton(t.x,t.y,!1,64)),this._accumulatedWheelDeltaX=0),Math.abs(this._accumulatedWheelDeltaY)>=50&&(this._accumulatedWheelDeltaY<0?(this._handleMouseButton(t.x,t.y,!0,8),this._handleMouseButton(t.x,t.y,!1,8)):this._accumulatedWheelDeltaY>0&&(this._handleMouseButton(t.x,t.y,!0,16),this._handleMouseButton(t.x,t.y,!1,16)),this._accumulatedWheelDeltaY=0)}}},{key:"_fakeMouseMove",value:function(e,t,i){this._handleMouseMove(t,i),this._cursor.move(e.detail.clientX,e.detail.clientY)}},{key:"_handleTapEvent",value:function(e,t){var i=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);if(null!==this._gestureLastTapTime&&Date.now()-this._gestureLastTapTime<1e3&&this._gestureFirstDoubleTapEv.detail.type===e.detail.type){var r=this._gestureFirstDoubleTapEv.detail.clientX-e.detail.clientX,n=this._gestureFirstDoubleTapEv.detail.clientY-e.detail.clientY;Math.hypot(r,n)<50?i=(0,a.clientToElement)(this._gestureFirstDoubleTapEv.detail.clientX,this._gestureFirstDoubleTapEv.detail.clientY,this._canvas):this._gestureFirstDoubleTapEv=e}else this._gestureFirstDoubleTapEv=e;this._gestureLastTapTime=Date.now(),this._fakeMouseMove(this._gestureFirstDoubleTapEv,i.x,i.y),this._handleMouseButton(i.x,i.y,!0,t),this._handleMouseButton(i.x,i.y,!1,t)}},{key:"_handleGesture",value:function(e){var t,i=(0,a.clientToElement)(e.detail.clientX,e.detail.clientY,this._canvas);switch(e.type){case"gesturestart":switch(e.detail.type){case"onetap":this._handleTapEvent(e,1);break;case"twotap":this._handleTapEvent(e,4);break;case"threetap":this._handleTapEvent(e,2);break;case"drag":this._fakeMouseMove(e,i.x,i.y),this._handleMouseButton(i.x,i.y,!0,1);break;case"longpress":this._fakeMouseMove(e,i.x,i.y),this._handleMouseButton(i.x,i.y,!0,4);break;case"twodrag":this._gestureLastMagnitudeX=e.detail.magnitudeX,this._gestureLastMagnitudeY=e.detail.magnitudeY,this._fakeMouseMove(e,i.x,i.y);break;case"pinch":this._gestureLastMagnitudeX=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),this._fakeMouseMove(e,i.x,i.y)}break;case"gesturemove":switch(e.detail.type){case"onetap":case"twotap":case"threetap":break;case"drag":case"longpress":this._fakeMouseMove(e,i.x,i.y);break;case"twodrag":for(this._fakeMouseMove(e,i.x,i.y);e.detail.magnitudeY-this._gestureLastMagnitudeY>50;)this._handleMouseButton(i.x,i.y,!0,8),this._handleMouseButton(i.x,i.y,!1,8),this._gestureLastMagnitudeY+=50;for(;e.detail.magnitudeY-this._gestureLastMagnitudeY<-50;)this._handleMouseButton(i.x,i.y,!0,16),this._handleMouseButton(i.x,i.y,!1,16),this._gestureLastMagnitudeY-=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX>50;)this._handleMouseButton(i.x,i.y,!0,32),this._handleMouseButton(i.x,i.y,!1,32),this._gestureLastMagnitudeX+=50;for(;e.detail.magnitudeX-this._gestureLastMagnitudeX<-50;)this._handleMouseButton(i.x,i.y,!0,64),this._handleMouseButton(i.x,i.y,!1,64),this._gestureLastMagnitudeX-=50;break;case"pinch":if(this._fakeMouseMove(e,i.x,i.y),t=Math.hypot(e.detail.magnitudeX,e.detail.magnitudeY),Math.abs(t-this._gestureLastMagnitudeX)>75){for(this._handleKeyEvent(y.default.XK_Control_L,"ControlLeft",!0);t-this._gestureLastMagnitudeX>75;)this._handleMouseButton(i.x,i.y,!0,8),this._handleMouseButton(i.x,i.y,!1,8),this._gestureLastMagnitudeX+=75;for(;t-this._gestureLastMagnitudeX<-75;)this._handleMouseButton(i.x,i.y,!0,16),this._handleMouseButton(i.x,i.y,!1,16),this._gestureLastMagnitudeX-=75}this._handleKeyEvent(y.default.XK_Control_L,"ControlLeft",!1)}break;case"gestureend":switch(e.detail.type){case"onetap":case"twotap":case"threetap":case"pinch":case"twodrag":break;case"drag":this._fakeMouseMove(e,i.x,i.y),this._handleMouseButton(i.x,i.y,!1,1);break;case"longpress":this._fakeMouseMove(e,i.x,i.y),this._handleMouseButton(i.x,i.y,!1,4)}}}},{key:"_negotiateProtocolVersion",value:function(){if(this._sock.rQwait("version",12))return!1;var e=this._sock.rQshiftStr(12).substr(4,7);n.Info("Server ProtocolVersion: "+e);var t=0;switch(e){case"000.000":t=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 "+e)}if(t){for(var i="ID:"+this._repeaterID;i.length<250;)i+="\0";return this._sock.sendString(i),!0}this._rfbVersion>this._rfbMaxVersion&&(this._rfbVersion=this._rfbMaxVersion);var r="00"+parseInt(this._rfbVersion,10)+".00"+10*this._rfbVersion%10;this._sock.sendString("RFB "+r+"\n"),n.Debug("Sent ProtocolVersion: "+r),this._rfbInitState="Security"}},{key:"_negotiateSecurity",value:function(){function e(e,t){for(var i=0;i<t.length;i++)if(t[i]===e)return!0;return!1}if(this._rfbVersion>=3.7){var t=this._sock.rQshift8();if(this._sock.rQwait("security type",t,1))return!1;if(0===t)return this._rfbInitState="SecurityReason",this._securityContext="no security types",this._securityStatus=1,this._initMsg();var i=this._sock.rQshiftBytes(t);if(n.Debug("Server security types: "+i),e(1,i))this._rfbAuthScheme=1;else if(e(22,i))this._rfbAuthScheme=22;else if(e(16,i))this._rfbAuthScheme=16;else if(e(2,i))this._rfbAuthScheme=2;else{if(!e(19,i))return this._fail("Unsupported security types (types: "+i+")");this._rfbAuthScheme=19}this._sock.send([this._rfbAuthScheme])}else{if(this._sock.rQwait("security scheme",4))return!1;if(this._rfbAuthScheme=this._sock.rQshift32(),0==this._rfbAuthScheme)return this._rfbInitState="SecurityReason",this._securityContext="authentication scheme",this._securityStatus=1,this._initMsg()}return this._rfbInitState="Authentication",n.Debug("Authenticating using scheme: "+this._rfbAuthScheme),this._initMsg()}},{key:"_handleSecurityReason",value:function(){if(this._sock.rQwait("reason length",4))return!1;var e=this._sock.rQshift32(),t="";if(e>0){if(this._sock.rQwait("reason",e,4))return!1;t=this._sock.rQshiftStr(e)}return""!==t?(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus,reason:t}})),this._fail("Security negotiation failed on "+this._securityContext+" (reason: "+t+")")):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:this._securityStatus}})),this._fail("Security negotiation failed on "+this._securityContext))}},{key:"_negotiateXvpAuth",value:function(){if(void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password||void 0===this._rfbCredentials.target)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password","target"]}})),!1;var e=String.fromCharCode(this._rfbCredentials.username.length)+String.fromCharCode(this._rfbCredentials.target.length)+this._rfbCredentials.username+this._rfbCredentials.target;return this._sock.sendString(e),this._rfbAuthScheme=2,this._negotiateAuthentication()}},{key:"_negotiateVeNCryptAuth",value:function(){if(0==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt version",2))return!1;var e=this._sock.rQshift8(),t=this._sock.rQshift8();if(0!=e||2!=t)return this._fail("Unsupported VeNCrypt version "+e+"."+t);this._sock.send([0,2]),this._rfbVeNCryptState=1}if(1==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt ack",1))return!1;var i=this._sock.rQshift8();if(0!=i)return this._fail("VeNCrypt failure "+i);this._rfbVeNCryptState=2}if(2==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes length",1))return!1;var r=this._sock.rQshift8();if(r<1)return this._fail("VeNCrypt subtypes empty");this._rfbVeNCryptSubtypesLength=r,this._rfbVeNCryptState=3}if(3==this._rfbVeNCryptState){if(this._sock.rQwait("vencrypt subtypes",4*this._rfbVeNCryptSubtypesLength))return!1;for(var n=[],o=0;o<this._rfbVeNCryptSubtypesLength;o++)n.push(this._sock.rQshift32());if(-1==n.indexOf(256))return this._fail("VeNCrypt Plain subtype not offered by server");this._sock.send([0,0,1,0]),this._rfbVeNCryptState=4}if(4==this._rfbVeNCryptState){if(!this._rfbCredentials.username||!this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["username","password"]}})),!1;var a=(0,s.encodeUTF8)(this._rfbCredentials.username),l=(0,s.encodeUTF8)(this._rfbCredentials.password);return this._sock.send([0,0,0,a.length]),this._sock.send([0,0,0,l.length]),this._sock.sendString(a),this._sock.sendString(l),this._rfbInitState="SecurityResult",!0}}},{key:"_negotiateStdVNCAuth",value:function(){if(this._sock.rQwait("auth challenge",16))return!1;if(void 0===this._rfbCredentials.password)return this.dispatchEvent(new CustomEvent("credentialsrequired",{detail:{types:["password"]}})),!1;var e=Array.prototype.slice.call(this._sock.rQshiftBytes(16)),t=T.genDES(this._rfbCredentials.password,e);return this._sock.send(t),this._rfbInitState="SecurityResult",!0}},{key:"_negotiateTightUnixAuth",value:function(){return void 0===this._rfbCredentials.username||void 0===this._rfbCredentials.password?(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(e){for(var t={vendor:"TGHT",signature:"NOTUNNEL"},i={},r=0;r<e;r++){var s=this._sock.rQshift32(),o=this._sock.rQshiftStr(4),a=this._sock.rQshiftStr(8);i[s]={vendor:o,signature:a}}return n.Debug("Server Tight tunnel types: "+i),i[1]&&"SICR"===i[1].vendor&&"SCHANNEL"===i[1].signature&&(n.Debug("Detected Siemens server. Assuming NOTUNNEL support."),i[0]={vendor:"TGHT",signature:"NOTUNNEL"}),i[0]?i[0].vendor!=t.vendor||i[0].signature!=t.signature?this._fail("Client's tunnel type had the incorrect vendor or signature"):(n.Debug("Selected tunnel type: "+t),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 e=this._sock.rQshift32();if(e>0&&this._sock.rQwait("tunnel capabilities",16*e,4))return!1;if(this._rfbTightVNC=!0,e>0)return this._negotiateTightTunnels(e),!1}if(this._sock.rQwait("sub auth count",4))return!1;var t=this._sock.rQshift32();if(0===t)return this._rfbInitState="SecurityResult",!0;if(this._sock.rQwait("sub auth capabilities",16*t,4))return!1;for(var i={STDVNOAUTH__:1,STDVVNCAUTH_:2,TGHTULGNAUTH:129},r=[],s=0;s<t;s++){this._sock.rQshift32();var o=this._sock.rQshiftStr(12);r.push(o)}for(var a in n.Debug("Server Tight authentication types: "+r),i)if(-1!=r.indexOf(a))switch(this._sock.send([0,0,0,i[a]]),n.Debug("Selected authentication type: "+a),a){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: "+a+")")}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 e=this._sock.rQshift32();return 0===e?(this._rfbInitState="ClientInitialisation",n.Debug("Authentication OK"),this._initMsg()):this._rfbVersion>=3.8?(this._rfbInitState="SecurityReason",this._securityContext="security result",this._securityStatus=e,this._initMsg()):(this.dispatchEvent(new CustomEvent("securityfailure",{detail:{status:e}})),this._fail("Security handshake failed"))}},{key:"_negotiateServerInit",value:function(){if(this._sock.rQwait("server initialization",24))return!1;var e=this._sock.rQshift16(),t=this._sock.rQshift16(),i=this._sock.rQshift8(),r=this._sock.rQshift8(),o=this._sock.rQshift8(),a=this._sock.rQshift8(),l=this._sock.rQshift16(),c=this._sock.rQshift16(),u=this._sock.rQshift16(),h=this._sock.rQshift8(),d=this._sock.rQshift8(),f=this._sock.rQshift8();this._sock.rQskipBytes(3);var p=this._sock.rQshift32();if(this._sock.rQwait("server init name",p,24))return!1;var g=this._sock.rQshiftStr(p);if(g=(0,s.decodeUTF8)(g,!0),this._rfbTightVNC){if(this._sock.rQwait("TightVNC extended server init header",8,24+p))return!1;var v=this._sock.rQshift16(),m=this._sock.rQshift16(),y=this._sock.rQshift16();this._sock.rQskipBytes(2);var _=16*(v+m+y);if(this._sock.rQwait("TightVNC extended server init header",_,32+p))return!1;this._sock.rQskipBytes(16*v),this._sock.rQskipBytes(16*m),this._sock.rQskipBytes(16*y)}return n.Info("Screen: "+e+"x"+t+", bpp: "+i+", depth: "+r+", bigEndian: "+o+", trueColor: "+a+", redMax: "+l+", greenMax: "+c+", blueMax: "+u+", redShift: "+h+", greenShift: "+d+", blueShift: "+f),this._setDesktopName(g),this._resize(e,t),this._viewOnly||this._keyboard.grab(),this._fbDepth=24,"Intel(r) AMT KVM"===this._fbName&&(n.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode."),this._fbDepth=8),T.messages.pixelFormat(this._sock,this._fbDepth,!0),this._sendEncodings(),T.messages.fbUpdateRequest(this._sock,!1,0,0,this._fbWidth,this._fbHeight),this._updateConnectionState("connected"),!0}},{key:"_sendEncodings",value:function(){var e=[];e.push(b.encodings.encodingCopyRect),24==this._fbDepth&&(e.push(b.encodings.encodingTight),e.push(b.encodings.encodingTightPNG),e.push(b.encodings.encodingHextile),e.push(b.encodings.encodingRRE)),e.push(b.encodings.encodingRaw),e.push(b.encodings.pseudoEncodingQualityLevel0+this._qualityLevel),e.push(b.encodings.pseudoEncodingCompressLevel0+this._compressionLevel),e.push(b.encodings.pseudoEncodingDesktopSize),e.push(b.encodings.pseudoEncodingLastRect),e.push(b.encodings.pseudoEncodingQEMUExtendedKeyEvent),e.push(b.encodings.pseudoEncodingExtendedDesktopSize),e.push(b.encodings.pseudoEncodingXvp),e.push(b.encodings.pseudoEncodingFence),e.push(b.encodings.pseudoEncodingContinuousUpdates),e.push(b.encodings.pseudoEncodingDesktopName),e.push(b.encodings.pseudoEncodingExtendedClipboard),24==this._fbDepth&&(e.push(b.encodings.pseudoEncodingVMwareCursor),e.push(b.encodings.pseudoEncodingCursor)),T.messages.clientEncodings(this._sock,e)}},{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 n.Debug("SetColorMapEntries"),this._fail("Unexpected SetColorMapEntries message")}},{key:"_handleServerCutText",value:function(){if(n.Debug("ServerCutText"),this._sock.rQwait("ServerCutText header",7,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32();if(e=(0,r.toSigned32bit)(e),this._sock.rQwait("ServerCutText content",Math.abs(e),8))return!1;if(e>=0){var t=this._sock.rQshiftStr(e);if(this._viewOnly)return!0;this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:t}}))}else{e=Math.abs(e);var i=this._sock.rQshift32(),o=65535&i,a=4278190080&i;if(a&1<<24){this._clipboardServerCapabilitiesFormats={},this._clipboardServerCapabilitiesActions={};for(var l=0;l<=15;l++){var c=1<<l;o&c&&(this._clipboardServerCapabilitiesFormats[c]=!0,this._sock.rQshift32())}for(var u=24;u<=31;u++){var d=1<<u;this._clipboardServerCapabilitiesActions[d]=!!(a&d)}var f=[1<<24,1<<25,1<<26,1<<27,1<<28];T.messages.extendedClipboardCaps(this._sock,f,{extendedClipboardFormatText:0})}else if(a===1<<25){if(this._viewOnly)return!0;null!=this._clipboardText&&this._clipboardServerCapabilitiesActions[1<<28]&&1&o&&T.messages.extendedClipboardProvide(this._sock,[1],[this._clipboardText])}else if(a===1<<26){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[1<<27]&&(null!=this._clipboardText?T.messages.extendedClipboardNotify(this._sock,[1]):T.messages.extendedClipboardNotify(this._sock,[]))}else if(a===1<<27){if(this._viewOnly)return!0;this._clipboardServerCapabilitiesActions[1<<25]&&1&o&&T.messages.extendedClipboardRequest(this._sock,[1])}else{if(a!==1<<28)return this._fail("Unexpected action in extended clipboard message: "+a);if(this._viewOnly)return!0;if(!(1&o))return!0;this._clipboardText=null;var p=this._sock.rQshiftBytes(e-4),g=new h.default,v=null;g.setInput(p);for(var m=0;m<=15;m++){var y=1<<m;if(o&y){var _=0,b=g.inflate(4);_|=b[0]<<24,_|=b[1]<<16,_|=b[2]<<8,_|=b[3];var S=g.inflate(_);1===y&&(v=S)}}if(g.setInput(null),null!==v){for(var C="",w=0;w<v.length;w++)C+=String.fromCharCode(v[w]);v=C,(v=(0,s.decodeUTF8)(v)).length>0&&"\0"===v.charAt(v.length-1)&&(v=v.slice(0,-1)),v=v.replace("\r\n","\n"),this.dispatchEvent(new CustomEvent("clipboard",{detail:{text:v}}))}}}return!0}},{key:"_handleServerFenceMsg",value:function(){if(this._sock.rQwait("ServerFence header",8,1))return!1;this._sock.rQskipBytes(3);var e=this._sock.rQshift32(),t=this._sock.rQshift8();if(this._sock.rQwait("ServerFence payload",t,9))return!1;t>64&&(n.Warn("Bad payload length ("+t+") in fence response"),t=64);var i=this._sock.rQshiftStr(t);return this._supportsFence=!0,e&1<<31?(e&=3,T.messages.clientFence(this._sock,e,i),!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 e=this._sock.rQshift8(),t=this._sock.rQshift8();switch(t){case 0:n.Error("XVP Operation Failed");break;case 1:this._rfbXvpVer=e,n.Info("XVP extensions enabled (version "+this._rfbXvpVer+")"),this._setCapability("power",!0);break;default:this._fail("Illegal server XVP message (msg: "+t+")")}return!0}},{key:"_normalMsg",value:function(){var e,t,i;switch(e=this._FBU.rects>0?0:this._sock.rQshift8()){case 0:return(i=this._framebufferUpdate())&&!this._enabledContinuousUpdates&&T.messages.fbUpdateRequest(this._sock,!0,0,0,this._fbWidth,this._fbHeight),i;case 1:return this._handleSetColourMapMsg();case 2:return n.Debug("Bell"),this.dispatchEvent(new CustomEvent("bell",{detail:{}})),!0;case 3:return this._handleServerCutText();case 150:return t=!this._supportsContinuousUpdates,this._supportsContinuousUpdates=!0,this._enabledContinuousUpdates=!1,t&&(this._enabledContinuousUpdates=!0,this._updateContinuousUpdates(),n.Info("Enabling continuous updates.")),!0;case 248:return this._handleServerFenceMsg();case 250:return this._handleXvpMsg();default:return this._fail("Unexpected server message (type "+e+")"),n.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(0===this._FBU.rects){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(null===this._FBU.encoding){if(this._sock.rQwait("rect header",12))return!1;var e=this._sock.rQshiftBytes(12);this._FBU.x=(e[0]<<8)+e[1],this._FBU.y=(e[2]<<8)+e[3],this._FBU.width=(e[4]<<8)+e[5],this._FBU.height=(e[6]<<8)+e[7],this._FBU.encoding=parseInt((e[8]<<24)+(e[9]<<16)+(e[10]<<8)+e[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 b.encodings.pseudoEncodingLastRect:return this._FBU.rects=1,!0;case b.encodings.pseudoEncodingVMwareCursor:return this._handleVMwareCursor();case b.encodings.pseudoEncodingCursor:return this._handleCursor();case b.encodings.pseudoEncodingQEMUExtendedKeyEvent:try{void 0!==document.createEvent("keyboardEvent").code&&(this._qemuExtKeyEventSupported=!0)}catch(e){}return!0;case b.encodings.pseudoEncodingDesktopName:return this._handleDesktopName();case b.encodings.pseudoEncodingDesktopSize:return this._resize(this._FBU.width,this._FBU.height),!0;case b.encodings.pseudoEncodingExtendedDesktopSize:return this._handleExtendedDesktopSize();default:return this._handleDataRect()}}},{key:"_handleVMwareCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,i=this._FBU.width,r=this._FBU.height;if(this._sock.rQwait("VMware cursor encoding",1))return!1;var s,o=this._sock.rQshift8();if(this._sock.rQshift8(),0==o){if(s=new Array(i*r*4),this._sock.rQwait("VMware cursor classic encoding",i*r*4*2,2))return!1;for(var a=new Array(i*r),l=0;l<i*r;l++)a[l]=this._sock.rQshift32();for(var c=new Array(i*r),u=0;u<i*r;u++)c[u]=this._sock.rQshift32();for(var h=0;h<i*r;h++)if(0==a[h]){var d=c[h],f=d>>8&255,p=d>>16&255,g=d>>24&255;s[4*h]=f,s[4*h+1]=p,s[4*h+2]=g,s[4*h+3]=255}else-256==(-256&a[h])?0==c[h]?(s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=0):(c[h],s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=255):(s[4*h]=0,s[4*h+1]=0,s[4*h+2]=0,s[4*h+3]=255)}else{if(1!=o)return n.Warn("The given cursor type is not supported: "+o+" given."),!1;if(this._sock.rQwait("VMware cursor alpha encoding",i*r*4,2))return!1;s=new Array(i*r*4);for(var v=0;v<i*r;v++){var m=this._sock.rQshift32();s[4*v]=m>>24&255,s[4*v+1]=m>>16&255,s[4*v+2]=m>>8&255,s[4*v+3]=255&m}}return this._updateCursor(s,e,t,i,r),!0}},{key:"_handleCursor",value:function(){var e=this._FBU.x,t=this._FBU.y,i=this._FBU.width,r=this._FBU.height,n=i*r*4,s=Math.ceil(i/8)*r,o=n+s;if(this._sock.rQwait("cursor encoding",o))return!1;for(var a=this._sock.rQshiftBytes(n),l=this._sock.rQshiftBytes(s),c=new Uint8Array(i*r*4),u=0,h=0;h<r;h++)for(var d=0;d<i;d++){var f=l[h*Math.ceil(i/8)+Math.floor(d/8)]<<d%8&128?255:0;c[u]=a[u+2],c[u+1]=a[u+1],c[u+2]=a[u],c[u+3]=f,u+=4}return this._updateCursor(c,e,t,i,r),!0}},{key:"_handleDesktopName",value:function(){if(this._sock.rQwait("DesktopName",4))return!1;var e=this._sock.rQshift32();if(this._sock.rQwait("DesktopName",e,4))return!1;var t=this._sock.rQshiftStr(e);return t=(0,s.decodeUTF8)(t,!0),this._setDesktopName(t),!0}},{key:"_handleExtendedDesktopSize",value:function(){if(this._sock.rQwait("ExtendedDesktopSize",4))return!1;var e=this._sock.rQpeek8(),t=4+16*e;if(this._sock.rQwait("ExtendedDesktopSize",t))return!1;var i=!this._supportsSetDesktopSize;this._supportsSetDesktopSize=!0,i&&this._requestRemoteResize(),this._sock.rQskipBytes(1),this._sock.rQskipBytes(3);for(var r=0;r<e;r+=1)0===r?(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(1===this._FBU.x&&0!==this._FBU.y){var s="";switch(this._FBU.y){case 1:s="Resize is administratively prohibited";break;case 2:s="Out of resources";break;case 3:s="Invalid screen layout";break;default:s="Unknown reason"}n.Warn("Server did not accept the resize request: "+s)}else this._resize(this._FBU.width,this._FBU.height);return!0}},{key:"_handleDataRect",value:function(){var e=this._decoders[this._FBU.encoding];if(!e)return this._fail("Unsupported encoding (encoding: "+this._FBU.encoding+")"),!1;try{return e.decodeRect(this._FBU.x,this._FBU.y,this._FBU.width,this._FBU.height,this._sock,this._display,this._fbDepth)}catch(e){return this._fail("Error decoding rect: "+e),!1}}},{key:"_updateContinuousUpdates",value:function(){this._enabledContinuousUpdates&&T.messages.enableContinuousUpdates(this._sock,!0,0,0,this._fbWidth,this._fbHeight)}},{key:"_resize",value:function(e,t){this._fbWidth=e,this._fbHeight=t,this._display.resize(this._fbWidth,this._fbHeight),this._updateClip(),this._updateScale(),this._updateContinuousUpdates()}},{key:"_xvpOp",value:function(e,t){this._rfbXvpVer<e||(n.Info("Sending XVP operation "+t+" (version "+e+")"),T.messages.xvpOp(this._sock,e,t))}},{key:"_updateCursor",value:function(e,t,i,r,n){this._cursorImage={rgbaPixels:e,hotx:t,hoty:i,w:r,h:n},this._refreshCursor()}},{key:"_shouldShowDotCursor",value:function(){if(!this._showDotCursor)return!1;for(var e=3;e<this._cursorImage.rgbaPixels.length;e+=4)if(this._cursorImage.rgbaPixels[e])return!1;return!0}},{key:"_refreshCursor",value:function(){if("connecting"===this._rfbConnectionState||"connected"===this._rfbConnectionState){var e=this._shouldShowDotCursor()?T.cursors.dot:this._cursorImage;this._cursor.change(e.rgbaPixels,e.hotx,e.hoty,e.w,e.h)}}},{key:"viewOnly",get:function(){return this._viewOnly},set:function(e){this._viewOnly=e,"connecting"!==this._rfbConnectionState&&"connected"!==this._rfbConnectionState||(e?this._keyboard.ungrab():this._keyboard.grab())}},{key:"capabilities",get:function(){return this._capabilities}},{key:"touchButton",get:function(){return 0},set:function(e){n.Warn("Using old API!")}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e,this._updateClip()}},{key:"scaleViewport",get:function(){return this._scaleViewport},set:function(e){this._scaleViewport=e,e&&this._clipViewport&&this._updateClip(),this._updateScale(),!e&&this._clipViewport&&this._updateClip()}},{key:"resizeSession",get:function(){return this._resizeSession},set:function(e){this._resizeSession=e,e&&this._requestRemoteResize()}},{key:"showDotCursor",get:function(){return this._showDotCursor},set:function(e){this._showDotCursor=e,this._refreshCursor()}},{key:"background",get:function(){return this._screen.style.background},set:function(e){this._screen.style.background=e}},{key:"qualityLevel",get:function(){return this._qualityLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("qualityLevel must be an integer between 0 and 9"):this._qualityLevel!==e&&(this._qualityLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}},{key:"compressionLevel",get:function(){return this._compressionLevel},set:function(e){!Number.isInteger(e)||e<0||e>9?n.Error("compressionLevel must be an integer between 0 and 9"):this._compressionLevel!==e&&(this._compressionLevel=e,"connected"===this._rfbConnectionState&&this._sendEncodings())}}])&&R(t.prototype,i),c&&R(t,c),T}(c.default);t.default=F,F.messages={keyEvent:function(e,t,i){var r=e._sQ,n=e._sQlen;r[n]=4,r[n+1]=i,r[n+2]=0,r[n+3]=0,r[n+4]=t>>24,r[n+5]=t>>16,r[n+6]=t>>8,r[n+7]=t,e._sQlen+=8,e.flush()},QEMUExtendedKeyEvent:function(e,t,i,r){var n=e._sQ,s=e._sQlen;n[s]=255,n[s+1]=0,n[s+2]=i>>8,n[s+3]=i,n[s+4]=t>>24,n[s+5]=t>>16,n[s+6]=t>>8,n[s+7]=t;var o,a,l=(o=r,a=255&r,224==r>>8&&a<127?128|a:o);n[s+8]=l>>24,n[s+9]=l>>16,n[s+10]=l>>8,n[s+11]=l,e._sQlen+=12,e.flush()},pointerEvent:function(e,t,i,r){var n=e._sQ,s=e._sQlen;n[s]=5,n[s+1]=r,n[s+2]=t>>8,n[s+3]=t,n[s+4]=i>>8,n[s+5]=i,e._sQlen+=6,e.flush()},_buildExtendedClipboardFlags:function(e,t){for(var i=new Uint8Array(4),r=0,n=0,s=0;s<e.length;s++)n|=e[s];for(var o=0;o<t.length;o++)r|=t[o];return i[0]=n>>24,i[1]=0,i[2]=0,i[3]=r,i},extendedClipboardProvide:function(e,t,i){for(var r=new d.default,n=[],o=0;o<t.length;o++){if(1!=t[o])throw new Error("Unsupported extended clipboard format for Provide message.");i[o]=i[o].replace(/\r\n|\r|\n/gm,"\r\n");var a=(0,s.encodeUTF8)(i[o]+"\0");n.push(a.length>>24&255,a.length>>16&255,a.length>>8&255,255&a.length);for(var l=0;l<a.length;l++)n.push(a.charCodeAt(l))}var c=r.deflate(new Uint8Array(n)),u=new Uint8Array(4+c.length);u.set(F.messages._buildExtendedClipboardFlags([1<<28],t)),u.set(c,4),F.messages.clientCutText(e,u,!0)},extendedClipboardNotify:function(e,t){var i=F.messages._buildExtendedClipboardFlags([1<<27],t);F.messages.clientCutText(e,i,!0)},extendedClipboardRequest:function(e,t){var i=F.messages._buildExtendedClipboardFlags([1<<25],t);F.messages.clientCutText(e,i,!0)},extendedClipboardCaps:function(e,t,i){var r=Object.keys(i),n=new Uint8Array(4+4*r.length);r.map((function(e){return parseInt(e)})),r.sort((function(e,t){return e-t})),n.set(F.messages._buildExtendedClipboardFlags(t,[]));for(var s=4,o=0;o<r.length;o++)n[s]=i[r[o]]>>24,n[s+1]=i[r[o]]>>16,n[s+2]=i[r[o]]>>8,n[s+3]=i[r[o]]>>0,s+=4,n[3]|=1<<r[o];F.messages.clientCutText(e,n,!0)},clientCutText:function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=e._sQ,o=e._sQlen;s[o]=6,s[o+1]=0,s[o+2]=0,s[o+3]=0,i=n?(0,r.toUnsigned32bit)(-t.length):t.length,s[o+4]=i>>24,s[o+5]=i>>16,s[o+6]=i>>8,s[o+7]=i,e._sQlen+=8;for(var a=0,l=t.length;l>0;){for(var c=Math.min(l,e._sQbufferSize-e._sQlen),u=0;u<c;u++)s[e._sQlen+u]=t[a+u];e._sQlen+=c,e.flush(),l-=c,a+=c}},setDesktopSize:function(e,t,i,r,n){var s=e._sQ,o=e._sQlen;s[o]=251,s[o+1]=0,s[o+2]=t>>8,s[o+3]=t,s[o+4]=i>>8,s[o+5]=i,s[o+6]=1,s[o+7]=0,s[o+8]=r>>24,s[o+9]=r>>16,s[o+10]=r>>8,s[o+11]=r,s[o+12]=0,s[o+13]=0,s[o+14]=0,s[o+15]=0,s[o+16]=t>>8,s[o+17]=t,s[o+18]=i>>8,s[o+19]=i,s[o+20]=n>>24,s[o+21]=n>>16,s[o+22]=n>>8,s[o+23]=n,e._sQlen+=24,e.flush()},clientFence:function(e,t,i){var r=e._sQ,n=e._sQlen;r[n]=248,r[n+1]=0,r[n+2]=0,r[n+3]=0,r[n+4]=t>>24,r[n+5]=t>>16,r[n+6]=t>>8,r[n+7]=t;var s=i.length;r[n+8]=s;for(var o=0;o<s;o++)r[n+9+o]=i.charCodeAt(o);e._sQlen+=9+s,e.flush()},enableContinuousUpdates:function(e,t,i,r,n,s){var o=e._sQ,a=e._sQlen;o[a]=150,o[a+1]=t,o[a+2]=i>>8,o[a+3]=i,o[a+4]=r>>8,o[a+5]=r,o[a+6]=n>>8,o[a+7]=n,o[a+8]=s>>8,o[a+9]=s,e._sQlen+=10,e.flush()},pixelFormat:function(e,t,i){var r,n=e._sQ,s=e._sQlen;r=t>16?32:t>8?16:8;var o=Math.floor(t/3);n[s]=0,n[s+1]=0,n[s+2]=0,n[s+3]=0,n[s+4]=r,n[s+5]=t,n[s+6]=0,n[s+7]=i?1:0,n[s+8]=0,n[s+9]=(1<<o)-1,n[s+10]=0,n[s+11]=(1<<o)-1,n[s+12]=0,n[s+13]=(1<<o)-1,n[s+14]=2*o,n[s+15]=1*o,n[s+16]=0*o,n[s+17]=0,n[s+18]=0,n[s+19]=0,e._sQlen+=20,e.flush()},clientEncodings:function(e,t){var i=e._sQ,r=e._sQlen;i[r]=2,i[r+1]=0,i[r+2]=t.length>>8,i[r+3]=t.length;for(var n=r+4,s=0;s<t.length;s++){var o=t[s];i[n]=o>>24,i[n+1]=o>>16,i[n+2]=o>>8,i[n+3]=o,n+=4}e._sQlen+=n-r,e.flush()},fbUpdateRequest:function(e,t,i,r,n,s){var o=e._sQ,a=e._sQlen;void 0===i&&(i=0),void 0===r&&(r=0),o[a]=3,o[a+1]=t?1:0,o[a+2]=i>>8&255,o[a+3]=255&i,o[a+4]=r>>8&255,o[a+5]=255&r,o[a+6]=n>>8&255,o[a+7]=255&n,o[a+8]=s>>8&255,o[a+9]=255&s,e._sQlen+=10,e.flush()},xvpOp:function(e,t,i){var r=e._sQ,n=e._sQlen;r[n]=250,r[n+1]=0,r[n+2]=t,r[n+3]=i,e._sQlen+=4,e.flush()}},F.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":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};e.defineMode("xml",(function(r,n){var s,o,a=r.indentUnit,l={},c=n.htmlMode?t:i;for(var u in c)l[u]=c[u];for(var u in n)l[u]=n[u];function h(e,t){function i(i){return t.tokenize=i,i(e,t)}var r=e.next();return"<"==r?e.eat("!")?e.eat("[")?e.match("CDATA[")?i(f("atom","]]>")):null:e.match("--")?i(f("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),i(function e(t){return function(i,r){for(var n;null!=(n=i.next());){if("<"==n)return r.tokenize=e(t+1),r.tokenize(i,r);if(">"==n){if(1==t){r.tokenize=h;break}return r.tokenize=e(t-1),r.tokenize(i,r)}}return"meta"}}(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=f("meta","?>"),"meta"):(s=e.eat("/")?"closeTag":"openTag",t.tokenize=d,"tag bracket"):"&"==r?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function d(e,t){var i,r,n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=h,s=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return s="equals",null;if("<"==n){t.tokenize=h,t.state=m,t.tagName=t.tagStart=null;var o=t.tokenize(e,t);return o?o+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=(i=n,(r=function(e,t){for(;!e.eol();)if(e.next()==i){t.tokenize=d;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(e,t){return function(i,r){for(;!i.eol();){if(i.match(t)){r.tokenize=h;break}i.next()}return e}}function p(e,t,i){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=i,(l.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function g(e){e.context&&(e.context=e.context.prev)}function v(e,t){for(var i;;){if(!e.context)return;if(i=e.context.tagName,!l.contextGrabbers.hasOwnProperty(i)||!l.contextGrabbers[i].hasOwnProperty(t))return;g(e)}}function m(e,t,i){return"openTag"==e?(i.tagStart=t.column(),y):"closeTag"==e?_:m}function y(e,t,i){return"word"==e?(i.tagName=t.current(),o="tag",C):l.allowMissingTagName&&"endTag"==e?(o="tag bracket",C(e,0,i)):(o="error",y)}function _(e,t,i){if("word"==e){var r=t.current();return i.context&&i.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(i.context.tagName)&&g(i),i.context&&i.context.tagName==r||!1===l.matchClosing?(o="tag",b):(o="tag error",S)}return l.allowMissingTagName&&"endTag"==e?(o="tag bracket",b(e,0,i)):(o="error",S)}function b(e,t,i){return"endTag"!=e?(o="error",b):(g(i),m)}function S(e,t,i){return o="error",b(e,0,i)}function C(e,t,i){if("word"==e)return o="attribute",w;if("endTag"==e||"selfcloseTag"==e){var r=i.tagName,n=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?v(i,r):(v(i,r),i.context=new p(i,r,n==i.indented)),m}return o="error",C}function w(e,t,i){return"equals"==e?k:(l.allowMissing||(o="error"),C(e,0,i))}function k(e,t,i){return"string"==e?x:"word"==e&&l.allowUnquoted?(o="string",C):(o="error",C(e,0,i))}function x(e,t,i){return"string"==e?x:C(e,0,i)}return h.isInText=!0,{startState:function(e){var t={tokenize:h,state:m,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;s=null;var i=t.tokenize(e,t);return(i||s)&&"comment"!=i&&(o=null,t.state=t.state(s||i,e,t),o&&(i="error"==o?i+" error":o)),i},indent:function(t,i,r){var n=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+a;if(n&&n.noIndent)return e.Pass;if(t.tokenize!=d&&t.tokenize!=h)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/<!\[CDATA\[/.test(i))return 0;var s=i&&/^<(\/)?([\w_:\.-]*)/.exec(i);if(s&&s[1])for(;n;){if(n.tagName==s[2]){n=n.prev;break}if(!l.implicitlyClosed.hasOwnProperty(n.tagName))break;n=n.prev}else if(s)for(;n;){var o=l.contextGrabbers[n.tagName];if(!o||!o.hasOwnProperty(s[2]))break;n=n.prev}for(;n&&n.prev&&!n.startOfLine;)n=n.prev;return n?n.indent+a:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=C)},xmlCurrentTag:function(e){return e.tagName?{name:e.tagName,close:"closeTag"==e.type}:null},xmlCurrentContext:function(e){for(var t=[],i=e.context;i;i=i.prev)i.tagName&&t.push(i.tagName);return t.reverse()}}})),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}(i(/*! ../../lib/codemirror */"VrN/"))},"1q3G":
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/zstream.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){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":
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/raw.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._lines=0}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,i,r,n,s,o){0===this._lines&&(this._lines=r);var a=i*(8==o?1:4);if(n.rQwait("RAW",a))return!1;var l=t+(r-this._lines),c=Math.min(this._lines,Math.floor(n.rQlen/a)),u=n.rQ,h=n.rQi;if(8==o){for(var d=i*c,f=new Uint8Array(4*d),p=0;p<d;p++)f[4*p+0]=255*(u[h+p]>>0&3)/3,f[4*p+1]=255*(u[h+p]>>2&3)/3,f[4*p+2]=255*(u[h+p]>>4&3)/3,f[4*p+4]=0;u=f,h=0}return s.blitImage(e,l,i,c,u,h),n.rQskipBytes(c*a),this._lines-=c,!(this._lines>0)}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=n},3690:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/hextile.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tiles=0,this._lastsubencoding=0}var t,i,r;return t=e,(i=[{key:"decodeRect",value:function(e,t,i,r,s,o,a){for(0===this._tiles&&(this._tilesX=Math.ceil(i/16),this._tilesY=Math.ceil(r/16),this._totalTiles=this._tilesX*this._tilesY,this._tiles=this._totalTiles);this._tiles>0;){var l=1;if(s.rQwait("HEXTILE",l))return!1;var c=s.rQ,u=s.rQi,h=c[u];if(h>30)throw new Error("Illegal hextile subencoding (subencoding: "+h+")");var d=this._totalTiles-this._tiles,f=e+d%this._tilesX*16,p=t+16*Math.floor(d/this._tilesX),g=Math.min(16,e+i-f),v=Math.min(16,t+r-p);if(1&h)l+=g*v*4;else if(2&h&&(l+=4),4&h&&(l+=4),8&h){if(l++,s.rQwait("HEXTILE",l))return!1;var m=c[u+l-1];l+=16&h?6*m:2*m}if(s.rQwait("HEXTILE",l))return!1;if(u++,0===h)1&this._lastsubencoding?n.Debug(" Ignoring blank after RAW"):o.fillRect(f,p,g,v,this._background);else if(1&h)o.blitImage(f,p,g,v,c,u),u+=l-1;else{if(2&h&&(this._background=[c[u],c[u+1],c[u+2],c[u+3]],u+=4),4&h&&(this._foreground=[c[u],c[u+1],c[u+2],c[u+3]],u+=4),o.startTile(f,p,g,v,this._background),8&h){var y=c[u];u++;for(var _=0;_<y;_++){var b=void 0;16&h?(b=[c[u],c[u+1],c[u+2],c[u+3]],u+=4):b=this._foreground;var S=c[u],C=S>>4,w=15&S,k=c[++u];u++;var x=1+(k>>4),E=1+(15&k);o.subTile(C,w,x,E,b)}}o.finishTile()}s.rQi=u,this._lastsubencoding=h,this._tiles--}return!0}}])&&o(t.prototype,i),r&&o(t,r),e}();t.default=a},"6BzB":
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/utils/common.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shrinkBuf=function(e,t){if(e.length===t)return e;if(e.subarray)return e.subarray(0,t);return e.length=t,e},t.arraySet=function(e,t,i,r,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(i,i+r),n);for(var s=0;s<r;s++)e[n+s]=t[i+s]},t.flattenChunks=function(e){var t,i,r,n,s,o;for(r=0,t=0,i=e.length;t<i;t++)r+=e[t].length;for(o=new Uint8Array(r),n=0,t=0,i=e.length;t<i;t++)s=e[t],o.set(s,n),n+=s.length;return o},t.Buf32=t.Buf16=t.Buf8=void 0;var r=Uint8Array;t.Buf8=r;var n=Uint16Array;t.Buf16=n;var s=Int32Array;t.Buf32=s},"6Qwc":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/vkeys.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},"7Cbv":
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),n=new Uint8Array(16);function s(){if(!r)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)}var o=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var a=function(e){return"string"==typeof e&&o.test(e)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(l[e[t+0]]+l[e[t+1]]+l[e[t+2]]+l[e[t+3]]+"-"+l[e[t+4]]+l[e[t+5]]+"-"+l[e[t+6]]+l[e[t+7]]+"-"+l[e[t+8]]+l[e[t+9]]+"-"+l[e[t+10]]+l[e[t+11]]+l[e[t+12]]+l[e[t+13]]+l[e[t+14]]+l[e[t+15]]).toLowerCase();if(!a(i))throw TypeError("Stringified UUID is invalid");return i};t.a=function(e,t,i){var r=(e=e||{}).random||(e.rng||s)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){i=i||0;for(var n=0;n<16;++n)t[i+n]=r[n];return t}return u(r)}},"7ahc":
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
|
|
|
\*************************************************************/
|
|
|
/*! exports provided: default, MyCodeMirror */
|
|
|
/*! exports used: MyCodeMirror, default */function(e,t,i){"use strict";i.d(t,"a",(function(){return v}));var r=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),n=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),s=(i(/*! antd/es/button/style */"+L6B"),i(/*! antd/es/button */"2/Rp")),o=(i(/*! antd/es/form/style */"y8nQ"),i(/*! antd/es/form */"Vl3Y")),a=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(i(/*! antd/es/select/style */"OaEy"),i(/*! antd/es/select */"2fM7")),c=i(/*! react */"q1tI"),u=i.n(c),h=i(/*! codemirror */"VrN/"),d=i.n(h),f=(i(/*! codemirror/lib/codemirror.css */"p77/"),i(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),p={labelCol:{span:4},wrapperCol:{span:20}},g={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"]};function v(e){var t=e.value,i=e.onChange,n=e.mode,s=e.options,o=void 0===s?{}:s,l=Object(c.useRef)(),h=Object(c.useState)(),f=Object(a.a)(h,2),p=f[0],g=f[1];return Object(c.useEffect)((function(){if(p){function e(e){var t=e.getValue();i&&i(t)}return p.on("change",e),function(){p.off("change",e)}}}),[p,i]),Object(c.useEffect)((function(){p&&p.setOption("mode",n)}),[p,n]),Object(c.useEffect)((function(){p&&(t===p.getValue()&&""!==t||setTimeout((function(){p.setValue(t||" ")}),300))}),[p,t]),Object(c.useEffect)((function(){if(l.current&&!p){var e=d.a.fromTextArea(l.current,Object(r.a)({mode:n,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},o));g(e)}}),[l.current,p]),u.a.createElement("div",{className:"my-codemirror-container"},u.a.createElement("textarea",{ref:l}))}t.b=function(e){var t=e.callback,i=e.onCancel,r=Object(c.useState)("python"),h=Object(a.a)(r,2),d=h[0],m=h[1];return u.a.createElement(o.a,Object(n.a)({},p,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(e){t(e)}}),u.a.createElement(o.a.Item,{label:"代码语言",name:"language"},u.a.createElement(l.a,{onChange:function(e){m(g[e][1])}},Object.keys(g).map((function(e){return u.a.createElement(f,{key:e,value:e},g[e][0])})))),u.a.createElement(o.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},u.a.createElement(v,{mode:d})),u.a.createElement("div",{className:"flex-container flex-end"},u.a.createElement(s.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),u.a.createElement(s.a,{type:"ghost",onClick:i},"取消")))}},"7ixt":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/placements.js ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: placements, default */
|
|
|
/*! exports used: placements */function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));var r={adjustX:1,adjustY:1},n=[0,0],s={left:{points:["cr","cl"],overflow:r,offset:[-4,0],targetOffset:n},right:{points:["cl","cr"],overflow:r,offset:[4,0],targetOffset:n},top:{points:["bc","tc"],overflow:r,offset:[0,-4],targetOffset:n},bottom:{points:["tc","bc"],overflow:r,offset:[0,4],targetOffset:n},topLeft:{points:["bl","tl"],overflow:r,offset:[0,-4],targetOffset:n},leftTop:{points:["tr","tl"],overflow:r,offset:[-4,0],targetOffset:n},topRight:{points:["br","tr"],overflow:r,offset:[0,-4],targetOffset:n},rightTop:{points:["tl","tr"],overflow:r,offset:[4,0],targetOffset:n},bottomRight:{points:["tr","br"],overflow:r,offset:[0,4],targetOffset:n},rightBottom:{points:["bl","br"],overflow:r,offset:[4,0],targetOffset:n},bottomLeft:{points:["tl","bl"],overflow:r,offset:[0,4],targetOffset:n},leftBottom:{points:["br","bl"],overflow:r,offset:[-4,0],targetOffset:n}}},"8+yF":
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keysymdef.js ***!
|
|
|
\**********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={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},n={lookup:function(e){if(e>=32&&e<=255)return e;var t=r[e];return void 0!==t?t:16777216|e}};t.default=n},"8CQX":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/util.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getKeycode=d,t.getKey=f,t.getKeysym=function(e){var t=f(e);if("Unidentified"===t)return null;if(t in l.default){var i=e.location;if("Meta"===t&&0===i&&(i=2),"Clear"===t&&3===i)"NumLock"===d(e)&&(i=0);if((void 0===i||i>3)&&(i=0),"Meta"===t){var r=d(e);if("AltLeft"===r)return n.default.XK_Meta_L;if("AltRight"===r)return n.default.XK_Meta_R}if("Clear"===t)if("NumLock"===d(e))return n.default.XK_Num_Lock;return l.default[t][i]}if(1!==t.length)return null;var o=t.charCodeAt();if(o)return s.default.lookup(o);return null};var n=h(i(/*! ./keysym.js */"mHUz")),s=h(i(/*! ./keysymdef.js */"8+yF")),o=h(i(/*! ./vkeys.js */"6Qwc")),a=h(i(/*! ./fixedkeys.js */"gIYZ")),l=h(i(/*! ./domkeytable.js */"mTgk")),c=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../util/browser.js */"GdRQ"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){return e&&e.__esModule?e:{default:e}}function d(e){if(e.code){switch(e.code){case"OSLeft":return"MetaLeft";case"OSRight":return"MetaRight"}return e.code}if("keypress"!==e.type&&e.keyCode in o.default){var t=o.default[e.keyCode];if(c.isMac()&&"ContextMenu"===t&&(t="MetaRight"),2===e.location)switch(t){case"ShiftLeft":return"ShiftRight";case"ControlLeft":return"ControlRight";case"AltLeft":return"AltRight"}if(3===e.location)switch(t){case"Delete":return"NumpadDecimal";case"Insert":return"Numpad0";case"End":return"Numpad1";case"ArrowDown":return"Numpad2";case"PageDown":return"Numpad3";case"ArrowLeft":return"Numpad4";case"ArrowRight":return"Numpad6";case"Home":return"Numpad7";case"ArrowUp":return"Numpad8";case"PageUp":return"Numpad9";case"Enter":return"NumpadEnter"}return t}return"Unidentified"}function f(e){if(void 0!==e.key){switch(e.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 e.char}switch(e.key){case"OS":return"Meta";case"LaunchMyComputer":return"LaunchApplication1";case"LaunchCalculator":return"LaunchApplication2"}switch(e.key){case"UIKeyInputUpArrow":return"ArrowUp";case"UIKeyInputDownArrow":return"ArrowDown";case"UIKeyInputLeftArrow":return"ArrowLeft";case"UIKeyInputRightArrow":return"ArrowRight";case"UIKeyInputEscape":return"Escape"}if("\0"===e.key&&"NumpadDecimal"===e.code)return"Delete";if(!c.isIE()&&!c.isEdge())return e.key;if(1!==e.key.length&&"Unidentified"!==e.key)return e.key}var t=d(e);return t in a.default?a.default[t]:e.charCode?String.fromCharCode(e.charCode):"Unidentified"}},"8EBN":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/meta.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){"use strict";e.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 t=0;t<e.modeInfo.length;t++){var i=e.modeInfo[t];i.mimes&&(i.mime=i.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var r=e.modeInfo[i];if(r.mime==t)return r;if(r.mimes)for(var n=0;n<r.mimes.length;n++)if(r.mimes[n]==t)return r}return/\+xml$/.test(t)?e.findModeByMIME("application/xml"):/\+json$/.test(t)?e.findModeByMIME("application/json"):void 0},e.findModeByExtension=function(t){t=t.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var r=e.modeInfo[i];if(r.ext)for(var n=0;n<r.ext.length;n++)if(r.ext[n]==t)return r}},e.findModeByFileName=function(t){for(var i=0;i<e.modeInfo.length;i++){var r=e.modeInfo[i];if(r.file&&r.file.test(t))return r}var n=t.lastIndexOf("."),s=n>-1&&t.substring(n+1,t.length);if(s)return e.findModeByExtension(s)},e.findModeByName=function(t){t=t.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var r=e.modeInfo[i];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var n=0;n<r.alias.length;n++)if(r.alias[n].toLowerCase()==t)return r}}}(i(/*! ../lib/codemirror */"VrN/"))},"8K/p":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/tight.js ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=a();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../util/logging.js */"Lo0S")),o=(n=i(/*! ../inflator.js */"ItS6"))&&n.__esModule?n:{default:n};function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ctl=null,this._filter=null,this._numColors=0,this._palette=new Uint8Array(1024),this._len=0,this._zlibs=[];for(var t=0;t<4;t++)this._zlibs[t]=new o.default}var t,i,r;return t=e,(i=[{key:"decodeRect",value:function(e,t,i,r,n,o,a){if(null===this._ctl){if(n.rQwait("TIGHT compression-control",1))return!1;this._ctl=n.rQshift8();for(var l=0;l<4;l++)this._ctl>>l&1&&(this._zlibs[l].reset(),s.Info("Reset zlib stream "+l));this._ctl=this._ctl>>4}var c;if(8===this._ctl)c=this._fillRect(e,t,i,r,n,o,a);else if(9===this._ctl)c=this._jpegRect(e,t,i,r,n,o,a);else if(10===this._ctl)c=this._pngRect(e,t,i,r,n,o,a);else{if(0!=(128&this._ctl))throw new Error("Illegal tight compression received (ctl: "+this._ctl+")");c=this._basicRect(this._ctl,e,t,i,r,n,o,a)}return c&&(this._ctl=null),c}},{key:"_fillRect",value:function(e,t,i,r,n,s,o){if(n.rQwait("TIGHT",3))return!1;var a=n.rQi,l=n.rQ;return s.fillRect(e,t,i,r,[l[a+2],l[a+1],l[a]],!1),n.rQskipBytes(3),!0}},{key:"_jpegRect",value:function(e,t,i,r,n,s,o){var a=this._readData(n);return null!==a&&(s.imageRect(e,t,i,r,"image/jpeg",a),!0)}},{key:"_pngRect",value:function(e,t,i,r,n,s,o){throw new Error("PNG received in standard Tight rect")}},{key:"_basicRect",value:function(e,t,i,r,n,s,o,a){if(null===this._filter)if(4&e){if(s.rQwait("TIGHT",1))return!1;this._filter=s.rQshift8()}else this._filter=0;var l,c=3&e;switch(this._filter){case 0:l=this._copyFilter(c,t,i,r,n,s,o,a);break;case 1:l=this._paletteFilter(c,t,i,r,n,s,o,a);break;case 2:l=this._gradientFilter(c,t,i,r,n,s,o,a);break;default:throw new Error("Illegal tight filter received (ctl: "+this._filter+")")}return l&&(this._filter=null),l}},{key:"_copyFilter",value:function(e,t,i,r,n,s,o,a){var l,c=r*n*3;if(c<12){if(s.rQwait("TIGHT",c))return!1;l=s.rQshiftBytes(c)}else{if(null===(l=this._readData(s)))return!1;this._zlibs[e].setInput(l),l=this._zlibs[e].inflate(c),this._zlibs[e].setInput(null)}return o.blitRgbImage(t,i,r,n,l,0,!1),!0}},{key:"_paletteFilter",value:function(e,t,i,r,n,s,o,a){if(0===this._numColors){if(s.rQwait("TIGHT palette",1))return!1;var l=s.rQpeek8()+1,c=3*l;if(s.rQwait("TIGHT palette",1+c))return!1;this._numColors=l,s.rQskipBytes(1),s.rQshiftTo(this._palette,c)}var u,h=this._numColors<=2?1:8,d=Math.floor((r*h+7)/8)*n;if(d<12){if(s.rQwait("TIGHT",d))return!1;u=s.rQshiftBytes(d)}else{if(null===(u=this._readData(s)))return!1;this._zlibs[e].setInput(u),u=this._zlibs[e].inflate(d),this._zlibs[e].setInput(null)}return 2==this._numColors?this._monoRect(t,i,r,n,u,this._palette,o):this._paletteRect(t,i,r,n,u,this._palette,o),this._numColors=0,!0}},{key:"_monoRect",value:function(e,t,i,r,n,s,o){for(var a=this._getScratchBuffer(i*r*4),l=Math.floor((i+7)/8),c=Math.floor(i/8),u=0;u<r;u++){var h=void 0,d=void 0,f=void 0;for(f=0;f<c;f++)for(var p=7;p>=0;p--)h=4*(u*i+8*f+7-p),d=3*(n[u*l+f]>>p&1),a[h]=s[d],a[h+1]=s[d+1],a[h+2]=s[d+2],a[h+3]=255;for(var g=7;g>=8-i%8;g--)h=4*(u*i+8*f+7-g),d=3*(n[u*l+f]>>g&1),a[h]=s[d],a[h+1]=s[d+1],a[h+2]=s[d+2],a[h+3]=255}o.blitRgbxImage(e,t,i,r,a,0,!1)}},{key:"_paletteRect",value:function(e,t,i,r,n,s,o){for(var a=this._getScratchBuffer(i*r*4),l=i*r*4,c=0,u=0;c<l;c+=4,u++){var h=3*n[u];a[c]=s[h],a[c+1]=s[h+1],a[c+2]=s[h+2],a[c+3]=255}o.blitRgbxImage(e,t,i,r,a,0,!1)}},{key:"_gradientFilter",value:function(e,t,i,r,n,s,o,a){throw new Error("Gradient filter not implemented")}},{key:"_readData",value:function(e){if(0===this._len){if(e.rQwait("TIGHT",3))return null;var t;t=e.rQshift8(),this._len=127&t,128&t&&(t=e.rQshift8(),this._len|=(127&t)<<7,128&t&&(t=e.rQshift8(),this._len|=t<<14))}if(e.rQwait("TIGHT",this._len))return null;var i=e.rQshiftBytes(this._len);return this._len=0,i}},{key:"_getScratchBuffer",value:function(e){return(!this._scratchBuffer||this._scratchBuffer.length<e)&&(this._scratchBuffer=new Uint8Array(e)),this._scratchBuffer}}])&&l(t.prototype,i),r&&l(t,r),e}();t.default=c},"8hTe":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.less?modules ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports={button:"button___1wy9m"}},"9Bee":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/RenderHtml/index.tsx + 3 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.less?modules (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/PreviewAll/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/space/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/hls.js/dist/hls.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/katex/dist/katex.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/lib/marked.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/marked/src/helpers.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";i("DYRE");var r=i("zeV3"),n=(i("+L6B"),i("2/Rp")),s=i("k1fw"),o=i("9og8"),a=i("tJVT"),l=i("WmNS"),c=i.n(l),u=i("q1tI"),h=i.n(u),d=(i("vg9a"),i("DlQD")),f=i.n(d),p=i("rUJ1");var g=[],v=["<ul>"],m=new f.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function _(){g.length=0,v=["<ul>"]}var b={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(){return function e(t,i,r,n){if(i>=t.length||t[i].level<=r)return i;var s=t[i];n.push("<li><a href='#"+s.anchor+"'>"+s.text+"</a>");var o=[];return i=e(t,++i,s.level,o),o.length>0&&(n.push("<ul>"),o.forEach((function(e){n.push(e)})),n.push("</ul>")),n.push("</li>"),i=e(t,i,r,n)}(g,0,0,v),v.push("</ul>"),v.join("")}var C={heading:function(e){var t=y.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},fences:function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],r=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var r=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:Object(a.a)(t,1)[0].length>=r.length?e.slice(r.length):e})).join("\n")}(i,t[3]||""),n=t[2]?t[2].trim():t[2];if(["latex","katex","math"].indexOf(n)>=0){var s=x(),o=r;r=s,E[s]={type:"block",expression:o}}return{type:"code",raw:i,lang:n,text:r}}}},w=/(?:\${2})([^\n`]+?)(?:\${2})/gi,k=0,x=function(){return"__special_katext_id_".concat(k++,"__")},E={};function T(){k=0,E={}}function L(e){return e=e.replace(w,(function(e,t){var i=x();return E[i]={type:"inline",expression:t},i}))}var A=m.listitem;m.listitem=function(e){return A(L(e))};var R=m.paragraph;m.paragraph=function(e){return R(L(e))};var D=m.tablecell;m.tablecell=function(e,t){return D(L(e),t)},m.code=function(e,t,i){var r=(t||"").match(/\S*/)[0];return r?["latex","katex","math"].indexOf(r)>=0?"<p class='editormd-tex'>".concat(e,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(t,'">').concat(i?e:Object(p.escape)(e,!0),"</code></pre>\n"):'<pre class="prettyprint linenums"><code>'+(i?e:Object(p.escape)(e,!0))+"</code></pre>"},m.heading=function(e,t,i){var r=this.options.headerPrefix+i.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return g.push({anchor:r,level:t,text:e}),"<h"+t+' id="'+r+'">'+e+"</h"+t+">"},f.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),f.a.use({tokenizer:C,renderer:m});var O=f.a,M=(i("SJMd"),i("ulZh")),I=i.n(M),P=i("m3rI"),F=i("Oy/b"),B=i("p5ED"),N=i("ErOA"),H=function(e,t){return(H=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function j(e,t){function i(){this.constructor=e}H(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function U(e,t,i,r){return new(i||(i=Promise))((function(n,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))}function K(e,t){var i,r,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function X(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(t=0;t<i;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,n++)r[n]=s[o];return r}var W=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var i=0,r=t;i<r.length;i++){var n=r[i],s=n[0],o=n[1];e.setAttribute(s,o)}},e.createRect=function(t,i,r){var n=document.createElementNS("http://www.w3.org/2000/svg","rect");return n.setAttribute("width",t.toString()),n.setAttribute("height",i.toString()),r&&e.setAttributes(n,r),n},e.createLine=function(t,i,r,n,s){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",t.toString()),o.setAttribute("y1",i.toString()),o.setAttribute("x2",r.toString()),o.setAttribute("y2",n.toString()),s&&e.setAttributes(o,s),o},e.createPolygon=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",t),i&&e.setAttributes(r,i),r},e.createCircle=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(t/2).toString()),r.setAttribute("r",t.toString()),i&&e.setAttributes(r,i),r},e.createEllipse=function(t,i,r){var n=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return n.setAttribute("cx",(t/2).toString()),n.setAttribute("cy",(i/2).toString()),n.setAttribute("rx",(t/2).toString()),n.setAttribute("ry",(i/2).toString()),r&&e.setAttributes(n,r),n},e.createGroup=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(i,t),i},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,i,r,n,s,o,a){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",i],["markerWidth",r.toString()],["markerHeight",n.toString()],["refX",s.toString()],["refY",o.toString()]]),l.appendChild(a),l},e.createText=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","text");return i.setAttribute("x","0"),i.setAttribute("y","0"),t&&e.setAttributes(i,t),i},e.createTSpan=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=t,i&&e.setAttributes(r,i),r},e.createImage=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(i,t),i},e.createPoint=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return i.x=e,i.y=t,i},e.createPath=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),i&&e.setAttributes(r,i),r},e}(),z=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),G=function(){function e(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return e.prototype.rasterize=function(e,t,i){var r=this;return new Promise((function(n){var s=void 0!==i?i:document.createElement("canvas");null===e&&(r.markersOnly=!0,r.naturalSize=!1);var o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("width",t.width.baseVal.valueAsString),o.setAttribute("height",t.height.baseVal.valueAsString),o.setAttribute("viewBox","0 0 "+t.viewBox.baseVal.width.toString()+" "+t.viewBox.baseVal.height.toString()),o.innerHTML=t.innerHTML,!0===r.naturalSize?(o.width.baseVal.value=e.naturalWidth,o.height.baseVal.value=e.naturalHeight):void 0!==r.width&&void 0!==r.height&&(o.width.baseVal.value=r.width,o.height.baseVal.value=r.height),s.width=o.width.baseVal.value,s.height=o.height.baseVal.value;var a=o.outerHTML,l=s.getContext("2d");!0!==r.markersOnly&&l.drawImage(e,0,0,s.width,s.height);var c=window.URL,u=new Image(s.width,s.height);u.setAttribute("crossOrigin","anonymous");var h=new Blob([a],{type:"image/svg+xml"}),d=c.createObjectURL(h);u.onload=function(){l.drawImage(u,0,0),c.revokeObjectURL(d);var e=s.toDataURL(r.imageType,r.imageQuality);n(e)},u.src=d}))},e}(),V=function(){},q=function(){function e(e){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new Q("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new Q("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new Y("fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new Y("fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),Q=function(e,t){this.selector=e,this.style=t},Y=function(e,t){this.localName=e,this.style=t},Z=function(){function e(e,t,i,r,n){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=e,this.displayMode=t,this.markerItems=i,this.uiStyleSettings=r,this.styles=n,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return e.prototype.show=function(e){var t=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var i=document.createElement("div");i.className=this.toolbarBlockStyleClass.name,i.style.whiteSpace="nowrap",this.uiContainer.appendChild(i),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(i,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach((function(e){var i=document.createElement("div");i.className=""+t.toolbarButtonStyleClass.name,i.setAttribute("data-type-name",e.typeName),i.innerHTML=e.icon,i.addEventListener("click",(function(){t.markerToolbarButtonClicked(i,e)})),t.buttons.push(i),t.markerButtons.push(i)})),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var r=document.createElement("div");r.className=this.toolbarBlockStyleClass.name,r.style.whiteSpace="nowrap",r.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(r),this.addActionButton(r,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(r,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},e.prototype.addButtonClickListener=function(e){this.buttonClickListeners.push(e)},e.prototype.removeButtonClickListener=function(e){this.buttonClickListeners.indexOf(e)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(e),1)},e.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},e.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var e=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var t=0;t<this.markerButtons.length;t++)t<e||t===e&&this.markerButtons.length-1===e?this.markerButtonBlock.appendChild(this.markerButtons[t]):(t===e&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[t]))}},e.prototype.overflowButtonClicked=function(){"none"!==this.markerButtonOverflowBlock.style.display?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},e.prototype.resetButtonStyles=function(){var e=this;this.buttons.forEach((function(t){t.className=t.className.replace(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name,"").trim(),t.className=t.className.replace(e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?e.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:e.toolbarActiveButtonStyleColorsClass.name,"").trim(),t.className+=" "+(e.uiStyleSettings.toolbarButtonStyleColorsClassName?e.uiStyleSettings.toolbarButtonStyleColorsClassName:e.toolbarButtonStyleColorsClass.name)}))},e.prototype.addActionButton=function(e,t,i){var r=this,n=document.createElement("div");switch(n.className=""+this.toolbarButtonStyleClass.name,n.innerHTML=t,n.setAttribute("data-action",i),n.addEventListener("click",(function(){r.actionToolbarButtonClicked(n,i)})),i){case"select":n.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":n.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":n.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":n.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":n.style.fill=this.uiStyleSettings.closeButtonColor}e.appendChild(n),this.buttons.push(n)},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Y("toolbar","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.uiStyleSettings.toolbarHeight+"px;\n box-sizing: content-box;\n "+("inline"===this.displayMode?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Y("toolbar_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n box-shadow: 0px 3px rgba(33, 33, 33, 0.1);\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Y("toolbar-block","\n display: inline-block;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Y("toolbar-overflow-block","\n position: absolute;\n top: "+this.uiStyleSettings.toolbarHeight+"px;\n max-width: "+2*this.uiStyleSettings.toolbarHeight+"px;\n z-index: 10;\n box-sizing: content-box;\n ")),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Y("toolbar-overflow-block_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Y("toolbar_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Y("toolbar_button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbar_active_button","\n fill: "+this.uiStyleSettings.toolbarColor+";\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Q("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Q("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n "))},e.prototype.markerToolbarButtonClicked=function(e,t){this.setActiveButton(e),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("marker",t)})),this.markerButtonOverflowBlock.style.display="none"},e.prototype.actionToolbarButtonClicked=function(e,t){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(e){return e("action",t)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},e.prototype.setActiveButton=function(e){this.resetButtonStyles(),e.className=e.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),e.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},e.prototype.setActiveMarkerButton=function(e){var t=this.markerButtons.find((function(t){return t.getAttribute("data-type-name")===e}));t&&this.setActiveButton(t)},e.prototype.setCurrentMarker=function(e){var t=this;this.currentMarker=e,this.buttons.filter((function(e){return/delete|notes/.test(e.getAttribute("data-action"))})).forEach((function(e){void 0===t.currentMarker?(e.style.fillOpacity="0.4",e.style.pointerEvents="none"):(e.style.fillOpacity="1",e.style.pointerEvents="all")}))},e}(),$=function(){function e(e,t,i,r){this.panels=[],this.panelButtons=[],this.markerjsContainer=e,this.displayMode=t,this.uiStyleSettings=i,this.styles=r,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return e.prototype.addStyles=function(){var e;this.toolboxStyleClass=this.styles.addClass(new Y("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new Y("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var t=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Y("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Y("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new Y("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Y("toolbox-panel-row_colors","\n background-color: "+(null!==(e=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==e?e:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new Y("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new Q("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new Q("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},e.prototype.show=function(e){var t;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=e,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==t?t:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},e.prototype.setPanelButtons=function(e){var t,i,r=this;this.panels=e,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(t=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==t?t:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(i=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==i?i:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(e){var t;e.uiStyleSettings=r.uiStyleSettings;var i=document.createElement("div");i.className=r.toolboxButtonStyleClass.name+" "+(null!==(t=r.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==t?t:r.toolboxButtonStyleColorsClass.name),i.innerHTML=e.icon,i.title=e.title,i.addEventListener("click",(function(){r.panelButtonClick(e)})),r.panelButtons.push(i),r.buttonRow.appendChild(i)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},e.prototype.panelButtonClick=function(e){var t=this,i=-1;if(e!==this.activePanel){i=this.panels.indexOf(e),this.panelRow.innerHTML="";var r=e.getUi();r.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(r),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=e}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===t.displayMode?t.panelRow.style.display="none":t.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(e,r){var n,s;e.className=t.toolboxButtonStyleClass.name+" "+(r===i?""+(null!==(n=t.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==n?n:t.toolboxActiveButtonStyleColorsClass.name):""+(null!==(s=t.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==s?s:t.toolboxButtonStyleColorsClass.name))}))},e}(),J=function(e,t){this.title=e,this.icon=t},ee=function(e){function t(t,i,r,n){var s=e.call(this,t,n||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return s.colors=[],s.addTransparent=!1,s.colorBoxes=[],s.colors=i,s.currentColor=r,s.setCurrentColor=s.setCurrentColor.bind(s),s.getColorBox=s.getColorBox.bind(s),s}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.whiteSpace="nowrap",this.colors.forEach((function(i){var r=e.getColorBox(i);t.appendChild(r),e.colorBoxes.push(r)})),t},t.prototype.getColorBox=function(e){var t=this,i=this.uiStyleSettings.toolbarHeight/4,r=this.uiStyleSettings.toolbarHeight-i,n=document.createElement("div");n.style.display="inline-block",n.style.boxSizing="content-box",n.style.width=r-2+"px",n.style.height=r-2+"px",n.style.padding="1px",n.style.marginRight="2px",n.style.marginBottom="2px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.borderRadius=(r+2)/2+"px",n.style.borderColor=e===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){t.setCurrentColor(e,n)}));var s=document.createElement("div");return s.style.display="inline-block",s.style.width=r-2+"px",s.style.height=r-2+"px",s.style.backgroundColor=e,s.style.borderRadius=r/2+"px","transparent"===e&&(s.style.fill=this.uiStyleSettings.toolboxAccentColor,s.innerHTML='<svg viewBox="0 0 24 24">\n <path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />\n </svg>'),n.appendChild(s),n},t.prototype.setCurrentColor=function(e,t){var i=this;this.currentColor=e,this.colorBoxes.forEach((function(e){e.style.borderColor=e===t?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(e)},t}(J),te=function(){function e(e,t,i){this._state="new",this._isSelected=!1,this._container=e,this._overlayContainer=t,this.globalSettings=i,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(e.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!1},Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),e.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},e.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},e.prototype.pointerDown=function(e,t){},e.prototype.dblClick=function(e,t){},e.prototype.manipulate=function(e){},e.prototype.pointerUp=function(e){this.stateChanged()},e.prototype.dispose=function(){},e.prototype.addMarkerVisualToContainer=function(e){this.container.childNodes.length>0?this.container.insertBefore(e,this.container.childNodes[0]):this.container.appendChild(e)},e.prototype.getState=function(){return{typeName:e.typeName,state:this.state,notes:this.notes}},e.prototype.restoreState=function(e){this._state=e.state,this.notes=e.notes},e.prototype.scale=function(e,t){},e.prototype.colorChanged=function(e){this.onColorChanged&&this.onColorChanged(e),this.stateChanged()},e.prototype.fillColorChanged=function(e){this.onFillColorChanged&&this.onFillColorChanged(e),this.stateChanged()},e.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var e=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),e.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(e)&&this.onStateChanged(this)}},e.typeName="MarkerBase",e}(),ie=function(){function e(){this.findGripByVisual=this.findGripByVisual.bind(this)}return e.prototype.findGripByVisual=function(e){return this.topLeft.ownsTarget(e)?this.topLeft:this.topCenter.ownsTarget(e)?this.topCenter:this.topRight.ownsTarget(e)?this.topRight:this.centerLeft.ownsTarget(e)?this.centerLeft:this.centerRight.ownsTarget(e)?this.centerRight:this.bottomLeft.ownsTarget(e)?this.bottomLeft:this.bottomCenter.ownsTarget(e)?this.bottomCenter:this.bottomRight.ownsTarget(e)?this.bottomRight:void 0},e}(),re=function(){function e(){this.GRIP_SIZE=10,this.visual=W.createGroup(),this.visual.appendChild(W.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(W.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e}(),ne=function(){function e(){}return e.toITransformMatrix=function(e){return{a:e.a,b:e.b,c:e.c,d:e.d,e:e.e,f:e.f}},e.toSVGMatrix=function(e,t){return e.a=t.a,e.b=t.b,e.c=t.c,e.d=t.d,e.e=t.e,e.f=t.f,e},e}(),se=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.left=0,n.top=0,n.width=0,n.height=0,n.defaultSize={x:50,y:20},n.offsetX=0,n.offsetY=0,n.rotationAngle=0,n.CB_DISTANCE=10,n._suppressMarkerCreateEvent=!1,n.container.transform.baseVal.appendItem(W.createTransform()),n.setupControlBox(),n}return j(t,e),Object.defineProperty(t.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visual",{get:function(){return this._visual},set:function(e){this._visual=e;var t=W.createTransform();this._visual.transform.baseVal.appendItem(t)},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!!(void 0!==this.controlGrips.findGripByVisual(t)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(t))},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"new"===this.state&&(this.left=t.x,this.top=t.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var r=this.unrotatePoint(t);if(this.manipulationStartX=r.x,this.manipulationStartY=r.y,this.offsetX=r.x-this.left,this.offsetY=r.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(i),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(i)){this.activeGrip=this.rotatorGrip;var n=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=n.x-this.width/2,this.top=n.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var s=this.container.transform.baseVal.getItem(0);s.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(s,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},t.prototype.pointerUp=function(t){var i=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(t),this._state="select","creating"===i&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},t.prototype.moveVisual=function(e){this.visual.style.transform="translate("+e.x+"px, "+e.y+"px)"},t.prototype.manipulate=function(e){var t=this.unrotatePoint(e);"creating"===this.state?this.resize(e):"move"===this.state?(this.left=this.manipulationStartLeft+(t.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(t.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(t):"rotate"===this.state&&this.rotate(e)},t.prototype.resize=function(e){var t=this.manipulationStartLeft,i=this.manipulationStartWidth,r=this.manipulationStartTop,n=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:t=this.manipulationStartLeft+e.x-this.manipulationStartX,i=this.manipulationStartWidth+this.manipulationStartLeft-t;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:i=this.manipulationStartWidth+e.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:r=this.manipulationStartTop+e.y-this.manipulationStartY,n=this.manipulationStartHeight+this.manipulationStartTop-r;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:n=this.manipulationStartHeight+e.y-this.manipulationStartY}i>=0?(this.left=t,this.width=i):(this.left=t+i,this.width=-i),n>=0?(this.top=r,this.height=n):(this.top=r+n,this.height=-n),this.setSize()},t.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},t.prototype.rotate=function(e){if(Math.abs(e.x-this.centerX)>.1){var t=Math.sign(e.x-this.centerX);this.rotationAngle=180*Math.atan((e.y-this.centerY)/(e.x-this.centerX))/Math.PI+90*t,this.applyRotation()}},t.prototype.applyRotation=function(){var e=this.container.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(e,0)},t.prototype.rotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM(),i=W.createPoint(e.x,e.y);return{x:(i=i.matrixTransform(t)).x,y:i.y}},t.prototype.unrotatePoint=function(e){if(0===this.rotationAngle)return e;var t=this.container.getCTM();t=t.inverse();var i=W.createPoint(e.x,e.y);return{x:(i=i.matrixTransform(t)).x,y:i.y}},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=W.createGroup();var e=W.createTransform();e.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(e),this.container.appendChild(this.controlBox),this.controlRect=W.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=W.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new ie,this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){var e=this.controlBox.transform.baseVal.getItem(0);e.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(e,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},t.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},t.prototype.createGrip=function(){var e=new re;return e.visual.transform.baseVal.appendItem(W.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.controlGrips.topLeft.GRIP_SIZE,t=-e/2,i=t,r=(this.width+this.CB_DISTANCE)/2-e/2,n=(this.height+this.CB_DISTANCE)/2-e/2,s=this.height+this.CB_DISTANCE-e/2,o=this.width+this.CB_DISTANCE-e/2;this.positionGrip(this.controlGrips.topLeft.visual,t,i),this.positionGrip(this.controlGrips.topCenter.visual,r,i),this.positionGrip(this.controlGrips.topRight.visual,o,i),this.positionGrip(this.controlGrips.centerLeft.visual,t,n),this.positionGrip(this.controlGrips.centerRight.visual,o,n),this.positionGrip(this.controlGrips.bottomLeft.visual,t,s),this.positionGrip(this.controlGrips.bottomCenter.visual,r,s),this.positionGrip(this.controlGrips.bottomRight.visual,o,s),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,r,i-3*this.CB_DISTANCE)},t.prototype.positionGrip=function(e,t,i){var r=e.transform.baseVal.getItem(0);r.setTranslate(t,i),e.transform.baseVal.replaceItem(r,0)},t.prototype.hideControlBox=function(){this.controlBox.style.display="none"},t.prototype.showControlBox=function(){this.controlBox.style.display=""},t.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:ne.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:ne.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var i=t;this.left=i.left,this.top=i.top,this.width=i.width,this.height=i.height,this.rotationAngle=i.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,i.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ne.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,i.containerTransformMatrix))},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i);var r=this.rotatePoint({x:this.left,y:this.top}),n=this.unrotatePoint({x:r.x*t,y:r.y*i});this.left=n.x,this.top=n.y,this.width=this.width*t,this.height=this.height*i,this.adjustControlBox()},t}(te),oe=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.fillColor="transparent",n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.opacity=1,n.setStrokeColor=n.setStrokeColor.bind(n),n.setFillColor=n.setFillColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.createVisual=n.createVisual.bind(n),n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=W.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&W.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){var i=t;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.setSize()},t.title="Rectangle marker",t}(se),ae=function(e){function t(t,i,r,n){var s=e.call(this,t,n||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return s.widths=[],s.widthBoxes=[],s.widths=i,s.currentWidth=r,s.setCurrentWidth=s.setCurrentWidth.bind(s),s}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.widths.forEach((function(i){var r=document.createElement("div");r.style.display="flex",r.style.flexGrow="2",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=i===e.currentWidth?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentWidth(i,r)})),t.appendChild(r);var n=document.createElement("div");n.innerText=i.toString(),n.style.marginRight="5px",r.appendChild(n);var s=document.createElement("div");s.style.minHeight="20px",s.style.flexGrow="2",s.style.display="flex",s.style.alignItems="center";var o=document.createElement("hr");o.style.minWidth="20px",o.style.border="0px",o.style.borderTop=i+"px solid "+e.uiStyleSettings.toolboxColor,o.style.flexGrow="2",s.appendChild(o),r.appendChild(s),e.widthBoxes.push(r)})),t},t.prototype.setCurrentWidth=function(e,t){var i=this;this.currentWidth=e,this.widthBoxes.forEach((function(e){e.style.borderColor=e===t?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},t}(J),le=function(e){function t(t,i,r,n){var s=e.call(this,t,n||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return s.styles=[],s.styleBoxes=[],s.styles=i,s.currentStyle=r,s.setCurrentStyle=s.setCurrentStyle.bind(s),s}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",this.styles.forEach((function(i){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/e.styles.length-5+"%",r.style.borderColor=i===e.currentStyle?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentStyle(i,r)})),t.appendChild(r);var n=document.createElement("div");n.style.minHeight="20px",n.style.flexGrow="2",n.style.overflow="hidden";var s='<svg width="100" height="20">\n <line x1="0" y1="10" x2="100" y2="10" stroke="'+e.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(""!==i?'stroke-dasharray="'+i+'"':"")+" />\n </svg>";n.innerHTML=s,r.appendChild(n),e.styleBoxes.push(r)})),t},t.prototype.setCurrentStyle=function(e,t){var i=this;this.currentStyle=e,this.styleBoxes.forEach((function(e){e.style.borderColor=e===t?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},t}(J),ce=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new ee("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ae("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return j(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=e.prototype.getState.call(this);return i.typeName=t.typeName,i},t.typeName="FrameMarker",t.title="Frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',t}(oe),ue=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},he=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.x1=0,n.y1=0,n.x2=0,n.y2=0,n.defaultLength=50,n.manipulationStartX=0,n.manipulationStartY=0,n.manipulationStartX1=0,n.manipulationStartY1=0,n.manipulationStartX2=0,n.manipulationStartY2=0,n.setupControlBox(),n}return j(t,e),t.prototype.ownsTarget=function(t){return!!e.prototype.ownsTarget.call(this,t)||!(!this.grip1.ownsTarget(t)&&!this.grip2.ownsTarget(t))},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),this.manipulationStartX=t.x,this.manipulationStartY=t.y,"new"===this.state&&(this.x1=t.x,this.y1=t.y,this.x2=t.x,this.y2=t.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(i)?this.activeGrip=this.grip1:this.grip2.ownsTarget(i)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},t.prototype.pointerUp=function(t){var i=this.state;e.prototype.pointerUp.call(this,t),"creating"===this.state&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(t),this._state="select","creating"===i&&this.onMarkerCreated&&this.onMarkerCreated(this)},t.prototype.adjustVisual=function(){},t.prototype.manipulate=function(e){"creating"===this.state?this.resize(e):"move"===this.state?(this.x1=this.manipulationStartX1+e.x-this.manipulationStartX,this.y1=this.manipulationStartY1+e.y-this.manipulationStartY,this.x2=this.manipulationStartX2+e.x-this.manipulationStartX,this.y2=this.manipulationStartY2+e.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(e)},t.prototype.resize=function(e){switch(this.activeGrip){case this.grip1:this.x1=e.x,this.y1=e.y;break;case this.grip2:case void 0:this.x2=e.x,this.y2=e.y}this.adjustVisual(),this.adjustControlBox()},t.prototype.select=function(){e.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},t.prototype.deselect=function(){e.prototype.deselect.call(this),this.controlBox.style.display="none"},t.prototype.setupControlBox=function(){this.controlBox=W.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},t.prototype.adjustControlBox=function(){this.positionGrips()},t.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},t.prototype.createGrip=function(){var e=new re;return e.visual.transform.baseVal.appendItem(W.createTransform()),this.controlBox.appendChild(e.visual),e},t.prototype.positionGrips=function(){var e=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-e/2,this.y1-e/2),this.positionGrip(this.grip2.visual,this.x2-e/2,this.y2-e/2)},t.prototype.positionGrip=function(e,t,i){var r=e.transform.baseVal.getItem(0);r.setTranslate(t,i),e.transform.baseVal.replaceItem(r,0)},t.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},e.prototype.getState.call(this))},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var i=t;this.x1=i.x1,this.y1=i.y1,this.x2=i.x2,this.y2=i.y2},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.x1=this.x1*t,this.y1=this.y1*i,this.x2=this.x2*t,this.y2=this.y2*i,this.adjustVisual(),this.adjustControlBox()},t}(te),de=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.setStrokeColor=n.setStrokeColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new ee("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ae("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorLine&&t!==this.visibleLine)},t.prototype.createVisual=function(){this.visual=W.createGroup(),this.selectorLine=W.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=W.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},t.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),W.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var i=t;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.createVisual(),this.adjustVisual()},t.typeName="LineMarker",t.title="Line marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',t}(he),fe=function(e){function t(t,i,r,n){var s=e.call(this,t,n||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return s.fonts=[],s.fontBoxes=[],s.fonts=i,s.currentFont=r,s.setCurrentFont=s.setCurrentFont.bind(s),s}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.overflow="hidden",t.style.flexGrow="2",this.fonts.forEach((function(i){var r=document.createElement("div");r.style.display="inline-block",r.style.alignItems="center",r.style.justifyContent="space-between",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.overflow="hidden",r.style.maxWidth=100/e.fonts.length-5+"%",r.style.borderColor=i===e.currentFont?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentFont(i,r)})),t.appendChild(r);var n=document.createElement("div");n.style.display="flex",n.style.minHeight="20px",n.style.flexGrow="2",n.style.fontFamily=i,n.style.overflow="hidden";var s=document.createElement("div");s.style.whiteSpace="nowrap",s.style.overflow="hidden",s.style.textOverflow="ellipsis",s.innerHTML="The quick brown fox jumps over the lazy dog",n.appendChild(s),r.appendChild(n),e.fontBoxes.push(r)})),t},t.prototype.setCurrentFont=function(e,t){var i=this;this.currentFont=e,this.fontBoxes.forEach((function(e){e.style.borderColor=e===t?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},t}(J),pe=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.color="transparent",n.padding=5,n.DEFAULT_TEXT="your text here",n.text=n.DEFAULT_TEXT,n.isMoved=!1,n.color=r.defaultColor,n.fontFamily=r.defaultFontFamily,n.defaultSize={x:100,y:30},n.setColor=n.setColor.bind(n),n.setFont=n.setFont.bind(n),n.renderText=n.renderText.bind(n),n.sizeText=n.sizeText.bind(n),n.textEditDivClicked=n.textEditDivClicked.bind(n),n.showTextEditor=n.showTextEditor.bind(n),n.setSize=n.setSize.bind(n),n.positionTextEditor=n.positionTextEditor.bind(n),n.colorPanel=new ee("Color",r.defaultColorSet,r.defaultColor),n.colorPanel.onColorChanged=n.setColor,n.fontFamilyPanel=new fe("Font",r.defaultFontFamilies,r.defaultFontFamily),n.fontFamilyPanel.onFontChanged=n.setFont,n}return j(t,e),t.prototype.ownsTarget=function(t){if(e.prototype.ownsTarget.call(this,t)||t===this.visual||t===this.textElement||t===this.bgRectangle)return!0;var i=!1;return this.textElement.childNodes.forEach((function(e){e===t&&(i=!0)})),i},t.prototype.createVisual=function(){this.visual=W.createGroup(),this.bgRectangle=W.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=W.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(W.createTransform()),this.textElement.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),this.isMoved=!1,this.pointerDownPoint=t,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.renderText=function(){var e=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach((function(t){e.textElement.appendChild(W.createTSpan(""===t.trim()?" ":t.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},t.prototype.getTextScale=function(){var e=this.textElement.getBBox(),t=1;if(e.width>0&&e.height>0){var i=(1*this.width-this.width*this.padding*2/100)/e.width,r=(1*this.height-this.height*this.padding*2/100)/e.height;t=Math.min(i,r)}return t},t.prototype.getTextPosition=function(e){var t=this.textElement.getBBox(),i=0,r=0;return t.width>0&&t.height>0&&(i=(this.width-t.width*e)/2,r=this.height/2-t.height*e/2),{x:i,y:r}},t.prototype.sizeText=function(){var e=this.textElement.getBBox(),t=this.getTextScale(),i=this.getTextPosition(t);i.y-=e.y*t,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+i.x+"px, "+i.y+"px) scale("+t+", "+t+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(i.x,i.y),this.textElement.transform.baseVal.getItem(1).setScale(t,t))},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(t.x-this.pointerDownPoint.x)>5||Math.abs(t.y-this.pointerDownPoint.y)>5)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.isMoved=!0,this.setSize(),this.sizeText()},t.prototype.setSize=function(){e.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},t.prototype.pointerUp=function(t){var i=this.state;"creating"===i&&(this._suppressMarkerCreateEvent=!0),e.prototype.pointerUp.call(this,t),this.setSize(),("creating"===i||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},t.prototype.showTextEditor=function(){var e=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",(function(e){e.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var t=Number.parseFloat(e.textEditor.style.fontSize);e.textEditor.clientWidth>=Number.parseInt(e.textEditor.style.maxWidth)&&t>.9;)t-=.1,e.textEditor.style.fontSize=Math.max(t,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(e){e.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(e){if(e.clipboardData){var t=e.clipboardData.getData("text"),i=window.getSelection();if(!i.rangeCount)return!1;i.deleteFromDocument(),i.getRangeAt(0).insertNode(document.createTextNode(t)),e.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){e.textEditDivClicked(e.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},t.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var e=this.getTextScale(),t=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),i=this.textElement.getBBox(),r={x:i.width*e,y:i.height*e};t.x-=r.x/2,t.y-=r.y/2,this.textEditor.style.top=t.y+"px",this.textEditor.style.left=t.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-t.x+"px",this.textEditor.style.fontSize=Math.max(16*e,12)+"px",this.textElement.style.display="none"}},t.prototype.textEditDivClicked=function(e){this.text=e.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},t.prototype.select=function(){e.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},t.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),e.prototype.deselect.call(this)},t.prototype.dblClick=function(t,i){e.prototype.dblClick.call(this,t,i),this.showTextEditor()},t.prototype.setColor=function(e){this.textElement&&W.setAttributes(this.textElement,[["fill",e]]),this.color=e,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(e)},t.prototype.setFont=function(e){this.textElement&&W.setAttributes(this.textElement,[["font-family",e]]),this.fontFamily=e,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},t.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},t.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){var i=t;this.color=i.color,this.fontFamily=i.fontFamily,this.padding=i.padding,this.text=i.text,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.setSize(),this.sizeText(),this.positionTextEditor()},t.typeName="TextMarker",t.title="Text marker",t.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',t}(se),ge=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.color="transparent",n.lineWidth=3,n.drawing=!1,n.pixelRatio=1,n.color=r.defaultColor,n.lineWidth=r.defaultStrokeWidth,n.pixelRatio=r.freehandPixelRatio,n.setColor=n.setColor.bind(n),n.addCanvas=n.addCanvas.bind(n),n.finishCreation=n.finishCreation.bind(n),n.setLineWidth=n.setLineWidth.bind(n),n.colorPanel=new ee("Color",r.defaultColorSet,r.defaultColor),n.colorPanel.onColorChanged=n.setColor,n.lineWidthPanel=new ae("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.lineWidthPanel.onWidthChanged=n.setLineWidth,n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.drawingImage)},t.prototype.createVisual=function(){this.visual=W.createGroup(),this.drawingImage=W.createImage(),this.visual.appendChild(this.drawingImage);var e=W.createTransform();this.visual.transform.baseVal.appendItem(e),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,i){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(t.x,t.y),this.drawing=!0):e.prototype.pointerDown.call(this,t,i)},t.prototype.manipulate=function(t){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(t.x,t.y),this.canvasContext.stroke()):e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),W.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},t.prototype.pointerUp=function(t){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):e.prototype.pointerUp.call(this,t)},t.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},t.prototype.select=function(){"creating"===this.state&&this.finishCreation(),e.prototype.select.call(this)},t.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),e.prototype.deselect.call(this)},t.prototype.finishCreation=function(){for(var e=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),t=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],i=t[0],r=t[1],n=t[2],s=t[3],o=!1,a=0;a<this.canvasElement.height;a++)for(var l=0;l<this.canvasElement.width;l++)e.data[a*this.canvasElement.width*4+4*l+3]>0&&(o=!0,a<r&&(r=a),l<i&&(i=l),a>s&&(s=a),l>n&&(n=l));if(o){this.left=i/this.pixelRatio,this.top=r/this.pixelRatio,this.width=(n-i)/this.pixelRatio,this.height=(s-r)/this.pixelRatio;var c=document.createElement("canvas");c.width=n-i,c.height=s-r,c.getContext("2d").putImageData(this.canvasContext.getImageData(i,r,n-i,s-r),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},t.prototype.setDrawingImage=function(){W.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),W.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},t.prototype.setColor=function(e){this.color=e,this.colorChanged(e)},t.prototype.setLineWidth=function(e){this.lineWidth=e},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({drawingImgUrl:this.drawingImgUrl},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){this.createVisual(),e.prototype.restoreState.call(this,t),this.drawingImgUrl=t.drawingImgUrl,this.setDrawingImage()},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.setDrawingImage()},t.typeName="FreehandMarker",t.title="Freehand marker",t.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',t}(se),ve=function(e){function t(t,i,r){var n=e.call(this,t,r||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return n.typeBoxes=[],n.currentType=i,n.setCurrentType=n.setCurrentType.bind(n),n}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2";for(var i=function(i){var n="both";switch(i){case 0:n="both";break;case 1:n="start";break;case 2:n="end";break;case 3:n="none"}var s=document.createElement("div");if(s.style.display="flex",s.style.flexGrow="2",s.style.alignItems="center",s.style.justifyContent="space-between",s.style.padding="5px",s.style.borderWidth="2px",s.style.borderStyle="solid",s.style.borderColor=n===r.currentType?r.uiStyleSettings.toolboxAccentColor:"transparent",s.addEventListener("click",(function(){e.setCurrentType(n,s)})),t.appendChild(s),"both"===n||"start"===n){var o=document.createElement("div");o.style.display="flex",o.style.alignItems="center",o.style.minHeight="20px",o.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,5 10,0 10,10" fill="'+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',o.style.marginLeft="5px",s.appendChild(o)}var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",a.appendChild(l),s.appendChild(a),"both"===n||"end"===n){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">\n <polygon points="0,0 10,5 0,10" fill="'+(void 0!==r.uiStyleSettings?r.uiStyleSettings.toolboxColor:"#eeeeee")+'" />\n </svg>',c.style.marginRight="5px",s.appendChild(c)}r.typeBoxes.push(s)},r=this,n=0;n<4;n++)i(n);return t},t.prototype.setCurrentType=function(e,t){var i=this;this.currentType=e,this.typeBoxes.forEach((function(e){e.style.borderColor=e===t?void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},t}(J),me=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.arrowType="end",n.arrowBaseHeight=10,n.arrowBaseWidth=10,n.getArrowPoints=n.getArrowPoints.bind(n),n.setArrowType=n.setArrowType.bind(n),n.arrowTypePanel=new ve("Arrow type","end"),n.arrowTypePanel.onArrowTypeChanged=n.setArrowType,n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.arrow1&&t!==this.arrow2)},t.prototype.getArrowPoints=function(e,t){var i=this.arrowBaseWidth+2*this.strokeWidth,r=this.arrowBaseHeight+2*this.strokeWidth;return e-i/2+","+(t+r/2)+" "+e+","+(t-r/2)+" "+(e+i/2)+","+(t+r/2)},t.prototype.createTips=function(){this.arrow1=W.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=W.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.arrow2)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",W.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),W.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.arrow1.transform.baseVal.getItem(0);i.setRotate(t,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(i,0);var r=this.arrow2.transform.baseVal.getItem(0);r.setRotate(t+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(r,0)}},t.prototype.setArrowType=function(e){this.arrowType=e,this.adjustVisual(),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({arrowType:this.arrowType},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var i=t;this.arrowType=i.arrowType,this.createTips(),this.adjustVisual()},t.typeName="ArrowMarker",t.title="Arrow marker",t.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',t}(de),ye=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.fillColor=r.defaultFillColor,n.strokeWidth=0,n.fillPanel=new ee("Color",r.defaultColorSet,r.defaultFillColor),n.fillPanel.onColorChanged=n.setFillColor,n}return j(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=e.prototype.getState.call(this);return i.typeName=t.typeName,i},t.typeName="CoverMarker",t.title="Cover marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',t}(oe),_e=function(e){function t(t,i,r,n){var s=e.call(this,t,n||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return s.opacities=[],s.opacityBoxes=[],s.opacities=i,s.currentOpacity=r,s.setCurrentOpacity=s.setCurrentOpacity.bind(s),s}return j(t,e),t.prototype.getUi=function(){var e=this,t=document.createElement("div");return t.style.display="flex",t.style.overflow="hidden",t.style.flexGrow="2",t.style.justifyContent="space-between",this.opacities.forEach((function(i){var r=document.createElement("div");r.style.display="flex",r.style.alignItems="center",r.style.justifyContent="center",r.style.padding="5px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderColor=i===e.currentOpacity?e.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentOpacity(i,r)})),t.appendChild(r);var n=document.createElement("div");n.innerText=100*i+"%",r.appendChild(n),e.opacityBoxes.push(r)})),t},t.prototype.setCurrentOpacity=function(e,t){var i=this;this.currentOpacity=e,this.opacityBoxes.forEach((function(e){e.style.borderColor=e===t?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},t}(J),be=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.setOpacity=n.setOpacity.bind(n),n.fillColor=r.defaultHighlightColor,n.strokeWidth=0,n.opacity=r.defaultHighlightOpacity,n.fillPanel=new ee("Color",r.defaultColorSet,n.fillColor),n.fillPanel.onColorChanged=n.setFillColor,n.opacityPanel=new _e("Opacity",r.defaultOpacitySteps,n.opacity),n.opacityPanel.onOpacityChanged=n.setOpacity,n}return j(t,e),t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&W.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=e.prototype.getState.call(this);return i.typeName=t.typeName,i},t.typeName="HighlightMarker",t.title="Highlight marker",t.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',t}(ye),Se='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Ce=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.bgColor="transparent",n.tipPosition={x:0,y:0},n.tipBase1Position={x:0,y:0},n.tipBase2Position={x:0,y:0},n.tipMoving=!1,n.color=r.defaultStrokeColor,n.bgColor=r.defaultFillColor,n.fontFamily=r.defaultFontFamily,n.defaultSize={x:100,y:30},n.setBgColor=n.setBgColor.bind(n),n.getTipPoints=n.getTipPoints.bind(n),n.positionTip=n.positionTip.bind(n),n.setTipPoints=n.setTipPoints.bind(n),n.colorPanel=new ee("Text color",r.defaultColorSet,n.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),n.colorPanel.onColorChanged=n.setColor,n.bgColorPanel=new ee("Fill color",r.defaultColorSet,n.bgColor,Se),n.bgColorPanel.onColorChanged=n.setBgColor,n.fontFamilyPanel=new fe("Font",r.defaultFontFamilies,r.defaultFontFamily),n.fontFamilyPanel.onFontChanged=n.setFont,n.tipGrip=new re,n.tipGrip.visual.transform.baseVal.appendItem(W.createTransform()),n.controlBox.appendChild(n.tipGrip.visual),n}return j(t,e),t.prototype.ownsTarget=function(t){return e.prototype.ownsTarget.call(this,t)||this.tipGrip.ownsTarget(t)||this.tip===t},t.prototype.createTip=function(){W.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=W.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},t.prototype.pointerDown=function(t,i){"new"===this.state&&e.prototype.pointerDown.call(this,t,i),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(i)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):e.prototype.pointerDown.call(this,t,i)},t.prototype.pointerUp=function(t){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,e.prototype.pointerUp.call(this,t);else{var i="creating"===this.state;e.prototype.pointerUp.call(this,t),this.setTipPoints(i),this.positionTip()}},t.prototype.manipulate=function(t){if(this.tipMoving){var i=this.unrotatePoint(t);this.tipPosition={x:i.x-this.manipulationStartLeft,y:i.y-this.manipulationStartTop},this.positionTip()}else e.prototype.manipulate.call(this,t)},t.prototype.setBgColor=function(e){this.bgRectangle&&this.tip&&(W.setAttributes(this.bgRectangle,[["fill",e]]),W.setAttributes(this.tip,[["fill",e]])),this.bgColor=e,this.fillColorChanged(e)},t.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},t.prototype.setTipPoints=function(e){void 0===e&&(e=!1);var t=Math.min(this.height/2,15),i=this.height/5;e&&(this.tipPosition={x:t+i/2,y:this.height+20});var r=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?r<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(i=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:0},this.tipBase2Position={x:t+i,y:0}):(this.tipBase1Position={x:0,y:t},this.tipBase2Position={x:0,y:t+i}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?r<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(i=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-i,y:0},this.tipBase2Position={x:this.width-t,y:0}):(this.tipBase1Position={x:this.width,y:t},this.tipBase2Position={x:this.width,y:t+i}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?r<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(i=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-t-i,y:this.height},this.tipBase2Position={x:this.width-t,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-t-i},this.tipBase2Position={x:this.width,y:this.height-t}):r<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(i=this.width/5,t=Math.min(this.width/2,15),this.tipBase1Position={x:t,y:this.height},this.tipBase2Position={x:t+i,y:this.height}):(this.tipBase1Position={x:0,y:this.height-t},this.tipBase2Position={x:0,y:this.height-t-i})},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.positionTip()},t.prototype.positionTip=function(){W.setAttributes(this.tip,[["points",this.getTipPoints()]]);var e=this.tipGrip.visual.transform.baseVal.getItem(0);e.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(e,0)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.positionTip(),e.prototype.select.call(this)},t.prototype.getState=function(){var i=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){var i=t;this.bgColor=i.bgColor,this.tipPosition=i.tipPosition,e.prototype.restoreState.call(this,t),this.createTip(),this.setTipPoints()},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.tipPosition={x:this.tipPosition.x*t,y:this.tipPosition.y*i},this.positionTip()},t.typeName="CalloutMarker",t.title="Callout marker",t.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',t}(pe),we=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.fillColor="transparent",n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.opacity=1,n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.fillColor=r.defaultFillColor,n.setStrokeColor=n.setStrokeColor.bind(n),n.setFillColor=n.setFillColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.setOpacity=n.setOpacity.bind(n),n.createVisual=n.createVisual.bind(n),n.strokePanel=new ee("Line color",X(r.defaultColorSet,["transparent"]),r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.fillPanel=new ee("Fill color",X(r.defaultColorSet,["transparent"]),n.fillColor,Se),n.fillPanel.onColorChanged=n.setFillColor,n.strokeWidthPanel=new ae("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n.opacityPanel=new _e("Opacity",r.defaultOpacitySteps,n.opacity),n.opacityPanel.onOpacityChanged=n.setOpacity,n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual)},t.prototype.createVisual=function(){this.visual=W.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"new"===this.state&&(this.createVisual(),this.moveVisual(t),this._state="creating")},t.prototype.manipulate=function(t){e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){e.prototype.resize.call(this,t),this.setSize()},t.prototype.setSize=function(){e.prototype.setSize.call(this),W.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},t.prototype.pointerUp=function(t){e.prototype.pointerUp.call(this,t),this.setSize()},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.visual&&W.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(e),this.stateChanged()},t.prototype.setFillColor=function(e){this.fillColor=e,this.visual&&W.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(e),this.stateChanged()},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.visual&&W.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.visual&&W.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},t.prototype.setOpacity=function(e){this.opacity=e,this.visual&&W.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){var i=t;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),e.prototype.restoreState.call(this,t),this.setSize()},t.prototype.scale=function(t,i){e.prototype.scale.call(this,t,i),this.setSize()},t.typeName="EllipseMarker",t.title="Ellipse marker",t.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',t}(se),ke=function(e){function t(t,i,r){return e.call(this,t,i,r)||this}return j(t,e),Object.defineProperty(t.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.tip1&&t!==this.tip2)},t.prototype.createTips=function(){this.tip1=W.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.tip1),this.tip2=W.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(W.createTransform()),this.visual.appendChild(this.tip2)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),"creating"===this.state&&this.createTips()},t.prototype.adjustVisual=function(){if(e.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(W.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var t=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.tip1.transform.baseVal.getItem(0);i.setRotate(t,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(i,0);var r=this.tip2.transform.baseVal.getItem(0);r.setRotate(t+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(r,0)}},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=e.prototype.getState.call(this);return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t),this.createTips(),this.adjustVisual()},t.typeName="MeasurementMarker",t.title="Measurement marker",t.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',t}(de),xe=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.strokePanel.colors=r.defaultColorSet,n.fillColor="transparent",n}return j(t,e),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=e.prototype.getState.call(this);return i.typeName=t.typeName,i},t.typeName="EllipseFrameMarker",t.title="Ellipse frame marker",t.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',t}(we),Ee=function(){function e(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),e.prototype.addUndoStep=function(e){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(e)||(this.undoStack.push(e),JSON.stringify(this.lastRedoStep)!==JSON.stringify(e)&&this.redoStack.splice(0,this.redoStack.length))},e.prototype.replaceLastUndoStep=function(e){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=e)},e.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},e.prototype.undo=function(){if(this.undoStack.length>1){var e=this.undoStack.pop();return void 0!==e&&this.redoStack.push(e),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},e.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},e}(),Te=function(e){function t(t,i,r){var n=e.call(this,t,i,r)||this;return n.strokeColor="transparent",n.strokeWidth=0,n.strokeDasharray="",n.curveX=0,n.curveY=0,n.manipulationStartCurveX=0,n.manipulationStartCurveY=0,n.setStrokeColor=n.setStrokeColor.bind(n),n.setStrokeWidth=n.setStrokeWidth.bind(n),n.setStrokeDasharray=n.setStrokeDasharray.bind(n),n.positionGrips=n.positionGrips.bind(n),n.addControlGrips=n.addControlGrips.bind(n),n.adjustVisual=n.adjustVisual.bind(n),n.setupControlBox=n.setupControlBox.bind(n),n.resize=n.resize.bind(n),n.strokeColor=r.defaultColor,n.strokeWidth=r.defaultStrokeWidth,n.strokeDasharray=r.defaultStrokeDasharray,n.strokePanel=new ee("Line color",r.defaultColorSet,r.defaultColor),n.strokePanel.onColorChanged=n.setStrokeColor,n.strokeWidthPanel=new ae("Line width",r.defaultStrokeWidths,r.defaultStrokeWidth),n.strokeWidthPanel.onWidthChanged=n.setStrokeWidth,n.strokeStylePanel=new le("Line style",r.defaultStrokeDasharrays,r.defaultStrokeDasharray),n.strokeStylePanel.onStyleChanged=n.setStrokeDasharray,n}return j(t,e),t.prototype.ownsTarget=function(t){return!(!e.prototype.ownsTarget.call(this,t)&&t!==this.visual&&t!==this.selectorCurve&&t!==this.visibleCurve&&!this.curveGrip.ownsTarget(t))},t.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},t.prototype.createVisual=function(){this.visual=W.createGroup(),this.selectorCurve=W.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=W.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},t.prototype.pointerDown=function(t,i){e.prototype.pointerDown.call(this,t,i),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=t.x,this.curveY=t.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(i)&&(this.activeGrip=this.curveGrip,this._state="resize")},t.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),W.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),W.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),W.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},t.prototype.setupControlBox=function(){e.prototype.setupControlBox.call(this),this.curveControlLine1=W.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=W.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},t.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,e.prototype.addControlGrips.call(this)},t.prototype.positionGrips=function(){e.prototype.positionGrips.call(this);var t=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-t/2,this.curveY-t/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},t.prototype.manipulate=function(t){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+t.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+t.y-this.manipulationStartY),e.prototype.manipulate.call(this,t)},t.prototype.resize=function(t){this.activeGrip===this.curveGrip&&(this.curveX=t.x,this.curveY=t.y),e.prototype.resize.call(this,t),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},t.prototype.setStrokeColor=function(e){this.strokeColor=e,this.adjustVisual(),this.colorChanged(e)},t.prototype.setStrokeWidth=function(e){this.strokeWidth=e,this.adjustVisual()},t.prototype.setStrokeDasharray=function(e){this.strokeDasharray=e,this.adjustVisual()},t.prototype.scale=function(t,i){this.curveX=this.curveX*t,this.curveY=this.curveY*i,e.prototype.scale.call(this,t,i)},Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),t.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},e.prototype.getState.call(this));return i.typeName=t.typeName,i},t.prototype.restoreState=function(t){e.prototype.restoreState.call(this,t);var i=t;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.curveX=i.curveX,this.curveY=i.curveY,this.createVisual(),this.adjustVisual()},t.typeName="CurveMarker",t.title="Curve marker",t.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',t}(he),Le=function(){function e(e,t){void 0===t&&(t=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=e,this.cancelable=t}return Object.defineProperty(e.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this._defaultPrevented=!0},e}(),Ae=function(e){function t(t,i,r){var n=e.call(this,t,!1)||this;return n.dataUrl=i,n.state=r,n}return j(t,e),t}(Le),Re=function(e){function t(t,i,r){void 0===r&&(r=!1);var n=e.call(this,t,r)||this;return n.marker=i,n}return j(t,e),t}(Le),De=function(){function e(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return e.prototype.addEventListener=function(e,t){this[e].push(t)},e.prototype.removeEventListener=function(e,t){var i=this[e].indexOf(t);i>-1&&this[e].splice(i,1)},e}(),Oe=function(){function e(t){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ue,this._isOpen=!1,this.undoRedoManager=new Ee,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new De,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=e.instanceCounter++,this.styles=new q(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=t,this.targetRoot=document.body,this.width=t.clientWidth,this.height=t.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(e.prototype,"ALL_MARKER_TYPES",{get:function(){return[ce,ge,me,pe,xe,we,be,Ce,ke,ye,de,Te]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ce,ge,me,pe,we,be,Ce]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ce,ge,me,pe,be]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(e){var t=this;this._availableMarkerTypes.splice(0),e.forEach((function(e){if("string"==typeof e){var i=t.ALL_MARKER_TYPES.find((function(t){return t.typeName===e}));void 0!==i&&t._availableMarkerTypes.push(i)}else t._availableMarkerTypes.push(e)}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(e){this._zoomLevel=e,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),z.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},e.prototype.show=function(){var e=this;void 0===this.styles.styleSheetRoot&&void 0!==V.styleSheetRoot&&(this.styles.styleSheetRoot=V.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(t){return t(new Le(e))}))},e.prototype.render=function(){return U(this,void 0,void 0,(function(){var e;return K(this,(function(t){switch(t.label){case 0:return this.setCurrentMarker(),(e=new G).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.markersOnly=this.renderMarkersOnly,e.width=this.renderWidth,e.height=this.renderHeight,[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return t.sent(),[4,e.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,t.sent()]}}))}))},e.prototype.close=function(e){var t=this;if(void 0===e&&(e=!1),this.isOpen){var i=!1;e||this.eventListeners.beforeclose.forEach((function(e){var r=new Le(t,!0);e(r),r.defaultPrevented&&(i=!0)})),i||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(e){return e(new Le(t))})),this.detachEvents(),this._isOpen=!1)}},e.prototype.addMarkersToToolbar=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];(e=this._availableMarkerTypes).push.apply(e,t)},e.prototype.addRenderEventListener=function(e){this.addEventListener("render",(function(t){e(t.dataUrl,t.state)}))},e.prototype.removeRenderEventListener=function(e){},e.prototype.addCloseEventListener=function(e){this.addEventListener("close",(function(){e()}))},e.prototype.removeCloseEventListener=function(e){},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.settings.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.settings.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){return e.onPopupTargetResize()})),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupTargetResize=function(){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.editorCanvas.clientWidth/e>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*e:this.editorCanvas.clientWidth,i=t<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/e;this.resize(t,i)},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.resize=function(e,t){this._isResizing=!0;var i=e/this.imageWidth,r=t/this.imageHeight;this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px","popup"!==this.settings.displayMode?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),void 0!==this.toolbar&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(i,r),this._isResizing=!1},e.prototype.scaleMarkers=function(e,t){var i,r=this;this._currentMarker&&this._currentMarker instanceof pe?this._currentMarker.scale(e,t):(i=this._currentMarker,this.setCurrentMarker()),this.markers.forEach((function(i){i!==r._currentMarker&&i.scale(e,t)})),void 0!==i&&this.setCurrentMarker(i)},e.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},e.prototype.setTopLeft=function(){var e=this.editingTarget.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left,this.top=e.top-t.top},e.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},e.prototype.addDefs=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];this.defs=W.createDefs(),this.addDefsToImage(),(e=this.defs).append.apply(e,t)},e.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},e.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},e.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},e.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},e.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},e.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},e.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},e.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var e=document.createElement("a");e.href="https://markerjs.com/",e.target="_blank",e.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',e.title="Powered by marker.js",e.style.display="grid",e.style.alignItems="center",e.style.justifyItems="center",e.style.padding="3px",e.style.width="20px",e.style.height="20px",this.logoUI.appendChild(e),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},e.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},e.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Z(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1","popup"===this.settings.displayMode&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex","popup"===this.settings.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new $(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},e.prototype.closeUI=function(){"popup"===this.settings.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.removeMarker=function(e){this.markerImage.removeChild(e.container),this.markers.indexOf(e)>-1&&this.markers.splice(this.markers.indexOf(e),1),e.dispose()},e.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},e.prototype.toolbarButtonClicked=function(e,t){if("marker"===e&&void 0!==t)this.createNewMarker(t);else if("action"===e)switch(t){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},e.prototype.deleteSelectedMarker=function(){var e=this;if(void 0!==this._currentMarker){var t=!1;if(this.eventListeners.markerbeforedelete.forEach((function(i){var r=new Re(e,e._currentMarker,!0);i(r),r.defaultPrevented&&(t=!0)})),!t){var i=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach((function(t){return t(new Re(e,i))}))}}},e.prototype.clear=function(){var e=this,t=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(i){var r=new Re(e,void 0,!0);i(r),r.defaultPrevented&&(t=!0)})),!t)){this.setCurrentMarker();for(var i=function(t){var i=r.markers[t];r.setCurrentMarker(r.markers[t]),r._currentMarker.dispose(),r.markerImage.removeChild(r._currentMarker.container),r.markers.splice(r.markers.indexOf(r._currentMarker),1),r.eventListeners.markerdelete.forEach((function(t){return t(new Re(e,i))}))},r=this,n=this.markers.length-1;n>=0;n--)i(n);this.addUndoStep()}},Object.defineProperty(e.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),e.prototype.showNotesEditor=function(){var e;void 0!==this._currentMarker&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=null!==(e=this._currentMarker.notes)&&void 0!==e?e:"",this.overlayContainer.appendChild(this.notesArea))},e.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},e.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},e.prototype.addUndoStep=function(){var e=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var t=this.getState(),i=this.undoRedoManager.getLastUndoStep();if(!i||i.width===t.width&&i.height===t.height){var r=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(t),r<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach((function(t){return t(new Le(e))}))}else this.undoRedoManager.replaceLastUndoStep(t),this.eventListeners.statechange.forEach((function(t){return t(new Le(e))}))}},e.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},e.prototype.undoStep=function(){var e=this,t=this.undoRedoManager.undo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Le(e))})))},e.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},e.prototype.redoStep=function(){var e=this,t=this.undoRedoManager.redo();void 0!==t&&(this.restoreState(t),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach((function(t){return t(new Le(e))})))},e.prototype.stepZoom=function(){var e=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=e<this.zoomSteps.length-1?this.zoomSteps[e+1]:this.zoomSteps[0]},e.prototype.panTo=function(e){this.contentDiv.scrollBy({left:this.prevPanPoint.x-e.x,top:this.prevPanPoint.y-e.y}),this.prevPanPoint=e},e.prototype.startRenderAndClose=function(){return U(this,void 0,void 0,(function(){var e,t,i=this;return K(this,(function(r){switch(r.label){case 0:return[4,this.render()];case 1:return e=r.sent(),t=this.getState(),this.eventListeners.render.forEach((function(r){return r(new Ae(i,e,t))})),this.close(!0),[2]}}))}))},e.prototype.getState=function(e){!0===e&&this.setCurrentMarker();var t={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach((function(e){return t.markers.push(e.getState())})),t},e.prototype.restoreState=function(e){var t=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);e.markers.forEach((function(e){var i=t._availableMarkerTypes.find((function(t){return t.typeName===e.typeName}));if(void 0!==i){var r=t.addNewMarker(i);r.restoreState(e),t.markers.push(r)}})),e.width&&e.height&&(e.width!==this.imageWidth||e.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/e.width,this.imageHeight/e.height),this.eventListeners.restorestate.forEach((function(e){return e(new Le(t))}))},e.prototype.addNewMarker=function(e){var t=W.createGroup();return this.markerImage.appendChild(t),new e(t,this.overlayContainer,this.settings)},e.prototype.createNewMarker=function(e){var t,i=this;(t="string"==typeof e?this._availableMarkerTypes.find((function(t){return t.typeName===e})):e)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(t),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(t.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach((function(e){return e(new Re(i,i._currentMarker))})))},e.prototype.markerCreated=function(e){var t=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(e),this.setCurrentMarker(e),e instanceof ge&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(ge):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach((function(e){return e(new Re(t,t._currentMarker))}))},e.prototype.colorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=e,this.settings.defaultStrokeColor=e)},e.prototype.fillColorChanged=function(e){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=e)},e.prototype.markerStateChanged=function(e){var t=this;this.eventListeners.markerchange.forEach((function(i){return i(new Re(t,e))}))},e.prototype.setCurrentMarker=function(e){var t=this;this._currentMarker!==e&&void 0!==this._currentMarker&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach((function(e){return e(new Re(t,t._currentMarker))}))),this._currentMarker=e,void 0===this._currentMarker||this._currentMarker.isSelected||("new"!==this._currentMarker.state&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach((function(e){return e(new Re(t,t._currentMarker))})))},e.prototype.onPointerDown=function(e){if(this._isFocused||this.focus(),this.touchPoints++,1===this.touchPoints||"touch"!==e.pointerType)if(void 0===this._currentMarker||"new"!==this._currentMarker.state&&"creating"!==this._currentMarker.state){if("select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t?(this.setCurrentMarker(t),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:e.clientX,y:e.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(e.clientX,e.clientY))},e.prototype.onDblClick=function(e){if(this._isFocused||this.focus(),"select"===this.mode){var t=this.markers.find((function(t){return t.ownsTarget(e.target)}));void 0!==t&&t!==this._currentMarker&&this.setCurrentMarker(t),void 0!==this._currentMarker?this._currentMarker.dblClick(this.clientToLocalCoordinates(e.clientX,e.clientY),e.target):this.setCurrentMarker()}},e.prototype.onPointerMove=function(e){1!==this.touchPoints&&"touch"===e.pointerType||(void 0!==this._currentMarker||this.isDragging)&&(void 0!==this._currentMarker&&"edit"===this._currentMarker.state||e.preventDefault(),void 0!==this._currentMarker?this._currentMarker.manipulate(this.clientToLocalCoordinates(e.clientX,e.clientY)):this.zoomLevel>1&&this.panTo({x:e.clientX,y:e.clientY}))},e.prototype.onPointerUp=function(e){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(e.clientX,e.clientY)),this.isDragging=!1,this.addUndoStep()},e.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},e.prototype.onKeyUp=function(e){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==e.key&&"Backspace"!==e.key||this.deleteSelectedMarker()},e.prototype.clientToLocalCoordinates=function(e,t){var i=this.markerImage.getBoundingClientRect();return{x:(e-i.left)/this.zoomLevel,y:(t-i.top)/this.zoomLevel}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var e=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},e.prototype.addLicenseKey=function(e){z.addKey(e)},e.prototype.addEventListener=function(e,t){this.eventListeners.addEventListener(e,t)},e.prototype.removeEventListener=function(e,t){this.eventListeners.removeEventListener(e,t)},e.prototype.renderState=function(e){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(e),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),e.prototype.focus=function(){var e=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(t){return t(new Le(e))})))},e.prototype.blur=function(){var e=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(t){return t(new Le(e))})))},e.instanceCounter=0,e}(),Me=function(e,t){return(Me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};
|
|
|
/* **********************************
|
|
|
cropro version 1.2.0
|
|
|
@license SEE LICENSE IN LICENSE
|
|
|
|
|
|
copyright Alan Mendelevich
|
|
|
see README and LICENSE for details
|
|
|
********************************** */
|
|
|
/*! *****************************************************************************
|
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
|
purpose with or without fee is hereby granted.
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
|
***************************************************************************** */function Ie(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}Me(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function Pe(e,t,i,r){return new(i||(i=Promise))((function(n,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))}function Fe(e,t){var i,r,n,s,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;o;)try{if(i=1,r&&(n=2&s[0]?r.return:s[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,s[1])).done)return n;switch(r=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((n=(n=o.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{i=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}var Be=function(){function e(){}return e.addKey=function(t){e.key=t},Object.defineProperty(e,"isLicensed",{get:function(){return!!e.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(e.key)},enumerable:!1,configurable:!0}),e}(),Ne=function(){function e(){}return e.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},e.setAttributes=function(e,t){for(var i=0,r=t;i<r.length;i++){var n=r[i],s=n[0],o=n[1];e.setAttribute(s,o)}},e.createRect=function(t,i,r){var n=document.createElementNS("http://www.w3.org/2000/svg","rect");return n.setAttribute("width",t.toString()),n.setAttribute("height",i.toString()),r&&e.setAttributes(n,r),n},e.createLine=function(t,i,r,n,s){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",t.toString()),o.setAttribute("y1",i.toString()),o.setAttribute("x2",r.toString()),o.setAttribute("y2",n.toString()),s&&e.setAttributes(o,s),o},e.createPolygon=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","polygon");return r.setAttribute("points",t),i&&e.setAttributes(r,i),r},e.createCircle=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","circle");return r.setAttribute("cx",(t/2).toString()),r.setAttribute("cy",(t/2).toString()),r.setAttribute("r",t.toString()),i&&e.setAttributes(r,i),r},e.createEllipse=function(t,i,r){var n=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return n.setAttribute("cx",(t/2).toString()),n.setAttribute("cy",(i/2).toString()),n.setAttribute("rx",(t/2).toString()),n.setAttribute("ry",(i/2).toString()),r&&e.setAttributes(n,r),n},e.createGroup=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","g");return t&&e.setAttributes(i,t),i},e.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},e.createMarker=function(t,i,r,n,s,o,a){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return e.setAttributes(l,[["id",t],["orient",i],["markerWidth",r.toString()],["markerHeight",n.toString()],["refX",s.toString()],["refY",o.toString()]]),l.appendChild(a),l},e.createText=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","text");return i.setAttribute("x","0"),i.setAttribute("y","0"),t&&e.setAttributes(i,t),i},e.createTSpan=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","tspan");return r.textContent=t,i&&e.setAttributes(r,i),r},e.createImage=function(t){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return t&&e.setAttributes(i,t),i},e.createPoint=function(e,t){var i=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return i.x=e,i.y=t,i},e.createPath=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg","path");return r.setAttribute("d",t),i&&e.setAttributes(r,i),r},e.createElement=function(t,i){var r=document.createElementNS("http://www.w3.org/2000/svg",t);return i&&e.setAttributes(r,i),r},e.getHollowRectanglePath=function(e,t,i,r,n,s,o,a){return"M"+e+","+t+"V"+(t+r)+"H"+(e+i)+"V"+t+"H"+n+"V"+s+"H"+(n+o)+"V"+(s+a)+"H"+n+"V"+t+"Z"},e}(),He=function(){function e(e){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+e+"_"}return Object.defineProperty(e.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),e.prototype.addClass=function(e){return void 0===this.styleSheet&&this.addStyleSheet(),e.name=""+this.classNamePrefix+e.localName,this.classes.push(e),this.styleSheet.sheet.insertRule("."+e.name+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length),e},e.prototype.addRule=function(e){void 0===this.styleSheet&&this.addStyleSheet(),this.rules.push(e),this.styleSheet.sheet.insertRule(e.selector+" {"+e.style+"}",this.styleSheet.sheet.cssRules.length)},e.prototype.addStyleSheet=function(){var e;this.styleSheet=document.createElement("style"),(null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).appendChild(this.styleSheet),this.addRule(new je("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new je("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames","\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n ")),this.addRule(new je("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames","\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n ")),this.addClass(new Ue("_fade_in","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_in_animation_frames;\n ")),this.addClass(new Ue("_fade_out","\n animation-duration: 0.3s;\n animation-name: "+this.classNamePrefix+"_fade_out_animation_frames;\n "))},e.prototype.removeStyleSheet=function(){var e;this.styleSheet&&((null!==(e=this.styleSheetRoot)&&void 0!==e?e:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},e}(),je=function(e,t){this.selector=e,this.style=t},Ue=function(e,t){this.localName=e,this.style=t},Ke=function(){function e(){this.blocks=[],this.display=""}return e.prototype.addButtonBlock=function(e){e.className=this.blockClassName,e.buttonClassName=this.buttonClassName,e.buttonColorsClassName=this.buttonColorsClassName,e.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(e)},e.prototype.addElementBlock=function(e){void 0===e.className&&(e.className=this.blockClassName),this.blocks.push(e)},e.prototype.getUI=function(){var e=document.createElement("div");return e.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,e.style.display=this.display,this.blocks.forEach((function(t){return e.appendChild(t.getUI())})),e},e}(),Xe=function(){function e(){}return e.prototype.getUI=function(){var e=document.createElement("div");if(e.className=this.className,void 0!==this.minWidth&&(e.style.minWidth=this.minWidth),void 0!==this.contentAlign)switch(this.contentAlign){case"start":e.style.justifyContent="flex-start";break;case"center":e.style.justifyContent="center";break;case"end":e.style.justifyContent="flex-end"}return e.style.whiteSpace="nowrap",e},e}(),We=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t}return Ie(t,e),t.prototype.addButton=function(e){e.className=this.buttonClassName,e.colorsClassName=this.buttonColorsClassName,e.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.buttons.forEach((function(e){return t.appendChild(e.getUI())})),t},t}(Xe),ze=function(){function e(e,t){this._isActive=!1,this._isHidden=!1,this._icon=e,this.title=t,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(e.prototype,"icon",{get:function(){return this._icon},set:function(e){this._icon=e,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isActive",{get:function(){return this._isActive},set:function(e){this._isActive=e,this.adjustClassName()},enumerable:!1,configurable:!0}),e.prototype.getUI=function(){var e=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",(function(){return e.onClick()})),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},e.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},e.prototype.hide=function(){this._isHidden=!0},e}(),Ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.elements=[],t}return Ie(t,e),t.prototype.addElement=function(e){this.elements.push(e)},t.prototype.getUI=function(){var t=e.prototype.getUI.call(this);return this.elements.forEach((function(e){return t.appendChild(e)})),t},t}(Xe),Ve=function(){function e(e,t){this.horizontal=e,this.vertical=t}return Object.defineProperty(e.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),e.prototype.getVerticalLength=function(e){return e/this.ratio},e.prototype.getHorizontalLength=function(e){return e*this.ratio},e}(),qe=function(){function e(){}return e.getIcon=function(e,t){if(e>0&&t>0){var i=new Ve(e,t),r=i.ratio>=1?20:i.getHorizontalLength(20),n=i.ratio<1?20:i.getVerticalLength(20),s=document.createElementNS("http://www.w3.org/2000/svg","svg");s.setAttribute("xmlns","http://www.w3.org/2000/svg"),s.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(s);var o=Ne.createDefs();s.appendChild(o);var a=Ne.createElement("clipPath",[["id","text-bg-clip"]]);o.appendChild(a);var l=Ne.createPath(Ne.getHollowRectanglePath((24-r)/2,(24-n)/2,r,n,(24-r)/2+2,(24-n)/2+2,r-4,n-4));s.appendChild(l);var c=Ne.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(Ne.createTSpan(e+":"+t)),s.appendChild(c);var u=c.getBBox();Ne.setAttributes(c,[["x",((24-u.width)/2).toString()],["y",((24-u.height)/2-u.y).toString()]]);var h=Ne.createPath(Ne.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(u.width))/2,(24-Math.ceil(u.height))/2,Math.ceil(u.width),Math.ceil(u.height)));return a.appendChild(h),Ne.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(s),s.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},e}(),Qe=function(e){function t(t,i,r){var n=e.call(this,t,i)||this;return n.isDropdownOpen=!1,n.onClick=n.dropdownButtonClicked,n.dropdownButtons=r,n}return Ie(t,e),t.prototype.setupDropdown=function(){var e=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(t){t.className=e.className,t.colorsClassName=e.colorsClassName,e.dropdownBlock.appendChild(t.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},t.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},t.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},t.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},t.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},t.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},t}(ze),Ye=function(){function e(e,t){this.GRIP_SIZE=10,this.color=e,this.fillColor=t,this.visual=Ne.createGroup(),this.visual.appendChild(Ne.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ne.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return e.prototype.ownsTarget=function(e){return e===this.visual||e===this.visual.childNodes[0]||e===this.visual.childNodes[1]},e.prototype.setCenter=function(e,t){this.visual.childNodes.forEach((function(i){return Ne.setAttributes(i,[["cx",e.toString()],["cy",t.toString()]])}))},e}(),Ze=function(){function e(e,t,i,r){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=e,this.canvasHeight=t,this.margin=i,this.container=r,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(e){this._aspectRatio=e,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.gridContainer&&Ne.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(e){this._zoomFactor=e,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),e.prototype.open=function(){var e=this;this.cropShadeElement=Ne.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ne.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var t=0;t<this.numberOfGridLines;t++)this.horizontalGridLines.push(Ne.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ne.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.verticalGridLines.forEach((function(t){return e.gridContainer.appendChild(t)})),this.cropRectElement=Ne.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},e.prototype.setCropRectangle=function(e){this.cropRect=e;var t=Object.assign({},this.cropRect);1!==this.zoomFactor&&(t.width=this.cropRect.width*this.zoomFactor,t.height=this.cropRect.height*this.zoomFactor,t.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-t.width/2,t.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-t.height/2),Ne.setAttributes(this.cropRectElement,[["x",t.x.toString()],["y",t.y.toString()],["width",t.width.toString()],["height",t.height.toString()]]);var i=t.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(e,r){var n=t.y+i*(r+1);Ne.setAttributes(e,[["x1",""+t.x],["y1",""+n],["x2",""+(t.x+t.width)],["y2",""+n]])}));var r=t.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(e,i){var n=t.x+r*(i+1);Ne.setAttributes(e,[["x1",""+n],["y1",""+t.y],["x2",""+n],["y2",""+(t.y+t.height)]])})),Ne.setAttributes(this.cropShadeElement,[["d",Ne.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,t.x,t.y,t.width,t.height)]]),this.topLeftGrip.setCenter(t.x,t.y),this.topRightGrip.setCenter(t.x+t.width,t.y),this.bottomLeftGrip.setCenter(t.x,t.y+t.height),this.bottomRightGrip.setCenter(t.x+t.width,t.y+t.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},e.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},e.prototype.clientToLocalCoordinates=function(e,t){var i=this.container.getBoundingClientRect();return{x:e-i.left+this.margin,y:t-i.top+this.margin}},e.prototype.onPointerDown=function(e){this.container.setPointerCapture(e.pointerId),this.previousPoint=this.clientToLocalCoordinates(e.clientX,e.clientY),this.cropRectElement===e.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(e.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(e.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(e.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(e.target)&&(this.activeGrip=this.bottomRightGrip)},e.prototype.onPointerMove=function(e){if(this.isMoving)this.move(this.clientToLocalCoordinates(e.clientX,e.clientY));else if(this.activeGrip){var t=this.clientToLocalCoordinates(e.clientX,e.clientY);this.resize(t)}e.preventDefault()},e.prototype.onPointerUp=function(e){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(e.pointerId)},e.prototype.move=function(e){var t=e.x-this.previousPoint.x,i=e.y-this.previousPoint.y;1!==this.zoomFactor&&(t=-t/this.zoomFactor,i=-i/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+t),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+i),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=e},e.prototype.resize=function(e){var t=Object.assign({},this.cropRect),i=e.x-this.previousPoint.x,r=e.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:t.x+i<this.margin&&(i=this.margin-t.x),t.x+=i,t.width=this.cropRect.x+this.cropRect.width-t.x;break;case this.bottomRightGrip:case this.topRightGrip:t.width+i>this.canvasWidth*this.zoomFactor&&(i=this.canvasWidth*this.zoomFactor-t.width),t.width+=i}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(t.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(i),t.height=this.aspectRatio.getVerticalLength(t.width)):(t.y+=r,t.height=this.cropRect.y+this.cropRect.height-t.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?t.height=this.aspectRatio.getVerticalLength(t.width):t.height+=r}t.width<10&&(t.x=this.cropRect.x,t.width=10),t.height<10&&(t.y=this.cropRect.y,t.height=10),this.previousPoint=e,t.x>=this.margin&&t.y>=this.margin&&t.x-this.margin+t.width<=this.canvasWidth&&t.y-this.margin+t.height<=this.canvasHeight&&(this.cropRect=t,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},e.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var e=this.cropRect.x+this.cropRect.width/2,t=this.cropRect.y+this.cropRect.height/2,i=this.aspectRatio.getHorizontalLength(this.cropRect.height),r=this.aspectRatio.getVerticalLength(this.cropRect.width);i/this.canvasWidth<r/this.canvasHeight?this.cropRect.width=i:this.cropRect.height=r,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=e-this.cropRect.width/2,this.cropRect.y=t-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},e.prototype.getRescaledRect=function(e,t,i,r,n,s){var o=i/e,a=r/t;return{x:(n.x-s)*o+s,y:(n.y-s)*a+s,width:n.width*o,height:n.height*a}},e.prototype.scaleCanvas=function(e,t){var i=this.getRescaledRect(this.canvasWidth,this.canvasHeight,e,t,this.cropRect,this.margin);this.canvasWidth=e,this.canvasHeight=t,this.onCropChange&&this.onCropChange(i),this.setCropRectangle(i)},e}(),$e=function(){function e(e){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=e,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(e.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),e.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},e.prototype.onPointerDown=function(e){this.controlContainer.setPointerCapture(e.pointerId),this.isDragging=!0,this.previousPoint={x:e.clientX,y:e.clientY}},e.prototype.onPointerMove=function(e){this.isDragging&&(this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.previousPoint.x=e.clientX)},e.prototype.onPointerUp=function(e){this.isDragging&&this.onAngleChange&&this.onAngleChange((e.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(e.pointerId)},e.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var e=this.angleLabelText.getBBox();Ne.setAttributes(this.angleLabelElement,[["x",((this.width-e.width)/2).toString()],["y",(this.height/2).toString()]])}},e.prototype.positionScaleShape=function(){if(this.scaleShape){var e=this.scaleShape.transform.baseVal.getItem(0);e.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(e,0)}},e.prototype.getVisual=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("width",this.width+"px"),e.setAttribute("height",this.height+"px"),e.setAttribute("viewBox","0 0 "+this.width+" "+this.height),e.style.flexShrink="0",document.body.appendChild(e);for(var t="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,i=1;i<=this.width/5+10;i++){var r=i%5==0?this.height/3:this.height/6;t+="h4v"+-r+"h1v"+r}t+="v1H0Z",this.scaleShape=Ne.createPath(t);var n=Ne.createTransform();this.scaleShape.transform.baseVal.appendItem(n),e.appendChild(this.scaleShape),this.angleLabelElement=Ne.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ne.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var s=Ne.createTSpan("");return s.innerHTML="°",this.angleLabelElement.appendChild(s),e.appendChild(this.angleLabelElement),document.body.removeChild(e),e},e}(),Je=function(){function e(){this.naturalSize=!1,this.imageType="image/png"}return e.prototype.rasterize=function(e,t,i,r,n,s,o){var a=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=e.width.baseVal.value-2*r,c.height=e.height.baseVal.value-2*r;var u=1,h=1;!0===a.naturalSize?(u=t.naturalWidth/(e.width.baseVal.value-2*r)/s,h=t.naturalHeight/(e.height.baseVal.value-2*r)/o,c.width=t.naturalWidth/s,c.height=t.naturalHeight/o):void 0!==a.width&&void 0!==a.height&&(u=a.width/i.width,h=a.height/i.height,c.width*=u,c.height*=h);var d=c.getContext("2d");d.translate(c.width/2,c.height/2),d.rotate(n*Math.PI/180),d.scale(s,o),d.translate(-c.width/2,-c.height/2),d.drawImage(t,0,0,c.width,c.height);var f=document.createElement("canvas");f.width=i.width*u,f.height=i.height*h,f.getContext("2d").putImageData(d.getImageData((i.x-r)*u,(i.y-r)*h,i.width*u,i.height*h),0,0),l(f.toDataURL(a.imageType,a.imageQuality))}))},e}(),et=function(){function e(t){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=e.instanceCounter++,this.styles=new He(this.instanceNo),this.target=t,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(e.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(e){this._zoomToCropEnabled=e,e?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(e){this._isGridVisible=e,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gridLines",{get:function(){return this._gridLines},set:function(e){this._gridLines=e,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(e){this._rotationAngle=e,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){var e;return null!==(e=this._aspectRatio)&&void 0!==e?e:this.aspectRatios[0]},set:function(e){this._aspectRatio=e},enumerable:!1,configurable:!0}),e.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},e.prototype.show=function(){this.showUI(),this.open()},e.prototype.close=function(e){void 0===e&&(e=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),e||this.closeEventListeners.forEach((function(e){return e()})),this._isOpen=!1)},e.prototype.addRenderEventListener=function(e){this.renderEventListeners.push(e)},e.prototype.removeRenderEventListener=function(e){this.renderEventListeners.indexOf(e)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(e),1)},e.prototype.addCloseEventListener=function(e){this.closeEventListeners.push(e)},e.prototype.removeCloseEventListener=function(e){this.closeEventListeners.indexOf(e)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(e),1)},e.prototype.setupResizeObserver=function(){var e=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){e.resize(e.target.clientWidth,e.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},e.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var e=1*this.target.clientWidth/this.target.clientHeight,t=this.contentDiv.clientWidth/e>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*e:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,i=t+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/e;this.resize(t,i)}},e.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},e.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Ne.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},e.prototype.resize=function(e,t){this.imageWidth=Math.round(e),this.imageHeight=Math.round(t),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px","popup"!==this.displayMode?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},e.prototype.setEditingTarget=function(){var e=document.createElement("canvas");e.width=this.target.naturalWidth,e.height=this.target.naturalHeight,e.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var t=e.toDataURL();Ne.setAttributes(this.editingTarget,[["href",t]]),this.setEditingTargetSize()},e.prototype.setTopLeft=function(){var e=this.target.getBoundingClientRect(),t=this.editorCanvas.getBoundingClientRect();this.left=e.left-t.left-this.CANVAS_MARGIN,this.top=e.top-t.top-this.CANVAS_MARGIN},e.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Ne.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ne.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ne.createGroup(),this.editingTargetRotationScaleContainer=Ne.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var e=Ne.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(e);var t=Ne.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(t),this.editingTargetContainer=Ne.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},e.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},e.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ne.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new Ze(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},e.prototype.zoomToCrop=function(){if(this.cropRect){var e=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,t=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=e+"px "+t+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-e+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-t+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},e.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},e.prototype.cropRectChanged=function(e){this.cropRect=e,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},e.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},e.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},e.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},e.prototype.showUI=function(){switch(this.addStyles(),"popup"===this.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var e=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,t=this.target.offsetTop>e+this.CANVAS_MARGIN?this.target.offsetTop-(e+this.CANVAS_MARGIN):0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=void 0!==this.styles.settings.zIndex?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=void 0!==this.styles.settings.zIndex?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin="popup"===this.displayMode?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,"popup"===this.displayMode&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex","popup"===this.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},e.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},e.prototype.addTopToolbar=function(){var e=this;this.topToolbar=new Ke,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new We;t.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(t);var i=[];this.aspectRatios.forEach((function(t){var r=new ze(qe.getIcon(t.horizontal,t.vertical),0===t.horizontal&&0===t.vertical?"FREE":t.horizontal+":"+t.vertical);r.onClick=function(){return e.ratioButtonClicked(t)},i.push(r)})),this.aspectRatioButton=new Qe(qe.getIcon(0,0),"Aspect ratio",i),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,t.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var r=new ze('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");r.isActive=this.isGridVisible,r.onClick=function(){e.isGridVisible=!e.isGridVisible,r.isActive=e.isGridVisible},t.addButton(r);var n=new ze('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(n.isActive=this.zoomToCropEnabled,n.onClick=function(){e.zoomToCropEnabled=!e.zoomToCropEnabled,n.isActive=e.zoomToCropEnabled},t.addButton(n),!Be.isLicensed){var s=new Ge;this.topToolbar.addElementBlock(s);var o=document.createElement("div");o.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var a=document.createElement("a");a.style.color="currentColor",a.href="https://markerjs.com/products/cropro",a.target="_blank",a.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',o.appendChild(a),s.addElement(o)}var l=new We;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new ze('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var u=new ze('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");u.onClick=this.close,l.addButton(u),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(u.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},e.prototype.addBottomToolbar=function(){var e=this;this.bottomToolbar=new Ke,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var t=new We;t.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(t);var i=new ze('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");i.onClick=this.rotateLeftButtonClicked,t.addButton(i);var r=new ze('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");r.onClick=this.rotateRightButtonClicked,t.addButton(r);var n=new Ge;n.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(n),this.straightener=new $e("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(t){e.rotateBy(t),e.straightener.angle=e.rotationAngle},n.addElement(this.straightener.getUI());var s=new We;s.minWidth=2*this.toolbarHeight+"px",s.contentAlign="end",this.bottomToolbar.addButtonBlock(s);var o=new ze('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");o.onClick=this.flipHorizontallyButtonClicked,s.addButton(o);var a=new ze('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");a.onClick=this.flipVerticallyButtonClicked,s.addButton(a)},e.prototype.ratioButtonClicked=function(e){this.aspectRatio=e,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},e.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=qe.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},e.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new Ve(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},e.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},e.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},e.prototype.restoreState=function(e){if(e){var t=this.cropLayer.getRescaledRect(e.width,e.height,this.imageWidth,this.imageHeight,e.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(t),this.cropRectChanged(t),this.flippedHorizontally=e.flippedHorizontally,this.flippedVertically=e.flippedVertically,this.applyFlip(),this.rotationAngle=e.rotationAngle,this.applyRotation()}},e.prototype.clientToLocalCoordinates=function(e,t){var i=this.cropImage.getBoundingClientRect();return{x:e-i.left,y:t-i.top}},e.prototype.onWindowResize=function(){this.positionUI()},e.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var e=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},e.prototype.rotateLeftButtonClicked=function(){var e=this.rotationAngle-90;this.rotationAngle%90!=0&&(e+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateRightButtonClicked=function(){var e=this.rotationAngle+90;this.rotationAngle%90!=0&&(e-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(e)},e.prototype.rotateTo=function(e){e=(e=e>180?e-360:e)<=-180?e+360:e,this.rotationAngle=e,this.applyRotation()},e.prototype.rotateBy=function(e){this.rotateTo((this.rotationAngle+e)%360)},e.prototype.applyRotation=function(){var e=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var t=this.editingTargetRotationContainer.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(t,0);var i=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/i.width,this.imageHeight/i.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=e},e.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},e.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},e.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},e.prototype.startRenderAndClose=function(){return Pe(this,void 0,void 0,(function(){var e,t;return Fe(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return e=i.sent(),t=this.getState(),this.renderEventListeners.forEach((function(i){return i(e,t)})),this.close(!0),[2]}}))}))},e.prototype.render=function(){return Pe(this,void 0,void 0,(function(){var e;return Fe(this,(function(t){switch(t.label){case 0:return(e=new Je).naturalSize=this.renderAtNaturalSize,e.imageType=this.renderImageType,e.imageQuality=this.renderImageQuality,e.width=this.renderWidth,e.height=this.renderHeight,this.unzoomFromCrop(),Ne.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return t.sent(),[4,e.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,t.sent()]}}))}))},e.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ue("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Ue("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Ue("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var e=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ue("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*e)+"px;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new je("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new je("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Ue("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ue("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ue("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ue("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ue("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},e.instanceCounter=0,e}(),tt=i("8hTe"),it=i.n(tt),rt=/<pre[^>]*>/g;t.a=function(e){var t=e.value,i=void 0===t?"":t,l=e.edit,d=void 0!==l&&l,f=e.className,p=e.showTextOnly,g=e.showLines,v=e.replaces,m=e.zoomImg,y=e.hasMask,C=e.style,w=void 0===C?{}:C,k=e.stylesPrev,x=void 0===k?{}:k,L=String(i),A=Object(u.useRef)(),R=Object(u.useRef)(),D=Object(u.useState)(""),M=Object(a.a)(D,2),H=M[0],j=M[1],U=Object(u.useState)("office"),K=Object(a.a)(U,2),X=K[0],W=K[1],z=Object(u.useMemo)((function(){try{L=(L=L.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+P.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+P.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+P.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")).replace(new RegExp("(?<!\\n)\\n(?!\\n)","g")," \n")}catch(e){}var e=O(L),t=E;if(L.match(/\[TOC\]/)&&(e=e.replace("<p>[TOC]</p>",S()),_()),e=(e=e.replace(/(__special_katext_id_\d+__)/g,(function(e,i){var r=t[i],n=r.type,s=r.expression;return Object(F.renderToString)(function(e){var t=document.createElement("div");return t.innerHTML=e,0===t.childNodes.length?"":t.childNodes[0].nodeValue}(s)||"",{displayMode:"block"===n,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),T(),p){var i=document.createElement("div");return i.innerHTML=e,i.innerText}return setTimeout((function(){return q()}),500),e}),[L]),G=Object(u.useRef)();function V(e){var t=e.target;if("IMG"===t.tagName.toUpperCase()){if(m){var i=t.getAttribute("src");j(i),W("image")}}else if("A"===t.tagName.toUpperCase()){var r=t.getAttribute("href");if(r.indexOf("office")>-1)e.preventDefault(),j(r),W("office");else if(r.indexOf("application/pdf")>-1)e.preventDefault(),j(r),W("pdf");else if(r.indexOf("type=text")>-1)e.preventDefault(),j(r),W("html");else if(r.startsWith("#")){e.preventDefault();var n=document.getElementById(r.replace("#",""));n&&n.scrollIntoView(!0)}}}b.WebkitLineClamp=g,g&&(w=Object(s.a)(Object(s.a)({},w),b));var q=function(){var e,t=null===(e=G.current)||void 0===e?void 0:e.querySelectorAll("video");null==t||t.forEach((function(e){if(e.oncontextmenu=function(){return!1},e.src.indexOf(".m3u8")>-1)if(e.canPlayType("application/vnd.apple.mpegurl"));else if(I.a.isSupported()){var t=new I.a;t.loadSource(e.src),t.attachMedia(e)}}))};Object(u.useEffect)((function(){if(G.current&&z&&z.match(rt)&&window.PR.prettyPrint(),G.current)return G.current.addEventListener("click",V),function(){G.current.removeEventListener("click",V),T(),_()}}),[z,G.current,V]);return h.a.createElement("div",{style:{position:"relative"}},h.a.createElement("div",{ref:G,style:Object(s.a)({},w),className:"".concat(f||""," markdown-body ").concat(it.a.mdBody),onMouseOver:function(e){d&&("IMG"===e.target.nodeName?(A.current.style.display="flex",A.current.style.width=e.target.clientWidth+"px",A.current.style.height=e.target.clientHeight+"px",A.current.style.top=e.target.offsetTop+"px",A.current.style.left=e.target.offsetLeft+"px",R.current.src=e.target.getAttribute("src")):A.current.style.display="none")},dangerouslySetInnerHTML:{__html:z}}),h.a.createElement("div",{ref:A,className:it.a.button},h.a.createElement(r.a,null,h.a.createElement(n.a,{onClick:function(){return(e=new et(R.current)).displayMode="popup",e.addRenderEventListener(function(){var e=Object(o.a)(c.a.mark((function e(t){var i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A.current.style.display="none",e.next=3,Object(N.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t}});case 3:null!=(i=e.sent)&&i.id&&v(R.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.content_type));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),void e.show();var e}},"裁剪"),h.a.createElement(n.a,{onClick:function(){return(e=new Oe(R.current)).settings.displayMode="popup",e.addEventListener("render",function(){var e=Object(o.a)(c.a.mark((function e(t){var i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A.current.style.display="none",!R.current){e.next=6;break}return e.next=4,Object(N.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:t.dataUrl}});case 4:null!=(i=e.sent)&&i.id&&v(R.current.getAttribute("src").replace(P.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.content_type));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),e.show(),void(window.markerArea=e);var e}},"编辑"))),h.a.createElement("img",{ref:R,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),h.a.createElement(B.a,{close:!0,data:H,hasMask:y,type:null!=H&&H.length?X:"",style:Object(s.a)({},x),onClose:function(){return j("")}}))}},"9VGf":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/components/useInterval.tsx ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i(/*! react */"q1tI");function n(e,t){var i=Object(r.useRef)();Object(r.useEffect)((function(){i.current=e})),Object(r.useEffect)((function(){if(null!==t){var e=setInterval((function(){i.current()}),t);return function(){return clearInterval(e)}}}),[t])}},BU3w:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/Dom/dynamicCSS.js ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: injectCSS, updateCSS */
|
|
|
/*! exports used: updateCSS */function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var r=i(/*! ./canUseDom */"MNnm");function n(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function s(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Object(r.a)())return null;var s,o=document.createElement("style");(null===(t=i.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(s=i.csp)||void 0===s?void 0:s.nonce);o.innerHTML=e;var a=n(i),l=a.firstChild;return i.prepend&&a.prepend?a.prepend(o):i.prepend&&l?a.insertBefore(o,l):a.appendChild(o),o}var o=new Map;function a(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n(i);if(!o.has(r)){var a=s("",i),l=a.parentNode;o.set(r,l),l.removeChild(a)}var c=Array.from(o.get(r).children).find((function(e){return"STYLE"===e.tagName&&e["rc-util-key"]===t}));if(c){var u,h,d;if((null===(u=i.csp)||void 0===u?void 0:u.nonce)&&c.nonce!==(null===(h=i.csp)||void 0===h?void 0:h.nonce))c.nonce=null===(d=i.csp)||void 0===d?void 0:d.nonce;return c.innerHTML!==e&&(c.innerHTML=e),c}var f=s(e,i);return f["rc-util-key"]=t,f}},Bd2K:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){e.defineOption("autoCloseTags",!1,(function(o,a,l){if(l!=e.Init&&l&&o.removeKeyMap("autoCloseTags"),a){var c={name:"autoCloseTags"};"object"==typeof a&&!1===a.whenClosing||(c["'/'"]=function(t){return function(t){return t.getOption("disableInput")?e.Pass:r(t,!0)}(t)}),"object"==typeof a&&!1===a.whenOpening||(c["'>'"]=function(r){return function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),a=[],l=r.getOption("autoCloseTags"),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=o[c].head,h=r.getTokenAt(u),d=e.innerMode(r.getMode(),h.state),f=d.state,p=d.mode.xmlCurrentTag&&d.mode.xmlCurrentTag(f),g=p&&p.name;if(!g)return e.Pass;var v="html"==d.mode.configuration,m="object"==typeof l&&l.dontCloseTags||v&&t,y="object"==typeof l&&l.indentTags||v&&i;h.end>u.ch&&(g=g.slice(0,g.length-h.end+u.ch));var _=g.toLowerCase();if(!g||"string"==h.type&&(h.end!=u.ch||!/[\"\']/.test(h.string.charAt(h.string.length-1))||1==h.string.length)||"tag"==h.type&&p.close||h.string.indexOf("/")==u.ch-h.start-1||m&&n(m,_)>-1||s(r,d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f)||[],g,u,!0))return e.Pass;var b="object"==typeof l&&l.emptyTags;if(b&&n(b,g)>-1)a[c]={text:"/>",newPos:e.Pos(u.line,u.ch+2)};else{var S=y&&n(y,_)>-1;a[c]={indent:S,text:">"+(S?"\n\n":"")+"</"+g+">",newPos:S?e.Pos(u.line+1,0):e.Pos(u.line,u.ch+1)}}}var C="object"==typeof l&&l.dontIndentOnAutoClose;for(c=o.length-1;c>=0;c--){var w=a[c];r.replaceRange(w.text,o[c].head,o[c].anchor,"+insert");var k=r.listSelections().slice(0);k[c]={head:w.newPos,anchor:w.newPos},r.setSelections(k),!C&&w.indent&&(r.indentLine(w.newPos.line,null,!0),r.indentLine(w.newPos.line+1,null,!0))}}(r)}),o.addKeyMap(c)}}));var t=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],i=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function r(t,i){for(var r=t.listSelections(),n=[],o=i?"/":"</",a=t.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c<r.length;c++){if(!r[c].empty())return e.Pass;var u=r[c].head,h=t.getTokenAt(u),d=e.innerMode(t.getMode(),h.state),f=d.state;if(i&&("string"==h.type||"<"!=h.string.charAt(0)||h.start!=u.ch-1))return e.Pass;var p,g="xml"!=d.mode.name&&"htmlmixed"==t.getMode().name;if(g&&"javascript"==d.mode.name)p=o+"script";else if(g&&"css"==d.mode.name)p=o+"style";else{var v=d.mode.xmlCurrentContext&&d.mode.xmlCurrentContext(f);if(!v||v.length&&s(t,v,v[v.length-1],u))return e.Pass;p=o+v[v.length-1]}">"!=t.getLine(u.line).charAt(h.end)&&(p+=">"),n[c]=p}if(t.replaceSelections(n),r=t.listSelections(),!l)for(c=0;c<r.length;c++)(c==r.length-1||r[c].head.line<r[c+1].head.line)&&t.indentLine(r[c].head.line)}function n(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i<r;++i)if(e[i]==t)return i;return-1}function s(t,i,r,n,s){if(!e.scanForClosingTag)return!1;var o=Math.min(t.lastLine()+1,n.line+500),a=e.scanForClosingTag(t,n,null,o);if(!a||a.tag!=r)return!1;for(var l=s?1:0,c=i.length-1;c>=0&&i[c]==r;c--)++l;for(n=a.to,c=1;c<l;c++){var u=e.scanForClosingTag(t,n,null,o);if(!u||u.tag!=r)return!1;n=u.to}return!0}e.commands.closeTag=function(e){return r(e)}}(i(/*! ../../lib/codemirror */"VrN/"),i(/*! ../fold/xml-fold */"osHv"))},BjJ7:
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/pages/tasks/util.js ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: isCompileOk, getTreeData, processTreeData, debounce, isProd, apiPref */
|
|
|
/*! exports used: apiPref, debounce, getTreeData, isCompileOk, processTreeData */function(e,t,i){"use strict";function r(e){var t=!0;if(e.length>0){for(var i=0;i<e.length;i++)if(0==e[i].compile_success||!e[i].compile_success){t=!1;break}}else t=!1;return t}function n(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=[],r=0;r<e.length;r++){var n=e[r],s=t?"".concat(t,"/").concat(n.name):"".concat(n.name);i.push({title:n.name,isLeaf:"tree"!==n.type,key:s})}return i}function s(e,t,i){for(var r=0;r<e.length;r++){var n=e[r];if(n.key===t){n.children=i;break}n.children&&s(n.children,t,i)}return e}function o(e,t,i){var r;return function(){var n=this,s=arguments,o=function(){r=null,i||e.apply(n,s)},a=i&&!r;clearTimeout(r),r=setTimeout(o,t),a&&e.apply(n,s)}}i.d(t,"d",(function(){return r})),i.d(t,"c",(function(){return n})),i.d(t,"e",(function(){return s})),i.d(t,"b",(function(){return o})),i.d(t,"a",(function(){return a}));var a=i(/*! @/utils/env */"m3rI").a.API_SERVER},"C+DQ":
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/css/iconfont.css ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},DlQD:
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./node_modules/marked/lib/marked.js ***!
|
|
|
\*******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports=function(){"use strict";function e(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function i(e,i){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,i){if(e){if("string"==typeof e)return t(e,i);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)}var r=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){function t(){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}}e.exports={defaults:{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},getDefaults:t,changeDefaults:function(t){e.exports.defaults=t}}})),n=(r.defaults,r.getDefaults,r.changeDefaults,/[&<>"']/),s=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return l[e]},u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function h(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var d=/(^|[^\[])\^/g,f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},v=/^[^:]+:\/*[^/]*$/,m=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function _(e,t){g[" "+e]||(v.test(e)?g[" "+e]=e+"/":g[" "+e]=b(e,"/",!0));var i=-1===(e=g[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(m,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}function b(e,t,i){var r=e.length;if(0===r)return"";for(var n=0;n<r;){var s=e.charAt(r-n-1);if(s!==t||i){if(s===t||!i)break;n++}else n++}return e.substr(0,r-n)}var S=function(e,t){if(t){if(n.test(e))return e.replace(s,c)}else if(o.test(e))return e.replace(a,c);return e},C=h,w=function(e,t){e=e.source||e,t=t||"";var i={replace:function(t,r){return r=(r=r.source||r).replace(d,"$1"),e=e.replace(t,r),i},getRegex:function(){return new RegExp(e,t)}};return i},k=function(e,t,i){if(e){var r;try{r=decodeURIComponent(h(i)).replace(f,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!p.test(i)&&(i=_(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i},x={exec:function(){}},E=function(e){for(var t,i,r=1;r<arguments.length;r++)for(i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T=function(e,t){var i=e.replace(/\|/g,(function(e,t,i){for(var r=!1,n=t;--n>=0&&"\\"===i[n];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i},L=b,A=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,r=0,n=0;n<i;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&--r<0)return n;return-1},R=function(e){e&&e.sanitize&&!e.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")},D=r.defaults,O=L,M=T,I=S,P=A;function F(e,t,i){var r=t.href,n=t.title?I(t.title):null,s=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:i,href:r,title:n,text:s}:{type:"image",raw:i,href:r,title:n,text:I(s)}}var B=function(){function e(e){this.options=e||D}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e,t){var i=this.rules.block.code.exec(e);if(i){var r=t[t.length-1];if(r&&"paragraph"===r.type)return{raw:i[0],text:i[0].trimRight()};var n=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?n:O(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],r=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var r=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:r}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var i={type:"table",header:M(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(i.header.length===i.align.length){var r,n=i.align.length;for(r=0;r<n;r++)/^ *-+: *$/.test(i.align[r])?i.align[r]="right":/^ *:-+: *$/.test(i.align[r])?i.align[r]="center":/^ *:-+ *$/.test(i.align[r])?i.align[r]="left":i.align[r]=null;for(n=i.cells.length,r=0;r<n;r++)i.cells[r]=M(i.cells[r],i.header.length);return i}}},t.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},t.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],text:i}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){for(var i,r,n,s,o,a,l,c=t[0],u=t[2],h=u.length>1,d=")"===u[u.length-1],f={type:"list",raw:c,ordered:h,start:h?+u.slice(0,-1):"",loose:!1,items:[]},p=t[0].match(this.rules.block.item),g=!1,v=p.length,m=0;m<v;m++)c=i=p[m],r=i.length,~(i=i.replace(/^ *([*+-]|\d+[.)]) */,"")).indexOf("\n ")&&(r-=i.length,i=this.options.pedantic?i.replace(/^ {1,4}/gm,""):i.replace(new RegExp("^ {1,"+r+"}","gm"),"")),m!==v-1&&(n=this.rules.block.bullet.exec(p[m+1])[0],(h?1===n.length||!d&&")"===n[n.length-1]:n.length>1||this.options.smartLists&&n!==u)&&(s=p.slice(m+1).join("\n"),f.raw=f.raw.substring(0,f.raw.length-s.length),m=v-1)),o=g||/\n\n(?!\s*$)/.test(i),m!==v-1&&(g="\n"===i.charAt(i.length-1),o||(o=g)),o&&(f.loose=!0),l=void 0,(a=/^\[[ xX]\] /.test(i))&&(l=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:c,task:a,checked:l,loose:o,text:i});return f}},t.html=function(e){var t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):I(t[0]):t[0]}},t.def=function(e){var t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},t.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:M(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var r,n=i.align.length;for(r=0;r<n;r++)/^ *-+: *$/.test(i.align[r])?i.align[r]="right":/^ *:-+: *$/.test(i.align[r])?i.align[r]="center":/^ *:-+ *$/.test(i.align[r])?i.align[r]="left":i.align[r]=null;for(n=i.cells.length,r=0;r<n;r++)i.cells[r]=M(i.cells[r].replace(/^ *\| *| *\| *$/g,""),i.header.length);return i}}},t.lheading=function(e){var t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},t.paragraph=function(e){var t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},t.text=function(e,t){var i=this.rules.block.text.exec(e);if(i){var r=t[t.length-1];return r&&"text"===r.type?{raw:i[0],text:i[0]}:{type:"text",raw:i[0],text:i[0]}}},t.escape=function(e){var t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}},t.tag=function(e,t,i){var r=this.rules.inline.tag.exec(e);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):I(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=P(t[2],"()");if(i>-1){var r=(0===t[0].indexOf("!")?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,r).trim(),t[3]=""}var n=t[2],s="";if(this.options.pedantic){var o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);o?(n=o[1],s=o[3]):s=""}else s=t[3]?t[3].slice(1,-1):"";return F(t,{href:(n=n.trim().replace(/^<([\s\S]*)>$/,"$1"))?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0])}},t.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var r=(i[2]||i[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var n=i[0].charAt(0);return{type:"text",raw:n,text:n}}return F(i,r,i[0])}},t.strong=function(e,t,i){void 0===i&&(i="");var r=this.rules.inline.strong.start.exec(e);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){t=t.slice(-1*e.length);var n,s="**"===r[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(s.lastIndex=0;null!=(r=s.exec(t));)if(n=this.rules.inline.strong.middle.exec(t.slice(0,r.index+3)))return{type:"strong",raw:e.slice(0,n[0].length),text:e.slice(2,n[0].length-2)}}},t.em=function(e,t,i){void 0===i&&(i="");var r=this.rules.inline.em.start.exec(e);if(r&&(!r[1]||r[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){t=t.slice(-1*e.length);var n,s="*"===r[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(s.lastIndex=0;null!=(r=s.exec(t));)if(n=this.rules.inline.em.middle.exec(t.slice(0,r.index+2)))return{type:"em",raw:e.slice(0,n[0].length),text:e.slice(1,n[0].length-1)}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),r=/[^ ]/.test(i),n=i.startsWith(" ")&&i.endsWith(" ");return r&&n&&(i=i.substring(1,i.length-1)),i=I(i,!0),{type:"codespan",raw:t[0],text:i}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[1]}},t.autolink=function(e,t){var i,r,n=this.rules.inline.autolink.exec(e);if(n)return r="@"===n[2]?"mailto:"+(i=I(this.options.mangle?t(n[1]):n[1])):i=I(n[1]),{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}},t.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var r,n;if("@"===i[2])n="mailto:"+(r=I(this.options.mangle?t(i[0]):i[0]));else{var s;do{s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(s!==i[0]);r=I(i[0]),n="www."===i[1]?"http://"+r:r}return{type:"link",raw:i[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}},t.inlineText=function(e,t,i){var r,n=this.rules.inline.text.exec(e);if(n)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):I(n[0]):n[0]:I(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:r}},e}(),N=x,H=w,j=E,U={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:N,table:N,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};U.def=H(U.def).replace("label",U._label).replace("title",U._title).getRegex(),U.bullet=/(?:[*+-]|\d{1,9}[.)])/,U.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,U.item=H(U.item,"gm").replace(/bull/g,U.bullet).getRegex(),U.list=H(U.list).replace(/bull/g,U.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+U.def.source+")").getRegex(),U._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",U._comment=/<!--(?!-?>)[\s\S]*?-->/,U.html=H(U.html,"i").replace("comment",U._comment).replace("tag",U._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),U.paragraph=H(U._paragraph).replace("hr",U.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",U._tag).getRegex(),U.blockquote=H(U.blockquote).replace("paragraph",U.paragraph).getRegex(),U.normal=j({},U),U.gfm=j({},U.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*|$)"}),U.gfm.nptable=H(U.gfm.nptable).replace("hr",U.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",U._tag).getRegex(),U.gfm.table=H(U.gfm.table).replace("hr",U.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",U._tag).getRegex(),U.pedantic=j({},U.normal,{html:H("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",U._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:N,paragraph:H(U.normal._paragraph).replace("hr",U.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",U.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var K={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:N,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:N,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};K.punctuation=H(K.punctuation).replace(/punctuation/g,K._punctuation).getRegex(),K._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",K._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",K.em.start=H(K.em.start).replace(/punctuation/g,K._punctuation).getRegex(),K.em.middle=H(K.em.middle).replace(/punctuation/g,K._punctuation).replace(/overlapSkip/g,K._overlapSkip).getRegex(),K.em.endAst=H(K.em.endAst,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.em.endUnd=H(K.em.endUnd,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.strong.start=H(K.strong.start).replace(/punctuation/g,K._punctuation).getRegex(),K.strong.middle=H(K.strong.middle).replace(/punctuation/g,K._punctuation).replace(/blockSkip/g,K._blockSkip).getRegex(),K.strong.endAst=H(K.strong.endAst,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.strong.endUnd=H(K.strong.endUnd,"g").replace(/punctuation/g,K._punctuation).getRegex(),K.blockSkip=H(K._blockSkip,"g").getRegex(),K.overlapSkip=H(K._overlapSkip,"g").getRegex(),K._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,K._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,K._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])?)+(?![-_])/,K.autolink=H(K.autolink).replace("scheme",K._scheme).replace("email",K._email).getRegex(),K._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,K.tag=H(K.tag).replace("comment",U._comment).replace("attribute",K._attribute).getRegex(),K._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,K._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,K._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,K.link=H(K.link).replace("label",K._label).replace("href",K._href).replace("title",K._title).getRegex(),K.reflink=H(K.reflink).replace("label",K._label).getRegex(),K.reflinkSearch=H(K.reflinkSearch,"g").replace("reflink",K.reflink).replace("nolink",K.nolink).getRegex(),K.normal=j({},K),K.pedantic=j({},K.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:H(/^!?\[(label)\]\((.*?)\)/).replace("label",K._label).getRegex(),reflink:H(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K._label).getRegex()}),K.gfm=j({},K.normal,{escape:H(K.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),K.gfm.url=H(K.gfm.url,"i").replace("email",K.gfm._extended_email).getRegex(),K.breaks=j({},K.gfm,{br:H(K.br).replace("{2,}","*").getRegex(),text:H(K.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var X={block:U,inline:K},W=r.defaults,z=X.block,G=X.inline;function V(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function q(e){var t,i,r="",n=e.length;for(t=0;t<n;t++)i=e.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),r+="&#"+i+";";return r}var Q=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||W,this.options.tokenizer=this.options.tokenizer||new B,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:z.normal,inline:G.normal};this.options.pedantic?(t.block=z.pedantic,t.inline=G.pedantic):this.options.gfm&&(t.block=z.gfm,this.options.breaks?t.inline=G.breaks:t.inline=G.gfm),this.tokenizer.rules=t}t.lex=function(e,i){return new t(i).lex(e)};var i,r,n,s=t.prototype;return s.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},s.blockTokens=function(e,t,i){var r,n,s,o;for(void 0===t&&(t=[]),void 0===i&&(i=!0),e=e.replace(/^ +$/gm,"");e;)if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((o=t[t.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],i),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),s=r.items.length,n=0;n<s;n++)r.items[n].tokens=this.blockTokens(r.items[n].text,[],!1);t.push(r)}else if(r=this.tokenizer.html(e))e=e.substring(r.raw.length),t.push(r);else if(i&&(r=this.tokenizer.def(e)))e=e.substring(r.raw.length),this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});else if(r=this.tokenizer.table(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(e))e=e.substring(r.raw.length),t.push(r);else if(i&&(r=this.tokenizer.paragraph(e)))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.text(e,t))e=e.substring(r.raw.length),r.type?t.push(r):((o=t[t.length-1]).raw+="\n"+r.raw,o.text+="\n"+r.text);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return t},s.inline=function(e){var t,i,r,n,s,o,a=e.length;for(t=0;t<a;t++)switch((o=e[t]).type){case"paragraph":case"text":case"heading":o.tokens=[],this.inlineTokens(o.text,o.tokens);break;case"table":for(o.tokens={header:[],cells:[]},n=o.header.length,i=0;i<n;i++)o.tokens.header[i]=[],this.inlineTokens(o.header[i],o.tokens.header[i]);for(n=o.cells.length,i=0;i<n;i++)for(s=o.cells[i],o.tokens.cells[i]=[],r=0;r<s.length;r++)o.tokens.cells[i][r]=[],this.inlineTokens(s[r],o.tokens.cells[i][r]);break;case"blockquote":this.inline(o.tokens);break;case"list":for(n=o.items.length,i=0;i<n;i++)this.inline(o.items[i].tokens)}return e},s.inlineTokens=function(e,t,i,r,n){var s;void 0===t&&(t=[]),void 0===i&&(i=!1),void 0===r&&(r=!1),void 0===n&&(n="");var o,a=e;if(this.tokens.links){var l=Object.keys(this.tokens.links);if(l.length>0)for(;null!=(o=this.tokenizer.rules.inline.reflinkSearch.exec(a));)l.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(o=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;)if(s=this.tokenizer.escape(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.tag(e,i,r))e=e.substring(s.raw.length),i=s.inLink,r=s.inRawBlock,t.push(s);else if(s=this.tokenizer.link(e))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),t.push(s);else if(s=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(s.raw.length),"link"===s.type&&(s.tokens=this.inlineTokens(s.text,[],!0,r)),t.push(s);else if(s=this.tokenizer.strong(e,a,n))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),t.push(s);else if(s=this.tokenizer.em(e,a,n))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),t.push(s);else if(s=this.tokenizer.codespan(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.br(e))e=e.substring(s.raw.length),t.push(s);else if(s=this.tokenizer.del(e))e=e.substring(s.raw.length),s.tokens=this.inlineTokens(s.text,[],i,r),t.push(s);else if(s=this.tokenizer.autolink(e,q))e=e.substring(s.raw.length),t.push(s);else if(i||!(s=this.tokenizer.url(e,q))){if(s=this.tokenizer.inlineText(e,r,V))e=e.substring(s.raw.length),n=s.raw.slice(-1),t.push(s);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(s.raw.length),t.push(s);return t},i=t,n=[{key:"rules",get:function(){return{block:z,inline:G}}}],(r=null)&&e(i.prototype,r),n&&e(i,n),t}(),Y=r.defaults,Z=k,$=S,J=function(){function e(e){this.options=e||Y}var t=e.prototype;return t.code=function(e,t,i){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var n=this.options.highlight(e,r);null!=n&&n!==e&&(i=!0,e=n)}return r?'<pre><code class="'+this.options.langPrefix+$(r,!0)+'">'+(i?e:$(e,!0))+"</code></pre>\n":"<pre><code>"+(i?e:$(e,!0))+"</code></pre>\n"},t.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},t.html=function(e){return e},t.heading=function(e,t,i,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(i)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},t.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},t.list=function(e,t,i){var r=t?"ol":"ul";return"<"+r+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"</"+r+">\n"},t.listitem=function(e){return"<li>"+e+"</li>\n"},t.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},t.paragraph=function(e){return"<p>"+e+"</p>\n"},t.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},t.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},t.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},t.strong=function(e){return"<strong>"+e+"</strong>"},t.em=function(e){return"<em>"+e+"</em>"},t.codespan=function(e){return"<code>"+e+"</code>"},t.br=function(){return this.options.xhtml?"<br/>":"<br>"},t.del=function(e){return"<del>"+e+"</del>"},t.link=function(e,t,i){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return i;var r='<a href="'+$(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>"},t.image=function(e,t,i){if(null===(e=Z(this.options.sanitize,this.options.baseUrl,e)))return i;var r='<img src="'+e+'" alt="'+i+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},t.text=function(e){return e},e}(),ee=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),te=function(){function e(){this.seen={}}return e.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var i=t;do{this.seen[i]++,t=i+"-"+this.seen[i]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},e}(),ie=r.defaults,re=C,ne=function(){function e(e){this.options=e||ie,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ee,this.slugger=new te}e.parse=function(t,i){return new e(i).parse(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var i,r,n,s,o,a,l,c,u,h,d,f,p,g,v,m,y,_,b="",S=e.length;for(i=0;i<S;i++)switch((h=e[i]).type){case"space":continue;case"hr":b+=this.renderer.hr();continue;case"heading":b+=this.renderer.heading(this.parseInline(h.tokens),h.depth,re(this.parseInline(h.tokens,this.textRenderer)),this.slugger);continue;case"code":b+=this.renderer.code(h.text,h.lang,h.escaped);continue;case"table":for(c="",l="",s=h.header.length,r=0;r<s;r++)l+=this.renderer.tablecell(this.parseInline(h.tokens.header[r]),{header:!0,align:h.align[r]});for(c+=this.renderer.tablerow(l),u="",s=h.cells.length,r=0;r<s;r++){for(l="",o=(a=h.tokens.cells[r]).length,n=0;n<o;n++)l+=this.renderer.tablecell(this.parseInline(a[n]),{header:!1,align:h.align[n]});u+=this.renderer.tablerow(l)}b+=this.renderer.table(c,u);continue;case"blockquote":u=this.parse(h.tokens),b+=this.renderer.blockquote(u);continue;case"list":for(d=h.ordered,f=h.start,p=h.loose,s=h.items.length,u="",r=0;r<s;r++)m=(v=h.items[r]).checked,y=v.task,g="",v.task&&(_=this.renderer.checkbox(m),p?v.tokens.length>0&&"text"===v.tokens[0].type?(v.tokens[0].text=_+" "+v.tokens[0].text,v.tokens[0].tokens&&v.tokens[0].tokens.length>0&&"text"===v.tokens[0].tokens[0].type&&(v.tokens[0].tokens[0].text=_+" "+v.tokens[0].tokens[0].text)):v.tokens.unshift({type:"text",text:_}):g+=_),g+=this.parse(v.tokens,p),u+=this.renderer.listitem(g,y,m);b+=this.renderer.list(u,d,f);continue;case"html":b+=this.renderer.html(h.text);continue;case"paragraph":b+=this.renderer.paragraph(this.parseInline(h.tokens));continue;case"text":for(u=h.tokens?this.parseInline(h.tokens):h.text;i+1<S&&"text"===e[i+1].type;)u+="\n"+((h=e[++i]).tokens?this.parseInline(h.tokens):h.text);b+=t?this.renderer.paragraph(u):u;continue;default:var C='Token with "'+h.type+'" type was not found.';if(this.options.silent)return void console.error(C);throw new Error(C)}return b},t.parseInline=function(e,t){t=t||this.renderer;var i,r,n="",s=e.length;for(i=0;i<s;i++)switch((r=e[i]).type){case"escape":n+=t.text(r.text);break;case"html":n+=t.html(r.text);break;case"link":n+=t.link(r.href,r.title,this.parseInline(r.tokens,t));break;case"image":n+=t.image(r.href,r.title,r.text);break;case"strong":n+=t.strong(this.parseInline(r.tokens,t));break;case"em":n+=t.em(this.parseInline(r.tokens,t));break;case"codespan":n+=t.codespan(r.text);break;case"br":n+=t.br();break;case"del":n+=t.del(this.parseInline(r.tokens,t));break;case"text":n+=t.text(r.text);break;default:var o='Token with "'+r.type+'" type was not found.';if(this.options.silent)return void console.error(o);throw new Error(o)}return n},e}(),se=E,oe=R,ae=S,le=r.getDefaults,ce=r.changeDefaults,ue=r.defaults;function he(e,t,i){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(i=t,t=null),t=se({},he.defaults,t||{}),oe(t),i){var r,n=t.highlight;try{r=Q.lex(e,t)}catch(e){return i(e)}var s=function(e){var s;if(!e)try{s=ne.parse(r,t)}catch(t){e=t}return t.highlight=n,e?i(e):i(null,s)};if(!n||n.length<3)return s();if(delete t.highlight,!r.length)return s();var o=0;return he.walkTokens(r,(function(e){"code"===e.type&&(o++,setTimeout((function(){n(e.text,e.lang,(function(t,i){if(t)return s(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--o&&s()}))}),0))})),void(0===o&&s())}try{var a=Q.lex(e,t);return t.walkTokens&&he.walkTokens(a,t.walkTokens),ne.parse(a,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+ae(e.message+"",!0)+"</pre>";throw e}}return he.options=he.setOptions=function(e){return se(he.defaults,e),ce(he.defaults),he},he.getDefaults=le,he.defaults=ue,he.use=function(e){var t=se({},e);if(e.renderer&&function(){var i=he.defaults.renderer||new J,r=function(t){var r=i[t];i[t]=function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var a=e.renderer[t].apply(i,s);return!1===a&&(a=r.apply(i,s)),a}};for(var n in e.renderer)r(n);t.renderer=i}(),e.tokenizer&&function(){var i=he.defaults.tokenizer||new B,r=function(t){var r=i[t];i[t]=function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];var a=e.tokenizer[t].apply(i,s);return!1===a&&(a=r.apply(i,s)),a}};for(var n in e.tokenizer)r(n);t.tokenizer=i}(),e.walkTokens){var i=he.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens(t),i&&i(t)}}he.setOptions(t)},he.walkTokens=function(e,t){for(var r,n=i(e);!(r=n()).done;){var s=r.value;switch(t(s),s.type){case"table":for(var o,a=i(s.tokens.header);!(o=a()).done;){var l=o.value;he.walkTokens(l,t)}for(var c,u=i(s.tokens.cells);!(c=u()).done;)for(var h,d=i(c.value);!(h=d()).done;){var f=h.value;he.walkTokens(f,t)}break;case"list":he.walkTokens(s.items,t);break;default:s.tokens&&he.walkTokens(s.tokens,t)}}},he.Parser=ne,he.parser=ne.parse,he.Renderer=J,he.TextRenderer=ee,he.Lexer=Q,he.lexer=Q.lex,he.Tokenizer=B,he.Slugger=te,he.parse=he,he}()},Dqnf:
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/pages/tasks/xterm-panel/index.jsx ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";var r=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),n=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),s=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper */"rAM+"),o=i(/*! react */"q1tI"),a=i.n(o),l=i(/*! js-base64 */"J66h"),c=i(/*! xterm */"/POA"),u=(i(/*! xterm/css/xterm.css */"q7KB"),i(/*! ./index.less?modules */"ER/M")),h=i.n(u),d=i(/*! @/components/mediator */"dhSg"),f=i(/*! resize-observer-polyfill */"bdgK");function p(e,t,i){var r=i._core._renderService.dimensions.actualCellWidth||9.5,n=i._core._renderService.dimensions.actualCellHeight||18,s=Math.floor(t/n);return[Math.floor(e/r),s]}t.a=function(e){var t=e.sshConfigData,i=e.sid,u=Object(o.useState)(null),g=Object(n.a)(u,2),v=g[0],m=g[1],y=t.ws_url,_=t.password,b=t.port,S=Object(o.useRef)(),C=Object(o.useRef)(),w=Object(o.useRef)(!1);return Object(o.useEffect)((function(){if(S.current&&y){var e=new c.Terminal({fontSize:16,rendererType:"dom"});e.open(S.current),e.onData((function(e){C.current&&1===C.current.readyState&&(C.current.send(JSON.stringify({tp:"client",data:e})),d.a.publish("on-operating-ssh"))})),e.write("Connecting..."),m(e);var t=function(e,t){var i=new f.default((function(t){var i,r=Object(s.a)(t);try{for(r.s();!(i=r.n()).done;){var o=i.value;if(o.target.offsetHeight>0||o.target.offsetWidth>0){var a=p(o.target.offsetWidth,o.target.offsetHeight,e),c=Object(n.a)(a,2),u=c[0],h=c[1];console.log("cols, rows",u,h),d.a.publish("ssh-xterm-resize",{columns:u,rows:h,width:o.target.offsetWidth,height:o.target.offsetHeight}),e.resize(u,h);var f=l.Base64.decode("IA=="),g=l.Base64.decode("CBtbSw==");e.write(f),e.write(g)}}}catch(e){r.e(e)}finally{r.f()}}));return i.observe(t),i}(e,S.current);return function(){e.dispose(),t.unobserve(S.current)}}}),[y,S.current]),Object(o.useEffect)((function(){if(v&&y){var e=setInterval((function(){C.current&&C.current.send(JSON.stringify({tp:"h"}))}),3e4),n=d.a.subscribe("create-socket",(function(n){var s;i==n&&(C.current&&1===C.current.readyState?v.focus():(s=new WebSocket(y),C.current=s,s.onopen=function(){var e=v.element.parentElement;if(e){var i=e.offsetWidth,n=e.offsetHeight;console.log("init",{tp:"init",data:Object(r.a)(Object(r.a)({},t),{},{secret:_,width:i,height:n,rows:v.rows,columns:v.cols})}),s.send(JSON.stringify({tp:"init",data:Object(r.a)(Object(r.a)({},t),{},{secret:_,width:i,height:n,rows:v.rows,columns:v.cols})}))}v.focus()},s.onerror=function(e){console.log("------in socket error----",e,s,y)},s.onmessage=function(e){w.current||(v.write("\r"),setTimeout((function(){}),1e3)),w.current=!0,console.log("event:",e);var t=l.Base64.decode(e.data.toString()),i=v._core._renderService.dimensions.actualCellWidth||9.5;console.log("data:",t,i,v),v.write(t)},s.onclose=function(t){e&&clearInterval(e),v.write("\r\nconnection closed")}),v.focus())})),s=d.a.subscribe("close-socket",(function(e){i===e&&(C.current&&(C.current.close(),w.current=!1,v.clear()),C.current=null)})),o=d.a.subscribe("ssh-xterm-resize",(function(e){C.current&&1===C.current.readyState&&C.current.send(JSON.stringify({tp:"resize",data:Object(r.a)({},e)}))})),a=d.a.subscribe("ssh-add-connect-time",(function(){C.current&&1===C.current.readyState&&C.current.send(JSON.stringify({tp:"overtime"}))}));return function(){s(),n(),o(),a(),C.current&&(C.current.close(),w.current=!1)}}}),[v,y,b]),a.a.createElement("div",{ref:S,className:h.a["xterm-panel"]},y?null:a.a.createElement("p",{style:{color:"#fff"}},"正在连接命令行服务..."))}},ELLl:
|
|
|
/*!*************************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/edit/closebrackets.js ***!
|
|
|
\*************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){var t={pairs:"()[]{}''\"\"",closeBefore:")]}'\":;>",triples:"",explode:"[]{}"},i=e.Pos;function r(e,i){return"pairs"==i&&"string"==typeof e?e:"object"==typeof e&&null!=e[i]?e[i]:t[i]}e.defineOption("autoCloseBrackets",!1,(function(t,i,o){o&&o!=e.Init&&(t.removeKeyMap(n),t.state.closeBrackets=null),i&&(s(r(i,"pairs")),t.state.closeBrackets=i,t.addKeyMap(n))}));var n={Backspace:function(t){var n=a(t);if(!n||t.getOption("disableInput"))return e.Pass;for(var s=r(n,"pairs"),o=t.listSelections(),c=0;c<o.length;c++){if(!o[c].empty())return e.Pass;var u=l(t,o[c].head);if(!u||s.indexOf(u)%2!=0)return e.Pass}for(c=o.length-1;c>=0;c--){var h=o[c].head;t.replaceRange("",i(h.line,h.ch-1),i(h.line,h.ch+1),"+delete")}},Enter:function(t){var i=a(t),n=i&&r(i,"explode");if(!n||t.getOption("disableInput"))return e.Pass;for(var s=t.listSelections(),o=0;o<s.length;o++){if(!s[o].empty())return e.Pass;var c=l(t,s[o].head);if(!c||n.indexOf(c)%2!=0)return e.Pass}t.operation((function(){var e=t.lineSeparator()||"\n";t.replaceSelection(e+e,null),t.execCommand("goCharLeft"),s=t.listSelections();for(var i=0;i<s.length;i++){var r=s[i].head.line;t.indentLine(r,null,!0),t.indentLine(r+1,null,!0)}}))}};function s(e){for(var t=0;t<e.length;t++){var i=e.charAt(t),r="'"+i+"'";n[r]||(n[r]=o(i))}}function o(t){return function(n){return function(t,n){var s=a(t);if(!s||t.getOption("disableInput"))return e.Pass;var o=r(s,"pairs"),l=o.indexOf(n);if(-1==l)return e.Pass;for(var u,h=r(s,"closeBefore"),d=r(s,"triples"),f=o.charAt(l+1)==n,p=t.listSelections(),g=l%2==0,v=0;v<p.length;v++){var m,y=p[v],_=y.head,b=t.getRange(_,i(_.line,_.ch+1));if(g&&!y.empty())m="surround";else if(!f&&g||b!=n)if(f&&_.ch>1&&d.indexOf(n)>=0&&t.getRange(i(_.line,_.ch-2),_)==n+n){if(_.ch>2&&/\bstring/.test(t.getTokenTypeAt(i(_.line,_.ch-2))))return e.Pass;m="addFour"}else if(f){var S=0==_.ch?" ":t.getRange(i(_.line,_.ch-1),_);if(e.isWordChar(b)||S==n||e.isWordChar(S))return e.Pass;m="both"}else{if(!g||!(0===b.length||/\s/.test(b)||h.indexOf(b)>-1))return e.Pass;m="both"}else m=f&&c(t,_)?"both":d.indexOf(n)>=0&&t.getRange(_,i(_.line,_.ch+3))==n+n+n?"skipThree":"skip";if(u){if(u!=m)return e.Pass}else u=m}var C=l%2?o.charAt(l-1):n,w=l%2?n:o.charAt(l+1);t.operation((function(){if("skip"==u)t.execCommand("goCharRight");else if("skipThree"==u)for(var r=0;r<3;r++)t.execCommand("goCharRight");else if("surround"==u){var n=t.getSelections();for(r=0;r<n.length;r++)n[r]=C+n[r]+w;for(t.replaceSelections(n,"around"),n=t.listSelections().slice(),r=0;r<n.length;r++)n[r]=(s=n[r],o=void 0,o=e.cmpPos(s.anchor,s.head)>0,{anchor:new i(s.anchor.line,s.anchor.ch+(o?-1:1)),head:new i(s.head.line,s.head.ch+(o?1:-1))});t.setSelections(n)}else"both"==u?(t.replaceSelection(C+w,null),t.triggerElectric(C+w),t.execCommand("goCharLeft")):"addFour"==u&&(t.replaceSelection(C+C+C+C,"before"),t.execCommand("goCharRight"));var s,o}))}(n,t)}}function a(e){var t=e.state.closeBrackets;return!t||t.override?t:e.getModeAt(e.getCursor()).closeBrackets||t}function l(e,t){var r=e.getRange(i(t.line,t.ch-1),i(t.line,t.ch+1));return 2==r.length?r:null}function c(e,t){var r=e.getTokenAt(i(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}s(t.pairs+"`")}(i(/*! ../../lib/codemirror */"VrN/"))},"ER/M":
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./src/pages/tasks/xterm-panel/index.less?modules ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports={"xterm-panel":"xterm-panel___2r2xx"}},Fv0C:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keyboard.js ***!
|
|
|
\*********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=h(i(/*! ../util/logging.js */"Lo0S")),o=i(/*! ../util/events.js */"vewr"),a=h(i(/*! ./util.js */"8CQX")),l=(n=i(/*! ./keysym.js */"mHUz"))&&n.__esModule?n:{default:n},c=h(i(/*! ../util/browser.js */"GdRQ"));function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}function d(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=t||null,this._keyDownList={},this._pendingKey=null,this._altGrArmed=!1,this._eventHandlers={keyup:this._handleKeyUp.bind(this),keydown:this._handleKeyDown.bind(this),keypress:this._handleKeyPress.bind(this),blur:this._allKeysUp.bind(this),checkalt:this._checkAlt.bind(this)},this.onkeyevent=function(){}}var t,i,r;return t=e,(i=[{key:"_sendKeyEvent",value:function(e,t,i){if(i)this._keyDownList[t]=e;else{if(!(t in this._keyDownList))return;delete this._keyDownList[t]}s.Debug("onkeyevent "+(i?"down":"up")+", keysym: "+e,", code: "+t),this.onkeyevent(e,t,i)}},{key:"_getKeyCode",value:function(e){var t=a.getKeycode(e);if("Unidentified"!==t)return t;if(e.keyCode&&"keypress"!==e.type&&229!==e.keyCode)return"Platform"+e.keyCode;if(e.keyIdentifier){if("U+"!==e.keyIdentifier.substr(0,2))return e.keyIdentifier;var i=parseInt(e.keyIdentifier.substr(2),16);return"Platform"+String.fromCharCode(i).toUpperCase().charCodeAt()}return"Unidentified"}},{key:"_handleKeyDown",value:function(e){var t=this._getKeyCode(e),i=a.getKeysym(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),"AltRight"===t&&e.timeStamp-this._altGrCtrlTime<50?i=l.default.XK_ISO_Level3_Shift:this._sendKeyEvent(l.default.XK_Control_L,"ControlLeft",!0)),"Unidentified"===t)return i&&(this._sendKeyEvent(i,t,!0),this._sendKeyEvent(i,t,!1)),void(0,o.stopEvent)(e);if(c.isMac()||c.isIOS())switch(i){case l.default.XK_Super_L:i=l.default.XK_Alt_L;break;case l.default.XK_Super_R:i=l.default.XK_Super_L;break;case l.default.XK_Alt_L:i=l.default.XK_Mode_switch;break;case l.default.XK_Alt_R:i=l.default.XK_ISO_Level3_Shift}return t in this._keyDownList&&(i=this._keyDownList[t]),(c.isMac()||c.isIOS())&&"CapsLock"===t?(this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!0),this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!1),void(0,o.stopEvent)(e)):i||e.key&&!c.isIE()&&!c.isEdge()?(this._pendingKey=null,(0,o.stopEvent)(e),"ControlLeft"===t&&c.isWindows()&&!("ControlLeft"in this._keyDownList)?(this._altGrArmed=!0,this._altGrTimeout=setTimeout(this._handleAltGrTimeout.bind(this),100),void(this._altGrCtrlTime=e.timeStamp)):void this._sendKeyEvent(i,t,!0)):(this._pendingKey=t,void setTimeout(this._handleKeyPressTimeout.bind(this),10,e))}},{key:"_handleKeyPress",value:function(e){if((0,o.stopEvent)(e),null!==this._pendingKey){var t=this._getKeyCode(e),i=a.getKeysym(e);"Unidentified"!==t&&t!=this._pendingKey||(t=this._pendingKey,this._pendingKey=null,i?this._sendKeyEvent(i,t,!0):s.Info("keypress with no keysym:",e))}}},{key:"_handleKeyPressTimeout",value:function(e){if(null!==this._pendingKey){var t,i=this._pendingKey;if(this._pendingKey=null,e.keyCode>=48&&e.keyCode<=57)t=e.keyCode;else if(e.keyCode>=65&&e.keyCode<=90){var r=String.fromCharCode(e.keyCode);t=(r=e.shiftKey?r.toUpperCase():r.toLowerCase()).charCodeAt()}else t=0;this._sendKeyEvent(t,i,!0)}}},{key:"_handleKeyUp",value:function(e){(0,o.stopEvent)(e);var t=this._getKeyCode(e);if(this._altGrArmed&&(this._altGrArmed=!1,clearTimeout(this._altGrTimeout),this._sendKeyEvent(l.default.XK_Control_L,"ControlLeft",!0)),(c.isMac()||c.isIOS())&&"CapsLock"===t)return this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!0),void this._sendKeyEvent(l.default.XK_Caps_Lock,"CapsLock",!1);this._sendKeyEvent(this._keyDownList[t],t,!1),!c.isWindows()||"ShiftLeft"!==t&&"ShiftRight"!==t||("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(l.default.XK_Control_L,"ControlLeft",!0)}},{key:"_allKeysUp",value:function(){for(var e in s.Debug(">> Keyboard.allKeysUp"),this._keyDownList)this._sendKeyEvent(this._keyDownList[e],e,!1);s.Debug("<< Keyboard.allKeysUp")}},{key:"_checkAlt",value:function(e){if(!e.skipCheckAlt&&!e.altKey){var t=this._target,i=this._keyDownList;["AltLeft","AltRight"].forEach((function(e){if(e in i){var r=new KeyboardEvent("keyup",{key:i[e],code:e});r.skipCheckAlt=!0,t.dispatchEvent(r)}}))}}},{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 e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.addEventListener(t,e,{capture:!0,passive:!0})}))}}},{key:"ungrab",value:function(){if(c.isWindows()&&c.isFirefox()){var e=this._eventHandlers.checkalt;["mousedown","mouseup","mousemove","wheel","touchstart","touchend","touchmove","keydown","keyup"].forEach((function(t){return document.removeEventListener(t,e)}))}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()}}])&&d(t.prototype,i),r&&d(t,r),e}();t.default=f},GQ8N:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/int.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toUnsigned32bit=function(e){return e>>>0},t.toSigned32bit=function(e){return 0|e}},GdRQ:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/browser.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isMac=function(){return navigator&&!!/mac/i.exec(navigator.platform)},t.isWindows=function(){return navigator&&!!/win/i.exec(navigator.platform)},t.isIOS=function(){return navigator&&(!!/ipad/i.exec(navigator.platform)||!!/iphone/i.exec(navigator.platform)||!!/ipod/i.exec(navigator.platform))},t.isSafari=function(){return navigator&&-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")},t.isIE=function(){return navigator&&!!/trident/i.exec(navigator.userAgent)},t.isEdge=function(){return navigator&&!!/edge/i.exec(navigator.userAgent)},t.isFirefox=function(){return navigator&&!!/firefox/i.exec(navigator.userAgent)},t.hasScrollbarGutter=t.supportsImageMetadata=t.supportsCursorURIs=t.dragThreshold=t.isTouchDevice=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ./logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var o="ontouchstart"in document.documentElement||void 0!==document.ontouchstart||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;t.isTouchDevice=o,window.addEventListener("touchstart",(function e(){t.isTouchDevice=o=!0,window.removeEventListener("touchstart",e,!1)}),!1);var a=10*(window.devicePixelRatio||1);t.dragThreshold=a;var l=!1;try{var c=document.createElement("canvas");c.style.cursor='url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default',0===c.style.cursor.indexOf("url")?(n.Info("Data URI scheme cursor supported"),l=!0):n.Warn("Data URI scheme cursor not supported")}catch(e){n.Error("Data URI scheme cursor test exception: "+e)}var u=l;t.supportsCursorURIs=u;var h=!1;try{new ImageData(new Uint8ClampedArray(4),1,1),h=!0}catch(e){}var d=h;t.supportsImageMetadata=d;var f=!0;try{var p=document.createElement("div");p.style.visibility="hidden",p.style.overflow="scroll",document.body.appendChild(p);var g=document.createElement("div");p.appendChild(g);var v=p.offsetWidth-g.offsetWidth;p.parentNode.removeChild(p),f=0!=v}catch(e){n.Error("Scrollbar test exception: "+e)}var m=f;t.hasScrollbarGutter=m},Gytx:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/shallowequal/index.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){e.exports=function(e,t,i,r){var n=i?i.call(r,e,t):void 0;if(void 0!==n)return!!n;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!a(c))return!1;var u=e[c],h=t[c];if(!1===(n=i?i.call(r,u,h,c):void 0)||void 0===n&&u!==h)return!1}return!0}},HmJG:
|
|
|
/*!****************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/upload-image/index.less ***!
|
|
|
\****************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},ItS6:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/inflator.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n=i(/*! ../lib/vendor/pako/lib/zlib/inflate.js */"eP3c"),s=(r=i(/*! ../lib/vendor/pako/lib/zlib/zstream.js */"1q3G"))&&r.__esModule?r:{default:r};function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new s.default,this.chunkSize=102400,this.strm.output=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.inflateInit)(this.strm,this.windowBits)}var t,i,r;return t=e,(i=[{key:"setInput",value:function(e){e?(this.strm.input=e,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(e){if(e>this.chunkSize&&(this.chunkSize=e,this.strm.output=new Uint8Array(this.chunkSize)),this.strm.next_out=0,this.strm.avail_out=e,(0,n.inflate)(this.strm,0)<0)throw new Error("zlib inflate failed");if(this.strm.next_out!=e)throw new Error("Incomplete zlib block");return new Uint8Array(this.strm.output.buffer,0,this.strm.next_out)}},{key:"reset",value:function(){(0,n.inflateReset)(this.strm)}}])&&o(t.prototype,i),r&&o(t,r),e}();t.default=a},IxHN:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/components/Spinner/index.tsx ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";var r=i(/*! react */"q1tI"),n=i.n(r),s=i(/*! ./index.less?modules */"07cG"),o=i.n(s);t.a=function(e){var t=e.message,i=e.className,r=e.children,s=e.style,a=void 0===s?{}:s;return n.a.createElement("div",{className:"".concat(o.a.idsRingWrapper," ").concat(i)},n.a.createElement("div",{className:o.a.ldsRing},n.a.createElement("div",null),n.a.createElement("div",null),n.a.createElement("div",null),n.a.createElement("div",null)),t?n.a.createElement("p",{style:a},t):null,r)}},J66h:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/js-base64/base64.js ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: Base64 */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){(function(i){var r;!function(i,n){e.exports=function(i){"use strict";var n,s=(i=i||{}).Base64,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},i=0,r=e.length;i<r;i++)t[e.charAt(i)]=i;return t}(o),l=String.fromCharCode,c=function(e){if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?l(192|t>>>6)+l(128|63&t):l(224|t>>>12&15)+l(128|t>>>6&63)+l(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return l(240|t>>>18&7)+l(128|t>>>12&63)+l(128|t>>>6&63)+l(128|63&t)},u=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,h=function(e){return e.replace(u,c)},d=function(e){var t=[0,2,1][e.length%3],i=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[o.charAt(i>>>18),o.charAt(i>>>12&63),t>=2?"=":o.charAt(i>>>6&63),t>=1?"=":o.charAt(63&i)].join("")},f=i.btoa&&"function"==typeof i.btoa?function(e){return i.btoa(e)}:function(e){if(e.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return e.replace(/[\s\S]{1,3}/g,d)},p=function(e){return f(h(String(e)))},g=function(e){return e.replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,"")},v=function(e,t){return t?g(p(e)):p(e)};i.Uint8Array&&(n=function(e,t){for(var i="",r=0,n=e.length;r<n;r+=3){var s=e[r],a=e[r+1],l=e[r+2],c=s<<16|a<<8|l;i+=o.charAt(c>>>18)+o.charAt(c>>>12&63)+(void 0!==a?o.charAt(c>>>6&63):"=")+(void 0!==l?o.charAt(63&c):"=")}return t?g(i):i});var m,y=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,_=function(e){switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return l(55296+(t>>>10))+l(56320+(1023&t));case 3:return l((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return l((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},b=function(e){return e.replace(y,_)},S=function(e){var t=e.length,i=t%4,r=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),n=[l(r>>>16),l(r>>>8&255),l(255&r)];return n.length-=[0,0,2,1][i],n.join("")},C=i.atob&&"function"==typeof i.atob?function(e){return i.atob(e)}:function(e){return e.replace(/\S{1,4}/g,S)},w=function(e){return C(String(e).replace(/[^A-Za-z0-9\+\/]/g,""))},k=function(e){return String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,"")},x=function(e){return function(e){return b(C(e))}(k(e))};i.Uint8Array&&(m=function(e){return Uint8Array.from(w(k(e)),(function(e){return e.charCodeAt(0)}))});var E=function(){var e=i.Base64;return i.Base64=s,e};if(i.Base64={VERSION:"2.6.4",atob:w,btoa:f,fromBase64:x,toBase64:v,utob:h,encode:v,encodeURI:function(e){return v(e,!0)},btou:b,decode:x,noConflict:E,fromUint8Array:n,toUint8Array:m},"function"==typeof Object.defineProperty){var T=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};i.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",T((function(){return x(this)}))),Object.defineProperty(String.prototype,"toBase64",T((function(e){return v(this,e)}))),Object.defineProperty(String.prototype,"toBase64URI",T((function(){return v(this,!0)})))}}i.Meteor&&(Base64=i.Base64);e.exports?e.exports.Base64=i.Base64:void 0===(r=function(){return i.Base64}.apply(t,[]))||(e.exports=r);return{Base64:i.Base64}}(i)}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i?i:this)}).call(this,i(/*! ./../@umijs/deps/compiled/webpack/4/global.js */"IyRk"))},JSwD:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inftrees.js ***!
|
|
|
\************************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,r,s,u,h,d){var f,p,g,v,m,y,_,b,S,C=d.bits,w=0,k=0,x=0,E=0,T=0,L=0,A=0,R=0,D=0,O=0,M=null,I=0,P=new n.Buf16(16),F=new n.Buf16(16),B=null,N=0;for(w=0;w<=15;w++)P[w]=0;for(k=0;k<r;k++)P[t[i+k]]++;for(T=C,E=15;E>=1&&0===P[E];E--);T>E&&(T=E);if(0===E)return s[u++]=20971520,s[u++]=20971520,d.bits=1,0;for(x=1;x<E&&0===P[x];x++);T<x&&(T=x);for(R=1,w=1;w<=15;w++)if(R<<=1,(R-=P[w])<0)return-1;if(R>0&&(0===e||1!==E))return-1;for(F[1]=0,w=1;w<15;w++)F[w+1]=F[w]+P[w];for(k=0;k<r;k++)0!==t[i+k]&&(h[F[t[i+k]]++]=k);0===e?(M=B=h,y=19):1===e?(M=o,I-=257,B=a,N-=257,y=256):(M=l,B=c,y=-1);if(O=0,k=0,w=x,m=u,L=T,A=0,g=-1,v=(D=1<<T)-1,1===e&&D>852||2===e&&D>592)return 1;for(;;){_=w-A,h[k]<y?(b=0,S=h[k]):h[k]>y?(b=B[N+h[k]],S=M[I+h[k]]):(b=96,S=0),f=1<<w-A,x=p=1<<L;do{s[m+(O>>A)+(p-=f)]=_<<24|b<<16|S|0}while(0!==p);for(f=1<<w-1;O&f;)f>>=1;if(0!==f?(O&=f-1,O+=f):O=0,k++,0==--P[w]){if(w===E)break;w=t[i+h[k]]}if(w>T&&(O&v)!==g){for(0===A&&(A=T),m+=x,R=1<<(L=w-A);L+A<E&&!((R-=P[L+A])<=0);)L++,R<<=1;if(D+=1<<L,1===e&&D>852||2===e&&D>592)return 1;s[g=O&v]=T<<24|L<<16|m-u|0}}0!==O&&(s[m+O]=w-A<<24|64<<16|0);return d.bits=T,0};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../utils/common.js */"6BzB"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var 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],a=[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],l=[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],c=[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]},LCi9:
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/gesturehandler.js ***!
|
|
|
\***************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._state=127,this._tracked=[],this._ignored=[],this._waitingRelease=!1,this._releaseStart=0,this._longpressTimeoutId=null,this._twoTouchTimeoutId=null,this._boundEventHandler=this._eventHandler.bind(this)}var t,i,n;return t=e,(i=[{key:"attach",value:function(e){this.detach(),this._target=e,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(){this._target&&(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(e){var t;switch(e.stopPropagation(),e.preventDefault(),e.type){case"touchstart":t=this._touchStart;break;case"touchmove":t=this._touchMove;break;case"touchend":case"touchcancel":t=this._touchEnd}for(var i=0;i<e.changedTouches.length;i++){var r=e.changedTouches[i];t.call(this,r.identifier,r.clientX,r.clientY)}}},{key:"_touchStart",value:function(e,t,i){if(this._hasDetectedGesture()||0===this._state)this._ignored.push(e);else{if(this._tracked.length>0&&Date.now()-this._tracked[0].started>250)return this._state=0,void this._ignored.push(e);if(this._waitingRelease)return this._state=0,void this._ignored.push(e);switch(this._tracked.push({id:e,started:Date.now(),active:!0,firstX:t,firstY:i,lastX:t,lastY:i,angle:0}),this._tracked.length){case 1:this._startLongpressTimeout();break;case 2:this._state&=-26,this._stopLongpressTimeout();break;case 3:this._state&=-99;break;default:this._state=0}}}},{key:"_touchMove",value:function(e,t,i){var r=this._tracked.find((function(t){return t.id===e}));if(void 0!==r){r.lastX=t,r.lastY=i;var n=t-r.firstX,s=i-r.firstY;if(r.firstX===r.lastX&&r.firstY===r.lastY||(r.angle=180*Math.atan2(s,n)/Math.PI),!this._hasDetectedGesture()){if(Math.hypot(n,s)<50)return;if(this._state&=-24,this._stopLongpressTimeout(),1!==this._tracked.length&&(this._state&=-9),2!==this._tracked.length&&(this._state&=-97),2===this._tracked.length){var o=this._tracked.find((function(t){return t.id!==e}));if(Math.hypot(o.firstX-o.lastX,o.firstY-o.lastY)>50){var a=Math.abs(r.angle-o.angle);a=Math.abs((a+180)%360-180),this._state&=a>90?-33:-65,this._isTwoTouchTimeoutRunning()&&this._stopTwoTouchTimeout()}else this._isTwoTouchTimeoutRunning()||this._startTwoTouchTimeout()}if(!this._hasDetectedGesture())return;this._pushEvent("gesturestart")}this._pushEvent("gesturemove")}}},{key:"_touchEnd",value:function(e,t,i){if(-1!==this._ignored.indexOf(e))return this._ignored.splice(this._ignored.indexOf(e),1),void(0===this._ignored.length&&0===this._tracked.length&&(this._state=127,this._waitingRelease=!1));if(!this._hasDetectedGesture()&&this._isTwoTouchTimeoutRunning()&&(this._stopTwoTouchTimeout(),this._state=0),!this._hasDetectedGesture()&&(this._state&=-105,this._state&=-17,this._stopLongpressTimeout(),!this._waitingRelease))switch(this._releaseStart=Date.now(),this._waitingRelease=!0,this._tracked.length){case 1:this._state&=-7;break;case 2:this._state&=-6}if(this._waitingRelease)if(Date.now()-this._releaseStart>250&&(this._state=0),this._tracked.some((function(e){return Date.now()-e.started>1e3}))&&(this._state=0),this._tracked.find((function(t){return t.id===e})).active=!1,this._hasDetectedGesture())this._pushEvent("gesturestart");else if(0!==this._state)return;this._hasDetectedGesture()&&this._pushEvent("gestureend");for(var r=0;r<this._tracked.length;r++)this._tracked[r].active&&this._ignored.push(this._tracked[r].id);this._tracked=[],this._state=0,-1!==this._ignored.indexOf(e)&&this._ignored.splice(this._ignored.indexOf(e),1),0===this._ignored.length&&(this._state=127,this._waitingRelease=!1)}},{key:"_hasDetectedGesture",value:function(){return!(0===this._state||this._state&this._state-1||7&this._state&&this._tracked.some((function(e){return e.active})))}},{key:"_startLongpressTimeout",value:function(){var e=this;this._stopLongpressTimeout(),this._longpressTimeoutId=setTimeout((function(){return e._longpressTimeout()}),1e3)}},{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=16,this._pushEvent("gesturestart")}},{key:"_startTwoTouchTimeout",value:function(){var e=this;this._stopTwoTouchTimeout(),this._twoTouchTimeoutId=setTimeout((function(){return e._twoTouchTimeout()}),50)}},{key:"_stopTwoTouchTimeout",value:function(){clearTimeout(this._twoTouchTimeoutId),this._twoTouchTimeoutId=null}},{key:"_isTwoTouchTimeoutRunning",value:function(){return null!==this._twoTouchTimeoutId}},{key:"_twoTouchTimeout",value:function(){if(0===this._tracked.length)throw new Error("A pinch or two drag gesture failed, no tracked touches");var e=this._getAverageMovement(),t=Math.abs(e.x),i=Math.abs(e.y),r=this._getAverageDistance(),n=Math.abs(Math.hypot(r.first.x,r.first.y)-Math.hypot(r.last.x,r.last.y));this._state=i<n&&t<n?64:32,this._pushEvent("gesturestart"),this._pushEvent("gesturemove")}},{key:"_pushEvent",value:function(e){var t={type:this._stateToGesture(this._state)},i=this._getPosition(),r=i.last;switch("gesturestart"===e&&(r=i.first),this._state){case 32:case 64:r=i.first}if(t.clientX=r.x,t.clientY=r.y,64===this._state){var n=this._getAverageDistance();"gesturestart"===e?(t.magnitudeX=n.first.x,t.magnitudeY=n.first.y):(t.magnitudeX=n.last.x,t.magnitudeY=n.last.y)}else if(32===this._state)if("gesturestart"===e)t.magnitudeX=0,t.magnitudeY=0;else{var s=this._getAverageMovement();t.magnitudeX=s.x,t.magnitudeY=s.y}var o=new CustomEvent(e,{detail:t});this._target.dispatchEvent(o)}},{key:"_stateToGesture",value:function(e){switch(e){case 1:return"onetap";case 2:return"twotap";case 4:return"threetap";case 8:return"drag";case 16:return"longpress";case 32:return"twodrag";case 64:return"pinch"}throw new Error("Unknown gesture state: "+e)}},{key:"_getPosition",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture position, no tracked touches");for(var e=this._tracked.length,t=0,i=0,r=0,n=0,s=0;s<this._tracked.length;s++)t+=this._tracked[s].firstX,i+=this._tracked[s].firstY,r+=this._tracked[s].lastX,n+=this._tracked[s].lastY;return{first:{x:t/e,y:i/e},last:{x:r/e,y:n/e}}}},{key:"_getAverageMovement",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture movement, no tracked touches");var e,t;e=t=0;for(var i=this._tracked.length,r=0;r<this._tracked.length;r++)e+=this._tracked[r].lastX-this._tracked[r].firstX,t+=this._tracked[r].lastY-this._tracked[r].firstY;return{x:e/i,y:t/i}}},{key:"_getAverageDistance",value:function(){if(0===this._tracked.length)throw new Error("Failed to get gesture distance, no tracked touches");var e=this._tracked[0],t=this._tracked[this._tracked.length-1];return{first:{x:Math.abs(t.firstX-e.firstX),y:Math.abs(t.firstY-e.firstY)},last:{x:Math.abs(t.lastX-e.lastX),y:Math.abs(t.lastY-e.lastY)}}}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=n},LdHM:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/rc-select/es/index.js + 6 modules ***!
|
|
|
\********************************************************/
|
|
|
/*! exports provided: Option, OptGroup, default */
|
|
|
/*! exports used: OptGroup, Option, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/TransBtn.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/generate.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/commonUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-select/es/utils/valueUtil.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/hooks/useMemo.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/pickAttrs.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-virtual-list/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";i.d(t,"b",(function(){return S})),i.d(t,"a",(function(){return w}));var r=i("1OyB"),n=i("vuIU"),s=i("Ji7U"),o=i("LK+K"),a=i("q1tI"),l=i("rePB"),c=i("Ff2n"),u=i("ODXe"),h=i("4IlW"),d=i("bX4T"),f=i("YrtM"),p=i("TSYQ"),g=i.n(p),v=i("+nKL"),m=i("8OUc"),y=a.forwardRef((function(e,t){var i=e.prefixCls,r=e.id,n=e.flattenOptions,s=e.childrenAsData,o=e.values,p=e.searchValue,y=e.multiple,_=e.defaultActiveFirstOption,b=e.height,S=e.itemHeight,C=e.notFoundContent,w=e.open,k=e.menuItemSelectedIcon,x=e.virtual,E=e.onSelect,T=e.onToggleOpen,L=e.onActiveValue,A=e.onScroll,R=e.onMouseEnter,D="".concat(i,"-item"),O=Object(f.a)((function(){return n}),[w,n],(function(e,t){return t[0]&&e[1]!==t[1]})),M=a.useRef(null),I=function(e){e.preventDefault()},P=function(e){M.current&&M.current.scrollTo({index:e})},F=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=O.length,r=0;r<i;r+=1){var n=(e+r*t+i)%i,s=O[n],o=s.group,a=s.data;if(!o&&!a.disabled)return n}return-1},B=a.useState((function(){return F(0)})),N=Object(u.a)(B,2),H=N[0],j=N[1],U=function(e){j(e);var t=O[e];t?L(t.data.value,e):L(null,-1)};a.useEffect((function(){U(!1!==_?F(0):-1)}),[O.length,p]),a.useEffect((function(){var e=setTimeout((function(){if(!y&&w&&1===o.size){var e=Array.from(o)[0],t=O.findIndex((function(t){return t.data.value===e}));U(t),P(t)}}));return function(){return clearTimeout(e)}}),[w]);var K=function(e){void 0!==e&&E(e,{selected:!o.has(e)}),y||T(!1)};if(a.useImperativeHandle(t,(function(){return{onKeyDown:function(e){var t=e.which;switch(t){case h.a.UP:case h.a.DOWN:var i=0;if(t===h.a.UP?i=-1:t===h.a.DOWN&&(i=1),0!==i){var r=F(H+i,i);P(r),U(r)}break;case h.a.ENTER:var n=O[H];n&&!n.data.disabled?K(n.data.value):K(void 0),w&&e.preventDefault();break;case h.a.ESC:T(!1)}},onKeyUp:function(){},scrollTo:function(e){P(e)}}})),0===O.length)return a.createElement("div",{role:"listbox",id:"".concat(r,"_list"),className:"".concat(D,"-empty"),onMouseDown:I},C);function X(e){var t=O[e];if(!t)return null;var i=t.data||{},n=i.value,l=i.label,c=i.children,u=Object(d.a)(i,!0),h=s?c:l;return t?a.createElement("div",Object.assign({"aria-label":"string"==typeof h?h:null},u,{key:e,role:"option",id:"".concat(r,"_list_").concat(e),"aria-selected":o.has(n)}),n):null}return a.createElement(a.Fragment,null,a.createElement("div",{role:"listbox",id:"".concat(r,"_list"),style:{height:0,width:0,overflow:"hidden"}},X(H-1),X(H),X(H+1)),a.createElement(v.a,{itemKey:"key",ref:M,data:O,height:b,itemHeight:S,fullHeight:!1,onMouseDown:I,onScroll:A,virtual:x,onMouseEnter:R},(function(e,t){var i,r=e.group,n=e.groupOption,u=e.data,h=u.label,d=u.key;if(r)return a.createElement("div",{className:g()(D,"".concat(D,"-group"))},void 0!==h?h:d);var f=u.disabled,p=u.value,v=u.title,y=u.children,_=u.style,b=u.className,S=Object(c.a)(u,["disabled","value","title","children","style","className"]),C=o.has(p),w="".concat(D,"-option"),x=g()(D,w,b,(i={},Object(l.a)(i,"".concat(w,"-grouped"),n),Object(l.a)(i,"".concat(w,"-active"),H===t&&!f),Object(l.a)(i,"".concat(w,"-disabled"),f),Object(l.a)(i,"".concat(w,"-selected"),C),i)),E=s?y:h,T=!k||"function"==typeof k||C;return a.createElement("div",Object.assign({},S,{"aria-selected":C,className:x,title:v,onMouseMove:function(){H===t||f||U(t)},onClick:function(){f||K(p)},style:_}),a.createElement("div",{className:"".concat(w,"-content")},E||p),a.isValidElement(k)||C,T&&a.createElement(m.a,{className:"".concat(D,"-option-state"),customizeIcon:k,customizeIconProps:{isSelected:C}},C?"✓":null))})))}));y.displayName="OptionList";var _=y,b=function(){return null};b.isSelectOption=!0;var S=b,C=function(){return null};C.isSelectOptGroup=!0;var w=C,k=i("VTBJ"),x=i("Zm9Q");function E(e){var t=e.key,i=e.props,r=i.children,n=i.value,s=Object(c.a)(i,["children","value"]);return Object(k.a)({key:t,value:void 0!==n?n:t,children:r},s)}function T(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(x.a)(e).map((function(e,i){if(!a.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,n=e.key,s=e.props,o=s.children,l=Object(c.a)(s,["children"]);return t||!r?E(e):Object(k.a)(Object(k.a)({key:"__RC_SELECT_GRP__".concat(null===n?i:n,"__"),label:n},l),{},{options:T(o)})})).filter((function(e){return e}))}var L=i("2Qr1"),A=i("qNPg"),R=i("U8pU"),D=i("Kwbf"),O=i("WKfj");var M=function(e){var t=e.mode,i=e.options,r=e.children,n=e.backfill,s=e.allowClear,o=e.placeholder,l=e.getInputElement,c=e.showSearch,u=e.onSearch,h=e.defaultOpen,d=e.autoFocus,f=e.labelInValue,p=e.value,g=e.inputValue,v=e.optionLabelProp,m="multiple"===t||"tags"===t,y=void 0!==c?c:m||"combobox"===t,_=i||T(r);if(Object(D.a)("tags"!==t||_.every((function(e){return!e.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===t||"combobox"===t){var b=_.some((function(e){return e.options?e.options.some((function(e){return"number"==typeof("value"in e?e.value:e.key)})):"number"==typeof("value"in e?e.value:e.key)}));Object(D.a)(!b,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(D.a)("combobox"!==t||!v,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(D.a)("combobox"===t||!n,"`backfill` only works with `combobox` mode."),Object(D.a)("combobox"===t||!l,"`getInputElement` only work with `combobox` mode."),Object(D.b)("combobox"!==t||!l||!s||!o,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),u&&!y&&"combobox"!==t&&"tags"!==t&&Object(D.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(D.b)(!h||d,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=p){var S=Object(O.d)(p);Object(D.a)(!f||S.every((function(e){return"object"===Object(R.a)(e)&&("key"in e||"value"in e)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(D.a)(!m||Array.isArray(p),"`value` should be array when `mode` is `multiple` or `tags`")}if(r){var C=null;Object(x.a)(r).some((function(e){if(!a.isValidElement(e)||!e.type)return!1;var t=e.type;return!t.isSelectOption&&(t.isSelectOptGroup?!Object(x.a)(e.props.children).every((function(t){return!(a.isValidElement(t)&&e.type&&!t.type.isSelectOption)||(C=t.type,!1)})):(C=t,!0))})),C&&Object(D.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(C.displayName||C.name||C,"`.")),Object(D.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},I=Object(A.a)({prefixCls:"rc-select",components:{optionList:_},convertChildrenToData:T,flattenOptions:L.d,getLabeledValue:L.e,filterOptions:L.b,isValueDisabled:L.g,findValueOption:L.c,warningProps:M,fillOptionsWithMissingValue:L.a}),P=function(e){Object(s.a)(i,e);var t=Object(o.a)(i);function i(){var e;return Object(r.a)(this,i),(e=t.apply(this,arguments)).selectRef=a.createRef(),e.focus=function(){e.selectRef.current.focus()},e.blur=function(){e.selectRef.current.blur()},e}return Object(n.a)(i,[{key:"render",value:function(){return a.createElement(I,Object.assign({ref:this.selectRef},this.props))}}]),i}(a.Component);P.Option=S,P.OptGroup=w;var F=P;t.c=F},Lmeb:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/pages/tasks/vnc-view/index.less ***!
|
|
|
\*********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},Lo0S:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/logging.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initLogging=l,t.getLogging=function(){return r},t.Error=t.Warn=t.Info=t.Debug=void 0;var r="warn",n=function(){};t.Debug=n;var s=function(){};t.Info=s;var o=function(){};t.Warn=o;var a=function(){};function l(e){if(void 0===e?e=r:r=e,t.Debug=n=t.Info=s=t.Warn=o=t.Error=a=function(){},void 0!==window.console)switch(e){case"debug":t.Debug=n=console.debug.bind(window.console);case"info":t.Info=s=console.info.bind(window.console);case"warn":t.Warn=o=console.warn.bind(window.console);case"error":t.Error=a=console.error.bind(window.console);case"none":break;default:throw new window.Error("invalid logging type '"+e+"'")}}t.Error=a,l()},M8RZ:
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/components/modal.tsx ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";i.d(t,"a",(function(){return u}));var r=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),n=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),s=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),o=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),a=i(/*! react */"q1tI"),l=i.n(a),c=i(/*! react-dom */"i8i4"),u=function(e){Object(s.a)(i,e);var t=Object(o.a)(i);function i(e){var n;Object(r.a)(this,i),n=t.call(this,e);var s=window.document;return n.node=s.createElement("div"),s.body.appendChild(n.node),n}return Object(n.a)(i,[{key:"render",value:function(){var e=this.props.children;return Object(c.createPortal)(e,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),i}(l.a.Component)},MZdM:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/display.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i(/*! ./util/logging.js */"Lo0S")),o=(n=i(/*! ./base64.js */"N/zr"))&&n.__esModule?n:{default:n},a=i(/*! ./util/browser.js */"GdRQ"),l=i(/*! ./util/int.js */"GQ8N");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function u(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),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,s.Debug(">> Display.constructor"),this._target=t,!this._target)throw new Error("Target must be set");if("string"==typeof this._target)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},s.Debug("User Agent: "+navigator.userAgent),!("createImageData"in this._drawCtx))throw new Error("Canvas does not support createImageData");this._tile16x16=this._drawCtx.createImageData(16,16),s.Debug("<< Display.constructor"),this._scale=1,this._clipViewport=!1,this.onflush=function(){}}var t,i,r;return t=e,(i=[{key:"viewportChangePos",value:function(e,t){var i=this._viewportLoc;e=Math.floor(e),t=Math.floor(t),this._clipViewport||(e=-i.w,t=-i.h);var r=i.x+i.w-1,n=i.y+i.h-1;e<0&&i.x+e<0&&(e=-i.x),r+e>=this._fbWidth&&(e-=r+e-this._fbWidth+1),i.y+t<0&&(t=-i.y),n+t>=this._fbHeight&&(t-=n+t-this._fbHeight+1),0===e&&0===t||(s.Debug("viewportChange deltaX: "+e+", deltaY: "+t),i.x+=e,i.y+=t,this._damage(i.x,i.y,i.w,i.h),this.flip())}},{key:"viewportChangeSize",value:function(e,t){this._clipViewport&&void 0!==e&&void 0!==t||(s.Debug("Setting viewport to full display region"),e=this._fbWidth,t=this._fbHeight),e=Math.floor(e),t=Math.floor(t),e>this._fbWidth&&(e=this._fbWidth),t>this._fbHeight&&(t=this._fbHeight);var i=this._viewportLoc;if(i.w!==e||i.h!==t){i.w=e,i.h=t;var r=this._target;r.width=e,r.height=t,this.viewportChangePos(0,0),this._damage(i.x,i.y,i.w,i.h),this.flip(),this._rescale(this._scale)}}},{key:"absX",value:function(e){return 0===this._scale?0:(0,l.toSigned32bit)(e/this._scale+this._viewportLoc.x)}},{key:"absY",value:function(e){return 0===this._scale?0:(0,l.toSigned32bit)(e/this._scale+this._viewportLoc.y)}},{key:"resize",value:function(e,t){this._prevDrawStyle="",this._fbWidth=e,this._fbHeight=t;var i=this._backbuffer;if(i.width!==e||i.height!==t){var r=null;i.width>0&&i.height>0&&(r=this._drawCtx.getImageData(0,0,i.width,i.height)),i.width!==e&&(i.width=e),i.height!==t&&(i.height=t),r&&this._drawCtx.putImageData(r,0,0)}var n=this._viewportLoc;this.viewportChangeSize(n.w,n.h),this.viewportChangePos(0,0)}},{key:"_damage",value:function(e,t,i,r){e<this._damageBounds.left&&(this._damageBounds.left=e),t<this._damageBounds.top&&(this._damageBounds.top=t),e+i>this._damageBounds.right&&(this._damageBounds.right=e+i),t+r>this._damageBounds.bottom&&(this._damageBounds.bottom=t+r)}},{key:"flip",value:function(e){if(0===this._renderQ.length||e){var t=this._damageBounds.left,i=this._damageBounds.top,r=this._damageBounds.right-t,n=this._damageBounds.bottom-i,s=t-this._viewportLoc.x,o=i-this._viewportLoc.y;s<0&&(r+=s,t-=s,s=0),o<0&&(n+=o,i-=o,o=0),s+r>this._viewportLoc.w&&(r=this._viewportLoc.w-s),o+n>this._viewportLoc.h&&(n=this._viewportLoc.h-o),r>0&&n>0&&this._targetCtx.drawImage(this._backbuffer,t,i,r,n,s,o,r,n),this._damageBounds.left=this._damageBounds.top=65535,this._damageBounds.right=this._damageBounds.bottom=0}else this._renderQPush({type:"flip"})}},{key:"pending",value:function(){return this._renderQ.length>0}},{key:"flush",value:function(){0===this._renderQ.length?this.onflush():this._flushing=!0}},{key:"fillRect",value:function(e,t,i,r,n,s){0===this._renderQ.length||s?(this._setFillColor(n),this._drawCtx.fillRect(e,t,i,r),this._damage(e,t,i,r)):this._renderQPush({type:"fill",x:e,y:t,width:i,height:r,color:n})}},{key:"copyImage",value:function(e,t,i,r,n,s,o){0===this._renderQ.length||o?(this._drawCtx.mozImageSmoothingEnabled=!1,this._drawCtx.webkitImageSmoothingEnabled=!1,this._drawCtx.msImageSmoothingEnabled=!1,this._drawCtx.imageSmoothingEnabled=!1,this._drawCtx.drawImage(this._backbuffer,e,t,n,s,i,r,n,s),this._damage(i,r,n,s)):this._renderQPush({type:"copy",oldX:e,oldY:t,x:i,y:r,width:n,height:s})}},{key:"imageRect",value:function(e,t,i,r,n,s){if(0!==i&&0!==r){var a=new Image;a.src="data: "+n+";base64,"+o.default.encode(s),this._renderQPush({type:"img",img:a,x:e,y:t,width:i,height:r})}}},{key:"startTile",value:function(e,t,i,r,n){this._tileX=e,this._tileY=t,this._tile=16===i&&16===r?this._tile16x16:this._drawCtx.createImageData(i,r);for(var s=n[2],o=n[1],a=n[0],l=this._tile.data,c=0;c<i*r*4;c+=4)l[c]=s,l[c+1]=o,l[c+2]=a,l[c+3]=255}},{key:"subTile",value:function(e,t,i,r,n){for(var s=n[2],o=n[1],a=n[0],l=e+i,c=t+r,u=this._tile.data,h=this._tile.width,d=t;d<c;d++)for(var f=e;f<l;f++){var p=4*(f+d*h);u[p]=s,u[p+1]=o,u[p+2]=a,u[p+3]=255}}},{key:"finishTile",value:function(){this._drawCtx.putImageData(this._tile,this._tileX,this._tileY),this._damage(this._tileX,this._tileY,this._tile.width,this._tile.height)}},{key:"blitImage",value:function(e,t,i,r,n,s,o){if(0===this._renderQ.length||o)this._bgrxImageData(e,t,i,r,n,s);else{var a=new Uint8Array(i*r*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blit",data:a,x:e,y:t,width:i,height:r})}}},{key:"blitRgbImage",value:function(e,t,i,r,n,s,o){if(0===this._renderQ.length||o)this._rgbImageData(e,t,i,r,n,s);else{var a=new Uint8Array(i*r*3);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgb",data:a,x:e,y:t,width:i,height:r})}}},{key:"blitRgbxImage",value:function(e,t,i,r,n,s,o){if(0===this._renderQ.length||o)this._rgbxImageData(e,t,i,r,n,s);else{var a=new Uint8Array(i*r*4);a.set(new Uint8Array(n.buffer,0,a.length)),this._renderQPush({type:"blitRgbx",data:a,x:e,y:t,width:i,height:r})}}},{key:"drawImage",value:function(e,t,i){this._drawCtx.drawImage(e,t,i),this._damage(t,i,e.width,e.height)}},{key:"autoscale",value:function(e,t){var i;if(0===e||0===t)i=0;else{var r=this._viewportLoc,n=e/t;i=r.w/r.h>=n?e/r.w:t/r.h}this._rescale(i)}},{key:"_rescale",value:function(e){this._scale=e;var t=this._viewportLoc,i=e*t.w+"px",r=e*t.h+"px";this._target.style.width===i&&this._target.style.height===r||(this._target.style.width=i,this._target.style.height=r)}},{key:"_setFillColor",value:function(e){var t="rgb("+e[2]+","+e[1]+","+e[0]+")";t!==this._prevDrawStyle&&(this._drawCtx.fillStyle=t,this._prevDrawStyle=t)}},{key:"_rgbImageData",value:function(e,t,i,r,n,s){for(var o=this._drawCtx.createImageData(i,r),a=o.data,l=0,c=s;l<i*r*4;l+=4,c+=3)a[l]=n[c],a[l+1]=n[c+1],a[l+2]=n[c+2],a[l+3]=255;this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_bgrxImageData",value:function(e,t,i,r,n,s){for(var o=this._drawCtx.createImageData(i,r),a=o.data,l=0,c=s;l<i*r*4;l+=4,c+=4)a[l]=n[c+2],a[l+1]=n[c+1],a[l+2]=n[c],a[l+3]=255;this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_rgbxImageData",value:function(e,t,i,r,n,s){var o;a.supportsImageMetadata?o=new ImageData(new Uint8ClampedArray(n.buffer,n.byteOffset,i*r*4),i,r):(o=this._drawCtx.createImageData(i,r)).data.set(new Uint8ClampedArray(n.buffer,n.byteOffset,i*r*4)),this._drawCtx.putImageData(o,e,t),this._damage(e,t,o.width,o.height)}},{key:"_renderQPush",value:function(e){this._renderQ.push(e),1===this._renderQ.length&&this._scanRenderQ()}},{key:"_resumeRenderQ",value:function(){this.removeEventListener("load",this._noVNCDisplay._resumeRenderQ),this._noVNCDisplay._scanRenderQ()}},{key:"_scanRenderQ",value:function(){for(var e=!0;e&&this._renderQ.length>0;){var t=this._renderQ[0];switch(t.type){case"flip":this.flip(!0);break;case"copy":this.copyImage(t.oldX,t.oldY,t.x,t.y,t.width,t.height,!0);break;case"fill":this.fillRect(t.x,t.y,t.width,t.height,t.color,!0);break;case"blit":this.blitImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgb":this.blitRgbImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"blitRgbx":this.blitRgbxImage(t.x,t.y,t.width,t.height,t.data,0,!0);break;case"img":if(t.img.complete&&0!==t.img.width&&0!==t.img.height){if(t.img.width!==t.width||t.img.height!==t.height)return void s.Error("Decoded image has incorrect dimensions. Got "+t.img.width+"x"+t.img.height+". Expected "+t.width+"x"+t.height+".");this.drawImage(t.img,t.x,t.y)}else t.img._noVNCDisplay=this,t.img.addEventListener("load",this._resumeRenderQ),e=!1}e&&this._renderQ.shift()}0===this._renderQ.length&&this._flushing&&(this._flushing=!1,this.onflush())}},{key:"scale",get:function(){return this._scale},set:function(e){this._rescale(e)}},{key:"clipViewport",get:function(){return this._clipViewport},set:function(e){this._clipViewport=e;var t=this._viewportLoc;this.viewportChangeSize(t.w,t.h),this.viewportChangePos(0,0)}},{key:"width",get:function(){return this._fbWidth}},{key:"height",get:function(){return this._fbHeight}}])&&u(t.prototype,i),r&&u(t,r),e}();t.default=h},Mmt2:
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/websock.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ./util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._websocket=null,this._rQi=0,this._rQlen=0,this._rQbufferSize=4194304,this._rQ=null,this._sQbufferSize=10240,this._sQlen=0,this._sQ=null,this._eventHandlers={message:function(){},open:function(){},close:function(){},error:function(){}}}var t,i,r;return t=e,(i=[{key:"rQpeek8",value:function(){return this._rQ[this._rQi]}},{key:"rQskipBytes",value:function(e){this._rQi+=e}},{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(e){for(var t=0,i=e-1;i>=0;i--)t+=this._rQ[this._rQi++]<<8*i;return t}},{key:"rQshiftStr",value:function(e){void 0===e&&(e=this.rQlen);for(var t="",i=0;i<e;i+=4096){var r=this.rQshiftBytes(Math.min(4096,e-i));t+=String.fromCharCode.apply(null,r)}return t}},{key:"rQshiftBytes",value:function(e){return void 0===e&&(e=this.rQlen),this._rQi+=e,new Uint8Array(this._rQ.buffer,this._rQi-e,e)}},{key:"rQshiftTo",value:function(e,t){void 0===t&&(t=this.rQlen),e.set(new Uint8Array(this._rQ.buffer,this._rQi,t)),this._rQi+=t}},{key:"rQslice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.rQlen;return new Uint8Array(this._rQ.buffer,this._rQi+e,t-e)}},{key:"rQwait",value:function(e,t,i){if(this.rQlen<t){if(i){if(this._rQi<i)throw new Error("rQwait cannot backup "+i+" bytes");this._rQi-=i}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(e){this._sQ.set(e,this._sQlen),this._sQlen+=e.length,this.flush()}},{key:"sendString",value:function(e){this.send(e.split("").map((function(e){return e.charCodeAt(0)})))}},{key:"off",value:function(e){this._eventHandlers[e]=function(){}}},{key:"on",value:function(e,t){this._eventHandlers[e]=t}},{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(e,t){var i=this;this.init(),this._websocket=new WebSocket(e,t),this._websocket.binaryType="arraybuffer",this._websocket.onmessage=this._recvMessage.bind(this),this._websocket.onopen=function(){n.Debug(">> WebSock.onopen"),i._websocket.protocol&&n.Info("Server choose sub-protocol: "+i._websocket.protocol),i._eventHandlers.open(),n.Debug("<< WebSock.onopen")},this._websocket.onclose=function(e){n.Debug(">> WebSock.onclose"),i._eventHandlers.close(e),n.Debug("<< WebSock.onclose")},this._websocket.onerror=function(e){n.Debug(">> WebSock.onerror: "+e),i._eventHandlers.error(e),n.Debug("<< WebSock.onerror: "+e)}}},{key:"close",value:function(){this._websocket&&(this._websocket.readyState!==WebSocket.OPEN&&this._websocket.readyState!==WebSocket.CONNECTING||(n.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(e){var t=8*(this._rQlen-this._rQi+e),i=this._rQbufferSize<t;if(i&&(this._rQbufferSize=Math.max(2*this._rQbufferSize,t)),this._rQbufferSize>41943040&&(this._rQbufferSize=41943040,this._rQbufferSize-this.rQlen<e))throw new Error("Receive Queue buffer exceeded 41943040 bytes, and the new message could not fit");if(i){var r=this._rQ.buffer;this._rQ=new Uint8Array(this._rQbufferSize),this._rQ.set(new Uint8Array(r,this._rQi,this._rQlen-this._rQi))}else 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(e){var t=new Uint8Array(e);t.length>this._rQbufferSize-this._rQlen&&this._expandCompactRQ(t.length),this._rQ.set(t,this._rQlen),this._rQlen+=t.length}},{key:"_recvMessage",value:function(e){this._DecodeMessage(e.data),this.rQlen>0?(this._eventHandlers.message(),this._rQlen==this._rQi&&(this._rQlen=0,this._rQi=0)):n.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(e){this._rQi=e}},{key:"rQlen",get:function(){return this._rQlen-this._rQi}}])&&o(t.prototype,i),r&&o(t,r),e}();t.default=a},"N/zr":
|
|
|
/*!*************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/base64.js ***!
|
|
|
\*************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ./util/logging.js */"Lo0S"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}var o={toBase64Table:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),base64Pad:"=",encode:function(e){for(var t="",i=e.length,r=i%3,n=0;n<i-2;n+=3)t+=this.toBase64Table[e[n]>>2],t+=this.toBase64Table[((3&e[n])<<4)+(e[n+1]>>4)],t+=this.toBase64Table[((15&e[n+1])<<2)+(e[n+2]>>6)],t+=this.toBase64Table[63&e[n+2]];var s=i-r;return 2===r?(t+=this.toBase64Table[e[s]>>2],t+=this.toBase64Table[((3&e[s])<<4)+(e[s+1]>>4)],t+=this.toBase64Table[(15&e[s+1])<<2],t+=this.toBase64Table[64]):1===r&&(t+=this.toBase64Table[e[s]>>2],t+=this.toBase64Table[(3&e[s])<<4],t+=this.toBase64Table[64],t+=this.toBase64Table[64]),t},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 t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=e.indexOf("=")-t;i<0&&(i=e.length-t);for(var r=3*(i>>2)+Math.floor(i%4/1.5),s=new Array(r),o=0,a=0,l=0,c=t;c<e.length;c++){var u=this.toBinaryTable[127&e.charCodeAt(c)],h=e.charAt(c)===this.base64Pad;-1!==u?(a=a<<6|u,(o+=6)>=8&&(o-=8,h||(s[l++]=a>>o&255),a&=(1<<o)-1)):n.Error("Illegal character code "+e.charCodeAt(c)+" at position "+c)}if(o){var d=new Error("Corrupted base64 string");throw d.name="Base64-Error",d}return s}};t.default=o},NBmB:
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/encodings.js ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodingName=function(e){switch(e){case r.encodingRaw:return"Raw";case r.encodingCopyRect:return"CopyRect";case r.encodingRRE:return"RRE";case r.encodingHextile:return"Hextile";case r.encodingTight:return"Tight";case r.encodingTightPNG:return"TightPNG";default:return"[unknown encoding "+e+"]"}},t.encodings=void 0;var r={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};t.encodings=r},OLES:
|
|
|
/*!*********************************************************!*\
|
|
|
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
|
|
|
\*********************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";var r=i("U8pU"),n=i("VTBJ"),s=i("Ff2n"),o=i("q1tI"),a=i("uciX"),l=i("7ixt"),c=function(e){var t=e.overlay,i=e.prefixCls,r=e.id,n=e.overlayInnerStyle;return o.createElement("div",{className:"".concat(i,"-inner"),id:r,role:"tooltip",style:n},"function"==typeof t?t():t)},u=Object(o.forwardRef)((function(e,t){var i=e.overlayClassName,u=e.trigger,h=void 0===u?["hover"]:u,d=e.mouseEnterDelay,f=void 0===d?0:d,p=e.mouseLeaveDelay,g=void 0===p?.1:p,v=e.overlayStyle,m=e.prefixCls,y=void 0===m?"rc-tooltip":m,_=e.children,b=e.onVisibleChange,S=e.afterVisibleChange,C=e.transitionName,w=e.animation,k=e.placement,x=void 0===k?"right":k,E=e.align,T=void 0===E?{}:E,L=e.destroyTooltipOnHide,A=void 0!==L&&L,R=e.defaultVisible,D=e.getTooltipContainer,O=e.overlayInnerStyle,M=Object(s.a)(e,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),I=Object(o.useRef)(null);Object(o.useImperativeHandle)(t,(function(){return I.current}));var P=Object(n.a)({},M);"visible"in e&&(P.popupVisible=e.visible);var F=!1,B=!1;if("boolean"==typeof A)F=A;else if(A&&"object"===Object(r.a)(A)){var N=A.keepParent;F=!0===N,B=!1===N}return o.createElement(a.a,Object.assign({popupClassName:i,prefixCls:y,popup:function(){var t=e.arrowContent,i=void 0===t?null:t,r=e.overlay,n=e.id;return[o.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},i),o.createElement(c,{key:"content",prefixCls:y,id:n,overlay:r,overlayInnerStyle:O})]},action:h,builtinPlacements:l.a,popupPlacement:x,ref:I,popupAlign:T,getPopupContainer:D,onPopupVisibleChange:b,afterPopupVisibleChange:S,popupTransitionName:C,popupAnimation:w,defaultPopupVisible:R,destroyPopupOnHide:F,autoDestroy:B,mouseLeaveDelay:g,popupStyle:v,mouseEnterDelay:f},P),_)}));t.a=u},Ot1p:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/index.tsx + 6 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(e,t,i){"use strict";i("2qtc");var r=i("kLXV"),n=i("rAM+"),s=(i("miYZ"),i("tsqr")),o=i("9og8"),a=i("tJVT"),l=i("jrin"),c=i("WmNS"),u=i.n(c),h=i("q1tI"),d=i.n(h),f=i("VrN/"),p=i.n(f),g=i("bdgK"),v=(i("p77/"),i("Bd2K"),i("ELLl"),i("19Vz"),i("lZu9"),i("+NIl"),i("kSUc"),i("9Bee")),m=function(e){var t=e.value,i=void 0===t?"":t,r=(e.className,e.showTextOnly,e.showLines,e.style,Object(h.useMemo)((function(){return""}),[i]));return d.a.createElement(d.a.Fragment,null,d.a.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))},y=i("0Owb"),_=(i("dejd"),i("C+DQ"),i("1vsH")),b=i("m3rI"),S=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function C(e){var t=e.onActionCallback,i=e.title,r=e.icon,n=e.actionName,s=e.className,o=void 0===s?"":s,a=e.children;return d.a.createElement("a",{title:i,className:o,onClick:function(){t(n)}},d.a.createElement("i",{className:"md-iconfont ".concat(r)}),a)}var w=function(e){var t=e.watch,i=e.showNullButton,r=e.onActionCallback,n=e.fullScreen,s=e.insertTemp,o=e.hidetoolBar,a=e.uuid;e.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(_.D)("_educoder_session_login"),"&_educoder_session=").concat(Object(_.D)("_educoder_session"),"&key=").concat(a,"&api=").concat(encodeURIComponent(b.a.PROXY_SERVER)));var l=[].concat(S,[{title:"".concat(t?"关闭实时预览":"开启实时预览"),icon:"".concat(t?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return d.a.createElement("ul",{className:"markdown-toolbar-container"},!o&&l.map((function(e,t){return d.a.createElement("li",{key:t},e.actionName?d.a.createElement(C,Object(y.a)({},e,{onActionCallback:r})):d.a.createElement("span",{className:"v-line"}))})),i?d.a.createElement("li",null,d.a.createElement(C,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:r},d.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,s&&d.a.createElement("li",null,d.a.createElement(C,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(s),onActionCallback:r},d.a.createElement("span",{className:"fill-tip"},"插入模板"))),d.a.createElement("li",{className:"btn-full-screen"},d.a.createElement(C,{icon:"".concat(n?"icon-shrink":"icon-enlarge"),title:n?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:r})))},k=i("M8RZ"),x=(i("+L6B"),i("2/Rp")),E=(i("y8nQ"),i("Vl3Y")),T=(i("5NDa"),i("5rEg")),L={labelCol:{span:4},wrapperCol:{span:20}},A=function(e){var t=e.callback,i=e.onCancel;return d.a.createElement(E.a,Object(y.a)({},L,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(e){t(e)}}),d.a.createElement(E.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},d.a.createElement(T.a,null)),d.a.createElement(E.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},d.a.createElement(T.a,null)),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(x.a,{type:"ghost",onClick:i},"取消")))},R=i("7ahc"),D=i("k1fw"),O=(i("HmJG"),i("BjJ7")),M=E.a.useForm,I={width:280,marginRight:10},P={labelCol:{span:5},wrapperCol:{span:19}},F=function(e){var t=e.callback,i=e.onCancel,r=M(),n=Object(a.a)(r,1)[0],s=Object(h.useRef)();function o(e,t){n.setFieldsValue({src:"/api/attachments/".concat(e.id,"?type=").concat(e.content_type),type:t.type})}return d.a.createElement(E.a,Object(y.a)({form:n},P,{className:"upload-image-panel",onFinish:function(e){t(Object(D.a)(Object(D.a)({},e),{},{name:s.current}))}}),d.a.createElement(E.a.Item,{label:"文件地址",required:!0},d.a.createElement("div",{className:"flex-container"},d.a.createElement(E.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},d.a.createElement(T.a,{style:I})),d.a.createElement(B,{onFileChange:function(e){var t=e.target.files[0];s.current=t.name,N(t,o)}}))),d.a.createElement(E.a.Item,{label:"文件描述",name:"alt"},d.a.createElement(T.a,{style:{width:264}})),d.a.createElement(E.a.Item,{style:{textAlign:"right"}},d.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(x.a,{type:"ghost",onClick:i},"取消")))};function B(e){var t=e.onFileChange;return d.a.createElement("a",{className:"upload-button"},"本地上传",d.a.createElement("input",{type:"file",onChange:t}))}function N(e,t){if(!e)throw new String("没有文件");var i=new FormData;i.append("editormd-image-file",e),i.append("file_param_name","editormd-image-file"),i.append("byxhr","true");var r=new window.XMLHttpRequest;r.withCredentials=!0,r.addEventListener("load",(function(i){t(JSON.parse(i.target.responseText),e)}),!1),r.addEventListener("error",(function(e){console.error(e)}),!1),r.open("POST","".concat(O.a,"/api/attachments.json")),r.send(i)}i("giR+");var H,j,U=i("fyUT"),K=(i("7Kak"),i("9yH6")),X=K.a.Group,W={margin:"0 8px"},z=function(e){var t=e.callback,i=e.onCancel;return d.a.createElement(E.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(e){t(e)}},d.a.createElement("div",{className:"flex-container"},d.a.createElement("span",{style:W},"单元格数:"),d.a.createElement("span",{style:W},"行数"),d.a.createElement(E.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},d.a.createElement(U.a,null)),d.a.createElement("span",{style:W},"列数"),d.a.createElement(E.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},d.a.createElement(U.a,null))),d.a.createElement("div",{className:"flex-container",style:{marginTop:12}},d.a.createElement("span",{style:W},"对齐方式:"),d.a.createElement(E.a.Item,{name:"align"},d.a.createElement(X,null,d.a.createElement(K.a,{value:"default"},d.a.createElement("i",{className:"fa fa-align-justify"})),d.a.createElement(K.a,{value:"left"},d.a.createElement("i",{className:"fa fa-align-left"})),d.a.createElement(K.a,{value:"center"},d.a.createElement("i",{className:"fa fa-align-center"})),d.a.createElement(K.a,{value:"right"},d.a.createElement("i",{className:"fa fa-align-right"}))))),d.a.createElement("div",{className:"flex-container flex-end"},d.a.createElement(x.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),d.a.createElement(x.a,{type:"ghost",onClick:i},"取消")))},G=i("ErOA"),V=i("7Cbv"),q="------------",Q={default:q,left:":".concat(q),center:":".concat(q,":"),right:"".concat(q,":")},Y=i("9VGf");function Z(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}var $=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",J=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ee=(H={},Object(l.a)(H,$+"-B","bold"),Object(l.a)(H,$+"-I","italic"),H),te=(j={},Object(l.a)(j,"link","添加链接"),Object(l.a)(j,"code-block","添加代码块"),Object(l.a)(j,"upload-image","添加文件"),Object(l.a)(j,"add-table","添加表格"),j);t.a=function(e){var t=e.defaultValue,i=void 0===t?"":t,c=e.onChange,f=e.width,y=void 0===f?"100%":f,_=e.height,S=void 0===_?400:_,C=e.miniToolbar,x=void 0!==C&&C,E=e.isFocus,T=void 0!==E&&E,L=e.watch,D=e.insertTemp,O=e.mode,M=void 0===O?"markdown":O,I=e.id,P=void 0===I?"markdown-editor-id":I,B=e.showResizeBar,H=void 0!==B&&B,j=e.noStorage,U=void 0!==j&&j,K=e.showNullButton,X=void 0!==K&&K,W=e.hidetoolBar,q=void 0!==W&&W,$=e.fullScreen,ie=void 0!==$&&$,re=e.onBlur,ne=e.onCMBeforeChange,se=e.onFullScreen,oe=e.className,ae=void 0===oe?"":oe,le=e.disablePaste,ce=void 0!==le&&le,ue=e.placeholder,he=void 0===ue?"":ue,de=e.values,fe=void 0===de?"":de,pe=Object(h.useState)(null),ge=Object(a.a)(pe,2),ve=ge[0],me=ge[1],ye=Object(h.useState)(i),_e=Object(a.a)(ye,2),be=_e[0],Se=_e[1],Ce=Object(h.useState)(L),we=Object(a.a)(Ce,2),ke=we[0],xe=we[1],Ee=Object(h.useState)(ie),Te=Object(a.a)(Ee,2),Le=Te[0],Ae=Te[1],Re=Object(h.useState)(""),De=Object(a.a)(Re,2),Oe=De[0],Me=De[1],Ie=Object(h.useState)(0),Pe=Object(a.a)(Ie,2),Fe=Pe[0],Be=Pe[1],Ne=Object(h.useState)(S),He=Object(a.a)(Ne,2),je=He[0],Ue=He[1],Ke=Object(h.useState)(!1),Xe=Object(a.a)(Ke,2),We=(Xe[0],Xe[1]),ze=Object(h.useRef)(Object(V.a)()),Ge=Object(h.useRef)(!1),Ve=Object(h.useRef)(),qe=Object(h.useRef)(),Qe=Object(h.useRef)(),Ye=Object(h.useRef)(),Ze=Object(h.useRef)(),$e=function(){var e=Object(o.a)(u.a.mark((function e(){var t,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(G.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:ze.current}});case 2:null!=(i=e.sent)&&null!==(t=i.attachments)&&void 0!==t&&t.length&&(console.log("cm:",ve,qe),i.attachments.map((function(e){e.content_type.indexOf("image")>-1?ve.replaceSelection(".concat(e.content_type,")")):e.content_type.indexOf("video")>-1?ve.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):e.content_type.indexOf("pdf")>-1?ve.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,'&disposition=inline" target="_blank">').concat(e.name,"</a>")):ve.replaceSelection("[".concat(e.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")"))})));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(h.useEffect)((function(){Se(fe),null==ve||ve.setValue(fe)}),[fe]),Object(h.useEffect)((function(){null==se||se(Le)}),[Le]),Object(h.useEffect)((function(){if(qe.current){var e=p.a.fromTextArea(qe.current,{mode:M,lineNumbers:!x,lineWrapping:!0,value:i,autoCloseTags:!0,autoCloseBrackets:!0});function t(t,i){if(!ce){var r=i.clipboardData;if(r){var n=r.types.toString(),o=r.items;if("Files"===n||r.types.indexOf("Files")>-1){if(i.preventDefault(),"stex"==M)return;try{var a,l=o[1];"file"===(null===(a=o[0])||void 0===a?void 0:a.kind)&&(l=o[0]);var c=l.getAsFile(),u=c.name.split(".").pop();N(c,(function(t){var i,r,n;t.id?(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("image"))>-1?e.replaceSelection(".concat(t.content_type,")")):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(c.type,'&disposition=inline" target="_blank">').concat(c.name,"</a>")):J.includes(u)?e.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(c.name,"</a>")):e.replaceSelection("[".concat(c.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))}catch(i){s.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}i.preventDefault()}return T&&e.focus(),e.on("paste",t),e.on("dragleave",(function(e,t){Qe.current.classList.remove("mouse-hover-md")})),e.on("dragover",(function(e,t){Qe.current.classList.add("mouse-hover-md")})),e.on("drop",(function(t,i){var r;if(Qe.current.classList.add("mouse-hover-md"),(r=i.dataTransfer.files).length>0){i.preventDefault(),i.stopPropagation();for(var n=function(t){var i=r[t],n=i.name.split(".").pop();N(i,(function(t){var r,s,o;t.id?(null==i||null===(r=i.type)||void 0===r?void 0:r.indexOf("image"))>-1?e.replaceSelection(".concat(t.content_type,")")):(null==i||null===(s=i.type)||void 0===s?void 0:s.indexOf("video"))>-1?e.replaceSelection('<video width="100%" controls src="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,'"></video>')):(null==i||null===(o=i.type)||void 0===o?void 0:o.indexOf("pdf"))>-1?e.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(i.type,'&disposition=inline" target="_blank">').concat(i.name,"</a>")):J.includes(n)?e.replaceSelection('<a href="'.concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,'?type=office&disposition=inline" target="_blank">').concat(i.name,"</a>")):e.replaceSelection("[".concat(i.name,"](").concat(b.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")")):401===(null==t?void 0:t.status)&&(document.location.href="/user/login")}))},s=0;s<r.length;s++)n(s)}})),me(e),function(){e.off("paste",t)}}}),[]);var Je=Object(h.useCallback)((function(){Qe.current}),[je,Qe,Le]);Object(h.useEffect)((function(){if(ve){var e=function(){var e=new g.default((function(e){var t,i=Object(n.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&(Je(),ve.setSize("100%","100%"),ve.refresh())}}catch(e){i.e(e)}finally{i.f()}}));return e.observe(qe.current.parentElement),e}();return function(){e.unobserve(qe.current.parentElement)}}}),[ve,Je]),Object(h.useEffect)((function(){if(ve){for(var e=[],t=function(){var t=r[i],n=(s=Object(a.a)(t,2))[0],o=s[1],c=Object(l.a)({},n,(function(){et(o)}));e.push(c),ve.addKeyMap(c)},i=0,r=Object.entries(ee);i<r.length;i++){var s;t()}return Ve.current=setInterval((function(){Ge.current&&$e()}),4e3),function(){clearInterval(Ve.current);var t,i=Object(n.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;ve.removeKeyMap(r)}}catch(e){i.e(e)}finally{i.f()}}}}),[ve]),Object(h.useEffect)((function(){ie!==Le&&Ae(ie)}),[ie]),Object(Y.a)((function(){if(!U&&Fe>0){var e=(new Date).getTime(),t=window.sessionStorage.getItem(P);e>=Fe+1e4&&(!t||t!==be)&&(window.sessionStorage.setItem(P,be),We(!0))}}),1e4),Object(h.useEffect)((function(){xe(L)}),[ve,L]),Object(h.useEffect)((function(){ve&&T&&ve.focus()}),[ve,T]),Object(h.useEffect)((function(){if(ke&&ve){var e=ve.getScrollerElement();function t(e){var t=e.target;if(Ze.current){var i=t.scrollTop/t.scrollHeight;Ze.current.scrollTop=Ze.current.scrollHeight*i}}return e.addEventListener("scroll",t),function(){e.removeEventListener("scroll",t)}}}),[ve,ke]),Object(h.useEffect)((function(){if(ve&&ne){function e(e,t){ne(e,t)}return ve.on("beforeChange",e),function(){ve.off("beforeChange",e)}}}),[ve,ne]),Object(h.useEffect)((function(){if(ve&&re){function e(){re(ve.getValue())}return ve.on("blur",e),function(){ve.off("blur",e)}}}),[ve,re]),Object(h.useEffect)((function(){if(ve){function e(e){var t=e.getValue();Se(t),Be((new Date).getTime()),e.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(t)}return ve.on("change",e),function(){ve.off("change",e)}}}),[ve,c]),Object(h.useEffect)((function(){ve&&(null==i?(ve.setValue(""),Se("")):i!==ve.getValue()&&(ve.setValue(i),Se(i),ve.setCursor(ve.lineCount(),0)))}),[ve,i]);var et=Object(h.useCallback)((function(e){var t=ve.getCursor(),i=ve.getSelection(),r=i.split("\n");switch(e){case"bold":return ve.replaceSelection("**"+i+"**"),""===i&&ve.setCursor(t.line,t.ch+2),ve.focus();case"italic":return ve.replaceSelection("*"+i+"*"),""===i&&ve.setCursor(t.line,t.ch+1),ve.focus();case"code":return ve.replaceSelection("`"+i+"`"),""===i&&ve.setCursor(t.line,t.ch+1),ve.focus();case"inline-latex":return ve.replaceSelection("`$$"+i+"$$`"),""===i&&ve.setCursor(t.line,t.ch+3),ve.focus();case"latex":return ve.replaceSelection("```latex\n"+i+"\n```"),ve.setCursor(t.line+1,i.length+1),ve.focus();case"line-break":return ve.replaceSelection("<br/>\n"),ve.focus();case"list-ul":return""===i?ve.replaceSelection("- "+i):ve.replaceSelection(r.map((function(e){return""===e?"":"- ".concat(e)})).join("\n")),ve.focus();case"list-ol":return""===i?ve.replaceSelection("1. "+i):ve.replaceSelection(r.map((function(e,t){return""===e?"":"".concat(t+1,". ").concat(e)})).join("\n")),ve.focus();case"add-null-ch":return""===i&&ve.setCursor(t.line,t.ch+1),ve.replaceSelection("▁"),ve.focus();case"inster-template-1":return""===i&&ve.setCursor(t.line,t.ch),ve.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),ve.focus();case"eraser":return ve.setValue(""),ve.focus();case"trigger-watch":return xe(!ke),ve.focus();case"trigger-full-screen":return Ae(!Le),ve.focus();case"link":return void Me("link");case"code-block":return void Me("code-block");case"upload-image":return void Me("upload-image");case"add-table":return void Me("add-table");default:throw new Error}}),[ve,ke,Le]),tt=Object(h.useCallback)((function(e){switch(Me(""),Oe){case"link":var t=e.title,i=e.link;return ve.replaceSelection("[".concat(t,"](").concat(i,")")),ve.focus();case"code-block":var r=e.language,n=e.content;return ve.replaceSelection(["```"+r,n,"```"].join("\n")),ve.focus();case"upload-image":var s=e.src,o=e.alt,a=e.name;return s.indexOf("type=image")>-1?ve.replaceSelection(".concat(s,' "').concat(o||"",'" )')):s.indexOf("type=application/pdf")>-1?ve.replaceSelection('<a href="'.concat(s,'&disposition=inline" target="_blank">').concat(a,"</a>")):ve.replaceSelection('<a href="'.concat(s,'" target="_blank">').concat(a,"</a>")),ve.focus();case"add-table":for(var l=e.row,c=e.col,u=e.align,h="\n",d=0;d<l;d++){for(var f=[],p=[],g=0;g<c;g++)1===d&&p.push(Q[u]),f.push(" ");1===d&&(h+="| ".concat(p.join(" | ")," |\n")),h+="| ".concat(f.join(1===c?"":" | ")," |\n")}return ve.replaceSelection(h+"\n"),ve.focus();default:throw new Error}}),[ve,Oe]),it=Object(h.useMemo)((function(){switch(Oe){case"link":return d.a.createElement(A,{callback:tt,onCancel:rt});case"code-block":return d.a.createElement(R.b,{callback:tt,onCancel:rt});case"upload-image":return d.a.createElement(F,{callback:tt,onCancel:rt});case"add-table":return d.a.createElement(z,{callback:tt,onCancel:rt});default:return null}}),[Oe]);function rt(){Me("")}Object(h.useEffect)((function(){if(Ye.current){var e=Ye.current,t=!1,i=0;function r(e){t=!0,i=e.pageY}function n(){t=!1}function s(e){if(t){var r=e.pageY-i;r<0&&(r=0),r>300&&(r=300),Ue(S+r+"px")}}return e.addEventListener("mousedown",r),document.addEventListener("mousemove",s),document.addEventListener("mouseup",n),function(){e.removeEventListener("mousedown",r),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",n)}}}),[ve,Ye]),Object(h.useEffect)((function(){Ue(S)}),[S]);var nt={width:Z(y),height:Z(je)};Object(h.useMemo)((function(){if(Fe){var e=new Date(Fe),t=e.getHours(),i=e.getMinutes(),r=e.getSeconds();return i=i<10?"0"+i:i,r=r<10?"0"+r:r,"".concat(t=t<10?"0"+t:t,":").concat(i,":").concat(r)}return 0}),[Fe]);return d.a.createElement(h.Fragment,null,d.a.createElement("div",{className:"markdown-editor-wrapper",ref:Qe},d.a.createElement("div",{className:"markdown-editor-container ".concat(ae," ").concat(ke?"on-preview":""," ").concat(x?"mini":""," ").concat(Le?"full-screen":""),style:nt},d.a.createElement(w,{insertTemp:D,watch:ke,fullScreen:Le,showNullButton:X,onActionCallback:et,hidetoolBar:q,uuid:ze.current,setOpenPhones:function(){Ge.current=!0}}),d.a.createElement("div",{className:"markdown-editor-body"},d.a.createElement("div",{className:"codemirror-container"},d.a.createElement("textarea",{ref:qe,placeholder:he})),ke?d.a.createElement("div",{ref:Ze,className:"preview-container"},"stex"===M&&d.a.createElement(m,{value:be}),"stex"!==M&&d.a.createElement(v.a,{edit:!0,value:be,replaces:function(e,t){var i=ve.getValue();i=i.replace(e,t),Se(i),null==ve||ve.setValue(i)}})):null))),H?d.a.createElement("a",{ref:Ye,className:"editor-resize"}):null,d.a.createElement(k.a,null,te[Oe]?d.a.createElement(r.a,{centered:!0,title:te[Oe],visible:!0,onCancel:rt,footer:null},it):null))}},P2ho:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/xtscancodes.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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}},QV2g:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/crc32.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(){for(var e,t=[],i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;r()},SJMd:
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/code-prettify/src/prettify.js ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var e=window,t=["break,continue,do,else,for,if,return,while"],i=[[t,"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"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],r=[i,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],n=[i,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],s=[i,"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"],o=[i,"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",l=[t,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[t,"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"],u=[t,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],h=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function d(e,t,i,r,n){if(i){var s={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:i,spans:null,basePos:t,decorations:null};r(s),n.push.apply(n,s.decorations)}}var f=/\S/;function p(e){for(var t=void 0,i=e.firstChild;i;i=i.nextSibling){var r=i.nodeType;t=1===r?t?e:i:3===r&&f.test(i.nodeValue)?e:t}return t===e?void 0:t}function g(e,t){var i,r={};!function(){for(var n=e.concat(t),s=[],o={},a=0,l=n.length;a<l;++a){var c=n[a],u=c[3];if(u)for(var h=u.length;--h>=0;)r[u.charAt(h)]=c;var d=c[1],f=""+d;o.hasOwnProperty(f)||(s.push(d),o[f]=null)}s.push(/[\0-\uffff]/),i=function(e){for(var t=0,i=!1,r=!1,n=0,s=e.length;n<s;++n){if((d=e[n]).ignoreCase)r=!0;else if(/[a-z]/i.test(d.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){i=!0,r=!1;break}}var o={b:8,t:9,n:10,v:11,f:12,r:13};function a(e){var t=e.charCodeAt(0);if(92!==t)return t;var i=e.charAt(1);return(t=o[i])||("0"<=i&&i<="7"?parseInt(e.substring(1),8):"u"===i||"x"===i?parseInt(e.substring(2),16):e.charCodeAt(1))}function l(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function c(e){var t=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),i=[],r="^"===t[0],n=["["];r&&n.push("^");for(var s=r?1:0,o=t.length;s<o;++s){var c=t[s];if(/\\[bdsw]/i.test(c))n.push(c);else{var u,h=a(c);s+2<o&&"-"===t[s+1]?(u=a(t[s+2]),s+=2):u=h,i.push([h,u]),u<65||h>122||(u<65||h>90||i.push([32|Math.max(65,h),32|Math.min(u,90)]),u<97||h>122||i.push([-33&Math.max(97,h),-33&Math.min(u,122)]))}}i.sort((function(e,t){return e[0]-t[0]||t[1]-e[1]}));var d=[],f=[];for(s=0;s<i.length;++s){(p=i[s])[0]<=f[1]+1?f[1]=Math.max(f[1],p[1]):d.push(f=p)}for(s=0;s<d.length;++s){var p=d[s];n.push(l(p[0])),p[1]>p[0]&&(p[1]+1>p[0]&&n.push("-"),n.push(l(p[1])))}return n.push("]"),n.join("")}function u(e){for(var r=e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),n=r.length,s=[],o=0,a=0;o<n;++o){if("("===(h=r[o]))++a;else if("\\"===h.charAt(0)){(u=+h.substring(1))&&(u<=a?s[u]=-1:r[o]=l(u))}}for(o=1;o<s.length;++o)-1===s[o]&&(s[o]=++t);for(o=0,a=0;o<n;++o){if("("===(h=r[o]))s[++a]||(r[o]="(?:");else if("\\"===h.charAt(0)){var u;(u=+h.substring(1))&&u<=a&&(r[o]="\\"+s[u])}}for(o=0;o<n;++o)"^"===r[o]&&"^"!==r[o+1]&&(r[o]="");if(e.ignoreCase&&i)for(o=0;o<n;++o){var h,d=(h=r[o]).charAt(0);h.length>=2&&"["===d?r[o]=c(h):"\\"!==d&&(r[o]=h.replace(/[a-zA-Z]/g,(function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"})))}return r.join("")}var h=[];for(n=0,s=e.length;n<s;++n){var d;if((d=e[n]).global||d.multiline)throw new Error(""+d);h.push("(?:"+u(d)+")")}return new RegExp(h.join("|"),r?"gi":"g")}(s)}();var n=t.length,s=function(e){for(var o=e.sourceCode,a=e.basePos,l=e.sourceNode,c=[a,"pln"],u=0,h=o.match(i)||[],f={},p=0,g=h.length;p<g;++p){var v,m=h[p],y=f[m],_=void 0;if("string"==typeof y)v=!1;else{var b=r[m.charAt(0)];if(b)_=m.match(b[1]),y=b[0];else{for(var C=0;C<n;++C)if(b=t[C],_=m.match(b[1])){y=b[0];break}_||(y="pln")}!(v=y.length>=5&&"lang-"===y.substring(0,5))||_&&"string"==typeof _[1]||(v=!1,y="src"),v||(f[m]=y)}var w=u;if(u+=m.length,v){var k=_[1],x=m.indexOf(k),E=x+k.length;_[2]&&(x=(E=m.length-_[2].length)-k.length);var T=y.substring(5);d(l,a+w,m.substring(0,x),s,c),d(l,a+w+x,k,S(T,k),c),d(l,a+w+E,m.substring(E),s,c)}else c.push(a+w,y)}e.decorations=c};return s}function v(e){var t=[],i=[];e.tripleQuotedStrings?t.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&i.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var r=e.hashComments;r&&(e.cStyleComments?(r>1?t.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),i.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push(["com",/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(i.push(["com",/^\/\/[^\r\n]*/,null]),i.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var n=e.regexLiterals;if(n){var s=n>1?"":"\n\r",o=s?".":"[\\S\\s]",a="/(?=[^/*"+s+"])(?:[^/\\x5B\\x5C"+s+"]|\\x5C"+o+"|\\x5B(?:[^\\x5C\\x5D"+s+"]|\\x5C"+o+")*(?:\\x5D|$))+/";i.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+a+")")])}var l=e.types;l&&i.push(["typ",l]);var c=(""+e.keywords).replace(/^ | $/g,"");c.length&&i.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push(["pln",/^\s+/,null," \r\n\t "]);var u="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(u+="(?!s*/)"),i.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(u),null]),g(t,i)}var m=v({keywords:[r,s,n,o,a,l,c,u],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(e,t,i){for(var r=/(?:^|\s)nocode(?:\s|$)/,n=/\r\n?|\n/,s=e.ownerDocument,o=s.createElement("li");e.firstChild;)o.appendChild(e.firstChild);var a=[o];function l(e){var t=e.nodeType;if(1!=t||r.test(e.className)){if((3==t||4==t)&&i){var o=e.nodeValue,a=o.match(n);if(a){var u=o.substring(0,a.index);e.nodeValue=u;var h=o.substring(a.index+a[0].length);if(h)e.parentNode.insertBefore(s.createTextNode(h),e.nextSibling);c(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName)c(e),e.parentNode&&e.parentNode.removeChild(e);else for(var d=e.firstChild;d;d=d.nextSibling)l(d)}function c(e){for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var t,i=function e(t,i){var r=i?t.cloneNode(!1):t,n=t.parentNode;if(n){var s=e(n,1),o=t.nextSibling;s.appendChild(r);for(var a=o;a;a=o)o=a.nextSibling,s.appendChild(a)}return r}(e.nextSibling,0);(t=i.parentNode)&&1===t.nodeType;)i=t;a.push(i)}for(var u=0;u<a.length;++u)l(a[u]);t===(0|t)&&a[0].setAttribute("value",t);var h=s.createElement("ol");h.className="linenums";for(var d=Math.max(0,t-1|0)||0,f=(u=0,a.length);u<f;++u)(o=a[u]).className="L"+(u+d)%10,o.firstChild||o.appendChild(s.createTextNode(" ")),h.appendChild(o);e.appendChild(h)}var _={};function b(t,i){for(var r=i.length;--r>=0;){var n=i[r];_.hasOwnProperty(n)?e.console&&console.warn("cannot override language handler %s",n):_[n]=t}}function S(e,t){return e&&_.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),_[e]}function C(t){var i,r,n,s,o,a,l,c=t.langExtension;try{var u=(i=t.sourceNode,r=t.pre,n=/(?:^|\s)nocode(?:\s|$)/,s=[],o=0,a=[],l=0,function e(t){var i=t.nodeType;if(1==i){if(n.test(t.className))return;for(var c=t.firstChild;c;c=c.nextSibling)e(c);var u=t.nodeName.toLowerCase();"br"!==u&&"li"!==u||(s[l]="\n",a[l<<1]=o++,a[l++<<1|1]=t)}else if(3==i||4==i){var h=t.nodeValue;h.length&&(h=r?h.replace(/\r\n?/g,"\n"):h.replace(/[ \t\r\n]+/g," "),s[l]=h,a[l<<1]=o,o+=h.length,a[l++<<1|1]=t)}}(i),{sourceCode:s.join("").replace(/\n$/,""),spans:a}),h=u.sourceCode;t.sourceCode=h,t.spans=u.spans,t.basePos=0,S(c,h)(t),function(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var i,r,n=/\n/g,s=e.sourceCode,o=s.length,a=0,l=e.spans,c=l.length,u=0,h=e.decorations,d=h.length,f=0;for(h[d]=o,r=i=0;r<d;)h[r]!==h[r+2]?(h[i++]=h[r++],h[i++]=h[r++]):r+=2;for(d=i,r=i=0;r<d;){for(var p=h[r],g=h[r+1],v=r+2;v+2<=d&&h[v+1]===g;)v+=2;h[i++]=p,h[i++]=g,r=v}d=h.length=i;var m=e.sourceNode,y="";m&&(y=m.style.display,m.style.display="none");try{for(;u<c;){l[u];var _,b=l[u+2]||o,S=h[f+2]||o,C=(v=Math.min(b,S),l[u+1]);if(1!==C.nodeType&&(_=s.substring(a,v))){t&&(_=_.replace(n,"\r")),C.nodeValue=_;var w=C.ownerDocument,k=w.createElement("span");k.className=h[f+1];var x=C.parentNode;x.replaceChild(k,C),k.appendChild(C),a<b&&(l[u+1]=C=w.createTextNode(s.substring(v,b)),x.insertBefore(C,k.nextSibling))}(a=v)>=b&&(u+=2),a>=S&&(f+=2)}}finally{m&&(m.style.display=y)}}(t)}catch(t){e.console&&console.log(t&&t.stack||t)}}function w(e,t,i){var r=i||!1,n=t||null,s=document.createElement("div");return s.innerHTML="<pre>"+e+"</pre>",s=s.firstChild,r&&y(s,r,!0),C({langExtension:n,numberLines:r,sourceNode:s,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),s.innerHTML}function k(t,i){var r=i||document.body,n=r.ownerDocument||document;function s(e){return r.getElementsByTagName(e)}for(var o=[s("pre"),s("code"),s("xmp")],a=[],l=0;l<o.length;++l)for(var c=0,u=o[l].length;c<u;++c)a.push(o[l][c]);o=null;var h=Date;h.now||(h={now:function(){return+new Date}});var d=0,f=/\blang(?:uage)?-([\w.]+)(?!\S)/,g=/\bprettyprint\b/,v=/\bprettyprinted\b/,m=/pre|xmp/i,_=/^code$/i,b=/^(?:pre|code|xmp)$/i,S={};!function i(){for(var r=e.PR_SHOULD_USE_CONTINUATION?h.now()+250:1/0;d<a.length&&h.now()<r;d++){for(var s=a[d],o=S,l=s;l=l.previousSibling;){var c=l.nodeType,u=(7===c||8===c)&&l.nodeValue;if(u?!/^\??prettify\b/.test(u):3!==c||/\S/.test(l.nodeValue))break;if(u){o={},u.replace(/\b(\w+)=([\w:.%+-]+)/g,(function(e,t,i){o[t]=i}));break}}var w=s.className;if((o!==S||g.test(w))&&!v.test(w)){for(var k=!1,x=s.parentNode;x;x=x.parentNode){var E=x.tagName;if(b.test(E)&&x.className&&g.test(x.className)){k=!0;break}}if(!k){s.className+=" prettyprinted";var T,L,A=o.lang;if(!A)!(A=w.match(f))&&(T=p(s))&&_.test(T.tagName)&&(A=T.className.match(f)),A&&(A=A[1]);if(m.test(s.tagName))L=1;else{var R=s.currentStyle,D=n.defaultView,O=R?R.whiteSpace:D&&D.getComputedStyle?D.getComputedStyle(s,null).getPropertyValue("white-space"):0;L=O&&"pre"===O.substring(0,3)}var M=o.linenums;(M="true"===M||+M)||(M=!!(M=w.match(/\blinenums\b(?::(\d+))?/))&&(!M[1]||!M[1].length||+M[1])),M&&y(s,M,L),C({langExtension:A,sourceNode:s,numberLines:M,pre:L,sourceCode:null,basePos:null,spans:null,decorations:null})}}}d<a.length?e.setTimeout(i,250):"function"==typeof t&&t()}()}b(m,["default-code"]),b(g([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["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"]),b(g([["pln",/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],["pun",/^[=<>\/]+/],["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"]),b(g([],[["atv",/^[\s\S]+/]]),["uq.val"]),b(v({keywords:r,hashComments:!0,cStyleComments:!0,types:h}),["c","cc","cpp","cxx","cyc","m"]),b(v({keywords:"null,true,false"}),["json"]),b(v({keywords:s,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:h}),["cs"]),b(v({keywords:n,cStyleComments:!0}),["java"]),b(v({keywords:u,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),b(v({keywords:l,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),b(v({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),b(v({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),b(v({keywords:o,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),b(v({keywords:"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",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),b(g([],[["str",/^[\s\S]+/]]),["regex"]);var x=e.PR={createSimpleLexer:g,registerLangHandler:b,sourceDecorator:v,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ",prettyPrintOne:w,prettyPrint:k},E=e.define;"function"==typeof E&&E.amd&&E("google-code-prettify",[],(function(){return x}))}()},SZEN:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/element.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clientToElement=function(e,t,i){var r=i.getBoundingClientRect(),n={x:0,y:0};e<r.left?n.x=0:e>=r.right?n.x=r.width-1:n.x=e-r.left;t<r.top?n.y=0:t>=r.bottom?n.y=r.height-1:n.y=t-r.top;return n}},SgaC:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/rre.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._subrects=0}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,i,r,n,s,o){if(0===this._subrects){if(n.rQwait("RRE",8))return!1;this._subrects=n.rQshift32();var a=n.rQshiftBytes(4);s.fillRect(e,t,i,r,a)}for(;this._subrects>0;){if(n.rQwait("RRE",12))return!1;var l=n.rQshiftBytes(4),c=n.rQshift16(),u=n.rQshift16(),h=n.rQshift16(),d=n.rQshift16();s.fillRect(e+c,t+u,h,d,l),this._subrects--}return!0}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=n},VSMT:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/strings.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUTF8=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];try{return decodeURIComponent(escape(e))}catch(i){if(i instanceof URIError&&t)return e;throw i}},t.encodeUTF8=function(e){return unescape(encodeURIComponent(e))}},"VaU+":
|
|
|
/*!***************************************************************!*\
|
|
|
!*** ./src/pages/Shixuns/New/ImagePreview/index.less?modules ***!
|
|
|
\***************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){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/":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/codemirror/lib/codemirror.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,i=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),s=/Edge\/(\d+)/.exec(e),o=r||n||s,a=o&&(r?document.documentMode||6:+(s||n)[1]),l=!s&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!s&&/Chrome\//.test(e),h=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),g=!s&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=/Android/.test(e),m=g||v||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=g||/Mac/.test(t),_=/\bCrOS\b/.test(e),b=/win/i.test(t),S=h&&e.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(h=!1,l=!0);var C=y&&(c||h&&(null==S||S<12.11)),w=i||o&&a>=9;function k(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x,E=function(e,t){var i=e.className,r=k(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function L(e,t){return T(e).appendChild(t)}function A(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)n.appendChild(t[s]);return n}function R(e,t,i,r){var n=A(e,t,i,r);return n.setAttribute("role","presentation"),n}function D(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function O(){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 M(e,t){var i=e.className;k(t).test(i)||(e.className+=(i?" ":"")+t)}function I(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!k(i[r]).test(t)&&(t+=" "+i[r]);return t}x=document.createRange?function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(e){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};var P=function(e){e.select()};function F(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function B(e,t,i){for(var r in t||(t={}),e)!e.hasOwnProperty(r)||!1===i&&t.hasOwnProperty(r)||(t[r]=e[r]);return t}function N(e,t,i,r,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var s=r||0,o=n||0;;){var a=e.indexOf("\t",s);if(a<0||a>=t)return o+(t-s);o+=a-s,o+=i-o%i,s=a+1}}g?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:o&&(P=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=F(this.onTimeout,this)};function j(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},H.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};var U={toString:function(){return"CodeMirror.Pass"}},K={scroll:!1},X={origin:"*mouse"},W={origin:"+move"};function z(e,t,i){for(var r=0,n=0;;){var s=e.indexOf("\t",r);-1==s&&(s=e.length);var o=s-r;if(s==e.length||n+o>=t)return r+Math.min(o,t-n);if(n+=s-r,r=s+1,(n+=i-n%i)>=t)return r}}var G=[""];function V(e){for(;G.length<=e;)G.push(q(G)+" ");return G[e]}function q(e){return e[e.length-1]}function Q(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Y(){}function Z(e,t){var i;return Object.create?i=Object.create(e):(Y.prototype=e,i=new Y),t&&B(t,i),i}var $=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function J(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||$.test(e))}function ee(e,t){return t?!!(t.source.indexOf("\\w")>-1&&J(e))||t.test(e):J(e)}function te(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var ie=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function re(e){return e.charCodeAt(0)>=768&&ie.test(e)}function ne(e,t,i){for(;(i<0?t>0:t<e.length)&&re(e.charAt(t));)t+=i;return t}function se(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,s=r<0?Math.ceil(n):Math.floor(n);if(s==t)return e(s)?t:i;e(s)?i=s:t=s+r}}var oe=null;function ae(e,t,i){var r;oe=null;for(var n=0;n<e.length;++n){var s=e[n];if(s.from<t&&s.to>t)return n;s.to==t&&(s.from!=s.to&&"before"==i?r=n:oe=n),s.from==t&&(s.from!=s.to&&"before"!=i?r=n:oe=n)}return null!=r?r:oe}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,n=/[1n]/;function s(e,t,i){this.level=e,this.from=t,this.to=i}return function(o,a){var l="ltr"==a?"L":"R";if(0==o.length||"ltr"==a&&!e.test(o))return!1;for(var c,u=o.length,h=[],d=0;d<u;++d)h.push((c=o.charCodeAt(d))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(c-1536):1774<=c&&c<=2220?"r":8192<=c&&c<=8203?"w":8204==c?"b":"L");for(var f=0,p=l;f<u;++f){var g=h[f];"m"==g?h[f]=p:p=g}for(var v=0,m=l;v<u;++v){var y=h[v];"1"==y&&"r"==m?h[v]="n":i.test(y)&&(m=y,"r"==y&&(h[v]="R"))}for(var _=1,b=h[0];_<u-1;++_){var S=h[_];"+"==S&&"1"==b&&"1"==h[_+1]?h[_]="1":","!=S||b!=h[_+1]||"1"!=b&&"n"!=b||(h[_]=b),b=S}for(var C=0;C<u;++C){var w=h[C];if(","==w)h[C]="N";else if("%"==w){var k=void 0;for(k=C+1;k<u&&"%"==h[k];++k);for(var x=C&&"!"==h[C-1]||k<u&&"1"==h[k]?"1":"N",E=C;E<k;++E)h[E]=x;C=k-1}}for(var T=0,L=l;T<u;++T){var A=h[T];"L"==L&&"1"==A?h[T]="L":i.test(A)&&(L=A)}for(var R=0;R<u;++R)if(t.test(h[R])){var D=void 0;for(D=R+1;D<u&&t.test(h[D]);++D);for(var O="L"==(R?h[R-1]:l),M=O==("L"==(D<u?h[D]:l))?O?"L":"R":l,I=R;I<D;++I)h[I]=M;R=D-1}for(var P,F=[],B=0;B<u;)if(r.test(h[B])){var N=B;for(++B;B<u&&r.test(h[B]);++B);F.push(new s(0,N,B))}else{var H=B,j=F.length,U="rtl"==a?1:0;for(++B;B<u&&"L"!=h[B];++B);for(var K=H;K<B;)if(n.test(h[K])){H<K&&(F.splice(j,0,new s(1,H,K)),j+=U);var X=K;for(++K;K<B&&n.test(h[K]);++K);F.splice(j,0,new s(2,X,K)),j+=U,H=K}else++K;H<B&&F.splice(j,0,new s(1,H,B))}return"ltr"==a&&(1==F[0].level&&(P=o.match(/^\s+/))&&(F[0].from=P[0].length,F.unshift(new s(0,0,P[0].length))),1==q(F).level&&(P=o.match(/\s+$/))&&(q(F).to-=P[0].length,F.push(new s(0,u-P[0].length,u)))),"rtl"==a?F.reverse():F}}();function ce(e,t){var i=e.order;return null==i&&(i=e.order=le(e.text,t)),i}var ue=[],he=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ue).concat(i)}};function de(e,t){return e._handlers&&e._handlers[t]||ue}function fe(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var s=j(n,i);s>-1&&(r[t]=n.slice(0,s).concat(n.slice(s+1)))}}}function pe(e,t){var i=de(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function ge(e,t,i){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),pe(e,i||t.type,e,t),Se(t)||t.codemirrorIgnore}function ve(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)-1==j(i,t[r])&&i.push(t[r])}function me(e,t){return de(e,t).length>0}function ye(e){e.prototype.on=function(e,t){he(this,e,t)},e.prototype.off=function(e,t){fe(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function be(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Se(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Ce(e){_e(e),be(e)}function we(e){return e.target||e.srcElement}function ke(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}var xe,Ee,Te=function(){if(o&&a<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Le(e){if(null==xe){var t=A("span","");L(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(xe=t.offsetWidth<=1&&t.offsetHeight>2&&!(o&&a<8))}var i=xe?A("span",""):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ae(e){if(null!=Ee)return Ee;var t=L(e,document.createTextNode("AخA")),i=x(t,0,1).getBoundingClientRect(),r=x(t,1,2).getBoundingClientRect();return T(e),!(!i||i.left==i.right)&&(Ee=r.right-i.right<3)}var Re,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var s=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),o=s.indexOf("\r");-1!=o?(i.push(s.slice(0,o)),t+=o+1):(i.push(s),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Oe=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Me="oncopy"in(Re=A("div"))||(Re.setAttribute("oncopy","return;"),"function"==typeof Re.oncopy),Ie=null,Pe={},Fe={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pe[e]=t}function Ne(e){if("string"==typeof e&&Fe.hasOwnProperty(e))e=Fe[e];else if(e&&"string"==typeof e.name&&Fe.hasOwnProperty(e.name)){var t=Fe[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ne("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ne("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=Ne(t);var i=Pe[t.name];if(!i)return He(e,"text/plain");var r=i(e,t);if(je.hasOwnProperty(t.name)){var n=je[t.name];for(var s in n)n.hasOwnProperty(s)&&(r.hasOwnProperty(s)&&(r["_"+s]=r[s]),r[s]=n[s])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}var je={};function Ue(e,t){B(t,je.hasOwnProperty(e)?je[e]:je[e]={})}function Ke(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Xe(e,t){for(var i;e.innerMode&&(i=e.innerMode(t))&&i.mode!=e;)t=i.state,e=i.mode;return i||{mode:e,state:t}}function We(e,t,i){return!e.startState||e.startState(t,i)}var ze=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};function Ge(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],s=n.chunkSize();if(t<s){i=n;break}t-=s}return i.lines[t]}function Ve(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,(function(e){var s=e.text;n==i.line&&(s=s.slice(0,i.ch)),n==t.line&&(s=s.slice(t.ch)),r.push(s),++n})),r}function qe(e,t,i){var r=[];return e.iter(t,i,(function(e){r.push(e.text)})),r}function Qe(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function Ye(e){if(null==e.parent)return null;for(var t=e.parent,i=j(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function Ze(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],s=n.height;if(t<s){e=n;continue e}t-=s,i+=n.chunkSize()}return i}while(!e.lines);for(var o=0;o<e.lines.length;++o){var a=e.lines[o].height;if(t<a)break;t-=a}return i+o}function $e(e,t){return t>=e.first&&t<e.first+e.size}function Je(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function et(e,t,i){if(void 0===i&&(i=null),!(this instanceof et))return new et(e,t,i);this.line=e,this.ch=t,this.sticky=i}function tt(e,t){return e.line-t.line||e.ch-t.ch}function it(e,t){return e.sticky==t.sticky&&0==tt(e,t)}function rt(e){return et(e.line,e.ch)}function nt(e,t){return tt(e,t)<0?t:e}function st(e,t){return tt(e,t)<0?e:t}function ot(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function at(e,t){if(t.line<e.first)return et(e.first,0);var i=e.first+e.size-1;return t.line>i?et(i,Ge(e,i).text.length):function(e,t){var i=e.ch;return null==i||i>t?et(e.line,t):i<0?et(e.line,0):e}(t,Ge(e,t.line).text.length)}function lt(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=at(e,t[r]);return i}ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ze.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},ze.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=N(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?N(this.string,this.lineStart,this.tabSize):0)},ze.prototype.indentation=function(){return N(this.string,null,this.tabSize)-(this.lineStart?N(this.string,this.lineStart,this.tabSize):0)},ze.prototype.match=function(e,t,i){if("string"!=typeof e){var r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var n=function(e){return i?e.toLowerCase():e};if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ct=function(e,t){this.state=e,this.lookAhead=t},ut=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ht(e,t,i,r){var n=[e.state.modeGen],s={};bt(e,t.text,e.doc.mode,i,(function(e,t){return n.push(e,t)}),s,r);for(var o=i.state,a=function(r){i.baseTokens=n;var a=e.state.overlays[r],l=1,c=0;i.state=!0,bt(e,t.text,a.mode,i,(function(e,t){for(var i=l;c<e;){var r=n[l];r>e&&n.splice(l,1,e,n[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(a.opaque)n.splice(i,l-i,e,"overlay "+t),l=i+2;else for(;i<l;i+=2){var s=n[i+1];n[i+1]=(s?s+" ":"")+"overlay "+t}}),s),i.state=o,i.baseTokens=null,i.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)a(l);return{styles:n,classes:s.bgClass||s.textClass?s:null}}function dt(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=ft(e,Ye(t)),n=t.text.length>e.options.maxHighlightLength&&Ke(e.doc.mode,r.state),s=ht(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=s.styles,s.classes?t.styleClasses=s.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ft(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new ut(r,!0,t);var s=function(e,t,i){for(var r,n,s=e.doc,o=i?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>o;--a){if(a<=s.first)return s.first;var l=Ge(s,a-1),c=l.stateAfter;if(c&&(!i||a+(c instanceof ct?c.lookAhead:0)<=s.modeFrontier))return a;var u=N(l.text,null,e.options.tabSize);(null==n||r>u)&&(n=a-1,r=u)}return n}(e,t,i),o=s>r.first&&Ge(r,s-1).stateAfter,a=o?ut.fromSaved(r,o,s):new ut(r,We(r.mode),s);return r.iter(s,t,(function(i){pt(e,i.text,a);var r=a.line;i.stateAfter=r==t-1||r%5==0||r>=n.viewFrom&&r<n.viewTo?a.save():null,a.nextLine()})),i&&(r.modeFrontier=a.line),a}function pt(e,t,i,r){var n=e.doc.mode,s=new ze(t,e.options.tabSize,i);for(s.start=s.pos=r||0,""==t&>(n,i.state);!s.eol();)vt(n,s,i.state),s.start=s.pos}function gt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Xe(e,t);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function vt(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Xe(e,i).mode);var s=e.token(t,i);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},ut.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}},ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ut.fromSaved=function(e,t,i){return t instanceof ct?new ut(e,Ke(e.mode,t.state),i,t.lookAhead):new ut(e,Ke(e.mode,t),i)},ut.prototype.save=function(e){var t=!1!==e?Ke(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ct(t,this.maxLookAhead):t};var mt=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function yt(e,t,i,r){var n,s,o=e.doc,a=o.mode,l=Ge(o,(t=at(o,t)).line),c=ft(e,t.line,i),u=new ze(l.text,e.options.tabSize,c);for(r&&(s=[]);(r||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=vt(a,u,c.state),r&&s.push(new mt(u,n,Ke(o.mode,c.state)));return r?s:new mt(u,n,c.state)}function _t(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";null==t[r]?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function bt(e,t,i,r,n,s,o){var a=i.flattenSpans;null==a&&(a=e.options.flattenSpans);var l,c=0,u=null,h=new ze(t,e.options.tabSize,r),d=e.options.addModeClass&&[null];for(""==t&&_t(gt(i,r.state),s);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,o&&pt(e,t,r,h.pos),h.pos=t.length,l=null):l=_t(vt(i,h,r.state,d),s),d){var f=d[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!a||u!=l){for(;c<h.start;)n(c=Math.min(h.start,c+5e3),u);u=l}h.start=h.pos}for(;c<h.pos;){var p=Math.min(h.pos,c+5e3);n(p,u),c=p}}var St=!1,Ct=!1;function wt(e,t,i){this.marker=e,this.from=t,this.to=i}function kt(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function xt(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function Et(e,t){if(t.full)return null;var i=$e(e,t.from.line)&&Ge(e,t.from.line).markedSpans,r=$e(e,t.to.line)&&Ge(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,s=t.to.ch,o=0==tt(t.from,t.to),a=function(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var s=e[n],o=s.marker;if(null==s.from||(o.inclusiveLeft?s.from<=t:s.from<t)||s.from==t&&"bookmark"==o.type&&(!i||!s.marker.insertLeft)){var a=null==s.to||(o.inclusiveRight?s.to>=t:s.to>t);(r||(r=[])).push(new wt(o,s.from,a?null:s.to))}}return r}(i,n,o),l=function(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var s=e[n],o=s.marker;if(null==s.to||(o.inclusiveRight?s.to>=t:s.to>t)||s.from==t&&"bookmark"==o.type&&(!i||s.marker.insertLeft)){var a=null==s.from||(o.inclusiveLeft?s.from<=t:s.from<t);(r||(r=[])).push(new wt(o,a?null:s.from-t,null==s.to?null:s.to-t))}}return r}(r,s,o),c=1==t.text.length,u=q(t.text).length+(c?n:0);if(a)for(var h=0;h<a.length;++h){var d=a[h];if(null==d.to){var f=kt(l,d.marker);f?c&&(d.to=null==f.to?null:f.to+u):d.to=n}}if(l)for(var p=0;p<l.length;++p){var g=l[p];null!=g.to&&(g.to+=u),null==g.from?kt(a,g.marker)||(g.from=u,c&&(a||(a=[])).push(g)):(g.from+=u,c&&(a||(a=[])).push(g))}a&&(a=Tt(a)),l&&l!=a&&(l=Tt(l));var v=[a];if(!c){var m,y=t.text.length-2;if(y>0&&a)for(var _=0;_<a.length;++_)null==a[_].to&&(m||(m=[])).push(new wt(a[_].marker,null,null));for(var b=0;b<y;++b)v.push(m);v.push(l)}return v}function Tt(e){for(var t=0;t<e.length;++t){var i=e[t];null!=i.from&&i.from==i.to&&!1!==i.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Lt(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function At(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function Rt(e){return e.inclusiveLeft?-1:0}function Dt(e){return e.inclusiveRight?1:0}function Ot(e,t){var i=e.lines.length-t.lines.length;if(0!=i)return i;var r=e.find(),n=t.find(),s=tt(r.from,n.from)||Rt(e)-Rt(t);if(s)return-s;var o=tt(r.to,n.to)||Dt(e)-Dt(t);return o||t.id-e.id}function Mt(e,t){var i,r=Ct&&e.markedSpans;if(r)for(var n=void 0,s=0;s<r.length;++s)(n=r[s]).marker.collapsed&&null==(t?n.from:n.to)&&(!i||Ot(i,n.marker)<0)&&(i=n.marker);return i}function It(e){return Mt(e,!0)}function Pt(e){return Mt(e,!1)}function Ft(e,t){var i,r=Ct&&e.markedSpans;if(r)for(var n=0;n<r.length;++n){var s=r[n];s.marker.collapsed&&(null==s.from||s.from<t)&&(null==s.to||s.to>t)&&(!i||Ot(i,s.marker)<0)&&(i=s.marker)}return i}function Bt(e,t,i,r,n){var s=Ge(e,t),o=Ct&&s.markedSpans;if(o)for(var a=0;a<o.length;++a){var l=o[a];if(l.marker.collapsed){var c=l.marker.find(0),u=tt(c.from,i)||Rt(l.marker)-Rt(n),h=tt(c.to,r)||Dt(l.marker)-Dt(n);if(!(u>=0&&h<=0||u<=0&&h>=0)&&(u<=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?tt(c.to,i)>=0:tt(c.to,i)>0)||u>=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?tt(c.from,r)<=0:tt(c.from,r)<0)))return!0}}}function Nt(e){for(var t;t=It(e);)e=t.find(-1,!0).line;return e}function Ht(e,t){var i=Ge(e,t),r=Nt(i);return i==r?t:Ye(r)}function jt(e,t){if(t>e.lastLine())return t;var i,r=Ge(e,t);if(!Ut(e,r))return t;for(;i=Pt(r);)r=i.find(1,!0).line;return Ye(r)+1}function Ut(e,t){var i=Ct&&t.markedSpans;if(i)for(var r=void 0,n=0;n<i.length;++n)if((r=i[n]).marker.collapsed){if(null==r.from)return!0;if(!r.marker.widgetNode&&0==r.from&&r.marker.inclusiveLeft&&Kt(e,t,r))return!0}}function Kt(e,t,i){if(null==i.to){var r=i.marker.find(1,!0);return Kt(e,r.line,kt(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,s=0;s<t.markedSpans.length;++s)if((n=t.markedSpans[s]).marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(null==n.to||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&Kt(e,t,n))return!0}function Xt(e){for(var t=0,i=(e=Nt(e)).parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var s=i.parent;s;s=(i=s).parent)for(var o=0;o<s.children.length;++o){var a=s.children[o];if(a==i)break;t+=a.height}return t}function Wt(e){if(0==e.height)return 0;for(var t,i=e.text.length,r=e;t=It(r);){var n=t.find(0,!0);r=n.from.line,i+=n.from.ch-n.to.ch}for(r=e;t=Pt(r);){var s=t.find(0,!0);i-=r.text.length-s.from.ch,i+=(r=s.to.line).text.length-s.to.ch}return i}function zt(e){var t=e.display,i=e.doc;t.maxLine=Ge(i,i.first),t.maxLineLength=Wt(t.maxLine),t.maxLineChanged=!0,i.iter((function(e){var i=Wt(e);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=e)}))}var Gt=function(e,t,i){this.text=e,At(this,t),this.height=i?i(this):1};function Vt(e){e.parent=null,Lt(e)}Gt.prototype.lineNo=function(){return Ye(this)},ye(Gt);var qt={},Qt={};function Yt(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?Qt:qt;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Zt(e,t){var i=R("span",null,null,l?"padding-right: .1px":null),r={pre:R("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var s=n?t.rest[n-1]:t.line,o=void 0;r.pos=0,r.addToken=Jt,Ae(e.display.measure)&&(o=ce(s,e.doc.direction))&&(r.addToken=ei(r.addToken,o)),r.map=[],ii(s,r,dt(e,s,t!=e.display.externalMeasured&&Ye(s))),s.styleClasses&&(s.styleClasses.bgClass&&(r.bgClass=I(s.styleClasses.bgClass,r.bgClass||"")),s.styleClasses.textClass&&(r.textClass=I(s.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Le(e.display.measure))),0==n?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var a=r.content.lastChild;(/\bcm-tab\b/.test(a.className)||a.querySelector&&a.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return pe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=I(r.pre.className,r.textClass||"")),r}function $t(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Jt(e,t,i,r,n,s,l){if(t){var c,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var s=e.charAt(n);" "!=s||!i||n!=e.length-1&&32!=e.charCodeAt(n+1)||(s=" "),r+=s,i=" "==s}return r}(t,e.trailingSpace):t,h=e.cm.state.specialChars,d=!1;if(h.test(t)){c=document.createDocumentFragment();for(var f=0;;){h.lastIndex=f;var p=h.exec(t),g=p?p.index-f:t.length-f;if(g){var v=document.createTextNode(u.slice(f,f+g));o&&a<9?c.appendChild(A("span",[v])):c.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!p)break;f+=g+1;var m=void 0;if("\t"==p[0]){var y=e.cm.options.tabSize,_=y-e.col%y;(m=c.appendChild(A("span",V(_),"cm-tab"))).setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=_}else"\r"==p[0]||"\n"==p[0]?((m=c.appendChild(A("span","\r"==p[0]?"␍":"","cm-invalidchar"))).setAttribute("cm-text",p[0]),e.col+=1):((m=e.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),o&&a<9?c.appendChild(A("span",[m])):c.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),o&&a<9&&(d=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),i||r||n||d||s||l){var b=i||"";r&&(b+=r),n&&(b+=n);var S=A("span",[c],b,s);if(l)for(var C in l)l.hasOwnProperty(C)&&"style"!=C&&"class"!=C&&S.setAttribute(C,l[C]);return e.content.appendChild(S)}e.content.appendChild(c)}}function ei(e,t){return function(i,r,n,s,o,a,l){n=n?n+" cm-force-border":"cm-force-border";for(var c=i.pos,u=c+r.length;;){for(var h=void 0,d=0;d<t.length&&!((h=t[d]).to>c&&h.from<=c);d++);if(h.to>=u)return e(i,r,n,s,o,a,l);e(i,r.slice(0,h.to-c),n,s,null,a,l),s=null,r=r.slice(h.to-c),c=h.to}}}function ti(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function ii(e,t,i){var r=e.markedSpans,n=e.text,s=0;if(r)for(var o,a,l,c,u,h,d,f=n.length,p=0,g=1,v="",m=0;;){if(m==p){l=c=u=a="",d=null,h=null,m=1/0;for(var y=[],_=void 0,b=0;b<r.length;++b){var S=r[b],C=S.marker;if("bookmark"==C.type&&S.from==p&&C.widgetNode)y.push(C);else if(S.from<=p&&(null==S.to||S.to>p||C.collapsed&&S.to==p&&S.from==p)){if(null!=S.to&&S.to!=p&&m>S.to&&(m=S.to,c=""),C.className&&(l+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&S.from==p&&(u+=" "+C.startStyle),C.endStyle&&S.to==m&&(_||(_=[])).push(C.endStyle,S.to),C.title&&((d||(d={})).title=C.title),C.attributes)for(var w in C.attributes)(d||(d={}))[w]=C.attributes[w];C.collapsed&&(!h||Ot(h.marker,C)<0)&&(h=S)}else S.from>p&&m>S.from&&(m=S.from)}if(_)for(var k=0;k<_.length;k+=2)_[k+1]==m&&(c+=" "+_[k]);if(!h||h.from==p)for(var x=0;x<y.length;++x)ti(t,0,y[x]);if(h&&(h.from||0)==p){if(ti(t,(null==h.to?f+1:h.to)-p,h.marker,null==h.from),null==h.to)return;h.to==p&&(h=!1)}}if(p>=f)break;for(var E=Math.min(f,m);;){if(v){var T=p+v.length;if(!h){var L=T>E?v.slice(0,E-p):v;t.addToken(t,L,o?o+l:l,u,p+L.length==m?c:"",a,d)}if(T>=E){v=v.slice(E-p),p=E;break}p=T,u=""}v=n.slice(s,s=i[g++]),o=Yt(i[g++],t.cm.options)}}else for(var A=1;A<i.length;A+=2)t.addToken(t,n.slice(s,s=i[A]),Yt(i[A+1],t.cm.options))}function ri(e,t,i){this.line=t,this.rest=function(e){for(var t,i;t=Pt(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}(t),this.size=this.rest?Ye(q(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function ni(e,t,i){for(var r,n=[],s=t;s<i;s=r){var o=new ri(e.doc,Ge(e.doc,s),s);r=s+o.size,n.push(o)}return n}var si=null,oi=null;function ai(e,t){var i=de(e,t);if(i.length){var r,n=Array.prototype.slice.call(arguments,2);si?r=si.delayedCallbacks:oi?r=oi:(r=oi=[],setTimeout(li,0));for(var s=function(e){r.push((function(){return i[e].apply(null,n)}))},o=0;o<i.length;++o)s(o)}}function li(){var e=oi;oi=null;for(var t=0;t<e.length;++t)e[t]()}function ci(e,t,i,r){for(var n=0;n<t.changes.length;n++){var s=t.changes[n];"text"==s?di(e,t):"gutter"==s?pi(e,t,i,r):"class"==s?fi(e,t):"widget"==s&&gi(e,t,r)}t.changes=null}function ui(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),o&&a<8&&(e.node.style.zIndex=2)),e.node}function hi(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Zt(e,t)}function di(e,t){var i=t.text.className,r=hi(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,fi(e,t)):i&&(t.text.className=i)}function fi(e,t){!function(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=ui(t);t.background=r.insertBefore(A("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}(e,t),t.line.wrapClass?ui(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function pi(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var n=ui(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var o=ui(t),a=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||s&&s["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(A("div",Je(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),s)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=s.hasOwnProperty(c)&&s[c];u&&a.appendChild(A("div",[u],"CodeMirror-gutter-elt","left: "+r.gutterLeft[c]+"px; width: "+r.gutterWidth[c]+"px"))}}}function gi(e,t,i){t.alignable&&(t.alignable=null);for(var r=k("CodeMirror-linewidget"),n=t.node.firstChild,s=void 0;n;n=s)s=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);mi(e,t,i)}function vi(e,t,i,r){var n=hi(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),fi(e,t),pi(e,t,i,r),mi(e,t,r),t.node}function mi(e,t,i){if(yi(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)yi(e,t.rest[r],t,i,!1)}function yi(e,t,i,r,n){if(t.widgets)for(var s=ui(i),o=0,a=t.widgets;o<a.length;++o){var l=a[o],c=A("div",[l.node],"CodeMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),_i(l,c,i,r),e.display.input.setUneditable(c),n&&l.above?s.insertBefore(c,i.gutter||i.text):s.appendChild(c),ai(l,"redraw")}}function _i(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function bi(e){if(null!=e.height)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),L(t.display.measure,A("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function Si(e,t){for(var i=we(t);i!=e.wrapper;i=i.parentNode)if(!i||1==i.nodeType&&"true"==i.getAttribute("cm-ignore-events")||i.parentNode==e.sizer&&i!=e.mover)return!0}function Ci(e){return e.lineSpace.offsetTop}function wi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ki(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=L(e.measure,A("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(r.left)||isNaN(r.right)||(e.cachedPaddingH=r),r}function xi(e){return 50-e.display.nativeBarWidth}function Ei(e){return e.display.scroller.clientWidth-xi(e)-e.display.barWidth}function Ti(e){return e.display.scroller.clientHeight-xi(e)-e.display.barHeight}function Li(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(Ye(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ai(e,t,i,r){return Oi(e,Di(e,t),i,r)}function Ri(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[cr(e,t)];var i=e.display.externalMeasured;return i&&t>=i.lineN&&t<i.lineN+i.size?i:void 0}function Di(e,t){var i=Ye(t),r=Ri(e,i);r&&!r.text?r=null:r&&r.changes&&(ci(e,r,i,nr(e)),e.curOp.forceUpdate=!0),r||(r=function(e,t){var i=Ye(t=Nt(t)),r=e.display.externalMeasured=new ri(e.doc,t,i);r.lineN=i;var n=r.built=Zt(e,r);return r.text=n.pre,L(e.display.lineMeasure,n.pre),r}(e,t));var n=Li(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Oi(e,t,i,r,n){t.before&&(i=-1);var s,l=i+(r||"");return t.cache.hasOwnProperty(l)?s=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,i){var r=e.options.lineWrapping,n=r&&Ei(e);if(!t.measure.heights||r&&t.measure.width!=n){var s=t.measure.heights=[];if(r){t.measure.width=n;for(var o=t.text.firstChild.getClientRects(),a=0;a<o.length-1;a++){var l=o[a],c=o[a+1];Math.abs(l.bottom-c.bottom)>2&&s.push((l.bottom+c.top)/2-i.top)}}s.push(i.bottom-i.top)}}(e,t.view,t.rect),t.hasHeights=!0),(s=function(e,t,i,r){var n,s=Pi(t.map,i,r),l=s.node,c=s.start,u=s.end,h=s.collapse;if(3==l.nodeType){for(var d=0;d<4;d++){for(;c&&re(t.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+u<s.coverEnd&&re(t.line.text.charAt(s.coverStart+u));)++u;if((n=o&&a<9&&0==c&&u==s.coverEnd-s.coverStart?l.parentNode.getBoundingClientRect():Fi(x(l,c,u).getClientRects(),r)).left||n.right||0==c)break;u=c,c-=1,h="right"}o&&a<11&&(n=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=Ie)return Ie;var t=L(e,A("span","x")),i=t.getBoundingClientRect(),r=x(t,0,1).getBoundingClientRect();return Ie=Math.abs(i.left-r.left)>1}(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,n))}else{var f;c>0&&(h=r="right"),n=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(o&&a<9&&!c&&(!n||!n.left&&!n.right)){var p=l.parentNode.getClientRects()[0];n=p?{left:p.left,right:p.left+rr(e.display),top:p.top,bottom:p.bottom}:Ii}for(var g=n.top-t.rect.top,v=n.bottom-t.rect.top,m=(g+v)/2,y=t.view.measure.heights,_=0;_<y.length-1&&!(m<y[_]);_++);var b=_?y[_-1]:0,S=y[_],C={left:("right"==h?n.right:n.left)-t.rect.left,right:("left"==h?n.left:n.right)-t.rect.left,top:b,bottom:S};return n.left||n.right||(C.bogus=!0),e.options.singleCursorHeightPerLine||(C.rtop=g,C.rbottom=v),C}(e,t,i,r)).bogus||(t.cache[l]=s)),{left:s.left,right:s.right,top:n?s.rtop:s.top,bottom:n?s.rbottom:s.bottom}}var Mi,Ii={left:0,right:0,top:0,bottom:0};function Pi(e,t,i){for(var r,n,s,o,a,l,c=0;c<e.length;c+=3)if(a=e[c],l=e[c+1],t<a?(n=0,s=1,o="left"):t<l?s=1+(n=t-a):(c==e.length-3||t==l&&e[c+3]>t)&&(n=(s=l-a)-1,t>=l&&(o="right")),null!=n){if(r=e[c+2],a==l&&i==(r.insertLeft?"left":"right")&&(o=i),"left"==i&&0==n)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],o="left";if("right"==i&&n==l-a)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)r=e[(c+=3)+2],o="right";break}return{node:r,start:n,end:s,collapse:o,coverStart:a,coverEnd:l}}function Fi(e,t){var i=Ii;if("left"==t)for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function Bi(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 Ni(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Bi(e.display.view[t])}function Hi(e){Ni(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ji(){return u&&v?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function Ui(){return u&&v?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Ki(e){var t=0;if(e.widgets)for(var i=0;i<e.widgets.length;++i)e.widgets[i].above&&(t+=bi(e.widgets[i]));return t}function Xi(e,t,i,r,n){if(!n){var s=Ki(t);i.top+=s,i.bottom+=s}if("line"==r)return i;r||(r="local");var o=Xt(t);if("local"==r?o+=Ci(e.display):o-=e.display.viewOffset,"page"==r||"window"==r){var a=e.display.lineSpace.getBoundingClientRect();o+=a.top+("window"==r?0:Ui());var l=a.left+("window"==r?0:ji());i.left+=l,i.right+=l}return i.top+=o,i.bottom+=o,i}function Wi(e,t,i){if("div"==i)return t;var r=t.left,n=t.top;if("page"==i)r-=ji(),n-=Ui();else if("local"==i||!i){var s=e.display.sizer.getBoundingClientRect();r+=s.left,n+=s.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:n-o.top}}function zi(e,t,i,r,n){return r||(r=Ge(e.doc,t.line)),Xi(e,r,Ai(e,r,t.ch,n),i)}function Gi(e,t,i,r,n,s){function o(t,o){var a=Oi(e,n,t,o?"right":"left",s);return o?a.left=a.right:a.right=a.left,Xi(e,r,a,i)}r=r||Ge(e.doc,t.line),n||(n=Di(e,r));var a=ce(r,e.doc.direction),l=t.ch,c=t.sticky;if(l>=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!a)return o("before"==c?l-1:l,"before"==c);function u(e,t,i){return o(i?e-1:e,1==a[t].level!=i)}var h=ae(a,l,c),d=oe,f=u(l,h,"before"==c);return null!=d&&(f.other=u(l,d,"before"!=c)),f}function Vi(e,t){var i=0;t=at(e.doc,t),e.options.lineWrapping||(i=rr(e.display)*t.ch);var r=Ge(e.doc,t.line),n=Xt(r)+Ci(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function qi(e,t,i,r,n){var s=et(e,t,i);return s.xRel=n,r&&(s.outside=r),s}function Qi(e,t,i){var r=e.doc;if((i+=e.display.viewOffset)<0)return qi(r.first,0,null,-1,-1);var n=Ze(r,i),s=r.first+r.size-1;if(n>s)return qi(r.first+r.size-1,Ge(r,s).text.length,null,1,1);t<0&&(t=0);for(var o=Ge(r,n);;){var a=Ji(e,o,n,t,i),l=Ft(o,a.ch+(a.xRel>0||a.outside>0?1:0));if(!l)return a;var c=l.find(1);if(c.line==n)return c;o=Ge(r,n=c.line)}}function Yi(e,t,i,r){r-=Ki(t);var n=t.text.length,s=se((function(t){return Oi(e,i,t-1).bottom<=r}),n,0);return{begin:s,end:n=se((function(t){return Oi(e,i,t).top>r}),s,n)}}function Zi(e,t,i,r){return i||(i=Di(e,t)),Yi(e,t,i,Xi(e,t,Oi(e,i,r),"line").top)}function $i(e,t,i,r){return!(e.bottom<=i)&&(e.top>i||(r?e.left:e.right)>t)}function Ji(e,t,i,r,n){n-=Xt(t);var s=Di(e,t),o=Ki(t),a=0,l=t.text.length,c=!0,u=ce(t,e.doc.direction);if(u){var h=(e.options.lineWrapping?tr:er)(e,t,i,s,u,r,n);a=(c=1!=h.level)?h.from:h.to-1,l=c?h.to:h.from-1}var d,f,p=null,g=null,v=se((function(t){var i=Oi(e,s,t);return i.top+=o,i.bottom+=o,!!$i(i,r,n,!1)&&(i.top<=n&&i.left<=r&&(p=t,g=i),!0)}),a,l),m=!1;if(g){var y=r-g.left<g.right-r,_=y==c;v=p+(_?0:1),f=_?"after":"before",d=y?g.left:g.right}else{c||v!=l&&v!=a||v++,f=0==v?"after":v==t.text.length?"before":Oi(e,s,v-(c?1:0)).bottom+o<=n==c?"after":"before";var b=Gi(e,et(i,v,f),"line",t,s);d=b.left,m=n<b.top?-1:n>=b.bottom?1:0}return qi(i,v=ne(t.text,v,1),f,m,r-d)}function er(e,t,i,r,n,s,o){var a=se((function(a){var l=n[a],c=1!=l.level;return $i(Gi(e,et(i,c?l.to:l.from,c?"before":"after"),"line",t,r),s,o,!0)}),0,n.length-1),l=n[a];if(a>0){var c=1!=l.level,u=Gi(e,et(i,c?l.from:l.to,c?"after":"before"),"line",t,r);$i(u,s,o,!0)&&u.top>o&&(l=n[a-1])}return l}function tr(e,t,i,r,n,s,o){var a=Yi(e,t,r,o),l=a.begin,c=a.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,h=null,d=0;d<n.length;d++){var f=n[d];if(!(f.from>=c||f.to<=l)){var p=Oi(e,r,1!=f.level?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=p<s?s-p+1e9:p-s;(!u||h>g)&&(u=f,h=g)}}return u||(u=n[n.length-1]),u.from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}function ir(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mi){Mi=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mi.appendChild(document.createTextNode("x")),Mi.appendChild(A("br"));Mi.appendChild(document.createTextNode("x"))}L(e.measure,Mi);var i=Mi.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),T(e.measure),i||1}function rr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),i=A("pre",[t],"CodeMirror-line-like");L(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function nr(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o){var a=e.display.gutterSpecs[o].className;i[a]=s.offsetLeft+s.clientLeft+n,r[a]=s.clientWidth}return{fixedPos:sr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function or(e){var t=ir(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(n){if(Ut(e.doc,n))return 0;var s=0;if(n.widgets)for(var o=0;o<n.widgets.length;o++)n.widgets[o].height&&(s+=n.widgets[o].height);return i?s+(Math.ceil(n.text.length/r)||1)*t:s+t}}function ar(e){var t=e.doc,i=or(e);t.iter((function(e){var t=i(e);t!=e.height&&Qe(e,t)}))}function lr(e,t,i,r){var n=e.display;if(!i&&"true"==we(t).getAttribute("cm-not-content"))return null;var s,o,a=n.lineSpace.getBoundingClientRect();try{s=t.clientX-a.left,o=t.clientY-a.top}catch(e){return null}var l,c=Qi(e,s,o);if(r&&c.xRel>0&&(l=Ge(e.doc,c.line).text).length==c.ch){var u=N(l,l.length,e.options.tabSize)-l.length;c=et(c.line,Math.max(0,Math.round((s-ki(e.display).left)/rr(e.display))-u))}return c}function cr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var i=e.display.view,r=0;r<i.length;r++)if((t-=i[r].size)<0)return r}function ur(e,t,i,r){null==t&&(t=e.doc.first),null==i&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Ct&&Ht(e.doc,t)<n.viewTo&&dr(e);else if(i<=n.viewFrom)Ct&&jt(e.doc,i+r)>n.viewFrom?dr(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)dr(e);else if(t<=n.viewFrom){var s=fr(e,i,i+r,1);s?(n.view=n.view.slice(s.index),n.viewFrom=s.lineN,n.viewTo+=r):dr(e)}else if(i>=n.viewTo){var o=fr(e,t,t,-1);o?(n.view=n.view.slice(0,o.index),n.viewTo=o.lineN):dr(e)}else{var a=fr(e,t,t,-1),l=fr(e,i,i+r,1);a&&l?(n.view=n.view.slice(0,a.index).concat(ni(e,a.lineN,l.lineN)).concat(n.view.slice(l.index)),n.viewTo+=r):dr(e)}var c=n.externalMeasured;c&&(i<c.lineN?c.lineN+=r:t<c.lineN+c.size&&(n.externalMeasured=null))}function hr(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var s=r.view[cr(e,t)];if(null!=s.node){var o=s.changes||(s.changes=[]);-1==j(o,i)&&o.push(i)}}}function dr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function fr(e,t,i,r){var n,s=cr(e,t),o=e.display.view;if(!Ct||i==e.doc.first+e.doc.size)return{index:s,lineN:i};for(var a=e.display.viewFrom,l=0;l<s;l++)a+=o[l].size;if(a!=t){if(r>0){if(s==o.length-1)return null;n=a+o[s].size-t,s++}else n=a-t;t+=n,i+=n}for(;Ht(e.doc,i)!=i;){if(s==(r<0?0:o.length-1))return null;i+=r*o[s-(r<0?1:0)].size,s+=r}return{index:s,lineN:i}}function pr(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];n.hidden||n.node&&!n.changes||++i}return i}function gr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function vr(e,t){void 0===t&&(t=!0);for(var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),s=r.selection=document.createDocumentFragment(),o=0;o<i.sel.ranges.length;o++)if(t||o!=i.sel.primIndex){var a=i.sel.ranges[o];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var l=a.empty();(l||e.options.showCursorWhenSelecting)&&mr(e,a.head,n),l||_r(e,a,s)}}return r}function mr(e,t,i){var r=Gi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(A("div"," ","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",r.other){var s=i.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function yr(e,t){return e.top-t.top||e.left-t.left}function _r(e,t,i){var r=e.display,n=e.doc,s=document.createDocumentFragment(),o=ki(e.display),a=o.left,l=Math.max(r.sizerWidth,Ei(e)-r.sizer.offsetLeft)-o.right,c="ltr"==n.direction;function u(e,t,i,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==i?l-e:i)+"px;\n height: "+(r-t)+"px"))}function h(t,i,r){var s,o,h=Ge(n,t),d=h.text.length;function f(i,r){return zi(e,et(t,i),"div",h,r)}function p(t,i,r){var n=Zi(e,h,null,t),s="ltr"==i==("after"==r)?"left":"right";return f("after"==r?n.begin:n.end-(/\s/.test(h.text.charAt(n.end-1))?2:1),s)[s]}var g=ce(h,n.direction);return function(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,s=0;s<e.length;++s){var o=e[s];(o.from<i&&o.to>t||t==i&&o.to==t)&&(r(Math.max(o.from,t),Math.min(o.to,i),1==o.level?"rtl":"ltr",s),n=!0)}n||r(t,i,"ltr")}(g,i||0,null==r?d:r,(function(e,t,n,h){var v="ltr"==n,m=f(e,v?"left":"right"),y=f(t-1,v?"right":"left"),_=null==i&&0==e,b=null==r&&t==d,S=0==h,C=!g||h==g.length-1;if(y.top-m.top<=3){var w=(c?b:_)&&C,k=(c?_:b)&&S?a:(v?m:y).left,x=w?l:(v?y:m).right;u(k,m.top,x-k,m.bottom)}else{var E,T,L,A;v?(E=c&&_&&S?a:m.left,T=c?l:p(e,n,"before"),L=c?a:p(t,n,"after"),A=c&&b&&C?l:y.right):(E=c?p(e,n,"before"):a,T=!c&&_&&S?l:m.right,L=!c&&b&&C?a:y.left,A=c?p(t,n,"after"):l),u(E,m.top,T-E,m.bottom),m.bottom<y.top&&u(a,m.bottom,null,y.top),u(L,y.top,A-L,y.bottom)}(!s||yr(m,s)<0)&&(s=m),yr(y,s)<0&&(s=y),(!o||yr(m,o)<0)&&(o=m),yr(y,o)<0&&(o=y)})),{start:s,end:o}}var d=t.from(),f=t.to();if(d.line==f.line)h(d.line,d.ch,f.ch);else{var p=Ge(n,d.line),g=Ge(n,f.line),v=Nt(p)==Nt(g),m=h(d.line,d.ch,v?p.text.length+1:null).end,y=h(f.line,v?0:null,f.ch).start;v&&(m.top<y.top-2?(u(m.right,m.top,null,m.bottom),u(a,y.top,y.left,y.bottom)):u(m.right,m.top,y.left-m.right,m.bottom)),m.bottom<y.top&&u(a,m.bottom,null,y.top)}i.appendChild(s)}function br(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){e.hasFocus()||kr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Sr(e){e.state.focused||(e.display.input.focus(),wr(e))}function Cr(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,kr(e))}),100)}function wr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(pe(e,"focus",e,t),e.state.focused=!0,M(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),br(e))}function kr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(pe(e,"blur",e,t),e.state.focused=!1,E(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function xr(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=0;r<t.view.length;r++){var n=t.view[r],s=e.options.lineWrapping,l=void 0,c=0;if(!n.hidden){if(o&&a<8){var u=n.node.offsetTop+n.node.offsetHeight;l=u-i,i=u}else{var h=n.node.getBoundingClientRect();l=h.bottom-h.top,!s&&n.text.firstChild&&(c=n.text.firstChild.getBoundingClientRect().right-h.left-1)}var d=n.line.height-l;if((d>.005||d<-.005)&&(Qe(n.line,l),Er(n.line),n.rest))for(var f=0;f<n.rest.length;f++)Er(n.rest[f]);if(c>e.display.sizerWidth){var p=Math.ceil(c/rr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=n.line,e.display.maxLineChanged=!0)}}}}function Er(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Tr(e,t,i){var r=i&&null!=i.top?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Ci(e));var n=i&&null!=i.bottom?i.bottom:r+e.wrapper.clientHeight,s=Ze(t,r),o=Ze(t,n);if(i&&i.ensure){var a=i.ensure.from.line,l=i.ensure.to.line;a<s?(s=a,o=Ze(t,Xt(Ge(t,a))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(s=Ze(t,Xt(Ge(t,l))-e.wrapper.clientHeight),o=l)}return{from:s,to:Math.max(o,s+1)}}function Lr(e,t){var i=e.display,r=ir(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:i.scroller.scrollTop,s=Ti(e),o={};t.bottom-t.top>s&&(t.bottom=t.top+s);var a=e.doc.height+wi(i),l=t.top<r,c=t.bottom>a-r;if(t.top<n)o.scrollTop=l?0:t.top;else if(t.bottom>n+s){var u=Math.min(t.top,(c?a:t.bottom)-s);u!=n&&(o.scrollTop=u)}var h=e.options.fixedGutter?0:i.gutters.offsetWidth,d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:i.scroller.scrollLeft-h,f=Ei(e)-i.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?o.scrollLeft=0:t.left<d?o.scrollLeft=Math.max(0,t.left+h-(p?0:10)):t.right>f+d-3&&(o.scrollLeft=t.right+(p?0:10)-f),o}function Ar(e,t){null!=t&&(Or(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Rr(e){Or(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Dr(e,t,i){null==t&&null==i||Or(e),null!=t&&(e.curOp.scrollLeft=t),null!=i&&(e.curOp.scrollTop=i)}function Or(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mr(e,Vi(e,t.from),Vi(e,t.to),t.margin))}function Mr(e,t,i,r){var n=Lr(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Dr(e,n.scrollLeft,n.scrollTop)}function Ir(e,t){Math.abs(e.doc.scrollTop-t)<2||(i||ln(e,{top:t}),Pr(e,t,!0),i&&ln(e),rn(e,100))}function Pr(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Fr(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,hn(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Br(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+wi(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?i:0,docHeight:r,scrollHeight:r+xi(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var Nr=function(e,t,i){this.cm=i;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),he(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),he(n,"scroll",(function(){n.clientWidth&&t(n.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,o&&a<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Nr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+s)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},Nr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Nr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Nr.prototype.zeroWidthHack=function(){var e=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},Nr.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto",t.set(1e3,(function r(){var n=e.getBoundingClientRect();("vert"==i?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)}))},Nr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hr=function(){};function jr(e,t){t||(t=Br(e));var i=e.display.barWidth,r=e.display.barHeight;Ur(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&xr(e),Ur(e,Br(e)),i=e.display.barWidth,r=e.display.barHeight}function Ur(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Kr={native:Nr,null:Hr};function Xr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&E(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Kr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),he(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,i){"horizontal"==i?Fr(e,t):Ir(e,t)}),e),e.display.scrollbars.addClass&&M(e.display.wrapper,e.display.scrollbars.addClass)}var Wr=0;function zr(e){var t;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:++Wr},t=e.curOp,si?si.ops.push(t):t.ownsGroup=si={ops:[t],delayedCallbacks:[]}}function Gr(e){var t=e.curOp;t&&function(e,t){var i=e.ownsGroup;if(i)try{!function(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}(i)}finally{si=null,t(i)}}(t,(function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,i=0;i<t.length;i++)Vr(t[i]);for(var r=0;r<t.length;r++)qr(t[r]);for(var n=0;n<t.length;n++)Qr(t[n]);for(var s=0;s<t.length;s++)Yr(t[s]);for(var o=0;o<t.length;o++)Zr(t[o])}(e)}))}function Vr(e){var t=e.cm,i=t.display;!function(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=xi(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=xi(e)+"px",t.scrollbarsClipped=!0)}(t),e.updateMaxLine&&zt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new sn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qr(e){e.updatedDisplay=e.mustUpdate&&on(e.cm,e.update)}function Qr(e){var t=e.cm,i=t.display;e.updatedDisplay&&xr(t),e.barMeasure=Br(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ai(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+xi(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Ei(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Yr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Fr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&jr(t,e.barMeasure),e.updatedDisplay&&un(t,e.barMeasure),e.selectionChanged&&br(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Sr(e.cm)}function Zr(e){var t=e.cm,i=t.display,r=t.doc;e.updatedDisplay&&an(t,e.update),null==i.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(i.wheelStartX=i.wheelStartY=null),null!=e.scrollTop&&Pr(t,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&Fr(t,e.scrollLeft,!0,!0),e.scrollToPos&&function(e,t){if(!ge(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null;if(t.top+r.top<0?n=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(n=!1),null!=n&&!p){var s=A("div","",null,"position: absolute;\n top: "+(t.top-i.viewOffset-Ci(e.display))+"px;\n height: "+(t.bottom-t.top+xi(e)+i.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}(t,function(e,t,i,r){var n;null==r&&(r=0),e.options.lineWrapping||t!=i||(i="before"==(t=t.ch?et(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?et(t.line,t.ch+1,"before"):t);for(var s=0;s<5;s++){var o=!1,a=Gi(e,t),l=i&&i!=t?Gi(e,i):a,c=Lr(e,n={left:Math.min(a.left,l.left),top:Math.min(a.top,l.top)-r,right:Math.max(a.left,l.left),bottom:Math.max(a.bottom,l.bottom)+r}),u=e.doc.scrollTop,h=e.doc.scrollLeft;if(null!=c.scrollTop&&(Ir(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(o=!0)),null!=c.scrollLeft&&(Fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-h)>1&&(o=!0)),!o)break}return n}(t,at(r,e.scrollToPos.from),at(r,e.scrollToPos.to),e.scrollToPos.margin));var n=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(n)for(var o=0;o<n.length;++o)n[o].lines.length||pe(n[o],"hide");if(s)for(var a=0;a<s.length;++a)s[a].lines.length&&pe(s[a],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&pe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function $r(e,t){if(e.curOp)return t();zr(e);try{return t()}finally{Gr(e)}}function Jr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);zr(e);try{return t.apply(e,arguments)}finally{Gr(e)}}}function en(e){return function(){if(this.curOp)return e.apply(this,arguments);zr(this);try{return e.apply(this,arguments)}finally{Gr(this)}}}function tn(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);zr(t);try{return e.apply(this,arguments)}finally{Gr(t)}}}function rn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,F(nn,e))}function nn(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=ft(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(s){if(r.line>=e.display.viewFrom){var o=s.styles,a=s.text.length>e.options.maxHighlightLength?Ke(t.mode,r.state):null,l=ht(e,s,r,!0);a&&(r.state=a),s.styles=l.styles;var c=s.styleClasses,u=l.classes;u?s.styleClasses=u:c&&(s.styleClasses=null);for(var h=!o||o.length!=s.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!h&&d<o.length;++d)h=o[d]!=s.styles[d];h&&n.push(r.line),s.stateAfter=r.save(),r.nextLine()}else s.text.length<=e.options.maxHighlightLength&&pt(e,s.text,r),s.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return rn(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&$r(e,(function(){for(var t=0;t<n.length;t++)hr(e,n[t],"text")}))}}var sn=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Tr(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Ei(e),this.force=i,this.dims=nr(e),this.events=[]};function on(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return dr(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==pr(e))return!1;dn(e)&&(dr(e),t.dims=nr(e));var n=r.first+r.size,s=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<s&&s-i.viewFrom<20&&(s=Math.max(r.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(n,i.viewTo)),Ct&&(s=Ht(e.doc,s),o=jt(e.doc,o));var a=s!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;!function(e,t,i){var r=e.display;0==r.view.length||t>=r.viewTo||i<=r.viewFrom?(r.view=ni(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=ni(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(cr(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(ni(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,cr(e,i)))),r.viewTo=i}(e,s,o),i.viewOffset=Xt(Ge(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var c=pr(e);if(!a&&0==c&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=O();if(!t||!D(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}(e);return c>4&&(i.lineDiv.style.display="none"),function(e,t,i){var r=e.display,n=e.options.lineNumbers,s=r.lineDiv,o=s.firstChild;function a(t){var i=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var c=r.view,u=r.viewFrom,h=0;h<c.length;h++){var d=c[h];if(d.hidden);else if(d.node&&d.node.parentNode==s){for(;o!=d.node;)o=a(o);var f=n&&null!=t&&t<=u&&d.lineNumber;d.changes&&(j(d.changes,"gutter")>-1&&(f=!1),ci(e,d,u,i)),f&&(T(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(Je(e.options,u)))),o=d.node.nextSibling}else{var p=vi(e,d,u,i);s.insertBefore(p,o)}u+=d.size}for(;o;)o=a(o)}(e,i.updateLineNumbers,t.dims),c>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,function(e){if(e&&e.activeElt&&e.activeElt!=O()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),i=document.createRange();i.setEnd(e.anchorNode,e.anchorOffset),i.collapse(!1),t.removeAllRanges(),t.addRange(i),t.extend(e.focusNode,e.focusOffset)}}(u),T(i.cursorDiv),T(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,a&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,rn(e,400)),i.updateLineNumbers=null,!0}function an(e,t){for(var i=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ei(e))r&&(t.visible=Tr(e.display,e.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(e.doc.height+wi(e.display)-Ti(e),i.top)}),t.visible=Tr(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!on(e,t))break;xr(e);var n=Br(e);gr(e),jr(e,n),un(e,n),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 ln(e,t){var i=new sn(e,t);if(on(e,i)){xr(e),an(e,i);var r=Br(e);gr(e),jr(e,r),un(e,r),i.finish()}}function cn(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function un(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+xi(e)+"px"}function hn(e){var t=e.display,i=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=sr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,s=r+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&(i[o].gutter&&(i[o].gutter.style.left=s),i[o].gutterBackground&&(i[o].gutterBackground.style.left=s));var a=i[o].alignable;if(a)for(var l=0;l<a.length;l++)a[l].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function dn(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Je(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(A("div",[A("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=n.firstChild.offsetWidth,o=n.offsetWidth-s;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(s,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",cn(e.display),!0}return!1}function fn(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var s=e[n],o=null;if("string"!=typeof s&&(o=s.style,s=s.className),"CodeMirror-linenumbers"==s){if(!t)continue;r=!0}i.push({className:s,style:o})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function pn(e){var t=e.gutters,i=e.gutterSpecs;T(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],s=n.className,o=n.style,a=t.appendChild(A("div",null,"CodeMirror-gutter "+s));o&&(a.style.cssText=o),"CodeMirror-linenumbers"==s&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",cn(e)}function gn(e){pn(e.display),ur(e),hn(e)}function vn(e,t,r,n){var s=this;this.input=r,s.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=R("div",null,"CodeMirror-code"),s.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=A("div",null,"CodeMirror-cursors"),s.measure=A("div",null,"CodeMirror-measure"),s.lineMeasure=A("div",null,"CodeMirror-measure"),s.lineSpace=R("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var c=R("div",[s.lineSpace],"CodeMirror-lines");s.mover=A("div",[c],null,"position: relative"),s.sizer=A("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=A("div",null,null,"position: absolute; height: 50px; width: 1px;"),s.gutters=A("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=A("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=A("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),o&&a<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),l||i&&m||(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=fn(n.gutters,n.lineNumbers),pn(s),r.init(s)}sn.prototype.signal=function(e,t){me(e,t)&&this.events.push(arguments)},sn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)pe.apply(null,this.events[e])};var mn=0,yn=null;function _n(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==i&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:null==i&&(i=e.wheelDelta),{x:t,y:i}}function bn(e){var t=_n(e);return t.x*=yn,t.y*=yn,t}function Sn(e,t){var r=_n(t),n=r.x,s=r.y,o=e.display,a=o.scroller,c=a.scrollWidth>a.clientWidth,u=a.scrollHeight>a.clientHeight;if(n&&c||s&&u){if(s&&y&&l)e:for(var d=t.target,f=o.view;d!=a;d=d.parentNode)for(var p=0;p<f.length;p++)if(f[p].node==d){e.display.currentWheelTarget=d;break e}if(n&&!i&&!h&&null!=yn)return s&&u&&Ir(e,Math.max(0,a.scrollTop+s*yn)),Fr(e,Math.max(0,a.scrollLeft+n*yn)),(!s||s&&u)&&_e(t),void(o.wheelStartX=null);if(s&&null!=yn){var g=s*yn,v=e.doc.scrollTop,m=v+o.wrapper.clientHeight;g<0?v=Math.max(0,v+g-50):m=Math.min(e.doc.height,m+g+50),ln(e,{top:v,bottom:m})}mn<20&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=n,o.wheelDY=s,setTimeout((function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,i=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,i&&(yn=(yn*mn+i)/(mn+1),++mn)}}),200)):(o.wheelDX+=n,o.wheelDY+=s))}}o?yn=-.53:i?yn=15:u?yn=-.7:d&&(yn=-1/3);var Cn=function(e,t){this.ranges=e,this.primIndex=t};Cn.prototype.primary=function(){return this.ranges[this.primIndex]},Cn.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 i=this.ranges[t],r=e.ranges[t];if(!it(i.anchor,r.anchor)||!it(i.head,r.head))return!1}return!0},Cn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new wn(rt(this.ranges[t].anchor),rt(this.ranges[t].head));return new Cn(e,this.primIndex)},Cn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Cn.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(tt(t,r.from())>=0&&tt(e,r.to())<=0)return i}return-1};var wn=function(e,t){this.anchor=e,this.head=t};function kn(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort((function(e,t){return tt(e.from(),t.from())})),i=j(t,n);for(var s=1;s<t.length;s++){var o=t[s],a=t[s-1],l=tt(a.to(),o.from());if(r&&!o.empty()?l>0:l>=0){var c=st(a.from(),o.from()),u=nt(a.to(),o.to()),h=a.empty()?o.from()==o.head:a.from()==a.head;s<=i&&--i,t.splice(--s,2,new wn(h?u:c,h?c:u))}}return new Cn(t,i)}function xn(e,t){return new Cn([new wn(e,t||e)],0)}function En(e){return e.text?et(e.from.line+e.text.length-1,q(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Tn(e,t){if(tt(e,t.from)<0)return e;if(tt(e,t.to)<=0)return En(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=En(t).ch-t.to.ch),et(i,r)}function Ln(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new wn(Tn(n.anchor,t),Tn(n.head,t)))}return kn(e.cm,i,e.sel.primIndex)}function An(e,t,i){return e.line==t.line?et(i.line,e.ch-t.ch+i.ch):et(i.line+(e.line-t.line),e.ch)}function Rn(e){e.doc.mode=He(e.options,e.doc.modeOption),Dn(e)}function Dn(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,rn(e,100),e.state.modeGen++,e.curOp&&ur(e)}function On(e,t){return 0==t.from.ch&&0==t.to.ch&&""==q(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Mn(e,t,i,r){function n(e){return i?i[e]:null}function s(e,i,n){!function(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Lt(e),At(e,i);var n=r?r(e):1;n!=e.height&&Qe(e,n)}(e,i,n,r),ai(e,"change",e,t)}function o(e,t){for(var i=[],s=e;s<t;++s)i.push(new Gt(c[s],n(s),r));return i}var a=t.from,l=t.to,c=t.text,u=Ge(e,a.line),h=Ge(e,l.line),d=q(c),f=n(c.length-1),p=l.line-a.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(On(e,t)){var g=o(0,c.length-1);s(h,h.text,f),p&&e.remove(a.line,p),g.length&&e.insert(a.line,g)}else if(u==h)if(1==c.length)s(u,u.text.slice(0,a.ch)+d+u.text.slice(l.ch),f);else{var v=o(1,c.length-1);v.push(new Gt(d+u.text.slice(l.ch),f,r)),s(u,u.text.slice(0,a.ch)+c[0],n(0)),e.insert(a.line+1,v)}else if(1==c.length)s(u,u.text.slice(0,a.ch)+c[0]+h.text.slice(l.ch),n(0)),e.remove(a.line+1,p);else{s(u,u.text.slice(0,a.ch)+c[0],n(0)),s(h,d+h.text.slice(l.ch),f);var m=o(1,c.length-1);p>1&&e.remove(a.line+1,p-1),e.insert(a.line+1,m)}ai(e,"change",e,t)}function In(e,t,i){!function e(r,n,s){if(r.linked)for(var o=0;o<r.linked.length;++o){var a=r.linked[o];if(a.doc!=n){var l=s&&a.sharedHist;i&&!l||(t(a.doc,l),e(a.doc,r,l))}}}(e,null,!0)}function Pn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ar(e),Rn(e),Fn(e),e.options.lineWrapping||zt(e),e.options.mode=t.modeOption,ur(e)}function Fn(e){("rtl"==e.doc.direction?M:E)(e.display.lineDiv,"CodeMirror-rtl")}function Bn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Nn(e,t){var i={from:rt(t.from),to:En(t),text:Ve(e,t.from,t.to)};return Xn(e,i,t.from.line,t.to.line+1),In(e,(function(e){return Xn(e,i,t.from.line,t.to.line+1)}),!0),i}function Hn(e){for(;e.length&&q(e).ranges;)e.pop()}function jn(e,t,i,r){var n=e.history;n.undone.length=0;var s,o,a=+new Date;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(s=function(e,t){return t?(Hn(e.done),q(e.done)):e.done.length&&!q(e.done).ranges?q(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),q(e.done)):void 0}(n,n.lastOp==r)))o=q(s.changes),0==tt(t.from,t.to)&&0==tt(t.from,o.to)?o.to=En(t):s.changes.push(Nn(e,t));else{var l=q(n.done);for(l&&l.ranges||Kn(e.sel,n.done),s={changes:[Nn(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=a,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,o||pe(e,"historyAdded")}function Un(e,t,i,r){var n=e.history,s=r&&r.origin;i==n.lastSelOp||s&&n.lastSelOrigin==s&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==s||function(e,t,i,r){var n=t.charAt(0);return"*"==n||"+"==n&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,s,q(n.done),t))?n.done[n.done.length-1]=t:Kn(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=s,n.lastSelOp=i,r&&!1!==r.clearRedo&&Hn(n.undone)}function Kn(e,t){var i=q(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Xn(e,t,i,r){var n=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),(function(i){i.markedSpans&&((n||(n=t["spans_"+e.id]={}))[s]=i.markedSpans),++s}))}function Wn(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function zn(e,t){var i=function(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(Wn(i[n]));return r}(e,t),r=Et(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var s=i[n],o=r[n];if(s&&o)e:for(var a=0;a<o.length;++a){for(var l=o[a],c=0;c<s.length;++c)if(s[c].marker==l.marker)continue e;s.push(l)}else o&&(i[n]=o)}return i}function Gn(e,t,i){for(var r=[],n=0;n<e.length;++n){var s=e[n];if(s.ranges)r.push(i?Cn.prototype.deepCopy.call(s):s);else{var o=s.changes,a=[];r.push({changes:a});for(var l=0;l<o.length;++l){var c=o[l],u=void 0;if(a.push({from:c.from,to:c.to,text:c.text}),t)for(var h in c)(u=h.match(/^spans_(\d+)$/))&&j(t,Number(u[1]))>-1&&(q(a)[h]=c[h],delete c[h])}}}return r}function Vn(e,t,i,r){if(r){var n=e.anchor;if(i){var s=tt(t,n)<0;s!=tt(i,n)<0?(n=t,t=i):s!=tt(t,i)<0&&(t=i)}return new wn(n,t)}return new wn(i||t,t)}function qn(e,t,i,r,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),Jn(e,new Cn([Vn(e.sel.primary(),t,i,n)],0),r)}function Qn(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),s=0;s<e.sel.ranges.length;s++)r[s]=Vn(e.sel.ranges[s],t[s],null,n);Jn(e,kn(e.cm,r,e.sel.primIndex),i)}function Yn(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,Jn(e,kn(e.cm,n,e.sel.primIndex),r)}function Zn(e,t,i,r){Jn(e,xn(t,i),r)}function $n(e,t,i){var r=e.history.done,n=q(r);n&&n.ranges?(r[r.length-1]=t,es(e,t,i)):Jn(e,t,i)}function Jn(e,t,i){es(e,t,i),Un(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function es(e,t,i){(me(e,"beforeSelectionChange")||e.cm&&me(e.cm,"beforeSelectionChange"))&&(t=function(e,t,i){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++)this.ranges[i]=new wn(at(e,t[i].anchor),at(e,t[i].head))},origin:i&&i.origin};return pe(e,"beforeSelectionChange",e,r),e.cm&&pe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?kn(e.cm,r.ranges,r.ranges.length-1):t}(e,t,i));var r=i&&i.bias||(tt(t.primary().head,e.sel.primary().head)<0?-1:1);ts(e,rs(e,t,r,!0)),i&&!1===i.scroll||!e.cm||Rr(e.cm)}function ts(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,ve(e.cm)),ai(e,"cursorActivity",e))}function is(e){ts(e,rs(e,e.sel,null,!1))}function rs(e,t,i,r){for(var n,s=0;s<t.ranges.length;s++){var o=t.ranges[s],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],l=ss(e,o.anchor,a&&a.anchor,i,r),c=ss(e,o.head,a&&a.head,i,r);(n||l!=o.anchor||c!=o.head)&&(n||(n=t.ranges.slice(0,s)),n[s]=new wn(l,c))}return n?kn(e.cm,n,t.primIndex):t}function ns(e,t,i,r,n){var s=Ge(e,t.line);if(s.markedSpans)for(var o=0;o<s.markedSpans.length;++o){var a=s.markedSpans[o],l=a.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==a.from||(c?a.from<=t.ch:a.from<t.ch))&&(null==a.to||(u?a.to>=t.ch:a.to>t.ch))){if(n&&(pe(l,"beforeCursorEnter"),l.explicitlyCleared)){if(s.markedSpans){--o;continue}break}if(!l.atomic)continue;if(i){var h=l.find(r<0?1:-1),d=void 0;if((r<0?u:c)&&(h=os(e,h,-r,h&&h.line==t.line?s:null)),h&&h.line==t.line&&(d=tt(h,i))&&(r<0?d<0:d>0))return ns(e,h,t,r,n)}var f=l.find(r<0?-1:1);return(r<0?c:u)&&(f=os(e,f,r,f.line==t.line?s:null)),f?ns(e,f,t,r,n):null}}return t}function ss(e,t,i,r,n){var s=r||1,o=ns(e,t,i,s,n)||!n&&ns(e,t,i,s,!0)||ns(e,t,i,-s,n)||!n&&ns(e,t,i,-s,!0);return o||(e.cantEdit=!0,et(e.first,0))}function os(e,t,i,r){return i<0&&0==t.ch?t.line>e.first?at(e,et(t.line-1)):null:i>0&&t.ch==(r||Ge(e,t.line)).text.length?t.line<e.first+e.size-1?et(t.line+1,0):null:new et(t.line,t.ch+i)}function as(e){e.setSelection(et(e.firstLine(),0),et(e.lastLine()),K)}function ls(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(t,i,n,s){t&&(r.from=at(e,t)),i&&(r.to=at(e,i)),n&&(r.text=n),void 0!==s&&(r.origin=s)}),pe(e,"beforeChange",e,r),e.cm&&pe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function cs(e,t,i){if(e.cm){if(!e.cm.curOp)return Jr(e.cm,cs)(e,t,i);if(e.cm.state.suppressEdits)return}if(!(me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"))||(t=ls(e,t,!0))){var r=St&&!i&&function(e,t,i){var r=null;if(e.iter(t.line,i.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var i=e.markedSpans[t].marker;!i.readOnly||r&&-1!=j(r,i)||(r||(r=[])).push(i)}})),!r)return null;for(var n=[{from:t,to:i}],s=0;s<r.length;++s)for(var o=r[s],a=o.find(0),l=0;l<n.length;++l){var c=n[l];if(!(tt(c.to,a.from)<0||tt(c.from,a.to)>0)){var u=[l,1],h=tt(c.from,a.from),d=tt(c.to,a.to);(h<0||!o.inclusiveLeft&&!h)&&u.push({from:c.from,to:a.from}),(d>0||!o.inclusiveRight&&!d)&&u.push({from:a.to,to:c.to}),n.splice.apply(n,u),l+=u.length-3}}return n}(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)us(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else us(e,t)}}function us(e,t){if(1!=t.text.length||""!=t.text[0]||0!=tt(t.from,t.to)){var i=Ln(e,t);jn(e,t,i,e.cm?e.cm.curOp.id:NaN),fs(e,t,i,Et(e,t));var r=[];In(e,(function(e,i){i||-1!=j(r,e.history)||(ms(e.history,t),r.push(e.history)),fs(e,t,null,Et(e,t))}))}}function hs(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!r||i){for(var n,s=e.history,o=e.sel,a="undo"==t?s.done:s.undone,l="undo"==t?s.undone:s.done,c=0;c<a.length&&(n=a[c],i?!n.ranges||n.equals(e.sel):n.ranges);c++);if(c!=a.length){for(s.lastOrigin=s.lastSelOrigin=null;;){if(!(n=a.pop()).ranges){if(r)return void a.push(n);break}if(Kn(n,l),i&&!n.equals(e.sel))return void Jn(e,n,{clearRedo:!1});o=n}var u=[];Kn(o,l),l.push({changes:u,generation:s.generation}),s.generation=n.generation||++s.maxGeneration;for(var h=me(e,"beforeChange")||e.cm&&me(e.cm,"beforeChange"),d=function(i){var r=n.changes[i];if(r.origin=t,h&&!ls(e,r,!1))return a.length=0,{};u.push(Nn(e,r));var s=i?Ln(e,r):q(a);fs(e,r,s,zn(e,r)),!i&&e.cm&&e.cm.scrollIntoView({from:r.from,to:En(r)});var o=[];In(e,(function(e,t){t||-1!=j(o,e.history)||(ms(e.history,r),o.push(e.history)),fs(e,r,null,zn(e,r))}))},f=n.changes.length-1;f>=0;--f){var p=d(f);if(p)return p.v}}}}function ds(e,t){if(0!=t&&(e.first+=t,e.sel=new Cn(Q(e.sel.ranges,(function(e){return new wn(et(e.anchor.line+t,e.anchor.ch),et(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){ur(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)hr(e.cm,r,"gutter")}}function fs(e,t,i,r){if(e.cm&&!e.cm.curOp)return Jr(e.cm,fs)(e,t,i,r);if(t.to.line<e.first)ds(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var n=t.text.length-1-(e.first-t.from.line);ds(e,n),t={from:et(e.first,0),to:et(t.to.line+n,t.to.ch),text:[q(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:et(s,Ge(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ve(e,t.from,t.to),i||(i=Ln(e,t)),e.cm?function(e,t,i){var r=e.doc,n=e.display,s=t.from,o=t.to,a=!1,l=s.line;e.options.lineWrapping||(l=Ye(Nt(Ge(r,s.line))),r.iter(l,o.line+1,(function(e){if(e==n.maxLine)return a=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ve(e),Mn(r,t,i,or(e)),e.options.lineWrapping||(r.iter(l,s.line+t.text.length,(function(e){var t=Wt(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,a=!1)})),a&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=Ge(e,r).stateAfter;if(n&&(!(n instanceof ct)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}(r,s.line),rn(e,400);var c=t.text.length-(o.line-s.line)-1;t.full?ur(e):s.line!=o.line||1!=t.text.length||On(e.doc,t)?ur(e,s.line,o.line+1,c):hr(e,s.line,"text");var u=me(e,"changes"),h=me(e,"change");if(h||u){var d={from:s,to:o,text:t.text,removed:t.removed,origin:t.origin};h&&ai(e,"change",e,d),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(d)}e.display.selForContextMenu=null}(e.cm,t,r):Mn(e,t,r),es(e,i,K),e.cantEdit&&ss(e,et(e.firstLine(),0))&&(e.cantEdit=!1)}}function ps(e,t,i,r,n){var s;r||(r=i),tt(r,i)<0&&(i=(s=[r,i])[0],r=s[1]),"string"==typeof t&&(t=e.splitLines(t)),cs(e,{from:i,to:r,text:t,origin:n})}function gs(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vs(e,t,i,r){for(var n=0;n<e.length;++n){var s=e[n],o=!0;if(s.ranges){s.copied||((s=e[n]=s.deepCopy()).copied=!0);for(var a=0;a<s.ranges.length;a++)gs(s.ranges[a].anchor,t,i,r),gs(s.ranges[a].head,t,i,r)}else{for(var l=0;l<s.changes.length;++l){var c=s.changes[l];if(i<c.from.line)c.from=et(c.from.line+r,c.from.ch),c.to=et(c.to.line+r,c.to.ch);else if(t<=c.to.line){o=!1;break}}o||(e.splice(0,n+1),n=0)}}}function ms(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;vs(e.done,i,r,n),vs(e.undone,i,r,n)}function ys(e,t,i,r){var n=t,s=t;return"number"==typeof t?s=Ge(e,ot(e,t)):n=Ye(t),null==n?null:(r(s,n)&&e.cm&&hr(e.cm,n,i),s)}function _s(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}function bs(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}wn.prototype.from=function(){return st(this.anchor,this.head)},wn.prototype.to=function(){return nt(this.anchor,this.head)},wn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},_s.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,Vt(n),ai(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}},bs.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var s=Math.min(t,n-e),o=r.height;if(r.removeInner(e,s),this.height-=o-r.height,n==s&&(this.children.splice(i--,1),r.parent=null),0==(t-=s))break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof _s))){var a=[];this.collapse(a),this.children=[new _s(a)],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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],s=n.chunkSize();if(e<=s){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var o=n.lines.length%25+25,a=o;a<n.lines.length;){var l=new _s(n.lines.slice(a,a+=25));n.height-=l.height,this.children.splice(++r,0,l),l.parent=this}n.lines=n.lines.slice(0,o),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new bs(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var i=j(e.parent.children,e);e.parent.children.splice(i+1,0,t)}else{var r=new bs(e.children);r.parent=e,e.children=[r,t],e=r}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],s=n.chunkSize();if(e<s){var o=Math.min(t,s-e);if(n.iterN(e,o,i))return!0;if(0==(t-=o))break;e=0}else e-=s}}};var Ss=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};function Cs(e,t,i){Xt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ar(e,i)}Ss.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=Ye(i);if(null!=r&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var s=bi(this);Qe(i,Math.max(0,i.height-s)),e&&($r(e,(function(){Cs(e,i,-s),hr(e,r,"widget")})),ai(e,"lineWidgetCleared",e,this,r))}},Ss.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=bi(this)-t;n&&(Ut(this.doc,r)||Qe(r,r.height+n),i&&$r(i,(function(){i.curOp.forceUpdate=!0,Cs(i,r,n),ai(i,"lineWidgetChanged",i,e,Ye(r))})))},ye(Ss);var ws=0,ks=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ws};function xs(e,t,i,r,n){if(r&&r.shared)return function(e,t,i,r,n){(r=B(r)).shared=!1;var s=[xs(e,t,i,r,n)],o=s[0],a=r.widgetNode;return In(e,(function(e){a&&(r.widgetNode=a.cloneNode(!0)),s.push(xs(e,at(e,t),at(e,i),r,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;o=q(s)})),new Es(s,o)}(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Jr(e.cm,xs)(e,t,i,r,n);var s=new ks(e,n),o=tt(t,i);if(r&&B(r,s,!1),o>0||0==o&&!1!==s.clearWhenEmpty)return s;if(s.replacedWith&&(s.collapsed=!0,s.widgetNode=R("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0)),s.collapsed){if(Bt(e,t.line,t,i,s)||t.line!=i.line&&Bt(e,i.line,t,i,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ct=!0}s.addToHistory&&jn(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var a,l=t.line,c=e.cm;if(e.iter(l,i.line+1,(function(e){c&&s.collapsed&&!c.options.lineWrapping&&Nt(e)==c.display.maxLine&&(a=!0),s.collapsed&&l!=t.line&&Qe(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new wt(s,l==t.line?t.ch:null,l==i.line?i.ch:null)),++l})),s.collapsed&&e.iter(t.line,i.line+1,(function(t){Ut(e,t)&&Qe(t,0)})),s.clearOnEnter&&he(s,"beforeCursorEnter",(function(){return s.clear()})),s.readOnly&&(St=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++ws,s.atomic=!0),c){if(a&&(c.curOp.updateMaxLine=!0),s.collapsed)ur(c,t.line,i.line+1);else if(s.className||s.startStyle||s.endStyle||s.css||s.attributes||s.title)for(var u=t.line;u<=i.line;u++)hr(c,u,"text");s.atomic&&is(c.doc),ai(c,"markerAdded",c,s)}return s}ks.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&zr(e),me(this,"clear")){var i=this.find();i&&ai(this,"clear",i.from,i.to)}for(var r=null,n=null,s=0;s<this.lines.length;++s){var o=this.lines[s],a=kt(o.markedSpans,this);e&&!this.collapsed?hr(e,Ye(o),"text"):e&&(null!=a.to&&(n=Ye(o)),null!=a.from&&(r=Ye(o))),o.markedSpans=xt(o.markedSpans,a),null==a.from&&this.collapsed&&!Ut(this.doc,o)&&e&&Qe(o,ir(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var l=0;l<this.lines.length;++l){var c=Nt(this.lines[l]),u=Wt(c);u>e.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&ur(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&is(e.doc)),e&&ai(e,"markerCleared",e,this,r,n),t&&Gr(e),this.parent&&this.parent.clear()}},ks.prototype.find=function(e,t){var i,r;null==e&&"bookmark"==this.type&&(e=1);for(var n=0;n<this.lines.length;++n){var s=this.lines[n],o=kt(s.markedSpans,this);if(null!=o.from&&(i=et(t?s:Ye(s),o.from),-1==e))return i;if(null!=o.to&&(r=et(t?s:Ye(s),o.to),1==e))return r}return i&&{from:i,to:r}},ks.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;t&&r&&$r(r,(function(){var n=t.line,s=Ye(t.line),o=Ri(r,s);if(o&&(Bi(o),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Ut(i.doc,n)&&null!=i.height){var a=i.height;i.height=null;var l=bi(i)-a;l&&Qe(n,n.height+l)}ai(r,"markerChanged",r,e)}))},ks.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=j(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ks.prototype.detachLine=function(e){if(this.lines.splice(j(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ye(ks);var Es=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};function Ts(e){return e.findMarks(et(e.first,0),e.clipPos(et(e.lastLine())),(function(e){return e.parent}))}function Ls(e){for(var t=function(t){var i=e[t],r=[i.primary.doc];In(i.primary.doc,(function(e){return r.push(e)}));for(var n=0;n<i.markers.length;n++){var s=i.markers[n];-1==j(r,s.doc)&&(s.parent=null,i.markers.splice(n--,1))}},i=0;i<e.length;i++)t(i)}Es.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ai(this,"clear")}},Es.prototype.find=function(e,t){return this.primary.find(e,t)},ye(Es);var As=0,Rs=function(e,t,i,r,n){if(!(this instanceof Rs))return new Rs(e,t,i,r,n);null==i&&(i=0),bs.call(this,[new _s([new Gt("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var s=et(i,0);this.sel=xn(s),this.history=new Bn(null),this.id=++As,this.modeOption=t,this.lineSep=r,this.direction="rtl"==n?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Mn(this,{from:s,to:s,text:e}),Jn(this,xn(s),K)};Rs.prototype=Z(bs.prototype,{constructor:Rs,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=qe(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:tn((function(e){var t=et(this.first,0),i=this.first+this.size-1;cs(this,{from:t,to:et(i,Ge(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Dr(this.cm,0,0),Jn(this,xn(t),K)})),replaceRange:function(e,t,i,r){ps(this,e,t=at(this,t),i=i?at(this,i):t,r)},getRange:function(e,t,i){var r=Ve(this,at(this,e),at(this,t));return!1===i?r:r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if($e(this,e))return Ge(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Ge(this,e)),Nt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return at(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:tn((function(e,t,i){Zn(this,at(this,"number"==typeof e?et(e,t||0):e),null,i)})),setSelection:tn((function(e,t,i){Zn(this,at(this,e),at(this,t||e),i)})),extendSelection:tn((function(e,t,i){qn(this,at(this,e),t&&at(this,t),i)})),extendSelections:tn((function(e,t){Qn(this,lt(this,e),t)})),extendSelectionsBy:tn((function(e,t){Qn(this,lt(this,Q(this.sel.ranges,e)),t)})),setSelections:tn((function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new wn(at(this,e[n].anchor),at(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Jn(this,kn(this.cm,r,t),i)}})),addSelection:tn((function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new wn(at(this,e),at(this,t||e))),Jn(this,kn(this.cm,r,r.length-1),i)})),getSelection:function(e){for(var t,i=this.sel.ranges,r=0;r<i.length;r++){var n=Ve(this,i[r].from(),i[r].to());t=t?t.concat(n):n}return!1===e?t:t.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=Ve(this,i[r].from(),i[r].to());!1!==e&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:tn((function(e,t,i){for(var r=[],n=this.sel,s=0;s<n.ranges.length;s++){var o=n.ranges[s];r[s]={from:o.from(),to:o.to(),text:this.splitLines(e[s]),origin:i}}for(var a=t&&"end"!=t&&function(e,t,i){for(var r=[],n=et(e.first,0),s=n,o=0;o<t.length;o++){var a=t[o],l=An(a.from,n,s),c=An(En(a),n,s);if(n=a.to,s=c,"around"==i){var u=e.sel.ranges[o],h=tt(u.head,u.anchor)<0;r[o]=new wn(h?c:l,h?l:c)}else r[o]=new wn(l,l)}return new Cn(r,e.sel.primIndex)}(this,r,t),l=r.length-1;l>=0;l--)cs(this,r[l]);a?$n(this,a):this.cm&&Rr(this.cm)})),undo:tn((function(){hs(this,"undo")})),redo:tn((function(){hs(this,"redo")})),undoSelection:tn((function(){hs(this,"undo",!0)})),redoSelection:tn((function(){hs(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Bn(this.history.maxGeneration),In(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:Gn(this.history.done),undone:Gn(this.history.undone)}},setHistory:function(e){var t=this.history=new Bn(this.history.maxGeneration);t.done=Gn(e.done.slice(0),null,!0),t.undone=Gn(e.undone.slice(0),null,!0)},setGutterMarker:tn((function(e,t,i){return ys(this,e,"gutter",(function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=i,!i&&te(r)&&(e.gutterMarkers=null),!0}))})),clearGutter:tn((function(e){var t=this;this.iter((function(i){i.gutterMarkers&&i.gutterMarkers[e]&&ys(t,i,"gutter",(function(){return i.gutterMarkers[e]=null,te(i.gutterMarkers)&&(i.gutterMarkers=null),!0}))}))})),lineInfo:function(e){var t;if("number"==typeof e){if(!$e(this,e))return null;if(t=e,!(e=Ge(this,e)))return null}else if(null==(t=Ye(e)))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:tn((function(e,t,i){return ys(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[r]){if(k(i).test(e[r]))return!1;e[r]+=" "+i}else e[r]=i;return!0}))})),removeLineClass:tn((function(e,t,i){return ys(this,e,"gutter"==t?"gutter":"class",(function(e){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",n=e[r];if(!n)return!1;if(null==i)e[r]=null;else{var s=n.match(k(i));if(!s)return!1;var o=s.index+s[0].length;e[r]=n.slice(0,s.index)+(s.index&&o!=n.length?" ":"")+n.slice(o)||null}return!0}))})),addLineWidget:tn((function(e,t,i){return function(e,t,i,r){var n=new Ss(e,i,r),s=e.cm;return s&&n.noHScroll&&(s.display.alignWidgets=!0),ys(e,t,"widget",(function(t){var i=t.widgets||(t.widgets=[]);if(null==n.insertAt?i.push(n):i.splice(Math.min(i.length-1,Math.max(0,n.insertAt)),0,n),n.line=t,s&&!Ut(e,t)){var r=Xt(t)<e.scrollTop;Qe(t,t.height+bi(n)),r&&Ar(s,n.height),s.curOp.forceUpdate=!0}return!0})),s&&ai(s,"lineWidgetAdded",s,n,"number"==typeof t?t:Ye(t)),n}(this,e,t,i)})),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return xs(this,at(this,e),at(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return xs(this,e=at(this,e),e,i,"bookmark")},findMarksAt:function(e){var t=[],i=Ge(this,(e=at(this,e)).line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=at(this,e),t=at(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,(function(s){var o=s.markedSpans;if(o)for(var a=0;a<o.length;a++){var l=o[a];null!=l.to&&n==e.line&&e.ch>=l.to||null==l.from&&n!=e.line||null!=l.from&&n==t.line&&l.from>=t.ch||i&&!i(l.marker)||r.push(l.marker.parent||l.marker)}++n})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)null!=i[r].from&&e.push(i[r].marker)})),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter((function(n){var s=n.text.length+r;if(s>e)return t=e,!0;e-=s,++i})),at(this,et(i,t))},indexFromPos:function(e){var t=(e=at(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,(function(e){t+=e.text.length+i})),t},copy:function(e){var t=new Rs(qe(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,i=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<i&&(i=e.to);var r=new Rs(qe(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),s=e.clipPos(n.from),o=e.clipPos(n.to);if(tt(s,o)){var a=xs(e,s,o,r.primary,r.primary.type);r.markers.push(a),a.parent=r}}}(r,Ts(this)),r},unlinkDoc:function(e){if(e instanceof To&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t)if(this.linked[t].doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Ls(Ts(this));break}if(e.history==this.history){var i=[e.id];In(e,(function(e){return i.push(e.id)}),!0),e.history=new Bn(null),e.history.done=Gn(this.history.done,i),e.history.undone=Gn(this.history.undone,i)}},iterLinkedDocs:function(e){In(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):De(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:tn((function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter((function(e){return e.order=null})),this.cm&&$r(t=this.cm,(function(){Fn(t),ur(t)})))}))}),Rs.prototype.eachLine=Rs.prototype.iter;var Ds=0;function Os(e){var t=this;if(Ms(t),!ge(t,e)&&!Si(t.display,e)){_e(e),o&&(Ds=+new Date);var i=lr(t,e,!0),r=e.dataTransfer.files;if(i&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,s=Array(n),a=0,l=function(){++a==n&&Jr(t,(function(){var e={from:i=at(t.doc,i),to:i,text:t.doc.splitLines(s.filter((function(e){return null!=e})).join(t.doc.lineSeparator())),origin:"paste"};cs(t.doc,e),$n(t.doc,xn(at(t.doc,i),at(t.doc,En(e))))}))()},c=function(e,i){if(t.options.allowDropFileTypes&&-1==j(t.options.allowDropFileTypes,e.type))l();else{var r=new FileReader;r.onerror=function(){return l()},r.onload=function(){var e=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(s[i]=e),l()},r.readAsText(e)}},u=0;u<r.length;u++)c(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var h=e.dataTransfer.getData("Text");if(h){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),es(t.doc,xn(i,i)),d)for(var f=0;f<d.length;++f)ps(t.doc,"",d[f].anchor,d[f].head,"drag");t.replaceSelection(h,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Ms(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Is(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation((function(){for(var t=0;t<i.length;t++)e(i[t])}))}}var Ps=!1;function Fs(){var e;Ps||(he(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Is(Bs)}),100))})),he(window,"blur",(function(){return Is(kr)})),Ps=!0)}function Bs(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Ns={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"},Hs=0;Hs<10;Hs++)Ns[Hs+48]=Ns[Hs+96]=String(Hs);for(var js=65;js<=90;js++)Ns[js]=String.fromCharCode(js);for(var Us=1;Us<=12;Us++)Ns[Us+111]=Ns[Us+63235]="F"+Us;var Ks={};function Xs(e){var t,i,r,n,s=e.split(/-(?!$)/);e=s[s.length-1];for(var o=0;o<s.length-1;o++){var a=s[o];if(/^(cmd|meta|m)$/i.test(a))n=!0;else if(/^a(lt)?$/i.test(a))t=!0;else if(/^(c|ctrl|control)$/i.test(a))i=!0;else{if(!/^s(hift)?$/i.test(a))throw new Error("Unrecognized modifier name: "+a);r=!0}}return t&&(e="Alt-"+e),i&&(e="Ctrl-"+e),n&&(e="Cmd-"+e),r&&(e="Shift-"+e),e}function Ws(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if("..."==r){delete e[i];continue}for(var n=Q(i.split(" "),Xs),s=0;s<n.length;s++){var o=void 0,a=void 0;s==n.length-1?(a=n.join(" "),o=r):(a=n.slice(0,s+1).join(" "),o="...");var l=t[a];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+a)}else t[a]=o}delete e[i]}for(var c in t)e[c]=t[c];return e}function zs(e,t,i,r){var n=(t=Qs(t)).call?t.call(e,r):t[e];if(!1===n)return"nothing";if("..."===n)return"multi";if(null!=n&&i(n))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return zs(e,t.fallthrough,i,r);for(var s=0;s<t.fallthrough.length;s++){var o=zs(e,t.fallthrough[s],i,r);if(o)return o}}}function Gs(e){var t="string"==typeof e?e:Ns[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function Vs(e,t,i){var r=e;return t.altKey&&"Alt"!=r&&(e="Alt-"+e),(C?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(e="Ctrl-"+e),(C?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(e="Cmd-"+e),!i&&t.shiftKey&&"Shift"!=r&&(e="Shift-"+e),e}function qs(e,t){if(h&&34==e.keyCode&&e.char)return!1;var i=Ns[e.keyCode];return null!=i&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(i=e.code),Vs(i,e,t))}function Qs(e){return"string"==typeof e?Ks[e]:e}function Ys(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var s=t(i[n]);r.length&&tt(s.from,q(r).to)<=0;){var o=r.pop();if(tt(o.from,s.from)<0){s.from=o.from;break}}r.push(s)}$r(e,(function(){for(var t=r.length-1;t>=0;t--)ps(e.doc,"",r[t].from,r[t].to,"+delete");Rr(e)}))}function Zs(e,t,i){var r=ne(e.text,t+i,i);return r<0||r>e.text.length?null:r}function $s(e,t,i){var r=Zs(e,t.ch,i);return null==r?null:new et(t.line,r,i<0?"after":"before")}function Js(e,t,i,r,n){if(e){"rtl"==t.doc.direction&&(n=-n);var s=ce(i,t.doc.direction);if(s){var o,a=n<0?q(s):s[0],l=n<0==(1==a.level)?"after":"before";if(a.level>0||"rtl"==t.doc.direction){var c=Di(t,i);o=n<0?i.text.length-1:0;var u=Oi(t,c,o).top;o=se((function(e){return Oi(t,c,e).top==u}),n<0==(1==a.level)?a.from:a.to-1,o),"before"==l&&(o=Zs(i,o,1))}else o=n<0?a.to:a.from;return new et(r,o,l)}}return new et(r,n<0?i.text.length:0,n<0?"before":"after")}Ks.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"},Ks.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"},Ks.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"},Ks.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"]},Ks.default=y?Ks.macDefault:Ks.pcDefault;var eo={selectAll:as,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),K)},killLine:function(e){return Ys(e,(function(t){if(t.empty()){var i=Ge(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:et(t.head.line+1,0)}:{from:t.head,to:et(t.head.line,i)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){return Ys(e,(function(t){return{from:et(t.from().line,0),to:at(e.doc,et(t.to().line+1,0))}}))},delLineLeft:function(e){return Ys(e,(function(e){return{from:et(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){return Ys(e,(function(t){var i=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:i},"div"),to:t.from()}}))},delWrappedLineRight:function(e){return Ys(e,(function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}}))},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(et(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(et(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy((function(t){return to(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy((function(t){return io(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy((function(t){return function(e,t){var i=Ge(e.doc,t),r=function(e){for(var t;t=Pt(e);)e=t.find(1,!0).line;return e}(i);return r!=i&&(t=Ye(r)),Js(!0,e,i,t,-1)}(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy((function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")}),W)},goLineLeft:function(e){return e.extendSelectionsBy((function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")}),W)},goLineLeftSmart:function(e){return e.extendSelectionsBy((function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?io(e,t.head):r}),W)},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("\t")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var s=i[n].from(),o=N(e.getLine(s.line),s.ch,r);t.push(V(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return $r(e,(function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,s=Ge(e.doc,n.line).text;if(s)if(n.ch==s.length&&(n=new et(n.line,n.ch-1)),n.ch>0)n=new et(n.line,n.ch+1),e.replaceRange(s.charAt(n.ch-1)+s.charAt(n.ch-2),et(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var o=Ge(e.doc,n.line-1).text;o&&(n=new et(n.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),et(n.line-1,o.length-1),n,"+transpose"))}i.push(new wn(n,n))}e.setSelections(i)}))},newlineAndIndent:function(e){return $r(e,(function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Rr(e)}))},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function to(e,t){var i=Ge(e.doc,t),r=Nt(i);return r!=i&&(t=Ye(r)),Js(!0,e,r,t,1)}function io(e,t){var i=to(e,t.line),r=Ge(e.doc,i.line),n=ce(r,e.doc.direction);if(!n||0==n[0].level){var s=Math.max(i.ch,r.text.search(/\S/)),o=t.line==i.line&&t.ch<=s&&t.ch;return et(i.line,o?0:s,i.sticky)}return i}function ro(e,t,i){if("string"==typeof t&&!(t=eo[t]))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=U}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}var no=new H;function so(e,t,i,r){var n=e.state.keySeq;if(n){if(Gs(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:no.set(50,(function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())})),oo(e,n+" "+t,i,r))return!0}return oo(e,t,i,r)}function oo(e,t,i,r){var n=function(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=zs(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&zs(t,e.options.extraKeys,i,e)||zs(t,e.options.keyMap,i,e)}(e,t,r);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&ai(e,"keyHandled",e,t,i),"handled"!=n&&"multi"!=n||(_e(i),br(e)),!!n}function ao(e,t){var i=qs(t,!0);return!!i&&(t.shiftKey&&!e.state.keySeq?so(e,"Shift-"+i,t,(function(t){return ro(e,t,!0)}))||so(e,i,t,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ro(e,t)})):so(e,i,t,(function(t){return ro(e,t)})))}var lo=null;function co(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||(t.curOp.focus=O(),ge(t,e)))){o&&a<11&&27==e.keyCode&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=16==r||e.shiftKey;var n=ao(t,e);h&&(lo=n?r:null,n||88!=r||Me||!(y?e.metaKey:e.ctrlKey)||t.replaceSelection("",null,"cut")),i&&!y&&!n&&46==r&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=r||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(e){var t=e.display.lineDiv;function i(e){18!=e.keyCode&&e.altKey||(E(t,"CodeMirror-crosshair"),fe(document,"keyup",i),fe(document,"mouseover",i))}M(t,"CodeMirror-crosshair"),he(document,"keyup",i),he(document,"mouseover",i)}(t)}}function uo(e){16==e.keyCode&&(this.doc.sel.shift=!1),ge(this,e)}function ho(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Si(t.display,e)||ge(t,e)||e.ctrlKey&&!e.altKey||y&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(h&&i==lo)return lo=null,void _e(e);if(!h||e.which&&!(e.which<10)||!ao(t,e)){var n=String.fromCharCode(null==r?i:r);"\b"!=n&&(function(e,t,i){return so(e,"'"+i+"'",t,(function(t){return ro(e,t,!0)}))}(t,e,n)||t.display.input.onKeyPress(e))}}}var fo,po,go=function(e,t,i){this.time=e,this.pos=t,this.button=i};function vo(e){var t=this,i=t.display;if(!(ge(t,e)||i.activeTouch&&i.input.supportsTouch()))if(i.input.ensurePolled(),i.shift=e.shiftKey,Si(i,e))l||(i.scroller.draggable=!1,setTimeout((function(){return i.scroller.draggable=!0}),100));else if(!_o(t,e)){var r=lr(t,e),n=ke(e),s=r?function(e,t){var i=+new Date;return po&&po.compare(i,e,t)?(fo=po=null,"triple"):fo&&fo.compare(i,e,t)?(po=new go(i,e,t),fo=null,"double"):(fo=new go(i,e,t),po=null,"single")}(r,n):"single";window.focus(),1==n&&t.state.selectingText&&t.state.selectingText(e),r&&function(e,t,i,r,n){var s="Click";return"double"==r?s="Double"+s:"triple"==r&&(s="Triple"+s),so(e,Vs(s=(1==t?"Left":2==t?"Middle":"Right")+s,n),n,(function(t){if("string"==typeof t&&(t=eo[t]),!t)return!1;var r=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r=t(e,i)!=U}finally{e.state.suppressEdits=!1}return r}))}(t,n,r,s,e)||(1==n?r?function(e,t,i,r){o?setTimeout(F(Sr,e),0):e.curOp.focus=O();var n,s=function(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(null==n.unit){var s=_?i.shiftKey&&i.metaKey:i.altKey;n.unit=s?"rectangle":"single"==t?"char":"double"==t?"word":"line"}return(null==n.extend||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),null==n.addNew&&(n.addNew=y?i.metaKey:i.ctrlKey),null==n.moveOnDrag&&(n.moveOnDrag=!(y?i.altKey:i.ctrlKey)),n}(e,i,r),c=e.doc.sel;e.options.dragDrop&&Te&&!e.isReadOnly()&&"single"==i&&(n=c.contains(t))>-1&&(tt((n=c.ranges[n]).from(),t)<0||t.xRel>0)&&(tt(n.to(),t)>0||t.xRel<0)?function(e,t,i,r){var n=e.display,s=!1,c=Jr(e,(function(t){l&&(n.scroller.draggable=!1),e.state.draggingText=!1,fe(n.wrapper.ownerDocument,"mouseup",c),fe(n.wrapper.ownerDocument,"mousemove",u),fe(n.scroller,"dragstart",h),fe(n.scroller,"drop",c),s||(_e(t),r.addNew||qn(e.doc,i,null,null,r.extend),l&&!d||o&&9==a?setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()}),20):n.input.focus())})),u=function(e){s=s||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},h=function(){return s=!0};l&&(n.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),he(n.wrapper.ownerDocument,"mouseup",c),he(n.wrapper.ownerDocument,"mousemove",u),he(n.scroller,"dragstart",h),he(n.scroller,"drop",c),Cr(e),setTimeout((function(){return n.input.focus()}),20)}(e,r,t,s):function(e,t,i,r){var n=e.display,s=e.doc;_e(t);var o,a,l=s.sel,c=l.ranges;if(r.addNew&&!r.extend?(a=s.sel.contains(i),o=a>-1?c[a]:new wn(i,i)):(o=s.sel.primary(),a=s.sel.primIndex),"rectangle"==r.unit)r.addNew||(o=new wn(i,i)),i=lr(e,t,!0,!0),a=-1;else{var u=mo(e,i,r.unit);o=r.extend?Vn(o,u.anchor,u.head,r.extend):u}r.addNew?-1==a?(a=c.length,Jn(s,kn(e,c.concat([o]),a),{scroll:!1,origin:"*mouse"})):c.length>1&&c[a].empty()&&"char"==r.unit&&!r.extend?(Jn(s,kn(e,c.slice(0,a).concat(c.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),l=s.sel):Yn(s,a,o,X):(a=0,Jn(s,new Cn([o],0),X),l=s.sel);var h=i;function d(t){if(0!=tt(h,t))if(h=t,"rectangle"==r.unit){for(var n=[],c=e.options.tabSize,u=N(Ge(s,i.line).text,i.ch,c),d=N(Ge(s,t.line).text,t.ch,c),f=Math.min(u,d),p=Math.max(u,d),g=Math.min(i.line,t.line),v=Math.min(e.lastLine(),Math.max(i.line,t.line));g<=v;g++){var m=Ge(s,g).text,y=z(m,f,c);f==p?n.push(new wn(et(g,y),et(g,y))):m.length>y&&n.push(new wn(et(g,y),et(g,z(m,p,c))))}n.length||n.push(new wn(i,i)),Jn(s,kn(e,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var _,b=o,S=mo(e,t,r.unit),C=b.anchor;tt(S.anchor,C)>0?(_=S.head,C=st(b.from(),S.anchor)):(_=S.anchor,C=nt(b.to(),S.head));var w=l.ranges.slice(0);w[a]=function(e,t){var i=t.anchor,r=t.head,n=Ge(e.doc,i.line);if(0==tt(i,r)&&i.sticky==r.sticky)return t;var s=ce(n);if(!s)return t;var o=ae(s,i.ch,i.sticky),a=s[o];if(a.from!=i.ch&&a.to!=i.ch)return t;var l,c=o+(a.from==i.ch==(1!=a.level)?0:1);if(0==c||c==s.length)return t;if(r.line!=i.line)l=(r.line-i.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ae(s,r.ch,r.sticky),h=u-o||(r.ch-i.ch)*(1==a.level?-1:1);l=u==c-1||u==c?h<0:h>0}var d=s[c+(l?-1:0)],f=l==(1==d.level),p=f?d.from:d.to,g=f?"after":"before";return i.ch==p&&i.sticky==g?t:new wn(new et(i.line,p,g),r)}(e,new wn(at(s,C),_)),Jn(s,kn(e,w,a),X)}}var f=n.wrapper.getBoundingClientRect(),p=0;function g(t){e.state.selectingText=!1,p=1/0,t&&(_e(t),n.input.focus()),fe(n.wrapper.ownerDocument,"mousemove",v),fe(n.wrapper.ownerDocument,"mouseup",m),s.history.lastSelOrigin=null}var v=Jr(e,(function(t){0!==t.buttons&&ke(t)?function t(i){var o=++p,a=lr(e,i,!0,"rectangle"==r.unit);if(a)if(0!=tt(a,h)){e.curOp.focus=O(),d(a);var l=Tr(n,s);(a.line>=l.to||a.line<l.from)&&setTimeout(Jr(e,(function(){p==o&&t(i)})),150)}else{var c=i.clientY<f.top?-20:i.clientY>f.bottom?20:0;c&&setTimeout(Jr(e,(function(){p==o&&(n.scroller.scrollTop+=c,t(i))})),50)}}(t):g(t)})),m=Jr(e,g);e.state.selectingText=m,he(n.wrapper.ownerDocument,"mousemove",v),he(n.wrapper.ownerDocument,"mouseup",m)}(e,r,t,s)}(t,r,s,e):we(e)==i.scroller&&_e(e):2==n?(r&&qn(t.doc,r),setTimeout((function(){return i.input.focus()}),20)):3==n&&(w?t.display.input.onContextMenu(e):Cr(t)))}}function mo(e,t,i){if("char"==i)return new wn(t,t);if("word"==i)return e.findWordAt(t);if("line"==i)return new wn(et(t.line,0),at(e.doc,et(t.line+1,0)));var r=i(e,t);return new wn(r.from,r.to)}function yo(e,t,i,r){var n,s;if(t.touches)n=t.touches[0].clientX,s=t.touches[0].clientY;else try{n=t.clientX,s=t.clientY}catch(e){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_e(t);var o=e.display,a=o.lineDiv.getBoundingClientRect();if(s>a.bottom||!me(e,i))return Se(t);s-=a.top-o.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=o.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=n)return pe(e,i,e,Ze(e.doc,s),e.display.gutterSpecs[l].className,t),Se(t)}}function _o(e,t){return yo(e,t,"gutterClick",!0)}function bo(e,t){Si(e.display,t)||function(e,t){return!!me(e,"gutterContextMenu")&&yo(e,t,"gutterContextMenu",!1)}(e,t)||ge(e,t,"contextmenu")||w||e.display.input.onContextMenu(t)}function So(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Hi(e)}go.prototype.compare=function(e,t,i){return this.time+400>e&&0==tt(t,this.pos)&&i==this.button};var Co={toString:function(){return"CodeMirror.Init"}},wo={},ko={};function xo(e,t,i){if(!t!=!(i&&i!=Co)){var r=e.display.dragFunctions,n=t?he:fe;n(e.display.scroller,"dragstart",r.start),n(e.display.scroller,"dragenter",r.enter),n(e.display.scroller,"dragover",r.over),n(e.display.scroller,"dragleave",r.leave),n(e.display.scroller,"drop",r.drop)}}function Eo(e){e.options.lineWrapping?(M(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(E(e.display.wrapper,"CodeMirror-wrap"),zt(e)),ar(e),ur(e),Hi(e),setTimeout((function(){return jr(e)}),100)}function To(e,t){var i=this;if(!(this instanceof To))return new To(e,t);this.options=t=t?B(t):{},B(wo,t,!1);var r=t.value;"string"==typeof r?r=new Rs(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new To.inputStyles[t.inputStyle](this),s=this.display=new vn(e,r,n,t);for(var c in s.wrapper.CodeMirror=this,So(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Xr(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 H,keySeq:null,specialChars:null},t.autofocus&&!m&&s.input.focus(),o&&a<11&&setTimeout((function(){return i.display.input.reset(!0)}),20),function(e){var t=e.display;he(t.scroller,"mousedown",Jr(e,vo)),he(t.scroller,"dblclick",o&&a<11?Jr(e,(function(t){if(!ge(e,t)){var i=lr(e,t);if(i&&!_o(e,t)&&!Si(e.display,t)){_e(t);var r=e.findWordAt(i);qn(e.doc,r.anchor,r.head)}}})):function(t){return ge(e,t)||_e(t)}),he(t.scroller,"contextmenu",(function(t){return bo(e,t)})),he(t.input.getField(),"contextmenu",(function(i){t.scroller.contains(i.target)||bo(e,i)}));var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function s(e,t){if(null==t.left)return!0;var i=t.left-e.left,r=t.top-e.top;return i*i+r*r>400}he(t.scroller,"touchstart",(function(n){if(!ge(e,n)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(n)&&!_o(e,n)){t.input.ensurePolled(),clearTimeout(i);var s=+new Date;t.activeTouch={start:s,moved:!1,prev:s-r.end<=300?r:null},1==n.touches.length&&(t.activeTouch.left=n.touches[0].pageX,t.activeTouch.top=n.touches[0].pageY)}})),he(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),he(t.scroller,"touchend",(function(i){var r=t.activeTouch;if(r&&!Si(t,i)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||s(r,r.prev)?new wn(a,a):!r.prev.prev||s(r,r.prev.prev)?e.findWordAt(a):new wn(et(a.line,0),at(e.doc,et(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),_e(i)}n()})),he(t.scroller,"touchcancel",n),he(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(Ir(e,t.scroller.scrollTop),Fr(e,t.scroller.scrollLeft,!0),pe(e,"scroll",e))})),he(t.scroller,"mousewheel",(function(t){return Sn(e,t)})),he(t.scroller,"DOMMouseScroll",(function(t){return Sn(e,t)})),he(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ge(e,t)||Ce(t)},over:function(t){ge(e,t)||(function(e,t){var i=lr(e,t);if(i){var r=document.createDocumentFragment();mr(e,i,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),L(e.display.dragCursor,r)}}(e,t),Ce(t))},start:function(t){return function(e,t){if(o&&(!e.state.draggingText||+new Date-Ds<100))Ce(t);else if(!ge(e,t)&&!Si(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var i=A("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",h&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),h&&i.parentNode.removeChild(i)}}(e,t)},drop:Jr(e,Os),leave:function(t){ge(e,t)||Ms(e)}};var l=t.input.getField();he(l,"keyup",(function(t){return uo.call(e,t)})),he(l,"keydown",Jr(e,co)),he(l,"keypress",Jr(e,ho)),he(l,"focus",(function(t){return wr(e,t)})),he(l,"blur",(function(t){return kr(e,t)}))}(this),Fs(),zr(this),this.curOp.forceUpdate=!0,Pn(this,r),t.autofocus&&!m||this.hasFocus()?setTimeout((function(){i.hasFocus()&&!i.state.focused&&wr(i)}),20):kr(this),ko)ko.hasOwnProperty(c)&&ko[c](this,t[c],Co);dn(this),t.finishInit&&t.finishInit(this);for(var u=0;u<Lo.length;++u)Lo[u](this);Gr(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(s.lineDiv).textRendering&&(s.lineDiv.style.textRendering="auto")}To.defaults=wo,To.optionHandlers=ko;var Lo=[];function Ao(e,t,i,r){var n,s=e.doc;null==i&&(i="add"),"smart"==i&&(s.mode.indent?n=ft(e,t).state:i="prev");var o=e.options.tabSize,a=Ge(s,t),l=N(a.text,null,o);a.stateAfter&&(a.stateAfter=null);var c,u=a.text.match(/^\s*/)[0];if(r||/\S/.test(a.text)){if("smart"==i&&((c=s.mode.indent(n,a.text.slice(u.length),a.text))==U||c>150)){if(!r)return;i="prev"}}else c=0,i="not";"prev"==i?c=t>s.first?N(Ge(s,t-1).text,null,o):0:"add"==i?c=l+e.options.indentUnit:"subtract"==i?c=l-e.options.indentUnit:"number"==typeof i&&(c=l+i),c=Math.max(0,c);var h="",d=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/o);f;--f)d+=o,h+="\t";if(d<c&&(h+=V(c-d)),h!=u)return ps(s,h,et(t,0),et(t,u.length),"+input"),a.stateAfter=null,!0;for(var p=0;p<s.sel.ranges.length;p++){var g=s.sel.ranges[p];if(g.head.line==t&&g.head.ch<u.length){var v=et(t,u.length);Yn(s,p,new wn(v,v));break}}}To.defineInitHook=function(e){return Lo.push(e)};var Ro=null;function Do(e){Ro=e}function Oo(e,t,i,r,n){var s=e.doc;e.display.shift=!1,r||(r=s.sel);var o=+new Date-200,a="paste"==n||e.state.pasteIncoming>o,l=De(t),c=null;if(a&&r.ranges.length>1)if(Ro&&Ro.text.join("\n")==t){if(r.ranges.length%Ro.text.length==0){c=[];for(var u=0;u<Ro.text.length;u++)c.push(s.splitLines(Ro.text[u]))}}else l.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(c=Q(l,(function(e){return[e]})));for(var h=e.curOp.updateInput,d=r.ranges.length-1;d>=0;d--){var f=r.ranges[d],p=f.from(),g=f.to();f.empty()&&(i&&i>0?p=et(p.line,p.ch-i):e.state.overwrite&&!a?g=et(g.line,Math.min(Ge(s,g.line).text.length,g.ch+q(l).length)):a&&Ro&&Ro.lineWise&&Ro.text.join("\n")==l.join("\n")&&(p=g=et(p.line,0)));var v={from:p,to:g,text:c?c[d%c.length]:l,origin:n||(a?"paste":e.state.cutIncoming>o?"cut":"+input")};cs(e.doc,v),ai(e,"inputRead",e,v)}t&&!a&&Io(e,t),Rr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=h),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Mo(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||$r(t,(function(){return Oo(t,i,0,null,"paste")})),!0}function Io(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var s=e.getModeAt(n.head),o=!1;if(s.electricChars){for(var a=0;a<s.electricChars.length;a++)if(t.indexOf(s.electricChars.charAt(a))>-1){o=Ao(e,n.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(Ge(e.doc,n.head.line).text.slice(0,n.head.ch))&&(o=Ao(e,n.head.line,"smart"));o&&ai(e,"electricInput",e,n.head.line)}}}function Po(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,s={anchor:et(n,0),head:et(n+1,0)};i.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:i}}function Fo(e,t,i,r){e.setAttribute("autocorrect",i?"":"off"),e.setAttribute("autocapitalize",r?"":"off"),e.setAttribute("spellcheck",!!t)}function Bo(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Fo(e),t}function No(e,t,i,r,n){var s=t,o=i,a=Ge(e,t.line),l=n&&"rtl"==e.direction?-i:i;function c(s){var o,c;if("codepoint"==r){var u=a.text.charCodeAt(t.ch+(r>0?0:-1));o=isNaN(u)?null:new et(t.line,Math.max(0,Math.min(a.text.length,t.ch+i*(u>=55296&&u<56320?2:1))),-i)}else o=n?function(e,t,i,r){var n=ce(t,e.doc.direction);if(!n)return $s(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var s=ae(n,i.ch,i.sticky),o=n[s];if("ltr"==e.doc.direction&&o.level%2==0&&(r>0?o.to>i.ch:o.from<i.ch))return $s(t,i,r);var a,l=function(e,i){return Zs(t,e instanceof et?e.ch:e,i)},c=function(i){return e.options.lineWrapping?(a=a||Di(e,t),Zi(e,t,a,i)):{begin:0,end:t.text.length}},u=c("before"==i.sticky?l(i,-1):i.ch);if("rtl"==e.doc.direction||1==o.level){var h=1==o.level==r<0,d=l(i,h?1:-1);if(null!=d&&(h?d<=o.to&&d<=u.end:d>=o.from&&d>=u.begin)){var f=h?"before":"after";return new et(i.line,d,f)}}var p=function(e,t,r){for(var s=function(e,t){return t?new et(i.line,l(e,1),"before"):new et(i.line,e,"after")};e>=0&&e<n.length;e+=t){var o=n[e],a=t>0==(1!=o.level),c=a?r.begin:l(r.end,-1);if(o.from<=c&&c<o.to)return s(c,a);if(c=a?o.from:l(o.to,-1),r.begin<=c&&c<r.end)return s(c,a)}},g=p(s+r,r,u);if(g)return g;var v=r>0?u.end:l(u.begin,-1);return null==v||r>0&&v==t.text.length||!(g=p(r>0?0:n.length-1,r,c(v)))?null:g}(e.cm,a,t,i):$s(a,t,i);if(null==o){if(s||(c=t.line+l)<e.first||c>=e.first+e.size||(t=new et(c,t.ch,t.sticky),!(a=Ge(e,c))))return!1;t=Js(n,e.cm,a,t.line,l)}else t=o;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var u=null,h="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(i<0)||c(!f);f=!1){var p=a.text.charAt(t.ch)||"\n",g=ee(p,d)?"w":h&&"\n"==p?"n":!h||/\s/.test(p)?null:"p";if(!h||f||g||(g="s"),u&&u!=g){i<0&&(i=1,c(),t.sticky="after");break}if(g&&(u=g),i>0&&!c(!f))break}var v=ss(e,t,s,o,!0);return it(s,v)&&(v.hitSide=!0),v}function Ho(e,t,i,r){var n,s,o=e.doc,a=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*ir(e.display),3);n=(i>0?t.bottom:t.top)+i*c}else"line"==r&&(n=i>0?t.bottom+3:t.top-3);for(;(s=Qi(e,a,n)).outside;){if(i<0?n<=0:n>=o.height){s.hitSide=!0;break}n+=5*i}return s}var jo=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Uo(e,t){var i=Ri(e,t.line);if(!i||i.hidden)return null;var r=Ge(e.doc,t.line),n=Li(i,r,t.line),s=ce(r,e.doc.direction),o="left";s&&(o=ae(s,t.ch)%2?"right":"left");var a=Pi(n.map,t.ch,o);return a.offset="right"==a.collapse?a.end:a.start,a}function Ko(e,t){return t&&(e.bad=!0),e}function Xo(e,t,i){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[i]))return Ko(e.clipPos(et(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var s=e.display.view[n];if(s.node==r)return Wo(s,t,i)}}function Wo(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!D(r,t))return Ko(et(Ye(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var s=e.rest?q(e.rest):e.line;return Ko(et(Ye(s),s.text.length),n)}var o=3==t.nodeType?t:null,a=t;for(o||1!=t.childNodes.length||3!=t.firstChild.nodeType||(o=t.firstChild,i&&(i=o.nodeValue.length));a.parentNode!=r;)a=a.parentNode;var l=e.measure,c=l.maps;function u(t,i,r){for(var n=-1;n<(c?c.length:0);n++)for(var s=n<0?l.map:c[n],o=0;o<s.length;o+=3){var a=s[o+2];if(a==t||a==i){var u=Ye(n<0?e.line:e.rest[n]),h=s[o]+r;return(r<0||a!=t)&&(h=s[o+(r?1:0)]),et(u,h)}}}var h=u(o,a,i);if(h)return Ko(h,n);for(var d=a.nextSibling,f=o?o.nodeValue.length-i:0;d;d=d.nextSibling){if(h=u(d,d.firstChild,0))return Ko(et(h.line,h.ch-f),n);f+=d.textContent.length}for(var p=a.previousSibling,g=i;p;p=p.previousSibling){if(h=u(p,p.firstChild,-1))return Ko(et(h.line,h.ch+g),n);g+=p.textContent.length}}jo.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;function s(e){for(var t=e.target;t;t=t.parentNode){if(t==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function o(e){if(s(e)&&!ge(r,e)){if(r.somethingSelected())Do({lineWise:!1,text:r.getSelections()}),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=Po(r);Do({lineWise:!0,text:t.text}),"cut"==e.type&&r.operation((function(){r.setSelections(t.ranges,0,K),r.replaceSelection("",null,"cut")}))}if(e.clipboardData){e.clipboardData.clearData();var o=Ro.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=Bo(),l=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),l.value=Ro.text.join("\n");var c=document.activeElement;P(l),setTimeout((function(){r.display.lineSpace.removeChild(a),c.focus(),c==n&&i.showPrimarySelection()}),50)}}Fo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize),he(n,"paste",(function(e){!s(e)||ge(r,e)||Mo(e,r)||a<=11&&setTimeout(Jr(r,(function(){return t.updateFromDOM()})),20)})),he(n,"compositionstart",(function(e){t.composing={data:e.data,done:!1}})),he(n,"compositionupdate",(function(e){t.composing||(t.composing={data:e.data,done:!1})})),he(n,"compositionend",(function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)})),he(n,"touchstart",(function(){return i.forceCompositionEnd()})),he(n,"input",(function(){t.composing||t.readFromDOMSoon()})),he(n,"copy",o),he(n,"cut",o)},jo.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},jo.prototype.prepareSelection=function(){var e=vr(this.cm,!1);return e.focus=document.activeElement==this.div,e},jo.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},jo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},jo.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),s=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||s.line<t.display.viewFrom)e.removeAllRanges();else{var o=Xo(t,e.anchorNode,e.anchorOffset),a=Xo(t,e.focusNode,e.focusOffset);if(!o||o.bad||!a||a.bad||0!=tt(st(o,a),n)||0!=tt(nt(o,a),s)){var l=t.display.view,c=n.line>=t.display.viewFrom&&Uo(t,n)||{node:l[0].measure.map[2],offset:0},u=s.line<t.display.viewTo&&Uo(t,s);if(!u){var h=l[l.length-1].measure,d=h.maps?h.maps[h.maps.length-1]:h.map;u={node:d[d.length-1],offset:d[d.length-2]-d[d.length-3]}}if(c&&u){var f,p=e.rangeCount&&e.getRangeAt(0);try{f=x(c.node,c.offset,u.offset,u.node)}catch(e){}f&&(!i&&t.state.focused?(e.collapse(c.node,c.offset),f.collapsed||(e.removeAllRanges(),e.addRange(f))):(e.removeAllRanges(),e.addRange(f)),p&&null==e.anchorNode?e.addRange(p):i&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},jo.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)},jo.prototype.showMultipleSelections=function(e){L(this.cm.display.cursorDiv,e.cursors),L(this.cm.display.selectionDiv,e.selection)},jo.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},jo.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},jo.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},jo.prototype.blur=function(){this.div.blur()},jo.prototype.getField=function(){return this.div},jo.prototype.supportsTouch=function(){return!0},jo.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():$r(this.cm,(function(){return e.cm.curOp.selectionChanged=!0})),this.polling.set(this.cm.options.pollInterval,(function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}))},jo.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},jo.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e=this.getSelection(),t=this.cm;if(v&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(e.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();if(!this.composing){this.rememberSelection();var i=Xo(t,e.anchorNode,e.anchorOffset),r=Xo(t,e.focusNode,e.focusOffset);i&&r&&$r(t,(function(){Jn(t.doc,xn(i,r),K),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}}},jo.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,i,r=this.cm,n=r.display,s=r.doc.sel.primary(),o=s.from(),a=s.to();if(0==o.ch&&o.line>r.firstLine()&&(o=et(o.line-1,Ge(r.doc,o.line-1).length)),a.ch==Ge(r.doc,a.line).text.length&&a.line<r.lastLine()&&(a=et(a.line+1,0)),o.line<n.viewFrom||a.line>n.viewTo-1)return!1;o.line==n.viewFrom||0==(e=cr(r,o.line))?(t=Ye(n.view[0].line),i=n.view[0].node):(t=Ye(n.view[e].line),i=n.view[e-1].node.nextSibling);var l,c,u=cr(r,a.line);if(u==n.view.length-1?(l=n.viewTo-1,c=n.lineDiv.lastChild):(l=Ye(n.view[u+1].line)-1,c=n.view[u+1].node.previousSibling),!i)return!1;for(var h=r.doc.splitLines(function(e,t,i,r,n){var s="",o=!1,a=e.doc.lineSeparator(),l=!1;function c(){o&&(s+=a,l&&(s+=a),o=l=!1)}function u(e){e&&(c(),s+=e)}function h(t){if(1==t.nodeType){var i=t.getAttribute("cm-text");if(i)return void u(i);var s,d=t.getAttribute("cm-marker");if(d){var f=e.findMarks(et(r,0),et(n+1,0),(v=+d,function(e){return e.id==v}));return void(f.length&&(s=f[0].find(0))&&u(Ve(e.doc,s.from,s.to).join(a)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var g=0;g<t.childNodes.length;g++)h(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),p&&(o=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var v}for(;h(t),t!=i;)t=t.nextSibling,l=!1;return s}(r,i,c,t,l)),d=Ve(r.doc,et(t,0),et(l,Ge(r.doc,l).text.length));h.length>1&&d.length>1;)if(q(h)==q(d))h.pop(),d.pop(),l--;else{if(h[0]!=d[0])break;h.shift(),d.shift(),t++}for(var f=0,p=0,g=h[0],v=d[0],m=Math.min(g.length,v.length);f<m&&g.charCodeAt(f)==v.charCodeAt(f);)++f;for(var y=q(h),_=q(d),b=Math.min(y.length-(1==h.length?f:0),_.length-(1==d.length?f:0));p<b&&y.charCodeAt(y.length-p-1)==_.charCodeAt(_.length-p-1);)++p;if(1==h.length&&1==d.length&&t==o.line)for(;f&&f>o.ch&&y.charCodeAt(y.length-p-1)==_.charCodeAt(_.length-p-1);)f--,p++;h[h.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),h[0]=h[0].slice(f).replace(/\u200b+$/,"");var S=et(t,f),C=et(l,d.length?q(d).length-p:0);return h.length>1||h[0]||tt(S,C)?(ps(r.doc,h,S,C,"+input"),!0):void 0},jo.prototype.ensurePolled=function(){this.forceCompositionEnd()},jo.prototype.reset=function(){this.forceCompositionEnd()},jo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},jo.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},jo.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||$r(this.cm,(function(){return ur(e.cm)}))},jo.prototype.setUneditable=function(e){e.contentEditable="false"},jo.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Jr(this.cm,Oo)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},jo.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},jo.prototype.onContextMenu=function(){},jo.prototype.resetPosition=function(){},jo.prototype.needsContentAttribute=!0;var zo=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null};zo.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;function s(e){if(!ge(r,e)){if(r.somethingSelected())Do({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Po(r);Do({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,K):(i.prevInput="",n.value=t.text.join("\n"),P(n))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),he(n,"input",(function(){o&&a>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()})),he(n,"paste",(function(e){ge(r,e)||Mo(e,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())})),he(n,"cut",s),he(n,"copy",s),he(e.scroller,"paste",(function(t){if(!Si(e,t)&&!ge(r,t)){if(!n.dispatchEvent)return r.state.pasteIncoming=+new Date,void i.focus();var s=new Event("paste");s.clipboardData=t.clipboardData,n.dispatchEvent(s)}})),he(e.lineSpace,"selectstart",(function(t){Si(e,t)||_e(t)})),he(n,"compositionstart",(function(){var e=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),he(n,"compositionend",(function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)}))},zo.prototype.createField=function(e){this.wrapper=Bo(),this.textarea=this.wrapper.firstChild},zo.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},zo.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=vr(e);if(e.options.moveInputWithCursor){var n=Gi(e,i.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+o.top-s.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+o.left-s.left))}return r},zo.prototype.showSelection=function(e){var t=this.cm.display;L(t.cursorDiv,e.cursors),L(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},zo.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&P(this.textarea),o&&a>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",o&&a>=9&&(this.hasSelection=null))}},zo.prototype.getField=function(){return this.textarea},zo.prototype.supportsTouch=function(){return!1},zo.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!m||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},zo.prototype.blur=function(){this.textarea.blur()},zo.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},zo.prototype.receivedFocus=function(){this.slowPoll()},zo.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},zo.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function i(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,i))}))},zo.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Oe(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(o&&a>=9&&this.hasSelection===n||y&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var s=n.charCodeAt(0);if(8203!=s||r||(r=""),8666==s)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,n.length);l<c&&r.charCodeAt(l)==n.charCodeAt(l);)++l;return $r(t,(function(){Oo(t,n.slice(l),r.length-l,null,e.composing?"*compose":null),n.length>1e3||n.indexOf("\n")>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},zo.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},zo.prototype.onKeyPress=function(){o&&a>=9&&(this.hasSelection=null),this.fastPoll()},zo.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var s=lr(i,e),c=r.scroller.scrollTop;if(s&&!h){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(s)&&Jr(i,Jn)(i.doc,xn(s),K);var u,d=n.style.cssText,f=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(o?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=m,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll),o&&a>=9&&v(),w){Ce(e);var g=function(){fe(window,"mouseup",g),setTimeout(m,20)};he(window,"mouseup",g)}else setTimeout(m,50)}function v(){if(null!=n.selectionStart){var e=i.somethingSelected(),s=""+(e?n.value:"");n.value="⇚",n.value=s,t.prevInput=e?"":"",n.selectionStart=1,n.selectionEnd=s.length,r.selForContextMenu=i.doc.sel}}function m(){if(t.contextMenuPending==m&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,n.style.cssText=d,o&&a<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=n.selectionStart)){(!o||o&&a<9)&&v();var e=0,s=function(){r.selForContextMenu==i.doc.sel&&0==n.selectionStart&&n.selectionEnd>0&&""==t.prevInput?Jr(i,as)(i):e++<10?r.detectingSelectAll=setTimeout(s,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(s,200)}}},zo.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},zo.prototype.setUneditable=function(){},zo.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function i(i,r,n,s){e.defaults[i]=r,n&&(t[i]=s?function(e,t,i){i!=Co&&n(e,t,i)}:n)}e.defineOption=i,e.Init=Co,i("value","",(function(e,t){return e.setValue(t)}),!0),i("mode",null,(function(e,t){e.doc.modeOption=t,Rn(e)}),!0),i("indentUnit",2,Rn,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,(function(e){Dn(e),Hi(e),ur(e)}),!0),i("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var i=[],r=e.doc.first;e.doc.iter((function(e){for(var n=0;;){var s=e.text.indexOf(t,n);if(-1==s)break;n=s+t.length,i.push(et(r,s))}r++}));for(var n=i.length-1;n>=0;n--)ps(e.doc,t,i[n],et(i[n].line,i[n].ch+t.length))}})),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,i){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),i!=Co&&e.refresh()})),i("specialCharPlaceholder",$t,(function(e){return e.refresh()}),!0),i("electricChars",!0),i("inputStyle",m?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),i("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),i("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),i("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),i("rtlMoveVisually",!b),i("wholeLineUpdateBefore",!0),i("theme","default",(function(e){So(e),gn(e)}),!0),i("keyMap","default",(function(e,t,i){var r=Qs(t),n=i!=Co&&Qs(i);n&&n.detach&&n.detach(e,r),r.attach&&r.attach(e,n||null)})),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Eo,!0),i("gutters",[],(function(e,t){e.display.gutterSpecs=fn(t,e.options.lineNumbers),gn(e)}),!0),i("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?sr(e.display)+"px":"0",e.refresh()}),!0),i("coverGutterNextToScrollbar",!1,(function(e){return jr(e)}),!0),i("scrollbarStyle","native",(function(e){Xr(e),jr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),i("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=fn(e.options.gutters,t),gn(e)}),!0),i("firstLineNumber",1,gn,!0),i("lineNumberFormatter",(function(e){return e}),gn,!0),i("showCursorWhenSelecting",!1,gr,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,(function(e,t){"nocursor"==t&&(kr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),i("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),i("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),i("dragDrop",!0,xo),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,gr,!0),i("singleCursorHeightPerLine",!0,gr,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Dn,!0),i("addModeClass",!1,Dn,!0),i("pollInterval",100),i("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),i("historyEventDelay",1250),i("viewportMargin",10,(function(e){return e.refresh()}),!0),i("maxHighlightLength",1e4,Dn,!0),i("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),i("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),i("autofocus",null),i("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),i("phrases",null)}(To),function(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,i){var r=this.options,n=r[e];r[e]==i&&"mode"!=e||(r[e]=i,t.hasOwnProperty(e)&&Jr(this,t[e])(this,i,n),pe(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Qs(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,i=0;i<t.length;++i)if(t[i]==e||t[i].name==e)return t.splice(i,1),!0},addOverlay:en((function(t,i){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:t,opaque:i&&i.opaque,priority:i&&i.priority||0},(function(e){return e.priority})),this.state.modeGen++,ur(this)})),removeOverlay:en((function(e){for(var t=this.state.overlays,i=0;i<t.length;++i){var r=t[i].modeSpec;if(r==e||"string"==typeof e&&r.name==e)return t.splice(i,1),this.state.modeGen++,void ur(this)}})),indentLine:en((function(e,t,i){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),$e(this.doc,e)&&Ao(this,e,t,i)})),indentSelection:en((function(e){for(var t=this.doc.sel.ranges,i=-1,r=0;r<t.length;r++){var n=t[r];if(n.empty())n.head.line>i&&(Ao(this,n.head.line,e,!0),i=n.head.line,r==this.doc.sel.primIndex&&Rr(this));else{var s=n.from(),o=n.to(),a=Math.max(i,s.line);i=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=a;l<i;++l)Ao(this,l,e);var c=this.doc.sel.ranges;0==s.ch&&t.length==c.length&&c[r].from().ch>0&&Yn(this.doc,r,new wn(s,c[r].to()),K)}}})),getTokenAt:function(e,t){return yt(this,e,t)},getLineTokens:function(e,t){return yt(this,et(e),t,!0)},getTokenTypeAt:function(e){e=at(this.doc,e);var t,i=dt(this,Ge(this.doc,e.line)),r=0,n=(i.length-1)/2,s=e.ch;if(0==s)t=i[2];else for(;;){var o=r+n>>1;if((o?i[2*o-1]:0)>=s)n=o;else{if(!(i[2*o+1]<s)){t=i[2*o+2];break}r=o+1}}var a=t?t.indexOf("overlay "):-1;return a<0?t:0==a?null:t.slice(0,a-1)},getModeAt:function(t){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(t).state).mode:i},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!i.hasOwnProperty(t))return r;var n=i[t],s=this.getModeAt(e);if("string"==typeof s[t])n[s[t]]&&r.push(n[s[t]]);else if(s[t])for(var o=0;o<s[t].length;o++){var a=n[s[t][o]];a&&r.push(a)}else s.helperType&&n[s.helperType]?r.push(n[s.helperType]):n[s.name]&&r.push(n[s.name]);for(var l=0;l<n._global.length;l++){var c=n._global[l];c.pred(s,this)&&-1==j(r,c.val)&&r.push(c.val)}return r},getStateAfter:function(e,t){var i=this.doc;return ft(this,(e=ot(i,null==e?i.first+i.size-1:e))+1,t).state},cursorCoords:function(e,t){var i=this.doc.sel.primary();return Gi(this,null==e?i.head:"object"==typeof e?at(this.doc,e):e?i.from():i.to(),t||"page")},charCoords:function(e,t){return zi(this,at(this.doc,e),t||"page")},coordsChar:function(e,t){return Qi(this,(e=Wi(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Wi(this,{top:e,left:0},t||"page").top,Ze(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,i){var r,n=!1;if("number"==typeof e){var s=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>s&&(e=s,n=!0),r=Ge(this.doc,e)}else r=e;return Xi(this,r,{top:0,left:0},t||"page",i||n).top+(n?this.doc.height-Xt(r):0)},defaultTextHeight:function(){return ir(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,r,n){var s,o,a,l=this.display,c=(e=Gi(this,at(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var h=Math.max(l.wrapper.clientHeight,this.doc.height),d=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>h)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=h&&(c=e.bottom),u+t.offsetWidth>d&&(u=d-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==n?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?u=0:"middle"==n&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),i&&(s=this,o={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(a=Lr(s,o)).scrollTop&&Ir(s,a.scrollTop),null!=a.scrollLeft&&Fr(s,a.scrollLeft))},triggerOnKeyDown:en(co),triggerOnKeyPress:en(ho),triggerOnKeyUp:uo,triggerOnMouseDown:en(vo),execCommand:function(e){if(eo.hasOwnProperty(e))return eo[e].call(null,this)},triggerElectric:en((function(e){Io(this,e)})),findPosH:function(e,t,i,r){var n=1;t<0&&(n=-1,t=-t);for(var s=at(this.doc,e),o=0;o<t&&!(s=No(this.doc,s,n,i,r)).hitSide;++o);return s},moveH:en((function(e,t){var i=this;this.extendSelectionsBy((function(r){return i.display.shift||i.doc.extend||r.empty()?No(i.doc,r.head,e,t,i.options.rtlMoveVisually):e<0?r.from():r.to()}),W)})),deleteH:en((function(e,t){var i=this.doc.sel,r=this.doc;i.somethingSelected()?r.replaceSelection("",null,"+delete"):Ys(this,(function(i){var n=No(r,i.head,e,t,!1);return e<0?{from:n,to:i.head}:{from:i.head,to:n}}))})),findPosV:function(e,t,i,r){var n=1,s=r;t<0&&(n=-1,t=-t);for(var o=at(this.doc,e),a=0;a<t;++a){var l=Gi(this,o,"div");if(null==s?s=l.left:l.left=s,(o=Ho(this,l,n,i)).hitSide)break}return o},moveV:en((function(e,t){var i=this,r=this.doc,n=[],s=!this.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy((function(o){if(s)return e<0?o.from():o.to();var a=Gi(i,o.head,"div");null!=o.goalColumn&&(a.left=o.goalColumn),n.push(a.left);var l=Ho(i,a,e,t);return"page"==t&&o==r.sel.primary()&&Ar(i,zi(i,l,"div").top-a.top),l}),W),n.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=n[o]})),findWordAt:function(e){var t=Ge(this.doc,e.line).text,i=e.ch,r=e.ch;if(t){var n=this.getHelper(e,"wordChars");"before"!=e.sticky&&r!=t.length||!i?++r:--i;for(var s=t.charAt(i),o=ee(s,n)?function(e){return ee(e,n)}:/\s/.test(s)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!ee(e)};i>0&&o(t.charAt(i-1));)--i;for(;r<t.length&&o(t.charAt(r));)++r}return new wn(et(e.line,i),et(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?M(this.display.cursorDiv,"CodeMirror-overwrite"):E(this.display.cursorDiv,"CodeMirror-overwrite"),pe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:en((function(e,t){Dr(this,e,t)})),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-xi(this)-this.display.barHeight,width:e.scrollWidth-xi(this)-this.display.barWidth,clientHeight:Ti(this),clientWidth:Ei(this)}},scrollIntoView:en((function(e,t){null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:et(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?function(e,t){Or(e),e.curOp.scrollToPos=t}(this,e):Mr(this,e.from,e.to,e.margin)})),setSize:en((function(e,t){var i=this,r=function(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e};null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Ni(this);var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){hr(i,n,"widget");break}++n})),this.curOp.forceUpdate=!0,pe(this,"refresh",this)})),operation:function(e){return $r(this,e)},startOperation:function(){return zr(this)},endOperation:function(){return Gr(this)},refresh:en((function(){var e=this.display.cachedTextHeight;ur(this),this.curOp.forceUpdate=!0,Hi(this),Dr(this,this.doc.scrollLeft,this.doc.scrollTop),cn(this.display),(null==e||Math.abs(e-ir(this.display))>.5||this.options.lineWrapping)&&ar(this),pe(this,"refresh",this)})),swapDoc:en((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Pn(this,e),Hi(this),this.display.input.reset(),Dr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ai(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},ye(e),e.registerHelper=function(t,r,n){i.hasOwnProperty(t)||(i[t]=e[t]={_global:[]}),i[t][r]=n},e.registerGlobalHelper=function(t,r,n,s){e.registerHelper(t,r,s),i[t]._global.push({pred:n,val:s})}}(To);var Go="iter insert remove copy getEditor constructor".split(" ");for(var Vo in Rs.prototype)Rs.prototype.hasOwnProperty(Vo)&&j(Go,Vo)<0&&(To.prototype[Vo]=function(e){return function(){return e.apply(this.doc,arguments)}}(Rs.prototype[Vo]));return ye(Rs),To.inputStyles={textarea:zo,contenteditable:jo},To.defineMode=function(e){To.defaults.mode||"null"==e||(To.defaults.mode=e),Be.apply(this,arguments)},To.defineMIME=function(e,t){Fe[e]=t},To.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),To.defineMIME("text/plain","null"),To.defineExtension=function(e,t){To.prototype[e]=t},To.defineDocExtension=function(e,t){Rs.prototype[e]=t},To.fromTextArea=function(e,t){if((t=t?B(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var i=O();t.autofocus=i==e||null!=e.getAttribute("autofocus")&&i==document.body}function r(){e.value=a.getValue()}var n;if(e.form&&(he(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var s=e.form;n=s.submit;try{var o=s.submit=function(){r(),s.submit=n,s.submit(),s.submit=o}}catch(e){}}t.finishInit=function(i){i.save=r,i.getTextArea=function(){return e},i.toTextArea=function(){i.toTextArea=isNaN,r(),e.parentNode.removeChild(i.getWrapperElement()),e.style.display="",e.form&&(fe(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=n))}},e.style.display="none";var a=To((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return a},function(e){e.off=fe,e.on=he,e.wheelEventPixels=bn,e.Doc=Rs,e.splitLines=De,e.countColumn=N,e.findColumn=z,e.isWordChar=J,e.Pass=U,e.signal=pe,e.Line=Gt,e.changeEnd=En,e.scrollbarModel=Kr,e.Pos=et,e.cmpPos=tt,e.modes=Pe,e.mimeModes=Fe,e.resolveMode=Ne,e.getMode=He,e.modeExtensions=je,e.extendMode=Ue,e.copyState=Ke,e.startState=We,e.innerMode=Xe,e.commands=eo,e.keyMap=Ks,e.keyName=qs,e.isModifierKey=Gs,e.lookupKey=zs,e.normalizeKeyMap=Ws,e.StringStream=ze,e.SharedTextMarker=Es,e.TextMarker=ks,e.LineWidget=Ss,e.e_preventDefault=_e,e.e_stopPropagation=be,e.e_stop=Ce,e.addClass=M,e.contains=D,e.rmClass=E,e.keyNames=Ns}(To),To.version="5.58.2",To}()},Y1PL:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-textarea/es/index.js + 7 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: ResizableTextArea, default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createSuper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/extends.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Children/toArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/Dom/findDOMNode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/omit.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/ref.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/warning.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/shallowequal/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";i.r(t),i.d(t,"ResizableTextArea",(function(){return M}));var r=i("wx14"),n=i("1OyB"),s=i("vuIU"),o=i("Ji7U"),a=i("LK+K"),l=i("q1tI"),c=i("VTBJ"),u=i("rePB"),h=i("Zm9Q"),d=(i("Kwbf"),i("c+Xe")),f=i("m+aA"),p=i("bdgK"),g=new Map;var v=new p.default((function(e){e.forEach((function(e){var t,i=e.target;null===(t=g.get(i))||void 0===t||t.forEach((function(e){return e(i)}))}))}));var m=function(e){Object(o.a)(i,e);var t=Object(a.a)(i);function i(){return Object(n.a)(this,i),t.apply(this,arguments)}return Object(s.a)(i,[{key:"render",value:function(){return this.props.children}}]),i}(l.Component),y=l.createContext(null);function _(e){var t=e.children,i=e.disabled,r=l.useRef(null),n=l.useRef(null),s=l.useContext(y),o=l.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),a=l.isValidElement(t)&&Object(d.c)(t),u=a?t.ref:null,h=l.useMemo((function(){return Object(d.a)(u,r)}),[u,r]),p=l.useRef(e);p.current=e;var _=l.useCallback((function(e){var t=p.current,i=t.onResize,r=t.data,n=e.getBoundingClientRect(),a=n.width,l=n.height,u=e.offsetWidth,h=e.offsetHeight,d=Math.floor(a),f=Math.floor(l);if(o.current.width!==d||o.current.height!==f||o.current.offsetWidth!==u||o.current.offsetHeight!==h){var g={width:d,height:f,offsetWidth:u,offsetHeight:h};o.current=g;var v=u===Math.round(a)?a:u,m=h===Math.round(l)?l:h,y=Object(c.a)(Object(c.a)({},g),{},{offsetWidth:v,offsetHeight:m});null==s||s(y,e,r),i&&Promise.resolve().then((function(){i(y,e)}))}}),[]);return l.useEffect((function(){var e,t,s=Object(f.a)(r.current)||Object(f.a)(n.current);return s&&!i&&(e=s,t=_,g.has(e)||(g.set(e,new Set),v.observe(e)),g.get(e).add(t)),function(){return function(e,t){g.has(e)&&(g.get(e).delete(t),g.get(e).size||(v.unobserve(e),g.delete(e)))}(s,_)}}),[r.current,i]),l.createElement(m,{ref:n},a?l.cloneElement(t,{ref:h}):t)}function b(e){var t=e.children;return Object(h.a)(t).map((function(t,i){var n=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(i);return l.createElement(_,Object(r.a)({},e,{key:n}),t)}))}b.Collection=function(e){var t=e.children,i=e.onBatchResize,r=l.useRef(0),n=l.useRef([]),s=l.useContext(y),o=l.useCallback((function(e,t,o){r.current+=1;var a=r.current;n.current.push({size:e,element:t,data:o}),Promise.resolve().then((function(){a===r.current&&(null==i||i(n.current),n.current=[])})),null==s||s(e,t,o)}),[i,s]);return l.createElement(y.Provider,{value:o},t)};var S,C=b,w=i("bT9E"),k=i("TSYQ"),x=i.n(k),E="\n min-height:0 !important;\n max-height:none !important;\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",T=["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"],L={};function A(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&L[i])return L[i];var r=window.getComputedStyle(e),n=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),s=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),o=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=T.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),l={sizingStyle:a,paddingSize:s,borderSize:o,boxSizing:n};return t&&i&&(L[i]=l),l}var R,D=i("Gytx"),O=i.n(D);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}(R||(R={}));var M=function(e){Object(o.a)(i,e);var t=Object(a.a)(i);function i(e){var s;return Object(n.a)(this,i),(s=t.call(this,e)).nextFrameActionId=void 0,s.resizeFrameId=void 0,s.textArea=void 0,s.saveTextArea=function(e){s.textArea=e},s.handleResize=function(e){var t=s.state.resizeStatus,i=s.props,r=i.autoSize,n=i.onResize;t===R.NONE&&("function"==typeof n&&n(e),r&&s.resizeOnNextFrame())},s.resizeOnNextFrame=function(){cancelAnimationFrame(s.nextFrameActionId),s.nextFrameActionId=requestAnimationFrame(s.resizeTextarea)},s.resizeTextarea=function(){var e=s.props.autoSize;if(e&&s.textArea){var t=e.minRows,i=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;S||((S=document.createElement("textarea")).setAttribute("tab-index","-1"),S.setAttribute("aria-hidden","true"),document.body.appendChild(S)),e.getAttribute("wrap")?S.setAttribute("wrap",e.getAttribute("wrap")):S.removeAttribute("wrap");var n=A(e,t),s=n.paddingSize,o=n.borderSize,a=n.boxSizing,l=n.sizingStyle;S.setAttribute("style","".concat(l,";").concat(E)),S.value=e.value||e.placeholder||"";var c,u=Number.MIN_SAFE_INTEGER,h=Number.MAX_SAFE_INTEGER,d=S.scrollHeight;if("border-box"===a?d+=o:"content-box"===a&&(d-=s),null!==i||null!==r){S.value=" ";var f=S.scrollHeight-s;null!==i&&(u=f*i,"border-box"===a&&(u=u+s+o),d=Math.max(u,d)),null!==r&&(h=f*r,"border-box"===a&&(h=h+s+o),c=d>h?"":"hidden",d=Math.min(h,d))}return{height:d,minHeight:u,maxHeight:h,overflowY:c,resize:"none"}}(s.textArea,!1,t,i);s.setState({textareaStyles:r,resizeStatus:R.RESIZING},(function(){cancelAnimationFrame(s.resizeFrameId),s.resizeFrameId=requestAnimationFrame((function(){s.setState({resizeStatus:R.RESIZED},(function(){s.resizeFrameId=requestAnimationFrame((function(){s.setState({resizeStatus:R.NONE}),s.fixFirefoxAutoScroll()}))}))}))}))}},s.renderTextArea=function(){var e=s.props,t=e.prefixCls,i=void 0===t?"rc-textarea":t,n=e.autoSize,o=e.onResize,a=e.className,h=e.disabled,d=s.state,f=d.textareaStyles,p=d.resizeStatus,g=Object(w.a)(s.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),v=x()(i,a,Object(u.a)({},"".concat(i,"-disabled"),h));"value"in g&&(g.value=g.value||"");var m=Object(c.a)(Object(c.a)(Object(c.a)({},s.props.style),f),p===R.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return l.createElement(C,{onResize:s.handleResize,disabled:!(n||o)},l.createElement("textarea",Object(r.a)({},g,{className:v,style:m,ref:s.saveTextArea})))},s.state={textareaStyles:{},resizeStatus:R.NONE},s}return Object(s.a)(i,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&O()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),i}(l.Component),I=function(e){Object(o.a)(i,e);var t=Object(a.a)(i);function i(e){var r;Object(n.a)(this,i),(r=t.call(this,e)).resizableTextArea=void 0,r.focus=function(){r.resizableTextArea.textArea.focus()},r.saveTextArea=function(e){r.resizableTextArea=e},r.handleChange=function(e){var t=r.props.onChange;r.setValue(e.target.value,(function(){r.resizableTextArea.resizeTextarea()})),t&&t(e)},r.handleKeyDown=function(e){var t=r.props,i=t.onPressEnter,n=t.onKeyDown;13===e.keyCode&&i&&i(e),n&&n(e)};var s=void 0===e.value||null===e.value?e.defaultValue:e.value;return r.state={value:s},r}return Object(s.a)(i,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return l.createElement(M,Object(r.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),i}(l.Component);t.default=I},YJ9k:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/eventtarget.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._listeners=new Map}var t,i,n;return t=e,(i=[{key:"addEventListener",value:function(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}},{key:"removeEventListener",value:function(e,t){this._listeners.has(e)&&this._listeners.get(e).delete(t)}},{key:"dispatchEvent",value:function(e){var t=this;return!this._listeners.has(e.type)||(this._listeners.get(e.type).forEach((function(i){return i.call(t,e)})),!e.defaultPrevented)}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=n},ZW9T:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./src/components/monaco-editor/index.jsx + 1 modules ***!
|
|
|
\************************************************************/
|
|
|
/*! exports provided: getLanguageByMirrorName, default, DiffEditor */
|
|
|
/*! exports used: DiffEditor, default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,i){"use strict";i.d(t,"a",(function(){return m}));var r=i("k1fw"),n=(i("miYZ"),i("tsqr")),s=i("rAM+"),o=i("tJVT"),a=i("PpiC"),l=i("q1tI"),c=i.n(l),u=i("bdgK");function h(e,t,i,n,s){var o=t.getWordUntilPosition(i),a={startLineNumber:i.lineNumber,endLineNumber:i.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn},l=n.map((function(t){return{label:t,kind:e.languages.CompletionItemKind.Keyword,insertText:t,insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:a}}));return s.map((function(e){l.push(Object(r.a)(Object(r.a)({},e),{},{range:a}))})),l}i("LvDl");function d(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function f(){}var p={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function g(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e;if(Array.isArray(e)){for(var i=0;i<e.length;i++){var r=p[e[i]];if(r)return r}return t[0]}return p[t]||t}var v=null;t.b=function(e){var t=e.width,p=void 0===t?"100%":t,m=e.height,y=void 0===m?"100%":m,_=e.value,b=e.language,S=void 0===b?"javascript":b,C=e.style,w=void 0===C?{}:C,k=e.options,x=void 0===k?{}:k,E=e.overrideServices,T=void 0===E?{}:E,L=e.theme,A=void 0===L?"vs-dark":L,R=e.onEditBlur,D=e.onSave,O=e.autoHeight,M=void 0!==O&&O,I=e.forbidCopy,P=void 0!==I&&I,F=e.onChange,B=void 0===F?f:F,N=e.editorDidMount,H=void 0===N?f:N,j=e.onFocus,U=void 0===j?f:j,K=e.filename,X=void 0===K?"educoder.txt":K,W=(Object(a.a)(e,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename"]),Object(l.useRef)()),z=Object(l.useRef)({}),G=Object(l.useRef)(),V=Object(l.useRef)(!1),q=Object(l.useRef)(),Q=Object(l.useState)(!1),Y=Object(o.a)(Q,2),Z=Y[0],$=Y[1];function J(){n.b.warn(decodeURIComponent("该任务关卡设置了禁止复制粘贴,请手动输入代码。"))}function ee(){var e=z.current.instance;if(e){var t=e.getSelection(),i=z.current.pastePos||{},r=new v.Range(i.startLineNumber||t.endLineNumber,i.startColumn||t.endColumn,i.endLineNumber||t.endLineNumber,i.endColumn||t.endColumn);setTimeout((function(){e.executeEdits("",[{range:r,text:""}])}),300)}}function te(e){(window.navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)&&83==e.keyCode&&(e.preventDefault(),D())}Object(l.useEffect)((function(){G.current&&clearTimeout(G.current),G.current=setTimeout((function(){!function(){var e=z.current.instance;if(null!=_&&e&&Z){var t=e.getModel();t&&_!==t.getValue()&&(!0,t.setValue(_),e.layout(),!1)}}()}),500)}),[_,Z,z.current]);var ie=function(){if(M&&z.current.instance){var e=z.current.instance.getContentHeight();ue(e<y?y:e)}else ue(y)};function re(e,t){var i,r,n=window.URL||window.webkitURL||window,s=new Blob([t]),o=document.createElementNS("http://www.w3.org/1999/xhtml","a");o.href=n.createObjectURL(s),o.download=e,i=o,(r=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(r)}Object(l.useEffect)((function(){ie()}),[ie]),Object(l.useEffect)((function(){W.current&&!Z&&i.e(/*! import() | monaco-editor */27).then(i.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){try{v=e,z.current.instance=v.editor.create(W.current,{value:_,language:g(S),theme:A,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},T);var t=z.current.instance;if(H(t,v),setTimeout((function(){ie(),z.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){re(X||"educoder.txt",t.getValue())}})}),500),z.current.subscription=t.onDidChangeModelContent((function(e){V.current?clearTimeout(q.current):(ie(),B(t.getValue(),e)),q.current=setTimeout((function(){V.current=!1}),500)})),window.Monaco||function(e){var t={label:"ifelse",kind:e.languages.CompletionItemKind.Method,insertText:["if (${1:condition}) {","\t$0","} else {","\t","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},i=["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"];e.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(r,n){return{suggestions:h(e,r,n,i,[t])}}});var r=["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"];e.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(t,i){var n=[{label:"print",kind:e.languages.CompletionItemKind.Snippet,insertText:["print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,t,i,r,n)}}});var n=["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"];e.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(i,r){var s=[t,{label:"main",kind:e.languages.CompletionItemKind.Snippet,insertText:["public static void main(String[] args) {","\t$0","}"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet},{label:"System.out.print",kind:e.languages.CompletionItemKind.Snippet,insertText:["System.out.print($0)"].join("\n"),insertTextRules:e.languages.CompletionItemInsertTextRule.InsertAsSnippet}];return{suggestions:h(e,i,r,n,s)}}})}(v),P&&(t.addCommand(v.KeyMod.CtrlCmd|v.KeyMod.Shift|v.KeyCode.KEY_V,(function(){return J(),null})),t.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KEY_C,(function(){return J(),null}))),window.Monaco=v,R&&t.onDidBlurEditorWidget((function(){R(t.getValue())})),U&&t.onDidFocusEditorText((function(){U(t.getValue())})),P){t.addCommand(v.KeyMod.CtrlCmd|v.KeyCode.KEY_V,(function(){return J(),null})),t.onDidPaste((function(e){z.current.pastePos=e}));try{window.addEventListener("paste",ee)}catch(e){}}var i=function(){var e;return W.current&&(e=new u.default((function(e){var t,i=Object(s.a)(e);try{for(i.s();!(t=i.n()).done;){var r=t.value;(r.target.offsetHeight>0||r.target.offsetWidth>0)&&z.current.instance.layout()}}catch(e){i.e(e)}finally{i.f()}}))).observe(W.current),e}();return $(!0),function(){var e=z.current.instance;e.dispose();var t=e.getModel();t&&t.dispose(),z.current.subscription&&z.current.subscription.dispose(),P&&window.removeEventListener("paste",ee),i.unobserve(W.current)}}catch(e){}}))}),[]),Object(l.useEffect)((function(){if(z.current.instance&&Z)return document.addEventListener("keydown",te,!1),function(){document.removeEventListener("keydown",te)}}),[D,Z]),Object(l.useEffect)((function(){var e=z.current.instance;if(e&&Z){var t=g(S);v.editor.setModelLanguage(e.getModel(),t),console.log("language:",S,e.getModel(),t)}}),[S,Z]),Object(l.useEffect)((function(){z.current.instance&&Z&&v.editor.setTheme(A)}),[A,Z]),Object(l.useEffect)((function(){var e=z.current.instance;e&&Z&&(e.updateOptions(Object(r.a)({},x)),setTimeout((function(){e.getModel().updateOptions(Object(r.a)({},x))}),200))}),[JSON.stringify(x),Z]),Object(l.useEffect)((function(){var e=z.current.instance;e&&Z&&e.layout()}),[p,y,Z]);var ne=Object(l.useState)(d(p)),se=Object(o.a)(ne,2),oe=se[0],ae=(se[1],Object(l.useState)(d(y))),le=Object(o.a)(ae,2),ce=le[0],ue=le[1],he=Object(r.a)(Object(r.a)({},w),{},{width:oe,height:ce});return c.a.createElement("div",{className:"my-monaco-editor",ref:W,style:he})};function m(e){var t=e.width,n=void 0===t?"100%":t,a=e.height,h=void 0===a?"100%":a,f=e.original,p=e.modified,g=e.language,m=e.options,y=void 0===m?{}:m,_=Object(l.useRef)(),b=Object(l.useState)(null),S=Object(o.a)(b,2),C=S[0],w=S[1];Object(l.useEffect)((function(){_.current&&i.e(/*! import() | monaco-editor */27).then(i.t.bind(null,/*! monaco-editor/esm/vs/editor/editor.api.js */"M/lh",7)).then((function(e){var t=(v=e).editor.createDiffEditor(_.current,Object(r.a)(Object(r.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},y),{},{wordWrap:!0}));w(t);var i=function(e){var t;return _.current&&(t=new u.default((function(t){var i,r=Object(s.a)(t);try{for(r.s();!(i=r.n()).done;){var n=i.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&e.layout()}}catch(e){r.e(e)}finally{r.f()}}))).observe(_.current),t}(t);return function(){t.dispose();var e=t.getModel();e&&e.dispose(),i.unobserve(_.current)}}))}),[]),Object(l.useEffect)((function(){C&&C.setModel({original:v.editor.createModel(f,g),modified:v.editor.createModel(p,g)})}),[f,p,g,C]);var k={width:d(n),height:d(h)};return c.a.createElement("div",{className:"my-diff-editor",ref:_,style:k})}},ZpRC:
|
|
|
/*!*************************************************************************!*\
|
|
|
!*** ./node_modules/scroll-into-view-if-needed/es/index.js + 1 modules ***!
|
|
|
\*************************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";function r(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function n(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function s(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var i=getComputedStyle(e,null);return n(i.overflowY,t)||n(i.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function o(e,t,i,r,n,s,o,a){return s<e&&o>t||s>e&&o<t?0:s<=e&&a<=i||o>=t&&a>=i?s-e-r:o>t&&a<i||s<e&&a>i?o-t+n:0}var a=function(e,t){var i=window,n=t.scrollMode,a=t.block,l=t.inline,c=t.boundary,u=t.skipOverflowHiddenElements,h="function"==typeof c?c:function(e){return e!==c};if(!r(e))throw new TypeError("Invalid target");for(var d=document.scrollingElement||document.documentElement,f=[],p=e;r(p)&&h(p);){if((p=p.parentElement)===d){f.push(p);break}null!=p&&p===document.body&&s(p)&&!s(document.documentElement)||null!=p&&s(p,u)&&f.push(p)}for(var g=i.visualViewport?i.visualViewport.width:innerWidth,v=i.visualViewport?i.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,_=e.getBoundingClientRect(),b=_.height,S=_.width,C=_.top,w=_.right,k=_.bottom,x=_.left,E="start"===a||"nearest"===a?C:"end"===a?k:C+b/2,T="center"===l?x+S/2:"end"===l?w:x,L=[],A=0;A<f.length;A++){var R=f[A],D=R.getBoundingClientRect(),O=D.height,M=D.width,I=D.top,P=D.right,F=D.bottom,B=D.left;if("if-needed"===n&&C>=0&&x>=0&&k<=v&&w<=g&&C>=I&&k<=F&&x>=B&&w<=P)return L;var N=getComputedStyle(R),H=parseInt(N.borderLeftWidth,10),j=parseInt(N.borderTopWidth,10),U=parseInt(N.borderRightWidth,10),K=parseInt(N.borderBottomWidth,10),X=0,W=0,z="offsetWidth"in R?R.offsetWidth-R.clientWidth-H-U:0,G="offsetHeight"in R?R.offsetHeight-R.clientHeight-j-K:0;if(d===R)X="start"===a?E:"end"===a?E-v:"nearest"===a?o(y,y+v,v,j,K,y+E,y+E+b,b):E-v/2,W="start"===l?T:"center"===l?T-g/2:"end"===l?T-g:o(m,m+g,g,H,U,m+T,m+T+S,S),X=Math.max(0,X+y),W=Math.max(0,W+m);else{X="start"===a?E-I-j:"end"===a?E-F+K+G:"nearest"===a?o(I,F,O,j,K+G,E,E+b,b):E-(I+O/2)+G/2,W="start"===l?T-B-H:"center"===l?T-(B+M/2)+z/2:"end"===l?T-P+U+z:o(B,P,M,H,U+z,T,T+S,S);var V=R.scrollLeft,q=R.scrollTop;E+=q-(X=Math.max(0,Math.min(q+X,R.scrollHeight-O+G))),T+=V-(W=Math.max(0,Math.min(V+W,R.scrollWidth-M+z)))}L.push({el:R,top:X,left:W})}return L};function l(e){return e===Object(e)&&0!==Object.keys(e).length}t.a=function(e,t){var i=!e.ownerDocument.documentElement.contains(e);if(l(t)&&"function"==typeof t.behavior)return t.behavior(i?[]:a(e,t));if(!i){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:l(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var i="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,n=e.top,s=e.left;r.scroll&&i?r.scroll({top:n,left:s,behavior:t}):(r.scrollTop=n,r.scrollLeft=s)}))}(a(e,r),r.behavior)}}},Zss7:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/tinycolor2/tinycolor.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){var r;!function(n){var s=/^\s+/,o=/\s+$/,a=0,l=n.round,c=n.min,u=n.max,h=n.random;function d(e,t){if(t=t||{},(e=e||"")instanceof d)return e;if(!(this instanceof d))return new d(e,t);var i=function(e){var t={r:0,g:0,b:0},i=1,r=null,a=null,l=null,h=!1,d=!1;"string"==typeof e&&(e=function(e){e=e.replace(s,"").replace(o,"").toLowerCase();var t,i=!1;if(R[e])e=R[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=X.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=X.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=X.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=X.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=X.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=X.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=X.hex8.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:H(t[4]),format:i?"name":"hex8"};if(t=X.hex6.exec(e))return{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:i?"name":"hex"};if(t=X.hex4.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:H(t[4]+""+t[4]),format:i?"name":"hex8"};if(t=X.hex3.exec(e))return{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:i?"name":"hex"};return!1}(e));"object"==typeof e&&(W(e.r)&&W(e.g)&&W(e.b)?(f=e.r,p=e.g,g=e.b,t={r:255*M(f,255),g:255*M(p,255),b:255*M(g,255)},h=!0,d="%"===String(e.r).substr(-1)?"prgb":"rgb"):W(e.h)&&W(e.s)&&W(e.v)?(r=B(e.s),a=B(e.v),t=function(e,t,i){e=6*M(e,360),t=M(t,100),i=M(i,100);var r=n.floor(e),s=e-r,o=i*(1-t),a=i*(1-s*t),l=i*(1-(1-s)*t),c=r%6;return{r:255*[i,a,o,o,l,i][c],g:255*[l,i,i,a,o,o][c],b:255*[o,o,l,i,i,a][c]}}(e.h,r,a),h=!0,d="hsv"):W(e.h)&&W(e.s)&&W(e.l)&&(r=B(e.s),l=B(e.l),t=function(e,t,i){var r,n,s;function o(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}if(e=M(e,360),t=M(t,100),i=M(i,100),0===t)r=n=s=i;else{var a=i<.5?i*(1+t):i+t-i*t,l=2*i-a;r=o(l,a,e+1/3),n=o(l,a,e),s=o(l,a,e-1/3)}return{r:255*r,g:255*n,b:255*s}}(e.h,r,l),h=!0,d="hsl"),e.hasOwnProperty("a")&&(i=e.a));var f,p,g;return i=O(i),{ok:h,format:e.format||d,r:c(255,u(t.r,0)),g:c(255,u(t.g,0)),b:c(255,u(t.b,0)),a:i}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=l(100*this._a)/100,this._format=t.format||i.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=i.ok,this._tc_id=a++}function f(e,t,i){e=M(e,255),t=M(t,255),i=M(i,255);var r,n,s=u(e,t,i),o=c(e,t,i),a=(s+o)/2;if(s==o)r=n=0;else{var l=s-o;switch(n=a>.5?l/(2-s-o):l/(s+o),s){case e:r=(t-i)/l+(t<i?6:0);break;case t:r=(i-e)/l+2;break;case i:r=(e-t)/l+4}r/=6}return{h:r,s:n,l:a}}function p(e,t,i){e=M(e,255),t=M(t,255),i=M(i,255);var r,n,s=u(e,t,i),o=c(e,t,i),a=s,l=s-o;if(n=0===s?0:l/s,s==o)r=0;else{switch(s){case e:r=(t-i)/l+(t<i?6:0);break;case t:r=(i-e)/l+2;break;case i:r=(e-t)/l+4}r/=6}return{h:r,s:n,v:a}}function g(e,t,i,r){var n=[F(l(e).toString(16)),F(l(t).toString(16)),F(l(i).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function v(e,t,i,r){return[F(N(r)),F(l(e).toString(16)),F(l(t).toString(16)),F(l(i).toString(16))].join("")}function m(e,t){t=0===t?0:t||10;var i=d(e).toHsl();return i.s-=t/100,i.s=I(i.s),d(i)}function y(e,t){t=0===t?0:t||10;var i=d(e).toHsl();return i.s+=t/100,i.s=I(i.s),d(i)}function _(e){return d(e).desaturate(100)}function b(e,t){t=0===t?0:t||10;var i=d(e).toHsl();return i.l+=t/100,i.l=I(i.l),d(i)}function S(e,t){t=0===t?0:t||10;var i=d(e).toRgb();return i.r=u(0,c(255,i.r-l(-t/100*255))),i.g=u(0,c(255,i.g-l(-t/100*255))),i.b=u(0,c(255,i.b-l(-t/100*255))),d(i)}function C(e,t){t=0===t?0:t||10;var i=d(e).toHsl();return i.l-=t/100,i.l=I(i.l),d(i)}function w(e,t){var i=d(e).toHsl(),r=(i.h+t)%360;return i.h=r<0?360+r:r,d(i)}function k(e){var t=d(e).toHsl();return t.h=(t.h+180)%360,d(t)}function x(e){var t=d(e).toHsl(),i=t.h;return[d(e),d({h:(i+120)%360,s:t.s,l:t.l}),d({h:(i+240)%360,s:t.s,l:t.l})]}function E(e){var t=d(e).toHsl(),i=t.h;return[d(e),d({h:(i+90)%360,s:t.s,l:t.l}),d({h:(i+180)%360,s:t.s,l:t.l}),d({h:(i+270)%360,s:t.s,l:t.l})]}function T(e){var t=d(e).toHsl(),i=t.h;return[d(e),d({h:(i+72)%360,s:t.s,l:t.l}),d({h:(i+216)%360,s:t.s,l:t.l})]}function L(e,t,i){t=t||6,i=i||30;var r=d(e).toHsl(),n=360/i,s=[d(e)];for(r.h=(r.h-(n*t>>1)+720)%360;--t;)r.h=(r.h+n)%360,s.push(d(r));return s}function A(e,t){t=t||6;for(var i=d(e).toHsv(),r=i.h,n=i.s,s=i.v,o=[],a=1/t;t--;)o.push(d({h:r,s:n,v:s})),s=(s+a)%1;return o}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,i,r=this.toRgb();return e=r.r/255,t=r.g/255,i=r.b/255,.2126*(e<=.03928?e/12.92:n.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:n.pow((t+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:n.pow((i+.055)/1.055,2.4))},setAlpha:function(e){return this._a=O(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),i=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+i+"%, "+r+"%)":"hsva("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=f(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=f(this._r,this._g,this._b),t=l(360*e.h),i=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+i+"%, "+r+"%)":"hsla("+t+", "+i+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return g(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,i,r,n){var s=[F(l(e).toString(16)),F(l(t).toString(16)),F(l(i).toString(16)),F(N(r))];if(n&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1))return s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0);return s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*M(this._r,255))+"%",g:l(100*M(this._g,255))+"%",b:l(100*M(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%)":"rgba("+l(100*M(this._r,255))+"%, "+l(100*M(this._g,255))+"%, "+l(100*M(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(D[g(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+v(this._r,this._g,this._b,this._a),i=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var n=d(e);i="#"+v(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+i+")"},toString:function(e){var t=!!e;e=e||this._format;var i=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(i=this.toRgbString()),"prgb"===e&&(i=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(i=this.toHexString()),"hex3"===e&&(i=this.toHexString(!0)),"hex4"===e&&(i=this.toHex8String(!0)),"hex8"===e&&(i=this.toHex8String()),"name"===e&&(i=this.toName()),"hsl"===e&&(i=this.toHslString()),"hsv"===e&&(i=this.toHsvString()),i||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var i=e.apply(null,[this].concat([].slice.call(t)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(b,arguments)},brighten:function(){return this._applyModification(S,arguments)},darken:function(){return this._applyModification(C,arguments)},desaturate:function(){return this._applyModification(m,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(_,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(L,arguments)},complement:function(){return this._applyCombination(k,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(x,arguments)},tetrad:function(){return this._applyCombination(E,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var i={};for(var r in e)e.hasOwnProperty(r)&&(i[r]="a"===r?e[r]:B(e[r]));e=i}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:h(),g:h(),b:h()})},d.mix=function(e,t,i){i=0===i?0:i||50;var r=d(e).toRgb(),n=d(t).toRgb(),s=i/100;return d({r:(n.r-r.r)*s+r.r,g:(n.g-r.g)*s+r.g,b:(n.b-r.b)*s+r.b,a:(n.a-r.a)*s+r.a})},d.readability=function(e,t){var i=d(e),r=d(t);return(n.max(i.getLuminance(),r.getLuminance())+.05)/(n.min(i.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,i){var r,n,s=d.readability(e,t);switch(n=!1,(r=function(e){var t,i;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),i=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==i&&"large"!==i&&(i="small");return{level:t,size:i}}(i)).level+r.size){case"AAsmall":case"AAAlarge":n=s>=4.5;break;case"AAlarge":n=s>=3;break;case"AAAsmall":n=s>=7}return n},d.mostReadable=function(e,t,i){var r,n,s,o,a=null,l=0;n=(i=i||{}).includeFallbackColors,s=i.level,o=i.size;for(var c=0;c<t.length;c++)(r=d.readability(e,t[c]))>l&&(l=r,a=d(t[c]));return d.isReadable(e,a,{level:s,size:o})||!n?a:(i.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],i))};var R=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},D=d.hexNames=function(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[e[i]]=i);return t}(R);function O(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function M(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var i=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=c(t,u(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),n.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function I(e){return c(1,u(0,e))}function P(e){return parseInt(e,16)}function F(e){return 1==e.length?"0"+e:""+e}function B(e){return e<=1&&(e=100*e+"%"),e}function N(e){return n.round(255*parseFloat(e)).toString(16)}function H(e){return P(e)/255}var j,U,K,X=(U="[\\s|\\(]+("+(j="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",K="[\\s|\\(]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")[,|\\s]+("+j+")\\s*\\)?",{CSS_UNIT:new RegExp(j),rgb:new RegExp("rgb"+U),rgba:new RegExp("rgba"+K),hsl:new RegExp("hsl"+U),hsla:new RegExp("hsla"+K),hsv:new RegExp("hsv"+U),hsva:new RegExp("hsva"+K),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 W(e){return!!X.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,i,t,e))||(e.exports=r)}(Math)},bT9E:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/rc-util/es/omit.js ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i(/*! @babel/runtime/helpers/esm/objectSpread2 */"VTBJ");function n(e,t){var i=Object(r.a)({},e);return Array.isArray(t)&&t.forEach((function(e){delete i[e]})),i}},c5Ni:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/codemirror/theme/blackboard.css ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},c5fP:
|
|
|
/*!*********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/trees.js ***!
|
|
|
\*********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t._tr_init=function(e){F||(!function(){var e,t,i,r,n,s=new Array(16);for(i=0,r=0;r<28;r++)for(g[r]=i,e=0;e<1<<a[r];e++)p[i++]=r;for(p[i-1]=r,n=0,r=0;r<16;r++)for(_[r]=n,e=0;e<1<<l[r];e++)f[n++]=r;for(n>>=7;r<30;r++)for(_[r]=n<<7,e=0;e<1<<l[r]-7;e++)f[256+n++]=r;for(t=0;t<=15;t++)s[t]=0;e=0;for(;e<=143;)h[2*e+1]=8,e++,s[8]++;for(;e<=255;)h[2*e+1]=9,e++,s[9]++;for(;e<=279;)h[2*e+1]=7,e++,s[7]++;for(;e<=287;)h[2*e+1]=8,e++,s[8]++;for(T(h,287,s),e=0;e<30;e++)d[2*e+1]=5,d[2*e]=E(e,5);v=new b(h,a,257,286,15),m=new b(d,l,0,30,15),y=new b(new Array(0),c,0,19,7)}(),F=!0);e.l_desc=new S(e.dyn_ltree,v),e.d_desc=new S(e.dyn_dtree,m),e.bl_desc=new S(e.bl_tree,y),e.bi_buf=0,e.bi_valid=0,L(e)},t._tr_stored_block=B,t._tr_flush_block=function(e,t,i,r){var n,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),o=function(e){var t;for(I(e,e.dyn_ltree,e.l_desc.max_code),I(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*u[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=n&&(n=s)):n=s=i+5;i+4<=n&&-1!==t?B(e,t,i,r):4===e.strategy||s===n?(k(e,2+(r?1:0),3),O(e,h,d)):(k(e,4+(r?1:0),3),function(e,t,i,r){var n;for(k(e,t-257,5),k(e,i-1,5),k(e,r-4,4),n=0;n<r;n++)k(e,e.bl_tree[2*u[n]+1],3);P(e,e.dyn_ltree,t-1),P(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),O(e,e.dyn_ltree,e.dyn_dtree));L(e),r&&A(e)},t._tr_tally=function(e,t,i){e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(p[i]+256+1)]++,e.dyn_dtree[2*C(t)]++);return e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){k(e,2,3),x(e,256,h),function(e){16===e.bi_valid?(w(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=s();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=n?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(i,o,a):i[o]=e[o]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../utils/common.js */"6BzB"));function s(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function o(e){for(var t=e.length;--t>=0;)e[t]=0}var a=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);o(h);var d=new Array(60);o(d);var f=new Array(512);o(f);var p=new Array(256);o(p);var g=new Array(29);o(g);var v,m,y,_=new Array(30);function b(e,t,i,r,n){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=n,this.has_stree=e&&e.length}function S(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function C(e){return e<256?f[e]:f[256+(e>>>7)]}function w(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function k(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,w(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function x(e,t,i){k(e,i[2*t],i[2*t+1])}function E(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1}function T(e,t,i){var r,n,s=new Array(16),o=0;for(r=1;r<=15;r++)s[r]=o=o+i[r-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=E(s[a]++,a))}}function L(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){e.bi_valid>8?w(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,i,r){var n=2*t,s=2*i;return e[n]<e[s]||e[n]===e[s]&&r[t]<=r[i]}function D(e,t,i){for(var r=e.heap[i],n=i<<1;n<=e.heap_len&&(n<e.heap_len&&R(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!R(t,r,e.heap[n],e.depth));)e.heap[i]=e.heap[n],i=n,n<<=1;e.heap[i]=r}function O(e,t,i){var r,n,s,o,c=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],n=e.pending_buf[e.l_buf+c],c++,0===r?x(e,n,t):(x(e,(s=p[n])+256+1,t),0!==(o=a[s])&&k(e,n-=g[s],o),x(e,s=C(--r),i),0!==(o=l[s])&&k(e,r-=_[s],o))}while(c<e.last_lit);x(e,256,t)}function M(e,t){var i,r,n,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<l;i++)0!==s[2*i]?(e.heap[++e.heap_len]=c=i,e.depth[i]=0):s[2*i+1]=0;for(;e.heap_len<2;)s[2*(n=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=o[2*n+1]);for(t.max_code=c,i=e.heap_len>>1;i>=1;i--)D(e,s,i);n=l;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),r=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=r,s[2*n]=s[2*i]+s[2*r],e.depth[n]=(e.depth[i]>=e.depth[r]?e.depth[i]:e.depth[r])+1,s[2*i+1]=s[2*r+1]=n,e.heap[1]=n++,D(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,r,n,s,o,a,l=t.dyn_tree,c=t.max_code,u=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(s=0;s<=15;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(s=l[2*l[2*(r=e.heap[i])+1]+1]+1)>p&&(s=p,g++),l[2*r+1]=s,r>c||(e.bl_count[s]++,o=0,r>=f&&(o=d[r-f]),a=l[2*r],e.opt_len+=a*(s+o),h&&(e.static_len+=a*(u[2*r+1]+o)));if(0!==g){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(r=e.bl_count[s];0!==r;)(n=e.heap[--i])>c||(l[2*n+1]!==s&&(e.opt_len+=(s-l[2*n+1])*l[2*n],l[2*n+1]=s),r--)}}(e,t),T(s,c,e.bl_count)}function I(e,t,i){var r,n,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)n=o,o=t[2*(r+1)+1],++a<l&&n===o||(a<c?e.bl_tree[2*n]+=a:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,s=n,0===o?(l=138,c=3):n===o?(l=6,c=3):(l=7,c=4))}function P(e,t,i){var r,n,s=-1,o=t[1],a=0,l=7,c=4;for(0===o&&(l=138,c=3),r=0;r<=i;r++)if(n=o,o=t[2*(r+1)+1],!(++a<l&&n===o)){if(a<c)do{x(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==s&&(x(e,n,e.bl_tree),a--),x(e,16,e.bl_tree),k(e,a-3,2)):a<=10?(x(e,17,e.bl_tree),k(e,a-3,3)):(x(e,18,e.bl_tree),k(e,a-11,7));a=0,s=n,0===o?(l=138,c=3):n===o?(l=6,c=3):(l=7,c=4)}}o(_);var F=!1;function B(e,t,i,r){k(e,0+(r?1:0),3),function(e,t,i,r){A(e),r&&(w(e,i),w(e,~i)),n.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}(e,t,i,!0)}},dejd:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/toolbar/index.less ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},dmUQ:
|
|
|
/*!**************************************************************!*\
|
|
|
!*** ./node_modules/rc-input-number/es/index.js + 1 modules ***!
|
|
|
\**************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/createClass.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/inherits.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-util/es/KeyCode.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";var r=i("Ff2n"),n=i("rePB"),s=i("1OyB"),o=i("vuIU"),a=i("Ji7U"),l=i("md7G"),c=i("foSv"),u=i("q1tI"),h=i.n(u),d=i("TSYQ"),f=i.n(d),p=i("4IlW");function g(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function v(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?g(Object(i),!0).forEach((function(t){Object(n.a)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):g(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=Object(c.a)(e);if(t){var n=Object(c.a)(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return Object(l.a)(this,i)}}function y(){}function _(e){e.preventDefault()}var b=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(e){return null!=e},C=function(e,t){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)},w=function(e){Object(a.a)(i,e);var t=m(i);function i(e){var r;Object(s.a)(this,i),(r=t.call(this,e)).onKeyDown=function(e){var t=r.props,i=t.onKeyDown,n=t.onPressEnter;if(e.keyCode===p.a.UP){var s=r.getRatio(e);r.up(e,s,null),r.stop()}else if(e.keyCode===p.a.DOWN){var o=r.getRatio(e);r.down(e,o,null),r.stop()}else e.keyCode===p.a.ENTER&&n&&n(e);if(r.recordCursorPosition(),r.lastKeyCode=e.keyCode,i){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];i.apply(void 0,[e].concat(l))}},r.onKeyUp=function(e){var t=r.props.onKeyUp;if(r.stop(),r.recordCursorPosition(),t){for(var i=arguments.length,n=new Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];t.apply(void 0,[e].concat(n))}},r.onChange=function(e){var t=r.props.onChange;r.state.focused&&(r.inputting=!0),r.rawInput=r.props.parser(r.getValueFromEvent(e)),r.setState({inputValue:r.rawInput}),t(r.toNumber(r.rawInput))},r.onMouseUp=function(){var e=r.props.onMouseUp;r.recordCursorPosition(),e&&e.apply(void 0,arguments)},r.onFocus=function(){var e;r.setState({focused:!0}),(e=r.props).onFocus.apply(e,arguments)},r.onBlur=function(){var e=r.props.onBlur;r.inputting=!1,r.setState({focused:!1});var t=r.getCurrentValidValue(r.state.inputValue),i=r.setValue(t,y);if(e){var n=r.input.value,s=r.getInputDisplayValue({focus:!1,value:i});r.input.value=s?Number(s):s,e.apply(void 0,arguments),r.input.value=n}},r.getRatio=function(e){var t=1;return e.metaKey||e.ctrlKey?t=.1:e.shiftKey&&(t=10),t},r.getFullNum=function(e){return isNaN(e)?e:/e/i.test(String(e))?Number(e).toFixed(18).replace(/\.?0+$/,""):e},r.getPrecision=function(e){if(S(r.props.precision))return r.props.precision;var t=String(e);if(t.indexOf("e-")>=0)return parseInt(t.slice(t.indexOf("e-")+2),10);var i=0;return t.indexOf(".")>=0&&(i=t.length-t.indexOf(".")-1),i},r.getInputDisplayValue=function(e){var t,i=e||r.state,n=i.focused,s=i.inputValue,o=i.value;null==(t=n?s:r.toPrecisionAsStep(o))&&(t="");var a=r.formatWrapper(t);return S(r.props.decimalSeparator)&&(a=a.toString().replace(".",r.props.decimalSeparator)),a},r.recordCursorPosition=function(){try{r.cursorStart=r.input.selectionStart,r.cursorEnd=r.input.selectionEnd,r.currentValue=r.input.value,r.cursorBefore=r.input.value.substring(0,r.cursorStart),r.cursorAfter=r.input.value.substring(r.cursorEnd)}catch(e){}},r.restoreByAfter=function(e){if(void 0===e)return!1;var t=r.input.value,i=t.lastIndexOf(e);if(-1===i)return!1;var n=r.cursorBefore.length;return r.lastKeyCode===p.a.DELETE&&r.cursorBefore.charAt(n-1)===e[0]?(r.fixCaret(n,n),!0):i+e.length===t.length&&(r.fixCaret(i,i),!0)},r.partRestoreByAfter=function(e){return void 0!==e&&Array.prototype.some.call(e,(function(t,i){var n=e.substring(i);return r.restoreByAfter(n)}))},r.isNotCompleteNumber=function(e){return isNaN(e)||""===e||null===e||e&&e.toString().indexOf(".")===e.toString().length-1},r.stop=function(){r.autoStepTimer&&clearTimeout(r.autoStepTimer)},r.down=function(e,t,i){r.pressingUpOrDown=!0,r.step("down",e,t,i)},r.up=function(e,t,i){r.pressingUpOrDown=!0,r.step("up",e,t,i)},r.saveInput=function(e){r.input=e};var n=e.value;void 0===n&&(n=e.defaultValue),r.state={focused:e.autoFocus};var o=r.getValidValue(r.toNumber(n));return r.state=v(v({},r.state),{},{inputValue:r.toPrecisionAsStep(o),value:o}),r}return Object(o.a)(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(e){var t=this.props,i=t.value,r=t.onChange,n=t.max,s=t.min,o=this.state.focused;if(e){if(!C(e.value,i)||!C(e.max,n)||!C(e.min,s)){var a,l=o?i:this.getValidValue(i);a=this.pressingUpOrDown?l:this.inputting?this.rawInput:this.toPrecisionAsStep(l),this.setState({value:l,inputValue:a})}var c="value"in this.props?i:this.state.value;"max"in this.props&&e.max!==n&&"number"==typeof c&&c>n&&r&&r(n),"min"in this.props&&e.min!==s&&"number"==typeof c&&c<s&&r&&r(s)}try{if(void 0!==this.cursorStart&&this.state.focused)if(this.partRestoreByAfter(this.cursorAfter)||this.state.value===this.props.value){if(this.currentValue===this.input.value)switch(this.lastKeyCode){case p.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case p.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1)}}else{var u=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===p.a.BACKSPACE?u=this.cursorStart-1:this.lastKeyCode===p.a.DELETE&&(u=this.cursorStart):u=this.input.value.length,this.fixCaret(u,u)}}catch(e){}this.lastKeyCode=null,this.pressingUpOrDown&&this.props.focusOnUpDown&&this.state.focused&&document.activeElement!==this.input&&this.focus()}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(e){var t=e;return t=""===t?"":this.isNotCompleteNumber(parseFloat(t))?this.state.value:this.getValidValue(t),this.toNumber(t)}},{key:"getValueFromEvent",value:function(e){var t=e.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(t=t.replace(this.props.decimalSeparator,".")),t}},{key:"getValidValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.min,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.props.max,r=parseFloat(e);return isNaN(r)?e:(r<t&&(r=t),r>i&&(r=i),r)}},{key:"setValue",value:function(e,t){var i=this.props.precision,r=this.isNotCompleteNumber(parseFloat(e))?null:parseFloat(e),n=this.state.value,s=void 0===n?null:n,o=this.state.inputValue,a=void 0===o?null:o,l="number"==typeof r?r.toFixed(i):"".concat(r),c=r!==s||l!=="".concat(a);return"value"in this.props?(a=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:a},t)):this.setState({value:r,inputValue:this.toPrecisionAsStep(e)},t),c&&this.props.onChange(r),r}},{key:"getMaxPrecision",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.props,r=i.precision,n=i.step;if(S(r))return r;var s=this.getPrecision(t),o=this.getPrecision(n),a=this.getPrecision(e);return e?Math.max(a,s+o):s+o}},{key:"getPrecisionFactor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this.getMaxPrecision(e,t);return Math.pow(10,i)}},{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(e){return this.props.formatter?this.props.formatter(e):e}},{key:"toPrecisionAsStep",value:function(e){if(this.isNotCompleteNumber(e)||""===e)return e;var t=Math.abs(this.getMaxPrecision(e));return isNaN(t)?e.toString():Number(e).toFixed(t)}},{key:"toNumber",value:function(e){var t=this.props.precision,i=this.state.focused,r=e&&e.length>16&&i;return this.isNotCompleteNumber(e)||r?e:S(t)?Math.round(e*Math.pow(10,t))/Math.pow(10,t):Number(e)}},{key:"upStep",value:function(e,t){var i=this.props.step,r=this.getPrecisionFactor(e,t),n=Math.abs(this.getMaxPrecision(e,t)),s=((r*e+r*i*t)/r).toFixed(n);return this.toNumber(s)}},{key:"downStep",value:function(e,t){var i=this.props.step,r=this.getPrecisionFactor(e,t),n=Math.abs(this.getMaxPrecision(e,t)),s=((r*e-r*i*t)/r).toFixed(n);return this.toNumber(s)}},{key:"step",value:function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3?arguments[3]:void 0;this.stop(),t&&(t.persist(),t.preventDefault());var s=this.props;if(!s.disabled){var o=this.getCurrentValidValue(this.state.inputValue)||0;if(!this.isNotCompleteNumber(o)){var a=this["".concat(e,"Step")](o,r),l=a>s.max||a<s.min;a>s.max?a=s.max:a<s.min&&(a=s.min),this.setValue(a,null),this.setState({focused:!0},(function(){i.pressingUpOrDown=!1})),l||(this.autoStepTimer=setTimeout((function(){i[e](t,r,!0)}),n?200:600))}}}},{key:"fixCaret",value:function(e,t){if(void 0!==e&&void 0!==t&&this.input&&this.input.value)try{var i=this.input.selectionStart,r=this.input.selectionEnd;e===i&&t===r||this.input.setSelectionRange(e,t)}catch(e){}}},{key:"render",value:function(){var e,t=this.props,i=t.prefixCls,s=t.disabled,o=t.readOnly,a=t.useTouch,l=t.autoComplete,c=t.upHandler,u=t.downHandler,d=t.className,p=t.max,g=t.min,v=t.style,m=t.title,b=t.onMouseEnter,S=t.onMouseLeave,C=t.onMouseOver,w=t.onMouseOut,k=t.required,x=t.onClick,E=t.tabIndex,T=t.type,L=t.placeholder,A=t.id,R=t.inputMode,D=t.pattern,O=t.step,M=t.maxLength,I=t.autoFocus,P=t.name,F=t.onPaste,B=t.onInput,N=Object(r.a)(t,["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"]),H=this.state,j=H.value,U=H.focused,K=f()(i,(e={},Object(n.a)(e,d,!!d),Object(n.a)(e,"".concat(i,"-disabled"),s),Object(n.a)(e,"".concat(i,"-focused"),U),e)),X={};Object.keys(N).forEach((function(e){"data-"!==e.substr(0,5)&&"aria-"!==e.substr(0,5)&&"role"!==e||(X[e]=N[e])}));var W=!o&&!s,z=this.getInputDisplayValue(null),G=(j||0===j)&&(isNaN(j)||Number(j)>=p)||s||o,V=(j||0===j)&&(isNaN(j)||Number(j)<=g)||s||o,q=f()("".concat(i,"-handler"),"".concat(i,"-handler-up"),Object(n.a)({},"".concat(i,"-handler-up-disabled"),G)),Q=f()("".concat(i,"-handler"),"".concat(i,"-handler-down"),Object(n.a)({},"".concat(i,"-handler-down-disabled"),V)),Y=a?{onTouchStart:G?y:this.up,onTouchEnd:this.stop}:{onMouseDown:G?y:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Z=a?{onTouchStart:V?y:this.down,onTouchEnd:this.stop}:{onMouseDown:V?y:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return h.a.createElement("div",{className:K,style:v,title:m,onMouseEnter:b,onMouseLeave:S,onMouseOver:C,onMouseOut:w,onFocus:function(){return null},onBlur:function(){return null}},h.a.createElement("div",{className:"".concat(i,"-handler-wrap")},h.a.createElement("span",Object.assign({unselectable:"on"},Y,{role:"button","aria-label":"Increase Value","aria-disabled":G,className:q}),c||h.a.createElement("span",{unselectable:"on",className:"".concat(i,"-handler-up-inner"),onClick:_})),h.a.createElement("span",Object.assign({unselectable:"on"},Z,{role:"button","aria-label":"Decrease Value","aria-disabled":V,className:Q}),u||h.a.createElement("span",{unselectable:"on",className:"".concat(i,"-handler-down-inner"),onClick:_}))),h.a.createElement("div",{className:"".concat(i,"-input-wrap")},h.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":g,"aria-valuemax":p,"aria-valuenow":j,required:k,type:T,placeholder:L,onPaste:F,onClick:x,onMouseUp:this.onMouseUp,className:"".concat(i,"-input"),tabIndex:E,autoComplete:l,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:W?this.onKeyDown:y,onKeyUp:W?this.onKeyUp:y,autoFocus:I,maxLength:M,readOnly:o,disabled:s,max:p,min:g,step:O,name:P,title:m,id:A,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(z),pattern:D,inputMode:R,onInput:B},X))))}}]),i}(h.a.Component);w.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:b,min:-b,step:1,style:{},onChange:y,onKeyDown:y,onPressEnter:y,onFocus:y,onBlur:y,parser:function(e){return e.replace(/[^\w.-]+/g,"")},required:!1,autoComplete:"off"};var k=w;t.a=k},eP3c:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inflate.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.inflateReset=p,t.inflateReset2=g,t.inflateResetKeep=f,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var i,r,c,u,d,f,p,g,v,m,y,_,C,w,k,x,E,T,L,A,R,D,O,M,I=0,P=new n.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return-2;12===(i=e.state).mode&&(i.mode=13);d=e.next_out,c=e.output,p=e.avail_out,u=e.next_in,r=e.input,f=e.avail_in,g=i.hold,v=i.bits,m=f,y=p,D=0;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;v<16;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(2&i.wrap&&35615===g){i.check=0,P[0]=255&g,P[1]=g>>>8&255,i.check=(0,o.default)(i.check,P,2,0),g=0,v=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",i.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",i.mode=30;break}if(v-=4,R=8+(15&(g>>>=4)),0===i.wbits)i.wbits=R;else if(R>i.wbits){e.msg="invalid window size",i.mode=30;break}i.dmax=1<<R,e.adler=i.check=1,i.mode=512&g?10:12,g=0,v=0;break;case 2:for(;v<16;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(i.flags=g,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=g>>8&1),512&i.flags&&(P[0]=255&g,P[1]=g>>>8&255,i.check=(0,o.default)(i.check,P,2,0)),g=0,v=0,i.mode=3;case 3:for(;v<32;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.head&&(i.head.time=g),512&i.flags&&(P[0]=255&g,P[1]=g>>>8&255,P[2]=g>>>16&255,P[3]=g>>>24&255,i.check=(0,o.default)(i.check,P,4,0)),g=0,v=0,i.mode=4;case 4:for(;v<16;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.head&&(i.head.xflags=255&g,i.head.os=g>>8),512&i.flags&&(P[0]=255&g,P[1]=g>>>8&255,i.check=(0,o.default)(i.check,P,2,0)),g=0,v=0,i.mode=5;case 5:if(1024&i.flags){for(;v<16;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.length=g,i.head&&(i.head.extra_len=g),512&i.flags&&(P[0]=255&g,P[1]=g>>>8&255,i.check=(0,o.default)(i.check,P,2,0)),g=0,v=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((_=i.length)>f&&(_=f),_&&(i.head&&(R=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,r,u,_,R)),512&i.flags&&(i.check=(0,o.default)(i.check,r,_,u)),f-=_,u+=_,i.length-=_),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===f)break e;_=0;do{R=r[u+_++],i.head&&R&&i.length<65536&&(i.head.name+=String.fromCharCode(R))}while(R&&_<f);if(512&i.flags&&(i.check=(0,o.default)(i.check,r,_,u)),f-=_,u+=_,R)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===f)break e;_=0;do{R=r[u+_++],i.head&&R&&i.length<65536&&(i.head.comment+=String.fromCharCode(R))}while(R&&_<f);if(512&i.flags&&(i.check=(0,o.default)(i.check,r,_,u)),f-=_,u+=_,R)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;v<16;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(g!==(65535&i.check)){e.msg="header crc mismatch",i.mode=30;break}g=0,v=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=12;break;case 10:for(;v<32;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}e.adler=i.check=h(g),g=0,v=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,i.hold=g,i.bits=v,2;e.adler=i.check=1,i.mode=12;case 12:if(5===t||6===t)break e;case 13:if(i.last){g>>>=7&v,v-=7&v,i.mode=27;break}for(;v<3;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}switch(i.last=1&g,v-=1,3&(g>>>=1)){case 0:i.mode=14;break;case 1:if(b(i),i.mode=20,6===t){g>>>=2,v-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=30}g>>>=2,v-=2;break;case 14:for(g>>>=7&v,v-=7&v;v<32;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&g,g=0,v=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(_=i.length){if(_>f&&(_=f),_>p&&(_=p),0===_)break e;n.arraySet(c,r,u,_,d),f-=_,u+=_,p-=_,d+=_,i.length-=_;break}i.mode=12;break;case 17:for(;v<14;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(i.nlen=257+(31&g),g>>>=5,v-=5,i.ndist=1+(31&g),g>>>=5,v-=5,i.ncode=4+(15&g),g>>>=4,v-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;v<3;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.lens[F[i.have++]]=7&g,g>>>=3,v-=3}for(;i.have<19;)i.lens[F[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,O={bits:i.lenbits},D=(0,l.default)(0,i.lens,0,19,i.lencode,0,i.work,O),i.lenbits=O.bits,D){e.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;I=i.lencode[g&(1<<i.lenbits)-1],x=I>>>16&255,E=65535&I,!((k=I>>>24)<=v);){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(E<16)g>>>=k,v-=k,i.lens[i.have++]=E;else{if(16===E){for(M=k+2;v<M;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(g>>>=k,v-=k,0===i.have){e.msg="invalid bit length repeat",i.mode=30;break}R=i.lens[i.have-1],_=3+(3&g),g>>>=2,v-=2}else if(17===E){for(M=k+3;v<M;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}v-=k,R=0,_=3+(7&(g>>>=k)),g>>>=3,v-=3}else{for(M=k+7;v<M;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}v-=k,R=0,_=11+(127&(g>>>=k)),g>>>=7,v-=7}if(i.have+_>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=30;break}for(;_--;)i.lens[i.have++]=R}}if(30===i.mode)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,O={bits:i.lenbits},D=(0,l.default)(1,i.lens,0,i.nlen,i.lencode,0,i.work,O),i.lenbits=O.bits,D){e.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,O={bits:i.distbits},D=(0,l.default)(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,O),i.distbits=O.bits,D){e.msg="invalid distances set",i.mode=30;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(f>=6&&p>=258){e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,i.hold=g,i.bits=v,(0,a.default)(e,y),d=e.next_out,c=e.output,p=e.avail_out,u=e.next_in,r=e.input,f=e.avail_in,g=i.hold,v=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;I=i.lencode[g&(1<<i.lenbits)-1],x=I>>>16&255,E=65535&I,!((k=I>>>24)<=v);){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(x&&0==(240&x)){for(T=k,L=x,A=E;I=i.lencode[A+((g&(1<<T+L)-1)>>T)],x=I>>>16&255,E=65535&I,!(T+(k=I>>>24)<=v);){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}g>>>=T,v-=T,i.back+=T}if(g>>>=k,v-=k,i.back+=k,i.length=E,0===x){i.mode=26;break}if(32&x){i.back=-1,i.mode=12;break}if(64&x){e.msg="invalid literal/length code",i.mode=30;break}i.extra=15&x,i.mode=22;case 22:if(i.extra){for(M=i.extra;v<M;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.length+=g&(1<<i.extra)-1,g>>>=i.extra,v-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;I=i.distcode[g&(1<<i.distbits)-1],x=I>>>16&255,E=65535&I,!((k=I>>>24)<=v);){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(0==(240&x)){for(T=k,L=x,A=E;I=i.distcode[A+((g&(1<<T+L)-1)>>T)],x=I>>>16&255,E=65535&I,!(T+(k=I>>>24)<=v);){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}g>>>=T,v-=T,i.back+=T}if(g>>>=k,v-=k,i.back+=k,64&x){e.msg="invalid distance code",i.mode=30;break}i.offset=E,i.extra=15&x,i.mode=24;case 24:if(i.extra){for(M=i.extra;v<M;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}i.offset+=g&(1<<i.extra)-1,g>>>=i.extra,v-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===p)break e;if(_=y-p,i.offset>_){if((_=i.offset-_)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=30;break}_>i.wnext?(_-=i.wnext,C=i.wsize-_):C=i.wnext-_,_>i.length&&(_=i.length),w=i.window}else w=c,C=d-i.offset,_=i.length;_>p&&(_=p),p-=_,i.length-=_;do{c[d++]=w[C++]}while(--_);0===i.length&&(i.mode=21);break;case 26:if(0===p)break e;c[d++]=i.length,p--,i.mode=21;break;case 27:if(i.wrap){for(;v<32;){if(0===f)break e;f--,g|=r[u++]<<v,v+=8}if(y-=p,e.total_out+=y,i.total+=y,y&&(e.adler=i.check=i.flags?(0,o.default)(i.check,c,y,d-y):(0,s.default)(i.check,c,y,d-y)),y=p,(i.flags?g:h(g))!==i.check){e.msg="incorrect data check",i.mode=30;break}g=0,v=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;v<32;){if(0===f)break e;f--,g+=r[u++]<<v,v+=8}if(g!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=30;break}g=0,v=0}i.mode=29;case 29:D=1;break e;case 30:D=-3;break e;case 31:return-4;case 32:default:return-2}if(e.next_out=d,e.avail_out=p,e.next_in=u,e.avail_in=f,i.hold=g,i.bits=v,(i.wsize||y!==e.avail_out&&i.mode<30&&(i.mode<27||4!==t))&&S(e,e.output,e.next_out,y-e.avail_out))return i.mode=31,-4;m-=e.avail_in,y-=e.avail_out,e.total_in+=m,e.total_out+=y,i.total+=y,i.wrap&&y&&(e.adler=i.check=i.flags?(0,o.default)(i.check,c,y,e.next_out-y):(0,s.default)(i.check,c,y,e.next_out-y));e.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0===m&&0===y||4===t)&&0===D&&(D=-5);return D},t.inflateEnd=function(e){if(!e||!e.state)return-2;var t=e.state;t.window&&(t.window=null);return e.state=null,0},t.inflateGetHeader=function(e,t){var i;if(!e||!e.state)return-2;if(0==(2&(i=e.state).wrap))return-2;return i.head=t,t.done=!1,0},t.inflateSetDictionary=function(e,t){var i,r,n=t.length;if(!e||!e.state)return-2;if(0!==(i=e.state).wrap&&11!==i.mode)return-2;if(11===i.mode&&(r=1,(r=(0,s.default)(r,t,n,0))!==i.check))return-3;if(S(e,t,n,n))return i.mode=31,-4;return i.havedict=1,0},t.inflateInfo=t.Z_DEFLATED=t.Z_BUF_ERROR=t.Z_MEM_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_NEED_DICT=t.Z_STREAM_END=t.Z_OK=t.Z_TREES=t.Z_BLOCK=t.Z_FINISH=void 0;var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}i.default=e,t&&t.set(e,i);return i}(i(/*! ../utils/common.js */"6BzB")),s=c(i(/*! ./adler32.js */"xlC8")),o=c(i(/*! ./crc32.js */"QV2g")),a=c(i(/*! ./inffast.js */"sjKO")),l=c(i(/*! ./inftrees.js */"JSwD"));function c(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_TREES=6;t.Z_OK=0;t.Z_STREAM_END=1;t.Z_NEED_DICT=2;t.Z_STREAM_ERROR=-2;t.Z_DATA_ERROR=-3;t.Z_MEM_ERROR=-4;t.Z_BUF_ERROR=-5;t.Z_DEFLATED=8;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):-2}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):-2}function g(e,t){var i,r;return e&&e.state?(r=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,p(e))):-2}function v(e,t){var i,r;return e?(r=new d,e.state=r,r.window=null,0!==(i=g(e,t))&&(e.state=null),i):-2}var m,y,_=!0;function b(e){if(_){var t;for(m=new n.Buf32(512),y=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for((0,l.default)(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;(0,l.default)(2,e.lens,0,32,y,0,e.work,{bits:5}),_=!1}e.lencode=m,e.lenbits=9,e.distcode=y,e.distbits=5}function S(e,t,i,r){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>r&&(s=r),n.arraySet(o.window,t,i-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,t,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}t.inflateInfo="pako inflate (from Nodeca project)"},gIYZ:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/fixedkeys.js ***!
|
|
|
\**********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},h78n:
|
|
|
/*!**********************************************************!*\
|
|
|
!*** ./node_modules/rc-progress/es/index.js + 3 modules ***!
|
|
|
\**********************************************************/
|
|
|
/*! exports provided: Line, Circle, default */
|
|
|
/*! exports used: Circle */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(e,t,i){"use strict";i.d(t,"a",(function(){return w}));var r=i("q1tI"),n=i.n(r),s=i("TSYQ"),o=i.n(s),a={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},l=function(e){var t=e.map((function(){return Object(r.useRef)()})),i=Object(r.useRef)();return Object(r.useEffect)((function(){var e=Date.now(),r=!1;Object.keys(t).forEach((function(n){var s=t[n].current;if(s){r=!0;var o=s.style;o.transitionDuration=".3s, .3s, .3s, .06s",i.current&&e-i.current<100&&(o.transitionDuration="0s, 0s")}})),r&&(i.current=Date.now())})),[t]};function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],r=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw s}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function d(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var f=function(e){var t=e.className,i=e.percent,r=e.prefixCls,s=e.strokeColor,a=e.strokeLinecap,h=e.strokeWidth,f=e.style,p=e.trailColor,g=e.trailWidth,v=e.transition,m=d(e,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete m.gapPosition;var y=Array.isArray(i)?i:[i],_=Array.isArray(s)?s:[s],b=u(l(y),1)[0],S=h/2,C=100-h/2,w="M ".concat("round"===a?S:0,",").concat(S,"\n L ").concat("round"===a?C:100,",").concat(S),k="0 0 100 ".concat(h),x=0;return n.a.createElement("svg",c({className:o()("".concat(r,"-line"),t),viewBox:k,preserveAspectRatio:"none",style:f},m),n.a.createElement("path",{className:"".concat(r,"-line-trail"),d:w,strokeLinecap:a,stroke:p,strokeWidth:g||h,fillOpacity:"0"}),y.map((function(e,t){var i={strokeDasharray:"".concat(e,"px, 100px"),strokeDashoffset:"-".concat(x,"px"),transition:v||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},s=_[t]||_[_.length-1];return x+=e,n.a.createElement("path",{key:t,className:"".concat(r,"-line-path"),d:w,strokeLinecap:a,stroke:s,strokeWidth:h,fillOpacity:"0",ref:b[t],style:i})})))};f.defaultProps=a;function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var i=[],r=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(r=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);r=!0);}catch(e){n=!0,s=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw s}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return v(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return v(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function m(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var y=0;function _(e){return+e.replace("%","")}function b(e){return Array.isArray(e)?e:[e]}function S(e,t,i,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5?arguments[5]:void 0,o=50-r/2,a=0,l=-o,c=0,u=-2*o;switch(s){case"left":a=-o,l=0,c=2*o,u=0;break;case"right":a=o,l=0,c=-2*o,u=0;break;case"bottom":l=o,u=2*o}var h="M 50,50 m ".concat(a,",").concat(l,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(c,",").concat(-u,"\n a ").concat(o,",").concat(o," 0 1 1 ").concat(-c,",").concat(u),d=2*Math.PI*o,f={stroke:i,strokeDasharray:"".concat(t/100*(d-n),"px ").concat(d,"px"),strokeDashoffset:"-".concat(n/2+e/100*(d-n),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:h,pathStyle:f}}var C=function(e){var t,i=e.prefixCls,s=e.strokeWidth,a=e.trailWidth,c=e.gapDegree,u=e.gapPosition,h=e.trailColor,d=e.strokeLinecap,f=e.style,v=e.className,C=e.strokeColor,w=e.percent,k=m(e,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),x=Object(r.useMemo)((function(){return y+=1}),[]),E=S(0,100,h,s,c,u),T=E.pathString,L=E.pathStyle,A=b(w),R=b(C),D=R.find((function(e){return"[object Object]"===Object.prototype.toString.call(e)})),O=g(l(A),1)[0];return n.a.createElement("svg",p({className:o()("".concat(i,"-circle"),v),viewBox:"0 0 100 100",style:f},k),D&&n.a.createElement("defs",null,n.a.createElement("linearGradient",{id:"".concat(i,"-gradient-").concat(x),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(D).sort((function(e,t){return _(e)-_(t)})).map((function(e,t){return n.a.createElement("stop",{key:t,offset:e,stopColor:D[e]})})))),n.a.createElement("path",{className:"".concat(i,"-circle-trail"),d:T,stroke:h,strokeLinecap:d,strokeWidth:a||s,fillOpacity:"0",style:L}),(t=0,A.map((function(e,r){var o=R[r]||R[R.length-1],a="[object Object]"===Object.prototype.toString.call(o)?"url(#".concat(i,"-gradient-").concat(x,")"):"",l=S(t,e,o,s,c,u);return t+=e,n.a.createElement("path",{key:r,className:"".concat(i,"-circle-path"),d:l.pathString,stroke:a,strokeLinecap:d,strokeWidth:s,opacity:0===e?0:1,fillOpacity:"0",style:l.pathStyle,ref:O[r]})}))).reverse())};C.defaultProps=a;var w=C},hXwI:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/copyrect.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i,n;return t=e,(i=[{key:"decodeRect",value:function(e,t,i,r,n,s,o){if(n.rQwait("COPYRECT",4))return!1;var a=n.rQshift16(),l=n.rQshift16();return s.copyImage(a,l,e,t,i,r),!0}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=n},iJb0:
|
|
|
/*!******************************************************************!*\
|
|
|
!*** ./src/pages/Shixuns/New/ImagePreview/index.tsx + 1 modules ***!
|
|
|
\******************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@ant-design/icons/es/icons/LoadingOutlined.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@novnc/novnc/lib/rfb.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/Shixuns/New/ImagePreview/index.less?modules (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/.umi-production/core/umiExports.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/Spinner/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/index.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/mediator.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/xterm-panel/index.jsx */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/service/shixuns.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/col/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/col/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/progress/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/progress/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/row/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/row/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/statistic/style/index.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react-router/esm/react-router.js */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
|
|
|
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */function(e,t,i){"use strict";i.r(t);i("+L6B");var r=i("2/Rp"),n=(i("miYZ"),i("tsqr")),s=(i("14J3"),i("BMrR")),o=(i("jCWc"),i("kPKH")),a=i("k1fw"),l=i("9og8"),c=(i("2qtc"),i("kLXV")),u=i("tJVT"),h=i("PpiC"),d=(i("aHsQ"),i("sGsY")),f=i("WmNS"),p=i.n(f),g=i("q1tI"),v=i.n(g),m=i("9kvl"),y=(i("Lmeb"),i("Ot1p")),_=i("Dqnf"),b=i("dhSg"),S=(i("MXD1"),i("CFYs")),C=i("rAM+"),w=i("IxHN"),k=i("bdgK"),x=i("M8RZ"),E=i("Ty5D"),T=i("1dTM"),L=i.n(T),A=i("HBuW"),R=i("VaU+"),D=i.n(R),O=i("ye1Q");O.a;function M(e){e||(e=window.location.search);var t=e.substr(1),i={};return t.split("&").forEach((function(e){var t=e.split("=");i[t[0]]=decodeURIComponent(t[1])})),i}var I,P={loading:!0,isLarge:!1,showClipBoardBox:!1,transferContent:"",mes:"实验环境准备中"};function F(e,t){switch(t.type){case I.SET_LOADING:return Object(a.a)(Object(a.a)({},e),{},{loading:t.payload});case I.SET_IS_LARGE:return Object(a.a)(Object(a.a)({},e),{},{isLarge:t.payload});case I.SET_MES:return Object(a.a)(Object(a.a)({},e),{},{mes:t.payload});case I.SET_STATE:return Object(a.a)(Object(a.a)({},e),t.payload);case I.SET_TRANSFER_CONTENT:return Object(a.a)(Object(a.a)({},e),{},{transferContent:t.payload});case I.SHOW_CLIPBOARD_BOX:return Object(a.a)(Object(a.a)({},e),{},{showClipBoardBox:t.payload});default:throw new Error}}!function(e){e[e.SET_LOADING=0]="SET_LOADING",e[e.SET_IS_LARGE=1]="SET_IS_LARGE",e[e.SET_MES=2]="SET_MES",e[e.SET_STATE=3]="SET_STATE",e[e.SHOW_CLIPBOARD_BOX=4]="SHOW_CLIPBOARD_BOX",e[e.SET_TRANSFER_CONTENT=5]="SET_TRANSFER_CONTENT"}(I||(I={}));var B=function(e){var t,i=e.vnc_url,r=e.window_vnc_url,s=(e.taskId,Object(g.useRef)()),o=Object(g.useRef)(),h=Object(g.useReducer)(F,P),d=Object(u.a)(h,2),f=d[0],m=d[1],y=Object(g.useState)(0),_=Object(u.a)(y,2),T=_[0],R=_[1],O=f.mes,B=f.loading,N=(f.showClipBoardBox,f.isLarge),H=(f.transferContent,Object(g.useState)(0)),j=Object(u.a)(H,2),U=j[0],K=j[1],X=Object(g.useRef)(),W=Object(E.i)();function z(e){var t;return s.current&&(t=new k.default((function(t){var i,r=Object(C.a)(t);try{for(r.s();!(i=r.n()).done;){var n=i.value;(n.target.offsetHeight>0||n.target.offsetWidth>0)&&e._eventHandlers.windowResize()}}catch(e){r.e(e)}finally{r.f()}}))).observe(s.current),t}var G=function(){var e=Object(l.a)(p.a.mark((function e(){var i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.rb)(Object(a.a)({},W));case 2:if(-3!==(null==(i=e.sent)?void 0:i.status)){e.next=5;break}return e.abrupt("return",new Promise(function(){var e=Object(l.a)(p.a.mark((function e(i,r){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.a.confirm({content:"检测到您已经开启了其他windows环境,请先关闭环境后,再连接",okText:"立即关闭",cancelText:"稍后关闭",onOk:function(){var e=Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return clearTimeout(t),K(0),G(),e.abrupt("return");case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})));return function(t,i){return e.apply(this,arguments)}}()));case 5:if(-1!==(null==i?void 0:i.status)){e.next=7;break}throw new String(null==i?void 0:i.message);case 7:return b.a.publish("update-windows-time",null==i?void 0:i.data),e.abrupt("return",i);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();Object(g.useEffect)((function(){return X.current=setTimeout((function(){c.a.confirm({title:v.a.createElement(v.a.Fragment,null,"实验环境延时提醒"),content:"当前实验环境将于 5 分钟后关闭,需要延长使用时间吗?",okText:"立即延长",cancelText:"不需要",onOk:function(){b.a.publish("delayed-time",1),R(T+1)}})}),36e5),function(){clearTimeout(X.current)}}),[]),Object(g.useEffect)((function(){var e,a;function c(e){r&&(n.b.warn("由于长时间未操作,连接失效,正在重新连接Windows VNC服务"),m({type:I.SET_LOADING,payload:!0}),R(T+1))}function u(){clearTimeout(t),K(100),setTimeout((function(){m({type:I.SET_LOADING,payload:!1})}),1300),b.a.subscribe("send-ctrl-alt-delete",(function(){var t;null===(t=e)||void 0===t||t.sendCtrlAltDel()}))}function h(e){var t=e.detail.text.replace(/\\u([\dA-Za-z]{4})/g,(function(e,t){return String.fromCharCode(parseInt("0x"+t))}));m({type:I.SET_TRANSFER_CONTENT,payload:t})}if((r||i)&&s.current){new Promise(Object(l.a)(p.a.mark((function t(){var i,n,l,d,f,g,v,m,y,_;return p.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=M(),n="",t.next=4,G();case 4:d=t.sent,r?(l="Edu123",n=decodeURIComponent(null==d||null===(f=d.data)||void 0===f?void 0:f.vnc_url)):(v=new URL(null==d||null===(g=d.data)||void 0===g?void 0:g.vnc_url),m=v.protocol,y=v.searchParams,_=v.host,l=y.get("password"),n="".concat("https:"===m?"wss":"ws","://").concat(_,"/").concat(i.path||"websockify")),e=new L.a(s.current,n,{credentials:{password:l},wsProtocols:["binary"]}),a=z(e),e.viewOnly=i.view_only||!1,e.scaleViewport=!!r||(i.scale||!1),e.scaleViewport=i.scale||!0,e.resizeSession=!0,o.current=e,e.addEventListener("disconnect",c),e.addEventListener("connect",u),e.addEventListener("clipboard",h);case 16:case"end":return t.stop()}}),t)}))));var d=b.a.subscribe("vnc-reseting",(function(){m({type:I.SET_STATE,payload:{loading:!0,mes:"实验环境重置中"}})})),f=b.a.subscribe("vnc-enlarge",(function(){m({type:I.SET_IS_LARGE,payload:!0})})),g=b.a.subscribe("show-clipboard-box",(function(){m({type:I.SHOW_CLIPBOARD_BOX,payload:!0})}));return K(0),function(){var t,i,r,n;null===(t=e)||void 0===t||t.removeEventListener("disconnect",c),null===(i=e)||void 0===i||i.removeEventListener("connect",u),null===(r=e)||void 0===r||r.removeEventListener("clipboard",h),d(),f(),g(),null===(n=a)||void 0===n||n.unobserve(s.current)}}}),[i,r,T]),Object(g.useEffect)((function(){0==U&&V()}),[U]);var V=function e(){U>99?U=99:(U+=1,t=setTimeout((function(){e()}),1500)),U<100&&K(U)};return v.a.createElement(g.Fragment,null,v.a.createElement("div",{style:{backgroundColor:"#000"},className:"".concat(r?"vnc-panel-wrapper-windows":"vnc-panel-wrapper"," ").concat(N?"full-screen":"")},v.a.createElement("a",{className:"btn-vnc-resize",onClick:function(){m({type:I.SET_IS_LARGE,payload:!N})}},v.a.createElement("i",{className:"iconfont ".concat(N?"icon-tuichuquanping1":"icon-quanping1")})),B?v.a.createElement(w.a,{className:D.a.spin,message:O,style:{color:"#0152d9"}},v.a.createElement("div",{className:"tc",style:{width:500,margin:"0 auto",color:"#FFF"}},v.a.createElement(S.a,{percent:U,format:function(e){return v.a.createElement("span",{className:"c-white"},e,"%")}}))):null,v.a.createElement("div",{ref:s,className:"vnc-panel ".concat(B?"hide":"animated fadeIn")})),v.a.createElement(x.a,null))},N=i("m3rI"),H=d.a.Countdown;t.default=Object(m.a)((function(e){var t=e.shixunsDetail,i=e.loading,r=e.user;return{shixunsDetail:t,globalSetting:e.globalSetting,user:r,loading:i.models.shixunsDetail}}))((function(e){var t,i,d=e.shixunsDetail,f=(e.globalSetting,e.loading,e.dispatch),m=e.user,S=e.history,C=Object(h.a)(e,["shixunsDetail","globalSetting","loading","dispatch","user","history"]),w=Object(g.useState)({}),k=Object(u.a)(w,2),x=k[0],E=k[1],T=Object(g.useState)(400),L=Object(u.a)(T,2),R=L[0],O=L[1],M=Object(g.useState)(!1),I=Object(u.a)(M,2),P=I[0],F=I[1],j=Object(g.useState)(""),U=Object(u.a)(j,2),K=U[0],X=U[1],W=Object(g.useState)(Date.now()+36e5),z=Object(u.a)(W,2),G=z[0],V=z[1],q=C.match.params,Q=(C.location.query,Object(g.useState)(!1)),Y=Object(u.a)(Q,2),Z=Y[0],$=Y[1],J=d.mirrorApplies,ee=Object(g.useRef)();Object(g.useEffect)((function(){return f({type:"globalSetting/headerFooterToggle",payload:!1}),ie(),re(),window.addEventListener("resize",ie),b.a.subscribe("delayed-time",(function(){V(Date.now()+36e5)})),function(){window.removeEventListener("resize",ie),clearTimeout(ee.current),f({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]),Object(g.useEffect)((function(){x.host&&setTimeout((function(){b.a.publish("create-socket",1)}),1500)}),[x]),Object(g.useEffect)((function(){J.webssh&&(te(),ee.current=setTimeout((function(){c.a.confirm({title:v.a.createElement(v.a.Fragment,null,"实验环境延时提醒"),content:"当前实验环境将于 15 分钟后关闭,需要延长使用时间吗?",okText:"立即延长",cancelText:"不需要",onOk:function(){b.a.publish("ssh-add-connect-time",{}),b.a.publish("delayed-time",1)}})}),36e5)),J.id&&ie()}),[J]);var te=function(){var e=Object(l.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.sb)(Object(a.a)({},q));case 2:t=e.sent,E(Object(a.a)({},t));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ie=function(){var e=window.innerHeight;O(e-(J.audit_remark?400:270))},re=function(){var e=Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:f({type:"shixunsDetail/getMirrorApplies",payload:Object(a.a)({},q)});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return console.log(null==m?void 0:m.userInfo),v.a.createElement("section",{className:D.a.wrp},v.a.createElement("header",{className:D.a.header},v.a.createElement(s.a,{align:"middle"},v.a.createElement(o.a,{flex:"1"},v.a.createElement("img",{alt:"用户头像",height:"40",src:"".concat(N.a.IMG_SERVER,"/images/").concat(null==m||null===(t=m.userInfo)||void 0===t?void 0:t.image_url),width:"40",style:{borderRadius:"50%"}}),v.a.createElement("span",{className:"ml10"},null==m||null===(i=m.userInfo)||void 0===i?void 0:i.real_name)),v.a.createElement(o.a,{flex:"1"},v.a.createElement("span",{className:"mr10 font18"},J.name)),v.a.createElement(o.a,null,v.a.createElement("span",null,"剩余时长:",v.a.createElement(H,{className:D.a.cuttDown,value:G,format:"mm:ss",valueStyle:{color:"#FFF"}})),v.a.createElement("span",{className:"icon-kaiguan font20 current ml60",onClick:function(){c.a.confirm({title:"退出镜像",content:"你确定要退出镜像吗?",okText:"确定",cancelText:"取消",onOk:function(){var e;S.push("/users/".concat(null===(e=m.userInfo)||void 0===e?void 0:e.login,"/experiment-img"))}})}})))),v.a.createElement("aside",{className:D.a.container},v.a.createElement(s.a,null,v.a.createElement(o.a,{style:{position:"relative",width:Z?"0%":"40%"}},v.a.createElement("section",{className:"".concat(D.a.info," ml40 mr40"),style:{display:Z?"none":"flex"}},v.a.createElement("aside",null,v.a.createElement(s.a,{align:"middle",style:{height:68,borderBottom:"1px solid #f1f1f1"}},v.a.createElement(o.a,{className:"font18"},"实验环境说明 ",v.a.createElement("span",{className:"font16 ml20 c-grey-999"},"请按模板填写实验环境说明"))),v.a.createElement("aside",{className:"mt30 flex1"},v.a.createElement(y.a,{height:R,defaultValue:J.description||"",onChange:function(e){return X(e)}}),J.audit_remark&&v.a.createElement("aside",{className:"mt10 font16 c-grey-999 mb10"},"审核不通过原因:",v.a.createElement("span",{className:"c-red"},J.audit_remark))),v.a.createElement("aside",{className:"mb20"},v.a.createElement(s.a,{justify:"center",gutter:[20,20],className:D.a.buttons},v.a.createElement(o.a,null,v.a.createElement(r.a,{type:"primary",size:"large",loading:P,onClick:Object(l.a)(p.a.mark((function e(){var t;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),c.a.info({title:"保存镜像",centered:!0,content:"临时镜像系统默认只保存30天,过期将会自动清理。请尽快申请发布。",okText:"我知道了",onOk:function(){}}),e.next=4,Object(A.ub)(Object(a.a)(Object(a.a)({},q),{},{description:K}));case 4:0===(null==(t=e.sent)?void 0:t.status)&&n.b.success("保存成功"),F(!1);case 7:case"end":return e.stop()}}),e)})))},"保存")),v.a.createElement(o.a,null,v.a.createElement(r.a,{type:"primary",ghost:!0,size:"large",onClick:Object(l.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:c.a.confirm({title:"申请发布",centered:!0,content:"你确定要申请发布该镜像?",okText:"确定",cancelText:"取消",onOk:function(){var e=Object(l.a)(p.a.mark((function e(){var t,i;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(A.tb)(Object(a.a)(Object(a.a)({},q),{},{description:K}));case 2:0===(null==(t=e.sent)?void 0:t.status)&&(S.push("/users/".concat(null===(i=m.userInfo)||void 0===i?void 0:i.login,"/experiment-img")),n.b.success("申请发布成功"));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 1:case"end":return e.stop()}}),e)})))},"申请发布")))))),v.a.createElement("div",{className:Z?D.a.elseShrink:D.a.shrink,onClick:function(){return $(!Z)}},v.a.createElement("i",{className:"iconfont icon-cela"}))),v.a.createElement(o.a,{style:{background:"#000",width:Z?"100%":"60%"}},v.a.createElement("div",null,v.a.createElement("aside",{className:D.a.fullBtn},v.a.createElement("span",{className:"icon-quanping"})),J.webssh&&v.a.createElement(_.a,{sshConfigData:x,sid:1}),((null==J?void 0:J.vnc)||(null==J?void 0:J.windows))&&v.a.createElement(B,{taskId:"windows"===J.type?"pcf9t4w6vrnz":"ijby95c82nsh",vnc_url:J.vnc,window_vnc_url:J.windows}))))))}))},iUHT:
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/des.js ***!
|
|
|
\**********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n,s,o,a,l,c,u=[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],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[(o=(n=65536)|(s=1<<24))|(l=1024),0,0|n,o|(c=(a=4)|l),o|a,n|c,0|a,0|n,0|l,o|l,o|c,0|l,s|c,o|a,0|s,0|a,0|c,s|l,s|l,n|l,n|l,0|o,0|o,s|c,n|a,s|a,s|a,n|a,0,0|c,n|c,0|s,0|n,o|c,0|a,0|o,o|l,0|s,0|s,0|l,o|a,0|n,n|l,s|a,0|l,0|a,s|c,n|c,o|c,n|a,0|o,s|c,s|a,0|c,n|c,o|l,0|c,s|l,s|l,0,n|a,n|l,0,o|a],f=[(o=(n=1<<20)|(s=1<<31))|(c=(a=32)|(l=32768)),s|l,0|l,n|c,0|n,0|a,o|a,s|c,s|a,o|c,o|l,0|s,s|l,0|n,0|a,o|a,n|l,n|a,s|c,0,0|s,0|l,n|c,0|o,n|a,s|a,0,n|l,0|c,o|l,0|o,0|c,0,n|c,o|a,0|n,s|c,0|o,o|l,0|l,0|o,s|l,0|a,o|c,n|c,0|a,0|l,0|s,0|c,o|l,0|n,s|a,n|a,s|c,s|a,n|a,n|l,0,s|l,0|c,0|s,o|a,o|c,n|l],p=[0|(c=(a=8)|(l=512)),(o=(n=1<<17)|(s=1<<27))|l,0,o|a,s|l,0,n|c,s|l,n|a,s|a,s|a,0|n,o|c,n|a,0|o,0|c,0|s,0|a,o|l,0|l,n|l,0|o,o|a,n|c,s|c,n|l,0|n,s|c,0|a,o|c,0|l,0|s,o|l,0|s,n|a,0|c,0|n,o|l,s|l,0,0|l,n|a,o|c,s|l,s|a,0|l,0,o|a,s|c,0|n,0|s,o|c,0|a,n|c,n|l,s|a,0|o,s|c,0|c,0|o,n|c,0|a,o|a,n|l],g=[(o=(n=8192)|(s=1<<23))|(a=1),n|(c=a|(l=128)),n|c,0|l,o|l,s|c,s|a,n|a,0,0|o,0|o,o|c,0|c,0,s|l,s|a,0|a,0|n,0|s,o|a,0|l,0|s,n|a,n|l,s|c,0|a,n|l,s|l,0|n,o|l,o|c,0|c,s|l,s|a,0|o,o|c,0|c,0,0,0|o,n|l,s|l,s|c,0|a,o|a,n|c,n|c,0|l,o|c,0|c,0|a,0|n,s|a,n|a,o|l,s|c,n|a,n|l,0|s,o|a,0|l,0|s,0|n,o|l],v=[0|(a=256),(n=1<<25)|(c=a|(l=1<<19)),n|l,(o=n|(s=1<<30))|a,0|l,0|a,0|s,n|l,s|c,0|l,n|a,s|c,o|a,o|l,0|c,0|s,0|n,s|l,s|l,0,s|a,o|c,o|c,n|a,o|l,s|a,0,0|o,n|c,0|n,0|o,0|c,0|l,o|a,0|a,0|n,0|s,n|l,o|a,s|c,n|a,0|s,o|l,n|c,s|c,0|a,0|n,o|l,o|c,0|c,0|o,o|c,n|l,0,s|l,0|o,0|c,n|a,s|a,0|l,0,s|l,n|c,s|a],m=[(s=1<<29)|(a=16),0|(o=(n=1<<22)|s),0|(l=16384),o|(c=a|l),0|o,0|a,o|c,0|n,s|l,n|c,0|n,s|a,n|a,s|l,0|s,0|c,0,n|a,s|c,0|l,n|l,s|c,0|a,o|a,o|a,0,n|c,o|l,0|c,n|l,o|l,0|s,s|l,0|a,o|a,n|l,o|c,0|n,0|c,s|a,0|n,s|l,0|s,0|c,s|a,o|c,n|l,0|o,n|c,o|l,0,o|a,0|a,0|l,0|o,n|c,0|l,n|a,s|c,0,o|l,0|s,n|a,s|c],y=[0|(n=1<<21),(o=n|(s=1<<26))|(a=2),s|(c=a|(l=2048)),0,0|l,s|c,n|c,o|l,o|c,0|n,0,s|a,0|a,0|s,o|a,0|c,s|l,n|c,n|a,s|l,s|a,0|o,o|l,n|a,0|o,0|l,0|c,o|c,n|l,0|a,0|s,n|l,0|s,n|l,0|n,s|c,s|c,o|a,o|a,0|a,n|a,0|s,s|l,0|n,o|l,0|c,n|c,o|l,0|c,s|a,o|c,0|o,n|l,0,0|a,o|c,0,n|c,0|o,0|l,s|a,s|l,0|l,n|a],_=[(s=1<<28)|(c=(a=64)|(l=4096)),0|l,0|(n=1<<18),(o=n|s)|c,0|s,s|c,0|a,0|s,n|a,0|o,o|c,n|l,o|l,n|c,0|l,0|a,0|o,s|a,s|l,0|c,n|l,n|a,o|a,o|l,0|c,0,0,o|a,s|a,s|l,n|c,0|n,n|c,0|n,o|l,0|l,0|a,o|a,0|l,n|c,s|l,0|a,s|a,0|o,o|a,0|s,0|n,s|c,0,o|c,n|a,s|a,0|o,s|l,s|c,0,o|c,n|l,n|l,0|c,0|c,n|a,0|s,o|l],b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keys=[];for(var i=[],r=[],n=[],s=0,o=56;s<56;++s,o-=8){var a=7&(o+=o<-5?65:o<-3?31:o<-1?63:27===o?35:0);i[s]=0!=(t[o>>>3]&1<<a)?1:0}for(var l=0;l<16;++l){var c=l<<1,d=c+1;n[c]=n[d]=0;for(var f=28;f<59;f+=28)for(var p=f-28;p<f;++p){var g=p+h[l];r[p]=g<f?i[g]:i[g-28]}for(var v=0;v<24;++v)0!==r[u[v]]&&(n[c]|=1<<23-v),0!==r[u[v+24]]&&(n[d]|=1<<23-v)}for(var m=0,y=0,_=0;m<16;++m){var b=n[y++],S=n[y++];this.keys[_]=(16515072&b)<<6,this.keys[_]|=(4032&b)<<10,this.keys[_]|=(16515072&S)>>>10,this.keys[_]|=(4032&S)>>>6,++_,this.keys[_]=(258048&b)<<12,this.keys[_]|=(63&b)<<16,this.keys[_]|=(258048&S)>>>4,this.keys[_]|=63&S,++_}}var t,i,n;return t=e,(i=[{key:"enc8",value:function(e){var t,i,r,n=e.slice(),s=0;t=n[s++]<<24|n[s++]<<16|n[s++]<<8|n[s++],i=n[s++]<<24|n[s++]<<16|n[s++]<<8|n[s++],i^=r=252645135&(t>>>4^i),i^=r=65535&((t^=r<<4)>>>16^i),i^=(r=858993459&(i>>>2^(t^=r<<16)))<<2,i=(i^=(r=16711935&(i>>>8^(t^=r)))<<8)<<1|i>>>31&1,i^=r=2863311530&((t^=r)^i),t=(t^=r)<<1|t>>>31&1;for(var o=0,a=0;o<8;++o){r=i<<28|i>>>4,r^=this.keys[a++];var l=y[63&r];l|=v[r>>>8&63],l|=p[r>>>16&63],l|=d[r>>>24&63],r=i^this.keys[a++],l|=_[63&r],l|=m[r>>>8&63],l|=g[r>>>16&63],r=(t^=l|=f[r>>>24&63])<<28|t>>>4,r^=this.keys[a++],l=y[63&r],l|=v[r>>>8&63],l|=p[r>>>16&63],l|=d[r>>>24&63],r=t^this.keys[a++],l|=_[63&r],l|=m[r>>>8&63],l|=g[r>>>16&63],i^=l|=f[r>>>24&63]}for(i=i<<31|i>>>1,i^=r=2863311530&(t^i),i^=r=16711935&((t=(t^=r)<<31|t>>>1)>>>8^i),i^=r=858993459&((t^=r<<8)>>>2^i),i^=(r=65535&(i>>>16^(t^=r<<2)))<<16,r=[i^=(r=252645135&(i>>>4^(t^=r)))<<4,t^=r],s=0;s<8;s++)n[s]=(r[s>>>2]>>>8*(3-s%4))%256,n[s]<0&&(n[s]+=256);return n}},{key:"encrypt",value:function(e){return this.enc8(e.slice(0,8)).concat(this.enc8(e.slice(8,16)))}}])&&r(t.prototype,i),n&&r(t,n),e}();t.default=b},kSUc:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/components/markdown-editor/index.less ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},lNSK:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/deflate.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.deflateInit=function(e,t){return L(e,t,8,15,8,0)},t.deflateInit2=L,t.deflateReset=T,t.deflateResetKeep=E,t.deflateSetHeader=function(e,t){if(!e||!e.state)return-2;if(2!==e.state.wrap)return-2;return e.state.gzhead=t,0},t.deflate=function(e,t){var i,r,n,o;if(!e||!e.state||t>5||t<0)return e?f(e,-2):-2;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&4!==t)return f(e,0===e.avail_out?-5:-2);if(r.strm=e,i=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,y(r,31),y(r,139),y(r,8),r.gzhead?(y(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),y(r,255&r.gzhead.time),y(r,r.gzhead.time>>8&255),y(r,r.gzhead.time>>16&255),y(r,r.gzhead.time>>24&255),y(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),y(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(y(r,255&r.gzhead.extra.length),y(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(y(r,0),y(r,0),y(r,0),y(r,0),y(r,0),y(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),y(r,3),r.status=113);else{var l=8+(r.w_bits-8<<4)<<8,c=-1;c=r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3,l|=c<<6,0!==r.strstart&&(l|=32),l+=31-l%31,r.status=113,_(r,l),0!==r.strstart&&(_(r,e.adler>>>16),_(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(n=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),v(e),n=r.pending,r.pending!==r.pending_buf_size));)y(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),v(e),n=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,y(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){n=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),v(e),n=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,y(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>n&&(e.adler=(0,a.default)(e.adler,r.pending_buf,r.pending-n,n)),0===o&&(r.status=103)}else r.status=103;103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&v(e),r.pending+2<=r.pending_buf_size&&(y(r,255&e.adler),y(r,e.adler>>8&255),e.adler=0,r.status=113)):r.status=113);if(0!==r.pending){if(v(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(i)&&4!==t)return f(e,-5);if(666===r.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var u=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(S(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(m(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return m(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(m(e,!1),0===e.strm.avail_out))return 1;return 2}(r,t):3===r.strategy?function(e,t){for(var i,r,n,o,a=e.window;;){if(e.lookahead<=258){if(S(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,(r=a[n])===a[++n]&&r===a[++n]&&r===a[++n])){o=e.strstart+258;do{}while(r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&r===a[++n]&&n<o);e.match_length=258-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=s._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(m(e,!1),0===e.strm.avail_out))return 1}if(e.insert=0,4===t)return m(e,!0),0===e.strm.avail_out?3:4;if(e.last_lit&&(m(e,!1),0===e.strm.avail_out))return 1;return 2}(r,t):d[r.level].func(r,t);if(3!==u&&4!==u||(r.status=666),1===u||3===u)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===u&&(1===t?s._tr_align(r):5!==t&&(s._tr_stored_block(r,0,0,!1),3===t&&(g(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),v(e),0===e.avail_out))return r.last_flush=-1,0}if(4!==t)return 0;if(r.wrap<=0)return 1;2===r.wrap?(y(r,255&e.adler),y(r,e.adler>>8&255),y(r,e.adler>>16&255),y(r,e.adler>>24&255),y(r,255&e.total_in),y(r,e.total_in>>8&255),y(r,e.total_in>>16&255),y(r,e.total_in>>24&255)):(_(r,e.adler>>>16),_(r,65535&e.adler));v(e),r.wrap>0&&(r.wrap=-r.wrap);return 0!==r.pending?0:1},t.deflateEnd=function(e){var t;if(!e||!e.state)return-2;if(42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t)return f(e,-2);return e.state=null,113===t?f(e,-3):0},t.deflateSetDictionary=function(e,t){var i,r,s,a,l,c,u,h,d=t.length;if(!e||!e.state)return-2;if(i=e.state,2===(a=i.wrap)||1===a&&42!==i.status||i.lookahead)return-2;1===a&&(e.adler=(0,o.default)(e.adler,t,d,0));i.wrap=0,d>=i.w_size&&(0===a&&(g(i.head),i.strstart=0,i.block_start=0,i.insert=0),h=new n.Buf8(i.w_size),n.arraySet(h,t,d-i.w_size,i.w_size,0),t=h,d=i.w_size);l=e.avail_in,c=e.next_in,u=e.input,e.avail_in=d,e.next_in=0,e.input=t,S(i);for(;i.lookahead>=3;){r=i.strstart,s=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[r+3-1])&i.hash_mask,i.prev[r&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=r,r++}while(--s);i.strstart=r,i.lookahead=2,S(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=c,e.input=u,e.avail_in=l,i.wrap=a,0},t.deflateInfo=t.Z_DEFLATED=t.Z_UNKNOWN=t.Z_DEFAULT_STRATEGY=t.Z_FIXED=t.Z_RLE=t.Z_HUFFMAN_ONLY=t.Z_FILTERED=t.Z_DEFAULT_COMPRESSION=t.Z_BUF_ERROR=t.Z_DATA_ERROR=t.Z_STREAM_ERROR=t.Z_STREAM_END=t.Z_OK=t.Z_BLOCK=t.Z_FINISH=t.Z_FULL_FLUSH=t.Z_PARTIAL_FLUSH=t.Z_NO_FLUSH=void 0;var n=h(i(/*! ../utils/common.js */"6BzB")),s=h(i(/*! ./trees.js */"c5fP")),o=c(i(/*! ./adler32.js */"xlC8")),a=c(i(/*! ./crc32.js */"QV2g")),l=c(i(/*! ./messages.js */"xSIq"));function c(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function h(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){var o=n?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(i,s,o):i[s]=e[s]}return i.default=e,t&&t.set(e,i),i}t.Z_NO_FLUSH=0;t.Z_PARTIAL_FLUSH=1;t.Z_FULL_FLUSH=3;t.Z_FINISH=4;t.Z_BLOCK=5;t.Z_OK=0;t.Z_STREAM_END=1;t.Z_STREAM_ERROR=-2;t.Z_DATA_ERROR=-3;t.Z_BUF_ERROR=-5;t.Z_DEFAULT_COMPRESSION=-1;t.Z_FILTERED=1;t.Z_HUFFMAN_ONLY=2;t.Z_RLE=3;t.Z_FIXED=4;t.Z_DEFAULT_STRATEGY=0;t.Z_UNKNOWN=2;t.Z_DEFLATED=8;var d;function f(e,t){return e.msg=l.default[t],t}function p(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function v(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(n.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function m(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function _(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function b(e,t){var i,r,n=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,u=e.w_mask,h=e.prev,d=e.strstart+258,f=c[s+o-1],p=c[s+o];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(i=t)+o]===p&&c[i+o-1]===f&&c[i]===c[s]&&c[++i]===c[s+1]){s+=2,i++;do{}while(c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&c[++s]===c[++i]&&s<d);if(r=258-(d-s),s=d-258,r>o){if(e.match_start=t,o=r,r>=a)break;f=c[s+o-1],p=c[s+o]}}}while((t=h[t&u])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function S(e){var t,i,r,s,l,c,u,h,d,f,p=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=i=e.hash_size;do{r=e.head[--t],e.head[t]=r>=p?r-p:0}while(--i);t=i=p;do{r=e.prev[--t],e.prev[t]=r>=p?r-p:0}while(--i);s+=p}if(0===e.strm.avail_in)break;if(c=e.strm,u=e.window,h=e.strstart+e.lookahead,d=s,f=void 0,(f=c.avail_in)>d&&(f=d),i=0===f?0:(c.avail_in-=f,n.arraySet(u,c.input,c.next_in,f,h),1===c.state.wrap?c.adler=(0,o.default)(c.adler,u,f,h):2===c.state.wrap&&(c.adler=(0,a.default)(c.adler,u,f,h)),c.next_in+=f,c.total_in+=f,f),e.lookahead+=i,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function C(e,t){for(var i,r;;){if(e.lookahead<262){if(S(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-262&&(e.match_length=b(e,i)),e.match_length>=3)if(r=s._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function w(e,t){for(var i,r,n;;){if(e.lookahead<262){if(S(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-262&&(e.match_length=b(e,i),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,r=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=s._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function k(e,t,i,r,n){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=n}function x(){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=8,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 n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),g(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 E(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=0,s._tr_init(t),0):f(e,-2)}function T(e){var t,i=E(e);return 0===i&&((t=e.state).window_size=2*t.w_size,g(t.head),t.max_lazy_match=d[t.level].max_lazy,t.good_match=d[t.level].good_length,t.nice_match=d[t.level].nice_length,t.max_chain_length=d[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i}function L(e,t,i,r,s,o){if(!e)return-2;var a=1;if(-1===t&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),s<1||s>9||8!==i||r<8||r>15||t<0||t>9||o<0||o>4)return f(e,-2);8===r&&(r=9);var l=new x;return e.state=l,l.strm=e,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=i,T(e)}d=[new k(0,0,0,0,(function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(S(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+i;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new k(4,4,8,4,C),new k(4,5,16,8,C),new k(4,6,32,32,C),new k(4,4,16,16,w),new k(8,16,32,32,w),new k(8,16,128,128,w),new k(8,32,128,256,w),new k(32,128,258,1024,w),new k(32,258,258,4096,w)];t.deflateInfo="pako deflate (from Nodeca project)"},lZu9:
|
|
|
/*!***********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/mode/markdown/markdown.js ***!
|
|
|
\***********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){"use strict";e.defineMode("markdown",(function(t,i){var r=e.getMode(t,"text/html"),n="null"==r.name;void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1),void 0===i.emoji&&(i.emoji=!1),void 0===i.fencedCodeBlockHighlighting&&(i.fencedCodeBlockHighlighting=!0),void 0===i.fencedCodeBlockDefaultMode&&(i.fencedCodeBlockDefaultMode="text/plain"),void 0===i.xml&&(i.xml=!0),void 0===i.tokenTypeOverrides&&(i.tokenTypeOverrides={});var s={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var o in s)s.hasOwnProperty(o)&&i.tokenTypeOverrides[o]&&(s[o]=i.tokenTypeOverrides[o]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,l=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,c=/^\[(x| )\](?=\s)/i,u=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~:]+/,f=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,p=/^\s*\[[^\]]+?\]:.*$/,g=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/;function v(e,t,i){return t.f=t.inline=i,i(e,t)}function m(e,t,i){return t.f=t.block=i,i(e,t)}function y(t){if(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==b){var i=n;if(!i){var s=e.innerMode(r,t.htmlState);i="xml"==s.mode.name&&null===s.state.tagStart&&!s.state.context&&s.state.tokenize.isInText}i&&(t.f=k,t.block=_,t.htmlState=null)}return t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function _(r,n){var o,d=r.column()===n.indentation,g=!(o=n.prevLine.stream)||!/\S/.test(o.string),m=n.indentedCode,y=n.prevLine.hr,_=!1!==n.list,b=(n.listStack[n.listStack.length-1]||0)+3;n.indentedCode=!1;var w=n.indentation;if(null===n.indentationDiff&&(n.indentationDiff=n.indentation,_)){for(n.list=null;w<n.listStack[n.listStack.length-1];)n.listStack.pop(),n.listStack.length?n.indentation=n.listStack[n.listStack.length-1]:n.list=!1;!1!==n.list&&(n.indentationDiff=w-n.listStack[n.listStack.length-1])}var k=!(g||y||n.prevLine.header||_&&m||n.prevLine.fencedCodeEnd),x=(!1===n.list||y||g)&&n.indentation<=b&&r.match(a),E=null;if(n.indentationDiff>=4&&(m||n.prevLine.fencedCodeEnd||n.prevLine.header||g))return r.skipToEnd(),n.indentedCode=!0,s.code;if(r.eatSpace())return null;if(d&&n.indentation<=b&&(E=r.match(u))&&E[1].length<=6)return n.quote=0,n.header=E[1].length,n.thisLine.header=!0,i.highlightFormatting&&(n.formatting="header"),n.f=n.inline,C(n);if(n.indentation<=b&&r.eat(">"))return n.quote=d?1:n.quote+1,i.highlightFormatting&&(n.formatting="quote"),r.eatSpace(),C(n);if(!x&&!n.setext&&d&&n.indentation<=b&&(E=r.match(l))){var T=E[1]?"ol":"ul";return n.indentation=w+r.current().length,n.list=!0,n.quote=0,n.listStack.push(n.indentation),n.em=!1,n.strong=!1,n.code=!1,n.strikethrough=!1,i.taskLists&&r.match(c,!1)&&(n.taskList=!0),n.f=n.inline,i.highlightFormatting&&(n.formatting=["list","list-"+T]),C(n)}return d&&n.indentation<=b&&(E=r.match(f,!0))?(n.quote=0,n.fencedEndRE=new RegExp(E[1]+"+ *$"),n.localMode=i.fencedCodeBlockHighlighting&&function(i){if(e.findModeByName){var r=e.findModeByName(i);r&&(i=r.mime||r.mimes[0])}var n=e.getMode(t,i);return"null"==n.name?null:n}(E[2]||i.fencedCodeBlockDefaultMode),n.localMode&&(n.localState=e.startState(n.localMode)),n.f=n.block=S,i.highlightFormatting&&(n.formatting="code-block"),n.code=-1,C(n)):n.setext||!(k&&_||n.quote||!1!==n.list||n.code||x||p.test(r.string))&&(E=r.lookAhead(1))&&(E=E.match(h))?(n.setext?(n.header=n.setext,n.setext=0,r.skipToEnd(),i.highlightFormatting&&(n.formatting="header")):(n.header="="==E[0].charAt(0)?1:2,n.setext=n.header),n.thisLine.header=!0,n.f=n.inline,C(n)):x?(r.skipToEnd(),n.hr=!0,n.thisLine.hr=!0,s.hr):"["===r.peek()?v(r,n,L):v(r,n,n.inline)}function b(t,i){var s=r.token(t,i.htmlState);if(!n){var o=e.innerMode(r,i.htmlState);("xml"==o.mode.name&&null===o.state.tagStart&&!o.state.context&&o.state.tokenize.isInText||i.md_inside&&t.current().indexOf(">")>-1)&&(i.f=k,i.block=_,i.htmlState=null)}return s}function S(e,t){var r,n=t.listStack[t.listStack.length-1]||0,o=t.indentation<n,a=n+3;return t.fencedEndRE&&t.indentation<=a&&(o||e.match(t.fencedEndRE))?(i.highlightFormatting&&(t.formatting="code-block"),o||(r=C(t)),t.localMode=t.localState=null,t.block=_,t.f=k,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,o?m(e,t,t.block):r):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),s.code)}function C(e){var t=[];if(e.formatting){t.push(s.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(s.formatting+"-"+e.formatting[r]),"header"===e.formatting[r]&&t.push(s.formatting+"-"+e.formatting[r]+"-"+e.header),"quote"===e.formatting[r]&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=e.quote?t.push(s.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(s.linkHref,"url"):(e.strong&&t.push(s.strong),e.em&&t.push(s.em),e.strikethrough&&t.push(s.strikethrough),e.emoji&&t.push(s.emoji),e.linkText&&t.push(s.linkText),e.code&&t.push(s.code),e.image&&t.push(s.image),e.imageAltText&&t.push(s.imageAltText,"link"),e.imageMarker&&t.push(s.imageMarker)),e.header&&t.push(s.header,s.header+"-"+e.header),e.quote&&(t.push(s.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=e.quote?t.push(s.quote+"-"+e.quote):t.push(s.quote+"-"+i.maxBlockquoteDepth)),!1!==e.list){var n=(e.listStack.length-1)%3;n?1===n?t.push(s.list2):t.push(s.list3):t.push(s.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function w(e,t){if(e.match(d,!0))return C(t)}function k(t,n){var o=n.text(t,n);if(void 0!==o)return o;if(n.list)return n.list=null,C(n);if(n.taskList)return" "===t.match(c,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,i.highlightFormatting&&(n.formatting="task"),n.taskList=!1,C(n);if(n.taskOpen=!1,n.taskClosed=!1,n.header&&t.match(/^#+$/,!0))return i.highlightFormatting&&(n.formatting="header"),C(n);var a=t.next();if(n.linkTitle){n.linkTitle=!1;var l=a;"("===a&&(l=")");var u="^\\s*(?:[^"+(l=(l+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(u),!0))return s.linkHref}if("`"===a){var h=n.formatting;i.highlightFormatting&&(n.formatting="code"),t.eatWhile("`");var d=t.current().length;if(0!=n.code||n.quote&&1!=d){if(d==n.code){var f=C(n);return n.code=0,f}return n.formatting=h,C(n)}return n.code=d,C(n)}if(n.code)return C(n);if("\\"===a&&(t.next(),i.highlightFormatting)){var p=C(n),v=s.formatting+"-escape";return p?p+" "+v:v}if("!"===a&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return n.imageMarker=!0,n.image=!0,i.highlightFormatting&&(n.formatting="image"),C(n);if("["===a&&n.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return n.imageMarker=!1,n.imageAltText=!0,i.highlightFormatting&&(n.formatting="image"),C(n);if("]"===a&&n.imageAltText){i.highlightFormatting&&(n.formatting="image");var p=C(n);return n.imageAltText=!1,n.image=!1,n.inline=n.f=E,p}if("["===a&&!n.image)return n.linkText&&t.match(/^.*?\]/)||(n.linkText=!0,i.highlightFormatting&&(n.formatting="link")),C(n);if("]"===a&&n.linkText){i.highlightFormatting&&(n.formatting="link");var p=C(n);return n.linkText=!1,n.inline=n.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?E:k,p}if("<"===a&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=x,i.highlightFormatting&&(n.formatting="link"),(p=C(n))?p+=" ":p="",p+s.linkInline;if("<"===a&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return n.f=n.inline=x,i.highlightFormatting&&(n.formatting="link"),(p=C(n))?p+=" ":p="",p+s.linkEmail;if(i.xml&&"<"===a&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var y=t.string.indexOf(">",t.pos);if(-1!=y){var _=t.string.substring(t.start,y);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(_)&&(n.md_inside=!0)}return t.backUp(1),n.htmlState=e.startState(r),m(t,n,b)}if(i.xml&&"<"===a&&t.match(/^\/\w*?>/))return n.md_inside=!1,"tag";if("*"===a||"_"===a){for(var S=1,w=1==t.pos?" ":t.string.charAt(t.pos-2);S<3&&t.eat(a);)S++;var T=t.peek()||" ",L=!/\s/.test(T)&&(!g.test(T)||/\s/.test(w)||g.test(w)),A=!/\s/.test(w)&&(!g.test(w)||/\s/.test(T)||g.test(T)),R=null,D=null;if(S%2&&(n.em||!L||"*"!==a&&A&&!g.test(w)?n.em!=a||!A||"*"!==a&&L&&!g.test(T)||(R=!1):R=!0),S>1&&(n.strong||!L||"*"!==a&&A&&!g.test(w)?n.strong!=a||!A||"*"!==a&&L&&!g.test(T)||(D=!1):D=!0),null!=D||null!=R)return i.highlightFormatting&&(n.formatting=null==R?"strong":null==D?"em":"strong em"),!0===R&&(n.em=a),!0===D&&(n.strong=a),f=C(n),!1===R&&(n.em=!1),!1===D&&(n.strong=!1),f}else if(" "===a&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return C(n);t.backUp(1)}if(i.strikethrough)if("~"===a&&t.eatWhile(a)){if(n.strikethrough)return i.highlightFormatting&&(n.formatting="strikethrough"),f=C(n),n.strikethrough=!1,f;if(t.match(/^[^\s]/,!1))return n.strikethrough=!0,i.highlightFormatting&&(n.formatting="strikethrough"),C(n)}else if(" "===a&&t.match(/^~~/,!0)){if(" "===t.peek())return C(n);t.backUp(2)}if(i.emoji&&":"===a&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){n.emoji=!0,i.highlightFormatting&&(n.formatting="emoji");var O=C(n);return n.emoji=!1,O}return" "===a&&(t.match(/^ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),C(n)}function x(e,t){if(">"===e.next()){t.f=t.inline=k,i.highlightFormatting&&(t.formatting="link");var r=C(t);return r?r+=" ":r="",r+s.linkInline}return e.match(/^[^>]+/,!0),s.linkInline}function E(e,t){if(e.eatSpace())return null;var r,n=e.next();return"("===n||"["===n?(t.f=t.inline=(r="("===n?")":"]",function(e,t){if(e.next()===r){t.f=t.inline=k,i.highlightFormatting&&(t.formatting="link-string");var n=C(t);return t.linkHref=!1,n}return e.match(T[r]),t.linkHref=!0,C(t)}),i.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,C(t)):"error"}var T={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function L(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=A,e.next(),i.highlightFormatting&&(t.formatting="link"),t.linkText=!0,C(t)):v(e,t,k)}function A(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=R,i.highlightFormatting&&(t.formatting="link");var r=C(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),s.linkText}function R(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=k,s.linkHref+" url")}var D={startState:function(){return{f:_,prevLine:{stream:null},thisLine:{stream:null},block:_,htmlState:null,indentation:0,inline:k,text:w,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(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine.stream){if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0))return y(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:e},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=b)){var i=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentation=i,t.indentationDiff=null,i>0)return null}}return t.f(e,t)},innerMode:function(e){return e.block==b?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:D}},indent:function(t,i,n){return t.block==b&&r.indent?r.indent(t.htmlState,i,n):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,i,n):e.Pass},blankLine:y,getType:C,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return D}),"xml"),e.defineMIME("text/markdown","markdown"),e.defineMIME("text/x-markdown","markdown")}(i(/*! ../../lib/codemirror */"VrN/"),i(/*! ../xml/xml */"1eCo"),i(/*! ../meta */"8EBN"))},mHUz:
|
|
|
/*!*******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/keysym.js ***!
|
|
|
\*******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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}},mTgk:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/input/domkeytable.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n=(r=i(/*! ./keysym.js */"mHUz"))&&r.__esModule?r:{default:r};var s={};function o(e,t){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,t,t]}function a(e,t,i){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===i)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,i,t]}function l(e,t,i){if(void 0===t)throw new Error('Undefined keysym for key "'+e+'"');if(void 0===i)throw new Error('Undefined keysym for key "'+e+'"');if(e in s)throw new Error('Duplicate entry for key "'+e+'"');s[e]=[t,t,t,i]}a("Alt",n.default.XK_Alt_L,n.default.XK_Alt_R),o("AltGraph",n.default.XK_ISO_Level3_Shift),o("CapsLock",n.default.XK_Caps_Lock),a("Control",n.default.XK_Control_L,n.default.XK_Control_R),a("Meta",n.default.XK_Super_L,n.default.XK_Super_R),o("NumLock",n.default.XK_Num_Lock),o("ScrollLock",n.default.XK_Scroll_Lock),a("Shift",n.default.XK_Shift_L,n.default.XK_Shift_R),l("Enter",n.default.XK_Return,n.default.XK_KP_Enter),o("Tab",n.default.XK_Tab),l(" ",n.default.XK_space,n.default.XK_KP_Space),l("ArrowDown",n.default.XK_Down,n.default.XK_KP_Down),l("ArrowUp",n.default.XK_Up,n.default.XK_KP_Up),l("ArrowLeft",n.default.XK_Left,n.default.XK_KP_Left),l("ArrowRight",n.default.XK_Right,n.default.XK_KP_Right),l("End",n.default.XK_End,n.default.XK_KP_End),l("Home",n.default.XK_Home,n.default.XK_KP_Home),l("PageDown",n.default.XK_Next,n.default.XK_KP_Next),l("PageUp",n.default.XK_Prior,n.default.XK_KP_Prior),o("Backspace",n.default.XK_BackSpace),l("Clear",n.default.XK_Clear,n.default.XK_KP_Begin),o("Copy",n.default.XF86XK_Copy),o("Cut",n.default.XF86XK_Cut),l("Delete",n.default.XK_Delete,n.default.XK_KP_Delete),l("Insert",n.default.XK_Insert,n.default.XK_KP_Insert),o("Paste",n.default.XF86XK_Paste),o("Redo",n.default.XK_Redo),o("Undo",n.default.XK_Undo),o("Cancel",n.default.XK_Cancel),o("ContextMenu",n.default.XK_Menu),o("Escape",n.default.XK_Escape),o("Execute",n.default.XK_Execute),o("Find",n.default.XK_Find),o("Help",n.default.XK_Help),o("Pause",n.default.XK_Pause),o("Select",n.default.XK_Select),o("ZoomIn",n.default.XF86XK_ZoomIn),o("ZoomOut",n.default.XF86XK_ZoomOut),o("BrightnessDown",n.default.XF86XK_MonBrightnessDown),o("BrightnessUp",n.default.XF86XK_MonBrightnessUp),o("Eject",n.default.XF86XK_Eject),o("LogOff",n.default.XF86XK_LogOff),o("Power",n.default.XF86XK_PowerOff),o("PowerOff",n.default.XF86XK_PowerDown),o("PrintScreen",n.default.XK_Print),o("Hibernate",n.default.XF86XK_Hibernate),o("Standby",n.default.XF86XK_Standby),o("WakeUp",n.default.XF86XK_WakeUp),o("AllCandidates",n.default.XK_MultipleCandidate),o("Alphanumeric",n.default.XK_Eisu_Shift),o("CodeInput",n.default.XK_Codeinput),o("Compose",n.default.XK_Multi_key),o("Convert",n.default.XK_Henkan),o("GroupFirst",n.default.XK_ISO_First_Group),o("GroupLast",n.default.XK_ISO_Last_Group),o("GroupNext",n.default.XK_ISO_Next_Group),o("GroupPrevious",n.default.XK_ISO_Prev_Group),o("NonConvert",n.default.XK_Muhenkan),o("PreviousCandidate",n.default.XK_PreviousCandidate),o("SingleCandidate",n.default.XK_SingleCandidate),o("HangulMode",n.default.XK_Hangul),o("HanjaMode",n.default.XK_Hangul_Hanja),o("JunjuaMode",n.default.XK_Hangul_Jeonja),o("Eisu",n.default.XK_Eisu_toggle),o("Hankaku",n.default.XK_Hankaku),o("Hiragana",n.default.XK_Hiragana),o("HiraganaKatakana",n.default.XK_Hiragana_Katakana),o("KanaMode",n.default.XK_Kana_Shift),o("KanjiMode",n.default.XK_Kanji),o("Katakana",n.default.XK_Katakana),o("Romaji",n.default.XK_Romaji),o("Zenkaku",n.default.XK_Zenkaku),o("ZenkakuHanaku",n.default.XK_Zenkaku_Hankaku),o("F1",n.default.XK_F1),o("F2",n.default.XK_F2),o("F3",n.default.XK_F3),o("F4",n.default.XK_F4),o("F5",n.default.XK_F5),o("F6",n.default.XK_F6),o("F7",n.default.XK_F7),o("F8",n.default.XK_F8),o("F9",n.default.XK_F9),o("F10",n.default.XK_F10),o("F11",n.default.XK_F11),o("F12",n.default.XK_F12),o("F13",n.default.XK_F13),o("F14",n.default.XK_F14),o("F15",n.default.XK_F15),o("F16",n.default.XK_F16),o("F17",n.default.XK_F17),o("F18",n.default.XK_F18),o("F19",n.default.XK_F19),o("F20",n.default.XK_F20),o("F21",n.default.XK_F21),o("F22",n.default.XK_F22),o("F23",n.default.XK_F23),o("F24",n.default.XK_F24),o("F25",n.default.XK_F25),o("F26",n.default.XK_F26),o("F27",n.default.XK_F27),o("F28",n.default.XK_F28),o("F29",n.default.XK_F29),o("F30",n.default.XK_F30),o("F31",n.default.XK_F31),o("F32",n.default.XK_F32),o("F33",n.default.XK_F33),o("F34",n.default.XK_F34),o("F35",n.default.XK_F35),o("Close",n.default.XF86XK_Close),o("MailForward",n.default.XF86XK_MailForward),o("MailReply",n.default.XF86XK_Reply),o("MailSend",n.default.XF86XK_Send),o("MediaFastForward",n.default.XF86XK_AudioForward),o("MediaPause",n.default.XF86XK_AudioPause),o("MediaPlay",n.default.XF86XK_AudioPlay),o("MediaRecord",n.default.XF86XK_AudioRecord),o("MediaRewind",n.default.XF86XK_AudioRewind),o("MediaStop",n.default.XF86XK_AudioStop),o("MediaTrackNext",n.default.XF86XK_AudioNext),o("MediaTrackPrevious",n.default.XF86XK_AudioPrev),o("New",n.default.XF86XK_New),o("Open",n.default.XF86XK_Open),o("Print",n.default.XK_Print),o("Save",n.default.XF86XK_Save),o("SpellCheck",n.default.XF86XK_Spell),o("AudioVolumeDown",n.default.XF86XK_AudioLowerVolume),o("AudioVolumeUp",n.default.XF86XK_AudioRaiseVolume),o("AudioVolumeMute",n.default.XF86XK_AudioMute),o("MicrophoneVolumeMute",n.default.XF86XK_AudioMicMute),o("LaunchApplication1",n.default.XF86XK_MyComputer),o("LaunchApplication2",n.default.XF86XK_Calculator),o("LaunchCalendar",n.default.XF86XK_Calendar),o("LaunchMail",n.default.XF86XK_Mail),o("LaunchMediaPlayer",n.default.XF86XK_AudioMedia),o("LaunchMusicPlayer",n.default.XF86XK_Music),o("LaunchPhone",n.default.XF86XK_Phone),o("LaunchScreenSaver",n.default.XF86XK_ScreenSaver),o("LaunchSpreadsheet",n.default.XF86XK_Excel),o("LaunchWebBrowser",n.default.XF86XK_WWW),o("LaunchWebCam",n.default.XF86XK_WebCam),o("LaunchWordProcessor",n.default.XF86XK_Word),o("BrowserBack",n.default.XF86XK_Back),o("BrowserFavorites",n.default.XF86XK_Favorites),o("BrowserForward",n.default.XF86XK_Forward),o("BrowserHome",n.default.XF86XK_HomePage),o("BrowserRefresh",n.default.XF86XK_Refresh),o("BrowserSearch",n.default.XF86XK_Search),o("BrowserStop",n.default.XF86XK_Stop),o("Dimmer",n.default.XF86XK_BrightnessAdjust),o("MediaAudioTrack",n.default.XF86XK_AudioCycleTrack),o("RandomToggle",n.default.XF86XK_AudioRandomPlay),o("SplitScreenToggle",n.default.XF86XK_SplitScreen),o("Subtitle",n.default.XF86XK_Subtitle),o("VideoModeNext",n.default.XF86XK_Next_VMode),l("=",n.default.XK_equal,n.default.XK_KP_Equal),l("+",n.default.XK_plus,n.default.XK_KP_Add),l("-",n.default.XK_minus,n.default.XK_KP_Subtract),l("*",n.default.XK_asterisk,n.default.XK_KP_Multiply),l("/",n.default.XK_slash,n.default.XK_KP_Divide),l(".",n.default.XK_period,n.default.XK_KP_Decimal),l(",",n.default.XK_comma,n.default.XK_KP_Separator),l("0",n.default.XK_0,n.default.XK_KP_0),l("1",n.default.XK_1,n.default.XK_KP_1),l("2",n.default.XK_2,n.default.XK_KP_2),l("3",n.default.XK_3,n.default.XK_KP_3),l("4",n.default.XK_4,n.default.XK_KP_4),l("5",n.default.XK_5,n.default.XK_KP_5),l("6",n.default.XK_6,n.default.XK_KP_6),l("7",n.default.XK_7,n.default.XK_KP_7),l("8",n.default.XK_8,n.default.XK_KP_8),l("9",n.default.XK_9,n.default.XK_KP_9);var c=s;t.default=c},mdZa:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/polyfill.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(e),r=1;r<arguments.length;r++){var n=arguments[r];if(null!=n)for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])}return i},writable:!0,configurable:!0}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}e.prototype=window.Event.prototype,"function"!=typeof window.CustomEvent&&(window.CustomEvent=e)}(),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}},osHv:
|
|
|
/*!********************************************************!*\
|
|
|
!*** ./node_modules/codemirror/addon/fold/xml-fold.js ***!
|
|
|
\********************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){!function(e){"use strict";var t=e.Pos;function i(e,t){return e.line-t.line||e.ch-t.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",n=new RegExp("<(/?)(["+r+"]["+r+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");function s(e,t,i,r){this.line=t,this.ch=i,this.cm=e,this.text=e.getLine(t),this.min=r?Math.max(r.from,e.firstLine()):e.firstLine(),this.max=r?Math.min(r.to-1,e.lastLine()):e.lastLine()}function o(e,i){var r=e.cm.getTokenTypeAt(t(e.line,i));return r&&/\btag\b/.test(r)}function a(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function l(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function c(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(a(e))continue;return}if(o(e,t+1)){var i=e.text.lastIndexOf("/",t),r=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t+1}}function u(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(o(e,t+1)){n.lastIndex=t,e.ch=t;var i=n.exec(e.text);if(i&&i.index==t)return i}else e.ch=t}}function h(e){for(;;){n.lastIndex=e.ch;var t=n.exec(e.text);if(!t){if(a(e))continue;return}if(o(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(l(e))continue;return}if(o(e,t+1)){var i=e.text.lastIndexOf("/",t),r=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function f(e,i){for(var r=[];;){var n,s=h(e),o=e.line,a=e.ch-(s?s[0].length:0);if(!s||!(n=c(e)))return;if("selfClose"!=n)if(s[1]){for(var l=r.length-1;l>=0;--l)if(r[l]==s[2]){r.length=l;break}if(l<0&&(!i||i==s[2]))return{tag:s[2],from:t(o,a),to:t(e.line,e.ch)}}else r.push(s[2])}}function p(e,i){for(var r=[];;){var n=d(e);if(!n)return;if("selfClose"!=n){var s=e.line,o=e.ch,a=u(e);if(!a)return;if(a[1])r.push(a[2]);else{for(var l=r.length-1;l>=0;--l)if(r[l]==a[2]){r.length=l;break}if(l<0&&(!i||i==a[2]))return{tag:a[2],from:t(e.line,e.ch),to:t(s,o)}}}else u(e)}}e.registerHelper("fold","xml",(function(e,r){for(var n=new s(e,r.line,0);;){var o=h(n);if(!o||n.line!=r.line)return;var a=c(n);if(!a)return;if(!o[1]&&"selfClose"!=a){var l=t(n.line,n.ch),u=f(n,o[2]);return u&&i(u.from,l)>0?{from:l,to:u.from}:null}}})),e.findMatchingTag=function(e,r,n){var o=new s(e,r.line,r.ch,n);if(-1!=o.text.indexOf(">")||-1!=o.text.indexOf("<")){var a=c(o),l=a&&t(o.line,o.ch),h=a&&u(o);if(a&&h&&!(i(o,r)>0)){var d={from:t(o.line,o.ch),to:l,tag:h[2]};return"selfClose"==a?{open:d,close:null,at:"open"}:h[1]?{open:p(o,h[2]),close:d,at:"close"}:{open:d,close:f(o=new s(e,l.line,l.ch,n),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,i,r){for(var n=new s(e,t.line,t.ch,i);;){var o=p(n,r);if(!o)break;var a=f(new s(e,t.line,t.ch,i),o.tag);if(a)return{open:o,close:a}}},e.scanForClosingTag=function(e,t,i,r){return f(new s(e,t.line,t.ch,r?{from:0,to:r}:null),i)}}(i(/*! ../../lib/codemirror */"VrN/"))},p5ED:
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.tsx ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: PreviewAll, default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";i(/*! antd/es/button/style */"+L6B");var r=i(/*! antd/es/button */"2/Rp"),n=(i(/*! antd/es/tooltip/style */"5Dmo"),i(/*! antd/es/tooltip */"3S7+")),s=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),o=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator */"9og8"),a=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator */"WmNS"),c=i.n(l),u=i(/*! react */"q1tI"),h=i.n(u),d=i(/*! ./index.less?modules */"vHTk"),f=i.n(d),p=i(/*! @ant-design/icons */"yEEn"),g=i(/*! @/components/monaco-editor */"ZW9T"),v=i(/*! @/utils/util */"1vsH"),m=i(/*! @/service/exercise */"V0Rq"),y=i(/*! @/utils/env */"m3rI");t.a=function(e){e.name;var t=e.data,i=(e.theme,e.type),l=e.filename,d=e.monacoEditor,_=e.className,b=e.style,S=e.close,C=e.onClose,w=e.hasMask,k=e.otherData,x=void 0===k?{}:k,E=Object(u.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),T=Object(a.a)(E,2),L=(T[0],T[1],Object(u.useState)("")),A=Object(a.a)(L,2),R=(A[0],A[1]),D=Object(u.useState)(),O=Object(a.a)(D,2),M=O[0],I=O[1],P="build"===window.ENV?"/react/build/office.html":"/office.html",F=Object(u.useRef)();"office"===i&&Object(v.P)(t).filesize>10485760&&(i="other"),l&&(d.filename=l),Object(u.useEffect)((function(){var e,t,i=null===(e=document.cookie)||void 0===e||null===(t=e.replace(/\s/g,""))||void 0===t?void 0:t.split(";");null==i||i.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&R(t[1])}))}),[]),Object(u.useEffect)((function(){"office"===i&&B()}),[i]);var B=function(){var e=Object(o.a)(c.a.mark((function e(){var i,r,n;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",t),i=t,t.startsWith("http")||(i=location.origin+i),r=new URL(i).pathname.split("/").pop(),e.next=6,Object(m.U)({attachment_id:r});case 6:n=e.sent,I(n);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(){t.startsWith("http")||t.startsWith("blob:")?H():Object(v.x)(l||"educoder",t,l)},H=function(){Object(v.v)(l||"educoder",decodeURIComponent(t))};return h.a.createElement("div",{style:Object(s.a)({},b||{}),className:"".concat(w&&f.a.bgBlack," ").concat(i?f.a.wrp:"hide")},S&&h.a.createElement("div",{className:f.a.close,ref:F},h.a.createElement(n.a,{title:"点击下载此文件",getPopupContainer:function(){return F.current}},h.a.createElement("span",{onClick:H},h.a.createElement("i",{className:"icon-quxiaozhiding"}))),h.a.createElement(n.a,{title:"关闭",getPopupContainer:function(){return F.current}},h.a.createElement("span",{className:"",onClick:function(){C(),I(null)}},h.a.createElement("i",{className:"icon-guanbi1"})))),h.a.createElement("div",{className:"".concat(f.a[_]," ").concat(_," ").concat(f.a.monaco," ").concat("txt"===i?"show":"hide")},"txt"===i&&h.a.createElement(g.b,d)),"audio"===i&&h.a.createElement("audio",{src:"".concat((null==t?void 0:t.indexOf("http://"))>-1||(null==t?void 0:t.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(t),autoPlay:!0}),"video"===i&&h.a.createElement(h.a.Fragment,null,(null==t?void 0:t.indexOf("/api"))>-1?h.a.createElement("video",{controls:!0,src:"".concat(t),autoPlay:!0}):h.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(t),autoPlay:!0})),"office"===i&&M&&h.a.createElement("iframe",{src:"".concat(P,"?key=").concat(M.key,"&url=").concat(y.a.API_SERVER+M.url,"&callbackUrl=").concat(y.a.API_SERVER+M.callbackUrl,"&fileType=").concat(M.fileType,"&title=").concat(M.title,"&model=view")}),("xlsx"===i||"doc"===i||"pptx"===i||"docx"===i)&&h.a.createElement("iframe",{src:"".concat(P,"?key=").concat(x.key,"&url=").concat(y.a.API_SERVER+x.url,"&callbackUrl=").concat(y.a.API_SERVER+x.callbackUrl,"&fileType=").concat(x.fileType,"&title=").concat(x.title,"&model=").concat(x.model)}),"html"===i&&h.a.createElement("iframe",{src:t+"&disposition=inline"}),"pdf"===i&&h.a.createElement("embed",{className:f.a.embed,src:t,type:"application/pdf"}),"image"===i&&h.a.createElement("img",{src:"".concat((null==t?void 0:t.indexOf("http://"))>-1||(null==t?void 0:t.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(t)}),"other"===i&&h.a.createElement("div",null,h.a.createElement(r.a,{type:"primary",size:"large",onClick:N},h.a.createElement(p.a,null),"点击下载")),"download"===i&&h.a.createElement(r.a,{type:"primary",size:"large",onClick:N},h.a.createElement(p.a,null),"点击下载"))}},"p77/":
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./node_modules/codemirror/lib/codemirror.css ***!
|
|
|
\****************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},q7KB:
|
|
|
/*!******************************************!*\
|
|
|
!*** ./node_modules/xterm/css/xterm.css ***!
|
|
|
\******************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){},"rAM+":
|
|
|
/*!*******************************************************************************************************************!*\
|
|
|
!*** ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js ***!
|
|
|
\*******************************************************************************************************************/
|
|
|
/*! exports provided: default */
|
|
|
/*! exports used: default */function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));var r=i(/*! @babel/runtime/helpers/esm/unsupportedIterableToArray */"Qw5x");function n(e,t){var i;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(i=Object(r.a)(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,s=function(){};return{s:s,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){l=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(l)throw o}}}}},rUJ1:
|
|
|
/*!********************************************!*\
|
|
|
!*** ./node_modules/marked/src/helpers.js ***!
|
|
|
\********************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: escape */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t){const i=/[&<>"']/,r=/[&<>"']/g,n=/[<>"']|&(?!#?\w+;)/,s=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},a=e=>o[e];const l=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function c(e){return e.replace(l,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}const u=/(^|[^\[])\^/g;const h=/[^\w:]/g,d=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;const f={},p=/^[^:]+:\/*[^/]*$/,g=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function m(e,t){f[" "+e]||(p.test(e)?f[" "+e]=e+"/":f[" "+e]=y(e,"/",!0));const i=-1===(e=f[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(g,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(v,"$1")+t:e+t}function y(e,t,i){const r=e.length;if(0===r)return"";let n=0;for(;n<r;){const s=e.charAt(r-n-1);if(s!==t||i){if(s===t||!i)break;n++}else n++}return e.substr(0,r-n)}e.exports={escape:function(e,t){if(t){if(i.test(e))return e.replace(r,a)}else if(n.test(e))return e.replace(s,a);return e},unescape:c,edit:function(e,t){e=e.source||e,t=t||"";const i={replace:(t,r)=>(r=(r=r.source||r).replace(u,"$1"),e=e.replace(t,r),i),getRegex:()=>new RegExp(e,t)};return i},cleanUrl:function(e,t,i){if(e){let e;try{e=decodeURIComponent(c(i)).replace(h,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!d.test(i)&&(i=m(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i},resolveUrl:m,noopTest:{exec:function(){}},merge:function(e){let t,i,r=1;for(;r<arguments.length;r++)for(i in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},splitCells:function(e,t){const i=e.replace(/\|/g,(e,t,i)=>{let r=!1,n=t;for(;--n>=0&&"\\"===i[n];)r=!r;return r?"|":" |"}).split(/ \|/);let r=0;if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i},rtrim:y,findClosingBracket:function(e,t){if(-1===e.indexOf(t[1]))return-1;const i=e.length;let r=0,n=0;for(;n<i;n++)if("\\"===e[n])n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return-1},checkSanitizeDeprecation:function(e){e&&e.sanitize&&!e.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")}}},rwxt:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/cursor.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i(/*! ./browser.js */"GdRQ");function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=!r.supportsCursorURIs||r.isTouchDevice,o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._target=null,this._canvas=document.createElement("canvas"),s&&(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)}}var t,i,r;return t=e,(i=[{key:"attach",value:function(e){if(this._target&&this.detach(),this._target=e,s){document.body.appendChild(this._canvas);var t={capture:!0,passive:!0};this._target.addEventListener("mouseover",this._eventHandlers.mouseover,t),this._target.addEventListener("mouseleave",this._eventHandlers.mouseleave,t),this._target.addEventListener("mousemove",this._eventHandlers.mousemove,t),this._target.addEventListener("mouseup",this._eventHandlers.mouseup,t)}this.clear()}},{key:"detach",value:function(){if(this._target){if(s){var e={capture:!0,passive:!0};this._target.removeEventListener("mouseover",this._eventHandlers.mouseover,e),this._target.removeEventListener("mouseleave",this._eventHandlers.mouseleave,e),this._target.removeEventListener("mousemove",this._eventHandlers.mousemove,e),this._target.removeEventListener("mouseup",this._eventHandlers.mouseup,e),document.body.removeChild(this._canvas)}this._target=null}}},{key:"change",value:function(e,t,i,r,n){if(0!==r&&0!==n){this._position.x=this._position.x+this._hotSpot.x-t,this._position.y=this._position.y+this._hotSpot.y-i,this._hotSpot.x=t,this._hotSpot.y=i;var o,a=this._canvas.getContext("2d");this._canvas.width=r,this._canvas.height=n;try{o=new ImageData(new Uint8ClampedArray(e),r,n)}catch(t){(o=a.createImageData(r,n)).data.set(new Uint8ClampedArray(e))}if(a.clearRect(0,0,r,n),a.putImageData(o,0,0),s)this._updatePosition();else{var l=this._canvas.toDataURL();this._target.style.cursor="url("+l+")"+t+" "+i+", default"}}else this.clear()}},{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(e,t){if(s){window.visualViewport?(this._position.x=e+window.visualViewport.offsetLeft,this._position.y=t+window.visualViewport.offsetTop):(this._position.x=e,this._position.y=t),this._updatePosition();var i=document.elementFromPoint(e,t);this._updateVisibility(i)}}},{key:"_handleMouseOver",value:function(e){this._handleMouseMove(e)}},{key:"_handleMouseLeave",value:function(e){this._updateVisibility(e.relatedTarget)}},{key:"_handleMouseMove",value:function(e){this._updateVisibility(e.target),this._position.x=e.clientX-this._hotSpot.x,this._position.y=e.clientY-this._hotSpot.y,this._updatePosition()}},{key:"_handleMouseUp",value:function(e){var t=this,i=document.elementFromPoint(e.clientX,e.clientY);this._updateVisibility(i),this._captureIsActive()&&window.setTimeout((function(){t._target&&(i=document.elementFromPoint(e.clientX,e.clientY),t._updateVisibility(i))}),0)}},{key:"_showCursor",value:function(){"hidden"===this._canvas.style.visibility&&(this._canvas.style.visibility="")}},{key:"_hideCursor",value:function(){"hidden"!==this._canvas.style.visibility&&(this._canvas.style.visibility="hidden")}},{key:"_shouldShowCursor",value:function(e){return!!e&&(e===this._target||!!this._target.contains(e)&&"none"===window.getComputedStyle(e).cursor)}},{key:"_updateVisibility",value:function(e){this._captureIsActive()&&(e=document.captureElement),this._shouldShowCursor(e)?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)}}])&&n(t.prototype,i),r&&n(t,r),e}();t.default=o},sjKO:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inffast.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var i,r,n,s,o,a,l,c,u,h,d,f,p,g,v,m,y,_,b,S,C,w,k,x,E;i=e.state,r=e.next_in,x=e.input,n=r+(e.avail_in-5),s=e.next_out,E=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),l=i.dmax,c=i.wsize,u=i.whave,h=i.wnext,d=i.window,f=i.hold,p=i.bits,g=i.lencode,v=i.distcode,m=(1<<i.lenbits)-1,y=(1<<i.distbits)-1;e:do{p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),_=g[f&m];t:for(;;){if(f>>>=b=_>>>24,p-=b,0===(b=_>>>16&255))E[s++]=65535&_;else{if(!(16&b)){if(0==(64&b)){_=g[(65535&_)+(f&(1<<b)-1)];continue t}if(32&b){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}S=65535&_,(b&=15)&&(p<b&&(f+=x[r++]<<p,p+=8),S+=f&(1<<b)-1,f>>>=b,p-=b),p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),_=v[f&y];i:for(;;){if(f>>>=b=_>>>24,p-=b,!(16&(b=_>>>16&255))){if(0==(64&b)){_=v[(65535&_)+(f&(1<<b)-1)];continue i}e.msg="invalid distance code",i.mode=30;break e}if(C=65535&_,p<(b&=15)&&(f+=x[r++]<<p,(p+=8)<b&&(f+=x[r++]<<p,p+=8)),(C+=f&(1<<b)-1)>l){e.msg="invalid distance too far back",i.mode=30;break e}if(f>>>=b,p-=b,C>(b=s-o)){if((b=C-b)>u&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(w=0,k=d,0===h){if(w+=c-b,b<S){S-=b;do{E[s++]=d[w++]}while(--b);w=s-C,k=E}}else if(h<b){if(w+=c+h-b,(b-=h)<S){S-=b;do{E[s++]=d[w++]}while(--b);if(w=0,h<S){S-=b=h;do{E[s++]=d[w++]}while(--b);w=s-C,k=E}}}else if(w+=h-b,b<S){S-=b;do{E[s++]=d[w++]}while(--b);w=s-C,k=E}for(;S>2;)E[s++]=k[w++],E[s++]=k[w++],E[s++]=k[w++],S-=3;S&&(E[s++]=k[w++],S>1&&(E[s++]=k[w++]))}else{w=s-C;do{E[s++]=E[w++],E[s++]=E[w++],E[s++]=E[w++],S-=3}while(S>2);S&&(E[s++]=E[w++],S>1&&(E[s++]=E[w++]))}break}}break}}while(r<n&&s<a);return r-=S=p>>3,f&=(1<<(p-=S<<3))-1,e.next_in=r,e.next_out=s,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=s<a?a-s+257:257-(s-a),i.hold=f,void(i.bits=p)}},ulZh:
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./node_modules/hls.js/dist/hls.js ***!
|
|
|
\*****************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){var r;"undefined"!=typeof window&&(r=function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./node_modules/eventemitter3/index.js ***!
|
|
|
\*********************************************/
|
|
|
/*! no static exports found */function(e,t,i){"use strict";var r=Object.prototype.hasOwnProperty,n="~";function s(){}function o(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function a(e,t,i,r,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,r||e,s),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function l(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function c(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(n=!1)),c.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)r.call(e,t)&&i.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},c.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,o=new Array(s);r<s;r++)o[r]=i[r].fn;return o},c.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},c.prototype.emit=function(e,t,i,r,s,o){var a=n?n+e:e;if(!this._events[a])return!1;var l,c,u=this._events[a],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,r),!0;case 5:return u.fn.call(u.context,t,i,r,s),!0;case 6:return u.fn.call(u.context,t,i,r,s,o),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var d,f=u.length;for(c=0;c<f;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,r);break;default:if(!l)for(d=1,l=new Array(h-1);d<h;d++)l[d-1]=arguments[d];u[c].fn.apply(u[c].context,l)}}return!0},c.prototype.on=function(e,t,i){return a(this,e,t,i,!1)},c.prototype.once=function(e,t,i){return a(this,e,t,i,!0)},c.prototype.removeListener=function(e,t,i,r){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return l(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||r&&!o.once||i&&o.context!==i||l(this,s);else{for(var a=0,c=[],u=o.length;a<u;a++)(o[a].fn!==t||r&&!o[a].once||i&&o[a].context!==i)&&c.push(o[a]);c.length?this._events[s]=1===c.length?c[0]:c:l(this,s)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&l(this,t)):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c},"./node_modules/url-toolkit/src/url-toolkit.js":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./node_modules/url-toolkit/src/url-toolkit.js ***!
|
|
|
\*****************************************************/
|
|
|
/*! no static exports found */function(e,t,i){var r,n,s,o,a;r=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,s=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=a.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=a.normalizePath(r.path),a.buildURLFromParts(r)}var s=a.parseURL(t);if(!s)throw new Error("Error trying to parse relative URL.");if(s.scheme)return i.alwaysNormalize?(s.path=a.normalizePath(s.path),a.buildURLFromParts(s)):t;var o=a.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var l=n.exec(o.path);o.netLoc=l[1],o.path=l[2]}o.netLoc&&!o.path&&(o.path="/");var c={scheme:o.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc&&(c.netLoc=o.netLoc,"/"!==s.path[0]))if(s.path){var u=o.path,h=u.substring(0,u.lastIndexOf("/")+1)+s.path;c.path=a.normalizePath(h)}else c.path=o.path,s.params||(c.params=o.params,s.query||(c.query=o.query));return null===c.path&&(c.path=i.alwaysNormalize?a.normalizePath(s.path):s.path),a.buildURLFromParts(c)},parseURL:function(e){var t=r.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(s,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=a},"./node_modules/webworkify-webpack/index.js":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./node_modules/webworkify-webpack/index.js ***!
|
|
|
\**************************************************/
|
|
|
/*! no static exports found */function(e,t,i){function r(e){var t={};function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.i=function(e){return e},i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},i.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var r=i(i.s=ENTRY_MODULE);return r.default||r}function n(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,r){var s={};s[r]=[];var o=t.toString(),a=o.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!a)return s;for(var l,c=a[1],u=new RegExp("(\\\\n|\\W)"+n(c)+"\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)","g");l=u.exec(o);)"dll-reference"!==l[3]&&s[r].push(l[3]);for(u=new RegExp("\\("+n(c)+'\\("(dll-reference\\s([\\.|\\-|\\+|\\w|/|@]+))"\\)\\)\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)',"g");l=u.exec(o);)e[l[2]]||(s[r].push(l[1]),e[l[2]]=i(l[1]).m),s[l[2]]=s[l[2]]||[],s[l[2]].push(l[4]);for(var h,d=Object.keys(s),f=0;f<d.length;f++)for(var p=0;p<s[d[f]].length;p++)h=s[d[f]][p],isNaN(1*h)||(s[d[f]][p]=1*s[d[f]][p]);return s}function o(e){return Object.keys(e).reduce((function(t,i){return t||e[i].length>0}),!1)}e.exports=function(e,t){t=t||{};var n={main:i.m},a=t.all?{main:Object.keys(n.main)}:function(e,t){for(var i={main:[t]},r={main:[]},n={main:{}};o(i);)for(var a=Object.keys(i),l=0;l<a.length;l++){var c=a[l],u=i[c].pop();if(n[c]=n[c]||{},!n[c][u]&&e[c][u]){n[c][u]=!0,r[c]=r[c]||[],r[c].push(u);for(var h=s(e,e[c][u],c),d=Object.keys(h),f=0;f<d.length;f++)i[d[f]]=i[d[f]]||[],i[d[f]]=i[d[f]].concat(h[d[f]])}}return r}(n,e),l="";Object.keys(a).filter((function(e){return"main"!==e})).forEach((function(e){for(var t=0;a[e][t];)t++;a[e].push(t),n[e][t]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+e+" = ("+r.toString().replace("ENTRY_MODULE",JSON.stringify(t))+")({"+a[e].map((function(t){return JSON.stringify(t)+": "+n[e][t].toString()})).join(",")+"});\n"})),l=l+"new (("+r.toString().replace("ENTRY_MODULE",JSON.stringify(e))+")({"+a.main.map((function(e){return JSON.stringify(e)+": "+n.main[e].toString()})).join(",")+"}))(self);";var c=new window.Blob([l],{type:"text/javascript"});if(t.bare)return c;var u=(window.URL||window.webkitURL||window.mozURL||window.msURL).createObjectURL(c),h=new window.Worker(u);return h.objectURL=u,h}},"./src/config.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/config.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: hlsDefaultConfig, mergeConfig, enableStreamingMode */function(e,t,i){"use strict";i.r(t),i.d(t,"hlsDefaultConfig",(function(){return w})),i.d(t,"mergeConfig",(function(){return k})),i.d(t,"enableStreamingMode",(function(){return x}));var r=i(/*! ./controller/abr-controller */"./src/controller/abr-controller.ts"),n=i(/*! ./controller/audio-stream-controller */"./src/controller/audio-stream-controller.ts"),s=i(/*! ./controller/audio-track-controller */"./src/controller/audio-track-controller.ts"),o=i(/*! ./controller/subtitle-stream-controller */"./src/controller/subtitle-stream-controller.ts"),a=i(/*! ./controller/subtitle-track-controller */"./src/controller/subtitle-track-controller.ts"),l=i(/*! ./controller/buffer-controller */"./src/controller/buffer-controller.ts"),c=i(/*! ./controller/timeline-controller */"./src/controller/timeline-controller.ts"),u=i(/*! ./controller/cap-level-controller */"./src/controller/cap-level-controller.ts"),h=i(/*! ./controller/fps-controller */"./src/controller/fps-controller.ts"),d=i(/*! ./controller/eme-controller */"./src/controller/eme-controller.ts"),f=i(/*! ./controller/cmcd-controller */"./src/controller/cmcd-controller.ts"),p=i(/*! ./utils/xhr-loader */"./src/utils/xhr-loader.ts"),g=i(/*! ./utils/fetch-loader */"./src/utils/fetch-loader.ts"),v=i(/*! ./utils/cues */"./src/utils/cues.ts"),m=i(/*! ./utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts"),y=i(/*! ./utils/logger */"./src/utils/logger.ts");function _(){return(_=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function b(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function S(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?b(Object(i),!0).forEach((function(t){C(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):b(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function C(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var w=S(S({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,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:p.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:r.default,bufferController:l.default,capLevelController:u.default,fpsController:h.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:m.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},{cueHandler:v.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}),{},{subtitleStreamController:o.SubtitleStreamController,subtitleTrackController:a.default,timelineController:c.TimelineController,audioStreamController:n.default,audioTrackController:s.default,emeController:d.default,cmcdController:f.default});function k(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return _({},e,t)}function x(e){var t=e.loader;t!==g.default&&t!==p.default?(y.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):Object(g.fetchSupported)()&&(e.loader=g.default,e.progressive=!0,e.enableSoftwareAES=!0,y.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}},"./src/controller/abr-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/abr-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../utils/ewma-bandwidth-estimator */"./src/utils/ewma-bandwidth-estimator.ts"),s=i(/*! ../events */"./src/events.ts"),o=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=i(/*! ../errors */"./src/errors.ts"),l=i(/*! ../types/loader */"./src/types/loader.ts"),c=i(/*! ../utils/logger */"./src/utils/logger.ts");function u(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h=function(){function e(e){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=e;var t=e.config;this.bwEstimator=new n.default(t.abrEwmaSlowVoD,t.abrEwmaFastVoD,t.abrEwmaDefaultEstimate),this.registerListeners()}var t,i,h,d=e.prototype;return d.registerListeners=function(){var e=this.hls;e.on(s.Events.FRAG_LOADING,this.onFragLoading,this),e.on(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(s.Events.FRAG_LOADING,this.onFragLoading,this),e.off(s.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},d.onFragLoading=function(e,t){var i,r=t.frag;r.type===l.PlaylistLevelType.MAIN&&(this.timer||(this.fragCurrent=r,this.partCurrent=null!=(i=t.part)?i:null,this.timer=self.setInterval(this.onCheck,100)))},d.onLevelLoaded=function(e,t){var i=this.hls.config;t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},d._abandonRulesCheck=function(){var e=this.fragCurrent,t=this.partCurrent,i=this.hls,n=i.autoLevelEnabled,a=i.config,l=i.media;if(e&&l){var u=t?t.stats:e.stats,h=t?t.duration:e.duration;if(u.aborted)return c.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),void(this._nextAutoLevel=-1);if(n&&!l.paused&&l.playbackRate&&l.readyState){var d=performance.now()-u.loading.start,f=Math.abs(l.playbackRate);if(!(d<=500*h/f)){var p=i.levels,g=i.minAutoLevel,v=p[e.level],m=u.total||Math.max(u.loaded,Math.round(h*v.maxBitrate/8)),y=Math.max(1,u.bwEstimate?u.bwEstimate/8:1e3*u.loaded/d),_=(m-u.loaded)/y,b=l.currentTime,S=(o.BufferHelper.bufferInfo(l,b,a.maxBufferHole).end-b)/f;if(!(S>=2*h/f||_<=S)){var C,w=Number.POSITIVE_INFINITY;for(C=e.level-1;C>g&&!((w=h*p[C].maxBitrate/(6.4*y))<S);C--);if(!(w>=_)){var k=this.bwEstimator.getEstimate();c.logger.warn("Fragment "+e.sn+(t?" part "+t.index:"")+" of level "+e.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+C+"\n Current BW estimate: "+(Object(r.isFiniteNumber)(k)?(k/1024).toFixed(3):"Unknown")+" Kb/s\n Estimated load time for current fragment: "+_.toFixed(3)+" s\n Estimated load time for the next fragment: "+w.toFixed(3)+" s\n Time to underbuffer: "+S.toFixed(3)+" s"),i.nextLoadLevel=C,this.bwEstimator.sample(d,u.loaded),this.clearTimer(),e.loader&&(this.fragCurrent=this.partCurrent=null,e.loader.abort()),i.trigger(s.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:u})}}}}}},d.onFragLoaded=function(e,t){var i=t.frag,n=t.part;if(i.type===l.PlaylistLevelType.MAIN&&Object(r.isFiniteNumber)(i.sn)){var o=n?n.stats:i.stats,a=n?n.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var c=this.hls.levels[i.level],u=(c.loaded?c.loaded.bytes:0)+o.loaded,h=(c.loaded?c.loaded.duration:0)+a;c.loaded={bytes:u,duration:h},c.realBitrate=Math.round(8*u/h)}if(i.bitrateTest){var d={stats:o,frag:i,part:n,id:i.type};this.onFragBuffered(s.Events.FRAG_BUFFERED,d),i.bitrateTest=!1}}},d.onFragBuffered=function(e,t){var i=t.frag,r=t.part,n=r?r.stats:i.stats;if(!n.aborted&&i.type===l.PlaylistLevelType.MAIN&&"initSegment"!==i.sn){var s=n.parsing.end-n.loading.start;this.bwEstimator.sample(s,n.loaded),n.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=s/1e3:this.bitrateTestDelay=0}},d.onError=function(e,t){switch(t.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}},d.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},d.getNextABRAutoLevel=function(){var e=this.fragCurrent,t=this.partCurrent,i=this.hls,r=i.maxAutoLevel,n=i.config,s=i.minAutoLevel,a=i.media,l=t?t.duration:e?e.duration:0,u=a?a.currentTime:0,h=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,d=this.bwEstimator?this.bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,f=(o.BufferHelper.bufferInfo(a,u,n.maxBufferHole).end-u)/h,p=this.findBestLevel(d,s,r,f,n.abrBandWidthFactor,n.abrBandWidthUpFactor);if(p>=0)return p;c.logger.trace((f?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var g=l?Math.min(l,n.maxStarvationDelay):n.maxStarvationDelay,v=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(!f){var y=this.bitrateTestDelay;y&&(g=(l?Math.min(l,n.maxLoadingDelay):n.maxLoadingDelay)-y,c.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*g)+" ms"),v=m=1)}return p=this.findBestLevel(d,s,r,f+g,v,m),Math.max(p,0)},d.findBestLevel=function(e,t,i,r,n,s){for(var o,a=this.fragCurrent,l=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,d=h[u],f=!(null==d||null===(o=d.details)||void 0===o||!o.live),p=null==d?void 0:d.codecSet,g=l?l.duration:a?a.duration:0,v=i;v>=t;v--){var m=h[v];if(m&&(!p||m.codecSet===p)){var y=m.details,_=(l?null==y?void 0:y.partTarget:null==y?void 0:y.averagetargetduration)||g,b=void 0;b=v<=u?n*e:s*e;var S=h[v].maxBitrate,C=S*_/b;if(c.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+v+"/"+Math.round(b)+"/"+S+"/"+_+"/"+r+"/"+C),b>S&&(!C||f&&!this.bitrateTestDelay||C<r))return v}}return-1},t=e,(i=[{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this.bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var i=this.getNextABRAutoLevel();return-1!==e&&(i=Math.min(e,i)),i},set:function(e){this._nextAutoLevel=e}}])&&u(t.prototype,i),h&&u(t,h),e}();t.default=h},"./src/controller/audio-stream-controller.ts":
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./src/controller/audio-stream-controller.ts ***!
|
|
|
\***************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),s=i(/*! ../events */"./src/events.ts"),o=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=i(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),l=i(/*! ../types/level */"./src/types/level.ts"),c=i(/*! ../types/loader */"./src/types/loader.ts"),u=i(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=i(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts"),d=i(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),f=i(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),p=i(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),g=i(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),v=i(/*! ../errors */"./src/errors.ts"),m=i(/*! ../utils/logger */"./src/utils/logger.ts");function y(){return(y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function _(e,t){return(_=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(e){var t,i;function b(t,i){var r;return(r=e.call(this,t,i,"[audio-stream-controller]")||this).videoBuffer=null,r.videoTrackCC=-1,r.waitingVideoCC=-1,r.audioSwitch=!1,r.trackId=-1,r.waitingData=null,r.mainDetails=null,r.bufferFlushed=!1,r._registerListeners(),r}i=e,(t=b).prototype=Object.create(i.prototype),t.prototype.constructor=t,_(t,i);var S=b.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var e=this.hls;e.on(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(s.Events.ERROR,this.onError,this),e.on(s.Events.BUFFER_RESET,this.onBufferReset,this),e.on(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S._unregisterListeners=function(){var e=this.hls;e.off(s.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(s.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(s.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(s.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(s.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(s.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(s.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(s.Events.ERROR,this.onError,this),e.off(s.Events.BUFFER_RESET,this.onBufferReset,this),e.off(s.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(s.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(s.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(s.Events.FRAG_BUFFERED,this.onFragBuffered,this)},S.onInitPtsFound=function(e,t){var i=t.frag,r=t.id,s=t.initPTS;if("main"===r){var o=i.cc;this.initPTS[i.cc]=s,this.log("InitPTS for cc: "+o+" found from main: "+s),this.videoTrackCC=o,this.state===n.State.WAITING_INIT_PTS&&this.tick()}},S.startLoad=function(e){if(!this.levels)return this.startPosition=e,void(this.state=n.State.STOPPED);var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),this.fragLoadError=0,t>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),this.state=n.State.IDLE):(this.loadedmetadata=!1,this.state=n.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()},S.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_TRACK:var t,i=this.levels,r=this.trackId,s=null==i||null===(t=i[r])||void 0===t?void 0:t.details;if(s){if(this.waitForCdnTuneIn(s))break;this.state=n.State.WAITING_INIT_PTS}break;case n.State.FRAG_LOADING_WAITING_RETRY:var a,l=performance.now(),c=this.retryDate;(!c||l>=c||null!==(a=this.media)&&void 0!==a&&a.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=n.State.IDLE);break;case n.State.WAITING_INIT_PTS:var u=this.waitingData;if(u){var h=u.frag,d=u.part,f=u.cache,g=u.complete;if(void 0!==this.initPTS[h.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.FRAG_LOADING;var v={frag:h,part:d,payload:f.flush(),networkDetails:null};this._handleFragmentLoadProgress(v),g&&e.prototype._handleFragmentLoadComplete.call(this,v)}else if(this.videoTrackCC!==this.waitingVideoCC)m.logger.log("Waiting fragment cc ("+h.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var y=this.getLoadPosition(),_=o.BufferHelper.bufferInfo(this.mediaBuffer,y,this.config.maxBufferHole);Object(p.fragmentWithinToleranceTest)(_.end,this.config.maxFragLookUpTolerance,h)<0&&(m.logger.log("Waiting fragment cc ("+h.cc+") @ "+h.start+" cancelled because another fragment at "+_.end+" is needed"),this.clearWaitingFragment())}}else this.state=n.State.IDLE}this.onTickEnd()},S.clearWaitingFragment=function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=n.State.IDLE)},S.onTickEnd=function(){var e=this.media;if(e&&e.readyState){var t=(this.mediaBuffer?this.mediaBuffer:e).buffered;!this.loadedmetadata&&t.length&&(this.loadedmetadata=!0),this.lastCurrentTime=e.currentTime}},S.doTickIdle=function(){var e,t,i=this.hls,r=this.levels,o=this.media,a=this.trackId,l=i.config;if(r&&r[a]&&(o||!this.startFragRequested&&l.startFragPrefetch)){var h=r[a].details;if(!h||h.live&&this.levelLastLoaded!==a||this.waitForCdnTuneIn(h))this.state=n.State.WAITING_TRACK;else{this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,u.ElementaryStreamTypes.AUDIO,c.PlaylistLevelType.AUDIO));var d=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,c.PlaylistLevelType.AUDIO);if(null!==d){var f=d.len,p=this.getMaxBufferLength(),g=this.audioSwitch;if(!(f>=p)||g){if(!g&&this._streamEnded(d,h))return i.trigger(s.Events.BUFFER_EOS,{type:"audio"}),void(this.state=n.State.ENDED);var v=h.fragments[0].start,m=d.end;if(g){var y=this.getLoadPosition();m=y,h.PTSKnown&&y<v&&(d.end>v||d.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=v+.05)}var _=this.getNextFragment(m,h);_?"identity"!==(null===(e=_.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=_.decryptdata)&&void 0!==t&&t.key?this.loadFragment(_,h,m):this.loadKey(_,h):this.bufferFlushed=!0}}}}},S.getMaxBufferLength=function(){var t=e.prototype.getMaxBufferLength.call(this),i=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,c.PlaylistLevelType.MAIN);return null===i?t:Math.max(t,i.len)},S.onMediaDetaching=function(){this.videoBuffer=null,e.prototype.onMediaDetaching.call(this)},S.onAudioTracksUpdated=function(e,t){var i=t.audioTracks;this.resetTransmuxer(),this.levels=i.map((function(e){return new l.Level(e)}))},S.onAudioTrackSwitching=function(e,t){var i=!!t.url;this.trackId=t.id;var r=this.fragCurrent;null!=r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.audioSwitch=!0,this.state=n.State.IDLE):this.state=n.State.STOPPED,this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},S.onLevelLoaded=function(e,t){this.mainDetails=t.details},S.onAudioTrackLoaded=function(e,t){var i,r=this.levels,s=t.details,o=t.id;if(r){this.log("Track "+o+" loaded ["+s.startSN+","+s.endSN+"],duration:"+s.totalduration);var a=r[o],l=0;if(s.live||null!==(i=a.details)&&void 0!==i&&i.live){var c=this.mainDetails;if(s.fragments[0]||(s.deltaUpdateFailed=!0),s.deltaUpdateFailed||!c)return;!a.details&&s.hasProgramDateTime&&c.hasProgramDateTime?(Object(g.alignMediaPlaylistByPDT)(s,c),l=s.fragments[0].start):l=this.alignPlaylists(s,a.details)}a.details=s,this.levelLastLoaded=o,this.startFragRequested||!this.mainDetails&&s.live||this.setStartPosition(a.details,l),this.state!==n.State.WAITING_TRACK||this.waitForCdnTuneIn(s)||(this.state=n.State.IDLE),this.tick()}else this.warn("Audio tracks were reset while loading level "+o)},S._handleFragmentLoadProgress=function(e){var t,i=e.frag,r=e.part,s=e.payload,o=this.config,a=this.trackId,l=this.levels;if(l){var u=l[a];console.assert(u,"Audio track is defined on fragment load progress");var p=u.details;console.assert(p,"Audio track details are defined on fragment load progress");var g=o.defaultAudioCodec||u.audioCodec||"mp4a.40.2",v=this.transmuxer;v||(v=this.transmuxer=new d.default(this.hls,c.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var y=this.initPTS[i.cc],_=null===(t=i.initSegment)||void 0===t?void 0:t.data;if(void 0!==y){var b=r?r.index:-1,S=-1!==b,C=new f.ChunkMetadata(i.level,i.sn,i.stats.chunkCount,s.byteLength,b,S);v.push(s,_,g,"",i,r,p.totalduration,!1,C,y)}else m.logger.log("Unknown video PTS for cc "+i.cc+", waiting for video PTS before demuxing audio frag "+i.sn+" of ["+p.startSN+" ,"+p.endSN+"],track "+a),(this.waitingData=this.waitingData||{frag:i,part:r,cache:new h.default,complete:!1}).cache.push(new Uint8Array(s)),this.waitingVideoCC=this.videoTrackCC,this.state=n.State.WAITING_INIT_PTS}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},S._handleFragmentLoadComplete=function(t){this.waitingData?this.waitingData.complete=!0:e.prototype._handleFragmentLoadComplete.call(this,t)},S.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},S.onBufferCreated=function(e,t){var i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer)},S.onFragBuffered=function(e,t){var i=t.frag,r=t.part;i.type===c.PlaylistLevelType.AUDIO&&(this.fragContextChanged(i)?this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch):("initSegment"!==i.sn&&(this.fragPrevious=i,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(i,r)))},S.onError=function(t,i){switch(i.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.AUDIO,i);break;case v.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case v.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==n.State.ERROR&&this.state!==n.State.STOPPED&&(this.state=i.fatal?n.State.ERROR:n.State.IDLE,this.warn(i.details+" while loading frag, switching to "+this.state+" state"));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if("audio"===i.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var r=!0,s=this.getFwdBufferInfo(this.mediaBuffer,c.PlaylistLevelType.AUDIO);s&&s.len>.5&&(r=!this.reduceMaxBufferLength(s.len)),r&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}}},S.onBufferFlushed=function(e,t){t.type===u.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},S._handleTransmuxComplete=function(e){var t,i="audio",r=this.hls,o=e.remuxResult,a=e.chunkMeta,l=this.getCurrentContext(a);if(!l)return this.warn("The loading context changed while buffering fragment "+a.sn+" of level "+a.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(a.level);var c=l.frag,h=l.part,d=o.audio,f=o.text,p=o.id3,g=o.initSegment;if(!this.fragContextChanged(c)){if(this.state=n.State.PARSING,this.audioSwitch&&d&&this.completeAudioSwitch(),null!=g&&g.tracks&&(this._bufferInitSegment(g.tracks,c,a),r.trigger(s.Events.FRAG_PARSING_INIT_SEGMENT,{frag:c,id:i,tracks:g.tracks})),d){var v=d.startPTS,m=d.endPTS,_=d.startDTS,b=d.endDTS;h&&(h.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:v,endPTS:m,startDTS:_,endDTS:b}),c.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,v,m,_,b),this.bufferFragmentData(d,c,h,a)}if(null!=p&&null!==(t=p.samples)&&void 0!==t&&t.length){var S=y({frag:c,id:i},p);r.trigger(s.Events.FRAG_PARSING_METADATA,S)}if(f){var C=y({frag:c,id:i},f);r.trigger(s.Events.FRAG_PARSING_USERDATA,C)}}},S._bufferInitSegment=function(e,t,i){if(this.state===n.State.PARSING){e.video&&delete e.video;var r=e.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:"+r.container+", codecs[parsed]=["+r.codec+"]"),this.hls.trigger(s.Events.BUFFER_CODECS,e);var o=r.initSegment;if(null!=o&&o.byteLength){var a={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:o};this.hls.trigger(s.Events.BUFFER_APPENDING,a)}this.tick()}}},S.loadFragment=function(t,i,s){var o=this.fragmentTracker.getState(t);this.fragCurrent=t,(this.audioSwitch||o===a.FragmentState.NOT_LOADED||o===a.FragmentState.PARTIAL)&&("initSegment"===t.sn?this._loadInitSegment(t):i.live&&!Object(r.isFiniteNumber)(this.initPTS[t.cc])?(this.log("Waiting for video PTS in continuity counter "+t.cc+" of live stream before loading audio fragment "+t.sn+" of level "+this.trackId),this.state=n.State.WAITING_INIT_PTS):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,i,s)))},S.completeAudioSwitch=function(){var t=this.hls,i=this.media,r=this.trackId;i&&(this.log("Switching audio track : flushing all audio"),e.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,t.trigger(s.Events.AUDIO_TRACK_SWITCHED,{id:r})},b}(n.default);t.default=b},"./src/controller/audio-track-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/audio-track-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../errors */"./src/errors.ts"),s=i(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=i(/*! ../types/loader */"./src/types/loader.ts");function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,i;function s(t){var i;return(i=e.call(this,t,"[audio-track-controller]")||this).tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,l(t,i);var c,u,h,d=s.prototype;return d.registerListeners=function(){var e=this.hls;e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(r.Events.ERROR,this.onError,this)},d.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(r.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(r.Events.ERROR,this.onError,this)},d.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,e.prototype.destroy.call(this)},d.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},d.onManifestParsed=function(e,t){this.tracks=t.audioTracks||[]},d.onAudioTrackLoaded=function(e,t){var i=t.id,r=t.details,n=this.tracksInGroup[i];if(n){var s=n.details;n.details=t.details,this.log("audioTrack "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,t,s))}else this.warn("Invalid audio track id "+i)},d.onLevelLoading=function(e,t){this.switchLevel(t.level)},d.onLevelSwitching=function(e,t){this.switchLevel(t.level)},d.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i;var n=this.tracks.filter((function(e){return!i||e.groupId===i}));this.selectDefaultTrack&&!n.some((function(e){return e.default}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=n;var s={audioTracks:n};this.log("Updating audio tracks, "+n.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(r.Events.AUDIO_TRACKS_UPDATED,s),this.selectInitialTrack()}}},d.onError=function(t,i){e.prototype.onError.call(this,t,i),!i.fatal&&i.context&&i.context.type===o.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},d.setAudioTrack=function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var i=t[this.trackId];this.log("Now switching to audio-track index "+e);var n=t[e],s=n.id,o=n.groupId,a=void 0===o?"":o,l=n.name,c=n.type,u=n.url;if(this.trackId=e,this.trackName=l,this.selectDefaultTrack=!1,this.hls.trigger(r.Events.AUDIO_TRACK_SWITCHING,{id:s,groupId:a,name:l,type:c,url:u}),!n.details||n.details.live){var h=this.switchParams(n.url,null==i?void 0:i.details);this.loadPlaylist(h)}}},d.selectInitialTrack=function(){var e=this.tracksInGroup;console.assert(e.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,i=this.findTrackId(t)||this.findTrackId();-1!==i?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},d.findTrackId=function(e){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1},d.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var i=t.id,n=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(r.Events.AUDIO_TRACK_LOADING,{url:s,id:i,groupId:n,deliveryDirectives:e||null})}},c=s,(u=[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}}])&&a(c.prototype,u),h&&a(c,h),s}(s.default);t.default=c},"./src/controller/base-playlist-controller.ts":
|
|
|
/*!****************************************************!*\
|
|
|
!*** ./src/controller/base-playlist-controller.ts ***!
|
|
|
\****************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return l}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../types/level */"./src/types/level.ts"),s=i(/*! ./level-helper */"./src/controller/level-helper.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=i(/*! ../errors */"./src/errors.ts"),l=function(){function e(e,t){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=o.logger.log.bind(o.logger,t+":"),this.warn=o.logger.warn.bind(o.logger,t+":"),this.hls=e}var t=e.prototype;return t.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},t.onError=function(e,t){t.fatal&&t.type===a.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},t.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},t.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},t.stopLoad=function(){this.canLoad=!1,this.clearTimer()},t.switchParams=function(e,t){var i=null==t?void 0:t.renditionReports;if(i)for(var s=0;s<i.length;s++){var o=i[s],a=""+o.URI;if(a===e.substr(-a.length)){var l=parseInt(o["LAST-MSN"]),c=parseInt(o["LAST-PART"]);if(t&&this.hls.config.lowLatencyMode){var u=Math.min(t.age-t.partTarget,t.targetduration);void 0!==c&&u>t.partTarget&&(c+=1)}if(Object(r.isFiniteNumber)(l))return new n.HlsUrlParameters(l,Object(r.isFiniteNumber)(c)?c:void 0,n.HlsSkip.No)}}},t.loadPlaylist=function(e){},t.shouldLoadTrack=function(e){return this.canLoad&&e&&!!e.url&&(!e.details||e.details.live)},t.playlistLoaded=function(e,t,i){var r=this,n=t.details,o=t.stats,a=o.loading.end?Math.max(0,self.performance.now()-o.loading.end):0;if(n.advancedDateTime=Date.now()-a,n.live||null!=i&&i.live){if(n.reloaded(i),i&&this.log("live playlist "+e+" "+(n.advanced?"REFRESHED "+n.lastPartSn+"-"+n.lastPartIndex:"MISSED")),i&&n.fragments.length>0&&Object(s.mergeDetails)(i,n),!this.canLoad||!n.live)return;var l,c=void 0,u=void 0;if(n.canBlockReload&&n.endSN&&n.advanced){var h=this.hls.config.lowLatencyMode,d=n.lastPartSn,f=n.endSN,p=n.lastPartIndex,g=d===f;-1!==p?(c=g?f+1:d,u=g?h?0:p:p+1):c=f+1;var v=n.age,m=v+n.ageHeader,y=Math.min(m-n.partTarget,1.5*n.targetduration);if(y>0){if(i&&y>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+y+" with playlist age: "+n.age),y=0;else{var _=Math.floor(y/n.targetduration);c+=_,void 0!==u&&(u+=Math.round(y%n.targetduration/n.partTarget)),this.log("CDN Tune-in age: "+n.ageHeader+"s last advanced "+v.toFixed(2)+"s goal: "+y+" skip sn "+_+" to part "+u)}n.tuneInGoal=y}if(l=this.getDeliveryDirectives(n,t.deliveryDirectives,c,u),h||!g)return void this.loadPlaylist(l)}else l=this.getDeliveryDirectives(n,t.deliveryDirectives,c,u);var b=Object(s.computeReloadInterval)(n,o);void 0!==c&&n.canBlockReload&&(b-=n.partTarget||1),this.log("reload live playlist "+e+" in "+Math.round(b)+" ms"),this.timer=self.setTimeout((function(){return r.loadPlaylist(l)}),b)}else this.clearTimer()},t.getDeliveryDirectives=function(e,t,i,r){var s=Object(n.getSkipValue)(e,i);return null!=t&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,s=n.HlsSkip.No),new n.HlsUrlParameters(i,r,s)},t.retryLoadingOrFail=function(e){var t,i=this,r=this.hls.config,n=this.retryCount<r.levelLoadingMaxRetry;if(n)if(this.retryCount++,e.details.indexOf("LoadTimeOut")>-1&&null!==(t=e.context)&&void 0!==t&&t.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+e.details+'"'),this.loadPlaylist();else{var s=Math.min(Math.pow(2,this.retryCount)*r.levelLoadingRetryDelay,r.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout((function(){return i.loadPlaylist()}),s),this.warn("retry playlist loading #"+this.retryCount+" in "+s+' ms after "'+e.details+'"')}else this.warn('cannot recover from error "'+e.details+'"'),this.clearTimer(),e.fatal=!0;return n},e}()},"./src/controller/base-stream-controller.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/base-stream-controller.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: State, default */function(e,t,i){"use strict";i.r(t),i.d(t,"State",(function(){return S})),i.d(t,"default",(function(){return C}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../task-loop */"./src/task-loop.ts"),s=i(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),o=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),a=i(/*! ../utils/logger */"./src/utils/logger.ts"),l=i(/*! ../events */"./src/events.ts"),c=i(/*! ../errors */"./src/errors.ts"),u=i(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),h=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),d=i(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),f=i(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),p=i(/*! ./level-helper */"./src/controller/level-helper.ts"),g=i(/*! ../loader/fragment-loader */"./src/loader/fragment-loader.ts"),v=i(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),m=i(/*! ../utils/time-ranges */"./src/utils/time-ranges.ts"),y=i(/*! ../types/loader */"./src/types/loader.ts");function _(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var S={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"},C=function(e){var t,i;function n(t,i,r){var n;return(n=e.call(this)||this).hls=void 0,n.fragPrevious=null,n.fragCurrent=null,n.fragmentTracker=void 0,n.transmuxer=null,n._state=S.STOPPED,n.media=void 0,n.mediaBuffer=void 0,n.config=void 0,n.bitrateTest=!1,n.lastCurrentTime=0,n.nextLoadPosition=0,n.startPosition=0,n.loadedmetadata=!1,n.fragLoadError=0,n.retryDate=0,n.levels=null,n.fragmentLoader=void 0,n.levelLastLoaded=null,n.startFragRequested=!1,n.decrypter=void 0,n.initPTS=[],n.onvseeking=null,n.onvended=null,n.logPrefix="",n.log=void 0,n.warn=void 0,n.logPrefix=r,n.log=a.logger.log.bind(a.logger,r+":"),n.warn=a.logger.warn.bind(a.logger,r+":"),n.hls=t,n.fragmentLoader=new g.default(t.config),n.fragmentTracker=i,n.config=t.config,n.decrypter=new v.default(t,t.config),t.on(l.Events.KEY_LOADED,n.onKeyLoaded,function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)),n}i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,b(t,i);var C,w,k,x=n.prototype;return x.doTick=function(){this.onTickEnd()},x.onTickEnd=function(){},x.startLoad=function(e){},x.stopLoad=function(){this.fragmentLoader.abort();var e=this.fragCurrent;e&&this.fragmentTracker.removeFragment(e),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=S.STOPPED},x._streamEnded=function(e,t){var i=this.fragCurrent,r=this.fragmentTracker;if(!t.live&&i&&i.sn===t.endSN&&!e.nextStart){var n=r.getState(i);return n===s.FragmentState.PARTIAL||n===s.FragmentState.OK}return!1},x.onMediaAttached=function(e,t){var i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.state===S.STOPPED&&this.startLoad(r.startPosition)},x.onMediaDetaching=function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},x.onMediaSeeking=function(){var e=this.config,t=this.fragCurrent,i=this.media,n=this.mediaBuffer,s=this.state,a=i?i.currentTime:0,l=o.BufferHelper.bufferInfo(n||i,a,e.maxBufferHole);if(this.log("media seeking to "+(Object(r.isFiniteNumber)(a)?a.toFixed(3):a)+", state: "+s),s===S.ENDED)this.resetLoadingState();else if(t&&!l.len){var c=e.maxFragLookUpTolerance,u=t.start-c,h=a>t.start+t.duration+c;(a<u||h)&&(h&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.loader.abort()),this.resetLoadingState())}i&&(this.lastCurrentTime=a),this.loadedmetadata||l.len||(this.nextLoadPosition=this.startPosition=a),this.tickImmediate()},x.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},x.onKeyLoaded=function(e,t){if(this.state===S.KEY_LOADING&&t.frag===this.fragCurrent&&this.levels){this.state=S.IDLE;var i=this.levels[t.frag.level].details;i&&this.loadFragment(t.frag,i,t.frag.start)}},x.onHandlerDestroying=function(){this.stopLoad(),e.prototype.onHandlerDestroying.call(this)},x.onHandlerDestroyed=function(){this.state=S.STOPPED,this.hls.off(l.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,e.prototype.onHandlerDestroyed.call(this)},x.loadKey=function(e,t){this.log("Loading key for "+e.sn+" of ["+t.startSN+"-"+t.endSN+"], "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level),this.state=S.KEY_LOADING,this.fragCurrent=e,this.hls.trigger(l.Events.KEY_LOADING,{frag:e})},x.loadFragment=function(e,t,i){this._loadFragForPlayback(e,t,i)},x._loadFragForPlayback=function(e,t,i){var r=this;this._doFragLoad(e,t,i,(function(t){if(r.fragContextChanged(e))return r.warn("Fragment "+e.sn+(t.part?" p: "+t.part.index:"")+" of level "+e.level+" was dropped during download."),void r.fragmentTracker.removeFragment(e);e.stats.chunkCount++,r._handleFragmentLoadProgress(t)})).then((function(t){if(t){r.fragLoadError=0;var i=r.state;if(!r.fragContextChanged(e))return"payload"in t&&(r.log("Loaded fragment "+e.sn+" of level "+e.level),r.hls.trigger(l.Events.FRAG_LOADED,t),r.state===S.BACKTRACKING)?(r.fragmentTracker.backtrack(e,t),void r.resetFragmentLoading(e)):void r._handleFragmentLoadComplete(t);(i===S.FRAG_LOADING||i===S.BACKTRACKING||!r.fragCurrent&&i===S.PARSING)&&(r.fragmentTracker.removeFragment(e),r.state=S.IDLE)}})).catch((function(t){r.warn(t),r.resetFragmentLoading(e)}))},x.flushMainBuffer=function(e,t,i){if(void 0===i&&(i=null),e-t){var r={startOffset:e,endOffset:t,type:i};this.fragLoadError=0,this.hls.trigger(l.Events.BUFFER_FLUSHING,r)}},x._loadInitSegment=function(e){var t=this;this._doFragLoad(e).then((function(i){if(!i||t.fragContextChanged(e)||!t.levels)throw new Error("init load aborted");return i})).then((function(i){var r=t.hls,n=i.payload,s=e.decryptdata;if(n&&n.byteLength>0&&s&&s.key&&s.iv&&"AES-128"===s.method){var o=self.performance.now();return t.decrypter.webCryptoDecrypt(new Uint8Array(n),s.key.buffer,s.iv.buffer).then((function(t){var n=self.performance.now();return r.trigger(l.Events.FRAG_DECRYPTED,{frag:e,payload:t,stats:{tstart:o,tdecrypt:n}}),i.payload=t,i}))}return i})).then((function(i){var r=t.fragCurrent,n=t.hls,s=t.levels;if(!s)throw new Error("init load aborted, missing levels");var o=s[e.level].details;console.assert(o,"Level details are defined when init segment is loaded");var a=e.stats;t.state=S.IDLE,t.fragLoadError=0,e.data=new Uint8Array(i.payload),a.parsing.start=a.buffering.start=self.performance.now(),a.parsing.end=a.buffering.end=self.performance.now(),i.frag===r&&n.trigger(l.Events.FRAG_BUFFERED,{stats:a,frag:r,part:null,id:e.type}),t.tick()})).catch((function(i){t.warn(i),t.resetFragmentLoading(e)}))},x.fragContextChanged=function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId},x.fragBufferedComplete=function(e,t){var i=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(t?" part: "+t.index:"")+" of "+("[stream-controller]"===this.logPrefix?"level":"track")+" "+e.level+" "+m.default.toString(o.BufferHelper.getBuffered(i))),this.state=S.IDLE,this.tick()},x._handleFragmentLoadComplete=function(e){var t=this.transmuxer;if(t){var i=e.frag,r=e.part,n=e.partsLoaded,s=!n||0===n.length||n.some((function(e){return!e})),o=new u.ChunkMetadata(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!s);t.flush(o)}},x._handleFragmentLoadProgress=function(e){},x._doFragLoad=function(e,t,i,n){var s=this;if(void 0===i&&(i=null),!this.levels)throw new Error("frag load aborted, missing levels");if(i=Math.max(e.start,i||0),this.config.lowLatencyMode&&t){var o=t.partList;if(o&&n){i>e.end&&t.fragmentHint&&(e=t.fragmentHint);var a=this.getNextPart(o,e,i);if(a>-1){var c=o[a];return this.log("Loading part sn: "+e.sn+" p: "+c.index+" cc: "+e.cc+" of playlist ["+t.startSN+"-"+t.endSN+"] parts [0-"+a+"-"+(o.length-1)+"] "+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(i.toFixed(3))),this.nextLoadPosition=c.start+c.duration,this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,part:o[a],targetBufferTime:i}),this.doFragPartsLoad(e,o,a,n).catch((function(e){return s.handleFragLoadError(e)}))}if(!e.url||this.loadedEndOfParts(o,i))return Promise.resolve(null)}}return this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(t?"of ["+t.startSN+"-"+t.endSN+"] ":"")+("[stream-controller]"===this.logPrefix?"level":"track")+": "+e.level+", target: "+parseFloat(i.toFixed(3))),Object(r.isFiniteNumber)(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=S.FRAG_LOADING,this.hls.trigger(l.Events.FRAG_LOADING,{frag:e,targetBufferTime:i}),this.fragmentLoader.load(e,n).catch((function(e){return s.handleFragLoadError(e)}))},x.doFragPartsLoad=function(e,t,i,r){var n=this;return new Promise((function(s,o){var a=[];!function i(c){var u=t[c];n.fragmentLoader.loadPart(e,u,r).then((function(r){a[u.index]=r;var o=r.part;n.hls.trigger(l.Events.FRAG_LOADED,r);var h=t[c+1];if(!h||h.fragment!==e)return s({frag:e,part:o,partsLoaded:a});i(c+1)})).catch(o)}(i)}))},x.handleFragLoadError=function(e){var t=e.data;return t&&t.details===c.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(l.Events.ERROR,t),null},x._handleTransmuxerFlush=function(e){var t=this.getCurrentContext(e);if(t&&this.state===S.PARSING){var i=t.frag,r=t.part,n=t.level,s=self.performance.now();i.stats.parsing.end=s,r&&(r.stats.parsing.end=s),this.updateLevelTiming(i,r,n,e.partial)}else this.fragCurrent||(this.state=S.IDLE)},x.getCurrentContext=function(e){var t=this.levels,i=e.level,r=e.sn,n=e.part;if(!t||!t[i])return this.warn("Levels object was unset while buffering fragment "+r+" of level "+i+". The current chunk will not be buffered."),null;var s=t[i],o=n>-1?Object(p.getPartWith)(s,r,n):null,a=o?o.fragment:Object(p.getFragmentWithSN)(s,r,this.fragCurrent);return a?{frag:a,part:o,level:s}:null},x.bufferFragmentData=function(e,t,i,r){if(e&&this.state===S.PARSING){var n=e.data1,s=e.data2,o=n;if(n&&s&&(o=Object(h.appendUint8Array)(n,s)),o&&o.length){var a={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:o};this.hls.trigger(l.Events.BUFFER_APPENDING,a),e.dropped&&e.independent&&!i&&this.flushBufferGap(t)}}},x.flushBufferGap=function(e){var t=this.media;if(t)if(o.BufferHelper.isBuffered(t,t.currentTime)){var i=t.currentTime,r=o.BufferHelper.bufferInfo(t,i,0),n=e.duration,s=Math.min(2*this.config.maxFragLookUpTolerance,.25*n),a=Math.max(Math.min(e.start-s,r.end-s),i+s);e.start-a>s&&this.flushMainBuffer(a,e.start)}else this.flushMainBuffer(0,e.start)},x.getFwdBufferInfo=function(e,t){var i=this.config,n=this.getLoadPosition();if(!Object(r.isFiniteNumber)(n))return null;var s=o.BufferHelper.bufferInfo(e,n,i.maxBufferHole);if(0===s.len&&void 0!==s.nextStart){var a=this.fragmentTracker.getBufferedFrag(n,t);if(a&&s.nextStart<a.end)return o.BufferHelper.bufferInfo(e,n,Math.max(s.nextStart,i.maxBufferHole))}return s},x.getMaxBufferLength=function(e){var t,i=this.config;return t=e?Math.max(8*i.maxBufferSize/e,i.maxBufferLength):i.maxBufferLength,Math.min(t,i.maxMaxBufferLength)},x.reduceMaxBufferLength=function(e){var t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+t.maxMaxBufferLength+"s"),!0)},x.getNextFragment=function(e,t){var i,r,n=t.fragments,s=n.length;if(!s)return null;var o,a=this.config,l=n[0].start;if(t.live){var c=a.initialLiveManifestSize;if(s<c)return this.warn("Not enough fragments to start playback (have: "+s+", need: "+c+")"),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(o=this.getInitialLiveFragment(t,n),this.startPosition=o?this.hls.liveSyncPosition||o.start:e)}else e<=l&&(o=n[0]);if(!o){var u=a.lowLatencyMode?t.partEnd:t.fragmentEnd;o=this.getFragmentAtPosition(e,u,t)}return null===(i=o)||void 0===i||!i.initSegment||null!==(r=o)&&void 0!==r&&r.initSegment.data||this.bitrateTest||(o=o.initSegment),o},x.getNextPart=function(e,t,i){for(var r=-1,n=!1,s=!0,o=0,a=e.length;o<a;o++){var l=e[o];if(s=s&&!l.independent,r>-1&&i<l.start)break;var c=l.loaded;!c&&(n||l.independent||s)&&l.fragment===t&&(r=o),n=c}return r},x.loadedEndOfParts=function(e,t){var i=e[e.length-1];return i&&t>i.start&&i.loaded},x.getInitialLiveFragment=function(e,t){var i=this.fragPrevious,r=null;if(i){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+i.programDateTime),r=Object(f.findFragmentByPDT)(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var n=i.sn+1;if(n>=e.startSN&&n<=e.endSN){var s=t[n-e.startSN];i.cc===s.cc&&(r=s,this.log("Live playlist, switching playlist, load frag with next SN: "+r.sn))}r||(r=Object(f.findFragWithCC)(t,i.cc))&&this.log("Live playlist, switching playlist, load frag with same CC: "+r.sn)}}else{var o=this.hls.liveSyncPosition;null!==o&&(r=this.getFragmentAtPosition(o,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r},x.getFragmentAtPosition=function(e,t,i){var r,n=this.config,o=this.fragPrevious,a=i.fragments,l=i.endSN,c=i.fragmentHint,u=n.maxFragLookUpTolerance,h=!!(n.lowLatencyMode&&i.partList&&c);if(h&&c&&!this.bitrateTest&&(a=a.concat(c),l=c.sn),e<t){var d=e>t-u?0:u;r=Object(f.findFragmentByPTS)(o,a,e,d)}else r=a[a.length-1];if(r){var p=r.sn-i.startSN,g=o&&r.level===o.level,v=a[p+1];if(this.fragmentTracker.getState(r)===s.FragmentState.BACKTRACKED){r=null;for(var m=p;a[m]&&this.fragmentTracker.getState(a[m])===s.FragmentState.BACKTRACKED;)r=o?a[m--]:a[--m];r||(r=v)}else o&&r.sn===o.sn&&!h&&g&&(r.sn<l&&this.fragmentTracker.getState(v)!==s.FragmentState.OK?(this.log("SN "+r.sn+" just loaded, load next one: "+v.sn),r=v):r=null)}return r},x.synchronizeToLiveEdge=function(e){var t=this.config,i=this.media;if(i){var r=this.hls.liveSyncPosition,n=i.currentTime,s=e.fragments[0].start,o=e.edge,a=n>=s-t.maxFragLookUpTolerance&&n<=o;if(null!==r&&i.duration>r&&(n<r||!a)){var l=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!a&&i.readyState<4||n<o-l)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn("Playback: "+n.toFixed(3)+" is located too far from the end of live sliding playlist: "+o+", reset currentTime to : "+r.toFixed(3)),i.currentTime=r))}}},x.alignPlaylists=function(e,t){var i=this.levels,n=this.levelLastLoaded,s=this.fragPrevious,o=null!==n?i[n]:null,a=e.fragments.length;if(!a)return this.warn("No fragments in live playlist"),0;var l=e.fragments[0].start,c=!t,u=e.alignedSliding&&Object(r.isFiniteNumber)(l);if(c||!u&&!l){Object(d.alignStream)(s,o,e);var h=e.fragments[0].start;return this.log("Live playlist sliding: "+h.toFixed(2)+" start-sn: "+(t?t.startSN:"na")+"->"+e.startSN+" prev-sn: "+(s?s.sn:"na")+" fragments: "+a),h}return l},x.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},x.setStartPosition=function(e,t){var i=this.startPosition;if(i<t&&(i=-1),-1===i||-1===this.lastCurrentTime){var n=e.startTimeOffset;Object(r.isFiniteNumber)(n)?(i=t+n,n<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log("Start time offset "+n+" found in playlist, adjust startPosition to "+i),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i},x.getLoadPosition=function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t},x.handleFragLoadAborted=function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(t?" part"+t.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},x.resetFragmentLoading=function(e){this.fragCurrent&&this.fragContextChanged(e)||(this.state=S.IDLE)},x.onFragmentOrKeyLoadError=function(e,t){if(!t.fatal){var i=t.frag;if(i&&i.type===e){var r=this.fragCurrent;console.assert(r&&i.sn===r.sn&&i.level===r.level&&i.urlId===r.urlId,"Frag load error must match current frag to retry");var n=this.config;if(this.fragLoadError+1<=n.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(i.level))return;var s=Math.min(Math.pow(2,this.fragLoadError)*n.fragLoadingRetryDelay,n.fragLoadingMaxRetryTimeout);this.warn("Fragment "+i.sn+" of "+e+" "+i.level+" failed to load, retrying in "+s+"ms"),this.retryDate=self.performance.now()+s,this.fragLoadError++,this.state=S.FRAG_LOADING_WAITING_RETRY}else t.levelRetry?(e===y.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=S.IDLE):(a.logger.error(t.details+" reaches max retry, redispatch as fatal ..."),t.fatal=!0,this.hls.stopLoad(),this.state=S.ERROR)}}},x.afterBufferFlushed=function(e,t,i){if(e){var r=o.BufferHelper.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===S.ENDED&&this.resetLoadingState()}},x.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=S.IDLE},x.resetLiveStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;if(null!=t&&t.live)return this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},x.updateLevelTiming=function(e,t,i,r){var n=this,s=i.details;console.assert(!!s,"level.details must be defined"),Object.keys(e.elementaryStreams).reduce((function(t,o){var a=e.elementaryStreams[o];if(a){var c=a.endPTS-a.startPTS;if(c<=0)return n.warn("Could not parse fragment "+e.sn+" "+o+" duration reliably ("+c+") resetting transmuxer to fallback to playlist timing"),n.resetTransmuxer(),t||!1;var u=r?0:Object(p.updateFragPTSDTS)(s,e,a.startPTS,a.endPTS,a.startDTS,a.endDTS);return n.hls.trigger(l.Events.LEVEL_PTS_UPDATED,{details:s,level:i,drift:u,type:o,frag:e,start:a.startPTS,end:a.endPTS}),!0}return t}),!1)?(this.state=S.PARSED,this.hls.trigger(l.Events.FRAG_PARSED,{frag:e,part:t})):this.resetLoadingState()},x.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},C=n,(w=[{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log(t+"->"+e))}}])&&_(C.prototype,w),k&&_(C,k),n}(n.default)},"./src/controller/buffer-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/buffer-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return f}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=i(/*! ../errors */"./src/errors.ts"),a=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=i(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=i(/*! ../loader/fragment */"./src/loader/fragment.ts"),u=i(/*! ./buffer-operation-queue */"./src/controller/buffer-operation-queue.ts"),h=Object(l.getMediaSource)(),d=/([ha]vc.)(?:\.[^.,]+)+/,f=function(){function e(e){var t=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 e=t.hls,i=t.media,r=t.mediaSource;s.logger.log("[buffer-controller]: Media source opened"),i&&(t.updateMediaElementDuration(),e.trigger(n.Events.MEDIA_ATTACHED,{media:i})),r&&r.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){s.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){s.logger.log("[buffer-controller]: Media source ended")},this.hls=e,this._initSourceBuffer(),this.registerListeners()}var t=e.prototype;return t.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},t.destroy=function(){this.unregisterListeners(),this.details=null},t.registerListeners=function(){var e=this.hls;e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(n.Events.BUFFER_RESET,this.onBufferReset,this),e.on(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.on(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(n.Events.BUFFER_EOS,this.onBufferEos,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(n.Events.FRAG_PARSED,this.onFragParsed,this),e.on(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(n.Events.BUFFER_RESET,this.onBufferReset,this),e.off(n.Events.BUFFER_APPENDING,this.onBufferAppending,this),e.off(n.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(n.Events.BUFFER_EOS,this.onBufferEos,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(n.Events.FRAG_PARSED,this.onFragParsed,this),e.off(n.Events.FRAG_CHANGED,this.onFragChanged,this)},t._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new u.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},t.onManifestParsed=function(e,t){var i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,this.details=null,s.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},t.onMediaAttaching=function(e,t){var i=this.media=t.media;if(i&&h){var r=this.mediaSource=new h;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src}},t.onMediaDetaching=function(){var e=this.media,t=this.mediaSource,i=this._objectUrl;if(t){if(s.logger.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(e){s.logger.warn("[buffer-controller]: onMediaDetaching: "+e.message+" while calling endOfStream")}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):s.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(n.Events.MEDIA_DETACHED,void 0)},t.onBufferReset=function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var i=e.sourceBuffer[t];try{i&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(i),e.sourceBuffer[t]=void 0)}catch(e){s.logger.warn("[buffer-controller]: Failed to reset the "+t+" buffer",e)}})),this._initSourceBuffer()},t.onBufferCodecs=function(e,t){var i=this,r=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(r){var n=i.tracks[e];if(n&&"function"==typeof n.buffer.changeType){var s=t[e],o=s.codec,a=s.levelCodec,l=s.container;if((n.levelCodec||n.codec).replace(d,"$1")!==(a||o).replace(d,"$1")){var c=l+";codecs="+(a||o);i.appendChangeType(e,c)}}}else i.pendingTracks[e]=t[e]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())},t.appendChangeType=function(e,t){var i=this,r=this.operationQueue,n={execute:function(){var n=i.sourceBuffer[e];n&&(s.logger.log("[buffer-controller]: changing "+e+" sourceBuffer type to "+t),n.changeType(t)),r.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){s.logger.warn("[buffer-controller]: Failed to change "+e+" SourceBuffer type",t)}};r.append(n,e)},t.onBufferAppending=function(e,t){var i=this,r=this.hls,l=this.operationQueue,c=this.tracks,u=t.data,h=t.type,d=t.frag,f=t.part,p=t.chunkMeta,g=p.buffering[h],v=self.performance.now();g.start=v;var m=d.stats.buffering,y=f?f.stats.buffering:null;0===m.start&&(m.start=v),y&&0===y.start&&(y.start=v);var _=c.audio,b="audio"===h&&1===p.id&&"audio/mpeg"===(null==_?void 0:_.container),S={execute:function(){if(g.executeStart=self.performance.now(),b){var e=i.sourceBuffer[h];if(e){var t=d.start-e.timestampOffset;Math.abs(t)>=.1&&(s.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+d.start+" (delta: "+t+") sn: "+d.sn+")"),e.timestampOffset=d.start)}}i.appendExecutor(u,h)},onStart:function(){},onComplete:function(){var e=self.performance.now();g.executeEnd=g.end=e,0===m.first&&(m.first=e),y&&0===y.first&&(y.first=e);var t=i.sourceBuffer,r={};for(var s in t)r[s]=a.BufferHelper.getBuffered(t[s]);i.appendError=0,i.hls.trigger(n.Events.BUFFER_APPENDED,{type:h,frag:d,part:f,chunkMeta:p,parent:d.type,timeRanges:r})},onError:function(e){s.logger.error("[buffer-controller]: Error encountered while trying to append to the "+h+" SourceBuffer",e);var t={type:o.ErrorTypes.MEDIA_ERROR,parent:d.type,details:o.ErrorDetails.BUFFER_APPEND_ERROR,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=o.ErrorDetails.BUFFER_FULL_ERROR:(i.appendError++,t.details=o.ErrorDetails.BUFFER_APPEND_ERROR,i.appendError>r.config.appendErrorMaxRetry&&(s.logger.error("[buffer-controller]: Failed "+r.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),t.fatal=!0)),r.trigger(n.Events.ERROR,t)}};l.append(S,h)},t.onBufferFlushing=function(e,t){var i=this,r=this.operationQueue,o=function(e){return{execute:i.removeExecutor.bind(i,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(n.Events.BUFFER_FLUSHED,{type:e})},onError:function(t){s.logger.warn("[buffer-controller]: Failed to remove from "+e+" SourceBuffer",t)}}};t.type?r.append(o(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){r.append(o(e),e)}))},t.onFragParsed=function(e,t){var i=this,r=t.frag,o=t.part,a=[],l=o?o.elementaryStreams:r.elementaryStreams;l[c.ElementaryStreamTypes.AUDIOVIDEO]?a.push("audiovideo"):(l[c.ElementaryStreamTypes.AUDIO]&&a.push("audio"),l[c.ElementaryStreamTypes.VIDEO]&&a.push("video")),0===a.length&&s.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+r.type+" level: "+r.level+" sn: "+r.sn),this.blockBuffers((function(){var e=self.performance.now();r.stats.buffering.end=e,o&&(o.stats.buffering.end=e);var t=o?o.stats:r.stats;i.hls.trigger(n.Events.FRAG_BUFFERED,{frag:r,part:o,stats:t,id:r.type})}),a)},t.onFragChanged=function(e,t){this.flushBackBuffer()},t.onBufferEos=function(e,t){var i=this;this.getSourceBufferTypes().reduce((function(e,r){var n=i.sourceBuffer[r];return t.type&&t.type!==r||n&&!n.ended&&(n.ended=!0,s.logger.log("[buffer-controller]: "+r+" sourceBuffer now EOS")),e&&!(n&&!n.ended)}),!0)&&this.blockBuffers((function(){var e=i.mediaSource;e&&"open"===e.readyState&&e.endOfStream()}))},t.onLevelUpdated=function(e,t){var i=t.details;i.fragments.length&&(this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},t.flushBackBuffer=function(){var e=this.hls,t=this.details,i=this.media,s=this.sourceBuffer;if(i&&null!==t){var o=this.getSourceBufferTypes();if(o.length){var l=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(Object(r.isFiniteNumber)(l)&&!(l<0)){var c=i.currentTime,u=t.levelTargetDuration,h=Math.max(l,u),d=Math.floor(c/u)*u-h;o.forEach((function(i){var r=s[i];if(r){var o=a.BufferHelper.getBuffered(r);o.length>0&&d>o.start(0)&&(e.trigger(n.Events.BACK_BUFFER_REACHED,{bufferEnd:d}),t.live&&e.trigger(n.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:d}),e.trigger(n.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:d,type:i}))}}))}}}},t.updateMediaElementDuration=function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,i=this.media,n=this.mediaSource,o=e.fragments[0].start+e.totalduration,a=i.duration,l=Object(r.isFiniteNumber)(n.duration)?n.duration:0;e.live&&t.config.liveDurationInfinity?(s.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),n.duration=1/0,this.updateSeekableRange(e)):(o>l&&o>a||!Object(r.isFiniteNumber)(a))&&(s.logger.log("[buffer-controller]: Updating Media Source duration to "+o.toFixed(3)),n.duration=o)}},t.updateSeekableRange=function(e){var t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&null!=t&&t.setLiveSeekableRange){var r=Math.max(0,i[0].start),n=Math.max(r,r+e.totalduration);t.setLiveSeekableRange(r,n)}},t.checkPendingTracks=function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,i=this.pendingTracks,r=Object.keys(i).length;if(r&&!e||2===r){this.createSourceBuffers(i),this.pendingTracks={};var s=this.getSourceBufferTypes();if(0===s.length)return void this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});s.forEach((function(e){t.executeNext(e)}))}},t.createSourceBuffers=function(e){var t=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");var r=0;for(var a in e)if(!t[a]){var l=e[a];if(!l)throw Error("source buffer exists for track "+a+", however track does not");var c=l.levelCodec||l.codec,u=l.container+";codecs="+c;s.logger.log("[buffer-controller]: creating sourceBuffer("+u+")");try{var h=t[a]=i.addSourceBuffer(u),d=a;this.addBufferListener(d,"updatestart",this._onSBUpdateStart),this.addBufferListener(d,"updateend",this._onSBUpdateEnd),this.addBufferListener(d,"error",this._onSBUpdateError),this.tracks[a]={buffer:h,codec:c,container:l.container,levelCodec:l.levelCodec,id:l.id},r++}catch(e){s.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+e.message),this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:e,mimeType:u})}}r&&this.hls.trigger(n.Events.BUFFER_CREATED,{tracks:this.tracks})},t._onSBUpdateStart=function(e){this.operationQueue.current(e).onStart()},t._onSBUpdateEnd=function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)},t._onSBUpdateError=function(e,t){s.logger.error("[buffer-controller]: "+e+" SourceBuffer error",t),this.hls.trigger(n.Events.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var i=this.operationQueue.current(e);i&&i.onError(t)},t.removeExecutor=function(e,t,i){var n=this.media,o=this.mediaSource,a=this.operationQueue,l=this.sourceBuffer[e];if(!n||!o||!l)return s.logger.warn("[buffer-controller]: Attempting to remove from the "+e+" SourceBuffer, but it does not exist"),void a.shiftAndExecuteNext(e);var c=Object(r.isFiniteNumber)(n.duration)?n.duration:1/0,u=Object(r.isFiniteNumber)(o.duration)?o.duration:1/0,h=Math.max(0,t),d=Math.min(i,c,u);d>h?(s.logger.log("[buffer-controller]: Removing ["+h+","+d+"] from the "+e+" SourceBuffer"),console.assert(!l.updating,e+" sourceBuffer must not be updating"),l.remove(h,d)):a.shiftAndExecuteNext(e)},t.appendExecutor=function(e,t){var i=this.operationQueue,r=this.sourceBuffer[t];if(!r)return s.logger.warn("[buffer-controller]: Attempting to append to the "+t+" SourceBuffer, but it does not exist"),void i.shiftAndExecuteNext(t);r.ended=!1,console.assert(!r.updating,t+" sourceBuffer must not be updating"),r.appendBuffer(e)},t.blockBuffers=function(e,t){var i=this;if(void 0===t&&(t=this.getSourceBufferTypes()),!t.length)return s.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve(e);var r=this.operationQueue,n=t.map((function(e){return r.appendBlocker(e)}));Promise.all(n).then((function(){e(),t.forEach((function(e){var t=i.sourceBuffer[e];t&&t.updating||r.shiftAndExecuteNext(e)}))}))},t.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},t.addBufferListener=function(e,t,i){var r=this.sourceBuffer[e];if(r){var n=i.bind(this,e);this.listeners[e].push({event:t,listener:n}),r.addEventListener(t,n)}},t.removeBufferListeners=function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))},e}()},"./src/controller/buffer-operation-queue.ts":
|
|
|
/*!**************************************************!*\
|
|
|
!*** ./src/controller/buffer-operation-queue.ts ***!
|
|
|
\**************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return n}));var r=i(/*! ../utils/logger */"./src/utils/logger.ts"),n=function(){function e(e){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=e}var t=e.prototype;return t.append=function(e,t){var i=this.queues[t];i.push(e),1===i.length&&this.buffers[t]&&this.executeNext(t)},t.insertAbort=function(e,t){this.queues[t].unshift(e),this.executeNext(t)},t.appendBlocker=function(e){var t,i=new Promise((function(e){t=e})),r={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,e),i},t.executeNext=function(e){var t=this.buffers,i=this.queues,n=t[e],s=i[e];if(s.length){var o=s[0];try{o.execute()}catch(t){r.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(t),n&&n.updating||(s.shift(),this.executeNext(e))}}},t.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},t.current=function(e){return this.queues[e][0]},e}()},"./src/controller/cap-level-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/cap-level-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts");function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(e){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=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var t,i,s,o=e.prototype;return o.setStreamController=function(e){this.streamController=e},o.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},o.registerListeners=function(){var e=this.hls;e.on(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.unregisterListener=function(){var e=this.hls;e.off(r.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.BUFFER_CODECS,this.onBufferCodecs,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},o.onFpsDropLevelCapping=function(t,i){e.isLevelAllowed(i.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(i.droppedLevel)},o.onMediaAttaching=function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null},o.onManifestParsed=function(e,t){var i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()},o.onBufferCodecs=function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()},o.onMediaDetaching=function(){this.stopCapping()},o.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}},o.getMaxLevel=function(t){var i=this,r=this.hls.levels;if(!r.length)return-1;var n=r.filter((function(r,n){return e.isLevelAllowed(n,i.restrictedLevels)&&n<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},o.startCapping=function(){this.timer||(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())},o.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},o.getDimensions=function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,t.width||t.height||(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t},e.isLevelAllowed=function(e,t){return void 0===t&&(t=[]),-1===t.indexOf(e)},e.getMaxLevelByMediaSize=function(e,t,i){if(!e||!e.length)return-1;for(var r,n,s=e.length-1,o=0;o<e.length;o+=1){var a=e[o];if((a.width>=t||a.height>=i)&&(r=a,!(n=e[o+1])||r.width!==n.width||r.height!==n.height)){s=o;break}}return s},t=e,s=[{key:"contentScaleFactor",get:function(){var e=1;try{e=self.devicePixelRatio}catch(e){}return e}}],(i=[{key:"mediaWidth",get:function(){return this.getDimensions().width*e.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*e.contentScaleFactor}}])&&n(t.prototype,i),s&&n(t,s),e}();t.default=s},"./src/controller/cmcd-controller.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/controller/cmcd-controller.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return d}));var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../types/cmcd */"./src/types/cmcd.ts"),s=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts");function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),e}function c(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(i)return(i=i.call(e)).next.bind(i);if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return u(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var d=function(){function e(t){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(e){try{i.apply(e,{ot:n.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(e){o.logger.warn("Could not generate manifest CMCD data.",e)}},this.applyFragmentData=function(e){try{var t=e.frag,r=i.hls.levels[t.level],s=i.getObjectType(t),a={d:1e3*t.duration,ot:s};s!==n.CMCDObjectType.VIDEO&&s!==n.CMCDObjectType.AUDIO&&s!=n.CMCDObjectType.MUXED||(a.br=r.bitrate/1e3,a.tb=i.getTopBandwidth(s),a.bl=i.getBufferLength(s)),i.apply(e,a)}catch(e){o.logger.warn("Could not generate segment CMCD data.",e)}},this.hls=t;var r=this.config=t.config,s=r.cmcd;null!=s&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||e.uuid(),this.cid=s.contentId,this.useHeaders=!0===s.useHeaders,this.registerListeners())}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.on(r.Events.BUFFER_CREATED,this.onBufferCreated,this)},t.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHED,this.onMediaDetached,this),e.off(r.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},t.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},t.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},t.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},t.onBufferCreated=function(e,t){var i,r;this.audioBuffer=null===(i=t.tracks.audio)||void 0===i?void 0:i.buffer,this.videoBuffer=null===(r=t.tracks.video)||void 0===r?void 0:r.buffer},t.createData=function(){var e;return{v:n.CMCDVersion,sf:n.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:null===(e=this.media)||void 0===e?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},t.apply=function(t,i){void 0===i&&(i={}),h(i,this.createData());var r=i.ot===n.CMCDObjectType.INIT||i.ot===n.CMCDObjectType.VIDEO||i.ot===n.CMCDObjectType.MUXED;if(this.starved&&r&&(i.bs=!0,i.su=!0,this.starved=!1),null==i.su&&(i.su=this.buffering),this.useHeaders){var s=e.toHeaders(i);if(!Object.keys(s).length)return;t.headers||(t.headers={}),h(t.headers,s)}else{var o=e.toQuery(i);if(!o)return;t.url=e.appendQueryToUri(t.url,o)}},t.getObjectType=function(e){var t=e.type;return"subtitle"===t?n.CMCDObjectType.TIMED_TEXT:"initSegment"===e.sn?n.CMCDObjectType.INIT:"audio"===t?n.CMCDObjectType.AUDIO:"main"===t?this.hls.audioTracks.length?n.CMCDObjectType.VIDEO:n.CMCDObjectType.MUXED:void 0},t.getTopBandwidth=function(e){for(var t,i=0,r=c(e===n.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels);!(t=r()).done;){var s=t.value;s.bitrate>i&&(i=s.bitrate)}return i>0?i:NaN},t.getBufferLength=function(e){var t=this.hls.media,i=e===n.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;return i&&t?1e3*s.BufferHelper.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len:NaN},t.createPlaylistLoader=function(){var e=this.config.pLoader,t=this.applyPlaylistData,i=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new i(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,i,r){t(e),this.loader.load(e,i,r)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},t.createFragmentLoader=function(){var e=this.config.fLoader,t=this.applyFragmentData,i=e||this.config.loader;return function(){function e(e){this.loader=void 0,this.loader=new i(e)}var r=e.prototype;return r.destroy=function(){this.loader.destroy()},r.abort=function(){this.loader.abort()},r.load=function(e,i,r){t(e),this.loader.load(e,i,r)},l(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),e}()},e.uuid=function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.substr(t.lastIndexOf("/")+1)},e.serialize=function(e){for(var t,i=[],r=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},n=function(e){return Math.round(e)},s=function(e){return 100*n(e/100)},o={br:n,d:n,bl:s,dl:s,mtp:s,nor:function(e){return encodeURIComponent(e)},rtp:s,tb:n},a=c(Object.keys(e||{}).sort());!(t=a()).done;){var l=t.value,u=e[l];if(r(u)&&!("v"===l&&1===u||"pr"==l&&1===u)){var h=o[l];h&&(u=h(u));var d=typeof u,f=void 0;f="ot"===l||"sf"===l||"st"===l?l+"="+u:"boolean"===d?l:"number"===d?l+"="+u:l+"="+JSON.stringify(u),i.push(f)}}return i.join(",")},e.toHeaders=function(t){for(var i={},r=["Object","Request","Session","Status"],n=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=0,a=Object.keys(t);o<a.length;o++){var l=a[o];n[null!=s[l]?s[l]:1][l]=t[l]}for(var c=0;c<n.length;c++){var u=e.serialize(n[c]);u&&(i["CMCD-"+r[c]]=u)}return i},e.toQuery=function(t){return"CMCD="+encodeURIComponent(e.serialize(t))},e.appendQueryToUri=function(e,t){if(!t)return e;var i=e.includes("?")?"&":"?";return""+e+i+t},e}()},"./src/controller/eme-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/eme-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../errors */"./src/errors.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=i(/*! ../utils/mediakeys-helper */"./src/utils/mediakeys-helper.ts");function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=function(){function e(e){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=e,this._config=e.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var t,i,l,c=e.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._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)},c._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)},c.getLicenseServerUrl=function(e){switch(e){case o.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+e+'"')},c._attemptKeySystemAccess=function(e,t,i){var r=this,n=function(e,t,i,r){switch(e){case o.KeySystems.WIDEVINE:return function(e,t,i){var r={audioCapabilities:[],videoCapabilities:[]};return e.forEach((function(e){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+e+'"',robustness:i.audioRobustness||""})})),t.forEach((function(e){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+e+'"',robustness:i.videoRobustness||""})})),[r]}(t,i,r);default:throw new Error("Unknown key-system: "+e)}}(e,t,i,this._drmSystemOptions);s.logger.log("Requesting encrypted media key-system access");var a=this.requestMediaKeySystemAccess(e,n);this.mediaKeysPromise=a.then((function(t){return r._onMediaKeySystemAccessObtained(e,t)})),a.catch((function(t){s.logger.error('Failed to obtain key-system "'+e+'" access:',t)}))},c._onMediaKeySystemAccessObtained=function(e,t){var i=this;s.logger.log('Access for key-system "'+e+'" obtained');var r={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:e};this._mediaKeysList.push(r);var n=Promise.resolve().then((function(){return t.createMediaKeys()})).then((function(t){return r.mediaKeys=t,s.logger.log('Media-keys created for key-system "'+e+'"'),i._onMediaKeysCreated(),t}));return n.catch((function(e){s.logger.error("Failed to create media-keys:",e)})),n},c._onMediaKeysCreated=function(){var e=this;this._mediaKeysList.forEach((function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),e._onNewMediaKeySession(t.mediaKeysSession))}))},c._onNewMediaKeySession=function(e){var t=this;s.logger.log("New key-system session "+e.sessionId),e.addEventListener("message",(function(i){t._onKeySessionMessage(e,i.message)}),!1)},c._onKeySessionMessage=function(e,t){s.logger.log("Got EME message event, creating license request"),this._requestLicense(t,(function(t){s.logger.log("Received license data (length: "+(t?t.byteLength:t)+"), updating key-session"),e.update(t)}))},c.onMediaEncrypted=function(e){var t=this;if(s.logger.log('Media is encrypted using "'+e.initDataType+'" init data type'),!this.mediaKeysPromise)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});var i=function(i){t._media&&(t._attemptSetMediaKeys(i),t._generateRequestWithPreferredKeySession(e.initDataType,e.initData))};this.mediaKeysPromise.then(i).catch(i)},c._attemptSetMediaKeys=function(e){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys)return s.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});s.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(e,t){var i=this,o=this._mediaKeysList[0];if(!o)return s.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});if(o.mediaKeysSessionInitialized)s.logger.warn("Key-Session already initialized but requested again");else{var a=o.mediaKeysSession;if(!a)return s.logger.error("Fatal: Media is encrypted but no key-session existing"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});if(!t)return s.logger.warn("Fatal: initData required for generating a key session is null"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});s.logger.log('Generating key-session request for "'+e+'" init data type'),o.mediaKeysSessionInitialized=!0,a.generateRequest(e,t).then((function(){s.logger.debug("Key-session generation succeeded")})).catch((function(e){s.logger.error("Error generating key-session request:",e),i.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})}))}},c._createLicenseXhr=function(e,t,i){var r=new XMLHttpRequest;r.responseType="arraybuffer",r.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,r,e,t,i);var n=this._licenseXhrSetup;if(n)try{n.call(this.hls,r,e),n=void 0}catch(e){s.logger.error(e)}try{r.readyState||r.open("POST",e,!0),n&&n.call(this.hls,r,e)}catch(e){throw new Error("issue setting up KeySystem license XHR "+e)}return r},c._onLicenseRequestReadyStageChange=function(e,t,i,o){switch(e.readyState){case 4:if(200===e.status){this._requestLicenseFailureCount=0,s.logger.log("License request succeeded");var a=e.response,l=this._licenseResponseCallback;if(l)try{a=l.call(this.hls,e,t)}catch(e){s.logger.error(e)}o(a)}else{if(s.logger.error("License Request XHR failed ("+t+"). Status: "+e.status+" ("+e.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>3)return void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});var c=3-this._requestLicenseFailureCount+1;s.logger.warn("Retrying license request, "+c+" attempts left"),this._requestLicense(i,o)}}},c._generateLicenseRequestChallenge=function(e,t){switch(e.mediaKeySystemDomain){case o.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+e.mediaKeySystemDomain)},c._requestLicense=function(e,t){s.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i)return s.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),void this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});try{var o=this.getLicenseServerUrl(i.mediaKeySystemDomain),a=this._createLicenseXhr(o,e,t);s.logger.log("Sending license request to URL: "+o);var l=this._generateLicenseRequestChallenge(i,e);a.send(l)}catch(e){s.logger.error("Failure requesting DRM license: "+e),this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.KEY_SYSTEM_ERROR,details:n.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(e,t){if(this._emeEnabled){var i=t.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)}},c.onMediaDetached=function(){var e=this._media,t=this._mediaKeysList;e&&(e.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map((function(e){if(e.mediaKeysSession)return e.mediaKeysSession.close().catch((function(){}))}))).then((function(){return e.setMediaKeys(null)})).catch((function(){})))},c.onManifestParsed=function(e,t){if(this._emeEnabled){var i=t.levels.map((function(e){return e.audioCodec})).filter((function(e){return!!e})),r=t.levels.map((function(e){return e.videoCodec})).filter((function(e){return!!e}));this._attemptKeySystemAccess(o.KeySystems.WIDEVINE,i,r)}},t=e,(i=[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}])&&a(t.prototype,i),l&&a(t,l),e}();t.default=l},"./src/controller/fps-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/fps-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../utils/logger */"./src/utils/logger.ts"),s=function(){function e(e){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=e,this.registerListeners()}var t=e.prototype;return t.setStreamController=function(e){this.streamController=e},t.registerListeners=function(){this.hls.on(r.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},t.unregisterListeners=function(){this.hls.off(r.Events.MEDIA_ATTACHING,this.onMediaAttaching)},t.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},t.onMediaAttaching=function(e,t){var i=this.hls.config;if(i.capLevelOnFPSDrop){var r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}},t.checkFPS=function(e,t,i){var s=performance.now();if(t){if(this.lastTime){var o=s-this.lastTime,a=i-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*a/o,u=this.hls;if(u.trigger(r.Events.FPS_DROP,{currentDropped:a,currentDecoded:l,totalDroppedFrames:i}),c>0&&a>u.config.fpsDroppedMonitoringThreshold*l){var h=u.currentLevel;n.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(-1===u.autoLevelCapping||u.autoLevelCapping>=h)&&(h-=1,u.trigger(r.Events.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:u.currentLevel}),u.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=i,this.lastDecodedFrames=t}},t.checkFPSInterval=function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)},e}();t.default=s},"./src/controller/fragment-finders.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-finders.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: findFragmentByPDT, findFragmentByPTS, fragmentWithinToleranceTest, pdtWithinToleranceTest, findFragWithCC */function(e,t,i){"use strict";i.r(t),i.d(t,"findFragmentByPDT",(function(){return s})),i.d(t,"findFragmentByPTS",(function(){return o})),i.d(t,"fragmentWithinToleranceTest",(function(){return a})),i.d(t,"pdtWithinToleranceTest",(function(){return l})),i.d(t,"findFragWithCC",(function(){return c}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../utils/binary-search */"./src/utils/binary-search.ts");function s(e,t,i){if(null===t||!Array.isArray(e)||!e.length||!Object(r.isFiniteNumber)(t))return null;if(t<(e[0].programDateTime||0))return null;if(t>=(e[e.length-1].endProgramDateTime||0))return null;i=i||0;for(var n=0;n<e.length;++n){var s=e[n];if(l(t,i,s))return s}return null}function o(e,t,i,r){void 0===i&&(i=0),void 0===r&&(r=0);var s=null;if(e?s=t[e.sn-t[0].sn+1]||null:0===i&&0===t[0].start&&(s=t[0]),s&&0===a(i,r,s))return s;var o=n.default.search(t,a.bind(null,i,r));return o||s}function a(e,t,i){void 0===e&&(e=0),void 0===t&&(t=0);var r=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=e?1:i.start-r>e&&i.start?-1:0}function l(e,t,i){var r=1e3*Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>e}function c(e,t){return n.default.search(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))}},"./src/controller/fragment-tracker.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/fragment-tracker.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: FragmentState, FragmentTracker */function(e,t,i){"use strict";i.r(t),i.d(t,"FragmentState",(function(){return r})),i.d(t,"FragmentTracker",(function(){return o}));var r,n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../types/loader */"./src/types/loader.ts");!function(e){e.NOT_LOADED="NOT_LOADED",e.BACKTRACKED="BACKTRACKED",e.APPENDING="APPENDING",e.PARTIAL="PARTIAL",e.OK="OK"}(r||(r={}));var o=function(){function e(e){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=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){var e=this.hls;e.on(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.on(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var e=this.hls;e.off(n.Events.BUFFER_APPENDED,this.onBufferAppended,this),e.off(n.Events.FRAG_BUFFERED,this.onFragBuffered,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},t.getAppendedFrag=function(e,t){if(t===s.PlaylistLevelType.MAIN){var i=this.activeFragment,r=this.activeParts;if(!i)return null;if(r)for(var n=r.length;n--;){var o=r[n],a=o?o.end:i.appendedPTS;if(o.start<=e&&void 0!==a&&e<=a)return n>9&&(this.activeParts=r.slice(n-9)),o}else if(i.start<=e&&void 0!==i.appendedPTS&&e<=i.appendedPTS)return i}return this.getBufferedFrag(e,t)},t.getBufferedFrag=function(e,t){for(var i=this.fragments,r=Object.keys(i),n=r.length;n--;){var s=i[r[n]];if((null==s?void 0:s.body.type)===t&&s.buffered){var o=s.body;if(o.start<=e&&e<=o.end)return o}}return null},t.detectEvictedFragments=function(e,t,i){var r=this;Object.keys(this.fragments).forEach((function(n){var s=r.fragments[n];if(s)if(s.buffered){var o=s.range[e];o&&o.time.some((function(e){var i=!r.isTimeBuffered(e.startPTS,e.endPTS,t);return i&&r.removeFragment(s.body),i}))}else s.body.type===i&&r.removeFragment(s.body)}))},t.detectPartialFragments=function(e){var t=this,i=this.timeRanges,r=e.frag,n=e.part;if(i&&"initSegment"!==r.sn){var s=l(r),o=this.fragments[s];o&&(Object.keys(i).forEach((function(e){var s=r.elementaryStreams[e];if(s){var a=i[e],l=null!==n||!0===s.partial;o.range[e]=t.getBufferedTimes(r,n,l,a)}})),o.backtrack=o.loaded=null,Object.keys(o.range).length?o.buffered=!0:this.removeFragment(o.body))}},t.fragBuffered=function(e){var t=l(e),i=this.fragments[t];i&&(i.backtrack=i.loaded=null,i.buffered=!0)},t.getBufferedTimes=function(e,t,i,r){for(var n={time:[],partial:i},s=t?t.start:e.start,o=t?t.end:e.end,a=e.minEndPTS||o,l=e.maxStartPTS||s,c=0;c<r.length;c++){var u=r.start(c)-this.bufferPadding,h=r.end(c)+this.bufferPadding;if(l>=u&&a<=h){n.time.push({startPTS:Math.max(s,r.start(c)),endPTS:Math.min(o,r.end(c))});break}if(s<h&&o>u)n.partial=!0,n.time.push({startPTS:Math.max(s,r.start(c)),endPTS:Math.min(o,r.end(c))});else if(o<=u)break}return n},t.getPartialFragment=function(e){var t,i,r,n=null,s=0,o=this.bufferPadding,l=this.fragments;return Object.keys(l).forEach((function(c){var u=l[c];u&&a(u)&&(i=u.body.start-o,r=u.body.end+o,e>=i&&e<=r&&(t=Math.min(e-i,r-e),s<=t&&(n=u.body,s=t)))})),n},t.getState=function(e){var t=l(e),i=this.fragments[t];return i?i.buffered?a(i)?r.PARTIAL:r.OK:i.backtrack?r.BACKTRACKED:r.APPENDING:r.NOT_LOADED},t.backtrack=function(e,t){var i=l(e),r=this.fragments[i];if(!r||r.backtrack)return null;var n=r.backtrack=t||r.loaded;return r.loaded=null,n},t.getBacktrackData=function(e){var t=l(e),i=this.fragments[t];if(i){var r,n=i.backtrack;if(null!=n&&null!==(r=n.payload)&&void 0!==r&&r.byteLength)return n;this.removeFragment(e)}return null},t.isTimeBuffered=function(e,t,i){for(var r,n,s=0;s<i.length;s++){if(r=i.start(s)-this.bufferPadding,n=i.end(s)+this.bufferPadding,e>=r&&t<=n)return!0;if(t<=r)return!1}return!1},t.onFragLoaded=function(e,t){var i=t.frag,r=t.part;if("initSegment"!==i.sn&&!i.bitrateTest&&!r){var n=l(i);this.fragments[n]={body:i,loaded:t,backtrack:null,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(e,t){var i=this,r=t.frag,n=t.part,o=t.timeRanges;if(r.type===s.PlaylistLevelType.MAIN)if(this.activeFragment=r,n){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(n)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach((function(e){var t=o[e];if(i.detectEvictedFragments(e,t),!n)for(var s=0;s<t.length;s++)r.appendedPTS=Math.max(t.end(s),r.appendedPTS||0)}))},t.onFragBuffered=function(e,t){this.detectPartialFragments(t)},t.hasFragment=function(e){var t=l(e);return!!this.fragments[t]},t.removeFragmentsInRange=function(e,t,i){var r=this;Object.keys(this.fragments).forEach((function(n){var s=r.fragments[n];if(s&&s.buffered){var o=s.body;o.type===i&&o.start<t&&o.end>e&&r.removeFragment(o)}}))},t.removeFragment=function(e){var t=l(e);e.stats.loaded=0,e.clearElementaryStreamInfo(),delete this.fragments[t]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},e}();function a(e){var t,i;return e.buffered&&((null===(t=e.range.video)||void 0===t?void 0:t.partial)||(null===(i=e.range.audio)||void 0===i?void 0:i.partial))}function l(e){return e.type+"_"+e.level+"_"+e.urlId+"_"+e.sn}},"./src/controller/gap-controller.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/controller/gap-controller.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: STALL_MINIMUM_DURATION_MS, MAX_START_GAP_JUMP, SKIP_BUFFER_HOLE_STEP_SECONDS, SKIP_BUFFER_RANGE_START, default */function(e,t,i){"use strict";i.r(t),i.d(t,"STALL_MINIMUM_DURATION_MS",(function(){return a})),i.d(t,"MAX_START_GAP_JUMP",(function(){return l})),i.d(t,"SKIP_BUFFER_HOLE_STEP_SECONDS",(function(){return c})),i.d(t,"SKIP_BUFFER_RANGE_START",(function(){return u})),i.d(t,"default",(function(){return h}));var r=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),n=i(/*! ../errors */"./src/errors.ts"),s=i(/*! ../events */"./src/events.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=250,l=2,c=.1,u=.05,h=function(){function e(e,t,i,r){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=e,this.media=t,this.fragmentTracker=i,this.hls=r}var t=e.prototype;return t.destroy=function(){this.hls=this.fragmentTracker=this.media=null},t.poll=function(e){var t=this.config,i=this.media,n=this.stalled,s=i.currentTime,c=i.seeking,u=this.seeking&&!c,h=!this.seeking&&c;if(this.seeking=c,s===e){if((h||u)&&(this.stalled=null),!i.paused&&!i.ended&&0!==i.playbackRate&&r.BufferHelper.getBuffered(i).length){var d=r.BufferHelper.bufferInfo(i,s,0),f=d.len>0,p=d.nextStart||0;if(f||p){if(c){var g=d.len>l,v=!p||p-s>l&&!this.fragmentTracker.getPartialFragment(s);if(g||v)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var m,y=Math.max(p,d.start||0)-s,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,b=(null==_||null===(m=_.details)||void 0===m?void 0:m.live)?2*_.details.targetduration:l;if(y>0&&y<=b)return void this._trySkipBufferHole(null)}var S=self.performance.now();if(null!==n){var C=S-n;!c&&C>=a&&this._reportStall(d.len);var w=r.BufferHelper.bufferInfo(i,s,t.maxBufferHole);this._tryFixBufferStall(w,C)}else this.stalled=S}}}else if(this.moved=!0,null!==n){if(this.stallReported){var k=self.performance.now()-n;o.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(k)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}},t._tryFixBufferStall=function(e,t){var i=this.config,r=this.fragmentTracker,n=this.media.currentTime,s=r.getPartialFragment(n);s&&this._trySkipBufferHole(s)||e.len>i.maxBufferHole&&t>1e3*i.highBufferWatchdogPeriod&&(o.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},t._reportStall=function(e){var t=this.hls,i=this.media;this.stallReported||(this.stallReported=!0,o.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+e+")"),t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:e}))},t._trySkipBufferHole=function(e){for(var t=this.config,i=this.hls,a=this.media,l=a.currentTime,h=0,d=r.BufferHelper.getBuffered(a),f=0;f<d.length;f++){var p=d.start(f);if(l+t.maxBufferHole>=h&&l<p){var g=Math.max(p+u,a.currentTime+c);return o.logger.warn("skipping hole, adjusting currentTime from "+l+" to "+g),this.moved=!0,this.stalled=null,a.currentTime=g,e&&i.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+l+" to "+g,frag:e}),g}h=d.end(f)}return 0},t._tryNudgeBuffer=function(){var e=this.config,t=this.hls,i=this.media,r=i.currentTime,a=(this.nudgeRetry||0)+1;if(this.nudgeRetry=a,a<e.nudgeMaxRetry){var l=r+a*e.nudgeOffset;o.logger.warn("Nudging 'currentTime' from "+r+" to "+l),i.currentTime=l,t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else o.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+e.nudgeMaxRetry+" nudges"),t.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},e}()},"./src/controller/id3-track-controller.ts":
|
|
|
/*!************************************************!*\
|
|
|
!*** ./src/controller/id3-track-controller.ts ***!
|
|
|
\************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),s=i(/*! ../demux/id3 */"./src/demux/id3.ts"),o=function(){function e(e){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t.destroy=function(){this._unregisterListeners()},t._registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t._unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},t.onMediaAttached=function(e,t){this.media=t.media},t.onMediaDetaching=function(){this.id3Track&&(Object(n.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null)},t.getID3Track=function(e){if(this.media){for(var t=0;t<e.length;t++){var i=e[t];if("metadata"===i.kind&&"id3"===i.label)return Object(n.sendAddTrackEvent)(i,this.media),i}return this.media.addTextTrack("metadata","id3")}},t.onFragParsingMetadata=function(e,t){if(this.media){var i=t.frag,r=t.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var n=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,o=0;o<r.length;o++){var a=s.getID3Frames(r[o].data);if(a){var l=r[o].pts,c=o<r.length-1?r[o+1].pts:i.end;c-l<=0&&(c=l+.25);for(var u=0;u<a.length;u++){var h=a[u];if(!s.isTimeStampFrame(h)){var d=new n(l,c,"");d.value=h,this.id3Track.addCue(d)}}}}}},t.onBufferFlushing=function(e,t){var i=t.startOffset,r=t.endOffset,s=t.type;if(!s||"audio"===s){var o=this.id3Track;o&&Object(n.removeCuesInRange)(o,i,r)}},e}();t.default=o},"./src/controller/latency-controller.ts":
|
|
|
/*!**********************************************!*\
|
|
|
!*** ./src/controller/latency-controller.ts ***!
|
|
|
\**********************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return a}));var r=i(/*! ../errors */"./src/errors.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts");function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(e){var t=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 t.timeupdate()},this.hls=e,this.config=e.config,this.registerListeners()}var t,i,a,l=e.prototype;return l.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},l.registerListeners=function(){this.hls.on(n.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(n.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(n.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){this.hls.off(n.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(n.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(n.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(n.Events.ERROR,this.onError)},l.onMediaAttached=function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},l.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},l.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},l.onLevelUpdated=function(e,t){var i=t.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},l.onError=function(e,t){t.details===r.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,s.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},l.timeupdate=function(){var e=this.media,t=this.levelDetails;if(e&&t){this.currentTime=e.currentTime;var i=this.computeLatency();if(null!==i){this._latency=i;var r=this.config,n=r.lowLatencyMode,s=r.maxLiveSyncPlaybackRate;if(n&&1!==s){var o=this.targetLatency;if(null!==o){var a=i-o,l=a<Math.min(this.maxLatency,o+t.targetduration);if(t.live&&l&&a>.05&&this.forwardBufferLength>1){var c=Math.min(2,Math.max(1,s)),u=Math.round(2/(1+Math.exp(-.75*a-this.edgeStalled))*20)/20;e.playbackRate=Math.min(c,Math.max(1,u))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}},l.estimateLiveEdge=function(){var e=this.levelDetails;return null===e?null:e.edge+e.age},l.computeLatency=function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime},t=e,(i=[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,i=e.partHoldBack,r=e.targetduration,n=this.config,s=n.liveSyncDuration,o=n.liveSyncDurationCount,a=n.lowLatencyMode,l=this.hls.userConfig,c=a&&i||t;(l.liveSyncDuration||l.liveSyncDurationCount||0===c)&&(c=void 0!==s?s:o*r);var u=r;return c+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(null===e||null===t||null===i)return null;var r=i.edge,n=e-t-this.edgeStalled,s=r-i.totalduration,o=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(s,n),o)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var i=e.buffered.length;return i?e.buffered.end(i-1):t.edge-this.currentTime}}])&&o(t.prototype,i),a&&o(t,a),e}()},"./src/controller/level-controller.ts":
|
|
|
/*!********************************************!*\
|
|
|
!*** ./src/controller/level-controller.ts ***!
|
|
|
\********************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return p}));var r=i(/*! ../types/level */"./src/types/level.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../errors */"./src/errors.ts"),o=i(/*! ../utils/codecs */"./src/utils/codecs.ts"),a=i(/*! ./level-helper */"./src/controller/level-helper.ts"),l=i(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),c=i(/*! ../types/loader */"./src/types/loader.ts");function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function h(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),p=function(e){var t,i;function l(t){var i;return(i=e.call(this,t,"[level-controller]")||this)._levels=[],i._firstLevel=-1,i._startLevel=void 0,i.currentLevelIndex=-1,i.manualLevelIndex=-1,i.onParsedComplete=void 0,i._registerListeners(),i}i=e,(t=l).prototype=Object.create(i.prototype),t.prototype.constructor=t,d(t,i);var p,g,v,m=l.prototype;return m._registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(n.Events.ERROR,this.onError,this)},m._unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(n.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(n.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(n.Events.ERROR,this.onError,this)},m.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,e.prototype.destroy.call(this)},m.startLoad=function(){this._levels.forEach((function(e){e.loadError=0})),e.prototype.startLoad.call(this)},m.onManifestLoaded=function(e,t){var i,l,c=[],u=[],h=[],d={},p=!1,g=!1,v=!1;if(t.levels.forEach((function(e){var t=e.attrs;p=p||!(!e.width||!e.height),g=g||!!e.videoCodec,v=v||!!e.audioCodec,f&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0);var i=e.bitrate+"-"+e.attrs.RESOLUTION+"-"+e.attrs.CODECS;(l=d[i])?l.url.push(e.url):(l=new r.Level(e),d[i]=l,c.push(l)),t&&(t.AUDIO&&Object(a.addGroupId)(l,"audio",t.AUDIO),t.SUBTITLES&&Object(a.addGroupId)(l,"text",t.SUBTITLES))})),(p||g)&&v&&(c=c.filter((function(e){var t=e.videoCodec,i=e.width,r=e.height;return!!t||!(!i||!r)}))),c=c.filter((function(e){var t=e.audioCodec,i=e.videoCodec;return(!t||Object(o.isCodecSupportedInMp4)(t,"audio"))&&(!i||Object(o.isCodecSupportedInMp4)(i,"video"))})),t.audioTracks&&(u=t.audioTracks.filter((function(e){return!e.audioCodec||Object(o.isCodecSupportedInMp4)(e.audioCodec,"audio")})),Object(a.assignTrackIdsByGroup)(u)),t.subtitles&&(h=t.subtitles,Object(a.assignTrackIdsByGroup)(h)),c.length>0){i=c[0].bitrate,c.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=c;for(var m=0;m<c.length;m++)if(c[m].bitrate===i){this._firstLevel=m,this.log("manifest loaded, "+c.length+" level(s) found, first bitrate: "+i);break}var y=v&&!g,_={levels:c,audioTracks:u,subtitleTracks:h,firstLevel:this._firstLevel,stats:t.stats,audio:v,video:g,altAudio:!y&&u.some((function(e){return!!e.url}))};this.hls.trigger(n.Events.MANIFEST_PARSED,_),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,reason:"no level with compatible codecs found in manifest"})},m.onError=function(t,i){if(e.prototype.onError.call(this,t,i),!i.fatal){var r=i.context,n=this._levels[this.currentLevelIndex];if(r&&(r.type===c.PlaylistContextType.AUDIO_TRACK&&n.audioGroupIds&&r.groupId===n.audioGroupIds[n.urlId]||r.type===c.PlaylistContextType.SUBTITLE_TRACK&&n.textGroupIds&&r.groupId===n.textGroupIds[n.urlId]))this.redundantFailover(this.currentLevelIndex);else{var o,a=!1,l=!0;switch(i.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:if(i.frag){var u=this._levels[i.frag.level];u?(u.fragmentError++,u.fragmentError>this.hls.config.fragLoadingMaxRetry&&(o=i.frag.level)):o=i.frag.level}break;case s.ErrorDetails.LEVEL_LOAD_ERROR:case s.ErrorDetails.LEVEL_LOAD_TIMEOUT:r&&(r.deliveryDirectives&&(l=!1),o=r.level),a=!0;break;case s.ErrorDetails.REMUX_ALLOC_ERROR:o=i.level,a=!0}void 0!==o&&this.recoverLevel(i,o,a,l)}}},m.recoverLevel=function(e,t,i,r){var n=e.details,s=this._levels[t];if(s.loadError++,i){if(!this.retryLoadingOrFail(e))return void(this.currentLevelIndex=-1);e.levelRetry=!0}if(r){var o=s.url.length;if(o>1&&s.loadError<o)e.levelRetry=!0,this.redundantFailover(t);else if(-1===this.manualLevelIndex){var a=0===t?this._levels.length-1:t-1;this.currentLevelIndex!==a&&0===this._levels[a].loadError&&(this.warn(n+": switch to "+a),e.levelRetry=!0,this.hls.nextAutoLevel=a)}}},m.redundantFailover=function(e){var t=this._levels[e],i=t.url.length;if(i>1){var r=(t.urlId+1)%i;this.warn("Switching to redundant URL-id "+r),this._levels.forEach((function(e){e.urlId=r})),this.level=e}},m.onFragLoaded=function(e,t){var i=t.frag;if(void 0!==i&&i.type===c.PlaylistLevelType.MAIN){var r=this._levels[i.level];void 0!==r&&(r.fragmentError=0,r.loadError=0)}},m.onLevelLoaded=function(e,t){var i,r,n=t.level,s=t.details,o=this._levels[n];if(!o)return this.warn("Invalid level index "+n),void(null!==(r=t.deliveryDirectives)&&void 0!==r&&r.skip&&(s.deltaUpdateFailed=!0));n===this.currentLevelIndex?(0===o.fragmentError&&(o.loadError=0,this.retryCount=0),this.playlistLoaded(n,t,o.details)):null!==(i=t.deliveryDirectives)&&void 0!==i&&i.skip&&(s.deltaUpdateFailed=!0)},m.onAudioTrackSwitched=function(e,t){var i=this.hls.levels[this.currentLevelIndex];if(i&&i.audioGroupIds){for(var r=-1,n=this.hls.audioTracks[t.id].groupId,s=0;s<i.audioGroupIds.length;s++)if(i.audioGroupIds[s]===n){r=s;break}r!==i.urlId&&(i.urlId=r,this.startLoad())}},m.loadPlaylist=function(e){var t=this.currentLevelIndex,i=this._levels[t];if(this.canLoad&&i&&i.url.length>0){var r=i.urlId,s=i.url[r];if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Attempt loading level index "+t+(e?" at sn "+e.msn+" part "+e.part:"")+" with URL-id "+r+" "+s),this.clearTimer(),this.hls.trigger(n.Events.LEVEL_LOADING,{url:s,level:t,id:r,deliveryDirectives:e||null})}},m.removeLevel=function(e,t){var i=function(e,i){return i!==t},r=this._levels.filter((function(r,n){return n!==e||r.url.length>1&&void 0!==t&&(r.url=r.url.filter(i),r.audioGroupIds&&(r.audioGroupIds=r.audioGroupIds.filter(i)),r.textGroupIds&&(r.textGroupIds=r.textGroupIds.filter(i)),r.urlId=0,!0)})).map((function(e,t){var i=e.details;return null!=i&&i.fragments&&i.fragments.forEach((function(e){e.level=t})),e}));this._levels=r,this.hls.trigger(n.Events.LEVELS_UPDATED,{levels:r})},p=l,(g=[{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t,i=this._levels;if(0!==i.length&&(this.currentLevelIndex!==e||null===(t=i[e])||void 0===t||!t.details)){if(e<0||e>=i.length){var r=e<0;if(this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.OTHER_ERROR,details:s.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:r,reason:"invalid level idx"}),r)return;e=Math.min(e,i.length-1)}this.clearTimer();var o=this.currentLevelIndex,a=i[o],l=i[e];this.log("switching to level "+e+" from "+o),this.currentLevelIndex=e;var c=u({},l,{level:e,maxBitrate:l.maxBitrate,uri:l.uri,urlId:l.urlId});delete c._urlId,this.hls.trigger(n.Events.LEVEL_SWITCHING,c);var h=l.details;if(!h||h.live){var d=this.switchParams(l.uri,null==a?void 0:a.details);this.loadPlaylist(d)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}}])&&h(p.prototype,g),v&&h(p,v),l}(l.default)},"./src/controller/level-helper.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/controller/level-helper.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: addGroupId, assignTrackIdsByGroup, updatePTS, updateFragPTSDTS, mergeDetails, mapPartIntersection, mapFragmentIntersection, adjustSliding, addSliding, computeReloadInterval, getFragmentWithSN, getPartWith */function(e,t,i){"use strict";i.r(t),i.d(t,"addGroupId",(function(){return s})),i.d(t,"assignTrackIdsByGroup",(function(){return o})),i.d(t,"updatePTS",(function(){return a})),i.d(t,"updateFragPTSDTS",(function(){return c})),i.d(t,"mergeDetails",(function(){return u})),i.d(t,"mapPartIntersection",(function(){return h})),i.d(t,"mapFragmentIntersection",(function(){return d})),i.d(t,"adjustSliding",(function(){return f})),i.d(t,"addSliding",(function(){return p})),i.d(t,"computeReloadInterval",(function(){return g})),i.d(t,"getFragmentWithSN",(function(){return v})),i.d(t,"getPartWith",(function(){return m}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../utils/logger */"./src/utils/logger.ts");function s(e,t,i){switch(t){case"audio":e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds.push(i);break;case"text":e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds.push(i)}}function o(e){var t={};e.forEach((function(e){var i=e.groupId||"";e.id=t[i]=t[i]||0,t[i]++}))}function a(e,t,i){l(e[t],e[i])}function l(e,t){var i=t.startPTS;if(Object(r.isFiniteNumber)(i)){var n,s=0;t.sn>e.sn?(s=i-e.start,n=e):(s=e.start-i,n=t),n.duration!==s&&(n.duration=s)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function c(e,t,i,s,o,a){s-i<=0&&(n.logger.warn("Fragment should have a positive duration",t),s=i+t.duration,a=o+t.duration);var c=i,u=s,h=t.startPTS,d=t.endPTS;if(Object(r.isFiniteNumber)(h)){var f=Math.abs(h-i);Object(r.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(f,t.deltaPTS):t.deltaPTS=f,c=Math.max(i,h),i=Math.min(i,h),o=Math.min(o,t.startDTS),u=Math.min(s,d),s=Math.max(s,d),a=Math.max(a,t.endDTS)}t.duration=s-i;var p=i-t.start;t.appendedPTS=s,t.start=t.startPTS=i,t.maxStartPTS=c,t.startDTS=o,t.endPTS=s,t.minEndPTS=u,t.endDTS=a;var g,v=t.sn;if(!e||v<e.startSN||v>e.endSN)return 0;var m=v-e.startSN,y=e.fragments;for(y[m]=t,g=m;g>0;g--)l(y[g],y[g-1]);for(g=m;g<y.length-1;g++)l(y[g],y[g+1]);return e.fragmentHint&&l(y[y.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,p}function u(e,t){for(var i=null,s=e.fragments,o=s.length-1;o>=0;o--){var a=s[o].initSegment;if(a){i=a;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var l,u=0;if(d(e,t,(function(e,n){e.relurl&&(u=e.cc-n.cc),Object(r.isFiniteNumber)(e.startPTS)&&Object(r.isFiniteNumber)(e.endPTS)&&(n.start=n.startPTS=e.startPTS,n.startDTS=e.startDTS,n.appendedPTS=e.appendedPTS,n.maxStartPTS=e.maxStartPTS,n.endPTS=e.endPTS,n.endDTS=e.endDTS,n.minEndPTS=e.minEndPTS,n.duration=e.endPTS-e.startPTS,n.duration&&(l=n),t.PTSKnown=t.alignedSliding=!0),n.elementaryStreams=e.elementaryStreams,n.loader=e.loader,n.stats=e.stats,n.urlId=e.urlId,e.initSegment&&(n.initSegment=e.initSegment,i=e.initSegment)})),i&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null===(t=i)||void 0===t?void 0:t.relurl)||(e.initSegment=i)})),t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed)){n.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=t.skippedSegments;p--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var g=t.fragments;if(u){n.logger.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<g.length;v++)g[v].cc+=u}t.skippedSegments&&(t.startCC=t.fragments[0].cc),h(e.partList,t.partList,(function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),l?c(t,l,l.startPTS,l.endPTS,l.startDTS,l.endDTS):f(e,t),g.length&&(t.totalduration=t.edge-g[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;var m=t.advancedDateTime;if(t.advanced&&m){var y=t.edge;t.driftStart||(t.driftStartTime=m,t.driftStart=y),t.driftEndTime=m,t.driftEnd=y}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function h(e,t,i){if(e&&t)for(var r=0,n=0,s=e.length;n<=s;n++){var o=e[n],a=t[n+r];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?i(o,a):r--}}function d(e,t,i){for(var r=t.skippedSegments,n=Math.max(e.startSN,t.startSN)-t.startSN,s=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,o=t.startSN-e.startSN,a=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=n;c<=s;c++){var u=l[o+c],h=a[c];r&&!h&&c<r&&(h=t.fragments[c]=u),u&&h&&i(u,h)}}function f(e,t){var i=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;i<0||i>=r.length||p(t,r[i].start)}function p(e,t){if(t){for(var i=e.fragments,r=e.skippedSegments;r<i.length;r++)i[r].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function g(e,t){var i,r=1e3*e.levelTargetDuration,n=r/2,s=e.age,o=s>0&&s<3*r,a=t.loading.end-t.loading.start,l=e.availabilityDelay;if(!1===e.updated)if(o){var c=333*e.misses;i=Math.max(Math.min(n,2*a),c),e.availabilityDelay=(e.availabilityDelay||0)+i}else i=n;else o?(l=Math.min(l||r/2,s),e.availabilityDelay=l,i=l+r-s):i=r-a;return Math.round(i)}function v(e,t,i){if(!e||!e.details)return null;var r=e.details,n=r.fragments[t-r.startSN];return n||((n=r.fragmentHint)&&n.sn===t?n:t<r.startSN&&i&&i.sn===t?i:null)}function m(e,t,i){if(!e||!e.details)return null;var r=e.details.partList;if(r)for(var n=r.length;n--;){var s=r[n];if(s.index===i&&s.fragment.sn===t)return s}return null}},"./src/controller/stream-controller.ts":
|
|
|
/*!*********************************************!*\
|
|
|
!*** ./src/controller/stream-controller.ts ***!
|
|
|
\*********************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return y}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),s=i(/*! ../is-supported */"./src/is-supported.ts"),o=i(/*! ../events */"./src/events.ts"),a=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),l=i(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),c=i(/*! ../types/loader */"./src/types/loader.ts"),u=i(/*! ../loader/fragment */"./src/loader/fragment.ts"),h=i(/*! ../demux/transmuxer-interface */"./src/demux/transmuxer-interface.ts"),d=i(/*! ../types/transmuxer */"./src/types/transmuxer.ts"),f=i(/*! ./gap-controller */"./src/controller/gap-controller.ts"),p=i(/*! ../errors */"./src/errors.ts"),g=i(/*! ../utils/logger */"./src/utils/logger.ts");function v(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e){var t,i;function y(t,i){var r;return(r=e.call(this,t,i,"[stream-controller]")||this).audioCodecSwap=!1,r.gapController=null,r.level=-1,r._forceStartLoad=!1,r.altAudio=!1,r.audioOnly=!1,r.fragPlaying=null,r.onvplaying=null,r.onvseeked=null,r.fragLastKbps=0,r.stalled=!1,r.couldBacktrack=!1,r.audioCodecSwitch=!1,r.videoBuffer=null,r._registerListeners(),r}i=e,(t=y).prototype=Object.create(i.prototype),t.prototype.constructor=t,m(t,i);var _,b,S,C=y.prototype;return C._registerListeners=function(){var e=this.hls;e.on(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(o.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(o.Events.ERROR,this.onError,this),e.on(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.on(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var e=this.hls;e.off(o.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(o.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(o.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(o.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(o.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(o.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(o.Events.ERROR,this.onError,this),e.off(o.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(o.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(o.Events.BUFFER_CREATED,this.onBufferCreated,this),e.off(o.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(o.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(o.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},C.startLoad=function(e){if(this.levels){var t=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var r=i.startLevel;-1===r&&(i.config.testBandwidth?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=n.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=n.State.STOPPED},C.stopLoad=function(){this._forceStartLoad=!1,e.prototype.stopLoad.call(this)},C.doTick=function(){switch(this.state){case n.State.IDLE:this.doTickIdle();break;case n.State.WAITING_LEVEL:var e,t=this.levels,i=this.level,r=null==t||null===(e=t[i])||void 0===e?void 0:e.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=n.State.IDLE;break}break;case n.State.FRAG_LOADING_WAITING_RETRY:var s,o=self.performance.now(),a=this.retryDate;(!a||o>=a||null!==(s=this.media)&&void 0!==s&&s.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=n.State.IDLE)}this.onTickEnd()},C.onTickEnd=function(){e.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},C.doTickIdle=function(){var e,t,i=this.hls,r=this.levelLastLoaded,s=this.levels,a=this.media,h=i.config,d=i.nextLoadLevel;if(null!==r&&(a||!this.startFragRequested&&h.startFragPrefetch)&&(!this.altAudio||!this.audioOnly)&&s&&s[d]){var f=s[d];this.level=i.nextLoadLevel=d;var p=f.details;if(!p||this.state===n.State.WAITING_LEVEL||p.live&&this.levelLastLoaded!==d)this.state=n.State.WAITING_LEVEL;else{var g=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:a,c.PlaylistLevelType.MAIN);if(null!==g&&!(g.len>=this.getMaxBufferLength(f.maxBitrate))){if(this._streamEnded(g,p)){var v={};return this.altAudio&&(v.type="video"),this.hls.trigger(o.Events.BUFFER_EOS,v),void(this.state=n.State.ENDED)}var m=g.end,y=this.getNextFragment(m,p);if(this.couldBacktrack&&!this.fragPrevious&&y&&"initSegment"!==y.sn){var _=y.sn-p.startSN;_>1&&(y=p.fragments[_-1],this.fragmentTracker.removeFragment(y))}if(y&&this.fragmentTracker.getState(y)===l.FragmentState.OK&&this.nextLoadPosition>m){var b=this.audioOnly&&!this.altAudio?u.ElementaryStreamTypes.AUDIO:u.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(a,b,c.PlaylistLevelType.MAIN),y=this.getNextFragment(this.nextLoadPosition,p)}y&&(!y.initSegment||y.initSegment.data||this.bitrateTest||(y=y.initSegment),"identity"!==(null===(e=y.decryptdata)||void 0===e?void 0:e.keyFormat)||null!==(t=y.decryptdata)&&void 0!==t&&t.key?this.loadFragment(y,p,m):this.loadKey(y,p))}}}},C.loadFragment=function(t,i,r){var n,s=this.fragmentTracker.getState(t);if(this.fragCurrent=t,s===l.FragmentState.BACKTRACKED){var o=this.fragmentTracker.getBacktrackData(t);if(o)return this._handleFragmentLoadProgress(o),void this._handleFragmentLoadComplete(o);s=l.FragmentState.NOT_LOADED}s===l.FragmentState.NOT_LOADED||s===l.FragmentState.PARTIAL?"initSegment"===t.sn?this._loadInitSegment(t):this.bitrateTest?(t.bitrateTest=!0,this.log("Fragment "+t.sn+" of level "+t.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(t)):(this.startFragRequested=!0,e.prototype.loadFragment.call(this,t,i,r)):s===l.FragmentState.APPENDING?this.reduceMaxBufferLength(t.duration)&&this.fragmentTracker.removeFragment(t):0===(null===(n=this.media)||void 0===n?void 0:n.buffered.length)&&this.fragmentTracker.removeAllFragments()},C.getAppendedFrag=function(e){var t=this.fragmentTracker.getAppendedFrag(e,c.PlaylistLevelType.MAIN);return t&&"fragment"in t?t.fragment:t},C.getBufferedFrag=function(e){return this.fragmentTracker.getBufferedFrag(e,c.PlaylistLevelType.MAIN)},C.followingBufferedFrag=function(e){return e?this.getBufferedFrag(e.end+.5):null},C.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},C.nextLevelSwitch=function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var i,r=this.getAppendedFrag(t.currentTime);if(r&&r.start>1&&this.flushMainBuffer(0,r.start-1),!t.paused&&e){var n=e[this.hls.nextLoadLevel],s=this.fragLastKbps;i=s&&this.fragCurrent?this.fragCurrent.duration*n.maxBitrate/(1e3*s)+1:0}else i=0;var o=this.getBufferedFrag(t.currentTime+i);if(o){var a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();var l=a.maxStartPTS?a.maxStartPTS:a.start,c=a.duration,u=Math.max(o.end,l+Math.min(Math.max(c-this.config.maxFragLookUpTolerance,.5*c),.75*c));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}},C.abortCurrentFrag=function(){var e=this.fragCurrent;this.fragCurrent=null,null!=e&&e.loader&&e.loader.abort(),this.state===n.State.KEY_LOADING&&(this.state=n.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},C.flushMainBuffer=function(t,i){e.prototype.flushMainBuffer.call(this,t,i,this.altAudio?"video":null)},C.onMediaAttached=function(t,i){e.prototype.onMediaAttached.call(this,t,i);var r=i.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new f.default(this.config,r,this.fragmentTracker,this.hls)},C.onMediaDetaching=function(){var t=this.media;t&&(t.removeEventListener("playing",this.onvplaying),t.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),e.prototype.onMediaDetaching.call(this)},C.onMediaPlaying=function(){this.tick()},C.onMediaSeeked=function(){var e=this.media,t=e?e.currentTime:null;Object(r.isFiniteNumber)(t)&&this.log("Media seeked to "+t.toFixed(3)),this.tick()},C.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(o.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},C.onManifestParsed=function(e,t){var i,r=!1,n=!1;t.levels.forEach((function(e){(i=e.audioCodec)&&(-1!==i.indexOf("mp4a.40.2")&&(r=!0),-1!==i.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=r&&n&&!Object(s.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1},C.onLevelLoading=function(e,t){var i=this.levels;if(i&&this.state===n.State.IDLE){var r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=n.State.WAITING_LEVEL)}},C.onLevelLoaded=function(e,t){var i,r=this.levels,s=t.level,a=t.details,l=a.totalduration;if(r){this.log("Level "+s+" loaded ["+a.startSN+","+a.endSN+"], cc ["+a.startCC+", "+a.endCC+"] duration:"+l);var c=this.fragCurrent;!c||this.state!==n.State.FRAG_LOADING&&this.state!==n.State.FRAG_LOADING_WAITING_RETRY||c.level!==t.level&&c.loader&&(this.state=n.State.IDLE,c.loader.abort());var u=r[s],h=0;if(a.live||null!==(i=u.details)&&void 0!==i&&i.live){if(a.fragments[0]||(a.deltaUpdateFailed=!0),a.deltaUpdateFailed)return;h=this.alignPlaylists(a,u.details)}if(u.details=a,this.levelLastLoaded=s,this.hls.trigger(o.Events.LEVEL_UPDATED,{details:a,level:s}),this.state===n.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=n.State.IDLE}this.startFragRequested?a.live&&this.synchronizeToLiveEdge(a):this.setStartPosition(a,h),this.tick()}else this.warn("Levels were reset while loading level "+s)},C._handleFragmentLoadProgress=function(e){var t,i=e.frag,r=e.part,n=e.payload,s=this.levels;if(s){var o=s[i.level],a=o.details;if(a){var l=o.videoCodec,u=a.PTSKnown||!a.live,f=null===(t=i.initSegment)||void 0===t?void 0:t.data,p=this._getAudioCodec(o),g=this.transmuxer=this.transmuxer||new h.default(this.hls,c.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),v=r?r.index:-1,m=-1!==v,y=new d.ChunkMetadata(i.level,i.sn,i.stats.chunkCount,n.byteLength,v,m),_=this.initPTS[i.cc];g.push(n,f,p,l,i,r,a.totalduration,u,y,_)}else this.warn("Dropping fragment "+i.sn+" of level "+i.level+" after level details were reset")}else this.warn("Levels were reset while fragment load was in progress. Fragment "+i.sn+" of level "+i.level+" will not be buffered")},C.onAudioTrackSwitching=function(e,t){var i=this.altAudio,r=!!t.url,n=t.id;if(!r){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var s=this.fragCurrent;null!=s&&s.loader&&(this.log("Switching to main audio track, cancel main fragment load"),s.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;i&&a.trigger(o.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),a.trigger(o.Events.AUDIO_TRACK_SWITCHED,{id:n})}},C.onAudioTrackSwitched=function(e,t){var i=t.id,r=!!this.hls.audioTracks[i].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()},C.onBufferCreated=function(e,t){var i,r,n=t.tracks,s=!1;for(var o in n){var a=n[o];if("main"===a.id){if(r=o,i=a,"video"===o){var l=n[o];l&&(this.videoBuffer=l.buffer)}}else s=!0}s&&i?(this.log("Alternate track found, use "+r+".buffered to schedule main fragment loading"),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media},C.onFragBuffered=function(e,t){var i=t.frag,r=t.part;if(!i||i.type===c.PlaylistLevelType.MAIN){if(this.fragContextChanged(i))return this.warn("Fragment "+i.sn+(r?" p: "+r.index:"")+" of level "+i.level+" finished buffering, but was aborted. state: "+this.state),void(this.state===n.State.PARSED&&(this.state=n.State.IDLE));var s=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*s.total/(s.buffering.end-s.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}},C.onError=function(e,t){switch(t.details){case p.ErrorDetails.FRAG_LOAD_ERROR:case p.ErrorDetails.FRAG_LOAD_TIMEOUT:case p.ErrorDetails.KEY_LOAD_ERROR:case p.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(c.PlaylistLevelType.MAIN,t);break;case p.ErrorDetails.LEVEL_LOAD_ERROR:case p.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==n.State.ERROR&&(t.fatal?(this.warn(""+t.details),this.state=n.State.ERROR):t.levelRetry||this.state!==n.State.WAITING_LEVEL||(this.state=n.State.IDLE));break;case p.ErrorDetails.BUFFER_FULL_ERROR:if("main"===t.parent&&(this.state===n.State.PARSING||this.state===n.State.PARSED)){var i=!0,r=this.getFwdBufferInfo(this.media,c.PlaylistLevelType.MAIN);r&&r.len>.5&&(i=!this.reduceMaxBufferLength(r.len)),i&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}}},C.checkBuffer=function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){var i=a.BufferHelper.getBuffered(e);!this.loadedmetadata&&i.length?(this.loadedmetadata=!0,this.seekToStartPos()):t.poll(this.lastCurrentTime),this.lastCurrentTime=e.currentTime}},C.onFragLoadEmergencyAborted=function(){this.state=n.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},C.onBufferFlushed=function(e,t){var i=t.type;if(i!==u.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var r=(i===u.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,i,c.PlaylistLevelType.MAIN)}},C.onLevelsUpdated=function(e,t){this.levels=t.levels},C.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},C.seekToStartPos=function(){var e=this.media,t=e.currentTime,i=this.startPosition;if(i>=0&&t<i){if(e.seeking)return void g.logger.log("could not seek to "+i+", already seeking at "+t);var r=a.BufferHelper.getBuffered(e),n=(r.length?r.start(0):0)-i;n>0&&(n<this.config.maxBufferHole||n<this.config.maxFragLookUpTolerance)&&(g.logger.log("adjusting start position by "+n+" to match buffer start"),i+=n,this.startPosition=i),this.log("seek to target start position "+i+" from current time "+t),e.currentTime=i}},C._getAudioCodec=function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t},C._loadBitrateTestFrag=function(e){var t=this;this._doFragLoad(e).then((function(i){var r=t.hls;if(i&&!r.nextLoadLevel&&!t.fragContextChanged(e)){t.fragLoadError=0,t.state=n.State.IDLE,t.startFragRequested=!1,t.bitrateTest=!1;var s=e.stats;s.parsing.start=s.parsing.end=s.buffering.start=s.buffering.end=self.performance.now(),r.trigger(o.Events.FRAG_LOADED,i)}}))},C._handleTransmuxComplete=function(e){var t,i="main",s=this.hls,a=e.remuxResult,l=e.chunkMeta,c=this.getCurrentContext(l);if(!c)return this.warn("The loading context changed while buffering fragment "+l.sn+" of level "+l.level+". This chunk will not be buffered."),void this.resetLiveStartWhenNotLoaded(l.level);var h=c.frag,d=c.part,f=c.level,p=a.video,g=a.text,v=a.id3,m=a.initSegment,y=this.altAudio?void 0:a.audio;if(!this.fragContextChanged(h)){if(this.state=n.State.PARSING,m){m.tracks&&(this._bufferInitSegment(f,m.tracks,h,l),s.trigger(o.Events.FRAG_PARSING_INIT_SEGMENT,{frag:h,id:i,tracks:m.tracks}));var _=m.initPTS,b=m.timescale;Object(r.isFiniteNumber)(_)&&(this.initPTS[h.cc]=_,s.trigger(o.Events.INIT_PTS_FOUND,{frag:h,id:i,initPTS:_,timescale:b}))}if(p&&!1!==a.independent){if(f.details){var S=p.startPTS,C=p.endPTS,w=p.startDTS,k=p.endDTS;if(d)d.elementaryStreams[p.type]={startPTS:S,endPTS:C,startDTS:w,endDTS:k};else if(p.firstKeyFrame&&p.independent&&(this.couldBacktrack=!0),p.dropped&&p.independent){if(this.getLoadPosition()+this.config.maxBufferHole<S)return void this.backtrack(h);h.setElementaryStreamInfo(p.type,h.start,C,h.start,k,!0)}h.setElementaryStreamInfo(p.type,S,C,w,k),this.bufferFragmentData(p,h,d,l)}}else if(!1===a.independent)return void this.backtrack(h);if(y){var x=y.startPTS,E=y.endPTS,T=y.startDTS,L=y.endDTS;d&&(d.elementaryStreams[u.ElementaryStreamTypes.AUDIO]={startPTS:x,endPTS:E,startDTS:T,endDTS:L}),h.setElementaryStreamInfo(u.ElementaryStreamTypes.AUDIO,x,E,T,L),this.bufferFragmentData(y,h,d,l)}if(null!=v&&null!==(t=v.samples)&&void 0!==t&&t.length){var A={frag:h,id:i,samples:v.samples};s.trigger(o.Events.FRAG_PARSING_METADATA,A)}if(g){var R={frag:h,id:i,samples:g.samples};s.trigger(o.Events.FRAG_PARSING_USERDATA,R)}}},C._bufferInitSegment=function(e,t,i,r){var s=this;if(this.state===n.State.PARSING){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var a=t.audio,l=t.video,c=t.audiovideo;if(a){var u=e.audioCodec,h=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(u&&(u=-1!==u.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==a.metadata.channelCount&&-1===h.indexOf("firefox")&&(u="mp4a.40.5")),-1!==h.indexOf("android")&&"audio/mpeg"!==a.container&&(u="mp4a.40.2",this.log("Android: force audio codec to "+u)),e.audioCodec&&e.audioCodec!==u&&this.log('Swapping manifest audio codec "'+e.audioCodec+'" for "'+u+'"'),a.levelCodec=u,a.id="main",this.log("Init audio buffer, container:"+a.container+", codecs[selected/level/parsed]=["+(u||"")+"/"+(e.audioCodec||"")+"/"+a.codec+"]")}l&&(l.levelCodec=e.videoCodec,l.id="main",this.log("Init video buffer, container:"+l.container+", codecs[level/parsed]=["+(e.videoCodec||"")+"/"+l.codec+"]")),c&&this.log("Init audiovideo buffer, container:"+c.container+", codecs[level/parsed]=["+(e.attrs.CODECS||"")+"/"+c.codec+"]"),this.hls.trigger(o.Events.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var n=t[e].initSegment;null!=n&&n.byteLength&&s.hls.trigger(o.Events.BUFFER_APPENDING,{type:e,data:n,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tick()}},C.backtrack=function(e){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(e);var t=this.fragmentTracker.backtrack(e);this.fragPrevious=null,this.nextLoadPosition=e.start,t?this.resetFragmentLoading(e):this.state=n.State.BACKTRACKING},C.checkFragmentChanged=function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var i=e.currentTime;if(a.BufferHelper.isBuffered(e,i)?t=this.getAppendedFrag(i):a.BufferHelper.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){var r=this.fragPlaying,n=t.level;r&&t.sn===r.sn&&r.level===n&&t.urlId===r.urlId||(this.hls.trigger(o.Events.FRAG_CHANGED,{frag:t}),r&&r.level===n||this.hls.trigger(o.Events.LEVEL_SWITCHED,{level:n}),this.fragPlaying=t)}}},_=y,(b=[{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;if(e){var t=this.getAppendedFrag(e.currentTime);return this.followingBufferedFrag(t)}return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}])&&v(_.prototype,b),S&&v(_,S),y}(n.default)},"./src/controller/subtitle-stream-controller.ts":
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/controller/subtitle-stream-controller.ts ***!
|
|
|
\******************************************************/
|
|
|
/*! exports provided: SubtitleStreamController */function(e,t,i){"use strict";i.r(t),i.d(t,"SubtitleStreamController",(function(){return g}));var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../utils/logger */"./src/utils/logger.ts"),s=i(/*! ../utils/buffer-helper */"./src/utils/buffer-helper.ts"),o=i(/*! ./fragment-finders */"./src/controller/fragment-finders.ts"),a=i(/*! ../utils/discontinuities */"./src/utils/discontinuities.ts"),l=i(/*! ./level-helper */"./src/controller/level-helper.ts"),c=i(/*! ./fragment-tracker */"./src/controller/fragment-tracker.ts"),u=i(/*! ./base-stream-controller */"./src/controller/base-stream-controller.ts"),h=i(/*! ../types/loader */"./src/types/loader.ts"),d=i(/*! ../types/level */"./src/types/level.ts");function f(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var g=function(e){var t,i;function g(t,i){var r;return(r=e.call(this,t,i,"[subtitle-stream-controller]")||this).levels=[],r.currentTrackId=-1,r.tracksBuffered=[],r.mainDetails=null,r._registerListeners(),r}i=e,(t=g).prototype=Object.create(i.prototype),t.prototype.constructor=t,p(t,i);var v,m,y,_=g.prototype;return _.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},_._registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.on(r.Events.ERROR,this.onError,this),e.on(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_._unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.LEVEL_LOADED,this.onLevelLoaded,this),e.off(r.Events.ERROR,this.onError,this),e.off(r.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(r.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(r.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(r.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},_.startLoad=function(){this.stopLoad(),this.state=u.State.IDLE,this.setInterval(500),this.tick()},_.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},_.onLevelLoaded=function(e,t){this.mainDetails=t.details},_.onSubtitleFragProcessed=function(e,t){var i=t.frag,r=t.success;if(this.fragPrevious=i,this.state=u.State.IDLE,r){var n=this.tracksBuffered[this.currentTrackId];if(n){for(var s,o=i.start,a=0;a<n.length;a++)if(o>=n[a].start&&o<=n[a].end){s=n[a];break}var l=i.start+i.duration;s?s.end=l:(s={start:o,end:l},n.push(s)),this.fragmentTracker.fragBuffered(i)}}},_.onBufferFlushing=function(e,t){var i=t.startOffset,r=t.endOffset;if(0===i&&r!==Number.POSITIVE_INFINITY){var n=this.currentTrackId,s=this.levels;if(!s.length||!s[n]||!s[n].details)return;var o=r-s[n].details.targetduration;if(o<=0)return;t.endOffsetSubtitles=Math.max(0,o),this.tracksBuffered.forEach((function(e){for(var t=0;t<e.length;)if(e[t].end<=o)e.shift();else{if(!(e[t].start<o))break;e[t].start=o,t++}})),this.fragmentTracker.removeFragmentsInRange(i,o,h.PlaylistLevelType.SUBTITLE)}},_.onError=function(e,t){var i,r=t.frag;r&&r.type===h.PlaylistLevelType.SUBTITLE&&(null!==(i=this.fragCurrent)&&void 0!==i&&i.loader&&this.fragCurrent.loader.abort(),this.state=u.State.IDLE)},_.onSubtitleTracksUpdated=function(e,t){var i=this,r=t.subtitleTracks;this.tracksBuffered=[],this.levels=r.map((function(e){return new d.Level(e)})),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach((function(e){i.tracksBuffered[e.id]=[]})),this.mediaBuffer=null},_.onSubtitleTrackSwitch=function(e,t){if(this.currentTrackId=t.id,this.levels.length&&-1!==this.currentTrackId){var i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}else this.clearInterval()},_.onSubtitleTrackLoaded=function(e,t){var i,r=t.details,n=t.id,s=this.currentTrackId,c=this.levels;if(c.length){var h=c[s];if(!(n>=c.length||n!==s)&&h){if(this.mediaBuffer=this.mediaBufferTimeRanges,r.live||null!==(i=h.details)&&void 0!==i&&i.live){var d=this.mainDetails;if(r.deltaUpdateFailed||!d)return;var f=d.fragments[0];h.details?0===this.alignPlaylists(r,h.details)&&f&&Object(l.addSliding)(r,f.start):r.hasProgramDateTime&&d.hasProgramDateTime?Object(a.alignMediaPlaylistByPDT)(r,d):f&&Object(l.addSliding)(r,f.start)}h.details=r,this.levelLastLoaded=n,this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===u.State.IDLE&&(Object(o.findFragmentByPTS)(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),h.details=void 0))}}},_._handleFragmentLoadComplete=function(e){var t=e.frag,i=e.payload,n=t.decryptdata,s=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){var o=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(i),n.key.buffer,n.iv.buffer).then((function(e){var i=performance.now();s.trigger(r.Events.FRAG_DECRYPTED,{frag:t,payload:e,stats:{tstart:o,tdecrypt:i}})}))}},_.doTick=function(){if(this.media){if(this.state===u.State.IDLE){var e,t=this.currentTrackId,i=this.levels;if(!i.length||!i[t]||!i[t].details)return;var a=i[t].details,l=a.targetduration,h=this.config,d=this.media,f=s.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,d.currentTime-l,h.maxBufferHole),p=f.end;if(f.len>this.getMaxBufferLength()+l)return;console.assert(a,"Subtitle track details are defined on idle subtitle stream controller tick");var g,v=a.fragments,m=v.length,y=a.edge,_=this.fragPrevious;if(p<y){var b=h.maxFragLookUpTolerance;_&&a.hasProgramDateTime&&(g=Object(o.findFragmentByPDT)(v,_.endProgramDateTime,b)),g||!(g=Object(o.findFragmentByPTS)(_,v,p,b))&&_&&_.start<v[0].start&&(g=v[0])}else g=v[m-1];null!==(e=g)&&void 0!==e&&e.encrypted?(n.logger.log("Loading key for "+g.sn),this.state=u.State.KEY_LOADING,this.hls.trigger(r.Events.KEY_LOADING,{frag:g})):g&&this.fragmentTracker.getState(g)===c.FragmentState.NOT_LOADED&&this.loadFragment(g,a,p)}}else this.state=u.State.IDLE},_.loadFragment=function(t,i,r){this.fragCurrent=t,e.prototype.loadFragment.call(this,t,i,r)},v=g,(m=[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}])&&f(v.prototype,m),y&&f(v,y),g}(u.default)},"./src/controller/subtitle-track-controller.ts":
|
|
|
/*!*****************************************************!*\
|
|
|
!*** ./src/controller/subtitle-track-controller.ts ***!
|
|
|
\*****************************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),s=i(/*! ./base-playlist-controller */"./src/controller/base-playlist-controller.ts"),o=i(/*! ../types/loader */"./src/types/loader.ts");function a(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=function(e){var t,i;function s(t){var i;return(i=e.call(this,t,"[subtitle-track-controller]")||this).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}i=e,(t=s).prototype=Object.create(i.prototype),t.prototype.constructor=t,l(t,i);var c,h,d,f=s.prototype;return f.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,e.prototype.destroy.call(this)},f.registerListeners=function(){var e=this.hls;e.on(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.on(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(r.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){var e=this.hls;e.off(r.Events.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(r.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(r.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(r.Events.MANIFEST_PARSED,this.onManifestParsed,this),e.off(r.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(r.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(r.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(r.Events.ERROR,this.onError,this)},f.onMediaAttached=function(e,t){this.media=t.media,this.media&&(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))},f.pollTrackChange=function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)},f.onMediaDetaching=function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),u(this.media.textTracks).forEach((function(e){Object(n.clearCurrentCues)(e)})),this.subtitleTrack=-1,this.media=null)},f.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},f.onManifestParsed=function(e,t){this.tracks=t.subtitleTracks},f.onSubtitleTrackLoaded=function(e,t){var i=t.id,r=t.details,n=this.trackId,s=this.tracksInGroup[n];if(s){var o=s.details;s.details=t.details,this.log("subtitle track "+i+" loaded ["+r.startSN+"-"+r.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,t,o))}else this.warn("Invalid subtitle track id "+i)},f.onLevelLoading=function(e,t){this.switchLevel(t.level)},f.onLevelSwitching=function(e,t){this.switchLevel(t.level)},f.switchLevel=function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var i=t.textGroupIds[t.urlId];if(this.groupId!==i){var n=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,s=this.tracks.filter((function(e){return!i||e.groupId===i}));this.tracksInGroup=s;var o=this.findTrackId(null==n?void 0:n.name)||this.findTrackId();this.groupId=i;var a={subtitleTracks:s};this.log("Updating subtitle tracks, "+s.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(r.Events.SUBTITLE_TRACKS_UPDATED,a),-1!==o&&this.setSubtitleTrack(o,n)}}},f.findTrackId=function(e){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var r=t[i];if((!this.selectDefaultTrack||r.default)&&(!e||e===r.name))return r.id}return-1},f.onError=function(t,i){e.prototype.onError.call(this,t,i),!i.fatal&&i.context&&i.context.type===o.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},f.loadPlaylist=function(e){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var i=t.id,n=t.groupId,s=t.url;if(e)try{s=e.addDirectives(s)}catch(e){this.warn("Could not construct new URL with HLS Delivery Directives: "+e)}this.log("Loading subtitle playlist for id "+i),this.hls.trigger(r.Events.SUBTITLE_TRACK_LOADING,{url:s,id:i,groupId:n,deliveryDirectives:e||null})}},f.toggleTrackModes=function(e){var t=this,i=this.media,r=this.subtitleDisplay,n=this.trackId;if(i){var s=u(i.textTracks),o=s.filter((function(e){return e.groupId===t.groupId}));if(-1===e)[].slice.call(s).forEach((function(e){e.mode="disabled"}));else{var a=o[n];a&&(a.mode="disabled")}var l=o[e];l&&(l.mode=r?"showing":"hidden")}},f.setSubtitleTrack=function(e,t){var i,n=this.tracksInGroup;if(this.media){if(this.trackId!==e&&this.toggleTrackModes(e),!(this.trackId===e&&(-1===e||null!==(i=n[e])&&void 0!==i&&i.details)||e<-1||e>=n.length)){this.clearTimer();var s=n[e];if(this.log("Switching to subtitle track "+e),this.trackId=e,s){var o=s.id,a=s.groupId,l=void 0===a?"":a,c=s.name,u=s.type,h=s.url;this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:c,type:u,url:h});var d=this.switchParams(s.url,null==t?void 0:t.details);this.loadPlaylist(d)}else this.hls.trigger(r.Events.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=u(this.media.textTracks),i=0;i<t.length;i++)if("hidden"===t[i].mode)e=i;else if("showing"===t[i].mode){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}},c=s,(h=[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}}])&&a(c.prototype,h),d&&a(c,d),s}(s.default);function u(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];"subtitles"===r.kind&&r.label&&t.push(e[i])}return t}t.default=c},"./src/controller/timeline-controller.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/controller/timeline-controller.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: TimelineController */function(e,t,i){"use strict";i.r(t),i.d(t,"TimelineController",(function(){return d}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../utils/cea-608-parser */"./src/utils/cea-608-parser.ts"),o=i(/*! ../utils/output-filter */"./src/utils/output-filter.ts"),a=i(/*! ../utils/webvtt-parser */"./src/utils/webvtt-parser.ts"),l=i(/*! ../utils/texttrack-utils */"./src/utils/texttrack-utils.ts"),c=i(/*! ../utils/imsc1-ttml-parser */"./src/utils/imsc1-ttml-parser.ts"),u=i(/*! ../types/loader */"./src/types/loader.ts"),h=i(/*! ../utils/logger */"./src/utils/logger.ts"),d=function(){function e(e){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={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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 t=new o.default(this,"textTrack1"),i=new o.default(this,"textTrack2"),r=new o.default(this,"textTrack3"),a=new o.default(this,"textTrack4");this.cea608Parser1=new s.default(1,t,i),this.cea608Parser2=new s.default(3,r,a)}e.on(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(n.Events.FRAG_LOADING,this.onFragLoading,this),e.on(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.on(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=e.prototype;return t.destroy=function(){var e=this.hls;e.off(n.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(n.Events.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(n.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(n.Events.FRAG_LOADING,this.onFragLoading,this),e.off(n.Events.FRAG_LOADED,this.onFragLoaded,this),e.off(n.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(n.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(n.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(n.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(n.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(e,t,i,r,s){for(var o,a,l,c,u=!1,h=s.length;h--;){var d=s[h],f=(o=d[0],a=d[1],l=t,c=i,Math.min(a,c)-Math.max(o,l));if(f>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],i),u=!0,f/(i-t)>.5))return}if(u||s.push([t,i]),this.config.renderTextTracksNatively){var p=this.captionsTracks[e];this.Cues.newCue(p,t,i,r)}else{var g=this.Cues.newCue(null,t,i,r);this.hls.trigger(n.Events.CUES_PARSED,{type:"captions",cues:g,track:e})}},t.onInitPtsFound=function(e,t){var i=this,r=t.frag,s=t.id,o=t.initPTS,a=t.timescale,l=this.unparsedVttFrags;"main"===s&&(this.initPTS[r.cc]=o,this.timescale[r.cc]=a),l.length&&(this.unparsedVttFrags=[],l.forEach((function(e){i.onFragLoaded(n.Events.FRAG_LOADED,e)})))},t.getExistingTrack=function(e){var t=this.media;if(t)for(var i=0;i<t.textTracks.length;i++){var r=t.textTracks[i];if(r[e])return r}return null},t.createCaptionsTrack=function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)},t.createNativeTrack=function(e){if(!this.captionsTracks[e]){var t=this.captionsProperties,i=this.captionsTracks,r=this.media,n=t[e],s=n.label,o=n.languageCode,a=this.getExistingTrack(e);if(a)i[e]=a,Object(l.clearCurrentCues)(i[e]),Object(l.sendAddTrackEvent)(i[e],r);else{var c=this.createTextTrack("captions",s,o);c&&(c[e]=!0,i[e]=c)}}},t.createNonNativeTrack=function(e){if(!this.nonNativeCaptionsTracks[e]){var t=this.captionsProperties[e];if(t){var i={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media.default,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}}},t.createTextTrack=function(e,t,i){var r=this.media;if(r)return r.addTextTrack(e,t,i)},t.onMediaAttaching=function(e,t){this.media=t.media,this._cleanTracks()},t.onMediaDetaching=function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){Object(l.clearCurrentCues)(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}},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())},t._cleanTracks=function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var i=0;i<t.length;i++)Object(l.clearCurrentCues)(t[i])}},t.onSubtitleTracksUpdated=function(e,t){var i=this;this.textTracks=[];var r=t.subtitleTracks||[],s=r.some((function(e){return e.textCodec===c.IMSC1_CODEC}));if(this.config.enableWebVTT||s&&this.config.enableIMSC1){var o=this.tracks&&r&&this.tracks.length===r.length;if(this.tracks=r||[],this.config.renderTextTracksNatively){var a=this.media?this.media.textTracks:[];this.tracks.forEach((function(e,t){var r;if(t<a.length){for(var n=null,s=0;s<a.length;s++)if(f(a[s],e)){n=a[s];break}n&&(r=n)}r?Object(l.clearCurrentCues)(r):(r=i.createTextTrack("subtitles",e.name,e.lang))&&(r.mode="disabled"),r&&(r.groupId=e.groupId,i.textTracks.push(r))}))}else if(!o&&this.tracks&&this.tracks.length){var u=this.tracks.map((function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e.default,subtitleTrack:e}}));this.hls.trigger(n.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:u})}}},t.onManifestLoaded=function(e,t){var i=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(t){var r="textTrack"+t[1],n=i.captionsProperties[r];n&&(n.label=e.name,e.lang&&(n.languageCode=e.lang),n.media=e)}}))},t.onFragLoading=function(e,t){var i=this.cea608Parser1,r=this.cea608Parser2,n=this.lastSn,s=this.lastPartIndex;if(this.enabled&&i&&r&&t.frag.type===u.PlaylistLevelType.MAIN){var o,a,l=t.frag.sn,c=null!=(o=null==t||null===(a=t.part)||void 0===a?void 0:a.index)?o:-1;l===n+1||l===n&&c===s+1||(i.reset(),r.reset()),this.lastSn=l,this.lastPartIndex=c}},t.onFragLoaded=function(e,t){var i=t.frag,s=t.payload,o=this.initPTS,a=this.unparsedVttFrags;if(i.type===u.PlaylistLevelType.SUBTITLE)if(s.byteLength){if(!Object(r.isFiniteNumber)(o[i.cc]))return a.push(t),void(o.length&&this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Missing initial subtitle PTS")}));var l=i.decryptdata;if(null==l||null==l.key||"AES-128"!==l.method){var h=this.tracks[i.level],d=this.vttCCs;d[i.cc]||(d[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),h&&h.textCodec===c.IMSC1_CODEC?this._parseIMSC1(i,s):this._parseVTTs(i,s,d)}}else this.hls.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(e,t){var i=this,r=this.hls;Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(t){i._appendCues(t,e.level),r.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(t){h.logger.log("Failed to parse IMSC1: "+t),r.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))},t._parseVTTs=function(e,t,i){var r=this,s=this.hls;Object(a.parseWebVTT)(t,this.initPTS[e.cc],this.timescale[e.cc],i,e.cc,e.start,(function(t){r._appendCues(t,e.level),s.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(i){r._fallbackToIMSC1(e,t),h.logger.log("Failed to parse VTT cue: "+i),s.trigger(n.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:i})}))},t._fallbackToIMSC1=function(e,t){var i=this,r=this.tracks[e.level];r.textCodec||Object(c.parseIMSC1)(t,this.initPTS[e.cc],this.timescale[e.cc],(function(){r.textCodec=c.IMSC1_CODEC,i._parseIMSC1(e,t)}),(function(){r.textCodec="wvtt"}))},t._appendCues=function(e,t){var i=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[t];if("disabled"===r.mode)return;e.forEach((function(e){return Object(l.addCueToTrack)(r,e)}))}else{var s=this.tracks[t].default?"default":"subtitles"+t;i.trigger(n.Events.CUES_PARSED,{type:"subtitles",cues:e,track:s})}},t.onFragDecrypted=function(e,t){var i=t.frag;if(i.type===u.PlaylistLevelType.SUBTITLE){if(!Object(r.isFiniteNumber)(this.initPTS[i.cc]))return void this.unparsedVttFrags.push(t);this.onFragLoaded(n.Events.FRAG_LOADED,t)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(e,t){var i=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&i&&r)for(var n=0;n<t.samples.length;n++){var s=t.samples[n].bytes;if(s){var o=this.extractCea608Data(s);i.addData(t.samples[n].pts,o[0]),r.addData(t.samples[n].pts,o[1])}}},t.onBufferFlushing=function(e,t){var i=t.startOffset,r=t.endOffset,n=t.endOffsetSubtitles,s=t.type,o=this.media;if(o&&!(o.currentTime<r)){if(!s||"video"===s){var a=this.captionsTracks;Object.keys(a).forEach((function(e){return Object(l.removeCuesInRange)(a[e],i,r)}))}if(this.config.renderTextTracksNatively&&0===i&&void 0!==n){var c=this.textTracks;Object.keys(c).forEach((function(e){return Object(l.removeCuesInRange)(c[e],i,n)}))}}},t.extractCea608Data=function(e){for(var t=31&e[0],i=2,r=[[],[]],n=0;n<t;n++){var s=e[i++],o=127&e[i++],a=127&e[i++],l=3&s;0===o&&0===a||0!=(4&s)&&(0!==l&&1!==l||(r[l].push(o),r[l].push(a)))}return r},e}();function f(e,t){return e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}},"./src/crypt/aes-crypto.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/crypt/aes-crypto.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=t}return e.prototype.decrypt=function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)},e}()},"./src/crypt/aes-decryptor.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/crypt/aes-decryptor.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: removePadding, default */function(e,t,i){"use strict";i.r(t),i.d(t,"removePadding",(function(){return n})),i.d(t,"default",(function(){return s}));var r=i(/*! ../utils/typed-array */"./src/utils/typed-array.ts");function n(e){var t=e.byteLength,i=t&&new DataView(e.buffer).getUint8(t-1);return i?Object(r.sliceUint8)(e,0,t-i):e}var s=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 t=e.prototype;return t.uint8ArrayToUint32Array_=function(e){for(var t=new DataView(e),i=new Uint32Array(4),r=0;r<4;r++)i[r]=t.getUint32(4*r);return i},t.initTable=function(){var e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],n=i[1],s=i[2],o=i[3],a=this.invSubMix,l=a[0],c=a[1],u=a[2],h=a[3],d=new Uint32Array(256),f=0,p=0,g=0;for(g=0;g<256;g++)d[g]=g<128?g<<1:g<<1^283;for(g=0;g<256;g++){var v=p^p<<1^p<<2^p<<3^p<<4;v=v>>>8^255&v^99,e[f]=v,t[v]=f;var m=d[f],y=d[m],_=d[y],b=257*d[v]^16843008*v;r[f]=b<<24|b>>>8,n[f]=b<<16|b>>>16,s[f]=b<<8|b>>>24,o[f]=b,b=16843009*_^65537*y^257*m^16843008*f,l[v]=b<<24|b>>>8,c[v]=b<<16|b>>>16,u[v]=b<<8|b>>>24,h[v]=b,f?(f=m^d[d[d[_^m]]],p^=d[d[p]]):f=p=1}},t.expandKey=function(e){for(var t=this.uint8ArrayToUint32Array_(e),i=!0,r=0;r<t.length&&i;)i=t[r]===this.key[r],r++;if(!i){this.key=t;var n=this.keySize=t.length;if(4!==n&&6!==n&&8!==n)throw new Error("Invalid aes key size="+n);var s,o,a,l,c=this.ksRows=4*(n+6+1),u=this.keySchedule=new Uint32Array(c),h=this.invKeySchedule=new Uint32Array(c),d=this.sBox,f=this.rcon,p=this.invSubMix,g=p[0],v=p[1],m=p[2],y=p[3];for(s=0;s<c;s++)s<n?a=u[s]=t[s]:(l=a,s%n==0?(l=d[(l=l<<8|l>>>24)>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l],l^=f[s/n|0]<<24):n>6&&s%n==4&&(l=d[l>>>24]<<24|d[l>>>16&255]<<16|d[l>>>8&255]<<8|d[255&l]),u[s]=a=(u[s-n]^l)>>>0);for(o=0;o<c;o++)s=c-o,l=3&o?u[s]:u[s-4],h[o]=o<4||s<=4?l:g[d[l>>>24]]^v[d[l>>>16&255]]^m[d[l>>>8&255]]^y[d[255&l]],h[o]=h[o]>>>0}},t.networkToHostOrderSwap=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},t.decrypt=function(e,t,i){for(var r,n,s,o,a,l,c,u,h,d,f,p,g,v,m=this.keySize+6,y=this.invKeySchedule,_=this.invSBox,b=this.invSubMix,S=b[0],C=b[1],w=b[2],k=b[3],x=this.uint8ArrayToUint32Array_(i),E=x[0],T=x[1],L=x[2],A=x[3],R=new Int32Array(e),D=new Int32Array(R.length),O=this.networkToHostOrderSwap;t<R.length;){for(h=O(R[t]),d=O(R[t+1]),f=O(R[t+2]),p=O(R[t+3]),a=h^y[0],l=p^y[1],c=f^y[2],u=d^y[3],g=4,v=1;v<m;v++)r=S[a>>>24]^C[l>>16&255]^w[c>>8&255]^k[255&u]^y[g],n=S[l>>>24]^C[c>>16&255]^w[u>>8&255]^k[255&a]^y[g+1],s=S[c>>>24]^C[u>>16&255]^w[a>>8&255]^k[255&l]^y[g+2],o=S[u>>>24]^C[a>>16&255]^w[l>>8&255]^k[255&c]^y[g+3],a=r,l=n,c=s,u=o,g+=4;r=_[a>>>24]<<24^_[l>>16&255]<<16^_[c>>8&255]<<8^_[255&u]^y[g],n=_[l>>>24]<<24^_[c>>16&255]<<16^_[u>>8&255]<<8^_[255&a]^y[g+1],s=_[c>>>24]<<24^_[u>>16&255]<<16^_[a>>8&255]<<8^_[255&l]^y[g+2],o=_[u>>>24]<<24^_[a>>16&255]<<16^_[l>>8&255]<<8^_[255&c]^y[g+3],D[t]=O(r^E),D[t+1]=O(o^T),D[t+2]=O(s^L),D[t+3]=O(n^A),E=h,T=d,L=f,A=p,t+=4}return D.buffer},e}()},"./src/crypt/decrypter.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/crypt/decrypter.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return c}));var r=i(/*! ./aes-crypto */"./src/crypt/aes-crypto.ts"),n=i(/*! ./fast-aes-key */"./src/crypt/fast-aes-key.ts"),s=i(/*! ./aes-decryptor */"./src/crypt/aes-decryptor.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=i(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),c=function(){function e(e,t,i){var r=(void 0===i?{}:i).removePKCS7Padding,n=void 0===r||r;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=e,this.config=t,this.removePKCS7Padding=n,n)try{var s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch(e){}null===this.subtle&&(this.config.enableSoftwareAES=!0)}var t=e.prototype;return t.destroy=function(){this.observer=null},t.isSync=function(){return this.config.enableSoftwareAES},t.flush=function(){var e=this.currentResult;if(e){var t=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Object(s.removePadding)(t):t}this.reset()},t.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},t.decrypt=function(e,t,i,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(e),t,i);var n=this.flush();n&&r(n.buffer)}else this.webCryptoDecrypt(new Uint8Array(e),t,i).then(r)},t.softwareDecrypt=function(e,t,i){var r=this.currentIV,n=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(e=Object(a.appendUint8Array)(o,e),this.remainderData=null);var c=this.getValidChunk(e);if(!c.length)return null;r&&(i=r);var u=this.softwareDecrypter;u||(u=this.softwareDecrypter=new s.default),u.expandKey(t);var h=n;return this.currentResult=u.decrypt(c.buffer,0,i),this.currentIV=Object(l.sliceUint8)(c,-16).buffer,h||null},t.webCryptoDecrypt=function(e,t,i){var s=this,o=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new n.default(o,t)),this.fastAesKey.expandKey().then((function(t){return o?new r.default(o,i).decrypt(e.buffer,t):Promise.reject(new Error("web crypto not initialized"))})).catch((function(r){return s.onWebCryptoError(r,e,t,i)}))},t.onWebCryptoError=function(e,t,i,r){return o.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",e),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(t,i,r)},t.getValidChunk=function(e){var t=e,i=e.length-e.length%16;return i!==e.length&&(t=Object(l.sliceUint8)(e,0,i),this.remainderData=Object(l.sliceUint8)(e,i)),t},t.logOnce=function(e){this.logEnabled&&(o.logger.log("[decrypter.ts]: "+e),this.logEnabled=!1)},e}()},"./src/crypt/fast-aes-key.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/crypt/fast-aes-key.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=t}return e.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},e}()},"./src/demux/aacdemuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/aacdemuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),n=i(/*! ./adts */"./src/demux/adts.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=i(/*! ../demux/id3 */"./src/demux/id3.ts");function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,i;function r(t,i){var r;return(r=e.call(this)||this).observer=void 0,r.config=void 0,r.observer=t,r.config=i,r}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,a(t,i);var l=r.prototype;return l.resetInitSegment=function(t,i,r){e.prototype.resetInitSegment.call(this,t,i,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(e){if(!e)return!1;for(var t=(o.getID3Data(e,0)||[]).length,i=e.length;t<i;t++)if(n.probe(e,t))return s.logger.log("ADTS sync word found !"),!0;return!1},l.canParse=function(e,t){return n.canParse(e,t)},l.appendFrame=function(e,t,i){n.initTrackConfig(e,this.observer,t,i,e.manifestCodec);var r=n.appendFrame(e,t,i,this.initPTS,this.frameIndex);if(r&&0===r.missing)return r},r}(r.default);l.minProbeByteLength=9,t.default=l},"./src/demux/adts.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/demux/adts.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: getAudioConfig, isHeaderPattern, getHeaderLength, getFullFrameLength, canGetFrameLength, isHeader, canParse, probe, initTrackConfig, getFrameDuration, parseFrameHeader, appendFrame */function(e,t,i){"use strict";i.r(t),i.d(t,"getAudioConfig",(function(){return o})),i.d(t,"isHeaderPattern",(function(){return a})),i.d(t,"getHeaderLength",(function(){return l})),i.d(t,"getFullFrameLength",(function(){return c})),i.d(t,"canGetFrameLength",(function(){return u})),i.d(t,"isHeader",(function(){return h})),i.d(t,"canParse",(function(){return d})),i.d(t,"probe",(function(){return f})),i.d(t,"initTrackConfig",(function(){return p})),i.d(t,"getFrameDuration",(function(){return g})),i.d(t,"parseFrameHeader",(function(){return v})),i.d(t,"appendFrame",(function(){return m}));var r=i(/*! ../utils/logger */"./src/utils/logger.ts"),n=i(/*! ../errors */"./src/errors.ts"),s=i(/*! ../events */"./src/events.ts");function o(e,t,i,o){var a,l,c,u,h=navigator.userAgent.toLowerCase(),d=o,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&t[i+2])>>>6);var p=(60&t[i+2])>>>2;if(!(p>f.length-1))return c=(1&t[i+2])<<2,c|=(192&t[i+3])>>>6,r.logger.log("manifest codec:"+o+", ADTS type:"+a+", samplingIndex:"+p),/firefox/i.test(h)?p>=6?(a=5,u=new Array(4),l=p-3):(a=2,u=new Array(2),l=p):-1!==h.indexOf("android")?(a=2,u=new Array(2),l=p):(a=5,u=new Array(4),o&&(-1!==o.indexOf("mp4a.40.29")||-1!==o.indexOf("mp4a.40.5"))||!o&&p>=6?l=p-3:((o&&-1!==o.indexOf("mp4a.40.2")&&(p>=6&&1===c||/vivaldi/i.test(h))||!o&&1===c)&&(a=2,u=new Array(2)),l=p)),u[0]=a<<3,u[0]|=(14&p)>>1,u[1]|=(1&p)<<7,u[1]|=c<<3,5===a&&(u[1]|=(14&l)>>1,u[2]=(1&l)<<7,u[2]|=8,u[3]=0),{config:u,samplerate:f[p],channelCount:c,codec:"mp4a.40."+a,manifestCodec:d};e.trigger(s.Events.ERROR,{type:n.ErrorTypes.MEDIA_ERROR,details:n.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+p})}function a(e,t){return 255===e[t]&&240==(246&e[t+1])}function l(e,t){return 1&e[t+1]?7:9}function c(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function u(e,t){return t+5<e.length}function h(e,t){return t+1<e.length&&a(e,t)}function d(e,t){return u(e,t)&&a(e,t)&&c(e,t)<=e.length-t}function f(e,t){if(h(e,t)){var i=l(e,t);if(t+i>=e.length)return!1;var r=c(e,t);if(r<=i)return!1;var n=t+r;return n===e.length||h(e,n)}return!1}function p(e,t,i,n,s){if(!e.samplerate){var a=o(t,i,n,s);if(!a)return;e.config=a.config,e.samplerate=a.samplerate,e.channelCount=a.channelCount,e.codec=a.codec,e.manifestCodec=a.manifestCodec,r.logger.log("parsed codec:"+e.codec+", rate:"+a.samplerate+", channels:"+a.channelCount)}}function g(e){return 9216e4/e}function v(e,t,i,r,n){var s=l(e,t),o=c(e,t);if((o-=s)>0)return{headerLength:s,frameLength:o,stamp:i+r*n}}function m(e,t,i,r,n){var s=v(t,i,r,n,g(e.samplerate));if(s){var o,a=s.frameLength,l=s.headerLength,c=s.stamp,u=l+a,h=Math.max(0,i+u-t.length);h?(o=new Uint8Array(u-l)).set(t.subarray(i+l,t.length),0):o=t.subarray(i+l,i+u);var d={unit:o,pts:c};return h||e.samples.push(d),{sample:d,length:u,missing:h}}}},"./src/demux/base-audio-demuxer.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/demux/base-audio-demuxer.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: initPTSFn, default */function(e,t,i){"use strict";i.r(t),i.d(t,"initPTSFn",(function(){return c}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../demux/id3 */"./src/demux/id3.ts"),s=i(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),o=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),a=i(/*! ../utils/typed-array */"./src/utils/typed-array.ts"),l=function(){function e(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var t=e.prototype;return t.resetInitSegment=function(e,t,i){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},t.resetTimeStamp=function(){},t.resetContiguity=function(){},t.canParse=function(e,t){return!1},t.appendFrame=function(e,t,i){},t.demux=function(e,t){this.cachedData&&(e=Object(o.appendUint8Array)(this.cachedData,e),this.cachedData=null);var i,r,l=n.getID3Data(e,0),u=l?l.length:0,h=this._audioTrack,d=this._id3Track,f=l?n.getTimeStamp(l):void 0,p=e.length;for(0!==this.frameIndex&&null!==this.initPTS||(this.initPTS=c(f,t)),l&&l.length>0&&d.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;u<p;){if(this.canParse(e,u)){var g=this.appendFrame(h,e,u);g?(this.frameIndex++,r=g.sample.pts,i=u+=g.length):u=p}else n.canParse(e,u)?(l=n.getID3Data(e,u),d.samples.push({pts:r,dts:r,data:l}),i=u+=l.length):u++;if(u===p&&i!==p){var v=Object(a.sliceUint8)(e,i);this.cachedData?this.cachedData=Object(o.appendUint8Array)(this.cachedData,v):this.cachedData=v}}return{audioTrack:h,avcTrack:Object(s.dummyTrack)(),id3Track:d,textTrack:Object(s.dummyTrack)()}},t.demuxSampleAes=function(e,t,i){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},t.flush=function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(s.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(s.dummyTrack)()}},t.destroy=function(){},e}(),c=function(e,t){return Object(r.isFiniteNumber)(e)?90*e:9e4*t};t.default=l},"./src/demux/chunk-cache.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/demux/chunk-cache.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return r}));var r=function(){function e(){this.chunks=[],this.dataLength=0}var t=e.prototype;return t.push=function(e){this.chunks.push(e),this.dataLength+=e.length},t.flush=function(){var e,t=this.chunks,i=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var i=new Uint8Array(t),r=0,n=0;n<e.length;n++){var s=e[n];i.set(s,r),r+=s.length}return i}(t,i),this.reset(),e):new Uint8Array(0)},t.reset=function(){this.chunks.length=0,this.dataLength=0},e}()},"./src/demux/dummy-demuxed-track.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/demux/dummy-demuxed-track.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: dummyTrack */function(e,t,i){"use strict";function r(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}i.r(t),i.d(t,"dummyTrack",(function(){return r}))},"./src/demux/exp-golomb.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/exp-golomb.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../utils/logger */"./src/utils/logger.ts"),n=function(){function e(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}var t=e.prototype;return t.loadWord=function(){var e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),n=Math.min(4,t);if(0===n)throw new Error("no bytes available");r.set(e.subarray(i,i+n)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*n,this.bytesAvailable-=n},t.skipBits=function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},t.readBits=function(e){var t=Math.min(this.bitsAvailable,e),i=this.word>>>32-t;return e>32&&r.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?i<<t|this.readBits(t):i},t.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if(0!=(this.word&2147483648>>>e))return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},t.skipUEG=function(){this.skipBits(1+this.skipLZ())},t.skipEG=function(){this.skipBits(1+this.skipLZ())},t.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},t.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},t.readBoolean=function(){return 1===this.readBits(1)},t.readUByte=function(){return this.readBits(8)},t.readUShort=function(){return this.readBits(16)},t.readUInt=function(){return this.readBits(32)},t.skipScalingList=function(e){for(var t=8,i=8,r=0;r<e;r++)0!==i&&(i=(t+this.readEG()+256)%256),t=0===i?t:i},t.readSPS=function(){var e,t,i,r=0,n=0,s=0,o=0,a=this.readUByte.bind(this),l=this.readBits.bind(this),c=this.readUEG.bind(this),u=this.readBoolean.bind(this),h=this.skipBits.bind(this),d=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);a();var g=a();if(l(5),h(3),a(),f(),100===g||110===g||122===g||244===g||44===g||83===g||86===g||118===g||128===g){var v=c();if(3===v&&h(1),f(),f(),h(1),u())for(t=3!==v?8:12,i=0;i<t;i++)u()&&p(i<6?16:64)}f();var m=c();if(0===m)c();else if(1===m)for(h(1),d(),d(),e=c(),i=0;i<e;i++)d();f(),h(1);var y=c(),_=c(),b=l(1);0===b&&h(1),h(1),u()&&(r=c(),n=c(),s=c(),o=c());var S=[1,1];if(u()&&u())switch(a()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[a()<<8|a(),a()<<8|a()]}return{width:Math.ceil(16*(y+1)-2*r-2*n),height:(2-b)*(_+1)*16-(b?2:4)*(s+o),pixelRatio:S}},t.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();t.default=n},"./src/demux/id3.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/demux/id3.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: isHeader, isFooter, getID3Data, canParse, getTimeStamp, isTimeStampFrame, getID3Frames, decodeFrame, utf8ArrayToStr, testables */function(e,t,i){"use strict";i.r(t),i.d(t,"isHeader",(function(){return n})),i.d(t,"isFooter",(function(){return s})),i.d(t,"getID3Data",(function(){return o})),i.d(t,"canParse",(function(){return l})),i.d(t,"getTimeStamp",(function(){return c})),i.d(t,"isTimeStampFrame",(function(){return u})),i.d(t,"getID3Frames",(function(){return d})),i.d(t,"decodeFrame",(function(){return f})),i.d(t,"utf8ArrayToStr",(function(){return y})),i.d(t,"testables",(function(){return _}));var r,n=function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},s=function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128},o=function(e,t){for(var i=t,r=0;n(e,t);)r+=10,r+=a(e,t+6),s(e,t+10)&&(r+=10),t+=r;if(r>0)return e.subarray(i,i+r)},a=function(e,t){var i=0;return i=(127&e[t])<<21,i|=(127&e[t+1])<<14,i|=(127&e[t+2])<<7,i|=127&e[t+3]},l=function(e,t){return n(e,t)&&a(e,t+6)+10<=e.length-t},c=function(e){for(var t=d(e),i=0;i<t.length;i++){var r=t[i];if(u(r))return m(r)}},u=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},h=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),i=a(e,4);return{type:t,size:i,data:e.subarray(10,10+i)}},d=function(e){for(var t=0,i=[];n(e,t);){for(var r=a(e,t+6),o=(t+=10)+r;t+8<o;){var l=h(e.subarray(t)),c=f(l);c&&i.push(c),t+=l.size+10}s(e,t)&&(t+=10)}return i},f=function(e){return"PRIV"===e.type?p(e):"W"===e.type[0]?v(e):g(e)},p=function(e){if(!(e.size<2)){var t=y(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}}},g=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,i=y(e.data.subarray(t),!0);t+=i.length+1;var r=y(e.data.subarray(t));return{key:e.type,info:i,data:r}}var n=y(e.data.subarray(1));return{key:e.type,data:n}}},v=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,i=y(e.data.subarray(t),!0);t+=i.length+1;var r=y(e.data.subarray(t));return{key:e.type,info:i,data:r}}var n=y(e.data);return{key:e.type,data:n}},m=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),i=1&t[3],r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},y=function(e,t){void 0===t&&(t=!1);var i=b();if(i){var r=i.decode(e);if(t){var n=r.indexOf("\0");return-1!==n?r.substring(0,n):r}return r.replace(/\0/g,"")}for(var s,o,a,l=e.length,c="",u=0;u<l;){if(0===(s=e[u++])&&t)return c;if(0!==s&&3!==s)switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:c+=String.fromCharCode(s);break;case 12:case 13:o=e[u++],c+=String.fromCharCode((31&s)<<6|63&o);break;case 14:o=e[u++],a=e[u++],c+=String.fromCharCode((15&s)<<12|(63&o)<<6|(63&a)<<0)}}return c},_={decodeTextFrame:g};function b(){return r||void 0===self.TextDecoder||(r=new self.TextDecoder("utf-8")),r}},"./src/demux/mp3demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp3demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./base-audio-demuxer */"./src/demux/base-audio-demuxer.ts"),n=i(/*! ../demux/id3 */"./src/demux/id3.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=i(/*! ./mpegaudio */"./src/demux/mpegaudio.ts");function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=function(e){var t,i;function r(){return e.apply(this,arguments)||this}i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,a(t,i);var l=r.prototype;return l.resetInitSegment=function(t,i,r){e.prototype.resetInitSegment.call(this,t,i,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:t,duration:r,inputTimeScale:9e4,dropped:0}},r.probe=function(e){if(!e)return!1;for(var t=(n.getID3Data(e,0)||[]).length,i=e.length;t<i;t++)if(o.probe(e,t))return s.logger.log("MPEG Audio sync word found !"),!0;return!1},l.canParse=function(e,t){return o.canParse(e,t)},l.appendFrame=function(e,t,i){if(null!==this.initPTS)return o.appendFrame(e,t,i,this.initPTS,this.frameIndex)},r}(r.default);l.minProbeByteLength=4,t.default=l},"./src/demux/mp4demuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/mp4demuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),n=i(/*! ./dummy-demuxed-track */"./src/demux/dummy-demuxed-track.ts"),s=function(){function e(e,t){this.remainderData=null,this.config=void 0,this.config=t}var t=e.prototype;return t.resetTimeStamp=function(){},t.resetInitSegment=function(){},t.resetContiguity=function(){},e.probe=function(e){return Object(r.findBox)({data:e,start:0,end:Math.min(e.length,16384)},["moof"]).length>0},t.demux=function(e){var t=e,i=Object(n.dummyTrack)();if(this.config.progressive){this.remainderData&&(t=Object(r.appendUint8Array)(this.remainderData,e));var s=Object(r.segmentValidRange)(t);this.remainderData=s.remainder,i.samples=s.valid||new Uint8Array}else i.samples=t;return{audioTrack:Object(n.dummyTrack)(),avcTrack:i,id3Track:Object(n.dummyTrack)(),textTrack:Object(n.dummyTrack)()}},t.flush=function(){var e=Object(n.dummyTrack)();return e.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(n.dummyTrack)(),avcTrack:e,id3Track:Object(n.dummyTrack)(),textTrack:Object(n.dummyTrack)()}},t.demuxSampleAes=function(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},t.destroy=function(){},e}();s.minProbeByteLength=1024,t.default=s},"./src/demux/mpegaudio.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/mpegaudio.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: appendFrame, parseHeader, isHeaderPattern, isHeader, canParse, probe */function(e,t,i){"use strict";i.r(t),i.d(t,"appendFrame",(function(){return l})),i.d(t,"parseHeader",(function(){return c})),i.d(t,"isHeaderPattern",(function(){return u})),i.d(t,"isHeader",(function(){return h})),i.d(t,"canParse",(function(){return d})),i.d(t,"probe",(function(){return f}));var r=null,n=[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],s=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],o=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],a=[0,1,1,4];function l(e,t,i,r,n){if(!(i+24>t.length)){var s=c(t,i);if(s&&i+s.frameLength<=t.length){var o=r+n*(9e4*s.samplesPerFrame/s.sampleRate),a={unit:t.subarray(i,i+s.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=s.channelCount,e.samplerate=s.sampleRate,e.samples.push(a),{sample:a,length:s.frameLength,missing:0}}}}function c(e,t){var i=e[t+1]>>3&3,l=e[t+1]>>1&3,c=e[t+2]>>4&15,u=e[t+2]>>2&3;if(1!==i&&0!==c&&15!==c&&3!==u){var h=e[t+2]>>1&1,d=e[t+3]>>6,f=1e3*n[14*(3===i?3-l:3===l?3:4)+c-1],p=s[3*(3===i?0:2===i?1:2)+u],g=3===d?1:2,v=o[i][l],m=a[l],y=8*v*m,_=Math.floor(v*f/p+h)*m;if(null===r){var b=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);r=b?parseInt(b[1]):0}return!!r&&r<=87&&2===l&&f>=224e3&&0===d&&(e[t+3]=128|e[t+3]),{sampleRate:p,channelCount:g,frameLength:_,samplesPerFrame:y}}}function u(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function h(e,t){return t+1<e.length&&u(e,t)}function d(e,t){return u(e,t)&&4<=e.length-t}function f(e,t){if(t+1<e.length&&u(e,t)){var i=c(e,t),r=4;null!=i&&i.frameLength&&(r=i.frameLength);var n=t+r;return n===e.length||h(e,n)}return!1}},"./src/demux/sample-aes.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/sample-aes.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),n=i(/*! ./tsdemuxer */"./src/demux/tsdemuxer.ts"),s=function(){function e(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new r.default(e,t,{removePKCS7Padding:!1})}var t=e.prototype;return t.decryptBuffer=function(e,t){this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,t)},t.decryptAacSample=function(e,t,i,r){var n=e[t].unit,s=n.subarray(16,n.length-n.length%16),o=s.buffer.slice(s.byteOffset,s.byteOffset+s.length),a=this;this.decryptBuffer(o,(function(s){var o=new Uint8Array(s);n.set(o,16),r||a.decryptAacSamples(e,t+1,i)}))},t.decryptAacSamples=function(e,t,i){for(;;t++){if(t>=e.length)return void i();if(!(e[t].unit.length<32)){var r=this.decrypter.isSync();if(this.decryptAacSample(e,t,i,r),!r)return}}},t.getAvcEncryptedData=function(e){for(var t=16*Math.floor((e.length-48)/160)+16,i=new Int8Array(t),r=0,n=32;n<=e.length-16;n+=160,r+=16)i.set(e.subarray(n,n+16),r);return i},t.getAvcDecryptedUnit=function(e,t){for(var i=new Uint8Array(t),r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(i.subarray(r,r+16),n);return e},t.decryptAvcSample=function(e,t,i,r,s,o){var a=Object(n.discardEPB)(s.data),l=this.getAvcEncryptedData(a),c=this;this.decryptBuffer(l.buffer,(function(n){s.data=c.getAvcDecryptedUnit(a,n),o||c.decryptAvcSamples(e,t,i+1,r)}))},t.decryptAvcSamples=function(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length)return void r();for(var n=e[t].units;!(i>=n.length);i++){var s=n[i];if(!(s.data.length<=48||1!==s.type&&5!==s.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,i,r,s,o),!o)return}}}},e}();t.default=s},"./src/demux/transmuxer-interface.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/demux/transmuxer-interface.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return h}));var r=i(/*! webworkify-webpack */"./node_modules/webworkify-webpack/index.js"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=i(/*! ../errors */"./src/errors.ts"),l=i(/*! ../utils/mediasource-helper */"./src/utils/mediasource-helper.ts"),c=i(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),u=Object(l.getMediaSource)()||{isTypeSupported:function(){return!1}},h=function(){function e(e,t,i,l){var h=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=e,this.id=t,this.onTransmuxComplete=i,this.onFlush=l;var d=e.config,f=function(t,i){(i=i||{}).frag=h.frag,i.id=h.id,e.trigger(t,i)};this.observer=new c.EventEmitter,this.observer.on(n.Events.FRAG_DECRYPTED,f),this.observer.on(n.Events.ERROR,f);var p={mp4:u.isTypeSupported("video/mp4"),mpeg:u.isTypeSupported("audio/mpeg"),mp3:u.isTypeSupported('audio/mp4; codecs="mp3"')},g=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){var v;o.logger.log("demuxing in webworker");try{v=this.worker=r(/*! ../demux/transmuxer-worker.ts */"./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(t){e.trigger(n.Events.ERROR,{type:a.ErrorTypes.OTHER_ERROR,details:a.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(t.message+" ("+t.filename+":"+t.lineno+")")})},v.postMessage({cmd:"init",typeSupported:p,vendor:g,id:t,config:JSON.stringify(d)})}catch(e){o.logger.warn("Error in worker:",e),o.logger.error("Error while initializing DemuxerWorker, fallback to inline"),v&&self.URL.revokeObjectURL(v.objectURL),this.transmuxer=new s.default(this.observer,p,d,g,t),this.worker=null}}else this.transmuxer=new s.default(this.observer,p,d,g,t)}var t=e.prototype;return t.destroy=function(){var e=this.worker;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.worker=null;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var i=this.observer;i&&i.removeAllListeners(),this.observer=null},t.push=function(e,t,i,r,n,a,l,c,u,h){var d=this;u.transmuxing.start=self.performance.now();var f=this.transmuxer,p=this.worker,g=a?a.start:n.start,v=n.decryptdata,m=this.frag,y=!(m&&n.cc===m.cc),_=!(m&&u.level===m.level),b=m?u.sn-m.sn:-1,S=this.part?u.part-this.part.index:1,C=!_&&(1===b||0===b&&1===S),w=self.performance.now();(_||b||0===n.stats.parsing.start)&&(n.stats.parsing.start=w),!a||!S&&C||(a.stats.parsing.start=w);var k=new s.TransmuxState(y,C,c,_,g);if(!C||y){o.logger.log("[transmuxer-interface, "+n.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+"\n discontinuity: "+y+"\n trackSwitch: "+_+"\n contiguous: "+C+"\n accurateTimeOffset: "+c+"\n timeOffset: "+g);var x=new s.TransmuxConfig(i,r,t,l,h);this.configureTransmuxer(x)}if(this.frag=n,this.part=a,p)p.postMessage({cmd:"demux",data:e,decryptdata:v,chunkMeta:u,state:k},e instanceof ArrayBuffer?[e]:[]);else if(f){var E=f.push(e,v,u,k);Object(s.isPromise)(E)?E.then((function(e){d.handleTransmuxComplete(e)})):this.handleTransmuxComplete(E)}},t.flush=function(e){var t=this;e.transmuxing.start=self.performance.now();var i=this.transmuxer,r=this.worker;if(r)r.postMessage({cmd:"flush",chunkMeta:e});else if(i){var n=i.flush(e);Object(s.isPromise)(n)?n.then((function(i){t.handleFlushResult(i,e)})):this.handleFlushResult(n,e)}},t.handleFlushResult=function(e,t){var i=this;e.forEach((function(e){i.handleTransmuxComplete(e)})),this.onFlush(t)},t.onWorkerMessage=function(e){var t=e.data,i=this.hls;switch(t.event){case"init":self.URL.revokeObjectURL(this.worker.objectURL);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data)}},t.configureTransmuxer=function(e){var t=this.worker,i=this.transmuxer;t?t.postMessage({cmd:"configure",config:e}):i&&i.configure(e)},t.handleTransmuxComplete=function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)},e}()},"./src/demux/transmuxer-worker.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/demux/transmuxer-worker.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return a}));var r=i(/*! ../demux/transmuxer */"./src/demux/transmuxer.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=i(/*! eventemitter3 */"./node_modules/eventemitter3/index.js");function a(e){var t=new o.EventEmitter,i=function(t,i){e.postMessage({event:t,data:i})};t.on(n.Events.FRAG_DECRYPTED,i),t.on(n.Events.ERROR,i),e.addEventListener("message",(function(n){var o=n.data;switch(o.cmd){case"init":var a=JSON.parse(o.config);e.transmuxer=new r.default(t,o.typeSupported,a,o.vendor,o.id),Object(s.enableLogs)(a.debug),i("init",null);break;case"configure":e.transmuxer.configure(o.config);break;case"demux":var c=e.transmuxer.push(o.data,o.decryptdata,o.chunkMeta,o.state);Object(r.isPromise)(c)?c.then((function(t){l(e,t)})):l(e,c);break;case"flush":var h=o.chunkMeta,d=e.transmuxer.flush(h);Object(r.isPromise)(d)?d.then((function(t){u(e,t,h)})):u(e,d,h)}}))}function l(e,t){if((i=t.remuxResult).audio||i.video||i.text||i.id3||i.initSegment){var i,r=[],n=t.remuxResult,s=n.audio,o=n.video;s&&c(r,s),o&&c(r,o),e.postMessage({event:"transmuxComplete",data:t},r)}}function c(e,t){t.data1&&e.push(t.data1.buffer),t.data2&&e.push(t.data2.buffer)}function u(e,t,i){t.forEach((function(t){l(e,t)})),e.postMessage({event:"flush",data:i})}},"./src/demux/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/demux/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default, isPromise, TransmuxConfig, TransmuxState */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return y})),i.d(t,"isPromise",(function(){return b})),i.d(t,"TransmuxConfig",(function(){return S})),i.d(t,"TransmuxState",(function(){return C}));var r,n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../errors */"./src/errors.ts"),o=i(/*! ../crypt/decrypter */"./src/crypt/decrypter.ts"),a=i(/*! ../demux/aacdemuxer */"./src/demux/aacdemuxer.ts"),l=i(/*! ../demux/mp4demuxer */"./src/demux/mp4demuxer.ts"),c=i(/*! ../demux/tsdemuxer */"./src/demux/tsdemuxer.ts"),u=i(/*! ../demux/mp3demuxer */"./src/demux/mp3demuxer.ts"),h=i(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),d=i(/*! ../remux/passthrough-remuxer */"./src/remux/passthrough-remuxer.ts"),f=i(/*! ./chunk-cache */"./src/demux/chunk-cache.ts"),p=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),g=i(/*! ../utils/logger */"./src/utils/logger.ts");try{r=self.performance.now.bind(self.performance)}catch(e){g.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var v=[{demux:c.default,remux:h.default},{demux:l.default,remux:d.default},{demux:a.default,remux:h.default},{demux:u.default,remux:h.default}],m=1024;v.forEach((function(e){var t=e.demux;m=Math.max(m,t.minProbeByteLength)}));var y=function(){function e(e,t,i,r,n){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 f.default,this.observer=e,this.typeSupported=t,this.config=i,this.vendor=r,this.id=n}var t=e.prototype;return t.configure=function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()},t.push=function(e,t,i,n){var s=this,o=i.transmuxing;o.executeStart=r();var a=new Uint8Array(e),l=this.cache,c=this.config,u=this.currentTransmuxState,h=this.transmuxConfig;n&&(this.currentTransmuxState=n);var d=function(e,t){var i=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(i=t),i}(a,t);if(d&&"AES-128"===d.method){var f=this.getDecrypter();if(!c.enableSoftwareAES)return this.decryptionPromise=f.webCryptoDecrypt(a,d.key.buffer,d.iv.buffer).then((function(e){var t=s.push(e,null,i);return s.decryptionPromise=null,t})),this.decryptionPromise;var g=f.softwareDecrypt(a,d.key.buffer,d.iv.buffer);if(!g)return o.executeEnd=r(),_(i);a=new Uint8Array(g)}var v=n||u,m=v.contiguous,y=v.discontinuity,b=v.trackSwitch,S=v.accurateTimeOffset,C=v.timeOffset,w=h.audioCodec,k=h.videoCodec,x=h.defaultInitPts,E=h.duration,T=h.initSegmentData;if((y||b)&&this.resetInitSegment(T,w,k,E),y&&this.resetInitialTimestamp(x),m||this.resetContiguity(),this.needsProbing(a,y,b)){if(l.dataLength){var L=l.flush();a=Object(p.appendUint8Array)(L,a)}this.configureTransmuxer(a,h)}var A=this.transmux(a,d,C,S,i),R=this.currentTransmuxState;return R.contiguous=!0,R.discontinuity=!1,R.trackSwitch=!1,o.executeEnd=r(),A},t.flush=function(e){var t=this,i=e.transmuxing;i.executeStart=r();var o=this.decrypter,a=this.cache,l=this.currentTransmuxState,c=this.decryptionPromise;if(c)return c.then((function(){return t.flush(e)}));var u=[],h=l.timeOffset;if(o){var d=o.flush();d&&u.push(this.push(d,null,e))}var f=a.dataLength;a.reset();var p=this.demuxer,g=this.remuxer;if(!p||!g)return f>=m&&this.observer.emit(n.Events.ERROR,n.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),i.executeEnd=r(),[_(e)];var v=p.flush(h);return b(v)?v.then((function(i){return t.flushRemux(u,i,e),u})):(this.flushRemux(u,v,e),u)},t.flushRemux=function(e,t,i){var n=t.audioTrack,s=t.avcTrack,o=t.id3Track,a=t.textTrack,l=this.currentTransmuxState,c=l.accurateTimeOffset,u=l.timeOffset;g.logger.log("[transmuxer.ts]: Flushed fragment "+i.sn+(i.part>-1?" p: "+i.part:"")+" of level "+i.level);var h=this.remuxer.remux(n,s,o,a,u,c,!0,this.id);e.push({remuxResult:h,chunkMeta:i}),i.transmuxing.executeEnd=r()},t.resetInitialTimestamp=function(e){var t=this.demuxer,i=this.remuxer;t&&i&&(t.resetTimeStamp(e),i.resetTimeStamp(e))},t.resetContiguity=function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())},t.resetInitSegment=function(e,t,i,r){var n=this.demuxer,s=this.remuxer;n&&s&&(n.resetInitSegment(t,i,r),s.resetInitSegment(e,t,i))},t.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},t.transmux=function(e,t,i,r,n){return t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,i,r,n):this.transmuxUnencrypted(e,i,r,n)},t.transmuxUnencrypted=function(e,t,i,r){var n=this.demuxer.demux(e,t,!1,!this.config.progressive),s=n.audioTrack,o=n.avcTrack,a=n.id3Track,l=n.textTrack;return{remuxResult:this.remuxer.remux(s,o,a,l,t,i,!1,this.id),chunkMeta:r}},t.transmuxSampleAes=function(e,t,i,r,n){var s=this;return this.demuxer.demuxSampleAes(e,t,i).then((function(e){return{remuxResult:s.remuxer.remux(e.audioTrack,e.avcTrack,e.id3Track,e.textTrack,i,r,!1,s.id),chunkMeta:n}}))},t.configureTransmuxer=function(e,t){for(var i,r=this.config,n=this.observer,s=this.typeSupported,o=this.vendor,a=t.audioCodec,c=t.defaultInitPts,u=t.duration,h=t.initSegmentData,f=t.videoCodec,p=0,m=v.length;p<m;p++)if(v[p].demux.probe(e)){i=v[p];break}i||(g.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),i={demux:l.default,remux:d.default});var y=this.demuxer,_=this.remuxer,b=i.remux,S=i.demux;_&&_ instanceof b||(this.remuxer=new b(n,r,s,o)),y&&y instanceof S||(this.demuxer=new S(n,r,s),this.probe=S.probe),this.resetInitSegment(h,a,f,u),this.resetInitialTimestamp(c)},t.needsProbing=function(e,t,i){return!this.demuxer||!this.remuxer||t||i},t.getDecrypter=function(){var e=this.decrypter;return e||(e=this.decrypter=new o.default(this.observer,this.config)),e},e}(),_=function(e){return{remuxResult:{},chunkMeta:e}};function b(e){return"then"in e&&e.then instanceof Function}var S=function(e,t,i,r,n){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=i,this.duration=r,this.defaultInitPts=n},C=function(e,t,i,r,n){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=i,this.trackSwitch=r,this.timeOffset=n}},"./src/demux/tsdemuxer.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/demux/tsdemuxer.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: discardEPB, default */function(e,t,i){"use strict";i.r(t),i.d(t,"discardEPB",(function(){return b}));var r=i(/*! ./adts */"./src/demux/adts.ts"),n=i(/*! ./mpegaudio */"./src/demux/mpegaudio.ts"),s=i(/*! ./exp-golomb */"./src/demux/exp-golomb.ts"),o=i(/*! ./id3 */"./src/demux/id3.ts"),a=i(/*! ./sample-aes */"./src/demux/sample-aes.ts"),l=i(/*! ../events */"./src/events.ts"),c=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),u=i(/*! ../utils/logger */"./src/utils/logger.ts"),h=i(/*! ../errors */"./src/errors.ts"),d={video:1,audio:2,id3:3,text:4},f=function(){function e(e,t,i){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=e,this.config=t,this.typeSupported=i}e.probe=function(t){var i=e.syncOffset(t);return!(i<0||(i&&u.logger.warn("MPEG2-TS detected but first sync word found @ offset "+i+", junk ahead ?"),0))},e.syncOffset=function(e){for(var t=Math.min(1e3,e.length-564),i=0;i<t;){if(71===e[i]&&71===e[i+188]&&71===e[i+376])return i;i++}return-1},e.createTrack=function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:d[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}};var t=e.prototype;return t.resetInitSegment=function(t,i,r){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video",r),this._audioTrack=e.createTrack("audio",r),this._id3Track=e.createTrack("id3",r),this._txtTrack=e.createTrack("text",r),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=i,this._duration=r},t.resetTimeStamp=function(){},t.resetContiguity=function(){var e=this._audioTrack,t=this._avcTrack,i=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},t.demux=function(t,i,r,n){var s;void 0===r&&(r=!1),void 0===n&&(n=!1),r||(this.sampleAes=null);var o=this._avcTrack,a=this._audioTrack,d=this._id3Track,f=o.pid,p=o.pesData,y=a.pid,_=d.pid,b=a.pesData,S=d.pesData,C=!1,w=this.pmtParsed,k=this._pmtId,x=t.length;if(this.remainderData&&(x=(t=Object(c.appendUint8Array)(this.remainderData,t)).length,this.remainderData=null),x<188&&!n)return this.remainderData=t,{audioTrack:a,avcTrack:o,id3Track:d,textTrack:this._txtTrack};var E=Math.max(0,e.syncOffset(t));(x-=(x+E)%188)<t.byteLength&&!n&&(this.remainderData=new Uint8Array(t.buffer,x,t.buffer.byteLength-x));for(var T=E;T<x;T+=188)if(71===t[T]){var L=!!(64&t[T+1]),A=((31&t[T+1])<<8)+t[T+2],R=void 0;if((48&t[T+3])>>4>1){if((R=T+5+t[T+4])===T+188)continue}else R=T+4;switch(A){case f:L&&(p&&(s=m(p))&&this.parseAVCPES(s,!1),p={data:[],size:0}),p&&(p.data.push(t.subarray(R,T+188)),p.size+=T+188-R);break;case y:L&&(b&&(s=m(b))&&(a.isAAC?this.parseAACPES(s):this.parseMPEGPES(s)),b={data:[],size:0}),b&&(b.data.push(t.subarray(R,T+188)),b.size+=T+188-R);break;case _:L&&(S&&(s=m(S))&&this.parseID3PES(s),S={data:[],size:0}),S&&(S.data.push(t.subarray(R,T+188)),S.size+=T+188-R);break;case 0:L&&(R+=t[R]+1),k=this._pmtId=g(t,R);break;case k:L&&(R+=t[R]+1);var D=v(t,R,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,r);(f=D.avc)>0&&(o.pid=f),(y=D.audio)>0&&(a.pid=y,a.isAAC=D.isAAC),(_=D.id3)>0&&(d.pid=_),C&&!w&&(u.logger.log("reparse from beginning"),C=!1,T=E-188),w=this.pmtParsed=!0;break;case 17:case 8191:break;default:C=!0}}else this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});o.pesData=p,a.pesData=b,d.pesData=S;var O={audioTrack:a,avcTrack:o,id3Track:d,textTrack:this._txtTrack};return n&&this.extractRemainingSamples(O),O},t.flush=function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e},t.extractRemainingSamples=function(e){var t,i=e.audioTrack,r=e.avcTrack,n=e.id3Track,s=r.pesData,o=i.pesData,a=n.pesData;s&&(t=m(s))?(this.parseAVCPES(t,!0),r.pesData=null):r.pesData=s,o&&(t=m(o))?(i.isAAC?this.parseAACPES(t):this.parseMPEGPES(t),i.pesData=null):(null!=o&&o.size&&u.logger.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=o),a&&(t=m(a))?(this.parseID3PES(t),n.pesData=null):n.pesData=a},t.demuxSampleAes=function(e,t,i){var r=this.demux(e,i,!0,!this.config.progressive),n=this.sampleAes=new a.default(this.observer,this.config,t);return this.decrypt(r,n)},t.decrypt=function(e,t){return new Promise((function(i){var r=e.audioTrack,n=e.avcTrack;r.samples&&r.isAAC?t.decryptAacSamples(r.samples,0,(function(){n.samples?t.decryptAvcSamples(n.samples,0,0,(function(){i(e)})):i(e)})):n.samples&&t.decryptAvcSamples(n.samples,0,0,(function(){i(e)}))}))},t.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},t.parseAVCPES=function(e,t){var i,r=this,n=this._avcTrack,a=this.parseAVCNALu(e.data),l=this.avcSample,c=!1;e.data=null,l&&a.length&&!n.audFound&&(y(l,n),l=this.avcSample=p(!1,e.pts,e.dts,"")),a.forEach((function(t){switch(t.type){case 1:i=!0,l||(l=r.avcSample=p(!0,e.pts,e.dts,"")),l.frame=!0;var a=t.data;if(c&&a.length>4){var u=new s.default(a).readSliceType();2!==u&&4!==u&&7!==u&&9!==u||(l.key=!0)}break;case 5:i=!0,l||(l=r.avcSample=p(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:i=!0;var h=new s.default(b(t.data));h.readUByte();for(var d=0,f=0,g=!1,v=0;!g&&h.bytesAvailable>1;){d=0;do{d+=v=h.readUByte()}while(255===v);f=0;do{f+=v=h.readUByte()}while(255===v);if(4===d&&0!==h.bytesAvailable){if(g=!0,181===h.readUByte()&&49===h.readUShort()&&1195456820===h.readUInt()&&3===h.readUByte()){for(var m=h.readUByte(),S=31&m,C=[m,h.readUByte()],w=0;w<S;w++)C.push(h.readUByte()),C.push(h.readUByte()),C.push(h.readUByte());_(r._txtTrack.samples,{type:3,pts:e.pts,bytes:C})}}else if(5===d&&0!==h.bytesAvailable){if(g=!0,f>16){for(var k=[],x=0;x<16;x++)k.push(h.readUByte().toString(16)),3!==x&&5!==x&&7!==x&&9!==x||k.push("-");for(var E=f-16,T=new Uint8Array(E),L=0;L<E;L++)T[L]=h.readUByte();_(r._txtTrack.samples,{pts:e.pts,payloadType:d,uuid:k.join(""),userData:Object(o.utf8ArrayToStr)(T),userDataBytes:T})}}else if(f<h.bytesAvailable)for(var A=0;A<f;A++)h.readUByte()}break;case 7:if(i=!0,c=!0,!n.sps){var R=new s.default(t.data).readSPS();n.width=R.width,n.height=R.height,n.pixelRatio=R.pixelRatio,n.sps=[t.data],n.duration=r._duration;for(var D=t.data.subarray(1,4),O="avc1.",M=0;M<3;M++){var I=D[M].toString(16);I.length<2&&(I="0"+I),O+=I}n.codec=O}break;case 8:i=!0,n.pps||(n.pps=[t.data]);break;case 9:i=!1,n.audFound=!0,l&&y(l,n),l=r.avcSample=p(!1,e.pts,e.dts,"");break;case 12:i=!1;break;default:i=!1,l&&(l.debug+="unknown NAL "+t.type+" ")}l&&i&&l.units.push(t)})),t&&l&&(y(l,n),this.avcSample=null)},t.getLastNalUnit=function(){var e,t,i=this.avcSample;if(!i||0===i.units.length){var r=this._avcTrack.samples;i=r[r.length-1]}if(null!==(e=i)&&void 0!==e&&e.units){var n=i.units;t=n[n.length-1]}return t},t.parseAVCNALu=function(e){var t,i,r=e.byteLength,n=this._avcTrack,s=n.naluState||0,o=s,a=[],l=0,c=-1,u=0;for(-1===s&&(c=0,u=31&e[0],s=0,l=1);l<r;)if(t=e[l++],s)if(1!==s)if(t)if(1===t){if(c>=0){var h={data:e.subarray(c,l-s-1),type:u};a.push(h)}else{var d=this.getLastNalUnit();if(d&&(o&&l<=4-o&&d.state&&(d.data=d.data.subarray(0,d.data.byteLength-o)),(i=l-s-1)>0)){var f=new Uint8Array(d.data.byteLength+i);f.set(d.data,0),f.set(e.subarray(0,i),d.data.byteLength),d.data=f,d.state=0}}l<r?(c=l,u=31&e[l],s=0):s=-1}else s=0;else s=3;else s=t?0:2;else s=t?0:1;if(c>=0&&s>=0){var p={data:e.subarray(c,r),type:u,state:s};a.push(p)}if(0===a.length){var g=this.getLastNalUnit();if(g){var v=new Uint8Array(g.data.byteLength+e.byteLength);v.set(g.data,0),v.set(e,g.data.byteLength),g.data=v}}return n.naluState=s,a},t.parseAACPES=function(e){var t,i,n,s,o,a=0,c=this._audioTrack,d=this.aacOverFlow,f=e.data;if(d){this.aacOverFlow=null;var p=d.sample.unit.byteLength,g=Math.min(d.missing,p),v=p-g;d.sample.unit.set(f.subarray(0,g),v),c.samples.push(d.sample),a=d.missing}for(t=a,i=f.length;t<i-1&&!r.isHeader(f,t);t++);if(t===a||(t<i-1?(n="AAC PES did not start with ADTS header,offset:"+t,s=!1):(n="no ADTS header found in AAC PES",s=!0),u.logger.warn("parsing error:"+n),this.observer.emit(l.Events.ERROR,l.Events.ERROR,{type:h.ErrorTypes.MEDIA_ERROR,details:h.ErrorDetails.FRAG_PARSING_ERROR,fatal:s,reason:n}),!s)){if(r.initTrackConfig(c,this.observer,f,t,this.audioCodec),void 0!==e.pts)o=e.pts;else{if(!d)return void u.logger.warn("[tsdemuxer]: AAC PES unknown PTS");var m=r.getFrameDuration(c.samplerate);o=d.sample.pts+m}for(var y=0;t<i;){if(r.isHeader(f,t)){if(t+5<i){var _=r.appendFrame(c,f,t,o,y);if(_){if(!_.missing){t+=_.length,y++;continue}this.aacOverFlow=_}}break}t++}}},t.parseMPEGPES=function(e){var t=e.data,i=t.length,r=0,s=0,o=e.pts;if(void 0!==o)for(;s<i;)if(n.isHeader(t,s)){var a=n.appendFrame(this._audioTrack,t,s,o,r);if(!a)break;s+=a.length,r++}else s++;else u.logger.warn("[tsdemuxer]: MPEG PES unknown PTS")},t.parseID3PES=function(e){void 0!==e.pts?this._id3Track.samples.push(e):u.logger.warn("[tsdemuxer]: ID3 PES unknown PTS")},e}();function p(e,t,i,r){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:r,length:0}}function g(e,t){return(31&e[t+10])<<8|e[t+11]}function v(e,t,i,r){var n={audio:-1,avc:-1,id3:-1,isAAC:!0},s=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<s;){var o=(31&e[t+1])<<8|e[t+2];switch(e[t]){case 207:if(!r){u.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===n.audio&&(n.audio=o);break;case 21:-1===n.id3&&(n.id3=o);break;case 219:if(!r){u.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===n.avc&&(n.avc=o);break;case 3:case 4:i?-1===n.audio&&(n.audio=o,n.isAAC=!1):u.logger.log("MPEG audio found, not supported in this browser");break;case 36:u.logger.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return n}function m(e){var t,i,r,n,s,o=0,a=e.data;if(!e||0===e.size)return null;for(;a[0].length<19&&a.length>1;){var l=new Uint8Array(a[0].length+a[1].length);l.set(a[0]),l.set(a[1],a[0].length),a[0]=l,a.splice(1,1)}if(1===((t=a[0])[0]<<16)+(t[1]<<8)+t[2]){if((i=(t[4]<<8)+t[5])&&i>e.size-6)return null;var c=t[7];192&c&&(n=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&c?n-(s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>54e5&&(u.logger.warn(Math.round((n-s)/9e4)+"s delta between PTS and DTS, align them"),n=s):s=n);var h=(r=t[8])+9;if(e.size<=h)return null;e.size-=h;for(var d=new Uint8Array(e.size),f=0,p=a.length;f<p;f++){var g=(t=a[f]).byteLength;if(h){if(h>g){h-=g;continue}t=t.subarray(h),g-=h,h=0}d.set(t,o),o+=g}return i&&(i-=r+3),{data:d,pts:n,dts:s,len:i}}return null}function y(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var i=t.samples,r=i.length;if(!r)return void t.dropped++;var n=i[r-1];e.pts=n.pts,e.dts=n.dts}t.samples.push(e)}e.debug.length&&u.logger.log(e.pts+"/"+e.dts+":"+e.debug)}function _(e,t){var i=e.length;if(i>0){if(t.pts>=e[i-1].pts)e.push(t);else for(var r=i-1;r>=0;r--)if(t.pts<e[r].pts){e.splice(r,0,t);break}}else e.push(t)}function b(e){for(var t=e.byteLength,i=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return e;var n=t-i.length,s=new Uint8Array(n),o=0;for(r=0;r<n;o++,r++)o===i[0]&&(o++,i.shift()),s[r]=e[o];return s}f.minProbeByteLength=188,t.default=f},"./src/errors.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/errors.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: ErrorTypes, ErrorDetails */function(e,t,i){"use strict";var r,n;i.r(t),i.d(t,"ErrorTypes",(function(){return r})),i.d(t,"ErrorDetails",(function(){return n})),function(e){e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError"}(r||(r={})),function(e){e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown"}(n||(n={}))},"./src/events.ts":
|
|
|
/*!***********************!*\
|
|
|
!*** ./src/events.ts ***!
|
|
|
\***********************/
|
|
|
/*! exports provided: Events */function(e,t,i){"use strict";var r;i.r(t),i.d(t,"Events",(function(){return r})),function(e){e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached"}(r||(r={}))},"./src/hls.ts":
|
|
|
/*!********************!*\
|
|
|
!*** ./src/hls.ts ***!
|
|
|
\********************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return y}));var r=i(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),n=i(/*! ./loader/playlist-loader */"./src/loader/playlist-loader.ts"),s=i(/*! ./loader/key-loader */"./src/loader/key-loader.ts"),o=i(/*! ./controller/id3-track-controller */"./src/controller/id3-track-controller.ts"),a=i(/*! ./controller/latency-controller */"./src/controller/latency-controller.ts"),l=i(/*! ./controller/level-controller */"./src/controller/level-controller.ts"),c=i(/*! ./controller/fragment-tracker */"./src/controller/fragment-tracker.ts"),u=i(/*! ./controller/stream-controller */"./src/controller/stream-controller.ts"),h=i(/*! ./is-supported */"./src/is-supported.ts"),d=i(/*! ./utils/logger */"./src/utils/logger.ts"),f=i(/*! ./config */"./src/config.ts"),p=i(/*! eventemitter3 */"./node_modules/eventemitter3/index.js"),g=i(/*! ./events */"./src/events.ts"),v=i(/*! ./errors */"./src/errors.ts");function m(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var y=function(){function e(t){void 0===t&&(t={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.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 i=this.config=Object(f.mergeConfig)(e.DefaultConfig,t);this.userConfig=t,Object(d.enableLogs)(i.debug),this._autoLevelCapping=-1,i.progressive&&Object(f.enableStreamingMode)(i);var r=i.abrController,h=i.bufferController,g=i.capLevelController,v=i.fpsController,m=this.abrController=new r(this),y=this.bufferController=new h(this),_=this.capLevelController=new g(this),b=new v(this),S=new n.default(this),C=new s.default(this),w=new o.default(this),k=this.levelController=new l.default(this),x=new c.FragmentTracker(this),E=this.streamController=new u.default(this,x);_.setStreamController(E),b.setStreamController(E);var T=[k,E];this.networkControllers=T;var L=[S,C,m,y,_,b,w,x];this.audioTrackController=this.createController(i.audioTrackController,null,T),this.createController(i.audioStreamController,x,T),this.subtitleTrackController=this.createController(i.subtitleTrackController,null,T),this.createController(i.subtitleStreamController,x,T),this.createController(i.timelineController,null,L),this.emeController=this.createController(i.emeController,null,L),this.cmcdController=this.createController(i.cmcdController,null,L),this.latencyController=this.createController(a.default,null,L),this.coreComponents=L}e.isSupported=function(){return Object(h.isSupported)()};var t,i,y,_=e.prototype;return _.createController=function(e,t,i){if(e){var r=t?new e(this,t):new e(this);return i&&i.push(r),r}return null},_.on=function(e,t,i){void 0===i&&(i=this),this._emitter.on(e,t,i)},_.once=function(e,t,i){void 0===i&&(i=this),this._emitter.once(e,t,i)},_.removeAllListeners=function(e){this._emitter.removeAllListeners(e)},_.off=function(e,t,i,r){void 0===i&&(i=this),this._emitter.off(e,t,i,r)},_.listeners=function(e){return this._emitter.listeners(e)},_.emit=function(e,t,i){return this._emitter.emit(e,t,i)},_.trigger=function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(t){d.logger.error("An internal error happened while handling event "+e+'. Error message: "'+t.message+'". Here is a stacktrace:',t),this.trigger(g.Events.ERROR,{type:v.ErrorTypes.OTHER_ERROR,details:v.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,error:t})}return!1},_.listenerCount=function(e){return this._emitter.listenerCount(e)},_.destroy=function(){d.logger.log("destroy"),this.trigger(g.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0},_.attachMedia=function(e){d.logger.log("attachMedia"),this._media=e,this.trigger(g.Events.MEDIA_ATTACHING,{media:e})},_.detachMedia=function(){d.logger.log("detachMedia"),this.trigger(g.Events.MEDIA_DETACHING,void 0),this._media=null},_.loadSource=function(e){this.stopLoad();var t=this.media,i=this.url,n=this.url=r.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});d.logger.log("loadSource:"+n),t&&i&&i!==n&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(t)),this.trigger(g.Events.MANIFEST_LOADING,{url:e})},_.startLoad=function(e){void 0===e&&(e=-1),d.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))},_.stopLoad=function(){d.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))},_.swapAudioCodec=function(){d.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},_.recoverMediaError=function(){d.logger.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)},_.removeLevel=function(e,t){void 0===t&&(t=0),this.levelController.removeLevel(e,t)},t=e,y=[{key:"version",get:function(){return"1.1.2"}},{key:"Events",get:function(){return g.Events}},{key:"ErrorTypes",get:function(){return v.ErrorTypes}},{key:"ErrorDetails",get:function(){return v.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:f.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}],(i=[{key:"levels",get:function(){var e=this.levelController.levels;return e||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){d.logger.log("set currentLevel:"+e),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){d.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){d.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){d.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){d.logger.log("set startLevel:"+e),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(d.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var i=e.length,r=0;r<i;r++)if(e[r].maxBitrate>t)return r;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{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}}])&&m(t.prototype,i),y&&m(t,y),e}();y.defaultConfig=void 0},"./src/is-supported.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/is-supported.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isSupported, changeTypeSupported */function(e,t,i){"use strict";i.r(t),i.d(t,"isSupported",(function(){return s})),i.d(t,"changeTypeSupported",(function(){return o}));var r=i(/*! ./utils/mediasource-helper */"./src/utils/mediasource-helper.ts");function n(){return self.SourceBuffer||self.WebKitSourceBuffer}function s(){var e=Object(r.getMediaSource)();if(!e)return!1;var t=n(),i=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),s=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!i&&!!s}function o(){var e,t=n();return"function"==typeof(null==t||null===(e=t.prototype)||void 0===e?void 0:e.changeType)}},"./src/loader/fragment-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/fragment-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default, LoadError */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return h})),i.d(t,"LoadError",(function(){return f}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../errors */"./src/errors.ts");function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return o(e,arguments,c(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),l(r,e)})(e)}function o(e,t,i){return(o=a()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&l(n,i.prototype),n}).apply(null,arguments)}function a(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=Math.pow(2,17),h=function(){function e(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}var t=e.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(e,t){var i=this,r=e.url;if(!r)return Promise.reject(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,networkDetails:null},"Fragment does not have a "+(r?"part list":"url")));this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(r,l){i.loader&&i.loader.destroy();var c=i.loader=e.loader=o?new o(s):new a(s),h=d(e),p={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:u};e.stats=c.stats,c.load(h,p,{onSuccess:function(t,n,s,o){i.resetLoader(e,c),r({frag:e,part:null,payload:t.data,networkDetails:o})},onError:function(t,r,s){i.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:t,networkDetails:s}))},onAbort:function(t,r,s){i.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,networkDetails:s}))},onTimeout:function(t,r,s){i.resetLoader(e,c),l(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,networkDetails:s}))},onProgress:function(i,r,n,s){t&&t({frag:e,part:null,payload:n,networkDetails:s})}})}))},t.loadPart=function(e,t,i){var r=this;this.abort();var s=this.config,o=s.fLoader,a=s.loader;return new Promise((function(l,c){r.loader&&r.loader.destroy();var h=r.loader=e.loader=o?new o(s):new a(s),p=d(e,t),g={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:u};t.stats=h.stats,h.load(p,g,{onSuccess:function(n,s,o,a){r.resetLoader(e,h),r.updateStatsFromPart(e,t);var c={frag:e,part:t,payload:n.data,networkDetails:a};i(c),l(c)},onError:function(i,s,o){r.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:i,networkDetails:o}))},onAbort:function(i,s,o){e.stats.aborted=t.stats.aborted,r.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,networkDetails:o}))},onTimeout:function(i,s,o){r.resetLoader(e,h),c(new f({type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,networkDetails:o}))}})}))},t.updateStatsFromPart=function(e,t){var i=e.stats,r=t.stats,n=r.total;if(i.loaded+=r.loaded,n){var s=Math.round(e.duration/t.duration),o=Math.min(Math.round(i.loaded/n),s),a=(s-o)*Math.round(i.loaded/o);i.total=i.loaded+a}else i.total=Math.max(i.loaded,i.total);var l=i.loading,c=r.loading;l.start?l.first+=c.first-c.start:(l.start=c.start,l.first=c.first),l.end=c.end},t.resetLoader=function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()},e}();function d(e,t){void 0===t&&(t=null);var i=t||e,n={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},s=i.byteRangeStartOffset,o=i.byteRangeEndOffset;return Object(r.isFiniteNumber)(s)&&Object(r.isFiniteNumber)(o)&&(n.rangeStart=s,n.rangeEnd=o),n}var f=function(e){var t,i;function r(t){for(var i,r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return(i=e.call.apply(e,[this].concat(n))||this).data=void 0,i.data=t,i}return i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,l(t,i),r}(s(Error))},"./src/loader/fragment.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/loader/fragment.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: ElementaryStreamTypes, BaseSegment, Fragment, Part */function(e,t,i){"use strict";i.r(t),i.d(t,"ElementaryStreamTypes",(function(){return r})),i.d(t,"BaseSegment",(function(){return f})),i.d(t,"Fragment",(function(){return p})),i.d(t,"Part",(function(){return g}));var r,n=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),s=i(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=i(/*! ./level-key */"./src/loader/level-key.ts"),l=i(/*! ./load-stats */"./src/loader/load-stats.ts");function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function h(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function d(e,t,i){return t&&h(e.prototype,t),i&&h(e,i),e}!function(e){e.AUDIO="audio",e.VIDEO="video",e.AUDIOVIDEO="audiovideo"}(r||(r={}));var f=function(){function e(e){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[r.AUDIO]=null,t[r.VIDEO]=null,t[r.AUDIOVIDEO]=null,t),this.baseurl=e}return e.prototype.setByteRange=function(e,t){var i=e.split("@",2),r=[];1===i.length?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r},d(e,[{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(s.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),p=function(e){function t(t,i){var r;return(r=e.call(this,i)||this)._decryptdata=null,r.rawProgramDateTime=null,r.programDateTime=null,r.tagList=[],r.duration=0,r.sn=0,r.levelkey=void 0,r.type=void 0,r.loader=null,r.level=-1,r.cc=0,r.startPTS=void 0,r.endPTS=void 0,r.appendedPTS=void 0,r.startDTS=void 0,r.endDTS=void 0,r.start=0,r.deltaPTS=void 0,r.maxStartPTS=void 0,r.minEndPTS=void 0,r.stats=new l.LoadStats,r.urlId=0,r.data=void 0,r.bitrateTest=!1,r.title=null,r.initSegment=null,r.type=t,r}c(t,e);var i=t.prototype;return i.createInitializationVector=function(e){for(var t=new Uint8Array(16),i=12;i<16;i++)t[i]=e>>8*(15-i)&255;return t},i.setDecryptDataFromLevelKey=function(e,t){var i=e;return"AES-128"===(null==e?void 0:e.method)&&e.uri&&!e.iv&&((i=a.LevelKey.fromURI(e.uri)).method=e.method,i.iv=this.createInitializationVector(t),i.keyFormat="identity"),i},i.setElementaryStreamInfo=function(e,t,i,r,n,s){void 0===s&&(s=!1);var o=this.elementaryStreams,a=o[e];a?(a.startPTS=Math.min(a.startPTS,t),a.endPTS=Math.max(a.endPTS,i),a.startDTS=Math.min(a.startDTS,r),a.endDTS=Math.max(a.endDTS,n)):o[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:n,partial:s}},i.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[r.AUDIO]=null,e[r.VIDEO]=null,e[r.AUDIOVIDEO]=null},d(t,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var e=this.sn;"number"!=typeof e&&(this.levelkey&&"AES-128"===this.levelkey.method&&!this.levelkey.iv&&o.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),e=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,e)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime)return null;if(!Object(n.isFiniteNumber)(this.programDateTime))return null;var e=Object(n.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;return!(null===(e=this.decryptdata)||void 0===e||!e.keyFormat||!this.decryptdata.uri)}}]),t}(f),g=function(e){function t(t,i,r,n,s){var o;(o=e.call(this,r)||this).fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new l.LoadStats,o.duration=t.decimalFloatingPoint("DURATION"),o.gap=t.bool("GAP"),o.independent=t.bool("INDEPENDENT"),o.relurl=t.enumeratedString("URI"),o.fragment=i,o.index=n;var a=t.enumeratedString("BYTERANGE");return a&&o.setByteRange(a,s),s&&(o.fragOffset=s.fragOffset+s.duration),o}return c(t,e),d(t,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),t}(f)},"./src/loader/key-loader.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/key-loader.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return o}));var r=i(/*! ../events */"./src/events.ts"),n=i(/*! ../errors */"./src/errors.ts"),s=i(/*! ../utils/logger */"./src/utils/logger.ts"),o=function(){function e(e){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=e,this._registerListeners()}var t=e.prototype;return t._registerListeners=function(){this.hls.on(r.Events.KEY_LOADING,this.onKeyLoading,this)},t._unregisterListeners=function(){this.hls.off(r.Events.KEY_LOADING,this.onKeyLoading)},t.destroy=function(){for(var e in this._unregisterListeners(),this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={}},t.onKeyLoading=function(e,t){var i=t.frag,n=i.type,o=this.loaders[n];if(i.decryptdata){var a=i.decryptdata.uri;if(a!==this.decrypturl||null===this.decryptkey){var l=this.hls.config;if(o&&(s.logger.warn("abort previous key loader for type:"+n),o.abort()),!a)return void s.logger.warn("key uri is falsy");var c=l.loader,u=i.loader=this.loaders[n]=new c(l);this.decrypturl=a,this.decryptkey=null;var h={url:a,frag:i,responseType:"arraybuffer"},d={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},f={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(h,d,f)}else this.decryptkey&&(i.decryptdata.key=this.decryptkey,this.hls.trigger(r.Events.KEY_LOADED,{frag:i}))}else s.logger.warn("Missing decryption data on fragment in onKeyLoading")},t.loadsuccess=function(e,t,i){var n=i.frag;n.decryptdata?(this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(r.Events.KEY_LOADED,{frag:n})):s.logger.error("after key load, decryptdata unset")},t.loaderror=function(e,t){var i=t.frag,s=i.loader;s&&s.abort(),delete this.loaders[i.type],this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:i,response:e})},t.loadtimeout=function(e,t){var i=t.frag,s=i.loader;s&&s.abort(),delete this.loaders[i.type],this.hls.trigger(r.Events.ERROR,{type:n.ErrorTypes.NETWORK_ERROR,details:n.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:i})},e}()},"./src/loader/level-details.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/loader/level-details.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: LevelDetails */function(e,t,i){"use strict";i.r(t),i.d(t,"LevelDetails",(function(){return s}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts");function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=e}var t,i,s;return e.prototype.reloaded=function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t,this.advanced=this.endSN>e.endSN||t>0||0===t&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay},t=e,(i=[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Object(r.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!==(e=this.fragments)&&void 0!==e&&e.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 e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!==(e=this.partList)&&void 0!==e&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}])&&n(t.prototype,i),s&&n(t,s),e}()},"./src/loader/level-key.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/loader/level-key.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: LevelKey */function(e,t,i){"use strict";i.r(t),i.d(t,"LevelKey",(function(){return s}));var r=i(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js");function n(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s=function(){function e(e,t){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,this._uri=t?Object(r.buildAbsoluteURL)(e,t,{alwaysNormalize:!0}):e}var t,i,s;return e.fromURL=function(t,i){return new e(t,i)},e.fromURI=function(t){return new e(t)},t=e,(i=[{key:"uri",get:function(){return this._uri}}])&&n(t.prototype,i),s&&n(t,s),e}()},"./src/loader/load-stats.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/loader/load-stats.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: LoadStats */function(e,t,i){"use strict";i.r(t),i.d(t,"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":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/loader/m3u8-parser.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return v}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! url-toolkit */"./node_modules/url-toolkit/src/url-toolkit.js"),s=i(/*! ./fragment */"./src/loader/fragment.ts"),o=i(/*! ./level-details */"./src/loader/level-details.ts"),a=i(/*! ./level-key */"./src/loader/level-key.ts"),l=i(/*! ../utils/attr-list */"./src/utils/attr-list.ts"),c=i(/*! ../utils/logger */"./src/utils/logger.ts"),u=i(/*! ../utils/codecs */"./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,d=/#EXT-X-MEDIA:(.*)/g,f=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),p=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("|")),g=/\.(mp4|m4s|m4v|m4a)$/i,v=function(){function e(){}return e.findGroup=function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.id===t)return r}},e.convertAVC1ToAVCOTI=function(e){var t=e.split(".");if(t.length>2){var i=t.shift()+".";return i+=parseInt(t.shift()).toString(16),i+=("000"+parseInt(t.shift()).toString(16)).substr(-4)}return e},e.resolve=function(e,t){return n.buildAbsoluteURL(t,e,{alwaysNormalize:!0})},e.parseMasterPlaylist=function(t,i){var r,n=[],s={},o=!1;for(h.lastIndex=0;null!=(r=h.exec(t));)if(r[1]){var a=new l.AttrList(r[1]),c={attrs:a,bitrate:a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),name:a.NAME,url:e.resolve(r[2],i)},u=a.decimalResolution("RESOLUTION");u&&(c.width=u.width,c.height=u.height),m((a.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),c),c.videoCodec&&-1!==c.videoCodec.indexOf("avc1")&&(c.videoCodec=e.convertAVC1ToAVCOTI(c.videoCodec)),n.push(c)}else if(r[3]){var d=new l.AttrList(r[3]);d["DATA-ID"]&&(o=!0,s[d["DATA-ID"]]=d)}return{levels:n,sessionData:o?s:null}},e.parseMasterPlaylistMedia=function(t,i,r,n){var s;void 0===n&&(n=[]);var o=[],a=0;for(d.lastIndex=0;null!==(s=d.exec(t));){var c=new l.AttrList(s[1]);if(c.TYPE===r){var u={attrs:c,bitrate:0,id:a++,groupId:c["GROUP-ID"],instreamId:c["INSTREAM-ID"],name:c.NAME||c.LANGUAGE||"",type:r,default:c.bool("DEFAULT"),autoselect:c.bool("AUTOSELECT"),forced:c.bool("FORCED"),lang:c.LANGUAGE,url:c.URI?e.resolve(c.URI,i):""};if(n.length){var h=e.findGroup(n,u.groupId)||n[0];y(u,h,"audioCodec"),y(u,h,"textCodec")}o.push(u)}}return o},e.parseLevelPlaylist=function(e,t,i,u,h){var d,v,m,y=new o.LevelDetails(t),b=y.fragments,S=null,C=0,w=0,k=0,x=0,E=null,T=new s.Fragment(u,t),L=-1,A=!1;for(f.lastIndex=0,y.m3u8=e;null!==(d=f.exec(e));){A&&(A=!1,(T=new s.Fragment(u,t)).start=k,T.sn=C,T.cc=x,T.level=i,S&&(T.initSegment=S,T.rawProgramDateTime=S.rawProgramDateTime));var R=d[1];if(R){T.duration=parseFloat(R);var D=(" "+d[2]).slice(1);T.title=D||null,T.tagList.push(D?["INF",R,D]:["INF",R])}else if(d[3])Object(r.isFiniteNumber)(T.duration)&&(T.start=k,m&&(T.levelkey=m),T.sn=C,T.level=i,T.cc=x,T.urlId=h,b.push(T),T.relurl=(" "+d[3]).slice(1),_(T,E),E=T,k+=T.duration,C++,w=0,A=!0);else if(d[4]){var O=(" "+d[4]).slice(1);E?T.setByteRange(O,E):T.setByteRange(O)}else if(d[5])T.rawProgramDateTime=(" "+d[5]).slice(1),T.tagList.push(["PROGRAM-DATE-TIME",T.rawProgramDateTime]),-1===L&&(L=b.length);else{if(!(d=d[0].match(p))){c.logger.warn("No matches on slow regex match for level playlist!");continue}for(v=1;v<d.length&&void 0===d[v];v++);var M=(" "+d[v]).slice(1),I=(" "+d[v+1]).slice(1),P=d[v+2]?(" "+d[v+2]).slice(1):"";switch(M){case"PLAYLIST-TYPE":y.type=I.toUpperCase();break;case"MEDIA-SEQUENCE":C=y.startSN=parseInt(I);break;case"SKIP":var F=new l.AttrList(I),B=F.decimalInteger("SKIPPED-SEGMENTS");if(Object(r.isFiniteNumber)(B)){y.skippedSegments=B;for(var N=B;N--;)b.unshift(null);C+=B}var H=F.enumeratedString("RECENTLY-REMOVED-DATERANGES");H&&(y.recentlyRemovedDateranges=H.split("\t"));break;case"TARGETDURATION":y.targetduration=parseFloat(I);break;case"VERSION":y.version=parseInt(I);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(I||P)&&T.tagList.push(P?[I,P]:[I]);break;case"DIS":x++;case"GAP":T.tagList.push([M]);break;case"BITRATE":T.tagList.push([M,I]);break;case"DISCONTINUITY-SEQ":x=parseInt(I);break;case"KEY":var j,U=new l.AttrList(I),K=U.enumeratedString("METHOD"),X=U.URI,W=U.hexadecimalInteger("IV"),z=U.enumeratedString("KEYFORMATVERSIONS"),G=U.enumeratedString("KEYID"),V=null!=(j=U.enumeratedString("KEYFORMAT"))?j:"identity";if(["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"].indexOf(V)>-1){c.logger.warn("Keyformat "+V+" is not supported from the manifest");continue}if("identity"!==V)continue;K&&(m=a.LevelKey.fromURL(t,X),X&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(K)>=0&&(m.method=K,m.keyFormat=V,G&&(m.keyID=G),z&&(m.keyFormatVersions=z),m.iv=W));break;case"START":var q=new l.AttrList(I).decimalFloatingPoint("TIME-OFFSET");Object(r.isFiniteNumber)(q)&&(y.startTimeOffset=q);break;case"MAP":var Q=new l.AttrList(I);T.relurl=Q.URI,Q.BYTERANGE&&T.setByteRange(Q.BYTERANGE),T.level=i,T.sn="initSegment",m&&(T.levelkey=m),T.initSegment=null,S=T,A=!0;break;case"SERVER-CONTROL":var Y=new l.AttrList(I);y.canBlockReload=Y.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=Y.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&Y.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=Y.optionalFloat("PART-HOLD-BACK",0),y.holdBack=Y.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var Z=new l.AttrList(I);y.partTarget=Z.decimalFloatingPoint("PART-TARGET");break;case"PART":var $=y.partList;$||($=y.partList=[]);var J=w>0?$[$.length-1]:void 0,ee=w++,te=new s.Part(new l.AttrList(I),T,t,ee,J);$.push(te),T.duration+=te.duration;break;case"PRELOAD-HINT":var ie=new l.AttrList(I);y.preloadHint=ie;break;case"RENDITION-REPORT":var re=new l.AttrList(I);y.renditionReports=y.renditionReports||[],y.renditionReports.push(re);break;default:c.logger.warn("line parsed but not handled: "+d)}}}E&&!E.relurl?(b.pop(),k-=E.duration,y.partList&&(y.fragmentHint=E)):y.partList&&(_(T,E),T.cc=x,y.fragmentHint=T);var ne=b.length,se=b[0],oe=b[ne-1];if((k+=y.skippedSegments*y.targetduration)>0&&ne&&oe){y.averagetargetduration=k/ne;var ae=oe.sn;y.endSN="initSegment"!==ae?ae:0,se&&(y.startCC=se.cc,se.initSegment||y.fragments.every((function(e){return e.relurl&&(t=e.relurl,g.test(null!=(i=null===(r=n.parseURL(t))||void 0===r?void 0:r.path)?i:""));var t,i,r}))&&(c.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),(T=new s.Fragment(u,t)).relurl=oe.relurl,T.level=i,T.sn="initSegment",se.initSegment=T,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(k+=y.fragmentHint.duration),y.totalduration=k,y.endCC=x,L>0&&function(e,t){for(var i=e[t],r=t;r--;){var n=e[r];if(!n)return;n.programDateTime=i.programDateTime-1e3*n.duration,i=n}}(b,L),y},e}();function m(e,t){["video","audio","text"].forEach((function(i){var r=e.filter((function(e){return Object(u.isCodecType)(e,i)}));if(r.length){var n=r.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t[i+"Codec"]=n.length>0?n[0]:r[0],e=e.filter((function(e){return-1===r.indexOf(e)}))}})),t.unknownCodecs=e}function y(e,t,i){var r=t[i];r&&(e[i]=r)}function _(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),Object(r.isFiniteNumber)(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/loader/playlist-loader.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../events */"./src/events.ts"),s=i(/*! ../errors */"./src/errors.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),l=i(/*! ./m3u8-parser */"./src/loader/m3u8-parser.ts"),c=i(/*! ../types/loader */"./src/types/loader.ts"),u=i(/*! ../utils/attr-list */"./src/utils/attr-list.ts");function h(e,t){var i=e.url;return void 0!==i&&0!==i.indexOf("data:")||(i=t.url),i}var d=function(){function e(e){this.hls=void 0,this.loaders=Object.create(null),this.hls=e,this.registerListeners()}var t=e.prototype;return t.registerListeners=function(){var e=this.hls;e.on(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.on(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.on(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.unregisterListeners=function(){var e=this.hls;e.off(n.Events.MANIFEST_LOADING,this.onManifestLoading,this),e.off(n.Events.LEVEL_LOADING,this.onLevelLoading,this),e.off(n.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(n.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},t.createInternalLoader=function(e){var t=this.hls.config,i=t.pLoader,r=t.loader,n=new(i||r)(t);return e.loader=n,this.loaders[e.type]=n,n},t.getInternalLoader=function(e){return this.loaders[e.type]},t.resetInternalLoader=function(e){this.loaders[e]&&delete this.loaders[e]},t.destroyInternalLoaders=function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}},t.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},t.onManifestLoading=function(e,t){var i=t.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:c.PlaylistContextType.MANIFEST,url:i,deliveryDirectives:null})},t.onLevelLoading=function(e,t){var i=t.id,r=t.level,n=t.url,s=t.deliveryDirectives;this.load({id:i,groupId:null,level:r,responseType:"text",type:c.PlaylistContextType.LEVEL,url:n,deliveryDirectives:s})},t.onAudioTrackLoading=function(e,t){var i=t.id,r=t.groupId,n=t.url,s=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.AUDIO_TRACK,url:n,deliveryDirectives:s})},t.onSubtitleTrackLoading=function(e,t){var i=t.id,r=t.groupId,n=t.url,s=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:c.PlaylistContextType.SUBTITLE_TRACK,url:n,deliveryDirectives:s})},t.load=function(e){var t,i,r,n,s,a,l=this.hls.config,u=this.getInternalLoader(e);if(u){var h=u.context;if(h&&h.url===e.url)return void o.logger.trace("[playlist-loader]: playlist request ongoing");o.logger.log("[playlist-loader]: aborting previous loader for type: "+e.type),u.abort()}switch(e.type){case c.PlaylistContextType.MANIFEST:i=l.manifestLoadingMaxRetry,r=l.manifestLoadingTimeOut,n=l.manifestLoadingRetryDelay,s=l.manifestLoadingMaxRetryTimeout;break;case c.PlaylistContextType.LEVEL:case c.PlaylistContextType.AUDIO_TRACK:case c.PlaylistContextType.SUBTITLE_TRACK:i=0,r=l.levelLoadingTimeOut;break;default:i=l.levelLoadingMaxRetry,r=l.levelLoadingTimeOut,n=l.levelLoadingRetryDelay,s=l.levelLoadingMaxRetryTimeout}if(u=this.createInternalLoader(e),null!==(t=e.deliveryDirectives)&&void 0!==t&&t.part&&(e.type===c.PlaylistContextType.LEVEL&&null!==e.level?a=this.hls.levels[e.level].details:e.type===c.PlaylistContextType.AUDIO_TRACK&&null!==e.id?a=this.hls.audioTracks[e.id].details:e.type===c.PlaylistContextType.SUBTITLE_TRACK&&null!==e.id&&(a=this.hls.subtitleTracks[e.id].details),a)){var d=a.partTarget,f=a.targetduration;d&&f&&(r=Math.min(1e3*Math.max(3*d,.8*f),r))}var p={timeout:r,maxRetry:i,retryDelay:n,maxRetryDelay:s,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(e,p,g)},t.loadsuccess=function(e,t,i,r){if(void 0===r&&(r=null),i.isSidxRequest)return this.handleSidxRequest(e,i),void this.handlePlaylistLoaded(e,t,i,r);this.resetInternalLoader(i.type);var n=e.data;0===n.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),n.indexOf("#EXTINF:")>0||n.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(e,t,i,r):this.handleMasterPlaylist(e,t,i,r)):this.handleManifestParsingError(e,i,"no EXTM3U delimiter",r)},t.loaderror=function(e,t,i){void 0===i&&(i=null),this.handleNetworkError(t,i,!1,e)},t.loadtimeout=function(e,t,i){void 0===i&&(i=null),this.handleNetworkError(t,i,!0)},t.handleMasterPlaylist=function(e,t,i,r){var s=this.hls,a=e.data,c=h(e,i),d=l.default.parseMasterPlaylist(a,c),f=d.levels,p=d.sessionData;if(f.length){var g=f.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),v=f.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),m=l.default.parseMasterPlaylistMedia(a,c,"AUDIO",g),y=l.default.parseMasterPlaylistMedia(a,c,"SUBTITLES",v),_=l.default.parseMasterPlaylistMedia(a,c,"CLOSED-CAPTIONS");m.length&&(m.some((function(e){return!e.url}))||!f[0].audioCodec||f[0].attrs.AUDIO||(o.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 u.AttrList({}),bitrate:0,url:""}))),s.trigger(n.Events.MANIFEST_LOADED,{levels:f,audioTracks:m,subtitles:y,captions:_,url:c,stats:t,networkDetails:r,sessionData:p})}else this.handleManifestParsingError(e,i,"no level found in manifest",r)},t.handleTrackOrLevelPlaylist=function(e,t,i,o){var a=this.hls,d=i.id,f=i.level,p=i.type,g=h(e,i),v=Object(r.isFiniteNumber)(d)?d:0,m=Object(r.isFiniteNumber)(f)?f:v,y=function(e){switch(e.type){case c.PlaylistContextType.AUDIO_TRACK:return c.PlaylistLevelType.AUDIO;case c.PlaylistContextType.SUBTITLE_TRACK:return c.PlaylistLevelType.SUBTITLE;default:return c.PlaylistLevelType.MAIN}}(i),_=l.default.parseLevelPlaylist(e.data,g,m,y,v);if(_.fragments.length){if(p===c.PlaylistContextType.MANIFEST){var b={attrs:new u.AttrList({}),bitrate:0,details:_,name:"",url:g};a.trigger(n.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:g,stats:t,networkDetails:o,sessionData:null})}if(t.parsing.end=performance.now(),_.needSidxRanges){var S,C=null===(S=_.fragments[0].initSegment)||void 0===S?void 0:S.url;this.load({url:C,isSidxRequest:!0,type:p,level:f,levelDetails:_,id:d,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null})}else i.levelDetails=_,this.handlePlaylistLoaded(e,t,i,o)}else a.trigger(n.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:g,reason:"no fragments found in level",level:"number"==typeof i.level?i.level:void 0})},t.handleSidxRequest=function(e,t){var i=Object(a.parseSegmentIndex)(new Uint8Array(e.data));if(i){var r=i.references,n=t.levelDetails;r.forEach((function(e,t){var r=e.info,s=n.fragments[t];0===s.byteRange.length&&s.setByteRange(String(1+r.end-r.start)+"@"+String(r.start)),s.initSegment&&s.initSegment.setByteRange(String(i.moovEndOffset)+"@0")}))}},t.handleManifestParsingError=function(e,t,i,r){this.hls.trigger(n.Events.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:t.type===c.PlaylistContextType.MANIFEST,url:e.url,reason:i,response:e,context:t,networkDetails:r})},t.handleNetworkError=function(e,t,i,r){void 0===i&&(i=!1),o.logger.warn("[playlist-loader]: A network "+(i?"timeout":"error")+" occurred while loading "+e.type+" level: "+e.level+" id: "+e.id+' group-id: "'+e.groupId+'"');var a=s.ErrorDetails.UNKNOWN,l=!1,u=this.getInternalLoader(e);switch(e.type){case c.PlaylistContextType.MANIFEST:a=i?s.ErrorDetails.MANIFEST_LOAD_TIMEOUT:s.ErrorDetails.MANIFEST_LOAD_ERROR,l=!0;break;case c.PlaylistContextType.LEVEL:a=i?s.ErrorDetails.LEVEL_LOAD_TIMEOUT:s.ErrorDetails.LEVEL_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.AUDIO_TRACK:a=i?s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case c.PlaylistContextType.SUBTITLE_TRACK:a=i?s.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:s.ErrorDetails.SUBTITLE_LOAD_ERROR,l=!1}u&&this.resetInternalLoader(e.type);var h={type:s.ErrorTypes.NETWORK_ERROR,details:a,fatal:l,url:e.url,loader:u,context:e,networkDetails:t};r&&(h.response=r),this.hls.trigger(n.Events.ERROR,h)},t.handlePlaylistLoaded=function(e,t,i,r){var s=i.type,o=i.level,a=i.id,l=i.groupId,u=i.loader,h=i.levelDetails,d=i.deliveryDirectives;if(null!=h&&h.targetduration){if(u)switch(h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),u.getCacheAge&&!isNaN(h.ageHeader)||(h.ageHeader=0)),s){case c.PlaylistContextType.MANIFEST:case c.PlaylistContextType.LEVEL:this.hls.trigger(n.Events.LEVEL_LOADED,{details:h,level:o||0,id:a||0,stats:t,networkDetails:r,deliveryDirectives:d});break;case c.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(n.Events.AUDIO_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:t,networkDetails:r,deliveryDirectives:d});break;case c.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(n.Events.SUBTITLE_TRACK_LOADED,{details:h,id:a||0,groupId:l||"",stats:t,networkDetails:r,deliveryDirectives:d})}}else this.handleManifestParsingError(e,i,"invalid target duration",r)},e}();t.default=d},"./src/polyfills/number.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/polyfills/number.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: isFiniteNumber, MAX_SAFE_INTEGER */function(e,t,i){"use strict";i.r(t),i.d(t,"isFiniteNumber",(function(){return r})),i.d(t,"MAX_SAFE_INTEGER",(function(){return n}));var r=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},n=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/remux/aac-helper.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=function(){function e(){}return e.getSilentFrame=function(e,t){switch(e){case"mp4a.40.2":if(1===t)return new Uint8Array([0,200,0,128,35,128]);if(2===t)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(3===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(4===t)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(5===t)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(6===t)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(1===t)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(2===t)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(3===t)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])}},e}();t.default=r},"./src/remux/mp4-generator.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/remux/mp4-generator.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=Math.pow(2,32)-1,n=function(){function e(){}return e.init=function(){var t;for(t in e.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:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),r=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:i,audio:r};var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),s=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=s,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,l,o,a),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,n))},e.box=function(e){for(var t=8,i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];for(var s=r.length,o=s;s--;)t+=r[s].byteLength;var a=new Uint8Array(t);for(a[0]=t>>24&255,a[1]=t>>16&255,a[2]=t>>8&255,a[3]=255&t,a.set(e,4),s=0,t=8;s<o;s++)a.set(r[s],t),t+=r[s].byteLength;return a},e.hdlr=function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])},e.mdat=function(t){return e.box(e.types.mdat,t)},e.mdhd=function(t,i){i*=t;var n=Math.floor(i/(r+1)),s=Math.floor(i%(r+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s,85,196,0,0]))},e.mdia=function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))},e.mfhd=function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))},e.minf=function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))},e.moof=function(t,i,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,i))},e.moov=function(t){for(var i=t.length,r=[];i--;)r[i]=e.trak(t[i]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))},e.mvex=function(t){for(var i=t.length,r=[];i--;)r[i]=e.trex(t[i]);return e.box.apply(null,[e.types.mvex].concat(r))},e.mvhd=function(t,i){i*=t;var n=Math.floor(i/(r+1)),s=Math.floor(i%(r+1)),o=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s,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 e.box(e.types.mvhd,o)},e.sdtp=function(t){var i,r,n=t.samples||[],s=new Uint8Array(4+n.length);for(i=0;i<n.length;i++)r=n[i].flags,s[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,s)},e.stbl=function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(t){var i,r,n,s=[],o=[];for(i=0;i<t.sps.length;i++)n=(r=t.sps[i]).byteLength,s.push(n>>>8&255),s.push(255&n),s=s.concat(Array.prototype.slice.call(r));for(i=0;i<t.pps.length;i++)n=(r=t.pps[i]).byteLength,o.push(n>>>8&255),o.push(255&n),o=o.concat(Array.prototype.slice.call(r));var a=e.box(e.types.avcC,new Uint8Array([1,s[3],s[4],s[5],255,224|t.sps.length].concat(s).concat([t.pps.length]).concat(o))),l=t.width,c=t.height,u=t.pixelRatio[0],h=t.pixelRatio[1];return e.box(e.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,l>>8&255,255&l,c>>8&255,255&c,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,h>>24,h>>16&255,h>>8&255,255&h])))},e.esds=function(e){var t=e.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(e.config).concat([6,1,2]))},e.mp4a=function(t){var i=t.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]),e.box(e.types.esds,e.esds(t)))},e.mp3=function(t){var i=t.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,i>>8&255,255&i,0,0]))},e.stsd=function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))},e.tkhd=function(t){var i=t.id,n=t.duration*t.timescale,s=t.width,o=t.height,a=Math.floor(n/(r+1)),l=Math.floor(n%(r+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,l>>24,l>>16&255,l>>8&255,255&l,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,s>>8&255,255&s,0,0,o>>8&255,255&o,0,0]))},e.traf=function(t,i){var n=e.sdtp(t),s=t.id,o=Math.floor(i/(r+1)),a=Math.floor(i%(r+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,a>>24,a>>16&255,a>>8&255,255&a])),e.trun(t,n.length+16+20+8+16+8+8),n)},e.trak=function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))},e.trex=function(t){var i=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(t,i){var r,n,s,o,a,l,c=t.samples||[],u=c.length,h=12+16*u,d=new Uint8Array(h);for(i+=8+h,d.set([0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r<u;r++)s=(n=c[r]).duration,o=n.size,a=n.flags,l=n.cts,d.set([s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,61440&a.degradPrio,15&a.degradPrio,l>>>24&255,l>>>16&255,l>>>8&255,255&l],12+16*r);return e.box(e.types.trun,d)},e.initSegment=function(t){e.types||e.init();var i=e.moov(t),r=new Uint8Array(e.FTYP.byteLength+i.byteLength);return r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r},e}();n.types=void 0,n.HDLR_TYPES=void 0,n.STTS=void 0,n.STSC=void 0,n.STCO=void 0,n.STSZ=void 0,n.VMHD=void 0,n.SMHD=void 0,n.STSD=void 0,n.FTYP=void 0,n.DINF=void 0,t.default=n},"./src/remux/mp4-remuxer.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/remux/mp4-remuxer.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default, normalizePts */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return g})),i.d(t,"normalizePts",(function(){return v}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ./aac-helper */"./src/remux/aac-helper.ts"),s=i(/*! ./mp4-generator */"./src/remux/mp4-generator.ts"),o=i(/*! ../events */"./src/events.ts"),a=i(/*! ../errors */"./src/errors.ts"),l=i(/*! ../utils/logger */"./src/utils/logger.ts"),c=i(/*! ../types/loader */"./src/types/loader.ts"),u=i(/*! ../utils/timescale-conversion */"./src/utils/timescale-conversion.ts");function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var d=null,f=null,p=!1,g=function(){function e(e,t,i,r){if(void 0===r&&(r=""),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=e,this.config=t,this.typeSupported=i,this.ISGenerated=!1,null===d){var n=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);d=n?parseInt(n[1]):0}if(null===f){var s=navigator.userAgent.match(/Safari\/(\d+)/i);f=s?parseInt(s[1]):0}p=!!d&&d<75||!!f&&f<600}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){l.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e},t.resetNextTimestamp=function(){l.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},t.resetInitSegment=function(){l.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},t.getVideoStartPts=function(e){var t=!1,i=e.reduce((function(e,i){var r=i.pts-e;return r<-4294967296?(t=!0,v(e,i.pts)):r>0?e:i.pts}),e[0].pts);return t&&l.logger.debug("PTS rollover detected"),i},t.remux=function(e,t,i,r,n,s,o,a){var u,h,d,f,p,g,m=n,y=n,_=e.pid>-1,b=t.pid>-1,S=t.samples.length,C=e.samples.length>0,w=S>1;if((!_||C)&&(!b||w)||this.ISGenerated||o){this.ISGenerated||(d=this.generateIS(e,t,n));var k=this.isVideoContiguous,x=-1;if(w&&(x=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!k&&this.config.forceKeyFrameOnDiscontinuity))if(g=!0,x>0){l.logger.warn("[mp4-remuxer]: Dropped "+x+" out of "+S+" video samples due to a missing keyframe");var E=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(x),t.dropped+=x,y+=(t.samples[0].pts-E)/(t.timescale||9e4)}else-1===x&&(l.logger.warn("[mp4-remuxer]: No keyframe found out of "+S+" video samples"),g=!1);if(this.ISGenerated){if(C&&w){var T=this.getVideoStartPts(t.samples),L=(v(e.samples[0].pts,T)-T)/t.inputTimeScale;m+=Math.max(0,L),y+=Math.max(0,-L)}if(C){if(e.samplerate||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),d=this.generateIS(e,t,n)),h=this.remuxAudio(e,m,this.isAudioContiguous,s,b||w||a===c.PlaylistLevelType.AUDIO?y:void 0),w){var A=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(l.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),d=this.generateIS(e,t,n)),u=this.remuxVideo(t,y,k,A)}}else w&&(u=this.remuxVideo(t,y,k,0));u&&(u.firstKeyFrame=x,u.independent=-1!==x)}}return this.ISGenerated&&(i.samples.length&&(p=this.remuxID3(i,n)),r.samples.length&&(f=this.remuxText(r,n))),{audio:h,video:u,initSegment:d,independent:g,text:f,id3:p}},t.generateIS=function(e,t,i){var n,o,a,l=e.samples,c=t.samples,u=this.typeSupported,h={},d=!Object(r.isFiniteNumber)(this._initPTS),f="audio/mp4";if(d&&(n=o=1/0),e.config&&l.length&&(e.timescale=e.samplerate,e.isAAC||(u.mpeg?(f="audio/mpeg",e.codec=""):u.mp3&&(e.codec="mp3")),h.audio={id:"audio",container:f,codec:e.codec,initSegment:!e.isAAC&&u.mpeg?new Uint8Array(0):s.default.initSegment([e]),metadata:{channelCount:e.channelCount}},d&&(a=e.inputTimeScale,n=o=l[0].pts-Math.round(a*i))),t.sps&&t.pps&&c.length&&(t.timescale=t.inputTimeScale,h.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:s.default.initSegment([t]),metadata:{width:t.width,height:t.height}},d)){a=t.inputTimeScale;var p=this.getVideoStartPts(c),g=Math.round(a*i);o=Math.min(o,v(c[0].dts,p)-g),n=Math.min(n,p-g)}if(Object.keys(h).length)return this.ISGenerated=!0,d&&(this._initPTS=n,this._initDTS=o),{tracks:h,initPTS:n,timescale:a}},t.remuxVideo=function(e,t,i,r){var n,c,f,g=e.inputTimeScale,y=e.samples,_=[],b=y.length,S=this._initPTS,C=this.nextAvcDts,w=8,k=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,E=0,T=!1;i&&null!==C||(C=t*g-(y[0].pts-v(y[0].dts,y[0].pts)));for(var L=0;L<b;L++){var A=y[L];A.pts=v(A.pts-S,C),A.dts=v(A.dts-S,C),A.dts>A.pts&&(E=Math.max(Math.min(E,A.pts-A.dts),-18e3)),A.dts<y[L>0?L-1:L].dts&&(T=!0)}T&&y.sort((function(e,t){var i=e.dts-t.dts,r=e.pts-t.pts;return i||r})),c=y[0].dts,f=y[y.length-1].dts;var R=Math.round((f-c)/(b-1));if(E<0){if(E<-2*R){l.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(u.toMsFromMpegTsClock)(-R,!0)+" ms");for(var D=E,O=0;O<b;O++)y[O].dts=D=Math.max(D,y[O].pts-R),y[O].pts=Math.max(D,y[O].pts)}else{l.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(u.toMsFromMpegTsClock)(E,!0)+" ms to overcome this issue");for(var M=0;M<b;M++)y[M].dts=y[M].dts+E}c=y[0].dts}if(i){var I=c-C,P=I>R;if(P||I<-1){P?l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(I,!0)+" ms ("+I+"dts) hole between fragments detected, filling it"):l.logger.warn("AVC: "+Object(u.toMsFromMpegTsClock)(-I,!0)+" ms ("+I+"dts) overlapping between fragments detected"),c=C;var F=y[0].pts-I;y[0].dts=c,y[0].pts=F,l.logger.log("Video: First PTS/DTS adjusted: "+Object(u.toMsFromMpegTsClock)(F,!0)+"/"+Object(u.toMsFromMpegTsClock)(c,!0)+", delta: "+Object(u.toMsFromMpegTsClock)(I,!0)+" ms")}}p&&(c=Math.max(0,c));for(var B=0,N=0,H=0;H<b;H++){for(var j=y[H],U=j.units,K=U.length,X=0,W=0;W<K;W++)X+=U[W].data.length;N+=X,B+=K,j.length=X,j.dts=Math.max(j.dts,c),j.pts=Math.max(j.pts,j.dts,0),k=Math.min(j.pts,k),x=Math.max(j.pts,x)}f=y[b-1].dts;var z,G=N+4*B+8;try{z=new Uint8Array(G)}catch(e){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:G,reason:"fail allocating video mdat "+G})}var V=new DataView(z.buffer);V.setUint32(0,G),z.set(s.default.types.mdat,4);for(var q=0;q<b;q++){for(var Q=y[q],Y=Q.units,Z=0,$=0,J=Y.length;$<J;$++){var ee=Y[$],te=ee.data,ie=ee.data.byteLength;V.setUint32(w,ie),w+=4,z.set(te,w),w+=ie,Z+=4+ie}if(q<b-1)n=y[q+1].dts-Q.dts;else{var re=this.config,ne=Q.dts-y[q>0?q-1:q].dts;if(re.stretchShortVideoTrack&&null!==this.nextAudioPts){var se=Math.floor(re.maxBufferHole*g),oe=(r?k+r*g:this.nextAudioPts)-Q.pts;oe>se?((n=oe-ne)<0&&(n=ne),l.logger.log("[mp4-remuxer]: It is approximately "+oe/90+" ms to the next segment; using duration "+n/90+" ms for the last video frame.")):n=ne}else n=ne}var ae=Math.round(Q.pts-Q.dts);_.push(new m(Q.key,n,Z,ae))}if(_.length&&d&&d<70){var le=_[0].flags;le.dependsOn=2,le.isNonSync=0}console.assert(void 0!==n,"mp4SampleDuration must be computed"),this.nextAvcDts=C=f+n,this.isVideoContiguous=!0;var ce={data1:s.default.moof(e.sequenceNumber++,c,h({},e,{samples:_})),data2:z,startPTS:k/g,endPTS:(x+n)/g,startDTS:c/g,endDTS:C/g,type:"video",hasAudio:!1,hasVideo:!0,nb:_.length,dropped:e.dropped};return e.samples=[],e.dropped=0,console.assert(z.length,"MDAT length must not be zero"),ce},t.remuxAudio=function(e,t,i,r,c){var u=e.inputTimeScale,d=u/(e.samplerate?e.samplerate:u),f=e.isAAC?1024:1152,p=f*d,g=this._initPTS,y=!e.isAAC&&this.typeSupported.mpeg,_=[],b=e.samples,S=y?0:8,C=this.nextAudioPts||-1,w=t*u;if(this.isAudioContiguous=i=i||b.length&&C>0&&(r&&Math.abs(w-C)<9e3||Math.abs(v(b[0].pts-g,w)-C)<20*p),b.forEach((function(e){e.pts=v(e.pts-g,w)})),!i||C<0){if(!(b=b.filter((function(e){return e.pts>=0}))).length)return;C=0===c?0:r?Math.max(0,w):b[0].pts}if(e.isAAC)for(var k=void 0!==c,x=this.config.maxAudioFramesDrift,E=0,T=C;E<b.length;E++){var L=b[E],A=L.pts,R=A-T,D=Math.abs(1e3*R/u);if(R<=-x*p&&k)0===E&&(l.logger.warn("Audio frame @ "+(A/u).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*R/u)+" ms."),this.nextAudioPts=C=T=A);else if(R>=x*p&&D<1e4&&k){var O=Math.round(R/p);(T=A-O*p)<0&&(O--,T+=p),0===E&&(this.nextAudioPts=C=T),l.logger.warn("[mp4-remuxer]: Injecting "+O+" audio frame @ "+(T/u).toFixed(3)+"s due to "+Math.round(1e3*R/u)+" ms gap.");for(var M=0;M<O;M++){var I=Math.max(T,0),P=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);P||(l.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),P=L.unit.subarray()),b.splice(E,0,{unit:P,pts:I}),T+=p,E++}}L.pts=T,T+=p}for(var F,B=null,N=null,H=0,j=b.length;j--;)H+=b[j].unit.byteLength;for(var U=0,K=b.length;U<K;U++){var X=b[U],W=X.unit,z=X.pts;if(null!==N)_[U-1].duration=Math.round((z-N)/d);else{if(i&&e.isAAC&&(z=C),B=z,!(H>0))return;H+=S;try{F=new Uint8Array(H)}catch(e){return void this.observer.emit(o.Events.ERROR,o.Events.ERROR,{type:a.ErrorTypes.MUX_ERROR,details:a.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:H,reason:"fail allocating audio mdat "+H})}y||(new DataView(F.buffer).setUint32(0,H),F.set(s.default.types.mdat,4))}F.set(W,S);var G=W.byteLength;S+=G,_.push(new m(!0,f,G,0)),N=z}var V=_.length;if(V){var q=_[_.length-1];this.nextAudioPts=C=N+d*q.duration;var Q=y?new Uint8Array(0):s.default.moof(e.sequenceNumber++,B/d,h({},e,{samples:_}));e.samples=[];var Y=B/u,Z=C/u,$={data1:Q,data2:F,startPTS:Y,endPTS:Z,startDTS:Y,endDTS:Z,type:"audio",hasAudio:!0,hasVideo:!1,nb:V};return this.isAudioContiguous=!0,console.assert(F.length,"MDAT length must not be zero"),$}},t.remuxEmptyAudio=function(e,t,i,r){var s=e.inputTimeScale,o=s/(e.samplerate?e.samplerate:s),a=this.nextAudioPts,c=(null!==a?a:r.startDTS*s)+this._initDTS,u=r.endDTS*s+this._initDTS,h=1024*o,d=Math.ceil((u-c)/h),f=n.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(l.logger.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],g=0;g<d;g++){var v=c+g*h;p.push({unit:f,pts:v,dts:v})}return e.samples=p,this.remuxAudio(e,t,i,!1)}l.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},t.remuxID3=function(e,t){var i=e.samples.length;if(i){for(var r=e.inputTimeScale,n=this._initPTS,s=this._initDTS,o=0;o<i;o++){var a=e.samples[o];a.pts=v(a.pts-n,t*r)/r,a.dts=v(a.dts-s,t*r)/r}var l=e.samples;return e.samples=[],{samples:l}}},t.remuxText=function(e,t){var i=e.samples.length;if(i){for(var r=e.inputTimeScale,n=this._initPTS,s=0;s<i;s++){var o=e.samples[s];o.pts=v(o.pts-n,t*r)/r}e.samples.sort((function(e,t){return e.pts-t.pts}));var a=e.samples;return e.samples=[],{samples:a}}},e}();function v(e,t){var i;if(null===t)return e;for(i=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=i;return e}var m=function(e,t,i,r){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=t,this.size=i,this.cts=r,this.flags=new y(e)},y=function(e){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=e?2:1,this.isNonSync=e?0:1}},"./src/remux/passthrough-remuxer.ts":
|
|
|
/*!******************************************!*\
|
|
|
!*** ./src/remux/passthrough-remuxer.ts ***!
|
|
|
\******************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../utils/mp4-tools */"./src/utils/mp4-tools.ts"),s=i(/*! ../loader/fragment */"./src/loader/fragment.ts"),o=i(/*! ../utils/logger */"./src/utils/logger.ts"),a=function(){function e(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var t=e.prototype;return t.destroy=function(){},t.resetTimeStamp=function(e){this.initPTS=e,this.lastEndDTS=null},t.resetNextTimestamp=function(){this.lastEndDTS=null},t.resetInitSegment=function(e,t,i){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(e),this.emitInitSegment=!0},t.generateInitSegment=function(e){var t=this.audioCodec,i=this.videoCodec;if(!e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=Object(n.parseInitSegment)(e);t||(t=c(r.audio,s.ElementaryStreamTypes.AUDIO)),i||(i=c(r.video,s.ElementaryStreamTypes.VIDEO));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?a.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:o.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a},t.remux=function(e,t,i,s,a){var c=this.initPTS,u=this.lastEndDTS,h={audio:void 0,video:void 0,text:s,id3:i,initSegment:void 0};Object(r.isFiniteNumber)(u)||(u=this.lastEndDTS=a||0);var d=t.samples;if(!d||!d.length)return h;var f={initPTS:void 0,timescale:1},p=this.initData;if(p&&p.length||(this.generateInitSegment(d),p=this.initData),!p||!p.length)return o.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),h;this.emitInitSegment&&(f.tracks=this.initTracks,this.emitInitSegment=!1),Object(r.isFiniteNumber)(c)||(this.initPTS=f.initPTS=c=l(p,d,u));var g=Object(n.getDuration)(d,p),v=u,m=g+v;Object(n.offsetStartDTS)(p,d,c),g>0?this.lastEndDTS=m:(o.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var y=!!p.audio,_=!!p.video,b="";y&&(b+="audio"),_&&(b+="video");var S={data1:d,startPTS:v,startDTS:v,endPTS:m,endDTS:m,type:b,hasAudio:y,hasVideo:_,nb:1,dropped:0};return h.audio="audio"===S.type?S:void 0,h.video="audio"!==S.type?S:void 0,h.text=s,h.id3=i,h.initSegment=f,h},e}(),l=function(e,t,i){return Object(n.getStartDTS)(e,t)-i};function c(e,t){var i=null==e?void 0:e.codec;return i&&i.length>4?i:"hvc1"===i?"hvc1.1.c.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||t===s.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}t.default=a},"./src/task-loop.ts":
|
|
|
/*!**************************!*\
|
|
|
!*** ./src/task-loop.ts ***!
|
|
|
\**************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return r}));var r=function(){function e(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var t=e.prototype;return t.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},t.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},t.onHandlerDestroyed=function(){},t.hasInterval=function(){return!!this._tickInterval},t.hasNextTick=function(){return!!this._tickTimer},t.setInterval=function(e){return!this._tickInterval&&(this._tickInterval=self.setInterval(this._boundTick,e),!0)},t.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},t.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},t.tick=function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},t.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},t.doTick=function(){},e}()},"./src/types/cmcd.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/types/cmcd.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: CMCDVersion, CMCDObjectType, CMCDStreamingFormat, CMCDStreamType */function(e,t,i){"use strict";i.r(t),i.d(t,"CMCDVersion",(function(){return o})),i.d(t,"CMCDObjectType",(function(){return r})),i.d(t,"CMCDStreamingFormat",(function(){return n})),i.d(t,"CMCDStreamType",(function(){return s}));var r,n,s,o=1;!function(e){e.MANIFEST="m",e.AUDIO="a",e.VIDEO="v",e.MUXED="av",e.INIT="i",e.CAPTION="c",e.TIMED_TEXT="tt",e.KEY="k",e.OTHER="o"}(r||(r={})),function(e){e.DASH="d",e.HLS="h",e.SMOOTH="s",e.OTHER="o"}(n||(n={})),function(e){e.VOD="v",e.LIVE="l"}(s||(s={}))},"./src/types/level.ts":
|
|
|
/*!****************************!*\
|
|
|
!*** ./src/types/level.ts ***!
|
|
|
\****************************/
|
|
|
/*! exports provided: HlsSkip, getSkipValue, HlsUrlParameters, Level */function(e,t,i){"use strict";function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var n;function s(e,t){var i=e.canSkipUntil,r=e.canSkipDateRanges,s=e.endSN;return i&&(void 0!==t?t-s:0)<i?r?n.v2:n.Yes:n.No}i.r(t),i.d(t,"HlsSkip",(function(){return n})),i.d(t,"getSkipValue",(function(){return s})),i.d(t,"HlsUrlParameters",(function(){return o})),i.d(t,"Level",(function(){return a})),function(e){e.No="",e.Yes="YES",e.v2="v2"}(n||(n={}));var o=function(){function e(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}return e.prototype.addDirectives=function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.toString()},e}(),a=function(){function e(e){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[e.url],this.attrs=e.attrs,this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.unknownCodecs=e.unknownCodecs,this.codecSet=[e.videoCodec,e.audioCodec].filter((function(e){return e})).join(",").replace(/\.[^.,]+/g,"")}var t,i,n;return t=e,(i=[{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(e){var t=e%this.url.length;this._urlId!==t&&(this.details=void 0,this._urlId=t)}}])&&r(t.prototype,i),n&&r(t,n),e}()},"./src/types/loader.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/types/loader.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: PlaylistContextType, PlaylistLevelType */function(e,t,i){"use strict";var r,n;i.r(t),i.d(t,"PlaylistContextType",(function(){return r})),i.d(t,"PlaylistLevelType",(function(){return n})),function(e){e.MANIFEST="manifest",e.LEVEL="level",e.AUDIO_TRACK="audioTrack",e.SUBTITLE_TRACK="subtitleTrack"}(r||(r={})),function(e){e.MAIN="main",e.AUDIO="audio",e.SUBTITLE="subtitle"}(n||(n={}))},"./src/types/transmuxer.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/types/transmuxer.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: ChunkMetadata */function(e,t,i){"use strict";i.r(t),i.d(t,"ChunkMetadata",(function(){return r}));var r=function(e,t,i,r,n,s){void 0===r&&(r=0),void 0===n&&(n=-1),void 0===s&&(s=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=e,this.sn=t,this.id=i,this.size=r,this.part=n,this.partial=s}},"./src/utils/attr-list.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/attr-list.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: AttrList */function(e,t,i){"use strict";i.r(t),i.d(t,"AttrList",(function(){return s}));var r=/^(\d+)x(\d+)$/,n=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,s=function(){function e(t){for(var i in"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(i)&&(this[i]=t[i])}var t=e.prototype;return t.decimalInteger=function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.hexadecimalInteger=function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var i=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(2*r,2*r+2),16);return i}return null},t.hexadecimalIntegerAsNumber=function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t},t.decimalFloatingPoint=function(e){return parseFloat(this[e])},t.optionalFloat=function(e,t){var i=this[e];return i?parseFloat(i):t},t.enumeratedString=function(e){return this[e]},t.bool=function(e){return"YES"===this[e]},t.decimalResolution=function(e){var t=r.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(e){var t,i={};for(n.lastIndex=0;null!==(t=n.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[t[1]]=r}return i},e}()},"./src/utils/binary-search.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/binary-search.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),t.default={search:function(e,t){for(var i=0,r=e.length-1,n=null,s=null;i<=r;){var o=t(s=e[n=(i+r)/2|0]);if(o>0)i=n+1;else{if(!(o<0))return s;r=n-1}}return null}}},"./src/utils/buffer-helper.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/buffer-helper.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: BufferHelper */function(e,t,i){"use strict";i.r(t),i.d(t,"BufferHelper",(function(){return s}));var r=i(/*! ./logger */"./src/utils/logger.ts"),n={length:0,start:function(){return 0},end:function(){return 0}},s=function(){function e(){}return e.isBuffered=function(t,i){try{if(t)for(var r=e.getBuffered(t),n=0;n<r.length;n++)if(i>=r.start(n)&&i<=r.end(n))return!0}catch(e){}return!1},e.bufferInfo=function(t,i,r){try{if(t){var n,s=e.getBuffered(t),o=[];for(n=0;n<s.length;n++)o.push({start:s.start(n),end:s.end(n)});return this.bufferedInfo(o,i,r)}}catch(e){}return{len:0,start:i,end:i,nextStart:void 0}},e.bufferedInfo=function(e,t,i){t=Math.max(0,t),e.sort((function(e,t){var i=e.start-t.start;return i||t.end-e.end}));var r=[];if(i)for(var n=0;n<e.length;n++){var s=r.length;if(s){var o=r[s-1].end;e[n].start-o<i?e[n].end>o&&(r[s-1].end=e[n].end):r.push(e[n])}else r.push(e[n])}else r=e;for(var a,l=0,c=t,u=t,h=0;h<r.length;h++){var d=r[h].start,f=r[h].end;if(t+i>=d&&t<f)c=d,l=(u=f)-t;else if(t+i<d){a=d;break}}return{len:l,start:c||0,end:u||0,nextStart:a}},e.getBuffered=function(e){try{return e.buffered}catch(e){return r.logger.log("failed to get media.buffered",e),n}},e}()},"./src/utils/cea-608-parser.ts":
|
|
|
/*!*************************************!*\
|
|
|
!*** ./src/utils/cea-608-parser.ts ***!
|
|
|
\*************************************/
|
|
|
/*! exports provided: Row, CaptionScreen, default */function(e,t,i){"use strict";i.r(t),i.d(t,"Row",(function(){return v})),i.d(t,"CaptionScreen",(function(){return m}));var r,n=i(/*! ../utils/logger */"./src/utils/logger.ts"),s={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},o=function(e){var t=e;return s.hasOwnProperty(e)&&(t=s[e]),String.fromCharCode(t)},a={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},l={17:2,18:4,21:6,22:8,23:10,19:13,20:15},c={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},u={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];!function(e){e[e.ERROR=0]="ERROR",e[e.TEXT=1]="TEXT",e[e.WARNING=2]="WARNING",e[e.INFO=2]="INFO",e[e.DEBUG=3]="DEBUG",e[e.DATA=3]="DATA"}(r||(r={}));var d=function(){function e(){this.time=null,this.verboseLevel=r.ERROR}return e.prototype.log=function(e,t){this.verboseLevel>=e&&n.logger.log(this.time+" ["+e+"] "+t)},e}(),f=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].toString(16));return t},p=function(){function e(e,t,i,r,n){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=e||"white",this.underline=t||!1,this.italics=i||!1,this.background=r||"black",this.flash=n||!1}var t=e.prototype;return t.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},t.setStyles=function(e){for(var t=["foreground","underline","italics","background","flash"],i=0;i<t.length;i++){var r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}},t.isDefault=function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},t.equals=function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},t.copy=function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},t.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},e}(),g=function(){function e(e,t,i,r,n,s){this.uchar=void 0,this.penState=void 0,this.uchar=e||" ",this.penState=new p(t,i,r,n,s)}var t=e.prototype;return t.reset=function(){this.uchar=" ",this.penState.reset()},t.setChar=function(e,t){this.uchar=e,this.penState.copy(t)},t.setPenState=function(e){this.penState.copy(e)},t.equals=function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},t.copy=function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},t.isEmpty=function(){return" "===this.uchar&&this.penState.isDefault()},e}(),v=function(){function e(e){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var t=0;t<100;t++)this.chars.push(new g);this.logger=e,this.pos=0,this.currPenState=new p}var t=e.prototype;return t.equals=function(e){for(var t=!0,i=0;i<100;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<100;t++)this.chars[t].copy(e.chars[t])},t.isEmpty=function(){for(var e=!0,t=0;t<100;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},t.setCursor=function(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(r.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>100&&(this.logger.log(r.DEBUG,"Too large cursor position "+this.pos),this.pos=100)},t.moveCursor=function(e){var t=this.pos+e;if(e>1)for(var i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)},t.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},t.insertChar=function(e){e>=144&&this.backSpace();var t=o(e);this.pos>=100?this.logger.log(r.ERROR,"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},t.clearFromPos=function(e){var t;for(t=e;t<100;t++)this.chars[t].reset()},t.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},t.clearToEndOfRow=function(){this.clearFromPos(this.pos)},t.getTextString=function(){for(var e=[],t=!0,i=0;i<100;i++){var r=this.chars[i].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},t.setPenStyles=function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)},e}(),m=function(){function e(e){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var t=0;t<15;t++)this.rows.push(new v(e));this.logger=e,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var t=e.prototype;return t.reset=function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},t.equals=function(e){for(var t=!0,i=0;i<15;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t},t.copy=function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},t.isEmpty=function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},t.backSpace=function(){this.rows[this.currRow].backSpace()},t.clearToEndOfRow=function(){this.rows[this.currRow].clearToEndOfRow()},t.insertChar=function(e){this.rows[this.currRow].insertChar(e)},t.setPen=function(e){this.rows[this.currRow].setPenStyles(e)},t.moveCursor=function(e){this.rows[this.currRow].moveCursor(e)},t.setCursor=function(e){this.logger.log(r.INFO,"setCursor: "+e),this.rows[this.currRow].setCursor(e)},t.setPAC=function(e){this.logger.log(r.INFO,"pacData = "+JSON.stringify(e));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var i=0;i<15;i++)this.rows[i].clear();var n=this.currRow+1-this.nrRollUpRows,s=this.lastOutputScreen;if(s){var o=s.rows[n].cueStartTime,a=this.logger.time;if(o&&null!==a&&o<a)for(var l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(s.rows[n+l])}}this.currRow=t;var c=this.rows[this.currRow];if(null!==e.indent){var u=e.indent,h=Math.max(u-1,0);c.setCursor(e.indent),e.color=c.chars[h].penState.foreground}var d={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(d)},t.setBkgData=function(e){this.logger.log(r.INFO,"bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},t.setRollUpRows=function(e){this.nrRollUpRows=e},t.rollUp=function(){if(null!==this.nrRollUpRows){this.logger.log(r.TEXT,this.getDisplayText());var e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(r.INFO,"Rolling up")}else this.logger.log(r.DEBUG,"roll_up but nrRollUpRows not set yet")},t.getDisplayText=function(e){e=e||!1;for(var t=[],i="",r=-1,n=0;n<15;n++){var s=this.rows[n].getTextString();s&&(r=n+1,e?t.push("Row "+r+": '"+s+"'"):t.push(s.trim()))}return t.length>0&&(i=e?"["+t.join(" | ")+"]":t.join("\n")),i},t.getTextAndFormat=function(){return this.rows},e}(),y=function(){function e(e,t,i){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=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new m(i),this.nonDisplayedMemory=new m(i),this.lastOutputScreen=new m(i),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}var t=e.prototype;return t.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},t.getHandler=function(){return this.outputFilter},t.setHandler=function(e){this.outputFilter=e},t.setPAC=function(e){this.writeScreen.setPAC(e)},t.setBkgData=function(e){this.writeScreen.setBkgData(e)},t.setMode=function(e){e!==this.mode&&(this.mode=e,this.logger.log(r.INFO,"MODE="+e),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},t.insertChars=function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(r.INFO,i+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(r.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},t.ccRCL=function(){this.logger.log(r.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},t.ccBS=function(){this.logger.log(r.INFO,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},t.ccAOF=function(){},t.ccAON=function(){},t.ccDER=function(){this.logger.log(r.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},t.ccRU=function(e){this.logger.log(r.INFO,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},t.ccFON=function(){this.logger.log(r.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},t.ccRDC=function(){this.logger.log(r.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},t.ccTR=function(){this.logger.log(r.INFO,"TR"),this.setMode("MODE_TEXT")},t.ccRTD=function(){this.logger.log(r.INFO,"RTD"),this.setMode("MODE_TEXT")},t.ccEDM=function(){this.logger.log(r.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},t.ccCR=function(){this.logger.log(r.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},t.ccENM=function(){this.logger.log(r.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},t.ccEOC=function(){if(this.logger.log(r.INFO,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(r.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},t.ccTO=function(e){this.logger.log(r.INFO,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},t.ccMIDROW=function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var i=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][i]}this.logger.log(r.INFO,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},t.outputDataUpdate=function(e){void 0===e&&(e=!1);var t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))},t.cueSplitAtTime=function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))},e}(),_=function(){function e(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var r=new d;this.channels=[null,new y(e,t,r),new y(e+1,i,r)],this.cmdHistory={a:null,b:null},this.logger=r}var t=e.prototype;return t.getHandler=function(e){return this.channels[e].getHandler()},t.setHandler=function(e,t){this.channels[e].setHandler(t)},t.addData=function(e,t){var i,n,s,o=!1;this.logger.time=e;for(var a=0;a<t.length;a+=2)if(n=127&t[a],s=127&t[a+1],0!==n||0!==s){if(this.logger.log(r.DATA,"["+f([t[a],t[a+1]])+"] -> ("+f([n,s])+")"),(i=this.parseCmd(n,s))||(i=this.parseMidrow(n,s)),i||(i=this.parsePAC(n,s)),i||(i=this.parseBackgroundAttributes(n,s)),!i&&(o=this.parseChars(n,s))){var l=this.currentChannel;l&&l>0?this.channels[l].insertChars(o):this.logger.log(r.WARNING,"No channel found yet. TEXT-MODE?")}i||o||this.logger.log(r.WARNING,"Couldn't parse cleaned data "+f([n,s])+" orig: "+f([t[a],t[a+1]]))}},t.parseCmd=function(e,t){var i=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=33&&t<=35))return!1;if(S(e,t,i))return b(null,null,i),this.logger.log(r.DEBUG,"Repeated command ("+f([e,t])+") is dropped"),!0;var n=20===e||21===e||23===e?1:2,s=this.channels[n];return 20===e||21===e||28===e||29===e?32===t?s.ccRCL():33===t?s.ccBS():34===t?s.ccAOF():35===t?s.ccAON():36===t?s.ccDER():37===t?s.ccRU(2):38===t?s.ccRU(3):39===t?s.ccRU(4):40===t?s.ccFON():41===t?s.ccRDC():42===t?s.ccTR():43===t?s.ccRTD():44===t?s.ccEDM():45===t?s.ccCR():46===t?s.ccENM():47===t&&s.ccEOC():s.ccTO(t-32),b(e,t,i),this.currentChannel=n,!0},t.parseMidrow=function(e,t){var i=0;if((17===e||25===e)&&t>=32&&t<=47){if((i=17===e?1:2)!==this.currentChannel)return this.logger.log(r.ERROR,"Mismatch channel in midrow parsing"),!1;var n=this.channels[i];return!!n&&(n.ccMIDROW(t),this.logger.log(r.DEBUG,"MIDROW ("+f([e,t])+")"),!0)}return!1},t.parsePAC=function(e,t){var i,r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127||(16===e||24===e)&&t>=64&&t<=95))return!1;if(S(e,t,r))return b(null,null,r),!0;var n=e<=23?1:2;i=t>=64&&t<=95?1===n?a[e]:c[e]:1===n?l[e]:u[e];var s=this.channels[n];return!!s&&(s.setPAC(this.interpretPAC(i,t)),b(e,t,r),this.currentChannel=n,!0)},t.interpretPAC=function(e,t){var i,r={color:null,italics:!1,indent:null,underline:!1,row:e};return i=t>95?t-96:t-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r},t.parseChars=function(e,t){var i,n,s=null,a=null;if(e>=25?(i=2,a=e-8):(i=1,a=e),a>=17&&a<=19?(n=17===a?t+80:18===a?t+112:t+144,this.logger.log(r.INFO,"Special char '"+o(n)+"' in channel "+i),s=[n]):e>=32&&e<=127&&(s=0===t?[e]:[e,t]),s){var l=f(s);this.logger.log(r.DEBUG,"Char codes = "+l.join(",")),b(e,t,this.cmdHistory)}return s},t.parseBackgroundAttributes=function(e,t){var i;if(!((16===e||24===e)&&t>=32&&t<=47||(23===e||31===e)&&t>=45&&t<=47))return!1;var r={};16===e||24===e?(i=Math.floor((t-32)/2),r.background=h[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));var n=e<=23?1:2;return this.channels[n].setBkgData(r),b(e,t,this.cmdHistory),!0},t.reset=function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}},t.cueSplitAtTime=function(e){for(var t=0;t<this.channels.length;t++){var i=this.channels[t];i&&i.cueSplitAtTime(e)}},e}();function b(e,t,i){i.a=e,i.b=t}function S(e,t,i){return i.a===e&&i.b===t}t.default=_},"./src/utils/codecs.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/codecs.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: isCodecType, isCodecSupportedInMp4 */function(e,t,i){"use strict";i.r(t),i.d(t,"isCodecType",(function(){return n})),i.d(t,"isCodecSupportedInMp4",(function(){return s}));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 n(e,t){var i=r[t];return!!i&&!0===i[e.slice(0,4)]}function s(e,t){return MediaSource.isTypeSupported((t||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/cues.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ./vttparser */"./src/utils/vttparser.ts"),n=i(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts"),s=i(/*! ./texttrack-utils */"./src/utils/texttrack-utils.ts"),o=/\s/,a={newCue:function(e,t,i,a){for(var l,c,u,h,d,f=[],p=self.VTTCue||self.TextTrackCue,g=0;g<a.rows.length;g++)if(u=!0,h=0,d="",!(l=a.rows[g]).isEmpty()){for(var v=0;v<l.chars.length;v++)o.test(l.chars[v].uchar)&&u?h++:(d+=l.chars[v].uchar,u=!1);l.cueStartTime=t,t===i&&(i+=1e-4),h>=16?h--:h++;var m=Object(r.fixLineBreaks)(d.trim()),y=Object(n.generateCueId)(t,i,m);e&&e.cues&&e.cues.getCueById(y)||((c=new p(t,i,m)).id=y,c.line=g+1,c.align="left",c.position=10+Math.min(80,10*Math.floor(8*h/32)),f.push(c))}return e&&f.length&&(f.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),f.forEach((function(t){return Object(s.addCueToTrack)(e,t)}))),f}};t.default=a},"./src/utils/discontinuities.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/discontinuities.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: findFirstFragWithCC, shouldAlignOnDiscontinuities, findDiscontinuousReferenceFrag, adjustSlidingStart, alignStream, alignPDT, alignFragmentByPDTDelta, alignMediaPlaylistByPDT */function(e,t,i){"use strict";i.r(t),i.d(t,"findFirstFragWithCC",(function(){return o})),i.d(t,"shouldAlignOnDiscontinuities",(function(){return a})),i.d(t,"findDiscontinuousReferenceFrag",(function(){return l})),i.d(t,"adjustSlidingStart",(function(){return u})),i.d(t,"alignStream",(function(){return h})),i.d(t,"alignPDT",(function(){return d})),i.d(t,"alignFragmentByPDTDelta",(function(){return f})),i.d(t,"alignMediaPlaylistByPDT",(function(){return p}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ./logger */"./src/utils/logger.ts"),s=i(/*! ../controller/level-helper */"./src/controller/level-helper.ts");function o(e,t){for(var i=null,r=0,n=e.length;r<n;r++){var s=e[r];if(s&&s.cc===t){i=s;break}}return i}function a(e,t,i){return!(!t.details||!(i.endCC>i.startCC||e&&e.cc<i.startCC))}function l(e,t){var i=e.fragments,r=t.fragments;if(r.length&&i.length){var s=o(i,r[0].cc);if(s&&(!s||s.startPTS))return s;n.logger.log("No frag in previous level to align on")}else n.logger.log("No fragments to align")}function c(e,t){if(e){var i=e.start+t;e.start=e.startPTS=i,e.endPTS=i+e.duration}}function u(e,t){for(var i=t.fragments,r=0,n=i.length;r<n;r++)c(i[r],e);t.fragmentHint&&c(t.fragmentHint,e),t.alignedSliding=!0}function h(e,t,i){t&&(function(e,t,i){if(a(e,i,t)){var s=l(i.details,t);s&&Object(r.isFiniteNumber)(s.start)&&(n.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),u(s.start,t))}}(e,i,t),!i.alignedSliding&&t.details&&d(i,t.details),i.alignedSliding||!t.details||i.skippedSegments||Object(s.adjustSliding)(t.details,i))}function d(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var i=t.fragments[0].programDateTime,s=e.fragments[0].programDateTime,o=(s-i)/1e3+t.fragments[0].start;o&&Object(r.isFiniteNumber)(o)&&(n.logger.log("Adjusting PTS using programDateTime delta "+(s-i)+"ms, sliding:"+o.toFixed(3)+" "+e.url+" "),u(o,e))}}function f(e,t){var i=e.programDateTime;if(i){var r=(i-t)/1e3;e.start=e.startPTS=r,e.endPTS=r+e.duration}}function p(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var i=t.fragments[0].programDateTime-1e3*t.fragments[0].start;e.fragments.forEach((function(e){f(e,i)})),e.fragmentHint&&f(e.fragmentHint,i),e.alignedSliding=!0}}},"./src/utils/ewma-bandwidth-estimator.ts":
|
|
|
/*!***********************************************!*\
|
|
|
!*** ./src/utils/ewma-bandwidth-estimator.ts ***!
|
|
|
\***********************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../utils/ewma */"./src/utils/ewma.ts"),n=function(){function e(e,t,i){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new r.default(e),this.fast_=new r.default(t)}var t=e.prototype;return t.update=function(e,t){var i=this.slow_,n=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new r.default(e,i.getEstimate(),i.getTotalWeight())),this.fast_.halfLife!==t&&(this.fast_=new r.default(t,n.getEstimate(),n.getTotalWeight()))},t.sample=function(e,t){var i=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/i;this.fast_.sample(i,r),this.slow_.sample(i,r)},t.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},t.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},t.destroy=function(){},e}();t.default=n},"./src/utils/ewma.ts":
|
|
|
/*!***************************!*\
|
|
|
!*** ./src/utils/ewma.ts ***!
|
|
|
\***************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=function(){function e(e,t,i){void 0===t&&(t=0),void 0===i&&(i=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_=t,this.totalWeight_=i}var t=e.prototype;return t.sample=function(e,t){var i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*this.estimate_,this.totalWeight_+=e},t.getTotalWeight=function(){return this.totalWeight_},t.getEstimate=function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_},e}();t.default=r},"./src/utils/fetch-loader.ts":
|
|
|
/*!***********************************!*\
|
|
|
!*** ./src/utils/fetch-loader.ts ***!
|
|
|
\***********************************/
|
|
|
/*! exports provided: fetchSupported, default */function(e,t,i){"use strict";i.r(t),i.d(t,"fetchSupported",(function(){return d}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),s=i(/*! ../demux/chunk-cache */"./src/demux/chunk-cache.ts");function o(e){var t="function"==typeof Map?new Map:void 0;return(o=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return a(e,arguments,u(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),c(r,e)})(e)}function a(e,t,i){return(a=l()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=new(Function.bind.apply(e,r));return i&&c(n,i.prototype),n}).apply(null,arguments)}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(){return(h=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}function d(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}var f=function(){function e(e){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=e.fetchSetup||p,this.controller=new self.AbortController,this.stats=new n.LoadStats}var t=e.prototype;return t.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},t.abortInternal=function(){var e=this.response;e&&e.ok||(this.stats.aborted=!0,this.controller.abort())},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},t.load=function(e,t,i){var n=this,s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();var o=function(e,t){var i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(h({},e.headers))};return e.rangeEnd&&i.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),i}(e,this.controller.signal),a=i.onProgress,l="arraybuffer"===e.responseType,c=l?"byteLength":"length";this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,o),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout((function(){n.abortInternal(),i.onTimeout(s,e,n.response)}),t.timeout),self.fetch(this.request).then((function(i){if(n.response=n.loader=i,!i.ok){var o=i.status,c=i.statusText;throw new g(c||"fetch, bad network response",o,i)}return s.loading.first=Math.max(self.performance.now(),s.loading.start),s.total=parseInt(i.headers.get("Content-Length")||"0"),a&&Object(r.isFiniteNumber)(t.highWaterMark)?n.loadProgressively(i,s,e,t.highWaterMark,a):l?i.arrayBuffer():i.text()})).then((function(o){var l=n.response;self.clearTimeout(n.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first),s.loaded=s.total=o[c];var u={url:l.url,data:o};a&&!Object(r.isFiniteNumber)(t.highWaterMark)&&a(s,e,o,l),i.onSuccess(u,s,e,l)})).catch((function(t){if(self.clearTimeout(n.requestTimeout),!s.aborted){var r=t.code||0;i.onError({code:r,text:t.message},e,t.details)}}))},t.getCacheAge=function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e},t.loadProgressively=function(e,t,i,r,n){void 0===r&&(r=0);var o=new s.default,a=e.body.getReader();return function s(){return a.read().then((function(a){if(a.done)return o.dataLength&&n(t,i,o.flush(),e),Promise.resolve(new ArrayBuffer(0));var l=a.value,c=l.length;return t.loaded+=c,c<r||o.dataLength?(o.push(l),o.dataLength>=r&&n(t,i,o.flush(),e)):n(t,i,l,e),s()})).catch((function(){return Promise.reject()}))}()},e}();function p(e,t){return new self.Request(e.url,t)}var g=function(e){var t,i;function r(t,i,r){var n;return(n=e.call(this,t)||this).code=void 0,n.details=void 0,n.code=i,n.details=r,n}return i=e,(t=r).prototype=Object.create(i.prototype),t.prototype.constructor=t,c(t,i),r}(o(Error));t.default=f},"./src/utils/imsc1-ttml-parser.ts":
|
|
|
/*!****************************************!*\
|
|
|
!*** ./src/utils/imsc1-ttml-parser.ts ***!
|
|
|
\****************************************/
|
|
|
/*! exports provided: IMSC1_CODEC, parseIMSC1 */function(e,t,i){"use strict";i.r(t),i.d(t,"IMSC1_CODEC",(function(){return u})),i.d(t,"parseIMSC1",(function(){return p}));var r=i(/*! ./mp4-tools */"./src/utils/mp4-tools.ts"),n=i(/*! ./vttparser */"./src/utils/vttparser.ts"),s=i(/*! ./vttcue */"./src/utils/vttcue.ts"),o=i(/*! ../demux/id3 */"./src/demux/id3.ts"),a=i(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),l=i(/*! ./webvtt-parser */"./src/utils/webvtt-parser.ts");function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(this,arguments)}var u="stpp.ttml.im1t",h=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,d=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,f={left:"start",center:"center",right:"end",start:"start",end:"end"};function p(e,t,i,n,u){var h=Object(r.findBox)(new Uint8Array(e),["mdat"]);if(0!==h.length){var d=h[0],p=Object(o.utf8ArrayToStr)(new Uint8Array(e,d.start,d.end-d.start)),b=Object(a.toTimescaleFromScale)(t,1,i);try{n(function(e,t){var i=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!i)throw new Error("Invalid ttml");var r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(r).reduce((function(e,t){return e[t]=i.getAttribute("ttp:"+t)||r[t],e}),{}),o="preserve"!==i.getAttribute("xml:space"),a=v(g(i,"styling","style")),u=v(g(i,"layout","region")),h=g(i,"body","[begin]");return[].map.call(h,(function(e){var i=function e(t,i){return[].slice.call(t.childNodes).reduce((function(t,r,n){var s;return"br"===r.nodeName&&n?t+"\n":null!==(s=r.childNodes)&&void 0!==s&&s.length?e(r,i):i?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent}),"")}(e,o);if(!i||!e.hasAttribute("begin"))return null;var r=_(e.getAttribute("begin"),n),h=_(e.getAttribute("dur"),n),d=_(e.getAttribute("end"),n);if(null===r)throw y(e);if(null===d){if(null===h)throw y(e);d=r+h}var p=new s.default(r-t,d-t,i);p.id=Object(l.generateCueId)(p.startTime,p.endTime,p.text);var g=u[e.getAttribute("region")],v=a[e.getAttribute("style")];p.position=10,p.size=80;var b=function(e,t){var i="http://www.w3.org/ns/ttml#styling";return["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"].reduce((function(r,n){var s=m(t,i,n)||m(e,i,n);return s&&(r[n]=s),r}),{})}(g,v),S=b.textAlign;if(S){var C=f[S];C&&(p.lineAlign=C),p.align=S}return c(p,b),p})).filter((function(e){return null!==e}))}(p,b))}catch(e){u(e)}}else u(new Error("Could not parse IMSC1 mdat"))}function g(e,t,i){var r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function v(e){return e.reduce((function(e,t){var i=t.getAttribute("xml:id");return i&&(e[i]=t),e}),{})}function m(e,t,i){return e.hasAttributeNS(t,i)?e.getAttributeNS(t,i):null}function y(e){return new Error("Could not parse ttml timestamp "+e)}function _(e,t){if(!e)return null;var i=Object(n.parseTimeStamp)(e);return null===i&&(h.test(e)?i=function(e,t){var i=h.exec(e),r=(0|i[4])+(0|i[5])/t.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/t.frameRate}(e,t):d.test(e)&&(i=function(e,t){var i=d.exec(e),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),i}},"./src/utils/logger.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/logger.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: enableLogs, logger */function(e,t,i){"use strict";i.r(t),i.d(t,"enableLogs",(function(){return a})),i.d(t,"logger",(function(){return l}));var r=function(){},n={trace:r,debug:r,log:r,warn:r,info:r,error:r},s=n;function o(e){var t=self.console[e];return t?t.bind(self.console,"["+e+"] >"):r}function a(e){if(self.console&&!0===e||"object"==typeof e){!function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];i.forEach((function(t){s[t]=e[t]?e[t].bind(e):o(t)}))}(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=n}}else s=n}var l=n},"./src/utils/mediakeys-helper.ts":
|
|
|
/*!***************************************!*\
|
|
|
!*** ./src/utils/mediakeys-helper.ts ***!
|
|
|
\***************************************/
|
|
|
/*! exports provided: KeySystems, requestMediaKeySystemAccess */function(e,t,i){"use strict";var r;i.r(t),i.d(t,"KeySystems",(function(){return r})),i.d(t,"requestMediaKeySystemAccess",(function(){return n})),function(e){e.WIDEVINE="com.widevine.alpha",e.PLAYREADY="com.microsoft.playready"}(r||(r={}));var n="undefined"!=typeof self&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null},"./src/utils/mediasource-helper.ts":
|
|
|
/*!*****************************************!*\
|
|
|
!*** ./src/utils/mediasource-helper.ts ***!
|
|
|
\*****************************************/
|
|
|
/*! exports provided: getMediaSource */function(e,t,i){"use strict";function r(){return self.MediaSource||self.WebKitMediaSource}i.r(t),i.d(t,"getMediaSource",(function(){return r}))},"./src/utils/mp4-tools.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/mp4-tools.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: bin2str, readUint16, readUint32, writeUint32, findBox, parseSegmentIndex, parseInitSegment, getStartDTS, getDuration, computeRawDurationFromSamples, offsetStartDTS, segmentValidRange, appendUint8Array */function(e,t,i){"use strict";i.r(t),i.d(t,"bin2str",(function(){return a})),i.d(t,"readUint16",(function(){return l})),i.d(t,"readUint32",(function(){return c})),i.d(t,"writeUint32",(function(){return u})),i.d(t,"findBox",(function(){return h})),i.d(t,"parseSegmentIndex",(function(){return d})),i.d(t,"parseInitSegment",(function(){return f})),i.d(t,"getStartDTS",(function(){return p})),i.d(t,"getDuration",(function(){return g})),i.d(t,"computeRawDurationFromSamples",(function(){return v})),i.d(t,"offsetStartDTS",(function(){return m})),i.d(t,"segmentValidRange",(function(){return y})),i.d(t,"appendUint8Array",(function(){return _}));var r=i(/*! ./typed-array */"./src/utils/typed-array.ts"),n=i(/*! ../loader/fragment */"./src/loader/fragment.ts"),s=Math.pow(2,32)-1,o=[].push;function a(e){return String.fromCharCode.apply(null,e)}function l(e,t){"data"in e&&(t+=e.start,e=e.data);var i=e[t]<<8|e[t+1];return i<0?65536+i:i}function c(e,t){"data"in e&&(t+=e.start,e=e.data);var i=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return i<0?4294967296+i:i}function u(e,t,i){"data"in e&&(t+=e.start,e=e.data),e[t]=i>>24,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function h(e,t){var i,r,n,s=[];if(!t.length)return s;"data"in e?(i=e.data,r=e.start,n=e.end):(r=0,n=(i=e).byteLength);for(var l=r;l<n;){var u=c(i,l),d=u>1?l+u:n;if(a(i.subarray(l+4,l+8))===t[0])if(1===t.length)s.push({data:i,start:l+8,end:d});else{var f=h({data:i,start:l+8,end:d},t.slice(1));f.length&&o.apply(s,f)}l=d}return s}function d(e){var t=h(e,["moov"])[0],i=t?t.end:null,r=h(e,["sidx"]);if(!r||!r[0])return null;var n=[],s=r[0],o=s.data[0],a=0===o?8:16,u=c(s,a);a+=4,a+=0===o?8:16,a+=2;var d=s.end+0,f=l(s,a);a+=2;for(var p=0;p<f;p++){var g=a,v=c(s,g);g+=4;var m=2147483647&v;if(1==(2147483648&v)>>>31)return console.warn("SIDX has hierarchical references (not supported)"),null;var y=c(s,g);g+=4,n.push({referenceSize:m,subsegmentDuration:y,info:{duration:y/u,start:d,end:d+m-1}}),d+=m,a=g+=4}return{earliestPresentationTime:0,timescale:u,version:o,referencesCount:f,references:n,moovEndOffset:i}}function f(e){for(var t=[],i=h(e,["moov","trak"]),r=0;r<i.length;r++){var s=i[r],o=h(s,["tkhd"])[0];if(o){var l=o.data[o.start],u=0===l?12:20,d=c(o,u),f=h(s,["mdia","mdhd"])[0];if(f){var p=c(f,u=0===(l=f.data[f.start])?12:20),g=h(s,["mdia","hdlr"])[0];if(g){var v=a(g.data.subarray(g.start+8,g.start+12)),m={soun:n.ElementaryStreamTypes.AUDIO,vide:n.ElementaryStreamTypes.VIDEO}[v];if(m){var y=h(s,["mdia","minf","stbl","stsd"])[0],_=void 0;y&&(_=a(y.data.subarray(y.start+12,y.start+16))),t[d]={timescale:p,type:m},t[m]={timescale:p,id:d,codec:_}}}}}}return h(e,["moov","mvex","trex"]).forEach((function(e){var i=c(e,4),r=t[i];r&&(r.default={duration:c(e,12),flags:c(e,20)})})),t}function p(e,t){return h(t,["moof","traf"]).reduce((function(t,i){var r=h(i,["tfdt"])[0],n=r.data[r.start],s=h(i,["tfhd"]).reduce((function(t,i){var s=c(i,4),o=e[s];if(o){var a=c(r,4);1===n&&(a*=Math.pow(2,32),a+=c(r,8));var l=a/(o.timescale||9e4);if(isFinite(l)&&(null===t||l<t))return l}return t}),null);return null!==s&&isFinite(s)&&(null===t||s<t)?s:t}),null)||0}function g(e,t){for(var i=0,r=0,s=0,o=h(e,["moof","traf"]),a=0;a<o.length;a++){var l=o[a],u=h(l,["tfhd"])[0],f=t[c(u,4)];if(f){var p=f.default,g=c(u,0)|(null==p?void 0:p.flags),m=null==p?void 0:p.duration;8&g&&(m=c(u,2&g?12:8));for(var y=f.timescale||9e4,_=h(l,["trun"]),b=0;b<_.length;b++)i=m?m*c(_[b],4):v(_[b]),f.type===n.ElementaryStreamTypes.VIDEO?r+=i/y:f.type===n.ElementaryStreamTypes.AUDIO&&(s+=i/y)}}if(0===r&&0===s){var S=d(e);if(null!=S&&S.references)return S.references.reduce((function(e,t){return e+t.info.duration||0}),0)}return r||s}function v(e){var t=c(e,0),i=8;1&t&&(i+=4),4&t&&(i+=4);for(var r=0,n=c(e,4),s=0;s<n;s++)256&t&&(r+=c(e,i),i+=4),512&t&&(i+=4),1024&t&&(i+=4),2048&t&&(i+=4);return r}function m(e,t,i){h(t,["moof","traf"]).forEach((function(t){h(t,["tfhd"]).forEach((function(r){var n=c(r,4),o=e[n];if(o){var a=o.timescale||9e4;h(t,["tfdt"]).forEach((function(e){var t=e.data[e.start],r=c(e,4);if(0===t)u(e,4,r-i*a);else{r*=Math.pow(2,32),r+=c(e,8),r-=i*a,r=Math.max(r,0);var n=Math.floor(r/(s+1)),o=Math.floor(r%(s+1));u(e,4,n),u(e,8,o)}}))}}))}))}function y(e){var t={valid:null,remainder:null},i=h(e,["moof"]);if(!i)return t;if(i.length<2)return t.remainder=e,t;var n=i[i.length-1];return t.valid=Object(r.sliceUint8)(e,0,n.start-8),t.remainder=Object(r.sliceUint8)(e,n.start-8),t}function _(e,t){var i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}},"./src/utils/output-filter.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/output-filter.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),i.d(t,"default",(function(){return r}));var r=function(){function e(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}var t=e.prototype;return t.dispatchCue=function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},t.newCue=function(e,t,i){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)},t.reset=function(){this.cueRanges=[]},e}()},"./src/utils/texttrack-utils.ts":
|
|
|
/*!**************************************!*\
|
|
|
!*** ./src/utils/texttrack-utils.ts ***!
|
|
|
\**************************************/
|
|
|
/*! exports provided: sendAddTrackEvent, addCueToTrack, clearCurrentCues, removeCuesInRange, getCuesInRange */function(e,t,i){"use strict";i.r(t),i.d(t,"sendAddTrackEvent",(function(){return n})),i.d(t,"addCueToTrack",(function(){return s})),i.d(t,"clearCurrentCues",(function(){return o})),i.d(t,"removeCuesInRange",(function(){return a})),i.d(t,"getCuesInRange",(function(){return l}));var r=i(/*! ./logger */"./src/utils/logger.ts");function n(e,t){var i;try{i=new Event("addtrack")}catch(e){(i=document.createEvent("Event")).initEvent("addtrack",!1,!1)}i.track=e,t.dispatchEvent(i)}function s(e,t){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: "+t)}catch(i){r.logger.debug("[texttrack-utils]: "+i);var n=new self.TextTrackCue(t.startTime,t.endTime,t.text);n.id=t.id,e.addCue(n)}"disabled"===i&&(e.mode=i)}function o(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var i=e.cues.length;i--;)e.removeCue(e.cues[i]);"disabled"===t&&(e.mode=t)}function a(e,t,i){var r=e.mode;if("disabled"===r&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var n=l(e.cues,t,i),s=0;s<n.length;s++)e.removeCue(n[s]);"disabled"===r&&(e.mode=r)}function l(e,t,i){var r=[],n=function(e,t){if(t<e[0].startTime)return 0;var i=e.length-1;if(t>e[i].endTime)return-1;for(var r=0,n=i;r<=n;){var s=Math.floor((n+r)/2);if(t<e[s].startTime)n=s-1;else{if(!(t>e[s].startTime&&r<i))return s;r=s+1}}return e[r].startTime-t<t-e[n].startTime?r:n}(e,t);if(n>-1)for(var s=n,o=e.length;s<o;s++){var a=e[s];if(a.startTime>=t&&a.endTime<=i)r.push(a);else if(a.startTime>i)return r}return r}},"./src/utils/time-ranges.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/time-ranges.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),t.default={toString:function(e){for(var t="",i=e.length,r=0;r<i;r++)t+="["+e.start(r).toFixed(3)+","+e.end(r).toFixed(3)+"]";return t}}},"./src/utils/timescale-conversion.ts":
|
|
|
/*!*******************************************!*\
|
|
|
!*** ./src/utils/timescale-conversion.ts ***!
|
|
|
\*******************************************/
|
|
|
/*! exports provided: toTimescaleFromBase, toTimescaleFromScale, toMsFromMpegTsClock, toMpegTsClockFromTimescale */function(e,t,i){"use strict";function r(e,t,i,r){void 0===i&&(i=1),void 0===r&&(r=!1);var n=e*t*i;return r?Math.round(n):n}function n(e,t,i,n){return void 0===i&&(i=1),void 0===n&&(n=!1),r(e,t,1/i,n)}function s(e,t){return void 0===t&&(t=!1),r(e,1e3,1/9e4,t)}function o(e,t){return void 0===t&&(t=1),r(e,9e4,1/t)}i.r(t),i.d(t,"toTimescaleFromBase",(function(){return r})),i.d(t,"toTimescaleFromScale",(function(){return n})),i.d(t,"toMsFromMpegTsClock",(function(){return s})),i.d(t,"toMpegTsClockFromTimescale",(function(){return o}))},"./src/utils/typed-array.ts":
|
|
|
/*!**********************************!*\
|
|
|
!*** ./src/utils/typed-array.ts ***!
|
|
|
\**********************************/
|
|
|
/*! exports provided: sliceUint8 */function(e,t,i){"use strict";function r(e,t,i){return Uint8Array.prototype.slice?e.slice(t,i):new Uint8Array(Array.prototype.slice.call(e,t,i))}i.r(t),i.d(t,"sliceUint8",(function(){return r}))},"./src/utils/vttcue.ts":
|
|
|
/*!*****************************!*\
|
|
|
!*** ./src/utils/vttcue.ts ***!
|
|
|
\*****************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t),t.default=function(){if("undefined"!=typeof self&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function i(e,t){if("string"!=typeof t)return!1;if(!Array.isArray(e))return!1;var i=t.toLowerCase();return!!~e.indexOf(i)&&i}function r(e){return i(t,e)}function n(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var o in s)e[o]=s[o]}return e}function s(t,s,o){var a=this,l={enumerable:!0};a.hasBeenReset=!1;var c="",u=!1,h=t,d=s,f=o,p=null,g="",v=!0,m="auto",y="start",_=50,b="middle",S=50,C="middle";Object.defineProperty(a,"id",n({},l,{get:function(){return c},set:function(e){c=""+e}})),Object.defineProperty(a,"pauseOnExit",n({},l,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(a,"startTime",n({},l,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",n({},l,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",n({},l,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",n({},l,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",n({},l,{get:function(){return g},set:function(t){var r=function(t){return i(e,t)}(t);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");g=r,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",n({},l,{get:function(){return v},set:function(e){v=!!e,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",n({},l,{get:function(){return m},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");m=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",n({},l,{get:function(){return y},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");y=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",n({},l,{get:function(){return _},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");_=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",n({},l,{get:function(){return b},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");b=t,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",n({},l,{get:function(){return S},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");S=e,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",n({},l,{get:function(){return C},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");C=t,this.hasBeenReset=!0}})),a.displayState=void 0}return s.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},s}()},"./src/utils/vttparser.ts":
|
|
|
/*!********************************!*\
|
|
|
!*** ./src/utils/vttparser.ts ***!
|
|
|
\********************************/
|
|
|
/*! exports provided: parseTimeStamp, fixLineBreaks, VTTParser */function(e,t,i){"use strict";i.r(t),i.d(t,"parseTimeStamp",(function(){return s})),i.d(t,"fixLineBreaks",(function(){return h})),i.d(t,"VTTParser",(function(){return d}));var r=i(/*! ./vttcue */"./src/utils/vttcue.ts"),n=function(){function e(){}return e.prototype.decode=function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))},e}();function s(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+parseFloat(r||0)}var i=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}var o=function(){function e(){this.values=Object.create(null)}var t=e.prototype;return t.set=function(e,t){this.get(e)||""===t||(this.values[e]=t)},t.get=function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},t.has=function(e){return e in this.values},t.alt=function(e,t,i){for(var r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}},t.integer=function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},t.percent=function(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1},e}();function a(e,t,i,r){var n=r?e.split(r):[e];for(var s in n)if("string"==typeof n[s]){var o=n[s].split(i);2===o.length&&t(o[0],o[1])}}var l=new r.default(0,0,""),c="middle"===l.align?"middle":"center";function u(e,t,i){var r=e;function n(){var t=s(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function u(){e=e.replace(/^\s+/,"")}if(u(),t.startTime=n(),u(),"--\x3e"!==e.substr(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.substr(3),u(),t.endTime=n(),u(),function(e,t){var r=new o;a(e,(function(e,t){var n;switch(e){case"region":for(var s=i.length-1;s>=0;s--)if(i[s].id===t){r.set(e,i[s].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":n=t.split(","),r.integer(e,n[0]),r.percent(e,n[0])&&r.set("snapToLines",!1),r.alt(e,n[0],["auto"]),2===n.length&&r.alt("lineAlign",n[1],["start",c,"end"]);break;case"position":n=t.split(","),r.percent(e,n[0]),2===n.length&&r.alt("positionAlign",n[1],["start",c,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",c,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var n=r.get("line","auto");"auto"===n&&-1===l.line&&(n=-1),t.line=n,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",c);var s=r.get("position","auto");"auto"===s&&50===l.position&&(s="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=s}(e,t)}function h(e){return e.replace(/<br(?: \/)?>/gi,"\n")}var d=function(){function e(){this.state="INITIAL",this.buffer="",this.decoder=new n,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var t=e.prototype;return t.parse=function(e){var t=this;function i(){var e=t.buffer,i=0;for(e=h(e);i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var r=e.substr(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.substr(i),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var n="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;var s=(n=i()).match(/^()?WEBVTT([ \t].*)?$/);if(!s||!s[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var o=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:n=i(),t.state){case"HEADER":/:/.test(n)?a(n,(function(e,t){}),/:/):n||(t.state="ID");continue;case"NOTE":n||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){t.state="NOTE";break}if(!n)continue;if(t.cue=new r.default(0,0,""),t.state="CUE",-1===n.indexOf("--\x3e")){t.cue.id=n;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{u(n,t.cue,t.regionList)}catch(e){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var l=-1!==n.indexOf("--\x3e");if(!n||l&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=n;continue;case"BADCUE":n||(t.state="ID")}}}catch(e){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this},t.flush=function(){try{if((this.cue||"HEADER"===this.state)&&(this.buffer+="\n\n",this.parse()),"INITIAL"===this.state||"BADWEBVTT"===this.state)throw new Error("Malformed WebVTT signature.")}catch(e){this.onparsingerror&&this.onparsingerror(e)}return this.onflush&&this.onflush(),this},e}()},"./src/utils/webvtt-parser.ts":
|
|
|
/*!************************************!*\
|
|
|
!*** ./src/utils/webvtt-parser.ts ***!
|
|
|
\************************************/
|
|
|
/*! exports provided: generateCueId, parseWebVTT */function(e,t,i){"use strict";i.r(t),i.d(t,"generateCueId",(function(){return h})),i.d(t,"parseWebVTT",(function(){return d}));var r=i(/*! ./src/polyfills/number */"./src/polyfills/number.ts"),n=i(/*! ./vttparser */"./src/utils/vttparser.ts"),s=i(/*! ../demux/id3 */"./src/demux/id3.ts"),o=i(/*! ./timescale-conversion */"./src/utils/timescale-conversion.ts"),a=i(/*! ../remux/mp4-remuxer */"./src/remux/mp4-remuxer.ts"),l=/\r\n|\n\r|\n|\r/g,c=function(e,t,i){return void 0===i&&(i=0),e.substr(i,t.length)===t},u=function(e){for(var t=5381,i=e.length;i;)t=33*t^e.charCodeAt(--i);return(t>>>0).toString()};function h(e,t,i){return u(e.toString())+u(t.toString())+u(i)}function d(e,t,i,u,d,f,p,g){var v,m=new n.VTTParser,y=Object(s.utf8ArrayToStr)(new Uint8Array(e)).trim().replace(l,"\n").split("\n"),_=[],b=Object(o.toMpegTsClockFromTimescale)(t,i),S="00:00.000",C=0,w=0,k=!0,x=!1;m.oncue=function(e){var t=u[d],i=u.ccOffset,r=(C-b)/9e4;if(null!=t&&t.new&&(void 0!==w?i=u.ccOffset=t.start:function(e,t,i){var r=e[t],n=e[r.prevCC];if(!n||!n.new&&r.new)return e.ccOffset=e.presentationOffset=r.start,void(r.new=!1);for(;null!==(s=n)&&void 0!==s&&s.new;){var s;e.ccOffset+=r.start-n.start,r.new=!1,n=e[(r=n).prevCC]}e.presentationOffset=i}(u,d,r)),r&&(i=r-u.presentationOffset),x){var n=e.endTime-e.startTime,s=Object(a.normalizePts)(9e4*(e.startTime+i-w),9e4*f)/9e4;e.startTime=s,e.endTime=s+n}var o=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(o)),e.id||(e.id=h(e.startTime,e.endTime,o)),e.endTime>0&&_.push(e)},m.onparsingerror=function(e){v=e},m.onflush=function(){v?g(v):p(_)},y.forEach((function(e){if(k){if(c(e,"X-TIMESTAMP-MAP=")){k=!1,x=!0,e.substr(16).split(",").forEach((function(e){c(e,"LOCAL:")?S=e.substr(6):c(e,"MPEGTS:")&&(C=parseInt(e.substr(7)))}));try{w=function(e){var t=parseInt(e.substr(-3)),i=parseInt(e.substr(-6,2)),n=parseInt(e.substr(-9,2)),s=e.length>9?parseInt(e.substr(0,e.indexOf(":"))):0;if(!(Object(r.isFiniteNumber)(t)&&Object(r.isFiniteNumber)(i)&&Object(r.isFiniteNumber)(n)&&Object(r.isFiniteNumber)(s)))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+e);return t+=1e3*i,t+=6e4*n,t+=36e5*s}(S)/1e3}catch(e){x=!1,v=e}return}""===e&&(k=!1)}m.parse(e+"\n")})),m.flush()}},"./src/utils/xhr-loader.ts":
|
|
|
/*!*********************************!*\
|
|
|
!*** ./src/utils/xhr-loader.ts ***!
|
|
|
\*********************************/
|
|
|
/*! exports provided: default */function(e,t,i){"use strict";i.r(t);var r=i(/*! ../utils/logger */"./src/utils/logger.ts"),n=i(/*! ../loader/load-stats */"./src/loader/load-stats.ts"),s=/^age:\s*[\d.]+\s*$/m,o=function(){function e(e){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=e?e.xhrSetup:null,this.stats=new n.LoadStats,this.retryDelay=0}var t=e.prototype;return t.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},t.abortInternal=function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))},t.abort=function(){var e;this.abortInternal(),null!==(e=this.callbacks)&&void 0!==e&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},t.load=function(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.retryDelay=t.retryDelay,this.loadInternal()},t.loadInternal=function(){var e=this.config,t=this.context;if(e){var i=this.loader=new self.XMLHttpRequest,r=this.stats;r.loading.first=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(i,t.url)}catch(e){i.open("GET",t.url,!0),n(i,t.url)}i.readyState||i.open("GET",t.url,!0);var s=this.context.headers;if(s)for(var o in s)i.setRequestHeader(o,s[o])}catch(e){return void this.callbacks.onError({code:i.status,text:e.message},t,i)}t.rangeEnd&&i.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),i.onreadystatechange=this.readystatechange.bind(this),i.onprogress=this.loadprogress.bind(this),i.responseType=t.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),e.timeout),i.send()}},t.readystatechange=function(){var e=this.context,t=this.loader,i=this.stats;if(e&&t){var n=t.readyState,s=this.config;if(!i.aborted&&n>=2)if(self.clearTimeout(this.requestTimeout),0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start)),4===n){t.onreadystatechange=null,t.onprogress=null;var o=t.status;if(o>=200&&o<300){var a,l;if(i.loading.end=Math.max(self.performance.now(),i.loading.first),l="arraybuffer"===e.responseType?(a=t.response).byteLength:(a=t.responseText).length,i.loaded=i.total=l,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(i,e,a,t),!this.callbacks)return;var u={url:t.responseURL,data:a};this.callbacks.onSuccess(u,i,e,t)}else i.retry>=s.maxRetry||o>=400&&o<499?(r.logger.error(o+" while loading "+e.url),this.callbacks.onError({code:o,text:t.statusText},e,t)):(r.logger.warn(o+" while loading "+e.url+", retrying in "+this.retryDelay+"..."),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,s.maxRetryDelay),i.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout)}},t.loadtimeout=function(){r.logger.warn("timeout while loading "+this.context.url);var e=this.callbacks;e&&(this.abortInternal(),e.onTimeout(this.stats,this.context,this.loader))},t.loadprogress=function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)},t.getCacheAge=function(){var e=null;if(this.loader&&s.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e},e}();t.default=o}}).default},e.exports=r())},vHTk:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./src/components/PreviewAll/index.less?modules ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! exports used: default */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){e.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},vewr:
|
|
|
/*!******************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/util/events.js ***!
|
|
|
\******************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPointerEvent=function(e){return e.changedTouches?e.changedTouches[0]:e.touches?e.touches[0]:e},t.stopEvent=function(e){e.stopPropagation(),e.preventDefault()},t.setCapture=function(e){if(e.setCapture)e.setCapture(),document.captureElement=e,e.addEventListener("mouseup",l);else{l();var t=document.getElementById("noVNC_mouse_capture_elem");null===t&&((t=document.createElement("div")).id="noVNC_mouse_capture_elem",t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="100%",t.style.zIndex=1e4,t.style.display="none",document.body.appendChild(t),t.addEventListener("contextmenu",s),t.addEventListener("mousemove",s),t.addEventListener("mouseup",s)),document.captureElement=e,a.observe(e,{attributes:!0}),o(),t.style.display="",window.addEventListener("mousemove",s),window.addEventListener("mouseup",s)}},t.releaseCapture=l;var r=!1,n=null;function s(e){if(!r){var t=new e.constructor(e.type,e);r=!0,document.captureElement?document.captureElement.dispatchEvent(t):n.dispatchEvent(t),r=!1,e.stopPropagation(),t.defaultPrevented&&e.preventDefault(),"mouseup"===e.type&&l()}}function o(){document.getElementById("noVNC_mouse_capture_elem").style.cursor=window.getComputedStyle(document.captureElement).cursor}document.captureElement=null;var a=new MutationObserver(o);function l(){if(document.releaseCapture)document.releaseCapture(),document.captureElement=null;else{if(!document.captureElement)return;n=document.captureElement,document.captureElement=null,a.disconnect(),document.getElementById("noVNC_mouse_capture_elem").style.display="none",window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",s)}}},whVF:
|
|
|
/*!***************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/deflator.js ***!
|
|
|
\***************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n=i(/*! ../lib/vendor/pako/lib/zlib/deflate.js */"lNSK"),s=(r=i(/*! ../lib/vendor/pako/lib/zlib/zstream.js */"1q3G"))&&r.__esModule?r:{default:r};function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.strm=new s.default,this.chunkSize=102400,this.outputBuffer=new Uint8Array(this.chunkSize),this.windowBits=5,(0,n.deflateInit)(this.strm,this.windowBits)}var t,i,r;return t=e,(i=[{key:"deflate",value:function(e){this.strm.input=e,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 t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH),i=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);if(t<0)throw new Error("zlib deflate failed");if(this.strm.avail_in>0){var r=[i],s=i.length;do{if(this.strm.output=new Uint8Array(this.chunkSize),this.strm.next_out=0,this.strm.avail_out=this.chunkSize,(t=(0,n.deflate)(this.strm,n.Z_FULL_FLUSH))<0)throw new Error("zlib deflate failed");var o=new Uint8Array(this.strm.output.buffer,0,this.strm.next_out);s+=o.length,r.push(o)}while(this.strm.avail_in>0);for(var a=new Uint8Array(s),l=0,c=0;c<r.length;c++)a.set(r[c],l),l+=r[c].length;i=a}return this.strm.input=null,this.strm.avail_in=0,this.strm.next_in=0,i}}])&&o(t.prototype,i),r&&o(t,r),e}();t.default=a},xO64:
|
|
|
/*!************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/decoders/tightpng.js ***!
|
|
|
\************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";var r;function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=u(e);if(t){var n=u(this).constructor;i=Reflect.construct(r,arguments,n)}else i=r.apply(this,arguments);return c(this,i)}}function c(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(c,e);var t,i,r,n=l(c);function c(){return s(this,c),n.apply(this,arguments)}return t=c,(i=[{key:"_pngRect",value:function(e,t,i,r,n,s,o){var a=this._readData(n);return null!==a&&(s.imageRect(e,t,i,r,"image/png",a),!0)}},{key:"_basicRect",value:function(e,t,i,r,n,s,o,a){throw new Error("BasicCompression received in TightPNG rect")}}])&&o(t.prototype,i),r&&o(t,r),c}(((r=i(/*! ./tight.js */"8K/p"))&&r.__esModule?r:{default:r}).default);t.default=h},xSIq:
|
|
|
/*!************************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/messages.js ***!
|
|
|
\************************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;t.default={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"}},xlC8:
|
|
|
/*!***********************************************************************!*\
|
|
|
!*** ./node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/adler32.js ***!
|
|
|
\***********************************************************************/
|
|
|
/*! no static exports found */
|
|
|
/*! all exports used */
|
|
|
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,r){var n=65535&e|0,s=e>>>16&65535|0,o=0;for(;0!==i;){i-=o=i>2e3?2e3:i;do{n=n+t[r++]|0,s=s+n|0}while(--o);n%=65521,s%=65521}return n|s<<16|0}}}]); |