ue-softphone-sdk-beta 3.0.21 → 3.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/sdkdemo/ue.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["myLib"]=t(require("vue")):e["myLib"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__274__){return function(){var __webpack_modules__={938:function(e,t,n){var r=n(335);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},77:function(e,t,n){var r=n(74);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},262:function(e,t,n){var r=n(200),o=n(335),i=r.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},74:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},200:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},694:function(e,t,n){var r=n(77),o=n(74),i=n(262);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},335:function(e){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},610:function(e,t,n){var r=n(77),o=n(694),i=n(938),s=n(874),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=s(t,!0),i(n),o)try{return a(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},844:function(e,t,n){"use strict";var r=n(938);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},192:function(e,t,n){"use strict";var r=n(74);function o(e,t){return RegExp(e,t)}t.u=r((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),r((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},874:function(e,t,n){var r=n(335);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},802:function(e,t,n){var r=n(77),o=n(610),i=n(844),s=n(192).u;r&&("g"!=/./g.flags||s)&&o.f(RegExp.prototype,"flags",{configurable:!0,get:i})},146:function(e,t,n){(function(t,n){e.exports=n()})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g&&n.g,(function(){"use strict";var e="3.7.6",t=e,n="function"===typeof atob,r="function"===typeof btoa,o="function"===typeof Buffer,i="function"===typeof TextDecoder?new TextDecoder:void 0,s="function"===typeof TextEncoder?new TextEncoder:void 0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=Array.prototype.slice.call(a),c=function(e){var t={};return e.forEach((function(e,n){return t[e]=n})),t}(l),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,d=String.fromCharCode.bind(String),p="function"===typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},h=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},f=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},g=function(e){for(var t,n,r,o,i="",s=e.length%3,a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=l[t>>18&63]+l[t>>12&63]+l[t>>6&63]+l[63&t]}return s?i.slice(0,s-3)+"===".substring(s):i},m=r?function(e){return btoa(e)}:o?function(e){return Buffer.from(e,"binary").toString("base64")}:g,v=o?function(e){return Buffer.from(e).toString("base64")}:function(e){for(var t=4096,n=[],r=0,o=e.length;r<o;r+=t)n.push(d.apply(null,e.subarray(r,r+t)));return m(n.join(""))},y=function(e,t){return void 0===t&&(t=!1),t?h(v(e)):v(e)},b=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?d(192|t>>>6)+d(128|63&t):d(224|t>>>12&15)+d(128|t>>>6&63)+d(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return d(240|t>>>18&7)+d(128|t>>>12&63)+d(128|t>>>6&63)+d(128|63&t)},w=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,C=function(e){return e.replace(w,b)},S=o?function(e){return Buffer.from(e,"utf8").toString("base64")}:s?function(e){return v(s.encode(e))}:function(e){return m(C(e))},E=function(e,t){return void 0===t&&(t=!1),t?h(S(e)):S(e)},T=function(e){return E(e,!0)},k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,x=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),n=t-65536;return d(55296+(n>>>10))+d(56320+(1023&n));case 3:return d((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return d((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},N=function(e){return e.replace(k,x)},R=function(e){if(e=e.replace(/\s+/g,""),!u.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var t,n,r,o="",i=0;i<e.length;)t=c[e.charAt(i++)]<<18|c[e.charAt(i++)]<<12|(n=c[e.charAt(i++)])<<6|(r=c[e.charAt(i++)]),o+=64===n?d(t>>16&255):64===r?d(t>>16&255,t>>8&255):d(t>>16&255,t>>8&255,255&t);return o},I=n?function(e){return atob(f(e))}:o?function(e){return Buffer.from(e,"base64").toString("binary")}:R,_=o?function(e){return p(Buffer.from(e,"base64"))}:function(e){return p(I(e).split("").map((function(e){return e.charCodeAt(0)})))},O=function(e){return _(B(e))},A=o?function(e){return Buffer.from(e,"base64").toString("utf8")}:i?function(e){return i.decode(_(e))}:function(e){return N(I(e))},B=function(e){return f(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},D=function(e){return A(B(e))},P=function(e){if("string"!==typeof e)return!1;var t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},H=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},M=function(){var e=function(e,t){return Object.defineProperty(String.prototype,e,H(t))};e("fromBase64",(function(){return D(this)})),e("toBase64",(function(e){return E(this,e)})),e("toBase64URI",(function(){return E(this,!0)})),e("toBase64URL",(function(){return E(this,!0)})),e("toUint8Array",(function(){return O(this)}))},j=function(){var e=function(e,t){return Object.defineProperty(Uint8Array.prototype,e,H(t))};e("toBase64",(function(e){return y(this,e)})),e("toBase64URI",(function(){return y(this,!0)})),e("toBase64URL",(function(){return y(this,!0)}))},V=function(){M(),j()},$={version:e,VERSION:t,atob:I,atobPolyfill:R,btoa:m,btoaPolyfill:g,fromBase64:D,toBase64:E,encode:E,encodeURI:T,encodeURL:T,utob:C,btou:N,decode:D,isValid:P,fromUint8Array:y,toUint8Array:O,extendString:M,extendUint8Array:j,extendBuiltins:V,Base64:{}};return Object.keys($).forEach((function(e){return $.Base64[e]=$[e]})),$}))},855:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;
1
+ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["myLib"]=t(require("vue")):e["myLib"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(__WEBPACK_EXTERNAL_MODULE__274__){return function(){var __webpack_modules__={938:function(e,t,n){var r=n(335);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},77:function(e,t,n){var r=n(74);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},262:function(e,t,n){var r=n(200),o=n(335),i=r.document,s=o(i)&&o(i.createElement);e.exports=function(e){return s?i.createElement(e):{}}},74:function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},200:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},694:function(e,t,n){var r=n(77),o=n(74),i=n(262);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},335:function(e){e.exports=function(e){return"object"===typeof e?null!==e:"function"===typeof e}},610:function(e,t,n){var r=n(77),o=n(694),i=n(938),s=n(874),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(i(e),t=s(t,!0),i(n),o)try{return a(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},844:function(e,t,n){"use strict";var r=n(938);e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},192:function(e,t,n){"use strict";var r=n(74);function o(e,t){return RegExp(e,t)}t.u=r((function(){var e=o("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),r((function(){var e=o("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},874:function(e,t,n){var r=n(335);e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},802:function(e,t,n){var r=n(77),o=n(610),i=n(844),s=n(192).u;r&&("g"!=/./g.flags||s)&&o.f(RegExp.prototype,"flags",{configurable:!0,get:i})},146:function(e,t,n){(function(t,n){e.exports=n()})("undefined"!==typeof self?self:"undefined"!==typeof window?window:"undefined"!==typeof n.g&&n.g,(function(){"use strict";var e="3.7.7",t=e,n="function"===typeof Buffer,r="function"===typeof TextDecoder?new TextDecoder:void 0,o="function"===typeof TextEncoder?new TextEncoder:void 0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=Array.prototype.slice.call(i),a=function(e){var t={};return e.forEach((function(e,n){return t[e]=n})),t}(s),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),u="function"===typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):function(e){return new Uint8Array(Array.prototype.slice.call(e,0))},d=function(e){return e.replace(/=/g,"").replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"}))},p=function(e){return e.replace(/[^A-Za-z0-9\+\/]/g,"")},h=function(e){for(var t,n,r,o,i="",a=e.length%3,l=0;l<e.length;){if((n=e.charCodeAt(l++))>255||(r=e.charCodeAt(l++))>255||(o=e.charCodeAt(l++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|o,i+=s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}return a?i.slice(0,a-3)+"===".substring(a):i},f="function"===typeof btoa?function(e){return btoa(e)}:n?function(e){return Buffer.from(e,"binary").toString("base64")}:h,g=n?function(e){return Buffer.from(e).toString("base64")}:function(e){for(var t=4096,n=[],r=0,o=e.length;r<o;r+=t)n.push(c.apply(null,e.subarray(r,r+t)));return f(n.join(""))},m=function(e,t){return void 0===t&&(t=!1),t?d(g(e)):g(e)},v=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t)},y=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=function(e){return e.replace(y,v)},w=n?function(e){return Buffer.from(e,"utf8").toString("base64")}:o?function(e){return g(o.encode(e))}:function(e){return f(b(e))},C=function(e,t){return void 0===t&&(t=!1),t?d(w(e)):w(e)},S=function(e){return C(e,!0)},E=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=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),n=t-65536;return c(55296+(n>>>10))+c(56320+(1023&n));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},k=function(e){return e.replace(E,T)},x=function(e){if(e=e.replace(/\s+/g,""),!l.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));for(var t,n,r,o="",i=0;i<e.length;)t=a[e.charAt(i++)]<<18|a[e.charAt(i++)]<<12|(n=a[e.charAt(i++)])<<6|(r=a[e.charAt(i++)]),o+=64===n?c(t>>16&255):64===r?c(t>>16&255,t>>8&255):c(t>>16&255,t>>8&255,255&t);return o},N="function"===typeof atob?function(e){return atob(p(e))}:n?function(e){return Buffer.from(e,"base64").toString("binary")}:x,R=n?function(e){return u(Buffer.from(e,"base64"))}:function(e){return u(N(e).split("").map((function(e){return e.charCodeAt(0)})))},I=function(e){return R(O(e))},_=n?function(e){return Buffer.from(e,"base64").toString("utf8")}:r?function(e){return r.decode(R(e))}:function(e){return k(N(e))},O=function(e){return p(e.replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})))},A=function(e){return _(O(e))},B=function(e){if("string"!==typeof e)return!1;var t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},D=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}},P=function(){var e=function(e,t){return Object.defineProperty(String.prototype,e,D(t))};e("fromBase64",(function(){return A(this)})),e("toBase64",(function(e){return C(this,e)})),e("toBase64URI",(function(){return C(this,!0)})),e("toBase64URL",(function(){return C(this,!0)})),e("toUint8Array",(function(){return I(this)}))},H=function(){var e=function(e,t){return Object.defineProperty(Uint8Array.prototype,e,D(t))};e("toBase64",(function(e){return m(this,e)})),e("toBase64URI",(function(){return m(this,!0)})),e("toBase64URL",(function(){return m(this,!0)}))},M=function(){P(),H()},j={version:e,VERSION:t,atob:N,atobPolyfill:x,btoa:f,btoaPolyfill:h,fromBase64:A,toBase64:C,encode:C,encodeURI:S,encodeURL:S,utob:b,btou:k,decode:A,isValid:B,fromUint8Array:m,toUint8Array:I,extendString:P,extendUint8Array:H,extendBuiltins:M,Base64:{}};return Object.keys(j).forEach((function(e){return j.Base64[e]=j[e]})),j}))},855:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_RESULT__;
2
2
  /**
3
3
  * [js-md5]{@link https://github.com/emn178/js-md5}
4
4
  *
@@ -7,7 +7,7 @@
7
7
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
8
8
  * @copyright Chen, Yi-Cyuan 2014-2017
9
9
  * @license MIT
10
- */(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"===typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null===e||void 0===e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw ERROR;t=!0}var r,o,i=0,s=e.length,a=this.blocks,l=this.buffer8;while(i<s){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(o=this.start;i<s&&o<64;++i)l[o++]=e[i];else for(o=this.start;i<s&&o<64;++i)a[o>>2]|=e[i]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?l[o++]=r:r<2048?(l[o++]=192|r>>6,l[o++]=128|63&r):r<55296||r>=57344?(l[o++]=224|r>>12,l[o++]=128|r>>6&63,l[o++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),l[o++]=240|r>>18,l[o++]=128|r>>12&63,l[o++]=128|r>>6&63,l[o++]=128|63&r);else for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?a[o>>2]|=r<<SHIFT[3&o++]:r<2048?(a[o>>2]|=(192|r>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]):r<55296||r>=57344?(a[o>>2]|=(224|r>>12)<<SHIFT[3&o++],a[o>>2]|=(128|r>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),a[o>>2]|=(240|r>>18)<<SHIFT[3&o++],a[o>>2]|=(128|r>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|r>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,r,o,i,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^2004318071&e)+s[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(-271733879^e))+s[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+s[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+s[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+s[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+s[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+s[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+s[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[12]-1926607734,t=(t<<20|t>>>12)+n<<0,o=t^n,e+=(o^r)+s[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[8]-2022574463,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[14]-35309556,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[4]+1272893353,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[10]-1094730640,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[0]-358537222,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[6]+76029189,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[12]-421815835,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+s[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=o[i],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"==",r};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},847:function(e,t,n){"use strict";n.r(t),n.d(t,{JSEncrypt:function(){return be},default:function(){return we}});var r="0123456789abcdefghijklmnopqrstuvwxyz";function o(e){return r.charAt(e)}function i(e,t){return e&t}function s(e,t){return e|t}function a(e,t){return e^t}function l(e,t){return e&~t}function c(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function u(e){var t=0;while(0!=e)e&=e-1,++t;return t}var d,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="=";function f(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=p.charAt(n>>6)+p.charAt(63&n);t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=p.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=p.charAt(n>>2)+p.charAt((3&n)<<4));while((3&r.length)>0)r+=h;return r}function g(e){var t,n="",r=0,i=0;for(t=0;t<e.length;++t){if(e.charAt(t)==h)break;var s=p.indexOf(e.charAt(t));s<0||(0==r?(n+=o(s>>2),i=3&s,r=1):1==r?(n+=o(i<<2|s>>4),i=15&s,r=2):2==r?(n+=o(i),n+=o(s>>2),i=3&s,r=3):(n+=o(i<<2|s>>4),n+=o(15&s),r=0))}return 1==r&&(n+=o(i<<2)),n}var m,v={decode:function(e){var t;if(void 0===d){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(d={},t=0;t<16;++t)d[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)d[n.charAt(t)]=t;for(t=0;t<r.length;++t)d[r.charAt(t)]=-1}var o=[],i=0,s=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(a=d[a],-1!=a){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++s>=2?(o[o.length]=i,i=0,s=0):i<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return o}},y={decode:function(e){var t;if(void 0===m){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="= \f\n\r\t \u2028\u2029";for(m=Object.create(null),t=0;t<64;++t)m[n.charAt(t)]=t;for(m["-"]=62,m["_"]=63,t=0;t<r.length;++t)m[r.charAt(t)]=-1}var o=[],i=0,s=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(a=m[a],-1!=a){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++s>=4?(o[o.length]=i>>16,o[o.length]=i>>8&255,o[o.length]=255&i,i=0,s=0):i<<=6}}switch(s){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:o[o.length]=i>>10;break;case 3:o[o.length]=i>>16,o[o.length]=i>>8&255;break}return o},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=y.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return y.decode(e)}},b=1e13,w=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)r=o[n]*e+t,r<b?t=0:(t=0|r/b,r-=t*b),o[n]=r;t>0&&(o[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)n=r[t]-e,n<0?(n+=b,e=1):e=0,r[t]=n;while(0===r[r.length-1])r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(b+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*b+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),C="…",S=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,E=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function T(e,t){return e.length>t&&(e=e.substring(0,t)+C),e}var k,x=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"===typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),o=(n?S:E).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){var n,r=this.get(e),o=r>127,i=o?255:0,s="";while(r==i&&++e<t)r=this.get(e);if(n=t-e,0===n)return o?-1:0;if(n>4){s=r,n<<=3;while(0==(128&(+s^i)))s=+s<<1,--n;s="("+n+" bit)\n"}o&&(r-=256);for(var a=new w(r),l=e+1;l<t;++l)a.mulAdd(256,this.get(l));return s+a.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),o=(t-e-1<<3)-r,i="("+o+" bit)\n",s="",a=e+1;a<t;++a){for(var l=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)s+=l>>u&1?"1":"0";if(s.length>n)return i+T(s,n)}return i+s},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return T(this.parseStringISO(e,t),n);var r=t-e,o="("+r+" byte)\n";n/=2,r>n&&(t=e+n);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return r>n&&(o+=C),o},e.prototype.parseOID=function(e,t,n){for(var r="",o=new w,i=0,s=e;s<t;++s){var a=this.get(s);if(o.mulAdd(128,127&a),i+=7,!(128&a)){if(""===r)if(o=o.simplify(),o instanceof w)o.sub(80),r="2."+o.toString();else{var l=o<80?o<40?0:1:2;r=l+"."+(o-40*l)}else r+="."+o.toString();if(r.length>n)return T(r,n);o=new w,i=0}}return i>0&&(r+=".incomplete"),r},e}(),N=function(){function e(e,t,n,r,o){if(!(r instanceof R))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=o}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return T(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return T(this.stream.parseStringISO(t,t+n),e);case 30:return T(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)},e.decode=function(t){var n;n=t instanceof x?t:new x(t,0);var r=new x(n),o=new R(n),i=e.decodeLength(n),s=n.pos,a=s-r.pos,l=null,c=function(){var t=[];if(null!==i){var r=s+i;while(n.pos<r)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+s)}else try{for(;;){var o=e.decode(n);if(o.tag.isEOC())break;t[t.length]=o}i=s-n.pos}catch(a){throw new Error("Exception while decoding undefined length content: "+a)}return t};if(o.tagConstructed)l=c();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=c();for(var u=0;u<l.length;++u)if(l[u].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(d){l=null}if(null===l){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+s);n.pos=s+Math.abs(i)}return new e(r,a,i,o,l)},e}(),R=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!==(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new w;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),I=0xdeadbeefcafe,_=15715070==(16777215&I),O=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/O[O.length-1],B=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,s="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0){l<this.DB&&(n=this[a]>>l)>0&&(i=!0,s=o(n));while(a>=0)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(s+=o(n))}return i?s:"0"},e.prototype.negate=function(){var t=j();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;while(--n>=0)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=j();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new P(t):new H(t),this.exp(e,n)},e.prototype.clone=function(){var e=j();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,o=0;if(e-- >0){r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);while(e>=0)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(t[o++]=n)}return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=j();return this.bitwiseTo(e,i,t),t},e.prototype.or=function(e){var t=j();return this.bitwiseTo(e,s,t),t},e.prototype.xor=function(e){var t=j();return this.bitwiseTo(e,a,t),t},e.prototype.andNot=function(e){var t=j();return this.bitwiseTo(e,l,t),t},e.prototype.not=function(){for(var e=j(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=j();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=j();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+c(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=u(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,s)},e.prototype.clearBit=function(e){return this.changeBit(e,l)},e.prototype.flipBit=function(e){return this.changeBit(e,a)},e.prototype.add=function(e){var t=j();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=j();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=j();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=j();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=j();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=j(),n=j();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,o=e.bitLength(),i=K(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new P(t):t.isEven()?new M(t):new H(t);var s=[],a=3,l=n-1,c=(1<<n)-1;if(s[1]=r.convert(this),n>1){var u=j();r.sqrTo(s[1],u);while(a<=c)s[a]=j(),r.mulTo(u,s[a-2],s[a]),a+=2}var d,p,h=e.t-1,f=!0,g=j();o=W(e[h])-1;while(h>=0){o>=l?d=e[h]>>o-l&c:(d=(e[h]&(1<<o+1)-1)<<l-o,h>0&&(d|=e[h-1]>>this.DB+o-l)),a=n;while(0==(1&d))d>>=1,--a;if((o-=a)<0&&(o+=this.DB,--h),f)s[d].copyTo(i),f=!1;else{while(a>1)r.sqrTo(i,g),r.sqrTo(g,i),a-=2;a>0?r.sqrTo(i,g):(p=i,i=g,g=p),r.mulTo(g,s[d],i)}while(h>=0&&0==(e[h]&1<<o))r.sqrTo(i,g),p=i,i=g,g=p,--o<0&&(o=this.DB-1,--h)}return r.revert(i)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;var r=t.clone(),o=this.clone(),i=K(1),s=K(0),a=K(0),l=K(1);while(0!=r.signum()){while(r.isEven())r.rShiftTo(1,r),n?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);while(o.isEven())o.rShiftTo(1,o),n?(a.isEven()&&l.isEven()||(a.addTo(this,a),l.subTo(t,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(o)>=0?(r.subTo(o,r),n&&i.subTo(a,i),s.subTo(l,s)):(o.subTo(r,o),n&&a.subTo(i,a),l.subTo(s,l))}return 0!=o.compareTo(e.ONE)?e.ZERO:l.compareTo(t)>=0?l.subtract(t):l.signum()<0?(l.addTo(t,l),l.signum()<0?l.add(t):l):l},e.prototype.pow=function(e){return this.exp(e,new D)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));while(t.signum()>0)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=O[O.length-1]){for(t=0;t<O.length;++t)if(n[0]==O[t])return!0;return!1}if(n.isEven())return!1;t=1;while(t<O.length){var r=O[t],o=t+1;while(o<O.length&&r<A)r*=O[o++];r=n.modInt(r);while(t<o)if(r%O[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;var o=t.length,i=!1,s=0;while(--o>=0){var a=8==r?255&+t[o]:z(t,o);a<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=r,s>=this.DB&&(s-=this.DB))}8==r&&0!=(128&+t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,o=(1<<r)-1,i=Math.floor(e/this.DB),s=this.s<<n&this.DM,a=this.t-1;a>=0;--a)t[a+i+1]=this[a]>>r|s,s=(this[a]&o)<<n;for(a=i-1;a>=0;--a)t[a]=0;t[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,o=this.DB-r,i=(1<<r)-1;t[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)t[s-n-1]|=(this[s]&i)<<o,t[s-n]=this[s]>>r;r>0&&(t[this.t-n-1]|=(this.s&i)<<o),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){var n=0,r=0,o=Math.min(e.t,this.t);while(n<o)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){r-=e.s;while(n<this.t)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{r+=this.s;while(n<e.t)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),o=t.abs(),i=r.t;n.t=i+o.t;while(--i>=0)n[i]=0;for(i=0;i<o.t;++i)n[i+r.t]=r.am(0,o[i],n,i,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){var t=this.abs(),n=e.t=2*t.t;while(--n>=0)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=j());var s=j(),a=this.s,l=t.s,c=this.DB-W(o[o.t-1]);c>0?(o.lShiftTo(c,s),i.lShiftTo(c,r)):(o.copyTo(s),i.copyTo(r));var u=s.t,d=s[u-1];if(0!=d){var p=d*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),h=this.FV/p,f=(1<<this.F1)/p,g=1<<this.F2,m=r.t,v=m-u,y=null==n?j():n;s.dlShiftTo(v,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),e.ONE.dlShiftTo(u,y),y.subTo(s,s);while(s.t<u)s[s.t++]=0;while(--v>=0){var b=r[--m]==d?this.DM:Math.floor(r[m]*h+(r[m-1]+g)*f);if((r[m]+=s.am(0,b,r,v,0,u))<b){s.dlShiftTo(v,y),r.subTo(y,r);while(r[m]<--b)r.subTo(y,r)}}null!=n&&(r.drShiftTo(u,n),a!=l&&e.ZERO.subTo(n,n)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=j(),o=j(),i=n.convert(this),s=W(t)-1;i.copyTo(r);while(--s>=0)if(n.sqrTo(r,o),(t&1<<s)>0)n.mulTo(o,i,r);else{var a=r;r=o,o=a}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=K(n),o=j(),i=j(),s="";this.divRemTo(r,o,i);while(o.signum()>0)s=(n+i.intValue()).toString(e).substr(1)+s,o.divRemTo(r,o,i);return i.intValue().toString(e)+s},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),o=Math.pow(n,r),i=!1,s=0,a=0,l=0;l<t.length;++l){var c=z(t,l);c<0?"-"==t.charAt(l)&&0==this.signum()&&(i=!0):(a=n*a+c,++s>=r&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(n,s)),this.dAddOffset(a,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),s,this),this.isEven()&&this.dAddOffset(1,0);while(!this.isProbablePrime(n))this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this)}else{var o=[],i=7&t;o.length=1+(t>>3),n.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,o,i=Math.min(e.t,this.t);for(r=0;r<i;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(o=e.s&this.DM,r=i;r<this.t;++r)n[r]=t(this[r],o);n.t=this.t}else{for(o=this.s&this.DM,r=i;r<e.t;++r)n[r]=t(o,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){var n=0,r=0,o=Math.min(e.t,this.t);while(n<o)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){r+=e.s;while(n<this.t)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{r+=this.s;while(n<e.t)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){while(this.t<=t)this[this.t++]=0;this[t]+=e;while(this[t]>=this.DV)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);n.s=0,n.t=r;while(r>0)n[--r]=0;for(var o=n.t-this.t;r<o;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(o=Math.min(e.t,t);r<o;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;n.s=0;while(--r>=0)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var o=n.shiftRight(r);t=t+1>>1,t>O.length&&(t=O.length);for(var i=j(),s=0;s<t;++s){i.fromInt(O[Math.floor(Math.random()*O.length)]);var a=i.modPow(o,this);if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(n)){var l=1;while(l++<r&&0!=a.compareTo(n))if(a=a.modPowInt(2,this),0==a.compareTo(e.ONE))return!1;if(0!=a.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=j();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var o=n;n=r,r=o}var i=n.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)t(n);else{i<s&&(s=i),s>0&&(n.rShiftTo(s,n),r.rShiftTo(s,r));var a=function(){(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(a,0):(s>0&&r.lShiftTo(s,r),setTimeout((function(){t(r)}),0))};setTimeout(a,10)}},e.prototype.fromNumberAsync=function(t,n,r,o){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),s,this),this.isEven()&&this.dAddOffset(1,0);var i=this,a=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(n)?setTimeout((function(){o()}),0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],c=7&t;l.length=1+(t>>3),n.nextBytes(l),c>0?l[0]&=(1<<c)-1:l[0]=0,this.fromString(l,256)}},e}(),D=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),P=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),H=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=j();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(B.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=j();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);while(e[n]>=e.DV)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),M=function(){function e(e){this.m=e,this.r2=j(),this.q3=j(),B.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=j();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function j(){return new B(null)}function V(e,t){return new B(e,t)}var $="undefined"!==typeof navigator;$&&_&&"Microsoft Internet Explorer"==navigator.appName?(B.prototype.am=function(e,t,n,r,o,i){var s=32767&t,a=t>>15;while(--i>=0){var l=32767&this[e],c=this[e++]>>15,u=a*l+c*s;l=s*l+((32767&u)<<15)+n[r]+(1073741823&o),o=(l>>>30)+(u>>>15)+a*c+(o>>>30),n[r++]=1073741823&l}return o},k=30):$&&_&&"Netscape"!=navigator.appName?(B.prototype.am=function(e,t,n,r,o,i){while(--i>=0){var s=t*this[e++]+n[r]+o;o=Math.floor(s/67108864),n[r++]=67108863&s}return o},k=26):(B.prototype.am=function(e,t,n,r,o,i){var s=16383&t,a=t>>14;while(--i>=0){var l=16383&this[e],c=this[e++]>>14,u=a*l+c*s;l=s*l+((16383&u)<<14)+n[r]+o,o=(l>>28)+(u>>14)+a*c,n[r++]=268435455&l}return o},k=28),B.prototype.DB=k,B.prototype.DM=(1<<k)-1,B.prototype.DV=1<<k;var L=52;B.prototype.FV=Math.pow(2,L),B.prototype.F1=L-k,B.prototype.F2=2*k-L;var q,F,U=[];for(q="0".charCodeAt(0),F=0;F<=9;++F)U[q++]=F;for(q="a".charCodeAt(0),F=10;F<36;++F)U[q++]=F;for(q="A".charCodeAt(0),F=10;F<36;++F)U[q++]=F;function z(e,t){var n=U[e.charCodeAt(t)];return null==n?-1:n}function K(e){var t=j();return t.fromInt(e),t}function W(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}B.ZERO=K(0),B.ONE=K(1);var G=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}();function Y(){return new G}var J,Z,X=256,Q=null;if(null==Q){Q=[],Z=0;var ee=void 0;if("undefined"!==typeof window&&window.crypto&&window.crypto.getRandomValues){var te=new Uint32Array(256);for(window.crypto.getRandomValues(te),ee=0;ee<te.length;++ee)Q[Z++]=255&te[ee]}var ne=0,re=function(e){if(ne=ne||0,ne>=256||Z>=X)window.removeEventListener?window.removeEventListener("mousemove",re,!1):window.detachEvent&&window.detachEvent("onmousemove",re);else try{var t=e.x+e.y;Q[Z++]=255&t,ne+=1}catch(n){}};"undefined"!==typeof window&&(window.addEventListener?window.addEventListener("mousemove",re,!1):window.attachEvent&&window.attachEvent("onmousemove",re))}function oe(){if(null==J){J=Y();while(Z<X){var e=Math.floor(65536*Math.random());Q[Z++]=255&e}for(J.init(Q),Z=0;Z<Q.length;++Z)Q[Z]=0;Z=0}return J.next()}var ie=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=oe()},e}();function se(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",o=0;o<n;o+=2)r+="ff";var i="0001"+r+"00"+e;return V(i,16)}function ae(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;var n=[],r=e.length-1;while(r>=0&&t>0){var o=e.charCodeAt(r--);o<128?n[--t]=o:o>127&&o<2048?(n[--t]=63&o|128,n[--t]=o>>6|192):(n[--t]=63&o|128,n[--t]=o>>6&63|128,n[--t]=o>>12|224)}n[--t]=0;var i=new ie,s=[];while(t>2){s[0]=0;while(0==s[0])i.nextBytes(s);n[--t]=s[0]}return n[--t]=2,n[--t]=0,new B(n)}var le=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);while(t.compareTo(n)<0)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,n=ae(e,t);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;for(var o=r.toString(16),i=o.length,s=0;s<2*t-i;s++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16),this.d=V(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,o,i,s,a){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16),this.d=V(n,16),this.p=V(r,16),this.q=V(o,16),this.dmp1=V(i,16),this.dmq1=V(s,16),this.coeff=V(a,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new ie,r=e>>1;this.e=parseInt(t,16);for(var o=new B(t,16);;){for(;;)if(this.p=new B(e-r,1,n),0==this.p.subtract(B.ONE).gcd(o).compareTo(B.ONE)&&this.p.isProbablePrime(10))break;for(;;)if(this.q=new B(r,1,n),0==this.q.subtract(B.ONE).gcd(o).compareTo(B.ONE)&&this.q.isProbablePrime(10))break;if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var s=this.p.subtract(B.ONE),a=this.q.subtract(B.ONE),l=s.multiply(a);if(0==l.gcd(o).compareTo(B.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(l),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=V(e,16),n=this.doPrivate(t);return null==n?null:ce(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new ie,o=e>>1;this.e=parseInt(t,16);var i=new B(t,16),s=this,a=function(){var t=function(){if(s.p.compareTo(s.q)<=0){var e=s.p;s.p=s.q,s.q=e}var t=s.p.subtract(B.ONE),r=s.q.subtract(B.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(B.ONE)?(s.n=s.p.multiply(s.q),s.d=i.modInverse(o),s.dmp1=s.d.mod(t),s.dmq1=s.d.mod(r),s.coeff=s.q.modInverse(s.p),setTimeout((function(){n()}),0)):setTimeout(a,0)},l=function(){s.q=j(),s.q.fromNumberAsync(o,1,r,(function(){s.q.subtract(B.ONE).gcda(i,(function(e){0==e.compareTo(B.ONE)&&s.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(l,0)}))}))},c=function(){s.p=j(),s.p.fromNumberAsync(e-o,1,r,(function(){s.p.subtract(B.ONE).gcda(i,(function(e){0==e.compareTo(B.ONE)&&s.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(c,0)}))}))};setTimeout(c,0)};setTimeout(a,0)},e.prototype.sign=function(e,t,n){var r=de(n),o=r+t(e).toString(),i=se(o,this.n.bitLength()/4);if(null==i)return null;var s=this.doPrivate(i);if(null==s)return null;var a=s.toString(16);return 0==(1&a.length)?a:"0"+a},e.prototype.verify=function(e,t,n){var r=V(t,16),o=this.doPublic(r);if(null==o)return null;var i=o.toString(16).replace(/^1f+00/,""),s=pe(i);return s==n(e).toString()},e}();function ce(e,t){var n=e.toByteArray(),r=0;while(r<n.length&&0==n[r])++r;if(n.length-r!=t-1||2!=n[r])return null;++r;while(0!=n[r])if(++r>=n.length)return null;var o="";while(++r<n.length){var i=255&n[r];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&n[r+1]),++r):(o+=String.fromCharCode((15&i)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return o}var ue={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function de(e){return ue[e]||""}function pe(e){for(var t in ue)if(ue.hasOwnProperty(t)){var n=ue[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}
10
+ */(function(){"use strict";var ERROR="input is invalid type",WINDOW="object"===typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"===typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var n=OUTPUT_TYPES[t];e[n]=createOutputMethod(n)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"===typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null===e||void 0===e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,n=typeof e;if("string"!==n){if("object"!==n)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw ERROR;t=!0}var r,o,i=0,s=e.length,a=this.blocks,l=this.buffer8;while(i<s){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(o=this.start;i<s&&o<64;++i)l[o++]=e[i];else for(o=this.start;i<s&&o<64;++i)a[o>>2]|=e[i]<<SHIFT[3&o++];else if(ARRAY_BUFFER)for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?l[o++]=r:r<2048?(l[o++]=192|r>>6,l[o++]=128|63&r):r<55296||r>=57344?(l[o++]=224|r>>12,l[o++]=128|r>>6&63,l[o++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),l[o++]=240|r>>18,l[o++]=128|r>>12&63,l[o++]=128|r>>6&63,l[o++]=128|63&r);else for(o=this.start;i<s&&o<64;++i)r=e.charCodeAt(i),r<128?a[o>>2]|=r<<SHIFT[3&o++]:r<2048?(a[o>>2]|=(192|r>>6)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]):r<55296||r>=57344?(a[o>>2]|=(224|r>>12)<<SHIFT[3&o++],a[o>>2]|=(128|r>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++i)),a[o>>2]|=(240|r>>18)<<SHIFT[3&o++],a[o>>2]|=(128|r>>12&63)<<SHIFT[3&o++],a[o>>2]|=(128|r>>6&63)<<SHIFT[3&o++],a[o>>2]|=(128|63&r)<<SHIFT[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,r,o,i,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,r=(-1732584194^2004318071&e)+s[1]-117830708,r=(r<<12|r>>>20)+e<<0,n=(-271733879^r&(-271733879^e))+s[2]-1126478375,n=(n<<17|n>>>15)+r<<0,t=(e^n&(r^e))+s[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,r=this.h3,e+=(r^t&(n^r))+s[0]-680876936,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[1]-389564586,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[2]+606105819,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(r^t&(n^r))+s[4]-176418897,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[5]+1200080426,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[6]-1473231341,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+s[8]+1770035416,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[9]-1958414417,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[10]-42063,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(r^t&(n^r))+s[12]+1804603682,e=(e<<7|e>>>25)+t<<0,r+=(n^e&(t^n))+s[13]-40341101,r=(r<<12|r>>>20)+e<<0,n+=(t^r&(e^t))+s[14]-1502002290,n=(n<<17|n>>>15)+r<<0,t+=(e^n&(r^e))+s[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^r&(t^n))+s[1]-165796510,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[6]-1069501632,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[11]+643717713,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[5]-701558691,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[10]+38016083,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[15]-660478335,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[9]+568446438,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[14]-1019803690,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[3]-187363961,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^r&(t^n))+s[13]-1444681467,e=(e<<5|e>>>27)+t<<0,r+=(t^n&(e^t))+s[2]-51403784,r=(r<<9|r>>>23)+e<<0,n+=(e^t&(r^e))+s[7]+1735328473,n=(n<<14|n>>>18)+r<<0,t+=(r^e&(n^r))+s[12]-1926607734,t=(t<<20|t>>>12)+n<<0,o=t^n,e+=(o^r)+s[5]-378558,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[8]-2022574463,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[11]+1839030562,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[14]-35309556,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[1]-1530992060,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[4]+1272893353,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[7]-155497632,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[10]-1094730640,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[13]+681279174,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[0]-358537222,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[3]-722521979,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[6]+76029189,t=(t<<23|t>>>9)+n<<0,o=t^n,e+=(o^r)+s[9]-640364487,e=(e<<4|e>>>28)+t<<0,r+=(o^e)+s[12]-421815835,r=(r<<11|r>>>21)+e<<0,i=r^e,n+=(i^t)+s[15]+530742520,n=(n<<16|n>>>16)+r<<0,t+=(i^n)+s[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~r))+s[0]-198630844,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[7]+1126891415,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[14]-1416354905,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[12]+1700485571,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[3]-1894986606,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[10]-1051523,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[8]+1873313359,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[15]-30611744,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[6]-1560198380,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~r))+s[4]-145523070,e=(e<<6|e>>>26)+t<<0,r+=(t^(e|~n))+s[11]-1120210379,r=(r<<10|r>>>22)+e<<0,n+=(e^(r|~t))+s[2]+718787259,n=(n<<15|n>>>17)+r<<0,t+=(r^(n|~e))+s[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=r+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,r="",o=this.array(),i=0;i<15;)e=o[i++],t=o[i++],n=o[i++],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=o[i],r+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"==",r};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()},847:function(e,t,n){"use strict";n.r(t),n.d(t,{JSEncrypt:function(){return be},default:function(){return we}});var r="0123456789abcdefghijklmnopqrstuvwxyz";function o(e){return r.charAt(e)}function i(e,t){return e&t}function s(e,t){return e|t}function a(e,t){return e^t}function l(e,t){return e&~t}function c(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function u(e){var t=0;while(0!=e)e&=e-1,++t;return t}var d,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="=";function f(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=p.charAt(n>>6)+p.charAt(63&n);t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=p.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=p.charAt(n>>2)+p.charAt((3&n)<<4));while((3&r.length)>0)r+=h;return r}function g(e){var t,n="",r=0,i=0;for(t=0;t<e.length;++t){if(e.charAt(t)==h)break;var s=p.indexOf(e.charAt(t));s<0||(0==r?(n+=o(s>>2),i=3&s,r=1):1==r?(n+=o(i<<2|s>>4),i=15&s,r=2):2==r?(n+=o(i),n+=o(s>>2),i=3&s,r=3):(n+=o(i<<2|s>>4),n+=o(15&s),r=0))}return 1==r&&(n+=o(i<<2)),n}var m,v={decode:function(e){var t;if(void 0===d){var n="0123456789ABCDEF",r=" \f\n\r\t \u2028\u2029";for(d={},t=0;t<16;++t)d[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)d[n.charAt(t)]=t;for(t=0;t<r.length;++t)d[r.charAt(t)]=-1}var o=[],i=0,s=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(a=d[a],-1!=a){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++s>=2?(o[o.length]=i,i=0,s=0):i<<=4}}if(s)throw new Error("Hex encoding incomplete: 4 bits missing");return o}},y={decode:function(e){var t;if(void 0===m){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="= \f\n\r\t \u2028\u2029";for(m=Object.create(null),t=0;t<64;++t)m[n.charAt(t)]=t;for(m["-"]=62,m["_"]=63,t=0;t<r.length;++t)m[r.charAt(t)]=-1}var o=[],i=0,s=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(a=m[a],-1!=a){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++s>=4?(o[o.length]=i>>16,o[o.length]=i>>8&255,o[o.length]=255&i,i=0,s=0):i<<=6}}switch(s){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:o[o.length]=i>>10;break;case 3:o[o.length]=i>>16,o[o.length]=i>>8&255;break}return o},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=y.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return y.decode(e)}},b=1e13,w=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,o=this.buf,i=o.length;for(n=0;n<i;++n)r=o[n]*e+t,r<b?t=0:(t=0|r/b,r-=t*b),o[n]=r;t>0&&(o[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,o=r.length;for(t=0;t<o;++t)n=r[t]-e,n<0?(n+=b,e=1):e=0,r[t]=n;while(0===r[r.length-1])r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(b+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*b+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),C="…",S=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,E=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function T(e,t){return e.length>t&&(e=e.substring(0,t)+C),e}var k,x=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"===typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",o=e;o<t;++o)if(r+=this.hexByte(this.get(o)),!0!==n)switch(15&o){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var o=this.get(r++);n+=o<128?String.fromCharCode(o):o>191&&o<224?String.fromCharCode((31&o)<<6|63&this.get(r++)):String.fromCharCode((15&o)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,o="",i=e;i<t;)n=this.get(i++),r=this.get(i++),o+=String.fromCharCode(n<<8|r);return o},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),o=(n?S:E).exec(r);return o?(n&&(o[1]=+o[1],o[1]+=+o[1]<70?2e3:1900),r=o[1]+"-"+o[2]+"-"+o[3]+" "+o[4],o[5]&&(r+=":"+o[5],o[6]&&(r+=":"+o[6],o[7]&&(r+="."+o[7]))),o[8]&&(r+=" UTC","Z"!=o[8]&&(r+=o[8],o[9]&&(r+=":"+o[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){var n,r=this.get(e),o=r>127,i=o?255:0,s="";while(r==i&&++e<t)r=this.get(e);if(n=t-e,0===n)return o?-1:0;if(n>4){s=r,n<<=3;while(0==(128&(+s^i)))s=+s<<1,--n;s="("+n+" bit)\n"}o&&(r-=256);for(var a=new w(r),l=e+1;l<t;++l)a.mulAdd(256,this.get(l));return s+a.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),o=(t-e-1<<3)-r,i="("+o+" bit)\n",s="",a=e+1;a<t;++a){for(var l=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)s+=l>>u&1?"1":"0";if(s.length>n)return i+T(s,n)}return i+s},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return T(this.parseStringISO(e,t),n);var r=t-e,o="("+r+" byte)\n";n/=2,r>n&&(t=e+n);for(var i=e;i<t;++i)o+=this.hexByte(this.get(i));return r>n&&(o+=C),o},e.prototype.parseOID=function(e,t,n){for(var r="",o=new w,i=0,s=e;s<t;++s){var a=this.get(s);if(o.mulAdd(128,127&a),i+=7,!(128&a)){if(""===r)if(o=o.simplify(),o instanceof w)o.sub(80),r="2."+o.toString();else{var l=o<80?o<40?0:1:2;r=l+"."+(o-40*l)}else r+="."+o.toString();if(r.length>n)return T(r,n);o=new w,i=0}}return i>0&&(r+=".incomplete"),r},e}(),N=function(){function e(e,t,n,r,o){if(!(r instanceof R))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=o}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return T(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return T(this.stream.parseStringISO(t,t+n),e);case 30:return T(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)},e.decode=function(t){var n;n=t instanceof x?t:new x(t,0);var r=new x(n),o=new R(n),i=e.decodeLength(n),s=n.pos,a=s-r.pos,l=null,c=function(){var t=[];if(null!==i){var r=s+i;while(n.pos<r)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+s)}else try{for(;;){var o=e.decode(n);if(o.tag.isEOC())break;t[t.length]=o}i=s-n.pos}catch(a){throw new Error("Exception while decoding undefined length content: "+a)}return t};if(o.tagConstructed)l=c();else if(o.isUniversal()&&(3==o.tagNumber||4==o.tagNumber))try{if(3==o.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=c();for(var u=0;u<l.length;++u)if(l[u].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(d){l=null}if(null===l){if(null===i)throw new Error("We can't skip over an invalid tag with undefined length at offset "+s);n.pos=s+Math.abs(i)}return new e(r,a,i,o,l)},e}(),R=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!==(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new w;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),I=0xdeadbeefcafe,_=15715070==(16777215&I),O=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/O[O.length-1],B=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,s="",a=this.t,l=this.DB-a*this.DB%t;if(a-- >0){l<this.DB&&(n=this[a]>>l)>0&&(i=!0,s=o(n));while(a>=0)l<t?(n=(this[a]&(1<<l)-1)<<t-l,n|=this[--a]>>(l+=this.DB-t)):(n=this[a]>>(l-=t)&r,l<=0&&(l+=this.DB,--a)),n>0&&(i=!0),i&&(s+=o(n))}return i?s:"0"},e.prototype.negate=function(){var t=j();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(t=n-e.t,0!=t)return this.s<0?-t:t;while(--n>=0)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+W(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=j();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new P(t):new H(t),this.exp(e,n)},e.prototype.clone=function(){var e=j();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,o=0;if(e-- >0){r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[o++]=n|this.s<<this.DB-r);while(e>=0)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==o&&(128&this.s)!=(128&n)&&++o,(o>0||n!=this.s)&&(t[o++]=n)}return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=j();return this.bitwiseTo(e,i,t),t},e.prototype.or=function(e){var t=j();return this.bitwiseTo(e,s,t),t},e.prototype.xor=function(e){var t=j();return this.bitwiseTo(e,a,t),t},e.prototype.andNot=function(e){var t=j();return this.bitwiseTo(e,l,t),t},e.prototype.not=function(){for(var e=j(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=j();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=j();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+c(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=u(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,s)},e.prototype.clearBit=function(e){return this.changeBit(e,l)},e.prototype.flipBit=function(e){return this.changeBit(e,a)},e.prototype.add=function(e){var t=j();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=j();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=j();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=j();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=j();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=j(),n=j();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,o=e.bitLength(),i=K(1);if(o<=0)return i;n=o<18?1:o<48?3:o<144?4:o<768?5:6,r=o<8?new P(t):t.isEven()?new M(t):new H(t);var s=[],a=3,l=n-1,c=(1<<n)-1;if(s[1]=r.convert(this),n>1){var u=j();r.sqrTo(s[1],u);while(a<=c)s[a]=j(),r.mulTo(u,s[a-2],s[a]),a+=2}var d,p,h=e.t-1,f=!0,g=j();o=W(e[h])-1;while(h>=0){o>=l?d=e[h]>>o-l&c:(d=(e[h]&(1<<o+1)-1)<<l-o,h>0&&(d|=e[h-1]>>this.DB+o-l)),a=n;while(0==(1&d))d>>=1,--a;if((o-=a)<0&&(o+=this.DB,--h),f)s[d].copyTo(i),f=!1;else{while(a>1)r.sqrTo(i,g),r.sqrTo(g,i),a-=2;a>0?r.sqrTo(i,g):(p=i,i=g,g=p),r.mulTo(g,s[d],i)}while(h>=0&&0==(e[h]&1<<o))r.sqrTo(i,g),p=i,i=g,g=p,--o<0&&(o=this.DB-1,--h)}return r.revert(i)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;var r=t.clone(),o=this.clone(),i=K(1),s=K(0),a=K(0),l=K(1);while(0!=r.signum()){while(r.isEven())r.rShiftTo(1,r),n?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);while(o.isEven())o.rShiftTo(1,o),n?(a.isEven()&&l.isEven()||(a.addTo(this,a),l.subTo(t,l)),a.rShiftTo(1,a)):l.isEven()||l.subTo(t,l),l.rShiftTo(1,l);r.compareTo(o)>=0?(r.subTo(o,r),n&&i.subTo(a,i),s.subTo(l,s)):(o.subTo(r,o),n&&a.subTo(i,a),l.subTo(s,l))}return 0!=o.compareTo(e.ONE)?e.ZERO:l.compareTo(t)>=0?l.subtract(t):l.signum()<0?(l.addTo(t,l),l.signum()<0?l.add(t):l):l},e.prototype.pow=function(e){return this.exp(e,new D)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var o=t.getLowestSetBit(),i=n.getLowestSetBit();if(i<0)return t;o<i&&(i=o),i>0&&(t.rShiftTo(i,t),n.rShiftTo(i,n));while(t.signum()>0)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return i>0&&n.lShiftTo(i,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=O[O.length-1]){for(t=0;t<O.length;++t)if(n[0]==O[t])return!0;return!1}if(n.isEven())return!1;t=1;while(t<O.length){var r=O[t],o=t+1;while(o<O.length&&r<A)r*=O[o++];r=n.modInt(r);while(t<o)if(r%O[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;var o=t.length,i=!1,s=0;while(--o>=0){var a=8==r?255&+t[o]:z(t,o);a<0?"-"==t.charAt(o)&&(i=!0):(i=!1,0==s?this[this.t++]=a:s+r>this.DB?(this[this.t-1]|=(a&(1<<this.DB-s)-1)<<s,this[this.t++]=a>>this.DB-s):this[this.t-1]|=a<<s,s+=r,s>=this.DB&&(s-=this.DB))}8==r&&0!=(128&+t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){var e=this.s&this.DM;while(this.t>0&&this[this.t-1]==e)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,o=(1<<r)-1,i=Math.floor(e/this.DB),s=this.s<<n&this.DM,a=this.t-1;a>=0;--a)t[a+i+1]=this[a]>>r|s,s=(this[a]&o)<<n;for(a=i-1;a>=0;--a)t[a]=0;t[i]=s,t.t=this.t+i+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,o=this.DB-r,i=(1<<r)-1;t[0]=this[n]>>r;for(var s=n+1;s<this.t;++s)t[s-n-1]|=(this[s]&i)<<o,t[s-n]=this[s]>>r;r>0&&(t[this.t-n-1]|=(this.s&i)<<o),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){var n=0,r=0,o=Math.min(e.t,this.t);while(n<o)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){r-=e.s;while(n<this.t)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{r+=this.s;while(n<e.t)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),o=t.abs(),i=r.t;n.t=i+o.t;while(--i>=0)n[i]=0;for(i=0;i<o.t;++i)n[i+r.t]=r.am(0,o[i],n,i,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){var t=this.abs(),n=e.t=2*t.t;while(--n>=0)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var o=t.abs();if(!(o.t<=0)){var i=this.abs();if(i.t<o.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=j());var s=j(),a=this.s,l=t.s,c=this.DB-W(o[o.t-1]);c>0?(o.lShiftTo(c,s),i.lShiftTo(c,r)):(o.copyTo(s),i.copyTo(r));var u=s.t,d=s[u-1];if(0!=d){var p=d*(1<<this.F1)+(u>1?s[u-2]>>this.F2:0),h=this.FV/p,f=(1<<this.F1)/p,g=1<<this.F2,m=r.t,v=m-u,y=null==n?j():n;s.dlShiftTo(v,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),e.ONE.dlShiftTo(u,y),y.subTo(s,s);while(s.t<u)s[s.t++]=0;while(--v>=0){var b=r[--m]==d?this.DM:Math.floor(r[m]*h+(r[m-1]+g)*f);if((r[m]+=s.am(0,b,r,v,0,u))<b){s.dlShiftTo(v,y),r.subTo(y,r);while(r[m]<--b)r.subTo(y,r)}}null!=n&&(r.drShiftTo(u,n),a!=l&&e.ZERO.subTo(n,n)),r.t=u,r.clamp(),c>0&&r.rShiftTo(c,r),a<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return t=t*(2-(15&e)*t)&15,t=t*(2-(255&e)*t)&255,t=t*(2-((65535&e)*t&65535))&65535,t=t*(2-e*t%this.DV)%this.DV,t>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=j(),o=j(),i=n.convert(this),s=W(t)-1;i.copyTo(r);while(--s>=0)if(n.sqrTo(r,o),(t&1<<s)>0)n.mulTo(o,i,r);else{var a=r;r=o,o=a}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=K(n),o=j(),i=j(),s="";this.divRemTo(r,o,i);while(o.signum()>0)s=(n+i.intValue()).toString(e).substr(1)+s,o.divRemTo(r,o,i);return i.intValue().toString(e)+s},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),o=Math.pow(n,r),i=!1,s=0,a=0,l=0;l<t.length;++l){var c=z(t,l);c<0?"-"==t.charAt(l)&&0==this.signum()&&(i=!0):(a=n*a+c,++s>=r&&(this.dMultiply(o),this.dAddOffset(a,0),s=0,a=0))}s>0&&(this.dMultiply(Math.pow(n,s)),this.dAddOffset(a,0)),i&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,r){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),s,this),this.isEven()&&this.dAddOffset(1,0);while(!this.isProbablePrime(n))this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this)}else{var o=[],i=7&t;o.length=1+(t>>3),n.nextBytes(o),i>0?o[0]&=(1<<i)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,o,i=Math.min(e.t,this.t);for(r=0;r<i;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(o=e.s&this.DM,r=i;r<this.t;++r)n[r]=t(this[r],o);n.t=this.t}else{for(o=this.s&this.DM,r=i;r<e.t;++r)n[r]=t(o,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){var n=0,r=0,o=Math.min(e.t,this.t);while(n<o)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){r+=e.s;while(n<this.t)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{r+=this.s;while(n<e.t)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){while(this.t<=t)this[this.t++]=0;this[t]+=e;while(this[t]>=this.DV)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);n.s=0,n.t=r;while(r>0)n[--r]=0;for(var o=n.t-this.t;r<o;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(o=Math.min(e.t,t);r<o;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;n.s=0;while(--r>=0)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var o=n.shiftRight(r);t=t+1>>1,t>O.length&&(t=O.length);for(var i=j(),s=0;s<t;++s){i.fromInt(O[Math.floor(Math.random()*O.length)]);var a=i.modPow(o,this);if(0!=a.compareTo(e.ONE)&&0!=a.compareTo(n)){var l=1;while(l++<r&&0!=a.compareTo(n))if(a=a.modPowInt(2,this),0==a.compareTo(e.ONE))return!1;if(0!=a.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=j();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var o=n;n=r,r=o}var i=n.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)t(n);else{i<s&&(s=i),s>0&&(n.rShiftTo(s,n),r.rShiftTo(s,r));var a=function(){(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(a,0):(s>0&&r.lShiftTo(s,r),setTimeout((function(){t(r)}),0))};setTimeout(a,10)}},e.prototype.fromNumberAsync=function(t,n,r,o){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),s,this),this.isEven()&&this.dAddOffset(1,0);var i=this,a=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(e.ONE.shiftLeft(t-1),i),i.isProbablePrime(n)?setTimeout((function(){o()}),0):setTimeout(a,0)};setTimeout(a,0)}else{var l=[],c=7&t;l.length=1+(t>>3),n.nextBytes(l),c>0?l[0]&=(1<<c)-1:l[0]=0,this.fromString(l,256)}},e}(),D=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),P=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),H=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=j();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(B.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=j();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){while(e.t<=this.mt2)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;n=t+this.m.t,e[n]+=this.m.am(0,r,e,t,0,this.m.t);while(e[n]>=e.DV)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),M=function(){function e(e){this.m=e,this.r2=j(),this.q3=j(),B.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=j();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);while(e.compareTo(this.r2)<0)e.dAddOffset(1,this.m.t+1);e.subTo(this.r2,e);while(e.compareTo(this.m)>=0)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function j(){return new B(null)}function V(e,t){return new B(e,t)}var L="undefined"!==typeof navigator;L&&_&&"Microsoft Internet Explorer"==navigator.appName?(B.prototype.am=function(e,t,n,r,o,i){var s=32767&t,a=t>>15;while(--i>=0){var l=32767&this[e],c=this[e++]>>15,u=a*l+c*s;l=s*l+((32767&u)<<15)+n[r]+(1073741823&o),o=(l>>>30)+(u>>>15)+a*c+(o>>>30),n[r++]=1073741823&l}return o},k=30):L&&_&&"Netscape"!=navigator.appName?(B.prototype.am=function(e,t,n,r,o,i){while(--i>=0){var s=t*this[e++]+n[r]+o;o=Math.floor(s/67108864),n[r++]=67108863&s}return o},k=26):(B.prototype.am=function(e,t,n,r,o,i){var s=16383&t,a=t>>14;while(--i>=0){var l=16383&this[e],c=this[e++]>>14,u=a*l+c*s;l=s*l+((16383&u)<<14)+n[r]+o,o=(l>>28)+(u>>14)+a*c,n[r++]=268435455&l}return o},k=28),B.prototype.DB=k,B.prototype.DM=(1<<k)-1,B.prototype.DV=1<<k;var $=52;B.prototype.FV=Math.pow(2,$),B.prototype.F1=$-k,B.prototype.F2=2*k-$;var q,F,U=[];for(q="0".charCodeAt(0),F=0;F<=9;++F)U[q++]=F;for(q="a".charCodeAt(0),F=10;F<36;++F)U[q++]=F;for(q="A".charCodeAt(0),F=10;F<36;++F)U[q++]=F;function z(e,t){var n=U[e.charCodeAt(t)];return null==n?-1:n}function K(e){var t=j();return t.fromInt(e),t}function W(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}B.ZERO=K(0),B.ONE=K(1);var G=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}();function Y(){return new G}var J,Z,X=256,Q=null;if(null==Q){Q=[],Z=0;var ee=void 0;if("undefined"!==typeof window&&window.crypto&&window.crypto.getRandomValues){var te=new Uint32Array(256);for(window.crypto.getRandomValues(te),ee=0;ee<te.length;++ee)Q[Z++]=255&te[ee]}var ne=0,re=function(e){if(ne=ne||0,ne>=256||Z>=X)window.removeEventListener?window.removeEventListener("mousemove",re,!1):window.detachEvent&&window.detachEvent("onmousemove",re);else try{var t=e.x+e.y;Q[Z++]=255&t,ne+=1}catch(n){}};"undefined"!==typeof window&&(window.addEventListener?window.addEventListener("mousemove",re,!1):window.attachEvent&&window.attachEvent("onmousemove",re))}function oe(){if(null==J){J=Y();while(Z<X){var e=Math.floor(65536*Math.random());Q[Z++]=255&e}for(J.init(Q),Z=0;Z<Q.length;++Z)Q[Z]=0;Z=0}return J.next()}var ie=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=oe()},e}();function se(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",o=0;o<n;o+=2)r+="ff";var i="0001"+r+"00"+e;return V(i,16)}function ae(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;var n=[],r=e.length-1;while(r>=0&&t>0){var o=e.charCodeAt(r--);o<128?n[--t]=o:o>127&&o<2048?(n[--t]=63&o|128,n[--t]=o>>6|192):(n[--t]=63&o|128,n[--t]=o>>6&63|128,n[--t]=o>>12|224)}n[--t]=0;var i=new ie,s=[];while(t>2){s[0]=0;while(0==s[0])i.nextBytes(s);n[--t]=s[0]}return n[--t]=2,n[--t]=0,new B(n)}var le=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);while(t.compareTo(n)<0)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,n=ae(e,t);if(null==n)return null;var r=this.doPublic(n);if(null==r)return null;for(var o=r.toString(16),i=o.length,s=0;s<2*t-i;s++)o="0"+o;return o},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16),this.d=V(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,o,i,s,a){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=V(e,16),this.e=parseInt(t,16),this.d=V(n,16),this.p=V(r,16),this.q=V(o,16),this.dmp1=V(i,16),this.dmq1=V(s,16),this.coeff=V(a,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new ie,r=e>>1;this.e=parseInt(t,16);for(var o=new B(t,16);;){for(;;)if(this.p=new B(e-r,1,n),0==this.p.subtract(B.ONE).gcd(o).compareTo(B.ONE)&&this.p.isProbablePrime(10))break;for(;;)if(this.q=new B(r,1,n),0==this.q.subtract(B.ONE).gcd(o).compareTo(B.ONE)&&this.q.isProbablePrime(10))break;if(this.p.compareTo(this.q)<=0){var i=this.p;this.p=this.q,this.q=i}var s=this.p.subtract(B.ONE),a=this.q.subtract(B.ONE),l=s.multiply(a);if(0==l.gcd(o).compareTo(B.ONE)){this.n=this.p.multiply(this.q),this.d=o.modInverse(l),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(a),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=V(e,16),n=this.doPrivate(t);return null==n?null:ce(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new ie,o=e>>1;this.e=parseInt(t,16);var i=new B(t,16),s=this,a=function(){var t=function(){if(s.p.compareTo(s.q)<=0){var e=s.p;s.p=s.q,s.q=e}var t=s.p.subtract(B.ONE),r=s.q.subtract(B.ONE),o=t.multiply(r);0==o.gcd(i).compareTo(B.ONE)?(s.n=s.p.multiply(s.q),s.d=i.modInverse(o),s.dmp1=s.d.mod(t),s.dmq1=s.d.mod(r),s.coeff=s.q.modInverse(s.p),setTimeout((function(){n()}),0)):setTimeout(a,0)},l=function(){s.q=j(),s.q.fromNumberAsync(o,1,r,(function(){s.q.subtract(B.ONE).gcda(i,(function(e){0==e.compareTo(B.ONE)&&s.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(l,0)}))}))},c=function(){s.p=j(),s.p.fromNumberAsync(e-o,1,r,(function(){s.p.subtract(B.ONE).gcda(i,(function(e){0==e.compareTo(B.ONE)&&s.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(c,0)}))}))};setTimeout(c,0)};setTimeout(a,0)},e.prototype.sign=function(e,t,n){var r=de(n),o=r+t(e).toString(),i=se(o,this.n.bitLength()/4);if(null==i)return null;var s=this.doPrivate(i);if(null==s)return null;var a=s.toString(16);return 0==(1&a.length)?a:"0"+a},e.prototype.verify=function(e,t,n){var r=V(t,16),o=this.doPublic(r);if(null==o)return null;var i=o.toString(16).replace(/^1f+00/,""),s=pe(i);return s==n(e).toString()},e}();function ce(e,t){var n=e.toByteArray(),r=0;while(r<n.length&&0==n[r])++r;if(n.length-r!=t-1||2!=n[r])return null;++r;while(0!=n[r])if(++r>=n.length)return null;var o="";while(++r<n.length){var i=255&n[r];i<128?o+=String.fromCharCode(i):i>191&&i<224?(o+=String.fromCharCode((31&i)<<6|63&n[r+1]),++r):(o+=String.fromCharCode((15&i)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return o}var ue={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function de(e){return ue[e]||""}function pe(e){for(var t in ue)if(ue.hasOwnProperty(t)){var n=ue[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}
11
11
  /*!
12
12
  Copyright (c) 2011, Yahoo! Inc. All rights reserved.
13
13
  Code licensed under the BSD License:
@@ -23,15 +23,15 @@ var he={};he.lang={extend:function(e,t,n){if(!t||!e)throw new Error("YAHOO.lang.
23
23
  * @since jsrsasign 2.1
24
24
  * @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
25
25
  */
26
- var fe={};"undefined"!=typeof fe.asn1&&fe.asn1||(fe.asn1={}),fe.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1),r=n.length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var o="",i=0;i<r;i++)o+="f";var s=new B(o,16),a=s.xor(e).add(B.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=fe,n=t.asn1,r=n.DERBoolean,o=n.DERInteger,i=n.DERBitString,s=n.DEROctetString,a=n.DERNull,l=n.DERObjectIdentifier,c=n.DEREnumerated,u=n.DERUTF8String,d=n.DERNumericString,p=n.DERPrintableString,h=n.DERTeletexString,f=n.DERIA5String,g=n.DERUTCTime,m=n.DERGeneralizedTime,v=n.DERSequence,y=n.DERSet,b=n.DERTaggedObject,w=n.ASN1Util.newObject,C=Object.keys(e);if(1!=C.length)throw"key of param shall be only one.";var S=C[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new r(e[S]);if("int"==S)return new o(e[S]);if("bitstr"==S)return new i(e[S]);if("octstr"==S)return new s(e[S]);if("null"==S)return new a(e[S]);if("oid"==S)return new l(e[S]);if("enum"==S)return new c(e[S]);if("utf8str"==S)return new u(e[S]);if("numstr"==S)return new d(e[S]);if("prnstr"==S)return new p(e[S]);if("telstr"==S)return new h(e[S]);if("ia5str"==S)return new f(e[S]);if("utctime"==S)return new g(e[S]);if("gentime"==S)return new m(e[S]);if("seq"==S){for(var E=e[S],T=[],k=0;k<E.length;k++){var x=w(E[k]);T.push(x)}return new v({array:T})}if("set"==S){for(E=e[S],T=[],k=0;k<E.length;k++){x=w(E[k]);T.push(x)}return new y({array:T})}if("tag"==S){var N=e[S];if("[object Array]"===Object.prototype.toString.call(N)&&3==N.length){var R=w(N[2]);return new b({tag:N[0],explicit:N[1],obj:R})}var I={};if(void 0!==N.explicit&&(I.explicit=N.explicit),void 0!==N.tag&&(I.tag=N.tag),void 0===N.obj)throw"obj shall be specified for 'tag'.";return I.obj=w(N.obj),new b(I)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.getEncodedHex()}},fe.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=Math.floor(n/40),o=n%40,i=(t=r+"."+o,""),s=2;s<e.length;s+=2){var a=parseInt(e.substr(s,2),16),l=("00000000"+a.toString(2)).slice(-8);if(i+=l.substr(1,7),"0"==l.substr(0,1)){var c=new B(i,2);t=t+"."+c.toString(10),i=""}}return t},fe.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new B(e,10),o=r.toString(2),i=7-o.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";o=s+o;for(a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);r+=t(i),o.splice(0,2);for(var s=0;s<o.length;s++)r+=n(o[s]);return r},fe.asn1.ASN1Object=function(){var e="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+e.length+",v="+this.hV;var t=this.hV.length/2,n=t.toString(16);if(n.length%2==1&&(n="0"+n),t<128)return n;var r=n.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var o=128+r;return o.toString(16)+n},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},fe.asn1.DERAbstractString=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e?this.setString(e):"undefined"!=typeof e["str"]?this.setString(e["str"]):"undefined"!=typeof e["hex"]&&this.setStringHex(e["hex"]))},he.lang.extend(fe.asn1.DERAbstractString,fe.asn1.ASN1Object),fe.asn1.DERAbstractTime=function(e){fe.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(e){utc=e.getTime()+6e4*e.getTimezoneOffset();var t=new Date(utc);return t},this.formatDate=function(e,t,n){var r=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var s=r(String(o.getMonth()+1),2),a=r(String(o.getDate()),2),l=r(String(o.getHours()),2),c=r(String(o.getMinutes()),2),u=r(String(o.getSeconds()),2),d=i+s+a+l+c+u;if(!0===n){var p=o.getMilliseconds();if(0!=p){var h=r(String(p),3);h=h.replace(/[0]+$/,""),d=d+"."+h}}return d+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,o,i){var s=new Date(Date.UTC(e,t-1,n,r,o,i,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},he.lang.extend(fe.asn1.DERAbstractTime,fe.asn1.ASN1Object),fe.asn1.DERAbstractStructured=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,"undefined"!=typeof e&&"undefined"!=typeof e["array"]&&(this.asn1Array=e["array"])},he.lang.extend(fe.asn1.DERAbstractStructured,fe.asn1.ASN1Object),fe.asn1.DERBoolean=function(){fe.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},he.lang.extend(fe.asn1.DERBoolean,fe.asn1.ASN1Object),fe.asn1.DERInteger=function(e){fe.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=fe.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new B(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["bigint"]?this.setByBigInteger(e["bigint"]):"undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e["hex"]&&this.setValueHex(e["hex"]))},he.lang.extend(fe.asn1.DERInteger,fe.asn1.ASN1Object),fe.asn1.DERBitString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}fe.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var t=8-e.length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var o=e.substr(n,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),r+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):"undefined"!=typeof e["hex"]?this.setHexValueIncludingUnusedBits(e["hex"]):"undefined"!=typeof e["bin"]?this.setByBinaryString(e["bin"]):"undefined"!=typeof e["array"]&&this.setByBooleanArray(e["array"]))},he.lang.extend(fe.asn1.DERBitString,fe.asn1.ASN1Object),fe.asn1.DEROctetString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}fe.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},he.lang.extend(fe.asn1.DEROctetString,fe.asn1.DERAbstractString),fe.asn1.DERNull=function(){fe.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},he.lang.extend(fe.asn1.DERNull,fe.asn1.ASN1Object),fe.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new B(e,10),o=r.toString(2),i=7-o.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";o=s+o;for(a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};fe.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);r+=t(i),o.splice(0,2);for(var s=0;s<o.length;s++)r+=n(o[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=fe.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"===typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},he.lang.extend(fe.asn1.DERObjectIdentifier,fe.asn1.ASN1Object),fe.asn1.DEREnumerated=function(e){fe.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=fe.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new B(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e["hex"]&&this.setValueHex(e["hex"]))},he.lang.extend(fe.asn1.DEREnumerated,fe.asn1.ASN1Object),fe.asn1.DERUTF8String=function(e){fe.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},he.lang.extend(fe.asn1.DERUTF8String,fe.asn1.DERAbstractString),fe.asn1.DERNumericString=function(e){fe.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},he.lang.extend(fe.asn1.DERNumericString,fe.asn1.DERAbstractString),fe.asn1.DERPrintableString=function(e){fe.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},he.lang.extend(fe.asn1.DERPrintableString,fe.asn1.DERAbstractString),fe.asn1.DERTeletexString=function(e){fe.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},he.lang.extend(fe.asn1.DERTeletexString,fe.asn1.DERAbstractString),fe.asn1.DERIA5String=function(e){fe.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},he.lang.extend(fe.asn1.DERIA5String,fe.asn1.DERAbstractString),fe.asn1.DERUTCTime=function(e){fe.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return"undefined"==typeof this.date&&"undefined"==typeof this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},he.lang.extend(fe.asn1.DERUTCTime,fe.asn1.DERAbstractTime),fe.asn1.DERGeneralizedTime=function(e){fe.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},he.lang.extend(fe.asn1.DERGeneralizedTime,fe.asn1.DERAbstractTime),fe.asn1.DERSequence=function(e){fe.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e+=n.getEncodedHex()}return this.hV=e,this.hV}},he.lang.extend(fe.asn1.DERSequence,fe.asn1.DERAbstractStructured),fe.asn1.DERSet=function(e){fe.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},"undefined"!=typeof e&&"undefined"!=typeof e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},he.lang.extend(fe.asn1.DERSet,fe.asn1.DERAbstractStructured),fe.asn1.DERTaggedObject=function(e){fe.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["tag"]&&(this.hT=e["tag"]),"undefined"!=typeof e["explicit"]&&(this.isExplicit=e["explicit"]),"undefined"!=typeof e["obj"]&&(this.asn1Object=e["obj"],this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},he.lang.extend(fe.asn1.DERTaggedObject,fe.asn1.ASN1Object);var ge,me=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=function(e){function t(n){var r=e.call(this)||this;return n&&("string"===typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return me(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=r.test(e)?v.decode(e):y.unarmor(e),i=N.decode(o);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=V(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var s=i.sub[3].getHexStringValue();this.d=V(s,16);var a=i.sub[4].getHexStringValue();this.p=V(a,16);var l=i.sub[5].getHexStringValue();this.q=V(l,16);var c=i.sub[6].getHexStringValue();this.dmp1=V(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=V(u,16);var d=i.sub[8].getHexStringValue();this.coeff=V(d,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var p=i.sub[1],h=p.sub[0];t=h.sub[0].getHexStringValue(),this.n=V(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=V(t,16),n=i.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(f){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new fe.asn1.DERInteger({int:0}),new fe.asn1.DERInteger({bigint:this.n}),new fe.asn1.DERInteger({int:this.e}),new fe.asn1.DERInteger({bigint:this.d}),new fe.asn1.DERInteger({bigint:this.p}),new fe.asn1.DERInteger({bigint:this.q}),new fe.asn1.DERInteger({bigint:this.dmp1}),new fe.asn1.DERInteger({bigint:this.dmq1}),new fe.asn1.DERInteger({bigint:this.coeff})]},t=new fe.asn1.DERSequence(e);return t.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return f(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new fe.asn1.DERSequence({array:[new fe.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new fe.asn1.DERNull]}),t=new fe.asn1.DERSequence({array:[new fe.asn1.DERInteger({bigint:this.n}),new fe.asn1.DERInteger({int:this.e})]}),n=new fe.asn1.DERBitString({hex:"00"+t.getEncodedHex()}),r=new fe.asn1.DERSequence({array:[e,n]});return r.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return f(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(t=t||64,!e)return e;var n="(.{1,"+t+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----",e},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(le),ye="undefined"!==typeof process?null===(ge={NODE_ENV:"production",BASE_URL:"/"})||void 0===ge?void 0:ge.npm_package_version:void 0,be=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ve(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(g(e))}catch(t){return!1}},e.prototype.encrypt=function(e){try{return f(this.getKey().encrypt(e))}catch(t){return!1}},e.prototype.sign=function(e,t,n){try{return f(this.getKey().sign(e,t,n))}catch(r){return!1}},e.prototype.verify=function(e,t,n){try{return this.getKey().verify(e,g(t),n)}catch(r){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ve,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=ye,e}(),we=be},798:function(e,t,n){n(802),function(t,r){e.exports=r(n(125),n(146),n(855),n(847))}(0,(function(e,t,n,r){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError;
26
+ var fe={};"undefined"!=typeof fe.asn1&&fe.asn1||(fe.asn1={}),fe.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1),r=n.length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var o="",i=0;i<r;i++)o+="f";var s=new B(o,16),a=s.xor(e).add(B.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=fe,n=t.asn1,r=n.DERBoolean,o=n.DERInteger,i=n.DERBitString,s=n.DEROctetString,a=n.DERNull,l=n.DERObjectIdentifier,c=n.DEREnumerated,u=n.DERUTF8String,d=n.DERNumericString,p=n.DERPrintableString,h=n.DERTeletexString,f=n.DERIA5String,g=n.DERUTCTime,m=n.DERGeneralizedTime,v=n.DERSequence,y=n.DERSet,b=n.DERTaggedObject,w=n.ASN1Util.newObject,C=Object.keys(e);if(1!=C.length)throw"key of param shall be only one.";var S=C[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new r(e[S]);if("int"==S)return new o(e[S]);if("bitstr"==S)return new i(e[S]);if("octstr"==S)return new s(e[S]);if("null"==S)return new a(e[S]);if("oid"==S)return new l(e[S]);if("enum"==S)return new c(e[S]);if("utf8str"==S)return new u(e[S]);if("numstr"==S)return new d(e[S]);if("prnstr"==S)return new p(e[S]);if("telstr"==S)return new h(e[S]);if("ia5str"==S)return new f(e[S]);if("utctime"==S)return new g(e[S]);if("gentime"==S)return new m(e[S]);if("seq"==S){for(var E=e[S],T=[],k=0;k<E.length;k++){var x=w(E[k]);T.push(x)}return new v({array:T})}if("set"==S){for(E=e[S],T=[],k=0;k<E.length;k++){x=w(E[k]);T.push(x)}return new y({array:T})}if("tag"==S){var N=e[S];if("[object Array]"===Object.prototype.toString.call(N)&&3==N.length){var R=w(N[2]);return new b({tag:N[0],explicit:N[1],obj:R})}var I={};if(void 0!==N.explicit&&(I.explicit=N.explicit),void 0!==N.tag&&(I.tag=N.tag),void 0===N.obj)throw"obj shall be specified for 'tag'.";return I.obj=w(N.obj),new b(I)}},this.jsonToASN1HEX=function(e){var t=this.newObject(e);return t.getEncodedHex()}},fe.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=Math.floor(n/40),o=n%40,i=(t=r+"."+o,""),s=2;s<e.length;s+=2){var a=parseInt(e.substr(s,2),16),l=("00000000"+a.toString(2)).slice(-8);if(i+=l.substr(1,7),"0"==l.substr(0,1)){var c=new B(i,2);t=t+"."+c.toString(10),i=""}}return t},fe.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new B(e,10),o=r.toString(2),i=7-o.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";o=s+o;for(a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);r+=t(i),o.splice(0,2);for(var s=0;s<o.length;s++)r+=n(o[s]);return r},fe.asn1.ASN1Object=function(){var e="";this.getLengthHexFromValue=function(){if("undefined"==typeof this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+e.length+",v="+this.hV;var t=this.hV.length/2,n=t.toString(16);if(n.length%2==1&&(n="0"+n),t<128)return n;var r=n.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var o=128+r;return o.toString(16)+n},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},fe.asn1.DERAbstractString=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e?this.setString(e):"undefined"!=typeof e["str"]?this.setString(e["str"]):"undefined"!=typeof e["hex"]&&this.setStringHex(e["hex"]))},he.lang.extend(fe.asn1.DERAbstractString,fe.asn1.ASN1Object),fe.asn1.DERAbstractTime=function(e){fe.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(e){utc=e.getTime()+6e4*e.getTimezoneOffset();var t=new Date(utc);return t},this.formatDate=function(e,t,n){var r=this.zeroPadding,o=this.localDateToUTC(e),i=String(o.getFullYear());"utc"==t&&(i=i.substr(2,2));var s=r(String(o.getMonth()+1),2),a=r(String(o.getDate()),2),l=r(String(o.getHours()),2),c=r(String(o.getMinutes()),2),u=r(String(o.getSeconds()),2),d=i+s+a+l+c+u;if(!0===n){var p=o.getMilliseconds();if(0!=p){var h=r(String(p),3);h=h.replace(/[0]+$/,""),d=d+"."+h}}return d+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,o,i){var s=new Date(Date.UTC(e,t-1,n,r,o,i,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},he.lang.extend(fe.asn1.DERAbstractTime,fe.asn1.ASN1Object),fe.asn1.DERAbstractStructured=function(e){fe.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,"undefined"!=typeof e&&"undefined"!=typeof e["array"]&&(this.asn1Array=e["array"])},he.lang.extend(fe.asn1.DERAbstractStructured,fe.asn1.ASN1Object),fe.asn1.DERBoolean=function(){fe.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},he.lang.extend(fe.asn1.DERBoolean,fe.asn1.ASN1Object),fe.asn1.DERInteger=function(e){fe.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=fe.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new B(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["bigint"]?this.setByBigInteger(e["bigint"]):"undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e["hex"]&&this.setValueHex(e["hex"]))},he.lang.extend(fe.asn1.DERInteger,fe.asn1.ASN1Object),fe.asn1.DERBitString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}fe.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var t=8-e.length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var o=e.substr(n,8),i=parseInt(o,2).toString(16);1==i.length&&(i="0"+i),r+=i}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):"undefined"!=typeof e["hex"]?this.setHexValueIncludingUnusedBits(e["hex"]):"undefined"!=typeof e["bin"]?this.setByBinaryString(e["bin"]):"undefined"!=typeof e["array"]&&this.setByBooleanArray(e["array"]))},he.lang.extend(fe.asn1.DERBitString,fe.asn1.ASN1Object),fe.asn1.DEROctetString=function(e){if(void 0!==e&&"undefined"!==typeof e.obj){var t=fe.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}fe.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},he.lang.extend(fe.asn1.DEROctetString,fe.asn1.DERAbstractString),fe.asn1.DERNull=function(){fe.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},he.lang.extend(fe.asn1.DERNull,fe.asn1.ASN1Object),fe.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new B(e,10),o=r.toString(2),i=7-o.length%7;7==i&&(i=0);for(var s="",a=0;a<i;a++)s+="0";o=s+o;for(a=0;a<o.length-1;a+=7){var l=o.substr(a,7);a!=o.length-7&&(l="1"+l),n+=t(parseInt(l,2))}return n};fe.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",o=e.split("."),i=40*parseInt(o[0])+parseInt(o[1]);r+=t(i),o.splice(0,2);for(var s=0;s<o.length;s++)r+=n(o[s]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=fe.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"===typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},he.lang.extend(fe.asn1.DERObjectIdentifier,fe.asn1.ASN1Object),fe.asn1.DEREnumerated=function(e){fe.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=fe.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new B(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["int"]?this.setByInteger(e["int"]):"number"==typeof e?this.setByInteger(e):"undefined"!=typeof e["hex"]&&this.setValueHex(e["hex"]))},he.lang.extend(fe.asn1.DEREnumerated,fe.asn1.ASN1Object),fe.asn1.DERUTF8String=function(e){fe.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},he.lang.extend(fe.asn1.DERUTF8String,fe.asn1.DERAbstractString),fe.asn1.DERNumericString=function(e){fe.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},he.lang.extend(fe.asn1.DERNumericString,fe.asn1.DERAbstractString),fe.asn1.DERPrintableString=function(e){fe.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},he.lang.extend(fe.asn1.DERPrintableString,fe.asn1.DERAbstractString),fe.asn1.DERTeletexString=function(e){fe.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},he.lang.extend(fe.asn1.DERTeletexString,fe.asn1.DERAbstractString),fe.asn1.DERIA5String=function(e){fe.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},he.lang.extend(fe.asn1.DERIA5String,fe.asn1.DERAbstractString),fe.asn1.DERUTCTime=function(e){fe.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return"undefined"==typeof this.date&&"undefined"==typeof this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},he.lang.extend(fe.asn1.DERUTCTime,fe.asn1.DERAbstractTime),fe.asn1.DERGeneralizedTime=function(e){fe.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},he.lang.extend(fe.asn1.DERGeneralizedTime,fe.asn1.DERAbstractTime),fe.asn1.DERSequence=function(e){fe.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e+=n.getEncodedHex()}return this.hV=e,this.hV}},he.lang.extend(fe.asn1.DERSequence,fe.asn1.DERAbstractStructured),fe.asn1.DERSet=function(e){fe.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},"undefined"!=typeof e&&"undefined"!=typeof e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},he.lang.extend(fe.asn1.DERSet,fe.asn1.DERAbstractStructured),fe.asn1.DERTaggedObject=function(e){fe.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},"undefined"!=typeof e&&("undefined"!=typeof e["tag"]&&(this.hT=e["tag"]),"undefined"!=typeof e["explicit"]&&(this.isExplicit=e["explicit"]),"undefined"!=typeof e["obj"]&&(this.asn1Object=e["obj"],this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},he.lang.extend(fe.asn1.DERTaggedObject,fe.asn1.ASN1Object);var ge,me=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if("function"!==typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ve=function(e){function t(n){var r=e.call(this)||this;return n&&("string"===typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return me(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=r.test(e)?v.decode(e):y.unarmor(e),i=N.decode(o);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=V(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var s=i.sub[3].getHexStringValue();this.d=V(s,16);var a=i.sub[4].getHexStringValue();this.p=V(a,16);var l=i.sub[5].getHexStringValue();this.q=V(l,16);var c=i.sub[6].getHexStringValue();this.dmp1=V(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=V(u,16);var d=i.sub[8].getHexStringValue();this.coeff=V(d,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var p=i.sub[1],h=p.sub[0];t=h.sub[0].getHexStringValue(),this.n=V(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}else t=i.sub[0].getHexStringValue(),this.n=V(t,16),n=i.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(f){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new fe.asn1.DERInteger({int:0}),new fe.asn1.DERInteger({bigint:this.n}),new fe.asn1.DERInteger({int:this.e}),new fe.asn1.DERInteger({bigint:this.d}),new fe.asn1.DERInteger({bigint:this.p}),new fe.asn1.DERInteger({bigint:this.q}),new fe.asn1.DERInteger({bigint:this.dmp1}),new fe.asn1.DERInteger({bigint:this.dmq1}),new fe.asn1.DERInteger({bigint:this.coeff})]},t=new fe.asn1.DERSequence(e);return t.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return f(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new fe.asn1.DERSequence({array:[new fe.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new fe.asn1.DERNull]}),t=new fe.asn1.DERSequence({array:[new fe.asn1.DERInteger({bigint:this.n}),new fe.asn1.DERInteger({int:this.e})]}),n=new fe.asn1.DERBitString({hex:"00"+t.getEncodedHex()}),r=new fe.asn1.DERSequence({array:[e,n]});return r.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return f(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(t=t||64,!e)return e;var n="(.{1,"+t+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----",e},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(le),ye="undefined"!==typeof process?null===(ge={NODE_ENV:"production",BASE_URL:"/"})||void 0===ge?void 0:ge.npm_package_version:void 0,be=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ve(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(g(e))}catch(t){return!1}},e.prototype.encrypt=function(e){try{return f(this.getKey().encrypt(e))}catch(t){return!1}},e.prototype.sign=function(e,t,n){try{return f(this.getKey().sign(e,t,n))}catch(r){return!1}},e.prototype.verify=function(e,t,n){try{return this.getKey().verify(e,g(t),n)}catch(r){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ve,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=ye,e}(),we=be},436:function(e,t,n){n(802),function(t,r){e.exports=r(n(125),n(146),n(855),n(847))}(0,(function(e,t,n,r){"use strict";var o=function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o.apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}"function"==typeof SuppressedError&&SuppressedError;
27
27
  /*!
28
28
  * Socket.IO v4.7.2
29
29
  * (c) 2014-2023 Guillermo Rauch
30
30
  * Released under the MIT License.
31
31
  */
32
- const a=Object.create(null);a.open="0",a.close="1",a.ping="2",a.pong="3",a.message="4",a.upgrade="5",a.noop="6";const l=Object.create(null);Object.keys(a).forEach((e=>{l[a[e]]=e}));const c={type:"error",data:"parser error"},u="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),d="function"==typeof ArrayBuffer,p=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,h=({type:e,data:t},n,r)=>u&&t instanceof Blob?n?r(t):f(t,r):d&&(t instanceof ArrayBuffer||p(t))?n?r(t):f(new Blob([t]),r):r(a[e]+(t||"")),f=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function g(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let m;const v="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let De=0;De<64;De++)v["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(De)]=De;const y="function"==typeof ArrayBuffer,b=(e,t)=>{if("string"!=typeof e)return{type:"message",data:C(e,t)};const n=e.charAt(0);return"b"===n?{type:"message",data:w(e.substring(1),t)}:l[n]?e.length>1?{type:l[n],data:e.substring(1)}:{type:l[n]}:c},w=(e,t)=>{if(y){const n=(e=>{let t,n,r,o,i,s=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);const c=new ArrayBuffer(s),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=v[e.charCodeAt(t)],r=v[e.charCodeAt(t+1)],o=v[e.charCodeAt(t+2)],i=v[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return C(n,t)}return{base64:!0,data:e}},C=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,S=String.fromCharCode(30);function E(){return new TransformStream({transform(e,t){!function(e,t){u&&e.data instanceof Blob?e.data.arrayBuffer().then(g).then(t):d&&(e.data instanceof ArrayBuffer||p(e.data))?t(g(e.data)):h(e,!1,(e=>{m||(m=new TextEncoder),t(m.encode(e))}))}(e,(n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)}))}})}let T;function k(e){return e.reduce(((e,t)=>e+t.length),0)}function x(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function N(e){if(e)return function(e){for(var t in N.prototype)e[t]=N.prototype[t];return e}(e)}N.prototype.on=N.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},N.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},N.prototype.off=N.prototype.removeListener=N.prototype.removeAllListeners=N.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},N.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},N.prototype.emitReserved=N.prototype.emit,N.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},N.prototype.hasListeners=function(e){return!!this.listeners(e).length};const R="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function I(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const _=R.setTimeout,O=R.clearTimeout;function A(e,t){t.useNativeTimers?(e.setTimeoutFn=_.bind(R),e.clearTimeoutFn=O.bind(R)):(e.setTimeoutFn=R.setTimeout.bind(R),e.clearTimeoutFn=R.clearTimeout.bind(R))}class B extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class D extends N{constructor(e){super(),this.writable=!1,A(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new B(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=b(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const P="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),H=64,M={};let j,V=0,$=0;function L(e){let t="";do{t=P[e%H]+t,e=Math.floor(e/H)}while(e>0);return t}function q(){const e=L(+new Date);return e!==j?(V=0,j=e):e+"."+L(V++)}for(;$<H;$++)M[P[$]]=$;let F=!1;try{F="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(a){}const U=F;function z(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||U))return new XMLHttpRequest}catch(e){}if(!t)try{return new(R[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function K(){}const W=null!=new z({xdomain:!1}).responseType;class G extends N{constructor(e,t){super(),A(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=I(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new z(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=G.requestsCount++,G.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=K,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Y(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}G.requestsCount=0,G.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Y):"function"==typeof addEventListener&&addEventListener("onpagehide"in R?"pagehide":"unload",Y,!1));const J="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Z=R.WebSocket||R.MozWebSocket,X="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Q={websocket:class extends D{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=X?{}:I(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=X?new Z(e,t,n):t?new Z(e,t):new Z(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;h(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&J((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=q()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Z}},webtransport:class extends D{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=function(e,t){T||(T=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(0===r){if(k(n)<1)break;const e=x(n,1);i=128==(128&e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(k(n)<2)break;const e=x(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(k(n)<8)break;const e=x(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue(c);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(k(n)<o)break;const e=x(n,o);a.enqueue(b(i?e:T.decode(e),t)),r=0}if(0===o||o>e){a.enqueue(c);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=E();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const o=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),o())})).catch((e=>{}))};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this.writer.write(i).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&J((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends D{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=W&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(S),r=[];for(let o=0;o<n.length;o++){const e=b(n[o],t);if(r.push(e),"error"===e.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{h(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(S))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=q()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new G(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},ee=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,te=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ne(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=ee.exec(e||""),i={},s=14;for(;s--;)i[te[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),n}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class re extends N{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=ne(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=ne(t.host).host),A(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Q[e](n)}open(){let e;if(this.opts.rememberUpgrade&&re.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;re.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;re.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",s),this.once("close",a),this.once("upgrading",l),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{n||t.open()}),200):t.open()}onOpen(){if(this.readyState="open",re.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){re.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}re.protocol=4;const oe="function"==typeof ArrayBuffer,ie=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,se=Object.prototype.toString,ae="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===se.call(Blob),le="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===se.call(File);function ce(e){return oe&&(e instanceof ArrayBuffer||ie(e))||ae&&e instanceof Blob||le&&e instanceof File}function ue(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ue(e[t]))return!0;return!1}if(ce(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ue(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ue(e[n]))return!0;return!1}function de(e){const t=[],n=e.data,r=e;return r.data=pe(n,t),r.attachments=t.length,{packet:r,buffers:t}}function pe(e,t){if(!e)return e;if(ce(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=pe(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=pe(e[r],t));return n}return e}function he(e,t){return e.data=fe(e.data,t),delete e.attachments,e}function fe(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=fe(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=fe(e[n],t));return e}const ge=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var me;function ve(e){return"[object Object]"===Object.prototype.toString.call(e)}!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(me||(me={}));class ye extends N{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===me.BINARY_EVENT;n||t.type===me.BINARY_ACK?(t.type=n?me.EVENT:me.ACK,this.reconstructor=new be(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!ce(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===me[n.type])throw new Error("unknown packet type "+n.type);if(n.type===me.BINARY_EVENT||n.type===me.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!ye.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case me.CONNECT:return ve(t);case me.DISCONNECT:return void 0===t;case me.CONNECT_ERROR:return"string"==typeof t||ve(t);case me.EVENT:case me.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ge.indexOf(t[0]));case me.ACK:case me.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class be{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=he(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var we=Object.freeze({__proto__:null,protocol:5,get PacketType(){return me},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==me.EVENT&&e.type!==me.ACK||!ue(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===me.EVENT?me.BINARY_EVENT:me.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==me.BINARY_EVENT&&e.type!==me.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=de(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:ye});function Ce(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Se=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ee extends N{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ce(e,"open",this.onopen.bind(this)),Ce(e,"packet",this.onpacket.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Se.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:me.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n===this._queue[0])return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:me.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case me.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case me.EVENT:case me.BINARY_EVENT:this.onevent(e);break;case me.ACK:case me.BINARY_ACK:this.onack(e);break;case me.DISCONNECT:this.ondisconnect();break;case me.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:me.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:me.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Te(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Te.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Te.prototype.reset=function(){this.attempts=0},Te.prototype.setMin=function(e){this.ms=e},Te.prototype.setMax=function(e){this.max=e},Te.prototype.setJitter=function(e){this.jitter=e};class ke extends N{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,A(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Te({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||we;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new re(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ce(t,"open",(function(){n.onopen(),e&&e()})),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=Ce(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),o(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ce(e,"ping",this.onping.bind(this)),Ce(e,"data",this.ondata.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this)),Ce(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){J((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ee(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const xe={};function Ne(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=ne(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=xe[o]&&i in xe[o].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?a=new ke(r,t):(xe[o]||(xe[o]=new ke(r,t)),a=xe[o]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Ne,{Manager:ke,Socket:Ee,io:Ne,connect:Ne});var Re={notOpenAudioMsg:"麦克风没有开启",notOpenAudioCode:403,notOpenAudioMsgEn:"Permission dismissed"},Ie={forbiddenAudioMsg:"请先检查您的麦克风是否开启",forbiddenAudioCode:0,forbiddenAudioMsgEn:"Permission denied"},_e={requestState:!1,delay:0},Oe=function(){function a(e){void 0===e&&(e={});var t=this;this.getWebrtcInfo=function(e,t){l.request(e+"/call/api/sip/webrtc/config/query",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){e.success&&e.data?(l.agentextras=e.data,l.initWebrtcEvent(e.data)):t.error(o({},e))},error:function(e){t.error({error:e})}})},this.initAttachEvent=function(e,n,r,o,i){t.attachEventCallbacks&&l.request(e+"/platform/action/refreshWsToken",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){if(e&&e.data){var s="";r.forEach((function(e){"KF"===e.id&&(s=e.url)})),t.attachEventCallbacks.serve=s,t.attachEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:1,pushHangupStatistics:l.initOptions.pushHangupStatistics||!1,pushCallinRingStatistics:l.initOptions.pushCallinRingStatistics||!1},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachEventCallbacks.suc=i,l.createEventHandle(t.attachEventCallbacks)}},error:function(e){r.error({error:e})}})},this.attachNetworkCallbacks={message:l.noop,error:l.noop,success:l.noop},this.initnNetworkMonitoring=function(e,n){var r="";e.forEach((function(e){if("MONITOR"===e.id){var t=document.location.protocol;"file:"===t&&(t="https:"),r=t+"//"+e.url}})),t.attachNetworkCallbacks.success(),t.attachNetworkCallbacks.message({delay:100}),setInterval((function(){var e=(new Date).getTime();_e.requestState=!0,l.request(r+"/ready",{method:"GET",success:function(n){if(n.success){var r=(new Date).getTime();_e.delay=(r-e)/2,t.attachNetworkCallbacks.message({delay:_e.delay})}else t.attachNetworkCallbacks.error(),_e.delay=500,_e.requestState=!1},error:function(e){t.attachNetworkCallbacks.error(),_e.delay=500,_e.requestState=!1}})}),1e4)},this.listenCallNetork=function(e){e&&(t.attachNetworkCallbacks.message=e.message&&"function"==typeof e.message?e.message:l.noop,t.attachNetworkCallbacks.success=e.success&&"function"==typeof e.success?e.success:l.noop,t.attachNetworkCallbacks.error=e.error&&"function"==typeof e.error?e.error:l.noop)},this.initAgentQueue=function(e,n,r,o,i){(t.attachMonitorEventCallbacks||t.attachNlsTranslationEventCallbacks)&&l.request(e+"/platform/action/refreshWsToken",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){if(e&&e.data){var s="";r.forEach((function(e){"MONITOR"===e.id&&(s=e.url)})),t.attachMonitorEventCallbacks&&l.UserConfig.isOpenCallQueue&&(t.attachMonitorEventCallbacks.serve=s,t.attachMonitorEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:3},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachMonitorEventCallbacks.suc=i,l.createQueueMonitorEventHandle(t.attachMonitorEventCallbacks)),t.attachNlsTranslationEventCallbacks&&l.UserConfig.openNlsTranslation&&(t.attachNlsTranslationEventCallbacks.serve=s,t.attachNlsTranslationEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:3},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachNlsTranslationEventCallbacks.suc=i,l.createQueueMonitorEventHandle(t.attachNlsTranslationEventCallbacks))}},error:function(e){console.log("失败",e),r.error({error:e})}})},this.initQueue=function(e){l.request(e+"/call/monitor/agent/queue/query",{verb:"POST",body:{accountId:l.agentInfo.accountId,agentId:l.agentInfo._id},success:function(e){e&&e.data?t.attachMonitorEventCallbacks.message(e):t.attachMonitorEventCallbacks.error(e)},error:function(e){t.attachMonitorEventCallbacks.error(e)}})},this.listenCallQueueEvent=function(e){t.attachMonitorEventCallbacks=e},this.listenTranslationEvent=function(e){t.attachNlsTranslationEventCallbacks=e},this.openMediaAudio=function(e,t){var n=navigator,r=n.mediaDevices,o=n.getUserMedia,i=n.webkitGetUserMedia,s=n.mozGetUserMedia,a=n.msGetUserMedia,l=(o||i||s||a).bind(navigator);return r?navigator.mediaDevices.getUserMedia({audio:!0}).catch((function(n){var r=n.message.includes("denied");return t?(r&&alert(Ie.forbiddenAudioMsg),e&&!r&&alert(e),r?Ie:Re):r?Ie:Re})):new Promise((function(n,r){l?l({audio:!0},(function(e){n(!0)}),(function(n){t&&e&&alert(e),r(Re)})):r(Re)}))},this.listenCallEvent=function(e){t.attachEventCallbacks=e},this._callApi=function(){var e,n,r=t;return{callout:function(t){return i(this,void 0,void 0,(function(){var i,a,c,u,d,p;return s(this,(function(s){switch(s.label){case 0:if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null===l.loginToken||void 0===l.loginToken)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null===l.agentInfo||void 0===l.agentInfo)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null===t.customerNumber||void 0===t.customerNumber)return t.fail({success:!1,message:"Parameter customerNumber is required!"}),[2];if("WEBRTC"!==l.initOptions.loginType)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 2:return s.sent(),[3,4];case 3:return s.sent(),t.fail({success:!1,message:"无麦克风权限!"}),[2];case 4:if(i=l.initOptions.server||l.callApiUrl,a={customerNumber:t.customerNumber,agentNumber:l.agentInfo.agentNumber,accountId:l.agentInfo.accountId,agentId:l.agentInfo._id,loginType:t.loginType||l.agentInfo.loginType||l.initOptions.loginType},t.agentTimeout&&(a.agentTimeout=t.agentTimeout),t.customerTimeout&&(a.customerTimeout=t.customerTimeout),t.agentDisNumber&&(a.agentDisNumber=t.agentDisNumber),t.customerDisNumber&&(a.customerDisNumber=t.customerDisNumber),t.extras&&(a.extras=t.extras),t.numberGroupId&&(a.numberGroupId=t.numberGroupId),t.numberGroupName&&(a.numberGroupName=t.numberGroupName),c=l.initOptions,u=!0,"WEBRTC"!==c.loginType)return[3,8];s.label=5;case 5:return s.trys.push([5,7,,8]),[4,r.openMediaAudio("请打开麦克风权限!",u)];case 6:return d=s.sent()||{},[3,8];case 7:return p=s.sent(),console.log(p),[3,8];case 8:return l.request(i+"/call/api/call/call/out",{verb:"POST",body:a,loginToken:l.loginToken,sessionId:l.agentInfo._id,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success(o(o({success:!0,message:"callout success"},d),e.data)):t.fail(o({success:!1,message:e.message,code:e.code},d))}}),[2]}}))}))},hangup:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/hangup",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"hangup success",data:e}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},holdOrUnHold:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl,o={type:t.type};l.request(r+"/call/api/call/hold",{verb:"POST",body:o,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"holdOrUnHold success"}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},muteOrUnMute:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl,o={type:t.type,direction:t.direction||"all"};l.request(r+"/call/api/call/mute",{verb:"POST",body:o,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"muteOrUnMute success"}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},transfer:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type)if(null!==t.number&&void 0!==t.number){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/transfer",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"transfer success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},consult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.mode&&void 0!==t.mode)if(null!==t.number&&void 0!==t.number){t.agentNumber=l.agentInfo.agentNumber;var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"consult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"Parameter mode is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},cancelconsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/cancel",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"cancelconsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},endConsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/stop",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"endConsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},callbackConsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/resume",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"resumeConsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},consultTransfer:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/transfer",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"consultTransfer success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},threeWayCall:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/threeway",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"threeWayCall success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},evaluate:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/evaluate",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"evaluate success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},meeting:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.number&&void 0!==t.number){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/meeting",{verb:"POST",body:{meetingType:"phone",number:t.number},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"meeting success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})}}},this._agentApi=function(){var e=t;return{switchLoginType:function(t){return i(this,void 0,void 0,(function(){var n,r,a,c,u,d,p=this;return s(this,(function(h){switch(h.label){case 0:if(n=null,t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null===t.loginType||void 0===t.loginType)return t.fail({success:!1,message:"Parameter loginType is required!"}),[2];if(null===l.agentInfo||void 0===l.agentInfo)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null!==t.loginNumber&&void 0!==t.loginNumber&&(n=t.loginNumber),"PSTN"===t.loginType&&!(n=n||l.agentInfo.mobile))return alert("请给座席绑定手机号,或者传入号码参数!"),t.fail({success:!1,message:"Please bind your mobile number"}),[2];if("SIP"===t.loginType&&(n=n||l.agentInfo.sipNumber),"WEBRTC"===t.loginType&&(n=l.agentInfo.webrtcSipNumber),r=l.initOptions.server||l.callApiUrl,a={loginType:t.loginType,loginNumber:n},l.initOptions,u=!0,"WEBRTC"!==t.loginType)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e.openMediaAudio("请打开麦克风权限!",u)];case 2:return c=h.sent()||{},[3,4];case 3:return d=h.sent(),console.log(d),[3,4];case 4:return l.request(r+"/call/api/agent/v1/login-type/change",{verb:"POST",body:a,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(n){return i(p,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return n.success?(t.success(o({success:!0,message:"updateLoginType success"},c)),l.agentInfo.loginType=t.loginType,l.initOptions.loginType=t.loginType,"WEBRTC"!==t.loginType?[3,1]:(e._webPhoneApi().connect(),[3,4])):[3,5];case 1:return"PSTN"!==t.loginType?[3,3]:[4,l.request(r+"/platform/action/updateCallConfig",{verb:"POST",body:{agentCallConfig:{},mobile:t.loginNumber},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId})];case 2:return i.sent(),e._webPhoneApi().disconnect(),[3,4];case 3:e._webPhoneApi().disconnect(),i.label=4;case 4:return[3,6];case 5:t.fail(o({success:!1,message:n.message,code:n.code},c)),i.label=6;case 6:return[2]}}))}))}}),[2]}}))}))},findPhoneBarList:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/phone/bar/all",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){if(t.success){var n=[];t.data.forEach((function(e){var t={name:e.name,number:e.number};n.push(t)})),e.success({success:!0,data:n})}else e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},switchPhoneBar:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==e.stateNumber&&void 0!==e.stateNumber)if(null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl,n={stateNumber:e.stateNumber,accountId:l.agentInfo.accountId,agentNumber:l.agentInfo.agentNumber};l.request(t+"/call/api/agent/status/switch",{verb:"POST",body:n,loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(t){t.success?e.success({success:!0}):e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"});else e.fail({success:!1,message:"Parameter stateNumber is required!"})},logout:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){null!==e.toAnswerOffline&&void 0!==e.toAnswerOffline||(e.toAnswerOffline="1");var t=l.initOptions.server||l.callApiUrl,n={toAnswerOffline:e.toAnswerOffline};l.request(t+"/call/api/sdk/agent/logout",{verb:"POST",body:n,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){t.success?e&&(l.Socketinstance.disconnect(),"WEBRTC"===l.agentInfo.loginType&&l.webPhone.disconnect(),e.success({success:!0})):e&&e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},findIdleAgentsForQueue:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/queue/acountFreeAgent/find",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){t.success?e&&e.success({success:!0,dataList:t.data||[]}):e&&e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},getAvailableSipNumberList:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/sip/avaliable/query",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(t){if(t.success&&t.data){var n=[];t.data.forEach((function(e){var t={number:e.id,numberName:e.number};n.push(t)})),e.success({success:!0,data:n})}else e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})}}},this._webPhoneApi=function(){return{accept:function(){l.webPhone.accept()},connect:function(){l.webPhone&&this.isConnected()||l.initWebrtcEvent(l.agentextras)},disconnect:function(){l.webPhone&&this.isConnected()&&l.webPhone.disconnect()},isConnected:function(){return l.webPhone.isConnected()},sendDTMF:function(e){l.webPhone.sendDTMF(e)}}},e.error="function"==typeof e.error?e.error:l.noop,e.success="function"==typeof e.success?e.success:l.noop,null!==e.agentNumber&&void 0!==e.agentNumber?(null!==e.loginType&&void 0!==e.loginType||(e.loginType="PSTN"),null!==e.pushHangupStatistics&&void 0!==e.pushHangupStatistics||(e.pushHangupStatistics=!1),null!==e.pushCallinRingStatistics&&void 0!==e.pushCallinRingStatistics||(e.pushCallinRingStatistics=!1),this.init(e)):e.error({message:"Invalid agentNumber"})}var l;return a.noop=function(){},a.prototype.init=function(e){if(void 0===e&&(e={}),l.trace=l.noop,l.debug=l.noop,l.log=l.noop,l.warn=l.noop,l.error=l.noop,!0===e.debug||"all"===e.debug)l.trace=console.trace.bind(console),l.debug=console.debug.bind(console),l.log=console.log.bind(console),l.warn=console.warn.bind(console),l.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":l.trace=console.trace.bind(console);break;case"debug":l.debug=console.debug.bind(console);break;case"log":l.log=console.log.bind(console);break;case"warn":l.warn=console.warn.bind(console);break;case"error":l.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'log', warn', 'error')")}}l.log("Initializing library");var r=l.useDefaultDependencies({WebSocket:Ae});l.newWebSocket=r.newWebSocket,l.request=r.request,this.login(e)},a.prototype.login=function(e){return i(this,void 0,void 0,(function(){var i,a,c,u,d,p,h,f,g,m,v=this;return s(this,(function(s){switch(s.label){case 0:if(console.log(e,"options"),l.UserConfig=e,i=e.server||l.callApiUrl,a=e.agentNumber+"@"+e.accountId,c=e.loginType,u=e.isOpenNetwork||!1,d=e.isOpenCallQueue||!1,p=e.openNlsTranslation||!1,h={loginName:a,loginType:c,loginChannel:"SDK",password:""},f=!0,"WEBRTC"!==c)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.openMediaAudio("请打开麦克风权限!",f)];case 2:return g=s.sent()||{},[3,4];case 3:return m=s.sent(),console.log(m),console.log("授权失败================================"),[3,4];case 4:return e.password&&(h.password=e.password),l.request(i+"/platform/public/loginPre",{verb:"GET",success:function(s){if(s&&s.success&&s.data){var a=decodeURIComponent(t.Base64.decode(s.data.pk)),f=new r.JSEncrypt;f.setPublicKey(a);var m=n(h.password),y=f.encrypt(m);h.password=y,l.request(i+"/platform/public/login",{verb:"POST",body:h,success:function(t){t.success?l.request(i+"/platform/action/loginInfo",{verb:"GET",loginToken:t.data.loginToken,sessionId:t.data.sessionId,success:function(t){t.success?(t.data.agent&&(l.agentInfo=t.data.agent,l.loginToken=t.data.loginToken,l.initOptions=o(o({},e),{audioInfo:g})),v.initAttachEvent(i,c,t.data.pushServer,t.data.agent,e.success),u&&v.initnNetworkMonitoring(t.data.pushServer,""),(d||p)&&v.initAgentQueue(i,c,t.data.pushServer,t.data.agent,e.success),d&&v.initQueue(i),"WEBRTC"===c&&v.getWebrtcInfo(i,e)):e.error(o(o({},t),g))},error:function(t){e.error(o({error:t},g))}}):e.error(o(o({},t),g))},error:function(t){e.error(o({error:t},g))}})}else e.error(o(o({},s),g))},error:function(t){e.error(o({error:t},g))}}),[2]}}))}))},a.createEventHandle=function(e){var t=this;void 0===e&&(e={}),e.success="function"==typeof e.success?e.success:l.noop,e.error="function"==typeof e.error?e.error:l.noop,e.message="function"==typeof e.message?e.message:l.noop,e.event="function"==typeof e.event?e.event:l.noop,e.server=null===e.serve||void 0===e.serve?"ws://152.136.72.209:3201/phoneBarGateway":e.serve,null!==e.SocketOptions&&void 0!==e.SocketOptions||(e.SocketOptions={},l.error({message:"login response error!"})),this.Socketinstance=l.newWebSocket(e.server,e.SocketOptions),this.Socketinstance.on("connect",(function(){e.success("connect event serve success!"),e.suc()})),this.Socketinstance.on("error",(function(t,n){e.error({type:"socketError",error:t}),n&&"function"==typeof n&&n("error")})),this.Socketinstance.on("message",(function(t,n){e.message({subtype:t.subType,data:t.data}),"WEBRTC"===l.initOptions.loginType&&(t.data&&t.data.callType&&"callin"===t.data.callType&&t.data.eventType&&"ring"===t.data.eventType?(l.AudioTask||(l.AudioTask=new Be("https://softphone.useasy.cn/ring.wav")),l.AudioTask.ringAudioPlay()):l.AudioTask&&l.AudioTask.ringAudioPause()),n&&"function"==typeof n&&n("success")})),this.Socketinstance.on("event",(function(n){if("KICK_OFF"===n.subType&&!0===n.data.kickoff){t.Socketinstance.disconnect();try{l.webPhone.disconnect(),console.log(n,"互踢")}catch(e){}e.event({message:"坐席账户在其他地方登录",data:n})}}))},a.createQueueMonitorEventHandle=function(e){var t=this;void 0===e&&(e={}),e.success="function"==typeof e.success?e.success:l.noop,e.error="function"==typeof e.error?e.error:l.noop,e.message="function"==typeof e.message?e.message:l.noop,e.server=null===e.serve||void 0===e.serve?"ue-dev1.useasy.cn":e.serve,null!==e.SocketOptions&&void 0!==e.SocketOptions||(e.SocketOptions={},l.error({message:"login response error!"})),this.MonitorSocketinstance=l.newWebSocket(e.server,e.SocketOptions),this.MonitorSocketinstance.on("connect",(function(){e.success("connect event serve success!"),e.suc(),l.log("监控connect========")})),this.MonitorSocketinstance.on("error",(function(t,n){e.error({type:"socketError",error:t}),n&&"function"==typeof n&&n("error")})),this.MonitorSocketinstance.on("message",(function(t,n){e.message({subtype:t.subType,data:t.data})})),this.MonitorSocketinstance.on("event",(function(n,r){if("KICK_OFF"===n.subType&&!0===n.data.kickoff){t.MonitorSocketinstance.disconnect();try{l.webPhone.disconnect(),console.log(n,"呼叫队列互踢")}catch(e){}e.message({message:"坐席账户在其他地方登录",data:n})}e.message(n)})),this.MonitorSocketinstance.on("translation",(function(t,n){console.log("呼叫队列消息更新???translation",t),e.message(t)}))},a.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,r=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new r(e,t)},request:function(e,r){var o={method:r.verb,cache:"no-cache",headers:{"Content-Type":"application/json",loginToken:r.loginToken||"",sessionId:r.sessionId||"",clienttype:0}};r.encryptionFields&&(o.headers["ue-encryption-algorithm"]=r.encryptionAlgorithm||"aes",o.headers["ue-encryption-fields"]=r.encryptionFields),void 0!==r.withCredentials&&(o.credentials=!0===r.withCredentials?"include":r.withCredentials?r.withCredentials:"omit"),void 0!==r.body&&(o.body=JSON.stringify(r.body));var i=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the gateway down?",error:e})}));if(void 0!==r.timeout){var s=new n((function(e,t){var n=window.setTimeout((function(){return clearTimeout(n),r.error({message:"Request timed out",timeout:r.timeout}),t({message:"Request timed out",timeout:r.timeout})}),r.timeout)}));i=n.race([i,s])}return i.then((function(e){return e.ok?typeof r.success==typeof l.noop?e.json().then((function(e){r.success(e)})).catch((function(t){return r.error({message:"Failed to parse response body",error:t,response:e}),n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:(r.error({message:"API call failed",response:e}),n.reject({message:"API call failed",response:e}))})).catch((function(e){typeof r.error==typeof l.noop&&r.error(e.message||"<< internal error >>",e)})),i}}},Object.defineProperty(a.prototype,"agent",{get:function(){return this._agentApi()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"webrtc",{get:function(){return this._webPhoneApi()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"call",{get:function(){return this._callApi()},enumerable:!1,configurable:!0}),l=a,a.callApiUrl="https://app.useasy.cn/api",a.Socketinstance=null,a.AudioTask=null,a.MonitorSocketinstance=null,a.UserConfig=null,a.initWebrtcEvent=function(t){return i(void 0,void 0,void 0,(function(){return s(l,(function(n){switch(n.label){case 0:return l.webPhone=new e.UeWebrtc({server:t.wssUrl,sip:t.sip,secret:t.password}),[4,this.webPhone.connect()];case 1:return n.sent(),this.webPhone.register(),[2]}}))}))},a}(),Ae=function(){function e(e,t){delete t.path,delete t.hostname,delete t.port,this.ws=Ne.connect("wss://".concat(e),t)}return e.prototype.on=function(e,t){console.log(e,"type---\x3ecallback",t),"connect"===e&&this.ws.on(e,t),"error"===e&&(this.ws.on("connect_error",t),this.ws.on("error",t),this.ws.on("disconnect",t),this.ws.on("reconnect_failed",t)),"message"===e&&this.ws.on("call",t),"event"===e&&this.ws.on("event",t),"monitor"===e&&this.ws.on("monitor",t),"translation"===e&&this.ws.on("translation",t)},e.prototype.emit=function(e,t,n){this.ws.emit(e,t,n)},e.prototype.disconnect=function(){this.ws.disconnect()},e}(),Be=function(){function e(e){this.ringAudio=new Audio(e),this.ringAudio.loop=!0,this.ringAudioRunning=!1}return e.prototype.ringAudioPlay=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.ringAudioRunning?[2]:[3,1];case 1:return[4,this.ringAudio.play()];case 2:e.sent(),this.ringAudioRunning=!0,e.label=3;case 3:return[2]}}))}))},e.prototype.ringAudioPause=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.ringAudio.paused?[3,2]:[4,this.ringAudio.pause()];case 1:e.sent(),this.ringAudioRunning=!1,e.label=2;case 2:return[2]}}))}))},e}();return Oe}))},125:function(e,t,n){"use strict";n.r(t),n.d(t,{UeWebrtc:function(){return yt}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function s(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(r.next(e))}catch(t){i(t)}}function a(e){try{l(r["throw"](e))}catch(t){i(t)}}function l(e){e.done?n(e.value):o(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(s=0)),s)try{if(n=1,r&&(o=2&a[0]?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(l){a=[6,l],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}"function"===typeof SuppressedError&&SuppressedError;var l="0.20.0",c=function(){function e(e){for(var t in this.parameters={},e)e.hasOwnProperty(t)&&this.setParam(t,e[t])}return e.prototype.setParam=function(e,t){e&&(this.parameters[e.toLowerCase()]="undefined"===typeof t||null===t?null:t.toString())},e.prototype.getParam=function(e){if(e)return this.parameters[e.toLowerCase()]},e.prototype.hasParam=function(e){return!(!e||void 0===this.parameters[e.toLowerCase()])},e.prototype.deleteParam=function(e){if(e=e.toLowerCase(),this.hasParam(e)){var t=this.parameters[e];return delete this.parameters[e],t}},e.prototype.clearParams=function(){this.parameters={}},e}(),u=function(e){function t(t,n,r){var o=e.call(this,r)||this;return o.uri=t,o._displayName=n,o}return o(t,e),Object.defineProperty(t.prototype,"friendlyName",{get:function(){return this.displayName||this.uri.aor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayName",{get:function(){return this._displayName},set:function(e){this._displayName=e},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.uri.clone(),this._displayName,JSON.parse(JSON.stringify(this.parameters)))},t.prototype.toString=function(){var e=this.displayName||"0"===this.displayName?'"'+this.displayName+'" ':"";for(var t in e+="<"+this.uri.toString()+">",this.parameters)this.parameters.hasOwnProperty(t)&&(e+=";"+t,null!==this.parameters[t]&&(e+="="+this.parameters[t]));return e},t}(c),d=function(e){function t(t,n,r,o,i,s){void 0===t&&(t="sip");var a=e.call(this,i||{})||this;if(a.headers={},!r)throw new TypeError('missing or invalid "host" parameter');for(var l in s)s.hasOwnProperty(l)&&a.setHeader(l,s[l]);return a.raw={scheme:t,user:n,host:r,port:o},a.normal={scheme:t.toLowerCase(),user:n,host:r.toLowerCase(),port:o},a}return o(t,e),Object.defineProperty(t.prototype,"scheme",{get:function(){return this.normal.scheme},set:function(e){this.raw.scheme=e,this.normal.scheme=e.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this.normal.user},set:function(e){this.normal.user=this.raw.user=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"host",{get:function(){return this.normal.host},set:function(e){this.raw.host=e,this.normal.host=e.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aor",{get:function(){return this.normal.user+"@"+this.normal.host},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"port",{get:function(){return this.normal.port},set:function(e){this.normal.port=this.raw.port=e},enumerable:!1,configurable:!0}),t.prototype.setHeader=function(e,t){this.headers[this.headerize(e)]=t instanceof Array?t:[t]},t.prototype.getHeader=function(e){if(e)return this.headers[this.headerize(e)]},t.prototype.hasHeader=function(e){return!!e&&!!this.headers.hasOwnProperty(this.headerize(e))},t.prototype.deleteHeader=function(e){if(e=this.headerize(e),this.headers.hasOwnProperty(e)){var t=this.headers[e];return delete this.headers[e],t}},t.prototype.clearHeaders=function(){this.headers={}},t.prototype.clone=function(){return new t(this._raw.scheme,this._raw.user||"",this._raw.host,this._raw.port,JSON.parse(JSON.stringify(this.parameters)),JSON.parse(JSON.stringify(this.headers)))},t.prototype.toRaw=function(){return this._toString(this._raw)},t.prototype.toString=function(){return this._toString(this._normal)},Object.defineProperty(t.prototype,"_normal",{get:function(){return this.normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_raw",{get:function(){return this.raw},enumerable:!1,configurable:!0}),t.prototype._toString=function(e){var t=e.scheme+":";for(var n in e.scheme.toLowerCase().match("^sips?$")||(t+="//"),e.user&&(t+=this.escapeUser(e.user)+"@"),t+=e.host,(e.port||0===e.port)&&(t+=":"+e.port),this.parameters)this.parameters.hasOwnProperty(n)&&(t+=";"+n,null!==this.parameters[n]&&(t+="="+this.parameters[n]));var r=[];for(var o in this.headers)if(this.headers.hasOwnProperty(o))for(var i in this.headers[o])this.headers[o].hasOwnProperty(i)&&r.push(o+"="+this.headers[o][i]);return r.length>0&&(t+="?"+r.join("&")),t},t.prototype.escapeUser=function(e){var t;try{t=decodeURIComponent(e)}catch(n){throw n}return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%2B/gi,"+").replace(/%3F/gi,"?").replace(/%2F/gi,"/")},t.prototype.headerize=function(e){for(var t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},n=e.toLowerCase().replace(/_/g,"-").split("-"),r=n.length,o="",i=0;i<r;i++)0!==i&&(o+="-"),o+=n[i].charAt(0).toUpperCase()+n[i].substring(1);return t[o]&&(o=t[o]),o},t}(c);function p(e,t){if(e.scheme!==t.scheme)return!1;if(e.user!==t.user||e.host!==t.host||e.port!==t.port)return!1;function n(e,t){var n=Object.keys(e.parameters),r=Object.keys(t.parameters),o=n.filter((function(e){return r.includes(e)}));return!!o.every((function(n){return e.parameters[n]===t.parameters[n]}))&&(!!["user","ttl","method","transport"].every((function(n){return e.hasParam(n)&&t.hasParam(n)||!e.hasParam(n)&&!t.hasParam(n)}))&&!!["maddr"].every((function(n){return e.hasParam(n)&&t.hasParam(n)||!e.hasParam(n)&&!t.hasParam(n)})))}if(!n(e,t))return!1;var r=Object.keys(e.headers),o=Object.keys(t.headers);if(0!==r.length||0!==o.length){if(r.length!==o.length)return!1;var i=r.filter((function(e){return o.includes(e)}));if(i.length!==o.length)return!1;if(!i.every((function(n){return e.headers[n].length&&t.headers[n].length&&e.headers[n][0]===t.headers[n][0]})))return!1}return!0}var h=function(e){function t(n,r,o,i){var s=e.call(this)||this;return s.message=n,s.expected=r,s.found=o,s.location=i,s.name="SyntaxError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(s,t),s}return o(t,e),t.buildMessage=function(e,t){function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){switch(e.type){case"literal":return'"'+r(e.text)+'"';case"class":var t=e.parts.map((function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)}));return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}function s(e){var t,n,r=e.map(i);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}function a(e){return e?'"'+r(e)+'"':"end of input"}return"Expected "+s(e)+" but "+a(t)+" found."},t}(Error);function f(e,t){t=void 0!==t?t:{};var n,r={},o={Contact:119,Name_Addr_Header:156,Record_Route:176,Request_Response:81,SIP_URI:45,Subscription_State:186,Supported:191,Require:182,Via:194,absoluteURI:84,Call_ID:118,Content_Disposition:130,Content_Length:135,Content_Type:136,CSeq:146,displayName:122,Event:149,From:151,host:52,Max_Forwards:154,Min_SE:213,Proxy_Authenticate:157,quoted_string:40,Refer_To:178,Replaces:179,Session_Expires:210,stun_URI:217,To:192,turn_URI:223,uuid:226,WWW_Authenticate:209,challenge:158,sipfrag:230,Referred_By:231},i=119,s=["\r\n",b("\r\n",!1),/^[0-9]/,w([["0","9"]],!1,!1),/^[a-zA-Z]/,w([["a","z"],["A","Z"]],!1,!1),/^[0-9a-fA-F]/,w([["0","9"],["a","f"],["A","F"]],!1,!1),/^[\0-\xFF]/,w([["\0","ÿ"]],!1,!1),/^["]/,w(['"'],!1,!1)," ",b(" ",!1),"\t",b("\t",!1),/^[a-zA-Z0-9]/,w([["a","z"],["A","Z"],["0","9"]],!1,!1),";",b(";",!1),"/",b("/",!1),"?",b("?",!1),":",b(":",!1),"@",b("@",!1),"&",b("&",!1),"=",b("=",!1),"+",b("+",!1),"$",b("$",!1),",",b(",",!1),"-",b("-",!1),"_",b("_",!1),".",b(".",!1),"!",b("!",!1),"~",b("~",!1),"*",b("*",!1),"'",b("'",!1),"(",b("(",!1),")",b(")",!1),"%",b("%",!1),function(){return" "},function(){return":"},/^[!-~]/,w([["!","~"]],!1,!1),/^[\x80-\uFFFF]/,w([["€","￿"]],!1,!1),/^[\x80-\xBF]/,w([["€","¿"]],!1,!1),/^[a-f]/,w([["a","f"]],!1,!1),"`",b("`",!1),"<",b("<",!1),">",b(">",!1),"\\",b("\\",!1),"[",b("[",!1),"]",b("]",!1),"{",b("{",!1),"}",b("}",!1),function(){return"*"},function(){return"/"},function(){return"="},function(){return"("},function(){return")"},function(){return">"},function(){return"<"},function(){return","},function(){return";"},function(){return":"},function(){return'"'},/^[!-']/,w([["!","'"]],!1,!1),/^[*-[]/,w([["*","["]],!1,!1),/^[\]-~]/,w([["]","~"]],!1,!1),function(e){return e},/^[#-[]/,w([["#","["]],!1,!1),/^[\0-\t]/,w([["\0","\t"]],!1,!1),/^[\x0B-\f]/,w([["\v","\f"]],!1,!1),/^[\x0E-\x7F]/,w([["",""]],!1,!1),function(){t=t||{data:{}},t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port},function(){t=t||{data:{}},t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port,t.data.uri_params,t.data.uri_headers),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port,delete t.data.uri_params,"SIP_URI"===t.startRule&&(t.data=t.data.uri)},"sips",b("sips",!0),"sip",b("sip",!0),function(e){t=t||{data:{}},t.data.scheme=e},function(){t=t||{data:{}},t.data.user=decodeURIComponent(v().slice(0,-1))},function(){t=t||{data:{}},t.data.password=v()},function(){return t=t||{data:{}},t.data.host=v(),t.data.host},function(){return t=t||{data:{}},t.data.host_type="domain",v()},/^[a-zA-Z0-9_\-]/,w([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),/^[a-zA-Z0-9\-]/,w([["a","z"],["A","Z"],["0","9"],"-"],!1,!1),function(){return t=t||{data:{}},t.data.host_type="IPv6",v()},"::",b("::",!1),function(){return t=t||{data:{}},t.data.host_type="IPv6",v()},function(){return t=t||{data:{}},t.data.host_type="IPv4",v()},"25",b("25",!1),/^[0-5]/,w([["0","5"]],!1,!1),"2",b("2",!1),/^[0-4]/,w([["0","4"]],!1,!1),"1",b("1",!1),/^[1-9]/,w([["1","9"]],!1,!1),function(e){return t=t||{data:{}},e=parseInt(e.join("")),t.data.port=e,e},"transport=",b("transport=",!0),"udp",b("udp",!0),"tcp",b("tcp",!0),"sctp",b("sctp",!0),"tls",b("tls",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["transport"]=e.toLowerCase()},"user=",b("user=",!0),"phone",b("phone",!0),"ip",b("ip",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["user"]=e.toLowerCase()},"method=",b("method=",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["method"]=e},"ttl=",b("ttl=",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["ttl"]=e},"maddr=",b("maddr=",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["maddr"]=e},"lr",b("lr",!0),function(){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["lr"]=void 0},function(e,n){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),n=null===n?void 0:n[1],t.data.uri_params[e.toLowerCase()]=n},function(e,n){e=e.join("").toLowerCase(),n=n.join(""),t=t||{data:{}},t.data.uri_headers||(t.data.uri_headers={}),t.data.uri_headers[e]?t.data.uri_headers[e].push(n):t.data.uri_headers[e]=[n]},function(){t=t||{data:{}},"Refer_To"===t.startRule&&(t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port,t.data.uri_params,t.data.uri_headers),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port,delete t.data.uri_params)},"//",b("//",!1),function(){t=t||{data:{}},t.data.scheme=v()},b("SIP",!0),function(){t=t||{data:{}},t.data.sip_version=v()},"INVITE",b("INVITE",!1),"ACK",b("ACK",!1),"VXACH",b("VXACH",!1),"OPTIONS",b("OPTIONS",!1),"BYE",b("BYE",!1),"CANCEL",b("CANCEL",!1),"REGISTER",b("REGISTER",!1),"SUBSCRIBE",b("SUBSCRIBE",!1),"NOTIFY",b("NOTIFY",!1),"REFER",b("REFER",!1),"PUBLISH",b("PUBLISH",!1),function(){return t=t||{data:{}},t.data.method=v(),t.data.method},function(e){t=t||{data:{}},t.data.status_code=parseInt(e.join(""))},function(){t=t||{data:{}},t.data.reason_phrase=v()},function(){t=t||{data:{}},t.data=v()},function(){var e,n;for(t=t||{data:{}},n=t.data.multi_header.length,e=0;e<n;e++)if(null===t.data.multi_header[e].parsed){t.data=null;break}null!==t.data?t.data=t.data.multi_header:t.data=-1},function(){var e;t=t||{data:{}},t.data.multi_header||(t.data.multi_header=[]);try{e=new u(t.data.uri,t.data.displayName,t.data.params),delete t.data.uri,delete t.data.displayName,delete t.data.params}catch(n){e=null}t.data.multi_header.push({position:l,offset:y().start.offset,parsed:e})},function(e){e=v().trim(),'"'===e[0]&&(e=e.substring(1,e.length-1)),t=t||{data:{}},t.data.displayName=e},"q",b("q",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["q"]=e},"expires",b("expires",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["expires"]=e},function(e){return parseInt(e.join(""))},"0",b("0",!1),function(){return parseFloat(v())},function(e,n){t=t||{data:{}},t.data.params||(t.data.params={}),n=null===n?void 0:n[1],t.data.params[e.toLowerCase()]=n},"render",b("render",!0),"session",b("session",!0),"icon",b("icon",!0),"alert",b("alert",!0),function(){t=t||{data:{}},"Content_Disposition"===t.startRule&&(t.data.type=v().toLowerCase())},"handling",b("handling",!0),"optional",b("optional",!0),"required",b("required",!0),function(e){t=t||{data:{}},t.data=parseInt(e.join(""))},function(){t=t||{data:{}},t.data=v()},"text",b("text",!0),"image",b("image",!0),"audio",b("audio",!0),"video",b("video",!0),"application",b("application",!0),"message",b("message",!0),"multipart",b("multipart",!0),"x-",b("x-",!0),function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},function(e){t=t||{data:{}},t.data=e},function(e){t=t||{data:{}},t.data.event=e.toLowerCase()},function(){t=t||{data:{}};var e=t.data.tag;t.data=new u(t.data.uri,t.data.displayName,t.data.params),e&&t.data.setParam("tag",e)},"tag",b("tag",!0),function(e){t=t||{data:{}},t.data.tag=e},function(e){t=t||{data:{}},t.data=parseInt(e.join(""))},function(e){t=t||{data:{}},t.data=e},function(){t=t||{data:{}},t.data=new u(t.data.uri,t.data.displayName,t.data.params)},"digest",b("Digest",!0),"realm",b("realm",!0),function(e){t=t||{data:{}},t.data.realm=e},"domain",b("domain",!0),"nonce",b("nonce",!0),function(e){t=t||{data:{}},t.data.nonce=e},"opaque",b("opaque",!0),function(e){t=t||{data:{}},t.data.opaque=e},"stale",b("stale",!0),"true",b("true",!0),function(){t=t||{data:{}},t.data.stale=!0},"false",b("false",!0),function(){t=t||{data:{}},t.data.stale=!1},"algorithm",b("algorithm",!0),"md5",b("MD5",!0),"md5-sess",b("MD5-sess",!0),function(e){t=t||{data:{}},t.data.algorithm=e.toUpperCase()},"qop",b("qop",!0),"auth-int",b("auth-int",!0),"auth",b("auth",!0),function(e){t=t||{data:{}},t.data.qop||(t.data.qop=[]),t.data.qop.push(e.toLowerCase())},function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},function(){var e,n;for(t=t||{data:{}},n=t.data.multi_header.length,e=0;e<n;e++)if(null===t.data.multi_header[e].parsed){t.data=null;break}null!==t.data?t.data=t.data.multi_header:t.data=-1},function(){var e;t=t||{data:{}},t.data.multi_header||(t.data.multi_header=[]);try{e=new u(t.data.uri,t.data.displayName,t.data.params),delete t.data.uri,delete t.data.displayName,delete t.data.params}catch(n){e=null}t.data.multi_header.push({position:l,offset:y().start.offset,parsed:e})},function(){t=t||{data:{}},t.data=new u(t.data.uri,t.data.displayName,t.data.params)},function(){t=t||{data:{}},t.data.replaces_from_tag&&t.data.replaces_to_tag||(t.data=-1)},function(){t=t||{data:{}},t.data={call_id:t.data}},"from-tag",b("from-tag",!0),function(e){t=t||{data:{}},t.data.replaces_from_tag=e},"to-tag",b("to-tag",!0),function(e){t=t||{data:{}},t.data.replaces_to_tag=e},"early-only",b("early-only",!0),function(){t=t||{data:{}},t.data.early_only=!0},function(e,t){return t},function(e,t){return R(e,t)},function(e){t=t||{data:{}},"Require"===t.startRule&&(t.data=e||[])},function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},"active",b("active",!0),"pending",b("pending",!0),"terminated",b("terminated",!0),function(){t=t||{data:{}},t.data.state=v()},"reason",b("reason",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.reason=e)},function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.expires=e)},"retry_after",b("retry_after",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.retry_after=e)},"deactivated",b("deactivated",!0),"probation",b("probation",!0),"rejected",b("rejected",!0),"timeout",b("timeout",!0),"giveup",b("giveup",!0),"noresource",b("noresource",!0),"invariant",b("invariant",!0),function(e){t=t||{data:{}},"Supported"===t.startRule&&(t.data=e||[])},function(){t=t||{data:{}};var e=t.data.tag;t.data=new u(t.data.uri,t.data.displayName,t.data.params),e&&t.data.setParam("tag",e)},"ttl",b("ttl",!0),function(e){t=t||{data:{}},t.data.ttl=e},"maddr",b("maddr",!0),function(e){t=t||{data:{}},t.data.maddr=e},"received",b("received",!0),function(e){t=t||{data:{}},t.data.received=e},"branch",b("branch",!0),function(e){t=t||{data:{}},t.data.branch=e},"rport",b("rport",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.rport=e.join(""))},function(e){t=t||{data:{}},t.data.protocol=e},b("UDP",!0),b("TCP",!0),b("TLS",!0),b("SCTP",!0),function(e){t=t||{data:{}},t.data.transport=e},function(){t=t||{data:{}},t.data.host=v()},function(e){t=t||{data:{}},t.data.port=parseInt(e.join(""))},function(e){return parseInt(e.join(""))},function(e){t=t||{data:{}},"Session_Expires"===t.startRule&&(t.data.deltaSeconds=e)},"refresher",b("refresher",!1),"uas",b("uas",!1),"uac",b("uac",!1),function(e){t=t||{data:{}},"Session_Expires"===t.startRule&&(t.data.refresher=e)},function(e){t=t||{data:{}},"Min_SE"===t.startRule&&(t.data=e)},"stuns",b("stuns",!0),"stun",b("stun",!0),function(e){t=t||{data:{}},t.data.scheme=e},function(e){t=t||{data:{}},t.data.host=e},"?transport=",b("?transport=",!1),"turns",b("turns",!0),"turn",b("turn",!0),function(e){t=t||{data:{}},t.data.transport=e},function(){t=t||{data:{}},t.data=v()},"Referred-By",b("Referred-By",!1),"b",b("b",!1),"cid",b("cid",!1)],a=[x('2 ""6 7!'),x('4"""5!7#'),x('4$""5!7%'),x('4&""5!7\''),x(";'.# &;("),x('4(""5!7)'),x('4*""5!7+'),x('2,""6,7-'),x('2.""6.7/'),x('40""5!71'),x('22""6273.‰ &24""6475.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x(";).# &;,"),x('2F""6F7G.} &2H""6H7I.q &2J""6J7K.e &2L""6L7M.Y &2N""6N7O.M &2P""6P7Q.A &2R""6R7S.5 &2T""6T7U.) &2V""6V7W'),x('%%2X""6X7Y/5#;#/,$;#/#$+#)(#\'#("\'#&\'#/"!&,)'),x('%%$;$0#*;$&/,#; /#$+")("\'#&\'#." &"/=#$;$/&#0#*;$&&&#/\'$8":Z" )("\'#&\'#'),x(';.." &"'),x("%$;'.# &;(0)*;'.# &;(&/?#28\"\"6879/0$;//'$8#:[# )(#'#(\"'#&'#"),x('%%$;2/&#0#*;2&&&#/g#$%$;.0#*;.&/,#;2/#$+")("\'#&\'#0=*%$;.0#*;.&/,#;2/#$+")("\'#&\'#&/#$+")("\'#&\'#/"!&,)'),x('4\\""5!7].# &;3'),x('4^""5!7_'),x('4`""5!7a'),x(';!.) &4b""5!7c'),x('%$;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/ž#0›*;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),x('%$;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/’#0*;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),x('2T""6T7U.ã &2V""6V7W.× &2f""6f7g.Ë &2h""6h7i.¿ &2:""6:7;.³ &2D""6D7E.§ &22""6273.› &28""6879. &2j""6j7k.ƒ &;&.} &24""6475.q &2l""6l7m.e &2n""6n7o.Y &26""6677.M &2>""6>7?.A &2p""6p7q.5 &2r""6r7s.) &;\'.# &;('),x('%$;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s/Ĵ#0ı*;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s&&&#/"!&,)'),x("%;//?#2P\"\"6P7Q/0$;//'$8#:t# )(#'#(\"'#&'#"),x("%;//?#24\"\"6475/0$;//'$8#:u# )(#'#(\"'#&'#"),x("%;//?#2>\"\"6>7?/0$;//'$8#:v# )(#'#(\"'#&'#"),x("%;//?#2T\"\"6T7U/0$;//'$8#:w# )(#'#(\"'#&'#"),x("%;//?#2V\"\"6V7W/0$;//'$8#:x# )(#'#(\"'#&'#"),x('%2h""6h7i/0#;//\'$8":y" )("\'#&\'#'),x('%;//6#2f""6f7g/\'$8":z" )("\'#&\'#'),x("%;//?#2D\"\"6D7E/0$;//'$8#:{# )(#'#(\"'#&'#"),x("%;//?#22\"\"6273/0$;//'$8#:|# )(#'#(\"'#&'#"),x("%;//?#28\"\"6879/0$;//'$8#:}# )(#'#(\"'#&'#"),x("%;//0#;&/'$8\":~\" )(\"'#&'#"),x("%;&/0#;//'$8\":~\" )(\"'#&'#"),x("%;=/T#$;G.) &;K.# &;F0/*;G.) &;K.# &;F&/,$;>/#$+#)(#'#(\"'#&'#"),x('4""5!7€.A &4""5!7‚.5 &4ƒ""5!7„.) &;3.# &;.'),x("%%;//Q#;&/H$$;J.# &;K0)*;J.# &;K&/,$;&/#$+$)($'#(#'#(\"'#&'#/\"!&,)"),x("%;//]#;&/T$%$;J.# &;K0)*;J.# &;K&/\"!&,)/1$;&/($8$:…$!!)($'#(#'#(\"'#&'#"),x(';..G &2L""6L7M.; &4†""5!7‡./ &4ƒ""5!7„.# &;3'),x('%2j""6j7k/J#4ˆ""5!7‰.5 &4Š""5!7‹.) &4Œ""5!7/#$+")("\'#&\'#'),x("%;N/M#28\"\"6879/>$;O.\" &\"/0$;S/'$8$:Ž$ )($'#(#'#(\"'#&'#"),x("%;N/d#28\"\"6879/U$;O.\" &\"/G$;S/>$;_/5$;l.\" &\"/'$8&:& )(&'#(%'#($'#(#'#(\"'#&'#"),x('%3""5$7‘.) &3’""5#7“/\' 8!:”!! )'),x('%;P/]#%28""6879/,#;R/#$+")("\'#&\'#." &"/6$2:""6:7;/\'$8#:•# )(#\'#("\'#&\'#'),x("$;+.) &;-.# &;Q/2#0/*;+.) &;-.# &;Q&&&#"),x('2<""6<7=.q &2>""6>7?.e &2@""6@7A.Y &2B""6B7C.M &2D""6D7E.A &22""6273.5 &26""6677.) &24""6475'),x('%$;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E0e*;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E&/& 8!:–! )'),x('%;T/J#%28""6879/,#;^/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;U.) &;\\.# &;X/& 8!:—! )"),x('%$%;V/2#2J""6J7K/#$+")("\'#&\'#0<*%;V/2#2J""6J7K/#$+")("\'#&\'#&/D#;W/;$2J""6J7K." &"/\'$8#:˜# )(#\'#("\'#&\'#'),x('$4™""5!7š/,#0)*4™""5!7š&&&#'),x('%4$""5!7%/?#$4›""5!7œ0)*4›""5!7œ&/#$+")("\'#&\'#'),x('%2l""6l7m/?#;Y/6$2n""6n7o/\'$8#:# )(#\'#("\'#&\'#'),x('%%;Z/³#28""6879/¤$;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+-)(-\'#(,\'#(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ސ &%2ž""6ž7Ÿ/¤#;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+,)(,\'#(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.۹ &%2ž""6ž7Ÿ/Œ#;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ٺ &%2ž""6ž7Ÿ/t#;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ؓ &%2ž""6ž7Ÿ/\\#;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+&)(&\'#(%\'#($\'#(#\'#("\'#&\'#.ׄ &%2ž""6ž7Ÿ/D#;Z/;$28""6879/,$;[/#$+$)($\'#(#\'#("\'#&\'#.֍ &%2ž""6ž7Ÿ/,#;[/#$+")("\'#&\'#.ծ &%2ž""6ž7Ÿ/,#;Z/#$+")("\'#&\'#.Տ &%;Z/›#2ž""6ž7Ÿ/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$++)(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ӈ &%;Z/ª#%28""6879/,#;Z/#$+")("\'#&\'#." &"/ƒ$2ž""6ž7Ÿ/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.а &%;Z/¹#%28""6879/,#;Z/#$+")("\'#&\'#." &"/’$%28""6879/,#;Z/#$+")("\'#&\'#." &"/k$2ž""6ž7Ÿ/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+))()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ί &%;Z/È#%28""6879/,#;Z/#$+")("\'#&\'#." &"/¡$%28""6879/,#;Z/#$+")("\'#&\'#." &"/z$%28""6879/,#;Z/#$+")("\'#&\'#." &"/S$2ž""6ž7Ÿ/D$;Z/;$28""6879/,$;[/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.˕ &%;Z/×#%28""6879/,#;Z/#$+")("\'#&\'#." &"/°$%28""6879/,#;Z/#$+")("\'#&\'#." &"/‰$%28""6879/,#;Z/#$+")("\'#&\'#." &"/b$%28""6879/,#;Z/#$+")("\'#&\'#." &"/;$2ž""6ž7Ÿ/,$;[/#$+\')(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ȑ &%;Z/þ#%28""6879/,#;Z/#$+")("\'#&\'#." &"/×$%28""6879/,#;Z/#$+")("\'#&\'#." &"/°$%28""6879/,#;Z/#$+")("\'#&\'#." &"/‰$%28""6879/,#;Z/#$+")("\'#&\'#." &"/b$%28""6879/,#;Z/#$+")("\'#&\'#." &"/;$2ž""6ž7Ÿ/,$;Z/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ħ &%;Z/Ĝ#%28""6879/,#;Z/#$+")("\'#&\'#." &"/õ$%28""6879/,#;Z/#$+")("\'#&\'#." &"/Î$%28""6879/,#;Z/#$+")("\'#&\'#." &"/§$%28""6879/,#;Z/#$+")("\'#&\'#." &"/€$%28""6879/,#;Z/#$+")("\'#&\'#." &"/Y$%28""6879/,#;Z/#$+")("\'#&\'#." &"/2$2ž""6ž7Ÿ/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#/& 8!: ! )'),x('%;#/M#;#." &"/?$;#." &"/1$;#." &"/#$+$)($\'#(#\'#("\'#&\'#'),x("%;Z/;#28\"\"6879/,$;Z/#$+#)(#'#(\"'#&'#.# &;\\"),x("%;]/o#2J\"\"6J7K/`$;]/W$2J\"\"6J7K/H$;]/?$2J\"\"6J7K/0$;]/'$8':¡' )(''#(&'#(%'#($'#(#'#(\"'#&'#"),x('%2¢""6¢7£/2#4¤""5!7¥/#$+")("\'#&\'#.˜ &%2¦""6¦7§/;#4¨""5!7©/,$;!/#$+#)(#\'#("\'#&\'#.j &%2ª""6ª7«/5#;!/,$;!/#$+#)(#\'#("\'#&\'#.B &%4¬""5!7­/,#;!/#$+")("\'#&\'#.# &;!'),x('%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%\'#($\'#(#\'#("\'#&\'#/\' 8!:®!! )'),x('$%22""6273/,#;`/#$+")("\'#&\'#0<*%22""6273/,#;`/#$+")("\'#&\'#&'),x(";a.A &;b.; &;c.5 &;d./ &;e.) &;f.# &;g"),x('%3¯""5*7°/a#3±""5#7².G &3³""5#7´.; &3µ""5$7¶./ &3·""5#7¸.# &;6/($8":¹"! )("\'#&\'#'),x('%3º""5%7»/I#3¼""5%7½./ &3¾""5"7¿.# &;6/($8":À"! )("\'#&\'#'),x('%3Á""5\'7Â/1#;/($8":Ã"! )("\'#&\'#'),x('%3Ä""5$7Å/1#;ð/($8":Æ"! )("\'#&\'#'),x('%3Ç""5&7È/1#;T/($8":É"! )("\'#&\'#'),x('%3Ê""5"7Ë/N#%2>""6>7?/,#;6/#$+")("\'#&\'#." &"/\'$8":Ì" )("\'#&\'#'),x('%;h/P#%2>""6>7?/,#;i/#$+")("\'#&\'#." &"/)$8":Í""! )("\'#&\'#'),x('%$;j/&#0#*;j&&&#/"!&,)'),x('%$;j/&#0#*;j&&&#/"!&,)'),x(";k.) &;+.# &;-"),x('2l""6l7m.e &2n""6n7o.Y &24""6475.M &28""6879.A &2<""6<7=.5 &2@""6@7A.) &2B""6B7C'),x('%26""6677/n#;m/e$$%2<""6<7=/,#;m/#$+")("\'#&\'#0<*%2<""6<7=/,#;m/#$+")("\'#&\'#&/#$+#)(#\'#("\'#&\'#'),x('%;n/A#2>""6>7?/2$;o/)$8#:Î#"" )(#\'#("\'#&\'#'),x("$;p.) &;+.# &;-/2#0/*;p.) &;+.# &;-&&&#"),x("$;p.) &;+.# &;-0/*;p.) &;+.# &;-&"),x('2l""6l7m.e &2n""6n7o.Y &24""6475.M &26""6677.A &28""6879.5 &2@""6@7A.) &2B""6B7C'),x(";‘.# &;r"),x("%;/G#;'/>$;s/5$;'/,$;„/#$+%)(%'#($'#(#'#(\"'#&'#"),x(";M.# &;t"),x("%;/E#28\"\"6879/6$;u.# &;x/'$8#:Ï# )(#'#(\"'#&'#"),x('%;v.# &;w/J#%26""6677/,#;ƒ/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x('%2Ð""6Ð7Ñ/:#;€/1$;w." &"/#$+#)(#\'#("\'#&\'#'),x('%24""6475/,#;{/#$+")("\'#&\'#'),x("%;z/3#$;y0#*;y&/#$+\")(\"'#&'#"),x(";*.) &;+.# &;-"),x(';+. &;-.‰ &22""6273.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x('%;|/e#$%24""6475/,#;|/#$+")("\'#&\'#0<*%24""6475/,#;|/#$+")("\'#&\'#&/#$+")("\'#&\'#'),x('%$;~0#*;~&/e#$%22""6273/,#;}/#$+")("\'#&\'#0<*%22""6273/,#;}/#$+")("\'#&\'#&/#$+")("\'#&\'#'),x("$;~0#*;~&"),x(';+.w &;-.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x('%%;"/‡#$;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K0M*;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K&/#$+")("\'#&\'#/& 8!:Ò! )'),x(";.# &;‚"),x('%%;O/2#2:""6:7;/#$+")("\'#&\'#." &"/,#;S/#$+")("\'#&\'#." &"'),x('$;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A/Œ#0‰*;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A&&&#'),x("$;y0#*;y&"),x('%3’""5#7Ó/q#24""6475/b$$;!/&#0#*;!&&&#/L$2J""6J7K/=$$;!/&#0#*;!&&&#/\'$8%:Ô% )(%\'#($\'#(#\'#("\'#&\'#'),x('2Õ""6Õ7Ö'),x('2×""6×7Ø'),x('2Ù""6Ù7Ú'),x('2Û""6Û7Ü'),x('2Ý""6Ý7Þ'),x('2ß""6ß7à'),x('2á""6á7â'),x('2ã""6ã7ä'),x('2å""6å7æ'),x('2ç""6ç7è'),x('2é""6é7ê'),x("%;….Y &;†.S &;ˆ.M &;‰.G &;Š.A &;‹.; &;Œ.5 &;./ &;.) &;Ž.# &;6/& 8!:ë! )"),x("%;„/G#;'/>$;’/5$;'/,$;”/#$+%)(%'#($'#(#'#(\"'#&'#"),x("%;“/' 8!:ì!! )"),x("%;!/5#;!/,$;!/#$+#)(#'#(\"'#&'#"),x("%$;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(0G*;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(&/& 8!:í! )"),x("%;¶/Y#$%;A/,#;¶/#$+\")(\"'#&'#06*%;A/,#;¶/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%;9/N#%2:""6:7;/,#;9/#$+")("\'#&\'#." &"/\'$8":î" )("\'#&\'#'),x("%;:.c &%;˜/Y#$%;A/,#;˜/#$+\")(\"'#&'#06*%;A/,#;˜/#$+\")(\"'#&'#&/#$+\")(\"'#&'#/& 8!:ï! )"),x("%;L.# &;™/]#$%;B/,#;›/#$+\")(\"'#&'#06*%;B/,#;›/#$+\")(\"'#&'#&/'$8\":ð\" )(\"'#&'#"),x("%;š.\" &\"/>#;@/5$;M/,$;?/#$+$)($'#(#'#(\"'#&'#"),x("%%;6/Y#$%;./,#;6/#$+\")(\"'#&'#06*%;./,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#.# &;H/' 8!:ñ!! )"),x(";œ.) &;.# &; "),x("%3ò\"\"5!7ó/:#;</1$;Ÿ/($8#:ô#! )(#'#(\"'#&'#"),x("%3õ\"\"5'7ö/:#;</1$;ž/($8#:÷#! )(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ø!! )"),x('%2ù""6ù7ú/o#%2J""6J7K/M#;!." &"/?$;!." &"/1$;!." &"/#$+$)($\'#(#\'#("\'#&\'#." &"/\'$8":û" )("\'#&\'#'),x('%;6/J#%;</,#;¡/#$+")("\'#&\'#." &"/)$8":ü""! )("\'#&\'#'),x(";6.) &;T.# &;H"),x("%;£/Y#$%;B/,#;¤/#$+\")(\"'#&'#06*%;B/,#;¤/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%3ý""5&7þ.G &3ÿ""5\'7Ā.; &3ā""5$7Ă./ &3ă""5%7Ą.# &;6/& 8!:ą! )'),x(";¥.# &; "),x('%3Ć""5(7ć/M#;</D$3Ĉ""5(7ĉ./ &3Ċ""5(7ċ.# &;6/#$+#)(#\'#("\'#&\'#'),x("%;6/Y#$%;A/,#;6/#$+\")(\"'#&'#06*%;A/,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:Č!! )"),x("%;©/& 8!:č! )"),x("%;ª/k#;;/b$;¯/Y$$%;B/,#;°/#$+\")(\"'#&'#06*%;B/,#;°/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x(";«.# &;¬"),x('3Ď""5$7ď.S &3Đ""5%7đ.G &3Ē""5%7ē.; &3Ĕ""5%7ĕ./ &3Ė""5+7ė.# &;­'),x('3Ę""5\'7ę./ &3Ě""5)7ě.# &;­'),x(";6.# &;®"),x('%3Ĝ""5"7ĝ/,#;6/#$+")("\'#&\'#'),x(";­.# &;6"),x("%;6/5#;</,$;±/#$+#)(#'#(\"'#&'#"),x(";6.# &;H"),x("%;³/5#;./,$;/#$+#)(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:Ğ!! )"),x("%;ž/' 8!:ğ!! )"),x('%;¶/^#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/($8":Ġ"!!)("\'#&\'#'),x('%%;7/e#$%2J""6J7K/,#;7/#$+")("\'#&\'#0<*%2J""6J7K/,#;7/#$+")("\'#&\'#&/#$+")("\'#&\'#/"!&,)'),x("%;L.# &;™/]#$%;B/,#;¸/#$+\")(\"'#&'#06*%;B/,#;¸/#$+\")(\"'#&'#&/'$8\":ġ\" )(\"'#&'#"),x(";¹.# &; "),x("%3Ģ\"\"5#7ģ/:#;</1$;6/($8#:Ĥ#! )(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ĥ!! )"),x("%;ž/' 8!:Ħ!! )"),x("%$;š0#*;š&/x#;@/o$;M/f$;?/]$$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/'$8%:ħ% )(%'#($'#(#'#(\"'#&'#"),x(";¾"),x("%3Ĩ\"\"5&7ĩ/k#;./b$;Á/Y$$%;A/,#;Á/#$+\")(\"'#&'#06*%;A/,#;Á/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#.# &;¿"),x("%;6/k#;./b$;À/Y$$%;A/,#;À/#$+\")(\"'#&'#06*%;A/,#;À/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x("%;6/;#;</2$;6.# &;H/#$+#)(#'#(\"'#&'#"),x(";Â.G &;Ä.A &;Æ.; &;È.5 &;É./ &;Ê.) &;Ë.# &;À"),x("%3Ī\"\"5%7ī/5#;</,$;Ã/#$+#)(#'#(\"'#&'#"),x("%;I/' 8!:Ĭ!! )"),x("%3ĭ\"\"5&7Į/—#;</Ž$;D/…$;Å/|$$%$;'/&#0#*;'&&&#/,#;Å/#$+\")(\"'#&'#0C*%$;'/&#0#*;'&&&#/,#;Å/#$+\")(\"'#&'#&/,$;E/#$+&)(&'#(%'#($'#(#'#(\"'#&'#"),x(";t.# &;w"),x("%3į\"\"5%7İ/5#;</,$;Ç/#$+#)(#'#(\"'#&'#"),x("%;I/' 8!:ı!! )"),x("%3IJ\"\"5&7ij/:#;</1$;I/($8#:Ĵ#! )(#'#(\"'#&'#"),x('%3ĵ""5%7Ķ/]#;</T$%3ķ""5$7ĸ/& 8!:Ĺ! ).4 &%3ĺ""5%7Ļ/& 8!:ļ! )/#$+#)(#\'#("\'#&\'#'),x('%3Ľ""5)7ľ/R#;</I$3Ŀ""5#7ŀ./ &3Ł""5(7ł.# &;6/($8#:Ń#! )(#\'#("\'#&\'#'),x('%3ń""5#7Ņ/“#;</Š$;D/$%;Ì/e#$%2D""6D7E/,#;Ì/#$+")("\'#&\'#0<*%2D""6D7E/,#;Ì/#$+")("\'#&\'#&/#$+")("\'#&\'#/,$;E/#$+%)(%\'#($\'#(#\'#("\'#&\'#'),x('%3ņ""5(7Ň./ &3ň""5$7ʼn.# &;6/\' 8!:Ŋ!! )'),x("%;6/Y#$%;A/,#;6/#$+\")(\"'#&'#06*%;A/,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;Ï/G#;./>$;Ï/5$;./,$;/#$+%)(%'#($'#(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ŋ!! )"),x("%;Ñ/]#$%;A/,#;Ñ/#$+\")(\"'#&'#06*%;A/,#;Ñ/#$+\")(\"'#&'#&/'$8\":Ō\" )(\"'#&'#"),x("%;™/]#$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/'$8\":ō\" )(\"'#&'#"),x('%;L.O &;™.I &%;@." &"/:#;t/1$;?." &"/#$+#)(#\'#("\'#&\'#/]#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/\'$8":Ŏ" )("\'#&\'#'),x("%;Ô/]#$%;B/,#;Õ/#$+\")(\"'#&'#06*%;B/,#;Õ/#$+\")(\"'#&'#&/'$8\":ŏ\" )(\"'#&'#"),x("%;–/& 8!:Ő! )"),x('%3ő""5(7Œ/:#;</1$;6/($8#:œ#! )(#\'#("\'#&\'#.g &%3Ŕ""5&7ŕ/:#;</1$;6/($8#:Ŗ#! )(#\'#("\'#&\'#.: &%3ŗ""5*7Ř/& 8!:ř! ).# &; '),x('%%;6/k#$%;A/2#;6/)$8":Ś""$ )("\'#&\'#0<*%;A/2#;6/)$8":Ś""$ )("\'#&\'#&/)$8":ś""! )("\'#&\'#." &"/\' 8!:Ŝ!! )'),x("%;Ø/Y#$%;A/,#;Ø/#$+\")(\"'#&'#06*%;A/,#;Ø/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;™/Y#$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ŝ!! )"),x("%;Û/Y#$%;B/,#;Ü/#$+\")(\"'#&'#06*%;B/,#;Ü/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%3Ş""5&7ş.; &3Š""5\'7š./ &3Ţ""5*7ţ.# &;6/& 8!:Ť! )'),x("%3ť\"\"5&7Ŧ/:#;</1$;Ý/($8#:ŧ#! )(#'#(\"'#&'#.} &%3õ\"\"5'7ö/:#;</1$;ž/($8#:Ũ#! )(#'#(\"'#&'#.P &%3ũ\"\"5+7Ū/:#;</1$;ž/($8#:ū#! )(#'#(\"'#&'#.# &; "),x('3Ŭ""5+7ŭ.k &3Ů""5)7ů._ &3Ű""5(7ű.S &3Ų""5\'7ų.G &3Ŵ""5&7ŵ.; &3Ŷ""5*7ŷ./ &3Ÿ""5)7Ź.# &;6'),x(';1." &"'),x('%%;6/k#$%;A/2#;6/)$8":Ś""$ )("\'#&\'#0<*%;A/2#;6/)$8":Ś""$ )("\'#&\'#&/)$8":ś""! )("\'#&\'#." &"/\' 8!:ź!! )'),x("%;L.# &;™/]#$%;B/,#;á/#$+\")(\"'#&'#06*%;B/,#;á/#$+\")(\"'#&'#&/'$8\":Ż\" )(\"'#&'#"),x(";¹.# &; "),x("%;ã/Y#$%;A/,#;ã/#$+\")(\"'#&'#06*%;A/,#;ã/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;ê/k#;./b$;í/Y$$%;B/,#;ä/#$+\")(\"'#&'#06*%;B/,#;ä/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x(";å.; &;æ.5 &;ç./ &;è.) &;é.# &; "),x("%3ż\"\"5#7Ž/:#;</1$;ð/($8#:ž#! )(#'#(\"'#&'#"),x("%3ſ\"\"5%7ƀ/:#;</1$;T/($8#:Ɓ#! )(#'#(\"'#&'#"),x("%3Ƃ\"\"5(7ƃ/F#;</=$;\\.) &;Y.# &;X/($8#:Ƅ#! )(#'#(\"'#&'#"),x("%3ƅ\"\"5&7Ɔ/:#;</1$;6/($8#:Ƈ#! )(#'#(\"'#&'#"),x("%3ƈ\"\"5%7Ɖ/A#;</8$$;!0#*;!&/($8#:Ɗ#! )(#'#(\"'#&'#"),x("%;ë/G#;;/>$;6/5$;;/,$;ì/#$+%)(%'#($'#(#'#(\"'#&'#"),x('%3’""5#7Ó.# &;6/\' 8!:Ƌ!! )'),x('%3±""5#7ƌ.G &3³""5#7ƍ.; &3·""5#7Ǝ./ &3µ""5$7Ə.# &;6/\' 8!:Ɛ!! )'),x('%;î/D#%;C/,#;ï/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;U.) &;\\.# &;X/& 8!:Ƒ! )"),x('%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%\'#($\'#(#\'#("\'#&\'#/\' 8!:ƒ!! )'),x('%%;!/?#;!." &"/1$;!." &"/#$+#)(#\'#("\'#&\'#/\' 8!:Ɠ!! )'),x(";¾"),x('%;ž/^#$%;B/,#;ó/#$+")("\'#&\'#06*%;B/,#;ó/#$+")("\'#&\'#&/($8":Ɣ"!!)("\'#&\'#'),x(";ô.# &; "),x('%2ƕ""6ƕ7Ɩ/L#;</C$2Ɨ""6Ɨ7Ƙ.) &2ƙ""6ƙ7ƚ/($8#:ƛ#! )(#\'#("\'#&\'#'),x('%;ž/^#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/($8":Ɯ"!!)("\'#&\'#'),x("%;6/5#;0/,$;÷/#$+#)(#'#(\"'#&'#"),x("$;2.) &;4.# &;.0/*;2.) &;4.# &;.&"),x("$;%0#*;%&"),x("%;ú/;#28\"\"6879/,$;û/#$+#)(#'#(\"'#&'#"),x('%3Ɲ""5%7ƞ.) &3Ɵ""5$7Ơ/\' 8!:ơ!! )'),x('%;ü/J#%28""6879/,#;^/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;\\.) &;X.# &;‚/' 8!:Ƣ!! )"),x(';".S &;!.M &2F""6F7G.A &2J""6J7K.5 &2H""6H7I.) &2N""6N7O'),x('2L""6L7M.• &2B""6B7C.‰ &2<""6<7=.} &2R""6R7S.q &2T""6T7U.e &2V""6V7W.Y &2P""6P7Q.M &2@""6@7A.A &2D""6D7E.5 &22""6273.) &2>""6>7?'),x('%;Ā/b#28""6879/S$;û/J$%2ƣ""6ƣ7Ƥ/,#;ì/#$+")("\'#&\'#." &"/#$+$)($\'#(#\'#("\'#&\'#'),x('%3ƥ""5%7Ʀ.) &3Ƨ""5$7ƨ/\' 8!:ơ!! )'),x('%3±""5#7².6 &3³""5#7´.* &$;+0#*;+&/\' 8!:Ʃ!! )'),x("%;Ą/‡#2F\"\"6F7G/x$;ă/o$2F\"\"6F7G/`$;ă/W$2F\"\"6F7G/H$;ă/?$2F\"\"6F7G/0$;ą/'$8):ƪ) )()'#(('#(''#(&'#(%'#($'#(#'#(\"'#&'#"),x("%;#/>#;#/5$;#/,$;#/#$+$)($'#(#'#(\"'#&'#"),x("%;ă/,#;ă/#$+\")(\"'#&'#"),x("%;ă/5#;ă/,$;ă/#$+#)(#'#(\"'#&'#"),x("%;q/T#$;m0#*;m&/D$%; /,#;ø/#$+\")(\"'#&'#.\" &\"/#$+#)(#'#(\"'#&'#"),x('%2ƫ""6ƫ7Ƭ.) &2ƭ""6ƭ7Ʈ/w#;0/n$;Ĉ/e$$%;B/2#;ĉ.# &; /#$+")("\'#&\'#0<*%;B/2#;ĉ.# &; /#$+")("\'#&\'#&/#$+$)($\'#(#\'#("\'#&\'#'),x(";™.# &;L"),x("%2Ư\"\"6Ư7ư/5#;</,$;Ċ/#$+#)(#'#(\"'#&'#"),x("%;D/S#;,/J$2:\"\"6:7;/;$;,.# &;T/,$;E/#$+%)(%'#($'#(#'#(\"'#&'#")],l=0,c=0,p=[{line:1,column:1}],f=0,g=[],m=0;if(void 0!==t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');i=o[t.startRule]}function v(){return e.substring(c,l)}function y(){return E(c,l)}function b(e,t){return{type:"literal",text:e,ignoreCase:t}}function w(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function C(){return{type:"end"}}function S(t){var n,r=p[t];if(r)return r;n=t-1;while(!p[n])n--;r=p[n],r={line:r.line,column:r.column};while(n<t)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return p[t]=r,r}function E(e,t){var n=S(e),r=S(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function T(e){l<f||(l>f&&(f=l,g=[]),g.push(e))}function k(e,t,n){return new h(h.buildMessage(e,t),e,t,n)}function x(e){return e.split("").map((function(e){return e.charCodeAt(0)-32}))}function N(t){var n,o=a[t],i=0,u=[],d=o.length,p=[],h=[];while(1){while(i<d)switch(o[i]){case 0:h.push(s[o[i+1]]),i+=2;break;case 1:h.push(void 0),i++;break;case 2:h.push(null),i++;break;case 3:h.push(r),i++;break;case 4:h.push([]),i++;break;case 5:h.push(l),i++;break;case 6:h.pop(),i++;break;case 7:l=h.pop(),i++;break;case 8:h.length-=o[i+1],i+=2;break;case 9:h.splice(-2,1),i++;break;case 10:h[h.length-2].push(h.pop()),i++;break;case 11:h.push(h.splice(h.length-o[i+1],o[i+1])),i+=2;break;case 12:h.push(e.substring(h.pop(),l)),i++;break;case 13:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 14:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]===r?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 15:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]!==r?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 16:h[h.length-1]!==r?(p.push(d),u.push(i),d=i+2+o[i+1],i+=2):i+=2+o[i+1];break;case 17:p.push(d),u.push(i+3+o[i+1]+o[i+2]),e.length>l?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 18:p.push(d),u.push(i+4+o[i+2]+o[i+3]),e.substr(l,s[o[i+1]].length)===s[o[i+1]]?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 19:p.push(d),u.push(i+4+o[i+2]+o[i+3]),e.substr(l,s[o[i+1]].length).toLowerCase()===s[o[i+1]]?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 20:p.push(d),u.push(i+4+o[i+2]+o[i+3]),s[o[i+1]].test(e.charAt(l))?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 21:h.push(e.substr(l,o[i+1])),l+=o[i+1],i+=2;break;case 22:h.push(s[o[i+1]]),l+=s[o[i+1]].length,i+=2;break;case 23:h.push(r),0===m&&T(s[o[i+1]]),i+=2;break;case 24:c=h[h.length-1-o[i+1]],i+=2;break;case 25:c=l,i++;break;case 26:n=o.slice(i+4,i+4+o[i+3]).map((function(e){return h[h.length-1-e]})),h.splice(h.length-o[i+2],o[i+2],s[o[i+1]].apply(null,n)),i+=4+o[i+3];break;case 27:h.push(N(o[i+1])),i+=2;break;case 28:m++,i++;break;case 29:m--,i++;break;default:throw new Error("Invalid opcode: "+o[i]+".")}if(!(p.length>0))break;d=p.pop(),i=u.pop()}return h[0]}function R(e,t){return[e].concat(t)}if(t.data={},n=N(i),n!==r&&l===e.length)return n;throw n!==r&&l<e.length&&T(C()),k(g,f<e.length?e.charAt(f):null,f<e.length?E(f,f+1):E(f,f))}var g,m,v=f;(function(e){function t(e,t){var n={startRule:t};try{v(e,n)}catch(r){n.data=-1}return n.data}function n(t){var n=e.parse(t,"Name_Addr_Header");return-1!==n?n:void 0}function r(t){var n=e.parse(t,"SIP_URI");return-1!==n?n:void 0}e.parse=t,e.nameAddrHeaderParse=n,e.URIParse=r})(g||(g={})),function(e){e.ACK="ACK",e.BYE="BYE",e.CANCEL="CANCEL",e.INFO="INFO",e.INVITE="INVITE",e.MESSAGE="MESSAGE",e.NOTIFY="NOTIFY",e.OPTIONS="OPTIONS",e.REGISTER="REGISTER",e.UPDATE="UPDATE",e.SUBSCRIBE="SUBSCRIBE",e.PUBLISH="PUBLISH",e.REFER="REFER",e.PRACK="PRACK"}(m||(m={}));var y={100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"};function b(e,t){void 0===t&&(t=32);for(var n="",r=0;r<e;r++){var o=Math.floor(Math.random()*t);n+=o.toString(t)}return n}function w(e){return y[e]||""}function C(){return b(10)}function S(e){for(var t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},n=e.toLowerCase().replace(/_/g,"-").split("-"),r=n.length,o="",i=0;i<r;i++)0!==i&&(o+="-"),o+=n[i].charAt(0).toUpperCase()+n[i].substring(1);return t[o]&&(o=t[o]),o}function E(e){return encodeURIComponent(e).replace(/%[A-F\d]{2}/g,"U").length}var T=function(){function e(){this.headers={}}return e.prototype.addHeader=function(e,t){var n={raw:t};e=S(e),this.headers[e]?this.headers[e].push(n):this.headers[e]=[n]},e.prototype.getHeader=function(e){var t=this.headers[S(e)];if(t)return t[0]?t[0].raw:void 0},e.prototype.getHeaders=function(e){var t=this.headers[S(e)],n=[];if(!t)return[];for(var r=0,o=t;r<o.length;r++){var i=o[r];n.push(i.raw)}return n},e.prototype.hasHeader=function(e){return!!this.headers[S(e)]},e.prototype.parseHeader=function(e,t){if(void 0===t&&(t=0),e=S(e),this.headers[e]&&!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var o=g.parse(r,e.replace(/-/g,"_"));return-1===o?void this.headers[e].splice(t,1):(n.parsed=o,o)}},e.prototype.s=function(e,t){return void 0===t&&(t=0),this.parseHeader(e,t)},e.prototype.setHeader=function(e,t){this.headers[S(e)]=[{raw:t}]},e.prototype.toString=function(){return this.data},e}(),k=function(e){function t(){return e.call(this)||this}return o(t,e),t}(T),x=function(e){function t(){return e.call(this)||this}return o(t,e),t}(T),N=function(){function e(t,n,r,o,s,a,l){this.headers={},this.extraHeaders=[],this.options=e.getDefaultOptions(),s&&(this.options=i(i({},this.options),s),this.options.optionTags&&this.options.optionTags.length&&(this.options.optionTags=this.options.optionTags.slice()),this.options.routeSet&&this.options.routeSet.length&&(this.options.routeSet=this.options.routeSet.slice())),a&&a.length&&(this.extraHeaders=a.slice()),l&&(this.body={body:l.content,contentType:l.contentType}),this.method=t,this.ruri=n.clone(),this.fromURI=r.clone(),this.fromTag=this.options.fromTag?this.options.fromTag:C(),this.from=e.makeNameAddrHeader(this.fromURI,this.options.fromDisplayName,this.fromTag),this.toURI=o.clone(),this.toTag=this.options.toTag,this.to=e.makeNameAddrHeader(this.toURI,this.options.toDisplayName,this.toTag),this.callId=this.options.callId?this.options.callId:this.options.callIdPrefix+b(15),this.cseq=this.options.cseq,this.setHeader("route",this.options.routeSet),this.setHeader("via",""),this.setHeader("to",this.to.toString()),this.setHeader("from",this.from.toString()),this.setHeader("cseq",this.cseq+" "+this.method),this.setHeader("call-id",this.callId),this.setHeader("max-forwards","70")}return e.getDefaultOptions=function(){return{callId:"",callIdPrefix:"",cseq:1,toDisplayName:"",toTag:"",fromDisplayName:"",fromTag:"",forceRport:!1,hackViaTcp:!1,optionTags:["outbound"],routeSet:[],userAgentString:"sip.js",viaHost:""}},e.makeNameAddrHeader=function(e,t,n){var r={};return n&&(r.tag=n),new u(e,t,r)},e.prototype.getHeader=function(e){var t=this.headers[S(e)];if(t){if(t[0])return t[0]}else for(var n=new RegExp("^\\s*"+e+"\\s*:","i"),r=0,o=this.extraHeaders;r<o.length;r++){var i=o[r];if(n.test(i))return i.substring(i.indexOf(":")+1).trim()}},e.prototype.getHeaders=function(e){var t=[],n=this.headers[S(e)];if(n)for(var r=0,o=n;r<o.length;r++){var i=o[r];t.push(i)}else for(var s=new RegExp("^\\s*"+e+"\\s*:","i"),a=0,l=this.extraHeaders;a<l.length;a++){var c=l[a];s.test(c)&&t.push(c.substring(c.indexOf(":")+1).trim())}return t},e.prototype.hasHeader=function(e){if(this.headers[S(e)])return!0;for(var t=new RegExp("^\\s*"+e+"\\s*:","i"),n=0,r=this.extraHeaders;n<r.length;n++){var o=r[n];if(t.test(o))return!0}return!1},e.prototype.setHeader=function(e,t){this.headers[S(e)]=t instanceof Array?t:[t]},e.prototype.setViaHeader=function(e,t){this.options.hackViaTcp&&(t="TCP");var n="SIP/2.0/"+t;n+=" "+this.options.viaHost+";branch="+e,this.options.forceRport&&(n+=";rport"),this.setHeader("via",n),this.branch=e},e.prototype.toString=function(){var e="";for(var t in e+=this.method+" "+this.ruri.toRaw()+" SIP/2.0\r\n",this.headers)if(this.headers[t])for(var n=0,r=this.headers[t];n<r.length;n++){var o=r[n];e+=t+": "+o+"\r\n"}for(var i=0,s=this.extraHeaders;i<s.length;i++){t=s[i];e+=t.trim()+"\r\n"}return e+="Supported: "+this.options.optionTags.join(", ")+"\r\n",e+="User-Agent: "+this.options.userAgentString+"\r\n",this.body?"string"===typeof this.body?(e+="Content-Length: "+E(this.body)+"\r\n\r\n",e+=this.body):this.body.body&&this.body.contentType?(e+="Content-Type: "+this.body.contentType+"\r\n",e+="Content-Length: "+E(this.body.body)+"\r\n\r\n",e+=this.body.body):e+="Content-Length: 0\r\n\r\n":e+="Content-Length: 0\r\n\r\n",e},e}();function R(e){return"application/sdp"===e?"session":"render"}function I(e){var t="string"===typeof e?e:e.body,n="string"===typeof e?"application/sdp":e.contentType,r=R(n),o={contentDisposition:r,contentType:n,content:t};return o}function _(e){return!(!e||"string"!==typeof e.content||"string"!==typeof e.contentType||void 0!==e.contentDisposition)||"string"===typeof e.contentDisposition}function O(e){var t,n,r;if(e instanceof k&&e.body){var o=e.parseHeader("Content-Disposition");t=o?o.type:void 0,n=e.parseHeader("Content-Type"),r=e.body}if(e instanceof x&&e.body){o=e.parseHeader("Content-Disposition");t=o?o.type:void 0,n=e.parseHeader("Content-Type"),r=e.body}if(e instanceof N&&e.body)if(t=e.getHeader("Content-Disposition"),n=e.getHeader("Content-Type"),"string"===typeof e.body){if(!n)throw new Error("Header content type header does not equal body content type.");r=e.body}else{if(n&&n!==e.body.contentType)throw new Error("Header content type header does not equal body content type.");n=e.body.contentType,r=e.body.body}if(_(e)&&(t=e.contentDisposition,n=e.contentType,r=e.content),r){if(n&&!t&&(t=R(n)),!t)throw new Error("Content disposition undefined.");if(!n)throw new Error("Content type undefined.");return{contentDisposition:t,contentType:n,content:r}}}var A=function(){function e(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return e.hashStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendStr(e).end(t)},e.hashAsciiStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendAsciiStr(e).end(t)},e._hex=function(t){var n,r,o,i,s=e.hexChars,a=e.hexOut;for(i=0;i<4;i+=1)for(r=8*i,n=t[i],o=0;o<8;o+=2)a[r+1+o]=s.charAt(15&n),n>>>=4,a[r+0+o]=s.charAt(15&n),n>>>=4;return a.join("")},e._md5cycle=function(e,t){var n=e[0],r=e[1],o=e[2],i=e[3];n+=(r&o|~r&i)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[1]-389564586|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[2]+606105819|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[5]+1200080426|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[6]-1473231341|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[9]-1958414417|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[10]-42063|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[13]-40341101|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[14]-1502002290|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+o|0,n+=(r&i|o&~i)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[6]-1069501632|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[11]+643717713|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[10]+38016083|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[15]-660478335|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[14]-1019803690|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[3]-187363961|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[2]-51403784|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[7]+1735328473|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+o|0,n+=(r^o^i)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[8]-2022574463|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[11]+1839030562|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[4]+1272893353|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[7]-155497632|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[0]-358537222|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[3]-722521979|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[12]-421815835|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[15]+530742520|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+o|0,n+=(o^(r|~i))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[7]+1126891415|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[14]-1416354905|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[3]-1894986606|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[10]-1051523|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[15]-30611744|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[6]-1560198380|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[11]-1120210379|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[2]+718787259|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+o|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0},e.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this},e.prototype.appendStr=function(t){var n,r,o=this._buffer8,i=this._buffer32,s=this._bufferLength;for(r=0;r<t.length;r+=1){if(n=t.charCodeAt(r),n<128)o[s++]=n;else if(n<2048)o[s++]=192+(n>>>6),o[s++]=63&n|128;else if(n<55296||n>56319)o[s++]=224+(n>>>12),o[s++]=n>>>6&63|128,o[s++]=63&n|128;else{if(n=1024*(n-55296)+(t.charCodeAt(++r)-56320)+65536,n>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");o[s++]=240+(n>>>18),o[s++]=n>>>12&63|128,o[s++]=n>>>6&63|128,o[s++]=63&n|128}s>=64&&(this._dataLength+=64,e._md5cycle(this._state,i),s-=64,i[0]=i[16])}return this._bufferLength=s,this},e.prototype.appendAsciiStr=function(t){for(var n,r=this._buffer8,o=this._buffer32,i=this._bufferLength,s=0;;){n=Math.min(t.length-s,64-i);while(n--)r[i++]=t.charCodeAt(s++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,o),i=0}return this._bufferLength=i,this},e.prototype.appendByteArray=function(t){for(var n,r=this._buffer8,o=this._buffer32,i=this._bufferLength,s=0;;){n=Math.min(t.length-s,64-i);while(n--)r[i++]=t[s++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,o),i=0}return this._bufferLength=i,this},e.prototype.getState=function(){var e=this,t=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[t[0],t[1],t[2],t[3]]}},e.prototype.setState=function(e){var t,n=e.buffer,r=e.state,o=this._state;for(this._dataLength=e.length,this._bufferLength=e.buflen,o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],t=0;t<n.length;t+=1)this._buffer8[t]=n.charCodeAt(t)},e.prototype.end=function(t){void 0===t&&(t=!1);var n,r=this._bufferLength,o=this._buffer8,i=this._buffer32,s=1+(r>>2);if(this._dataLength+=r,o[r]=128,o[r+1]=o[r+2]=o[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),n=8*this._dataLength,n<=4294967295)i[14]=n;else{var a=n.toString(16).match(/(.*?)(.{0,8})$/);if(null===a)return;var l=parseInt(a[2],16),c=parseInt(a[1],16)||0;i[14]=l,i[15]=c}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)},e.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),e.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e.hexChars="0123456789abcdef",e.hexOut=[],e.onePassHasher=new e,e}();function B(e){return A.hashStr(e)}"5d41402abc4b2a76b9719d911017c592"!==A.hashStr("hello")&&console.error("Md5 self test failed.");var D,P=function(){function e(e,t,n,r){this.logger=e.getLogger("sipjs.digestauthentication"),this.username=n,this.password=r,this.ha1=t,this.nc=0,this.ncHex="00000000"}return e.prototype.authenticate=function(e,t,n){if(this.algorithm=t.algorithm,this.realm=t.realm,this.nonce=t.nonce,this.opaque=t.opaque,this.stale=t.stale,this.algorithm){if("MD5"!==this.algorithm)return this.logger.warn("challenge with Digest algorithm different than 'MD5', authentication aborted"),!1}else this.algorithm="MD5";if(!this.realm)return this.logger.warn("challenge without Digest realm, authentication aborted"),!1;if(!this.nonce)return this.logger.warn("challenge without Digest nonce, authentication aborted"),!1;if(t.qop)if(t.qop.indexOf("auth")>-1)this.qop="auth";else{if(!(t.qop.indexOf("auth-int")>-1))return this.logger.warn("challenge without Digest qop different than 'auth' or 'auth-int', authentication aborted"),!1;this.qop="auth-int"}else this.qop=void 0;return this.method=e.method,this.uri=e.ruri,this.cnonce=b(12),this.nc+=1,this.updateNcHex(),4294967296===this.nc&&(this.nc=1,this.ncHex="00000001"),this.calculateResponse(n),!0},e.prototype.toString=function(){var e=[];if(!this.response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm="+this.algorithm),e.push('username="'+this.username+'"'),e.push('realm="'+this.realm+'"'),e.push('nonce="'+this.nonce+'"'),e.push('uri="'+this.uri+'"'),e.push('response="'+this.response+'"'),this.opaque&&e.push('opaque="'+this.opaque+'"'),this.qop&&(e.push("qop="+this.qop),e.push('cnonce="'+this.cnonce+'"'),e.push("nc="+this.ncHex)),"Digest "+e.join(", ")},e.prototype.updateNcHex=function(){var e=Number(this.nc).toString(16);this.ncHex="00000000".substr(0,8-e.length)+e},e.prototype.calculateResponse=function(e){var t,n;t=this.ha1,""!==t&&void 0!==t||(t=B(this.username+":"+this.realm+":"+this.password)),"auth"===this.qop?(n=B(this.method+":"+this.uri),this.response=B(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth:"+n)):"auth-int"===this.qop?(n=B(this.method+":"+this.uri+":"+B(e||"")),this.response=B(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth-int:"+n)):void 0===this.qop&&(n=B(this.method+":"+this.uri),this.response=B(t+":"+this.nonce+":"+n))},e}();function H(e,t){var n="\r\n";if(t.statusCode<100||t.statusCode>699)throw new TypeError("Invalid statusCode: "+t.statusCode);var r=t.reasonPhrase?t.reasonPhrase:w(t.statusCode),o="SIP/2.0 "+t.statusCode+" "+r+n;t.statusCode>=100&&t.statusCode,t.statusCode;var i="From: "+e.getHeader("From")+n,s="Call-ID: "+e.callId+n,a="CSeq: "+e.cseq+" "+e.method+n,l=e.getHeaders("via").reduce((function(e,t){return e+"Via: "+t+n}),""),c="To: "+e.getHeader("to");if(t.statusCode>100&&!e.parseHeader("to").hasParam("tag")){var u=t.toTag;u||(u=C()),c+=";tag="+u}c+=n;var d="";t.supported&&(d="Supported: "+t.supported.join(", ")+n);var p="";t.userAgent&&(p="User-Agent: "+t.userAgent+n);var h="";return t.extraHeaders&&(h=t.extraHeaders.reduce((function(e,t){return e+t.trim()+n}),"")),o+=l,o+=i,o+=c,o+=a,o+=s,o+=d,o+=p,o+=h,t.body?(o+="Content-Type: "+t.body.contentType+n,o+="Content-Length: "+E(t.body.content)+n+n,o+=t.body.content):o+="Content-Length: 0"+n+n,{message:o}}(function(e){function t(e,t){var n=t,r=0,o=0;if(e.substring(n,n+2).match(/(^\r\n)/))return-2;while(0===r){if(o=e.indexOf("\r\n",n),-1===o)return o;!e.substring(o+2,o+4).match(/(^\r\n)/)&&e.charAt(o+2).match(/(^\s+)/)?n=o+2:r=o}return r}function n(e,t,n,r){var o,i=t.indexOf(":",n),s=t.substring(n,i).trim(),a=t.substring(i+1,r).trim();switch(s.toLowerCase()){case"via":case"v":e.addHeader("via",a),1===e.getHeaders("via").length?(o=e.parseHeader("Via"),o&&(e.via=o,e.viaBranch=o.branch)):o=0;break;case"from":case"f":e.setHeader("from",a),o=e.parseHeader("from"),o&&(e.from=o,e.fromTag=o.getParam("tag"));break;case"to":case"t":e.setHeader("to",a),o=e.parseHeader("to"),o&&(e.to=o,e.toTag=o.getParam("tag"));break;case"record-route":if(o=g.parse(a,"Record_Route"),-1===o){o=void 0;break}if(!(o instanceof Array)){o=void 0;break}o.forEach((function(t){e.addHeader("record-route",a.substring(t.position,t.offset)),e.headers["Record-Route"][e.getHeaders("record-route").length-1].parsed=t.parsed}));break;case"call-id":case"i":e.setHeader("call-id",a),o=e.parseHeader("call-id"),o&&(e.callId=a);break;case"contact":case"m":if(o=g.parse(a,"Contact"),-1===o){o=void 0;break}if(!(o instanceof Array)){o=void 0;break}o.forEach((function(t){e.addHeader("contact",a.substring(t.position,t.offset)),e.headers.Contact[e.getHeaders("contact").length-1].parsed=t.parsed}));break;case"content-length":case"l":e.setHeader("content-length",a),o=e.parseHeader("content-length");break;case"content-type":case"c":e.setHeader("content-type",a),o=e.parseHeader("content-type");break;case"cseq":e.setHeader("cseq",a),o=e.parseHeader("cseq"),o&&(e.cseq=o.value),e instanceof x&&(e.method=o.method);break;case"max-forwards":e.setHeader("max-forwards",a),o=e.parseHeader("max-forwards");break;case"www-authenticate":e.setHeader("www-authenticate",a),o=e.parseHeader("www-authenticate");break;case"proxy-authenticate":e.setHeader("proxy-authenticate",a),o=e.parseHeader("proxy-authenticate");break;case"refer-to":case"r":e.setHeader("refer-to",a),o=e.parseHeader("refer-to"),o&&(e.referTo=o);break;default:e.addHeader(s.toLowerCase(),a),o=0}return void 0!==o||{error:"error parsing header '"+s+"'"}}function r(e,r){var o=0,i=e.indexOf("\r\n");if(-1!==i){var s,a=e.substring(0,i),l=g.parse(a,"Request_Response");if(-1!==l){var c;l.status_code?(s=new x,s.statusCode=l.status_code,s.reasonPhrase=l.reason_phrase):(s=new k,s.method=l.method,s.ruri=l.uri),s.data=e,o=i+2;while(1){if(i=t(e,o),-2===i){c=o+2;break}if(-1===i)return void r.error("malformed message");var u=n(s,e,o,i);if(u&&!0!==u)return void r.error(u.error);o=i+2}return s.hasHeader("content-length")?s.body=e.substr(c,Number(s.getHeader("content-length"))):s.body=e.substring(c),s}r.warn('error parsing first line of SIP message: "'+a+'"')}else r.warn("no CRLF found, not a SIP message, discarded")}e.getHeader=t,e.parseHeader=n,e.parseMessage=r})(D||(D={}));var M,j,V=function(){function e(e,t){this.core=e,this.dialogState=t,this.core.dialogs.set(this.id,this)}return e.initialDialogStateForUserAgentClient=function(e,t){var n=!1,r=t.getHeaders("record-route").reverse(),o=t.parseHeader("contact");if(!o)throw new Error("Contact undefined.");if(!(o instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var i=o.uri,s=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=t.toTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");var p=e.from.uri,h=e.to.uri;if(!t.statusCode)throw new Error("Incoming response status code undefined.");var f=t.statusCode<200,g={id:l+c+d,early:f,callId:l,localTag:c,remoteTag:d,localSequenceNumber:s,remoteSequenceNumber:a,localURI:p,remoteURI:h,remoteTarget:i,routeSet:r,secure:n};return g},e.initialDialogStateForUserAgentServer=function(e,t,n){void 0===n&&(n=!1);var r=!1,o=e.getHeaders("record-route"),i=e.parseHeader("contact");if(!i)throw new Error("Contact undefined.");if(!(i instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var s=i.uri,a=e.cseq,l=void 0,c=e.callId,d=t,p=e.fromTag,h=e.from.uri,f=e.to.uri,g={id:c+d+p,early:n,callId:c,localTag:d,remoteTag:p,localSequenceNumber:l,remoteSequenceNumber:a,localURI:f,remoteURI:h,remoteTarget:s,routeSet:o,secure:r};return g},e.prototype.dispose=function(){this.core.dialogs.delete(this.id)},Object.defineProperty(e.prototype,"id",{get:function(){return this.dialogState.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"early",{get:function(){return this.dialogState.early},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"callId",{get:function(){return this.dialogState.callId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTag",{get:function(){return this.dialogState.localTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteTag",{get:function(){return this.dialogState.remoteTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localSequenceNumber",{get:function(){return this.dialogState.localSequenceNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteSequenceNumber",{get:function(){return this.dialogState.remoteSequenceNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localURI",{get:function(){return this.dialogState.localURI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteURI",{get:function(){return this.dialogState.remoteURI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteTarget",{get:function(){return this.dialogState.remoteTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"routeSet",{get:function(){return this.dialogState.routeSet},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secure",{get:function(){return this.dialogState.secure},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgentCore",{get:function(){return this.core},enumerable:!1,configurable:!0}),e.prototype.confirm=function(){this.dialogState.early=!1},e.prototype.receiveRequest=function(e){if(e.method!==m.ACK){if(this.remoteSequenceNumber){if(e.cseq<=this.remoteSequenceNumber)throw new Error("Out of sequence in dialog request. Did you forget to call sequenceGuard()?");this.dialogState.remoteSequenceNumber=e.cseq}this.remoteSequenceNumber||(this.dialogState.remoteSequenceNumber=e.cseq)}},e.prototype.recomputeRouteSet=function(e){this.dialogState.routeSet=e.getHeaders("record-route").reverse()},e.prototype.createOutgoingRequestMessage=function(e,t){var n,r=this.remoteURI,o=this.remoteTag,i=this.localURI,s=this.localTag,a=this.callId;n=t&&t.cseq?t.cseq:this.dialogState.localSequenceNumber?this.dialogState.localSequenceNumber+=1:this.dialogState.localSequenceNumber=1;var l=this.remoteTarget,c=this.routeSet,u=t&&t.extraHeaders,d=t&&t.body,p=this.userAgentCore.makeOutgoingRequestMessage(e,l,i,r,{callId:a,cseq:n,fromTag:s,toTag:o,routeSet:c},u,d);return p},e.prototype.incrementLocalSequenceNumber=function(){if(!this.dialogState.localSequenceNumber)throw new Error("Local sequence number undefined.");this.dialogState.localSequenceNumber+=1},e.prototype.sequenceGuard=function(e){return e.method===m.ACK||(!(this.remoteSequenceNumber&&e.cseq<=this.remoteSequenceNumber)||(this.core.replyStateless(e,{statusCode:500}),!1))},e}();(function(e){e["Initial"]="Initial",e["Early"]="Early",e["AckWait"]="AckWait",e["Confirmed"]="Confirmed",e["Terminated"]="Terminated"})(M||(M={})),function(e){e["Initial"]="Initial",e["HaveLocalOffer"]="HaveLocalOffer",e["HaveRemoteOffer"]="HaveRemoteOffer",e["Stable"]="Stable",e["Closed"]="Closed"}(j||(j={}));var $,L=500,q=4e3,F=5e3,U={T1:L,T2:q,T4:F,TIMER_B:64*L,TIMER_D:0*L,TIMER_F:6*L,TIMER_H:64*L,TIMER_I:0*F,TIMER_J:0*L,TIMER_K:0*F,TIMER_L:64*L,TIMER_M:64*L,TIMER_N:64*L,PROVISIONAL_RESPONSE_INTERVAL:6e4},z=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return o(t,e),t}(Error),K=function(e){function t(t){return e.call(this,t||"Transaction state error.")||this}return o(t,e),t}(z),W=function(e){function t(t){return e.call(this,t||"Unspecified transport error.")||this}return o(t,e),t}(z),G=function(){function e(e,t,n,r,o){this._transport=e,this._user=t,this._id=n,this._state=r,this.listeners=new Array,this.logger=t.loggerFactory.getLogger(o,n),this.logger.debug("Constructing ".concat(this.typeToString()," with id ").concat(this.id,"."))}return e.prototype.dispose=function(){this.logger.debug("Destroyed ".concat(this.typeToString()," with id ").concat(this.id,"."))},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"kind",{get:function(){throw new Error("Invalid kind.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this._transport},enumerable:!1,configurable:!0}),e.prototype.addStateChangeListener=function(e,t){var n=this,r=function(){n.removeStateChangeListener(r),e()};!0===(null===t||void 0===t?void 0:t.once)?this.listeners.push(r):this.listeners.push(e)},e.prototype.notifyStateChangeListeners=function(){this.listeners.slice().forEach((function(e){return e()}))},e.prototype.removeStateChangeListener=function(e){this.listeners=this.listeners.filter((function(t){return t!==e}))},e.prototype.logTransportError=function(e,t){this.logger.error(e.message),this.logger.error("Transport error occurred in ".concat(this.typeToString()," with id ").concat(this.id,".")),this.logger.error(t)},e.prototype.send=function(e){var t=this;return this.transport.send(e).catch((function(e){if(e instanceof W)throw t.onTransportError(e),e;var n;throw n=e&&"string"===typeof e.message?new W(e.message):new W,t.onTransportError(n),n}))},e.prototype.setState=function(e){this.logger.debug('State change to "'.concat(e,'" on ').concat(this.typeToString()," with id ").concat(this.id,".")),this._state=e,this._user.onStateChange&&this._user.onStateChange(e),this.notifyStateChangeListeners()},e.prototype.typeToString=function(){return"UnknownType"},e}(),Y=function(e){function t(n,r,o,i,s){var a=e.call(this,r,o,t.makeId(n),i,s)||this;return a._request=n,a.user=o,n.setViaHeader(a.id,r.protocol),a}return o(t,e),t.makeId=function(e){if("CANCEL"===e.method){if(!e.branch)throw new Error("Outgoing CANCEL request without a branch.");return e.branch}return"z9hG4bK"+Math.floor(1e7*Math.random())},Object.defineProperty(t.prototype,"request",{get:function(){return this._request},enumerable:!1,configurable:!0}),t.prototype.onRequestTimeout=function(){this.user.onRequestTimeout&&this.user.onRequestTimeout()},t}(G);(function(e){e["Accepted"]="Accepted",e["Calling"]="Calling",e["Completed"]="Completed",e["Confirmed"]="Confirmed",e["Proceeding"]="Proceeding",e["Terminated"]="Terminated",e["Trying"]="Trying"})($||($={}));var J=function(e){function t(t,n,r){var o=e.call(this,t,n,r,$.Calling,"sip.transaction.ict")||this;return o.ackRetransmissionCache=new Map,o.B=setTimeout((function(){return o.timerB()}),U.TIMER_B),o.send(t.toString()).catch((function(e){o.logTransportError(e,"Failed to send initial outgoing request.")})),o}return o(t,e),t.prototype.dispose=function(){this.B&&(clearTimeout(this.B),this.B=void 0),this.D&&(clearTimeout(this.D),this.D=void 0),this.M&&(clearTimeout(this.M),this.M=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"ict"},enumerable:!1,configurable:!0}),t.prototype.ackResponse=function(e){var t=this,n=e.toTag;if(!n)throw new Error("To tag undefined.");var r="z9hG4bK"+Math.floor(1e7*Math.random());e.setViaHeader(r,this.transport.protocol),this.ackRetransmissionCache.set(n,e),this.send(e.toString()).catch((function(e){t.logTransportError(e,"Failed to send ACK to 2xx response.")}))},t.prototype.receiveResponse=function(e){var t=this,n=e.statusCode;if(!n||n<100||n>699)throw new Error("Invalid status code ".concat(n));switch(this.state){case $.Calling:if(n>=100&&n<=199)return this.stateTransition($.Proceeding),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=200&&n<=299)return this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition($.Accepted),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=300&&n<=699)return this.stateTransition($.Completed),this.ack(e),void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case $.Proceeding:if(n>=100&&n<=199)return void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=200&&n<=299)return this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition($.Accepted),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=300&&n<=699)return this.stateTransition($.Completed),this.ack(e),void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case $.Accepted:if(n>=200&&n<=299){if(!this.ackRetransmissionCache.has(e.toTag))return this.ackRetransmissionCache.set(e.toTag,void 0),void(this.user.receiveResponse&&this.user.receiveResponse(e));var r=this.ackRetransmissionCache.get(e.toTag);return r?void this.send(r.toString()).catch((function(e){t.logTransportError(e,"Failed to send retransmission of ACK to 2xx response.")})):void 0}break;case $.Completed:if(n>=300&&n<=699)return void this.ack(e);break;case $.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var o="Received unexpected ".concat(n," response while in state ").concat(this.state,".");this.logger.warn(o)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition($.Terminated,!0)},t.prototype.typeToString=function(){return"INVITE client transaction"},t.prototype.ack=function(e){var t=this,n=this.request.ruri,r=this.request.callId,o=this.request.cseq,i=this.request.getHeader("from"),s=e.getHeader("to"),a=this.request.getHeader("via"),l=this.request.getHeader("route");if(!i)throw new Error("From undefined.");if(!s)throw new Error("To undefined.");if(!a)throw new Error("Via undefined.");var c="ACK ".concat(n," SIP/2.0\r\n");l&&(c+="Route: ".concat(l,"\r\n")),c+="Via: ".concat(a,"\r\n"),c+="To: ".concat(s,"\r\n"),c+="From: ".concat(i,"\r\n"),c+="Call-ID: ".concat(r,"\r\n"),c+="CSeq: ".concat(o," ACK\r\n"),c+="Max-Forwards: 70\r\n",c+="Content-Length: 0\r\n\r\n",this.send(c).catch((function(e){t.logTransportError(e,"Failed to send ACK to non-2xx response.")}))},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case $.Calling:r();break;case $.Proceeding:this.state!==$.Calling&&r();break;case $.Accepted:case $.Completed:this.state!==$.Calling&&this.state!==$.Proceeding&&r();break;case $.Terminated:this.state!==$.Calling&&this.state!==$.Accepted&&this.state!==$.Completed&&(t||r());break;default:r()}this.B&&(clearTimeout(this.B),this.B=void 0),$.Proceeding,e===$.Completed&&(this.D=setTimeout((function(){return n.timerD()}),U.TIMER_D)),e===$.Accepted&&(this.M=setTimeout((function(){return n.timerM()}),U.TIMER_M)),e===$.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerA=function(){},t.prototype.timerB=function(){this.logger.debug("Timer B expired for INVITE client transaction ".concat(this.id,".")),this.state===$.Calling&&(this.onRequestTimeout(),this.stateTransition($.Terminated))},t.prototype.timerD=function(){this.logger.debug("Timer D expired for INVITE client transaction ".concat(this.id,".")),this.state===$.Completed&&this.stateTransition($.Terminated)},t.prototype.timerM=function(){this.logger.debug("Timer M expired for INVITE client transaction ".concat(this.id,".")),this.state===$.Accepted&&this.stateTransition($.Terminated)},t}(Y),Z=function(e){function t(t,n,r,o,i){var s=e.call(this,n,r,t.viaBranch,o,i)||this;return s._request=t,s.user=r,s}return o(t,e),Object.defineProperty(t.prototype,"request",{get:function(){return this._request},enumerable:!1,configurable:!0}),t}(G),X=function(e){function t(t,n,r){return e.call(this,t,n,r,$.Proceeding,"sip.transaction.ist")||this}return o(t,e),t.prototype.dispose=function(){this.stopProgressExtensionTimer(),this.H&&(clearTimeout(this.H),this.H=void 0),this.I&&(clearTimeout(this.I),this.I=void 0),this.L&&(clearTimeout(this.L),this.L=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"ist"},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(e){var t=this;switch(this.state){case $.Proceeding:if(e.method===m.INVITE)return void(this.lastProvisionalResponse&&this.send(this.lastProvisionalResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of provisional response.")})));break;case $.Accepted:if(e.method===m.INVITE)return;break;case $.Completed:if(e.method===m.INVITE){if(!this.lastFinalResponse)throw new Error("Last final response undefined.");return void this.send(this.lastFinalResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of final response.")}))}if(e.method===m.ACK)return void this.stateTransition($.Confirmed);break;case $.Confirmed:if(e.method===m.INVITE||e.method===m.ACK)return;break;case $.Terminated:if(e.method===m.INVITE||e.method===m.ACK)return;break;default:throw new Error("Invalid state ".concat(this.state))}var n="INVITE server transaction received unexpected ".concat(e.method," request while in state ").concat(this.state,".");this.logger.warn(n)},t.prototype.receiveResponse=function(e,t){var n=this;if(e<100||e>699)throw new Error("Invalid status code ".concat(e));switch(this.state){case $.Proceeding:if(e>=100&&e<=199)return this.lastProvisionalResponse=t,e>100&&this.startProgressExtensionTimer(),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 1xx response.")}));if(e>=200&&e<=299)return this.lastFinalResponse=t,this.stateTransition($.Accepted),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 2xx response.")}));if(e>=300&&e<=699)return this.lastFinalResponse=t,this.stateTransition($.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send non-2xx final response.")}));break;case $.Accepted:if(e>=200&&e<=299)return void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 2xx response.")}));break;case $.Completed:break;case $.Confirmed:break;case $.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var r="INVITE server transaction received unexpected ".concat(e," response from TU while in state ").concat(this.state,".");throw this.logger.error(r),new Error(r)},t.prototype.retransmitAcceptedResponse=function(){var e=this;this.state===$.Accepted&&this.lastFinalResponse&&this.send(this.lastFinalResponse).catch((function(t){e.logTransportError(t,"Failed to send 2xx response.")}))},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e)},t.prototype.typeToString=function(){return"INVITE server transaction"},t.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t.state," to ").concat(e))};switch(e){case $.Proceeding:n();break;case $.Accepted:case $.Completed:this.state!==$.Proceeding&&n();break;case $.Confirmed:this.state!==$.Completed&&n();break;case $.Terminated:this.state!==$.Accepted&&this.state!==$.Completed&&this.state!==$.Confirmed&&n();break;default:n()}this.stopProgressExtensionTimer(),e===$.Accepted&&(this.L=setTimeout((function(){return t.timerL()}),U.TIMER_L)),e===$.Completed&&(this.H=setTimeout((function(){return t.timerH()}),U.TIMER_H)),e===$.Confirmed&&(this.I=setTimeout((function(){return t.timerI()}),U.TIMER_I)),e===$.Terminated&&this.dispose(),this.setState(e)},t.prototype.startProgressExtensionTimer=function(){var e=this;void 0===this.progressExtensionTimer&&(this.progressExtensionTimer=setInterval((function(){if(e.logger.debug("Progress extension timer expired for INVITE server transaction ".concat(e.id,".")),!e.lastProvisionalResponse)throw new Error("Last provisional response undefined.");e.send(e.lastProvisionalResponse).catch((function(t){e.logTransportError(t,"Failed to send retransmission of provisional response.")}))}),U.PROVISIONAL_RESPONSE_INTERVAL))},t.prototype.stopProgressExtensionTimer=function(){void 0!==this.progressExtensionTimer&&(clearInterval(this.progressExtensionTimer),this.progressExtensionTimer=void 0)},t.prototype.timerG=function(){},t.prototype.timerH=function(){this.logger.debug("Timer H expired for INVITE server transaction ".concat(this.id,".")),this.state===$.Completed&&(this.logger.warn("ACK to negative final response was never received, terminating transaction."),this.stateTransition($.Terminated))},t.prototype.timerI=function(){this.logger.debug("Timer I expired for INVITE server transaction ".concat(this.id,".")),this.stateTransition($.Terminated)},t.prototype.timerL=function(){this.logger.debug("Timer L expired for INVITE server transaction ".concat(this.id,".")),this.state===$.Accepted&&this.stateTransition($.Terminated)},t}(Z),Q=function(e){function t(t,n,r){var o=e.call(this,t,n,r,$.Trying,"sip.transaction.nict")||this;return o.F=setTimeout((function(){return o.timerF()}),U.TIMER_F),o.send(t.toString()).catch((function(e){o.logTransportError(e,"Failed to send initial outgoing request.")})),o}return o(t,e),t.prototype.dispose=function(){this.F&&(clearTimeout(this.F),this.F=void 0),this.K&&(clearTimeout(this.K),this.K=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"nict"},enumerable:!1,configurable:!0}),t.prototype.receiveResponse=function(e){var t=e.statusCode;if(!t||t<100||t>699)throw new Error("Invalid status code ".concat(t));switch(this.state){case $.Trying:if(t>=100&&t<=199)return this.stateTransition($.Proceeding),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(t>=200&&t<=699)return this.stateTransition($.Completed),408===t?void this.onRequestTimeout():void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case $.Proceeding:if(t>=100&&t<=199&&this.user.receiveResponse)return this.user.receiveResponse(e);if(t>=200&&t<=699)return this.stateTransition($.Completed),408===t?void this.onRequestTimeout():void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case $.Completed:return;case $.Terminated:return;default:throw new Error("Invalid state ".concat(this.state))}var n="Non-INVITE client transaction received unexpected ".concat(t," response while in state ").concat(this.state,".");this.logger.warn(n)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition($.Terminated,!0)},t.prototype.typeToString=function(){return"non-INVITE client transaction"},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case $.Trying:r();break;case $.Proceeding:this.state!==$.Trying&&r();break;case $.Completed:this.state!==$.Trying&&this.state!==$.Proceeding&&r();break;case $.Terminated:this.state!==$.Trying&&this.state!==$.Proceeding&&this.state!==$.Completed&&(t||r());break;default:r()}e===$.Completed&&(this.F&&(clearTimeout(this.F),this.F=void 0),this.K=setTimeout((function(){return n.timerK()}),U.TIMER_K)),e===$.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerF=function(){this.logger.debug("Timer F expired for non-INVITE client transaction ".concat(this.id,".")),this.state!==$.Trying&&this.state!==$.Proceeding||(this.onRequestTimeout(),this.stateTransition($.Terminated))},t.prototype.timerK=function(){this.state===$.Completed&&this.stateTransition($.Terminated)},t}(Y),ee=function(e){function t(t,n,r){return e.call(this,t,n,r,$.Trying,"sip.transaction.nist")||this}return o(t,e),t.prototype.dispose=function(){this.J&&(clearTimeout(this.J),this.J=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"nist"},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(e){var t=this;switch(this.state){case $.Trying:break;case $.Proceeding:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of provisional response.")}));break;case $.Completed:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of final response.")}));break;case $.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}},t.prototype.receiveResponse=function(e,t){var n=this;if(e<100||e>699)throw new Error("Invalid status code ".concat(e));if(e>100&&e<=199)throw new Error("Provisional response other than 100 not allowed.");switch(this.state){case $.Trying:if(this.lastResponse=t,e>=100&&e<200)return this.stateTransition($.Proceeding),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send provisional response.")}));if(e>=200&&e<=699)return this.stateTransition($.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send final response.")}));break;case $.Proceeding:if(this.lastResponse=t,e>=200&&e<=699)return this.stateTransition($.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send final response.")}));break;case $.Completed:return;case $.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var r="Non-INVITE server transaction received unexpected ".concat(e," response from TU while in state ").concat(this.state,".");throw this.logger.error(r),new Error(r)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition($.Terminated,!0)},t.prototype.typeToString=function(){return"non-INVITE server transaction"},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case $.Trying:r();break;case $.Proceeding:this.state!==$.Trying&&r();break;case $.Completed:this.state!==$.Trying&&this.state!==$.Proceeding&&r();break;case $.Terminated:this.state!==$.Proceeding&&this.state!==$.Completed&&(t||r());break;default:r()}e===$.Completed&&(this.J=setTimeout((function(){return n.timerJ()}),U.TIMER_J)),e===$.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerJ=function(){this.logger.debug("Timer J expired for NON-INVITE server transaction ".concat(this.id,".")),this.state===$.Completed&&this.stateTransition($.Terminated)},t}(Z),te=function(){function e(e,t,n,r){this.transactionConstructor=e,this.core=t,this.message=n,this.delegate=r,this.challenged=!1,this.stale=!1,this.logger=this.loggerFactory.getLogger("sip.user-agent-client"),this.init()}return e.prototype.dispose=function(){this.transaction.dispose()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.core.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transaction",{get:function(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction},enumerable:!1,configurable:!0}),e.prototype.cancel=function(t,n){var r=this;if(void 0===n&&(n={}),!this.transaction)throw new Error("Transaction undefined.");if(!this.message.to)throw new Error("To undefined.");if(!this.message.from)throw new Error("From undefined.");var o=this.core.makeOutgoingRequestMessage(m.CANCEL,this.message.ruri,this.message.from.uri,this.message.to.uri,{toTag:this.message.toTag,fromTag:this.message.fromTag,callId:this.message.callId,cseq:this.message.cseq},n.extraHeaders);return o.branch=this.message.branch,this.message.headers.Route&&(o.headers.Route=this.message.headers.Route),t&&o.setHeader("Reason",t),this.transaction.state===$.Proceeding?new e(Q,this.core,o):this.transaction.addStateChangeListener((function(){r.transaction&&r.transaction.state===$.Proceeding&&new e(Q,r.core,o)}),{once:!0}),o},e.prototype.authenticationGuard=function(e,t){var n,r,o=e.statusCode;if(!o)throw new Error("Response status code undefined.");if(401!==o&&407!==o)return!0;if(401===o?(n=e.parseHeader("www-authenticate"),r="authorization"):(n=e.parseHeader("proxy-authenticate"),r="proxy-authorization"),!n)return this.logger.warn(o+" with wrong or missing challenge, cannot authenticate"),!0;if(this.challenged&&(this.stale||!0!==n.stale))return this.logger.warn(o+" apparently in authentication loop, cannot authenticate"),!0;if(!this.credentials&&(this.credentials=this.core.configuration.authenticationFactory(),!this.credentials))return this.logger.warn("Unable to obtain credentials, cannot authenticate"),!0;if(!this.credentials.authenticate(this.message,n))return!0;this.challenged=!0,n.stale&&(this.stale=!0);var i=this.message.cseq+=1;return t&&t.localSequenceNumber&&(t.incrementLocalSequenceNumber(),i=this.message.cseq=t.localSequenceNumber),this.message.setHeader("cseq",i+" "+this.message.method),this.message.setHeader(r,this.credentials.toString()),this.init(),!1},e.prototype.onRequestTimeout=function(){this.logger.warn("User agent client request timed out. Generating internal 408 Request Timeout.");var e=new x;e.statusCode=408,e.reasonPhrase="Request Timeout",this.receiveResponse(e)},e.prototype.onTransportError=function(e){this.logger.error(e.message),this.logger.error("User agent client request transport error. Generating internal 503 Service Unavailable.");var t=new x;t.statusCode=503,t.reasonPhrase="Service Unavailable",this.receiveResponse(t)},e.prototype.receiveResponse=function(e){if(this.authenticationGuard(e)){var t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e});break;case/^2[0-9]{2}$/.test(t):this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e});break;case/^3[0-9]{2}$/.test(t):this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error("Invalid status code ".concat(t))}}},e.prototype.init=function(){var e=this,t={loggerFactory:this.loggerFactory,onRequestTimeout:function(){return e.onRequestTimeout()},onStateChange:function(t){t===$.Terminated&&(e.core.userAgentClients.delete(r),n===e._transaction&&e.dispose())},onTransportError:function(t){return e.onTransportError(t)},receiveResponse:function(t){return e.receiveResponse(t)}},n=new this.transactionConstructor(this.message,this.core.transport,t);this._transaction=n;var r=n.id+n.request.method;this.core.userAgentClients.set(r,this)},e}(),ne=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.BYE,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,t.dispose(),o}return o(t,e),t}(te),re=function(){function e(e,t,n,r){this.transactionConstructor=e,this.core=t,this.message=n,this.delegate=r,this.logger=this.loggerFactory.getLogger("sip.user-agent-server"),this.toTag=n.toTag?n.toTag:C(),this.init()}return e.prototype.dispose=function(){this.transaction.dispose()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.core.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transaction",{get:function(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){if(void 0===e&&(e={statusCode:200}),!this.acceptable)throw new K("".concat(this.message.method," not acceptable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<200||t>299)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.progress=function(e){if(void 0===e&&(e={statusCode:180}),!this.progressable)throw new K("".concat(this.message.method," not progressable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<101||t>199)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.redirect=function(e,t){if(void 0===t&&(t={statusCode:302}),!this.redirectable)throw new K("".concat(this.message.method," not redirectable in state ").concat(this.transaction.state,"."));var n=t.statusCode;if(n<300||n>399)throw new TypeError("Invalid statusCode: ".concat(n));var r=new Array;e.forEach((function(e){return r.push("Contact: ".concat(e.toString()))})),t.extraHeaders=(t.extraHeaders||[]).concat(r);var o=this.reply(t);return o},e.prototype.reject=function(e){if(void 0===e&&(e={statusCode:480}),!this.rejectable)throw new K("".concat(this.message.method," not rejectable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<400||t>699)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.trying=function(e){if(!this.tryingable)throw new K("".concat(this.message.method," not tryingable in state ").concat(this.transaction.state,"."));var t=this.reply({statusCode:100});return t},e.prototype.receiveCancel=function(e){this.delegate&&this.delegate.onCancel&&this.delegate.onCancel(e)},Object.defineProperty(e.prototype,"acceptable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===$.Proceeding||this.transaction.state===$.Accepted;if(this.transaction instanceof ee)return this.transaction.state===$.Trying||this.transaction.state===$.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"progressable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===$.Proceeding;if(this.transaction instanceof ee)return!1;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redirectable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===$.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===$.Trying||this.transaction.state===$.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rejectable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===$.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===$.Trying||this.transaction.state===$.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tryingable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===$.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===$.Trying;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),e.prototype.reply=function(e){e.toTag||100===e.statusCode||(e.toTag=this.toTag),e.userAgent=e.userAgent||this.core.configuration.userAgentHeaderFieldValue,e.supported=e.supported||this.core.configuration.supportedOptionTagsResponse;var t=H(this.message,e);return this.transaction.receiveResponse(e.statusCode,t.message),t},e.prototype.init=function(){var e=this,t={loggerFactory:this.loggerFactory,onStateChange:function(t){t===$.Terminated&&(e.core.userAgentServers.delete(r),e.dispose())},onTransportError:function(t){e.logger.error(t.message),e.delegate&&e.delegate.onTransportError?e.delegate.onTransportError(t):e.logger.error("User agent server response transport error.")}},n=new this.transactionConstructor(this.message,this.core.transport,t);this._transaction=n;var r=n.id;this.core.userAgentServers.set(n.id,this)},e}(),oe=function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}return o(t,e),t}(re),ie=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.INFO,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te),se=function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}return o(t,e),t}(re),ae=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te),le=function(e){function t(t,n,r){return e.call(this,ee,t,n,r)||this}return o(t,e),t}(re),ce=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.NOTIFY,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te);function ue(e){return void 0!==e.userAgentCore}var de=function(e){function t(t,n,r){var o=ue(t)?t.userAgentCore:t;return e.call(this,ee,o,n,r)||this}return o(t,e),t}(re),pe=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.PRACK,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,t.signalingStateTransition(i),o}return o(t,e),t}(te),he=function(e){function t(t,n,r){var o=e.call(this,ee,t.userAgentCore,n,r)||this;return t.signalingStateTransition(n),o.dialog=t,o}return o(t,e),t.prototype.accept=function(t){return void 0===t&&(t={statusCode:200}),t.body&&this.dialog.signalingStateTransition(t.body),e.prototype.accept.call(this,t)},t}(re),fe=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.INVITE,r);return o=e.call(this,J,t.userAgentCore,i,n)||this,o.delegate=n,t.signalingStateTransition(i),t.reinviteUserAgentClient=o,o.dialog=t,o}return o(t,e),t.prototype.receiveResponse=function(e){var t=this;if(this.authenticationGuard(e,this.dialog)){var n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(n):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:this.dialog,prack:function(e){throw new Error("Unimplemented.")}});break;case/^2[0-9]{2}$/.test(n):this.dialog.signalingStateTransition(e),this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e,session:this.dialog,ack:function(e){var n=t.dialog.ack(e);return n}});break;case/^3[0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error("Invalid status code ".concat(n))}}},t}(te),ge=function(e){function t(t,n,r){var o=e.call(this,X,t.userAgentCore,n,r)||this;return t.reinviteUserAgentServer=o,o.dialog=t,o}return o(t,e),t.prototype.accept=function(t){void 0===t&&(t={statusCode:200}),t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(this.dialog.routeSet.map((function(e){return"Record-Route: ".concat(e)})));var n=e.prototype.accept.call(this,t),r=this.dialog,o=i(i({},n),{session:r});return t.body&&this.dialog.signalingStateTransition(t.body),this.dialog.reConfirm(),o},t.prototype.progress=function(t){void 0===t&&(t={statusCode:180});var n=e.prototype.progress.call(this,t),r=this.dialog,o=i(i({},n),{session:r});return t.body&&this.dialog.signalingStateTransition(t.body),o},t.prototype.redirect=function(e,t){throw this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,new Error("Unimplemented.")},t.prototype.reject=function(t){return void 0===t&&(t={statusCode:488}),this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,e.prototype.reject.call(this,t)},t}(re),me=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.REFER,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te);function ve(e){return void 0!==e.userAgentCore}var ye,be=function(e){function t(t,n,r){var o=ve(t)?t.userAgentCore:t;return e.call(this,ee,o,n,r)||this}return o(t,e),t}(re),we=function(e){function t(t,n,r,o){var i=e.call(this,n,r)||this;return i.initialTransaction=t,i._signalingState=j.Initial,i.ackWait=!1,i.ackProcessing=!1,i.delegate=o,t instanceof X&&(i.ackWait=!0),i.early||i.start2xxRetransmissionTimer(),i.signalingStateTransition(t.request),i.logger=n.loggerFactory.getLogger("sip.invite-dialog"),i.logger.log("INVITE dialog ".concat(i.id," constructed")),i}return o(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._signalingState=j.Closed,this._offer=void 0,this._answer=void 0,this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.logger.log("INVITE dialog ".concat(this.id," destroyed"))},Object.defineProperty(t.prototype,"sessionState",{get:function(){return this.early?M.Early:this.ackWait?M.AckWait:this._signalingState===j.Closed?M.Terminated:M.Confirmed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"signalingState",{get:function(){return this._signalingState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offer",{get:function(){return this._offer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this._answer},enumerable:!1,configurable:!0}),t.prototype.confirm=function(){this.early&&this.start2xxRetransmissionTimer(),e.prototype.confirm.call(this)},t.prototype.reConfirm=function(){this.reinviteUserAgentServer&&this.startReInvite2xxRetransmissionTimer()},t.prototype.ack=function(e){var t;if(void 0===e&&(e={}),this.logger.log("INVITE dialog ".concat(this.id," sending ACK request")),this.reinviteUserAgentClient){if(!(this.reinviteUserAgentClient.transaction instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");t=this.reinviteUserAgentClient.transaction,this.reinviteUserAgentClient=void 0}else{if(!(this.initialTransaction instanceof J))throw new Error("Initial transaction not instance of InviteClientTransaction.");t=this.initialTransaction}var n=this.createOutgoingRequestMessage(m.ACK,{cseq:t.request.cseq,extraHeaders:e.extraHeaders,body:e.body});return t.ackResponse(n),this.signalingStateTransition(n),{message:n}},t.prototype.bye=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending BYE request")),this.initialTransaction instanceof X){if(this.early)throw new Error("UAS MUST NOT send a BYE on early dialogs.");if(this.ackWait&&this.initialTransaction.state!==$.Terminated)throw new Error("UAS MUST NOT send a BYE on a confirmed dialog until it has received an ACK for its 2xx response or until the server transaction times out.")}return new ne(this,e,t)},t.prototype.info=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending INFO request")),this.early)throw new Error("Dialog not confirmed.");return new ie(this,e,t)},t.prototype.invite=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending INVITE request")),this.early)throw new Error("Dialog not confirmed.");if(this.reinviteUserAgentClient)throw new Error("There is an ongoing re-INVITE client transaction.");if(this.reinviteUserAgentServer)throw new Error("There is an ongoing re-INVITE server transaction.");return new fe(this,e,t)},t.prototype.message=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending MESSAGE request")),this.early)throw new Error("Dialog not confirmed.");var n=this.createOutgoingRequestMessage(m.MESSAGE,t);return new ae(this.core,n,e)},t.prototype.notify=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending NOTIFY request")),this.early)throw new Error("Dialog not confirmed.");return new ce(this,e,t)},t.prototype.prack=function(e,t){return this.logger.log("INVITE dialog ".concat(this.id," sending PRACK request")),new pe(this,e,t)},t.prototype.refer=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending REFER request")),this.early)throw new Error("Dialog not confirmed.");return new me(this,e,t)},t.prototype.receiveRequest=function(t){var n=this;if(this.logger.log("INVITE dialog ".concat(this.id," received ").concat(t.method," request")),t.method!==m.ACK)if(this.sequenceGuard(t)){if(e.prototype.receiveRequest.call(this,t),t.method===m.INVITE){var r=function(){var e=n.ackWait?"waiting for initial ACK":"processing initial ACK";n.logger.warn("INVITE dialog ".concat(n.id," received re-INVITE while ").concat(e));var t="RFC 5407 suggests the following to avoid this race condition... ";t+=" Note: Implementation issues are outside the scope of this document,",t+=" but the following tip is provided for avoiding race conditions of",t+=" this type. The caller can delay sending re-INVITE F6 for some period",t+=" of time (2 seconds, perhaps), after which the caller can reasonably",t+=" assume that its ACK has been received. Implementors can decouple the",t+=" actions of the user (e.g., pressing the hold button) from the actions",t+=" of the protocol (the sending of re-INVITE F6), so that the UA can",t+=" behave like this. In this case, it is the implementor's choice as to",t+=" how long to wait. In most cases, such an implementation may be",t+=" useful to prevent the type of race condition shown in this section.",t+=" This document expresses no preference about whether or not they",t+=" should wait for an ACK to be delivered. After considering the impact",t+=" on user experience, implementors should decide whether or not to wait",t+=" for a while, because the user experience depends on the",t+=" implementation and has no direct bearing on protocol behavior.",n.logger.warn(t)},o=Math.floor(10*Math.random())+1,i=["Retry-After: ".concat(o)];if(this.ackProcessing)return this.core.replyStateless(t,{statusCode:500,extraHeaders:i}),void r();if(this.ackWait&&this.signalingState!==j.Stable)return this.core.replyStateless(t,{statusCode:500,extraHeaders:i}),void r();if(this.reinviteUserAgentServer)return void this.core.replyStateless(t,{statusCode:500,extraHeaders:i});if(this.reinviteUserAgentClient)return void this.core.replyStateless(t,{statusCode:491})}if(t.method===m.INVITE){var s=t.parseHeader("contact");if(!s)throw new Error("Contact undefined.");if(!(s instanceof u))throw new Error("Contact not instance of NameAddrHeader.");this.dialogState.remoteTarget=s.uri}switch(t.method){case m.BYE:var a=new oe(this,t);this.delegate&&this.delegate.onBye?this.delegate.onBye(a):a.accept(),this.dispose();break;case m.INFO:a=new se(this,t);this.delegate&&this.delegate.onInfo?this.delegate.onInfo(a):a.reject({statusCode:469,extraHeaders:["Recv-Info:"]});break;case m.INVITE:a=new ge(this,t);this.signalingStateTransition(t),this.delegate&&this.delegate.onInvite?this.delegate.onInvite(a):a.reject({statusCode:488});break;case m.MESSAGE:a=new le(this.core,t);this.delegate&&this.delegate.onMessage?this.delegate.onMessage(a):a.accept();break;case m.NOTIFY:a=new de(this,t);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(a):a.accept();break;case m.PRACK:a=new he(this,t);this.delegate&&this.delegate.onPrack?this.delegate.onPrack(a):a.accept();break;case m.REFER:a=new be(this,t);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(a):a.reject();break;default:this.logger.log("INVITE dialog ".concat(this.id," received unimplemented ").concat(t.method," request")),this.core.replyStateless(t,{statusCode:501});break}}else this.logger.log("INVITE dialog ".concat(this.id," rejected out of order ").concat(t.method," request."));else{if(this.ackWait){if(this.initialTransaction instanceof J)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));if(this.initialTransaction.request.cseq!==t.cseq)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));this.ackWait=!1}else{if(!this.reinviteUserAgentServer)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));if(this.reinviteUserAgentServer.transaction.request.cseq!==t.cseq)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));this.reinviteUserAgentServer=void 0}if(this.signalingStateTransition(t),this.delegate&&this.delegate.onAck){var l=this.delegate.onAck({message:t});l instanceof Promise&&(this.ackProcessing=!0,l.then((function(){return n.ackProcessing=!1})).catch((function(){return n.ackProcessing=!1})))}}},t.prototype.reliableSequenceGuard=function(e){var t=e.statusCode;if(!t)throw new Error("Status code undefined");if(t>100&&t<200){var n=e.getHeader("require"),r=e.getHeader("rseq"),o=n&&n.includes("100rel")&&r?Number(r):void 0;if(o){if(this.rseq&&this.rseq+1!==o)return!1;this.rseq=this.rseq?this.rseq+1:o}}return!0},t.prototype.signalingStateRollback=function(){this._signalingState!==j.HaveLocalOffer&&this.signalingState!==j.HaveRemoteOffer||this._rollbackOffer&&this._rollbackAnswer&&(this._signalingState=j.Stable,this._offer=this._rollbackOffer,this._answer=this._rollbackAnswer)},t.prototype.signalingStateTransition=function(e){var t=O(e);if(t&&"session"===t.contentDisposition){if(this._signalingState===j.Stable&&(this._rollbackOffer=this._offer,this._rollbackAnswer=this._answer),e instanceof k)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:this._signalingState=j.Stable,this._answer=t;break;case j.HaveRemoteOffer:break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof x)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:this._signalingState=j.Stable,this._answer=t;break;case j.HaveRemoteOffer:break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof N)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:break;case j.HaveRemoteOffer:this._signalingState=j.Stable,this._answer=t;break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(_(e))switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:break;case j.HaveRemoteOffer:this._signalingState=j.Stable,this._answer=t;break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}}},t.prototype.start2xxRetransmissionTimer=function(){var e=this;if(this.initialTransaction instanceof X){var t=this.initialTransaction,n=U.T1,r=function(){e.ackWait?(e.logger.log("No ACK for 2xx response received, attempting retransmission"),t.retransmitAcceptedResponse(),n=Math.min(2*n,U.T2),e.invite2xxTimer=setTimeout(r,n)):e.invite2xxTimer=void 0};this.invite2xxTimer=setTimeout(r,n);var o=function(){t.state===$.Terminated&&(t.removeStateChangeListener(o),e.invite2xxTimer&&(clearTimeout(e.invite2xxTimer),e.invite2xxTimer=void 0),e.ackWait&&(e.delegate&&e.delegate.onAckTimeout?e.delegate.onAckTimeout():e.bye()))};t.addStateChangeListener(o)}},t.prototype.startReInvite2xxRetransmissionTimer=function(){var e=this;if(this.reinviteUserAgentServer&&this.reinviteUserAgentServer.transaction instanceof X){var t=this.reinviteUserAgentServer.transaction,n=U.T1,r=function(){e.reinviteUserAgentServer?(e.logger.log("No ACK for 2xx response received, attempting retransmission"),t.retransmitAcceptedResponse(),n=Math.min(2*n,U.T2),e.invite2xxTimer=setTimeout(r,n)):e.invite2xxTimer=void 0};this.invite2xxTimer=setTimeout(r,n);var o=function(){t.state===$.Terminated&&(t.removeStateChangeListener(o),e.invite2xxTimer&&(clearTimeout(e.invite2xxTimer),e.invite2xxTimer=void 0),e.reinviteUserAgentServer)};t.addStateChangeListener(o)}},t}(V);(function(e){e["Initial"]="Initial",e["NotifyWait"]="NotifyWait",e["Pending"]="Pending",e["Active"]="Active",e["Terminated"]="Terminated"})(ye||(ye={}));var Ce,Se=[m.ACK,m.BYE,m.CANCEL,m.INFO,m.INVITE,m.MESSAGE,m.NOTIFY,m.OPTIONS,m.PRACK,m.REFER,m.REGISTER,m.SUBSCRIBE],Ee=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.SUBSCRIBE,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,o.dialog=t,o}return o(t,e),t.prototype.waitNotifyStop=function(){},t.prototype.receiveResponse=function(t){if(t.statusCode&&t.statusCode>=200&&t.statusCode<300){var n=t.getHeader("Expires");if(n){var r=Number(n);this.dialog.subscriptionExpires>r&&(this.dialog.subscriptionExpires=r)}else this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE")}if(t.statusCode&&t.statusCode>=400&&t.statusCode<700){var o=[404,405,410,416,480,481,482,483,484,485,489,501,604];o.includes(t.statusCode)&&this.dialog.terminate()}e.prototype.receiveResponse.call(this,t)},t}(te),Te=function(e){function t(t,n,r,o,i,s){var a=e.call(this,o,i)||this;return a.delegate=s,a._autoRefresh=!1,a._subscriptionEvent=t,a._subscriptionExpires=n,a._subscriptionExpiresInitial=n,a._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),a._subscriptionRefresh=void 0,a._subscriptionRefreshLastSet=void 0,a._subscriptionState=r,a.logger=o.loggerFactory.getLogger("sip.subscribe-dialog"),a.logger.log("SUBSCRIBE dialog ".concat(a.id," constructed")),a}return o(t,e),t.initialDialogStateForSubscription=function(e,t){var n=!1,r=t.getHeaders("record-route"),o=t.parseHeader("contact");if(!o)throw new Error("Contact undefined.");if(!(o instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var i=o.uri,s=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=t.fromTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");var p=e.from.uri,h=e.to.uri,f=!1,g={id:l+c+d,early:f,callId:l,localTag:c,remoteTag:d,localSequenceNumber:s,remoteSequenceNumber:a,localURI:p,remoteURI:h,remoteTarget:i,routeSet:r,secure:n};return g},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.N&&(clearTimeout(this.N),this.N=void 0),this.refreshTimerClear(),this.logger.log("SUBSCRIBE dialog ".concat(this.id," destroyed"))},Object.defineProperty(t.prototype,"autoRefresh",{get:function(){return this._autoRefresh},set:function(e){this._autoRefresh=!0,this.refreshTimerSet()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionEvent",{get:function(){return this._subscriptionEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionExpires",{get:function(){var e=Math.floor(Date.now()/1e3)-this._subscriptionExpiresLastSet,t=this._subscriptionExpires-e;return Math.max(t,0)},set:function(e){if(e<0)throw new Error("Expires must be greater than or equal to zero.");if(this._subscriptionExpires=e,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this.autoRefresh){var t=this.subscriptionRefresh;(void 0===t||t>=e)&&this.refreshTimerSet()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionExpiresInitial",{get:function(){return this._subscriptionExpiresInitial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionRefresh",{get:function(){if(void 0!==this._subscriptionRefresh&&void 0!==this._subscriptionRefreshLastSet){var e=Math.floor(Date.now()/1e3)-this._subscriptionRefreshLastSet,t=this._subscriptionRefresh-e;return Math.max(t,0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionState",{get:function(){return this._subscriptionState},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(t){if(this.logger.log("SUBSCRIBE dialog ".concat(this.id," received ").concat(t.method," request")),this.sequenceGuard(t))switch(e.prototype.receiveRequest.call(this,t),t.method){case m.NOTIFY:this.onNotify(t);break;default:this.logger.log("SUBSCRIBE dialog ".concat(this.id," received unimplemented ").concat(t.method," request")),this.core.replyStateless(t,{statusCode:501});break}else this.logger.log("SUBSCRIBE dialog ".concat(this.id," rejected out of order ").concat(t.method," request."))},t.prototype.refresh=function(){var e="Allow: "+Se.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: "+this.subscriptionExpiresInitial),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)},t.prototype.subscribe=function(e,t){var n=this;if(void 0===t&&(t={}),this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)throw new Error("Invalid state ".concat(this.subscriptionState,'. May only re-subscribe while in state "pending" or "active".'));this.logger.log("SUBSCRIBE dialog ".concat(this.id," sending SUBSCRIBE request"));var r=new Ee(this,e,t);return this.N&&(clearTimeout(this.N),this.N=void 0),this.N=setTimeout((function(){return n.timerN()}),U.TIMER_N),r},t.prototype.terminate=function(){this.stateTransition(ye.Terminated),this.onTerminated()},t.prototype.unsubscribe=function(){var e="Allow: "+Se.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: 0"),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)},t.prototype.onNotify=function(e){var t=e.parseHeader("Event").event;if(t&&t===this.subscriptionEvent){this.N&&(clearTimeout(this.N),this.N=void 0);var n=e.parseHeader("Subscription-State");if(n&&n.state){var r=n.state,o=n.expires?Math.max(n.expires,0):void 0;switch(r){case"pending":this.stateTransition(ye.Pending,o);break;case"active":this.stateTransition(ye.Active,o);break;case"terminated":this.stateTransition(ye.Terminated,o);break;default:this.logger.warn("Unrecognized subscription state.");break}var i=new de(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(i):i.accept()}else this.core.replyStateless(e,{statusCode:489})}else this.core.replyStateless(e,{statusCode:489})},t.prototype.onRefresh=function(e){this.delegate&&this.delegate.onRefresh&&this.delegate.onRefresh(e)},t.prototype.onTerminated=function(){this.delegate&&this.delegate.onTerminated&&this.delegate.onTerminated()},t.prototype.refreshTimerClear=function(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)},t.prototype.refreshTimerSet=function(){var e=this;if(this.refreshTimerClear(),this.autoRefresh&&this.subscriptionExpires>0){var t=900*this.subscriptionExpires;this._subscriptionRefresh=Math.floor(t/1e3),this._subscriptionRefreshLastSet=Math.floor(Date.now()/1e3),this.refreshTimer=setTimeout((function(){e.refreshTimer=void 0,e._subscriptionRefresh=void 0,e._subscriptionRefreshLastSet=void 0,e.onRefresh(e.refresh())}),t)}},t.prototype.stateTransition=function(e,t){var n=this,r=function(){n.logger.warn("Invalid subscription state transition from ".concat(n.subscriptionState," to ").concat(e))};switch(e){case ye.Initial:return void r();case ye.NotifyWait:return void r();case ye.Pending:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending)return void r();break;case ye.Active:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)return void r();break;case ye.Terminated:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)return void r();break;default:return void r()}e===ye.Pending&&t&&(this.subscriptionExpires=t),e===ye.Active&&t&&(this.subscriptionExpires=t),e===ye.Terminated&&this.dispose(),this._subscriptionState=e},t.prototype.timerN=function(){this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."),this.subscriptionState!==ye.Terminated&&(this.stateTransition(ye.Terminated),this.onTerminated())},t}(V);(function(e){e[e["error"]=0]="error",e[e["warn"]=1]="warn",e[e["log"]=2]="log",e[e["debug"]=3]="debug"})(Ce||(Ce={}));var ke=function(){function e(e,t,n){this.logger=e,this.category=t,this.label=n}return e.prototype.error=function(e){this.genericLog(Ce.error,e)},e.prototype.warn=function(e){this.genericLog(Ce.warn,e)},e.prototype.log=function(e){this.genericLog(Ce.log,e)},e.prototype.debug=function(e){this.genericLog(Ce.debug,e)},e.prototype.genericLog=function(e,t){this.logger.genericLog(e,this.category,this.label,t)},Object.defineProperty(e.prototype,"level",{get:function(){return this.logger.level},set:function(e){this.logger.level=e},enumerable:!1,configurable:!0}),e}(),xe=function(){function e(){this.builtinEnabled=!0,this._level=Ce.log,this.loggers={},this.logger=this.getLogger("sip:loggerfactory")}return Object.defineProperty(e.prototype,"level",{get:function(){return this._level},set:function(e){e>=0&&e<=3?this._level=e:e>3?this._level=3:Ce.hasOwnProperty(e)?this._level=e:this.logger.error("invalid 'level' parameter value: "+JSON.stringify(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connector",{get:function(){return this._connector},set:function(e){e?"function"===typeof e?this._connector=e:this.logger.error("invalid 'connector' parameter value: "+JSON.stringify(e)):this._connector=void 0},enumerable:!1,configurable:!0}),e.prototype.getLogger=function(e,t){if(t&&3===this.level)return new ke(this,e,t);if(this.loggers[e])return this.loggers[e];var n=new ke(this,e);return this.loggers[e]=n,n},e.prototype.genericLog=function(e,t,n,r){this.level>=e&&this.builtinEnabled&&this.print(e,t,n,r),this.connector&&this.connector(Ce[e],t,n,r)},e.prototype.print=function(e,t,n,r){if("string"===typeof r){var o=[new Date,t];n&&o.push(n),r=o.concat(r).join(" | ")}switch(e){case Ce.error:console.error(r);break;case Ce.warn:console.warn(r);break;case Ce.log:console.log(r);break;case Ce.debug:console.debug(r);break}},e}();(function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}o(t,e)})(te);var Ne=function(e){function t(t,n,r){var o=e.call(this,J,t,n,r)||this;return o.confirmedDialogAcks=new Map,o.confirmedDialogs=new Map,o.earlyDialogs=new Map,o.delegate=r,o}return o(t,e),t.prototype.dispose=function(){this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),e.prototype.dispose.call(this)},t.prototype.onTransportError=function(t){if(this.transaction.state===$.Calling)return e.prototype.onTransportError.call(this,t);this.logger.error(t.message),this.logger.error("User agent client request transport error while sending ACK.")},t.prototype.receiveResponse=function(e){var t=this;if(this.authenticationGuard(e)){var n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):return void(this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e}));case/^1[0-9]{2}$/.test(n):if(!e.toTag)return void this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");var r=e.parseHeader("contact");if(!r)return void this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");var o=V.initialDialogStateForUserAgentClient(this.message,e),i=this.earlyDialogs.get(o.id);if(!i){var s=this.transaction;if(!(s instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");i=new we(s,this.core,o),this.earlyDialogs.set(i.id,i)}if(!i.reliableSequenceGuard(e))return void this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");i.signalingState!==j.Initial&&i.signalingState!==j.HaveLocalOffer||i.signalingStateTransition(e);var a=i;return void(this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:a,prack:function(e){var t=a.prack(void 0,e);return t}}));case/^2[0-9]{2}$/.test(n):if(!e.toTag)return void this.logger.error("2xx INVITE response received without a to tag, dropping.");r=e.parseHeader("contact");if(!r)return void this.logger.error("2xx INVITE response received without a Contact header field, dropping.");o=V.initialDialogStateForUserAgentClient(this.message,e);var l=this.confirmedDialogs.get(o.id);if(l){var c=this.confirmedDialogAcks.get(o.id);if(c){s=this.transaction;if(!(s instanceof J))throw new Error("Client transaction not instance of InviteClientTransaction.");s.ackResponse(c.message)}return}if(l=this.earlyDialogs.get(o.id),l)l.confirm(),l.recomputeRouteSet(e),this.earlyDialogs.delete(l.id),this.confirmedDialogs.set(l.id,l);else{s=this.transaction;if(!(s instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");l=new we(s,this.core,o),this.confirmedDialogs.set(l.id,l)}l.signalingState!==j.Initial&&l.signalingState!==j.HaveLocalOffer||l.signalingStateTransition(e);var u=l;if(this.delegate&&this.delegate.onAccept)this.delegate.onAccept({message:e,session:u,ack:function(e){var n=u.ack(e);return t.confirmedDialogAcks.set(u.id,n),n}});else{c=u.ack();this.confirmedDialogAcks.set(u.id,c)}return;case/^3[0-9]{2}$/.test(n):return this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),void(this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e}));case/^[4-6][0-9]{2}$/.test(n):return this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),void(this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e}));default:throw new Error("Invalid status code ".concat(n))}}},t}(te),Re=function(e){function t(t,n,r){var o=e.call(this,X,t,n,r)||this;return o.core=t,o}return o(t,e),t.prototype.dispose=function(){this.earlyDialog&&this.earlyDialog.dispose(),e.prototype.dispose.call(this)},t.prototype.accept=function(t){if(void 0===t&&(t={statusCode:200}),!this.acceptable)throw new K("".concat(this.message.method," not acceptable in state ").concat(this.transaction.state,"."));if(!this.confirmedDialog)if(this.earlyDialog)this.earlyDialog.confirm(),this.confirmedDialog=this.earlyDialog,this.earlyDialog=void 0;else{var n=this.transaction;if(!(n instanceof X))throw new Error("Transaction not instance of InviteClientTransaction.");var r=V.initialDialogStateForUserAgentServer(this.message,this.toTag);this.confirmedDialog=new we(n,this.core,r)}var o=this.message.getHeaders("record-route").map((function(e){return"Record-Route: ".concat(e)})),s="Contact: ".concat(this.core.configuration.contact.toString()),a="Allow: "+Se.toString();if(!t.body)if(this.confirmedDialog.signalingState===j.Stable)t.body=this.confirmedDialog.answer;else if(this.confirmedDialog.signalingState===j.Initial||this.confirmedDialog.signalingState===j.HaveRemoteOffer)throw new Error("Response must have a body.");t.statusCode=t.statusCode||200,t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(o),t.extraHeaders.push(a),t.extraHeaders.push(s);var l=e.prototype.accept.call(this,t),c=this.confirmedDialog,u=i(i({},l),{session:c});return t.body&&this.confirmedDialog.signalingState!==j.Stable&&this.confirmedDialog.signalingStateTransition(t.body),u},t.prototype.progress=function(t){if(void 0===t&&(t={statusCode:180}),!this.progressable)throw new K("".concat(this.message.method," not progressable in state ").concat(this.transaction.state,"."));if(!this.earlyDialog){var n=this.transaction;if(!(n instanceof X))throw new Error("Transaction not instance of InviteClientTransaction.");var r=V.initialDialogStateForUserAgentServer(this.message,this.toTag,!0);this.earlyDialog=new we(n,this.core,r)}var o=this.message.getHeaders("record-route").map((function(e){return"Record-Route: ".concat(e)})),s="Contact: ".concat(this.core.configuration.contact);t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(o),t.extraHeaders.push(s);var a=e.prototype.progress.call(this,t),l=this.earlyDialog,c=i(i({},a),{session:l});return t.body&&this.earlyDialog.signalingState!==j.Stable&&this.earlyDialog.signalingStateTransition(t.body),c},t.prototype.redirect=function(t,n){return void 0===n&&(n={statusCode:302}),e.prototype.redirect.call(this,t,n)},t.prototype.reject=function(t){return void 0===t&&(t={statusCode:486}),e.prototype.reject.call(this,t)},t}(re),Ie=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te);(function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}o(t,e)})(re);var _e,Oe=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te),Ae=function(e){function t(t,n,r){var o=e.call(this,ee,t,n,r)||this;return o.core=t,o}return o(t,e),t}(re),Be=function(e){function t(t,n,r){var o=this,i=n.getHeader("Event");if(!i)throw new Error("Event undefined");var s=n.getHeader("Expires");if(!s)throw new Error("Expires undefined");return o=e.call(this,Q,t,n,r)||this,o.delegate=r,o.subscriberId=n.callId+n.fromTag+i,o.subscriptionExpiresRequested=o.subscriptionExpires=Number(s),o.subscriptionEvent=i,o.subscriptionState=ye.NotifyWait,o.waitNotifyStart(),o}return o(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onNotify=function(e){var t=e.message.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent)return this.logger.warn("Failed to parse event."),void e.reject({statusCode:489});var n=e.message.parseHeader("Subscription-State");if(!n||!n.state)return this.logger.warn("Failed to parse subscription state."),void e.reject({statusCode:489});var r=n.state;switch(r){case"pending":break;case"active":break;case"terminated":break;default:return this.logger.warn("Invalid subscription state ".concat(r)),void e.reject({statusCode:489})}if("terminated"!==r){var o=e.message.parseHeader("contact");if(!o)return this.logger.warn("Failed to parse contact."),void e.reject({statusCode:489})}if(this.dialog)throw new Error("Dialog already created. This implementation only supports install of single subscriptions.");switch(this.waitNotifyStop(),this.subscriptionExpires=n.expires?Math.min(this.subscriptionExpires,Math.max(n.expires,0)):this.subscriptionExpires,r){case"pending":this.subscriptionState=ye.Pending;break;case"active":this.subscriptionState=ye.Active;break;case"terminated":this.subscriptionState=ye.Terminated;break;default:throw new Error("Unrecognized state ".concat(r,"."))}if(this.subscriptionState!==ye.Terminated){var i=Te.initialDialogStateForSubscription(this.message,e.message);this.dialog=new Te(this.subscriptionEvent,this.subscriptionExpires,this.subscriptionState,this.core,i)}if(this.delegate&&this.delegate.onNotify){var s=e,a=this.dialog;this.delegate.onNotify({request:s,subscription:a})}else e.accept()},t.prototype.waitNotifyStart=function(){var e=this;this.N||(this.core.subscribers.set(this.subscriberId,this),this.N=setTimeout((function(){return e.timerN()}),U.TIMER_N))},t.prototype.waitNotifyStop=function(){this.N&&(this.core.subscribers.delete(this.subscriberId),clearTimeout(this.N),this.N=void 0)},t.prototype.receiveResponse=function(t){if(this.authenticationGuard(t)){if(t.statusCode&&t.statusCode>=200&&t.statusCode<300){var n=t.getHeader("Expires");if(n){var r=Number(n);r>this.subscriptionExpiresRequested&&this.logger.warn("Expires header in a 200-class response to SUBSCRIBE with a higher value than the one in the request"),r<this.subscriptionExpires&&(this.subscriptionExpires=r)}else this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");this.dialog&&this.dialog.subscriptionExpires>this.subscriptionExpires&&(this.dialog.subscriptionExpires=this.subscriptionExpires)}t.statusCode&&t.statusCode>=300&&t.statusCode<700&&this.waitNotifyStop(),e.prototype.receiveResponse.call(this,t)}},t.prototype.timerN=function(){this.logger.warn("Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY."),this.waitNotifyStop(),this.delegate&&this.delegate.onNotifyTimeout&&this.delegate.onNotifyTimeout()},t}(te),De=function(e){function t(t,n,r){var o=e.call(this,ee,t,n,r)||this;return o.core=t,o}return o(t,e),t}(re),Pe=["application/sdp","application/dtmf-relay"],He=function(){function e(e,t){void 0===t&&(t={}),this.userAgentClients=new Map,this.userAgentServers=new Map,this.configuration=e,this.delegate=t,this.dialogs=new Map,this.subscribers=new Map,this.logger=e.loggerFactory.getLogger("sip.user-agent-core")}return e.prototype.dispose=function(){this.reset()},e.prototype.reset=function(){this.dialogs.forEach((function(e){return e.dispose()})),this.dialogs.clear(),this.subscribers.forEach((function(e){return e.dispose()})),this.subscribers.clear(),this.userAgentClients.forEach((function(e){return e.dispose()})),this.userAgentClients.clear(),this.userAgentServers.forEach((function(e){return e.dispose()})),this.userAgentServers.clear()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.configuration.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){var e=this.configuration.transportAccessor();if(!e)throw new Error("Transport undefined.");return e},enumerable:!1,configurable:!0}),e.prototype.invite=function(e,t){return new Ne(this,e,t)},e.prototype.message=function(e,t){return new ae(this,e,t)},e.prototype.publish=function(e,t){return new Ie(this,e,t)},e.prototype.register=function(e,t){return new Oe(this,e,t)},e.prototype.subscribe=function(e,t){return new Be(this,e,t)},e.prototype.request=function(e,t){return new te(Q,this,e,t)},e.prototype.makeOutgoingRequestMessage=function(e,t,n,r,o,s,a){var l=this.configuration.sipjsId,c=this.configuration.displayName,u=this.configuration.viaForceRport,d=this.configuration.hackViaTcp,p=this.configuration.supportedOptionTags.slice();e===m.REGISTER&&p.push("path","gruu"),e===m.INVITE&&(this.configuration.contact.pubGruu||this.configuration.contact.tempGruu)&&p.push("gruu");var h=this.configuration.routeSet,f=this.configuration.userAgentHeaderFieldValue,g=this.configuration.viaHost,v={callIdPrefix:l,forceRport:u,fromDisplayName:c,hackViaTcp:d,optionTags:p,routeSet:h,userAgentString:f,viaHost:g},y=i(i({},v),o);return new N(e,t,n,r,y,s,a)},e.prototype.receiveIncomingRequestFromTransport=function(e){this.receiveRequestFromTransport(e)},e.prototype.receiveIncomingResponseFromTransport=function(e){this.receiveResponseFromTransport(e)},e.prototype.replyStateless=function(e,t){var n=this,r=this.configuration.userAgentHeaderFieldValue,o=this.configuration.supportedOptionTagsResponse;t=i(i({},t),{userAgent:r,supported:o});var s=H(e,t);return this.transport.send(s.message).catch((function(t){t instanceof Error&&n.logger.error(t.message),n.logger.error("Transport error occurred sending stateless reply to ".concat(e.method," request."))})),s},e.prototype.receiveRequestFromTransport=function(e){var t=e.viaBranch,n=this.userAgentServers.get(t);e.method===m.ACK&&n&&n.transaction.state===$.Accepted&&n instanceof Re?this.logger.warn("Discarding out of dialog ACK after 2xx response sent on transaction ".concat(t,".")):e.method!==m.CANCEL?n?n.transaction.receiveRequest(e):this.receiveRequest(e):n?(this.replyStateless(e,{statusCode:200}),n.transaction instanceof X&&n.transaction.state===$.Proceeding&&n instanceof Re&&n.receiveCancel(e)):this.replyStateless(e,{statusCode:481})},e.prototype.receiveRequest=function(e){if(Se.includes(e.method)){if(!e.ruri)throw new Error("Request-URI undefined.");if("sip"===e.ruri.scheme){var t=e.ruri,n=function(e){return!!e&&e.user===t.user};if(!n(this.configuration.aor)&&!(n(this.configuration.contact.uri)||n(this.configuration.contact.pubGruu)||n(this.configuration.contact.tempGruu)))return this.logger.warn("Request-URI does not point to us."),void(e.method!==m.ACK&&this.replyStateless(e,{statusCode:404}));if(e.method!==m.INVITE||e.hasHeader("Contact")){if(!e.toTag){var r=e.viaBranch;if(!this.userAgentServers.has(r)){var o=Array.from(this.userAgentServers.values()).some((function(t){return t.transaction.request.fromTag===e.fromTag&&t.transaction.request.callId===e.callId&&t.transaction.request.cseq===e.cseq}));if(o)return void this.replyStateless(e,{statusCode:482})}}e.toTag?this.receiveInsideDialogRequest(e):this.receiveOutsideDialogRequest(e)}else this.replyStateless(e,{statusCode:400,reasonPhrase:"Missing Contact Header"})}else this.replyStateless(e,{statusCode:416})}else{var i="Allow: "+Se.toString();this.replyStateless(e,{statusCode:405,extraHeaders:[i]})}},e.prototype.receiveInsideDialogRequest=function(e){if(e.method===m.NOTIFY){var t=e.parseHeader("Event");if(!t||!t.event)return void this.replyStateless(e,{statusCode:489});var n=e.callId+e.toTag+t.event,r=this.subscribers.get(n);if(r){var o=new de(this,e);return void r.onNotify(o)}}var i=e.callId+e.toTag+e.fromTag,s=this.dialogs.get(i);if(s){if(e.method===m.OPTIONS){var a="Allow: "+Se.toString(),l="Accept: "+Pe.toString();return void this.replyStateless(e,{statusCode:200,extraHeaders:[a,l]})}s.receiveRequest(e)}else e.method!==m.ACK&&this.replyStateless(e,{statusCode:481})},e.prototype.receiveOutsideDialogRequest=function(e){switch(e.method){case m.ACK:break;case m.BYE:this.replyStateless(e,{statusCode:481});break;case m.CANCEL:throw new Error("Unexpected out of dialog request method ".concat(e.method,"."));case m.INFO:this.replyStateless(e,{statusCode:405});break;case m.INVITE:var t=new Re(this,e);this.delegate.onInvite?this.delegate.onInvite(t):t.reject();break;case m.MESSAGE:t=new le(this,e);this.delegate.onMessage?this.delegate.onMessage(t):t.accept();break;case m.NOTIFY:t=new de(this,e);this.delegate.onNotify?this.delegate.onNotify(t):t.reject({statusCode:405});break;case m.OPTIONS:var n="Allow: "+Se.toString(),r="Accept: "+Pe.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[n,r]});break;case m.REFER:t=new be(this,e);this.delegate.onRefer?this.delegate.onRefer(t):t.reject({statusCode:405});break;case m.REGISTER:t=new Ae(this,e);this.delegate.onRegister?this.delegate.onRegister(t):t.reject({statusCode:405});break;case m.SUBSCRIBE:t=new De(this,e);this.delegate.onSubscribe?this.delegate.onSubscribe(t):t.reject({statusCode:480});break;default:throw new Error("Unexpected out of dialog request method ".concat(e.method,"."))}},e.prototype.receiveResponseFromTransport=function(e){if(e.getHeaders("via").length>1)this.logger.warn("More than one Via header field present in the response, dropping");else{var t=e.viaBranch+e.method,n=this.userAgentClients.get(t);n?n.transaction.receiveResponse(e):this.logger.warn("Discarding unmatched ".concat(e.statusCode," response to ").concat(e.method," ").concat(t,"."))}},e}(),Me=function(e){function t(t){return e.call(this,t||"Unsupported content type.")||this}return o(t,e),t}(z),je=function(e){function t(t){return e.call(this,t||"Request pending.")||this}return o(t,e),t}(z),Ve=function(e){function t(t){return e.call(this,t||"Unspecified session description handler error.")||this}return o(t,e),t}(z),$e=function(e){function t(){return e.call(this,"The session has terminated.")||this}return o(t,e),t}(z),Le=function(e){function t(t){return e.call(this,t||"An error occurred during state transition.")||this}return o(t,e),t}(z),qe=function(){function e(e){this.incomingAckRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingAckRequest.message},enumerable:!1,configurable:!0}),e}(),Fe=function(){function e(e){this.incomingByeRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingByeRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingByeRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingByeRequest.reject(e),Promise.resolve()},e}(),Ue=function(){function e(){this.listeners=new Array}return e.prototype.addListener=function(e,t){var n=this,r=function(t){n.removeListener(r),e(t)};!0===(null===t||void 0===t?void 0:t.once)?this.listeners.push(r):this.listeners.push(e)},e.prototype.emit=function(e){this.listeners.slice().forEach((function(t){return t(e)}))},e.prototype.removeAllListeners=function(){this.listeners=[]},e.prototype.removeListener=function(e){this.listeners=this.listeners.filter((function(t){return t!==e}))},e.prototype.on=function(e){return this.addListener(e)},e.prototype.off=function(e){return this.removeListener(e)},e.prototype.once=function(e){return this.addListener(e,{once:!0})},e}(),ze=function(){function e(e){this.incomingInfoRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingInfoRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingInfoRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingInfoRequest.reject(e),Promise.resolve()},e}(),Ke=function(){function e(e){this.incomingMessageRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingMessageRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingMessageRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingMessageRequest.reject(e),Promise.resolve()},e}(),We=function(){function e(e){this.incomingNotifyRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingNotifyRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingNotifyRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingNotifyRequest.reject(e),Promise.resolve()},e}(),Ge=function(){function e(e,t){this.incomingReferRequest=e,this.session=t}return Object.defineProperty(e.prototype,"referTo",{get:function(){var e=this.incomingReferRequest.message.parseHeader("refer-to");if(!(e instanceof u))throw new Error("Failed to parse Refer-To header.");return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"referredBy",{get:function(){return this.incomingReferRequest.message.getHeader("referred-by")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"replaces",{get:function(){var e=this.referTo.uri.getHeader("replaces");return e instanceof Array?e[0]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingReferRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return void 0===e&&(e={statusCode:202}),this.incomingReferRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingReferRequest.reject(e),Promise.resolve()},e.prototype.makeInviter=function(e){if(this.inviter)return this.inviter;var t=this.referTo.uri.clone();t.clearHeaders(),e=e||{};var n=(e.extraHeaders||[]).slice(),r=this.replaces;r&&n.push("Replaces: "+decodeURIComponent(r));var o=this.referredBy;return o&&n.push("Referred-By: "+o),e.extraHeaders=n,this.inviter=this.session.userAgent._makeInviter(t,e),this.inviter._referred=this.session,this.session._referral=this.inviter,this.inviter},e}();(function(e){e["Initial"]="Initial",e["Establishing"]="Establishing",e["Established"]="Established",e["Terminating"]="Terminating",e["Terminated"]="Terminated"})(_e||(_e={}));var Ye,Je=function(){function e(e,t){void 0===t&&(t={}),this.pendingReinvite=!1,this.pendingReinviteAck=!1,this._state=_e.Initial,this.delegate=t.delegate,this._stateEventEmitter=new Ue,this._userAgent=e}return e.prototype.dispose=function(){var e=this;switch(this.logger.log("Session ".concat(this.id," in state ").concat(this._state," is being disposed")),delete this.userAgent._sessions[this.id],this._sessionDescriptionHandler&&this._sessionDescriptionHandler.close(),this.state){case _e.Initial:break;case _e.Establishing:break;case _e.Established:return new Promise((function(t){e._bye({onAccept:function(){return t()},onRedirect:function(){return t()},onReject:function(){return t()}})}));case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown state.")}return Promise.resolve()},Object.defineProperty(e.prototype,"assertedIdentity",{get:function(){return this._assertedIdentity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return this._dialog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"replacee",{get:function(){return this._replacee},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandler",{get:function(){return this._sessionDescriptionHandler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerFactory",{get:function(){return this.userAgent.configuration.sessionDescriptionHandlerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerModifiers",{get:function(){return this._sessionDescriptionHandlerModifiers||[]},set:function(e){this._sessionDescriptionHandlerModifiers=e.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerOptions",{get:function(){return this._sessionDescriptionHandlerOptions||{}},set:function(e){this._sessionDescriptionHandlerOptions=i({},e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerModifiersReInvite",{get:function(){return this._sessionDescriptionHandlerModifiersReInvite||[]},set:function(e){this._sessionDescriptionHandlerModifiersReInvite=e.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerOptionsReInvite",{get:function(){return this._sessionDescriptionHandlerOptionsReInvite||{}},set:function(e){this._sessionDescriptionHandlerOptionsReInvite=i({},e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgent",{get:function(){return this._userAgent},enumerable:!1,configurable:!0}),e.prototype.bye=function(e){void 0===e&&(e={});var t="Session.bye() may only be called if established session.";switch(this.state){case _e.Initial:"function"===typeof this.cancel?(t+=" However Inviter.invite() has not yet been called.",t+=" Perhaps you should have called Inviter.cancel()?"):"function"===typeof this.reject&&(t+=" However Invitation.accept() has not yet been called.",t+=" Perhaps you should have called Invitation.reject()?");break;case _e.Establishing:"function"===typeof this.cancel?(t+=" However a dialog does not yet exist.",t+=" Perhaps you should have called Inviter.cancel()?"):"function"===typeof this.reject&&(t+=" However Invitation.accept() has not yet been called (or not yet resolved).",t+=" Perhaps you should have called Invitation.reject()?");break;case _e.Established:var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._bye(n,r);case _e.Terminating:t+=" However this session is already terminating.","function"===typeof this.cancel?t+=" Perhaps you have already called Inviter.cancel()?":"function"===typeof this.reject&&(t+=" Perhaps you have already called Session.bye()?");break;case _e.Terminated:t+=" However this session is already terminated.";break;default:throw new Error("Unknown state")}return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))},e.prototype.info=function(e){if(void 0===e&&(e={}),this.state!==_e.Established){var t="Session.info() may only be called if established session.";return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._info(n,r)},e.prototype.invite=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Session.invite"),this.state!==_e.Established)return Promise.reject(new Error("Invalid session state ".concat(this.state)));if(this.pendingReinvite)return Promise.reject(new je("Reinvite in progress. Please wait until complete, then try again."));this.pendingReinvite=!0,e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiersReInvite=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptionsReInvite=e.sessionDescriptionHandlerOptions);var n={onAccept:function(n){var r=O(n.message);if(!r)return t.logger.error("Received 2xx response to re-INVITE without a session description"),t.ackAndBye(n,400,"Missing session description"),t.stateTransition(_e.Terminated),void(t.pendingReinvite=!1);if(e.withoutSdp){var o={sessionDescriptionHandlerOptions:t.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:t.sessionDescriptionHandlerModifiersReInvite};t.setOfferAndGetAnswer(r,o).then((function(e){n.ack({body:e})})).catch((function(e){t.logger.error("Failed to handle offer in 2xx response to re-INVITE"),t.logger.error(e.message),t.state===_e.Terminated?n.ack():(t.ackAndBye(n,488,"Bad Media Description"),t.stateTransition(_e.Terminated))})).then((function(){t.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)}))}else{o={sessionDescriptionHandlerOptions:t.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:t.sessionDescriptionHandlerModifiersReInvite};t.setAnswer(r,o).then((function(){n.ack()})).catch((function(e){t.logger.error("Failed to handle answer in 2xx response to re-INVITE"),t.logger.error(e.message),t.state!==_e.Terminated?(t.ackAndBye(n,488,"Bad Media Description"),t.stateTransition(_e.Terminated)):n.ack()})).then((function(){t.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)}))}},onProgress:function(e){},onRedirect:function(e){},onReject:function(n){t.logger.warn("Received a non-2xx response to re-INVITE"),t.pendingReinvite=!1,e.withoutSdp?e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n):t.rollbackOffer().catch((function(e){if(t.logger.error("Failed to rollback offer on non-2xx response to re-INVITE"),t.logger.error(e.message),t.state!==_e.Terminated){if(!t.dialog)throw new Error("Dialog undefined.");var n=[];n.push("Reason: "+t.getReasonHeaderValue(500,"Internal Server Error")),t.dialog.bye(void 0,{extraHeaders:n}),t.stateTransition(_e.Terminated)}})).then((function(){e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)}))},onTrying:function(e){}},r=e.requestOptions||{};if(r.extraHeaders=(r.extraHeaders||[]).slice(),r.extraHeaders.push("Allow: "+Se.toString()),r.extraHeaders.push("Contact: "+this._contact),e.withoutSdp){if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return Promise.resolve(this.dialog.invite(n,r))}var o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};return this.getOffer(o).then((function(e){if(!t.dialog)throw t.pendingReinvite=!1,new Error("Dialog undefined.");return r.body=e,t.dialog.invite(n,r)})).catch((function(e){throw t.logger.error(e.message),t.logger.error("Failed to send re-INVITE"),t.pendingReinvite=!1,e}))},e.prototype.message=function(e){if(void 0===e&&(e={}),this.state!==_e.Established){var t="Session.message() may only be called if established session.";return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._message(n,r)},e.prototype.refer=function(e,t){if(void 0===t&&(t={}),this.state!==_e.Established){var n="Session.refer() may only be called if established session.";return this.logger.error(n),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var r=t.requestDelegate,o=this.copyRequestOptions(t.requestOptions);return o.extraHeaders=o.extraHeaders?o.extraHeaders.concat(this.referExtraHeaders(this.referToString(e))):this.referExtraHeaders(this.referToString(e)),this._refer(t.onNotify,r,o)},e.prototype._bye=function(e,t){var n=this;if(!this.dialog)return Promise.reject(new Error("Session dialog undefined."));var r=this.dialog;switch(r.sessionState){case M.Initial:throw new Error("Invalid dialog state ".concat(r.sessionState));case M.Early:throw new Error("Invalid dialog state ".concat(r.sessionState));case M.AckWait:return this.stateTransition(_e.Terminating),new Promise((function(o){r.delegate={onAck:function(){var i=r.bye(e,t);return n.stateTransition(_e.Terminated),o(i),Promise.resolve()},onAckTimeout:function(){var i=r.bye(e,t);n.stateTransition(_e.Terminated),o(i)}}}));case M.Confirmed:var o=r.bye(e,t);return this.stateTransition(_e.Terminated),Promise.resolve(o);case M.Terminated:throw new Error("Invalid dialog state ".concat(r.sessionState));default:throw new Error("Unrecognized state.")}},e.prototype._info=function(e,t){return this.dialog?Promise.resolve(this.dialog.info(e,t)):Promise.reject(new Error("Session dialog undefined."))},e.prototype._message=function(e,t){return this.dialog?Promise.resolve(this.dialog.message(e,t)):Promise.reject(new Error("Session dialog undefined."))},e.prototype._refer=function(e,t,n){return this.dialog?(this.onNotify=e,Promise.resolve(this.dialog.refer(t,n))):Promise.reject(new Error("Session dialog undefined."))},e.prototype.ackAndBye=function(e,t,n){e.ack();var r=[];t&&r.push("Reason: "+this.getReasonHeaderValue(t,n)),e.session.bye(void 0,{extraHeaders:r})},e.prototype.onAckRequest=function(e){var t=this;if(this.logger.log("Session.onAckRequest"),this.state!==_e.Established&&this.state!==_e.Terminating)return this.logger.error("ACK received while in state ".concat(this.state,", dropping request")),Promise.resolve();var n=this.dialog;if(!n)throw new Error("Dialog undefined.");var r={sessionDescriptionHandlerOptions:this.pendingReinviteAck?this.sessionDescriptionHandlerOptionsReInvite:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.pendingReinviteAck?this._sessionDescriptionHandlerModifiersReInvite:this._sessionDescriptionHandlerModifiers};if(this.delegate&&this.delegate.onAck){var o=new qe(e);this.delegate.onAck(o)}switch(this.pendingReinviteAck=!1,n.signalingState){case j.Initial:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));var i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.Stable:var s=O(e.message);return s?"render"===s.contentDisposition?(this._renderbody=s.content,this._rendertype=s.contentType,Promise.resolve()):"session"!==s.contentDisposition?Promise.resolve():this.setAnswer(s,r).catch((function(e){t.logger.error(e.message);var r=["Reason: "+t.getReasonHeaderValue(488,"Bad Media Description")];n.bye(void 0,{extraHeaders:r}),t.stateTransition(_e.Terminated)})):Promise.resolve();case j.HaveLocalOffer:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.HaveRemoteOffer:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.Closed:throw new Error("Invalid signaling state ".concat(n.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(n.signalingState,"."))}},e.prototype.onByeRequest=function(e){if(this.logger.log("Session.onByeRequest"),this.state===_e.Established){if(this.delegate&&this.delegate.onBye){var t=new Fe(e);this.delegate.onBye(t)}else e.accept();this.stateTransition(_e.Terminated)}else this.logger.error("BYE received while in state ".concat(this.state,", dropping request"))},e.prototype.onInfoRequest=function(e){if(this.logger.log("Session.onInfoRequest"),this.state===_e.Established)if(this.delegate&&this.delegate.onInfo){var t=new ze(e);this.delegate.onInfo(t)}else e.accept();else this.logger.error("INFO received while in state ".concat(this.state,", dropping request"))},e.prototype.onInviteRequest=function(e){var t=this;if(this.logger.log("Session.onInviteRequest"),this.state===_e.Established){this.pendingReinviteAck=!0;var n=["Contact: "+this._contact];if(e.message.hasHeader("P-Asserted-Identity")){var r=e.message.getHeader("P-Asserted-Identity");if(!r)throw new Error("Header undefined.");this._assertedIdentity=g.nameAddrHeaderParse(r)}var o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.generateResponseOfferAnswerInDialog(o).then((function(r){var o=e.accept({statusCode:200,extraHeaders:n,body:r});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,200)})).catch((function(r){if(t.logger.error(r.message),t.logger.error("Failed to handle to re-INVITE request"),!t.dialog)throw new Error("Dialog undefined.");if(t.logger.error(t.dialog.signalingState),t.dialog.signalingState!==j.Stable)t.rollbackOffer().then((function(){var n=e.reject({statusCode:488});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,n.message,488)})).catch((function(r){t.logger.error(r.message),t.logger.error("Failed to rollback offer on re-INVITE request");var o=e.reject({statusCode:488});if(t.state!==_e.Terminated){if(!t.dialog)throw new Error("Dialog undefined.");var i=[];i.push("Reason: "+t.getReasonHeaderValue(500,"Internal Server Error")),t.dialog.bye(void 0,{extraHeaders:n}),t.stateTransition(_e.Terminated)}t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,488)}));else{var o=e.reject({statusCode:488});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,488)}}))}else this.logger.error("INVITE received while in state ".concat(this.state,", dropping request"))},e.prototype.onMessageRequest=function(e){if(this.logger.log("Session.onMessageRequest"),this.state===_e.Established)if(this.delegate&&this.delegate.onMessage){var t=new Ke(e);this.delegate.onMessage(t)}else e.accept();else this.logger.error("MESSAGE received while in state ".concat(this.state,", dropping request"))},e.prototype.onNotifyRequest=function(e){if(this.logger.log("Session.onNotifyRequest"),this.state===_e.Established)if(this.onNotify){var t=new We(e);this.onNotify(t)}else if(this.delegate&&this.delegate.onNotify){t=new We(e);this.delegate.onNotify(t)}else e.accept();else this.logger.error("NOTIFY received while in state ".concat(this.state,", dropping request"))},e.prototype.onPrackRequest=function(e){if(this.logger.log("Session.onPrackRequest"),this.state===_e.Established)throw new Error("Unimplemented.");this.logger.error("PRACK received while in state ".concat(this.state,", dropping request"))},e.prototype.onReferRequest=function(e){var t=this;if(this.logger.log("Session.onReferRequest"),this.state===_e.Established){if(!e.message.hasHeader("refer-to"))return this.logger.warn("Invalid REFER packet. A refer-to header is required. Rejecting."),void e.reject();var n=new Ge(e,this);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(n):(this.logger.log("No delegate available to handle REFER, automatically accepting and following."),n.accept().then((function(){return n.makeInviter(t._referralInviterOptions).invite()})).catch((function(e){t.logger.error(e.message)})))}else this.logger.error("REFER received while in state ".concat(this.state,", dropping request"))},e.prototype.generateResponseOfferAnswer=function(e,t){if(this.dialog)return this.generateResponseOfferAnswerInDialog(t);var n=O(e.message);return n&&"session"===n.contentDisposition?this.setOfferAndGetAnswer(n,t):this.getOffer(t)},e.prototype.generateResponseOfferAnswerInDialog=function(e){if(!this.dialog)throw new Error("Dialog undefined.");switch(this.dialog.signalingState){case j.Initial:return this.getOffer(e);case j.HaveLocalOffer:return Promise.resolve(void 0);case j.HaveRemoteOffer:if(!this.dialog.offer)throw new Error("Session offer undefined in signaling state ".concat(this.dialog.signalingState,"."));return this.setOfferAndGetAnswer(this.dialog.offer,e);case j.Stable:return this.state!==_e.Established?Promise.resolve(void 0):this.getOffer(e);case j.Closed:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."))}},e.prototype.getOffer=function(e){var t=this,n=this.setupSessionDescriptionHandler(),r=e.sessionDescriptionHandlerOptions,o=e.sessionDescriptionHandlerModifiers;try{return n.getDescription(r,o).then((function(e){return I(e)})).catch((function(e){t.logger.error("Session.getOffer: SDH getDescription rejected...");var n=e instanceof Error?e:new Error("Session.getOffer unknown error.");throw t.logger.error(n.message),n}))}catch(s){this.logger.error("Session.getOffer: SDH getDescription threw...");var i=s instanceof Error?s:new Error(s);return this.logger.error(i.message),Promise.reject(i)}},e.prototype.rollbackOffer=function(){var e=this,t=this.setupSessionDescriptionHandler();if(void 0===t.rollbackDescription)return Promise.resolve();try{return t.rollbackDescription().catch((function(t){e.logger.error("Session.rollbackOffer: SDH rollbackDescription rejected...");var n=t instanceof Error?t:new Error("Session.rollbackOffer unknown error.");throw e.logger.error(n.message),n}))}catch(r){this.logger.error("Session.rollbackOffer: SDH rollbackDescription threw...");var n=r instanceof Error?r:new Error(r);return this.logger.error(n.message),Promise.reject(n)}},e.prototype.setAnswer=function(e,t){var n=this,r=this.setupSessionDescriptionHandler(),o=t.sessionDescriptionHandlerOptions,i=t.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new Me)}catch(a){this.logger.error("Session.setAnswer: SDH hasDescription threw...");var s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}try{return r.setDescription(e.content,o,i).catch((function(e){n.logger.error("Session.setAnswer: SDH setDescription rejected...");var t=e instanceof Error?e:new Error("Session.setAnswer unknown error.");throw n.logger.error(t.message),t}))}catch(a){this.logger.error("Session.setAnswer: SDH setDescription threw...");s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}},e.prototype.setOfferAndGetAnswer=function(e,t){var n=this,r=this.setupSessionDescriptionHandler(),o=t.sessionDescriptionHandlerOptions,i=t.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new Me)}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH hasDescription threw...");var s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}try{return r.setDescription(e.content,o,i).then((function(){return r.getDescription(o,i)})).then((function(e){return I(e)})).catch((function(e){n.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription rejected...");var t=e instanceof Error?e:new Error("Session.setOfferAndGetAnswer unknown error.");throw n.logger.error(t.message),t}))}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription threw...");s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}},e.prototype.setSessionDescriptionHandler=function(e){if(this._sessionDescriptionHandler)throw new Error("Session description handler defined.");this._sessionDescriptionHandler=e},e.prototype.setupSessionDescriptionHandler=function(){var e;return this._sessionDescriptionHandler||(this._sessionDescriptionHandler=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions),(null===(e=this.delegate)||void 0===e?void 0:e.onSessionDescriptionHandler)&&this.delegate.onSessionDescriptionHandler(this._sessionDescriptionHandler,!1)),this._sessionDescriptionHandler},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case _e.Initial:e!==_e.Establishing&&e!==_e.Established&&e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Establishing:e!==_e.Established&&e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Established:e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Terminating:e!==_e.Terminated&&n();break;case _e.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Session ".concat(this.id," transitioned to state ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===_e.Terminated&&this.dispose()},e.prototype.copyRequestOptions=function(e){void 0===e&&(e={});var t=e.extraHeaders?e.extraHeaders.slice():void 0,n=e.body?{contentDisposition:e.body.contentDisposition||"render",contentType:e.body.contentType||"text/plain",content:e.body.content||""}:void 0;return{extraHeaders:t,body:n}},e.prototype.getReasonHeaderValue=function(e,t){var n=e,r=w(e);return!r&&t&&(r=t),"SIP;cause="+n+';text="'+r+'"'},e.prototype.referExtraHeaders=function(e){var t=[];return t.push("Referred-By: <"+this.userAgent.configuration.uri+">"),t.push("Contact: "+this._contact),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.push("Refer-To: "+e),t},e.prototype.referToString=function(e){var t;if(e instanceof d)t=e.toString();else{if(!e.dialog)throw new Error("Dialog undefined.");var n=e.remoteIdentity.friendlyName,r=e.dialog.remoteTarget.toString(),o=e.dialog.callId,i=e.dialog.remoteTag,s=e.dialog.localTag,a=encodeURIComponent("".concat(o,";to-tag=").concat(i,";from-tag=").concat(s));t='"'.concat(n,'" <').concat(r,"?Replaces=").concat(a,">")}return t},e}();(function(e){e["Required"]="Required",e["Supported"]="Supported",e["Unsupported"]="Unsupported"})(Ye||(Ye={}));var Ze,Xe,Qe={"100rel":!0,199:!0,answermode:!0,"early-session":!0,eventlist:!0,explicitsub:!0,"from-change":!0,"geolocation-http":!0,"geolocation-sip":!0,gin:!0,gruu:!0,histinfo:!0,ice:!0,join:!0,"multiple-refer":!0,norefersub:!0,nosub:!0,outbound:!0,path:!0,policy:!0,precondition:!0,pref:!0,privacy:!0,"recipient-list-invite":!0,"recipient-list-message":!0,"recipient-list-subscribe":!0,replaces:!0,"resource-priority":!0,"sdp-anat":!0,"sec-agree":!0,tdialog:!0,timer:!0,uui:!0},et=function(e){function t(t,n){var r=e.call(this,t)||this;r.incomingInviteRequest=n,r.disposed=!1,r.expiresTimer=void 0,r.isCanceled=!1,r.rel100="none",r.rseq=Math.floor(1e4*Math.random()),r.userNoAnswerTimer=void 0,r.waitingForPrack=!1,r.logger=t.getLogger("sip.Invitation");var o=r.incomingInviteRequest.message,i=o.getHeader("require");i&&i.toLowerCase().includes("100rel")&&(r.rel100="required");var s=o.getHeader("supported");if(s&&s.toLowerCase().includes("100rel")&&(r.rel100="supported"),o.toTag=n.toTag,"string"!==typeof o.toTag)throw new TypeError("toTag should have been a string.");if(r.userNoAnswerTimer=setTimeout((function(){n.reject({statusCode:480}),r.stateTransition(_e.Terminated)}),r.userAgent.configuration.noAnswerTimeout?1e3*r.userAgent.configuration.noAnswerTimeout:6e4),o.hasHeader("expires")){var a=1e3*Number(o.getHeader("expires")||0);r.expiresTimer=setTimeout((function(){r.state===_e.Initial&&(n.reject({statusCode:487}),r.stateTransition(_e.Terminated))}),a)}var l=r.request.getHeader("P-Asserted-Identity");l&&(r._assertedIdentity=g.nameAddrHeaderParse(l)),r._contact=r.userAgent.contact.toString();var c=o.parseHeader("Content-Disposition");return c&&"render"===c.type&&(r._renderbody=o.body,r._rendertype=o.getHeader("Content-Type")),r._id=o.callId+o.fromTag,r.userAgent._sessions[r._id]=r,r}return o(t,e),t.prototype.dispose=function(){var t=this;if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.expiresTimer&&(clearTimeout(this.expiresTimer),this.expiresTimer=void 0),this.userNoAnswerTimer&&(clearTimeout(this.userNoAnswerTimer),this.userNoAnswerTimer=void 0),this.prackNeverArrived(),this.state){case _e.Initial:return this.reject().then((function(){return e.prototype.dispose.call(t)}));case _e.Establishing:return this.reject().then((function(){return e.prototype.dispose.call(t)}));case _e.Established:return e.prototype.dispose.call(this);case _e.Terminating:return e.prototype.dispose.call(this);case _e.Terminated:return e.prototype.dispose.call(this);default:throw new Error("Unknown state.")}},Object.defineProperty(t.prototype,"autoSendAnInitialProvisionalResponse",{get:function(){return"required"!==this.rel100&&this.userAgent.configuration.sendInitialProvisionalResponse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{get:function(){return this.incomingInviteRequest.message.body},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localIdentity",{get:function(){return this.request.to},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteIdentity",{get:function(){return this.request.from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return this.incomingInviteRequest.message},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Invitation.accept"),this.state!==_e.Initial){var n=new Error("Invalid session state ".concat(this.state));return this.logger.error(n.message),Promise.reject(n)}return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.stateTransition(_e.Establishing),this.sendAccept(e).then((function(e){e.message;var n=e.session;n.delegate={onAck:function(e){return t.onAckRequest(e)},onAckTimeout:function(){return t.onAckTimeout()},onBye:function(e){return t.onByeRequest(e)},onInfo:function(e){return t.onInfoRequest(e)},onInvite:function(e){return t.onInviteRequest(e)},onMessage:function(e){return t.onMessageRequest(e)},onNotify:function(e){return t.onNotifyRequest(e)},onPrack:function(e){return t.onPrackRequest(e)},onRefer:function(e){return t.onReferRequest(e)}},t._dialog=n,t.stateTransition(_e.Established),t._replacee&&t._replacee._bye()})).catch((function(e){return t.handleResponseError(e)}))},t.prototype.progress=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Invitation.progress"),this.state!==_e.Initial){var n=new Error("Invalid session state ".concat(this.state));return this.logger.error(n.message),Promise.reject(n)}var r=e.statusCode||180;if(r<100||r>199)throw new TypeError("Invalid statusCode: "+r);return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.waitingForPrack?(this.logger.warn("Unexpected call for progress while waiting for prack, ignoring"),Promise.resolve()):100===e.statusCode?this.sendProgressTrying().then((function(){})).catch((function(e){return t.handleResponseError(e)})):"required"===this.rel100||"supported"===this.rel100&&e.rel100||"supported"===this.rel100&&this.userAgent.configuration.sipExtension100rel===Ye.Required?this.sendProgressReliableWaitForPrack(e).then((function(){})).catch((function(e){return t.handleResponseError(e)})):this.sendProgress(e).then((function(){})).catch((function(e){return t.handleResponseError(e)}))},t.prototype.reject=function(e){if(void 0===e&&(e={}),this.logger.log("Invitation.reject"),this.state!==_e.Initial&&this.state!==_e.Establishing){var t=new Error("Invalid session state ".concat(this.state));return this.logger.error(t.message),Promise.reject(t)}var n=e.statusCode||480,r=e.reasonPhrase?e.reasonPhrase:w(n),o=e.extraHeaders||[];if(n<300||n>699)throw new TypeError("Invalid statusCode: "+n);var i=e.body?I(e.body):void 0;return n<400?this.incomingInviteRequest.redirect([],{statusCode:n,reasonPhrase:r,extraHeaders:o,body:i}):this.incomingInviteRequest.reject({statusCode:n,reasonPhrase:r,extraHeaders:o,body:i}),this.stateTransition(_e.Terminated),Promise.resolve()},t.prototype._onCancel=function(e){this.logger.log("Invitation._onCancel"),this.state===_e.Initial||this.state===_e.Establishing?(this.isCanceled=!0,this.incomingInviteRequest.reject({statusCode:487}),this.stateTransition(_e.Terminated)):this.logger.error("CANCEL received while in state ".concat(this.state,", dropping request"))},t.prototype.handlePrackOfferAnswer=function(e){if(!this.dialog)throw new Error("Dialog undefined.");var t=O(e.message);if(!t||"session"!==t.contentDisposition)return Promise.resolve(void 0);var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers};switch(this.dialog.signalingState){case j.Initial:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));case j.Stable:return this.setAnswer(t,n).then((function(){}));case j.HaveLocalOffer:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));case j.HaveRemoteOffer:return this.setOfferAndGetAnswer(t,n);case j.Closed:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."))}},t.prototype.handleResponseError=function(e){var t=480;if(e instanceof Error?this.logger.error(e.message):this.logger.error(e),e instanceof Me?(this.logger.error("A session description handler occurred while sending response (content type unsupported"),t=415):e instanceof Ve?this.logger.error("A session description handler occurred while sending response"):e instanceof $e?this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)"):e instanceof K&&this.logger.error("Session changed state before response could be formulated and sent"),this.state===_e.Initial||this.state===_e.Establishing)try{this.incomingInviteRequest.reject({statusCode:t}),this.stateTransition(_e.Terminated)}catch(n){throw this.logger.error("An error occurred attempting to reject the request while handling another error"),n}if(!this.isCanceled)throw e;this.logger.warn("An error occurred while attempting to formulate and send a response to an incoming INVITE. However a CANCEL was received and processed while doing so which can (and often does) result in errors occurring as the session terminates in the meantime. Said error is being ignored.")},t.prototype.onAckTimeout=function(){if(this.logger.log("Invitation.onAckTimeout"),!this.dialog)throw new Error("Dialog undefined.");this.logger.log("No ACK received for an extended period of time, terminating session"),this.dialog.bye(),this.stateTransition(_e.Terminated)},t.prototype.sendAccept=function(e){var t=this;void 0===e&&(e={});var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.extraHeaders||[];return this.waitingForPrack?this.waitForArrivalOfPrack().then((function(){return clearTimeout(t.userNoAnswerTimer)})).then((function(){return t.generateResponseOfferAnswer(t.incomingInviteRequest,n)})).then((function(e){return t.incomingInviteRequest.accept({statusCode:200,body:e,extraHeaders:r})})):(clearTimeout(this.userNoAnswerTimer),this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then((function(e){return t.incomingInviteRequest.accept({statusCode:200,body:e,extraHeaders:r})})))},t.prototype.sendProgress=function(e){void 0===e&&(e={});var t=e.statusCode||180,n=e.reasonPhrase,r=(e.extraHeaders||[]).slice(),o=e.body?I(e.body):void 0;if(183===t&&!o)return this.sendProgressWithSDP(e);try{var i=this.incomingInviteRequest.progress({statusCode:t,reasonPhrase:n,extraHeaders:r,body:o});return this._dialog=i.session,Promise.resolve(i)}catch(s){return Promise.reject(s)}},t.prototype.sendProgressWithSDP=function(e){var t=this;void 0===e&&(e={});var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.statusCode||183,o=e.reasonPhrase,i=(e.extraHeaders||[]).slice();return this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then((function(e){return t.incomingInviteRequest.progress({statusCode:r,reasonPhrase:o,extraHeaders:i,body:e})})).then((function(e){return t._dialog=e.session,e}))},t.prototype.sendProgressReliable=function(e){return void 0===e&&(e={}),e.extraHeaders=(e.extraHeaders||[]).slice(),e.extraHeaders.push("Require: 100rel"),e.extraHeaders.push("RSeq: "+Math.floor(1e4*Math.random())),this.sendProgressWithSDP(e)},t.prototype.sendProgressReliableWaitForPrack=function(e){var t=this;void 0===e&&(e={});var n,r={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},o=e.statusCode||183,i=e.reasonPhrase,s=(e.extraHeaders||[]).slice();return s.push("Require: 100rel"),s.push("RSeq: "+this.rseq++),new Promise((function(e,a){t.waitingForPrack=!0,t.generateResponseOfferAnswer(t.incomingInviteRequest,r).then((function(e){return n=e,t.incomingInviteRequest.progress({statusCode:o,reasonPhrase:i,extraHeaders:s,body:n})})).then((function(r){var l,c;t._dialog=r.session,r.session.delegate={onPrack:function(n){l=n,clearTimeout(d),clearTimeout(f),t.waitingForPrack&&(t.waitingForPrack=!1,t.handlePrackOfferAnswer(l).then((function(n){try{c=l.accept({statusCode:200,body:n}),t.prackArrived(),e({prackRequest:l,prackResponse:c,progressResponse:r})}catch(o){a(o)}})).catch((function(e){return a(e)})))}};var u=function(){t.waitingForPrack&&(t.waitingForPrack=!1,t.logger.warn("No PRACK received, rejecting INVITE."),clearTimeout(f),t.reject({statusCode:504}).then((function(){return a(new $e)})).catch((function(e){return a(e)})))},d=setTimeout(u,64*U.T1),p=function(){try{t.incomingInviteRequest.progress({statusCode:o,reasonPhrase:i,extraHeaders:s,body:n})}catch(e){return t.waitingForPrack=!1,void a(e)}f=setTimeout(p,h*=2)},h=U.T1,f=setTimeout(p,h)})).catch((function(e){t.waitingForPrack=!1,a(e)}))}))},t.prototype.sendProgressTrying=function(){try{var e=this.incomingInviteRequest.trying();return Promise.resolve(e)}catch(t){return Promise.reject(t)}},t.prototype.waitForArrivalOfPrack=function(){var e=this;if(this.waitingForPrackPromise)throw new Error("Already waiting for PRACK");return this.waitingForPrackPromise=new Promise((function(t,n){e.waitingForPrackResolve=t,e.waitingForPrackReject=n})),this.waitingForPrackPromise},t.prototype.prackArrived=function(){this.waitingForPrackResolve&&this.waitingForPrackResolve(),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0},t.prototype.prackNeverArrived=function(){this.waitingForPrackReject&&this.waitingForPrackReject(new $e),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0},t}(Je),tt=function(e){function t(t,n,r){void 0===r&&(r={});var o=e.call(this,t,r)||this;o.disposed=!1,o.earlyMedia=!1,o.earlyMediaSessionDescriptionHandlers=new Map,o.isCanceled=!1,o.inviteWithoutSdp=!1,o.logger=t.getLogger("sip.Inviter"),o.earlyMedia=void 0!==r.earlyMedia?r.earlyMedia:o.earlyMedia,o.fromTag=C(),o.inviteWithoutSdp=void 0!==r.inviteWithoutSdp?r.inviteWithoutSdp:o.inviteWithoutSdp;var s=i({},r);s.params=i({},r.params);var a=r.anonymous||!1,l=t.contact.toString({anonymous:a,outbound:a?!t.contact.tempGruu:!t.contact.pubGruu});a&&t.configuration.uri&&(s.params.fromDisplayName="Anonymous",s.params.fromUri="sip:anonymous@anonymous.invalid");var c=t.userAgentCore.configuration.aor;if(s.params.fromUri&&(c="string"===typeof s.params.fromUri?g.URIParse(s.params.fromUri):s.params.fromUri),!c)throw new TypeError("Invalid from URI: "+s.params.fromUri);var u=n;if(s.params.toUri&&(u="string"===typeof s.params.toUri?g.URIParse(s.params.toUri):s.params.toUri),!u)throw new TypeError("Invalid to URI: "+s.params.toUri);var d=i({},s.params);d.fromTag=o.fromTag;var p=(s.extraHeaders||[]).slice();a&&t.configuration.uri&&(p.push("P-Preferred-Identity: "+t.configuration.uri.toString()),p.push("Privacy: id")),p.push("Contact: "+l),p.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.configuration.sipExtension100rel===Ye.Required&&p.push("Require: 100rel"),t.configuration.sipExtensionReplaces===Ye.Required&&p.push("Require: replaces"),s.extraHeaders=p;var h=void 0;return o.outgoingRequestMessage=t.userAgentCore.makeOutgoingRequestMessage(m.INVITE,n,c,u,d,p,h),o._contact=l,o._referralInviterOptions=s,o._renderbody=r.renderbody,o._rendertype=r.rendertype,r.sessionDescriptionHandlerModifiers&&(o.sessionDescriptionHandlerModifiers=r.sessionDescriptionHandlerModifiers),r.sessionDescriptionHandlerOptions&&(o.sessionDescriptionHandlerOptions=r.sessionDescriptionHandlerOptions),r.sessionDescriptionHandlerModifiersReInvite&&(o.sessionDescriptionHandlerModifiersReInvite=r.sessionDescriptionHandlerModifiersReInvite),r.sessionDescriptionHandlerOptionsReInvite&&(o.sessionDescriptionHandlerOptionsReInvite=r.sessionDescriptionHandlerOptionsReInvite),o._id=o.outgoingRequestMessage.callId+o.fromTag,o.userAgent._sessions[o._id]=o,o}return o(t,e),t.prototype.dispose=function(){var t=this;if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.disposeEarlyMedia(),this.state){case _e.Initial:return this.cancel().then((function(){return e.prototype.dispose.call(t)}));case _e.Establishing:return this.cancel().then((function(){return e.prototype.dispose.call(t)}));case _e.Established:return e.prototype.dispose.call(this);case _e.Terminating:return e.prototype.dispose.call(this);case _e.Terminated:return e.prototype.dispose.call(this);default:throw new Error("Unknown state.")}},Object.defineProperty(t.prototype,"body",{get:function(){return this.outgoingRequestMessage.body},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localIdentity",{get:function(){return this.outgoingRequestMessage.from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteIdentity",{get:function(){return this.outgoingRequestMessage.to},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return this.outgoingRequestMessage},enumerable:!1,configurable:!0}),t.prototype.cancel=function(e){if(void 0===e&&(e={}),this.logger.log("Inviter.cancel"),this.state!==_e.Initial&&this.state!==_e.Establishing){var t=new Error("Invalid session state ".concat(this.state));return this.logger.error(t.message),Promise.reject(t)}function n(e,t){if(e&&e<200||e>699)throw new TypeError("Invalid statusCode: "+e);if(e){var n=e,r=w(e)||t;return"SIP;cause="+n+';text="'+r+'"'}}if(this.isCanceled=!0,this.stateTransition(_e.Terminating),this.outgoingInviteRequest){var r=void 0;e.statusCode&&e.reasonPhrase&&(r=n(e.statusCode,e.reasonPhrase)),this.outgoingInviteRequest.cancel(r,e)}else this.logger.warn("Canceled session before INVITE was sent"),this.stateTransition(_e.Terminated);return Promise.resolve()},t.prototype.invite=function(t){var n=this;if(void 0===t&&(t={}),this.logger.log("Inviter.invite"),this.state!==_e.Initial)return e.prototype.invite.call(this,t);if(t.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=t.sessionDescriptionHandlerModifiers),t.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=t.sessionDescriptionHandlerOptions),t.withoutSdp||this.inviteWithoutSdp)return this._renderbody&&this._rendertype&&(this.outgoingRequestMessage.body={contentType:this._rendertype,body:this._renderbody}),this.stateTransition(_e.Establishing),Promise.resolve(this.sendInvite(t));var r={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.getOffer(r).then((function(e){return n.outgoingRequestMessage.body={body:e.content,contentType:e.contentType},n.stateTransition(_e.Establishing),n.sendInvite(t)})).catch((function(e){throw n.logger.log(e.message),n.stateTransition(_e.Terminated),e}))},t.prototype.sendInvite=function(e){var t=this;return void 0===e&&(e={}),this.outgoingInviteRequest=this.userAgent.userAgentCore.invite(this.outgoingRequestMessage,{onAccept:function(n){return t.dialog?(t.logger.log("Additional confirmed dialog, sending ACK and BYE"),void t.ackAndBye(n)):t.isCanceled?(t.logger.log("Canceled session accepted, sending ACK and BYE"),t.ackAndBye(n),void t.stateTransition(_e.Terminated)):(t.notifyReferer(n),void t.onAccept(n).then((function(){t.disposeEarlyMedia()})).catch((function(){t.disposeEarlyMedia()})).then((function(){e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})))},onProgress:function(n){t.isCanceled||(t.notifyReferer(n),t.onProgress(n).catch((function(){t.disposeEarlyMedia()})).then((function(){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(n)})))},onRedirect:function(n){t.notifyReferer(n),t.onRedirect(n),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n)},onReject:function(n){t.notifyReferer(n),t.onReject(n),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)},onTrying:function(n){t.notifyReferer(n),t.onTrying(n),e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(n)}}),this.outgoingInviteRequest},t.prototype.disposeEarlyMedia=function(){this.earlyMediaSessionDescriptionHandlers.forEach((function(e){e.close()})),this.earlyMediaSessionDescriptionHandlers.clear()},t.prototype.notifyReferer=function(e){var t=this;if(this._referred){if(!(this._referred instanceof Je))throw new Error("Referred session not instance of session");if(this._referred.dialog){if(!e.message.statusCode)throw new Error("Status code undefined.");if(!e.message.reasonPhrase)throw new Error("Reason phrase undefined.");var n=e.message.statusCode,r=e.message.reasonPhrase,o="SIP/2.0 ".concat(n," ").concat(r).trim(),i=this._referred.dialog.notify(void 0,{extraHeaders:["Event: refer","Subscription-State: terminated"],body:{contentDisposition:"render",contentType:"message/sipfrag",content:o}});i.delegate={onReject:function(){t._referred=void 0}}}}},t.prototype.onAccept=function(e){var t=this;if(this.logger.log("Inviter.onAccept"),this.state!==_e.Establishing)return this.logger.error("Accept received while in state ".concat(this.state,", dropping response")),Promise.reject(new Error("Invalid session state ".concat(this.state)));var n=e.message,r=e.session;switch(n.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=g.nameAddrHeaderParse(n.getHeader("P-Asserted-Identity"))),r.delegate={onAck:function(e){return t.onAckRequest(e)},onBye:function(e){return t.onByeRequest(e)},onInfo:function(e){return t.onInfoRequest(e)},onInvite:function(e){return t.onInviteRequest(e)},onMessage:function(e){return t.onMessageRequest(e)},onNotify:function(e){return t.onNotifyRequest(e)},onPrack:function(e){return t.onPrackRequest(e)},onRefer:function(e){return t.onReferRequest(e)}},this._dialog=r,r.signalingState){case j.Initial:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(_e.Terminated),Promise.reject(new Error("Bad Media Description"));case j.HaveLocalOffer:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(_e.Terminated),Promise.reject(new Error("Bad Media Description"));case j.HaveRemoteOffer:if(!this._dialog.offer)throw new Error("Session offer undefined in signaling state ".concat(this._dialog.signalingState,"."));var o={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setOfferAndGetAnswer(this._dialog.offer,o).then((function(n){e.ack({body:n}),t.stateTransition(_e.Established)})).catch((function(n){throw t.ackAndBye(e,488,"Invalid session description"),t.stateTransition(_e.Terminated),n}));case j.Stable:if(this.earlyMediaSessionDescriptionHandlers.size>0){var i=this.earlyMediaSessionDescriptionHandlers.get(r.id);if(!i)throw new Error("Session description handler undefined.");return this.setSessionDescriptionHandler(i),this.earlyMediaSessionDescriptionHandlers.delete(r.id),e.ack(),this.stateTransition(_e.Established),Promise.resolve()}if(this.earlyMediaDialog){if(this.earlyMediaDialog!==r){if(this.earlyMedia){var s="You have set the 'earlyMedia' option to 'true' which requires that your INVITE requests do not fork and yet this INVITE request did in fact fork. Consequentially and not surprisingly the end point which accepted the INVITE (confirmed dialog) does not match the end point with which early media has been setup (early dialog) and thus this session is unable to proceed. In accordance with the SIP specifications, the SIP servers your end point is connected to determine if an INVITE forks and the forking behavior of those servers cannot be controlled by this library. If you wish to use early media with this library you must configure those servers accordingly. Alternatively you may set the 'earlyMedia' to 'false' which will allow this library to function with any INVITE requests which do fork.";this.logger.error(s)}var a=new Error("Early media dialog does not equal confirmed dialog, terminating session");return this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(_e.Terminated),Promise.reject(a)}return e.ack(),this.stateTransition(_e.Established),Promise.resolve()}var l=r.answer;if(!l)throw new Error("Answer is undefined.");o={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(l,o).then((function(){var n;t._renderbody&&t._rendertype&&(n={body:{contentDisposition:"render",contentType:t._rendertype,content:t._renderbody}}),e.ack(n),t.stateTransition(_e.Established)})).catch((function(n){throw t.logger.error(n.message),t.ackAndBye(e,488,"Not Acceptable Here"),t.stateTransition(_e.Terminated),n}));case j.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}},t.prototype.onProgress=function(e){var t,n=this;if(this.logger.log("Inviter.onProgress"),this.state!==_e.Establishing)return this.logger.error("Progress received while in state ".concat(this.state,", dropping response")),Promise.reject(new Error("Invalid session state ".concat(this.state)));if(!this.outgoingInviteRequest)throw new Error("Outgoing INVITE request undefined.");var r=e.message,o=e.session;r.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=g.nameAddrHeaderParse(r.getHeader("P-Asserted-Identity")));var i=r.getHeader("require"),s=r.getHeader("rseq"),a=i&&i.includes("100rel")&&s?Number(s):void 0,l=!!a,c=[];switch(l&&c.push("RAck: "+r.getHeader("rseq")+" "+r.getHeader("cseq")),o.signalingState){case j.Initial:return l&&(this.logger.warn("First reliable provisional response received MUST contain an offer when INVITE does not contain an offer."),e.prack({extraHeaders:c})),Promise.resolve();case j.HaveLocalOffer:return l&&e.prack({extraHeaders:c}),Promise.resolve();case j.HaveRemoteOffer:if(!l)return this.logger.warn("Non-reliable provisional response MUST NOT contain an initial offer, discarding response."),Promise.resolve();var u=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions||{});return(null===(t=this.delegate)||void 0===t?void 0:t.onSessionDescriptionHandler)&&this.delegate.onSessionDescriptionHandler(u,!0),this.earlyMediaSessionDescriptionHandlers.set(o.id,u),u.setDescription(r.body,this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers).then((function(){return u.getDescription(n.sessionDescriptionHandlerOptions,n.sessionDescriptionHandlerModifiers)})).then((function(t){var n={contentDisposition:"session",contentType:t.contentType,content:t.body};e.prack({extraHeaders:c,body:n})})).catch((function(e){throw n.stateTransition(_e.Terminated),e}));case j.Stable:if(l&&e.prack({extraHeaders:c}),this.earlyMedia&&!this.earlyMediaDialog){this.earlyMediaDialog=o;var d=o.answer;if(!d)throw new Error("Answer is undefined.");var p={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(d,p).catch((function(e){throw n.stateTransition(_e.Terminated),e}))}return Promise.resolve();case j.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}},t.prototype.onRedirect=function(e){this.logger.log("Inviter.onRedirect"),this.state===_e.Establishing||this.state===_e.Terminating?this.stateTransition(_e.Terminated):this.logger.error("Redirect received while in state ".concat(this.state,", dropping response"))},t.prototype.onReject=function(e){this.logger.log("Inviter.onReject"),this.state===_e.Establishing||this.state===_e.Terminating?this.stateTransition(_e.Terminated):this.logger.error("Reject received while in state ".concat(this.state,", dropping response"))},t.prototype.onTrying=function(e){this.logger.log("Inviter.onTrying"),this.state===_e.Establishing||this.logger.error("Trying received while in state ".concat(this.state,", dropping response"))},t}(Je),nt=function(){function e(e,t,n,r,o){void 0===r&&(r="text/plain"),void 0===o&&(o={}),this.logger=e.getLogger("sip.Messager"),o.params=o.params||{};var s=e.userAgentCore.configuration.aor;if(o.params.fromUri&&(s="string"===typeof o.params.fromUri?g.URIParse(o.params.fromUri):o.params.fromUri),!s)throw new TypeError("Invalid from URI: "+o.params.fromUri);var a=t;if(o.params.toUri&&(a="string"===typeof o.params.toUri?g.URIParse(o.params.toUri):o.params.toUri),!a)throw new TypeError("Invalid to URI: "+o.params.toUri);var l=o.params?i({},o.params):{},c=(o.extraHeaders||[]).slice(),u="render",d={contentDisposition:u,contentType:r,content:n};this.request=e.userAgentCore.makeOutgoingRequestMessage(m.MESSAGE,t,s,a,l,c,d),this.userAgent=e}return e.prototype.message=function(e){return void 0===e&&(e={}),this.userAgent.userAgentCore.request(this.request,e.requestDelegate),Promise.resolve()},e}();(function(e){e["Initial"]="Initial",e["Published"]="Published",e["Unpublished"]="Unpublished",e["Terminated"]="Terminated"})(Ze||(Ze={})),function(){function e(e,t,n,r){void 0===r&&(r={}),this.disposed=!1,this._state=Ze.Initial,this._stateEventEmitter=new Ue,this.userAgent=e,r.extraHeaders=(r.extraHeaders||[]).slice(),r.contentType=r.contentType||"text/plain","number"!==typeof r.expires||r.expires%1!==0?r.expires=3600:r.expires=Number(r.expires),"boolean"!==typeof r.unpublishOnClose&&(r.unpublishOnClose=!0),this.target=t,this.event=n,this.options=r,this.pubRequestExpires=r.expires,this.logger=e.getLogger("sip.Publisher");var o,i=r.params||{},s=i.fromUri?i.fromUri:e.userAgentCore.configuration.aor,a=i.toUri?i.toUri:t;if(r.body&&r.contentType){var l="render",c=r.contentType,u=r.body;o={contentDisposition:l,contentType:c,content:u}}var d=(r.extraHeaders||[]).slice();this.request=e.userAgentCore.makeOutgoingRequestMessage(m.PUBLISH,t,s,a,i,d,o),this.id=this.target.toString()+":"+this.event,this.userAgent._publishers[this.id]=this}e.prototype.dispose=function(){return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log("Publisher ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this.userAgent._publishers[this.id],this.options.unpublishOnClose&&this.state===Ze.Published?this.unpublish():(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestExpires=0,this.pubRequestEtag=void 0,Promise.resolve()))},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.publish=function(e,t){if(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.options.body=e,this.pubRequestBody=this.options.body,0===this.pubRequestExpires){if(void 0===this.options.expires)throw new Error("Expires undefined.");this.pubRequestExpires=this.options.expires,this.pubRequestEtag=void 0}return this.sendPublishRequest(),Promise.resolve()},e.prototype.unpublish=function(e){return this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestExpires=0,void 0!==this.pubRequestEtag&&this.sendPublishRequest(),Promise.resolve()},e.prototype.receiveResponse=function(e){var t=this,n=e.statusCode||0;switch(!0){case/^1[0-9]{2}$/.test(n.toString()):break;case/^2[0-9]{2}$/.test(n.toString()):if(e.hasHeader("SIP-ETag")?this.pubRequestEtag=e.getHeader("SIP-ETag"):this.logger.warn("SIP-ETag header missing in a 200-class response to PUBLISH"),e.hasHeader("Expires")){var r=Number(e.getHeader("Expires"));"number"===typeof r&&r>=0&&r<=this.pubRequestExpires?this.pubRequestExpires=r:this.logger.warn("Bad Expires header in a 200-class response to PUBLISH")}else this.logger.warn("Expires header missing in a 200-class response to PUBLISH");0!==this.pubRequestExpires?(this.publishRefreshTimer=setTimeout((function(){return t.refreshRequest()}),900*this.pubRequestExpires),this._state!==Ze.Published&&this.stateTransition(Ze.Published)):this.stateTransition(Ze.Unpublished);break;case/^412$/.test(n.toString()):if(void 0!==this.pubRequestEtag&&0!==this.pubRequestExpires){if(this.logger.warn("412 response to PUBLISH, recovering"),this.pubRequestEtag=void 0,void 0===this.options.body)throw new Error("Body undefined.");this.publish(this.options.body)}else this.logger.warn("412 response to PUBLISH, recovery failed"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break;case/^423$/.test(n.toString()):if(0!==this.pubRequestExpires&&e.hasHeader("Min-Expires")){var o=Number(e.getHeader("Min-Expires"));if("number"===typeof o||o>this.pubRequestExpires){if(this.logger.warn("423 code in response to PUBLISH, adjusting the Expires value and trying to recover"),this.pubRequestExpires=o,void 0===this.options.body)throw new Error("Body undefined.");this.publish(this.options.body)}else this.logger.warn("Bad 423 response Min-Expires header received for PUBLISH"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated)}else this.logger.warn("423 response to PUBLISH, recovery failed"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break;default:this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break}0===this.pubRequestExpires&&(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestEtag=void 0)},e.prototype.send=function(){var e=this;return this.userAgent.userAgentCore.publish(this.request,{onAccept:function(t){return e.receiveResponse(t.message)},onProgress:function(t){return e.receiveResponse(t.message)},onRedirect:function(t){return e.receiveResponse(t.message)},onReject:function(t){return e.receiveResponse(t.message)},onTrying:function(t){return e.receiveResponse(t.message)}})},e.prototype.refreshRequest=function(){if(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,void 0===this.pubRequestEtag)throw new Error("Etag undefined");if(0===this.pubRequestExpires)throw new Error("Expires zero");this.sendPublishRequest()},e.prototype.sendPublishRequest=function(){var e=i({},this.options);e.extraHeaders=(this.options.extraHeaders||[]).slice(),e.extraHeaders.push("Event: "+this.event),e.extraHeaders.push("Expires: "+this.pubRequestExpires),void 0!==this.pubRequestEtag&&e.extraHeaders.push("SIP-If-Match: "+this.pubRequestEtag);var t,n,r=this.target,o=this.options.params||{};if(void 0!==this.pubRequestBody){if(void 0===this.options.contentType)throw new Error("Content type undefined.");t={body:this.pubRequestBody,contentType:this.options.contentType}}return t&&(n=I(t)),this.request=this.userAgent.userAgentCore.makeOutgoingRequestMessage(m.PUBLISH,r,o.fromUri?o.fromUri:this.userAgent.userAgentCore.configuration.aor,o.toUri?o.toUri:this.target,o,e.extraHeaders,n),this.send()},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case Ze.Initial:e!==Ze.Published&&e!==Ze.Unpublished&&e!==Ze.Terminated&&n();break;case Ze.Published:e!==Ze.Unpublished&&e!==Ze.Terminated&&n();break;case Ze.Unpublished:e!==Ze.Published&&e!==Ze.Terminated&&n();break;case Ze.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Publication transitioned to state ".concat(this._state)),this._stateEventEmitter.emit(this._state),e===Ze.Terminated&&this.dispose()}}(),function(e){e["Initial"]="Initial",e["Registered"]="Registered",e["Unregistered"]="Unregistered",e["Terminated"]="Terminated"}(Xe||(Xe={}));var rt,ot=function(){function e(t,n){var r=this;void 0===n&&(n={}),this.disposed=!1,this._contacts=[],this._retryAfter=void 0,this._state=Xe.Initial,this._waiting=!1,this._stateEventEmitter=new Ue,this._waitingEventEmitter=new Ue,this.userAgent=t;var o=t.configuration.uri.clone();if(o.user=void 0,this.options=i(i(i({},e.defaultOptions()),{registrar:o}),e.stripUndefinedProperties(n)),this.options.extraContactHeaderParams=(this.options.extraContactHeaderParams||[]).slice(),this.options.extraHeaders=(this.options.extraHeaders||[]).slice(),!this.options.registrar)throw new Error("Registrar undefined.");if(this.options.registrar=this.options.registrar.clone(),this.options.regId&&!this.options.instanceId?this.options.instanceId=e.newUUID():!this.options.regId&&this.options.instanceId&&(this.options.regId=1),this.options.instanceId&&-1===g.parse(this.options.instanceId,"uuid"))throw new Error("Invalid instanceId.");if(this.options.regId&&this.options.regId<0)throw new Error("Invalid regId.");var s=this.options.registrar,a=this.options.params&&this.options.params.fromUri||t.userAgentCore.configuration.aor,l=this.options.params&&this.options.params.toUri||t.configuration.uri,c=this.options.params||{},u=(n.extraHeaders||[]).slice();if(this.request=t.userAgentCore.makeOutgoingRequestMessage(m.REGISTER,s,a,l,c,u,void 0),this.expires=this.options.expires||e.defaultExpires,this.expires<0)throw new Error("Invalid expires.");if(this.refreshFrequency=this.options.refreshFrequency||e.defaultRefreshFrequency,this.refreshFrequency<50||this.refreshFrequency>99)throw new Error("Invalid refresh frequency. The value represents a percentage of the expiration time and should be between 50 and 99.");this.logger=t.getLogger("sip.Registerer"),this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach((function(e){var t=r.options[e];switch(e){case"registrar":r.logger.log("· "+e+": "+t);break;default:r.logger.log("· "+e+": "+JSON.stringify(t))}}))),this.id=this.request.callId+this.request.from.parameters.tag,this.userAgent._registerers[this.id]=this}return e.defaultOptions=function(){return{expires:e.defaultExpires,extraContactHeaderParams:[],extraHeaders:[],logConfiguration:!0,instanceId:"",params:{},regId:0,registrar:new d("sip","anonymous","anonymous.invalid"),refreshFrequency:e.defaultRefreshFrequency}},e.newUUID=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(16*Math.random()),n="x"===e?t:t%4+8;return n.toString(16)}));return e},e.stripUndefinedProperties=function(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})},Object.defineProperty(e.prototype,"contacts",{get:function(){return this._contacts.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"retryAfter",{get:function(){return this._retryAfter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){var e=this;return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log("Registerer ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this.userAgent._registerers[this.id],new Promise((function(t){var n=function(){if(!e.waiting&&e._state===Xe.Registered)return e.stateChange.addListener((function(){e.terminated(),t()}),{once:!0}),void e.unregister();e.terminated(),t()};e.waiting?e.waitingChange.addListener((function(){n()}),{once:!0}):n()})))},e.prototype.register=function(e){var t=this;if(void 0===e&&(e={}),this.state===Xe.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();var n=new je("REGISTER request already in progress, waiting for final response");return Promise.reject(n)}e.requestOptions&&(this.options=i(i({},this.options),e.requestOptions));var r=(this.options.extraHeaders||[]).slice();r.push("Contact: "+this.generateContactHeader(this.expires)),r.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.request.extraHeaders=r,this.waitingToggle(!0);var o=this.userAgent.userAgentCore.register(this.request,{onAccept:function(n){var r;n.message.hasHeader("expires")&&(r=Number(n.message.getHeader("expires"))),t._contacts=n.message.getHeaders("contact");var o,i=t._contacts.length;if(!i)return t.logger.error("No Contact header in response to REGISTER, dropping response."),void t.unregistered();while(i--){if(o=n.message.parseHeader("contact",i),!o)throw new Error("Contact undefined");if(t.userAgent.contact.pubGruu&&p(o.uri,t.userAgent.contact.pubGruu)){r=Number(o.getParam("expires"));break}if(""===t.userAgent.configuration.contactName){if(o.uri.user===t.userAgent.contact.uri.user){r=Number(o.getParam("expires"));break}}else if(p(o.uri,t.userAgent.contact.uri)){r=Number(o.getParam("expires"));break}o=void 0}if(void 0===o)return t.logger.error("No Contact header pointing to us, dropping response"),t.unregistered(),void t.waitingToggle(!1);if(void 0===r)return t.logger.error("Contact pointing to us is missing expires parameter, dropping response"),t.unregistered(),void t.waitingToggle(!1);if(o.hasParam("temp-gruu")){var s=o.getParam("temp-gruu");s&&(t.userAgent.contact.tempGruu=g.URIParse(s.replace(/"/g,"")))}if(o.hasParam("pub-gruu")){s=o.getParam("pub-gruu");s&&(t.userAgent.contact.pubGruu=g.URIParse(s.replace(/"/g,"")))}t.registered(r),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n),t.waitingToggle(!1)},onProgress:function(t){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)},onRedirect:function(n){t.logger.error("Redirect received. Not supported."),t.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n),t.waitingToggle(!1)},onReject:function(n){if(423===n.message.statusCode)return n.message.hasHeader("min-expires")?(t.expires=Number(n.message.getHeader("min-expires")),t.waitingToggle(!1),void t.register()):(t.logger.error("423 response received for REGISTER without Min-Expires, dropping response"),t.unregistered(),void t.waitingToggle(!1));t.logger.warn("Failed to register, status code ".concat(n.message.statusCode));var r=NaN;if(500===n.message.statusCode||503===n.message.statusCode){var o=n.message.getHeader("retry-after");o&&(r=Number.parseInt(o,void 0))}t._retryAfter=isNaN(r)?void 0:r,t.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n),t._retryAfter=void 0,t.waitingToggle(!1)},onTrying:function(t){e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}});return Promise.resolve(o)},e.prototype.unregister=function(e){var t=this;if(void 0===e&&(e={}),this.state===Xe.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed&&this.state!==Xe.Registered)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();var n=new je("REGISTER request already in progress, waiting for final response");return Promise.reject(n)}this._state===Xe.Registered||e.all||this.logger.warn("Not currently registered, but sending an unregister anyway.");var r=(e.requestOptions&&e.requestOptions.extraHeaders||[]).slice();this.request.extraHeaders=r,e.all?(r.push("Contact: *"),r.push("Expires: 0")):r.push("Contact: "+this.generateContactHeader(0)),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),void 0!==this.registrationTimer&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.waitingToggle(!0);var o=this.userAgent.userAgentCore.register(this.request,{onAccept:function(n){t._contacts=n.message.getHeaders("contact"),t.unregistered(),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n),t.waitingToggle(!1)},onProgress:function(t){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)},onRedirect:function(n){t.logger.error("Unregister redirected. Not currently supported."),t.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n),t.waitingToggle(!1)},onReject:function(n){t.logger.error("Unregister rejected with status code ".concat(n.message.statusCode)),t.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n),t.waitingToggle(!1)},onTrying:function(t){e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}});return Promise.resolve(o)},e.prototype.clearTimers=function(){void 0!==this.registrationTimer&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),void 0!==this.registrationExpiredTimer&&(clearTimeout(this.registrationExpiredTimer),this.registrationExpiredTimer=void 0)},e.prototype.generateContactHeader=function(e){var t=this.userAgent.contact.toString();return this.options.regId&&this.options.instanceId&&(t+=";reg-id="+this.options.regId,t+=';+sip.instance="<urn:uuid:'+this.options.instanceId+'>"'),this.options.extraContactHeaderParams&&this.options.extraContactHeaderParams.forEach((function(e){t+=";"+e})),t+=";expires="+e,t},e.prototype.registered=function(e){var t=this;this.clearTimers(),this.registrationTimer=setTimeout((function(){t.registrationTimer=void 0,t.register()}),this.refreshFrequency/100*e*1e3),this.registrationExpiredTimer=setTimeout((function(){t.logger.warn("Registration expired"),t.unregistered()}),1e3*e),this._state!==Xe.Registered&&this.stateTransition(Xe.Registered)},e.prototype.unregistered=function(){this.clearTimers(),this._state!==Xe.Unregistered&&this.stateTransition(Xe.Unregistered)},e.prototype.terminated=function(){this.clearTimers(),this._state!==Xe.Terminated&&this.stateTransition(Xe.Terminated)},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case Xe.Initial:e!==Xe.Registered&&e!==Xe.Unregistered&&e!==Xe.Terminated&&n();break;case Xe.Registered:e!==Xe.Unregistered&&e!==Xe.Terminated&&n();break;case Xe.Unregistered:e!==Xe.Registered&&e!==Xe.Terminated&&n();break;case Xe.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Registration transitioned to state ".concat(this._state)),this._stateEventEmitter.emit(this._state),e===Xe.Terminated&&this.dispose()},Object.defineProperty(e.prototype,"waiting",{get:function(){return this._waiting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"waitingChange",{get:function(){return this._waitingEventEmitter},enumerable:!1,configurable:!0}),e.prototype.waitingToggle=function(e){if(this._waiting===e)throw new Error("Invalid waiting transition from ".concat(this._waiting," to ").concat(e));this._waiting=e,this.logger.log("Waiting toggled to ".concat(this._waiting)),this._waitingEventEmitter.emit(this._waiting)},e.prototype.waitingWarning=function(){var e="An attempt was made to send a REGISTER request while a prior one was still in progress.";e+=" RFC 3261 requires UAs MUST NOT send a new registration until they have received a final response",e+=" from the registrar for the previous one or the previous REGISTER request has timed out.",e+=" Note that if the transport disconnects, you still must wait for the prior request to time out before",e+=" sending a new REGISTER request or alternatively dispose of the current Registerer and create a new Registerer.",this.logger.warn(e)},e.prototype.stateError=function(){var e=this.state===Xe.Terminated?"is in 'Terminated' state":"has been disposed",t="An attempt was made to send a REGISTER request when the Registerer ".concat(e,".");t+=" The Registerer transitions to 'Terminated' when Registerer.dispose() is called.",t+=" Perhaps you called UserAgent.stop() which dipsoses of all Registerers?",this.logger.error(t)},e.defaultExpires=600,e.defaultRefreshFrequency=99,e}();(function(e){e["Initial"]="Initial",e["NotifyWait"]="NotifyWait",e["Subscribed"]="Subscribed",e["Terminated"]="Terminated"})(rt||(rt={}));var it=function(){function e(e,t){void 0===t&&(t={}),this._disposed=!1,this._state=rt.Initial,this._logger=e.getLogger("sip.Subscription"),this._stateEventEmitter=new Ue,this._userAgent=e,this.delegate=t.delegate}return e.prototype.dispose=function(){return this._disposed||(this._disposed=!0,this._stateEventEmitter.removeAllListeners()),Promise.resolve()},Object.defineProperty(e.prototype,"dialog",{get:function(){return this._dialog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case rt.Initial:e!==rt.NotifyWait&&e!==rt.Terminated&&n();break;case rt.NotifyWait:e!==rt.Subscribed&&e!==rt.Terminated&&n();break;case rt.Subscribed:e!==rt.Terminated&&n();break;case rt.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state!==e&&(this._state=e,this._logger.log("Subscription ".concat(this._dialog?this._dialog.id:void 0," transitioned to ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===rt.Terminated&&this.dispose())},e}();(function(e){function t(t,n,r,o){void 0===o&&(o={});var i=e.call(this,t,o)||this;return i.body=void 0,i.logger=t.getLogger("sip.Subscriber"),o.body&&(i.body={body:o.body,contentType:o.contentType?o.contentType:"application/sdp"}),i.targetURI=n,i.event=r,void 0===o.expires?i.expires=3600:"number"!==typeof o.expires?(i.logger.warn('Option "expires" must be a number. Using default of 3600.'),i.expires=3600):i.expires=o.expires,i.extraHeaders=(o.extraHeaders||[]).slice(),i.subscriberRequest=i.initSubscriberRequest(),i.outgoingRequestMessage=i.subscriberRequest.message,i.id=i.outgoingRequestMessage.callId+i.outgoingRequestMessage.from.parameters.tag+i.event,i._userAgent._subscriptions[i.id]=i,i}o(t,e),t.prototype.dispose=function(){var t=this;return this.disposed?Promise.resolve():(this.logger.log("Subscription ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this._userAgent._subscriptions[this.id],this.retryAfterTimer&&(clearTimeout(this.retryAfterTimer),this.retryAfterTimer=void 0),this.subscriberRequest.dispose(),e.prototype.dispose.call(this).then((function(){if(t.state===rt.Subscribed){if(!t._dialog)throw new Error("Dialog undefined.");if(t._dialog.subscriptionState===ye.Pending||t._dialog.subscriptionState===ye.Active){var e=t._dialog;return new Promise((function(t,n){e.delegate={onTerminated:function(){return t()}},e.unsubscribe()}))}}})))},t.prototype.subscribe=function(e){var t=this;switch(this.subscriberRequest.state){case ye.Initial:this.state===rt.Initial&&this.stateTransition(rt.NotifyWait),this.subscriberRequest.subscribe().then((function(e){e.success?(e.success.subscription&&(t._dialog=e.success.subscription,t._dialog.delegate={onNotify:function(e){return t.onNotify(e)},onRefresh:function(e){return t.onRefresh(e)},onTerminated:function(){t.state!==rt.Terminated&&t.stateTransition(rt.Terminated)}}),t.onNotify(e.success.request)):e.failure&&t.unsubscribe()}));break;case ye.NotifyWait:break;case ye.Pending:break;case ye.Active:if(this._dialog){var n=this._dialog.refresh();n.delegate={onAccept:function(e){return t.onAccepted(e)},onRedirect:function(e){return t.unsubscribe()},onReject:function(e){return t.unsubscribe()}}}break;case ye.Terminated:break}return Promise.resolve()},t.prototype.unsubscribe=function(e){if(this.disposed)return Promise.resolve();switch(this.subscriberRequest.state){case ye.Initial:break;case ye.NotifyWait:break;case ye.Pending:this._dialog&&this._dialog.unsubscribe();break;case ye.Active:this._dialog&&this._dialog.unsubscribe();break;case ye.Terminated:break;default:throw new Error("Unknown state.")}return this.stateTransition(rt.Terminated),Promise.resolve()},t.prototype._refresh=function(){return this.subscriberRequest.state===ye.Active?this.subscribe():Promise.resolve()},t.prototype.onAccepted=function(e){},t.prototype.onNotify=function(e){var t=this;if(this.disposed)e.accept();else{if(this.state!==rt.Subscribed&&this.stateTransition(rt.Subscribed),this.delegate&&this.delegate.onNotify){var n=new We(e);this.delegate.onNotify(n)}else e.accept();var r=e.message.parseHeader("Subscription-State");if(r&&r.state)switch(r.state){case"terminated":if(r.reason)switch(this.logger.log("Terminated subscription with reason ".concat(r.reason)),r.reason){case"deactivated":case"timeout":return this.initSubscriberRequest(),void this.subscribe();case"probation":case"giveup":return this.initSubscriberRequest(),void(r.params&&r.params["retry-after"]?this.retryAfterTimer=setTimeout((function(){t.subscribe()}),r.params["retry-after"]):this.subscribe())}this.unsubscribe();break}}},t.prototype.onRefresh=function(e){var t=this;e.delegate={onAccept:function(e){return t.onAccepted(e)}}},t.prototype.initSubscriberRequest=function(){var e=this,t={extraHeaders:this.extraHeaders,body:this.body?I(this.body):void 0};return this.subscriberRequest=new lt(this._userAgent.userAgentCore,this.targetURI,this.event,this.expires,t),this.subscriberRequest.delegate={onAccept:function(t){return e.onAccepted(t)}},this.subscriberRequest}})(it);var st,at,lt=function(){function e(e,t,n,r,o,i){this.core=e,this.target=t,this.event=n,this.expires=r,this.subscribed=!1,this.logger=e.loggerFactory.getLogger("sip.Subscriber"),this.delegate=i;var s="Allow: "+Se.toString(),a=(o&&o.extraHeaders||[]).slice();a.push(s),a.push("Event: "+this.event),a.push("Expires: "+this.expires),a.push("Contact: "+this.core.configuration.contact.toString());var l=o&&o.body;this.message=e.makeOutgoingRequestMessage(m.SUBSCRIBE,this.target,this.core.configuration.aor,this.target,{},a,l)}return e.prototype.dispose=function(){this.request&&(this.request.waitNotifyStop(),this.request.dispose(),this.request=void 0)},Object.defineProperty(e.prototype,"state",{get:function(){return this.subscription?this.subscription.subscriptionState:this.subscribed?ye.NotifyWait:ye.Initial},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(){var e=this;return this.subscribed?Promise.reject(new Error("Not in initial state. Did you call subscribe more than once?")):(this.subscribed=!0,new Promise((function(t){if(!e.message)throw new Error("Message undefined.");e.request=e.core.subscribe(e.message,{onAccept:function(t){e.delegate&&e.delegate.onAccept&&e.delegate.onAccept(t)},onNotify:function(n){e.subscription=n.subscription,e.subscription&&(e.subscription.autoRefresh=!0),t({success:n})},onNotifyTimeout:function(){t({failure:{}})},onRedirect:function(e){t({failure:{response:e}})},onReject:function(e){t({failure:{response:e}})}})})))},e}();function ct(){return function(e){return e.audio||e.video?void 0===navigator.mediaDevices?Promise.reject(new Error("Media devices not available in insecure contexts.")):navigator.mediaDevices.getUserMedia.call(navigator.mediaDevices,e):Promise.resolve(new MediaStream)}}function ut(){var e={bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",peerIdentity:void 0,rtcpMuxPolicy:"require"};return e}(function(e){e["Connecting"]="Connecting",e["Connected"]="Connected",e["Disconnecting"]="Disconnecting",e["Disconnected"]="Disconnected"})(st||(st={})),function(e){e["Started"]="Started",e["Stopped"]="Stopped"}(at||(at={}));var dt=function(){function e(e,t,n){e.debug("SessionDescriptionHandler.constructor"),this.logger=e,this.mediaStreamFactory=t,this.sessionDescriptionHandlerConfiguration=n,this._localMediaStream=new MediaStream,this._remoteMediaStream=new MediaStream,this._peerConnection=new RTCPeerConnection(null===n||void 0===n?void 0:n.peerConnectionConfiguration),this.initPeerConnectionEventHandlers()}return Object.defineProperty(e.prototype,"localMediaStream",{get:function(){return this._localMediaStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteMediaStream",{get:function(){return this._remoteMediaStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataChannel",{get:function(){return this._dataChannel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerConnection",{get:function(){return this._peerConnection},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerConnectionDelegate",{get:function(){return this._peerConnectionDelegate},set:function(e){this._peerConnectionDelegate=e},enumerable:!1,configurable:!0}),e.dispatchAddTrackEvent=function(e,t){e.dispatchEvent(new MediaStreamTrackEvent("addtrack",{track:t}))},e.dispatchRemoveTrackEvent=function(e,t){e.dispatchEvent(new MediaStreamTrackEvent("removetrack",{track:t}))},e.prototype.close=function(){this.logger.debug("SessionDescriptionHandler.close"),void 0!==this._peerConnection&&(this._peerConnection.getReceivers().forEach((function(e){e.track&&e.track.stop()})),this._peerConnection.getSenders().forEach((function(e){e.track&&e.track.stop()})),this._dataChannel&&this._dataChannel.close(),this._peerConnection.close(),this._peerConnection=void 0)},e.prototype.getDescription=function(e,t){var n,r,o=this;if(this.logger.debug("SessionDescriptionHandler.getDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=null===e||void 0===e?void 0:e.onDataChannel;var i=null===(n=null===e||void 0===e?void 0:e.offerOptions)||void 0===n?void 0:n.iceRestart,s=void 0===(null===e||void 0===e?void 0:e.iceGatheringTimeout)?null===(r=this.sessionDescriptionHandlerConfiguration)||void 0===r?void 0:r.iceGatheringTimeout:null===e||void 0===e?void 0:e.iceGatheringTimeout;return this.getLocalMediaStream(e).then((function(){return o.updateDirection(e)})).then((function(){return o.createDataChannel(e)})).then((function(){return o.createLocalOfferOrAnswer(e)})).then((function(e){return o.applyModifiers(e,t)})).then((function(e){return o.setLocalSessionDescription(e)})).then((function(){return o.waitForIceGatheringComplete(i,s)})).then((function(){return o.getLocalSessionDescription()})).then((function(e){return{body:e.sdp,contentType:"application/sdp"}})).catch((function(e){throw o.logger.error("SessionDescriptionHandler.getDescription failed - "+e),e}))},e.prototype.hasDescription=function(e){return this.logger.debug("SessionDescriptionHandler.hasDescription"),"application/sdp"===e},e.prototype.sendDtmf=function(e,t){if(this.logger.debug("SessionDescriptionHandler.sendDtmf"),void 0===this._peerConnection)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - peer connection closed"),!1;var n=this._peerConnection.getSenders();if(0===n.length)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no senders"),!1;var r=n[0].dtmf;if(!r)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no DTMF sender"),!1;var o=null===t||void 0===t?void 0:t.duration,i=null===t||void 0===t?void 0:t.interToneGap;try{r.insertDTMF(e,o,i)}catch(s){return this.logger.error(s),!1}return this.logger.log("SessionDescriptionHandler.sendDtmf sent via RTP: "+e.toString()),!0},e.prototype.setDescription=function(e,t,n){var r=this;if(this.logger.debug("SessionDescriptionHandler.setDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=null===t||void 0===t?void 0:t.onDataChannel;var o="have-local-offer"===this._peerConnection.signalingState?"answer":"offer";return this.getLocalMediaStream(t).then((function(){return r.applyModifiers({sdp:e,type:o},n)})).then((function(e){return r.setRemoteSessionDescription(e)})).catch((function(e){throw r.logger.error("SessionDescriptionHandler.setDescription failed - "+e),e}))},e.prototype.applyModifiers=function(e,t){var n=this;return this.logger.debug("SessionDescriptionHandler.applyModifiers"),t&&0!==t.length?t.reduce((function(e,t){return e.then(t)}),Promise.resolve(e)).then((function(e){if(n.logger.debug("SessionDescriptionHandler.applyModifiers - modified sdp"),!e.sdp||!e.type)throw new Error("Invalid SDP.");return{sdp:e.sdp,type:e.type}})):Promise.resolve(e)},e.prototype.createDataChannel=function(e){if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));if(!0!==(null===e||void 0===e?void 0:e.dataChannel))return Promise.resolve();if(this._dataChannel)return Promise.resolve();switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.createDataChannel - creating data channel");try{return this._dataChannel=this._peerConnection.createDataChannel((null===e||void 0===e?void 0:e.dataChannelLabel)||"",null===e||void 0===e?void 0:e.dataChannelOptions),this.onDataChannel&&this.onDataChannel(this._dataChannel),Promise.resolve()}catch(t){return Promise.reject(t)}case"have-remote-offer":return Promise.resolve();case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}},e.prototype.createLocalOfferOrAnswer=function(e){if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP offer"),this._peerConnection.createOffer(null===e||void 0===e?void 0:e.offerOptions);case"have-remote-offer":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP answer"),this._peerConnection.createAnswer(null===e||void 0===e?void 0:e.answerOptions);case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}},e.prototype.getLocalMediaStream=function(e){var t=this;if(this.logger.debug("SessionDescriptionHandler.getLocalMediaStream"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var n=i({},null===e||void 0===e?void 0:e.constraints);if(this.localMediaStreamConstraints){if(n.audio=n.audio||this.localMediaStreamConstraints.audio,n.video=n.video||this.localMediaStreamConstraints.video,JSON.stringify(this.localMediaStreamConstraints.audio)===JSON.stringify(n.audio)&&JSON.stringify(this.localMediaStreamConstraints.video)===JSON.stringify(n.video))return Promise.resolve()}else void 0===n.audio&&void 0===n.video&&(n={audio:!0});return this.localMediaStreamConstraints=n,this.mediaStreamFactory(n,this).then((function(e){return t.setLocalMediaStream(e)}))},e.prototype.setLocalMediaStream=function(t){var n=this;if(this.logger.debug("SessionDescriptionHandler.setLocalMediaStream"),!this._peerConnection)throw new Error("Peer connection undefined.");var r=this._peerConnection,o=this._localMediaStream,i=[],s=function(t){var s=t.kind;if("audio"!==s&&"video"!==s)throw new Error("Unknown new track kind ".concat(s,"."));var a=r.getSenders().find((function(e){return e.track&&e.track.kind===s}));a?i.push(new Promise((function(e){n.logger.debug("SessionDescriptionHandler.setLocalMediaStream - replacing sender ".concat(s," track")),e()})).then((function(){return a.replaceTrack(t).then((function(){var n=o.getTracks().find((function(e){return e.kind===s}));n&&(n.stop(),o.removeTrack(n),e.dispatchRemoveTrackEvent(o,n)),o.addTrack(t),e.dispatchAddTrackEvent(o,t)})).catch((function(e){throw n.logger.error("SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ".concat(s," track")),e}))}))):i.push(new Promise((function(e){n.logger.debug("SessionDescriptionHandler.setLocalMediaStream - adding sender ".concat(s," track")),e()})).then((function(){try{r.addTrack(t,o)}catch(i){throw n.logger.error("SessionDescriptionHandler.setLocalMediaStream - failed to add sender ".concat(s," track")),i}o.addTrack(t),e.dispatchAddTrackEvent(o,t)})))},a=t.getAudioTracks();a.length&&s(a[0]);var l=t.getVideoTracks();return l.length&&s(l[0]),i.reduce((function(e,t){return e.then((function(){return t}))}),Promise.resolve())},e.prototype.getLocalSessionDescription=function(){if(this.logger.debug("SessionDescriptionHandler.getLocalSessionDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var e=this._peerConnection.localDescription;return e?Promise.resolve(e):Promise.reject(new Error("Failed to get local session description"))},e.prototype.setLocalSessionDescription=function(e){return this.logger.debug("SessionDescriptionHandler.setLocalSessionDescription"),void 0===this._peerConnection?Promise.reject(new Error("Peer connection closed.")):this._peerConnection.setLocalDescription(e)},e.prototype.setRemoteSessionDescription=function(e){if(this.logger.debug("SessionDescriptionHandler.setRemoteSessionDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var t,n=e.sdp;switch(this._peerConnection.signalingState){case"stable":t="offer";break;case"have-local-offer":t="answer";break;case"have-local-pranswer":case"have-remote-offer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return n?this._peerConnection.setRemoteDescription({sdp:n,type:t}):(this.logger.error("SessionDescriptionHandler.setRemoteSessionDescription failed - cannot set null sdp"),Promise.reject(new Error("SDP is undefined")))},e.prototype.setRemoteTrack=function(t){this.logger.debug("SessionDescriptionHandler.setRemoteTrack");var n=this._remoteMediaStream;n.getTrackById(t.id)?this.logger.debug("SessionDescriptionHandler.setRemoteTrack - have remote ".concat(t.kind," track")):"audio"===t.kind?(this.logger.debug("SessionDescriptionHandler.setRemoteTrack - adding remote ".concat(t.kind," track")),n.getAudioTracks().forEach((function(t){t.stop(),n.removeTrack(t),e.dispatchRemoveTrackEvent(n,t)})),n.addTrack(t),e.dispatchAddTrackEvent(n,t)):"video"===t.kind&&(this.logger.debug("SessionDescriptionHandler.setRemoteTrack - adding remote ".concat(t.kind," track")),n.getVideoTracks().forEach((function(t){t.stop(),n.removeTrack(t),e.dispatchRemoveTrackEvent(n,t)})),n.addTrack(t),e.dispatchAddTrackEvent(n,t))},e.prototype.updateDirection=function(e){var t=this;if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.updateDirection - setting offer direction");var n=function(t){switch(t){case"inactive":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"recvonly":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"sendonly":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";case"sendrecv":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";case"stopped":return"stopped";default:throw new Error("Should never happen")}};this._peerConnection.getTransceivers().forEach((function(e){if(e.direction){var t=n(e.direction);e.direction!==t&&(e.direction=t)}}));break;case"have-remote-offer":this.logger.debug("SessionDescriptionHandler.updateDirection - setting answer direction");var r=function(){var e=t._peerConnection.remoteDescription;if(!e)throw new Error("Failed to read remote offer");var n=/a=sendrecv\r\n|a=sendonly\r\n|a=recvonly\r\n|a=inactive\r\n/.exec(e.sdp);if(n)switch(n[0]){case"a=inactive\r\n":return"inactive";case"a=recvonly\r\n":return"recvonly";case"a=sendonly\r\n":return"sendonly";case"a=sendrecv\r\n":return"sendrecv";default:throw new Error("Should never happen")}return"sendrecv"}(),o=function(){switch(r){case"inactive":return"inactive";case"recvonly":return"sendonly";case"sendonly":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"sendrecv":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";default:throw new Error("Should never happen")}}();this._peerConnection.getTransceivers().forEach((function(e){e.direction&&"stopped"!==e.direction&&e.direction!==o&&(e.direction=o)}));break;case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return Promise.resolve()},e.prototype.iceGatheringComplete=function(){this.logger.debug("SessionDescriptionHandler.iceGatheringComplete"),void 0!==this.iceGatheringCompleteTimeoutId&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - clearing timeout"),clearTimeout(this.iceGatheringCompleteTimeoutId),this.iceGatheringCompleteTimeoutId=void 0),void 0!==this.iceGatheringCompletePromise&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - resolving promise"),this.iceGatheringCompleteResolve&&this.iceGatheringCompleteResolve(),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0)},e.prototype.waitForIceGatheringComplete=function(e,t){var n=this;return void 0===e&&(e=!1),void 0===t&&(t=0),this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete"),void 0===this._peerConnection?Promise.reject("Peer connection closed."):e||"complete"!==this._peerConnection.iceGatheringState?(void 0!==this.iceGatheringCompletePromise&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - rejecting prior waiting promise"),this.iceGatheringCompleteReject&&this.iceGatheringCompleteReject(new Error("Promise superseded.")),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0),this.iceGatheringCompletePromise=new Promise((function(e,r){n.iceGatheringCompleteResolve=e,n.iceGatheringCompleteReject=r,t>0&&(n.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout in "+t),n.iceGatheringCompleteTimeoutId=setTimeout((function(){n.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout"),n.iceGatheringComplete()}),t))})),this.iceGatheringCompletePromise):(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - already complete"),Promise.resolve())},e.prototype.initPeerConnectionEventHandlers=function(){var e=this;if(this.logger.debug("SessionDescriptionHandler.initPeerConnectionEventHandlers"),!this._peerConnection)throw new Error("Peer connection undefined.");var t=this._peerConnection;t.onconnectionstatechange=function(n){var r,o=t.connectionState;e.logger.debug("SessionDescriptionHandler.onconnectionstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onconnectionstatechange)&&e._peerConnectionDelegate.onconnectionstatechange(n)},t.ondatachannel=function(t){var n;e.logger.debug("SessionDescriptionHandler.ondatachannel"),e._dataChannel=t.channel,e.onDataChannel&&e.onDataChannel(e._dataChannel),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.ondatachannel)&&e._peerConnectionDelegate.ondatachannel(t)},t.onicecandidate=function(t){var n;e.logger.debug("SessionDescriptionHandler.onicecandidate"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onicecandidate)&&e._peerConnectionDelegate.onicecandidate(t)},t.onicecandidateerror=function(t){var n;e.logger.debug("SessionDescriptionHandler.onicecandidateerror"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onicecandidateerror)&&e._peerConnectionDelegate.onicecandidateerror(t)},t.oniceconnectionstatechange=function(n){var r,o=t.iceConnectionState;e.logger.debug("SessionDescriptionHandler.oniceconnectionstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.oniceconnectionstatechange)&&e._peerConnectionDelegate.oniceconnectionstatechange(n)},t.onicegatheringstatechange=function(n){var r,o=t.iceGatheringState;e.logger.debug("SessionDescriptionHandler.onicegatheringstatechange ".concat(o)),"complete"===o&&e.iceGatheringComplete(),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onicegatheringstatechange)&&e._peerConnectionDelegate.onicegatheringstatechange(n)},t.onnegotiationneeded=function(t){var n;e.logger.debug("SessionDescriptionHandler.onnegotiationneeded"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onnegotiationneeded)&&e._peerConnectionDelegate.onnegotiationneeded(t)},t.onsignalingstatechange=function(n){var r,o=t.signalingState;e.logger.debug("SessionDescriptionHandler.onsignalingstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onsignalingstatechange)&&e._peerConnectionDelegate.onsignalingstatechange(n)},t.onstatsended=function(t){var n;e.logger.debug("SessionDescriptionHandler.onstatsended"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onstatsended)&&e._peerConnectionDelegate.onstatsended(t)},t.ontrack=function(t){var n,r=t.track.kind,o=t.track.enabled?"enabled":"disabled";e.logger.debug("SessionDescriptionHandler.ontrack ".concat(r," ").concat(o)),e.setRemoteTrack(t.track),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.ontrack)&&e._peerConnectionDelegate.ontrack(t)}},e}();function pt(e){return function(t,n){void 0===e&&(e=ct());var r=void 0!==(null===n||void 0===n?void 0:n.iceGatheringTimeout)?null===n||void 0===n?void 0:n.iceGatheringTimeout:5e3,o={iceGatheringTimeout:r,peerConnectionConfiguration:i(i({},ut()),null===n||void 0===n?void 0:n.peerConnectionConfiguration)},s=t.userAgent.getLogger("sip.SessionDescriptionHandler");return new dt(s,e,o)}}var ht=function(){function e(t,n){if(this._state=st.Disconnected,this.transitioningState=!1,this._stateEventEmitter=new Ue,this.logger=t,n){var r=n,o=null===r||void 0===r?void 0:r.wsServers,s=null===r||void 0===r?void 0:r.maxReconnectionAttempts;if(void 0!==o){var a='The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(a)}if(void 0!==s){a='The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(a)}o&&!n.server&&("string"===typeof o&&(n.server=o),o instanceof Array&&(n.server=o[0]))}this.configuration=i(i({},e.defaultOptions),n);var l=this.configuration.server,c=g.parse(l,"absoluteURI");if(-1===c)throw this.logger.error('Invalid WebSocket Server URL "'.concat(l,'"')),new Error("Invalid WebSocket Server URL");if(!["wss","ws","udp"].includes(c.scheme))throw this.logger.error('Invalid scheme in WebSocket Server URL "'.concat(l,'"')),new Error("Invalid scheme in WebSocket Server URL");this._protocol=c.scheme.toUpperCase()}return e.prototype.dispose=function(){return this.disconnect()},Object.defineProperty(e.prototype,"protocol",{get:function(){return this._protocol},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"server",{get:function(){return this.configuration.server},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ws",{get:function(){return this._ws},enumerable:!1,configurable:!0}),e.prototype.connect=function(){return this._connect()},e.prototype.disconnect=function(){return this._disconnect()},e.prototype.isConnected=function(){return this.state===st.Connected},e.prototype.send=function(e){return this._send(e)},e.prototype._connect=function(){var e,t=this;switch(this.logger.log("Connecting ".concat(this.server)),this.state){case st.Connecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Connecting));if(!this.connectPromise)throw new Error("Connect promise must be defined.");return this.connectPromise;case st.Connected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Connecting));if(this.connectPromise)throw new Error("Connect promise must not be defined.");return Promise.resolve();case st.Disconnecting:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(st.Connecting)}catch(n){if(n instanceof Le)return Promise.reject(n);throw n}break;case st.Disconnected:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(st.Connecting)}catch(n){if(n instanceof Le)return Promise.reject(n);throw n}break;default:throw new Error("Unknown state")}try{e=new WebSocket(this.server,"sip"),e.binaryType="arraybuffer",e.addEventListener("close",(function(n){return t.onWebSocketClose(n,e)})),e.addEventListener("error",(function(n){return t.onWebSocketError(n,e)})),e.addEventListener("open",(function(n){return t.onWebSocketOpen(n,e)})),e.addEventListener("message",(function(n){return t.onWebSocketMessage(n,e)})),this._ws=e}catch(r){return this._ws=void 0,this.logger.error("WebSocket construction failed."),this.logger.error(r),new Promise((function(e,n){t.connectResolve=e,t.connectReject=n,t.transitionState(st.Disconnected,r)}))}return this.connectPromise=new Promise((function(n,r){t.connectResolve=n,t.connectReject=r,t.connectTimeout=setTimeout((function(){t.logger.warn("Connect timed out. Exceeded time set in configuration.connectionTimeout: "+t.configuration.connectionTimeout+"s."),e.close(1e3)}),1e3*t.configuration.connectionTimeout)})),this.connectPromise},e.prototype._disconnect=function(){var e=this;switch(this.logger.log("Disconnecting ".concat(this.server)),this.state){case st.Connecting:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(st.Disconnecting)}catch(n){if(n instanceof Le)return Promise.reject(n);throw n}break;case st.Connected:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(st.Disconnecting)}catch(n){if(n instanceof Le)return Promise.reject(n);throw n}break;case st.Disconnecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Disconnecting));if(!this.disconnectPromise)throw new Error("Disconnect promise must be defined.");return this.disconnectPromise;case st.Disconnected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Disconnecting));if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");return Promise.resolve();default:throw new Error("Unknown state")}if(!this._ws)throw new Error("WebSocket must be defined.");var t=this._ws;return this.disconnectPromise=new Promise((function(n,r){e.disconnectResolve=n,e.disconnectReject=r;try{t.close(1e3)}catch(o){throw e.logger.error("WebSocket close failed."),e.logger.error(o),o}})),this.disconnectPromise},e.prototype._send=function(e){if(!0===this.configuration.traceSip&&this.logger.log("Sending WebSocket message:\n\n"+e+"\n"),this._state!==st.Connected)return Promise.reject(new Error("Not connected."));if(!this._ws)throw new Error("WebSocket undefined.");try{this._ws.send(e)}catch(t){return t instanceof Error?Promise.reject(t):Promise.reject(new Error("WebSocket send failed."))}return Promise.resolve()},e.prototype.onWebSocketClose=function(e,t){if(t===this._ws){var n="WebSocket closed ".concat(this.server," (code: ").concat(e.code,")"),r=this.disconnectPromise?void 0:new Error(n);r&&this.logger.warn("WebSocket closed unexpectedly"),this.logger.log(n),this._ws=void 0,this.transitionState(st.Disconnected,r)}},e.prototype.onWebSocketError=function(e,t){t===this._ws&&this.logger.error("WebSocket error occurred.")},e.prototype.onWebSocketMessage=function(e,t){if(t===this._ws){var n,r=e.data;if(/^(\r\n)+$/.test(r))return this.clearKeepAliveTimeout(),void(!0===this.configuration.traceSip&&this.logger.log("Received WebSocket message with CRLF Keep Alive response"));if(r){if("string"!==typeof r){try{n=(new TextDecoder).decode(new Uint8Array(r))}catch(o){return this.logger.error(o),void this.logger.error("Received WebSocket binary message failed to be converted into string, message discarded")}!0===this.configuration.traceSip&&this.logger.log("Received WebSocket binary message:\n\n"+n+"\n")}else n=r,!0===this.configuration.traceSip&&this.logger.log("Received WebSocket text message:\n\n"+n+"\n");if(this.state===st.Connected){if(this.onMessage)try{this.onMessage(n)}catch(i){throw this.logger.error(i),this.logger.error("Exception thrown by onMessage callback"),i}}else this.logger.warn("Received message while not connected, discarding...")}else this.logger.warn("Received empty message, discarding...")}},e.prototype.onWebSocketOpen=function(e,t){t===this._ws&&this._state===st.Connecting&&(this.logger.log("WebSocket opened ".concat(this.server)),this.transitionState(st.Connected))},e.prototype.transitionLoopDetectedError=function(e){var t="A state transition loop has been detected.";return t+=" An attempt to transition from ".concat(this._state," to ").concat(e," before the prior transition completed."),t+=" Perhaps you are synchronously calling connect() or disconnect() from a callback or state change handler?",this.logger.error(t),new Le("Loop detected.")},e.prototype.transitionState=function(e,t){var n=this,r=function(){throw new Error("Invalid state transition from ".concat(n._state," to ").concat(e))};if(this.transitioningState)throw this.transitionLoopDetectedError(e);switch(this.transitioningState=!0,this._state){case st.Connecting:e!==st.Connected&&e!==st.Disconnecting&&e!==st.Disconnected&&r();break;case st.Connected:e!==st.Disconnecting&&e!==st.Disconnected&&r();break;case st.Disconnecting:e!==st.Connecting&&e!==st.Disconnected&&r();break;case st.Disconnected:e!==st.Connecting&&r();break;default:throw new Error("Unknown state.")}var o=this._state;this._state=e;var i=this.connectResolve,s=this.connectReject;o===st.Connecting&&(this.connectPromise=void 0,this.connectResolve=void 0,this.connectReject=void 0);var a=this.disconnectResolve,l=this.disconnectReject;if(o===st.Disconnecting&&(this.disconnectPromise=void 0,this.disconnectResolve=void 0,this.disconnectReject=void 0),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0),this.logger.log("Transitioned from ".concat(o," to ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===st.Connected&&(this.startSendingKeepAlives(),this.onConnect))try{this.onConnect()}catch(c){throw this.logger.error(c),this.logger.error("Exception thrown by onConnect callback"),c}if(o===st.Connected&&(this.stopSendingKeepAlives(),this.onDisconnect))try{t?this.onDisconnect(t):this.onDisconnect()}catch(c){throw this.logger.error(c),this.logger.error("Exception thrown by onDisconnect callback"),c}if(o===st.Connecting){if(!i)throw new Error("Connect resolve undefined.");if(!s)throw new Error("Connect reject undefined.");e===st.Connected?i():s(t||new Error("Connect aborted."))}if(o===st.Disconnecting){if(!a)throw new Error("Disconnect resolve undefined.");if(!l)throw new Error("Disconnect reject undefined.");e===st.Disconnected?a():l(t||new Error("Disconnect aborted."))}this.transitioningState=!1},e.prototype.clearKeepAliveTimeout=function(){this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveDebounceTimeout=void 0},e.prototype.sendKeepAlive=function(){var e=this;return this.keepAliveDebounceTimeout?Promise.resolve():(this.keepAliveDebounceTimeout=setTimeout((function(){e.clearKeepAliveTimeout()}),1e3*this.configuration.keepAliveDebounce),this.send("\r\n\r\n"))},e.prototype.startSendingKeepAlives=function(){var e=this,t=function(e){var t=.8*e;return 1e3*(Math.random()*(e-t)+t)};this.configuration.keepAliveInterval&&!this.keepAliveInterval&&(this.keepAliveInterval=setInterval((function(){e.sendKeepAlive(),e.startSendingKeepAlives()}),t(this.configuration.keepAliveInterval)))},e.prototype.stopSendingKeepAlives=function(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval),this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveInterval=void 0,this.keepAliveDebounceTimeout=void 0},e.defaultOptions={server:"",connectionTimeout:5,keepAliveInterval:0,keepAliveDebounce:10,traceSip:!0},e}(),ft=function(){function e(t){var n=this;if(void 0===t&&(t={}),this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this._state=at.Stopped,this.unloadListener=function(){n.stop()},this._stateEventEmitter=new Ue,this.delegate=t.delegate,this.options=i(i(i(i(i({},e.defaultOptions()),{sipjsId:b(5)}),{uri:new d("sip","anonymous."+b(6),"anonymous.invalid")}),{viaHost:b(12)+".invalid"}),e.stripUndefinedProperties(t)),this.options.hackIpInContact)if("boolean"===typeof this.options.hackIpInContact&&this.options.hackIpInContact){var r=1,o=254,s=Math.floor(Math.random()*(o-r+1)+r);this.options.viaHost="192.0.2."+s}else this.options.hackIpInContact&&(this.options.viaHost=this.options.hackIpInContact);switch(this.loggerFactory=new xe,this.logger=this.loggerFactory.getLogger("sip.UserAgent"),this.loggerFactory.builtinEnabled=this.options.logBuiltinEnabled,this.loggerFactory.connector=this.options.logConnector,this.options.logLevel){case"error":this.loggerFactory.level=Ce.error;break;case"warn":this.loggerFactory.level=Ce.warn;break;case"log":this.loggerFactory.level=Ce.log;break;case"debug":this.loggerFactory.level=Ce.debug;break}if(this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach((function(e){var t=n.options[e];switch(e){case"uri":case"sessionDescriptionHandlerFactory":n.logger.log("· "+e+": "+t);break;case"authorizationPassword":n.logger.log("· "+e+": NOT SHOWN");break;case"transportConstructor":n.logger.log("· "+e+": "+t.name);break;default:n.logger.log("· "+e+": "+JSON.stringify(t))}}))),this.options.transportOptions){var a=this.options.transportOptions,l=a.maxReconnectionAttempts,c=a.reconnectionTimeout;if(void 0!==l){var u='The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}if(void 0!==c){u='The transport option "reconnectionTimeout" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}void 0===t.reconnectionDelay&&void 0!==c&&(this.options.reconnectionDelay=c),void 0===t.reconnectionAttempts&&void 0!==l&&(this.options.reconnectionAttempts=l)}if(void 0!==t.reconnectionDelay){u='The user agent option "reconnectionDelay" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}if(void 0!==t.reconnectionAttempts){u='The user agent option "reconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}this._transport=new this.options.transportConstructor(this.getLogger("sip.Transport"),this.options.transportOptions),this.initTransportCallbacks(),this._contact=this.initContact(),this._userAgentCore=this.initCore(),this.options.autoStart&&this.start()}return e.makeURI=function(e){return g.URIParse(e)},e.defaultOptions=function(){return{allowLegacyNotifications:!1,authorizationHa1:"",authorizationPassword:"",authorizationUsername:"",autoStart:!1,autoStop:!0,delegate:{},contactName:"",contactParams:{transport:"ws"},displayName:"",forceRport:!1,hackAllowUnregisteredOptionTags:!1,hackIpInContact:!1,hackViaTcp:!1,logBuiltinEnabled:!0,logConfiguration:!0,logConnector:function(){},logLevel:"log",noAnswerTimeout:60,preloadedRouteSet:[],reconnectionAttempts:0,reconnectionDelay:4,sendInitialProvisionalResponse:!0,sessionDescriptionHandlerFactory:pt(),sessionDescriptionHandlerFactoryOptions:{},sipExtension100rel:Ye.Unsupported,sipExtensionReplaces:Ye.Unsupported,sipExtensionExtraSupported:[],sipjsId:"",transportConstructor:ht,transportOptions:{},uri:new d("sip","anonymous","anonymous.invalid"),userAgentString:"SIP.js/"+l,viaHost:""}},e.stripUndefinedProperties=function(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})},Object.defineProperty(e.prototype,"configuration",{get:function(){return this.options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contact",{get:function(){return this._contact},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this._transport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgentCore",{get:function(){return this._userAgentCore},enumerable:!1,configurable:!0}),e.prototype.getLogger=function(e,t){return this.loggerFactory.getLogger(e,t)},e.prototype.getLoggerFactory=function(){return this.loggerFactory},e.prototype.isConnected=function(){return this.transport.isConnected()},e.prototype.reconnect=function(){var e=this;return this.state===at.Stopped?Promise.reject(new Error("User agent stopped.")):Promise.resolve().then((function(){return e.transport.connect()}))},e.prototype.start=function(){if(this.state===at.Started)return this.logger.warn("User agent already started"),Promise.resolve();if(this.logger.log("Starting ".concat(this.configuration.uri)),this.transitionState(at.Started),this.options.autoStop){var e=!("undefined"===typeof chrome||!chrome.app||!chrome.app.runtime);"undefined"===typeof window||"function"!==typeof window.addEventListener||e||window.addEventListener("unload",this.unloadListener)}return this.transport.connect()},e.prototype.stop=function(){return s(this,void 0,void 0,(function(){var e,t,n,r,o,s,l,c,u,d,p,h,f,g,m,v,y,b,w,C,S,E,T,k,x,N,R,I,_=this;return a(this,(function(O){switch(O.label){case 0:if(this.state===at.Stopped)return this.logger.warn("User agent already stopped"),[2,Promise.resolve()];for(p in this.logger.log("Stopping ".concat(this.configuration.uri)),this.transitionState(at.Stopped),this.options.autoStop&&(e=!("undefined"===typeof chrome||!chrome.app||!chrome.app.runtime),"undefined"!==typeof window&&window.removeEventListener&&!e&&window.removeEventListener("unload",this.unloadListener)),t=i({},this._publishers),n=i({},this._registerers),r=i({},this._sessions),o=i({},this._subscriptions),s=this.transport,l=this.userAgentCore,this.logger.log("Dispose of registerers"),c=function(e){return a(this,(function(t){switch(t.label){case 0:return n[e]?[4,n[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._registerers[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},u=n,d=[],u)d.push(p);h=0,O.label=1;case 1:return h<d.length?(p=d[h],p in u?(I=p,[5,c(I)]):[3,3]):[3,4];case 2:O.sent(),O.label=3;case 3:return h++,[3,1];case 4:for(v in this.logger.log("Dispose of sessions"),f=function(e){return a(this,(function(t){switch(t.label){case 0:return r[e]?[4,r[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._sessions[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},g=r,m=[],g)m.push(v);y=0,O.label=5;case 5:return y<m.length?(v=m[y],v in g?(I=v,[5,f(I)]):[3,7]):[3,8];case 6:O.sent(),O.label=7;case 7:return y++,[3,5];case 8:for(S in this.logger.log("Dispose of subscriptions"),b=function(e){return a(this,(function(t){switch(t.label){case 0:return o[e]?[4,o[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._subscriptions[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},w=o,C=[],w)C.push(S);E=0,O.label=9;case 9:return E<C.length?(S=C[E],S in w?(I=S,[5,b(I)]):[3,11]):[3,12];case 10:O.sent(),O.label=11;case 11:return E++,[3,9];case 12:for(N in this.logger.log("Dispose of publishers"),T=function(e){return a(this,(function(n){switch(n.label){case 0:return t[e]?[4,t[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._publishers[e],t}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))},k=t,x=[],k)x.push(N);R=0,O.label=13;case 13:return R<x.length?(N=x[R],N in k?(I=N,[5,T(I)]):[3,15]):[3,16];case 14:O.sent(),O.label=15;case 15:return R++,[3,13];case 16:return this.logger.log("Dispose of transport"),[4,s.dispose().catch((function(e){throw _.logger.error(e.message),e}))];case 17:return O.sent(),this.logger.log("Dispose of core"),l.dispose(),[2]}}))}))},e.prototype._makeInviter=function(e,t){return new tt(this,e,t)},e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=this.options.reconnectionAttempts,r=this.options.reconnectionDelay;e>n?this.logger.log("Maximum reconnection attempts reached"):(this.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - trying")),setTimeout((function(){t.reconnect().then((function(){t.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - succeeded"))})).catch((function(r){t.logger.error(r.message),t.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - failed")),t.attemptReconnection(++e)}))}),1===e?0:1e3*r))},e.prototype.initContact=function(){var e=this,t=""!==this.options.contactName?this.options.contactName:b(8),n=this.options.contactParams,r={pubGruu:void 0,tempGruu:void 0,uri:new d("sip",t,this.options.viaHost,void 0,n),toString:function(t){void 0===t&&(t={});var r=t.anonymous||!1,o=t.outbound||!1,i="<";return i+=r?e.contact.tempGruu||"sip:anonymous@anonymous.invalid;transport=".concat(n.transport?n.transport:"ws"):e.contact.pubGruu||e.contact.uri,o&&(i+=";ob"),i+=">",i}};return r},e.prototype.initCore=function(){var e=this,t=[];t.push("outbound"),this.options.sipExtension100rel===Ye.Supported&&t.push("100rel"),this.options.sipExtensionReplaces===Ye.Supported&&t.push("replaces"),this.options.sipExtensionExtraSupported&&t.push.apply(t,this.options.sipExtensionExtraSupported),this.options.hackAllowUnregisteredOptionTags||(t=t.filter((function(e){return Qe[e]}))),t=Array.from(new Set(t));var n=t.slice();(this.contact.pubGruu||this.contact.tempGruu)&&n.push("gruu");var r={aor:this.options.uri,contact:this.contact,displayName:this.options.displayName,loggerFactory:this.loggerFactory,hackViaTcp:this.options.hackViaTcp,routeSet:this.options.preloadedRouteSet,supportedOptionTags:t,supportedOptionTagsResponse:n,sipjsId:this.options.sipjsId,userAgentHeaderFieldValue:this.options.userAgentString,viaForceRport:this.options.forceRport,viaHost:this.options.viaHost,authenticationFactory:function(){var t=e.options.authorizationUsername?e.options.authorizationUsername:e.options.uri.user,n=e.options.authorizationPassword?e.options.authorizationPassword:void 0,r=e.options.authorizationHa1?e.options.authorizationHa1:void 0;return new P(e.getLoggerFactory(),r,t,n)},transportAccessor:function(){return e.transport}},o={onInvite:function(t){var n,r=new et(e,t);if(t.delegate={onCancel:function(e){r._onCancel(e)},onTransportError:function(t){e.logger.error("A transport error has occurred while handling an incoming INVITE request.")}},t.trying(),e.options.sipExtensionReplaces!==Ye.Unsupported){var o=t.message,i=o.parseHeader("replaces");if(i){var s=i.call_id;if("string"!==typeof s)throw new Error("Type of call id is not string");var a=i.replaces_to_tag;if("string"!==typeof a)throw new Error("Type of to tag is not string");var l=i.replaces_from_tag;if("string"!==typeof l)throw new Error("type of from tag is not string");var c=s+a+l,u=e.userAgentCore.dialogs.get(c);if(!u)return void r.reject({statusCode:481});if(!u.early&&!0===i.early_only)return void r.reject({statusCode:486});var d=e._sessions[s+l]||e._sessions[s+a]||void 0;if(!d)throw new Error("Session does not exist.");r._replacee=d}}if(null===(n=e.delegate)||void 0===n?void 0:n.onInvite)return r.autoSendAnInitialProvisionalResponse?void r.progress().then((function(){var t;if(void 0===(null===(t=e.delegate)||void 0===t?void 0:t.onInvite))throw new Error("onInvite undefined.");e.delegate.onInvite(r)})):void e.delegate.onInvite(r);r.reject({statusCode:486})},onMessage:function(t){if(e.delegate&&e.delegate.onMessage){var n=new Ke(t);e.delegate.onMessage(n)}else t.accept()},onNotify:function(t){if(e.delegate&&e.delegate.onNotify){var n=new We(t);e.delegate.onNotify(n)}else e.options.allowLegacyNotifications?t.accept():t.reject({statusCode:481})},onRefer:function(t){e.logger.warn("Received an out of dialog REFER request"),e.delegate&&e.delegate.onReferRequest?e.delegate.onReferRequest(t):t.reject({statusCode:405})},onRegister:function(t){e.logger.warn("Received an out of dialog REGISTER request"),e.delegate&&e.delegate.onRegisterRequest?e.delegate.onRegisterRequest(t):t.reject({statusCode:405})},onSubscribe:function(t){e.logger.warn("Received an out of dialog SUBSCRIBE request"),e.delegate&&e.delegate.onSubscribeRequest?e.delegate.onSubscribeRequest(t):t.reject({statusCode:405})}};return new He(r,o)},e.prototype.initTransportCallbacks=function(){var e=this;this.transport.onConnect=function(){return e.onTransportConnect()},this.transport.onDisconnect=function(t){return e.onTransportDisconnect(t)},this.transport.onMessage=function(t){return e.onTransportMessage(t)}},e.prototype.onTransportConnect=function(){this.state!==at.Stopped&&this.delegate&&this.delegate.onConnect&&this.delegate.onConnect()},e.prototype.onTransportDisconnect=function(e){this.state!==at.Stopped&&(this.delegate&&this.delegate.onDisconnect&&this.delegate.onDisconnect(e),e&&this.options.reconnectionAttempts>0&&this.attemptReconnection())},e.prototype.onTransportMessage=function(e){var t=this,n=D.parseMessage(e,this.getLogger("sip.Parser"));if(n)if(this.state===at.Stopped&&n instanceof k)this.logger.warn("Received ".concat(n.method," request while stopped. Dropping."));else{var r=function(){for(var e=["from","to","call_id","cseq","via"],r=0,o=e;r<o.length;r++){var i=o[r];if(!n.hasHeader(i))return t.logger.warn("Missing mandatory header field : ".concat(i,".")),!1}return!0};if(n instanceof k){if(!r())return void this.logger.warn("Request missing mandatory header field. Dropping.");if(!n.toTag&&n.callId.substr(0,5)===this.options.sipjsId)return void this.userAgentCore.replyStateless(n,{statusCode:482});var o=E(n.body),i=n.getHeader("content-length");if(i&&o<Number(i))return void this.userAgentCore.replyStateless(n,{statusCode:400})}if(n instanceof x){if(!r())return void this.logger.warn("Response missing mandatory header field. Dropping.");if(n.getHeaders("via").length>1)return void this.logger.warn("More than one Via header field present in the response. Dropping.");if(n.via.host!==this.options.viaHost||void 0!==n.via.port)return void this.logger.warn("Via sent-by in the response does not match UA Via host value. Dropping.");o=E(n.body),i=n.getHeader("content-length");if(i&&o<Number(i))return void this.logger.warn("Message body length is lower than the value in Content-Length header field. Dropping.")}if(n instanceof k)this.userAgentCore.receiveIncomingRequestFromTransport(n);else{if(!(n instanceof x))throw new Error("Invalid message type.");this.userAgentCore.receiveIncomingResponseFromTransport(n)}}else this.logger.warn("Failed to parse incoming message. Dropping.")},e.prototype.transitionState=function(e,t){var n=this,r=function(){throw new Error("Invalid state transition from ".concat(n._state," to ").concat(e))};switch(this._state){case at.Started:e!==at.Stopped&&r();break;case at.Stopped:e!==at.Started&&r();break;default:throw new Error("Unknown state.")}this.logger.log("Transitioned from ".concat(this._state," to ").concat(e)),this._state=e,this._stateEventEmitter.emit(this._state)},e}();function gt(e,t){t.autoplay=!0,t.srcObject=e,t.play().catch((function(e){console.error(e)})),e.onaddtrack=function(){t.load(),t.play().catch((function(e){console.error("Failed to play remote media on add track"),console.error(e)}))},e.onremovetrack=function(){t.load(),t.play().catch((function(e){console.error("Failed to play remote media on remove track"),console.error(e)}))}}function mt(e){var t=document.getElementById(e);if(t instanceof HTMLAudioElement)return t;var n=new Audio;return n.controls=!0,n.autoplay=!0,n.id="m7remoteAudio",n.style.display="none",document.body.appendChild(n),document.getElementById(e)}(function(){function e(e,t){var n=this;void 0===t&&(t={}),this.attemptingReconnection=!1,this.connectRequested=!1,this.held=!1,this.muted=!1,this.registerer=void 0,this.registerRequested=!1,this.session=void 0,this.delegate=t.delegate,this.options=i({},t);var r=i({},t.userAgentOptions);if(r.transportConstructor||(r.transportConstructor=ht),r.transportOptions||(r.transportOptions={server:e}),!r.uri&&t.aor){var o=ft.makeURI(t.aor);if(!o)throw new Error("Failed to create valid URI from ".concat(t.aor));r.uri=o}this.userAgent=new ft(r),this.userAgent.delegate={onConnect:function(){n.logger.log("[".concat(n.id,"] Connected")),n.delegate&&n.delegate.onServerConnect&&n.delegate.onServerConnect(),n.registerer&&n.registerRequested&&(n.logger.log("[".concat(n.id,"] Registering...")),n.registerer.register().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred registering after connection with server was obtained.")),n.logger.error(e.toString())})))},onDisconnect:function(e){n.logger.log("[".concat(n.id,"] Disconnected")),n.delegate&&n.delegate.onServerDisconnect&&n.delegate.onServerDisconnect(e),n.session&&(n.logger.log("[".concat(n.id,"] Hanging up...")),n.hangup().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred hanging up call after connection with server was lost.")),n.logger.error(e.toString())}))),n.registerer&&(n.logger.log("[".concat(n.id,"] Unregistering...")),n.registerer.unregister().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred unregistering after connection with server was lost.")),n.logger.error(e.toString())}))),e&&n.attemptReconnection()},onInvite:function(e){if(n.logger.log("[".concat(n.id,"] Received INVITE")),n.session)return n.logger.warn("[".concat(n.id,"] Session already in progress, rejecting INVITE...")),void e.reject().then((function(){n.logger.log("[".concat(n.id,"] Rejected INVITE"))})).catch((function(e){n.logger.error("[".concat(n.id,"] Failed to reject INVITE")),n.logger.error(e.toString())}));var t={sessionDescriptionHandlerOptions:{constraints:n.constraints}};n.initSession(e,t),n.delegate&&n.delegate.onCallReceived?n.delegate.onCallReceived():(n.logger.warn("[".concat(n.id,"] No handler available, rejecting INVITE...")),e.reject().then((function(){n.logger.log("[".concat(n.id,"] Rejected INVITE"))})).catch((function(e){n.logger.error("[".concat(n.id,"] Failed to reject INVITE")),n.logger.error(e.toString())})))},onMessage:function(e){e.accept().then((function(){n.delegate&&n.delegate.onMessageReceived&&n.delegate.onMessageReceived(e.request.body)}))}},this.logger=this.userAgent.getLogger("sip.SimpleUser"),window.addEventListener("online",(function(){n.logger.log("[".concat(n.id,"] Online")),n.attemptReconnection()}))}Object.defineProperty(e.prototype,"id",{get:function(){return this.options.userAgentOptions&&this.options.userAgentOptions.displayName||"Anonymous"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localMediaStream",{get:function(){var e,t=null===(e=this.session)||void 0===e?void 0:e.sessionDescriptionHandler;if(t){if(!(t instanceof dt))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return t.localMediaStream}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteMediaStream",{get:function(){var e,t=null===(e=this.session)||void 0===e?void 0:e.sessionDescriptionHandler;if(t){if(!(t instanceof dt))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return t.remoteMediaStream}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localAudioTrack",{get:function(){var e;return null===(e=this.localMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"audio"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localVideoTrack",{get:function(){var e;return null===(e=this.localMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"video"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteAudioTrack",{get:function(){var e;return null===(e=this.remoteMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"audio"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteVideoTrack",{get:function(){var e;return null===(e=this.remoteMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"video"===e.kind}))},enumerable:!1,configurable:!0}),e.prototype.connect=function(){return this.logger.log("[".concat(this.id,"] Connecting UserAgent...")),this.connectRequested=!0,this.userAgent.state!==at.Started?this.userAgent.start():this.userAgent.reconnect()},e.prototype.disconnect=function(){return this.logger.log("[".concat(this.id,"] Disconnecting UserAgent...")),this.connectRequested=!1,this.userAgent.stop()},e.prototype.isConnected=function(){return this.userAgent.isConnected()},e.prototype.register=function(e,t){var n=this;return this.logger.log("[".concat(this.id,"] Registering UserAgent...")),this.registerRequested=!0,this.registerer||(this.registerer=new ot(this.userAgent,e),this.registerer.stateChange.addListener((function(e){switch(e){case Xe.Initial:break;case Xe.Registered:n.delegate&&n.delegate.onRegistered&&n.delegate.onRegistered();break;case Xe.Unregistered:n.delegate&&n.delegate.onUnregistered&&n.delegate.onUnregistered();break;case Xe.Terminated:n.registerer=void 0;break;default:throw new Error("Unknown registerer state.")}}))),this.registerer.register(t).then((function(){}))},e.prototype.unregister=function(e){return this.logger.log("[".concat(this.id,"] Unregistering UserAgent...")),this.registerRequested=!1,this.registerer?this.registerer.unregister(e).then((function(){})):Promise.resolve()},e.prototype.call=function(e,t,n){if(this.logger.log("[".concat(this.id,"] Beginning Session...")),this.session)return Promise.reject(new Error("Session already exists."));var r=ft.makeURI(e);if(!r)return Promise.reject(new Error('Failed to create a valid URI from "'.concat(e,'"')));t||(t={}),t.sessionDescriptionHandlerOptions||(t.sessionDescriptionHandlerOptions={}),t.sessionDescriptionHandlerOptions.constraints||(t.sessionDescriptionHandlerOptions.constraints=this.constraints);var o=new tt(this.userAgent,r,t);return this.sendInvite(o,t,n).then((function(){}))},e.prototype.hangup=function(){return this.logger.log("[".concat(this.id,"] Hangup...")),this.terminate()},e.prototype.answer=function(e){return this.logger.log("[".concat(this.id,"] Accepting Invitation...")),this.session?this.session instanceof et?(e||(e={}),e.sessionDescriptionHandlerOptions||(e.sessionDescriptionHandlerOptions={}),e.sessionDescriptionHandlerOptions.constraints||(e.sessionDescriptionHandlerOptions.constraints=this.constraints),this.session.accept(e)):Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))},e.prototype.decline=function(){return this.logger.log("[".concat(this.id,"] rejecting Invitation...")),this.session?this.session instanceof et?this.session.reject():Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))},e.prototype.hold=function(){return this.logger.log("[".concat(this.id,"] holding session...")),this.setHold(!0)},e.prototype.unhold=function(){return this.logger.log("[".concat(this.id,"] unholding session...")),this.setHold(!1)},e.prototype.isHeld=function(){return this.held},e.prototype.mute=function(){this.logger.log("[".concat(this.id,"] disabling media tracks...")),this.setMute(!0)},e.prototype.unmute=function(){this.logger.log("[".concat(this.id,"] enabling media tracks...")),this.setMute(!1)},e.prototype.isMuted=function(){return this.muted},e.prototype.sendDTMF=function(e){if(this.logger.log("[".concat(this.id,"] sending DTMF...")),!/^[0-9A-D#*,]$/.exec(e))return Promise.reject(new Error("Invalid DTMF tone."));if(!this.session)return Promise.reject(new Error("Session does not exist."));this.logger.log("[".concat(this.id,"] Sending DTMF tone: ").concat(e));var t=e,n=2e3,r={contentDisposition:"render",contentType:"application/dtmf-relay",content:"Signal="+t+"\r\nDuration="+n},o={body:r};return this.session.info({requestOptions:o}).then((function(){}))},e.prototype.message=function(e,t){this.logger.log("[".concat(this.id,"] sending message..."));var n=ft.makeURI(e);return n?new nt(this.userAgent,n,t).message():Promise.reject(new Error('Failed to create a valid URI from "'.concat(e,'"')))},Object.defineProperty(e.prototype,"constraints",{get:function(){var e,t={audio:!0,video:!1};return(null===(e=this.options.media)||void 0===e?void 0:e.constraints)&&(t=i({},this.options.media.constraints)),t},enumerable:!1,configurable:!0}),e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=this.options.reconnectionAttempts||3,r=this.options.reconnectionDelay||4;this.connectRequested?(this.attemptingReconnection&&this.logger.log("[".concat(this.id,"] Reconnection attempt already in progress")),e>n?this.logger.log("[".concat(this.id,"] Reconnection maximum attempts reached")):(1===e?this.logger.log("[".concat(this.id,"] Reconnection attempt ").concat(e," of ").concat(n," - trying")):this.logger.log("[".concat(this.id,"] Reconnection attempt ").concat(e," of ").concat(n," - trying in ").concat(r," seconds")),this.attemptingReconnection=!0,setTimeout((function(){if(!t.connectRequested)return t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - aborted")),void(t.attemptingReconnection=!1);t.userAgent.reconnect().then((function(){t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - succeeded")),t.attemptingReconnection=!1})).catch((function(r){t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - failed")),t.logger.error(r.message),t.attemptingReconnection=!1,t.attemptReconnection(++e)}))}),1===e?0:1e3*r))):this.logger.log("[".concat(this.id,"] Reconnection not currently desired"))},e.prototype.cleanupMedia=function(){this.options.media&&(this.options.media.local&&this.options.media.local.video&&(this.options.media.local.video.srcObject=null,this.options.media.local.video.pause()),this.options.media.remote&&(this.options.media.remote.audio&&(this.options.media.remote.audio.srcObject=null,this.options.media.remote.audio.pause()),this.options.media.remote.video&&(this.options.media.remote.video.srcObject=null,this.options.media.remote.video.pause())))},e.prototype.enableReceiverTracks=function(e){if(!this.session)throw new Error("Session does not exist.");var t=this.session.sessionDescriptionHandler;if(!(t instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var n=t.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getReceivers().forEach((function(t){t.track&&(t.track.enabled=e)}))},e.prototype.enableSenderTracks=function(e){if(!this.session)throw new Error("Session does not exist.");var t=this.session.sessionDescriptionHandler;if(!(t instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var n=t.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getSenders().forEach((function(t){t.track&&(t.track.enabled=e)}))},e.prototype.initSession=function(e,t){var n=this;this.session=e,this.delegate&&this.delegate.onCallCreated&&this.delegate.onCallCreated(),this.session.stateChange.addListener((function(t){if(n.session===e)switch(n.logger.log("[".concat(n.id,"] session state changed to ").concat(t)),t){case _e.Initial:break;case _e.Establishing:break;case _e.Established:n.setupLocalMedia(),n.setupRemoteMedia(),n.delegate&&n.delegate.onCallAnswered&&n.delegate.onCallAnswered();break;case _e.Terminating:case _e.Terminated:n.session=void 0,n.cleanupMedia(),n.delegate&&n.delegate.onCallHangup&&n.delegate.onCallHangup();break;default:throw new Error("Unknown session state.")}})),this.session.delegate={onInfo:function(e){var t;if(void 0!==(null===(t=n.delegate)||void 0===t?void 0:t.onCallDTMFReceived)){var r=e.request.getHeader("content-type");if(r&&/^application\/dtmf-relay/i.exec(r)){var o=e.request.body.split("\r\n",2);if(2===o.length){var i,s=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/;if(s.test(o[0])&&(i=o[0].replace(s,"$2")),i){var a,l=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;l.test(o[1])&&(a=parseInt(o[1].replace(l,"$2"),10)),a?e.accept().then((function(){if(n.delegate&&n.delegate.onCallDTMFReceived){if(!i||!a)throw new Error("Tone or duration undefined.");n.delegate.onCallDTMFReceived(i,a)}})).catch((function(e){n.logger.error(e.message)})):e.reject()}else e.reject()}else e.reject()}else e.reject()}else e.reject()},onRefer:function(e){e.accept().then((function(){return n.sendInvite(e.makeInviter(t),t)})).catch((function(e){n.logger.error(e.message)}))}}},e.prototype.sendInvite=function(e,t,n){var r=this;return this.initSession(e,t),e.invite(n).then((function(){r.logger.log("[".concat(r.id,"] sent INVITE"))}))},e.prototype.setHold=function(e){var t=this;if(!this.session)return Promise.reject(new Error("Session does not exist."));var n=this.session;if(this.held===e)return Promise.resolve();var r=this.session.sessionDescriptionHandler;if(!(r instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var o={requestDelegate:{onAccept:function(){t.held=e,t.enableReceiverTracks(!t.held),t.enableSenderTracks(!t.held&&!t.muted),t.delegate&&t.delegate.onCallHold&&t.delegate.onCallHold(t.held)},onReject:function(){t.logger.warn("[".concat(t.id,"] re-invite request was rejected")),t.enableReceiverTracks(!t.held),t.enableSenderTracks(!t.held&&!t.muted),t.delegate&&t.delegate.onCallHold&&t.delegate.onCallHold(t.held)}}},i=n.sessionDescriptionHandlerOptionsReInvite;return i.hold=e,n.sessionDescriptionHandlerOptionsReInvite=i,this.session.invite(o).then((function(){t.enableReceiverTracks(!e),t.enableSenderTracks(!e&&!t.muted)})).catch((function(e){throw e instanceof je&&t.logger.error("[".concat(t.id,"] A hold request is already in progress.")),e}))},e.prototype.setMute=function(e){this.session?this.session.state===_e.Established?(this.muted=e,this.enableSenderTracks(!this.held&&!this.muted)):this.logger.warn("[".concat(this.id,"] An established session is required to enable/disable media tracks")):this.logger.warn("[".concat(this.id,"] A session is required to enabled/disable media tracks"))},e.prototype.setupLocalMedia=function(){var e,t,n=this;if(!this.session)throw new Error("Session does not exist.");var r=null===(t=null===(e=this.options.media)||void 0===e?void 0:e.local)||void 0===t?void 0:t.video;if(r){var o=this.localMediaStream;if(!o)throw new Error("Local media stream undefiend.");r.srcObject=o,r.volume=0,r.play().catch((function(e){n.logger.error("[".concat(n.id,"] Failed to play local media")),n.logger.error(e.message)}))}},e.prototype.setupRemoteMedia=function(){var e,t,n,r,o=this;if(!this.session)throw new Error("Session does not exist.");var i=(null===(t=null===(e=this.options.media)||void 0===e?void 0:e.remote)||void 0===t?void 0:t.video)||(null===(r=null===(n=this.options.media)||void 0===n?void 0:n.remote)||void 0===r?void 0:r.audio);if(i){var s=this.remoteMediaStream;if(!s)throw new Error("Remote media stream undefiend.");i.autoplay=!0,i.srcObject=s,i.play().catch((function(e){o.logger.error("[".concat(o.id,"] Failed to play remote media")),o.logger.error(e.message)})),s.onaddtrack=function(){o.logger.log("[".concat(o.id,"] Remote media onaddtrack")),i.load(),i.play().catch((function(e){o.logger.error("[".concat(o.id,"] Failed to play remote media")),o.logger.error(e.message)}))}}},e.prototype.terminate=function(){var e=this;if(this.logger.log("[".concat(this.id,"] Terminating...")),!this.session)return Promise.reject(new Error("Session does not exist."));switch(this.session.state){case _e.Initial:if(this.session instanceof tt)return this.session.cancel().then((function(){e.logger.log("[".concat(e.id,"] Inviter never sent INVITE (canceled)"))}));if(this.session instanceof et)return this.session.reject().then((function(){e.logger.log("[".concat(e.id,"] Invitation rejected (sent 480)"))}));throw new Error("Unknown session type.");case _e.Establishing:if(this.session instanceof tt)return this.session.cancel().then((function(){e.logger.log("[".concat(e.id,"] Inviter canceled (sent CANCEL)"))}));if(this.session instanceof et)return this.session.reject().then((function(){e.logger.log("[".concat(e.id,"] Invitation rejected (sent 480)"))}));throw new Error("Unknown session type.");case _e.Established:return this.session.bye().then((function(){e.logger.log("[".concat(e.id,"] Session ended (sent BYE)"))}));case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown state")}return this.logger.log("[".concat(this.id,"] Terminating in state ").concat(this.session.state,", no action taken")),Promise.resolve()}})();var vt=mt("m7remoteAudio"),yt=function(){function e(e){var t=this;this.registerRequested=!1,this.attemptingReconnection=!1,this.connectRequested=!1,this.requestDelegate={onAccept:function(e){},onProgress:function(e){},onRedirect:function(e){},onReject:function(e){return s(t,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return e.sent(),[4,this.connect()];case 2:return e.sent(),this.register(),[2]}}))}))},onTrying:function(e){}},this.accept=function(){return s(t,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e={audio:!0,video:!1},t={sessionDescriptionHandlerOptions:{constraints:e}},[2,this.Ginvitation.accept(t)]}))}))};var n=ft.makeURI("sip:"+e.sip+"@"+e.server);if(!n)throw new Error("Failed to create URI");var r={onConnect:function(){return s(t,void 0,void 0,(function(){return a(this,(function(e){return this.registerer&&this.registerRequested&&this.registerer.register().catch((function(e){})),[2]}))}))},onDisconnect:function(e){t.registerer&&t.registerer.unregister().catch((function(e){})),e&&t.attemptReconnection()},onInvite:function(e){t.Ginvitation=e;var n=e;n.delegate={onRefer:function(e){}},n.stateChange.addListener((function(e){switch(e){case _e.Initial:break;case _e.Establishing:break;case _e.Established:var t=n.sessionDescriptionHandler;if(!t||!(t instanceof dt))throw new Error("Invalid session description handler.");vt&&gt(t.remoteMediaStream,vt);break;case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown session state.")}}));var r={audio:!0,video:!1},o={sessionDescriptionHandlerOptions:{constraints:r}},i=t.Ginvitation.incomingInviteRequest.message.headers["X-Calltype"][0].raw;"callout"!==i&&"callTask"!==i||e.accept(o).then((function(){})).catch((function(e){}))}},o={logBuiltinEnabled:!1,delegate:r,displayName:"webrtc",uri:n,transportOptions:{server:"wss://"+e.server},authorizationUsername:e.sip,authorizationHa1:e.secret,reconnectionDelay:0};this.userAgent=new ft(o),window.addEventListener("online",(function(){return s(t,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.attemptReconnection()];case 1:return e.sent(),this.register(),[2]}}))}))}))}return e.prototype.register=function(){var e=this;return this.registerRequested=!0,this.registerer||(this.registerer=new ot(this.userAgent,{expires:10}),this.registerer.stateChange.addListener((function(t){switch(t){case Xe.Initial:break;case Xe.Registered:break;case Xe.Unregistered:break;case Xe.Terminated:e.registerer=void 0;break;default:throw new Error("Unknown registerer state.")}}))),this.registerer.register({requestDelegate:this.requestDelegate}).then((function(){}))},e.prototype.unregister=function(e){return this.registerRequested=!1,this.registerer?this.registerer.unregister(e).then((function(){})):Promise.resolve()},e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=1,r=0;this.connectRequested&&(e>n||(this.attemptingReconnection=!0,setTimeout((function(){t.connectRequested?t.userAgent.reconnect().then((function(){t.attemptingReconnection=!1})).catch((function(n){t.attemptingReconnection=!1,t.attemptReconnection(++e)})):t.attemptingReconnection=!1}),1===e?0:1e3*r)))},e.prototype.sendDTMF=function(e){if(!/^[0-9A-D#*,]$/.exec(e))return Promise.reject(new Error("Invalid DTMF tone."));if(!this.Ginvitation)return Promise.reject(new Error("Session does not exist."));var t=e,n=2e3,r={contentDisposition:"render",contentType:"application/dtmf-relay",content:"Signal="+t+"\r\nDuration="+n},o={body:r};return this.Ginvitation.info({requestOptions:o}).then((function(){}))},e.prototype.disconnect=function(){return this.connectRequested=!1,this.userAgent.stop()},e.prototype.connect=function(){return this.connectRequested=!0,this.userAgent.state!==at.Started?this.userAgent.start():this.userAgent.reconnect()},e.prototype.isConnected=function(){return this.userAgent.isConnected()},e}()},559:function(e,t){"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n}},274:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__274__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}!function(){__webpack_require__.amdO={}}(),function(){__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return __webpack_require__.d(t,{a:t}),t}}(),function(){__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){__webpack_require__.p=""}();var __webpack_exports__={};return function(){"use strict";if(__webpack_require__.d(__webpack_exports__,{default:function(){return bR}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(__webpack_require__.p=t[1])}var n=__webpack_require__(274);const r=Symbol(),o="el",i="is-",s=(e,t,n,r,o)=>{let i=`${e}-${t}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),o&&(i+=`--${o}`),i},a=Symbol("namespaceContextKey"),l=e=>{const t=e||((0,n.getCurrentInstance)()?(0,n.inject)(a,(0,n.ref)(o)):(0,n.ref)(o)),r=(0,n.computed)((()=>(0,n.unref)(t)||o));return r},c=(e,t)=>{const n=l(t),r=(t="")=>s(n.value,e,t,"",""),o=t=>t?s(n.value,e,"",t,""):"",a=t=>t?s(n.value,e,"","",t):"",c=(t,r)=>t&&r?s(n.value,e,t,r,""):"",u=(t,r)=>t&&r?s(n.value,e,"",t,r):"",d=(t,r)=>t&&r?s(n.value,e,t,"",r):"",p=(t,r,o)=>t&&r&&o?s(n.value,e,t,r,o):"",h=(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`${i}${e}`:""},f=e=>{const t={};for(const r in e)e[r]&&(t[`--${n.value}-${r}`]=e[r]);return t},g=t=>{const r={};for(const o in t)t[o]&&(r[`--${n.value}-${e}-${o}`]=t[o]);return r},m=e=>`--${n.value}-${e}`,v=t=>`--${n.value}-${e}-${t}`;return{namespace:n,b:r,e:o,m:a,be:c,em:u,bm:d,bem:p,is:h,cssVar:f,cssVarName:m,cssVarBlock:g,cssVarBlockName:v}};var u=Array.isArray,d=u,p="object"==typeof global&&global&&global.Object===Object&&global,h=p,f="object"==typeof self&&self&&self.Object===Object&&self,g=h||f||Function("return this")(),m=g,v=m.Symbol,y=v,b=Object.prototype,w=b.hasOwnProperty,C=b.toString,S=y?y.toStringTag:void 0;function E(e){var t=w.call(e,S),n=e[S];try{e[S]=void 0;var r=!0}catch(i){}var o=C.call(e);return r&&(t?e[S]=n:delete e[S]),o}var T=E,k=Object.prototype,x=k.toString;function N(e){return x.call(e)}var R=N,I="[object Null]",_="[object Undefined]",O=y?y.toStringTag:void 0;function A(e){return null==e?void 0===e?_:I:O&&O in Object(e)?T(e):R(e)}var B=A;function D(e){return null!=e&&"object"==typeof e}var P=D,H="[object Symbol]";function M(e){return"symbol"==typeof e||P(e)&&B(e)==H}var j=M,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$=/^\w*$/;function L(e,t){if(d(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||($.test(e)||!V.test(e)||null!=t&&e in Object(t))}var q=L;function F(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var U=F,z="[object AsyncFunction]",K="[object Function]",W="[object GeneratorFunction]",G="[object Proxy]";function Y(e){if(!U(e))return!1;var t=B(e);return t==K||t==W||t==z||t==G}var J=Y,Z=m["__core-js_shared__"],X=Z,Q=function(){var e=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ee(e){return!!Q&&Q in e}var te=ee,ne=Function.prototype,re=ne.toString;function oe(e){if(null!=e){try{return re.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var ie=oe,se=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,le=Function.prototype,ce=Object.prototype,ue=le.toString,de=ce.hasOwnProperty,pe=RegExp("^"+ue.call(de).replace(se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function he(e){if(!U(e)||te(e))return!1;var t=J(e)?pe:ae;return t.test(ie(e))}var fe=he;function ge(e,t){return null==e?void 0:e[t]}var me=ge;function ve(e,t){var n=me(e,t);return fe(n)?n:void 0}var ye=ve,be=ye(Object,"create"),we=be;function Ce(){this.__data__=we?we(null):{},this.size=0}var Se=Ce;function Ee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Te=Ee,ke="__lodash_hash_undefined__",xe=Object.prototype,Ne=xe.hasOwnProperty;function Re(e){var t=this.__data__;if(we){var n=t[e];return n===ke?void 0:n}return Ne.call(t,e)?t[e]:void 0}var Ie=Re,_e=Object.prototype,Oe=_e.hasOwnProperty;function Ae(e){var t=this.__data__;return we?void 0!==t[e]:Oe.call(t,e)}var Be=Ae,De="__lodash_hash_undefined__";function Pe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=we&&void 0===t?De:t,this}var He=Pe;function Me(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Me.prototype.clear=Se,Me.prototype["delete"]=Te,Me.prototype.get=Ie,Me.prototype.has=Be,Me.prototype.set=He;var je=Me;function Ve(){this.__data__=[],this.size=0}var $e=Ve;function Le(e,t){return e===t||e!==e&&t!==t}var qe=Le;function Fe(e,t){var n=e.length;while(n--)if(qe(e[n][0],t))return n;return-1}var Ue=Fe,ze=Array.prototype,Ke=ze.splice;function We(e){var t=this.__data__,n=Ue(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ke.call(t,n,1),--this.size,!0}var Ge=We;function Ye(e){var t=this.__data__,n=Ue(t,e);return n<0?void 0:t[n][1]}var Je=Ye;function Ze(e){return Ue(this.__data__,e)>-1}var Xe=Ze;function Qe(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var et=Qe;function tt(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}tt.prototype.clear=$e,tt.prototype["delete"]=Ge,tt.prototype.get=Je,tt.prototype.has=Xe,tt.prototype.set=et;var nt=tt,rt=ye(m,"Map"),ot=rt;function it(){this.size=0,this.__data__={hash:new je,map:new(ot||nt),string:new je}}var st=it;function at(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var lt=at;function ct(e,t){var n=e.__data__;return lt(t)?n["string"==typeof t?"string":"hash"]:n.map}var ut=ct;function dt(e){var t=ut(this,e)["delete"](e);return this.size-=t?1:0,t}var pt=dt;function ht(e){return ut(this,e).get(e)}var ft=ht;function gt(e){return ut(this,e).has(e)}var mt=gt;function vt(e,t){var n=ut(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var yt=vt;function bt(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}bt.prototype.clear=st,bt.prototype["delete"]=pt,bt.prototype.get=ft,bt.prototype.has=mt,bt.prototype.set=yt;var wt=bt,Ct="Expected a function";function St(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Ct);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(St.Cache||wt),n}St.Cache=wt;var Et=St,Tt=500;function kt(e){var t=Et(e,(function(e){return n.size===Tt&&n.clear(),e})),n=t.cache;return t}var xt=kt,Nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rt=/\\(\\)?/g,It=xt((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Nt,(function(e,n,r,o){t.push(r?o.replace(Rt,"$1"):n||e)})),t})),_t=It;function Ot(e,t){var n=-1,r=null==e?0:e.length,o=Array(r);while(++n<r)o[n]=t(e[n],n,e);return o}var At=Ot,Bt=1/0,Dt=y?y.prototype:void 0,Pt=Dt?Dt.toString:void 0;function Ht(e){if("string"==typeof e)return e;if(d(e))return At(e,Ht)+"";if(j(e))return Pt?Pt.call(e):"";var t=e+"";return"0"==t&&1/e==-Bt?"-0":t}var Mt=Ht;function jt(e){return null==e?"":Mt(e)}var Vt=jt;function $t(e,t){return d(e)?e:q(e,t)?[e]:_t(Vt(e))}var Lt=$t,qt=1/0;function Ft(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-qt?"-0":t}var Ut=Ft;function zt(e,t){t=Lt(t,e);var n=0,r=t.length;while(null!=e&&n<r)e=e[Ut(t[n++])];return n&&n==r?e:void 0}var Kt=zt;function Wt(e,t,n){var r=null==e?void 0:Kt(e,t);return void 0===r?n:r}var Gt=Wt,Yt={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Jt=e=>(t,r)=>Zt(t,r,(0,n.unref)(e)),Zt=(e,t,n)=>Gt(n,e,e).replace(/\{(\w+)\}/g,((e,n)=>{var r;return`${null!=(r=null==t?void 0:t[n])?r:`{${n}}`}`})),Xt=e=>{const t=(0,n.computed)((()=>(0,n.unref)(e).name)),r=(0,n.isRef)(e)?e:(0,n.ref)(e);return{lang:t,locale:r,t:Jt(e)}},Qt=Symbol("localeContextKey"),en=e=>{const t=e||(0,n.inject)(Qt,(0,n.ref)());return Xt((0,n.computed)((()=>t.value||Yt)))};const tn=()=>{},nn=(Object.assign,Object.prototype.hasOwnProperty),rn=(e,t)=>nn.call(e,t),on=Array.isArray,sn=e=>"function"===typeof e,an=e=>"string"===typeof e,ln=e=>null!==e&&"object"===typeof e,cn=Object.prototype.toString,un=e=>cn.call(e),dn=e=>un(e).slice(8,-1),pn=e=>{const t=Object.create(null);return n=>{const r=t[n];return r||(t[n]=e(n))}},hn=/-(\w)/g,fn=(pn((e=>e.replace(hn,((e,t)=>t?t.toUpperCase():"")))),/\B([A-Z])/g),gn=(pn((e=>e.replace(fn,"-$1").toLowerCase())),pn((e=>e.charAt(0).toUpperCase()+e.slice(1))));pn((e=>e?`on${gn(e)}`:""));const mn=e=>void 0===e,vn=e=>"boolean"===typeof e,yn=e=>"number"===typeof e,bn=e=>"undefined"!==typeof Element&&e instanceof Element,wn=e=>!!an(e)&&!Number.isNaN(Number(e)),Cn=(0,n.ref)(0),Sn=2e3,En=Symbol("zIndexContextKey"),Tn=e=>{const t=e||((0,n.getCurrentInstance)()?(0,n.inject)(En,void 0):void 0),r=(0,n.computed)((()=>{const e=(0,n.unref)(t);return yn(e)?e:Sn})),o=(0,n.computed)((()=>r.value+Cn.value)),i=()=>(Cn.value++,o.value);return{initialZIndex:r,currentZIndex:o,nextZIndex:i}};class kn extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function xn(e,t){throw new kn(`[${e}] ${t}`)}function Nn(e,t){0}function Rn(e){var t=-1,n=null==e?0:e.length,r={};while(++t<n){var o=e[t];r[o[0]]=o[1]}return r}var In=Rn;const _n="__epPropKey",On=e=>e,An=e=>ln(e)&&!!e[_n],Bn=(e,t)=>{if(!ln(e)||An(e))return e;const{values:r,required:o,default:i,type:s,validator:a}=e,l=r||a?o=>{let s=!1,l=[];if(r&&(l=Array.from(r),rn(e,"default")&&l.push(i),s||(s=l.includes(o))),a&&(s||(s=a(o))),!s&&l.length>0){const e=[...new Set(l)].map((e=>JSON.stringify(e))).join(", ");(0,n.warn)(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(o)}.`)}return s}:void 0,c={type:s,required:!!o,validator:l,[_n]:!0};return rn(e,"default")&&(c.default=i),c},Dn=e=>In(Object.entries(e).map((([e,t])=>[e,Bn(t,e)]))),Pn=["","default","small","large"],Hn=Bn({type:String,values:Pn,required:!1}),Mn=Symbol("size"),jn=()=>{const e=(0,n.inject)(Mn,{});return(0,n.computed)((()=>(0,n.unref)(e.size)||""))};var Vn=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),$n=Vn;function Ln(e,t,n){"__proto__"==t&&$n?$n(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var qn=Ln,Fn=Object.prototype,Un=Fn.hasOwnProperty;function zn(e,t,n){var r=e[t];Un.call(e,t)&&qe(r,n)&&(void 0!==n||t in e)||qn(e,t,n)}var Kn=zn,Wn=9007199254740991,Gn=/^(?:0|[1-9]\d*)$/;function Yn(e,t){var n=typeof e;return t=null==t?Wn:t,!!t&&("number"==n||"symbol"!=n&&Gn.test(e))&&e>-1&&e%1==0&&e<t}var Jn=Yn;function Zn(e,t,n,r){if(!U(e))return e;t=Lt(t,e);var o=-1,i=t.length,s=i-1,a=e;while(null!=a&&++o<i){var l=Ut(t[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=s){var u=a[l];c=r?r(u,l,a):void 0,void 0===c&&(c=U(u)?u:Jn(t[o+1])?[]:{})}Kn(a,l,c),a=a[l]}return e}var Xn=Zn;function Qn(e,t,n){return null==e?e:Xn(e,t,n)}var er=Qn;const tr=e=>Object.keys(e),nr=(e,t,n)=>({get value(){return Gt(e,t,n)},set value(n){er(e,t,n)}}),rr=(0,n.ref)();function or(e,t=void 0){const o=(0,n.getCurrentInstance)()?(0,n.inject)(r,rr):rr;return e?(0,n.computed)((()=>{var n,r;return null!=(r=null==(n=o.value)?void 0:n[e])?r:t})):o}function ir(e,t){const r=or(),i=c(e,(0,n.computed)((()=>{var e;return(null==(e=r.value)?void 0:e.namespace)||o}))),s=en((0,n.computed)((()=>{var e;return null==(e=r.value)?void 0:e.locale}))),a=Tn((0,n.computed)((()=>{var e;return(null==(e=r.value)?void 0:e.zIndex)||Sn}))),l=(0,n.computed)((()=>{var e;return(0,n.unref)(t)||(null==(e=r.value)?void 0:e.size)||""}));return sr((0,n.computed)((()=>(0,n.unref)(r)||{}))),{ns:i,locale:s,zIndex:a,size:l}}const sr=(e,t,o=!1)=>{var i;const s=!!(0,n.getCurrentInstance)(),l=s?or():void 0,c=null!=(i=null==t?void 0:t.provide)?i:s?n.provide:void 0;if(!c)return void Nn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const u=(0,n.computed)((()=>{const t=(0,n.unref)(e);return(null==l?void 0:l.value)?ar(l.value,t):t}));return c(r,u),c(Qt,(0,n.computed)((()=>u.value.locale))),c(a,(0,n.computed)((()=>u.value.namespace))),c(En,(0,n.computed)((()=>u.value.zIndex))),c(Mn,{size:(0,n.computed)((()=>u.value.size||""))}),!o&&rr.value||(rr.value=u.value),u},ar=(e,t)=>{var n;const r=[...new Set([...tr(e),...tr(t)])],o={};for(const i of r)o[i]=null!=(n=t[i])?n:e[i];return o},lr=Dn({a11y:{type:Boolean,default:!0},locale:{type:On(Object)},size:Hn,button:{type:On(Object)},experimentalFeatures:{type:On(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:On(Object)},zIndex:Number,namespace:{type:String,default:"el"}}),cr={},ur=(0,n.defineComponent)({name:"ElConfigProvider",props:lr,setup(e,{slots:t}){(0,n.watch)((()=>e.message),(e=>{Object.assign(cr,null!=e?e:{})}),{immediate:!0,deep:!0});const r=sr(e);return()=>(0,n.renderSlot)(t,"default",{config:null==r?void 0:r.value})}}),dr=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(null!=t?t:{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return e},pr=(e,t)=>(e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e),hr=(e,t)=>(e.install=n=>{n.directive(t,e)},e),fr=e=>(e.install=tn,e),gr=dr(ur);function mr(e,t,r,o,i,s){const a=(0,n.resolveComponent)("telephoneStrip"),l=gr;return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(l,{namespace:"ue"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(a)])),_:1})])}const vr=Symbol("popper"),yr=Symbol("popperContent"),br=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],wr=Dn({role:{type:String,values:br,default:"tooltip"}});var Cr=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};const Sr=(0,n.defineComponent)({name:"ElPopper",inheritAttrs:!1}),Er=(0,n.defineComponent)({...Sr,props:wr,setup(e,{expose:t}){const r=e,o=(0,n.ref)(),i=(0,n.ref)(),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.computed)((()=>r.role)),c={triggerRef:o,popperInstanceRef:i,contentRef:s,referenceRef:a,role:l};return t(c),(0,n.provide)(vr,c),(e,t)=>(0,n.renderSlot)(e.$slots,"default")}});var Tr=Cr(Er,[["__file","popper.vue"]]);const kr=dr(Tr),xr=Symbol("elTooltip");var Nr,Rr=Object.defineProperty,Ir=Object.defineProperties,_r=Object.getOwnPropertyDescriptors,Or=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,Br=Object.prototype.propertyIsEnumerable,Dr=(e,t,n)=>t in e?Rr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pr=(e,t)=>{for(var n in t||(t={}))Ar.call(t,n)&&Dr(e,n,t[n]);if(Or)for(var n of Or(t))Br.call(t,n)&&Dr(e,n,t[n]);return e},Hr=(e,t)=>Ir(e,_r(t));function Mr(e,t){var r;const o=(0,n.shallowRef)();return(0,n.watchEffect)((()=>{o.value=e()}),Hr(Pr({},t),{flush:null!=(r=null==t?void 0:t.flush)?r:"sync"})),(0,n.readonly)(o)}const jr="undefined"!==typeof window,Vr=(Object.prototype.toString,e=>"string"===typeof e),$r=()=>{},Lr=jr&&(null==(Nr=null==window?void 0:window.navigator)?void 0:Nr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function qr(e){return"function"===typeof e?e():(0,n.unref)(e)}function Fr(e){return e}function Ur(e){return!!(0,n.getCurrentScope)()&&((0,n.onScopeDispose)(e),!0)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function zr(e,t=!0){(0,n.getCurrentInstance)()?(0,n.onMounted)(e):t?e():(0,n.nextTick)(e)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Kr(e,t,r={}){const{immediate:o=!0}=r,i=(0,n.ref)(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){i.value=!1,a()}function c(...n){a(),i.value=!0,s=setTimeout((()=>{i.value=!1,s=null,e(...n)}),qr(t))}return o&&(i.value=!0,jr&&c()),Ur(l),{isPending:(0,n.readonly)(i),start:c,stop:l}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Wr(){let e;const t=(t,r)=>{n(),e=window.setTimeout(t,r)},n=()=>window.clearTimeout(e);return Ur((()=>n())),{registerTimeout:t,cancelTimeout:n}}const Gr=Dn({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),Yr=({showAfter:e,hideAfter:t,autoClose:r,open:o,close:i})=>{const{registerTimeout:s}=Wr(),{registerTimeout:a,cancelTimeout:l}=Wr(),c=t=>{s((()=>{o(t);const e=(0,n.unref)(r);yn(e)&&e>0&&a((()=>{i(t)}),e)}),(0,n.unref)(e))},u=e=>{l(),s((()=>{i(e)}),(0,n.unref)(t))};return{onOpen:c,onClose:u}};var Jr="top",Zr="bottom",Xr="right",Qr="left",eo="auto",to=[Jr,Zr,Xr,Qr],no="start",ro="end",oo="clippingParents",io="viewport",so="popper",ao="reference",lo=to.reduce((function(e,t){return e.concat([t+"-"+no,t+"-"+ro])}),[]),co=[].concat(to,[eo]).reduce((function(e,t){return e.concat([t,t+"-"+no,t+"-"+ro])}),[]),uo="beforeRead",po="read",ho="afterRead",fo="beforeMain",go="main",mo="afterMain",vo="beforeWrite",yo="write",bo="afterWrite",wo=[uo,po,ho,fo,go,mo,vo,yo,bo];function Co(e){return e?(e.nodeName||"").toLowerCase():null}function So(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Eo(e){var t=So(e).Element;return e instanceof t||e instanceof Element}function To(e){var t=So(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ko(e){if("undefined"==typeof ShadowRoot)return!1;var t=So(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function xo(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];!To(o)||!Co(o)||(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))}function No(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]),s=i.reduce((function(e,t){return e[t]="",e}),{});!To(r)||!Co(r)||(Object.assign(r.style,s),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}}var Ro={name:"applyStyles",enabled:!0,phase:"write",fn:xo,effect:No,requires:["computeStyles"]};function Io(e){return e.split("-")[0]}var _o=Math.max,Oo=Math.min,Ao=Math.round;function Bo(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(To(e)&&t){var i=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Ao(n.width)/s||1),i>0&&(o=Ao(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function Do(e){var t=Bo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Po(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ko(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Ho(e){return So(e).getComputedStyle(e)}function Mo(e){return["table","td","th"].indexOf(Co(e))>=0}function jo(e){return((Eo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Vo(e){return"html"===Co(e)?e:e.assignedSlot||e.parentNode||(ko(e)?e.host:null)||jo(e)}function $o(e){return To(e)&&"fixed"!==Ho(e).position?e.offsetParent:null}function Lo(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=-1!==navigator.userAgent.indexOf("Trident");if(n&&To(e)){var r=Ho(e);if("fixed"===r.position)return null}var o=Vo(e);for(ko(o)&&(o=o.host);To(o)&&["html","body"].indexOf(Co(o))<0;){var i=Ho(o);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return o;o=o.parentNode}return null}function qo(e){for(var t=So(e),n=$o(e);n&&Mo(n)&&"static"===Ho(n).position;)n=$o(n);return n&&("html"===Co(n)||"body"===Co(n)&&"static"===Ho(n).position)?t:n||Lo(e)||t}function Fo(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Uo(e,t,n){return _o(e,Oo(t,n))}function zo(e,t,n){var r=Uo(e,t,n);return r>n?n:r}function Ko(){return{top:0,right:0,bottom:0,left:0}}function Wo(e){return Object.assign({},Ko(),e)}function Go(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Yo=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,Wo("number"!=typeof e?e:Go(e,to))};function Jo(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Io(n.placement),l=Fo(a),c=[Qr,Xr].indexOf(a)>=0,u=c?"height":"width";if(i&&s){var d=Yo(o.padding,n),p=Do(i),h="y"===l?Jr:Qr,f="y"===l?Zr:Xr,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=qo(i),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=g/2-m/2,w=d[h],C=y-p[u]-d[f],S=y/2-p[u]/2+b,E=Uo(w,S,C),T=l;n.modifiersData[r]=(t={},t[T]=E,t.centerOffset=E-S,t)}}function Zo(e){var t=e.state,n=e.options,r=n.element,o=void 0===r?"[data-popper-arrow]":r;null!=o&&("string"==typeof o&&(o=t.elements.popper.querySelector(o),!o)||!Po(t.elements.popper,o)||(t.elements.arrow=o))}var Xo={name:"arrow",enabled:!0,phase:"main",fn:Jo,effect:Zo,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Qo(e){return e.split("-")[1]}var ei={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ti(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:Ao(t*o)/o||0,y:Ao(n*o)/o||0}}function ni(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,g=void 0===f?0:f,m="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=Qr,w=Jr,C=window;if(c){var S=qo(n),E="clientHeight",T="clientWidth";if(S===So(n)&&(S=jo(n),"static"!==Ho(S).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth")),o===Jr||(o===Qr||o===Xr)&&i===ro){w=Zr;var k=d&&S===C&&C.visualViewport?C.visualViewport.height:S[E];g-=k-r.height,g*=l?1:-1}if(o===Qr||(o===Jr||o===Zr)&&i===ro){b=Xr;var x=d&&S===C&&C.visualViewport?C.visualViewport.width:S[T];h-=x-r.width,h*=l?1:-1}}var N,R=Object.assign({position:a},c&&ei),I=!0===u?ti({x:h,y:g}):{x:h,y:g};return h=I.x,g=I.y,l?Object.assign({},R,(N={},N[w]=y?"0":"",N[b]=v?"0":"",N.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",N)):Object.assign({},R,(t={},t[w]=y?g+"px":"",t[b]=v?h+"px":"",t.transform="",t))}function ri(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Io(t.placement),variation:Qo(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ni(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ni(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var oi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ri,data:{}},ii={passive:!0};function si(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=So(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,ii)})),a&&l.addEventListener("resize",n.update,ii),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,ii)})),a&&l.removeEventListener("resize",n.update,ii)}}var ai={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:si,data:{}},li={left:"right",right:"left",bottom:"top",top:"bottom"};function ci(e){return e.replace(/left|right|bottom|top/g,(function(e){return li[e]}))}var ui={start:"end",end:"start"};function di(e){return e.replace(/start|end/g,(function(e){return ui[e]}))}function pi(e){var t=So(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function hi(e){return Bo(jo(e)).left+pi(e).scrollLeft}function fi(e){var t=So(e),n=jo(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+hi(e),y:a}}function gi(e){var t,n=jo(e),r=pi(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=_o(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=_o(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+hi(e),l=-r.scrollTop;return"rtl"===Ho(o||n).direction&&(a+=_o(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function mi(e){var t=Ho(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function vi(e){return["html","body","#document"].indexOf(Co(e))>=0?e.ownerDocument.body:To(e)&&mi(e)?e:vi(Vo(e))}function yi(e,t){var n;void 0===t&&(t=[]);var r=vi(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=So(r),s=o?[i].concat(i.visualViewport||[],mi(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(yi(Vo(s)))}function bi(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function wi(e){var t=Bo(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ci(e,t){return t===io?bi(fi(e)):Eo(t)?wi(t):bi(gi(jo(e)))}function Si(e){var t=yi(Vo(e)),n=["absolute","fixed"].indexOf(Ho(e).position)>=0,r=n&&To(e)?qo(e):e;return Eo(r)?t.filter((function(e){return Eo(e)&&Po(e,r)&&"body"!==Co(e)})):[]}function Ei(e,t,n){var r="clippingParents"===t?Si(e):[].concat(t),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(t,n){var r=Ci(e,n);return t.top=_o(r.top,t.top),t.right=Oo(r.right,t.right),t.bottom=Oo(r.bottom,t.bottom),t.left=_o(r.left,t.left),t}),Ci(e,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Ti(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Io(o):null,s=o?Qo(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case Jr:t={x:a,y:n.y-r.height};break;case Zr:t={x:a,y:n.y+n.height};break;case Xr:t={x:n.x+n.width,y:l};break;case Qr:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?Fo(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case no:t[c]=t[c]-(n[u]/2-r[u]/2);break;case ro:t[c]=t[c]+(n[u]/2-r[u]/2);break}}return t}function ki(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,s=void 0===i?oo:i,a=n.rootBoundary,l=void 0===a?io:a,c=n.elementContext,u=void 0===c?so:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,g=Wo("number"!=typeof f?f:Go(f,to)),m=u===so?ao:so,v=e.rects.popper,y=e.elements[p?m:u],b=Ei(Eo(y)?y:y.contextElement||jo(e.elements.popper),s,l),w=Bo(e.elements.reference),C=Ti({reference:w,element:v,strategy:"absolute",placement:o}),S=bi(Object.assign({},v,C)),E=u===so?S:w,T={top:b.top-E.top+g.top,bottom:E.bottom-b.bottom+g.bottom,left:b.left-E.left+g.left,right:E.right-b.right+g.right},k=e.modifiersData.offset;if(u===so&&k){var x=k[o];Object.keys(T).forEach((function(e){var t=[Xr,Zr].indexOf(e)>=0?1:-1,n=[Jr,Zr].indexOf(e)>=0?"y":"x";T[e]+=x[n]*t}))}return T}function xi(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?co:l,u=Qo(r),d=u?a?lo:lo.filter((function(e){return Qo(e)===u})):to,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=ki(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[Io(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}function Ni(e){if(Io(e)===eo)return[];var t=ci(e);return[di(e),t,di(t)]}function Ri(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,v=Io(m),y=v===m,b=l||(y||!f?[ci(m)]:Ni(m)),w=[m].concat(b).reduce((function(e,n){return e.concat(Io(n)===eo?xi(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),C=t.rects.reference,S=t.rects.popper,E=new Map,T=!0,k=w[0],x=0;x<w.length;x++){var N=w[x],R=Io(N),I=Qo(N)===no,_=[Jr,Zr].indexOf(R)>=0,O=_?"width":"height",A=ki(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),B=_?I?Xr:Qr:I?Zr:Jr;C[O]>S[O]&&(B=ci(B));var D=ci(B),P=[];if(i&&P.push(A[R]<=0),a&&P.push(A[B]<=0,A[D]<=0),P.every((function(e){return e}))){k=N,T=!1;break}E.set(N,P)}if(T)for(var H=f?3:1,M=function(e){var t=w.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},j=H;j>0;j--){var V=M(j);if("break"===V)break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}}var Ii={name:"flip",enabled:!0,phase:"main",fn:Ri,requiresIfExists:["offset"],data:{_skip:!1}};function _i(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Oi(e){return[Jr,Xr,Zr,Qr].some((function(t){return e[t]>=0}))}function Ai(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=ki(t,{elementContext:"reference"}),a=ki(t,{altBoundary:!0}),l=_i(s,r),c=_i(a,o,i),u=Oi(l),d=Oi(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Bi={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ai};function Di(e,t,n){var r=Io(e),o=[Qr,Jr].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Qr,Xr].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Pi(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=co.reduce((function(e,n){return e[n]=Di(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}var Hi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Pi};function Mi(e){var t=e.state,n=e.name;t.modifiersData[n]=Ti({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var ji={name:"popperOffsets",enabled:!0,phase:"read",fn:Mi,data:{}};function Vi(e){return"x"===e?"y":"x"}function $i(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,g=void 0===f?0:f,m=ki(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Io(t.placement),y=Qo(t.placement),b=!y,w=Fo(v),C=Vi(w),S=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,x="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(S){if(i){var I,_="y"===w?Jr:Qr,O="y"===w?Zr:Xr,A="y"===w?"height":"width",B=S[w],D=B+m[_],P=B-m[O],H=h?-T[A]/2:0,M=y===no?E[A]:T[A],j=y===no?-T[A]:-E[A],V=t.elements.arrow,$=h&&V?Do(V):{width:0,height:0},L=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ko(),q=L[_],F=L[O],U=Uo(0,E[A],$[A]),z=b?E[A]/2-H-U-q-x.mainAxis:M-U-q-x.mainAxis,K=b?-E[A]/2+H+U+F+x.mainAxis:j+U+F+x.mainAxis,W=t.elements.arrow&&qo(t.elements.arrow),G=W?"y"===w?W.clientTop||0:W.clientLeft||0:0,Y=null!=(I=null==N?void 0:N[w])?I:0,J=B+z-Y-G,Z=B+K-Y,X=Uo(h?Oo(D,J):D,B,h?_o(P,Z):P);S[w]=X,R[w]=X-B}if(a){var Q,ee="x"===w?Jr:Qr,te="x"===w?Zr:Xr,ne=S[C],re="y"===C?"height":"width",oe=ne+m[ee],ie=ne-m[te],se=-1!==[Jr,Qr].indexOf(v),ae=null!=(Q=null==N?void 0:N[C])?Q:0,le=se?oe:ne-E[re]-T[re]-ae+x.altAxis,ce=se?ne+E[re]+T[re]-ae-x.altAxis:ie,ue=h&&se?zo(le,ne,ce):Uo(h?le:oe,ne,h?ce:ie);S[C]=ue,R[C]=ue-ne}t.modifiersData[r]=R}}var Li={name:"preventOverflow",enabled:!0,phase:"main",fn:$i,requiresIfExists:["offset"]};function qi(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Fi(e){return e!==So(e)&&To(e)?qi(e):pi(e)}function Ui(e){var t=e.getBoundingClientRect(),n=Ao(t.width)/e.offsetWidth||1,r=Ao(t.height)/e.offsetHeight||1;return 1!==n||1!==r}function zi(e,t,n){void 0===n&&(n=!1);var r=To(t),o=To(t)&&Ui(t),i=jo(t),s=Bo(e,o),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==Co(t)||mi(i))&&(a=Fi(t)),To(t)?(l=Bo(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=hi(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ki(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name);var i=[].concat(e.requires||[],e.requiresIfExists||[]);i.forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function Wi(e){var t=Ki(e);return wo.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}function Gi(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function Yi(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}var Ji={placement:"bottom",modifiers:[],strategy:"absolute"};function Zi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function Xi(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?Ji:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ji,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],a=!1,l={state:o,setOptions:function(n){var s="function"==typeof n?n(o.options):n;u(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:Eo(e)?yi(e):e.contextElement?yi(e.contextElement):[],popper:yi(t)};var a=Wi(Yi([].concat(r,o.options.modifiers)));return o.orderedModifiers=a.filter((function(e){return e.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var e=o.elements,t=e.reference,n=e.popper;if(Zi(t,n)){o.rects={reference:zi(t,qo(n),"fixed"===o.options.strategy),popper:Do(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],s=i.fn,c=i.options,u=void 0===c?{}:c,d=i.name;"function"==typeof s&&(o=s({state:o,options:u,name:d,instance:l})||o)}else o.reset=!1,r=-1}}},update:Gi((function(){return new Promise((function(e){l.forceUpdate(),e(o)}))})),destroy:function(){u(),a=!0}};if(!Zi(e,t))return l;function c(){o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var a=i({state:o,name:t,instance:l,options:r}),c=function(){};s.push(a||c)}}))}function u(){s.forEach((function(e){return e()})),s=[]}return l.setOptions(n).then((function(e){!a&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}Xi();var Qi=[ai,ji,oi,Ro],es=(Xi({defaultModifiers:Qi}),[ai,ji,oi,Ro,Hi,Ii,Li,Xo,Bi]),ts=Xi({defaultModifiers:es});const ns=["fixed","absolute"],rs=Dn({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:On(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:co,default:"bottom"},popperOptions:{type:On(Object),default:()=>({})},strategy:{type:String,values:ns,default:"absolute"}}),os=Dn({...rs,id:String,style:{type:On([String,Array,Object])},className:{type:On([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:On([String,Array,Object])},popperStyle:{type:On([String,Array,Object])},referenceEl:{type:On(Object)},triggerTargetEl:{type:On(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),is={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},ss=Dn({...Gr,...os,appendTo:{type:On([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:On(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),as=Dn({virtualRef:{type:On(Object)},virtualTriggering:Boolean,onMouseenter:{type:On(Function)},onMouseleave:{type:On(Function)},onClick:{type:On(Function)},onKeydown:{type:On(Function)},onFocus:{type:On(Function)},onBlur:{type:On(Function)},onContextmenu:{type:On(Function)},id:String,open:Boolean}),ls={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},cs=Dn({...as,disabled:Boolean,trigger:{type:On([String,Array]),default:"hover"},triggerKeys:{type:On(Array),default:()=>[ls.enter,ls.space]}}),us=Bn({type:On(Boolean),default:null}),ds=Bn({type:On(Function)}),ps=e=>{const t=`update:${e}`,r=`onUpdate:${e}`,o=[t],i={[e]:us,[r]:ds},s=({indicator:o,toggleReason:i,shouldHideWhenRouteChanges:s,shouldProceed:a,onShow:l,onHide:c})=>{const u=(0,n.getCurrentInstance)(),{emit:d}=u,p=u.props,h=(0,n.computed)((()=>sn(p[r]))),f=(0,n.computed)((()=>null===p[e])),g=e=>{!0!==o.value&&(o.value=!0,i&&(i.value=e),sn(l)&&l(e))},m=e=>{!1!==o.value&&(o.value=!1,i&&(i.value=e),sn(c)&&c(e))},v=e=>{if(!0===p.disabled||sn(a)&&!a())return;const n=h.value&&jr;n&&d(t,!0),!f.value&&n||g(e)},y=e=>{if(!0===p.disabled||!jr)return;const n=h.value&&jr;n&&d(t,!1),!f.value&&n||m(e)},b=e=>{vn(e)&&(p.disabled&&e?h.value&&d(t,!1):o.value!==e&&(e?g():m()))},w=()=>{o.value?y():v()};return(0,n.watch)((()=>p[e]),b),s&&void 0!==u.appContext.config.globalProperties.$route&&(0,n.watch)((()=>({...u.proxy.$route})),(()=>{s.value&&o.value&&y()})),(0,n.onMounted)((()=>{b(p[e])})),{hide:y,show:v,toggle:w,hasUpdateHandler:h}};return{useModelToggle:s,useModelToggleProps:i,useModelToggleEmits:o}},{useModelToggle:hs,useModelToggleProps:fs,useModelToggleEmits:gs}=ps("modelValue"),ms=Dn({arrowOffset:{type:Number,default:5}}),{useModelToggleProps:vs,useModelToggleEmits:ys,useModelToggle:bs}=ps("visible"),ws=Dn({...wr,...vs,...ss,...cs,...ms,showArrow:{type:Boolean,default:!0}}),Cs=[...ys,"before-show","before-hide","show","hide","open","close"],Ss=(e,t)=>on(e)?e.includes(t):e===t,Es=(e,t,r)=>o=>{Ss((0,n.unref)(e),t)&&r(o)},Ts=(e,t,{checkForDefaultPrevented:n=!0}={})=>{const r=r=>{const o=null==e?void 0:e(r);if(!1===n||!o)return null==t?void 0:t(r)};return r},ks=e=>t=>"mouse"===t.pointerType?e(t):void 0;function xs(e){return null==e}var Ns=xs;function Rs(e){var t;const n=qr(e);return null!=(t=null==n?void 0:n.$el)?t:n}const Is=jr?window:void 0,_s=jr?window.document:void 0;jr&&window.navigator,jr&&window.location;function Os(...e){let t,r,o,i;if(Vr(e[0])||Array.isArray(e[0])?([r,o,i]=e,t=Is):[t,r,o,i]=e,!t)return $r;Array.isArray(r)||(r=[r]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach((e=>e())),s.length=0},l=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=(0,n.watch)((()=>[Rs(t),qr(i)]),(([e,t])=>{a(),e&&s.push(...r.flatMap((n=>o.map((r=>l(e,n,r,t))))))}),{immediate:!0,flush:"post"}),u=()=>{c(),a()};return Ur(u),u}let As=!1;function Bs(e,t,n={}){const{window:r=Is,ignore:o=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return;Lr&&!As&&(As=!0,Array.from(r.document.body.children).forEach((e=>e.addEventListener("click",$r))));let a=!0;const l=e=>o.some((t=>{if("string"===typeof t)return Array.from(r.document.querySelectorAll(t)).some((t=>t===e.target||e.composedPath().includes(t)));{const n=Rs(t);return n&&(e.target===n||e.composedPath().includes(n))}})),c=n=>{const r=Rs(e);r&&r!==n.target&&!n.composedPath().includes(r)&&(0===n.detail&&(a=!l(n)),a?t(n):a=!0)},u=[Os(r,"click",c,{passive:!0,capture:i}),Os(r,"pointerdown",(t=>{const n=Rs(e);n&&(a=!t.composedPath().includes(n)&&!l(t))}),{passive:!0}),s&&Os(r,"blur",(n=>{var o;const i=Rs(e);"IFRAME"!==(null==(o=r.document.activeElement)?void 0:o.tagName)||(null==i?void 0:i.contains(r.document.activeElement))||t(n)}))].filter(Boolean),d=()=>u.forEach((e=>e()));return d}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ds(e,t=!1){const r=(0,n.ref)(),o=()=>r.value=Boolean(e());return o(),zr(o,t),r}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const Ps="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},Hs="__vueuse_ssr_handlers__";Ps[Hs]=Ps[Hs]||{};Ps[Hs];Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Ms({document:e=_s}={}){if(!e)return(0,n.ref)("visible");const t=(0,n.ref)(e.visibilityState);return Os(e,"visibilitychange",(()=>{t.value=e.visibilityState})),t}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var js=Object.getOwnPropertySymbols,Vs=Object.prototype.hasOwnProperty,$s=Object.prototype.propertyIsEnumerable,Ls=(e,t)=>{var n={};for(var r in e)Vs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&js)for(var r of js(e))t.indexOf(r)<0&&$s.call(e,r)&&(n[r]=e[r]);return n};function qs(e,t,r={}){const o=r,{window:i=Is}=o,s=Ls(o,["window"]);let a;const l=Ds((()=>i&&"ResizeObserver"in i)),c=()=>{a&&(a.disconnect(),a=void 0)},u=(0,n.watch)((()=>Rs(e)),(e=>{c(),l.value&&i&&e&&(a=new ResizeObserver(t),a.observe(e,s))}),{immediate:!0,flush:"post"}),d=()=>{c(),u()};return Ur(d),{isSupported:l,stop:d}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;new Map;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Fs=Object.getOwnPropertySymbols,Us=Object.prototype.hasOwnProperty,zs=Object.prototype.propertyIsEnumerable,Ks=(e,t)=>{var n={};for(var r in e)Us.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Fs)for(var r of Fs(e))t.indexOf(r)<0&&zs.call(e,r)&&(n[r]=e[r]);return n};function Ws(e,t,r={}){const o=r,{window:i=Is}=o,s=Ks(o,["window"]);let a;const l=Ds((()=>i&&"MutationObserver"in i)),c=()=>{a&&(a.disconnect(),a=void 0)},u=(0,n.watch)((()=>Rs(e)),(e=>{c(),l.value&&i&&e&&(a=new MutationObserver(t),a.observe(e,s))}),{immediate:!0}),d=()=>{c(),u()};return Ur(d),{isSupported:l,stop:d}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Gs;(function(e){e["UP"]="UP",e["RIGHT"]="RIGHT",e["DOWN"]="DOWN",e["LEFT"]="LEFT",e["NONE"]="NONE"})(Gs||(Gs={}));Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Ys=Object.defineProperty,Js=Object.getOwnPropertySymbols,Zs=Object.prototype.hasOwnProperty,Xs=Object.prototype.propertyIsEnumerable,Qs=(e,t,n)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ea=(e,t)=>{for(var n in t||(t={}))Zs.call(t,n)&&Qs(e,n,t[n]);if(Js)for(var n of Js(t))Xs.call(t,n)&&Qs(e,n,t[n]);return e};const ta={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};ea({linear:Fr},ta);function na({window:e=Is}={}){if(!e)return(0,n.ref)(!1);const t=(0,n.ref)(e.document.hasFocus());return Os(e,"blur",(()=>{t.value=!1})),Os(e,"focus",(()=>{t.value=!0})),t}const ra=Symbol("elForwardRef"),oa=e=>{const t=t=>{e.value=t};(0,n.provide)(ra,{setForwardRef:t})},ia=e=>({mounted(t){e(t)},updated(t){e(t)},unmounted(){e(null)}}),sa="ElOnlyChild",aa=(0,n.defineComponent)({name:sa,setup(e,{slots:t,attrs:r}){var o;const i=(0,n.inject)(ra),s=ia(null!=(o=null==i?void 0:i.setForwardRef)?o:tn);return()=>{var e;const o=null==(e=t.default)?void 0:e.call(t,r);if(!o)return null;if(o.length>1)return Nn(sa,"requires exact only one valid child."),null;const i=la(o);return i?(0,n.withDirectives)((0,n.cloneVNode)(i,r),[[s]]):(Nn(sa,"no valid child node found"),null)}}});function la(e){if(!e)return null;const t=e;for(const r of t){if(ln(r))switch(r.type){case n.Comment:continue;case n.Text:case"svg":return ca(r);case n.Fragment:return la(r.children);default:return r}return ca(r)}return null}function ca(e){const t=c("only-child");return(0,n.createVNode)("span",{class:t.e("content")},[e])}const ua=(0,n.defineComponent)({name:"ElPopperTrigger",inheritAttrs:!1}),da=(0,n.defineComponent)({...ua,props:as,setup(e,{expose:t}){const r=e,{role:o,triggerRef:i}=(0,n.inject)(vr,void 0);oa(i);const s=(0,n.computed)((()=>l.value?r.id:void 0)),a=(0,n.computed)((()=>{if(o&&"tooltip"===o.value)return r.open&&r.id?r.id:void 0})),l=(0,n.computed)((()=>{if(o&&"tooltip"!==o.value)return o.value})),c=(0,n.computed)((()=>l.value?`${r.open}`:void 0));let u;return(0,n.onMounted)((()=>{(0,n.watch)((()=>r.virtualRef),(e=>{e&&(i.value=Rs(e))}),{immediate:!0}),(0,n.watch)(i,((e,t)=>{null==u||u(),u=void 0,bn(e)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach((n=>{var o;const i=r[n];i&&(e.addEventListener(n.slice(2).toLowerCase(),i),null==(o=null==t?void 0:t.removeEventListener)||o.call(t,n.slice(2).toLowerCase(),i))})),u=(0,n.watch)([s,a,l,c],(t=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(((n,r)=>{Ns(t[r])?e.removeAttribute(n):e.setAttribute(n,t[r])}))}),{immediate:!0})),bn(t)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((e=>t.removeAttribute(e)))}),{immediate:!0})})),(0,n.onBeforeUnmount)((()=>{null==u||u(),u=void 0})),t({triggerRef:i}),(e,t)=>e.virtualTriggering?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(aa),(0,n.mergeProps)({key:0},e.$attrs,{"aria-controls":(0,n.unref)(s),"aria-describedby":(0,n.unref)(a),"aria-expanded":(0,n.unref)(c),"aria-haspopup":(0,n.unref)(l)}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var pa=Cr(da,[["__file","trigger.vue"]]);const ha=(0,n.defineComponent)({name:"ElTooltipTrigger"}),fa=(0,n.defineComponent)({...ha,props:cs,setup(e,{expose:t}){const r=e,o=c("tooltip"),{controlled:i,id:s,open:a,onOpen:l,onClose:u,onToggle:d}=(0,n.inject)(xr,void 0),p=(0,n.ref)(null),h=()=>{if((0,n.unref)(i)||r.disabled)return!0},f=(0,n.toRef)(r,"trigger"),g=Ts(h,Es(f,"hover",l)),m=Ts(h,Es(f,"hover",u)),v=Ts(h,Es(f,"click",(e=>{0===e.button&&d(e)}))),y=Ts(h,Es(f,"focus",l)),b=Ts(h,Es(f,"focus",u)),w=Ts(h,Es(f,"contextmenu",(e=>{e.preventDefault(),d(e)}))),C=Ts(h,(e=>{const{code:t}=e;r.triggerKeys.includes(t)&&(e.preventDefault(),d(e))}));return t({triggerRef:p}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(pa),{id:(0,n.unref)(s),"virtual-ref":e.virtualRef,open:(0,n.unref)(a),"virtual-triggering":e.virtualTriggering,class:(0,n.normalizeClass)((0,n.unref)(o).e("trigger")),onBlur:(0,n.unref)(b),onClick:(0,n.unref)(v),onContextmenu:(0,n.unref)(w),onFocus:(0,n.unref)(y),onMouseenter:(0,n.unref)(g),onMouseleave:(0,n.unref)(m),onKeydown:(0,n.unref)(C)},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ga=Cr(fa,[["__file","trigger.vue"]]);const ma={prefix:Math.floor(1e4*Math.random()),current:0},va=Symbol("elIdInjection"),ya=()=>(0,n.getCurrentInstance)()?(0,n.inject)(va,ma):ma,ba=e=>{const t=ya();jr||t!==ma||Nn("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const r=l(),o=(0,n.computed)((()=>(0,n.unref)(e)||`${r.value}-id-${t.prefix}-${t.current++}`));return o};let wa;const Ca=()=>{const e=l(),t=ya(),r=(0,n.computed)((()=>`${e.value}-popper-container-${t.prefix}`)),o=(0,n.computed)((()=>`#${r.value}`));return{id:r,selector:o}},Sa=e=>{const t=document.createElement("div");return t.id=e,document.body.appendChild(t),t},Ea=()=>{const{id:e,selector:t}=Ca();return(0,n.onBeforeMount)((()=>{jr&&(wa||document.body.querySelector(t.value)||(wa=Sa(e.value)))})),{id:e,selector:t}},Ta=(e,t)=>{const r=(0,n.ref)(!1),o=(0,n.ref)(),i=()=>{t("focus")},s=e=>{var n;"pointer"!==(null==(n=e.detail)?void 0:n.focusReason)&&(o.value="first",t("blur"))},a=t=>{e.visible&&!r.value&&(t.target&&(o.value=t.target),r.value=!0)},l=t=>{e.trapping||("pointer"===t.detail.focusReason&&t.preventDefault(),r.value=!1)},c=()=>{r.value=!1,t("close")};return{focusStartRef:o,trapped:r,onFocusAfterReleased:s,onFocusAfterTrapped:i,onFocusInTrap:a,onFocusoutPrevented:l,onReleaseRequested:c}};function ka(e){return void 0===e}var xa=ka;const Na=(e,t=[])=>{const{placement:n,strategy:r,popperOptions:o}=e,i={placement:n,strategy:r,...o,modifiers:[...Ia(e),...t]};return _a(i,null==o?void 0:o.modifiers),i},Ra=e=>{if(jr)return Rs(e)};function Ia(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:r}=e;return[{name:"offset",options:{offset:[0,null!=t?t:12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function _a(e,t){t&&(e.modifiers=[...e.modifiers,...null!=t?t:[]])}const Oa=(e,t,r={})=>{const o={name:"updateState",enabled:!0,phase:"write",fn:({state:e})=>{const t=Aa(e);Object.assign(a.value,t)},requires:["computeStyles"]},i=(0,n.computed)((()=>{const{onFirstUpdate:e,placement:t,strategy:i,modifiers:s}=(0,n.unref)(r);return{onFirstUpdate:e,placement:t||"bottom",strategy:i||"absolute",modifiers:[...s||[],o,{name:"applyStyles",enabled:!1}]}})),s=(0,n.shallowRef)(),a=(0,n.ref)({styles:{popper:{position:(0,n.unref)(i).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return(0,n.watch)(i,(e=>{const t=(0,n.unref)(s);t&&t.setOptions(e)}),{deep:!0}),(0,n.watch)([e,t],(([e,t])=>{l(),e&&t&&(s.value=ts(e,t,(0,n.unref)(i)))})),(0,n.onBeforeUnmount)((()=>{l()})),{state:(0,n.computed)((()=>{var e;return{...(null==(e=(0,n.unref)(s))?void 0:e.state)||{}}})),styles:(0,n.computed)((()=>(0,n.unref)(a).styles)),attributes:(0,n.computed)((()=>(0,n.unref)(a).attributes)),update:()=>{var e;return null==(e=(0,n.unref)(s))?void 0:e.update()},forceUpdate:()=>{var e;return null==(e=(0,n.unref)(s))?void 0:e.forceUpdate()},instanceRef:(0,n.computed)((()=>(0,n.unref)(s)))}};function Aa(e){const t=Object.keys(e.elements),n=In(t.map((t=>[t,e.styles[t]||{}]))),r=In(t.map((t=>[t,e.attributes[t]])));return{styles:n,attributes:r}}const Ba=0,Da=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:o,role:i}=(0,n.inject)(vr,void 0),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.computed)((()=>({name:"eventListeners",enabled:!!e.visible}))),c=(0,n.computed)((()=>{var e;const t=(0,n.unref)(s),r=null!=(e=(0,n.unref)(a))?e:Ba;return{name:"arrow",enabled:!xa(t),options:{element:t,padding:r}}})),u=(0,n.computed)((()=>({onFirstUpdate:()=>{g()},...Na(e,[(0,n.unref)(c),(0,n.unref)(l)])}))),d=(0,n.computed)((()=>Ra(e.referenceEl)||(0,n.unref)(o))),{attributes:p,state:h,styles:f,update:g,forceUpdate:m,instanceRef:v}=Oa(d,r,u);return(0,n.watch)(v,(e=>t.value=e)),(0,n.onMounted)((()=>{(0,n.watch)((()=>{var e;return null==(e=(0,n.unref)(d))?void 0:e.getBoundingClientRect()}),(()=>{g()}))})),{attributes:p,arrowRef:s,contentRef:r,instanceRef:v,state:h,styles:f,role:i,forceUpdate:m,update:g}},Pa=(e,{attributes:t,styles:r,role:o})=>{const{nextZIndex:i}=Tn(),s=c("popper"),a=(0,n.computed)((()=>(0,n.unref)(t).popper)),l=(0,n.ref)(yn(e.zIndex)?e.zIndex:i()),u=(0,n.computed)((()=>[s.b(),s.is("pure",e.pure),s.is(e.effect),e.popperClass])),d=(0,n.computed)((()=>[{zIndex:(0,n.unref)(l)},(0,n.unref)(r).popper,e.popperStyle||{}])),p=(0,n.computed)((()=>"dialog"===o.value?"false":void 0)),h=(0,n.computed)((()=>(0,n.unref)(r).arrow||{})),f=()=>{l.value=yn(e.zIndex)?e.zIndex:i()};return{ariaModal:p,arrowStyle:h,contentAttrs:a,contentClass:u,contentStyle:d,contentZIndex:l,updateZIndex:f}},Ha=Symbol("formContextKey"),Ma=Symbol("formItemContextKey"),ja="focus-trap.focus-after-trapped",Va="focus-trap.focus-after-released",$a="focus-trap.focusout-prevented",La={cancelable:!0,bubbles:!1},qa={cancelable:!0,bubbles:!1},Fa="focusAfterTrapped",Ua="focusAfterReleased",za=Symbol("elFocusTrap"),Ka=(0,n.ref)(),Wa=(0,n.ref)(0),Ga=(0,n.ref)(0);let Ya=0;const Ja=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});while(n.nextNode())t.push(n.currentNode);return t},Za=(e,t)=>{for(const n of e)if(!Xa(n,t))return n},Xa=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;while(e){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},Qa=e=>{const t=Ja(e),n=Za(t,e),r=Za(t.reverse(),e);return[n,r]},el=e=>e instanceof HTMLInputElement&&"select"in e,tl=(e,t)=>{if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),Ga.value=window.performance.now(),e!==n&&el(e)&&t&&e.select()}};function nl(e,t){const n=[...e],r=e.indexOf(t);return-1!==r&&n.splice(r,1),n}const rl=()=>{let e=[];const t=t=>{const n=e[0];n&&t!==n&&n.pause(),e=nl(e,t),e.unshift(t)},n=t=>{var n,r;e=nl(e,t),null==(r=null==(n=e[0])?void 0:n.resume)||r.call(n)};return{push:t,remove:n}},ol=(e,t=!1)=>{const n=document.activeElement;for(const r of e)if(tl(r,t),document.activeElement!==n)return},il=rl(),sl=()=>Wa.value>Ga.value,al=()=>{Ka.value="pointer",Wa.value=window.performance.now()},ll=()=>{Ka.value="keyboard",Wa.value=window.performance.now()},cl=()=>((0,n.onMounted)((()=>{0===Ya&&(document.addEventListener("mousedown",al),document.addEventListener("touchstart",al),document.addEventListener("keydown",ll)),Ya++})),(0,n.onBeforeUnmount)((()=>{Ya--,Ya<=0&&(document.removeEventListener("mousedown",al),document.removeEventListener("touchstart",al),document.removeEventListener("keydown",ll))})),{focusReason:Ka,lastUserFocusTimestamp:Wa,lastAutomatedFocusTimestamp:Ga}),ul=e=>new CustomEvent($a,{...qa,detail:e});let dl=[];const pl=e=>{const t=e;t.key===ls.esc&&dl.forEach((e=>e(t)))},hl=e=>{(0,n.onMounted)((()=>{0===dl.length&&document.addEventListener("keydown",pl),jr&&dl.push(e)})),(0,n.onBeforeUnmount)((()=>{dl=dl.filter((t=>t!==e)),0===dl.length&&jr&&document.removeEventListener("keydown",pl)}))},fl=(0,n.defineComponent)({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Fa,Ua,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=(0,n.ref)();let o,i;const{focusReason:s}=cl();hl((n=>{e.trapped&&!a.paused&&t("release-requested",n)}));const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{key:r,altKey:o,ctrlKey:i,metaKey:l,currentTarget:c,shiftKey:u}=n,{loop:d}=e,p=r===ls.tab&&!o&&!i&&!l,h=document.activeElement;if(p&&h){const e=c,[r,o]=Qa(e),i=r&&o;if(i)if(u||h!==o){if(u&&[r,e].includes(h)){const e=ul({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&tl(o,!0))}}else{const e=ul({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&tl(r,!0))}else if(h===e){const e=ul({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};(0,n.provide)(za,{focusTrapRef:r,onKeydown:l}),(0,n.watch)((()=>e.focusTrapEl),(e=>{e&&(r.value=e)}),{immediate:!0}),(0,n.watch)([r],(([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",d),e.addEventListener("focusout",p)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",d),t.removeEventListener("focusout",p))}));const c=e=>{t(Fa,e)},u=e=>t(Ua,e),d=s=>{const l=(0,n.unref)(r);if(!l)return;const c=s.target,u=s.relatedTarget,d=c&&l.contains(c);if(!e.trapped){const e=u&&l.contains(u);e||(o=u)}d&&t("focusin",s),a.paused||e.trapped&&(d?i=c:tl(i,!0))},p=o=>{const l=(0,n.unref)(r);if(!a.paused&&l)if(e.trapped){const n=o.relatedTarget;Ns(n)||l.contains(n)||setTimeout((()=>{if(!a.paused&&e.trapped){const e=ul({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||tl(i,!0)}}),0)}else{const e=o.target,n=e&&l.contains(e);n||t("focusout",o)}};async function h(){await(0,n.nextTick)();const t=(0,n.unref)(r);if(t){il.push(a);const r=t.contains(document.activeElement)?o:document.activeElement;o=r;const i=t.contains(r);if(!i){const o=new Event(ja,La);t.addEventListener(ja,c),t.dispatchEvent(o),o.defaultPrevented||(0,n.nextTick)((()=>{let n=e.focusStartEl;an(n)||(tl(n),document.activeElement!==n&&(n="first")),"first"===n&&ol(Ja(t),!0),document.activeElement!==r&&"container"!==n||tl(t)}))}}}function f(){const e=(0,n.unref)(r);if(e){e.removeEventListener(ja,c);const t=new CustomEvent(Va,{...La,detail:{focusReason:s.value}});e.addEventListener(Va,u),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=s.value&&sl()&&!e.contains(document.activeElement)||tl(null!=o?o:document.body),e.removeEventListener(Va,u),il.remove(a)}}return(0,n.onMounted)((()=>{e.trapped&&h(),(0,n.watch)((()=>e.trapped),(e=>{e?h():f()}))})),(0,n.onBeforeUnmount)((()=>{e.trapped&&f()})),{onKeydown:l}}});function gl(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default",{handleKeydown:e.onKeydown})}var ml=Cr(fl,[["render",gl],["__file","focus-trap.vue"]]);const vl=(0,n.defineComponent)({name:"ElPopperContent"}),yl=(0,n.defineComponent)({...vl,props:os,emits:is,setup(e,{expose:t,emit:r}){const o=e,{focusStartRef:i,trapped:s,onFocusAfterReleased:a,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=Ta(o,r),{attributes:p,arrowRef:h,contentRef:f,styles:g,instanceRef:m,role:v,update:y}=Da(o),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:S,contentStyle:E,updateZIndex:T}=Pa(o,{styles:g,attributes:p,role:v}),k=(0,n.inject)(Ma,void 0),x=(0,n.ref)();let N;(0,n.provide)(yr,{arrowStyle:w,arrowRef:h,arrowOffset:x}),k&&(k.addInputId||k.removeInputId)&&(0,n.provide)(Ma,{...k,addInputId:tn,removeInputId:tn});const R=(e=!0)=>{y(),e&&T()},I=()=>{R(!1),o.visible&&o.focusOnShow?s.value=!0:!1===o.visible&&(s.value=!1)};return(0,n.onMounted)((()=>{(0,n.watch)((()=>o.triggerTargetEl),((e,t)=>{null==N||N(),N=void 0;const r=(0,n.unref)(e||f.value),i=(0,n.unref)(t||f.value);bn(r)&&(N=(0,n.watch)([v,()=>o.ariaLabel,b,()=>o.id],(e=>{["role","aria-label","aria-modal","id"].forEach(((t,n)=>{Ns(e[n])?r.removeAttribute(t):r.setAttribute(t,e[n])}))}),{immediate:!0})),i!==r&&bn(i)&&["role","aria-label","aria-modal","id"].forEach((e=>{i.removeAttribute(e)}))}),{immediate:!0}),(0,n.watch)((()=>o.visible),I,{immediate:!0})})),(0,n.onBeforeUnmount)((()=>{null==N||N(),N=void 0})),t({popperContentRef:f,popperInstanceRef:m,updatePopper:R,contentStyle:E}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({ref_key:"contentRef",ref:f},(0,n.unref)(C),{style:(0,n.unref)(E),class:(0,n.unref)(S),tabindex:"-1",onMouseenter:t[0]||(t[0]=t=>e.$emit("mouseenter",t)),onMouseleave:t[1]||(t[1]=t=>e.$emit("mouseleave",t))}),[(0,n.createVNode)((0,n.unref)(ml),{trapped:(0,n.unref)(s),"trap-on-focus-in":!0,"focus-trap-el":(0,n.unref)(f),"focus-start-el":(0,n.unref)(i),onFocusAfterTrapped:(0,n.unref)(l),onFocusAfterReleased:(0,n.unref)(a),onFocusin:(0,n.unref)(c),onFocusoutPrevented:(0,n.unref)(u),onReleaseRequested:(0,n.unref)(d)},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var bl=Cr(yl,[["__file","content.vue"]]);const wl=(0,n.defineComponent)({name:"ElTooltipContent",inheritAttrs:!1}),Cl=(0,n.defineComponent)({...wl,props:ss,setup(e,{expose:t}){const r=e,{selector:o}=Ca(),i=c("tooltip"),s=(0,n.ref)(null),a=(0,n.ref)(!1),{controlled:l,id:u,open:d,trigger:p,onClose:h,onOpen:f,onShow:g,onHide:m,onBeforeShow:v,onBeforeHide:y}=(0,n.inject)(xr,void 0),b=(0,n.computed)((()=>r.transition||`${i.namespace.value}-fade-in-linear`)),w=(0,n.computed)((()=>r.persistent));(0,n.onBeforeUnmount)((()=>{a.value=!0}));const C=(0,n.computed)((()=>!!(0,n.unref)(w)||(0,n.unref)(d))),S=(0,n.computed)((()=>!r.disabled&&(0,n.unref)(d))),E=(0,n.computed)((()=>r.appendTo||o.value)),T=(0,n.computed)((()=>{var e;return null!=(e=r.style)?e:{}})),k=(0,n.computed)((()=>!(0,n.unref)(d))),x=()=>{m()},N=()=>{if((0,n.unref)(l))return!0},R=Ts(N,(()=>{r.enterable&&"hover"===(0,n.unref)(p)&&f()})),I=Ts(N,(()=>{"hover"===(0,n.unref)(p)&&h()})),_=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e),null==v||v()},O=()=>{null==y||y()},A=()=>{g(),D=Bs((0,n.computed)((()=>{var e;return null==(e=s.value)?void 0:e.popperContentRef})),(()=>{if((0,n.unref)(l))return;const e=(0,n.unref)(p);"hover"!==e&&h()}))},B=()=>{r.virtualTriggering||h()};let D;return(0,n.watch)((()=>(0,n.unref)(d)),(e=>{e||null==D||D()}),{flush:"post"}),(0,n.watch)((()=>r.content),(()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e)})),t({contentRef:s}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Teleport,{disabled:!e.teleported,to:(0,n.unref)(E)},[(0,n.createVNode)(n.Transition,{name:(0,n.unref)(b),onAfterLeave:x,onBeforeEnter:_,onAfterEnter:A,onBeforeLeave:O},{default:(0,n.withCtx)((()=>[(0,n.unref)(C)?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(bl),(0,n.mergeProps)({key:0,id:(0,n.unref)(u),ref_key:"contentRef",ref:s},e.$attrs,{"aria-label":e.ariaLabel,"aria-hidden":(0,n.unref)(k),"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,(0,n.unref)(T)],"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,visible:(0,n.unref)(S),"z-index":e.zIndex,onMouseenter:(0,n.unref)(R),onMouseleave:(0,n.unref)(I),onBlur:B,onClose:(0,n.unref)(h)}),{default:(0,n.withCtx)((()=>[a.value?(0,n.createCommentVNode)("v-if",!0):(0,n.renderSlot)(e.$slots,"default",{key:0})])),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[n.vShow,(0,n.unref)(S)]]):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["name"])],8,["disabled","to"]))}});var Sl=Cr(Cl,[["__file","content.vue"]]);const El=(0,n.defineComponent)({name:"ElPopperArrow",inheritAttrs:!1}),Tl=(0,n.defineComponent)({...El,props:ms,setup(e,{expose:t}){const r=e,o=c("popper"),{arrowOffset:i,arrowRef:s,arrowStyle:a}=(0,n.inject)(yr,void 0);return(0,n.watch)((()=>r.arrowOffset),(e=>{i.value=e})),(0,n.onBeforeUnmount)((()=>{s.value=void 0})),t({arrowRef:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("span",{ref_key:"arrowRef",ref:s,class:(0,n.normalizeClass)((0,n.unref)(o).e("arrow")),style:(0,n.normalizeStyle)((0,n.unref)(a)),"data-popper-arrow":""},null,6))}});var kl=Cr(Tl,[["__file","arrow.vue"]]);const xl=["innerHTML"],Nl={key:1},Rl=(0,n.defineComponent)({name:"ElTooltip"}),Il=(0,n.defineComponent)({...Rl,props:ws,emits:Cs,setup(e,{expose:t,emit:r}){const o=e;Ea();const i=ba(),s=(0,n.ref)(),a=(0,n.ref)(),l=()=>{var e;const t=(0,n.unref)(s);t&&(null==(e=t.popperInstanceRef)||e.update())},c=(0,n.ref)(!1),u=(0,n.ref)(),{show:d,hide:p,hasUpdateHandler:h}=bs({indicator:c,toggleReason:u}),{onOpen:f,onClose:g}=Yr({showAfter:(0,n.toRef)(o,"showAfter"),hideAfter:(0,n.toRef)(o,"hideAfter"),autoClose:(0,n.toRef)(o,"autoClose"),open:d,close:p}),m=(0,n.computed)((()=>vn(o.visible)&&!h.value));(0,n.provide)(xr,{controlled:m,id:i,open:(0,n.readonly)(c),trigger:(0,n.toRef)(o,"trigger"),onOpen:e=>{f(e)},onClose:e=>{g(e)},onToggle:e=>{(0,n.unref)(c)?g(e):f(e)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),(0,n.watch)((()=>o.disabled),(e=>{e&&c.value&&(c.value=!1)}));const v=e=>{var t,n;const r=null==(n=null==(t=a.value)?void 0:t.contentRef)?void 0:n.popperContentRef,o=(null==e?void 0:e.relatedTarget)||document.activeElement;return r&&r.contains(o)};return(0,n.onDeactivated)((()=>c.value&&p())),t({popperRef:s,contentRef:a,isFocusInsideContent:v,updatePopper:l,onOpen:f,onClose:g,hide:p}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(kr),{ref_key:"popperRef",ref:s,role:e.role},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(ga,{disabled:e.disabled,trigger:e.trigger,"trigger-keys":e.triggerKeys,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering},{default:(0,n.withCtx)((()=>[e.$slots.default?(0,n.renderSlot)(e.$slots,"default",{key:0}):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),(0,n.createVNode)(Sl,{ref_key:"contentRef",ref:a,"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":e.popperClass,"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,"show-after":e.showAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"virtual-triggering":e.virtualTriggering,"z-index":e.zIndex,"append-to":e.appendTo},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"content",{},(()=>[e.rawContent?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,innerHTML:e.content},null,8,xl)):((0,n.openBlock)(),(0,n.createElementBlock)("span",Nl,(0,n.toDisplayString)(e.content),1))])),e.showArrow?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(kl),{key:0,"arrow-offset":e.arrowOffset},null,8,["arrow-offset"])):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])])),_:3},8,["role"]))}});var _l=Cr(Il,[["__file","tooltip.vue"]]);const Ol=dr(_l);
32
+ const a=Object.create(null);a.open="0",a.close="1",a.ping="2",a.pong="3",a.message="4",a.upgrade="5",a.noop="6";const l=Object.create(null);Object.keys(a).forEach((e=>{l[a[e]]=e}));const c={type:"error",data:"parser error"},u="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),d="function"==typeof ArrayBuffer,p=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,h=({type:e,data:t},n,r)=>u&&t instanceof Blob?n?r(t):f(t,r):d&&(t instanceof ArrayBuffer||p(t))?n?r(t):f(new Blob([t]),r):r(a[e]+(t||"")),f=(e,t)=>{const n=new FileReader;return n.onload=function(){const e=n.result.split(",")[1];t("b"+(e||""))},n.readAsDataURL(e)};function g(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let m;const v="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let De=0;De<64;De++)v["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(De)]=De;const y="function"==typeof ArrayBuffer,b=(e,t)=>{if("string"!=typeof e)return{type:"message",data:C(e,t)};const n=e.charAt(0);return"b"===n?{type:"message",data:w(e.substring(1),t)}:l[n]?e.length>1?{type:l[n],data:e.substring(1)}:{type:l[n]}:c},w=(e,t)=>{if(y){const n=(e=>{let t,n,r,o,i,s=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);const c=new ArrayBuffer(s),u=new Uint8Array(c);for(t=0;t<a;t+=4)n=v[e.charCodeAt(t)],r=v[e.charCodeAt(t+1)],o=v[e.charCodeAt(t+2)],i=v[e.charCodeAt(t+3)],u[l++]=n<<2|r>>4,u[l++]=(15&r)<<4|o>>2,u[l++]=(3&o)<<6|63&i;return c})(e);return C(n,t)}return{base64:!0,data:e}},C=(e,t)=>"blob"===t?e instanceof Blob?e:new Blob([e]):e instanceof ArrayBuffer?e:e.buffer,S=String.fromCharCode(30);function E(){return new TransformStream({transform(e,t){!function(e,t){u&&e.data instanceof Blob?e.data.arrayBuffer().then(g).then(t):d&&(e.data instanceof ArrayBuffer||p(e.data))?t(g(e.data)):h(e,!1,(e=>{m||(m=new TextEncoder),t(m.encode(e))}))}(e,(n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const e=new DataView(o.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{o=new Uint8Array(9);const e=new DataView(o.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(o[0]|=128),t.enqueue(o),t.enqueue(n)}))}})}let T;function k(e){return e.reduce(((e,t)=>e+t.length),0)}function x(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let o=0;o<t;o++)n[o]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function N(e){if(e)return function(e){for(var t in N.prototype)e[t]=N.prototype[t];return e}(e)}N.prototype.on=N.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},N.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},N.prototype.off=N.prototype.removeListener=N.prototype.removeAllListeners=N.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},N.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t)}return this},N.prototype.emitReserved=N.prototype.emit,N.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},N.prototype.hasListeners=function(e){return!!this.listeners(e).length};const R="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function I(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const _=R.setTimeout,O=R.clearTimeout;function A(e,t){t.useNativeTimers?(e.setTimeoutFn=_.bind(R),e.clearTimeoutFn=O.bind(R)):(e.setTimeoutFn=R.setTimeout.bind(R),e.clearTimeoutFn=R.clearTimeout.bind(R))}class B extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class D extends N{constructor(e){super(),this.writable=!1,A(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new B(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=b(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const P="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),H=64,M={};let j,V=0,L=0;function $(e){let t="";do{t=P[e%H]+t,e=Math.floor(e/H)}while(e>0);return t}function q(){const e=$(+new Date);return e!==j?(V=0,j=e):e+"."+$(V++)}for(;L<H;L++)M[P[L]]=L;let F=!1;try{F="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(a){}const U=F;function z(e){const t=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||U))return new XMLHttpRequest}catch(e){}if(!t)try{return new(R[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function K(){}const W=null!=new z({xdomain:!1}).responseType;class G extends N{constructor(e,t){super(),A(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e;const t=I(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const n=this.xhr=new z(t);try{n.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&n.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{n.setRequestHeader("Accept","*/*")}catch(e){}null===(e=this.opts.cookieJar)||void 0===e||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{var e;3===n.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(n)),4===n.readyState&&(200===n.status||1223===n.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=G.requestsCount++,G.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=K,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete G.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}function Y(){for(let e in G.requests)G.requests.hasOwnProperty(e)&&G.requests[e].abort()}G.requestsCount=0,G.requests={},"undefined"!=typeof document&&("function"==typeof attachEvent?attachEvent("onunload",Y):"function"==typeof addEventListener&&addEventListener("onpagehide"in R?"pagehide":"unload",Y,!1));const J="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),Z=R.WebSocket||R.MozWebSocket,X="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Q={websocket:class extends D{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=X?{}:I(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=X?new Z(e,t,n):t?new Z(e,t):new Z(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;h(n,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}r&&J((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=q()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!Z}},webtransport:class extends D{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=function(e,t){T||(T=new TextDecoder);const n=[];let r=0,o=-1,i=!1;return new TransformStream({transform(s,a){for(n.push(s);;){if(0===r){if(k(n)<1)break;const e=x(n,1);i=128==(128&e[0]),o=127&e[0],r=o<126?3:126===o?1:2}else if(1===r){if(k(n)<2)break;const e=x(n,2);o=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(k(n)<8)break;const e=x(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),i=t.getUint32(0);if(i>Math.pow(2,21)-1){a.enqueue(c);break}o=i*Math.pow(2,32)+t.getUint32(4),r=3}else{if(k(n)<o)break;const e=x(n,o);a.enqueue(b(i?e:T.decode(e),t)),r=0}if(0===o||o>e){a.enqueue(c);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=E();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const o=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),o())})).catch((e=>{}))};o();const i={type:"open"};this.query.sid&&(i.data=`{"sid":"${this.query.sid}"}`),this.writer.write(i).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&J((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends D{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=W&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(S),r=[];for(let o=0;o<n.length;o++){const e=b(n[o],t);if(r.push(e),"error"===e.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let o=0;e.forEach(((e,i)=>{h(e,!1,(e=>{r[i]=e,++o===n&&t(r.join(S))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=q()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new G(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},ee=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,te=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function ne(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let o=ee.exec(e||""),i={},s=14;for(;s--;)i[te[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=function(e,t){const n=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||n.splice(0,1),"/"==t.slice(-1)&&n.splice(n.length-1,1),n}(0,i.path),i.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,i.query),i}class re extends N{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=ne(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=ne(t.host).host),A(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let r=0,o=n.length;r<o;r++){let e=n[r].split("=");t[decodeURIComponent(e[0])]=decodeURIComponent(e[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new Q[e](n)}open(){let e;if(this.opts.rememberUpgrade&&re.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(e){let t=this.createTransport(e),n=!1;re.priorWebsocketSuccess=!1;const r=()=>{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",(e=>{if(!n)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;re.priorWebsocketSuccess="websocket"===t.name,this.transport.pause((()=>{n||"closed"!==this.readyState&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=t.name,this.emitReserved("upgradeError",e)}})))};function o(){n||(n=!0,c(),t.close(),t=null)}const i=e=>{const n=new Error("probe error: "+e);n.transport=t.name,o(),this.emitReserved("upgradeError",n)};function s(){i("transport closed")}function a(){i("socket closed")}function l(e){t&&e.name!==t.name&&o()}const c=()=>{t.removeListener("open",r),t.removeListener("error",i),t.removeListener("close",s),this.off("close",a),this.off("upgrading",l)};t.once("open",r),t.once("error",i),t.once("close",s),this.once("close",a),this.once("upgrading",l),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==e?this.setTimeoutFn((()=>{n||t.open()}),200):t.open()}onOpen(){if(this.readyState="open",re.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,o=e.length;r<o;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const o={type:e,data:t,options:n};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(e){re.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}re.protocol=4;const oe="function"==typeof ArrayBuffer,ie=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,se=Object.prototype.toString,ae="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===se.call(Blob),le="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===se.call(File);function ce(e){return oe&&(e instanceof ArrayBuffer||ie(e))||ae&&e instanceof Blob||le&&e instanceof File}function ue(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(ue(e[t]))return!0;return!1}if(ce(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return ue(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ue(e[n]))return!0;return!1}function de(e){const t=[],n=e.data,r=e;return r.data=pe(n,t),r.attachments=t.length,{packet:r,buffers:t}}function pe(e,t){if(!e)return e;if(ce(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=pe(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=pe(e[r],t));return n}return e}function he(e,t){return e.data=fe(e.data,t),delete e.attachments,e}function fe(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=fe(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=fe(e[n],t));return e}const ge=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var me;function ve(e){return"[object Object]"===Object.prototype.toString.call(e)}!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(me||(me={}));class ye extends N{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===me.BINARY_EVENT;n||t.type===me.BINARY_ACK?(t.type=n?me.EVENT:me.ACK,this.reconstructor=new be(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!ce(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===me[n.type])throw new Error("unknown packet type "+n.type);if(n.type===me.BINARY_EVENT||n.type===me.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const o=e.substring(r,t);if(o!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(o)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t&&","!==e.charAt(t)&&t!==e.length;);n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!ye.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case me.CONNECT:return ve(t);case me.DISCONNECT:return void 0===t;case me.CONNECT_ERROR:return"string"==typeof t||ve(t);case me.EVENT:case me.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===ge.indexOf(t[0]));case me.ACK:case me.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class be{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=he(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var we=Object.freeze({__proto__:null,protocol:5,get PacketType(){return me},Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==me.EVENT&&e.type!==me.ACK||!ue(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===me.EVENT?me.BINARY_EVENT:me.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==me.BINARY_EVENT&&e.type!==me.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=de(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},Decoder:ye});function Ce(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const Se=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Ee extends N{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Ce(e,"open",this.onopen.bind(this)),Ce(e,"packet",this.onpacket.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Se.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:me.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}emitWithAck(e,...t){const n=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((r,o)=>{t.push(((e,t)=>n?e?o(e):r(t):r(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n===this._queue[0])return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:me.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case me.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case me.EVENT:case me.BINARY_EVENT:this.onevent(e);break;case me.ACK:case me.BINARY_ACK:this.onack(e);break;case me.DISCONNECT:this.ondisconnect();break;case me.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:me.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:me.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function Te(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Te.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},Te.prototype.reset=function(){this.attempts=0},Te.prototype.setMin=function(e){this.ms=e},Te.prototype.setMax=function(e){this.max=e},Te.prototype.setJitter=function(e){this.jitter=e};class ke extends N{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,A(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new Te({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||we;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new re(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=Ce(t,"open",(function(){n.onopen(),e&&e()})),o=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},i=Ce(t,"error",o);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),o(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(i),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Ce(e,"ping",this.onping.bind(this)),Ce(e,"data",this.ondata.bind(this)),Ce(e,"error",this.onerror.bind(this)),Ce(e,"close",this.onclose.bind(this)),Ce(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){J((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new Ee(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const xe={};function Ne(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=ne(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,o=n.id,i=n.path,s=xe[o]&&i in xe[o].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||s?a=new ke(r,t):(xe[o]||(xe[o]=new ke(r,t)),a=xe[o]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(Ne,{Manager:ke,Socket:Ee,io:Ne,connect:Ne});var Re={notOpenAudioMsg:"麦克风没有开启",notOpenAudioCode:403,notOpenAudioMsgEn:"Permission dismissed"},Ie={forbiddenAudioMsg:"请先检查您的麦克风是否开启",forbiddenAudioCode:0,forbiddenAudioMsgEn:"Permission denied"},_e={requestState:!1,delay:0},Oe=function(){function a(e){void 0===e&&(e={});var t=this;this.getWebrtcInfo=function(e,t){l.request(e+"/call/api/sip/webrtc/config/query",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){e.success&&e.data?(l.agentextras=e.data,l.initWebrtcEvent(e.data)):t.error(o({},e))},error:function(e){t.error({error:e})}})},this.initAttachEvent=function(e,n,r,o,i){t.attachEventCallbacks&&l.request(e+"/platform/action/refreshWsToken",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){if(e&&e.data){var s="";r.forEach((function(e){"KF"===e.id&&(s=e.url)})),t.attachEventCallbacks.serve=s,t.attachEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:1,pushHangupStatistics:l.initOptions.pushHangupStatistics||!1,pushCallinRingStatistics:l.initOptions.pushCallinRingStatistics||!1},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachEventCallbacks.suc=i,l.createEventHandle(t.attachEventCallbacks)}},error:function(e){r.error({error:e})}})},this.attachNetworkCallbacks={message:l.noop,error:l.noop,success:l.noop},this.initnNetworkMonitoring=function(e,n){var r="";e.forEach((function(e){if("MONITOR"===e.id){var t=document.location.protocol;"file:"===t&&(t="https:"),r=t+"//"+e.url}})),t.attachNetworkCallbacks.success(),t.attachNetworkCallbacks.message({delay:100}),setInterval((function(){var e=(new Date).getTime();_e.requestState=!0,l.request(r+"/ready",{method:"GET",success:function(n){if(n.success){var r=(new Date).getTime();_e.delay=(r-e)/2,t.attachNetworkCallbacks.message({delay:_e.delay})}else t.attachNetworkCallbacks.error(),_e.delay=500,_e.requestState=!1},error:function(e){t.attachNetworkCallbacks.error(),_e.delay=500,_e.requestState=!1}})}),1e4)},this.listenCallNetork=function(e){e&&(t.attachNetworkCallbacks.message=e.message&&"function"==typeof e.message?e.message:l.noop,t.attachNetworkCallbacks.success=e.success&&"function"==typeof e.success?e.success:l.noop,t.attachNetworkCallbacks.error=e.error&&"function"==typeof e.error?e.error:l.noop)},this.initAgentQueue=function(e,n,r,o,i){(t.attachMonitorEventCallbacks||t.attachNlsTranslationEventCallbacks)&&l.request(e+"/platform/action/refreshWsToken",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(e){if(e&&e.data){var s="";r.forEach((function(e){"MONITOR"===e.id&&(s=e.url)})),t.attachMonitorEventCallbacks&&l.UserConfig.isOpenCallQueue&&(t.attachMonitorEventCallbacks.serve=s,t.attachMonitorEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:3},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachMonitorEventCallbacks.suc=i,l.createQueueMonitorEventHandle(t.attachMonitorEventCallbacks)),t.attachNlsTranslationEventCallbacks&&l.UserConfig.openNlsTranslation&&(t.attachNlsTranslationEventCallbacks.serve=s,t.attachNlsTranslationEventCallbacks.SocketOptions={query:{accountId:o.accountId,agentNumber:o.agentNumber,agentId:o._id,token:e.data.wsToken,wsExtra:JSON.stringify({loginType:n,channelType:"SDK",ability:["call"]}),timestamp:e.data.timestamp,clientType:3},reconnectionDelay:3e3,"force new connection":!0,transports:["websocket"],timeout:5e3},t.attachNlsTranslationEventCallbacks.suc=i,l.createQueueMonitorEventHandle(t.attachNlsTranslationEventCallbacks))}},error:function(e){console.log("失败",e),r.error({error:e})}})},this.initQueue=function(e){l.request(e+"/call/monitor/agent/queue/query",{verb:"POST",body:{accountId:l.agentInfo.accountId,agentId:l.agentInfo._id},success:function(e){e&&e.data?t.attachMonitorEventCallbacks.message(e):t.attachMonitorEventCallbacks.error(e)},error:function(e){t.attachMonitorEventCallbacks.error(e)}})},this.listenCallQueueEvent=function(e){t.attachMonitorEventCallbacks=e},this.listenTranslationEvent=function(e){t.attachNlsTranslationEventCallbacks=e},this.openMediaAudio=function(e,t){var n=navigator,r=n.mediaDevices,o=n.getUserMedia,i=n.webkitGetUserMedia,s=n.mozGetUserMedia,a=n.msGetUserMedia,l=(o||i||s||a).bind(navigator);return r?navigator.mediaDevices.getUserMedia({audio:!0}).catch((function(n){var r=n.message.includes("denied");return t?(r&&alert(Ie.forbiddenAudioMsg),e&&!r&&alert(e),r?Ie:Re):r?Ie:Re})):new Promise((function(n,r){l?l({audio:!0},(function(e){n(!0)}),(function(n){t&&e&&alert(e),r(Re)})):r(Re)}))},this.listenCallEvent=function(e){t.attachEventCallbacks=e},this._callApi=function(){var e,n,r=t;return{callout:function(t){return i(this,void 0,void 0,(function(){var i,a,c,u,d,p;return s(this,(function(s){switch(s.label){case 0:if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null===l.loginToken||void 0===l.loginToken)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null===l.agentInfo||void 0===l.agentInfo)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null===t.customerNumber||void 0===t.customerNumber)return t.fail({success:!1,message:"Parameter customerNumber is required!"}),[2];if("WEBRTC"!==l.initOptions.loginType)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia({audio:!0})];case 2:return s.sent(),[3,4];case 3:return s.sent(),t.fail({success:!1,message:"无麦克风权限!"}),[2];case 4:if(i=l.initOptions.server||l.callApiUrl,a={customerNumber:t.customerNumber,agentNumber:l.agentInfo.agentNumber,accountId:l.agentInfo.accountId,agentId:l.agentInfo._id,loginType:t.loginType||l.agentInfo.loginType||l.initOptions.loginType},t.agentTimeout&&(a.agentTimeout=t.agentTimeout),t.customerTimeout&&(a.customerTimeout=t.customerTimeout),t.agentDisNumber&&(a.agentDisNumber=t.agentDisNumber),t.customerDisNumber&&(a.customerDisNumber=t.customerDisNumber),t.extras&&(a.extras=t.extras),t.numberGroupId&&(a.numberGroupId=t.numberGroupId),t.numberGroupName&&(a.numberGroupName=t.numberGroupName),c=l.initOptions,u=!0,"WEBRTC"!==c.loginType)return[3,8];s.label=5;case 5:return s.trys.push([5,7,,8]),[4,r.openMediaAudio("请打开麦克风权限!",u)];case 6:return d=s.sent()||{},[3,8];case 7:return p=s.sent(),console.log(p),[3,8];case 8:return l.request(i+"/call/api/call/call/out",{verb:"POST",body:a,loginToken:l.loginToken,sessionId:l.agentInfo._id,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success(o(o({success:!0,message:"callout success"},d),e.data)):t.fail(o({success:!1,message:e.message,code:e.code},d))}}),[2]}}))}))},hangup:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/hangup",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"hangup success",data:e}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},holdOrUnHold:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl,o={type:t.type};l.request(r+"/call/api/call/hold",{verb:"POST",body:o,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"holdOrUnHold success"}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},muteOrUnMute:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl,o={type:t.type,direction:t.direction||"all"};l.request(r+"/call/api/call/mute",{verb:"POST",body:o,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"muteOrUnMute success"}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},transfer:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type)if(null!==t.number&&void 0!==t.number){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/transfer",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"transfer success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},consult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.mode&&void 0!==t.mode)if(null!==t.number&&void 0!==t.number){t.agentNumber=l.agentInfo.agentNumber;var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"consult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"Parameter mode is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},cancelconsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/cancel",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"cancelconsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},endConsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/stop",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"endConsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},callbackConsult:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/resume",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"resumeConsult success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},consultTransfer:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/consult/transfer",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"consultTransfer success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},threeWayCall:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/threeway",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"threeWayCall success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},evaluate:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.type&&void 0!==t.type){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/evaluate",{verb:"POST",body:t,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"evaluate success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter type is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})},meeting:function(t){if(t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null!==l.loginToken&&void 0!==l.loginToken)if(null!==l.agentInfo&&void 0!==l.agentInfo)if(null!==t.number&&void 0!==t.number){var r=l.initOptions.server||l.callApiUrl;l.request(r+"/call/api/call/meeting",{verb:"POST",body:{meetingType:"phone",number:t.number},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,encryptionAlgorithm:e,encryptionFields:n,success:function(e){e.success?t.success({success:!0,message:"meeting success",data:e.data.response.data}):t.fail({success:!1,message:e.message,code:e.code})}})}else t.fail({success:!1,message:"Parameter number is required!"});else t.fail({success:!1,message:"initialization not complete!"});else t.fail({success:!1,message:"initialization not complete!"})}}},this._agentApi=function(){var e=t;return{switchLoginType:function(t){return i(this,void 0,void 0,(function(){var n,r,a,c,u,d,p=this;return s(this,(function(h){switch(h.label){case 0:if(n=null,t.success=t&&"function"==typeof t.success?t.success:l.noop,t.fail=t&&"function"==typeof t.fail?t.fail:l.noop,null===t.loginType||void 0===t.loginType)return t.fail({success:!1,message:"Parameter loginType is required!"}),[2];if(null===l.agentInfo||void 0===l.agentInfo)return t.fail({success:!1,message:"initialization not complete!"}),[2];if(null!==t.loginNumber&&void 0!==t.loginNumber&&(n=t.loginNumber),"PSTN"===t.loginType&&!(n=n||l.agentInfo.mobile))return alert("请给座席绑定手机号,或者传入号码参数!"),t.fail({success:!1,message:"Please bind your mobile number"}),[2];if("SIP"===t.loginType&&(n=n||l.agentInfo.sipNumber),"WEBRTC"===t.loginType&&(n=l.agentInfo.webrtcSipNumber),r=l.initOptions.server||l.callApiUrl,a={loginType:t.loginType,loginNumber:n},l.initOptions,u=!0,"WEBRTC"!==t.loginType)return[3,4];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,e.openMediaAudio("请打开麦克风权限!",u)];case 2:return c=h.sent()||{},[3,4];case 3:return d=h.sent(),console.log(d),[3,4];case 4:return l.request(r+"/call/api/agent/v1/login-type/change",{verb:"POST",body:a,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(n){return i(p,void 0,void 0,(function(){return s(this,(function(i){switch(i.label){case 0:return n.success?(t.success(o({success:!0,message:"updateLoginType success"},c)),l.agentInfo.loginType=t.loginType,l.initOptions.loginType=t.loginType,"WEBRTC"!==t.loginType?[3,1]:(e._webPhoneApi().connect(),[3,4])):[3,5];case 1:return"PSTN"!==t.loginType?[3,3]:[4,l.request(r+"/platform/action/updateCallConfig",{verb:"POST",body:{agentCallConfig:{},mobile:t.loginNumber},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId})];case 2:return i.sent(),e._webPhoneApi().disconnect(),[3,4];case 3:e._webPhoneApi().disconnect(),i.label=4;case 4:return[3,6];case 5:t.fail(o({success:!1,message:n.message,code:n.code},c)),i.label=6;case 6:return[2]}}))}))}}),[2]}}))}))},findPhoneBarList:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/phone/bar/all",{verb:"GET",loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){if(t.success){var n=[];t.data.forEach((function(e){var t={name:e.name,number:e.number};n.push(t)})),e.success({success:!0,data:n})}else e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},switchPhoneBar:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==e.stateNumber&&void 0!==e.stateNumber)if(null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl,n={stateNumber:e.stateNumber,accountId:l.agentInfo.accountId,agentNumber:l.agentInfo.agentNumber};l.request(t+"/call/api/agent/status/switch",{verb:"POST",body:n,loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(t){t.success?e.success({success:!0}):e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"});else e.fail({success:!1,message:"Parameter stateNumber is required!"})},logout:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){null!==e.toAnswerOffline&&void 0!==e.toAnswerOffline||(e.toAnswerOffline="1");var t=l.initOptions.server||l.callApiUrl,n={toAnswerOffline:e.toAnswerOffline};l.request(t+"/call/api/sdk/agent/logout",{verb:"POST",body:n,loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){t.success?e&&(l.Socketinstance.disconnect(),"WEBRTC"===l.agentInfo.loginType&&l.webPhone.disconnect(),e.success({success:!0})):e&&e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},findIdleAgentsForQueue:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/queue/acountFreeAgent/find",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,accountId:l.agentInfo.accountId,success:function(t){t.success?e&&e.success({success:!0,dataList:t.data||[]}):e&&e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})},getAvailableSipNumberList:function(e){if(e.success=e&&"function"==typeof e.success?e.success:l.noop,e.fail=e&&"function"==typeof e.fail?e.fail:l.noop,null!==l.agentInfo&&void 0!==l.agentInfo){var t=l.initOptions.server||l.callApiUrl;l.request(t+"/call/api/sip/avaliable/query",{verb:"POST",body:{},loginToken:l.loginToken,sessionId:l.agentInfo._id,success:function(t){if(t.success&&t.data){var n=[];t.data.forEach((function(e){var t={number:e.id,numberName:e.number};n.push(t)})),e.success({success:!0,data:n})}else e.fail({success:!1,message:t.message,code:t.code})}})}else e.fail({success:!1,message:"initialization not complete!"})}}},this._webPhoneApi=function(){return{accept:function(){l.webPhone.accept()},connect:function(){l.webPhone&&this.isConnected()||l.initWebrtcEvent(l.agentextras)},disconnect:function(){l.webPhone&&this.isConnected()&&l.webPhone.disconnect()},isConnected:function(){return l.webPhone.isConnected()},sendDTMF:function(e){l.webPhone.sendDTMF(e)}}},e.error="function"==typeof e.error?e.error:l.noop,e.success="function"==typeof e.success?e.success:l.noop,null!==e.agentNumber&&void 0!==e.agentNumber?(null!==e.loginType&&void 0!==e.loginType||(e.loginType="PSTN"),null!==e.pushHangupStatistics&&void 0!==e.pushHangupStatistics||(e.pushHangupStatistics=!1),null!==e.pushCallinRingStatistics&&void 0!==e.pushCallinRingStatistics||(e.pushCallinRingStatistics=!1),this.init(e)):e.error({message:"Invalid agentNumber"})}var l;return a.noop=function(){},a.prototype.init=function(e){if(void 0===e&&(e={}),l.trace=l.noop,l.debug=l.noop,l.log=l.noop,l.warn=l.noop,l.error=l.noop,!0===e.debug||"all"===e.debug)l.trace=console.trace.bind(console),l.debug=console.debug.bind(console),l.log=console.log.bind(console),l.warn=console.warn.bind(console),l.error=console.error.bind(console);else if(Array.isArray(e.debug))for(var t in e.debug){var n=e.debug[t];switch(n){case"trace":l.trace=console.trace.bind(console);break;case"debug":l.debug=console.debug.bind(console);break;case"log":l.log=console.log.bind(console);break;case"warn":l.warn=console.warn.bind(console);break;case"error":l.error=console.error.bind(console);break;default:console.error("Unknown debugging option '"+n+"' (supported: 'trace', 'debug', 'log', warn', 'error')")}}l.log("Initializing library");var r=l.useDefaultDependencies({WebSocket:Ae});l.newWebSocket=r.newWebSocket,l.request=r.request,this.login(e)},a.prototype.login=function(e){return i(this,void 0,void 0,(function(){var i,a,c,u,d,p,h,f,g,m,v=this;return s(this,(function(s){switch(s.label){case 0:if(console.log(e,"options"),l.UserConfig=e,i=e.server||l.callApiUrl,a=e.agentNumber+"@"+e.accountId,c=e.loginType,u=e.isOpenNetwork||!1,d=e.isOpenCallQueue||!1,p=e.openNlsTranslation||!1,h={loginName:a,loginType:c,loginChannel:"SDK",password:""},f=!0,"WEBRTC"!==c)return[3,4];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.openMediaAudio("请打开麦克风权限!",f)];case 2:return g=s.sent()||{},[3,4];case 3:return m=s.sent(),console.log(m),console.log("授权失败================================"),[3,4];case 4:return e.password&&(h.password=e.password),l.request(i+"/platform/public/loginPre",{verb:"GET",success:function(s){if(s&&s.success&&s.data){var a=decodeURIComponent(t.Base64.decode(s.data.pk)),f=new r.JSEncrypt;f.setPublicKey(a);var m=n(h.password),y=f.encrypt(m);h.password=y,l.request(i+"/platform/public/login",{verb:"POST",body:h,success:function(t){t.success?l.request(i+"/platform/action/loginInfo",{verb:"GET",loginToken:t.data.loginToken,sessionId:t.data.sessionId,success:function(t){t.success?(t.data.agent&&(l.agentInfo=t.data.agent,l.loginToken=t.data.loginToken,l.initOptions=o(o({},e),{audioInfo:g})),v.initAttachEvent(i,c,t.data.pushServer,t.data.agent,e.success),u&&v.initnNetworkMonitoring(t.data.pushServer,""),(d||p)&&v.initAgentQueue(i,c,t.data.pushServer,t.data.agent,e.success),d&&v.initQueue(i),"WEBRTC"===c&&v.getWebrtcInfo(i,e)):e.error(o(o({},t),g))},error:function(t){e.error(o({error:t},g))}}):e.error(o(o({},t),g))},error:function(t){e.error(o({error:t},g))}})}else e.error(o(o({},s),g))},error:function(t){e.error(o({error:t},g))}}),[2]}}))}))},a.exitLogOut=function(){var e=l.UserConfig.server||l.callApiUrl;l.request(e+"/platform/action/webLogout",{verb:"POST",success:function(e){console.log(e,"互踢后退出登录成功")},error:function(e){console.log(e,"互踢后退出登录失败")}})},a.createEventHandle=function(e){var t=this;void 0===e&&(e={}),e.success="function"==typeof e.success?e.success:l.noop,e.error="function"==typeof e.error?e.error:l.noop,e.message="function"==typeof e.message?e.message:l.noop,e.event="function"==typeof e.event?e.event:l.noop,e.server=null===e.serve||void 0===e.serve?"ws://152.136.72.209:3201/phoneBarGateway":e.serve,null!==e.SocketOptions&&void 0!==e.SocketOptions||(e.SocketOptions={},l.error({message:"login response error!"})),this.Socketinstance=l.newWebSocket(e.server,e.SocketOptions),this.Socketinstance.on("connect",(function(){e.success("connect event serve success!"),e.suc()})),this.Socketinstance.on("error",(function(t,n){e.error({type:"socketError",error:t}),n&&"function"==typeof n&&n("error")})),this.Socketinstance.on("message",(function(t,n){e.message({subtype:t.subType,data:t.data}),"WEBRTC"===l.initOptions.loginType&&(t.data&&t.data.callType&&"callin"===t.data.callType&&t.data.eventType&&"ring"===t.data.eventType?(l.AudioTask||(l.AudioTask=new Be("https://softphone.useasy.cn/ring.wav")),l.AudioTask.ringAudioPlay()):l.AudioTask&&l.AudioTask.ringAudioPause()),n&&"function"==typeof n&&n("success")})),this.Socketinstance.on("event",(function(n){if("KICK_OFF"===n.subType&&!0===n.data.kickoff){t.Socketinstance.disconnect(),l.loginToken=null;try{l.webPhone.disconnect(),console.log(n,"互踢")}catch(e){}e.event({message:"坐席账户在其他地方登录",data:n})}}))},a.createQueueMonitorEventHandle=function(e){var t=this;void 0===e&&(e={}),e.success="function"==typeof e.success?e.success:l.noop,e.error="function"==typeof e.error?e.error:l.noop,e.message="function"==typeof e.message?e.message:l.noop,e.server=null===e.serve||void 0===e.serve?"ue-dev1.useasy.cn":e.serve,null!==e.SocketOptions&&void 0!==e.SocketOptions||(e.SocketOptions={},l.error({message:"login response error!"})),this.MonitorSocketinstance=l.newWebSocket(e.server,e.SocketOptions),this.MonitorSocketinstance.on("connect",(function(){e.success("connect event serve success!"),e.suc(),l.log("监控connect========")})),this.MonitorSocketinstance.on("error",(function(t,n){e.error({type:"socketError",error:t}),n&&"function"==typeof n&&n("error")})),this.MonitorSocketinstance.on("message",(function(t,n){e.message({subtype:t.subType,data:t.data})})),this.MonitorSocketinstance.on("event",(function(n,r){if("KICK_OFF"===n.subType&&!0===n.data.kickoff){t.MonitorSocketinstance.disconnect();try{l.webPhone.disconnect(),console.log(n,"呼叫队列互踢")}catch(e){}e.message({message:"坐席账户在其他地方登录",data:n})}e.message(n)})),this.MonitorSocketinstance.on("translation",(function(t,n){console.log("呼叫队列消息更新???translation",t),e.message(t)}))},a.useDefaultDependencies=function(e){var t=e&&e.fetch||fetch,n=e&&e.Promise||Promise,r=e&&e.WebSocket||WebSocket;return{newWebSocket:function(e,t){return new r(e,t)},request:function(e,r){var o={method:r.verb,cache:"no-cache",headers:{"Content-Type":"application/json",loginToken:r.loginToken||"",sessionId:r.sessionId||"",clienttype:0}};r.encryptionFields&&(o.headers["ue-encryption-algorithm"]=r.encryptionAlgorithm||"aes",o.headers["ue-encryption-fields"]=r.encryptionFields),void 0!==r.withCredentials&&(o.credentials=!0===r.withCredentials?"include":r.withCredentials?r.withCredentials:"omit"),void 0!==r.body&&(o.body=JSON.stringify(r.body));var i=t(e,o).catch((function(e){return n.reject({message:"Probably a network error, is the gateway down?",error:e})}));if(void 0!==r.timeout){var s=new n((function(e,t){var n=window.setTimeout((function(){return clearTimeout(n),r.error({message:"Request timed out",timeout:r.timeout}),t({message:"Request timed out",timeout:r.timeout})}),r.timeout)}));i=n.race([i,s])}return i.then((function(e){return e.ok?typeof r.success==typeof l.noop?e.json().then((function(e){r.success(e)})).catch((function(t){return r.error({message:"Failed to parse response body",error:t,response:e}),n.reject({message:"Failed to parse response body",error:t,response:e})})):void 0:(r.error({message:"API call failed",response:e}),n.reject({message:"API call failed",response:e}))})).catch((function(e){typeof r.error==typeof l.noop&&r.error(e.message||"<< internal error >>",e)})),i}}},Object.defineProperty(a.prototype,"agent",{get:function(){return this._agentApi()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"webrtc",{get:function(){return this._webPhoneApi()},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"call",{get:function(){return this._callApi()},enumerable:!1,configurable:!0}),l=a,a.callApiUrl="https://app.useasy.cn/api",a.Socketinstance=null,a.AudioTask=null,a.MonitorSocketinstance=null,a.UserConfig=null,a.initWebrtcEvent=function(t){return i(void 0,void 0,void 0,(function(){return s(l,(function(n){switch(n.label){case 0:return l.webPhone=new e.UeWebrtc({server:t.wssUrl,sip:t.sip,secret:t.password}),[4,this.webPhone.connect()];case 1:return n.sent(),this.webPhone.register(),[2]}}))}))},a}(),Ae=function(){function e(e,t){delete t.path,delete t.hostname,delete t.port,this.ws=Ne.connect("wss://".concat(e),t)}return e.prototype.on=function(e,t){console.log(e,"type---\x3ecallback",t),"connect"===e&&this.ws.on(e,t),"error"===e&&(this.ws.on("connect_error",t),this.ws.on("error",t),this.ws.on("disconnect",t),this.ws.on("reconnect_failed",t)),"message"===e&&this.ws.on("call",t),"event"===e&&this.ws.on("event",t),"monitor"===e&&this.ws.on("monitor",t),"translation"===e&&this.ws.on("translation",t)},e.prototype.emit=function(e,t,n){this.ws.emit(e,t,n)},e.prototype.disconnect=function(){this.ws.disconnect()},e}(),Be=function(){function e(e){this.ringAudio=new Audio(e),this.ringAudio.loop=!0,this.ringAudioRunning=!1}return e.prototype.ringAudioPlay=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.ringAudioRunning?[2]:[3,1];case 1:return[4,this.ringAudio.play()];case 2:e.sent(),this.ringAudioRunning=!0,e.label=3;case 3:return[2]}}))}))},e.prototype.ringAudioPause=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return this.ringAudio.paused?[3,2]:[4,this.ringAudio.pause()];case 1:e.sent(),this.ringAudioRunning=!1,e.label=2;case 2:return[2]}}))}))},e}();return Oe}))},125:function(e,t,n){"use strict";n.r(t),n.d(t,{UeWebrtc:function(){return yt}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function s(e,t,n,r){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(r.next(e))}catch(t){i(t)}}function a(e){try{l(r["throw"](e))}catch(t){i(t)}}function l(e){e.done?n(e.value):o(e.value).then(s,a)}l((r=r.apply(e,t||[])).next())}))}function a(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"===typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(s=0)),s)try{if(n=1,r&&(o=2&a[0]?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!(o=o.length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(l){a=[6,l],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}"function"===typeof SuppressedError&&SuppressedError;var l="0.20.0",c=function(){function e(e){for(var t in this.parameters={},e)e.hasOwnProperty(t)&&this.setParam(t,e[t])}return e.prototype.setParam=function(e,t){e&&(this.parameters[e.toLowerCase()]="undefined"===typeof t||null===t?null:t.toString())},e.prototype.getParam=function(e){if(e)return this.parameters[e.toLowerCase()]},e.prototype.hasParam=function(e){return!(!e||void 0===this.parameters[e.toLowerCase()])},e.prototype.deleteParam=function(e){if(e=e.toLowerCase(),this.hasParam(e)){var t=this.parameters[e];return delete this.parameters[e],t}},e.prototype.clearParams=function(){this.parameters={}},e}(),u=function(e){function t(t,n,r){var o=e.call(this,r)||this;return o.uri=t,o._displayName=n,o}return o(t,e),Object.defineProperty(t.prototype,"friendlyName",{get:function(){return this.displayName||this.uri.aor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"displayName",{get:function(){return this._displayName},set:function(e){this._displayName=e},enumerable:!1,configurable:!0}),t.prototype.clone=function(){return new t(this.uri.clone(),this._displayName,JSON.parse(JSON.stringify(this.parameters)))},t.prototype.toString=function(){var e=this.displayName||"0"===this.displayName?'"'+this.displayName+'" ':"";for(var t in e+="<"+this.uri.toString()+">",this.parameters)this.parameters.hasOwnProperty(t)&&(e+=";"+t,null!==this.parameters[t]&&(e+="="+this.parameters[t]));return e},t}(c),d=function(e){function t(t,n,r,o,i,s){void 0===t&&(t="sip");var a=e.call(this,i||{})||this;if(a.headers={},!r)throw new TypeError('missing or invalid "host" parameter');for(var l in s)s.hasOwnProperty(l)&&a.setHeader(l,s[l]);return a.raw={scheme:t,user:n,host:r,port:o},a.normal={scheme:t.toLowerCase(),user:n,host:r.toLowerCase(),port:o},a}return o(t,e),Object.defineProperty(t.prototype,"scheme",{get:function(){return this.normal.scheme},set:function(e){this.raw.scheme=e,this.normal.scheme=e.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"user",{get:function(){return this.normal.user},set:function(e){this.normal.user=this.raw.user=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"host",{get:function(){return this.normal.host},set:function(e){this.raw.host=e,this.normal.host=e.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aor",{get:function(){return this.normal.user+"@"+this.normal.host},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"port",{get:function(){return this.normal.port},set:function(e){this.normal.port=this.raw.port=e},enumerable:!1,configurable:!0}),t.prototype.setHeader=function(e,t){this.headers[this.headerize(e)]=t instanceof Array?t:[t]},t.prototype.getHeader=function(e){if(e)return this.headers[this.headerize(e)]},t.prototype.hasHeader=function(e){return!!e&&!!this.headers.hasOwnProperty(this.headerize(e))},t.prototype.deleteHeader=function(e){if(e=this.headerize(e),this.headers.hasOwnProperty(e)){var t=this.headers[e];return delete this.headers[e],t}},t.prototype.clearHeaders=function(){this.headers={}},t.prototype.clone=function(){return new t(this._raw.scheme,this._raw.user||"",this._raw.host,this._raw.port,JSON.parse(JSON.stringify(this.parameters)),JSON.parse(JSON.stringify(this.headers)))},t.prototype.toRaw=function(){return this._toString(this._raw)},t.prototype.toString=function(){return this._toString(this._normal)},Object.defineProperty(t.prototype,"_normal",{get:function(){return this.normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_raw",{get:function(){return this.raw},enumerable:!1,configurable:!0}),t.prototype._toString=function(e){var t=e.scheme+":";for(var n in e.scheme.toLowerCase().match("^sips?$")||(t+="//"),e.user&&(t+=this.escapeUser(e.user)+"@"),t+=e.host,(e.port||0===e.port)&&(t+=":"+e.port),this.parameters)this.parameters.hasOwnProperty(n)&&(t+=";"+n,null!==this.parameters[n]&&(t+="="+this.parameters[n]));var r=[];for(var o in this.headers)if(this.headers.hasOwnProperty(o))for(var i in this.headers[o])this.headers[o].hasOwnProperty(i)&&r.push(o+"="+this.headers[o][i]);return r.length>0&&(t+="?"+r.join("&")),t},t.prototype.escapeUser=function(e){var t;try{t=decodeURIComponent(e)}catch(n){throw n}return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%2B/gi,"+").replace(/%3F/gi,"?").replace(/%2F/gi,"/")},t.prototype.headerize=function(e){for(var t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},n=e.toLowerCase().replace(/_/g,"-").split("-"),r=n.length,o="",i=0;i<r;i++)0!==i&&(o+="-"),o+=n[i].charAt(0).toUpperCase()+n[i].substring(1);return t[o]&&(o=t[o]),o},t}(c);function p(e,t){if(e.scheme!==t.scheme)return!1;if(e.user!==t.user||e.host!==t.host||e.port!==t.port)return!1;function n(e,t){var n=Object.keys(e.parameters),r=Object.keys(t.parameters),o=n.filter((function(e){return r.includes(e)}));return!!o.every((function(n){return e.parameters[n]===t.parameters[n]}))&&(!!["user","ttl","method","transport"].every((function(n){return e.hasParam(n)&&t.hasParam(n)||!e.hasParam(n)&&!t.hasParam(n)}))&&!!["maddr"].every((function(n){return e.hasParam(n)&&t.hasParam(n)||!e.hasParam(n)&&!t.hasParam(n)})))}if(!n(e,t))return!1;var r=Object.keys(e.headers),o=Object.keys(t.headers);if(0!==r.length||0!==o.length){if(r.length!==o.length)return!1;var i=r.filter((function(e){return o.includes(e)}));if(i.length!==o.length)return!1;if(!i.every((function(n){return e.headers[n].length&&t.headers[n].length&&e.headers[n][0]===t.headers[n][0]})))return!1}return!0}var h=function(e){function t(n,r,o,i){var s=e.call(this)||this;return s.message=n,s.expected=r,s.found=o,s.location=i,s.name="SyntaxError","function"===typeof Error.captureStackTrace&&Error.captureStackTrace(s,t),s}return o(t,e),t.buildMessage=function(e,t){function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function r(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function i(e){switch(e.type){case"literal":return'"'+r(e.text)+'"';case"class":var t=e.parts.map((function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)}));return"["+(e.inverted?"^":"")+t+"]";case"any":return"any character";case"end":return"end of input";case"other":return e.description}}function s(e){var t,n,r=e.map(i);if(r.sort(),r.length>0){for(t=1,n=1;t<r.length;t++)r[t-1]!==r[t]&&(r[n]=r[t],n++);r.length=n}switch(r.length){case 1:return r[0];case 2:return r[0]+" or "+r[1];default:return r.slice(0,-1).join(", ")+", or "+r[r.length-1]}}function a(e){return e?'"'+r(e)+'"':"end of input"}return"Expected "+s(e)+" but "+a(t)+" found."},t}(Error);function f(e,t){t=void 0!==t?t:{};var n,r={},o={Contact:119,Name_Addr_Header:156,Record_Route:176,Request_Response:81,SIP_URI:45,Subscription_State:186,Supported:191,Require:182,Via:194,absoluteURI:84,Call_ID:118,Content_Disposition:130,Content_Length:135,Content_Type:136,CSeq:146,displayName:122,Event:149,From:151,host:52,Max_Forwards:154,Min_SE:213,Proxy_Authenticate:157,quoted_string:40,Refer_To:178,Replaces:179,Session_Expires:210,stun_URI:217,To:192,turn_URI:223,uuid:226,WWW_Authenticate:209,challenge:158,sipfrag:230,Referred_By:231},i=119,s=["\r\n",b("\r\n",!1),/^[0-9]/,w([["0","9"]],!1,!1),/^[a-zA-Z]/,w([["a","z"],["A","Z"]],!1,!1),/^[0-9a-fA-F]/,w([["0","9"],["a","f"],["A","F"]],!1,!1),/^[\0-\xFF]/,w([["\0","ÿ"]],!1,!1),/^["]/,w(['"'],!1,!1)," ",b(" ",!1),"\t",b("\t",!1),/^[a-zA-Z0-9]/,w([["a","z"],["A","Z"],["0","9"]],!1,!1),";",b(";",!1),"/",b("/",!1),"?",b("?",!1),":",b(":",!1),"@",b("@",!1),"&",b("&",!1),"=",b("=",!1),"+",b("+",!1),"$",b("$",!1),",",b(",",!1),"-",b("-",!1),"_",b("_",!1),".",b(".",!1),"!",b("!",!1),"~",b("~",!1),"*",b("*",!1),"'",b("'",!1),"(",b("(",!1),")",b(")",!1),"%",b("%",!1),function(){return" "},function(){return":"},/^[!-~]/,w([["!","~"]],!1,!1),/^[\x80-\uFFFF]/,w([["€","￿"]],!1,!1),/^[\x80-\xBF]/,w([["€","¿"]],!1,!1),/^[a-f]/,w([["a","f"]],!1,!1),"`",b("`",!1),"<",b("<",!1),">",b(">",!1),"\\",b("\\",!1),"[",b("[",!1),"]",b("]",!1),"{",b("{",!1),"}",b("}",!1),function(){return"*"},function(){return"/"},function(){return"="},function(){return"("},function(){return")"},function(){return">"},function(){return"<"},function(){return","},function(){return";"},function(){return":"},function(){return'"'},/^[!-']/,w([["!","'"]],!1,!1),/^[*-[]/,w([["*","["]],!1,!1),/^[\]-~]/,w([["]","~"]],!1,!1),function(e){return e},/^[#-[]/,w([["#","["]],!1,!1),/^[\0-\t]/,w([["\0","\t"]],!1,!1),/^[\x0B-\f]/,w([["\v","\f"]],!1,!1),/^[\x0E-\x7F]/,w([["",""]],!1,!1),function(){t=t||{data:{}},t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port},function(){t=t||{data:{}},t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port,t.data.uri_params,t.data.uri_headers),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port,delete t.data.uri_params,"SIP_URI"===t.startRule&&(t.data=t.data.uri)},"sips",b("sips",!0),"sip",b("sip",!0),function(e){t=t||{data:{}},t.data.scheme=e},function(){t=t||{data:{}},t.data.user=decodeURIComponent(v().slice(0,-1))},function(){t=t||{data:{}},t.data.password=v()},function(){return t=t||{data:{}},t.data.host=v(),t.data.host},function(){return t=t||{data:{}},t.data.host_type="domain",v()},/^[a-zA-Z0-9_\-]/,w([["a","z"],["A","Z"],["0","9"],"_","-"],!1,!1),/^[a-zA-Z0-9\-]/,w([["a","z"],["A","Z"],["0","9"],"-"],!1,!1),function(){return t=t||{data:{}},t.data.host_type="IPv6",v()},"::",b("::",!1),function(){return t=t||{data:{}},t.data.host_type="IPv6",v()},function(){return t=t||{data:{}},t.data.host_type="IPv4",v()},"25",b("25",!1),/^[0-5]/,w([["0","5"]],!1,!1),"2",b("2",!1),/^[0-4]/,w([["0","4"]],!1,!1),"1",b("1",!1),/^[1-9]/,w([["1","9"]],!1,!1),function(e){return t=t||{data:{}},e=parseInt(e.join("")),t.data.port=e,e},"transport=",b("transport=",!0),"udp",b("udp",!0),"tcp",b("tcp",!0),"sctp",b("sctp",!0),"tls",b("tls",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["transport"]=e.toLowerCase()},"user=",b("user=",!0),"phone",b("phone",!0),"ip",b("ip",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["user"]=e.toLowerCase()},"method=",b("method=",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["method"]=e},"ttl=",b("ttl=",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["ttl"]=e},"maddr=",b("maddr=",!0),function(e){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["maddr"]=e},"lr",b("lr",!0),function(){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),t.data.uri_params["lr"]=void 0},function(e,n){t=t||{data:{}},t.data.uri_params||(t.data.uri_params={}),n=null===n?void 0:n[1],t.data.uri_params[e.toLowerCase()]=n},function(e,n){e=e.join("").toLowerCase(),n=n.join(""),t=t||{data:{}},t.data.uri_headers||(t.data.uri_headers={}),t.data.uri_headers[e]?t.data.uri_headers[e].push(n):t.data.uri_headers[e]=[n]},function(){t=t||{data:{}},"Refer_To"===t.startRule&&(t.data.uri=new d(t.data.scheme,t.data.user,t.data.host,t.data.port,t.data.uri_params,t.data.uri_headers),delete t.data.scheme,delete t.data.user,delete t.data.host,delete t.data.host_type,delete t.data.port,delete t.data.uri_params)},"//",b("//",!1),function(){t=t||{data:{}},t.data.scheme=v()},b("SIP",!0),function(){t=t||{data:{}},t.data.sip_version=v()},"INVITE",b("INVITE",!1),"ACK",b("ACK",!1),"VXACH",b("VXACH",!1),"OPTIONS",b("OPTIONS",!1),"BYE",b("BYE",!1),"CANCEL",b("CANCEL",!1),"REGISTER",b("REGISTER",!1),"SUBSCRIBE",b("SUBSCRIBE",!1),"NOTIFY",b("NOTIFY",!1),"REFER",b("REFER",!1),"PUBLISH",b("PUBLISH",!1),function(){return t=t||{data:{}},t.data.method=v(),t.data.method},function(e){t=t||{data:{}},t.data.status_code=parseInt(e.join(""))},function(){t=t||{data:{}},t.data.reason_phrase=v()},function(){t=t||{data:{}},t.data=v()},function(){var e,n;for(t=t||{data:{}},n=t.data.multi_header.length,e=0;e<n;e++)if(null===t.data.multi_header[e].parsed){t.data=null;break}null!==t.data?t.data=t.data.multi_header:t.data=-1},function(){var e;t=t||{data:{}},t.data.multi_header||(t.data.multi_header=[]);try{e=new u(t.data.uri,t.data.displayName,t.data.params),delete t.data.uri,delete t.data.displayName,delete t.data.params}catch(n){e=null}t.data.multi_header.push({position:l,offset:y().start.offset,parsed:e})},function(e){e=v().trim(),'"'===e[0]&&(e=e.substring(1,e.length-1)),t=t||{data:{}},t.data.displayName=e},"q",b("q",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["q"]=e},"expires",b("expires",!0),function(e){t=t||{data:{}},t.data.params||(t.data.params={}),t.data.params["expires"]=e},function(e){return parseInt(e.join(""))},"0",b("0",!1),function(){return parseFloat(v())},function(e,n){t=t||{data:{}},t.data.params||(t.data.params={}),n=null===n?void 0:n[1],t.data.params[e.toLowerCase()]=n},"render",b("render",!0),"session",b("session",!0),"icon",b("icon",!0),"alert",b("alert",!0),function(){t=t||{data:{}},"Content_Disposition"===t.startRule&&(t.data.type=v().toLowerCase())},"handling",b("handling",!0),"optional",b("optional",!0),"required",b("required",!0),function(e){t=t||{data:{}},t.data=parseInt(e.join(""))},function(){t=t||{data:{}},t.data=v()},"text",b("text",!0),"image",b("image",!0),"audio",b("audio",!0),"video",b("video",!0),"application",b("application",!0),"message",b("message",!0),"multipart",b("multipart",!0),"x-",b("x-",!0),function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},function(e){t=t||{data:{}},t.data=e},function(e){t=t||{data:{}},t.data.event=e.toLowerCase()},function(){t=t||{data:{}};var e=t.data.tag;t.data=new u(t.data.uri,t.data.displayName,t.data.params),e&&t.data.setParam("tag",e)},"tag",b("tag",!0),function(e){t=t||{data:{}},t.data.tag=e},function(e){t=t||{data:{}},t.data=parseInt(e.join(""))},function(e){t=t||{data:{}},t.data=e},function(){t=t||{data:{}},t.data=new u(t.data.uri,t.data.displayName,t.data.params)},"digest",b("Digest",!0),"realm",b("realm",!0),function(e){t=t||{data:{}},t.data.realm=e},"domain",b("domain",!0),"nonce",b("nonce",!0),function(e){t=t||{data:{}},t.data.nonce=e},"opaque",b("opaque",!0),function(e){t=t||{data:{}},t.data.opaque=e},"stale",b("stale",!0),"true",b("true",!0),function(){t=t||{data:{}},t.data.stale=!0},"false",b("false",!0),function(){t=t||{data:{}},t.data.stale=!1},"algorithm",b("algorithm",!0),"md5",b("MD5",!0),"md5-sess",b("MD5-sess",!0),function(e){t=t||{data:{}},t.data.algorithm=e.toUpperCase()},"qop",b("qop",!0),"auth-int",b("auth-int",!0),"auth",b("auth",!0),function(e){t=t||{data:{}},t.data.qop||(t.data.qop=[]),t.data.qop.push(e.toLowerCase())},function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},function(){var e,n;for(t=t||{data:{}},n=t.data.multi_header.length,e=0;e<n;e++)if(null===t.data.multi_header[e].parsed){t.data=null;break}null!==t.data?t.data=t.data.multi_header:t.data=-1},function(){var e;t=t||{data:{}},t.data.multi_header||(t.data.multi_header=[]);try{e=new u(t.data.uri,t.data.displayName,t.data.params),delete t.data.uri,delete t.data.displayName,delete t.data.params}catch(n){e=null}t.data.multi_header.push({position:l,offset:y().start.offset,parsed:e})},function(){t=t||{data:{}},t.data=new u(t.data.uri,t.data.displayName,t.data.params)},function(){t=t||{data:{}},t.data.replaces_from_tag&&t.data.replaces_to_tag||(t.data=-1)},function(){t=t||{data:{}},t.data={call_id:t.data}},"from-tag",b("from-tag",!0),function(e){t=t||{data:{}},t.data.replaces_from_tag=e},"to-tag",b("to-tag",!0),function(e){t=t||{data:{}},t.data.replaces_to_tag=e},"early-only",b("early-only",!0),function(){t=t||{data:{}},t.data.early_only=!0},function(e,t){return t},function(e,t){return R(e,t)},function(e){t=t||{data:{}},"Require"===t.startRule&&(t.data=e||[])},function(e){t=t||{data:{}},t.data.value=parseInt(e.join(""))},"active",b("active",!0),"pending",b("pending",!0),"terminated",b("terminated",!0),function(){t=t||{data:{}},t.data.state=v()},"reason",b("reason",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.reason=e)},function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.expires=e)},"retry_after",b("retry_after",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.retry_after=e)},"deactivated",b("deactivated",!0),"probation",b("probation",!0),"rejected",b("rejected",!0),"timeout",b("timeout",!0),"giveup",b("giveup",!0),"noresource",b("noresource",!0),"invariant",b("invariant",!0),function(e){t=t||{data:{}},"Supported"===t.startRule&&(t.data=e||[])},function(){t=t||{data:{}};var e=t.data.tag;t.data=new u(t.data.uri,t.data.displayName,t.data.params),e&&t.data.setParam("tag",e)},"ttl",b("ttl",!0),function(e){t=t||{data:{}},t.data.ttl=e},"maddr",b("maddr",!0),function(e){t=t||{data:{}},t.data.maddr=e},"received",b("received",!0),function(e){t=t||{data:{}},t.data.received=e},"branch",b("branch",!0),function(e){t=t||{data:{}},t.data.branch=e},"rport",b("rport",!0),function(e){t=t||{data:{}},"undefined"!==typeof e&&(t.data.rport=e.join(""))},function(e){t=t||{data:{}},t.data.protocol=e},b("UDP",!0),b("TCP",!0),b("TLS",!0),b("SCTP",!0),function(e){t=t||{data:{}},t.data.transport=e},function(){t=t||{data:{}},t.data.host=v()},function(e){t=t||{data:{}},t.data.port=parseInt(e.join(""))},function(e){return parseInt(e.join(""))},function(e){t=t||{data:{}},"Session_Expires"===t.startRule&&(t.data.deltaSeconds=e)},"refresher",b("refresher",!1),"uas",b("uas",!1),"uac",b("uac",!1),function(e){t=t||{data:{}},"Session_Expires"===t.startRule&&(t.data.refresher=e)},function(e){t=t||{data:{}},"Min_SE"===t.startRule&&(t.data=e)},"stuns",b("stuns",!0),"stun",b("stun",!0),function(e){t=t||{data:{}},t.data.scheme=e},function(e){t=t||{data:{}},t.data.host=e},"?transport=",b("?transport=",!1),"turns",b("turns",!0),"turn",b("turn",!0),function(e){t=t||{data:{}},t.data.transport=e},function(){t=t||{data:{}},t.data=v()},"Referred-By",b("Referred-By",!1),"b",b("b",!1),"cid",b("cid",!1)],a=[x('2 ""6 7!'),x('4"""5!7#'),x('4$""5!7%'),x('4&""5!7\''),x(";'.# &;("),x('4(""5!7)'),x('4*""5!7+'),x('2,""6,7-'),x('2.""6.7/'),x('40""5!71'),x('22""6273.‰ &24""6475.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x(";).# &;,"),x('2F""6F7G.} &2H""6H7I.q &2J""6J7K.e &2L""6L7M.Y &2N""6N7O.M &2P""6P7Q.A &2R""6R7S.5 &2T""6T7U.) &2V""6V7W'),x('%%2X""6X7Y/5#;#/,$;#/#$+#)(#\'#("\'#&\'#/"!&,)'),x('%%$;$0#*;$&/,#; /#$+")("\'#&\'#." &"/=#$;$/&#0#*;$&&&#/\'$8":Z" )("\'#&\'#'),x(';.." &"'),x("%$;'.# &;(0)*;'.# &;(&/?#28\"\"6879/0$;//'$8#:[# )(#'#(\"'#&'#"),x('%%$;2/&#0#*;2&&&#/g#$%$;.0#*;.&/,#;2/#$+")("\'#&\'#0=*%$;.0#*;.&/,#;2/#$+")("\'#&\'#&/#$+")("\'#&\'#/"!&,)'),x('4\\""5!7].# &;3'),x('4^""5!7_'),x('4`""5!7a'),x(';!.) &4b""5!7c'),x('%$;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/ž#0›*;).• &2F""6F7G.‰ &2J""6J7K.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),x('%$;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O/’#0*;).‰ &2F""6F7G.} &2L""6L7M.q &2X""6X7Y.e &2P""6P7Q.Y &2H""6H7I.M &2@""6@7A.A &2d""6d7e.5 &2R""6R7S.) &2N""6N7O&&&#/"!&,)'),x('2T""6T7U.ã &2V""6V7W.× &2f""6f7g.Ë &2h""6h7i.¿ &2:""6:7;.³ &2D""6D7E.§ &22""6273.› &28""6879. &2j""6j7k.ƒ &;&.} &24""6475.q &2l""6l7m.e &2n""6n7o.Y &26""6677.M &2>""6>7?.A &2p""6p7q.5 &2r""6r7s.) &;\'.# &;('),x('%$;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s/Ĵ#0ı*;).ī &2F""6F7G.ğ &2J""6J7K.ē &2L""6L7M.ć &2X""6X7Y.û &2P""6P7Q.ï &2H""6H7I.ã &2@""6@7A.× &2d""6d7e.Ë &2R""6R7S.¿ &2N""6N7O.³ &2T""6T7U.§ &2V""6V7W.› &2f""6f7g. &2h""6h7i.ƒ &28""6879.w &2j""6j7k.k &;&.e &24""6475.Y &2l""6l7m.M &2n""6n7o.A &26""6677.5 &2p""6p7q.) &2r""6r7s&&&#/"!&,)'),x("%;//?#2P\"\"6P7Q/0$;//'$8#:t# )(#'#(\"'#&'#"),x("%;//?#24\"\"6475/0$;//'$8#:u# )(#'#(\"'#&'#"),x("%;//?#2>\"\"6>7?/0$;//'$8#:v# )(#'#(\"'#&'#"),x("%;//?#2T\"\"6T7U/0$;//'$8#:w# )(#'#(\"'#&'#"),x("%;//?#2V\"\"6V7W/0$;//'$8#:x# )(#'#(\"'#&'#"),x('%2h""6h7i/0#;//\'$8":y" )("\'#&\'#'),x('%;//6#2f""6f7g/\'$8":z" )("\'#&\'#'),x("%;//?#2D\"\"6D7E/0$;//'$8#:{# )(#'#(\"'#&'#"),x("%;//?#22\"\"6273/0$;//'$8#:|# )(#'#(\"'#&'#"),x("%;//?#28\"\"6879/0$;//'$8#:}# )(#'#(\"'#&'#"),x("%;//0#;&/'$8\":~\" )(\"'#&'#"),x("%;&/0#;//'$8\":~\" )(\"'#&'#"),x("%;=/T#$;G.) &;K.# &;F0/*;G.) &;K.# &;F&/,$;>/#$+#)(#'#(\"'#&'#"),x('4""5!7€.A &4""5!7‚.5 &4ƒ""5!7„.) &;3.# &;.'),x("%%;//Q#;&/H$$;J.# &;K0)*;J.# &;K&/,$;&/#$+$)($'#(#'#(\"'#&'#/\"!&,)"),x("%;//]#;&/T$%$;J.# &;K0)*;J.# &;K&/\"!&,)/1$;&/($8$:…$!!)($'#(#'#(\"'#&'#"),x(';..G &2L""6L7M.; &4†""5!7‡./ &4ƒ""5!7„.# &;3'),x('%2j""6j7k/J#4ˆ""5!7‰.5 &4Š""5!7‹.) &4Œ""5!7/#$+")("\'#&\'#'),x("%;N/M#28\"\"6879/>$;O.\" &\"/0$;S/'$8$:Ž$ )($'#(#'#(\"'#&'#"),x("%;N/d#28\"\"6879/U$;O.\" &\"/G$;S/>$;_/5$;l.\" &\"/'$8&:& )(&'#(%'#($'#(#'#(\"'#&'#"),x('%3""5$7‘.) &3’""5#7“/\' 8!:”!! )'),x('%;P/]#%28""6879/,#;R/#$+")("\'#&\'#." &"/6$2:""6:7;/\'$8#:•# )(#\'#("\'#&\'#'),x("$;+.) &;-.# &;Q/2#0/*;+.) &;-.# &;Q&&&#"),x('2<""6<7=.q &2>""6>7?.e &2@""6@7A.Y &2B""6B7C.M &2D""6D7E.A &22""6273.5 &26""6677.) &24""6475'),x('%$;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E0e*;+._ &;-.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E&/& 8!:–! )'),x('%;T/J#%28""6879/,#;^/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;U.) &;\\.# &;X/& 8!:—! )"),x('%$%;V/2#2J""6J7K/#$+")("\'#&\'#0<*%;V/2#2J""6J7K/#$+")("\'#&\'#&/D#;W/;$2J""6J7K." &"/\'$8#:˜# )(#\'#("\'#&\'#'),x('$4™""5!7š/,#0)*4™""5!7š&&&#'),x('%4$""5!7%/?#$4›""5!7œ0)*4›""5!7œ&/#$+")("\'#&\'#'),x('%2l""6l7m/?#;Y/6$2n""6n7o/\'$8#:# )(#\'#("\'#&\'#'),x('%%;Z/³#28""6879/¤$;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+-)(-\'#(,\'#(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ސ &%2ž""6ž7Ÿ/¤#;Z/›$28""6879/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+,)(,\'#(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.۹ &%2ž""6ž7Ÿ/Œ#;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ٺ &%2ž""6ž7Ÿ/t#;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ؓ &%2ž""6ž7Ÿ/\\#;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+&)(&\'#(%\'#($\'#(#\'#("\'#&\'#.ׄ &%2ž""6ž7Ÿ/D#;Z/;$28""6879/,$;[/#$+$)($\'#(#\'#("\'#&\'#.֍ &%2ž""6ž7Ÿ/,#;[/#$+")("\'#&\'#.ծ &%2ž""6ž7Ÿ/,#;Z/#$+")("\'#&\'#.Տ &%;Z/›#2ž""6ž7Ÿ/Œ$;Z/ƒ$28""6879/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$++)(+\'#(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ӈ &%;Z/ª#%28""6879/,#;Z/#$+")("\'#&\'#." &"/ƒ$2ž""6ž7Ÿ/t$;Z/k$28""6879/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+*)(*\'#()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.а &%;Z/¹#%28""6879/,#;Z/#$+")("\'#&\'#." &"/’$%28""6879/,#;Z/#$+")("\'#&\'#." &"/k$2ž""6ž7Ÿ/\\$;Z/S$28""6879/D$;Z/;$28""6879/,$;[/#$+))()\'#((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ί &%;Z/È#%28""6879/,#;Z/#$+")("\'#&\'#." &"/¡$%28""6879/,#;Z/#$+")("\'#&\'#." &"/z$%28""6879/,#;Z/#$+")("\'#&\'#." &"/S$2ž""6ž7Ÿ/D$;Z/;$28""6879/,$;[/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.˕ &%;Z/×#%28""6879/,#;Z/#$+")("\'#&\'#." &"/°$%28""6879/,#;Z/#$+")("\'#&\'#." &"/‰$%28""6879/,#;Z/#$+")("\'#&\'#." &"/b$%28""6879/,#;Z/#$+")("\'#&\'#." &"/;$2ž""6ž7Ÿ/,$;[/#$+\')(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.ȑ &%;Z/þ#%28""6879/,#;Z/#$+")("\'#&\'#." &"/×$%28""6879/,#;Z/#$+")("\'#&\'#." &"/°$%28""6879/,#;Z/#$+")("\'#&\'#." &"/‰$%28""6879/,#;Z/#$+")("\'#&\'#." &"/b$%28""6879/,#;Z/#$+")("\'#&\'#." &"/;$2ž""6ž7Ÿ/,$;Z/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#.Ħ &%;Z/Ĝ#%28""6879/,#;Z/#$+")("\'#&\'#." &"/õ$%28""6879/,#;Z/#$+")("\'#&\'#." &"/Î$%28""6879/,#;Z/#$+")("\'#&\'#." &"/§$%28""6879/,#;Z/#$+")("\'#&\'#." &"/€$%28""6879/,#;Z/#$+")("\'#&\'#." &"/Y$%28""6879/,#;Z/#$+")("\'#&\'#." &"/2$2ž""6ž7Ÿ/#$+()((\'#(\'\'#(&\'#(%\'#($\'#(#\'#("\'#&\'#/& 8!: ! )'),x('%;#/M#;#." &"/?$;#." &"/1$;#." &"/#$+$)($\'#(#\'#("\'#&\'#'),x("%;Z/;#28\"\"6879/,$;Z/#$+#)(#'#(\"'#&'#.# &;\\"),x("%;]/o#2J\"\"6J7K/`$;]/W$2J\"\"6J7K/H$;]/?$2J\"\"6J7K/0$;]/'$8':¡' )(''#(&'#(%'#($'#(#'#(\"'#&'#"),x('%2¢""6¢7£/2#4¤""5!7¥/#$+")("\'#&\'#.˜ &%2¦""6¦7§/;#4¨""5!7©/,$;!/#$+#)(#\'#("\'#&\'#.j &%2ª""6ª7«/5#;!/,$;!/#$+#)(#\'#("\'#&\'#.B &%4¬""5!7­/,#;!/#$+")("\'#&\'#.# &;!'),x('%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%\'#($\'#(#\'#("\'#&\'#/\' 8!:®!! )'),x('$%22""6273/,#;`/#$+")("\'#&\'#0<*%22""6273/,#;`/#$+")("\'#&\'#&'),x(";a.A &;b.; &;c.5 &;d./ &;e.) &;f.# &;g"),x('%3¯""5*7°/a#3±""5#7².G &3³""5#7´.; &3µ""5$7¶./ &3·""5#7¸.# &;6/($8":¹"! )("\'#&\'#'),x('%3º""5%7»/I#3¼""5%7½./ &3¾""5"7¿.# &;6/($8":À"! )("\'#&\'#'),x('%3Á""5\'7Â/1#;/($8":Ã"! )("\'#&\'#'),x('%3Ä""5$7Å/1#;ð/($8":Æ"! )("\'#&\'#'),x('%3Ç""5&7È/1#;T/($8":É"! )("\'#&\'#'),x('%3Ê""5"7Ë/N#%2>""6>7?/,#;6/#$+")("\'#&\'#." &"/\'$8":Ì" )("\'#&\'#'),x('%;h/P#%2>""6>7?/,#;i/#$+")("\'#&\'#." &"/)$8":Í""! )("\'#&\'#'),x('%$;j/&#0#*;j&&&#/"!&,)'),x('%$;j/&#0#*;j&&&#/"!&,)'),x(";k.) &;+.# &;-"),x('2l""6l7m.e &2n""6n7o.Y &24""6475.M &28""6879.A &2<""6<7=.5 &2@""6@7A.) &2B""6B7C'),x('%26""6677/n#;m/e$$%2<""6<7=/,#;m/#$+")("\'#&\'#0<*%2<""6<7=/,#;m/#$+")("\'#&\'#&/#$+#)(#\'#("\'#&\'#'),x('%;n/A#2>""6>7?/2$;o/)$8#:Î#"" )(#\'#("\'#&\'#'),x("$;p.) &;+.# &;-/2#0/*;p.) &;+.# &;-&&&#"),x("$;p.) &;+.# &;-0/*;p.) &;+.# &;-&"),x('2l""6l7m.e &2n""6n7o.Y &24""6475.M &26""6677.A &28""6879.5 &2@""6@7A.) &2B""6B7C'),x(";‘.# &;r"),x("%;/G#;'/>$;s/5$;'/,$;„/#$+%)(%'#($'#(#'#(\"'#&'#"),x(";M.# &;t"),x("%;/E#28\"\"6879/6$;u.# &;x/'$8#:Ï# )(#'#(\"'#&'#"),x('%;v.# &;w/J#%26""6677/,#;ƒ/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x('%2Ð""6Ð7Ñ/:#;€/1$;w." &"/#$+#)(#\'#("\'#&\'#'),x('%24""6475/,#;{/#$+")("\'#&\'#'),x("%;z/3#$;y0#*;y&/#$+\")(\"'#&'#"),x(";*.) &;+.# &;-"),x(';+. &;-.‰ &22""6273.} &26""6677.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x('%;|/e#$%24""6475/,#;|/#$+")("\'#&\'#0<*%24""6475/,#;|/#$+")("\'#&\'#&/#$+")("\'#&\'#'),x('%$;~0#*;~&/e#$%22""6273/,#;}/#$+")("\'#&\'#0<*%22""6273/,#;}/#$+")("\'#&\'#&/#$+")("\'#&\'#'),x("$;~0#*;~&"),x(';+.w &;-.q &28""6879.e &2:""6:7;.Y &2<""6<7=.M &2>""6>7?.A &2@""6@7A.5 &2B""6B7C.) &2D""6D7E'),x('%%;"/‡#$;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K0M*;".G &;!.A &2@""6@7A.5 &2F""6F7G.) &2J""6J7K&/#$+")("\'#&\'#/& 8!:Ò! )'),x(";.# &;‚"),x('%%;O/2#2:""6:7;/#$+")("\'#&\'#." &"/,#;S/#$+")("\'#&\'#." &"'),x('$;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A/Œ#0‰*;+.ƒ &;-.} &2B""6B7C.q &2D""6D7E.e &22""6273.Y &28""6879.M &2:""6:7;.A &2<""6<7=.5 &2>""6>7?.) &2@""6@7A&&&#'),x("$;y0#*;y&"),x('%3’""5#7Ó/q#24""6475/b$$;!/&#0#*;!&&&#/L$2J""6J7K/=$$;!/&#0#*;!&&&#/\'$8%:Ô% )(%\'#($\'#(#\'#("\'#&\'#'),x('2Õ""6Õ7Ö'),x('2×""6×7Ø'),x('2Ù""6Ù7Ú'),x('2Û""6Û7Ü'),x('2Ý""6Ý7Þ'),x('2ß""6ß7à'),x('2á""6á7â'),x('2ã""6ã7ä'),x('2å""6å7æ'),x('2ç""6ç7è'),x('2é""6é7ê'),x("%;….Y &;†.S &;ˆ.M &;‰.G &;Š.A &;‹.; &;Œ.5 &;./ &;.) &;Ž.# &;6/& 8!:ë! )"),x("%;„/G#;'/>$;’/5$;'/,$;”/#$+%)(%'#($'#(#'#(\"'#&'#"),x("%;“/' 8!:ì!! )"),x("%;!/5#;!/,$;!/#$+#)(#'#(\"'#&'#"),x("%$;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(0G*;*.A &;+.; &;-.5 &;3./ &;4.) &;'.# &;(&/& 8!:í! )"),x("%;¶/Y#$%;A/,#;¶/#$+\")(\"'#&'#06*%;A/,#;¶/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%;9/N#%2:""6:7;/,#;9/#$+")("\'#&\'#." &"/\'$8":î" )("\'#&\'#'),x("%;:.c &%;˜/Y#$%;A/,#;˜/#$+\")(\"'#&'#06*%;A/,#;˜/#$+\")(\"'#&'#&/#$+\")(\"'#&'#/& 8!:ï! )"),x("%;L.# &;™/]#$%;B/,#;›/#$+\")(\"'#&'#06*%;B/,#;›/#$+\")(\"'#&'#&/'$8\":ð\" )(\"'#&'#"),x("%;š.\" &\"/>#;@/5$;M/,$;?/#$+$)($'#(#'#(\"'#&'#"),x("%%;6/Y#$%;./,#;6/#$+\")(\"'#&'#06*%;./,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#.# &;H/' 8!:ñ!! )"),x(";œ.) &;.# &; "),x("%3ò\"\"5!7ó/:#;</1$;Ÿ/($8#:ô#! )(#'#(\"'#&'#"),x("%3õ\"\"5'7ö/:#;</1$;ž/($8#:÷#! )(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ø!! )"),x('%2ù""6ù7ú/o#%2J""6J7K/M#;!." &"/?$;!." &"/1$;!." &"/#$+$)($\'#(#\'#("\'#&\'#." &"/\'$8":û" )("\'#&\'#'),x('%;6/J#%;</,#;¡/#$+")("\'#&\'#." &"/)$8":ü""! )("\'#&\'#'),x(";6.) &;T.# &;H"),x("%;£/Y#$%;B/,#;¤/#$+\")(\"'#&'#06*%;B/,#;¤/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%3ý""5&7þ.G &3ÿ""5\'7Ā.; &3ā""5$7Ă./ &3ă""5%7Ą.# &;6/& 8!:ą! )'),x(";¥.# &; "),x('%3Ć""5(7ć/M#;</D$3Ĉ""5(7ĉ./ &3Ċ""5(7ċ.# &;6/#$+#)(#\'#("\'#&\'#'),x("%;6/Y#$%;A/,#;6/#$+\")(\"'#&'#06*%;A/,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:Č!! )"),x("%;©/& 8!:č! )"),x("%;ª/k#;;/b$;¯/Y$$%;B/,#;°/#$+\")(\"'#&'#06*%;B/,#;°/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x(";«.# &;¬"),x('3Ď""5$7ď.S &3Đ""5%7đ.G &3Ē""5%7ē.; &3Ĕ""5%7ĕ./ &3Ė""5+7ė.# &;­'),x('3Ę""5\'7ę./ &3Ě""5)7ě.# &;­'),x(";6.# &;®"),x('%3Ĝ""5"7ĝ/,#;6/#$+")("\'#&\'#'),x(";­.# &;6"),x("%;6/5#;</,$;±/#$+#)(#'#(\"'#&'#"),x(";6.# &;H"),x("%;³/5#;./,$;/#$+#)(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:Ğ!! )"),x("%;ž/' 8!:ğ!! )"),x('%;¶/^#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/($8":Ġ"!!)("\'#&\'#'),x('%%;7/e#$%2J""6J7K/,#;7/#$+")("\'#&\'#0<*%2J""6J7K/,#;7/#$+")("\'#&\'#&/#$+")("\'#&\'#/"!&,)'),x("%;L.# &;™/]#$%;B/,#;¸/#$+\")(\"'#&'#06*%;B/,#;¸/#$+\")(\"'#&'#&/'$8\":ġ\" )(\"'#&'#"),x(";¹.# &; "),x("%3Ģ\"\"5#7ģ/:#;</1$;6/($8#:Ĥ#! )(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ĥ!! )"),x("%;ž/' 8!:Ħ!! )"),x("%$;š0#*;š&/x#;@/o$;M/f$;?/]$$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/'$8%:ħ% )(%'#($'#(#'#(\"'#&'#"),x(";¾"),x("%3Ĩ\"\"5&7ĩ/k#;./b$;Á/Y$$%;A/,#;Á/#$+\")(\"'#&'#06*%;A/,#;Á/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#.# &;¿"),x("%;6/k#;./b$;À/Y$$%;A/,#;À/#$+\")(\"'#&'#06*%;A/,#;À/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x("%;6/;#;</2$;6.# &;H/#$+#)(#'#(\"'#&'#"),x(";Â.G &;Ä.A &;Æ.; &;È.5 &;É./ &;Ê.) &;Ë.# &;À"),x("%3Ī\"\"5%7ī/5#;</,$;Ã/#$+#)(#'#(\"'#&'#"),x("%;I/' 8!:Ĭ!! )"),x("%3ĭ\"\"5&7Į/—#;</Ž$;D/…$;Å/|$$%$;'/&#0#*;'&&&#/,#;Å/#$+\")(\"'#&'#0C*%$;'/&#0#*;'&&&#/,#;Å/#$+\")(\"'#&'#&/,$;E/#$+&)(&'#(%'#($'#(#'#(\"'#&'#"),x(";t.# &;w"),x("%3į\"\"5%7İ/5#;</,$;Ç/#$+#)(#'#(\"'#&'#"),x("%;I/' 8!:ı!! )"),x("%3IJ\"\"5&7ij/:#;</1$;I/($8#:Ĵ#! )(#'#(\"'#&'#"),x('%3ĵ""5%7Ķ/]#;</T$%3ķ""5$7ĸ/& 8!:Ĺ! ).4 &%3ĺ""5%7Ļ/& 8!:ļ! )/#$+#)(#\'#("\'#&\'#'),x('%3Ľ""5)7ľ/R#;</I$3Ŀ""5#7ŀ./ &3Ł""5(7ł.# &;6/($8#:Ń#! )(#\'#("\'#&\'#'),x('%3ń""5#7Ņ/“#;</Š$;D/$%;Ì/e#$%2D""6D7E/,#;Ì/#$+")("\'#&\'#0<*%2D""6D7E/,#;Ì/#$+")("\'#&\'#&/#$+")("\'#&\'#/,$;E/#$+%)(%\'#($\'#(#\'#("\'#&\'#'),x('%3ņ""5(7Ň./ &3ň""5$7ʼn.# &;6/\' 8!:Ŋ!! )'),x("%;6/Y#$%;A/,#;6/#$+\")(\"'#&'#06*%;A/,#;6/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;Ï/G#;./>$;Ï/5$;./,$;/#$+%)(%'#($'#(#'#(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ŋ!! )"),x("%;Ñ/]#$%;A/,#;Ñ/#$+\")(\"'#&'#06*%;A/,#;Ñ/#$+\")(\"'#&'#&/'$8\":Ō\" )(\"'#&'#"),x("%;™/]#$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/'$8\":ō\" )(\"'#&'#"),x('%;L.O &;™.I &%;@." &"/:#;t/1$;?." &"/#$+#)(#\'#("\'#&\'#/]#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/\'$8":Ŏ" )("\'#&\'#'),x("%;Ô/]#$%;B/,#;Õ/#$+\")(\"'#&'#06*%;B/,#;Õ/#$+\")(\"'#&'#&/'$8\":ŏ\" )(\"'#&'#"),x("%;–/& 8!:Ő! )"),x('%3ő""5(7Œ/:#;</1$;6/($8#:œ#! )(#\'#("\'#&\'#.g &%3Ŕ""5&7ŕ/:#;</1$;6/($8#:Ŗ#! )(#\'#("\'#&\'#.: &%3ŗ""5*7Ř/& 8!:ř! ).# &; '),x('%%;6/k#$%;A/2#;6/)$8":Ś""$ )("\'#&\'#0<*%;A/2#;6/)$8":Ś""$ )("\'#&\'#&/)$8":ś""! )("\'#&\'#." &"/\' 8!:Ŝ!! )'),x("%;Ø/Y#$%;A/,#;Ø/#$+\")(\"'#&'#06*%;A/,#;Ø/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;™/Y#$%;B/,#; /#$+\")(\"'#&'#06*%;B/,#; /#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%$;!/&#0#*;!&&&#/' 8!:ŝ!! )"),x("%;Û/Y#$%;B/,#;Ü/#$+\")(\"'#&'#06*%;B/,#;Ü/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x('%3Ş""5&7ş.; &3Š""5\'7š./ &3Ţ""5*7ţ.# &;6/& 8!:Ť! )'),x("%3ť\"\"5&7Ŧ/:#;</1$;Ý/($8#:ŧ#! )(#'#(\"'#&'#.} &%3õ\"\"5'7ö/:#;</1$;ž/($8#:Ũ#! )(#'#(\"'#&'#.P &%3ũ\"\"5+7Ū/:#;</1$;ž/($8#:ū#! )(#'#(\"'#&'#.# &; "),x('3Ŭ""5+7ŭ.k &3Ů""5)7ů._ &3Ű""5(7ű.S &3Ų""5\'7ų.G &3Ŵ""5&7ŵ.; &3Ŷ""5*7ŷ./ &3Ÿ""5)7Ź.# &;6'),x(';1." &"'),x('%%;6/k#$%;A/2#;6/)$8":Ś""$ )("\'#&\'#0<*%;A/2#;6/)$8":Ś""$ )("\'#&\'#&/)$8":ś""! )("\'#&\'#." &"/\' 8!:ź!! )'),x("%;L.# &;™/]#$%;B/,#;á/#$+\")(\"'#&'#06*%;B/,#;á/#$+\")(\"'#&'#&/'$8\":Ż\" )(\"'#&'#"),x(";¹.# &; "),x("%;ã/Y#$%;A/,#;ã/#$+\")(\"'#&'#06*%;A/,#;ã/#$+\")(\"'#&'#&/#$+\")(\"'#&'#"),x("%;ê/k#;./b$;í/Y$$%;B/,#;ä/#$+\")(\"'#&'#06*%;B/,#;ä/#$+\")(\"'#&'#&/#$+$)($'#(#'#(\"'#&'#"),x(";å.; &;æ.5 &;ç./ &;è.) &;é.# &; "),x("%3ż\"\"5#7Ž/:#;</1$;ð/($8#:ž#! )(#'#(\"'#&'#"),x("%3ſ\"\"5%7ƀ/:#;</1$;T/($8#:Ɓ#! )(#'#(\"'#&'#"),x("%3Ƃ\"\"5(7ƃ/F#;</=$;\\.) &;Y.# &;X/($8#:Ƅ#! )(#'#(\"'#&'#"),x("%3ƅ\"\"5&7Ɔ/:#;</1$;6/($8#:Ƈ#! )(#'#(\"'#&'#"),x("%3ƈ\"\"5%7Ɖ/A#;</8$$;!0#*;!&/($8#:Ɗ#! )(#'#(\"'#&'#"),x("%;ë/G#;;/>$;6/5$;;/,$;ì/#$+%)(%'#($'#(#'#(\"'#&'#"),x('%3’""5#7Ó.# &;6/\' 8!:Ƌ!! )'),x('%3±""5#7ƌ.G &3³""5#7ƍ.; &3·""5#7Ǝ./ &3µ""5$7Ə.# &;6/\' 8!:Ɛ!! )'),x('%;î/D#%;C/,#;ï/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;U.) &;\\.# &;X/& 8!:Ƒ! )"),x('%%;!." &"/[#;!." &"/M$;!." &"/?$;!." &"/1$;!." &"/#$+%)(%\'#($\'#(#\'#("\'#&\'#/\' 8!:ƒ!! )'),x('%%;!/?#;!." &"/1$;!." &"/#$+#)(#\'#("\'#&\'#/\' 8!:Ɠ!! )'),x(";¾"),x('%;ž/^#$%;B/,#;ó/#$+")("\'#&\'#06*%;B/,#;ó/#$+")("\'#&\'#&/($8":Ɣ"!!)("\'#&\'#'),x(";ô.# &; "),x('%2ƕ""6ƕ7Ɩ/L#;</C$2Ɨ""6Ɨ7Ƙ.) &2ƙ""6ƙ7ƚ/($8#:ƛ#! )(#\'#("\'#&\'#'),x('%;ž/^#$%;B/,#; /#$+")("\'#&\'#06*%;B/,#; /#$+")("\'#&\'#&/($8":Ɯ"!!)("\'#&\'#'),x("%;6/5#;0/,$;÷/#$+#)(#'#(\"'#&'#"),x("$;2.) &;4.# &;.0/*;2.) &;4.# &;.&"),x("$;%0#*;%&"),x("%;ú/;#28\"\"6879/,$;û/#$+#)(#'#(\"'#&'#"),x('%3Ɲ""5%7ƞ.) &3Ɵ""5$7Ơ/\' 8!:ơ!! )'),x('%;ü/J#%28""6879/,#;^/#$+")("\'#&\'#." &"/#$+")("\'#&\'#'),x("%;\\.) &;X.# &;‚/' 8!:Ƣ!! )"),x(';".S &;!.M &2F""6F7G.A &2J""6J7K.5 &2H""6H7I.) &2N""6N7O'),x('2L""6L7M.• &2B""6B7C.‰ &2<""6<7=.} &2R""6R7S.q &2T""6T7U.e &2V""6V7W.Y &2P""6P7Q.M &2@""6@7A.A &2D""6D7E.5 &22""6273.) &2>""6>7?'),x('%;Ā/b#28""6879/S$;û/J$%2ƣ""6ƣ7Ƥ/,#;ì/#$+")("\'#&\'#." &"/#$+$)($\'#(#\'#("\'#&\'#'),x('%3ƥ""5%7Ʀ.) &3Ƨ""5$7ƨ/\' 8!:ơ!! )'),x('%3±""5#7².6 &3³""5#7´.* &$;+0#*;+&/\' 8!:Ʃ!! )'),x("%;Ą/‡#2F\"\"6F7G/x$;ă/o$2F\"\"6F7G/`$;ă/W$2F\"\"6F7G/H$;ă/?$2F\"\"6F7G/0$;ą/'$8):ƪ) )()'#(('#(''#(&'#(%'#($'#(#'#(\"'#&'#"),x("%;#/>#;#/5$;#/,$;#/#$+$)($'#(#'#(\"'#&'#"),x("%;ă/,#;ă/#$+\")(\"'#&'#"),x("%;ă/5#;ă/,$;ă/#$+#)(#'#(\"'#&'#"),x("%;q/T#$;m0#*;m&/D$%; /,#;ø/#$+\")(\"'#&'#.\" &\"/#$+#)(#'#(\"'#&'#"),x('%2ƫ""6ƫ7Ƭ.) &2ƭ""6ƭ7Ʈ/w#;0/n$;Ĉ/e$$%;B/2#;ĉ.# &; /#$+")("\'#&\'#0<*%;B/2#;ĉ.# &; /#$+")("\'#&\'#&/#$+$)($\'#(#\'#("\'#&\'#'),x(";™.# &;L"),x("%2Ư\"\"6Ư7ư/5#;</,$;Ċ/#$+#)(#'#(\"'#&'#"),x("%;D/S#;,/J$2:\"\"6:7;/;$;,.# &;T/,$;E/#$+%)(%'#($'#(#'#(\"'#&'#")],l=0,c=0,p=[{line:1,column:1}],f=0,g=[],m=0;if(void 0!==t.startRule){if(!(t.startRule in o))throw new Error("Can't start parsing from rule \""+t.startRule+'".');i=o[t.startRule]}function v(){return e.substring(c,l)}function y(){return E(c,l)}function b(e,t){return{type:"literal",text:e,ignoreCase:t}}function w(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function C(){return{type:"end"}}function S(t){var n,r=p[t];if(r)return r;n=t-1;while(!p[n])n--;r=p[n],r={line:r.line,column:r.column};while(n<t)10===e.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return p[t]=r,r}function E(e,t){var n=S(e),r=S(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:r.line,column:r.column}}}function T(e){l<f||(l>f&&(f=l,g=[]),g.push(e))}function k(e,t,n){return new h(h.buildMessage(e,t),e,t,n)}function x(e){return e.split("").map((function(e){return e.charCodeAt(0)-32}))}function N(t){var n,o=a[t],i=0,u=[],d=o.length,p=[],h=[];while(1){while(i<d)switch(o[i]){case 0:h.push(s[o[i+1]]),i+=2;break;case 1:h.push(void 0),i++;break;case 2:h.push(null),i++;break;case 3:h.push(r),i++;break;case 4:h.push([]),i++;break;case 5:h.push(l),i++;break;case 6:h.pop(),i++;break;case 7:l=h.pop(),i++;break;case 8:h.length-=o[i+1],i+=2;break;case 9:h.splice(-2,1),i++;break;case 10:h[h.length-2].push(h.pop()),i++;break;case 11:h.push(h.splice(h.length-o[i+1],o[i+1])),i+=2;break;case 12:h.push(e.substring(h.pop(),l)),i++;break;case 13:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 14:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]===r?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 15:p.push(d),u.push(i+3+o[i+1]+o[i+2]),h[h.length-1]!==r?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 16:h[h.length-1]!==r?(p.push(d),u.push(i),d=i+2+o[i+1],i+=2):i+=2+o[i+1];break;case 17:p.push(d),u.push(i+3+o[i+1]+o[i+2]),e.length>l?(d=i+3+o[i+1],i+=3):(d=i+3+o[i+1]+o[i+2],i+=3+o[i+1]);break;case 18:p.push(d),u.push(i+4+o[i+2]+o[i+3]),e.substr(l,s[o[i+1]].length)===s[o[i+1]]?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 19:p.push(d),u.push(i+4+o[i+2]+o[i+3]),e.substr(l,s[o[i+1]].length).toLowerCase()===s[o[i+1]]?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 20:p.push(d),u.push(i+4+o[i+2]+o[i+3]),s[o[i+1]].test(e.charAt(l))?(d=i+4+o[i+2],i+=4):(d=i+4+o[i+2]+o[i+3],i+=4+o[i+2]);break;case 21:h.push(e.substr(l,o[i+1])),l+=o[i+1],i+=2;break;case 22:h.push(s[o[i+1]]),l+=s[o[i+1]].length,i+=2;break;case 23:h.push(r),0===m&&T(s[o[i+1]]),i+=2;break;case 24:c=h[h.length-1-o[i+1]],i+=2;break;case 25:c=l,i++;break;case 26:n=o.slice(i+4,i+4+o[i+3]).map((function(e){return h[h.length-1-e]})),h.splice(h.length-o[i+2],o[i+2],s[o[i+1]].apply(null,n)),i+=4+o[i+3];break;case 27:h.push(N(o[i+1])),i+=2;break;case 28:m++,i++;break;case 29:m--,i++;break;default:throw new Error("Invalid opcode: "+o[i]+".")}if(!(p.length>0))break;d=p.pop(),i=u.pop()}return h[0]}function R(e,t){return[e].concat(t)}if(t.data={},n=N(i),n!==r&&l===e.length)return n;throw n!==r&&l<e.length&&T(C()),k(g,f<e.length?e.charAt(f):null,f<e.length?E(f,f+1):E(f,f))}var g,m,v=f;(function(e){function t(e,t){var n={startRule:t};try{v(e,n)}catch(r){n.data=-1}return n.data}function n(t){var n=e.parse(t,"Name_Addr_Header");return-1!==n?n:void 0}function r(t){var n=e.parse(t,"SIP_URI");return-1!==n?n:void 0}e.parse=t,e.nameAddrHeaderParse=n,e.URIParse=r})(g||(g={})),function(e){e.ACK="ACK",e.BYE="BYE",e.CANCEL="CANCEL",e.INFO="INFO",e.INVITE="INVITE",e.MESSAGE="MESSAGE",e.NOTIFY="NOTIFY",e.OPTIONS="OPTIONS",e.REGISTER="REGISTER",e.UPDATE="UPDATE",e.SUBSCRIBE="SUBSCRIBE",e.PUBLISH="PUBLISH",e.REFER="REFER",e.PRACK="PRACK"}(m||(m={}));var y={100:"Trying",180:"Ringing",181:"Call Is Being Forwarded",182:"Queued",183:"Session Progress",199:"Early Dialog Terminated",200:"OK",202:"Accepted",204:"No Notification",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",305:"Use Proxy",380:"Alternative Service",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",410:"Gone",412:"Conditional Request Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Unsupported URI Scheme",417:"Unknown Resource-Priority",420:"Bad Extension",421:"Extension Required",422:"Session Interval Too Small",423:"Interval Too Brief",428:"Use Identity Header",429:"Provide Referrer Identity",430:"Flow Failed",433:"Anonymity Disallowed",436:"Bad Identity-Info",437:"Unsupported Certificate",438:"Invalid Identity Header",439:"First Hop Lacks Outbound Support",440:"Max-Breadth Exceeded",469:"Bad Info Package",470:"Consent Needed",478:"Unresolvable Destination",480:"Temporarily Unavailable",481:"Call/Transaction Does Not Exist",482:"Loop Detected",483:"Too Many Hops",484:"Address Incomplete",485:"Ambiguous",486:"Busy Here",487:"Request Terminated",488:"Not Acceptable Here",489:"Bad Event",491:"Request Pending",493:"Undecipherable",494:"Security Agreement Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Server Time-out",505:"Version Not Supported",513:"Message Too Large",580:"Precondition Failure",600:"Busy Everywhere",603:"Decline",604:"Does Not Exist Anywhere",606:"Not Acceptable"};function b(e,t){void 0===t&&(t=32);for(var n="",r=0;r<e;r++){var o=Math.floor(Math.random()*t);n+=o.toString(t)}return n}function w(e){return y[e]||""}function C(){return b(10)}function S(e){for(var t={"Call-Id":"Call-ID",Cseq:"CSeq","Min-Se":"Min-SE",Rack:"RAck",Rseq:"RSeq","Www-Authenticate":"WWW-Authenticate"},n=e.toLowerCase().replace(/_/g,"-").split("-"),r=n.length,o="",i=0;i<r;i++)0!==i&&(o+="-"),o+=n[i].charAt(0).toUpperCase()+n[i].substring(1);return t[o]&&(o=t[o]),o}function E(e){return encodeURIComponent(e).replace(/%[A-F\d]{2}/g,"U").length}var T=function(){function e(){this.headers={}}return e.prototype.addHeader=function(e,t){var n={raw:t};e=S(e),this.headers[e]?this.headers[e].push(n):this.headers[e]=[n]},e.prototype.getHeader=function(e){var t=this.headers[S(e)];if(t)return t[0]?t[0].raw:void 0},e.prototype.getHeaders=function(e){var t=this.headers[S(e)],n=[];if(!t)return[];for(var r=0,o=t;r<o.length;r++){var i=o[r];n.push(i.raw)}return n},e.prototype.hasHeader=function(e){return!!this.headers[S(e)]},e.prototype.parseHeader=function(e,t){if(void 0===t&&(t=0),e=S(e),this.headers[e]&&!(t>=this.headers[e].length)){var n=this.headers[e][t],r=n.raw;if(n.parsed)return n.parsed;var o=g.parse(r,e.replace(/-/g,"_"));return-1===o?void this.headers[e].splice(t,1):(n.parsed=o,o)}},e.prototype.s=function(e,t){return void 0===t&&(t=0),this.parseHeader(e,t)},e.prototype.setHeader=function(e,t){this.headers[S(e)]=[{raw:t}]},e.prototype.toString=function(){return this.data},e}(),k=function(e){function t(){return e.call(this)||this}return o(t,e),t}(T),x=function(e){function t(){return e.call(this)||this}return o(t,e),t}(T),N=function(){function e(t,n,r,o,s,a,l){this.headers={},this.extraHeaders=[],this.options=e.getDefaultOptions(),s&&(this.options=i(i({},this.options),s),this.options.optionTags&&this.options.optionTags.length&&(this.options.optionTags=this.options.optionTags.slice()),this.options.routeSet&&this.options.routeSet.length&&(this.options.routeSet=this.options.routeSet.slice())),a&&a.length&&(this.extraHeaders=a.slice()),l&&(this.body={body:l.content,contentType:l.contentType}),this.method=t,this.ruri=n.clone(),this.fromURI=r.clone(),this.fromTag=this.options.fromTag?this.options.fromTag:C(),this.from=e.makeNameAddrHeader(this.fromURI,this.options.fromDisplayName,this.fromTag),this.toURI=o.clone(),this.toTag=this.options.toTag,this.to=e.makeNameAddrHeader(this.toURI,this.options.toDisplayName,this.toTag),this.callId=this.options.callId?this.options.callId:this.options.callIdPrefix+b(15),this.cseq=this.options.cseq,this.setHeader("route",this.options.routeSet),this.setHeader("via",""),this.setHeader("to",this.to.toString()),this.setHeader("from",this.from.toString()),this.setHeader("cseq",this.cseq+" "+this.method),this.setHeader("call-id",this.callId),this.setHeader("max-forwards","70")}return e.getDefaultOptions=function(){return{callId:"",callIdPrefix:"",cseq:1,toDisplayName:"",toTag:"",fromDisplayName:"",fromTag:"",forceRport:!1,hackViaTcp:!1,optionTags:["outbound"],routeSet:[],userAgentString:"sip.js",viaHost:""}},e.makeNameAddrHeader=function(e,t,n){var r={};return n&&(r.tag=n),new u(e,t,r)},e.prototype.getHeader=function(e){var t=this.headers[S(e)];if(t){if(t[0])return t[0]}else for(var n=new RegExp("^\\s*"+e+"\\s*:","i"),r=0,o=this.extraHeaders;r<o.length;r++){var i=o[r];if(n.test(i))return i.substring(i.indexOf(":")+1).trim()}},e.prototype.getHeaders=function(e){var t=[],n=this.headers[S(e)];if(n)for(var r=0,o=n;r<o.length;r++){var i=o[r];t.push(i)}else for(var s=new RegExp("^\\s*"+e+"\\s*:","i"),a=0,l=this.extraHeaders;a<l.length;a++){var c=l[a];s.test(c)&&t.push(c.substring(c.indexOf(":")+1).trim())}return t},e.prototype.hasHeader=function(e){if(this.headers[S(e)])return!0;for(var t=new RegExp("^\\s*"+e+"\\s*:","i"),n=0,r=this.extraHeaders;n<r.length;n++){var o=r[n];if(t.test(o))return!0}return!1},e.prototype.setHeader=function(e,t){this.headers[S(e)]=t instanceof Array?t:[t]},e.prototype.setViaHeader=function(e,t){this.options.hackViaTcp&&(t="TCP");var n="SIP/2.0/"+t;n+=" "+this.options.viaHost+";branch="+e,this.options.forceRport&&(n+=";rport"),this.setHeader("via",n),this.branch=e},e.prototype.toString=function(){var e="";for(var t in e+=this.method+" "+this.ruri.toRaw()+" SIP/2.0\r\n",this.headers)if(this.headers[t])for(var n=0,r=this.headers[t];n<r.length;n++){var o=r[n];e+=t+": "+o+"\r\n"}for(var i=0,s=this.extraHeaders;i<s.length;i++){t=s[i];e+=t.trim()+"\r\n"}return e+="Supported: "+this.options.optionTags.join(", ")+"\r\n",e+="User-Agent: "+this.options.userAgentString+"\r\n",this.body?"string"===typeof this.body?(e+="Content-Length: "+E(this.body)+"\r\n\r\n",e+=this.body):this.body.body&&this.body.contentType?(e+="Content-Type: "+this.body.contentType+"\r\n",e+="Content-Length: "+E(this.body.body)+"\r\n\r\n",e+=this.body.body):e+="Content-Length: 0\r\n\r\n":e+="Content-Length: 0\r\n\r\n",e},e}();function R(e){return"application/sdp"===e?"session":"render"}function I(e){var t="string"===typeof e?e:e.body,n="string"===typeof e?"application/sdp":e.contentType,r=R(n),o={contentDisposition:r,contentType:n,content:t};return o}function _(e){return!(!e||"string"!==typeof e.content||"string"!==typeof e.contentType||void 0!==e.contentDisposition)||"string"===typeof e.contentDisposition}function O(e){var t,n,r;if(e instanceof k&&e.body){var o=e.parseHeader("Content-Disposition");t=o?o.type:void 0,n=e.parseHeader("Content-Type"),r=e.body}if(e instanceof x&&e.body){o=e.parseHeader("Content-Disposition");t=o?o.type:void 0,n=e.parseHeader("Content-Type"),r=e.body}if(e instanceof N&&e.body)if(t=e.getHeader("Content-Disposition"),n=e.getHeader("Content-Type"),"string"===typeof e.body){if(!n)throw new Error("Header content type header does not equal body content type.");r=e.body}else{if(n&&n!==e.body.contentType)throw new Error("Header content type header does not equal body content type.");n=e.body.contentType,r=e.body.body}if(_(e)&&(t=e.contentDisposition,n=e.contentType,r=e.content),r){if(n&&!t&&(t=R(n)),!t)throw new Error("Content disposition undefined.");if(!n)throw new Error("Content type undefined.");return{contentDisposition:t,contentType:n,content:r}}}var A=function(){function e(){this._dataLength=0,this._bufferLength=0,this._state=new Int32Array(4),this._buffer=new ArrayBuffer(68),this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}return e.hashStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendStr(e).end(t)},e.hashAsciiStr=function(e,t){return void 0===t&&(t=!1),this.onePassHasher.start().appendAsciiStr(e).end(t)},e._hex=function(t){var n,r,o,i,s=e.hexChars,a=e.hexOut;for(i=0;i<4;i+=1)for(r=8*i,n=t[i],o=0;o<8;o+=2)a[r+1+o]=s.charAt(15&n),n>>>=4,a[r+0+o]=s.charAt(15&n),n>>>=4;return a.join("")},e._md5cycle=function(e,t){var n=e[0],r=e[1],o=e[2],i=e[3];n+=(r&o|~r&i)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[1]-389564586|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[2]+606105819|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[5]+1200080426|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[6]-1473231341|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[9]-1958414417|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[10]-42063|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+o|0,n+=(r&o|~r&i)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,i+=(n&r|~n&o)+t[13]-40341101|0,i=(i<<12|i>>>20)+n|0,o+=(i&n|~i&r)+t[14]-1502002290|0,o=(o<<17|o>>>15)+i|0,r+=(o&i|~o&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+o|0,n+=(r&i|o&~i)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[6]-1069501632|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[11]+643717713|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[10]+38016083|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[15]-660478335|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[14]-1019803690|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[3]-187363961|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+o|0,n+=(r&i|o&~i)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,i+=(n&o|r&~o)+t[2]-51403784|0,i=(i<<9|i>>>23)+n|0,o+=(i&r|n&~r)+t[7]+1735328473|0,o=(o<<14|o>>>18)+i|0,r+=(o&n|i&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+o|0,n+=(r^o^i)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[8]-2022574463|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[11]+1839030562|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[4]+1272893353|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[7]-155497632|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[0]-358537222|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[3]-722521979|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+o|0,n+=(r^o^i)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,i+=(n^r^o)+t[12]-421815835|0,i=(i<<11|i>>>21)+n|0,o+=(i^n^r)+t[15]+530742520|0,o=(o<<16|o>>>16)+i|0,r+=(o^i^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+o|0,n+=(o^(r|~i))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[7]+1126891415|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[14]-1416354905|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[3]-1894986606|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[10]-1051523|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[15]-30611744|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[6]-1560198380|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+o|0,n+=(o^(r|~i))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,i+=(r^(n|~o))+t[11]-1120210379|0,i=(i<<10|i>>>22)+n|0,o+=(n^(i|~r))+t[2]+718787259|0,o=(o<<15|o>>>17)+i|0,r+=(i^(o|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+o|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0},e.prototype.start=function(){return this._dataLength=0,this._bufferLength=0,this._state.set(e.stateIdentity),this},e.prototype.appendStr=function(t){var n,r,o=this._buffer8,i=this._buffer32,s=this._bufferLength;for(r=0;r<t.length;r+=1){if(n=t.charCodeAt(r),n<128)o[s++]=n;else if(n<2048)o[s++]=192+(n>>>6),o[s++]=63&n|128;else if(n<55296||n>56319)o[s++]=224+(n>>>12),o[s++]=n>>>6&63|128,o[s++]=63&n|128;else{if(n=1024*(n-55296)+(t.charCodeAt(++r)-56320)+65536,n>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");o[s++]=240+(n>>>18),o[s++]=n>>>12&63|128,o[s++]=n>>>6&63|128,o[s++]=63&n|128}s>=64&&(this._dataLength+=64,e._md5cycle(this._state,i),s-=64,i[0]=i[16])}return this._bufferLength=s,this},e.prototype.appendAsciiStr=function(t){for(var n,r=this._buffer8,o=this._buffer32,i=this._bufferLength,s=0;;){n=Math.min(t.length-s,64-i);while(n--)r[i++]=t.charCodeAt(s++);if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,o),i=0}return this._bufferLength=i,this},e.prototype.appendByteArray=function(t){for(var n,r=this._buffer8,o=this._buffer32,i=this._bufferLength,s=0;;){n=Math.min(t.length-s,64-i);while(n--)r[i++]=t[s++];if(i<64)break;this._dataLength+=64,e._md5cycle(this._state,o),i=0}return this._bufferLength=i,this},e.prototype.getState=function(){var e=this,t=e._state;return{buffer:String.fromCharCode.apply(null,e._buffer8),buflen:e._bufferLength,length:e._dataLength,state:[t[0],t[1],t[2],t[3]]}},e.prototype.setState=function(e){var t,n=e.buffer,r=e.state,o=this._state;for(this._dataLength=e.length,this._bufferLength=e.buflen,o[0]=r[0],o[1]=r[1],o[2]=r[2],o[3]=r[3],t=0;t<n.length;t+=1)this._buffer8[t]=n.charCodeAt(t)},e.prototype.end=function(t){void 0===t&&(t=!1);var n,r=this._bufferLength,o=this._buffer8,i=this._buffer32,s=1+(r>>2);if(this._dataLength+=r,o[r]=128,o[r+1]=o[r+2]=o[r+3]=0,i.set(e.buffer32Identity.subarray(s),s),r>55&&(e._md5cycle(this._state,i),i.set(e.buffer32Identity)),n=8*this._dataLength,n<=4294967295)i[14]=n;else{var a=n.toString(16).match(/(.*?)(.{0,8})$/);if(null===a)return;var l=parseInt(a[2],16),c=parseInt(a[1],16)||0;i[14]=l,i[15]=c}return e._md5cycle(this._state,i),t?this._state:e._hex(this._state)},e.stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]),e.buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e.hexChars="0123456789abcdef",e.hexOut=[],e.onePassHasher=new e,e}();function B(e){return A.hashStr(e)}"5d41402abc4b2a76b9719d911017c592"!==A.hashStr("hello")&&console.error("Md5 self test failed.");var D,P=function(){function e(e,t,n,r){this.logger=e.getLogger("sipjs.digestauthentication"),this.username=n,this.password=r,this.ha1=t,this.nc=0,this.ncHex="00000000"}return e.prototype.authenticate=function(e,t,n){if(this.algorithm=t.algorithm,this.realm=t.realm,this.nonce=t.nonce,this.opaque=t.opaque,this.stale=t.stale,this.algorithm){if("MD5"!==this.algorithm)return this.logger.warn("challenge with Digest algorithm different than 'MD5', authentication aborted"),!1}else this.algorithm="MD5";if(!this.realm)return this.logger.warn("challenge without Digest realm, authentication aborted"),!1;if(!this.nonce)return this.logger.warn("challenge without Digest nonce, authentication aborted"),!1;if(t.qop)if(t.qop.indexOf("auth")>-1)this.qop="auth";else{if(!(t.qop.indexOf("auth-int")>-1))return this.logger.warn("challenge without Digest qop different than 'auth' or 'auth-int', authentication aborted"),!1;this.qop="auth-int"}else this.qop=void 0;return this.method=e.method,this.uri=e.ruri,this.cnonce=b(12),this.nc+=1,this.updateNcHex(),4294967296===this.nc&&(this.nc=1,this.ncHex="00000001"),this.calculateResponse(n),!0},e.prototype.toString=function(){var e=[];if(!this.response)throw new Error("response field does not exist, cannot generate Authorization header");return e.push("algorithm="+this.algorithm),e.push('username="'+this.username+'"'),e.push('realm="'+this.realm+'"'),e.push('nonce="'+this.nonce+'"'),e.push('uri="'+this.uri+'"'),e.push('response="'+this.response+'"'),this.opaque&&e.push('opaque="'+this.opaque+'"'),this.qop&&(e.push("qop="+this.qop),e.push('cnonce="'+this.cnonce+'"'),e.push("nc="+this.ncHex)),"Digest "+e.join(", ")},e.prototype.updateNcHex=function(){var e=Number(this.nc).toString(16);this.ncHex="00000000".substr(0,8-e.length)+e},e.prototype.calculateResponse=function(e){var t,n;t=this.ha1,""!==t&&void 0!==t||(t=B(this.username+":"+this.realm+":"+this.password)),"auth"===this.qop?(n=B(this.method+":"+this.uri),this.response=B(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth:"+n)):"auth-int"===this.qop?(n=B(this.method+":"+this.uri+":"+B(e||"")),this.response=B(t+":"+this.nonce+":"+this.ncHex+":"+this.cnonce+":auth-int:"+n)):void 0===this.qop&&(n=B(this.method+":"+this.uri),this.response=B(t+":"+this.nonce+":"+n))},e}();function H(e,t){var n="\r\n";if(t.statusCode<100||t.statusCode>699)throw new TypeError("Invalid statusCode: "+t.statusCode);var r=t.reasonPhrase?t.reasonPhrase:w(t.statusCode),o="SIP/2.0 "+t.statusCode+" "+r+n;t.statusCode>=100&&t.statusCode,t.statusCode;var i="From: "+e.getHeader("From")+n,s="Call-ID: "+e.callId+n,a="CSeq: "+e.cseq+" "+e.method+n,l=e.getHeaders("via").reduce((function(e,t){return e+"Via: "+t+n}),""),c="To: "+e.getHeader("to");if(t.statusCode>100&&!e.parseHeader("to").hasParam("tag")){var u=t.toTag;u||(u=C()),c+=";tag="+u}c+=n;var d="";t.supported&&(d="Supported: "+t.supported.join(", ")+n);var p="";t.userAgent&&(p="User-Agent: "+t.userAgent+n);var h="";return t.extraHeaders&&(h=t.extraHeaders.reduce((function(e,t){return e+t.trim()+n}),"")),o+=l,o+=i,o+=c,o+=a,o+=s,o+=d,o+=p,o+=h,t.body?(o+="Content-Type: "+t.body.contentType+n,o+="Content-Length: "+E(t.body.content)+n+n,o+=t.body.content):o+="Content-Length: 0"+n+n,{message:o}}(function(e){function t(e,t){var n=t,r=0,o=0;if(e.substring(n,n+2).match(/(^\r\n)/))return-2;while(0===r){if(o=e.indexOf("\r\n",n),-1===o)return o;!e.substring(o+2,o+4).match(/(^\r\n)/)&&e.charAt(o+2).match(/(^\s+)/)?n=o+2:r=o}return r}function n(e,t,n,r){var o,i=t.indexOf(":",n),s=t.substring(n,i).trim(),a=t.substring(i+1,r).trim();switch(s.toLowerCase()){case"via":case"v":e.addHeader("via",a),1===e.getHeaders("via").length?(o=e.parseHeader("Via"),o&&(e.via=o,e.viaBranch=o.branch)):o=0;break;case"from":case"f":e.setHeader("from",a),o=e.parseHeader("from"),o&&(e.from=o,e.fromTag=o.getParam("tag"));break;case"to":case"t":e.setHeader("to",a),o=e.parseHeader("to"),o&&(e.to=o,e.toTag=o.getParam("tag"));break;case"record-route":if(o=g.parse(a,"Record_Route"),-1===o){o=void 0;break}if(!(o instanceof Array)){o=void 0;break}o.forEach((function(t){e.addHeader("record-route",a.substring(t.position,t.offset)),e.headers["Record-Route"][e.getHeaders("record-route").length-1].parsed=t.parsed}));break;case"call-id":case"i":e.setHeader("call-id",a),o=e.parseHeader("call-id"),o&&(e.callId=a);break;case"contact":case"m":if(o=g.parse(a,"Contact"),-1===o){o=void 0;break}if(!(o instanceof Array)){o=void 0;break}o.forEach((function(t){e.addHeader("contact",a.substring(t.position,t.offset)),e.headers.Contact[e.getHeaders("contact").length-1].parsed=t.parsed}));break;case"content-length":case"l":e.setHeader("content-length",a),o=e.parseHeader("content-length");break;case"content-type":case"c":e.setHeader("content-type",a),o=e.parseHeader("content-type");break;case"cseq":e.setHeader("cseq",a),o=e.parseHeader("cseq"),o&&(e.cseq=o.value),e instanceof x&&(e.method=o.method);break;case"max-forwards":e.setHeader("max-forwards",a),o=e.parseHeader("max-forwards");break;case"www-authenticate":e.setHeader("www-authenticate",a),o=e.parseHeader("www-authenticate");break;case"proxy-authenticate":e.setHeader("proxy-authenticate",a),o=e.parseHeader("proxy-authenticate");break;case"refer-to":case"r":e.setHeader("refer-to",a),o=e.parseHeader("refer-to"),o&&(e.referTo=o);break;default:e.addHeader(s.toLowerCase(),a),o=0}return void 0!==o||{error:"error parsing header '"+s+"'"}}function r(e,r){var o=0,i=e.indexOf("\r\n");if(-1!==i){var s,a=e.substring(0,i),l=g.parse(a,"Request_Response");if(-1!==l){var c;l.status_code?(s=new x,s.statusCode=l.status_code,s.reasonPhrase=l.reason_phrase):(s=new k,s.method=l.method,s.ruri=l.uri),s.data=e,o=i+2;while(1){if(i=t(e,o),-2===i){c=o+2;break}if(-1===i)return void r.error("malformed message");var u=n(s,e,o,i);if(u&&!0!==u)return void r.error(u.error);o=i+2}return s.hasHeader("content-length")?s.body=e.substr(c,Number(s.getHeader("content-length"))):s.body=e.substring(c),s}r.warn('error parsing first line of SIP message: "'+a+'"')}else r.warn("no CRLF found, not a SIP message, discarded")}e.getHeader=t,e.parseHeader=n,e.parseMessage=r})(D||(D={}));var M,j,V=function(){function e(e,t){this.core=e,this.dialogState=t,this.core.dialogs.set(this.id,this)}return e.initialDialogStateForUserAgentClient=function(e,t){var n=!1,r=t.getHeaders("record-route").reverse(),o=t.parseHeader("contact");if(!o)throw new Error("Contact undefined.");if(!(o instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var i=o.uri,s=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=t.toTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");var p=e.from.uri,h=e.to.uri;if(!t.statusCode)throw new Error("Incoming response status code undefined.");var f=t.statusCode<200,g={id:l+c+d,early:f,callId:l,localTag:c,remoteTag:d,localSequenceNumber:s,remoteSequenceNumber:a,localURI:p,remoteURI:h,remoteTarget:i,routeSet:r,secure:n};return g},e.initialDialogStateForUserAgentServer=function(e,t,n){void 0===n&&(n=!1);var r=!1,o=e.getHeaders("record-route"),i=e.parseHeader("contact");if(!i)throw new Error("Contact undefined.");if(!(i instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var s=i.uri,a=e.cseq,l=void 0,c=e.callId,d=t,p=e.fromTag,h=e.from.uri,f=e.to.uri,g={id:c+d+p,early:n,callId:c,localTag:d,remoteTag:p,localSequenceNumber:l,remoteSequenceNumber:a,localURI:f,remoteURI:h,remoteTarget:s,routeSet:o,secure:r};return g},e.prototype.dispose=function(){this.core.dialogs.delete(this.id)},Object.defineProperty(e.prototype,"id",{get:function(){return this.dialogState.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"early",{get:function(){return this.dialogState.early},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"callId",{get:function(){return this.dialogState.callId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localTag",{get:function(){return this.dialogState.localTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteTag",{get:function(){return this.dialogState.remoteTag},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localSequenceNumber",{get:function(){return this.dialogState.localSequenceNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteSequenceNumber",{get:function(){return this.dialogState.remoteSequenceNumber},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localURI",{get:function(){return this.dialogState.localURI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteURI",{get:function(){return this.dialogState.remoteURI},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteTarget",{get:function(){return this.dialogState.remoteTarget},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"routeSet",{get:function(){return this.dialogState.routeSet},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"secure",{get:function(){return this.dialogState.secure},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgentCore",{get:function(){return this.core},enumerable:!1,configurable:!0}),e.prototype.confirm=function(){this.dialogState.early=!1},e.prototype.receiveRequest=function(e){if(e.method!==m.ACK){if(this.remoteSequenceNumber){if(e.cseq<=this.remoteSequenceNumber)throw new Error("Out of sequence in dialog request. Did you forget to call sequenceGuard()?");this.dialogState.remoteSequenceNumber=e.cseq}this.remoteSequenceNumber||(this.dialogState.remoteSequenceNumber=e.cseq)}},e.prototype.recomputeRouteSet=function(e){this.dialogState.routeSet=e.getHeaders("record-route").reverse()},e.prototype.createOutgoingRequestMessage=function(e,t){var n,r=this.remoteURI,o=this.remoteTag,i=this.localURI,s=this.localTag,a=this.callId;n=t&&t.cseq?t.cseq:this.dialogState.localSequenceNumber?this.dialogState.localSequenceNumber+=1:this.dialogState.localSequenceNumber=1;var l=this.remoteTarget,c=this.routeSet,u=t&&t.extraHeaders,d=t&&t.body,p=this.userAgentCore.makeOutgoingRequestMessage(e,l,i,r,{callId:a,cseq:n,fromTag:s,toTag:o,routeSet:c},u,d);return p},e.prototype.incrementLocalSequenceNumber=function(){if(!this.dialogState.localSequenceNumber)throw new Error("Local sequence number undefined.");this.dialogState.localSequenceNumber+=1},e.prototype.sequenceGuard=function(e){return e.method===m.ACK||(!(this.remoteSequenceNumber&&e.cseq<=this.remoteSequenceNumber)||(this.core.replyStateless(e,{statusCode:500}),!1))},e}();(function(e){e["Initial"]="Initial",e["Early"]="Early",e["AckWait"]="AckWait",e["Confirmed"]="Confirmed",e["Terminated"]="Terminated"})(M||(M={})),function(e){e["Initial"]="Initial",e["HaveLocalOffer"]="HaveLocalOffer",e["HaveRemoteOffer"]="HaveRemoteOffer",e["Stable"]="Stable",e["Closed"]="Closed"}(j||(j={}));var L,$=500,q=4e3,F=5e3,U={T1:$,T2:q,T4:F,TIMER_B:64*$,TIMER_D:0*$,TIMER_F:6*$,TIMER_H:64*$,TIMER_I:0*F,TIMER_J:0*$,TIMER_K:0*F,TIMER_L:64*$,TIMER_M:64*$,TIMER_N:64*$,PROVISIONAL_RESPONSE_INTERVAL:6e4},z=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return Object.setPrototypeOf(r,n.prototype),r}return o(t,e),t}(Error),K=function(e){function t(t){return e.call(this,t||"Transaction state error.")||this}return o(t,e),t}(z),W=function(e){function t(t){return e.call(this,t||"Unspecified transport error.")||this}return o(t,e),t}(z),G=function(){function e(e,t,n,r,o){this._transport=e,this._user=t,this._id=n,this._state=r,this.listeners=new Array,this.logger=t.loggerFactory.getLogger(o,n),this.logger.debug("Constructing ".concat(this.typeToString()," with id ").concat(this.id,"."))}return e.prototype.dispose=function(){this.logger.debug("Destroyed ".concat(this.typeToString()," with id ").concat(this.id,"."))},Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"kind",{get:function(){throw new Error("Invalid kind.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this._transport},enumerable:!1,configurable:!0}),e.prototype.addStateChangeListener=function(e,t){var n=this,r=function(){n.removeStateChangeListener(r),e()};!0===(null===t||void 0===t?void 0:t.once)?this.listeners.push(r):this.listeners.push(e)},e.prototype.notifyStateChangeListeners=function(){this.listeners.slice().forEach((function(e){return e()}))},e.prototype.removeStateChangeListener=function(e){this.listeners=this.listeners.filter((function(t){return t!==e}))},e.prototype.logTransportError=function(e,t){this.logger.error(e.message),this.logger.error("Transport error occurred in ".concat(this.typeToString()," with id ").concat(this.id,".")),this.logger.error(t)},e.prototype.send=function(e){var t=this;return this.transport.send(e).catch((function(e){if(e instanceof W)throw t.onTransportError(e),e;var n;throw n=e&&"string"===typeof e.message?new W(e.message):new W,t.onTransportError(n),n}))},e.prototype.setState=function(e){this.logger.debug('State change to "'.concat(e,'" on ').concat(this.typeToString()," with id ").concat(this.id,".")),this._state=e,this._user.onStateChange&&this._user.onStateChange(e),this.notifyStateChangeListeners()},e.prototype.typeToString=function(){return"UnknownType"},e}(),Y=function(e){function t(n,r,o,i,s){var a=e.call(this,r,o,t.makeId(n),i,s)||this;return a._request=n,a.user=o,n.setViaHeader(a.id,r.protocol),a}return o(t,e),t.makeId=function(e){if("CANCEL"===e.method){if(!e.branch)throw new Error("Outgoing CANCEL request without a branch.");return e.branch}return"z9hG4bK"+Math.floor(1e7*Math.random())},Object.defineProperty(t.prototype,"request",{get:function(){return this._request},enumerable:!1,configurable:!0}),t.prototype.onRequestTimeout=function(){this.user.onRequestTimeout&&this.user.onRequestTimeout()},t}(G);(function(e){e["Accepted"]="Accepted",e["Calling"]="Calling",e["Completed"]="Completed",e["Confirmed"]="Confirmed",e["Proceeding"]="Proceeding",e["Terminated"]="Terminated",e["Trying"]="Trying"})(L||(L={}));var J=function(e){function t(t,n,r){var o=e.call(this,t,n,r,L.Calling,"sip.transaction.ict")||this;return o.ackRetransmissionCache=new Map,o.B=setTimeout((function(){return o.timerB()}),U.TIMER_B),o.send(t.toString()).catch((function(e){o.logTransportError(e,"Failed to send initial outgoing request.")})),o}return o(t,e),t.prototype.dispose=function(){this.B&&(clearTimeout(this.B),this.B=void 0),this.D&&(clearTimeout(this.D),this.D=void 0),this.M&&(clearTimeout(this.M),this.M=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"ict"},enumerable:!1,configurable:!0}),t.prototype.ackResponse=function(e){var t=this,n=e.toTag;if(!n)throw new Error("To tag undefined.");var r="z9hG4bK"+Math.floor(1e7*Math.random());e.setViaHeader(r,this.transport.protocol),this.ackRetransmissionCache.set(n,e),this.send(e.toString()).catch((function(e){t.logTransportError(e,"Failed to send ACK to 2xx response.")}))},t.prototype.receiveResponse=function(e){var t=this,n=e.statusCode;if(!n||n<100||n>699)throw new Error("Invalid status code ".concat(n));switch(this.state){case L.Calling:if(n>=100&&n<=199)return this.stateTransition(L.Proceeding),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=200&&n<=299)return this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(L.Accepted),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=300&&n<=699)return this.stateTransition(L.Completed),this.ack(e),void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case L.Proceeding:if(n>=100&&n<=199)return void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=200&&n<=299)return this.ackRetransmissionCache.set(e.toTag,void 0),this.stateTransition(L.Accepted),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(n>=300&&n<=699)return this.stateTransition(L.Completed),this.ack(e),void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case L.Accepted:if(n>=200&&n<=299){if(!this.ackRetransmissionCache.has(e.toTag))return this.ackRetransmissionCache.set(e.toTag,void 0),void(this.user.receiveResponse&&this.user.receiveResponse(e));var r=this.ackRetransmissionCache.get(e.toTag);return r?void this.send(r.toString()).catch((function(e){t.logTransportError(e,"Failed to send retransmission of ACK to 2xx response.")})):void 0}break;case L.Completed:if(n>=300&&n<=699)return void this.ack(e);break;case L.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var o="Received unexpected ".concat(n," response while in state ").concat(this.state,".");this.logger.warn(o)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(L.Terminated,!0)},t.prototype.typeToString=function(){return"INVITE client transaction"},t.prototype.ack=function(e){var t=this,n=this.request.ruri,r=this.request.callId,o=this.request.cseq,i=this.request.getHeader("from"),s=e.getHeader("to"),a=this.request.getHeader("via"),l=this.request.getHeader("route");if(!i)throw new Error("From undefined.");if(!s)throw new Error("To undefined.");if(!a)throw new Error("Via undefined.");var c="ACK ".concat(n," SIP/2.0\r\n");l&&(c+="Route: ".concat(l,"\r\n")),c+="Via: ".concat(a,"\r\n"),c+="To: ".concat(s,"\r\n"),c+="From: ".concat(i,"\r\n"),c+="Call-ID: ".concat(r,"\r\n"),c+="CSeq: ".concat(o," ACK\r\n"),c+="Max-Forwards: 70\r\n",c+="Content-Length: 0\r\n\r\n",this.send(c).catch((function(e){t.logTransportError(e,"Failed to send ACK to non-2xx response.")}))},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case L.Calling:r();break;case L.Proceeding:this.state!==L.Calling&&r();break;case L.Accepted:case L.Completed:this.state!==L.Calling&&this.state!==L.Proceeding&&r();break;case L.Terminated:this.state!==L.Calling&&this.state!==L.Accepted&&this.state!==L.Completed&&(t||r());break;default:r()}this.B&&(clearTimeout(this.B),this.B=void 0),L.Proceeding,e===L.Completed&&(this.D=setTimeout((function(){return n.timerD()}),U.TIMER_D)),e===L.Accepted&&(this.M=setTimeout((function(){return n.timerM()}),U.TIMER_M)),e===L.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerA=function(){},t.prototype.timerB=function(){this.logger.debug("Timer B expired for INVITE client transaction ".concat(this.id,".")),this.state===L.Calling&&(this.onRequestTimeout(),this.stateTransition(L.Terminated))},t.prototype.timerD=function(){this.logger.debug("Timer D expired for INVITE client transaction ".concat(this.id,".")),this.state===L.Completed&&this.stateTransition(L.Terminated)},t.prototype.timerM=function(){this.logger.debug("Timer M expired for INVITE client transaction ".concat(this.id,".")),this.state===L.Accepted&&this.stateTransition(L.Terminated)},t}(Y),Z=function(e){function t(t,n,r,o,i){var s=e.call(this,n,r,t.viaBranch,o,i)||this;return s._request=t,s.user=r,s}return o(t,e),Object.defineProperty(t.prototype,"request",{get:function(){return this._request},enumerable:!1,configurable:!0}),t}(G),X=function(e){function t(t,n,r){return e.call(this,t,n,r,L.Proceeding,"sip.transaction.ist")||this}return o(t,e),t.prototype.dispose=function(){this.stopProgressExtensionTimer(),this.H&&(clearTimeout(this.H),this.H=void 0),this.I&&(clearTimeout(this.I),this.I=void 0),this.L&&(clearTimeout(this.L),this.L=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"ist"},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(e){var t=this;switch(this.state){case L.Proceeding:if(e.method===m.INVITE)return void(this.lastProvisionalResponse&&this.send(this.lastProvisionalResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of provisional response.")})));break;case L.Accepted:if(e.method===m.INVITE)return;break;case L.Completed:if(e.method===m.INVITE){if(!this.lastFinalResponse)throw new Error("Last final response undefined.");return void this.send(this.lastFinalResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of final response.")}))}if(e.method===m.ACK)return void this.stateTransition(L.Confirmed);break;case L.Confirmed:if(e.method===m.INVITE||e.method===m.ACK)return;break;case L.Terminated:if(e.method===m.INVITE||e.method===m.ACK)return;break;default:throw new Error("Invalid state ".concat(this.state))}var n="INVITE server transaction received unexpected ".concat(e.method," request while in state ").concat(this.state,".");this.logger.warn(n)},t.prototype.receiveResponse=function(e,t){var n=this;if(e<100||e>699)throw new Error("Invalid status code ".concat(e));switch(this.state){case L.Proceeding:if(e>=100&&e<=199)return this.lastProvisionalResponse=t,e>100&&this.startProgressExtensionTimer(),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 1xx response.")}));if(e>=200&&e<=299)return this.lastFinalResponse=t,this.stateTransition(L.Accepted),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 2xx response.")}));if(e>=300&&e<=699)return this.lastFinalResponse=t,this.stateTransition(L.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send non-2xx final response.")}));break;case L.Accepted:if(e>=200&&e<=299)return void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send 2xx response.")}));break;case L.Completed:break;case L.Confirmed:break;case L.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var r="INVITE server transaction received unexpected ".concat(e," response from TU while in state ").concat(this.state,".");throw this.logger.error(r),new Error(r)},t.prototype.retransmitAcceptedResponse=function(){var e=this;this.state===L.Accepted&&this.lastFinalResponse&&this.send(this.lastFinalResponse).catch((function(t){e.logTransportError(t,"Failed to send 2xx response.")}))},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e)},t.prototype.typeToString=function(){return"INVITE server transaction"},t.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t.state," to ").concat(e))};switch(e){case L.Proceeding:n();break;case L.Accepted:case L.Completed:this.state!==L.Proceeding&&n();break;case L.Confirmed:this.state!==L.Completed&&n();break;case L.Terminated:this.state!==L.Accepted&&this.state!==L.Completed&&this.state!==L.Confirmed&&n();break;default:n()}this.stopProgressExtensionTimer(),e===L.Accepted&&(this.L=setTimeout((function(){return t.timerL()}),U.TIMER_L)),e===L.Completed&&(this.H=setTimeout((function(){return t.timerH()}),U.TIMER_H)),e===L.Confirmed&&(this.I=setTimeout((function(){return t.timerI()}),U.TIMER_I)),e===L.Terminated&&this.dispose(),this.setState(e)},t.prototype.startProgressExtensionTimer=function(){var e=this;void 0===this.progressExtensionTimer&&(this.progressExtensionTimer=setInterval((function(){if(e.logger.debug("Progress extension timer expired for INVITE server transaction ".concat(e.id,".")),!e.lastProvisionalResponse)throw new Error("Last provisional response undefined.");e.send(e.lastProvisionalResponse).catch((function(t){e.logTransportError(t,"Failed to send retransmission of provisional response.")}))}),U.PROVISIONAL_RESPONSE_INTERVAL))},t.prototype.stopProgressExtensionTimer=function(){void 0!==this.progressExtensionTimer&&(clearInterval(this.progressExtensionTimer),this.progressExtensionTimer=void 0)},t.prototype.timerG=function(){},t.prototype.timerH=function(){this.logger.debug("Timer H expired for INVITE server transaction ".concat(this.id,".")),this.state===L.Completed&&(this.logger.warn("ACK to negative final response was never received, terminating transaction."),this.stateTransition(L.Terminated))},t.prototype.timerI=function(){this.logger.debug("Timer I expired for INVITE server transaction ".concat(this.id,".")),this.stateTransition(L.Terminated)},t.prototype.timerL=function(){this.logger.debug("Timer L expired for INVITE server transaction ".concat(this.id,".")),this.state===L.Accepted&&this.stateTransition(L.Terminated)},t}(Z),Q=function(e){function t(t,n,r){var o=e.call(this,t,n,r,L.Trying,"sip.transaction.nict")||this;return o.F=setTimeout((function(){return o.timerF()}),U.TIMER_F),o.send(t.toString()).catch((function(e){o.logTransportError(e,"Failed to send initial outgoing request.")})),o}return o(t,e),t.prototype.dispose=function(){this.F&&(clearTimeout(this.F),this.F=void 0),this.K&&(clearTimeout(this.K),this.K=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"nict"},enumerable:!1,configurable:!0}),t.prototype.receiveResponse=function(e){var t=e.statusCode;if(!t||t<100||t>699)throw new Error("Invalid status code ".concat(t));switch(this.state){case L.Trying:if(t>=100&&t<=199)return this.stateTransition(L.Proceeding),void(this.user.receiveResponse&&this.user.receiveResponse(e));if(t>=200&&t<=699)return this.stateTransition(L.Completed),408===t?void this.onRequestTimeout():void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case L.Proceeding:if(t>=100&&t<=199&&this.user.receiveResponse)return this.user.receiveResponse(e);if(t>=200&&t<=699)return this.stateTransition(L.Completed),408===t?void this.onRequestTimeout():void(this.user.receiveResponse&&this.user.receiveResponse(e));break;case L.Completed:return;case L.Terminated:return;default:throw new Error("Invalid state ".concat(this.state))}var n="Non-INVITE client transaction received unexpected ".concat(t," response while in state ").concat(this.state,".");this.logger.warn(n)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(L.Terminated,!0)},t.prototype.typeToString=function(){return"non-INVITE client transaction"},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case L.Trying:r();break;case L.Proceeding:this.state!==L.Trying&&r();break;case L.Completed:this.state!==L.Trying&&this.state!==L.Proceeding&&r();break;case L.Terminated:this.state!==L.Trying&&this.state!==L.Proceeding&&this.state!==L.Completed&&(t||r());break;default:r()}e===L.Completed&&(this.F&&(clearTimeout(this.F),this.F=void 0),this.K=setTimeout((function(){return n.timerK()}),U.TIMER_K)),e===L.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerF=function(){this.logger.debug("Timer F expired for non-INVITE client transaction ".concat(this.id,".")),this.state!==L.Trying&&this.state!==L.Proceeding||(this.onRequestTimeout(),this.stateTransition(L.Terminated))},t.prototype.timerK=function(){this.state===L.Completed&&this.stateTransition(L.Terminated)},t}(Y),ee=function(e){function t(t,n,r){return e.call(this,t,n,r,L.Trying,"sip.transaction.nist")||this}return o(t,e),t.prototype.dispose=function(){this.J&&(clearTimeout(this.J),this.J=void 0),e.prototype.dispose.call(this)},Object.defineProperty(t.prototype,"kind",{get:function(){return"nist"},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(e){var t=this;switch(this.state){case L.Trying:break;case L.Proceeding:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of provisional response.")}));break;case L.Completed:if(!this.lastResponse)throw new Error("Last response undefined.");this.send(this.lastResponse).catch((function(e){t.logTransportError(e,"Failed to send retransmission of final response.")}));break;case L.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}},t.prototype.receiveResponse=function(e,t){var n=this;if(e<100||e>699)throw new Error("Invalid status code ".concat(e));if(e>100&&e<=199)throw new Error("Provisional response other than 100 not allowed.");switch(this.state){case L.Trying:if(this.lastResponse=t,e>=100&&e<200)return this.stateTransition(L.Proceeding),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send provisional response.")}));if(e>=200&&e<=699)return this.stateTransition(L.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send final response.")}));break;case L.Proceeding:if(this.lastResponse=t,e>=200&&e<=699)return this.stateTransition(L.Completed),void this.send(t).catch((function(e){n.logTransportError(e,"Failed to send final response.")}));break;case L.Completed:return;case L.Terminated:break;default:throw new Error("Invalid state ".concat(this.state))}var r="Non-INVITE server transaction received unexpected ".concat(e," response from TU while in state ").concat(this.state,".");throw this.logger.error(r),new Error(r)},t.prototype.onTransportError=function(e){this.user.onTransportError&&this.user.onTransportError(e),this.stateTransition(L.Terminated,!0)},t.prototype.typeToString=function(){return"non-INVITE server transaction"},t.prototype.stateTransition=function(e,t){var n=this;void 0===t&&(t=!1);var r=function(){throw new Error("Invalid state transition from ".concat(n.state," to ").concat(e))};switch(e){case L.Trying:r();break;case L.Proceeding:this.state!==L.Trying&&r();break;case L.Completed:this.state!==L.Trying&&this.state!==L.Proceeding&&r();break;case L.Terminated:this.state!==L.Proceeding&&this.state!==L.Completed&&(t||r());break;default:r()}e===L.Completed&&(this.J=setTimeout((function(){return n.timerJ()}),U.TIMER_J)),e===L.Terminated&&this.dispose(),this.setState(e)},t.prototype.timerJ=function(){this.logger.debug("Timer J expired for NON-INVITE server transaction ".concat(this.id,".")),this.state===L.Completed&&this.stateTransition(L.Terminated)},t}(Z),te=function(){function e(e,t,n,r){this.transactionConstructor=e,this.core=t,this.message=n,this.delegate=r,this.challenged=!1,this.stale=!1,this.logger=this.loggerFactory.getLogger("sip.user-agent-client"),this.init()}return e.prototype.dispose=function(){this.transaction.dispose()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.core.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transaction",{get:function(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction},enumerable:!1,configurable:!0}),e.prototype.cancel=function(t,n){var r=this;if(void 0===n&&(n={}),!this.transaction)throw new Error("Transaction undefined.");if(!this.message.to)throw new Error("To undefined.");if(!this.message.from)throw new Error("From undefined.");var o=this.core.makeOutgoingRequestMessage(m.CANCEL,this.message.ruri,this.message.from.uri,this.message.to.uri,{toTag:this.message.toTag,fromTag:this.message.fromTag,callId:this.message.callId,cseq:this.message.cseq},n.extraHeaders);return o.branch=this.message.branch,this.message.headers.Route&&(o.headers.Route=this.message.headers.Route),t&&o.setHeader("Reason",t),this.transaction.state===L.Proceeding?new e(Q,this.core,o):this.transaction.addStateChangeListener((function(){r.transaction&&r.transaction.state===L.Proceeding&&new e(Q,r.core,o)}),{once:!0}),o},e.prototype.authenticationGuard=function(e,t){var n,r,o=e.statusCode;if(!o)throw new Error("Response status code undefined.");if(401!==o&&407!==o)return!0;if(401===o?(n=e.parseHeader("www-authenticate"),r="authorization"):(n=e.parseHeader("proxy-authenticate"),r="proxy-authorization"),!n)return this.logger.warn(o+" with wrong or missing challenge, cannot authenticate"),!0;if(this.challenged&&(this.stale||!0!==n.stale))return this.logger.warn(o+" apparently in authentication loop, cannot authenticate"),!0;if(!this.credentials&&(this.credentials=this.core.configuration.authenticationFactory(),!this.credentials))return this.logger.warn("Unable to obtain credentials, cannot authenticate"),!0;if(!this.credentials.authenticate(this.message,n))return!0;this.challenged=!0,n.stale&&(this.stale=!0);var i=this.message.cseq+=1;return t&&t.localSequenceNumber&&(t.incrementLocalSequenceNumber(),i=this.message.cseq=t.localSequenceNumber),this.message.setHeader("cseq",i+" "+this.message.method),this.message.setHeader(r,this.credentials.toString()),this.init(),!1},e.prototype.onRequestTimeout=function(){this.logger.warn("User agent client request timed out. Generating internal 408 Request Timeout.");var e=new x;e.statusCode=408,e.reasonPhrase="Request Timeout",this.receiveResponse(e)},e.prototype.onTransportError=function(e){this.logger.error(e.message),this.logger.error("User agent client request transport error. Generating internal 503 Service Unavailable.");var t=new x;t.statusCode=503,t.reasonPhrase="Service Unavailable",this.receiveResponse(t)},e.prototype.receiveResponse=function(e){if(this.authenticationGuard(e)){var t=e.statusCode?e.statusCode.toString():"";if(!t)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(t):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(t):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e});break;case/^2[0-9]{2}$/.test(t):this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e});break;case/^3[0-9]{2}$/.test(t):this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(t):this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error("Invalid status code ".concat(t))}}},e.prototype.init=function(){var e=this,t={loggerFactory:this.loggerFactory,onRequestTimeout:function(){return e.onRequestTimeout()},onStateChange:function(t){t===L.Terminated&&(e.core.userAgentClients.delete(r),n===e._transaction&&e.dispose())},onTransportError:function(t){return e.onTransportError(t)},receiveResponse:function(t){return e.receiveResponse(t)}},n=new this.transactionConstructor(this.message,this.core.transport,t);this._transaction=n;var r=n.id+n.request.method;this.core.userAgentClients.set(r,this)},e}(),ne=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.BYE,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,t.dispose(),o}return o(t,e),t}(te),re=function(){function e(e,t,n,r){this.transactionConstructor=e,this.core=t,this.message=n,this.delegate=r,this.logger=this.loggerFactory.getLogger("sip.user-agent-server"),this.toTag=n.toTag?n.toTag:C(),this.init()}return e.prototype.dispose=function(){this.transaction.dispose()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.core.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transaction",{get:function(){if(!this._transaction)throw new Error("Transaction undefined.");return this._transaction},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){if(void 0===e&&(e={statusCode:200}),!this.acceptable)throw new K("".concat(this.message.method," not acceptable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<200||t>299)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.progress=function(e){if(void 0===e&&(e={statusCode:180}),!this.progressable)throw new K("".concat(this.message.method," not progressable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<101||t>199)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.redirect=function(e,t){if(void 0===t&&(t={statusCode:302}),!this.redirectable)throw new K("".concat(this.message.method," not redirectable in state ").concat(this.transaction.state,"."));var n=t.statusCode;if(n<300||n>399)throw new TypeError("Invalid statusCode: ".concat(n));var r=new Array;e.forEach((function(e){return r.push("Contact: ".concat(e.toString()))})),t.extraHeaders=(t.extraHeaders||[]).concat(r);var o=this.reply(t);return o},e.prototype.reject=function(e){if(void 0===e&&(e={statusCode:480}),!this.rejectable)throw new K("".concat(this.message.method," not rejectable in state ").concat(this.transaction.state,"."));var t=e.statusCode;if(t<400||t>699)throw new TypeError("Invalid statusCode: ".concat(t));var n=this.reply(e);return n},e.prototype.trying=function(e){if(!this.tryingable)throw new K("".concat(this.message.method," not tryingable in state ").concat(this.transaction.state,"."));var t=this.reply({statusCode:100});return t},e.prototype.receiveCancel=function(e){this.delegate&&this.delegate.onCancel&&this.delegate.onCancel(e)},Object.defineProperty(e.prototype,"acceptable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===L.Proceeding||this.transaction.state===L.Accepted;if(this.transaction instanceof ee)return this.transaction.state===L.Trying||this.transaction.state===L.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"progressable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===L.Proceeding;if(this.transaction instanceof ee)return!1;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"redirectable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===L.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===L.Trying||this.transaction.state===L.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rejectable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===L.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===L.Trying||this.transaction.state===L.Proceeding;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tryingable",{get:function(){if(this.transaction instanceof X)return this.transaction.state===L.Proceeding;if(this.transaction instanceof ee)return this.transaction.state===L.Trying;throw new Error("Unknown transaction type.")},enumerable:!1,configurable:!0}),e.prototype.reply=function(e){e.toTag||100===e.statusCode||(e.toTag=this.toTag),e.userAgent=e.userAgent||this.core.configuration.userAgentHeaderFieldValue,e.supported=e.supported||this.core.configuration.supportedOptionTagsResponse;var t=H(this.message,e);return this.transaction.receiveResponse(e.statusCode,t.message),t},e.prototype.init=function(){var e=this,t={loggerFactory:this.loggerFactory,onStateChange:function(t){t===L.Terminated&&(e.core.userAgentServers.delete(r),e.dispose())},onTransportError:function(t){e.logger.error(t.message),e.delegate&&e.delegate.onTransportError?e.delegate.onTransportError(t):e.logger.error("User agent server response transport error.")}},n=new this.transactionConstructor(this.message,this.core.transport,t);this._transaction=n;var r=n.id;this.core.userAgentServers.set(n.id,this)},e}(),oe=function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}return o(t,e),t}(re),ie=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.INFO,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te),se=function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}return o(t,e),t}(re),ae=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te),le=function(e){function t(t,n,r){return e.call(this,ee,t,n,r)||this}return o(t,e),t}(re),ce=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.NOTIFY,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te);function ue(e){return void 0!==e.userAgentCore}var de=function(e){function t(t,n,r){var o=ue(t)?t.userAgentCore:t;return e.call(this,ee,o,n,r)||this}return o(t,e),t}(re),pe=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.PRACK,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,t.signalingStateTransition(i),o}return o(t,e),t}(te),he=function(e){function t(t,n,r){var o=e.call(this,ee,t.userAgentCore,n,r)||this;return t.signalingStateTransition(n),o.dialog=t,o}return o(t,e),t.prototype.accept=function(t){return void 0===t&&(t={statusCode:200}),t.body&&this.dialog.signalingStateTransition(t.body),e.prototype.accept.call(this,t)},t}(re),fe=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.INVITE,r);return o=e.call(this,J,t.userAgentCore,i,n)||this,o.delegate=n,t.signalingStateTransition(i),t.reinviteUserAgentClient=o,o.dialog=t,o}return o(t,e),t.prototype.receiveResponse=function(e){var t=this;if(this.authenticationGuard(e,this.dialog)){var n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e});break;case/^1[0-9]{2}$/.test(n):this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:this.dialog,prack:function(e){throw new Error("Unimplemented.")}});break;case/^2[0-9]{2}$/.test(n):this.dialog.signalingStateTransition(e),this.delegate&&this.delegate.onAccept&&this.delegate.onAccept({message:e,session:this.dialog,ack:function(e){var n=t.dialog.ack(e);return n}});break;case/^3[0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e});break;case/^[4-6][0-9]{2}$/.test(n):this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentClient=void 0,this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e});break;default:throw new Error("Invalid status code ".concat(n))}}},t}(te),ge=function(e){function t(t,n,r){var o=e.call(this,X,t.userAgentCore,n,r)||this;return t.reinviteUserAgentServer=o,o.dialog=t,o}return o(t,e),t.prototype.accept=function(t){void 0===t&&(t={statusCode:200}),t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(this.dialog.routeSet.map((function(e){return"Record-Route: ".concat(e)})));var n=e.prototype.accept.call(this,t),r=this.dialog,o=i(i({},n),{session:r});return t.body&&this.dialog.signalingStateTransition(t.body),this.dialog.reConfirm(),o},t.prototype.progress=function(t){void 0===t&&(t={statusCode:180});var n=e.prototype.progress.call(this,t),r=this.dialog,o=i(i({},n),{session:r});return t.body&&this.dialog.signalingStateTransition(t.body),o},t.prototype.redirect=function(e,t){throw this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,new Error("Unimplemented.")},t.prototype.reject=function(t){return void 0===t&&(t={statusCode:488}),this.dialog.signalingStateRollback(),this.dialog.reinviteUserAgentServer=void 0,e.prototype.reject.call(this,t)},t}(re),me=function(e){function t(t,n,r){var o=t.createOutgoingRequestMessage(m.REFER,r);return e.call(this,Q,t.userAgentCore,o,n)||this}return o(t,e),t}(te);function ve(e){return void 0!==e.userAgentCore}var ye,be=function(e){function t(t,n,r){var o=ve(t)?t.userAgentCore:t;return e.call(this,ee,o,n,r)||this}return o(t,e),t}(re),we=function(e){function t(t,n,r,o){var i=e.call(this,n,r)||this;return i.initialTransaction=t,i._signalingState=j.Initial,i.ackWait=!1,i.ackProcessing=!1,i.delegate=o,t instanceof X&&(i.ackWait=!0),i.early||i.start2xxRetransmissionTimer(),i.signalingStateTransition(t.request),i.logger=n.loggerFactory.getLogger("sip.invite-dialog"),i.logger.log("INVITE dialog ".concat(i.id," constructed")),i}return o(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this),this._signalingState=j.Closed,this._offer=void 0,this._answer=void 0,this.invite2xxTimer&&(clearTimeout(this.invite2xxTimer),this.invite2xxTimer=void 0),this.logger.log("INVITE dialog ".concat(this.id," destroyed"))},Object.defineProperty(t.prototype,"sessionState",{get:function(){return this.early?M.Early:this.ackWait?M.AckWait:this._signalingState===j.Closed?M.Terminated:M.Confirmed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"signalingState",{get:function(){return this._signalingState},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offer",{get:function(){return this._offer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"answer",{get:function(){return this._answer},enumerable:!1,configurable:!0}),t.prototype.confirm=function(){this.early&&this.start2xxRetransmissionTimer(),e.prototype.confirm.call(this)},t.prototype.reConfirm=function(){this.reinviteUserAgentServer&&this.startReInvite2xxRetransmissionTimer()},t.prototype.ack=function(e){var t;if(void 0===e&&(e={}),this.logger.log("INVITE dialog ".concat(this.id," sending ACK request")),this.reinviteUserAgentClient){if(!(this.reinviteUserAgentClient.transaction instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");t=this.reinviteUserAgentClient.transaction,this.reinviteUserAgentClient=void 0}else{if(!(this.initialTransaction instanceof J))throw new Error("Initial transaction not instance of InviteClientTransaction.");t=this.initialTransaction}var n=this.createOutgoingRequestMessage(m.ACK,{cseq:t.request.cseq,extraHeaders:e.extraHeaders,body:e.body});return t.ackResponse(n),this.signalingStateTransition(n),{message:n}},t.prototype.bye=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending BYE request")),this.initialTransaction instanceof X){if(this.early)throw new Error("UAS MUST NOT send a BYE on early dialogs.");if(this.ackWait&&this.initialTransaction.state!==L.Terminated)throw new Error("UAS MUST NOT send a BYE on a confirmed dialog until it has received an ACK for its 2xx response or until the server transaction times out.")}return new ne(this,e,t)},t.prototype.info=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending INFO request")),this.early)throw new Error("Dialog not confirmed.");return new ie(this,e,t)},t.prototype.invite=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending INVITE request")),this.early)throw new Error("Dialog not confirmed.");if(this.reinviteUserAgentClient)throw new Error("There is an ongoing re-INVITE client transaction.");if(this.reinviteUserAgentServer)throw new Error("There is an ongoing re-INVITE server transaction.");return new fe(this,e,t)},t.prototype.message=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending MESSAGE request")),this.early)throw new Error("Dialog not confirmed.");var n=this.createOutgoingRequestMessage(m.MESSAGE,t);return new ae(this.core,n,e)},t.prototype.notify=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending NOTIFY request")),this.early)throw new Error("Dialog not confirmed.");return new ce(this,e,t)},t.prototype.prack=function(e,t){return this.logger.log("INVITE dialog ".concat(this.id," sending PRACK request")),new pe(this,e,t)},t.prototype.refer=function(e,t){if(this.logger.log("INVITE dialog ".concat(this.id," sending REFER request")),this.early)throw new Error("Dialog not confirmed.");return new me(this,e,t)},t.prototype.receiveRequest=function(t){var n=this;if(this.logger.log("INVITE dialog ".concat(this.id," received ").concat(t.method," request")),t.method!==m.ACK)if(this.sequenceGuard(t)){if(e.prototype.receiveRequest.call(this,t),t.method===m.INVITE){var r=function(){var e=n.ackWait?"waiting for initial ACK":"processing initial ACK";n.logger.warn("INVITE dialog ".concat(n.id," received re-INVITE while ").concat(e));var t="RFC 5407 suggests the following to avoid this race condition... ";t+=" Note: Implementation issues are outside the scope of this document,",t+=" but the following tip is provided for avoiding race conditions of",t+=" this type. The caller can delay sending re-INVITE F6 for some period",t+=" of time (2 seconds, perhaps), after which the caller can reasonably",t+=" assume that its ACK has been received. Implementors can decouple the",t+=" actions of the user (e.g., pressing the hold button) from the actions",t+=" of the protocol (the sending of re-INVITE F6), so that the UA can",t+=" behave like this. In this case, it is the implementor's choice as to",t+=" how long to wait. In most cases, such an implementation may be",t+=" useful to prevent the type of race condition shown in this section.",t+=" This document expresses no preference about whether or not they",t+=" should wait for an ACK to be delivered. After considering the impact",t+=" on user experience, implementors should decide whether or not to wait",t+=" for a while, because the user experience depends on the",t+=" implementation and has no direct bearing on protocol behavior.",n.logger.warn(t)},o=Math.floor(10*Math.random())+1,i=["Retry-After: ".concat(o)];if(this.ackProcessing)return this.core.replyStateless(t,{statusCode:500,extraHeaders:i}),void r();if(this.ackWait&&this.signalingState!==j.Stable)return this.core.replyStateless(t,{statusCode:500,extraHeaders:i}),void r();if(this.reinviteUserAgentServer)return void this.core.replyStateless(t,{statusCode:500,extraHeaders:i});if(this.reinviteUserAgentClient)return void this.core.replyStateless(t,{statusCode:491})}if(t.method===m.INVITE){var s=t.parseHeader("contact");if(!s)throw new Error("Contact undefined.");if(!(s instanceof u))throw new Error("Contact not instance of NameAddrHeader.");this.dialogState.remoteTarget=s.uri}switch(t.method){case m.BYE:var a=new oe(this,t);this.delegate&&this.delegate.onBye?this.delegate.onBye(a):a.accept(),this.dispose();break;case m.INFO:a=new se(this,t);this.delegate&&this.delegate.onInfo?this.delegate.onInfo(a):a.reject({statusCode:469,extraHeaders:["Recv-Info:"]});break;case m.INVITE:a=new ge(this,t);this.signalingStateTransition(t),this.delegate&&this.delegate.onInvite?this.delegate.onInvite(a):a.reject({statusCode:488});break;case m.MESSAGE:a=new le(this.core,t);this.delegate&&this.delegate.onMessage?this.delegate.onMessage(a):a.accept();break;case m.NOTIFY:a=new de(this,t);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(a):a.accept();break;case m.PRACK:a=new he(this,t);this.delegate&&this.delegate.onPrack?this.delegate.onPrack(a):a.accept();break;case m.REFER:a=new be(this,t);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(a):a.reject();break;default:this.logger.log("INVITE dialog ".concat(this.id," received unimplemented ").concat(t.method," request")),this.core.replyStateless(t,{statusCode:501});break}}else this.logger.log("INVITE dialog ".concat(this.id," rejected out of order ").concat(t.method," request."));else{if(this.ackWait){if(this.initialTransaction instanceof J)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));if(this.initialTransaction.request.cseq!==t.cseq)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));this.ackWait=!1}else{if(!this.reinviteUserAgentServer)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));if(this.reinviteUserAgentServer.transaction.request.cseq!==t.cseq)return void this.logger.warn("INVITE dialog ".concat(this.id," received unexpected ").concat(t.method," request, dropping."));this.reinviteUserAgentServer=void 0}if(this.signalingStateTransition(t),this.delegate&&this.delegate.onAck){var l=this.delegate.onAck({message:t});l instanceof Promise&&(this.ackProcessing=!0,l.then((function(){return n.ackProcessing=!1})).catch((function(){return n.ackProcessing=!1})))}}},t.prototype.reliableSequenceGuard=function(e){var t=e.statusCode;if(!t)throw new Error("Status code undefined");if(t>100&&t<200){var n=e.getHeader("require"),r=e.getHeader("rseq"),o=n&&n.includes("100rel")&&r?Number(r):void 0;if(o){if(this.rseq&&this.rseq+1!==o)return!1;this.rseq=this.rseq?this.rseq+1:o}}return!0},t.prototype.signalingStateRollback=function(){this._signalingState!==j.HaveLocalOffer&&this.signalingState!==j.HaveRemoteOffer||this._rollbackOffer&&this._rollbackAnswer&&(this._signalingState=j.Stable,this._offer=this._rollbackOffer,this._answer=this._rollbackAnswer)},t.prototype.signalingStateTransition=function(e){var t=O(e);if(t&&"session"===t.contentDisposition){if(this._signalingState===j.Stable&&(this._rollbackOffer=this._offer,this._rollbackAnswer=this._answer),e instanceof k)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:this._signalingState=j.Stable,this._answer=t;break;case j.HaveRemoteOffer:break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof x)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveRemoteOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:this._signalingState=j.Stable,this._answer=t;break;case j.HaveRemoteOffer:break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(e instanceof N)switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:break;case j.HaveRemoteOffer:this._signalingState=j.Stable,this._answer=t;break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}if(_(e))switch(this._signalingState){case j.Initial:case j.Stable:this._signalingState=j.HaveLocalOffer,this._offer=t,this._answer=void 0;break;case j.HaveLocalOffer:break;case j.HaveRemoteOffer:this._signalingState=j.Stable,this._answer=t;break;case j.Closed:break;default:throw new Error("Unexpected signaling state.")}}},t.prototype.start2xxRetransmissionTimer=function(){var e=this;if(this.initialTransaction instanceof X){var t=this.initialTransaction,n=U.T1,r=function(){e.ackWait?(e.logger.log("No ACK for 2xx response received, attempting retransmission"),t.retransmitAcceptedResponse(),n=Math.min(2*n,U.T2),e.invite2xxTimer=setTimeout(r,n)):e.invite2xxTimer=void 0};this.invite2xxTimer=setTimeout(r,n);var o=function(){t.state===L.Terminated&&(t.removeStateChangeListener(o),e.invite2xxTimer&&(clearTimeout(e.invite2xxTimer),e.invite2xxTimer=void 0),e.ackWait&&(e.delegate&&e.delegate.onAckTimeout?e.delegate.onAckTimeout():e.bye()))};t.addStateChangeListener(o)}},t.prototype.startReInvite2xxRetransmissionTimer=function(){var e=this;if(this.reinviteUserAgentServer&&this.reinviteUserAgentServer.transaction instanceof X){var t=this.reinviteUserAgentServer.transaction,n=U.T1,r=function(){e.reinviteUserAgentServer?(e.logger.log("No ACK for 2xx response received, attempting retransmission"),t.retransmitAcceptedResponse(),n=Math.min(2*n,U.T2),e.invite2xxTimer=setTimeout(r,n)):e.invite2xxTimer=void 0};this.invite2xxTimer=setTimeout(r,n);var o=function(){t.state===L.Terminated&&(t.removeStateChangeListener(o),e.invite2xxTimer&&(clearTimeout(e.invite2xxTimer),e.invite2xxTimer=void 0),e.reinviteUserAgentServer)};t.addStateChangeListener(o)}},t}(V);(function(e){e["Initial"]="Initial",e["NotifyWait"]="NotifyWait",e["Pending"]="Pending",e["Active"]="Active",e["Terminated"]="Terminated"})(ye||(ye={}));var Ce,Se=[m.ACK,m.BYE,m.CANCEL,m.INFO,m.INVITE,m.MESSAGE,m.NOTIFY,m.OPTIONS,m.PRACK,m.REFER,m.REGISTER,m.SUBSCRIBE],Ee=function(e){function t(t,n,r){var o=this,i=t.createOutgoingRequestMessage(m.SUBSCRIBE,r);return o=e.call(this,Q,t.userAgentCore,i,n)||this,o.dialog=t,o}return o(t,e),t.prototype.waitNotifyStop=function(){},t.prototype.receiveResponse=function(t){if(t.statusCode&&t.statusCode>=200&&t.statusCode<300){var n=t.getHeader("Expires");if(n){var r=Number(n);this.dialog.subscriptionExpires>r&&(this.dialog.subscriptionExpires=r)}else this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE")}if(t.statusCode&&t.statusCode>=400&&t.statusCode<700){var o=[404,405,410,416,480,481,482,483,484,485,489,501,604];o.includes(t.statusCode)&&this.dialog.terminate()}e.prototype.receiveResponse.call(this,t)},t}(te),Te=function(e){function t(t,n,r,o,i,s){var a=e.call(this,o,i)||this;return a.delegate=s,a._autoRefresh=!1,a._subscriptionEvent=t,a._subscriptionExpires=n,a._subscriptionExpiresInitial=n,a._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),a._subscriptionRefresh=void 0,a._subscriptionRefreshLastSet=void 0,a._subscriptionState=r,a.logger=o.loggerFactory.getLogger("sip.subscribe-dialog"),a.logger.log("SUBSCRIBE dialog ".concat(a.id," constructed")),a}return o(t,e),t.initialDialogStateForSubscription=function(e,t){var n=!1,r=t.getHeaders("record-route"),o=t.parseHeader("contact");if(!o)throw new Error("Contact undefined.");if(!(o instanceof u))throw new Error("Contact not instance of NameAddrHeader.");var i=o.uri,s=e.cseq,a=void 0,l=e.callId,c=e.fromTag,d=t.fromTag;if(!l)throw new Error("Call id undefined.");if(!c)throw new Error("From tag undefined.");if(!d)throw new Error("To tag undefined.");if(!e.from)throw new Error("From undefined.");if(!e.to)throw new Error("To undefined.");var p=e.from.uri,h=e.to.uri,f=!1,g={id:l+c+d,early:f,callId:l,localTag:c,remoteTag:d,localSequenceNumber:s,remoteSequenceNumber:a,localURI:p,remoteURI:h,remoteTarget:i,routeSet:r,secure:n};return g},t.prototype.dispose=function(){e.prototype.dispose.call(this),this.N&&(clearTimeout(this.N),this.N=void 0),this.refreshTimerClear(),this.logger.log("SUBSCRIBE dialog ".concat(this.id," destroyed"))},Object.defineProperty(t.prototype,"autoRefresh",{get:function(){return this._autoRefresh},set:function(e){this._autoRefresh=!0,this.refreshTimerSet()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionEvent",{get:function(){return this._subscriptionEvent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionExpires",{get:function(){var e=Math.floor(Date.now()/1e3)-this._subscriptionExpiresLastSet,t=this._subscriptionExpires-e;return Math.max(t,0)},set:function(e){if(e<0)throw new Error("Expires must be greater than or equal to zero.");if(this._subscriptionExpires=e,this._subscriptionExpiresLastSet=Math.floor(Date.now()/1e3),this.autoRefresh){var t=this.subscriptionRefresh;(void 0===t||t>=e)&&this.refreshTimerSet()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionExpiresInitial",{get:function(){return this._subscriptionExpiresInitial},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionRefresh",{get:function(){if(void 0!==this._subscriptionRefresh&&void 0!==this._subscriptionRefreshLastSet){var e=Math.floor(Date.now()/1e3)-this._subscriptionRefreshLastSet,t=this._subscriptionRefresh-e;return Math.max(t,0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"subscriptionState",{get:function(){return this._subscriptionState},enumerable:!1,configurable:!0}),t.prototype.receiveRequest=function(t){if(this.logger.log("SUBSCRIBE dialog ".concat(this.id," received ").concat(t.method," request")),this.sequenceGuard(t))switch(e.prototype.receiveRequest.call(this,t),t.method){case m.NOTIFY:this.onNotify(t);break;default:this.logger.log("SUBSCRIBE dialog ".concat(this.id," received unimplemented ").concat(t.method," request")),this.core.replyStateless(t,{statusCode:501});break}else this.logger.log("SUBSCRIBE dialog ".concat(this.id," rejected out of order ").concat(t.method," request."))},t.prototype.refresh=function(){var e="Allow: "+Se.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: "+this.subscriptionExpiresInitial),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)},t.prototype.subscribe=function(e,t){var n=this;if(void 0===t&&(t={}),this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)throw new Error("Invalid state ".concat(this.subscriptionState,'. May only re-subscribe while in state "pending" or "active".'));this.logger.log("SUBSCRIBE dialog ".concat(this.id," sending SUBSCRIBE request"));var r=new Ee(this,e,t);return this.N&&(clearTimeout(this.N),this.N=void 0),this.N=setTimeout((function(){return n.timerN()}),U.TIMER_N),r},t.prototype.terminate=function(){this.stateTransition(ye.Terminated),this.onTerminated()},t.prototype.unsubscribe=function(){var e="Allow: "+Se.toString(),t={};return t.extraHeaders=(t.extraHeaders||[]).slice(),t.extraHeaders.push(e),t.extraHeaders.push("Event: "+this.subscriptionEvent),t.extraHeaders.push("Expires: 0"),t.extraHeaders.push("Contact: "+this.core.configuration.contact.toString()),this.subscribe(void 0,t)},t.prototype.onNotify=function(e){var t=e.parseHeader("Event").event;if(t&&t===this.subscriptionEvent){this.N&&(clearTimeout(this.N),this.N=void 0);var n=e.parseHeader("Subscription-State");if(n&&n.state){var r=n.state,o=n.expires?Math.max(n.expires,0):void 0;switch(r){case"pending":this.stateTransition(ye.Pending,o);break;case"active":this.stateTransition(ye.Active,o);break;case"terminated":this.stateTransition(ye.Terminated,o);break;default:this.logger.warn("Unrecognized subscription state.");break}var i=new de(this,e);this.delegate&&this.delegate.onNotify?this.delegate.onNotify(i):i.accept()}else this.core.replyStateless(e,{statusCode:489})}else this.core.replyStateless(e,{statusCode:489})},t.prototype.onRefresh=function(e){this.delegate&&this.delegate.onRefresh&&this.delegate.onRefresh(e)},t.prototype.onTerminated=function(){this.delegate&&this.delegate.onTerminated&&this.delegate.onTerminated()},t.prototype.refreshTimerClear=function(){this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=void 0)},t.prototype.refreshTimerSet=function(){var e=this;if(this.refreshTimerClear(),this.autoRefresh&&this.subscriptionExpires>0){var t=900*this.subscriptionExpires;this._subscriptionRefresh=Math.floor(t/1e3),this._subscriptionRefreshLastSet=Math.floor(Date.now()/1e3),this.refreshTimer=setTimeout((function(){e.refreshTimer=void 0,e._subscriptionRefresh=void 0,e._subscriptionRefreshLastSet=void 0,e.onRefresh(e.refresh())}),t)}},t.prototype.stateTransition=function(e,t){var n=this,r=function(){n.logger.warn("Invalid subscription state transition from ".concat(n.subscriptionState," to ").concat(e))};switch(e){case ye.Initial:return void r();case ye.NotifyWait:return void r();case ye.Pending:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending)return void r();break;case ye.Active:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)return void r();break;case ye.Terminated:if(this.subscriptionState!==ye.NotifyWait&&this.subscriptionState!==ye.Pending&&this.subscriptionState!==ye.Active)return void r();break;default:return void r()}e===ye.Pending&&t&&(this.subscriptionExpires=t),e===ye.Active&&t&&(this.subscriptionExpires=t),e===ye.Terminated&&this.dispose(),this._subscriptionState=e},t.prototype.timerN=function(){this.logger.warn("Timer N expired for SUBSCRIBE dialog. Timed out waiting for NOTIFY."),this.subscriptionState!==ye.Terminated&&(this.stateTransition(ye.Terminated),this.onTerminated())},t}(V);(function(e){e[e["error"]=0]="error",e[e["warn"]=1]="warn",e[e["log"]=2]="log",e[e["debug"]=3]="debug"})(Ce||(Ce={}));var ke=function(){function e(e,t,n){this.logger=e,this.category=t,this.label=n}return e.prototype.error=function(e){this.genericLog(Ce.error,e)},e.prototype.warn=function(e){this.genericLog(Ce.warn,e)},e.prototype.log=function(e){this.genericLog(Ce.log,e)},e.prototype.debug=function(e){this.genericLog(Ce.debug,e)},e.prototype.genericLog=function(e,t){this.logger.genericLog(e,this.category,this.label,t)},Object.defineProperty(e.prototype,"level",{get:function(){return this.logger.level},set:function(e){this.logger.level=e},enumerable:!1,configurable:!0}),e}(),xe=function(){function e(){this.builtinEnabled=!0,this._level=Ce.log,this.loggers={},this.logger=this.getLogger("sip:loggerfactory")}return Object.defineProperty(e.prototype,"level",{get:function(){return this._level},set:function(e){e>=0&&e<=3?this._level=e:e>3?this._level=3:Ce.hasOwnProperty(e)?this._level=e:this.logger.error("invalid 'level' parameter value: "+JSON.stringify(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"connector",{get:function(){return this._connector},set:function(e){e?"function"===typeof e?this._connector=e:this.logger.error("invalid 'connector' parameter value: "+JSON.stringify(e)):this._connector=void 0},enumerable:!1,configurable:!0}),e.prototype.getLogger=function(e,t){if(t&&3===this.level)return new ke(this,e,t);if(this.loggers[e])return this.loggers[e];var n=new ke(this,e);return this.loggers[e]=n,n},e.prototype.genericLog=function(e,t,n,r){this.level>=e&&this.builtinEnabled&&this.print(e,t,n,r),this.connector&&this.connector(Ce[e],t,n,r)},e.prototype.print=function(e,t,n,r){if("string"===typeof r){var o=[new Date,t];n&&o.push(n),r=o.concat(r).join(" | ")}switch(e){case Ce.error:console.error(r);break;case Ce.warn:console.warn(r);break;case Ce.log:console.log(r);break;case Ce.debug:console.debug(r);break}},e}();(function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}o(t,e)})(te);var Ne=function(e){function t(t,n,r){var o=e.call(this,J,t,n,r)||this;return o.confirmedDialogAcks=new Map,o.confirmedDialogs=new Map,o.earlyDialogs=new Map,o.delegate=r,o}return o(t,e),t.prototype.dispose=function(){this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),e.prototype.dispose.call(this)},t.prototype.onTransportError=function(t){if(this.transaction.state===L.Calling)return e.prototype.onTransportError.call(this,t);this.logger.error(t.message),this.logger.error("User agent client request transport error while sending ACK.")},t.prototype.receiveResponse=function(e){var t=this;if(this.authenticationGuard(e)){var n=e.statusCode?e.statusCode.toString():"";if(!n)throw new Error("Response status code undefined.");switch(!0){case/^100$/.test(n):return void(this.delegate&&this.delegate.onTrying&&this.delegate.onTrying({message:e}));case/^1[0-9]{2}$/.test(n):if(!e.toTag)return void this.logger.warn("Non-100 1xx INVITE response received without a to tag, dropping.");var r=e.parseHeader("contact");if(!r)return void this.logger.error("Non-100 1xx INVITE response received without a Contact header field, dropping.");var o=V.initialDialogStateForUserAgentClient(this.message,e),i=this.earlyDialogs.get(o.id);if(!i){var s=this.transaction;if(!(s instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");i=new we(s,this.core,o),this.earlyDialogs.set(i.id,i)}if(!i.reliableSequenceGuard(e))return void this.logger.warn("1xx INVITE reliable response received out of order or is a retransmission, dropping.");i.signalingState!==j.Initial&&i.signalingState!==j.HaveLocalOffer||i.signalingStateTransition(e);var a=i;return void(this.delegate&&this.delegate.onProgress&&this.delegate.onProgress({message:e,session:a,prack:function(e){var t=a.prack(void 0,e);return t}}));case/^2[0-9]{2}$/.test(n):if(!e.toTag)return void this.logger.error("2xx INVITE response received without a to tag, dropping.");r=e.parseHeader("contact");if(!r)return void this.logger.error("2xx INVITE response received without a Contact header field, dropping.");o=V.initialDialogStateForUserAgentClient(this.message,e);var l=this.confirmedDialogs.get(o.id);if(l){var c=this.confirmedDialogAcks.get(o.id);if(c){s=this.transaction;if(!(s instanceof J))throw new Error("Client transaction not instance of InviteClientTransaction.");s.ackResponse(c.message)}return}if(l=this.earlyDialogs.get(o.id),l)l.confirm(),l.recomputeRouteSet(e),this.earlyDialogs.delete(l.id),this.confirmedDialogs.set(l.id,l);else{s=this.transaction;if(!(s instanceof J))throw new Error("Transaction not instance of InviteClientTransaction.");l=new we(s,this.core,o),this.confirmedDialogs.set(l.id,l)}l.signalingState!==j.Initial&&l.signalingState!==j.HaveLocalOffer||l.signalingStateTransition(e);var u=l;if(this.delegate&&this.delegate.onAccept)this.delegate.onAccept({message:e,session:u,ack:function(e){var n=u.ack(e);return t.confirmedDialogAcks.set(u.id,n),n}});else{c=u.ack();this.confirmedDialogAcks.set(u.id,c)}return;case/^3[0-9]{2}$/.test(n):return this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),void(this.delegate&&this.delegate.onRedirect&&this.delegate.onRedirect({message:e}));case/^[4-6][0-9]{2}$/.test(n):return this.earlyDialogs.forEach((function(e){return e.dispose()})),this.earlyDialogs.clear(),void(this.delegate&&this.delegate.onReject&&this.delegate.onReject({message:e}));default:throw new Error("Invalid status code ".concat(n))}}},t}(te),Re=function(e){function t(t,n,r){var o=e.call(this,X,t,n,r)||this;return o.core=t,o}return o(t,e),t.prototype.dispose=function(){this.earlyDialog&&this.earlyDialog.dispose(),e.prototype.dispose.call(this)},t.prototype.accept=function(t){if(void 0===t&&(t={statusCode:200}),!this.acceptable)throw new K("".concat(this.message.method," not acceptable in state ").concat(this.transaction.state,"."));if(!this.confirmedDialog)if(this.earlyDialog)this.earlyDialog.confirm(),this.confirmedDialog=this.earlyDialog,this.earlyDialog=void 0;else{var n=this.transaction;if(!(n instanceof X))throw new Error("Transaction not instance of InviteClientTransaction.");var r=V.initialDialogStateForUserAgentServer(this.message,this.toTag);this.confirmedDialog=new we(n,this.core,r)}var o=this.message.getHeaders("record-route").map((function(e){return"Record-Route: ".concat(e)})),s="Contact: ".concat(this.core.configuration.contact.toString()),a="Allow: "+Se.toString();if(!t.body)if(this.confirmedDialog.signalingState===j.Stable)t.body=this.confirmedDialog.answer;else if(this.confirmedDialog.signalingState===j.Initial||this.confirmedDialog.signalingState===j.HaveRemoteOffer)throw new Error("Response must have a body.");t.statusCode=t.statusCode||200,t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(o),t.extraHeaders.push(a),t.extraHeaders.push(s);var l=e.prototype.accept.call(this,t),c=this.confirmedDialog,u=i(i({},l),{session:c});return t.body&&this.confirmedDialog.signalingState!==j.Stable&&this.confirmedDialog.signalingStateTransition(t.body),u},t.prototype.progress=function(t){if(void 0===t&&(t={statusCode:180}),!this.progressable)throw new K("".concat(this.message.method," not progressable in state ").concat(this.transaction.state,"."));if(!this.earlyDialog){var n=this.transaction;if(!(n instanceof X))throw new Error("Transaction not instance of InviteClientTransaction.");var r=V.initialDialogStateForUserAgentServer(this.message,this.toTag,!0);this.earlyDialog=new we(n,this.core,r)}var o=this.message.getHeaders("record-route").map((function(e){return"Record-Route: ".concat(e)})),s="Contact: ".concat(this.core.configuration.contact);t.extraHeaders=t.extraHeaders||[],t.extraHeaders=t.extraHeaders.concat(o),t.extraHeaders.push(s);var a=e.prototype.progress.call(this,t),l=this.earlyDialog,c=i(i({},a),{session:l});return t.body&&this.earlyDialog.signalingState!==j.Stable&&this.earlyDialog.signalingStateTransition(t.body),c},t.prototype.redirect=function(t,n){return void 0===n&&(n={statusCode:302}),e.prototype.redirect.call(this,t,n)},t.prototype.reject=function(t){return void 0===t&&(t={statusCode:486}),e.prototype.reject.call(this,t)},t}(re),Ie=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te);(function(e){function t(t,n,r){return e.call(this,ee,t.userAgentCore,n,r)||this}o(t,e)})(re);var _e,Oe=function(e){function t(t,n,r){return e.call(this,Q,t,n,r)||this}return o(t,e),t}(te),Ae=function(e){function t(t,n,r){var o=e.call(this,ee,t,n,r)||this;return o.core=t,o}return o(t,e),t}(re),Be=function(e){function t(t,n,r){var o=this,i=n.getHeader("Event");if(!i)throw new Error("Event undefined");var s=n.getHeader("Expires");if(!s)throw new Error("Expires undefined");return o=e.call(this,Q,t,n,r)||this,o.delegate=r,o.subscriberId=n.callId+n.fromTag+i,o.subscriptionExpiresRequested=o.subscriptionExpires=Number(s),o.subscriptionEvent=i,o.subscriptionState=ye.NotifyWait,o.waitNotifyStart(),o}return o(t,e),t.prototype.dispose=function(){e.prototype.dispose.call(this)},t.prototype.onNotify=function(e){var t=e.message.parseHeader("Event").event;if(!t||t!==this.subscriptionEvent)return this.logger.warn("Failed to parse event."),void e.reject({statusCode:489});var n=e.message.parseHeader("Subscription-State");if(!n||!n.state)return this.logger.warn("Failed to parse subscription state."),void e.reject({statusCode:489});var r=n.state;switch(r){case"pending":break;case"active":break;case"terminated":break;default:return this.logger.warn("Invalid subscription state ".concat(r)),void e.reject({statusCode:489})}if("terminated"!==r){var o=e.message.parseHeader("contact");if(!o)return this.logger.warn("Failed to parse contact."),void e.reject({statusCode:489})}if(this.dialog)throw new Error("Dialog already created. This implementation only supports install of single subscriptions.");switch(this.waitNotifyStop(),this.subscriptionExpires=n.expires?Math.min(this.subscriptionExpires,Math.max(n.expires,0)):this.subscriptionExpires,r){case"pending":this.subscriptionState=ye.Pending;break;case"active":this.subscriptionState=ye.Active;break;case"terminated":this.subscriptionState=ye.Terminated;break;default:throw new Error("Unrecognized state ".concat(r,"."))}if(this.subscriptionState!==ye.Terminated){var i=Te.initialDialogStateForSubscription(this.message,e.message);this.dialog=new Te(this.subscriptionEvent,this.subscriptionExpires,this.subscriptionState,this.core,i)}if(this.delegate&&this.delegate.onNotify){var s=e,a=this.dialog;this.delegate.onNotify({request:s,subscription:a})}else e.accept()},t.prototype.waitNotifyStart=function(){var e=this;this.N||(this.core.subscribers.set(this.subscriberId,this),this.N=setTimeout((function(){return e.timerN()}),U.TIMER_N))},t.prototype.waitNotifyStop=function(){this.N&&(this.core.subscribers.delete(this.subscriberId),clearTimeout(this.N),this.N=void 0)},t.prototype.receiveResponse=function(t){if(this.authenticationGuard(t)){if(t.statusCode&&t.statusCode>=200&&t.statusCode<300){var n=t.getHeader("Expires");if(n){var r=Number(n);r>this.subscriptionExpiresRequested&&this.logger.warn("Expires header in a 200-class response to SUBSCRIBE with a higher value than the one in the request"),r<this.subscriptionExpires&&(this.subscriptionExpires=r)}else this.logger.warn("Expires header missing in a 200-class response to SUBSCRIBE");this.dialog&&this.dialog.subscriptionExpires>this.subscriptionExpires&&(this.dialog.subscriptionExpires=this.subscriptionExpires)}t.statusCode&&t.statusCode>=300&&t.statusCode<700&&this.waitNotifyStop(),e.prototype.receiveResponse.call(this,t)}},t.prototype.timerN=function(){this.logger.warn("Timer N expired for SUBSCRIBE user agent client. Timed out waiting for NOTIFY."),this.waitNotifyStop(),this.delegate&&this.delegate.onNotifyTimeout&&this.delegate.onNotifyTimeout()},t}(te),De=function(e){function t(t,n,r){var o=e.call(this,ee,t,n,r)||this;return o.core=t,o}return o(t,e),t}(re),Pe=["application/sdp","application/dtmf-relay"],He=function(){function e(e,t){void 0===t&&(t={}),this.userAgentClients=new Map,this.userAgentServers=new Map,this.configuration=e,this.delegate=t,this.dialogs=new Map,this.subscribers=new Map,this.logger=e.loggerFactory.getLogger("sip.user-agent-core")}return e.prototype.dispose=function(){this.reset()},e.prototype.reset=function(){this.dialogs.forEach((function(e){return e.dispose()})),this.dialogs.clear(),this.subscribers.forEach((function(e){return e.dispose()})),this.subscribers.clear(),this.userAgentClients.forEach((function(e){return e.dispose()})),this.userAgentClients.clear(),this.userAgentServers.forEach((function(e){return e.dispose()})),this.userAgentServers.clear()},Object.defineProperty(e.prototype,"loggerFactory",{get:function(){return this.configuration.loggerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){var e=this.configuration.transportAccessor();if(!e)throw new Error("Transport undefined.");return e},enumerable:!1,configurable:!0}),e.prototype.invite=function(e,t){return new Ne(this,e,t)},e.prototype.message=function(e,t){return new ae(this,e,t)},e.prototype.publish=function(e,t){return new Ie(this,e,t)},e.prototype.register=function(e,t){return new Oe(this,e,t)},e.prototype.subscribe=function(e,t){return new Be(this,e,t)},e.prototype.request=function(e,t){return new te(Q,this,e,t)},e.prototype.makeOutgoingRequestMessage=function(e,t,n,r,o,s,a){var l=this.configuration.sipjsId,c=this.configuration.displayName,u=this.configuration.viaForceRport,d=this.configuration.hackViaTcp,p=this.configuration.supportedOptionTags.slice();e===m.REGISTER&&p.push("path","gruu"),e===m.INVITE&&(this.configuration.contact.pubGruu||this.configuration.contact.tempGruu)&&p.push("gruu");var h=this.configuration.routeSet,f=this.configuration.userAgentHeaderFieldValue,g=this.configuration.viaHost,v={callIdPrefix:l,forceRport:u,fromDisplayName:c,hackViaTcp:d,optionTags:p,routeSet:h,userAgentString:f,viaHost:g},y=i(i({},v),o);return new N(e,t,n,r,y,s,a)},e.prototype.receiveIncomingRequestFromTransport=function(e){this.receiveRequestFromTransport(e)},e.prototype.receiveIncomingResponseFromTransport=function(e){this.receiveResponseFromTransport(e)},e.prototype.replyStateless=function(e,t){var n=this,r=this.configuration.userAgentHeaderFieldValue,o=this.configuration.supportedOptionTagsResponse;t=i(i({},t),{userAgent:r,supported:o});var s=H(e,t);return this.transport.send(s.message).catch((function(t){t instanceof Error&&n.logger.error(t.message),n.logger.error("Transport error occurred sending stateless reply to ".concat(e.method," request."))})),s},e.prototype.receiveRequestFromTransport=function(e){var t=e.viaBranch,n=this.userAgentServers.get(t);e.method===m.ACK&&n&&n.transaction.state===L.Accepted&&n instanceof Re?this.logger.warn("Discarding out of dialog ACK after 2xx response sent on transaction ".concat(t,".")):e.method!==m.CANCEL?n?n.transaction.receiveRequest(e):this.receiveRequest(e):n?(this.replyStateless(e,{statusCode:200}),n.transaction instanceof X&&n.transaction.state===L.Proceeding&&n instanceof Re&&n.receiveCancel(e)):this.replyStateless(e,{statusCode:481})},e.prototype.receiveRequest=function(e){if(Se.includes(e.method)){if(!e.ruri)throw new Error("Request-URI undefined.");if("sip"===e.ruri.scheme){var t=e.ruri,n=function(e){return!!e&&e.user===t.user};if(!n(this.configuration.aor)&&!(n(this.configuration.contact.uri)||n(this.configuration.contact.pubGruu)||n(this.configuration.contact.tempGruu)))return this.logger.warn("Request-URI does not point to us."),void(e.method!==m.ACK&&this.replyStateless(e,{statusCode:404}));if(e.method!==m.INVITE||e.hasHeader("Contact")){if(!e.toTag){var r=e.viaBranch;if(!this.userAgentServers.has(r)){var o=Array.from(this.userAgentServers.values()).some((function(t){return t.transaction.request.fromTag===e.fromTag&&t.transaction.request.callId===e.callId&&t.transaction.request.cseq===e.cseq}));if(o)return void this.replyStateless(e,{statusCode:482})}}e.toTag?this.receiveInsideDialogRequest(e):this.receiveOutsideDialogRequest(e)}else this.replyStateless(e,{statusCode:400,reasonPhrase:"Missing Contact Header"})}else this.replyStateless(e,{statusCode:416})}else{var i="Allow: "+Se.toString();this.replyStateless(e,{statusCode:405,extraHeaders:[i]})}},e.prototype.receiveInsideDialogRequest=function(e){if(e.method===m.NOTIFY){var t=e.parseHeader("Event");if(!t||!t.event)return void this.replyStateless(e,{statusCode:489});var n=e.callId+e.toTag+t.event,r=this.subscribers.get(n);if(r){var o=new de(this,e);return void r.onNotify(o)}}var i=e.callId+e.toTag+e.fromTag,s=this.dialogs.get(i);if(s){if(e.method===m.OPTIONS){var a="Allow: "+Se.toString(),l="Accept: "+Pe.toString();return void this.replyStateless(e,{statusCode:200,extraHeaders:[a,l]})}s.receiveRequest(e)}else e.method!==m.ACK&&this.replyStateless(e,{statusCode:481})},e.prototype.receiveOutsideDialogRequest=function(e){switch(e.method){case m.ACK:break;case m.BYE:this.replyStateless(e,{statusCode:481});break;case m.CANCEL:throw new Error("Unexpected out of dialog request method ".concat(e.method,"."));case m.INFO:this.replyStateless(e,{statusCode:405});break;case m.INVITE:var t=new Re(this,e);this.delegate.onInvite?this.delegate.onInvite(t):t.reject();break;case m.MESSAGE:t=new le(this,e);this.delegate.onMessage?this.delegate.onMessage(t):t.accept();break;case m.NOTIFY:t=new de(this,e);this.delegate.onNotify?this.delegate.onNotify(t):t.reject({statusCode:405});break;case m.OPTIONS:var n="Allow: "+Se.toString(),r="Accept: "+Pe.toString();this.replyStateless(e,{statusCode:200,extraHeaders:[n,r]});break;case m.REFER:t=new be(this,e);this.delegate.onRefer?this.delegate.onRefer(t):t.reject({statusCode:405});break;case m.REGISTER:t=new Ae(this,e);this.delegate.onRegister?this.delegate.onRegister(t):t.reject({statusCode:405});break;case m.SUBSCRIBE:t=new De(this,e);this.delegate.onSubscribe?this.delegate.onSubscribe(t):t.reject({statusCode:480});break;default:throw new Error("Unexpected out of dialog request method ".concat(e.method,"."))}},e.prototype.receiveResponseFromTransport=function(e){if(e.getHeaders("via").length>1)this.logger.warn("More than one Via header field present in the response, dropping");else{var t=e.viaBranch+e.method,n=this.userAgentClients.get(t);n?n.transaction.receiveResponse(e):this.logger.warn("Discarding unmatched ".concat(e.statusCode," response to ").concat(e.method," ").concat(t,"."))}},e}(),Me=function(e){function t(t){return e.call(this,t||"Unsupported content type.")||this}return o(t,e),t}(z),je=function(e){function t(t){return e.call(this,t||"Request pending.")||this}return o(t,e),t}(z),Ve=function(e){function t(t){return e.call(this,t||"Unspecified session description handler error.")||this}return o(t,e),t}(z),Le=function(e){function t(){return e.call(this,"The session has terminated.")||this}return o(t,e),t}(z),$e=function(e){function t(t){return e.call(this,t||"An error occurred during state transition.")||this}return o(t,e),t}(z),qe=function(){function e(e){this.incomingAckRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingAckRequest.message},enumerable:!1,configurable:!0}),e}(),Fe=function(){function e(e){this.incomingByeRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingByeRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingByeRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingByeRequest.reject(e),Promise.resolve()},e}(),Ue=function(){function e(){this.listeners=new Array}return e.prototype.addListener=function(e,t){var n=this,r=function(t){n.removeListener(r),e(t)};!0===(null===t||void 0===t?void 0:t.once)?this.listeners.push(r):this.listeners.push(e)},e.prototype.emit=function(e){this.listeners.slice().forEach((function(t){return t(e)}))},e.prototype.removeAllListeners=function(){this.listeners=[]},e.prototype.removeListener=function(e){this.listeners=this.listeners.filter((function(t){return t!==e}))},e.prototype.on=function(e){return this.addListener(e)},e.prototype.off=function(e){return this.removeListener(e)},e.prototype.once=function(e){return this.addListener(e,{once:!0})},e}(),ze=function(){function e(e){this.incomingInfoRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingInfoRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingInfoRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingInfoRequest.reject(e),Promise.resolve()},e}(),Ke=function(){function e(e){this.incomingMessageRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingMessageRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingMessageRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingMessageRequest.reject(e),Promise.resolve()},e}(),We=function(){function e(e){this.incomingNotifyRequest=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingNotifyRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return this.incomingNotifyRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingNotifyRequest.reject(e),Promise.resolve()},e}(),Ge=function(){function e(e,t){this.incomingReferRequest=e,this.session=t}return Object.defineProperty(e.prototype,"referTo",{get:function(){var e=this.incomingReferRequest.message.parseHeader("refer-to");if(!(e instanceof u))throw new Error("Failed to parse Refer-To header.");return e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"referredBy",{get:function(){return this.incomingReferRequest.message.getHeader("referred-by")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"replaces",{get:function(){var e=this.referTo.uri.getHeader("replaces");return e instanceof Array?e[0]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.incomingReferRequest.message},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){return void 0===e&&(e={statusCode:202}),this.incomingReferRequest.accept(e),Promise.resolve()},e.prototype.reject=function(e){return this.incomingReferRequest.reject(e),Promise.resolve()},e.prototype.makeInviter=function(e){if(this.inviter)return this.inviter;var t=this.referTo.uri.clone();t.clearHeaders(),e=e||{};var n=(e.extraHeaders||[]).slice(),r=this.replaces;r&&n.push("Replaces: "+decodeURIComponent(r));var o=this.referredBy;return o&&n.push("Referred-By: "+o),e.extraHeaders=n,this.inviter=this.session.userAgent._makeInviter(t,e),this.inviter._referred=this.session,this.session._referral=this.inviter,this.inviter},e}();(function(e){e["Initial"]="Initial",e["Establishing"]="Establishing",e["Established"]="Established",e["Terminating"]="Terminating",e["Terminated"]="Terminated"})(_e||(_e={}));var Ye,Je=function(){function e(e,t){void 0===t&&(t={}),this.pendingReinvite=!1,this.pendingReinviteAck=!1,this._state=_e.Initial,this.delegate=t.delegate,this._stateEventEmitter=new Ue,this._userAgent=e}return e.prototype.dispose=function(){var e=this;switch(this.logger.log("Session ".concat(this.id," in state ").concat(this._state," is being disposed")),delete this.userAgent._sessions[this.id],this._sessionDescriptionHandler&&this._sessionDescriptionHandler.close(),this.state){case _e.Initial:break;case _e.Establishing:break;case _e.Established:return new Promise((function(t){e._bye({onAccept:function(){return t()},onRedirect:function(){return t()},onReject:function(){return t()}})}));case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown state.")}return Promise.resolve()},Object.defineProperty(e.prototype,"assertedIdentity",{get:function(){return this._assertedIdentity},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dialog",{get:function(){return this._dialog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"replacee",{get:function(){return this._replacee},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandler",{get:function(){return this._sessionDescriptionHandler},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerFactory",{get:function(){return this.userAgent.configuration.sessionDescriptionHandlerFactory},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerModifiers",{get:function(){return this._sessionDescriptionHandlerModifiers||[]},set:function(e){this._sessionDescriptionHandlerModifiers=e.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerOptions",{get:function(){return this._sessionDescriptionHandlerOptions||{}},set:function(e){this._sessionDescriptionHandlerOptions=i({},e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerModifiersReInvite",{get:function(){return this._sessionDescriptionHandlerModifiersReInvite||[]},set:function(e){this._sessionDescriptionHandlerModifiersReInvite=e.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionDescriptionHandlerOptionsReInvite",{get:function(){return this._sessionDescriptionHandlerOptionsReInvite||{}},set:function(e){this._sessionDescriptionHandlerOptionsReInvite=i({},e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgent",{get:function(){return this._userAgent},enumerable:!1,configurable:!0}),e.prototype.bye=function(e){void 0===e&&(e={});var t="Session.bye() may only be called if established session.";switch(this.state){case _e.Initial:"function"===typeof this.cancel?(t+=" However Inviter.invite() has not yet been called.",t+=" Perhaps you should have called Inviter.cancel()?"):"function"===typeof this.reject&&(t+=" However Invitation.accept() has not yet been called.",t+=" Perhaps you should have called Invitation.reject()?");break;case _e.Establishing:"function"===typeof this.cancel?(t+=" However a dialog does not yet exist.",t+=" Perhaps you should have called Inviter.cancel()?"):"function"===typeof this.reject&&(t+=" However Invitation.accept() has not yet been called (or not yet resolved).",t+=" Perhaps you should have called Invitation.reject()?");break;case _e.Established:var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._bye(n,r);case _e.Terminating:t+=" However this session is already terminating.","function"===typeof this.cancel?t+=" Perhaps you have already called Inviter.cancel()?":"function"===typeof this.reject&&(t+=" Perhaps you have already called Session.bye()?");break;case _e.Terminated:t+=" However this session is already terminated.";break;default:throw new Error("Unknown state")}return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))},e.prototype.info=function(e){if(void 0===e&&(e={}),this.state!==_e.Established){var t="Session.info() may only be called if established session.";return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._info(n,r)},e.prototype.invite=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Session.invite"),this.state!==_e.Established)return Promise.reject(new Error("Invalid session state ".concat(this.state)));if(this.pendingReinvite)return Promise.reject(new je("Reinvite in progress. Please wait until complete, then try again."));this.pendingReinvite=!0,e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiersReInvite=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptionsReInvite=e.sessionDescriptionHandlerOptions);var n={onAccept:function(n){var r=O(n.message);if(!r)return t.logger.error("Received 2xx response to re-INVITE without a session description"),t.ackAndBye(n,400,"Missing session description"),t.stateTransition(_e.Terminated),void(t.pendingReinvite=!1);if(e.withoutSdp){var o={sessionDescriptionHandlerOptions:t.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:t.sessionDescriptionHandlerModifiersReInvite};t.setOfferAndGetAnswer(r,o).then((function(e){n.ack({body:e})})).catch((function(e){t.logger.error("Failed to handle offer in 2xx response to re-INVITE"),t.logger.error(e.message),t.state===_e.Terminated?n.ack():(t.ackAndBye(n,488,"Bad Media Description"),t.stateTransition(_e.Terminated))})).then((function(){t.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)}))}else{o={sessionDescriptionHandlerOptions:t.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:t.sessionDescriptionHandlerModifiersReInvite};t.setAnswer(r,o).then((function(){n.ack()})).catch((function(e){t.logger.error("Failed to handle answer in 2xx response to re-INVITE"),t.logger.error(e.message),t.state!==_e.Terminated?(t.ackAndBye(n,488,"Bad Media Description"),t.stateTransition(_e.Terminated)):n.ack()})).then((function(){t.pendingReinvite=!1,e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)}))}},onProgress:function(e){},onRedirect:function(e){},onReject:function(n){t.logger.warn("Received a non-2xx response to re-INVITE"),t.pendingReinvite=!1,e.withoutSdp?e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n):t.rollbackOffer().catch((function(e){if(t.logger.error("Failed to rollback offer on non-2xx response to re-INVITE"),t.logger.error(e.message),t.state!==_e.Terminated){if(!t.dialog)throw new Error("Dialog undefined.");var n=[];n.push("Reason: "+t.getReasonHeaderValue(500,"Internal Server Error")),t.dialog.bye(void 0,{extraHeaders:n}),t.stateTransition(_e.Terminated)}})).then((function(){e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)}))},onTrying:function(e){}},r=e.requestOptions||{};if(r.extraHeaders=(r.extraHeaders||[]).slice(),r.extraHeaders.push("Allow: "+Se.toString()),r.extraHeaders.push("Contact: "+this._contact),e.withoutSdp){if(!this.dialog)throw this.pendingReinvite=!1,new Error("Dialog undefined.");return Promise.resolve(this.dialog.invite(n,r))}var o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};return this.getOffer(o).then((function(e){if(!t.dialog)throw t.pendingReinvite=!1,new Error("Dialog undefined.");return r.body=e,t.dialog.invite(n,r)})).catch((function(e){throw t.logger.error(e.message),t.logger.error("Failed to send re-INVITE"),t.pendingReinvite=!1,e}))},e.prototype.message=function(e){if(void 0===e&&(e={}),this.state!==_e.Established){var t="Session.message() may only be called if established session.";return this.logger.error(t),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var n=e.requestDelegate,r=this.copyRequestOptions(e.requestOptions);return this._message(n,r)},e.prototype.refer=function(e,t){if(void 0===t&&(t={}),this.state!==_e.Established){var n="Session.refer() may only be called if established session.";return this.logger.error(n),Promise.reject(new Error("Invalid session state ".concat(this.state)))}var r=t.requestDelegate,o=this.copyRequestOptions(t.requestOptions);return o.extraHeaders=o.extraHeaders?o.extraHeaders.concat(this.referExtraHeaders(this.referToString(e))):this.referExtraHeaders(this.referToString(e)),this._refer(t.onNotify,r,o)},e.prototype._bye=function(e,t){var n=this;if(!this.dialog)return Promise.reject(new Error("Session dialog undefined."));var r=this.dialog;switch(r.sessionState){case M.Initial:throw new Error("Invalid dialog state ".concat(r.sessionState));case M.Early:throw new Error("Invalid dialog state ".concat(r.sessionState));case M.AckWait:return this.stateTransition(_e.Terminating),new Promise((function(o){r.delegate={onAck:function(){var i=r.bye(e,t);return n.stateTransition(_e.Terminated),o(i),Promise.resolve()},onAckTimeout:function(){var i=r.bye(e,t);n.stateTransition(_e.Terminated),o(i)}}}));case M.Confirmed:var o=r.bye(e,t);return this.stateTransition(_e.Terminated),Promise.resolve(o);case M.Terminated:throw new Error("Invalid dialog state ".concat(r.sessionState));default:throw new Error("Unrecognized state.")}},e.prototype._info=function(e,t){return this.dialog?Promise.resolve(this.dialog.info(e,t)):Promise.reject(new Error("Session dialog undefined."))},e.prototype._message=function(e,t){return this.dialog?Promise.resolve(this.dialog.message(e,t)):Promise.reject(new Error("Session dialog undefined."))},e.prototype._refer=function(e,t,n){return this.dialog?(this.onNotify=e,Promise.resolve(this.dialog.refer(t,n))):Promise.reject(new Error("Session dialog undefined."))},e.prototype.ackAndBye=function(e,t,n){e.ack();var r=[];t&&r.push("Reason: "+this.getReasonHeaderValue(t,n)),e.session.bye(void 0,{extraHeaders:r})},e.prototype.onAckRequest=function(e){var t=this;if(this.logger.log("Session.onAckRequest"),this.state!==_e.Established&&this.state!==_e.Terminating)return this.logger.error("ACK received while in state ".concat(this.state,", dropping request")),Promise.resolve();var n=this.dialog;if(!n)throw new Error("Dialog undefined.");var r={sessionDescriptionHandlerOptions:this.pendingReinviteAck?this.sessionDescriptionHandlerOptionsReInvite:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.pendingReinviteAck?this._sessionDescriptionHandlerModifiersReInvite:this._sessionDescriptionHandlerModifiers};if(this.delegate&&this.delegate.onAck){var o=new qe(e);this.delegate.onAck(o)}switch(this.pendingReinviteAck=!1,n.signalingState){case j.Initial:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));var i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.Stable:var s=O(e.message);return s?"render"===s.contentDisposition?(this._renderbody=s.content,this._rendertype=s.contentType,Promise.resolve()):"session"!==s.contentDisposition?Promise.resolve():this.setAnswer(s,r).catch((function(e){t.logger.error(e.message);var r=["Reason: "+t.getReasonHeaderValue(488,"Bad Media Description")];n.bye(void 0,{extraHeaders:r}),t.stateTransition(_e.Terminated)})):Promise.resolve();case j.HaveLocalOffer:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.HaveRemoteOffer:this.logger.error("Invalid signaling state ".concat(n.signalingState,"."));i=["Reason: "+this.getReasonHeaderValue(488,"Bad Media Description")];return n.bye(void 0,{extraHeaders:i}),this.stateTransition(_e.Terminated),Promise.resolve();case j.Closed:throw new Error("Invalid signaling state ".concat(n.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(n.signalingState,"."))}},e.prototype.onByeRequest=function(e){if(this.logger.log("Session.onByeRequest"),this.state===_e.Established){if(this.delegate&&this.delegate.onBye){var t=new Fe(e);this.delegate.onBye(t)}else e.accept();this.stateTransition(_e.Terminated)}else this.logger.error("BYE received while in state ".concat(this.state,", dropping request"))},e.prototype.onInfoRequest=function(e){if(this.logger.log("Session.onInfoRequest"),this.state===_e.Established)if(this.delegate&&this.delegate.onInfo){var t=new ze(e);this.delegate.onInfo(t)}else e.accept();else this.logger.error("INFO received while in state ".concat(this.state,", dropping request"))},e.prototype.onInviteRequest=function(e){var t=this;if(this.logger.log("Session.onInviteRequest"),this.state===_e.Established){this.pendingReinviteAck=!0;var n=["Contact: "+this._contact];if(e.message.hasHeader("P-Asserted-Identity")){var r=e.message.getHeader("P-Asserted-Identity");if(!r)throw new Error("Header undefined.");this._assertedIdentity=g.nameAddrHeaderParse(r)}var o={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptionsReInvite,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiersReInvite};this.generateResponseOfferAnswerInDialog(o).then((function(r){var o=e.accept({statusCode:200,extraHeaders:n,body:r});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,200)})).catch((function(r){if(t.logger.error(r.message),t.logger.error("Failed to handle to re-INVITE request"),!t.dialog)throw new Error("Dialog undefined.");if(t.logger.error(t.dialog.signalingState),t.dialog.signalingState!==j.Stable)t.rollbackOffer().then((function(){var n=e.reject({statusCode:488});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,n.message,488)})).catch((function(r){t.logger.error(r.message),t.logger.error("Failed to rollback offer on re-INVITE request");var o=e.reject({statusCode:488});if(t.state!==_e.Terminated){if(!t.dialog)throw new Error("Dialog undefined.");var i=[];i.push("Reason: "+t.getReasonHeaderValue(500,"Internal Server Error")),t.dialog.bye(void 0,{extraHeaders:n}),t.stateTransition(_e.Terminated)}t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,488)}));else{var o=e.reject({statusCode:488});t.delegate&&t.delegate.onInvite&&t.delegate.onInvite(e.message,o.message,488)}}))}else this.logger.error("INVITE received while in state ".concat(this.state,", dropping request"))},e.prototype.onMessageRequest=function(e){if(this.logger.log("Session.onMessageRequest"),this.state===_e.Established)if(this.delegate&&this.delegate.onMessage){var t=new Ke(e);this.delegate.onMessage(t)}else e.accept();else this.logger.error("MESSAGE received while in state ".concat(this.state,", dropping request"))},e.prototype.onNotifyRequest=function(e){if(this.logger.log("Session.onNotifyRequest"),this.state===_e.Established)if(this.onNotify){var t=new We(e);this.onNotify(t)}else if(this.delegate&&this.delegate.onNotify){t=new We(e);this.delegate.onNotify(t)}else e.accept();else this.logger.error("NOTIFY received while in state ".concat(this.state,", dropping request"))},e.prototype.onPrackRequest=function(e){if(this.logger.log("Session.onPrackRequest"),this.state===_e.Established)throw new Error("Unimplemented.");this.logger.error("PRACK received while in state ".concat(this.state,", dropping request"))},e.prototype.onReferRequest=function(e){var t=this;if(this.logger.log("Session.onReferRequest"),this.state===_e.Established){if(!e.message.hasHeader("refer-to"))return this.logger.warn("Invalid REFER packet. A refer-to header is required. Rejecting."),void e.reject();var n=new Ge(e,this);this.delegate&&this.delegate.onRefer?this.delegate.onRefer(n):(this.logger.log("No delegate available to handle REFER, automatically accepting and following."),n.accept().then((function(){return n.makeInviter(t._referralInviterOptions).invite()})).catch((function(e){t.logger.error(e.message)})))}else this.logger.error("REFER received while in state ".concat(this.state,", dropping request"))},e.prototype.generateResponseOfferAnswer=function(e,t){if(this.dialog)return this.generateResponseOfferAnswerInDialog(t);var n=O(e.message);return n&&"session"===n.contentDisposition?this.setOfferAndGetAnswer(n,t):this.getOffer(t)},e.prototype.generateResponseOfferAnswerInDialog=function(e){if(!this.dialog)throw new Error("Dialog undefined.");switch(this.dialog.signalingState){case j.Initial:return this.getOffer(e);case j.HaveLocalOffer:return Promise.resolve(void 0);case j.HaveRemoteOffer:if(!this.dialog.offer)throw new Error("Session offer undefined in signaling state ".concat(this.dialog.signalingState,"."));return this.setOfferAndGetAnswer(this.dialog.offer,e);case j.Stable:return this.state!==_e.Established?Promise.resolve(void 0):this.getOffer(e);case j.Closed:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."))}},e.prototype.getOffer=function(e){var t=this,n=this.setupSessionDescriptionHandler(),r=e.sessionDescriptionHandlerOptions,o=e.sessionDescriptionHandlerModifiers;try{return n.getDescription(r,o).then((function(e){return I(e)})).catch((function(e){t.logger.error("Session.getOffer: SDH getDescription rejected...");var n=e instanceof Error?e:new Error("Session.getOffer unknown error.");throw t.logger.error(n.message),n}))}catch(s){this.logger.error("Session.getOffer: SDH getDescription threw...");var i=s instanceof Error?s:new Error(s);return this.logger.error(i.message),Promise.reject(i)}},e.prototype.rollbackOffer=function(){var e=this,t=this.setupSessionDescriptionHandler();if(void 0===t.rollbackDescription)return Promise.resolve();try{return t.rollbackDescription().catch((function(t){e.logger.error("Session.rollbackOffer: SDH rollbackDescription rejected...");var n=t instanceof Error?t:new Error("Session.rollbackOffer unknown error.");throw e.logger.error(n.message),n}))}catch(r){this.logger.error("Session.rollbackOffer: SDH rollbackDescription threw...");var n=r instanceof Error?r:new Error(r);return this.logger.error(n.message),Promise.reject(n)}},e.prototype.setAnswer=function(e,t){var n=this,r=this.setupSessionDescriptionHandler(),o=t.sessionDescriptionHandlerOptions,i=t.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new Me)}catch(a){this.logger.error("Session.setAnswer: SDH hasDescription threw...");var s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}try{return r.setDescription(e.content,o,i).catch((function(e){n.logger.error("Session.setAnswer: SDH setDescription rejected...");var t=e instanceof Error?e:new Error("Session.setAnswer unknown error.");throw n.logger.error(t.message),t}))}catch(a){this.logger.error("Session.setAnswer: SDH setDescription threw...");s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}},e.prototype.setOfferAndGetAnswer=function(e,t){var n=this,r=this.setupSessionDescriptionHandler(),o=t.sessionDescriptionHandlerOptions,i=t.sessionDescriptionHandlerModifiers;try{if(!r.hasDescription(e.contentType))return Promise.reject(new Me)}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH hasDescription threw...");var s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}try{return r.setDescription(e.content,o,i).then((function(){return r.getDescription(o,i)})).then((function(e){return I(e)})).catch((function(e){n.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription rejected...");var t=e instanceof Error?e:new Error("Session.setOfferAndGetAnswer unknown error.");throw n.logger.error(t.message),t}))}catch(a){this.logger.error("Session.setOfferAndGetAnswer: SDH setDescription or getDescription threw...");s=a instanceof Error?a:new Error(a);return this.logger.error(s.message),Promise.reject(s)}},e.prototype.setSessionDescriptionHandler=function(e){if(this._sessionDescriptionHandler)throw new Error("Session description handler defined.");this._sessionDescriptionHandler=e},e.prototype.setupSessionDescriptionHandler=function(){var e;return this._sessionDescriptionHandler||(this._sessionDescriptionHandler=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions),(null===(e=this.delegate)||void 0===e?void 0:e.onSessionDescriptionHandler)&&this.delegate.onSessionDescriptionHandler(this._sessionDescriptionHandler,!1)),this._sessionDescriptionHandler},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case _e.Initial:e!==_e.Establishing&&e!==_e.Established&&e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Establishing:e!==_e.Established&&e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Established:e!==_e.Terminating&&e!==_e.Terminated&&n();break;case _e.Terminating:e!==_e.Terminated&&n();break;case _e.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Session ".concat(this.id," transitioned to state ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===_e.Terminated&&this.dispose()},e.prototype.copyRequestOptions=function(e){void 0===e&&(e={});var t=e.extraHeaders?e.extraHeaders.slice():void 0,n=e.body?{contentDisposition:e.body.contentDisposition||"render",contentType:e.body.contentType||"text/plain",content:e.body.content||""}:void 0;return{extraHeaders:t,body:n}},e.prototype.getReasonHeaderValue=function(e,t){var n=e,r=w(e);return!r&&t&&(r=t),"SIP;cause="+n+';text="'+r+'"'},e.prototype.referExtraHeaders=function(e){var t=[];return t.push("Referred-By: <"+this.userAgent.configuration.uri+">"),t.push("Contact: "+this._contact),t.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.push("Refer-To: "+e),t},e.prototype.referToString=function(e){var t;if(e instanceof d)t=e.toString();else{if(!e.dialog)throw new Error("Dialog undefined.");var n=e.remoteIdentity.friendlyName,r=e.dialog.remoteTarget.toString(),o=e.dialog.callId,i=e.dialog.remoteTag,s=e.dialog.localTag,a=encodeURIComponent("".concat(o,";to-tag=").concat(i,";from-tag=").concat(s));t='"'.concat(n,'" <').concat(r,"?Replaces=").concat(a,">")}return t},e}();(function(e){e["Required"]="Required",e["Supported"]="Supported",e["Unsupported"]="Unsupported"})(Ye||(Ye={}));var Ze,Xe,Qe={"100rel":!0,199:!0,answermode:!0,"early-session":!0,eventlist:!0,explicitsub:!0,"from-change":!0,"geolocation-http":!0,"geolocation-sip":!0,gin:!0,gruu:!0,histinfo:!0,ice:!0,join:!0,"multiple-refer":!0,norefersub:!0,nosub:!0,outbound:!0,path:!0,policy:!0,precondition:!0,pref:!0,privacy:!0,"recipient-list-invite":!0,"recipient-list-message":!0,"recipient-list-subscribe":!0,replaces:!0,"resource-priority":!0,"sdp-anat":!0,"sec-agree":!0,tdialog:!0,timer:!0,uui:!0},et=function(e){function t(t,n){var r=e.call(this,t)||this;r.incomingInviteRequest=n,r.disposed=!1,r.expiresTimer=void 0,r.isCanceled=!1,r.rel100="none",r.rseq=Math.floor(1e4*Math.random()),r.userNoAnswerTimer=void 0,r.waitingForPrack=!1,r.logger=t.getLogger("sip.Invitation");var o=r.incomingInviteRequest.message,i=o.getHeader("require");i&&i.toLowerCase().includes("100rel")&&(r.rel100="required");var s=o.getHeader("supported");if(s&&s.toLowerCase().includes("100rel")&&(r.rel100="supported"),o.toTag=n.toTag,"string"!==typeof o.toTag)throw new TypeError("toTag should have been a string.");if(r.userNoAnswerTimer=setTimeout((function(){n.reject({statusCode:480}),r.stateTransition(_e.Terminated)}),r.userAgent.configuration.noAnswerTimeout?1e3*r.userAgent.configuration.noAnswerTimeout:6e4),o.hasHeader("expires")){var a=1e3*Number(o.getHeader("expires")||0);r.expiresTimer=setTimeout((function(){r.state===_e.Initial&&(n.reject({statusCode:487}),r.stateTransition(_e.Terminated))}),a)}var l=r.request.getHeader("P-Asserted-Identity");l&&(r._assertedIdentity=g.nameAddrHeaderParse(l)),r._contact=r.userAgent.contact.toString();var c=o.parseHeader("Content-Disposition");return c&&"render"===c.type&&(r._renderbody=o.body,r._rendertype=o.getHeader("Content-Type")),r._id=o.callId+o.fromTag,r.userAgent._sessions[r._id]=r,r}return o(t,e),t.prototype.dispose=function(){var t=this;if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.expiresTimer&&(clearTimeout(this.expiresTimer),this.expiresTimer=void 0),this.userNoAnswerTimer&&(clearTimeout(this.userNoAnswerTimer),this.userNoAnswerTimer=void 0),this.prackNeverArrived(),this.state){case _e.Initial:return this.reject().then((function(){return e.prototype.dispose.call(t)}));case _e.Establishing:return this.reject().then((function(){return e.prototype.dispose.call(t)}));case _e.Established:return e.prototype.dispose.call(this);case _e.Terminating:return e.prototype.dispose.call(this);case _e.Terminated:return e.prototype.dispose.call(this);default:throw new Error("Unknown state.")}},Object.defineProperty(t.prototype,"autoSendAnInitialProvisionalResponse",{get:function(){return"required"!==this.rel100&&this.userAgent.configuration.sendInitialProvisionalResponse},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"body",{get:function(){return this.incomingInviteRequest.message.body},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localIdentity",{get:function(){return this.request.to},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteIdentity",{get:function(){return this.request.from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return this.incomingInviteRequest.message},enumerable:!1,configurable:!0}),t.prototype.accept=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Invitation.accept"),this.state!==_e.Initial){var n=new Error("Invalid session state ".concat(this.state));return this.logger.error(n.message),Promise.reject(n)}return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.stateTransition(_e.Establishing),this.sendAccept(e).then((function(e){e.message;var n=e.session;n.delegate={onAck:function(e){return t.onAckRequest(e)},onAckTimeout:function(){return t.onAckTimeout()},onBye:function(e){return t.onByeRequest(e)},onInfo:function(e){return t.onInfoRequest(e)},onInvite:function(e){return t.onInviteRequest(e)},onMessage:function(e){return t.onMessageRequest(e)},onNotify:function(e){return t.onNotifyRequest(e)},onPrack:function(e){return t.onPrackRequest(e)},onRefer:function(e){return t.onReferRequest(e)}},t._dialog=n,t.stateTransition(_e.Established),t._replacee&&t._replacee._bye()})).catch((function(e){return t.handleResponseError(e)}))},t.prototype.progress=function(e){var t=this;if(void 0===e&&(e={}),this.logger.log("Invitation.progress"),this.state!==_e.Initial){var n=new Error("Invalid session state ".concat(this.state));return this.logger.error(n.message),Promise.reject(n)}var r=e.statusCode||180;if(r<100||r>199)throw new TypeError("Invalid statusCode: "+r);return e.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=e.sessionDescriptionHandlerModifiers),e.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=e.sessionDescriptionHandlerOptions),this.waitingForPrack?(this.logger.warn("Unexpected call for progress while waiting for prack, ignoring"),Promise.resolve()):100===e.statusCode?this.sendProgressTrying().then((function(){})).catch((function(e){return t.handleResponseError(e)})):"required"===this.rel100||"supported"===this.rel100&&e.rel100||"supported"===this.rel100&&this.userAgent.configuration.sipExtension100rel===Ye.Required?this.sendProgressReliableWaitForPrack(e).then((function(){})).catch((function(e){return t.handleResponseError(e)})):this.sendProgress(e).then((function(){})).catch((function(e){return t.handleResponseError(e)}))},t.prototype.reject=function(e){if(void 0===e&&(e={}),this.logger.log("Invitation.reject"),this.state!==_e.Initial&&this.state!==_e.Establishing){var t=new Error("Invalid session state ".concat(this.state));return this.logger.error(t.message),Promise.reject(t)}var n=e.statusCode||480,r=e.reasonPhrase?e.reasonPhrase:w(n),o=e.extraHeaders||[];if(n<300||n>699)throw new TypeError("Invalid statusCode: "+n);var i=e.body?I(e.body):void 0;return n<400?this.incomingInviteRequest.redirect([],{statusCode:n,reasonPhrase:r,extraHeaders:o,body:i}):this.incomingInviteRequest.reject({statusCode:n,reasonPhrase:r,extraHeaders:o,body:i}),this.stateTransition(_e.Terminated),Promise.resolve()},t.prototype._onCancel=function(e){this.logger.log("Invitation._onCancel"),this.state===_e.Initial||this.state===_e.Establishing?(this.isCanceled=!0,this.incomingInviteRequest.reject({statusCode:487}),this.stateTransition(_e.Terminated)):this.logger.error("CANCEL received while in state ".concat(this.state,", dropping request"))},t.prototype.handlePrackOfferAnswer=function(e){if(!this.dialog)throw new Error("Dialog undefined.");var t=O(e.message);if(!t||"session"!==t.contentDisposition)return Promise.resolve(void 0);var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers};switch(this.dialog.signalingState){case j.Initial:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));case j.Stable:return this.setAnswer(t,n).then((function(){}));case j.HaveLocalOffer:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));case j.HaveRemoteOffer:return this.setOfferAndGetAnswer(t,n);case j.Closed:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."));default:throw new Error("Invalid signaling state ".concat(this.dialog.signalingState,"."))}},t.prototype.handleResponseError=function(e){var t=480;if(e instanceof Error?this.logger.error(e.message):this.logger.error(e),e instanceof Me?(this.logger.error("A session description handler occurred while sending response (content type unsupported"),t=415):e instanceof Ve?this.logger.error("A session description handler occurred while sending response"):e instanceof Le?this.logger.error("Session ended before response could be formulated and sent (while waiting for PRACK)"):e instanceof K&&this.logger.error("Session changed state before response could be formulated and sent"),this.state===_e.Initial||this.state===_e.Establishing)try{this.incomingInviteRequest.reject({statusCode:t}),this.stateTransition(_e.Terminated)}catch(n){throw this.logger.error("An error occurred attempting to reject the request while handling another error"),n}if(!this.isCanceled)throw e;this.logger.warn("An error occurred while attempting to formulate and send a response to an incoming INVITE. However a CANCEL was received and processed while doing so which can (and often does) result in errors occurring as the session terminates in the meantime. Said error is being ignored.")},t.prototype.onAckTimeout=function(){if(this.logger.log("Invitation.onAckTimeout"),!this.dialog)throw new Error("Dialog undefined.");this.logger.log("No ACK received for an extended period of time, terminating session"),this.dialog.bye(),this.stateTransition(_e.Terminated)},t.prototype.sendAccept=function(e){var t=this;void 0===e&&(e={});var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.extraHeaders||[];return this.waitingForPrack?this.waitForArrivalOfPrack().then((function(){return clearTimeout(t.userNoAnswerTimer)})).then((function(){return t.generateResponseOfferAnswer(t.incomingInviteRequest,n)})).then((function(e){return t.incomingInviteRequest.accept({statusCode:200,body:e,extraHeaders:r})})):(clearTimeout(this.userNoAnswerTimer),this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then((function(e){return t.incomingInviteRequest.accept({statusCode:200,body:e,extraHeaders:r})})))},t.prototype.sendProgress=function(e){void 0===e&&(e={});var t=e.statusCode||180,n=e.reasonPhrase,r=(e.extraHeaders||[]).slice(),o=e.body?I(e.body):void 0;if(183===t&&!o)return this.sendProgressWithSDP(e);try{var i=this.incomingInviteRequest.progress({statusCode:t,reasonPhrase:n,extraHeaders:r,body:o});return this._dialog=i.session,Promise.resolve(i)}catch(s){return Promise.reject(s)}},t.prototype.sendProgressWithSDP=function(e){var t=this;void 0===e&&(e={});var n={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},r=e.statusCode||183,o=e.reasonPhrase,i=(e.extraHeaders||[]).slice();return this.generateResponseOfferAnswer(this.incomingInviteRequest,n).then((function(e){return t.incomingInviteRequest.progress({statusCode:r,reasonPhrase:o,extraHeaders:i,body:e})})).then((function(e){return t._dialog=e.session,e}))},t.prototype.sendProgressReliable=function(e){return void 0===e&&(e={}),e.extraHeaders=(e.extraHeaders||[]).slice(),e.extraHeaders.push("Require: 100rel"),e.extraHeaders.push("RSeq: "+Math.floor(1e4*Math.random())),this.sendProgressWithSDP(e)},t.prototype.sendProgressReliableWaitForPrack=function(e){var t=this;void 0===e&&(e={});var n,r={sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions,sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers},o=e.statusCode||183,i=e.reasonPhrase,s=(e.extraHeaders||[]).slice();return s.push("Require: 100rel"),s.push("RSeq: "+this.rseq++),new Promise((function(e,a){t.waitingForPrack=!0,t.generateResponseOfferAnswer(t.incomingInviteRequest,r).then((function(e){return n=e,t.incomingInviteRequest.progress({statusCode:o,reasonPhrase:i,extraHeaders:s,body:n})})).then((function(r){var l,c;t._dialog=r.session,r.session.delegate={onPrack:function(n){l=n,clearTimeout(d),clearTimeout(f),t.waitingForPrack&&(t.waitingForPrack=!1,t.handlePrackOfferAnswer(l).then((function(n){try{c=l.accept({statusCode:200,body:n}),t.prackArrived(),e({prackRequest:l,prackResponse:c,progressResponse:r})}catch(o){a(o)}})).catch((function(e){return a(e)})))}};var u=function(){t.waitingForPrack&&(t.waitingForPrack=!1,t.logger.warn("No PRACK received, rejecting INVITE."),clearTimeout(f),t.reject({statusCode:504}).then((function(){return a(new Le)})).catch((function(e){return a(e)})))},d=setTimeout(u,64*U.T1),p=function(){try{t.incomingInviteRequest.progress({statusCode:o,reasonPhrase:i,extraHeaders:s,body:n})}catch(e){return t.waitingForPrack=!1,void a(e)}f=setTimeout(p,h*=2)},h=U.T1,f=setTimeout(p,h)})).catch((function(e){t.waitingForPrack=!1,a(e)}))}))},t.prototype.sendProgressTrying=function(){try{var e=this.incomingInviteRequest.trying();return Promise.resolve(e)}catch(t){return Promise.reject(t)}},t.prototype.waitForArrivalOfPrack=function(){var e=this;if(this.waitingForPrackPromise)throw new Error("Already waiting for PRACK");return this.waitingForPrackPromise=new Promise((function(t,n){e.waitingForPrackResolve=t,e.waitingForPrackReject=n})),this.waitingForPrackPromise},t.prototype.prackArrived=function(){this.waitingForPrackResolve&&this.waitingForPrackResolve(),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0},t.prototype.prackNeverArrived=function(){this.waitingForPrackReject&&this.waitingForPrackReject(new Le),this.waitingForPrackPromise=void 0,this.waitingForPrackResolve=void 0,this.waitingForPrackReject=void 0},t}(Je),tt=function(e){function t(t,n,r){void 0===r&&(r={});var o=e.call(this,t,r)||this;o.disposed=!1,o.earlyMedia=!1,o.earlyMediaSessionDescriptionHandlers=new Map,o.isCanceled=!1,o.inviteWithoutSdp=!1,o.logger=t.getLogger("sip.Inviter"),o.earlyMedia=void 0!==r.earlyMedia?r.earlyMedia:o.earlyMedia,o.fromTag=C(),o.inviteWithoutSdp=void 0!==r.inviteWithoutSdp?r.inviteWithoutSdp:o.inviteWithoutSdp;var s=i({},r);s.params=i({},r.params);var a=r.anonymous||!1,l=t.contact.toString({anonymous:a,outbound:a?!t.contact.tempGruu:!t.contact.pubGruu});a&&t.configuration.uri&&(s.params.fromDisplayName="Anonymous",s.params.fromUri="sip:anonymous@anonymous.invalid");var c=t.userAgentCore.configuration.aor;if(s.params.fromUri&&(c="string"===typeof s.params.fromUri?g.URIParse(s.params.fromUri):s.params.fromUri),!c)throw new TypeError("Invalid from URI: "+s.params.fromUri);var u=n;if(s.params.toUri&&(u="string"===typeof s.params.toUri?g.URIParse(s.params.toUri):s.params.toUri),!u)throw new TypeError("Invalid to URI: "+s.params.toUri);var d=i({},s.params);d.fromTag=o.fromTag;var p=(s.extraHeaders||[]).slice();a&&t.configuration.uri&&(p.push("P-Preferred-Identity: "+t.configuration.uri.toString()),p.push("Privacy: id")),p.push("Contact: "+l),p.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),t.configuration.sipExtension100rel===Ye.Required&&p.push("Require: 100rel"),t.configuration.sipExtensionReplaces===Ye.Required&&p.push("Require: replaces"),s.extraHeaders=p;var h=void 0;return o.outgoingRequestMessage=t.userAgentCore.makeOutgoingRequestMessage(m.INVITE,n,c,u,d,p,h),o._contact=l,o._referralInviterOptions=s,o._renderbody=r.renderbody,o._rendertype=r.rendertype,r.sessionDescriptionHandlerModifiers&&(o.sessionDescriptionHandlerModifiers=r.sessionDescriptionHandlerModifiers),r.sessionDescriptionHandlerOptions&&(o.sessionDescriptionHandlerOptions=r.sessionDescriptionHandlerOptions),r.sessionDescriptionHandlerModifiersReInvite&&(o.sessionDescriptionHandlerModifiersReInvite=r.sessionDescriptionHandlerModifiersReInvite),r.sessionDescriptionHandlerOptionsReInvite&&(o.sessionDescriptionHandlerOptionsReInvite=r.sessionDescriptionHandlerOptionsReInvite),o._id=o.outgoingRequestMessage.callId+o.fromTag,o.userAgent._sessions[o._id]=o,o}return o(t,e),t.prototype.dispose=function(){var t=this;if(this.disposed)return Promise.resolve();switch(this.disposed=!0,this.disposeEarlyMedia(),this.state){case _e.Initial:return this.cancel().then((function(){return e.prototype.dispose.call(t)}));case _e.Establishing:return this.cancel().then((function(){return e.prototype.dispose.call(t)}));case _e.Established:return e.prototype.dispose.call(this);case _e.Terminating:return e.prototype.dispose.call(this);case _e.Terminated:return e.prototype.dispose.call(this);default:throw new Error("Unknown state.")}},Object.defineProperty(t.prototype,"body",{get:function(){return this.outgoingRequestMessage.body},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"localIdentity",{get:function(){return this.outgoingRequestMessage.from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remoteIdentity",{get:function(){return this.outgoingRequestMessage.to},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"request",{get:function(){return this.outgoingRequestMessage},enumerable:!1,configurable:!0}),t.prototype.cancel=function(e){if(void 0===e&&(e={}),this.logger.log("Inviter.cancel"),this.state!==_e.Initial&&this.state!==_e.Establishing){var t=new Error("Invalid session state ".concat(this.state));return this.logger.error(t.message),Promise.reject(t)}function n(e,t){if(e&&e<200||e>699)throw new TypeError("Invalid statusCode: "+e);if(e){var n=e,r=w(e)||t;return"SIP;cause="+n+';text="'+r+'"'}}if(this.isCanceled=!0,this.stateTransition(_e.Terminating),this.outgoingInviteRequest){var r=void 0;e.statusCode&&e.reasonPhrase&&(r=n(e.statusCode,e.reasonPhrase)),this.outgoingInviteRequest.cancel(r,e)}else this.logger.warn("Canceled session before INVITE was sent"),this.stateTransition(_e.Terminated);return Promise.resolve()},t.prototype.invite=function(t){var n=this;if(void 0===t&&(t={}),this.logger.log("Inviter.invite"),this.state!==_e.Initial)return e.prototype.invite.call(this,t);if(t.sessionDescriptionHandlerModifiers&&(this.sessionDescriptionHandlerModifiers=t.sessionDescriptionHandlerModifiers),t.sessionDescriptionHandlerOptions&&(this.sessionDescriptionHandlerOptions=t.sessionDescriptionHandlerOptions),t.withoutSdp||this.inviteWithoutSdp)return this._renderbody&&this._rendertype&&(this.outgoingRequestMessage.body={contentType:this._rendertype,body:this._renderbody}),this.stateTransition(_e.Establishing),Promise.resolve(this.sendInvite(t));var r={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.getOffer(r).then((function(e){return n.outgoingRequestMessage.body={body:e.content,contentType:e.contentType},n.stateTransition(_e.Establishing),n.sendInvite(t)})).catch((function(e){throw n.logger.log(e.message),n.stateTransition(_e.Terminated),e}))},t.prototype.sendInvite=function(e){var t=this;return void 0===e&&(e={}),this.outgoingInviteRequest=this.userAgent.userAgentCore.invite(this.outgoingRequestMessage,{onAccept:function(n){return t.dialog?(t.logger.log("Additional confirmed dialog, sending ACK and BYE"),void t.ackAndBye(n)):t.isCanceled?(t.logger.log("Canceled session accepted, sending ACK and BYE"),t.ackAndBye(n),void t.stateTransition(_e.Terminated)):(t.notifyReferer(n),void t.onAccept(n).then((function(){t.disposeEarlyMedia()})).catch((function(){t.disposeEarlyMedia()})).then((function(){e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n)})))},onProgress:function(n){t.isCanceled||(t.notifyReferer(n),t.onProgress(n).catch((function(){t.disposeEarlyMedia()})).then((function(){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(n)})))},onRedirect:function(n){t.notifyReferer(n),t.onRedirect(n),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n)},onReject:function(n){t.notifyReferer(n),t.onReject(n),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n)},onTrying:function(n){t.notifyReferer(n),t.onTrying(n),e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(n)}}),this.outgoingInviteRequest},t.prototype.disposeEarlyMedia=function(){this.earlyMediaSessionDescriptionHandlers.forEach((function(e){e.close()})),this.earlyMediaSessionDescriptionHandlers.clear()},t.prototype.notifyReferer=function(e){var t=this;if(this._referred){if(!(this._referred instanceof Je))throw new Error("Referred session not instance of session");if(this._referred.dialog){if(!e.message.statusCode)throw new Error("Status code undefined.");if(!e.message.reasonPhrase)throw new Error("Reason phrase undefined.");var n=e.message.statusCode,r=e.message.reasonPhrase,o="SIP/2.0 ".concat(n," ").concat(r).trim(),i=this._referred.dialog.notify(void 0,{extraHeaders:["Event: refer","Subscription-State: terminated"],body:{contentDisposition:"render",contentType:"message/sipfrag",content:o}});i.delegate={onReject:function(){t._referred=void 0}}}}},t.prototype.onAccept=function(e){var t=this;if(this.logger.log("Inviter.onAccept"),this.state!==_e.Establishing)return this.logger.error("Accept received while in state ".concat(this.state,", dropping response")),Promise.reject(new Error("Invalid session state ".concat(this.state)));var n=e.message,r=e.session;switch(n.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=g.nameAddrHeaderParse(n.getHeader("P-Asserted-Identity"))),r.delegate={onAck:function(e){return t.onAckRequest(e)},onBye:function(e){return t.onByeRequest(e)},onInfo:function(e){return t.onInfoRequest(e)},onInvite:function(e){return t.onInviteRequest(e)},onMessage:function(e){return t.onMessageRequest(e)},onNotify:function(e){return t.onNotifyRequest(e)},onPrack:function(e){return t.onPrackRequest(e)},onRefer:function(e){return t.onReferRequest(e)}},this._dialog=r,r.signalingState){case j.Initial:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(_e.Terminated),Promise.reject(new Error("Bad Media Description"));case j.HaveLocalOffer:return this.logger.error("Received 2xx response to INVITE without a session description"),this.ackAndBye(e,400,"Missing session description"),this.stateTransition(_e.Terminated),Promise.reject(new Error("Bad Media Description"));case j.HaveRemoteOffer:if(!this._dialog.offer)throw new Error("Session offer undefined in signaling state ".concat(this._dialog.signalingState,"."));var o={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setOfferAndGetAnswer(this._dialog.offer,o).then((function(n){e.ack({body:n}),t.stateTransition(_e.Established)})).catch((function(n){throw t.ackAndBye(e,488,"Invalid session description"),t.stateTransition(_e.Terminated),n}));case j.Stable:if(this.earlyMediaSessionDescriptionHandlers.size>0){var i=this.earlyMediaSessionDescriptionHandlers.get(r.id);if(!i)throw new Error("Session description handler undefined.");return this.setSessionDescriptionHandler(i),this.earlyMediaSessionDescriptionHandlers.delete(r.id),e.ack(),this.stateTransition(_e.Established),Promise.resolve()}if(this.earlyMediaDialog){if(this.earlyMediaDialog!==r){if(this.earlyMedia){var s="You have set the 'earlyMedia' option to 'true' which requires that your INVITE requests do not fork and yet this INVITE request did in fact fork. Consequentially and not surprisingly the end point which accepted the INVITE (confirmed dialog) does not match the end point with which early media has been setup (early dialog) and thus this session is unable to proceed. In accordance with the SIP specifications, the SIP servers your end point is connected to determine if an INVITE forks and the forking behavior of those servers cannot be controlled by this library. If you wish to use early media with this library you must configure those servers accordingly. Alternatively you may set the 'earlyMedia' to 'false' which will allow this library to function with any INVITE requests which do fork.";this.logger.error(s)}var a=new Error("Early media dialog does not equal confirmed dialog, terminating session");return this.logger.error(a.message),this.ackAndBye(e,488,"Not Acceptable Here"),this.stateTransition(_e.Terminated),Promise.reject(a)}return e.ack(),this.stateTransition(_e.Established),Promise.resolve()}var l=r.answer;if(!l)throw new Error("Answer is undefined.");o={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(l,o).then((function(){var n;t._renderbody&&t._rendertype&&(n={body:{contentDisposition:"render",contentType:t._rendertype,content:t._renderbody}}),e.ack(n),t.stateTransition(_e.Established)})).catch((function(n){throw t.logger.error(n.message),t.ackAndBye(e,488,"Not Acceptable Here"),t.stateTransition(_e.Terminated),n}));case j.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}},t.prototype.onProgress=function(e){var t,n=this;if(this.logger.log("Inviter.onProgress"),this.state!==_e.Establishing)return this.logger.error("Progress received while in state ".concat(this.state,", dropping response")),Promise.reject(new Error("Invalid session state ".concat(this.state)));if(!this.outgoingInviteRequest)throw new Error("Outgoing INVITE request undefined.");var r=e.message,o=e.session;r.hasHeader("P-Asserted-Identity")&&(this._assertedIdentity=g.nameAddrHeaderParse(r.getHeader("P-Asserted-Identity")));var i=r.getHeader("require"),s=r.getHeader("rseq"),a=i&&i.includes("100rel")&&s?Number(s):void 0,l=!!a,c=[];switch(l&&c.push("RAck: "+r.getHeader("rseq")+" "+r.getHeader("cseq")),o.signalingState){case j.Initial:return l&&(this.logger.warn("First reliable provisional response received MUST contain an offer when INVITE does not contain an offer."),e.prack({extraHeaders:c})),Promise.resolve();case j.HaveLocalOffer:return l&&e.prack({extraHeaders:c}),Promise.resolve();case j.HaveRemoteOffer:if(!l)return this.logger.warn("Non-reliable provisional response MUST NOT contain an initial offer, discarding response."),Promise.resolve();var u=this.sessionDescriptionHandlerFactory(this,this.userAgent.configuration.sessionDescriptionHandlerFactoryOptions||{});return(null===(t=this.delegate)||void 0===t?void 0:t.onSessionDescriptionHandler)&&this.delegate.onSessionDescriptionHandler(u,!0),this.earlyMediaSessionDescriptionHandlers.set(o.id,u),u.setDescription(r.body,this.sessionDescriptionHandlerOptions,this.sessionDescriptionHandlerModifiers).then((function(){return u.getDescription(n.sessionDescriptionHandlerOptions,n.sessionDescriptionHandlerModifiers)})).then((function(t){var n={contentDisposition:"session",contentType:t.contentType,content:t.body};e.prack({extraHeaders:c,body:n})})).catch((function(e){throw n.stateTransition(_e.Terminated),e}));case j.Stable:if(l&&e.prack({extraHeaders:c}),this.earlyMedia&&!this.earlyMediaDialog){this.earlyMediaDialog=o;var d=o.answer;if(!d)throw new Error("Answer is undefined.");var p={sessionDescriptionHandlerModifiers:this.sessionDescriptionHandlerModifiers,sessionDescriptionHandlerOptions:this.sessionDescriptionHandlerOptions};return this.setAnswer(d,p).catch((function(e){throw n.stateTransition(_e.Terminated),e}))}return Promise.resolve();case j.Closed:return Promise.reject(new Error("Terminated."));default:throw new Error("Unknown session signaling state.")}},t.prototype.onRedirect=function(e){this.logger.log("Inviter.onRedirect"),this.state===_e.Establishing||this.state===_e.Terminating?this.stateTransition(_e.Terminated):this.logger.error("Redirect received while in state ".concat(this.state,", dropping response"))},t.prototype.onReject=function(e){this.logger.log("Inviter.onReject"),this.state===_e.Establishing||this.state===_e.Terminating?this.stateTransition(_e.Terminated):this.logger.error("Reject received while in state ".concat(this.state,", dropping response"))},t.prototype.onTrying=function(e){this.logger.log("Inviter.onTrying"),this.state===_e.Establishing||this.logger.error("Trying received while in state ".concat(this.state,", dropping response"))},t}(Je),nt=function(){function e(e,t,n,r,o){void 0===r&&(r="text/plain"),void 0===o&&(o={}),this.logger=e.getLogger("sip.Messager"),o.params=o.params||{};var s=e.userAgentCore.configuration.aor;if(o.params.fromUri&&(s="string"===typeof o.params.fromUri?g.URIParse(o.params.fromUri):o.params.fromUri),!s)throw new TypeError("Invalid from URI: "+o.params.fromUri);var a=t;if(o.params.toUri&&(a="string"===typeof o.params.toUri?g.URIParse(o.params.toUri):o.params.toUri),!a)throw new TypeError("Invalid to URI: "+o.params.toUri);var l=o.params?i({},o.params):{},c=(o.extraHeaders||[]).slice(),u="render",d={contentDisposition:u,contentType:r,content:n};this.request=e.userAgentCore.makeOutgoingRequestMessage(m.MESSAGE,t,s,a,l,c,d),this.userAgent=e}return e.prototype.message=function(e){return void 0===e&&(e={}),this.userAgent.userAgentCore.request(this.request,e.requestDelegate),Promise.resolve()},e}();(function(e){e["Initial"]="Initial",e["Published"]="Published",e["Unpublished"]="Unpublished",e["Terminated"]="Terminated"})(Ze||(Ze={})),function(){function e(e,t,n,r){void 0===r&&(r={}),this.disposed=!1,this._state=Ze.Initial,this._stateEventEmitter=new Ue,this.userAgent=e,r.extraHeaders=(r.extraHeaders||[]).slice(),r.contentType=r.contentType||"text/plain","number"!==typeof r.expires||r.expires%1!==0?r.expires=3600:r.expires=Number(r.expires),"boolean"!==typeof r.unpublishOnClose&&(r.unpublishOnClose=!0),this.target=t,this.event=n,this.options=r,this.pubRequestExpires=r.expires,this.logger=e.getLogger("sip.Publisher");var o,i=r.params||{},s=i.fromUri?i.fromUri:e.userAgentCore.configuration.aor,a=i.toUri?i.toUri:t;if(r.body&&r.contentType){var l="render",c=r.contentType,u=r.body;o={contentDisposition:l,contentType:c,content:u}}var d=(r.extraHeaders||[]).slice();this.request=e.userAgentCore.makeOutgoingRequestMessage(m.PUBLISH,t,s,a,i,d,o),this.id=this.target.toString()+":"+this.event,this.userAgent._publishers[this.id]=this}e.prototype.dispose=function(){return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log("Publisher ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this.userAgent._publishers[this.id],this.options.unpublishOnClose&&this.state===Ze.Published?this.unpublish():(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestExpires=0,this.pubRequestEtag=void 0,Promise.resolve()))},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.publish=function(e,t){if(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.options.body=e,this.pubRequestBody=this.options.body,0===this.pubRequestExpires){if(void 0===this.options.expires)throw new Error("Expires undefined.");this.pubRequestExpires=this.options.expires,this.pubRequestEtag=void 0}return this.sendPublishRequest(),Promise.resolve()},e.prototype.unpublish=function(e){return this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestExpires=0,void 0!==this.pubRequestEtag&&this.sendPublishRequest(),Promise.resolve()},e.prototype.receiveResponse=function(e){var t=this,n=e.statusCode||0;switch(!0){case/^1[0-9]{2}$/.test(n.toString()):break;case/^2[0-9]{2}$/.test(n.toString()):if(e.hasHeader("SIP-ETag")?this.pubRequestEtag=e.getHeader("SIP-ETag"):this.logger.warn("SIP-ETag header missing in a 200-class response to PUBLISH"),e.hasHeader("Expires")){var r=Number(e.getHeader("Expires"));"number"===typeof r&&r>=0&&r<=this.pubRequestExpires?this.pubRequestExpires=r:this.logger.warn("Bad Expires header in a 200-class response to PUBLISH")}else this.logger.warn("Expires header missing in a 200-class response to PUBLISH");0!==this.pubRequestExpires?(this.publishRefreshTimer=setTimeout((function(){return t.refreshRequest()}),900*this.pubRequestExpires),this._state!==Ze.Published&&this.stateTransition(Ze.Published)):this.stateTransition(Ze.Unpublished);break;case/^412$/.test(n.toString()):if(void 0!==this.pubRequestEtag&&0!==this.pubRequestExpires){if(this.logger.warn("412 response to PUBLISH, recovering"),this.pubRequestEtag=void 0,void 0===this.options.body)throw new Error("Body undefined.");this.publish(this.options.body)}else this.logger.warn("412 response to PUBLISH, recovery failed"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break;case/^423$/.test(n.toString()):if(0!==this.pubRequestExpires&&e.hasHeader("Min-Expires")){var o=Number(e.getHeader("Min-Expires"));if("number"===typeof o||o>this.pubRequestExpires){if(this.logger.warn("423 code in response to PUBLISH, adjusting the Expires value and trying to recover"),this.pubRequestExpires=o,void 0===this.options.body)throw new Error("Body undefined.");this.publish(this.options.body)}else this.logger.warn("Bad 423 response Min-Expires header received for PUBLISH"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated)}else this.logger.warn("423 response to PUBLISH, recovery failed"),this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break;default:this.pubRequestExpires=0,this.stateTransition(Ze.Unpublished),this.stateTransition(Ze.Terminated);break}0===this.pubRequestExpires&&(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,this.pubRequestEtag=void 0)},e.prototype.send=function(){var e=this;return this.userAgent.userAgentCore.publish(this.request,{onAccept:function(t){return e.receiveResponse(t.message)},onProgress:function(t){return e.receiveResponse(t.message)},onRedirect:function(t){return e.receiveResponse(t.message)},onReject:function(t){return e.receiveResponse(t.message)},onTrying:function(t){return e.receiveResponse(t.message)}})},e.prototype.refreshRequest=function(){if(this.publishRefreshTimer&&(clearTimeout(this.publishRefreshTimer),this.publishRefreshTimer=void 0),this.pubRequestBody=void 0,void 0===this.pubRequestEtag)throw new Error("Etag undefined");if(0===this.pubRequestExpires)throw new Error("Expires zero");this.sendPublishRequest()},e.prototype.sendPublishRequest=function(){var e=i({},this.options);e.extraHeaders=(this.options.extraHeaders||[]).slice(),e.extraHeaders.push("Event: "+this.event),e.extraHeaders.push("Expires: "+this.pubRequestExpires),void 0!==this.pubRequestEtag&&e.extraHeaders.push("SIP-If-Match: "+this.pubRequestEtag);var t,n,r=this.target,o=this.options.params||{};if(void 0!==this.pubRequestBody){if(void 0===this.options.contentType)throw new Error("Content type undefined.");t={body:this.pubRequestBody,contentType:this.options.contentType}}return t&&(n=I(t)),this.request=this.userAgent.userAgentCore.makeOutgoingRequestMessage(m.PUBLISH,r,o.fromUri?o.fromUri:this.userAgent.userAgentCore.configuration.aor,o.toUri?o.toUri:this.target,o,e.extraHeaders,n),this.send()},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case Ze.Initial:e!==Ze.Published&&e!==Ze.Unpublished&&e!==Ze.Terminated&&n();break;case Ze.Published:e!==Ze.Unpublished&&e!==Ze.Terminated&&n();break;case Ze.Unpublished:e!==Ze.Published&&e!==Ze.Terminated&&n();break;case Ze.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Publication transitioned to state ".concat(this._state)),this._stateEventEmitter.emit(this._state),e===Ze.Terminated&&this.dispose()}}(),function(e){e["Initial"]="Initial",e["Registered"]="Registered",e["Unregistered"]="Unregistered",e["Terminated"]="Terminated"}(Xe||(Xe={}));var rt,ot=function(){function e(t,n){var r=this;void 0===n&&(n={}),this.disposed=!1,this._contacts=[],this._retryAfter=void 0,this._state=Xe.Initial,this._waiting=!1,this._stateEventEmitter=new Ue,this._waitingEventEmitter=new Ue,this.userAgent=t;var o=t.configuration.uri.clone();if(o.user=void 0,this.options=i(i(i({},e.defaultOptions()),{registrar:o}),e.stripUndefinedProperties(n)),this.options.extraContactHeaderParams=(this.options.extraContactHeaderParams||[]).slice(),this.options.extraHeaders=(this.options.extraHeaders||[]).slice(),!this.options.registrar)throw new Error("Registrar undefined.");if(this.options.registrar=this.options.registrar.clone(),this.options.regId&&!this.options.instanceId?this.options.instanceId=e.newUUID():!this.options.regId&&this.options.instanceId&&(this.options.regId=1),this.options.instanceId&&-1===g.parse(this.options.instanceId,"uuid"))throw new Error("Invalid instanceId.");if(this.options.regId&&this.options.regId<0)throw new Error("Invalid regId.");var s=this.options.registrar,a=this.options.params&&this.options.params.fromUri||t.userAgentCore.configuration.aor,l=this.options.params&&this.options.params.toUri||t.configuration.uri,c=this.options.params||{},u=(n.extraHeaders||[]).slice();if(this.request=t.userAgentCore.makeOutgoingRequestMessage(m.REGISTER,s,a,l,c,u,void 0),this.expires=this.options.expires||e.defaultExpires,this.expires<0)throw new Error("Invalid expires.");if(this.refreshFrequency=this.options.refreshFrequency||e.defaultRefreshFrequency,this.refreshFrequency<50||this.refreshFrequency>99)throw new Error("Invalid refresh frequency. The value represents a percentage of the expiration time and should be between 50 and 99.");this.logger=t.getLogger("sip.Registerer"),this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach((function(e){var t=r.options[e];switch(e){case"registrar":r.logger.log("· "+e+": "+t);break;default:r.logger.log("· "+e+": "+JSON.stringify(t))}}))),this.id=this.request.callId+this.request.from.parameters.tag,this.userAgent._registerers[this.id]=this}return e.defaultOptions=function(){return{expires:e.defaultExpires,extraContactHeaderParams:[],extraHeaders:[],logConfiguration:!0,instanceId:"",params:{},regId:0,registrar:new d("sip","anonymous","anonymous.invalid"),refreshFrequency:e.defaultRefreshFrequency}},e.newUUID=function(){var e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(16*Math.random()),n="x"===e?t:t%4+8;return n.toString(16)}));return e},e.stripUndefinedProperties=function(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})},Object.defineProperty(e.prototype,"contacts",{get:function(){return this._contacts.slice()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"retryAfter",{get:function(){return this._retryAfter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){var e=this;return this.disposed?Promise.resolve():(this.disposed=!0,this.logger.log("Registerer ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this.userAgent._registerers[this.id],new Promise((function(t){var n=function(){if(!e.waiting&&e._state===Xe.Registered)return e.stateChange.addListener((function(){e.terminated(),t()}),{once:!0}),void e.unregister();e.terminated(),t()};e.waiting?e.waitingChange.addListener((function(){n()}),{once:!0}):n()})))},e.prototype.register=function(e){var t=this;if(void 0===e&&(e={}),this.state===Xe.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();var n=new je("REGISTER request already in progress, waiting for final response");return Promise.reject(n)}e.requestOptions&&(this.options=i(i({},this.options),e.requestOptions));var r=(this.options.extraHeaders||[]).slice();r.push("Contact: "+this.generateContactHeader(this.expires)),r.push("Allow: "+["ACK","CANCEL","INVITE","MESSAGE","BYE","OPTIONS","INFO","NOTIFY","REFER"].toString()),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),this.request.extraHeaders=r,this.waitingToggle(!0);var o=this.userAgent.userAgentCore.register(this.request,{onAccept:function(n){var r;n.message.hasHeader("expires")&&(r=Number(n.message.getHeader("expires"))),t._contacts=n.message.getHeaders("contact");var o,i=t._contacts.length;if(!i)return t.logger.error("No Contact header in response to REGISTER, dropping response."),void t.unregistered();while(i--){if(o=n.message.parseHeader("contact",i),!o)throw new Error("Contact undefined");if(t.userAgent.contact.pubGruu&&p(o.uri,t.userAgent.contact.pubGruu)){r=Number(o.getParam("expires"));break}if(""===t.userAgent.configuration.contactName){if(o.uri.user===t.userAgent.contact.uri.user){r=Number(o.getParam("expires"));break}}else if(p(o.uri,t.userAgent.contact.uri)){r=Number(o.getParam("expires"));break}o=void 0}if(void 0===o)return t.logger.error("No Contact header pointing to us, dropping response"),t.unregistered(),void t.waitingToggle(!1);if(void 0===r)return t.logger.error("Contact pointing to us is missing expires parameter, dropping response"),t.unregistered(),void t.waitingToggle(!1);if(o.hasParam("temp-gruu")){var s=o.getParam("temp-gruu");s&&(t.userAgent.contact.tempGruu=g.URIParse(s.replace(/"/g,"")))}if(o.hasParam("pub-gruu")){s=o.getParam("pub-gruu");s&&(t.userAgent.contact.pubGruu=g.URIParse(s.replace(/"/g,"")))}t.registered(r),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n),t.waitingToggle(!1)},onProgress:function(t){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)},onRedirect:function(n){t.logger.error("Redirect received. Not supported."),t.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n),t.waitingToggle(!1)},onReject:function(n){if(423===n.message.statusCode)return n.message.hasHeader("min-expires")?(t.expires=Number(n.message.getHeader("min-expires")),t.waitingToggle(!1),void t.register()):(t.logger.error("423 response received for REGISTER without Min-Expires, dropping response"),t.unregistered(),void t.waitingToggle(!1));t.logger.warn("Failed to register, status code ".concat(n.message.statusCode));var r=NaN;if(500===n.message.statusCode||503===n.message.statusCode){var o=n.message.getHeader("retry-after");o&&(r=Number.parseInt(o,void 0))}t._retryAfter=isNaN(r)?void 0:r,t.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n),t._retryAfter=void 0,t.waitingToggle(!1)},onTrying:function(t){e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}});return Promise.resolve(o)},e.prototype.unregister=function(e){var t=this;if(void 0===e&&(e={}),this.state===Xe.Terminated)throw this.stateError(),new Error("Registerer terminated. Unable to register.");if(this.disposed&&this.state!==Xe.Registered)throw this.stateError(),new Error("Registerer disposed. Unable to register.");if(this.waiting){this.waitingWarning();var n=new je("REGISTER request already in progress, waiting for final response");return Promise.reject(n)}this._state===Xe.Registered||e.all||this.logger.warn("Not currently registered, but sending an unregister anyway.");var r=(e.requestOptions&&e.requestOptions.extraHeaders||[]).slice();this.request.extraHeaders=r,e.all?(r.push("Contact: *"),r.push("Expires: 0")):r.push("Contact: "+this.generateContactHeader(0)),this.request.cseq++,this.request.setHeader("cseq",this.request.cseq+" REGISTER"),void 0!==this.registrationTimer&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),this.waitingToggle(!0);var o=this.userAgent.userAgentCore.register(this.request,{onAccept:function(n){t._contacts=n.message.getHeaders("contact"),t.unregistered(),e.requestDelegate&&e.requestDelegate.onAccept&&e.requestDelegate.onAccept(n),t.waitingToggle(!1)},onProgress:function(t){e.requestDelegate&&e.requestDelegate.onProgress&&e.requestDelegate.onProgress(t)},onRedirect:function(n){t.logger.error("Unregister redirected. Not currently supported."),t.unregistered(),e.requestDelegate&&e.requestDelegate.onRedirect&&e.requestDelegate.onRedirect(n),t.waitingToggle(!1)},onReject:function(n){t.logger.error("Unregister rejected with status code ".concat(n.message.statusCode)),t.unregistered(),e.requestDelegate&&e.requestDelegate.onReject&&e.requestDelegate.onReject(n),t.waitingToggle(!1)},onTrying:function(t){e.requestDelegate&&e.requestDelegate.onTrying&&e.requestDelegate.onTrying(t)}});return Promise.resolve(o)},e.prototype.clearTimers=function(){void 0!==this.registrationTimer&&(clearTimeout(this.registrationTimer),this.registrationTimer=void 0),void 0!==this.registrationExpiredTimer&&(clearTimeout(this.registrationExpiredTimer),this.registrationExpiredTimer=void 0)},e.prototype.generateContactHeader=function(e){var t=this.userAgent.contact.toString();return this.options.regId&&this.options.instanceId&&(t+=";reg-id="+this.options.regId,t+=';+sip.instance="<urn:uuid:'+this.options.instanceId+'>"'),this.options.extraContactHeaderParams&&this.options.extraContactHeaderParams.forEach((function(e){t+=";"+e})),t+=";expires="+e,t},e.prototype.registered=function(e){var t=this;this.clearTimers(),this.registrationTimer=setTimeout((function(){t.registrationTimer=void 0,t.register()}),this.refreshFrequency/100*e*1e3),this.registrationExpiredTimer=setTimeout((function(){t.logger.warn("Registration expired"),t.unregistered()}),1e3*e),this._state!==Xe.Registered&&this.stateTransition(Xe.Registered)},e.prototype.unregistered=function(){this.clearTimers(),this._state!==Xe.Unregistered&&this.stateTransition(Xe.Unregistered)},e.prototype.terminated=function(){this.clearTimers(),this._state!==Xe.Terminated&&this.stateTransition(Xe.Terminated)},e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case Xe.Initial:e!==Xe.Registered&&e!==Xe.Unregistered&&e!==Xe.Terminated&&n();break;case Xe.Registered:e!==Xe.Unregistered&&e!==Xe.Terminated&&n();break;case Xe.Unregistered:e!==Xe.Registered&&e!==Xe.Terminated&&n();break;case Xe.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state=e,this.logger.log("Registration transitioned to state ".concat(this._state)),this._stateEventEmitter.emit(this._state),e===Xe.Terminated&&this.dispose()},Object.defineProperty(e.prototype,"waiting",{get:function(){return this._waiting},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"waitingChange",{get:function(){return this._waitingEventEmitter},enumerable:!1,configurable:!0}),e.prototype.waitingToggle=function(e){if(this._waiting===e)throw new Error("Invalid waiting transition from ".concat(this._waiting," to ").concat(e));this._waiting=e,this.logger.log("Waiting toggled to ".concat(this._waiting)),this._waitingEventEmitter.emit(this._waiting)},e.prototype.waitingWarning=function(){var e="An attempt was made to send a REGISTER request while a prior one was still in progress.";e+=" RFC 3261 requires UAs MUST NOT send a new registration until they have received a final response",e+=" from the registrar for the previous one or the previous REGISTER request has timed out.",e+=" Note that if the transport disconnects, you still must wait for the prior request to time out before",e+=" sending a new REGISTER request or alternatively dispose of the current Registerer and create a new Registerer.",this.logger.warn(e)},e.prototype.stateError=function(){var e=this.state===Xe.Terminated?"is in 'Terminated' state":"has been disposed",t="An attempt was made to send a REGISTER request when the Registerer ".concat(e,".");t+=" The Registerer transitions to 'Terminated' when Registerer.dispose() is called.",t+=" Perhaps you called UserAgent.stop() which dipsoses of all Registerers?",this.logger.error(t)},e.defaultExpires=600,e.defaultRefreshFrequency=99,e}();(function(e){e["Initial"]="Initial",e["NotifyWait"]="NotifyWait",e["Subscribed"]="Subscribed",e["Terminated"]="Terminated"})(rt||(rt={}));var it=function(){function e(e,t){void 0===t&&(t={}),this._disposed=!1,this._state=rt.Initial,this._logger=e.getLogger("sip.Subscription"),this._stateEventEmitter=new Ue,this._userAgent=e,this.delegate=t.delegate}return e.prototype.dispose=function(){return this._disposed||(this._disposed=!0,this._stateEventEmitter.removeAllListeners()),Promise.resolve()},Object.defineProperty(e.prototype,"dialog",{get:function(){return this._dialog},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),e.prototype.stateTransition=function(e){var t=this,n=function(){throw new Error("Invalid state transition from ".concat(t._state," to ").concat(e))};switch(this._state){case rt.Initial:e!==rt.NotifyWait&&e!==rt.Terminated&&n();break;case rt.NotifyWait:e!==rt.Subscribed&&e!==rt.Terminated&&n();break;case rt.Subscribed:e!==rt.Terminated&&n();break;case rt.Terminated:n();break;default:throw new Error("Unrecognized state.")}this._state!==e&&(this._state=e,this._logger.log("Subscription ".concat(this._dialog?this._dialog.id:void 0," transitioned to ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===rt.Terminated&&this.dispose())},e}();(function(e){function t(t,n,r,o){void 0===o&&(o={});var i=e.call(this,t,o)||this;return i.body=void 0,i.logger=t.getLogger("sip.Subscriber"),o.body&&(i.body={body:o.body,contentType:o.contentType?o.contentType:"application/sdp"}),i.targetURI=n,i.event=r,void 0===o.expires?i.expires=3600:"number"!==typeof o.expires?(i.logger.warn('Option "expires" must be a number. Using default of 3600.'),i.expires=3600):i.expires=o.expires,i.extraHeaders=(o.extraHeaders||[]).slice(),i.subscriberRequest=i.initSubscriberRequest(),i.outgoingRequestMessage=i.subscriberRequest.message,i.id=i.outgoingRequestMessage.callId+i.outgoingRequestMessage.from.parameters.tag+i.event,i._userAgent._subscriptions[i.id]=i,i}o(t,e),t.prototype.dispose=function(){var t=this;return this.disposed?Promise.resolve():(this.logger.log("Subscription ".concat(this.id," in state ").concat(this.state," is being disposed")),delete this._userAgent._subscriptions[this.id],this.retryAfterTimer&&(clearTimeout(this.retryAfterTimer),this.retryAfterTimer=void 0),this.subscriberRequest.dispose(),e.prototype.dispose.call(this).then((function(){if(t.state===rt.Subscribed){if(!t._dialog)throw new Error("Dialog undefined.");if(t._dialog.subscriptionState===ye.Pending||t._dialog.subscriptionState===ye.Active){var e=t._dialog;return new Promise((function(t,n){e.delegate={onTerminated:function(){return t()}},e.unsubscribe()}))}}})))},t.prototype.subscribe=function(e){var t=this;switch(this.subscriberRequest.state){case ye.Initial:this.state===rt.Initial&&this.stateTransition(rt.NotifyWait),this.subscriberRequest.subscribe().then((function(e){e.success?(e.success.subscription&&(t._dialog=e.success.subscription,t._dialog.delegate={onNotify:function(e){return t.onNotify(e)},onRefresh:function(e){return t.onRefresh(e)},onTerminated:function(){t.state!==rt.Terminated&&t.stateTransition(rt.Terminated)}}),t.onNotify(e.success.request)):e.failure&&t.unsubscribe()}));break;case ye.NotifyWait:break;case ye.Pending:break;case ye.Active:if(this._dialog){var n=this._dialog.refresh();n.delegate={onAccept:function(e){return t.onAccepted(e)},onRedirect:function(e){return t.unsubscribe()},onReject:function(e){return t.unsubscribe()}}}break;case ye.Terminated:break}return Promise.resolve()},t.prototype.unsubscribe=function(e){if(this.disposed)return Promise.resolve();switch(this.subscriberRequest.state){case ye.Initial:break;case ye.NotifyWait:break;case ye.Pending:this._dialog&&this._dialog.unsubscribe();break;case ye.Active:this._dialog&&this._dialog.unsubscribe();break;case ye.Terminated:break;default:throw new Error("Unknown state.")}return this.stateTransition(rt.Terminated),Promise.resolve()},t.prototype._refresh=function(){return this.subscriberRequest.state===ye.Active?this.subscribe():Promise.resolve()},t.prototype.onAccepted=function(e){},t.prototype.onNotify=function(e){var t=this;if(this.disposed)e.accept();else{if(this.state!==rt.Subscribed&&this.stateTransition(rt.Subscribed),this.delegate&&this.delegate.onNotify){var n=new We(e);this.delegate.onNotify(n)}else e.accept();var r=e.message.parseHeader("Subscription-State");if(r&&r.state)switch(r.state){case"terminated":if(r.reason)switch(this.logger.log("Terminated subscription with reason ".concat(r.reason)),r.reason){case"deactivated":case"timeout":return this.initSubscriberRequest(),void this.subscribe();case"probation":case"giveup":return this.initSubscriberRequest(),void(r.params&&r.params["retry-after"]?this.retryAfterTimer=setTimeout((function(){t.subscribe()}),r.params["retry-after"]):this.subscribe())}this.unsubscribe();break}}},t.prototype.onRefresh=function(e){var t=this;e.delegate={onAccept:function(e){return t.onAccepted(e)}}},t.prototype.initSubscriberRequest=function(){var e=this,t={extraHeaders:this.extraHeaders,body:this.body?I(this.body):void 0};return this.subscriberRequest=new lt(this._userAgent.userAgentCore,this.targetURI,this.event,this.expires,t),this.subscriberRequest.delegate={onAccept:function(t){return e.onAccepted(t)}},this.subscriberRequest}})(it);var st,at,lt=function(){function e(e,t,n,r,o,i){this.core=e,this.target=t,this.event=n,this.expires=r,this.subscribed=!1,this.logger=e.loggerFactory.getLogger("sip.Subscriber"),this.delegate=i;var s="Allow: "+Se.toString(),a=(o&&o.extraHeaders||[]).slice();a.push(s),a.push("Event: "+this.event),a.push("Expires: "+this.expires),a.push("Contact: "+this.core.configuration.contact.toString());var l=o&&o.body;this.message=e.makeOutgoingRequestMessage(m.SUBSCRIBE,this.target,this.core.configuration.aor,this.target,{},a,l)}return e.prototype.dispose=function(){this.request&&(this.request.waitNotifyStop(),this.request.dispose(),this.request=void 0)},Object.defineProperty(e.prototype,"state",{get:function(){return this.subscription?this.subscription.subscriptionState:this.subscribed?ye.NotifyWait:ye.Initial},enumerable:!1,configurable:!0}),e.prototype.subscribe=function(){var e=this;return this.subscribed?Promise.reject(new Error("Not in initial state. Did you call subscribe more than once?")):(this.subscribed=!0,new Promise((function(t){if(!e.message)throw new Error("Message undefined.");e.request=e.core.subscribe(e.message,{onAccept:function(t){e.delegate&&e.delegate.onAccept&&e.delegate.onAccept(t)},onNotify:function(n){e.subscription=n.subscription,e.subscription&&(e.subscription.autoRefresh=!0),t({success:n})},onNotifyTimeout:function(){t({failure:{}})},onRedirect:function(e){t({failure:{response:e}})},onReject:function(e){t({failure:{response:e}})}})})))},e}();function ct(){return function(e){return e.audio||e.video?void 0===navigator.mediaDevices?Promise.reject(new Error("Media devices not available in insecure contexts.")):navigator.mediaDevices.getUserMedia.call(navigator.mediaDevices,e):Promise.resolve(new MediaStream)}}function ut(){var e={bundlePolicy:"balanced",certificates:void 0,iceCandidatePoolSize:0,iceServers:[{urls:"stun:stun.l.google.com:19302"}],iceTransportPolicy:"all",peerIdentity:void 0,rtcpMuxPolicy:"require"};return e}(function(e){e["Connecting"]="Connecting",e["Connected"]="Connected",e["Disconnecting"]="Disconnecting",e["Disconnected"]="Disconnected"})(st||(st={})),function(e){e["Started"]="Started",e["Stopped"]="Stopped"}(at||(at={}));var dt=function(){function e(e,t,n){e.debug("SessionDescriptionHandler.constructor"),this.logger=e,this.mediaStreamFactory=t,this.sessionDescriptionHandlerConfiguration=n,this._localMediaStream=new MediaStream,this._remoteMediaStream=new MediaStream,this._peerConnection=new RTCPeerConnection(null===n||void 0===n?void 0:n.peerConnectionConfiguration),this.initPeerConnectionEventHandlers()}return Object.defineProperty(e.prototype,"localMediaStream",{get:function(){return this._localMediaStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteMediaStream",{get:function(){return this._remoteMediaStream},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataChannel",{get:function(){return this._dataChannel},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerConnection",{get:function(){return this._peerConnection},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"peerConnectionDelegate",{get:function(){return this._peerConnectionDelegate},set:function(e){this._peerConnectionDelegate=e},enumerable:!1,configurable:!0}),e.dispatchAddTrackEvent=function(e,t){e.dispatchEvent(new MediaStreamTrackEvent("addtrack",{track:t}))},e.dispatchRemoveTrackEvent=function(e,t){e.dispatchEvent(new MediaStreamTrackEvent("removetrack",{track:t}))},e.prototype.close=function(){this.logger.debug("SessionDescriptionHandler.close"),void 0!==this._peerConnection&&(this._peerConnection.getReceivers().forEach((function(e){e.track&&e.track.stop()})),this._peerConnection.getSenders().forEach((function(e){e.track&&e.track.stop()})),this._dataChannel&&this._dataChannel.close(),this._peerConnection.close(),this._peerConnection=void 0)},e.prototype.getDescription=function(e,t){var n,r,o=this;if(this.logger.debug("SessionDescriptionHandler.getDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=null===e||void 0===e?void 0:e.onDataChannel;var i=null===(n=null===e||void 0===e?void 0:e.offerOptions)||void 0===n?void 0:n.iceRestart,s=void 0===(null===e||void 0===e?void 0:e.iceGatheringTimeout)?null===(r=this.sessionDescriptionHandlerConfiguration)||void 0===r?void 0:r.iceGatheringTimeout:null===e||void 0===e?void 0:e.iceGatheringTimeout;return this.getLocalMediaStream(e).then((function(){return o.updateDirection(e)})).then((function(){return o.createDataChannel(e)})).then((function(){return o.createLocalOfferOrAnswer(e)})).then((function(e){return o.applyModifiers(e,t)})).then((function(e){return o.setLocalSessionDescription(e)})).then((function(){return o.waitForIceGatheringComplete(i,s)})).then((function(){return o.getLocalSessionDescription()})).then((function(e){return{body:e.sdp,contentType:"application/sdp"}})).catch((function(e){throw o.logger.error("SessionDescriptionHandler.getDescription failed - "+e),e}))},e.prototype.hasDescription=function(e){return this.logger.debug("SessionDescriptionHandler.hasDescription"),"application/sdp"===e},e.prototype.sendDtmf=function(e,t){if(this.logger.debug("SessionDescriptionHandler.sendDtmf"),void 0===this._peerConnection)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - peer connection closed"),!1;var n=this._peerConnection.getSenders();if(0===n.length)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no senders"),!1;var r=n[0].dtmf;if(!r)return this.logger.error("SessionDescriptionHandler.sendDtmf failed - no DTMF sender"),!1;var o=null===t||void 0===t?void 0:t.duration,i=null===t||void 0===t?void 0:t.interToneGap;try{r.insertDTMF(e,o,i)}catch(s){return this.logger.error(s),!1}return this.logger.log("SessionDescriptionHandler.sendDtmf sent via RTP: "+e.toString()),!0},e.prototype.setDescription=function(e,t,n){var r=this;if(this.logger.debug("SessionDescriptionHandler.setDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));this.onDataChannel=null===t||void 0===t?void 0:t.onDataChannel;var o="have-local-offer"===this._peerConnection.signalingState?"answer":"offer";return this.getLocalMediaStream(t).then((function(){return r.applyModifiers({sdp:e,type:o},n)})).then((function(e){return r.setRemoteSessionDescription(e)})).catch((function(e){throw r.logger.error("SessionDescriptionHandler.setDescription failed - "+e),e}))},e.prototype.applyModifiers=function(e,t){var n=this;return this.logger.debug("SessionDescriptionHandler.applyModifiers"),t&&0!==t.length?t.reduce((function(e,t){return e.then(t)}),Promise.resolve(e)).then((function(e){if(n.logger.debug("SessionDescriptionHandler.applyModifiers - modified sdp"),!e.sdp||!e.type)throw new Error("Invalid SDP.");return{sdp:e.sdp,type:e.type}})):Promise.resolve(e)},e.prototype.createDataChannel=function(e){if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));if(!0!==(null===e||void 0===e?void 0:e.dataChannel))return Promise.resolve();if(this._dataChannel)return Promise.resolve();switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.createDataChannel - creating data channel");try{return this._dataChannel=this._peerConnection.createDataChannel((null===e||void 0===e?void 0:e.dataChannelLabel)||"",null===e||void 0===e?void 0:e.dataChannelOptions),this.onDataChannel&&this.onDataChannel(this._dataChannel),Promise.resolve()}catch(t){return Promise.reject(t)}case"have-remote-offer":return Promise.resolve();case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}},e.prototype.createLocalOfferOrAnswer=function(e){if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP offer"),this._peerConnection.createOffer(null===e||void 0===e?void 0:e.offerOptions);case"have-remote-offer":return this.logger.debug("SessionDescriptionHandler.createLocalOfferOrAnswer - creating SDP answer"),this._peerConnection.createAnswer(null===e||void 0===e?void 0:e.answerOptions);case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}},e.prototype.getLocalMediaStream=function(e){var t=this;if(this.logger.debug("SessionDescriptionHandler.getLocalMediaStream"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var n=i({},null===e||void 0===e?void 0:e.constraints);if(this.localMediaStreamConstraints){if(n.audio=n.audio||this.localMediaStreamConstraints.audio,n.video=n.video||this.localMediaStreamConstraints.video,JSON.stringify(this.localMediaStreamConstraints.audio)===JSON.stringify(n.audio)&&JSON.stringify(this.localMediaStreamConstraints.video)===JSON.stringify(n.video))return Promise.resolve()}else void 0===n.audio&&void 0===n.video&&(n={audio:!0});return this.localMediaStreamConstraints=n,this.mediaStreamFactory(n,this).then((function(e){return t.setLocalMediaStream(e)}))},e.prototype.setLocalMediaStream=function(t){var n=this;if(this.logger.debug("SessionDescriptionHandler.setLocalMediaStream"),!this._peerConnection)throw new Error("Peer connection undefined.");var r=this._peerConnection,o=this._localMediaStream,i=[],s=function(t){var s=t.kind;if("audio"!==s&&"video"!==s)throw new Error("Unknown new track kind ".concat(s,"."));var a=r.getSenders().find((function(e){return e.track&&e.track.kind===s}));a?i.push(new Promise((function(e){n.logger.debug("SessionDescriptionHandler.setLocalMediaStream - replacing sender ".concat(s," track")),e()})).then((function(){return a.replaceTrack(t).then((function(){var n=o.getTracks().find((function(e){return e.kind===s}));n&&(n.stop(),o.removeTrack(n),e.dispatchRemoveTrackEvent(o,n)),o.addTrack(t),e.dispatchAddTrackEvent(o,t)})).catch((function(e){throw n.logger.error("SessionDescriptionHandler.setLocalMediaStream - failed to replace sender ".concat(s," track")),e}))}))):i.push(new Promise((function(e){n.logger.debug("SessionDescriptionHandler.setLocalMediaStream - adding sender ".concat(s," track")),e()})).then((function(){try{r.addTrack(t,o)}catch(i){throw n.logger.error("SessionDescriptionHandler.setLocalMediaStream - failed to add sender ".concat(s," track")),i}o.addTrack(t),e.dispatchAddTrackEvent(o,t)})))},a=t.getAudioTracks();a.length&&s(a[0]);var l=t.getVideoTracks();return l.length&&s(l[0]),i.reduce((function(e,t){return e.then((function(){return t}))}),Promise.resolve())},e.prototype.getLocalSessionDescription=function(){if(this.logger.debug("SessionDescriptionHandler.getLocalSessionDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var e=this._peerConnection.localDescription;return e?Promise.resolve(e):Promise.reject(new Error("Failed to get local session description"))},e.prototype.setLocalSessionDescription=function(e){return this.logger.debug("SessionDescriptionHandler.setLocalSessionDescription"),void 0===this._peerConnection?Promise.reject(new Error("Peer connection closed.")):this._peerConnection.setLocalDescription(e)},e.prototype.setRemoteSessionDescription=function(e){if(this.logger.debug("SessionDescriptionHandler.setRemoteSessionDescription"),void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));var t,n=e.sdp;switch(this._peerConnection.signalingState){case"stable":t="offer";break;case"have-local-offer":t="answer";break;case"have-local-pranswer":case"have-remote-offer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return n?this._peerConnection.setRemoteDescription({sdp:n,type:t}):(this.logger.error("SessionDescriptionHandler.setRemoteSessionDescription failed - cannot set null sdp"),Promise.reject(new Error("SDP is undefined")))},e.prototype.setRemoteTrack=function(t){this.logger.debug("SessionDescriptionHandler.setRemoteTrack");var n=this._remoteMediaStream;n.getTrackById(t.id)?this.logger.debug("SessionDescriptionHandler.setRemoteTrack - have remote ".concat(t.kind," track")):"audio"===t.kind?(this.logger.debug("SessionDescriptionHandler.setRemoteTrack - adding remote ".concat(t.kind," track")),n.getAudioTracks().forEach((function(t){t.stop(),n.removeTrack(t),e.dispatchRemoveTrackEvent(n,t)})),n.addTrack(t),e.dispatchAddTrackEvent(n,t)):"video"===t.kind&&(this.logger.debug("SessionDescriptionHandler.setRemoteTrack - adding remote ".concat(t.kind," track")),n.getVideoTracks().forEach((function(t){t.stop(),n.removeTrack(t),e.dispatchRemoveTrackEvent(n,t)})),n.addTrack(t),e.dispatchAddTrackEvent(n,t))},e.prototype.updateDirection=function(e){var t=this;if(void 0===this._peerConnection)return Promise.reject(new Error("Peer connection closed."));switch(this._peerConnection.signalingState){case"stable":this.logger.debug("SessionDescriptionHandler.updateDirection - setting offer direction");var n=function(t){switch(t){case"inactive":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"recvonly":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"sendonly":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";case"sendrecv":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";case"stopped":return"stopped";default:throw new Error("Should never happen")}};this._peerConnection.getTransceivers().forEach((function(e){if(e.direction){var t=n(e.direction);e.direction!==t&&(e.direction=t)}}));break;case"have-remote-offer":this.logger.debug("SessionDescriptionHandler.updateDirection - setting answer direction");var r=function(){var e=t._peerConnection.remoteDescription;if(!e)throw new Error("Failed to read remote offer");var n=/a=sendrecv\r\n|a=sendonly\r\n|a=recvonly\r\n|a=inactive\r\n/.exec(e.sdp);if(n)switch(n[0]){case"a=inactive\r\n":return"inactive";case"a=recvonly\r\n":return"recvonly";case"a=sendonly\r\n":return"sendonly";case"a=sendrecv\r\n":return"sendrecv";default:throw new Error("Should never happen")}return"sendrecv"}(),o=function(){switch(r){case"inactive":return"inactive";case"recvonly":return"sendonly";case"sendonly":return(null===e||void 0===e?void 0:e.hold)?"inactive":"recvonly";case"sendrecv":return(null===e||void 0===e?void 0:e.hold)?"sendonly":"sendrecv";default:throw new Error("Should never happen")}}();this._peerConnection.getTransceivers().forEach((function(e){e.direction&&"stopped"!==e.direction&&e.direction!==o&&(e.direction=o)}));break;case"have-local-offer":case"have-local-pranswer":case"have-remote-pranswer":case"closed":default:return Promise.reject(new Error("Invalid signaling state "+this._peerConnection.signalingState))}return Promise.resolve()},e.prototype.iceGatheringComplete=function(){this.logger.debug("SessionDescriptionHandler.iceGatheringComplete"),void 0!==this.iceGatheringCompleteTimeoutId&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - clearing timeout"),clearTimeout(this.iceGatheringCompleteTimeoutId),this.iceGatheringCompleteTimeoutId=void 0),void 0!==this.iceGatheringCompletePromise&&(this.logger.debug("SessionDescriptionHandler.iceGatheringComplete - resolving promise"),this.iceGatheringCompleteResolve&&this.iceGatheringCompleteResolve(),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0)},e.prototype.waitForIceGatheringComplete=function(e,t){var n=this;return void 0===e&&(e=!1),void 0===t&&(t=0),this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete"),void 0===this._peerConnection?Promise.reject("Peer connection closed."):e||"complete"!==this._peerConnection.iceGatheringState?(void 0!==this.iceGatheringCompletePromise&&(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - rejecting prior waiting promise"),this.iceGatheringCompleteReject&&this.iceGatheringCompleteReject(new Error("Promise superseded.")),this.iceGatheringCompletePromise=void 0,this.iceGatheringCompleteResolve=void 0,this.iceGatheringCompleteReject=void 0),this.iceGatheringCompletePromise=new Promise((function(e,r){n.iceGatheringCompleteResolve=e,n.iceGatheringCompleteReject=r,t>0&&(n.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout in "+t),n.iceGatheringCompleteTimeoutId=setTimeout((function(){n.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - timeout"),n.iceGatheringComplete()}),t))})),this.iceGatheringCompletePromise):(this.logger.debug("SessionDescriptionHandler.waitForIceGatheringToComplete - already complete"),Promise.resolve())},e.prototype.initPeerConnectionEventHandlers=function(){var e=this;if(this.logger.debug("SessionDescriptionHandler.initPeerConnectionEventHandlers"),!this._peerConnection)throw new Error("Peer connection undefined.");var t=this._peerConnection;t.onconnectionstatechange=function(n){var r,o=t.connectionState;e.logger.debug("SessionDescriptionHandler.onconnectionstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onconnectionstatechange)&&e._peerConnectionDelegate.onconnectionstatechange(n)},t.ondatachannel=function(t){var n;e.logger.debug("SessionDescriptionHandler.ondatachannel"),e._dataChannel=t.channel,e.onDataChannel&&e.onDataChannel(e._dataChannel),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.ondatachannel)&&e._peerConnectionDelegate.ondatachannel(t)},t.onicecandidate=function(t){var n;e.logger.debug("SessionDescriptionHandler.onicecandidate"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onicecandidate)&&e._peerConnectionDelegate.onicecandidate(t)},t.onicecandidateerror=function(t){var n;e.logger.debug("SessionDescriptionHandler.onicecandidateerror"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onicecandidateerror)&&e._peerConnectionDelegate.onicecandidateerror(t)},t.oniceconnectionstatechange=function(n){var r,o=t.iceConnectionState;e.logger.debug("SessionDescriptionHandler.oniceconnectionstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.oniceconnectionstatechange)&&e._peerConnectionDelegate.oniceconnectionstatechange(n)},t.onicegatheringstatechange=function(n){var r,o=t.iceGatheringState;e.logger.debug("SessionDescriptionHandler.onicegatheringstatechange ".concat(o)),"complete"===o&&e.iceGatheringComplete(),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onicegatheringstatechange)&&e._peerConnectionDelegate.onicegatheringstatechange(n)},t.onnegotiationneeded=function(t){var n;e.logger.debug("SessionDescriptionHandler.onnegotiationneeded"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onnegotiationneeded)&&e._peerConnectionDelegate.onnegotiationneeded(t)},t.onsignalingstatechange=function(n){var r,o=t.signalingState;e.logger.debug("SessionDescriptionHandler.onsignalingstatechange ".concat(o)),(null===(r=e._peerConnectionDelegate)||void 0===r?void 0:r.onsignalingstatechange)&&e._peerConnectionDelegate.onsignalingstatechange(n)},t.onstatsended=function(t){var n;e.logger.debug("SessionDescriptionHandler.onstatsended"),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.onstatsended)&&e._peerConnectionDelegate.onstatsended(t)},t.ontrack=function(t){var n,r=t.track.kind,o=t.track.enabled?"enabled":"disabled";e.logger.debug("SessionDescriptionHandler.ontrack ".concat(r," ").concat(o)),e.setRemoteTrack(t.track),(null===(n=e._peerConnectionDelegate)||void 0===n?void 0:n.ontrack)&&e._peerConnectionDelegate.ontrack(t)}},e}();function pt(e){return function(t,n){void 0===e&&(e=ct());var r=void 0!==(null===n||void 0===n?void 0:n.iceGatheringTimeout)?null===n||void 0===n?void 0:n.iceGatheringTimeout:5e3,o={iceGatheringTimeout:r,peerConnectionConfiguration:i(i({},ut()),null===n||void 0===n?void 0:n.peerConnectionConfiguration)},s=t.userAgent.getLogger("sip.SessionDescriptionHandler");return new dt(s,e,o)}}var ht=function(){function e(t,n){if(this._state=st.Disconnected,this.transitioningState=!1,this._stateEventEmitter=new Ue,this.logger=t,n){var r=n,o=null===r||void 0===r?void 0:r.wsServers,s=null===r||void 0===r?void 0:r.maxReconnectionAttempts;if(void 0!==o){var a='The transport option "wsServers" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(a)}if(void 0!==s){a='The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(a)}o&&!n.server&&("string"===typeof o&&(n.server=o),o instanceof Array&&(n.server=o[0]))}this.configuration=i(i({},e.defaultOptions),n);var l=this.configuration.server,c=g.parse(l,"absoluteURI");if(-1===c)throw this.logger.error('Invalid WebSocket Server URL "'.concat(l,'"')),new Error("Invalid WebSocket Server URL");if(!["wss","ws","udp"].includes(c.scheme))throw this.logger.error('Invalid scheme in WebSocket Server URL "'.concat(l,'"')),new Error("Invalid scheme in WebSocket Server URL");this._protocol=c.scheme.toUpperCase()}return e.prototype.dispose=function(){return this.disconnect()},Object.defineProperty(e.prototype,"protocol",{get:function(){return this._protocol},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"server",{get:function(){return this.configuration.server},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ws",{get:function(){return this._ws},enumerable:!1,configurable:!0}),e.prototype.connect=function(){return this._connect()},e.prototype.disconnect=function(){return this._disconnect()},e.prototype.isConnected=function(){return this.state===st.Connected},e.prototype.send=function(e){return this._send(e)},e.prototype._connect=function(){var e,t=this;switch(this.logger.log("Connecting ".concat(this.server)),this.state){case st.Connecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Connecting));if(!this.connectPromise)throw new Error("Connect promise must be defined.");return this.connectPromise;case st.Connected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Connecting));if(this.connectPromise)throw new Error("Connect promise must not be defined.");return Promise.resolve();case st.Disconnecting:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(st.Connecting)}catch(n){if(n instanceof $e)return Promise.reject(n);throw n}break;case st.Disconnected:if(this.connectPromise)throw new Error("Connect promise must not be defined.");try{this.transitionState(st.Connecting)}catch(n){if(n instanceof $e)return Promise.reject(n);throw n}break;default:throw new Error("Unknown state")}try{e=new WebSocket(this.server,"sip"),e.binaryType="arraybuffer",e.addEventListener("close",(function(n){return t.onWebSocketClose(n,e)})),e.addEventListener("error",(function(n){return t.onWebSocketError(n,e)})),e.addEventListener("open",(function(n){return t.onWebSocketOpen(n,e)})),e.addEventListener("message",(function(n){return t.onWebSocketMessage(n,e)})),this._ws=e}catch(r){return this._ws=void 0,this.logger.error("WebSocket construction failed."),this.logger.error(r),new Promise((function(e,n){t.connectResolve=e,t.connectReject=n,t.transitionState(st.Disconnected,r)}))}return this.connectPromise=new Promise((function(n,r){t.connectResolve=n,t.connectReject=r,t.connectTimeout=setTimeout((function(){t.logger.warn("Connect timed out. Exceeded time set in configuration.connectionTimeout: "+t.configuration.connectionTimeout+"s."),e.close(1e3)}),1e3*t.configuration.connectionTimeout)})),this.connectPromise},e.prototype._disconnect=function(){var e=this;switch(this.logger.log("Disconnecting ".concat(this.server)),this.state){case st.Connecting:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(st.Disconnecting)}catch(n){if(n instanceof $e)return Promise.reject(n);throw n}break;case st.Connected:if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");try{this.transitionState(st.Disconnecting)}catch(n){if(n instanceof $e)return Promise.reject(n);throw n}break;case st.Disconnecting:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Disconnecting));if(!this.disconnectPromise)throw new Error("Disconnect promise must be defined.");return this.disconnectPromise;case st.Disconnected:if(this.transitioningState)return Promise.reject(this.transitionLoopDetectedError(st.Disconnecting));if(this.disconnectPromise)throw new Error("Disconnect promise must not be defined.");return Promise.resolve();default:throw new Error("Unknown state")}if(!this._ws)throw new Error("WebSocket must be defined.");var t=this._ws;return this.disconnectPromise=new Promise((function(n,r){e.disconnectResolve=n,e.disconnectReject=r;try{t.close(1e3)}catch(o){throw e.logger.error("WebSocket close failed."),e.logger.error(o),o}})),this.disconnectPromise},e.prototype._send=function(e){if(!0===this.configuration.traceSip&&this.logger.log("Sending WebSocket message:\n\n"+e+"\n"),this._state!==st.Connected)return Promise.reject(new Error("Not connected."));if(!this._ws)throw new Error("WebSocket undefined.");try{this._ws.send(e)}catch(t){return t instanceof Error?Promise.reject(t):Promise.reject(new Error("WebSocket send failed."))}return Promise.resolve()},e.prototype.onWebSocketClose=function(e,t){if(t===this._ws){var n="WebSocket closed ".concat(this.server," (code: ").concat(e.code,")"),r=this.disconnectPromise?void 0:new Error(n);r&&this.logger.warn("WebSocket closed unexpectedly"),this.logger.log(n),this._ws=void 0,this.transitionState(st.Disconnected,r)}},e.prototype.onWebSocketError=function(e,t){t===this._ws&&this.logger.error("WebSocket error occurred.")},e.prototype.onWebSocketMessage=function(e,t){if(t===this._ws){var n,r=e.data;if(/^(\r\n)+$/.test(r))return this.clearKeepAliveTimeout(),void(!0===this.configuration.traceSip&&this.logger.log("Received WebSocket message with CRLF Keep Alive response"));if(r){if("string"!==typeof r){try{n=(new TextDecoder).decode(new Uint8Array(r))}catch(o){return this.logger.error(o),void this.logger.error("Received WebSocket binary message failed to be converted into string, message discarded")}!0===this.configuration.traceSip&&this.logger.log("Received WebSocket binary message:\n\n"+n+"\n")}else n=r,!0===this.configuration.traceSip&&this.logger.log("Received WebSocket text message:\n\n"+n+"\n");if(this.state===st.Connected){if(this.onMessage)try{this.onMessage(n)}catch(i){throw this.logger.error(i),this.logger.error("Exception thrown by onMessage callback"),i}}else this.logger.warn("Received message while not connected, discarding...")}else this.logger.warn("Received empty message, discarding...")}},e.prototype.onWebSocketOpen=function(e,t){t===this._ws&&this._state===st.Connecting&&(this.logger.log("WebSocket opened ".concat(this.server)),this.transitionState(st.Connected))},e.prototype.transitionLoopDetectedError=function(e){var t="A state transition loop has been detected.";return t+=" An attempt to transition from ".concat(this._state," to ").concat(e," before the prior transition completed."),t+=" Perhaps you are synchronously calling connect() or disconnect() from a callback or state change handler?",this.logger.error(t),new $e("Loop detected.")},e.prototype.transitionState=function(e,t){var n=this,r=function(){throw new Error("Invalid state transition from ".concat(n._state," to ").concat(e))};if(this.transitioningState)throw this.transitionLoopDetectedError(e);switch(this.transitioningState=!0,this._state){case st.Connecting:e!==st.Connected&&e!==st.Disconnecting&&e!==st.Disconnected&&r();break;case st.Connected:e!==st.Disconnecting&&e!==st.Disconnected&&r();break;case st.Disconnecting:e!==st.Connecting&&e!==st.Disconnected&&r();break;case st.Disconnected:e!==st.Connecting&&r();break;default:throw new Error("Unknown state.")}var o=this._state;this._state=e;var i=this.connectResolve,s=this.connectReject;o===st.Connecting&&(this.connectPromise=void 0,this.connectResolve=void 0,this.connectReject=void 0);var a=this.disconnectResolve,l=this.disconnectReject;if(o===st.Disconnecting&&(this.disconnectPromise=void 0,this.disconnectResolve=void 0,this.disconnectReject=void 0),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0),this.logger.log("Transitioned from ".concat(o," to ").concat(this._state)),this._stateEventEmitter.emit(this._state),e===st.Connected&&(this.startSendingKeepAlives(),this.onConnect))try{this.onConnect()}catch(c){throw this.logger.error(c),this.logger.error("Exception thrown by onConnect callback"),c}if(o===st.Connected&&(this.stopSendingKeepAlives(),this.onDisconnect))try{t?this.onDisconnect(t):this.onDisconnect()}catch(c){throw this.logger.error(c),this.logger.error("Exception thrown by onDisconnect callback"),c}if(o===st.Connecting){if(!i)throw new Error("Connect resolve undefined.");if(!s)throw new Error("Connect reject undefined.");e===st.Connected?i():s(t||new Error("Connect aborted."))}if(o===st.Disconnecting){if(!a)throw new Error("Disconnect resolve undefined.");if(!l)throw new Error("Disconnect reject undefined.");e===st.Disconnected?a():l(t||new Error("Disconnect aborted."))}this.transitioningState=!1},e.prototype.clearKeepAliveTimeout=function(){this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveDebounceTimeout=void 0},e.prototype.sendKeepAlive=function(){var e=this;return this.keepAliveDebounceTimeout?Promise.resolve():(this.keepAliveDebounceTimeout=setTimeout((function(){e.clearKeepAliveTimeout()}),1e3*this.configuration.keepAliveDebounce),this.send("\r\n\r\n"))},e.prototype.startSendingKeepAlives=function(){var e=this,t=function(e){var t=.8*e;return 1e3*(Math.random()*(e-t)+t)};this.configuration.keepAliveInterval&&!this.keepAliveInterval&&(this.keepAliveInterval=setInterval((function(){e.sendKeepAlive(),e.startSendingKeepAlives()}),t(this.configuration.keepAliveInterval)))},e.prototype.stopSendingKeepAlives=function(){this.keepAliveInterval&&clearInterval(this.keepAliveInterval),this.keepAliveDebounceTimeout&&clearTimeout(this.keepAliveDebounceTimeout),this.keepAliveInterval=void 0,this.keepAliveDebounceTimeout=void 0},e.defaultOptions={server:"",connectionTimeout:5,keepAliveInterval:0,keepAliveDebounce:10,traceSip:!0},e}(),ft=function(){function e(t){var n=this;if(void 0===t&&(t={}),this._publishers={},this._registerers={},this._sessions={},this._subscriptions={},this._state=at.Stopped,this.unloadListener=function(){n.stop()},this._stateEventEmitter=new Ue,this.delegate=t.delegate,this.options=i(i(i(i(i({},e.defaultOptions()),{sipjsId:b(5)}),{uri:new d("sip","anonymous."+b(6),"anonymous.invalid")}),{viaHost:b(12)+".invalid"}),e.stripUndefinedProperties(t)),this.options.hackIpInContact)if("boolean"===typeof this.options.hackIpInContact&&this.options.hackIpInContact){var r=1,o=254,s=Math.floor(Math.random()*(o-r+1)+r);this.options.viaHost="192.0.2."+s}else this.options.hackIpInContact&&(this.options.viaHost=this.options.hackIpInContact);switch(this.loggerFactory=new xe,this.logger=this.loggerFactory.getLogger("sip.UserAgent"),this.loggerFactory.builtinEnabled=this.options.logBuiltinEnabled,this.loggerFactory.connector=this.options.logConnector,this.options.logLevel){case"error":this.loggerFactory.level=Ce.error;break;case"warn":this.loggerFactory.level=Ce.warn;break;case"log":this.loggerFactory.level=Ce.log;break;case"debug":this.loggerFactory.level=Ce.debug;break}if(this.options.logConfiguration&&(this.logger.log("Configuration:"),Object.keys(this.options).forEach((function(e){var t=n.options[e];switch(e){case"uri":case"sessionDescriptionHandlerFactory":n.logger.log("· "+e+": "+t);break;case"authorizationPassword":n.logger.log("· "+e+": NOT SHOWN");break;case"transportConstructor":n.logger.log("· "+e+": "+t.name);break;default:n.logger.log("· "+e+": "+JSON.stringify(t))}}))),this.options.transportOptions){var a=this.options.transportOptions,l=a.maxReconnectionAttempts,c=a.reconnectionTimeout;if(void 0!==l){var u='The transport option "maxReconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}if(void 0!==c){u='The transport option "reconnectionTimeout" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}void 0===t.reconnectionDelay&&void 0!==c&&(this.options.reconnectionDelay=c),void 0===t.reconnectionAttempts&&void 0!==l&&(this.options.reconnectionAttempts=l)}if(void 0!==t.reconnectionDelay){u='The user agent option "reconnectionDelay" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}if(void 0!==t.reconnectionAttempts){u='The user agent option "reconnectionAttempts" as has apparently been specified and has been deprecated. It will no longer be available starting with SIP.js release 0.16.0. Please update accordingly.';this.logger.warn(u)}this._transport=new this.options.transportConstructor(this.getLogger("sip.Transport"),this.options.transportOptions),this.initTransportCallbacks(),this._contact=this.initContact(),this._userAgentCore=this.initCore(),this.options.autoStart&&this.start()}return e.makeURI=function(e){return g.URIParse(e)},e.defaultOptions=function(){return{allowLegacyNotifications:!1,authorizationHa1:"",authorizationPassword:"",authorizationUsername:"",autoStart:!1,autoStop:!0,delegate:{},contactName:"",contactParams:{transport:"ws"},displayName:"",forceRport:!1,hackAllowUnregisteredOptionTags:!1,hackIpInContact:!1,hackViaTcp:!1,logBuiltinEnabled:!0,logConfiguration:!0,logConnector:function(){},logLevel:"log",noAnswerTimeout:60,preloadedRouteSet:[],reconnectionAttempts:0,reconnectionDelay:4,sendInitialProvisionalResponse:!0,sessionDescriptionHandlerFactory:pt(),sessionDescriptionHandlerFactoryOptions:{},sipExtension100rel:Ye.Unsupported,sipExtensionReplaces:Ye.Unsupported,sipExtensionExtraSupported:[],sipjsId:"",transportConstructor:ht,transportOptions:{},uri:new d("sip","anonymous","anonymous.invalid"),userAgentString:"SIP.js/"+l,viaHost:""}},e.stripUndefinedProperties=function(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})},Object.defineProperty(e.prototype,"configuration",{get:function(){return this.options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"contact",{get:function(){return this._contact},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stateChange",{get:function(){return this._stateEventEmitter},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transport",{get:function(){return this._transport},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userAgentCore",{get:function(){return this._userAgentCore},enumerable:!1,configurable:!0}),e.prototype.getLogger=function(e,t){return this.loggerFactory.getLogger(e,t)},e.prototype.getLoggerFactory=function(){return this.loggerFactory},e.prototype.isConnected=function(){return this.transport.isConnected()},e.prototype.reconnect=function(){var e=this;return this.state===at.Stopped?Promise.reject(new Error("User agent stopped.")):Promise.resolve().then((function(){return e.transport.connect()}))},e.prototype.start=function(){if(this.state===at.Started)return this.logger.warn("User agent already started"),Promise.resolve();if(this.logger.log("Starting ".concat(this.configuration.uri)),this.transitionState(at.Started),this.options.autoStop){var e=!("undefined"===typeof chrome||!chrome.app||!chrome.app.runtime);"undefined"===typeof window||"function"!==typeof window.addEventListener||e||window.addEventListener("unload",this.unloadListener)}return this.transport.connect()},e.prototype.stop=function(){return s(this,void 0,void 0,(function(){var e,t,n,r,o,s,l,c,u,d,p,h,f,g,m,v,y,b,w,C,S,E,T,k,x,N,R,I,_=this;return a(this,(function(O){switch(O.label){case 0:if(this.state===at.Stopped)return this.logger.warn("User agent already stopped"),[2,Promise.resolve()];for(p in this.logger.log("Stopping ".concat(this.configuration.uri)),this.transitionState(at.Stopped),this.options.autoStop&&(e=!("undefined"===typeof chrome||!chrome.app||!chrome.app.runtime),"undefined"!==typeof window&&window.removeEventListener&&!e&&window.removeEventListener("unload",this.unloadListener)),t=i({},this._publishers),n=i({},this._registerers),r=i({},this._sessions),o=i({},this._subscriptions),s=this.transport,l=this.userAgentCore,this.logger.log("Dispose of registerers"),c=function(e){return a(this,(function(t){switch(t.label){case 0:return n[e]?[4,n[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._registerers[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},u=n,d=[],u)d.push(p);h=0,O.label=1;case 1:return h<d.length?(p=d[h],p in u?(I=p,[5,c(I)]):[3,3]):[3,4];case 2:O.sent(),O.label=3;case 3:return h++,[3,1];case 4:for(v in this.logger.log("Dispose of sessions"),f=function(e){return a(this,(function(t){switch(t.label){case 0:return r[e]?[4,r[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._sessions[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},g=r,m=[],g)m.push(v);y=0,O.label=5;case 5:return y<m.length?(v=m[y],v in g?(I=v,[5,f(I)]):[3,7]):[3,8];case 6:O.sent(),O.label=7;case 7:return y++,[3,5];case 8:for(S in this.logger.log("Dispose of subscriptions"),b=function(e){return a(this,(function(t){switch(t.label){case 0:return o[e]?[4,o[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._subscriptions[e],t}))]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))},w=o,C=[],w)C.push(S);E=0,O.label=9;case 9:return E<C.length?(S=C[E],S in w?(I=S,[5,b(I)]):[3,11]):[3,12];case 10:O.sent(),O.label=11;case 11:return E++,[3,9];case 12:for(N in this.logger.log("Dispose of publishers"),T=function(e){return a(this,(function(n){switch(n.label){case 0:return t[e]?[4,t[e].dispose().catch((function(t){throw _.logger.error(t.message),delete _._publishers[e],t}))]:[3,2];case 1:n.sent(),n.label=2;case 2:return[2]}}))},k=t,x=[],k)x.push(N);R=0,O.label=13;case 13:return R<x.length?(N=x[R],N in k?(I=N,[5,T(I)]):[3,15]):[3,16];case 14:O.sent(),O.label=15;case 15:return R++,[3,13];case 16:return this.logger.log("Dispose of transport"),[4,s.dispose().catch((function(e){throw _.logger.error(e.message),e}))];case 17:return O.sent(),this.logger.log("Dispose of core"),l.dispose(),[2]}}))}))},e.prototype._makeInviter=function(e,t){return new tt(this,e,t)},e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=this.options.reconnectionAttempts,r=this.options.reconnectionDelay;e>n?this.logger.log("Maximum reconnection attempts reached"):(this.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - trying")),setTimeout((function(){t.reconnect().then((function(){t.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - succeeded"))})).catch((function(r){t.logger.error(r.message),t.logger.log("Reconnection attempt ".concat(e," of ").concat(n," - failed")),t.attemptReconnection(++e)}))}),1===e?0:1e3*r))},e.prototype.initContact=function(){var e=this,t=""!==this.options.contactName?this.options.contactName:b(8),n=this.options.contactParams,r={pubGruu:void 0,tempGruu:void 0,uri:new d("sip",t,this.options.viaHost,void 0,n),toString:function(t){void 0===t&&(t={});var r=t.anonymous||!1,o=t.outbound||!1,i="<";return i+=r?e.contact.tempGruu||"sip:anonymous@anonymous.invalid;transport=".concat(n.transport?n.transport:"ws"):e.contact.pubGruu||e.contact.uri,o&&(i+=";ob"),i+=">",i}};return r},e.prototype.initCore=function(){var e=this,t=[];t.push("outbound"),this.options.sipExtension100rel===Ye.Supported&&t.push("100rel"),this.options.sipExtensionReplaces===Ye.Supported&&t.push("replaces"),this.options.sipExtensionExtraSupported&&t.push.apply(t,this.options.sipExtensionExtraSupported),this.options.hackAllowUnregisteredOptionTags||(t=t.filter((function(e){return Qe[e]}))),t=Array.from(new Set(t));var n=t.slice();(this.contact.pubGruu||this.contact.tempGruu)&&n.push("gruu");var r={aor:this.options.uri,contact:this.contact,displayName:this.options.displayName,loggerFactory:this.loggerFactory,hackViaTcp:this.options.hackViaTcp,routeSet:this.options.preloadedRouteSet,supportedOptionTags:t,supportedOptionTagsResponse:n,sipjsId:this.options.sipjsId,userAgentHeaderFieldValue:this.options.userAgentString,viaForceRport:this.options.forceRport,viaHost:this.options.viaHost,authenticationFactory:function(){var t=e.options.authorizationUsername?e.options.authorizationUsername:e.options.uri.user,n=e.options.authorizationPassword?e.options.authorizationPassword:void 0,r=e.options.authorizationHa1?e.options.authorizationHa1:void 0;return new P(e.getLoggerFactory(),r,t,n)},transportAccessor:function(){return e.transport}},o={onInvite:function(t){var n,r=new et(e,t);if(t.delegate={onCancel:function(e){r._onCancel(e)},onTransportError:function(t){e.logger.error("A transport error has occurred while handling an incoming INVITE request.")}},t.trying(),e.options.sipExtensionReplaces!==Ye.Unsupported){var o=t.message,i=o.parseHeader("replaces");if(i){var s=i.call_id;if("string"!==typeof s)throw new Error("Type of call id is not string");var a=i.replaces_to_tag;if("string"!==typeof a)throw new Error("Type of to tag is not string");var l=i.replaces_from_tag;if("string"!==typeof l)throw new Error("type of from tag is not string");var c=s+a+l,u=e.userAgentCore.dialogs.get(c);if(!u)return void r.reject({statusCode:481});if(!u.early&&!0===i.early_only)return void r.reject({statusCode:486});var d=e._sessions[s+l]||e._sessions[s+a]||void 0;if(!d)throw new Error("Session does not exist.");r._replacee=d}}if(null===(n=e.delegate)||void 0===n?void 0:n.onInvite)return r.autoSendAnInitialProvisionalResponse?void r.progress().then((function(){var t;if(void 0===(null===(t=e.delegate)||void 0===t?void 0:t.onInvite))throw new Error("onInvite undefined.");e.delegate.onInvite(r)})):void e.delegate.onInvite(r);r.reject({statusCode:486})},onMessage:function(t){if(e.delegate&&e.delegate.onMessage){var n=new Ke(t);e.delegate.onMessage(n)}else t.accept()},onNotify:function(t){if(e.delegate&&e.delegate.onNotify){var n=new We(t);e.delegate.onNotify(n)}else e.options.allowLegacyNotifications?t.accept():t.reject({statusCode:481})},onRefer:function(t){e.logger.warn("Received an out of dialog REFER request"),e.delegate&&e.delegate.onReferRequest?e.delegate.onReferRequest(t):t.reject({statusCode:405})},onRegister:function(t){e.logger.warn("Received an out of dialog REGISTER request"),e.delegate&&e.delegate.onRegisterRequest?e.delegate.onRegisterRequest(t):t.reject({statusCode:405})},onSubscribe:function(t){e.logger.warn("Received an out of dialog SUBSCRIBE request"),e.delegate&&e.delegate.onSubscribeRequest?e.delegate.onSubscribeRequest(t):t.reject({statusCode:405})}};return new He(r,o)},e.prototype.initTransportCallbacks=function(){var e=this;this.transport.onConnect=function(){return e.onTransportConnect()},this.transport.onDisconnect=function(t){return e.onTransportDisconnect(t)},this.transport.onMessage=function(t){return e.onTransportMessage(t)}},e.prototype.onTransportConnect=function(){this.state!==at.Stopped&&this.delegate&&this.delegate.onConnect&&this.delegate.onConnect()},e.prototype.onTransportDisconnect=function(e){this.state!==at.Stopped&&(this.delegate&&this.delegate.onDisconnect&&this.delegate.onDisconnect(e),e&&this.options.reconnectionAttempts>0&&this.attemptReconnection())},e.prototype.onTransportMessage=function(e){var t=this,n=D.parseMessage(e,this.getLogger("sip.Parser"));if(n)if(this.state===at.Stopped&&n instanceof k)this.logger.warn("Received ".concat(n.method," request while stopped. Dropping."));else{var r=function(){for(var e=["from","to","call_id","cseq","via"],r=0,o=e;r<o.length;r++){var i=o[r];if(!n.hasHeader(i))return t.logger.warn("Missing mandatory header field : ".concat(i,".")),!1}return!0};if(n instanceof k){if(!r())return void this.logger.warn("Request missing mandatory header field. Dropping.");if(!n.toTag&&n.callId.substr(0,5)===this.options.sipjsId)return void this.userAgentCore.replyStateless(n,{statusCode:482});var o=E(n.body),i=n.getHeader("content-length");if(i&&o<Number(i))return void this.userAgentCore.replyStateless(n,{statusCode:400})}if(n instanceof x){if(!r())return void this.logger.warn("Response missing mandatory header field. Dropping.");if(n.getHeaders("via").length>1)return void this.logger.warn("More than one Via header field present in the response. Dropping.");if(n.via.host!==this.options.viaHost||void 0!==n.via.port)return void this.logger.warn("Via sent-by in the response does not match UA Via host value. Dropping.");o=E(n.body),i=n.getHeader("content-length");if(i&&o<Number(i))return void this.logger.warn("Message body length is lower than the value in Content-Length header field. Dropping.")}if(n instanceof k)this.userAgentCore.receiveIncomingRequestFromTransport(n);else{if(!(n instanceof x))throw new Error("Invalid message type.");this.userAgentCore.receiveIncomingResponseFromTransport(n)}}else this.logger.warn("Failed to parse incoming message. Dropping.")},e.prototype.transitionState=function(e,t){var n=this,r=function(){throw new Error("Invalid state transition from ".concat(n._state," to ").concat(e))};switch(this._state){case at.Started:e!==at.Stopped&&r();break;case at.Stopped:e!==at.Started&&r();break;default:throw new Error("Unknown state.")}this.logger.log("Transitioned from ".concat(this._state," to ").concat(e)),this._state=e,this._stateEventEmitter.emit(this._state)},e}();function gt(e,t){t.autoplay=!0,t.srcObject=e,t.play().catch((function(e){console.error(e)})),e.onaddtrack=function(){t.load(),t.play().catch((function(e){console.error("Failed to play remote media on add track"),console.error(e)}))},e.onremovetrack=function(){t.load(),t.play().catch((function(e){console.error("Failed to play remote media on remove track"),console.error(e)}))}}function mt(e){var t=document.getElementById(e);if(t instanceof HTMLAudioElement)return t;var n=new Audio;return n.controls=!0,n.autoplay=!0,n.id="m7remoteAudio",n.style.display="none",document.body.appendChild(n),document.getElementById(e)}(function(){function e(e,t){var n=this;void 0===t&&(t={}),this.attemptingReconnection=!1,this.connectRequested=!1,this.held=!1,this.muted=!1,this.registerer=void 0,this.registerRequested=!1,this.session=void 0,this.delegate=t.delegate,this.options=i({},t);var r=i({},t.userAgentOptions);if(r.transportConstructor||(r.transportConstructor=ht),r.transportOptions||(r.transportOptions={server:e}),!r.uri&&t.aor){var o=ft.makeURI(t.aor);if(!o)throw new Error("Failed to create valid URI from ".concat(t.aor));r.uri=o}this.userAgent=new ft(r),this.userAgent.delegate={onConnect:function(){n.logger.log("[".concat(n.id,"] Connected")),n.delegate&&n.delegate.onServerConnect&&n.delegate.onServerConnect(),n.registerer&&n.registerRequested&&(n.logger.log("[".concat(n.id,"] Registering...")),n.registerer.register().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred registering after connection with server was obtained.")),n.logger.error(e.toString())})))},onDisconnect:function(e){n.logger.log("[".concat(n.id,"] Disconnected")),n.delegate&&n.delegate.onServerDisconnect&&n.delegate.onServerDisconnect(e),n.session&&(n.logger.log("[".concat(n.id,"] Hanging up...")),n.hangup().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred hanging up call after connection with server was lost.")),n.logger.error(e.toString())}))),n.registerer&&(n.logger.log("[".concat(n.id,"] Unregistering...")),n.registerer.unregister().catch((function(e){n.logger.error("[".concat(n.id,"] Error occurred unregistering after connection with server was lost.")),n.logger.error(e.toString())}))),e&&n.attemptReconnection()},onInvite:function(e){if(n.logger.log("[".concat(n.id,"] Received INVITE")),n.session)return n.logger.warn("[".concat(n.id,"] Session already in progress, rejecting INVITE...")),void e.reject().then((function(){n.logger.log("[".concat(n.id,"] Rejected INVITE"))})).catch((function(e){n.logger.error("[".concat(n.id,"] Failed to reject INVITE")),n.logger.error(e.toString())}));var t={sessionDescriptionHandlerOptions:{constraints:n.constraints}};n.initSession(e,t),n.delegate&&n.delegate.onCallReceived?n.delegate.onCallReceived():(n.logger.warn("[".concat(n.id,"] No handler available, rejecting INVITE...")),e.reject().then((function(){n.logger.log("[".concat(n.id,"] Rejected INVITE"))})).catch((function(e){n.logger.error("[".concat(n.id,"] Failed to reject INVITE")),n.logger.error(e.toString())})))},onMessage:function(e){e.accept().then((function(){n.delegate&&n.delegate.onMessageReceived&&n.delegate.onMessageReceived(e.request.body)}))}},this.logger=this.userAgent.getLogger("sip.SimpleUser"),window.addEventListener("online",(function(){n.logger.log("[".concat(n.id,"] Online")),n.attemptReconnection()}))}Object.defineProperty(e.prototype,"id",{get:function(){return this.options.userAgentOptions&&this.options.userAgentOptions.displayName||"Anonymous"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localMediaStream",{get:function(){var e,t=null===(e=this.session)||void 0===e?void 0:e.sessionDescriptionHandler;if(t){if(!(t instanceof dt))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return t.localMediaStream}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteMediaStream",{get:function(){var e,t=null===(e=this.session)||void 0===e?void 0:e.sessionDescriptionHandler;if(t){if(!(t instanceof dt))throw new Error("Session description handler not instance of web SessionDescriptionHandler");return t.remoteMediaStream}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localAudioTrack",{get:function(){var e;return null===(e=this.localMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"audio"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localVideoTrack",{get:function(){var e;return null===(e=this.localMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"video"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteAudioTrack",{get:function(){var e;return null===(e=this.remoteMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"audio"===e.kind}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"remoteVideoTrack",{get:function(){var e;return null===(e=this.remoteMediaStream)||void 0===e?void 0:e.getTracks().find((function(e){return"video"===e.kind}))},enumerable:!1,configurable:!0}),e.prototype.connect=function(){return this.logger.log("[".concat(this.id,"] Connecting UserAgent...")),this.connectRequested=!0,this.userAgent.state!==at.Started?this.userAgent.start():this.userAgent.reconnect()},e.prototype.disconnect=function(){return this.logger.log("[".concat(this.id,"] Disconnecting UserAgent...")),this.connectRequested=!1,this.userAgent.stop()},e.prototype.isConnected=function(){return this.userAgent.isConnected()},e.prototype.register=function(e,t){var n=this;return this.logger.log("[".concat(this.id,"] Registering UserAgent...")),this.registerRequested=!0,this.registerer||(this.registerer=new ot(this.userAgent,e),this.registerer.stateChange.addListener((function(e){switch(e){case Xe.Initial:break;case Xe.Registered:n.delegate&&n.delegate.onRegistered&&n.delegate.onRegistered();break;case Xe.Unregistered:n.delegate&&n.delegate.onUnregistered&&n.delegate.onUnregistered();break;case Xe.Terminated:n.registerer=void 0;break;default:throw new Error("Unknown registerer state.")}}))),this.registerer.register(t).then((function(){}))},e.prototype.unregister=function(e){return this.logger.log("[".concat(this.id,"] Unregistering UserAgent...")),this.registerRequested=!1,this.registerer?this.registerer.unregister(e).then((function(){})):Promise.resolve()},e.prototype.call=function(e,t,n){if(this.logger.log("[".concat(this.id,"] Beginning Session...")),this.session)return Promise.reject(new Error("Session already exists."));var r=ft.makeURI(e);if(!r)return Promise.reject(new Error('Failed to create a valid URI from "'.concat(e,'"')));t||(t={}),t.sessionDescriptionHandlerOptions||(t.sessionDescriptionHandlerOptions={}),t.sessionDescriptionHandlerOptions.constraints||(t.sessionDescriptionHandlerOptions.constraints=this.constraints);var o=new tt(this.userAgent,r,t);return this.sendInvite(o,t,n).then((function(){}))},e.prototype.hangup=function(){return this.logger.log("[".concat(this.id,"] Hangup...")),this.terminate()},e.prototype.answer=function(e){return this.logger.log("[".concat(this.id,"] Accepting Invitation...")),this.session?this.session instanceof et?(e||(e={}),e.sessionDescriptionHandlerOptions||(e.sessionDescriptionHandlerOptions={}),e.sessionDescriptionHandlerOptions.constraints||(e.sessionDescriptionHandlerOptions.constraints=this.constraints),this.session.accept(e)):Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))},e.prototype.decline=function(){return this.logger.log("[".concat(this.id,"] rejecting Invitation...")),this.session?this.session instanceof et?this.session.reject():Promise.reject(new Error("Session not instance of Invitation.")):Promise.reject(new Error("Session does not exist."))},e.prototype.hold=function(){return this.logger.log("[".concat(this.id,"] holding session...")),this.setHold(!0)},e.prototype.unhold=function(){return this.logger.log("[".concat(this.id,"] unholding session...")),this.setHold(!1)},e.prototype.isHeld=function(){return this.held},e.prototype.mute=function(){this.logger.log("[".concat(this.id,"] disabling media tracks...")),this.setMute(!0)},e.prototype.unmute=function(){this.logger.log("[".concat(this.id,"] enabling media tracks...")),this.setMute(!1)},e.prototype.isMuted=function(){return this.muted},e.prototype.sendDTMF=function(e){if(this.logger.log("[".concat(this.id,"] sending DTMF...")),!/^[0-9A-D#*,]$/.exec(e))return Promise.reject(new Error("Invalid DTMF tone."));if(!this.session)return Promise.reject(new Error("Session does not exist."));this.logger.log("[".concat(this.id,"] Sending DTMF tone: ").concat(e));var t=e,n=2e3,r={contentDisposition:"render",contentType:"application/dtmf-relay",content:"Signal="+t+"\r\nDuration="+n},o={body:r};return this.session.info({requestOptions:o}).then((function(){}))},e.prototype.message=function(e,t){this.logger.log("[".concat(this.id,"] sending message..."));var n=ft.makeURI(e);return n?new nt(this.userAgent,n,t).message():Promise.reject(new Error('Failed to create a valid URI from "'.concat(e,'"')))},Object.defineProperty(e.prototype,"constraints",{get:function(){var e,t={audio:!0,video:!1};return(null===(e=this.options.media)||void 0===e?void 0:e.constraints)&&(t=i({},this.options.media.constraints)),t},enumerable:!1,configurable:!0}),e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=this.options.reconnectionAttempts||3,r=this.options.reconnectionDelay||4;this.connectRequested?(this.attemptingReconnection&&this.logger.log("[".concat(this.id,"] Reconnection attempt already in progress")),e>n?this.logger.log("[".concat(this.id,"] Reconnection maximum attempts reached")):(1===e?this.logger.log("[".concat(this.id,"] Reconnection attempt ").concat(e," of ").concat(n," - trying")):this.logger.log("[".concat(this.id,"] Reconnection attempt ").concat(e," of ").concat(n," - trying in ").concat(r," seconds")),this.attemptingReconnection=!0,setTimeout((function(){if(!t.connectRequested)return t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - aborted")),void(t.attemptingReconnection=!1);t.userAgent.reconnect().then((function(){t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - succeeded")),t.attemptingReconnection=!1})).catch((function(r){t.logger.log("[".concat(t.id,"] Reconnection attempt ").concat(e," of ").concat(n," - failed")),t.logger.error(r.message),t.attemptingReconnection=!1,t.attemptReconnection(++e)}))}),1===e?0:1e3*r))):this.logger.log("[".concat(this.id,"] Reconnection not currently desired"))},e.prototype.cleanupMedia=function(){this.options.media&&(this.options.media.local&&this.options.media.local.video&&(this.options.media.local.video.srcObject=null,this.options.media.local.video.pause()),this.options.media.remote&&(this.options.media.remote.audio&&(this.options.media.remote.audio.srcObject=null,this.options.media.remote.audio.pause()),this.options.media.remote.video&&(this.options.media.remote.video.srcObject=null,this.options.media.remote.video.pause())))},e.prototype.enableReceiverTracks=function(e){if(!this.session)throw new Error("Session does not exist.");var t=this.session.sessionDescriptionHandler;if(!(t instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var n=t.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getReceivers().forEach((function(t){t.track&&(t.track.enabled=e)}))},e.prototype.enableSenderTracks=function(e){if(!this.session)throw new Error("Session does not exist.");var t=this.session.sessionDescriptionHandler;if(!(t instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var n=t.peerConnection;if(!n)throw new Error("Peer connection closed.");n.getSenders().forEach((function(t){t.track&&(t.track.enabled=e)}))},e.prototype.initSession=function(e,t){var n=this;this.session=e,this.delegate&&this.delegate.onCallCreated&&this.delegate.onCallCreated(),this.session.stateChange.addListener((function(t){if(n.session===e)switch(n.logger.log("[".concat(n.id,"] session state changed to ").concat(t)),t){case _e.Initial:break;case _e.Establishing:break;case _e.Established:n.setupLocalMedia(),n.setupRemoteMedia(),n.delegate&&n.delegate.onCallAnswered&&n.delegate.onCallAnswered();break;case _e.Terminating:case _e.Terminated:n.session=void 0,n.cleanupMedia(),n.delegate&&n.delegate.onCallHangup&&n.delegate.onCallHangup();break;default:throw new Error("Unknown session state.")}})),this.session.delegate={onInfo:function(e){var t;if(void 0!==(null===(t=n.delegate)||void 0===t?void 0:t.onCallDTMFReceived)){var r=e.request.getHeader("content-type");if(r&&/^application\/dtmf-relay/i.exec(r)){var o=e.request.body.split("\r\n",2);if(2===o.length){var i,s=/^(Signal\s*?=\s*?)([0-9A-D#*]{1})(\s)?.*/;if(s.test(o[0])&&(i=o[0].replace(s,"$2")),i){var a,l=/^(Duration\s?=\s?)([0-9]{1,4})(\s)?.*/;l.test(o[1])&&(a=parseInt(o[1].replace(l,"$2"),10)),a?e.accept().then((function(){if(n.delegate&&n.delegate.onCallDTMFReceived){if(!i||!a)throw new Error("Tone or duration undefined.");n.delegate.onCallDTMFReceived(i,a)}})).catch((function(e){n.logger.error(e.message)})):e.reject()}else e.reject()}else e.reject()}else e.reject()}else e.reject()},onRefer:function(e){e.accept().then((function(){return n.sendInvite(e.makeInviter(t),t)})).catch((function(e){n.logger.error(e.message)}))}}},e.prototype.sendInvite=function(e,t,n){var r=this;return this.initSession(e,t),e.invite(n).then((function(){r.logger.log("[".concat(r.id,"] sent INVITE"))}))},e.prototype.setHold=function(e){var t=this;if(!this.session)return Promise.reject(new Error("Session does not exist."));var n=this.session;if(this.held===e)return Promise.resolve();var r=this.session.sessionDescriptionHandler;if(!(r instanceof dt))throw new Error("Session's session description handler not instance of SessionDescriptionHandler.");var o={requestDelegate:{onAccept:function(){t.held=e,t.enableReceiverTracks(!t.held),t.enableSenderTracks(!t.held&&!t.muted),t.delegate&&t.delegate.onCallHold&&t.delegate.onCallHold(t.held)},onReject:function(){t.logger.warn("[".concat(t.id,"] re-invite request was rejected")),t.enableReceiverTracks(!t.held),t.enableSenderTracks(!t.held&&!t.muted),t.delegate&&t.delegate.onCallHold&&t.delegate.onCallHold(t.held)}}},i=n.sessionDescriptionHandlerOptionsReInvite;return i.hold=e,n.sessionDescriptionHandlerOptionsReInvite=i,this.session.invite(o).then((function(){t.enableReceiverTracks(!e),t.enableSenderTracks(!e&&!t.muted)})).catch((function(e){throw e instanceof je&&t.logger.error("[".concat(t.id,"] A hold request is already in progress.")),e}))},e.prototype.setMute=function(e){this.session?this.session.state===_e.Established?(this.muted=e,this.enableSenderTracks(!this.held&&!this.muted)):this.logger.warn("[".concat(this.id,"] An established session is required to enable/disable media tracks")):this.logger.warn("[".concat(this.id,"] A session is required to enabled/disable media tracks"))},e.prototype.setupLocalMedia=function(){var e,t,n=this;if(!this.session)throw new Error("Session does not exist.");var r=null===(t=null===(e=this.options.media)||void 0===e?void 0:e.local)||void 0===t?void 0:t.video;if(r){var o=this.localMediaStream;if(!o)throw new Error("Local media stream undefiend.");r.srcObject=o,r.volume=0,r.play().catch((function(e){n.logger.error("[".concat(n.id,"] Failed to play local media")),n.logger.error(e.message)}))}},e.prototype.setupRemoteMedia=function(){var e,t,n,r,o=this;if(!this.session)throw new Error("Session does not exist.");var i=(null===(t=null===(e=this.options.media)||void 0===e?void 0:e.remote)||void 0===t?void 0:t.video)||(null===(r=null===(n=this.options.media)||void 0===n?void 0:n.remote)||void 0===r?void 0:r.audio);if(i){var s=this.remoteMediaStream;if(!s)throw new Error("Remote media stream undefiend.");i.autoplay=!0,i.srcObject=s,i.play().catch((function(e){o.logger.error("[".concat(o.id,"] Failed to play remote media")),o.logger.error(e.message)})),s.onaddtrack=function(){o.logger.log("[".concat(o.id,"] Remote media onaddtrack")),i.load(),i.play().catch((function(e){o.logger.error("[".concat(o.id,"] Failed to play remote media")),o.logger.error(e.message)}))}}},e.prototype.terminate=function(){var e=this;if(this.logger.log("[".concat(this.id,"] Terminating...")),!this.session)return Promise.reject(new Error("Session does not exist."));switch(this.session.state){case _e.Initial:if(this.session instanceof tt)return this.session.cancel().then((function(){e.logger.log("[".concat(e.id,"] Inviter never sent INVITE (canceled)"))}));if(this.session instanceof et)return this.session.reject().then((function(){e.logger.log("[".concat(e.id,"] Invitation rejected (sent 480)"))}));throw new Error("Unknown session type.");case _e.Establishing:if(this.session instanceof tt)return this.session.cancel().then((function(){e.logger.log("[".concat(e.id,"] Inviter canceled (sent CANCEL)"))}));if(this.session instanceof et)return this.session.reject().then((function(){e.logger.log("[".concat(e.id,"] Invitation rejected (sent 480)"))}));throw new Error("Unknown session type.");case _e.Established:return this.session.bye().then((function(){e.logger.log("[".concat(e.id,"] Session ended (sent BYE)"))}));case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown state")}return this.logger.log("[".concat(this.id,"] Terminating in state ").concat(this.session.state,", no action taken")),Promise.resolve()}})();var vt=mt("m7remoteAudio"),yt=function(){function e(e){var t=this;this.registerRequested=!1,this.attemptingReconnection=!1,this.connectRequested=!1,this.requestDelegate={onAccept:function(e){},onProgress:function(e){},onRedirect:function(e){},onReject:function(e){return s(t,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.disconnect()];case 1:return e.sent(),[4,this.connect()];case 2:return e.sent(),this.register(),[2]}}))}))},onTrying:function(e){}},this.accept=function(){return s(t,void 0,void 0,(function(){var e,t;return a(this,(function(n){return e={audio:!0,video:!1},t={sessionDescriptionHandlerOptions:{constraints:e}},[2,this.Ginvitation.accept(t)]}))}))};var n=ft.makeURI("sip:"+e.sip+"@"+e.server);if(!n)throw new Error("Failed to create URI");var r={onConnect:function(){return s(t,void 0,void 0,(function(){return a(this,(function(e){return this.registerer&&this.registerRequested&&this.registerer.register().catch((function(e){})),[2]}))}))},onDisconnect:function(e){t.registerer&&t.registerer.unregister().catch((function(e){})),e&&t.attemptReconnection()},onInvite:function(e){t.Ginvitation=e;var n=e;n.delegate={onRefer:function(e){}},n.stateChange.addListener((function(e){switch(e){case _e.Initial:break;case _e.Establishing:break;case _e.Established:var t=n.sessionDescriptionHandler;if(!t||!(t instanceof dt))throw new Error("Invalid session description handler.");vt&&gt(t.remoteMediaStream,vt);break;case _e.Terminating:break;case _e.Terminated:break;default:throw new Error("Unknown session state.")}}));var r={audio:!0,video:!1},o={sessionDescriptionHandlerOptions:{constraints:r}},i=t.Ginvitation.incomingInviteRequest.message.headers["X-Calltype"][0].raw;"callout"!==i&&"callTask"!==i||e.accept(o).then((function(){})).catch((function(e){}))}},o={logBuiltinEnabled:!1,delegate:r,displayName:"webrtc",uri:n,transportOptions:{server:"wss://"+e.server},authorizationUsername:e.sip,authorizationHa1:e.secret,reconnectionDelay:0};this.userAgent=new ft(o),window.addEventListener("online",(function(){return s(t,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.attemptReconnection()];case 1:return e.sent(),this.register(),[2]}}))}))}))}return e.prototype.register=function(){var e=this;return this.registerRequested=!0,this.registerer||(this.registerer=new ot(this.userAgent,{expires:10}),this.registerer.stateChange.addListener((function(t){switch(t){case Xe.Initial:break;case Xe.Registered:break;case Xe.Unregistered:break;case Xe.Terminated:e.registerer=void 0;break;default:throw new Error("Unknown registerer state.")}}))),this.registerer.register({requestDelegate:this.requestDelegate}).then((function(){}))},e.prototype.unregister=function(e){return this.registerRequested=!1,this.registerer?this.registerer.unregister(e).then((function(){})):Promise.resolve()},e.prototype.attemptReconnection=function(e){var t=this;void 0===e&&(e=1);var n=1,r=0;this.connectRequested&&(e>n||(this.attemptingReconnection=!0,setTimeout((function(){t.connectRequested?t.userAgent.reconnect().then((function(){t.attemptingReconnection=!1})).catch((function(n){t.attemptingReconnection=!1,t.attemptReconnection(++e)})):t.attemptingReconnection=!1}),1===e?0:1e3*r)))},e.prototype.sendDTMF=function(e){if(!/^[0-9A-D#*,]$/.exec(e))return Promise.reject(new Error("Invalid DTMF tone."));if(!this.Ginvitation)return Promise.reject(new Error("Session does not exist."));var t=e,n=2e3,r={contentDisposition:"render",contentType:"application/dtmf-relay",content:"Signal="+t+"\r\nDuration="+n},o={body:r};return this.Ginvitation.info({requestOptions:o}).then((function(){}))},e.prototype.disconnect=function(){return this.connectRequested=!1,this.userAgent.stop()},e.prototype.connect=function(){return this.connectRequested=!0,this.userAgent.state!==at.Started?this.userAgent.start():this.userAgent.reconnect()},e.prototype.isConnected=function(){return this.userAgent.isConnected()},e}()},559:function(e,t){"use strict";t.A=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n}},274:function(e){"use strict";e.exports=__WEBPACK_EXTERNAL_MODULE__274__}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}!function(){__webpack_require__.amdO={}}(),function(){__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return __webpack_require__.d(t,{a:t}),t}}(),function(){__webpack_require__.d=function(e,t){for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}}(),function(){__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){__webpack_require__.p=""}();var __webpack_exports__={};return function(){"use strict";if(__webpack_require__.d(__webpack_exports__,{default:function(){return _R}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(__webpack_require__.p=t[1])}var n=__webpack_require__(274);const r=Symbol(),o="el",i="is-",s=(e,t,n,r,o)=>{let i=`${e}-${t}`;return n&&(i+=`-${n}`),r&&(i+=`__${r}`),o&&(i+=`--${o}`),i},a=Symbol("namespaceContextKey"),l=e=>{const t=e||((0,n.getCurrentInstance)()?(0,n.inject)(a,(0,n.ref)(o)):(0,n.ref)(o)),r=(0,n.computed)((()=>(0,n.unref)(t)||o));return r},c=(e,t)=>{const n=l(t),r=(t="")=>s(n.value,e,t,"",""),o=t=>t?s(n.value,e,"",t,""):"",a=t=>t?s(n.value,e,"","",t):"",c=(t,r)=>t&&r?s(n.value,e,t,r,""):"",u=(t,r)=>t&&r?s(n.value,e,"",t,r):"",d=(t,r)=>t&&r?s(n.value,e,t,"",r):"",p=(t,r,o)=>t&&r&&o?s(n.value,e,t,r,o):"",h=(e,...t)=>{const n=!(t.length>=1)||t[0];return e&&n?`${i}${e}`:""},f=e=>{const t={};for(const r in e)e[r]&&(t[`--${n.value}-${r}`]=e[r]);return t},g=t=>{const r={};for(const o in t)t[o]&&(r[`--${n.value}-${e}-${o}`]=t[o]);return r},m=e=>`--${n.value}-${e}`,v=t=>`--${n.value}-${e}-${t}`;return{namespace:n,b:r,e:o,m:a,be:c,em:u,bm:d,bem:p,is:h,cssVar:f,cssVarName:m,cssVarBlock:g,cssVarBlockName:v}};var u=Array.isArray,d=u,p="object"==typeof global&&global&&global.Object===Object&&global,h=p,f="object"==typeof self&&self&&self.Object===Object&&self,g=h||f||Function("return this")(),m=g,v=m.Symbol,y=v,b=Object.prototype,w=b.hasOwnProperty,C=b.toString,S=y?y.toStringTag:void 0;function E(e){var t=w.call(e,S),n=e[S];try{e[S]=void 0;var r=!0}catch(i){}var o=C.call(e);return r&&(t?e[S]=n:delete e[S]),o}var T=E,k=Object.prototype,x=k.toString;function N(e){return x.call(e)}var R=N,I="[object Null]",_="[object Undefined]",O=y?y.toStringTag:void 0;function A(e){return null==e?void 0===e?_:I:O&&O in Object(e)?T(e):R(e)}var B=A;function D(e){return null!=e&&"object"==typeof e}var P=D,H="[object Symbol]";function M(e){return"symbol"==typeof e||P(e)&&B(e)==H}var j=M,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,L=/^\w*$/;function $(e,t){if(d(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||(L.test(e)||!V.test(e)||null!=t&&e in Object(t))}var q=$;function F(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var U=F,z="[object AsyncFunction]",K="[object Function]",W="[object GeneratorFunction]",G="[object Proxy]";function Y(e){if(!U(e))return!1;var t=B(e);return t==K||t==W||t==z||t==G}var J=Y,Z=m["__core-js_shared__"],X=Z,Q=function(){var e=/[^.]+$/.exec(X&&X.keys&&X.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function ee(e){return!!Q&&Q in e}var te=ee,ne=Function.prototype,re=ne.toString;function oe(e){if(null!=e){try{return re.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var ie=oe,se=/[\\^$.*+?()[\]{}|]/g,ae=/^\[object .+?Constructor\]$/,le=Function.prototype,ce=Object.prototype,ue=le.toString,de=ce.hasOwnProperty,pe=RegExp("^"+ue.call(de).replace(se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function he(e){if(!U(e)||te(e))return!1;var t=J(e)?pe:ae;return t.test(ie(e))}var fe=he;function ge(e,t){return null==e?void 0:e[t]}var me=ge;function ve(e,t){var n=me(e,t);return fe(n)?n:void 0}var ye=ve,be=ye(Object,"create"),we=be;function Ce(){this.__data__=we?we(null):{},this.size=0}var Se=Ce;function Ee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Te=Ee,ke="__lodash_hash_undefined__",xe=Object.prototype,Ne=xe.hasOwnProperty;function Re(e){var t=this.__data__;if(we){var n=t[e];return n===ke?void 0:n}return Ne.call(t,e)?t[e]:void 0}var Ie=Re,_e=Object.prototype,Oe=_e.hasOwnProperty;function Ae(e){var t=this.__data__;return we?void 0!==t[e]:Oe.call(t,e)}var Be=Ae,De="__lodash_hash_undefined__";function Pe(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=we&&void 0===t?De:t,this}var He=Pe;function Me(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}Me.prototype.clear=Se,Me.prototype["delete"]=Te,Me.prototype.get=Ie,Me.prototype.has=Be,Me.prototype.set=He;var je=Me;function Ve(){this.__data__=[],this.size=0}var Le=Ve;function $e(e,t){return e===t||e!==e&&t!==t}var qe=$e;function Fe(e,t){var n=e.length;while(n--)if(qe(e[n][0],t))return n;return-1}var Ue=Fe,ze=Array.prototype,Ke=ze.splice;function We(e){var t=this.__data__,n=Ue(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Ke.call(t,n,1),--this.size,!0}var Ge=We;function Ye(e){var t=this.__data__,n=Ue(t,e);return n<0?void 0:t[n][1]}var Je=Ye;function Ze(e){return Ue(this.__data__,e)>-1}var Xe=Ze;function Qe(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var et=Qe;function tt(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}tt.prototype.clear=Le,tt.prototype["delete"]=Ge,tt.prototype.get=Je,tt.prototype.has=Xe,tt.prototype.set=et;var nt=tt,rt=ye(m,"Map"),ot=rt;function it(){this.size=0,this.__data__={hash:new je,map:new(ot||nt),string:new je}}var st=it;function at(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var lt=at;function ct(e,t){var n=e.__data__;return lt(t)?n["string"==typeof t?"string":"hash"]:n.map}var ut=ct;function dt(e){var t=ut(this,e)["delete"](e);return this.size-=t?1:0,t}var pt=dt;function ht(e){return ut(this,e).get(e)}var ft=ht;function gt(e){return ut(this,e).has(e)}var mt=gt;function vt(e,t){var n=ut(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var yt=vt;function bt(e){var t=-1,n=null==e?0:e.length;this.clear();while(++t<n){var r=e[t];this.set(r[0],r[1])}}bt.prototype.clear=st,bt.prototype["delete"]=pt,bt.prototype.get=ft,bt.prototype.has=mt,bt.prototype.set=yt;var wt=bt,Ct="Expected a function";function St(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(Ct);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(St.Cache||wt),n}St.Cache=wt;var Et=St,Tt=500;function kt(e){var t=Et(e,(function(e){return n.size===Tt&&n.clear(),e})),n=t.cache;return t}var xt=kt,Nt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rt=/\\(\\)?/g,It=xt((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Nt,(function(e,n,r,o){t.push(r?o.replace(Rt,"$1"):n||e)})),t})),_t=It;function Ot(e,t){var n=-1,r=null==e?0:e.length,o=Array(r);while(++n<r)o[n]=t(e[n],n,e);return o}var At=Ot,Bt=1/0,Dt=y?y.prototype:void 0,Pt=Dt?Dt.toString:void 0;function Ht(e){if("string"==typeof e)return e;if(d(e))return At(e,Ht)+"";if(j(e))return Pt?Pt.call(e):"";var t=e+"";return"0"==t&&1/e==-Bt?"-0":t}var Mt=Ht;function jt(e){return null==e?"":Mt(e)}var Vt=jt;function Lt(e,t){return d(e)?e:q(e,t)?[e]:_t(Vt(e))}var $t=Lt,qt=1/0;function Ft(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-qt?"-0":t}var Ut=Ft;function zt(e,t){t=$t(t,e);var n=0,r=t.length;while(null!=e&&n<r)e=e[Ut(t[n++])];return n&&n==r?e:void 0}var Kt=zt;function Wt(e,t,n){var r=null==e?void 0:Kt(e,t);return void 0===r?n:r}var Gt=Wt,Yt={name:"en",el:{colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Jt=e=>(t,r)=>Zt(t,r,(0,n.unref)(e)),Zt=(e,t,n)=>Gt(n,e,e).replace(/\{(\w+)\}/g,((e,n)=>{var r;return`${null!=(r=null==t?void 0:t[n])?r:`{${n}}`}`})),Xt=e=>{const t=(0,n.computed)((()=>(0,n.unref)(e).name)),r=(0,n.isRef)(e)?e:(0,n.ref)(e);return{lang:t,locale:r,t:Jt(e)}},Qt=Symbol("localeContextKey"),en=e=>{const t=e||(0,n.inject)(Qt,(0,n.ref)());return Xt((0,n.computed)((()=>t.value||Yt)))};const tn=()=>{},nn=(Object.assign,Object.prototype.hasOwnProperty),rn=(e,t)=>nn.call(e,t),on=Array.isArray,sn=e=>"function"===typeof e,an=e=>"string"===typeof e,ln=e=>null!==e&&"object"===typeof e,cn=Object.prototype.toString,un=e=>cn.call(e),dn=e=>un(e).slice(8,-1),pn=e=>{const t=Object.create(null);return n=>{const r=t[n];return r||(t[n]=e(n))}},hn=/-(\w)/g,fn=(pn((e=>e.replace(hn,((e,t)=>t?t.toUpperCase():"")))),/\B([A-Z])/g),gn=(pn((e=>e.replace(fn,"-$1").toLowerCase())),pn((e=>e.charAt(0).toUpperCase()+e.slice(1))));pn((e=>e?`on${gn(e)}`:""));const mn=e=>void 0===e,vn=e=>"boolean"===typeof e,yn=e=>"number"===typeof e,bn=e=>"undefined"!==typeof Element&&e instanceof Element,wn=e=>!!an(e)&&!Number.isNaN(Number(e)),Cn=(0,n.ref)(0),Sn=2e3,En=Symbol("zIndexContextKey"),Tn=e=>{const t=e||((0,n.getCurrentInstance)()?(0,n.inject)(En,void 0):void 0),r=(0,n.computed)((()=>{const e=(0,n.unref)(t);return yn(e)?e:Sn})),o=(0,n.computed)((()=>r.value+Cn.value)),i=()=>(Cn.value++,o.value);return{initialZIndex:r,currentZIndex:o,nextZIndex:i}};class kn extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function xn(e,t){throw new kn(`[${e}] ${t}`)}function Nn(e,t){0}function Rn(e){var t=-1,n=null==e?0:e.length,r={};while(++t<n){var o=e[t];r[o[0]]=o[1]}return r}var In=Rn;const _n="__epPropKey",On=e=>e,An=e=>ln(e)&&!!e[_n],Bn=(e,t)=>{if(!ln(e)||An(e))return e;const{values:r,required:o,default:i,type:s,validator:a}=e,l=r||a?o=>{let s=!1,l=[];if(r&&(l=Array.from(r),rn(e,"default")&&l.push(i),s||(s=l.includes(o))),a&&(s||(s=a(o))),!s&&l.length>0){const e=[...new Set(l)].map((e=>JSON.stringify(e))).join(", ");(0,n.warn)(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${e}], got value ${JSON.stringify(o)}.`)}return s}:void 0,c={type:s,required:!!o,validator:l,[_n]:!0};return rn(e,"default")&&(c.default=i),c},Dn=e=>In(Object.entries(e).map((([e,t])=>[e,Bn(t,e)]))),Pn=["","default","small","large"],Hn=Bn({type:String,values:Pn,required:!1}),Mn=Symbol("size"),jn=()=>{const e=(0,n.inject)(Mn,{});return(0,n.computed)((()=>(0,n.unref)(e.size)||""))};var Vn=function(){try{var e=ye(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Ln=Vn;function $n(e,t,n){"__proto__"==t&&Ln?Ln(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var qn=$n,Fn=Object.prototype,Un=Fn.hasOwnProperty;function zn(e,t,n){var r=e[t];Un.call(e,t)&&qe(r,n)&&(void 0!==n||t in e)||qn(e,t,n)}var Kn=zn,Wn=9007199254740991,Gn=/^(?:0|[1-9]\d*)$/;function Yn(e,t){var n=typeof e;return t=null==t?Wn:t,!!t&&("number"==n||"symbol"!=n&&Gn.test(e))&&e>-1&&e%1==0&&e<t}var Jn=Yn;function Zn(e,t,n,r){if(!U(e))return e;t=$t(t,e);var o=-1,i=t.length,s=i-1,a=e;while(null!=a&&++o<i){var l=Ut(t[o]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(o!=s){var u=a[l];c=r?r(u,l,a):void 0,void 0===c&&(c=U(u)?u:Jn(t[o+1])?[]:{})}Kn(a,l,c),a=a[l]}return e}var Xn=Zn;function Qn(e,t,n){return null==e?e:Xn(e,t,n)}var er=Qn;const tr=e=>Object.keys(e),nr=(e,t,n)=>({get value(){return Gt(e,t,n)},set value(n){er(e,t,n)}}),rr=(0,n.ref)();function or(e,t=void 0){const o=(0,n.getCurrentInstance)()?(0,n.inject)(r,rr):rr;return e?(0,n.computed)((()=>{var n,r;return null!=(r=null==(n=o.value)?void 0:n[e])?r:t})):o}function ir(e,t){const r=or(),i=c(e,(0,n.computed)((()=>{var e;return(null==(e=r.value)?void 0:e.namespace)||o}))),s=en((0,n.computed)((()=>{var e;return null==(e=r.value)?void 0:e.locale}))),a=Tn((0,n.computed)((()=>{var e;return(null==(e=r.value)?void 0:e.zIndex)||Sn}))),l=(0,n.computed)((()=>{var e;return(0,n.unref)(t)||(null==(e=r.value)?void 0:e.size)||""}));return sr((0,n.computed)((()=>(0,n.unref)(r)||{}))),{ns:i,locale:s,zIndex:a,size:l}}const sr=(e,t,o=!1)=>{var i;const s=!!(0,n.getCurrentInstance)(),l=s?or():void 0,c=null!=(i=null==t?void 0:t.provide)?i:s?n.provide:void 0;if(!c)return void Nn("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");const u=(0,n.computed)((()=>{const t=(0,n.unref)(e);return(null==l?void 0:l.value)?ar(l.value,t):t}));return c(r,u),c(Qt,(0,n.computed)((()=>u.value.locale))),c(a,(0,n.computed)((()=>u.value.namespace))),c(En,(0,n.computed)((()=>u.value.zIndex))),c(Mn,{size:(0,n.computed)((()=>u.value.size||""))}),!o&&rr.value||(rr.value=u.value),u},ar=(e,t)=>{var n;const r=[...new Set([...tr(e),...tr(t)])],o={};for(const i of r)o[i]=null!=(n=t[i])?n:e[i];return o},lr=Dn({a11y:{type:Boolean,default:!0},locale:{type:On(Object)},size:Hn,button:{type:On(Object)},experimentalFeatures:{type:On(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:On(Object)},zIndex:Number,namespace:{type:String,default:"el"}}),cr={},ur=(0,n.defineComponent)({name:"ElConfigProvider",props:lr,setup(e,{slots:t}){(0,n.watch)((()=>e.message),(e=>{Object.assign(cr,null!=e?e:{})}),{immediate:!0,deep:!0});const r=sr(e);return()=>(0,n.renderSlot)(t,"default",{config:null==r?void 0:r.value})}}),dr=(e,t)=>{if(e.install=n=>{for(const r of[e,...Object.values(null!=t?t:{})])n.component(r.name,r)},t)for(const[n,r]of Object.entries(t))e[n]=r;return e},pr=(e,t)=>(e.install=n=>{e._context=n._context,n.config.globalProperties[t]=e},e),hr=(e,t)=>(e.install=n=>{n.directive(t,e)},e),fr=e=>(e.install=tn,e),gr=dr(ur);function mr(e,t,r,o,i,s){const a=(0,n.resolveComponent)("telephoneStrip"),l=gr;return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.createVNode)(l,{namespace:"ue"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(a)])),_:1})])}const vr={class:"translation-txt-box"},yr={key:0},br={key:0,class:"angent-box"},wr=(0,n.createElementVNode)("div",{class:"gray-txt"},[(0,n.createTextVNode)(" 座席 "),(0,n.createElementVNode)("div",{class:"name-icon"},"U")],-1),Cr={class:"blue-txt"},Sr={key:1},Er=(0,n.createElementVNode)("div",{class:"gray-txt"},[(0,n.createElementVNode)("div",{class:"name-icon"},"U"),(0,n.createTextVNode)(" 客户 ")],-1),Tr={class:"ke-txt"};var kr=(0,n.defineComponent)({props:{openNlsTranslationBarMsg:{type:Array,default:()=>[]}},setup(e){return(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",vr,[0===e.openNlsTranslationBarMsg.length?((0,n.openBlock)(),(0,n.createElementBlock)("div",yr,"暂无实时通话")):(0,n.createCommentVNode)("",!0),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.openNlsTranslationBarMsg,((e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:t},["agent"===e.side?((0,n.openBlock)(),(0,n.createElementBlock)("div",br,[wr,(0,n.createElementVNode)("span",Cr,(0,n.toDisplayString)(e.text),1)])):(0,n.createCommentVNode)("",!0),"customer"===e.side?((0,n.openBlock)(),(0,n.createElementBlock)("div",Sr,[Er,(0,n.createElementVNode)("span",Tr,(0,n.toDisplayString)(e.text),1)])):(0,n.createCommentVNode)("",!0)])))),128))]))}});const xr=kr;var Nr=xr;const Rr=Symbol("popper"),Ir=Symbol("popperContent"),_r=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],Or=Dn({role:{type:String,values:_r,default:"tooltip"}});var Ar=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n};const Br=(0,n.defineComponent)({name:"ElPopper",inheritAttrs:!1}),Dr=(0,n.defineComponent)({...Br,props:Or,setup(e,{expose:t}){const r=e,o=(0,n.ref)(),i=(0,n.ref)(),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.computed)((()=>r.role)),c={triggerRef:o,popperInstanceRef:i,contentRef:s,referenceRef:a,role:l};return t(c),(0,n.provide)(Rr,c),(e,t)=>(0,n.renderSlot)(e.$slots,"default")}});var Pr=Ar(Dr,[["__file","popper.vue"]]);const Hr=dr(Pr),Mr=Symbol("elTooltip");var jr,Vr=Object.defineProperty,Lr=Object.defineProperties,$r=Object.getOwnPropertyDescriptors,qr=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,Ur=Object.prototype.propertyIsEnumerable,zr=(e,t,n)=>t in e?Vr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Kr=(e,t)=>{for(var n in t||(t={}))Fr.call(t,n)&&zr(e,n,t[n]);if(qr)for(var n of qr(t))Ur.call(t,n)&&zr(e,n,t[n]);return e},Wr=(e,t)=>Lr(e,$r(t));function Gr(e,t){var r;const o=(0,n.shallowRef)();return(0,n.watchEffect)((()=>{o.value=e()}),Wr(Kr({},t),{flush:null!=(r=null==t?void 0:t.flush)?r:"sync"})),(0,n.readonly)(o)}const Yr="undefined"!==typeof window,Jr=(Object.prototype.toString,e=>"string"===typeof e),Zr=()=>{},Xr=Yr&&(null==(jr=null==window?void 0:window.navigator)?void 0:jr.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function Qr(e){return"function"===typeof e?e():(0,n.unref)(e)}function eo(e){return e}function to(e){return!!(0,n.getCurrentScope)()&&((0,n.onScopeDispose)(e),!0)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function no(e,t=!0){(0,n.getCurrentInstance)()?(0,n.onMounted)(e):t?e():(0,n.nextTick)(e)}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function ro(e,t,r={}){const{immediate:o=!0}=r,i=(0,n.ref)(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function l(){i.value=!1,a()}function c(...n){a(),i.value=!0,s=setTimeout((()=>{i.value=!1,s=null,e(...n)}),Qr(t))}return o&&(i.value=!0,Yr&&c()),to(l),{isPending:(0,n.readonly)(i),start:c,stop:l}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function oo(){let e;const t=(t,r)=>{n(),e=window.setTimeout(t,r)},n=()=>window.clearTimeout(e);return to((()=>n())),{registerTimeout:t,cancelTimeout:n}}const io=Dn({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),so=({showAfter:e,hideAfter:t,autoClose:r,open:o,close:i})=>{const{registerTimeout:s}=oo(),{registerTimeout:a,cancelTimeout:l}=oo(),c=t=>{s((()=>{o(t);const e=(0,n.unref)(r);yn(e)&&e>0&&a((()=>{i(t)}),e)}),(0,n.unref)(e))},u=e=>{l(),s((()=>{i(e)}),(0,n.unref)(t))};return{onOpen:c,onClose:u}};var ao="top",lo="bottom",co="right",uo="left",po="auto",ho=[ao,lo,co,uo],fo="start",go="end",mo="clippingParents",vo="viewport",yo="popper",bo="reference",wo=ho.reduce((function(e,t){return e.concat([t+"-"+fo,t+"-"+go])}),[]),Co=[].concat(ho,[po]).reduce((function(e,t){return e.concat([t,t+"-"+fo,t+"-"+go])}),[]),So="beforeRead",Eo="read",To="afterRead",ko="beforeMain",xo="main",No="afterMain",Ro="beforeWrite",Io="write",_o="afterWrite",Oo=[So,Eo,To,ko,xo,No,Ro,Io,_o];function Ao(e){return e?(e.nodeName||"").toLowerCase():null}function Bo(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Do(e){var t=Bo(e).Element;return e instanceof t||e instanceof Element}function Po(e){var t=Bo(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Ho(e){if("undefined"==typeof ShadowRoot)return!1;var t=Bo(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Mo(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},o=t.elements[e];!Po(o)||!Ao(o)||(Object.assign(o.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))}function jo(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]),s=i.reduce((function(e,t){return e[t]="",e}),{});!Po(r)||!Ao(r)||(Object.assign(r.style,s),Object.keys(o).forEach((function(e){r.removeAttribute(e)})))}))}}var Vo={name:"applyStyles",enabled:!0,phase:"write",fn:Mo,effect:jo,requires:["computeStyles"]};function Lo(e){return e.split("-")[0]}var $o=Math.max,qo=Math.min,Fo=Math.round;function Uo(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,o=1;if(Po(e)&&t){var i=e.offsetHeight,s=e.offsetWidth;s>0&&(r=Fo(n.width)/s||1),i>0&&(o=Fo(n.height)/i||1)}return{width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function zo(e){var t=Uo(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Ko(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ho(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wo(e){return Bo(e).getComputedStyle(e)}function Go(e){return["table","td","th"].indexOf(Ao(e))>=0}function Yo(e){return((Do(e)?e.ownerDocument:e.document)||window.document).documentElement}function Jo(e){return"html"===Ao(e)?e:e.assignedSlot||e.parentNode||(Ho(e)?e.host:null)||Yo(e)}function Zo(e){return Po(e)&&"fixed"!==Wo(e).position?e.offsetParent:null}function Xo(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),n=-1!==navigator.userAgent.indexOf("Trident");if(n&&Po(e)){var r=Wo(e);if("fixed"===r.position)return null}var o=Jo(e);for(Ho(o)&&(o=o.host);Po(o)&&["html","body"].indexOf(Ao(o))<0;){var i=Wo(o);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return o;o=o.parentNode}return null}function Qo(e){for(var t=Bo(e),n=Zo(e);n&&Go(n)&&"static"===Wo(n).position;)n=Zo(n);return n&&("html"===Ao(n)||"body"===Ao(n)&&"static"===Wo(n).position)?t:n||Xo(e)||t}function ei(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ti(e,t,n){return $o(e,qo(t,n))}function ni(e,t,n){var r=ti(e,t,n);return r>n?n:r}function ri(){return{top:0,right:0,bottom:0,left:0}}function oi(e){return Object.assign({},ri(),e)}function ii(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var si=function(e,t){return e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e,oi("number"!=typeof e?e:ii(e,ho))};function ai(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Lo(n.placement),l=ei(a),c=[uo,co].indexOf(a)>=0,u=c?"height":"width";if(i&&s){var d=si(o.padding,n),p=zo(i),h="y"===l?ao:uo,f="y"===l?lo:co,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],v=Qo(i),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,b=g/2-m/2,w=d[h],C=y-p[u]-d[f],S=y/2-p[u]/2+b,E=ti(w,S,C),T=l;n.modifiersData[r]=(t={},t[T]=E,t.centerOffset=E-S,t)}}function li(e){var t=e.state,n=e.options,r=n.element,o=void 0===r?"[data-popper-arrow]":r;null!=o&&("string"==typeof o&&(o=t.elements.popper.querySelector(o),!o)||!Ko(t.elements.popper,o)||(t.elements.arrow=o))}var ci={name:"arrow",enabled:!0,phase:"main",fn:ai,effect:li,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ui(e){return e.split("-")[1]}var di={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pi(e){var t=e.x,n=e.y,r=window,o=r.devicePixelRatio||1;return{x:Fo(t*o)/o||0,y:Fo(n*o)/o||0}}function hi(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,d=e.isFixed,p=s.x,h=void 0===p?0:p,f=s.y,g=void 0===f?0:f,m="function"==typeof u?u({x:h,y:g}):{x:h,y:g};h=m.x,g=m.y;var v=s.hasOwnProperty("x"),y=s.hasOwnProperty("y"),b=uo,w=ao,C=window;if(c){var S=Qo(n),E="clientHeight",T="clientWidth";if(S===Bo(n)&&(S=Yo(n),"static"!==Wo(S).position&&"absolute"===a&&(E="scrollHeight",T="scrollWidth")),o===ao||(o===uo||o===co)&&i===go){w=lo;var k=d&&S===C&&C.visualViewport?C.visualViewport.height:S[E];g-=k-r.height,g*=l?1:-1}if(o===uo||(o===ao||o===lo)&&i===go){b=co;var x=d&&S===C&&C.visualViewport?C.visualViewport.width:S[T];h-=x-r.width,h*=l?1:-1}}var N,R=Object.assign({position:a},c&&di),I=!0===u?pi({x:h,y:g}):{x:h,y:g};return h=I.x,g=I.y,l?Object.assign({},R,(N={},N[w]=y?"0":"",N[b]=v?"0":"",N.transform=(C.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",N)):Object.assign({},R,(t={},t[w]=y?g+"px":"",t[b]=v?h+"px":"",t.transform="",t))}function fi(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,i=n.adaptive,s=void 0===i||i,a=n.roundOffsets,l=void 0===a||a,c={placement:Lo(t.placement),variation:ui(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,hi(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,hi(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var gi={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fi,data:{}},mi={passive:!0};function vi(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=void 0===o||o,s=r.resize,a=void 0===s||s,l=Bo(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach((function(e){e.addEventListener("scroll",n.update,mi)})),a&&l.addEventListener("resize",n.update,mi),function(){i&&c.forEach((function(e){e.removeEventListener("scroll",n.update,mi)})),a&&l.removeEventListener("resize",n.update,mi)}}var yi={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vi,data:{}},bi={left:"right",right:"left",bottom:"top",top:"bottom"};function wi(e){return e.replace(/left|right|bottom|top/g,(function(e){return bi[e]}))}var Ci={start:"end",end:"start"};function Si(e){return e.replace(/start|end/g,(function(e){return Ci[e]}))}function Ei(e){var t=Bo(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ti(e){return Uo(Yo(e)).left+Ei(e).scrollLeft}function ki(e){var t=Bo(e),n=Yo(e),r=t.visualViewport,o=n.clientWidth,i=n.clientHeight,s=0,a=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=r.offsetLeft,a=r.offsetTop)),{width:o,height:i,x:s+Ti(e),y:a}}function xi(e){var t,n=Yo(e),r=Ei(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=$o(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=$o(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+Ti(e),l=-r.scrollTop;return"rtl"===Wo(o||n).direction&&(a+=$o(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Ni(e){var t=Wo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Ri(e){return["html","body","#document"].indexOf(Ao(e))>=0?e.ownerDocument.body:Po(e)&&Ni(e)?e:Ri(Jo(e))}function Ii(e,t){var n;void 0===t&&(t=[]);var r=Ri(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=Bo(r),s=o?[i].concat(i.visualViewport||[],Ni(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Ii(Jo(s)))}function _i(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Oi(e){var t=Uo(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Ai(e,t){return t===vo?_i(ki(e)):Do(t)?Oi(t):_i(xi(Yo(e)))}function Bi(e){var t=Ii(Jo(e)),n=["absolute","fixed"].indexOf(Wo(e).position)>=0,r=n&&Po(e)?Qo(e):e;return Do(r)?t.filter((function(e){return Do(e)&&Ko(e,r)&&"body"!==Ao(e)})):[]}function Di(e,t,n){var r="clippingParents"===t?Bi(e):[].concat(t),o=[].concat(r,[n]),i=o[0],s=o.reduce((function(t,n){var r=Ai(e,n);return t.top=$o(r.top,t.top),t.right=qo(r.right,t.right),t.bottom=qo(r.bottom,t.bottom),t.left=$o(r.left,t.left),t}),Ai(e,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Pi(e){var t,n=e.reference,r=e.element,o=e.placement,i=o?Lo(o):null,s=o?ui(o):null,a=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(i){case ao:t={x:a,y:n.y-r.height};break;case lo:t={x:a,y:n.y+n.height};break;case co:t={x:n.x+n.width,y:l};break;case uo:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var c=i?ei(i):null;if(null!=c){var u="y"===c?"height":"width";switch(s){case fo:t[c]=t[c]-(n[u]/2-r[u]/2);break;case go:t[c]=t[c]+(n[u]/2-r[u]/2);break}}return t}function Hi(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,i=n.boundary,s=void 0===i?mo:i,a=n.rootBoundary,l=void 0===a?vo:a,c=n.elementContext,u=void 0===c?yo:c,d=n.altBoundary,p=void 0!==d&&d,h=n.padding,f=void 0===h?0:h,g=oi("number"!=typeof f?f:ii(f,ho)),m=u===yo?bo:yo,v=e.rects.popper,y=e.elements[p?m:u],b=Di(Do(y)?y:y.contextElement||Yo(e.elements.popper),s,l),w=Uo(e.elements.reference),C=Pi({reference:w,element:v,strategy:"absolute",placement:o}),S=_i(Object.assign({},v,C)),E=u===yo?S:w,T={top:b.top-E.top+g.top,bottom:E.bottom-b.bottom+g.bottom,left:b.left-E.left+g.left,right:E.right-b.right+g.right},k=e.modifiersData.offset;if(u===yo&&k){var x=k[o];Object.keys(T).forEach((function(e){var t=[co,lo].indexOf(e)>=0?1:-1,n=[ao,lo].indexOf(e)>=0?"y":"x";T[e]+=x[n]*t}))}return T}function Mi(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?Co:l,u=ui(r),d=u?a?wo:wo.filter((function(e){return ui(e)===u})):ho,p=d.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=d);var h=p.reduce((function(t,n){return t[n]=Hi(e,{placement:n,boundary:o,rootBoundary:i,padding:s})[Lo(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}function ji(e){if(Lo(e)===po)return[];var t=wi(e);return[Si(e),t,Si(t)]}function Vi(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0===s||s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,f=void 0===h||h,g=n.allowedAutoPlacements,m=t.options.placement,v=Lo(m),y=v===m,b=l||(y||!f?[wi(m)]:ji(m)),w=[m].concat(b).reduce((function(e,n){return e.concat(Lo(n)===po?Mi(t,{placement:n,boundary:u,rootBoundary:d,padding:c,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),C=t.rects.reference,S=t.rects.popper,E=new Map,T=!0,k=w[0],x=0;x<w.length;x++){var N=w[x],R=Lo(N),I=ui(N)===fo,_=[ao,lo].indexOf(R)>=0,O=_?"width":"height",A=Hi(t,{placement:N,boundary:u,rootBoundary:d,altBoundary:p,padding:c}),B=_?I?co:uo:I?lo:ao;C[O]>S[O]&&(B=wi(B));var D=wi(B),P=[];if(i&&P.push(A[R]<=0),a&&P.push(A[B]<=0,A[D]<=0),P.every((function(e){return e}))){k=N,T=!1;break}E.set(N,P)}if(T)for(var H=f?3:1,M=function(e){var t=w.find((function(t){var n=E.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return k=t,"break"},j=H;j>0;j--){var V=M(j);if("break"===V)break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}}var Li={name:"flip",enabled:!0,phase:"main",fn:Vi,requiresIfExists:["offset"],data:{_skip:!1}};function $i(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function qi(e){return[ao,co,lo,uo].some((function(t){return e[t]>=0}))}function Fi(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Hi(t,{elementContext:"reference"}),a=Hi(t,{altBoundary:!0}),l=$i(s,r),c=$i(a,o,i),u=qi(l),d=qi(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}var Ui={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Fi};function zi(e,t,n){var r=Lo(e),o=[uo,ao].indexOf(r)>=0?-1:1,i="function"==typeof n?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[uo,co].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function Ki(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=void 0===o?[0,0]:o,s=Co.reduce((function(e,n){return e[n]=zi(n,t.rects,i),e}),{}),a=s[t.placement],l=a.x,c=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}var Wi={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ki};function Gi(e){var t=e.state,n=e.name;t.modifiersData[n]=Pi({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Yi={name:"popperOffsets",enabled:!0,phase:"read",fn:Gi,data:{}};function Ji(e){return"x"===e?"y":"x"}function Zi(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=void 0===o||o,s=n.altAxis,a=void 0!==s&&s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,p=n.tether,h=void 0===p||p,f=n.tetherOffset,g=void 0===f?0:f,m=Hi(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),v=Lo(t.placement),y=ui(t.placement),b=!y,w=ei(v),C=Ji(w),S=t.modifiersData.popperOffsets,E=t.rects.reference,T=t.rects.popper,k="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,x="number"==typeof k?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(S){if(i){var I,_="y"===w?ao:uo,O="y"===w?lo:co,A="y"===w?"height":"width",B=S[w],D=B+m[_],P=B-m[O],H=h?-T[A]/2:0,M=y===fo?E[A]:T[A],j=y===fo?-T[A]:-E[A],V=t.elements.arrow,L=h&&V?zo(V):{width:0,height:0},$=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ri(),q=$[_],F=$[O],U=ti(0,E[A],L[A]),z=b?E[A]/2-H-U-q-x.mainAxis:M-U-q-x.mainAxis,K=b?-E[A]/2+H+U+F+x.mainAxis:j+U+F+x.mainAxis,W=t.elements.arrow&&Qo(t.elements.arrow),G=W?"y"===w?W.clientTop||0:W.clientLeft||0:0,Y=null!=(I=null==N?void 0:N[w])?I:0,J=B+z-Y-G,Z=B+K-Y,X=ti(h?qo(D,J):D,B,h?$o(P,Z):P);S[w]=X,R[w]=X-B}if(a){var Q,ee="x"===w?ao:uo,te="x"===w?lo:co,ne=S[C],re="y"===C?"height":"width",oe=ne+m[ee],ie=ne-m[te],se=-1!==[ao,uo].indexOf(v),ae=null!=(Q=null==N?void 0:N[C])?Q:0,le=se?oe:ne-E[re]-T[re]-ae+x.altAxis,ce=se?ne+E[re]+T[re]-ae-x.altAxis:ie,ue=h&&se?ni(le,ne,ce):ti(h?le:oe,ne,h?ce:ie);S[C]=ue,R[C]=ue-ne}t.modifiersData[r]=R}}var Xi={name:"preventOverflow",enabled:!0,phase:"main",fn:Zi,requiresIfExists:["offset"]};function Qi(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function es(e){return e!==Bo(e)&&Po(e)?Qi(e):Ei(e)}function ts(e){var t=e.getBoundingClientRect(),n=Fo(t.width)/e.offsetWidth||1,r=Fo(t.height)/e.offsetHeight||1;return 1!==n||1!==r}function ns(e,t,n){void 0===n&&(n=!1);var r=Po(t),o=Po(t)&&ts(t),i=Yo(t),s=Uo(e,o),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==Ao(t)||Ni(i))&&(a=es(t)),Po(t)?(l=Uo(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Ti(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function rs(e){var t=new Map,n=new Set,r=[];function o(e){n.add(e.name);var i=[].concat(e.requires||[],e.requiresIfExists||[]);i.forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&o(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||o(e)})),r}function os(e){var t=rs(e);return Oo.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}function is(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function ss(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}var as={placement:"bottom",modifiers:[],strategy:"absolute"};function ls(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function cs(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,o=t.defaultOptions,i=void 0===o?as:o;return function(e,t,n){void 0===n&&(n=i);var o={placement:"bottom",orderedModifiers:[],options:Object.assign({},as,i),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},s=[],a=!1,l={state:o,setOptions:function(n){var s="function"==typeof n?n(o.options):n;u(),o.options=Object.assign({},i,o.options,s),o.scrollParents={reference:Do(e)?Ii(e):e.contextElement?Ii(e.contextElement):[],popper:Ii(t)};var a=os(ss([].concat(r,o.options.modifiers)));return o.orderedModifiers=a.filter((function(e){return e.enabled})),c(),l.update()},forceUpdate:function(){if(!a){var e=o.elements,t=e.reference,n=e.popper;if(ls(t,n)){o.rects={reference:ns(t,Qo(n),"fixed"===o.options.strategy),popper:zo(n)},o.reset=!1,o.placement=o.options.placement,o.orderedModifiers.forEach((function(e){return o.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<o.orderedModifiers.length;r++)if(!0!==o.reset){var i=o.orderedModifiers[r],s=i.fn,c=i.options,u=void 0===c?{}:c,d=i.name;"function"==typeof s&&(o=s({state:o,options:u,name:d,instance:l})||o)}else o.reset=!1,r=-1}}},update:is((function(){return new Promise((function(e){l.forceUpdate(),e(o)}))})),destroy:function(){u(),a=!0}};if(!ls(e,t))return l;function c(){o.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var a=i({state:o,name:t,instance:l,options:r}),c=function(){};s.push(a||c)}}))}function u(){s.forEach((function(e){return e()})),s=[]}return l.setOptions(n).then((function(e){!a&&n.onFirstUpdate&&n.onFirstUpdate(e)})),l}}cs();var us=[yi,Yi,gi,Vo],ds=(cs({defaultModifiers:us}),[yi,Yi,gi,Vo,Wi,Li,Xi,ci,Ui]),ps=cs({defaultModifiers:ds});const hs=["fixed","absolute"],fs=Dn({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:On(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Co,default:"bottom"},popperOptions:{type:On(Object),default:()=>({})},strategy:{type:String,values:hs,default:"absolute"}}),gs=Dn({...fs,id:String,style:{type:On([String,Array,Object])},className:{type:On([String,Array,Object])},effect:{type:String,default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:On([String,Array,Object])},popperStyle:{type:On([String,Array,Object])},referenceEl:{type:On(Object)},triggerTargetEl:{type:On(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},ariaLabel:{type:String,default:void 0},virtualTriggering:Boolean,zIndex:Number}),ms={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},vs=Dn({...io,...gs,appendTo:{type:On([String,Object])},content:{type:String,default:""},rawContent:{type:Boolean,default:!1},persistent:Boolean,ariaLabel:String,visible:{type:On(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean}),ys=Dn({virtualRef:{type:On(Object)},virtualTriggering:Boolean,onMouseenter:{type:On(Function)},onMouseleave:{type:On(Function)},onClick:{type:On(Function)},onKeydown:{type:On(Function)},onFocus:{type:On(Function)},onBlur:{type:On(Function)},onContextmenu:{type:On(Function)},id:String,open:Boolean}),bs={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},ws=Dn({...ys,disabled:Boolean,trigger:{type:On([String,Array]),default:"hover"},triggerKeys:{type:On(Array),default:()=>[bs.enter,bs.space]}}),Cs=Bn({type:On(Boolean),default:null}),Ss=Bn({type:On(Function)}),Es=e=>{const t=`update:${e}`,r=`onUpdate:${e}`,o=[t],i={[e]:Cs,[r]:Ss},s=({indicator:o,toggleReason:i,shouldHideWhenRouteChanges:s,shouldProceed:a,onShow:l,onHide:c})=>{const u=(0,n.getCurrentInstance)(),{emit:d}=u,p=u.props,h=(0,n.computed)((()=>sn(p[r]))),f=(0,n.computed)((()=>null===p[e])),g=e=>{!0!==o.value&&(o.value=!0,i&&(i.value=e),sn(l)&&l(e))},m=e=>{!1!==o.value&&(o.value=!1,i&&(i.value=e),sn(c)&&c(e))},v=e=>{if(!0===p.disabled||sn(a)&&!a())return;const n=h.value&&Yr;n&&d(t,!0),!f.value&&n||g(e)},y=e=>{if(!0===p.disabled||!Yr)return;const n=h.value&&Yr;n&&d(t,!1),!f.value&&n||m(e)},b=e=>{vn(e)&&(p.disabled&&e?h.value&&d(t,!1):o.value!==e&&(e?g():m()))},w=()=>{o.value?y():v()};return(0,n.watch)((()=>p[e]),b),s&&void 0!==u.appContext.config.globalProperties.$route&&(0,n.watch)((()=>({...u.proxy.$route})),(()=>{s.value&&o.value&&y()})),(0,n.onMounted)((()=>{b(p[e])})),{hide:y,show:v,toggle:w,hasUpdateHandler:h}};return{useModelToggle:s,useModelToggleProps:i,useModelToggleEmits:o}},{useModelToggle:Ts,useModelToggleProps:ks,useModelToggleEmits:xs}=Es("modelValue"),Ns=Dn({arrowOffset:{type:Number,default:5}}),{useModelToggleProps:Rs,useModelToggleEmits:Is,useModelToggle:_s}=Es("visible"),Os=Dn({...Or,...Rs,...vs,...ws,...Ns,showArrow:{type:Boolean,default:!0}}),As=[...Is,"before-show","before-hide","show","hide","open","close"],Bs=(e,t)=>on(e)?e.includes(t):e===t,Ds=(e,t,r)=>o=>{Bs((0,n.unref)(e),t)&&r(o)},Ps=(e,t,{checkForDefaultPrevented:n=!0}={})=>{const r=r=>{const o=null==e?void 0:e(r);if(!1===n||!o)return null==t?void 0:t(r)};return r},Hs=e=>t=>"mouse"===t.pointerType?e(t):void 0;function Ms(e){return null==e}var js=Ms;function Vs(e){var t;const n=Qr(e);return null!=(t=null==n?void 0:n.$el)?t:n}const Ls=Yr?window:void 0,$s=Yr?window.document:void 0;Yr&&window.navigator,Yr&&window.location;function qs(...e){let t,r,o,i;if(Jr(e[0])||Array.isArray(e[0])?([r,o,i]=e,t=Ls):[t,r,o,i]=e,!t)return Zr;Array.isArray(r)||(r=[r]),Array.isArray(o)||(o=[o]);const s=[],a=()=>{s.forEach((e=>e())),s.length=0},l=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=(0,n.watch)((()=>[Vs(t),Qr(i)]),(([e,t])=>{a(),e&&s.push(...r.flatMap((n=>o.map((r=>l(e,n,r,t))))))}),{immediate:!0,flush:"post"}),u=()=>{c(),a()};return to(u),u}let Fs=!1;function Us(e,t,n={}){const{window:r=Ls,ignore:o=[],capture:i=!0,detectIframe:s=!1}=n;if(!r)return;Xr&&!Fs&&(Fs=!0,Array.from(r.document.body.children).forEach((e=>e.addEventListener("click",Zr))));let a=!0;const l=e=>o.some((t=>{if("string"===typeof t)return Array.from(r.document.querySelectorAll(t)).some((t=>t===e.target||e.composedPath().includes(t)));{const n=Vs(t);return n&&(e.target===n||e.composedPath().includes(n))}})),c=n=>{const r=Vs(e);r&&r!==n.target&&!n.composedPath().includes(r)&&(0===n.detail&&(a=!l(n)),a?t(n):a=!0)},u=[qs(r,"click",c,{passive:!0,capture:i}),qs(r,"pointerdown",(t=>{const n=Vs(e);n&&(a=!t.composedPath().includes(n)&&!l(t))}),{passive:!0}),s&&qs(r,"blur",(n=>{var o;const i=Vs(e);"IFRAME"!==(null==(o=r.document.activeElement)?void 0:o.tagName)||(null==i?void 0:i.contains(r.document.activeElement))||t(n)}))].filter(Boolean),d=()=>u.forEach((e=>e()));return d}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function zs(e,t=!1){const r=(0,n.ref)(),o=()=>r.value=Boolean(e());return o(),no(o,t),r}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;const Ks="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},Ws="__vueuse_ssr_handlers__";Ks[Ws]=Ks[Ws]||{};Ks[Ws];Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;function Gs({document:e=$s}={}){if(!e)return(0,n.ref)("visible");const t=(0,n.ref)(e.visibilityState);return qs(e,"visibilitychange",(()=>{t.value=e.visibilityState})),t}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Ys=Object.getOwnPropertySymbols,Js=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable,Xs=(e,t)=>{var n={};for(var r in e)Js.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Ys)for(var r of Ys(e))t.indexOf(r)<0&&Zs.call(e,r)&&(n[r]=e[r]);return n};function Qs(e,t,r={}){const o=r,{window:i=Ls}=o,s=Xs(o,["window"]);let a;const l=zs((()=>i&&"ResizeObserver"in i)),c=()=>{a&&(a.disconnect(),a=void 0)},u=(0,n.watch)((()=>Vs(e)),(e=>{c(),l.value&&i&&e&&(a=new ResizeObserver(t),a.observe(e,s))}),{immediate:!0,flush:"post"}),d=()=>{c(),u()};return to(d),{isSupported:l,stop:d}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;new Map;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var ea=Object.getOwnPropertySymbols,ta=Object.prototype.hasOwnProperty,na=Object.prototype.propertyIsEnumerable,ra=(e,t)=>{var n={};for(var r in e)ta.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&ea)for(var r of ea(e))t.indexOf(r)<0&&na.call(e,r)&&(n[r]=e[r]);return n};function oa(e,t,r={}){const o=r,{window:i=Ls}=o,s=ra(o,["window"]);let a;const l=zs((()=>i&&"MutationObserver"in i)),c=()=>{a&&(a.disconnect(),a=void 0)},u=(0,n.watch)((()=>Vs(e)),(e=>{c(),l.value&&i&&e&&(a=new MutationObserver(t),a.observe(e,s))}),{immediate:!0}),d=()=>{c(),u()};return to(d),{isSupported:l,stop:d}}Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var ia;(function(e){e["UP"]="UP",e["RIGHT"]="RIGHT",e["DOWN"]="DOWN",e["LEFT"]="LEFT",e["NONE"]="NONE"})(ia||(ia={}));Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var sa=Object.defineProperty,aa=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,ua=(e,t,n)=>t in e?sa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,da=(e,t)=>{for(var n in t||(t={}))la.call(t,n)&&ua(e,n,t[n]);if(aa)for(var n of aa(t))ca.call(t,n)&&ua(e,n,t[n]);return e};const pa={easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]};da({linear:eo},pa);function ha({window:e=Ls}={}){if(!e)return(0,n.ref)(!1);const t=(0,n.ref)(e.document.hasFocus());return qs(e,"blur",(()=>{t.value=!1})),qs(e,"focus",(()=>{t.value=!0})),t}const fa=Symbol("elForwardRef"),ga=e=>{const t=t=>{e.value=t};(0,n.provide)(fa,{setForwardRef:t})},ma=e=>({mounted(t){e(t)},updated(t){e(t)},unmounted(){e(null)}}),va="ElOnlyChild",ya=(0,n.defineComponent)({name:va,setup(e,{slots:t,attrs:r}){var o;const i=(0,n.inject)(fa),s=ma(null!=(o=null==i?void 0:i.setForwardRef)?o:tn);return()=>{var e;const o=null==(e=t.default)?void 0:e.call(t,r);if(!o)return null;if(o.length>1)return Nn(va,"requires exact only one valid child."),null;const i=ba(o);return i?(0,n.withDirectives)((0,n.cloneVNode)(i,r),[[s]]):(Nn(va,"no valid child node found"),null)}}});function ba(e){if(!e)return null;const t=e;for(const r of t){if(ln(r))switch(r.type){case n.Comment:continue;case n.Text:case"svg":return wa(r);case n.Fragment:return ba(r.children);default:return r}return wa(r)}return null}function wa(e){const t=c("only-child");return(0,n.createVNode)("span",{class:t.e("content")},[e])}const Ca=(0,n.defineComponent)({name:"ElPopperTrigger",inheritAttrs:!1}),Sa=(0,n.defineComponent)({...Ca,props:ys,setup(e,{expose:t}){const r=e,{role:o,triggerRef:i}=(0,n.inject)(Rr,void 0);ga(i);const s=(0,n.computed)((()=>l.value?r.id:void 0)),a=(0,n.computed)((()=>{if(o&&"tooltip"===o.value)return r.open&&r.id?r.id:void 0})),l=(0,n.computed)((()=>{if(o&&"tooltip"!==o.value)return o.value})),c=(0,n.computed)((()=>l.value?`${r.open}`:void 0));let u;return(0,n.onMounted)((()=>{(0,n.watch)((()=>r.virtualRef),(e=>{e&&(i.value=Vs(e))}),{immediate:!0}),(0,n.watch)(i,((e,t)=>{null==u||u(),u=void 0,bn(e)&&(["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"].forEach((n=>{var o;const i=r[n];i&&(e.addEventListener(n.slice(2).toLowerCase(),i),null==(o=null==t?void 0:t.removeEventListener)||o.call(t,n.slice(2).toLowerCase(),i))})),u=(0,n.watch)([s,a,l,c],(t=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(((n,r)=>{js(t[r])?e.removeAttribute(n):e.setAttribute(n,t[r])}))}),{immediate:!0})),bn(t)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((e=>t.removeAttribute(e)))}),{immediate:!0})})),(0,n.onBeforeUnmount)((()=>{null==u||u(),u=void 0})),t({triggerRef:i}),(e,t)=>e.virtualTriggering?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(ya),(0,n.mergeProps)({key:0},e.$attrs,{"aria-controls":(0,n.unref)(s),"aria-describedby":(0,n.unref)(a),"aria-expanded":(0,n.unref)(c),"aria-haspopup":(0,n.unref)(l)}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var Ea=Ar(Sa,[["__file","trigger.vue"]]);const Ta=(0,n.defineComponent)({name:"ElTooltipTrigger"}),ka=(0,n.defineComponent)({...Ta,props:ws,setup(e,{expose:t}){const r=e,o=c("tooltip"),{controlled:i,id:s,open:a,onOpen:l,onClose:u,onToggle:d}=(0,n.inject)(Mr,void 0),p=(0,n.ref)(null),h=()=>{if((0,n.unref)(i)||r.disabled)return!0},f=(0,n.toRef)(r,"trigger"),g=Ps(h,Ds(f,"hover",l)),m=Ps(h,Ds(f,"hover",u)),v=Ps(h,Ds(f,"click",(e=>{0===e.button&&d(e)}))),y=Ps(h,Ds(f,"focus",l)),b=Ps(h,Ds(f,"focus",u)),w=Ps(h,Ds(f,"contextmenu",(e=>{e.preventDefault(),d(e)}))),C=Ps(h,(e=>{const{code:t}=e;r.triggerKeys.includes(t)&&(e.preventDefault(),d(e))}));return t({triggerRef:p}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ea),{id:(0,n.unref)(s),"virtual-ref":e.virtualRef,open:(0,n.unref)(a),"virtual-triggering":e.virtualTriggering,class:(0,n.normalizeClass)((0,n.unref)(o).e("trigger")),onBlur:(0,n.unref)(b),onClick:(0,n.unref)(v),onContextmenu:(0,n.unref)(w),onFocus:(0,n.unref)(y),onMouseenter:(0,n.unref)(g),onMouseleave:(0,n.unref)(m),onKeydown:(0,n.unref)(C)},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var xa=Ar(ka,[["__file","trigger.vue"]]);const Na={prefix:Math.floor(1e4*Math.random()),current:0},Ra=Symbol("elIdInjection"),Ia=()=>(0,n.getCurrentInstance)()?(0,n.inject)(Ra,Na):Na,_a=e=>{const t=Ia();Yr||t!==Na||Nn("IdInjection","Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed\nusage: app.provide(ID_INJECTION_KEY, {\n prefix: number,\n current: number,\n})");const r=l(),o=(0,n.computed)((()=>(0,n.unref)(e)||`${r.value}-id-${t.prefix}-${t.current++}`));return o};let Oa;const Aa=()=>{const e=l(),t=Ia(),r=(0,n.computed)((()=>`${e.value}-popper-container-${t.prefix}`)),o=(0,n.computed)((()=>`#${r.value}`));return{id:r,selector:o}},Ba=e=>{const t=document.createElement("div");return t.id=e,document.body.appendChild(t),t},Da=()=>{const{id:e,selector:t}=Aa();return(0,n.onBeforeMount)((()=>{Yr&&(Oa||document.body.querySelector(t.value)||(Oa=Ba(e.value)))})),{id:e,selector:t}},Pa=(e,t)=>{const r=(0,n.ref)(!1),o=(0,n.ref)(),i=()=>{t("focus")},s=e=>{var n;"pointer"!==(null==(n=e.detail)?void 0:n.focusReason)&&(o.value="first",t("blur"))},a=t=>{e.visible&&!r.value&&(t.target&&(o.value=t.target),r.value=!0)},l=t=>{e.trapping||("pointer"===t.detail.focusReason&&t.preventDefault(),r.value=!1)},c=()=>{r.value=!1,t("close")};return{focusStartRef:o,trapped:r,onFocusAfterReleased:s,onFocusAfterTrapped:i,onFocusInTrap:a,onFocusoutPrevented:l,onReleaseRequested:c}};function Ha(e){return void 0===e}var Ma=Ha;const ja=(e,t=[])=>{const{placement:n,strategy:r,popperOptions:o}=e,i={placement:n,strategy:r,...o,modifiers:[...La(e),...t]};return $a(i,null==o?void 0:o.modifiers),i},Va=e=>{if(Yr)return Vs(e)};function La(e){const{offset:t,gpuAcceleration:n,fallbackPlacements:r}=e;return[{name:"offset",options:{offset:[0,null!=t?t:12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:r}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function $a(e,t){t&&(e.modifiers=[...e.modifiers,...null!=t?t:[]])}const qa=(e,t,r={})=>{const o={name:"updateState",enabled:!0,phase:"write",fn:({state:e})=>{const t=Fa(e);Object.assign(a.value,t)},requires:["computeStyles"]},i=(0,n.computed)((()=>{const{onFirstUpdate:e,placement:t,strategy:i,modifiers:s}=(0,n.unref)(r);return{onFirstUpdate:e,placement:t||"bottom",strategy:i||"absolute",modifiers:[...s||[],o,{name:"applyStyles",enabled:!1}]}})),s=(0,n.shallowRef)(),a=(0,n.ref)({styles:{popper:{position:(0,n.unref)(i).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{s.value&&(s.value.destroy(),s.value=void 0)};return(0,n.watch)(i,(e=>{const t=(0,n.unref)(s);t&&t.setOptions(e)}),{deep:!0}),(0,n.watch)([e,t],(([e,t])=>{l(),e&&t&&(s.value=ps(e,t,(0,n.unref)(i)))})),(0,n.onBeforeUnmount)((()=>{l()})),{state:(0,n.computed)((()=>{var e;return{...(null==(e=(0,n.unref)(s))?void 0:e.state)||{}}})),styles:(0,n.computed)((()=>(0,n.unref)(a).styles)),attributes:(0,n.computed)((()=>(0,n.unref)(a).attributes)),update:()=>{var e;return null==(e=(0,n.unref)(s))?void 0:e.update()},forceUpdate:()=>{var e;return null==(e=(0,n.unref)(s))?void 0:e.forceUpdate()},instanceRef:(0,n.computed)((()=>(0,n.unref)(s)))}};function Fa(e){const t=Object.keys(e.elements),n=In(t.map((t=>[t,e.styles[t]||{}]))),r=In(t.map((t=>[t,e.attributes[t]])));return{styles:n,attributes:r}}const Ua=0,za=e=>{const{popperInstanceRef:t,contentRef:r,triggerRef:o,role:i}=(0,n.inject)(Rr,void 0),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.computed)((()=>({name:"eventListeners",enabled:!!e.visible}))),c=(0,n.computed)((()=>{var e;const t=(0,n.unref)(s),r=null!=(e=(0,n.unref)(a))?e:Ua;return{name:"arrow",enabled:!Ma(t),options:{element:t,padding:r}}})),u=(0,n.computed)((()=>({onFirstUpdate:()=>{g()},...ja(e,[(0,n.unref)(c),(0,n.unref)(l)])}))),d=(0,n.computed)((()=>Va(e.referenceEl)||(0,n.unref)(o))),{attributes:p,state:h,styles:f,update:g,forceUpdate:m,instanceRef:v}=qa(d,r,u);return(0,n.watch)(v,(e=>t.value=e)),(0,n.onMounted)((()=>{(0,n.watch)((()=>{var e;return null==(e=(0,n.unref)(d))?void 0:e.getBoundingClientRect()}),(()=>{g()}))})),{attributes:p,arrowRef:s,contentRef:r,instanceRef:v,state:h,styles:f,role:i,forceUpdate:m,update:g}},Ka=(e,{attributes:t,styles:r,role:o})=>{const{nextZIndex:i}=Tn(),s=c("popper"),a=(0,n.computed)((()=>(0,n.unref)(t).popper)),l=(0,n.ref)(yn(e.zIndex)?e.zIndex:i()),u=(0,n.computed)((()=>[s.b(),s.is("pure",e.pure),s.is(e.effect),e.popperClass])),d=(0,n.computed)((()=>[{zIndex:(0,n.unref)(l)},(0,n.unref)(r).popper,e.popperStyle||{}])),p=(0,n.computed)((()=>"dialog"===o.value?"false":void 0)),h=(0,n.computed)((()=>(0,n.unref)(r).arrow||{})),f=()=>{l.value=yn(e.zIndex)?e.zIndex:i()};return{ariaModal:p,arrowStyle:h,contentAttrs:a,contentClass:u,contentStyle:d,contentZIndex:l,updateZIndex:f}},Wa=Symbol("formContextKey"),Ga=Symbol("formItemContextKey"),Ya="focus-trap.focus-after-trapped",Ja="focus-trap.focus-after-released",Za="focus-trap.focusout-prevented",Xa={cancelable:!0,bubbles:!1},Qa={cancelable:!0,bubbles:!1},el="focusAfterTrapped",tl="focusAfterReleased",nl=Symbol("elFocusTrap"),rl=(0,n.ref)(),ol=(0,n.ref)(0),il=(0,n.ref)(0);let sl=0;const al=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0||e===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});while(n.nextNode())t.push(n.currentNode);return t},ll=(e,t)=>{for(const n of e)if(!cl(n,t))return n},cl=(e,t)=>{if("hidden"===getComputedStyle(e).visibility)return!0;while(e){if(t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1},ul=e=>{const t=al(e),n=ll(t,e),r=ll(t.reverse(),e);return[n,r]},dl=e=>e instanceof HTMLInputElement&&"select"in e,pl=(e,t)=>{if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),il.value=window.performance.now(),e!==n&&dl(e)&&t&&e.select()}};function hl(e,t){const n=[...e],r=e.indexOf(t);return-1!==r&&n.splice(r,1),n}const fl=()=>{let e=[];const t=t=>{const n=e[0];n&&t!==n&&n.pause(),e=hl(e,t),e.unshift(t)},n=t=>{var n,r;e=hl(e,t),null==(r=null==(n=e[0])?void 0:n.resume)||r.call(n)};return{push:t,remove:n}},gl=(e,t=!1)=>{const n=document.activeElement;for(const r of e)if(pl(r,t),document.activeElement!==n)return},ml=fl(),vl=()=>ol.value>il.value,yl=()=>{rl.value="pointer",ol.value=window.performance.now()},bl=()=>{rl.value="keyboard",ol.value=window.performance.now()},wl=()=>((0,n.onMounted)((()=>{0===sl&&(document.addEventListener("mousedown",yl),document.addEventListener("touchstart",yl),document.addEventListener("keydown",bl)),sl++})),(0,n.onBeforeUnmount)((()=>{sl--,sl<=0&&(document.removeEventListener("mousedown",yl),document.removeEventListener("touchstart",yl),document.removeEventListener("keydown",bl))})),{focusReason:rl,lastUserFocusTimestamp:ol,lastAutomatedFocusTimestamp:il}),Cl=e=>new CustomEvent(Za,{...Qa,detail:e});let Sl=[];const El=e=>{const t=e;t.key===bs.esc&&Sl.forEach((e=>e(t)))},Tl=e=>{(0,n.onMounted)((()=>{0===Sl.length&&document.addEventListener("keydown",El),Yr&&Sl.push(e)})),(0,n.onBeforeUnmount)((()=>{Sl=Sl.filter((t=>t!==e)),0===Sl.length&&Yr&&document.removeEventListener("keydown",El)}))},kl=(0,n.defineComponent)({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[el,tl,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const r=(0,n.ref)();let o,i;const{focusReason:s}=wl();Tl((n=>{e.trapped&&!a.paused&&t("release-requested",n)}));const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=n=>{if(!e.loop&&!e.trapped)return;if(a.paused)return;const{key:r,altKey:o,ctrlKey:i,metaKey:l,currentTarget:c,shiftKey:u}=n,{loop:d}=e,p=r===bs.tab&&!o&&!i&&!l,h=document.activeElement;if(p&&h){const e=c,[r,o]=ul(e),i=r&&o;if(i)if(u||h!==o){if(u&&[r,e].includes(h)){const e=Cl({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&pl(o,!0))}}else{const e=Cl({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||(n.preventDefault(),d&&pl(r,!0))}else if(h===e){const e=Cl({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||n.preventDefault()}}};(0,n.provide)(nl,{focusTrapRef:r,onKeydown:l}),(0,n.watch)((()=>e.focusTrapEl),(e=>{e&&(r.value=e)}),{immediate:!0}),(0,n.watch)([r],(([e],[t])=>{e&&(e.addEventListener("keydown",l),e.addEventListener("focusin",d),e.addEventListener("focusout",p)),t&&(t.removeEventListener("keydown",l),t.removeEventListener("focusin",d),t.removeEventListener("focusout",p))}));const c=e=>{t(el,e)},u=e=>t(tl,e),d=s=>{const l=(0,n.unref)(r);if(!l)return;const c=s.target,u=s.relatedTarget,d=c&&l.contains(c);if(!e.trapped){const e=u&&l.contains(u);e||(o=u)}d&&t("focusin",s),a.paused||e.trapped&&(d?i=c:pl(i,!0))},p=o=>{const l=(0,n.unref)(r);if(!a.paused&&l)if(e.trapped){const n=o.relatedTarget;js(n)||l.contains(n)||setTimeout((()=>{if(!a.paused&&e.trapped){const e=Cl({focusReason:s.value});t("focusout-prevented",e),e.defaultPrevented||pl(i,!0)}}),0)}else{const e=o.target,n=e&&l.contains(e);n||t("focusout",o)}};async function h(){await(0,n.nextTick)();const t=(0,n.unref)(r);if(t){ml.push(a);const r=t.contains(document.activeElement)?o:document.activeElement;o=r;const i=t.contains(r);if(!i){const o=new Event(Ya,Xa);t.addEventListener(Ya,c),t.dispatchEvent(o),o.defaultPrevented||(0,n.nextTick)((()=>{let n=e.focusStartEl;an(n)||(pl(n),document.activeElement!==n&&(n="first")),"first"===n&&gl(al(t),!0),document.activeElement!==r&&"container"!==n||pl(t)}))}}}function f(){const e=(0,n.unref)(r);if(e){e.removeEventListener(Ya,c);const t=new CustomEvent(Ja,{...Xa,detail:{focusReason:s.value}});e.addEventListener(Ja,u),e.dispatchEvent(t),t.defaultPrevented||"keyboard"!=s.value&&vl()&&!e.contains(document.activeElement)||pl(null!=o?o:document.body),e.removeEventListener(Ja,u),ml.remove(a)}}return(0,n.onMounted)((()=>{e.trapped&&h(),(0,n.watch)((()=>e.trapped),(e=>{e?h():f()}))})),(0,n.onBeforeUnmount)((()=>{e.trapped&&f()})),{onKeydown:l}}});function xl(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default",{handleKeydown:e.onKeydown})}var Nl=Ar(kl,[["render",xl],["__file","focus-trap.vue"]]);const Rl=(0,n.defineComponent)({name:"ElPopperContent"}),Il=(0,n.defineComponent)({...Rl,props:gs,emits:ms,setup(e,{expose:t,emit:r}){const o=e,{focusStartRef:i,trapped:s,onFocusAfterReleased:a,onFocusAfterTrapped:l,onFocusInTrap:c,onFocusoutPrevented:u,onReleaseRequested:d}=Pa(o,r),{attributes:p,arrowRef:h,contentRef:f,styles:g,instanceRef:m,role:v,update:y}=za(o),{ariaModal:b,arrowStyle:w,contentAttrs:C,contentClass:S,contentStyle:E,updateZIndex:T}=Ka(o,{styles:g,attributes:p,role:v}),k=(0,n.inject)(Ga,void 0),x=(0,n.ref)();let N;(0,n.provide)(Ir,{arrowStyle:w,arrowRef:h,arrowOffset:x}),k&&(k.addInputId||k.removeInputId)&&(0,n.provide)(Ga,{...k,addInputId:tn,removeInputId:tn});const R=(e=!0)=>{y(),e&&T()},I=()=>{R(!1),o.visible&&o.focusOnShow?s.value=!0:!1===o.visible&&(s.value=!1)};return(0,n.onMounted)((()=>{(0,n.watch)((()=>o.triggerTargetEl),((e,t)=>{null==N||N(),N=void 0;const r=(0,n.unref)(e||f.value),i=(0,n.unref)(t||f.value);bn(r)&&(N=(0,n.watch)([v,()=>o.ariaLabel,b,()=>o.id],(e=>{["role","aria-label","aria-modal","id"].forEach(((t,n)=>{js(e[n])?r.removeAttribute(t):r.setAttribute(t,e[n])}))}),{immediate:!0})),i!==r&&bn(i)&&["role","aria-label","aria-modal","id"].forEach((e=>{i.removeAttribute(e)}))}),{immediate:!0}),(0,n.watch)((()=>o.visible),I,{immediate:!0})})),(0,n.onBeforeUnmount)((()=>{null==N||N(),N=void 0})),t({popperContentRef:f,popperInstanceRef:m,updatePopper:R,contentStyle:E}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)({ref_key:"contentRef",ref:f},(0,n.unref)(C),{style:(0,n.unref)(E),class:(0,n.unref)(S),tabindex:"-1",onMouseenter:t[0]||(t[0]=t=>e.$emit("mouseenter",t)),onMouseleave:t[1]||(t[1]=t=>e.$emit("mouseleave",t))}),[(0,n.createVNode)((0,n.unref)(Nl),{trapped:(0,n.unref)(s),"trap-on-focus-in":!0,"focus-trap-el":(0,n.unref)(f),"focus-start-el":(0,n.unref)(i),onFocusAfterTrapped:(0,n.unref)(l),onFocusAfterReleased:(0,n.unref)(a),onFocusin:(0,n.unref)(c),onFocusoutPrevented:(0,n.unref)(u),onReleaseRequested:(0,n.unref)(d)},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16))}});var _l=Ar(Il,[["__file","content.vue"]]);const Ol=(0,n.defineComponent)({name:"ElTooltipContent",inheritAttrs:!1}),Al=(0,n.defineComponent)({...Ol,props:vs,setup(e,{expose:t}){const r=e,{selector:o}=Aa(),i=c("tooltip"),s=(0,n.ref)(null),a=(0,n.ref)(!1),{controlled:l,id:u,open:d,trigger:p,onClose:h,onOpen:f,onShow:g,onHide:m,onBeforeShow:v,onBeforeHide:y}=(0,n.inject)(Mr,void 0),b=(0,n.computed)((()=>r.transition||`${i.namespace.value}-fade-in-linear`)),w=(0,n.computed)((()=>r.persistent));(0,n.onBeforeUnmount)((()=>{a.value=!0}));const C=(0,n.computed)((()=>!!(0,n.unref)(w)||(0,n.unref)(d))),S=(0,n.computed)((()=>!r.disabled&&(0,n.unref)(d))),E=(0,n.computed)((()=>r.appendTo||o.value)),T=(0,n.computed)((()=>{var e;return null!=(e=r.style)?e:{}})),k=(0,n.computed)((()=>!(0,n.unref)(d))),x=()=>{m()},N=()=>{if((0,n.unref)(l))return!0},R=Ps(N,(()=>{r.enterable&&"hover"===(0,n.unref)(p)&&f()})),I=Ps(N,(()=>{"hover"===(0,n.unref)(p)&&h()})),_=()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e),null==v||v()},O=()=>{null==y||y()},A=()=>{g(),D=Us((0,n.computed)((()=>{var e;return null==(e=s.value)?void 0:e.popperContentRef})),(()=>{if((0,n.unref)(l))return;const e=(0,n.unref)(p);"hover"!==e&&h()}))},B=()=>{r.virtualTriggering||h()};let D;return(0,n.watch)((()=>(0,n.unref)(d)),(e=>{e||null==D||D()}),{flush:"post"}),(0,n.watch)((()=>r.content),(()=>{var e,t;null==(t=null==(e=s.value)?void 0:e.updatePopper)||t.call(e)})),t({contentRef:s}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Teleport,{disabled:!e.teleported,to:(0,n.unref)(E)},[(0,n.createVNode)(n.Transition,{name:(0,n.unref)(b),onAfterLeave:x,onBeforeEnter:_,onAfterEnter:A,onBeforeLeave:O},{default:(0,n.withCtx)((()=>[(0,n.unref)(C)?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(_l),(0,n.mergeProps)({key:0,id:(0,n.unref)(u),ref_key:"contentRef",ref:s},e.$attrs,{"aria-label":e.ariaLabel,"aria-hidden":(0,n.unref)(k),"boundaries-padding":e.boundariesPadding,"fallback-placements":e.fallbackPlacements,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,placement:e.placement,"popper-options":e.popperOptions,strategy:e.strategy,effect:e.effect,enterable:e.enterable,pure:e.pure,"popper-class":e.popperClass,"popper-style":[e.popperStyle,(0,n.unref)(T)],"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,visible:(0,n.unref)(S),"z-index":e.zIndex,onMouseenter:(0,n.unref)(R),onMouseleave:(0,n.unref)(I),onBlur:B,onClose:(0,n.unref)(h)}),{default:(0,n.withCtx)((()=>[a.value?(0,n.createCommentVNode)("v-if",!0):(0,n.renderSlot)(e.$slots,"default",{key:0})])),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[n.vShow,(0,n.unref)(S)]]):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["name"])],8,["disabled","to"]))}});var Bl=Ar(Al,[["__file","content.vue"]]);const Dl=(0,n.defineComponent)({name:"ElPopperArrow",inheritAttrs:!1}),Pl=(0,n.defineComponent)({...Dl,props:Ns,setup(e,{expose:t}){const r=e,o=c("popper"),{arrowOffset:i,arrowRef:s,arrowStyle:a}=(0,n.inject)(Ir,void 0);return(0,n.watch)((()=>r.arrowOffset),(e=>{i.value=e})),(0,n.onBeforeUnmount)((()=>{s.value=void 0})),t({arrowRef:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("span",{ref_key:"arrowRef",ref:s,class:(0,n.normalizeClass)((0,n.unref)(o).e("arrow")),style:(0,n.normalizeStyle)((0,n.unref)(a)),"data-popper-arrow":""},null,6))}});var Hl=Ar(Pl,[["__file","arrow.vue"]]);const Ml=["innerHTML"],jl={key:1},Vl=(0,n.defineComponent)({name:"ElTooltip"}),Ll=(0,n.defineComponent)({...Vl,props:Os,emits:As,setup(e,{expose:t,emit:r}){const o=e;Da();const i=_a(),s=(0,n.ref)(),a=(0,n.ref)(),l=()=>{var e;const t=(0,n.unref)(s);t&&(null==(e=t.popperInstanceRef)||e.update())},c=(0,n.ref)(!1),u=(0,n.ref)(),{show:d,hide:p,hasUpdateHandler:h}=_s({indicator:c,toggleReason:u}),{onOpen:f,onClose:g}=so({showAfter:(0,n.toRef)(o,"showAfter"),hideAfter:(0,n.toRef)(o,"hideAfter"),autoClose:(0,n.toRef)(o,"autoClose"),open:d,close:p}),m=(0,n.computed)((()=>vn(o.visible)&&!h.value));(0,n.provide)(Mr,{controlled:m,id:i,open:(0,n.readonly)(c),trigger:(0,n.toRef)(o,"trigger"),onOpen:e=>{f(e)},onClose:e=>{g(e)},onToggle:e=>{(0,n.unref)(c)?g(e):f(e)},onShow:()=>{r("show",u.value)},onHide:()=>{r("hide",u.value)},onBeforeShow:()=>{r("before-show",u.value)},onBeforeHide:()=>{r("before-hide",u.value)},updatePopper:l}),(0,n.watch)((()=>o.disabled),(e=>{e&&c.value&&(c.value=!1)}));const v=e=>{var t,n;const r=null==(n=null==(t=a.value)?void 0:t.contentRef)?void 0:n.popperContentRef,o=(null==e?void 0:e.relatedTarget)||document.activeElement;return r&&r.contains(o)};return(0,n.onDeactivated)((()=>c.value&&p())),t({popperRef:s,contentRef:a,isFocusInsideContent:v,updatePopper:l,onOpen:f,onClose:g,hide:p}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Hr),{ref_key:"popperRef",ref:s,role:e.role},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(xa,{disabled:e.disabled,trigger:e.trigger,"trigger-keys":e.triggerKeys,"virtual-ref":e.virtualRef,"virtual-triggering":e.virtualTriggering},{default:(0,n.withCtx)((()=>[e.$slots.default?(0,n.renderSlot)(e.$slots,"default",{key:0}):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),(0,n.createVNode)(Bl,{ref_key:"contentRef",ref:a,"aria-label":e.ariaLabel,"boundaries-padding":e.boundariesPadding,content:e.content,disabled:e.disabled,effect:e.effect,enterable:e.enterable,"fallback-placements":e.fallbackPlacements,"hide-after":e.hideAfter,"gpu-acceleration":e.gpuAcceleration,offset:e.offset,persistent:e.persistent,"popper-class":e.popperClass,"popper-style":e.popperStyle,placement:e.placement,"popper-options":e.popperOptions,pure:e.pure,"raw-content":e.rawContent,"reference-el":e.referenceEl,"trigger-target-el":e.triggerTargetEl,"show-after":e.showAfter,strategy:e.strategy,teleported:e.teleported,transition:e.transition,"virtual-triggering":e.virtualTriggering,"z-index":e.zIndex,"append-to":e.appendTo},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"content",{},(()=>[e.rawContent?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,innerHTML:e.content},null,8,Ml)):((0,n.openBlock)(),(0,n.createElementBlock)("span",jl,(0,n.toDisplayString)(e.content),1))])),e.showArrow?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Hl),{key:0,"arrow-offset":e.arrowOffset},null,8,["arrow-offset"])):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])])),_:3},8,["role"]))}});var $l=Ar(Ll,[["__file","tooltip.vue"]]);const ql=dr($l);
33
33
  /*! Element Plus Icons Vue v2.3.1 */
34
- var Al=(0,n.defineComponent)({name:"ArrowDown",__name:"arrow-down",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Bl=Al,Dl=(0,n.defineComponent)({name:"ArrowLeft",__name:"arrow-left",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Pl=Dl,Hl=(0,n.defineComponent)({name:"ArrowRight",__name:"arrow-right",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Ml=Hl,jl=(0,n.defineComponent)({name:"ArrowUp",__name:"arrow-up",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Vl=jl,$l=(0,n.defineComponent)({name:"CaretRight",__name:"caret-right",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),Ll=$l,ql=(0,n.defineComponent)({name:"CircleCheck",__name:"circle-check",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),Fl=ql,Ul=(0,n.defineComponent)({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),zl=Ul,Kl=(0,n.defineComponent)({name:"CircleClose",__name:"circle-close",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Wl=Kl,Gl=(0,n.defineComponent)({name:"Close",__name:"close",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Yl=Gl,Jl=(0,n.defineComponent)({name:"Hide",__name:"hide",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),Zl=Jl,Xl=(0,n.defineComponent)({name:"InfoFilled",__name:"info-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Ql=Xl,ec=(0,n.defineComponent)({name:"Loading",__name:"loading",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),tc=ec,nc=(0,n.defineComponent)({name:"Minus",__name:"minus",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),rc=nc,oc=(0,n.defineComponent)({name:"Plus",__name:"plus",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),ic=oc,sc=(0,n.defineComponent)({name:"SuccessFilled",__name:"success-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),ac=sc,lc=(0,n.defineComponent)({name:"View",__name:"view",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),cc=lc,uc=(0,n.defineComponent)({name:"WarningFilled",__name:"warning-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),dc=uc;const pc=On([String,Object,Function]),hc={Close:Yl,SuccessFilled:ac,InfoFilled:Ql,WarningFilled:dc,CircleCloseFilled:zl},fc={success:ac,warning:dc,error:zl,info:Ql},gc={validating:tc,success:Fl,error:Wl},mc=(0,n.defineComponent)({inheritAttrs:!1});function vc(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var yc=Cr(mc,[["render",vc],["__file","collection.vue"]]);const bc=(0,n.defineComponent)({name:"ElCollectionItem",inheritAttrs:!1});function wc(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var Cc=Cr(bc,[["render",wc],["__file","collection-item.vue"]]);const Sc="data-el-collection-item",Ec=e=>{const t=`El${e}Collection`,r=`${t}Item`,o=Symbol(t),i=Symbol(r),s={...yc,name:t,setup(){const e=(0,n.ref)(null),t=new Map,r=()=>{const r=(0,n.unref)(e);if(!r)return[];const o=Array.from(r.querySelectorAll(`[${Sc}]`)),i=[...t.values()];return i.sort(((e,t)=>o.indexOf(e.ref)-o.indexOf(t.ref)))};(0,n.provide)(o,{itemMap:t,getItems:r,collectionRef:e})}},a={...Cc,name:r,setup(e,{attrs:t}){const r=(0,n.ref)(null),s=(0,n.inject)(o,void 0);(0,n.provide)(i,{collectionItemRef:r}),(0,n.onMounted)((()=>{const e=(0,n.unref)(r);e&&s.itemMap.set(e,{ref:e,...t})})),(0,n.onBeforeUnmount)((()=>{const e=(0,n.unref)(r);s.itemMap.delete(e)}))}};return{COLLECTION_INJECTION_KEY:o,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:s,ElCollectionItem:a}},Tc=Dn({trigger:cs.trigger,effect:{...ss.effect,default:"light"},type:{type:On(String)},placement:{type:On(String),default:"bottom"},popperOptions:{type:On(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:On([Number,String]),default:0},maxHeight:{type:On([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:On(Object)},teleported:ss.teleported}),kc=Dn({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:pc}}),xc=Dn({onKeydown:{type:On(Function)}}),Nc=[ls.down,ls.pageDown,ls.home],Rc=[ls.up,ls.pageUp,ls.end],Ic=[...Nc,...Rc],{ElCollection:_c,ElCollectionItem:Oc,COLLECTION_INJECTION_KEY:Ac,COLLECTION_ITEM_INJECTION_KEY:Bc}=Ec("Dropdown"),Dc=Dn({trigger:cs.trigger,placement:Tc.placement,disabled:cs.disabled,visible:ss.visible,transition:ss.transition,popperOptions:Tc.popperOptions,tabindex:Tc.tabindex,content:ss.content,popperStyle:ss.popperStyle,popperClass:ss.popperClass,enterable:{...ss.enterable,default:!0},effect:{...ss.effect,default:"light"},teleported:ss.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Pc={"update:visible":e=>vn(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Hc="utils/dom/style",Mc=(e="")=>e.split(" ").filter((e=>!!e.trim())),jc=(e,t)=>{if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},Vc=(e,t)=>{e&&t.trim()&&e.classList.add(...Mc(t))},$c=(e,t)=>{e&&t.trim()&&e.classList.remove(...Mc(t))};function Lc(e,t="px"){return e?yn(e)||wn(e)?`${e}${t}`:an(e)?e:void Nn(Hc,"binding value must be a string or number"):""}const qc="onUpdate:visible",Fc=(0,n.defineComponent)({name:"ElPopover"}),Uc=(0,n.defineComponent)({...Fc,props:Dc,emits:Pc,setup(e,{expose:t,emit:r}){const o=e,i=(0,n.computed)((()=>o[qc])),s=c("popover"),a=(0,n.ref)(),l=(0,n.computed)((()=>{var e;return null==(e=(0,n.unref)(a))?void 0:e.popperRef})),u=(0,n.computed)((()=>[{width:Lc(o.width)},o.popperStyle])),d=(0,n.computed)((()=>[s.b(),o.popperClass,{[s.m("plain")]:!!o.content}])),p=(0,n.computed)((()=>o.transition===`${s.namespace.value}-fade-in-linear`)),h=()=>{var e;null==(e=a.value)||e.hide()},f=()=>{r("before-enter")},g=()=>{r("before-leave")},m=()=>{r("after-enter")},v=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:l,hide:h}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ol),(0,n.mergeProps)({ref_key:"tooltipRef",ref:a},e.$attrs,{trigger:e.trigger,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":(0,n.unref)(d),"popper-style":(0,n.unref)(u),teleported:e.teleported,persistent:e.persistent,"gpu-acceleration":(0,n.unref)(p),"onUpdate:visible":(0,n.unref)(i),onBeforeShow:f,onBeforeHide:g,onShow:m,onHide:v}),{content:(0,n.withCtx)((()=>[e.title?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)((0,n.unref)(s).e("title")),role:"title"},(0,n.toDisplayString)(e.title),3)):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.content),1)]))])),default:(0,n.withCtx)((()=>[e.$slots.reference?(0,n.renderSlot)(e.$slots,"reference",{key:0}):(0,n.createCommentVNode)("v-if",!0)])),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var zc=Cr(Uc,[["__file","popover.vue"]]);const Kc=(e,t)=>{const n=t.arg||t.value,r=null==n?void 0:n.popperRef;r&&(r.triggerRef=e)};var Wc={mounted(e,t){Kc(e,t)},updated(e,t){Kc(e,t)}};const Gc="popover",Yc=hr(Wc,Gc),Jc=dr(zc,{directive:Yc}),Zc=e=>e,Xc="update:modelValue",Qc="change",eu="input",tu=e=>yn(e)||an(e)||on(e),nu=Dn({accordion:Boolean,modelValue:{type:On([Array,String,Number]),default:()=>Zc([])}}),ru={[Xc]:tu,[Qc]:tu},ou=Symbol("collapseContextKey");function iu(){if(!arguments.length)return[];var e=arguments[0];return d(e)?e:[e]}var su=iu;const au=(e,t)=>{const r=(0,n.ref)(su(e.modelValue)),o=n=>{r.value=n;const o=e.accordion?r.value[0]:r.value;t(Xc,o),t(Qc,o)},i=t=>{if(e.accordion)o([r.value[0]===t?"":t]);else{const e=[...r.value],n=e.indexOf(t);n>-1?e.splice(n,1):e.push(t),o(e)}};return(0,n.watch)((()=>e.modelValue),(()=>r.value=su(e.modelValue)),{deep:!0}),(0,n.provide)(ou,{activeNames:r,handleItemClick:i}),{activeNames:r,setActiveNames:o}},lu=()=>{const e=c("collapse"),t=(0,n.computed)((()=>e.b()));return{rootKls:t}},cu=(0,n.defineComponent)({name:"ElCollapse"}),uu=(0,n.defineComponent)({...cu,props:nu,emits:ru,setup(e,{expose:t,emit:r}){const o=e,{activeNames:i,setActiveNames:s}=au(o,r),{rootKls:a}=lu();return t({activeNames:i,setActiveNames:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(a))},[(0,n.renderSlot)(e.$slots,"default")],2))}});var du=Cr(uu,[["__file","collapse.vue"]]);const pu=(0,n.defineComponent)({name:"ElCollapseTransition"}),hu=(0,n.defineComponent)({...pu,setup(e){const t=c("collapse-transition"),r=e=>{e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom},o={beforeEnter(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.style.height&&(e.dataset.elExistsHeight=e.style.height),e.style.maxHeight=0,e.style.paddingTop=0,e.style.paddingBottom=0},enter(e){requestAnimationFrame((()=>{e.dataset.oldOverflow=e.style.overflow,e.dataset.elExistsHeight?e.style.maxHeight=e.dataset.elExistsHeight:0!==e.scrollHeight?e.style.maxHeight=`${e.scrollHeight}px`:e.style.maxHeight=0,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom,e.style.overflow="hidden"}))},afterEnter(e){e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow},enterCancelled(e){r(e)},beforeLeave(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.maxHeight=`${e.scrollHeight}px`,e.style.overflow="hidden"},leave(e){0!==e.scrollHeight&&(e.style.maxHeight=0,e.style.paddingTop=0,e.style.paddingBottom=0)},afterLeave(e){r(e)},leaveCancelled(e){r(e)}};return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,(0,n.mergeProps)({name:(0,n.unref)(t).b()},(0,n.toHandlers)(o)),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["name"]))}});var fu=Cr(hu,[["__file","collapse-transition.vue"]]);fu.install=e=>{e.component(fu.name,fu)};const gu=fu,mu=Dn({size:{type:On([Number,String])},color:{type:String}}),vu=(0,n.defineComponent)({name:"ElIcon",inheritAttrs:!1}),yu=(0,n.defineComponent)({...vu,props:mu,setup(e){const t=e,r=c("icon"),o=(0,n.computed)((()=>{const{size:e,color:n}=t;return e||n?{fontSize:mn(e)?void 0:Lc(e),"--color":n}:{}}));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("i",(0,n.mergeProps)({class:(0,n.unref)(r).b(),style:(0,n.unref)(o)},e.$attrs),[(0,n.renderSlot)(e.$slots,"default")],16))}});var bu=Cr(yu,[["__file","icon.vue"]]);const wu=dr(bu),Cu=Dn({title:{type:String,default:""},name:{type:On([String,Number]),default:void 0},disabled:Boolean}),Su=e=>{const t=(0,n.inject)(ou),{namespace:r}=c("collapse"),o=(0,n.ref)(!1),i=(0,n.ref)(!1),s=ya(),a=(0,n.computed)((()=>s.current++)),l=(0,n.computed)((()=>{var t;return null!=(t=e.name)?t:`${r.value}-id-${s.prefix}-${(0,n.unref)(a)}`})),u=(0,n.computed)((()=>null==t?void 0:t.activeNames.value.includes((0,n.unref)(l)))),d=()=>{setTimeout((()=>{i.value?i.value=!1:o.value=!0}),50)},p=()=>{e.disabled||(null==t||t.handleItemClick((0,n.unref)(l)),o.value=!1,i.value=!0)},h=()=>{null==t||t.handleItemClick((0,n.unref)(l))};return{focusing:o,id:a,isActive:u,handleFocus:d,handleHeaderClick:p,handleEnterClick:h}},Eu=(e,{focusing:t,isActive:r,id:o})=>{const i=c("collapse"),s=(0,n.computed)((()=>[i.b("item"),i.is("active",(0,n.unref)(r)),i.is("disabled",e.disabled)])),a=(0,n.computed)((()=>[i.be("item","header"),i.is("active",(0,n.unref)(r)),{focusing:(0,n.unref)(t)&&!e.disabled}])),l=(0,n.computed)((()=>[i.be("item","arrow"),i.is("active",(0,n.unref)(r))])),u=(0,n.computed)((()=>i.be("item","wrap"))),d=(0,n.computed)((()=>i.be("item","content"))),p=(0,n.computed)((()=>i.b(`content-${(0,n.unref)(o)}`))),h=(0,n.computed)((()=>i.b(`head-${(0,n.unref)(o)}`)));return{arrowKls:l,headKls:a,rootKls:s,itemWrapperKls:u,itemContentKls:d,scopedContentId:p,scopedHeadId:h}},Tu=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],ku=["id","aria-hidden","aria-labelledby"],xu=(0,n.defineComponent)({name:"ElCollapseItem"}),Nu=(0,n.defineComponent)({...xu,props:Cu,setup(e,{expose:t}){const r=e,{focusing:o,id:i,isActive:s,handleFocus:a,handleHeaderClick:l,handleEnterClick:c}=Su(r),{arrowKls:u,headKls:d,rootKls:p,itemWrapperKls:h,itemContentKls:f,scopedContentId:g,scopedHeadId:m}=Eu(r,{focusing:o,isActive:s,id:i});return t({isActive:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(p))},[(0,n.createElementVNode)("button",{id:(0,n.unref)(m),class:(0,n.normalizeClass)((0,n.unref)(d)),"aria-expanded":(0,n.unref)(s),"aria-controls":(0,n.unref)(g),"aria-describedby":(0,n.unref)(g),tabindex:e.disabled?-1:0,type:"button",onClick:t[0]||(t[0]=(...e)=>(0,n.unref)(l)&&(0,n.unref)(l)(...e)),onKeydown:t[1]||(t[1]=(0,n.withKeys)((0,n.withModifiers)(((...e)=>(0,n.unref)(c)&&(0,n.unref)(c)(...e)),["stop","prevent"]),["space","enter"])),onFocus:t[2]||(t[2]=(...e)=>(0,n.unref)(a)&&(0,n.unref)(a)(...e)),onBlur:t[3]||(t[3]=e=>o.value=!1)},[(0,n.renderSlot)(e.$slots,"title",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.title),1)])),(0,n.createVNode)((0,n.unref)(wu),{class:(0,n.normalizeClass)((0,n.unref)(u))},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(Ml))])),_:1},8,["class"])],42,Tu),(0,n.createVNode)((0,n.unref)(gu),null,{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{id:(0,n.unref)(g),role:"region",class:(0,n.normalizeClass)((0,n.unref)(h)),"aria-hidden":!(0,n.unref)(s),"aria-labelledby":(0,n.unref)(m)},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)((0,n.unref)(f))},[(0,n.renderSlot)(e.$slots,"default")],2)],10,ku),[[n.vShow,(0,n.unref)(s)]])])),_:3})],2))}});var Ru=Cr(Nu,[["__file","collapse-item.vue"]]);const Iu=dr(du,{CollapseItem:Ru}),_u=fr(Ru);var Ou=function(){return m.Date.now()},Au=Ou,Bu=/\s/;function Du(e){var t=e.length;while(t--&&Bu.test(e.charAt(t)));return t}var Pu=Du,Hu=/^\s+/;function Mu(e){return e?e.slice(0,Pu(e)+1).replace(Hu,""):e}var ju=Mu,Vu=NaN,$u=/^[-+]0x[0-9a-f]+$/i,Lu=/^0b[01]+$/i,qu=/^0o[0-7]+$/i,Fu=parseInt;function Uu(e){if("number"==typeof e)return e;if(j(e))return Vu;if(U(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=U(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ju(e);var n=Lu.test(e);return n||qu.test(e)?Fu(e.slice(2),n?2:8):$u.test(e)?Vu:+e}var zu=Uu,Ku="Expected a function",Wu=Math.max,Gu=Math.min;function Yu(e,t,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(Ku);function h(t){var n=r,i=o;return r=o=void 0,c=t,s=e.apply(i,n),s}function f(e){return c=e,a=setTimeout(v,t),u?h(e):s}function g(e){var n=e-l,r=e-c,o=t-n;return d?Gu(o,i-r):o}function m(e){var n=e-l,r=e-c;return void 0===l||n>=t||n<0||d&&r>=i}function v(){var e=Au();if(m(e))return y(e);a=setTimeout(v,g(e))}function y(e){return a=void 0,p&&r?h(e):(r=o=void 0,s)}function b(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0}function w(){return void 0===a?s:y(Au())}function C(){var e=Au(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return f(l);if(d)return clearTimeout(a),a=setTimeout(v,t),h(l)}return void 0===a&&(a=setTimeout(v,t)),s}return t=zu(t)||0,U(n)&&(u=!!n.leading,d="maxWait"in n,i=d?Wu(zu(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),C.cancel=b,C.flush=w,C}var Ju=Yu;const Zu=4,Xu={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},Qu=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),ed=Symbol("scrollbarContextKey"),td=Dn({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),nd="Thumb",rd=(0,n.defineComponent)({__name:"thumb",props:td,setup(e){const t=e,r=(0,n.inject)(ed),o=c("scrollbar");r||xn(nd,"can not inject scrollbar context");const i=(0,n.ref)(),s=(0,n.ref)(),a=(0,n.ref)({}),l=(0,n.ref)(!1);let u=!1,d=!1,p=jr?document.onselectstart:null;const h=(0,n.computed)((()=>Xu[t.vertical?"vertical":"horizontal"])),f=(0,n.computed)((()=>Qu({size:t.size,move:t.move,bar:h.value}))),g=(0,n.computed)((()=>i.value[h.value.offset]**2/r.wrapElement[h.value.scrollSize]/t.ratio/s.value[h.value.offset])),m=e=>{var t;if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;null==(t=window.getSelection())||t.removeAllRanges(),y(e);const n=e.currentTarget;n&&(a.value[h.value.axis]=n[h.value.offset]-(e[h.value.client]-n.getBoundingClientRect()[h.value.direction]))},v=e=>{if(!s.value||!i.value||!r.wrapElement)return;const t=Math.abs(e.target.getBoundingClientRect()[h.value.direction]-e[h.value.client]),n=s.value[h.value.offset]/2,o=100*(t-n)*g.value/i.value[h.value.offset];r.wrapElement[h.value.scroll]=o*r.wrapElement[h.value.scrollSize]/100},y=e=>{e.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",b),document.addEventListener("mouseup",w),p=document.onselectstart,document.onselectstart=()=>!1},b=e=>{if(!i.value||!s.value)return;if(!1===u)return;const t=a.value[h.value.axis];if(!t)return;const n=-1*(i.value.getBoundingClientRect()[h.value.direction]-e[h.value.client]),o=s.value[h.value.offset]-t,l=100*(n-o)*g.value/i.value[h.value.offset];r.wrapElement[h.value.scroll]=l*r.wrapElement[h.value.scrollSize]/100},w=()=>{u=!1,a.value[h.value.axis]=0,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",w),E(),d&&(l.value=!1)},C=()=>{d=!1,l.value=!!t.size},S=()=>{d=!0,l.value=u};(0,n.onBeforeUnmount)((()=>{E(),document.removeEventListener("mouseup",w)}));const E=()=>{document.onselectstart!==p&&(document.onselectstart=p)};return Os((0,n.toRef)(r,"scrollbarElement"),"mousemove",C),Os((0,n.toRef)(r,"scrollbarElement"),"mouseleave",S),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{name:(0,n.unref)(o).b("fade"),persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{ref_key:"instance",ref:i,class:(0,n.normalizeClass)([(0,n.unref)(o).e("bar"),(0,n.unref)(o).is((0,n.unref)(h).key)]),onMousedown:v},[(0,n.createElementVNode)("div",{ref_key:"thumb",ref:s,class:(0,n.normalizeClass)((0,n.unref)(o).e("thumb")),style:(0,n.normalizeStyle)((0,n.unref)(f)),onMousedown:m},null,38)],34),[[n.vShow,e.always||l.value]])])),_:1},8,["name"]))}});var od=Cr(rd,[["__file","thumb.vue"]]);const id=Dn({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),sd=(0,n.defineComponent)({__name:"bar",props:id,setup(e,{expose:t}){const r=e,o=(0,n.inject)(ed),i=(0,n.ref)(0),s=(0,n.ref)(0),a=(0,n.ref)(""),l=(0,n.ref)(""),c=(0,n.ref)(1),u=(0,n.ref)(1),d=e=>{if(e){const t=e.offsetHeight-Zu,n=e.offsetWidth-Zu;s.value=100*e.scrollTop/t*c.value,i.value=100*e.scrollLeft/n*u.value}},p=()=>{const e=null==o?void 0:o.wrapElement;if(!e)return;const t=e.offsetHeight-Zu,n=e.offsetWidth-Zu,i=t**2/e.scrollHeight,s=n**2/e.scrollWidth,d=Math.max(i,r.minSize),p=Math.max(s,r.minSize);c.value=i/(t-i)/(d/(t-d)),u.value=s/(n-s)/(p/(n-p)),l.value=d+Zu<t?`${d}px`:"",a.value=p+Zu<n?`${p}px`:""};return t({handleScroll:d,update:p}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[(0,n.createVNode)(od,{move:i.value,ratio:u.value,size:a.value,always:e.always},null,8,["move","ratio","size","always"]),(0,n.createVNode)(od,{move:s.value,ratio:c.value,size:l.value,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64))}});var ad=Cr(sd,[["__file","bar.vue"]]);const ld=Dn({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:On([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),cd={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(yn)},ud="ElScrollbar",dd=(0,n.defineComponent)({name:ud}),pd=(0,n.defineComponent)({...dd,props:ld,emits:cd,setup(e,{expose:t,emit:r}){const o=e,i=c("scrollbar");let s,a;const l=(0,n.ref)(),u=(0,n.ref)(),d=(0,n.ref)(),p=(0,n.ref)(),h=(0,n.computed)((()=>{const e={};return o.height&&(e.height=Lc(o.height)),o.maxHeight&&(e.maxHeight=Lc(o.maxHeight)),[o.wrapStyle,e]})),f=(0,n.computed)((()=>[o.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!o.native}])),g=(0,n.computed)((()=>[i.e("view"),o.viewClass])),m=()=>{var e;u.value&&(null==(e=p.value)||e.handleScroll(u.value),r("scroll",{scrollTop:u.value.scrollTop,scrollLeft:u.value.scrollLeft}))};function v(e,t){ln(e)?u.value.scrollTo(e):yn(e)&&yn(t)&&u.value.scrollTo(e,t)}const y=e=>{yn(e)?u.value.scrollTop=e:Nn(ud,"value must be a number")},b=e=>{yn(e)?u.value.scrollLeft=e:Nn(ud,"value must be a number")},w=()=>{var e;null==(e=p.value)||e.update()};return(0,n.watch)((()=>o.noresize),(e=>{e?(null==s||s(),null==a||a()):(({stop:s}=qs(d,w)),a=Os("resize",w))}),{immediate:!0}),(0,n.watch)((()=>[o.maxHeight,o.height]),(()=>{o.native||(0,n.nextTick)((()=>{var e;w(),u.value&&(null==(e=p.value)||e.handleScroll(u.value))}))})),(0,n.provide)(ed,(0,n.reactive)({scrollbarElement:l,wrapElement:u})),(0,n.onMounted)((()=>{o.native||(0,n.nextTick)((()=>{w()}))})),(0,n.onUpdated)((()=>w())),t({wrapRef:u,update:w,scrollTo:v,setScrollTop:y,setScrollLeft:b,handleScroll:m}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"scrollbarRef",ref:l,class:(0,n.normalizeClass)((0,n.unref)(i).b())},[(0,n.createElementVNode)("div",{ref_key:"wrapRef",ref:u,class:(0,n.normalizeClass)((0,n.unref)(f)),style:(0,n.normalizeStyle)((0,n.unref)(h)),onScroll:m},[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),{id:e.id,ref_key:"resizeRef",ref:d,class:(0,n.normalizeClass)((0,n.unref)(g)),style:(0,n.normalizeStyle)(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),e.native?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createBlock)(ad,{key:0,ref_key:"barRef",ref:p,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});var hd=Cr(pd,[["__file","scrollbar.vue"]]);const fd=dr(hd);function gd(e,t){var n=-1,r=t.length,o=e.length;while(++n<r)e[o+n]=t[n];return e}var md=gd,vd="[object Arguments]";function yd(e){return P(e)&&B(e)==vd}var bd=yd,wd=Object.prototype,Cd=wd.hasOwnProperty,Sd=wd.propertyIsEnumerable,Ed=bd(function(){return arguments}())?bd:function(e){return P(e)&&Cd.call(e,"callee")&&!Sd.call(e,"callee")},Td=Ed,kd=y?y.isConcatSpreadable:void 0;function xd(e){return d(e)||Td(e)||!!(kd&&e&&e[kd])}var Nd=xd;function Rd(e,t,n,r,o){var i=-1,s=e.length;n||(n=Nd),o||(o=[]);while(++i<s){var a=e[i];t>0&&n(a)?t>1?Rd(a,t-1,n,r,o):md(o,a):r||(o[o.length]=a)}return o}var Id=Rd;function _d(){this.__data__=new nt,this.size=0}var Od=_d;function Ad(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}var Bd=Ad;function Dd(e){return this.__data__.get(e)}var Pd=Dd;function Hd(e){return this.__data__.has(e)}var Md=Hd,jd=200;function Vd(e,t){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!ot||r.length<jd-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wt(r)}return n.set(e,t),this.size=n.size,this}var $d=Vd;function Ld(e){var t=this.__data__=new nt(e);this.size=t.size}Ld.prototype.clear=Od,Ld.prototype["delete"]=Bd,Ld.prototype.get=Pd,Ld.prototype.has=Md,Ld.prototype.set=$d;var qd=Ld,Fd="__lodash_hash_undefined__";function Ud(e){return this.__data__.set(e,Fd),this}var zd=Ud;function Kd(e){return this.__data__.has(e)}var Wd=Kd;function Gd(e){var t=-1,n=null==e?0:e.length;this.__data__=new wt;while(++t<n)this.add(e[t])}Gd.prototype.add=Gd.prototype.push=zd,Gd.prototype.has=Wd;var Yd=Gd;function Jd(e,t){var n=-1,r=null==e?0:e.length;while(++n<r)if(t(e[n],n,e))return!0;return!1}var Zd=Jd;function Xd(e,t){return e.has(t)}var Qd=Xd,ep=1,tp=2;function np(e,t,n,r,o,i){var s=n&ep,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=n&tp?new Yd:void 0;i.set(e,t),i.set(t,e);while(++d<a){var f=e[d],g=t[d];if(r)var m=s?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!Zd(t,(function(e,t){if(!Qd(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)}))){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i["delete"](e),i["delete"](t),p}var rp=np,op=m.Uint8Array,ip=op;function sp(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}var ap=sp;function lp(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var cp=lp,up=1,dp=2,pp="[object Boolean]",hp="[object Date]",fp="[object Error]",gp="[object Map]",mp="[object Number]",vp="[object RegExp]",yp="[object Set]",bp="[object String]",wp="[object Symbol]",Cp="[object ArrayBuffer]",Sp="[object DataView]",Ep=y?y.prototype:void 0,Tp=Ep?Ep.valueOf:void 0;function kp(e,t,n,r,o,i,s){switch(n){case Sp:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Cp:return!(e.byteLength!=t.byteLength||!i(new ip(e),new ip(t)));case pp:case hp:case mp:return qe(+e,+t);case fp:return e.name==t.name&&e.message==t.message;case vp:case bp:return e==t+"";case gp:var a=ap;case yp:var l=r&up;if(a||(a=cp),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=dp,s.set(e,t);var u=rp(a(e),a(t),r,o,i,s);return s["delete"](e),u;case wp:if(Tp)return Tp.call(e)==Tp.call(t)}return!1}var xp=kp;function Np(e,t,n){var r=t(e);return d(e)?r:md(r,n(e))}var Rp=Np;function Ip(e,t){var n=-1,r=null==e?0:e.length,o=0,i=[];while(++n<r){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}var _p=Ip;function Op(){return[]}var Ap=Op,Bp=Object.prototype,Dp=Bp.propertyIsEnumerable,Pp=Object.getOwnPropertySymbols,Hp=Pp?function(e){return null==e?[]:(e=Object(e),_p(Pp(e),(function(t){return Dp.call(e,t)})))}:Ap,Mp=Hp;function jp(e,t){var n=-1,r=Array(e);while(++n<e)r[n]=t(n);return r}var Vp=jp;function $p(){return!1}var Lp=$p,qp="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fp=qp&&"object"==typeof module&&module&&!module.nodeType&&module,Up=Fp&&Fp.exports===qp,zp=Up?m.Buffer:void 0,Kp=zp?zp.isBuffer:void 0,Wp=Kp||Lp,Gp=Wp,Yp=9007199254740991;function Jp(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=Yp}var Zp=Jp,Xp="[object Arguments]",Qp="[object Array]",eh="[object Boolean]",th="[object Date]",nh="[object Error]",rh="[object Function]",oh="[object Map]",ih="[object Number]",sh="[object Object]",ah="[object RegExp]",lh="[object Set]",ch="[object String]",uh="[object WeakMap]",dh="[object ArrayBuffer]",ph="[object DataView]",hh="[object Float32Array]",fh="[object Float64Array]",gh="[object Int8Array]",mh="[object Int16Array]",vh="[object Int32Array]",yh="[object Uint8Array]",bh="[object Uint8ClampedArray]",wh="[object Uint16Array]",Ch="[object Uint32Array]",Sh={};function Eh(e){return P(e)&&Zp(e.length)&&!!Sh[B(e)]}Sh[hh]=Sh[fh]=Sh[gh]=Sh[mh]=Sh[vh]=Sh[yh]=Sh[bh]=Sh[wh]=Sh[Ch]=!0,Sh[Xp]=Sh[Qp]=Sh[dh]=Sh[eh]=Sh[ph]=Sh[th]=Sh[nh]=Sh[rh]=Sh[oh]=Sh[ih]=Sh[sh]=Sh[ah]=Sh[lh]=Sh[ch]=Sh[uh]=!1;var Th=Eh;function kh(e){return function(t){return e(t)}}var xh=kh,Nh="object"==typeof exports&&exports&&!exports.nodeType&&exports,Rh=Nh&&"object"==typeof module&&module&&!module.nodeType&&module,Ih=Rh&&Rh.exports===Nh,_h=Ih&&h.process,Oh=function(){try{var e=Rh&&Rh.require&&Rh.require("util").types;return e||_h&&_h.binding&&_h.binding("util")}catch(t){}}(),Ah=Oh,Bh=Ah&&Ah.isTypedArray,Dh=Bh?xh(Bh):Th,Ph=Dh,Hh=Object.prototype,Mh=Hh.hasOwnProperty;function jh(e,t){var n=d(e),r=!n&&Td(e),o=!n&&!r&&Gp(e),i=!n&&!r&&!o&&Ph(e),s=n||r||o||i,a=s?Vp(e.length,String):[],l=a.length;for(var c in e)!t&&!Mh.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Jn(c,l))||a.push(c);return a}var Vh=jh,$h=Object.prototype;function Lh(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||$h;return e===n}var qh=Lh;function Fh(e,t){return function(n){return e(t(n))}}var Uh=Fh,zh=Uh(Object.keys,Object),Kh=zh,Wh=Object.prototype,Gh=Wh.hasOwnProperty;function Yh(e){if(!qh(e))return Kh(e);var t=[];for(var n in Object(e))Gh.call(e,n)&&"constructor"!=n&&t.push(n);return t}var Jh=Yh;function Zh(e){return null!=e&&Zp(e.length)&&!J(e)}var Xh=Zh;function Qh(e){return Xh(e)?Vh(e):Jh(e)}var ef=Qh;function tf(e){return Rp(e,ef,Mp)}var nf=tf,rf=1,of=Object.prototype,sf=of.hasOwnProperty;function af(e,t,n,r,o,i){var s=n&rf,a=nf(e),l=a.length,c=nf(t),u=c.length;if(l!=u&&!s)return!1;var d=l;while(d--){var p=a[d];if(!(s?p in t:sf.call(t,p)))return!1}var h=i.get(e),f=i.get(t);if(h&&f)return h==t&&f==e;var g=!0;i.set(e,t),i.set(t,e);var m=s;while(++d<l){p=a[d];var v=e[p],y=t[p];if(r)var b=s?r(y,v,p,t,e,i):r(v,y,p,e,t,i);if(!(void 0===b?v===y||o(v,y,n,r,i):b)){g=!1;break}m||(m="constructor"==p)}if(g&&!m){var w=e.constructor,C=t.constructor;w==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(g=!1)}return i["delete"](e),i["delete"](t),g}var lf=af,cf=ye(m,"DataView"),uf=cf,df=ye(m,"Promise"),pf=df,hf=ye(m,"Set"),ff=hf,gf=ye(m,"WeakMap"),mf=gf,vf="[object Map]",yf="[object Object]",bf="[object Promise]",wf="[object Set]",Cf="[object WeakMap]",Sf="[object DataView]",Ef=ie(uf),Tf=ie(ot),kf=ie(pf),xf=ie(ff),Nf=ie(mf),Rf=B;(uf&&Rf(new uf(new ArrayBuffer(1)))!=Sf||ot&&Rf(new ot)!=vf||pf&&Rf(pf.resolve())!=bf||ff&&Rf(new ff)!=wf||mf&&Rf(new mf)!=Cf)&&(Rf=function(e){var t=B(e),n=t==yf?e.constructor:void 0,r=n?ie(n):"";if(r)switch(r){case Ef:return Sf;case Tf:return vf;case kf:return bf;case xf:return wf;case Nf:return Cf}return t});var If=Rf,_f=1,Of="[object Arguments]",Af="[object Array]",Bf="[object Object]",Df=Object.prototype,Pf=Df.hasOwnProperty;function Hf(e,t,n,r,o,i){var s=d(e),a=d(t),l=s?Af:If(e),c=a?Af:If(t);l=l==Of?Bf:l,c=c==Of?Bf:c;var u=l==Bf,p=c==Bf,h=l==c;if(h&&Gp(e)){if(!Gp(t))return!1;s=!0,u=!1}if(h&&!u)return i||(i=new qd),s||Ph(e)?rp(e,t,n,r,o,i):xp(e,t,l,n,r,o,i);if(!(n&_f)){var f=u&&Pf.call(e,"__wrapped__"),g=p&&Pf.call(t,"__wrapped__");if(f||g){var m=f?e.value():e,v=g?t.value():t;return i||(i=new qd),o(m,v,n,r,i)}}return!!h&&(i||(i=new qd),lf(e,t,n,r,o,i))}var Mf=Hf;function jf(e,t,n,r,o){return e===t||(null==e||null==t||!P(e)&&!P(t)?e!==e&&t!==t:Mf(e,t,n,r,jf,o))}var Vf=jf,$f=1,Lf=2;function qf(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;e=Object(e);while(o--){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}while(++o<i){a=n[o];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var d=new qd;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?Vf(u,c,$f|Lf,r,d):p))return!1}}return!0}var Ff=qf;function Uf(e){return e===e&&!U(e)}var zf=Uf;function Kf(e){var t=ef(e),n=t.length;while(n--){var r=t[n],o=e[r];t[n]=[r,o,zf(o)]}return t}var Wf=Kf;function Gf(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}var Yf=Gf;function Jf(e){var t=Wf(e);return 1==t.length&&t[0][2]?Yf(t[0][0],t[0][1]):function(n){return n===e||Ff(n,e,t)}}var Zf=Jf;function Xf(e,t){return null!=e&&t in Object(e)}var Qf=Xf;function eg(e,t,n){t=Lt(t,e);var r=-1,o=t.length,i=!1;while(++r<o){var s=Ut(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:(o=null==e?0:e.length,!!o&&Zp(o)&&Jn(s,o)&&(d(e)||Td(e)))}var tg=eg;function ng(e,t){return null!=e&&tg(e,t,Qf)}var rg=ng,og=1,ig=2;function sg(e,t){return q(e)&&zf(t)?Yf(Ut(e),t):function(n){var r=Gt(n,e);return void 0===r&&r===t?rg(n,e):Vf(t,r,og|ig)}}var ag=sg;function lg(e){return e}var cg=lg;function ug(e){return function(t){return null==t?void 0:t[e]}}var dg=ug;function pg(e){return function(t){return Kt(t,e)}}var hg=pg;function fg(e){return q(e)?dg(Ut(e)):hg(e)}var gg=fg;function mg(e){return"function"==typeof e?e:null==e?cg:"object"==typeof e?d(e)?ag(e[0],e[1]):Zf(e):gg(e)}var vg=mg;function yg(e){return function(t,n,r){var o=-1,i=Object(t),s=r(t),a=s.length;while(a--){var l=s[e?a:++o];if(!1===n(i[l],l,i))break}return t}}var bg=yg,wg=bg(),Cg=wg;function Sg(e,t){return e&&Cg(e,t,ef)}var Eg=Sg;function Tg(e,t){return function(n,r){if(null==n)return n;if(!Xh(n))return e(n,r);var o=n.length,i=t?o:-1,s=Object(n);while(t?i--:++i<o)if(!1===r(s[i],i,s))break;return n}}var kg=Tg,xg=kg(Eg),Ng=xg;function Rg(e,t){var n=-1,r=Xh(e)?Array(e.length):[];return Ng(e,(function(e,o,i){r[++n]=t(e,o,i)})),r}var Ig=Rg;function _g(e,t){var n=d(e)?At:Ig;return n(e,vg(t,3))}var Og=_g;function Ag(e,t){return Id(Og(e,t),1)}var Bg=Ag;const Dg=function(e){var t;return null==(t=e.target)?void 0:t.closest("td")},Pg=function(e,t,n,r,o){if(!t&&!r&&(!o||Array.isArray(o)&&!o.length))return e;n="string"===typeof n?"descending"===n?-1:1:n&&n<0?-1:1;const i=r?null:function(n,r){return o?(Array.isArray(o)||(o=[o]),o.map((t=>"string"===typeof t?Gt(n,t):t(n,r,e)))):("$key"!==t&&ln(n)&&"$value"in n&&(n=n.$value),[ln(n)?Gt(n,t):n])},s=function(e,t){if(r)return r(e.value,t.value);for(let n=0,r=e.key.length;n<r;n++){if(e.key[n]<t.key[n])return-1;if(e.key[n]>t.key[n])return 1}return 0};return e.map(((e,t)=>({value:e,index:t,key:i?i(e,t):null}))).sort(((e,t)=>{let r=s(e,t);return r||(r=e.index-t.index),r*+n})).map((e=>e.value))},Hg=function(e,t){let n=null;return e.columns.forEach((e=>{e.id===t&&(n=e)})),n},Mg=function(e,t){let n=null;for(let r=0;r<e.columns.length;r++){const o=e.columns[r];if(o.columnKey===t){n=o;break}}return n||xn("ElTable",`No column matching with column-key: ${t}`),n},jg=function(e,t,n){const r=(t.className||"").match(new RegExp(`${n}-table_[^\\s]+`,"gm"));return r?Hg(e,r[0]):null},Vg=(e,t)=>{if(!e)throw new Error("Row is required when get row identity");if("string"===typeof t){if(!t.includes("."))return`${e[t]}`;const n=t.split(".");let r=e;for(const e of n)r=r[e];return`${r}`}if("function"===typeof t)return t.call(null,e)},$g=function(e,t){const n={};return(e||[]).forEach(((e,r)=>{n[Vg(e,t)]={row:e,index:r}})),n};function Lg(e,t){const n={};let r;for(r in e)n[r]=e[r];for(r in t)if(rn(t,r)){const e=t[r];"undefined"!==typeof e&&(n[r]=e)}return n}function qg(e){return""===e||void 0!==e&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function Fg(e){return""===e||void 0!==e&&(e=qg(e),Number.isNaN(e)&&(e=80)),e}function Ug(e){return"number"===typeof e?e:"string"===typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null}function zg(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function Kg(e,t,n){let r=!1;const o=e.indexOf(t),i=-1!==o,s=s=>{"add"===s?e.push(t):e.splice(o,1),r=!0,on(t.children)&&t.children.forEach((t=>{Kg(e,t,null!=n?n:!i)}))};return vn(n)?n&&!i?s("add"):!n&&i&&s("remove"):s(i?"remove":"add"),r}function Wg(e,t,n="children",r="hasChildren"){const o=e=>!(Array.isArray(e)&&e.length);function i(e,s,a){t(e,s,a),s.forEach((e=>{if(e[r])return void t(e,null,a+1);const s=e[n];o(s)||i(e,s,a+1)}))}e.forEach((e=>{if(e[r])return void t(e,null,0);const s=e[n];o(s)||i(e,s,0)}))}let Gg=null;function Yg(e,t,r,o){if((null==Gg?void 0:Gg.trigger)===r)return;null==Gg||Gg();const i=null==o?void 0:o.refs.tableWrapper,s=null==i?void 0:i.dataset.prefix,a={strategy:"fixed",...e.popperOptions},l=(0,n.createVNode)(Ol,{content:t,virtualTriggering:!0,virtualRef:r,appendTo:i,placement:"top",transition:"none",offset:0,hideAfter:0,...e,popperOptions:a,onHide:()=>{null==Gg||Gg()}});l.appContext={...o.appContext,...o};const c=document.createElement("div");(0,n.render)(l,c),l.component.exposed.onOpen();const u=null==i?void 0:i.querySelector(`.${s}-scrollbar__wrap`);Gg=()=>{(0,n.render)(null,c),null==u||u.removeEventListener("scroll",Gg),Gg=null},Gg.trigger=r,null==u||u.addEventListener("scroll",Gg)}function Jg(e){return e.children?Bg(e.children,Jg):[e]}function Zg(e,t){return e+t.colSpan}const Xg=(e,t,n,r)=>{let o=0,i=e;const s=n.states.columns.value;if(r){const t=Jg(r[e]),n=s.slice(0,s.indexOf(t[0]));o=n.reduce(Zg,0),i=o+t.reduce(Zg,0)-1}else o=e;let a;switch(t){case"left":i<n.states.fixedLeafColumnsLength.value&&(a="left");break;case"right":o>=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right");break;default:i<n.states.fixedLeafColumnsLength.value?a="left":o>=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right")}return a?{direction:a,start:o,after:i}:{}},Qg=(e,t,n,r,o,i=0)=>{const s=[],{direction:a,start:l,after:c}=Xg(t,n,r,o);if(a){const t="left"===a;s.push(`${e}-fixed-column--${a}`),t&&c+i===r.states.fixedLeafColumnsLength.value-1?s.push("is-last-column"):t||l-i!==r.states.columns.value.length-r.states.rightFixedLeafColumnsLength.value||s.push("is-first-column")}return s};function em(e,t){return e+(null===t.realWidth||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const tm=(e,t,n,r)=>{const{direction:o,start:i=0,after:s=0}=Xg(e,t,n,r);if(!o)return;const a={},l="left"===o,c=n.states.columns.value;return l?a.left=c.slice(0,i).reduce(em,0):a.right=c.slice(s+1).reverse().reduce(em,0),a},nm=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))};function rm(e){const t=(0,n.getCurrentInstance)(),r=(0,n.ref)(!1),o=(0,n.ref)([]),i=()=>{const t=e.data.value||[],n=e.rowKey.value;if(r.value)o.value=t.slice();else if(n){const e=$g(o.value,n);o.value=t.reduce(((t,r)=>{const o=Vg(r,n),i=e[o];return i&&t.push(r),t}),[])}else o.value=[]},s=(e,n)=>{const r=Kg(o.value,e,n);r&&t.emit("expand-change",e,o.value.slice())},a=n=>{t.store.assertRowKey();const r=e.data.value||[],i=e.rowKey.value,s=$g(r,i);o.value=n.reduce(((e,t)=>{const n=s[t];return n&&e.push(n.row),e}),[])},l=t=>{const n=e.rowKey.value;if(n){const e=$g(o.value,n);return!!e[Vg(t,n)]}return o.value.includes(t)};return{updateExpandRows:i,toggleRowExpansion:s,setExpandRowKeys:a,isRowExpanded:l,states:{expandRows:o,defaultExpandAll:r}}}function om(e){const t=(0,n.getCurrentInstance)(),r=(0,n.ref)(null),o=(0,n.ref)(null),i=e=>{t.store.assertRowKey(),r.value=e,a(e)},s=()=>{r.value=null},a=r=>{const{data:i,rowKey:s}=e;let a=null;s.value&&(a=((0,n.unref)(i)||[]).find((e=>Vg(e,s.value)===r))),o.value=a,t.emit("current-change",o.value,null)},l=e=>{const n=o.value;if(e&&e!==n)return o.value=e,void t.emit("current-change",o.value,n);!e&&n&&(o.value=null,t.emit("current-change",null,n))},c=()=>{const n=e.rowKey.value,i=e.data.value||[],l=o.value;if(!i.includes(l)&&l){if(n){const e=Vg(l,n);a(e)}else o.value=null;null===o.value&&t.emit("current-change",null,l)}else r.value&&(a(r.value),s())};return{setCurrentRowKey:i,restoreCurrentRowKey:s,setCurrentRowByKey:a,updateCurrentRow:l,updateCurrentRowData:c,states:{_currentRowKey:r,currentRow:o}}}function im(e){const t=(0,n.ref)([]),r=(0,n.ref)({}),o=(0,n.ref)(16),i=(0,n.ref)(!1),s=(0,n.ref)({}),a=(0,n.ref)("hasChildren"),l=(0,n.ref)("children"),c=(0,n.getCurrentInstance)(),u=(0,n.computed)((()=>{if(!e.rowKey.value)return{};const t=e.data.value||[];return p(t)})),d=(0,n.computed)((()=>{const t=e.rowKey.value,n=Object.keys(s.value),r={};return n.length?(n.forEach((e=>{if(s.value[e].length){const n={children:[]};s.value[e].forEach((e=>{const o=Vg(e,t);n.children.push(o),e[a.value]&&!r[o]&&(r[o]={children:[]})})),r[e]=n}})),r):r})),p=t=>{const n=e.rowKey.value,r={};return Wg(t,((e,t,o)=>{const s=Vg(e,n);Array.isArray(t)?r[s]={children:t.map((e=>Vg(e,n))),level:o}:i.value&&(r[s]={children:[],lazy:!0,level:o})}),l.value,a.value),r},h=(e=!1,o=(e=>null==(e=c.store)?void 0:e.states.defaultExpandAll.value)())=>{var s;const a=u.value,l=d.value,p=Object.keys(a),h={};if(p.length){const s=(0,n.unref)(r),c=[],u=(n,r)=>{if(e)return t.value?o||t.value.includes(r):!(!o&&!(null==n?void 0:n.expanded));{const e=o||t.value&&t.value.includes(r);return!(!(null==n?void 0:n.expanded)&&!e)}};p.forEach((e=>{const t=s[e],n={...a[e]};if(n.expanded=u(t,e),n.lazy){const{loaded:r=!1,loading:o=!1}=t||{};n.loaded=!!r,n.loading=!!o,c.push(e)}h[e]=n}));const d=Object.keys(l);i.value&&d.length&&c.length&&d.forEach((e=>{const t=s[e],n=l[e].children;if(c.includes(e)){if(0!==h[e].children.length)throw new Error("[ElTable]children must be an empty array.");h[e].children=n}else{const{loaded:r=!1,loading:o=!1}=t||{};h[e]={lazy:!0,loaded:!!r,loading:!!o,expanded:u(t,e),children:n,level:""}}}))}r.value=h,null==(s=c.store)||s.updateTableScrollY()};(0,n.watch)((()=>t.value),(()=>{h(!0)})),(0,n.watch)((()=>u.value),(()=>{h()})),(0,n.watch)((()=>d.value),(()=>{h()}));const f=e=>{t.value=e,h()},g=(t,n)=>{c.store.assertRowKey();const o=e.rowKey.value,i=Vg(t,o),s=i&&r.value[i];if(i&&s&&"expanded"in s){const e=s.expanded;n="undefined"===typeof n?!s.expanded:n,r.value[i].expanded=n,e!==n&&c.emit("expand-change",t,n),c.store.updateTableScrollY()}},m=t=>{c.store.assertRowKey();const n=e.rowKey.value,o=Vg(t,n),s=r.value[o];i.value&&s&&"loaded"in s&&!s.loaded?v(t,o,s):g(t,void 0)},v=(e,t,n)=>{const{load:o}=c.props;o&&!r.value[t].loaded&&(r.value[t].loading=!0,o(e,n,(n=>{if(!Array.isArray(n))throw new TypeError("[ElTable] data must be an array");r.value[t].loading=!1,r.value[t].loaded=!0,r.value[t].expanded=!0,n.length&&(s.value[t]=n),c.emit("expand-change",e,!0)})))};return{loadData:v,loadOrToggle:m,toggleTreeExpansion:g,updateTreeExpandKeys:f,updateTreeData:h,normalize:p,states:{expandRowKeys:t,treeData:r,indent:o,lazy:i,lazyTreeNodeMap:s,lazyColumnIdentifier:a,childrenColumnName:l}}}const sm=(e,t)=>{const n=t.sortingColumn;return n&&"string"!==typeof n.sortable?Pg(e,t.sortProp,t.sortOrder,n.sortMethod,n.sortBy):e},am=e=>{const t=[];return e.forEach((e=>{e.children&&e.children.length>0?t.push.apply(t,am(e.children)):t.push(e)})),t};function lm(){var e;const t=(0,n.getCurrentInstance)(),{size:r}=(0,n.toRefs)(null==(e=t.proxy)?void 0:e.$props),o=(0,n.ref)(null),i=(0,n.ref)([]),s=(0,n.ref)([]),a=(0,n.ref)(!1),l=(0,n.ref)([]),c=(0,n.ref)([]),u=(0,n.ref)([]),d=(0,n.ref)([]),p=(0,n.ref)([]),h=(0,n.ref)([]),f=(0,n.ref)([]),g=(0,n.ref)([]),m=[],v=(0,n.ref)(0),y=(0,n.ref)(0),b=(0,n.ref)(0),w=(0,n.ref)(!1),C=(0,n.ref)([]),S=(0,n.ref)(!1),E=(0,n.ref)(!1),T=(0,n.ref)(null),k=(0,n.ref)({}),x=(0,n.ref)(null),N=(0,n.ref)(null),R=(0,n.ref)(null),I=(0,n.ref)(null),_=(0,n.ref)(null);(0,n.watch)(i,(()=>t.state&&D(!1)),{deep:!0});const O=()=>{if(!o.value)throw new Error("[ElTable] prop row-key is required")},A=e=>{var t;null==(t=e.children)||t.forEach((t=>{t.fixed=e.fixed,A(t)}))},B=()=>{l.value.forEach((e=>{A(e)})),d.value=l.value.filter((e=>!0===e.fixed||"left"===e.fixed)),p.value=l.value.filter((e=>"right"===e.fixed)),d.value.length>0&&l.value[0]&&"selection"===l.value[0].type&&!l.value[0].fixed&&(l.value[0].fixed=!0,d.value.unshift(l.value[0]));const e=l.value.filter((e=>!e.fixed));c.value=[].concat(d.value).concat(e).concat(p.value);const t=am(e),n=am(d.value),r=am(p.value);v.value=t.length,y.value=n.length,b.value=r.length,u.value=[].concat(n).concat(t).concat(r),a.value=d.value.length>0||p.value.length>0},D=(e,n=!1)=>{e&&B(),n?t.state.doLayout():t.state.debouncedUpdateLayout()},P=e=>C.value.includes(e),H=()=>{w.value=!1;const e=C.value;e.length&&(C.value=[],t.emit("selection-change",[]))},M=()=>{let e;if(o.value){e=[];const t=$g(C.value,o.value),n=$g(i.value,o.value);for(const r in t)rn(t,r)&&!n[r]&&e.push(t[r].row)}else e=C.value.filter((e=>!i.value.includes(e)));if(e.length){const n=C.value.filter((t=>!e.includes(t)));C.value=n,t.emit("selection-change",n.slice())}},j=()=>(C.value||[]).slice(),V=(e,n=void 0,r=!0)=>{const o=Kg(C.value,e,n);if(o){const n=(C.value||[]).slice();r&&t.emit("select",n,e),t.emit("selection-change",n)}},$=()=>{var e,n;const r=E.value?!w.value:!(w.value||C.value.length);w.value=r;let o=!1,s=0;const a=null==(n=null==(e=null==t?void 0:t.store)?void 0:e.states)?void 0:n.rowKey.value;i.value.forEach(((e,t)=>{const n=t+s;T.value?T.value.call(null,e,n)&&Kg(C.value,e,r)&&(o=!0):Kg(C.value,e,r)&&(o=!0),s+=F(Vg(e,a))})),o&&t.emit("selection-change",C.value?C.value.slice():[]),t.emit("select-all",C.value)},L=()=>{const e=$g(C.value,o.value);i.value.forEach((t=>{const n=Vg(t,o.value),r=e[n];r&&(C.value[r.index]=t)}))},q=()=>{var e,n,r;if(0===(null==(e=i.value)?void 0:e.length))return void(w.value=!1);let s;o.value&&(s=$g(C.value,o.value));const a=function(e){return s?!!s[Vg(e,o.value)]:C.value.includes(e)};let l=!0,c=0,u=0;for(let o=0,d=(i.value||[]).length;o<d;o++){const e=null==(r=null==(n=null==t?void 0:t.store)?void 0:n.states)?void 0:r.rowKey.value,s=o+u,d=i.value[o],p=T.value&&T.value.call(null,d,s);if(a(d))c++;else if(!T.value||p){l=!1;break}u+=F(Vg(d,e))}0===c&&(l=!1),w.value=l},F=e=>{var n;if(!t||!t.store)return 0;const{treeData:r}=t.store.states;let o=0;const i=null==(n=r.value[e])?void 0:n.children;return i&&(o+=i.length,i.forEach((e=>{o+=F(e)}))),o},U=(e,t)=>{Array.isArray(e)||(e=[e]);const n={};return e.forEach((e=>{k.value[e.id]=t,n[e.columnKey||e.id]=t})),n},z=(e,t,n)=>{N.value&&N.value!==e&&(N.value.order=null),N.value=e,R.value=t,I.value=n},K=()=>{let e=(0,n.unref)(s);Object.keys(k.value).forEach((t=>{const n=k.value[t];if(!n||0===n.length)return;const r=Hg({columns:u.value},t);r&&r.filterMethod&&(e=e.filter((e=>n.some((t=>r.filterMethod.call(null,t,e,r))))))})),x.value=e},W=()=>{i.value=sm(x.value,{sortingColumn:N.value,sortProp:R.value,sortOrder:I.value})},G=(e=void 0)=>{e&&e.filter||K(),W()},Y=e=>{const{tableHeaderRef:n}=t.refs;if(!n)return;const r=Object.assign({},n.filterPanels),o=Object.keys(r);if(o.length)if("string"===typeof e&&(e=[e]),Array.isArray(e)){const n=e.map((e=>Mg({columns:u.value},e)));o.forEach((e=>{const t=n.find((t=>t.id===e));t&&(t.filteredValue=[])})),t.store.commit("filterChange",{column:n,values:[],silent:!0,multi:!0})}else o.forEach((e=>{const t=u.value.find((t=>t.id===e));t&&(t.filteredValue=[])})),k.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},J=()=>{N.value&&(z(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Z,toggleRowExpansion:X,updateExpandRows:Q,states:ee,isRowExpanded:te}=rm({data:i,rowKey:o}),{updateTreeExpandKeys:ne,toggleTreeExpansion:re,updateTreeData:oe,loadOrToggle:ie,states:se}=im({data:i,rowKey:o}),{updateCurrentRowData:ae,updateCurrentRow:le,setCurrentRowKey:ce,states:ue}=om({data:i,rowKey:o}),de=e=>{Z(e),ne(e)},pe=(e,t)=>{const n=u.value.some((({type:e})=>"expand"===e));n?X(e,t):re(e,t)};return{assertRowKey:O,updateColumns:B,scheduleLayout:D,isSelected:P,clearSelection:H,cleanSelection:M,getSelectionRows:j,toggleRowSelection:V,_toggleAllSelection:$,toggleAllSelection:null,updateSelectionByRowKey:L,updateAllSelected:q,updateFilters:U,updateCurrentRow:le,updateSort:z,execFilter:K,execSort:W,execQuery:G,clearFilter:Y,clearSort:J,toggleRowExpansion:X,setExpandRowKeysAdapter:de,setCurrentRowKey:ce,toggleRowExpansionAdapter:pe,isRowExpanded:te,updateExpandRows:Q,updateCurrentRowData:ae,loadOrToggle:ie,updateTreeData:oe,states:{tableSize:r,rowKey:o,data:i,_data:s,isComplex:a,_columns:l,originColumns:c,columns:u,fixedColumns:d,rightFixedColumns:p,leafColumns:h,fixedLeafColumns:f,rightFixedLeafColumns:g,updateOrderFns:m,leafColumnsLength:v,fixedLeafColumnsLength:y,rightFixedLeafColumnsLength:b,isAllSelected:w,selection:C,reserveSelection:S,selectOnIndeterminate:E,selectable:T,filters:k,filteredData:x,sortingColumn:N,sortProp:R,sortOrder:I,hoverRow:_,...ee,...se,...ue}}}function cm(e,t){return e.map((e=>{var n;return e.id===t.id?t:((null==(n=e.children)?void 0:n.length)&&(e.children=cm(e.children,t)),e)}))}function um(e){e.forEach((e=>{var t,n;e.no=null==(t=e.getColumnIndex)?void 0:t.call(e),(null==(n=e.children)?void 0:n.length)&&um(e.children)})),e.sort(((e,t)=>e.no-t.no))}function dm(){const e=(0,n.getCurrentInstance)(),t=lm(),r=c("table"),o={setData(t,r){const o=(0,n.unref)(t._data)!==r;t.data.value=r,t._data.value=r,e.store.execQuery(),e.store.updateCurrentRowData(),e.store.updateExpandRows(),e.store.updateTreeData(e.store.states.defaultExpandAll.value),(0,n.unref)(t.reserveSelection)?(e.store.assertRowKey(),e.store.updateSelectionByRowKey()):o?e.store.clearSelection():e.store.cleanSelection(),e.store.updateAllSelected(),e.$ready&&e.store.scheduleLayout()},insertColumn(t,r,o,i){const s=(0,n.unref)(t._columns);let a=[];o?(o&&!o.children&&(o.children=[]),o.children.push(r),a=cm(s,o)):(s.push(r),a=s),um(a),t._columns.value=a,t.updateOrderFns.push(i),"selection"===r.type&&(t.selectable.value=r.selectable,t.reserveSelection.value=r.reserveSelection),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},updateColumnOrder(t,n){var r;const o=null==(r=n.getColumnIndex)?void 0:r.call(n);o!==n.no&&(um(t._columns.value),e.$ready&&e.store.updateColumns())},removeColumn(t,r,o,i){const s=(0,n.unref)(t._columns)||[];if(o)o.children.splice(o.children.findIndex((e=>e.id===r.id)),1),(0,n.nextTick)((()=>{var e;0===(null==(e=o.children)?void 0:e.length)&&delete o.children})),t._columns.value=cm(s,o);else{const e=s.indexOf(r);e>-1&&(s.splice(e,1),t._columns.value=s)}const a=t.updateOrderFns.indexOf(i);a>-1&&t.updateOrderFns.splice(a,1),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},sort(t,r){const{prop:o,order:i,init:s}=r;if(o){const r=(0,n.unref)(t.columns).find((e=>e.property===o));r&&(r.order=i,e.store.updateSort(r,o,i),e.store.commit("changeSortCondition",{init:s}))}},changeSortCondition(t,r){const{sortingColumn:o,sortProp:i,sortOrder:s}=t,a=(0,n.unref)(o),l=(0,n.unref)(i),c=(0,n.unref)(s);null===c&&(t.sortingColumn.value=null,t.sortProp.value=null);const u={filter:!0};e.store.execQuery(u),r&&(r.silent||r.init)||e.emit("sort-change",{column:a,prop:l,order:c}),e.store.updateTableScrollY()},filterChange(t,n){const{column:r,values:o,silent:i}=n,s=e.store.updateFilters(r,o);e.store.execQuery(),i||e.emit("filter-change",s),e.store.updateTableScrollY()},toggleAllSelection(){e.store.toggleAllSelection()},rowSelectedChanged(t,n){e.store.toggleRowSelection(n),e.store.updateAllSelected()},setHoverRow(e,t){e.hoverRow.value=t},setCurrentRow(t,n){e.store.updateCurrentRow(n)}},i=function(t,...n){const r=e.store.mutations;if(!r[t])throw new Error(`Action not found: ${t}`);r[t].apply(e,[e.store.states].concat(n))},s=function(){(0,n.nextTick)((()=>e.layout.updateScrollY.apply(e.layout)))};return{ns:r,...t,mutations:o,commit:i,updateTableScrollY:s}}const pm={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function hm(e,t){if(!e)throw new Error("Table is required.");const n=dm();return n.toggleAllSelection=Ju(n._toggleAllSelection,10),Object.keys(pm).forEach((e=>{gm(mm(t,e),e,n)})),fm(n,t),n}function fm(e,t){Object.keys(pm).forEach((r=>{(0,n.watch)((()=>mm(t,r)),(t=>{gm(t,r,e)}))}))}function gm(e,t,n){let r=e,o=pm[t];"object"===typeof pm[t]&&(o=o.key,r=r||pm[t].default),n.states[o].value=r}function mm(e,t){if(t.includes(".")){const n=t.split(".");let r=e;return n.forEach((e=>{r=r[e]})),r}return e[t]}class vm{constructor(e){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=(0,n.ref)(null),this.scrollX=(0,n.ref)(!1),this.scrollY=(0,n.ref)(!1),this.bodyWidth=(0,n.ref)(null),this.fixedWidth=(0,n.ref)(null),this.rightFixedWidth=(0,n.ref)(null),this.gutterWidth=0;for(const t in e)rn(e,t)&&((0,n.isRef)(this[t])?this[t].value=e[t]:this[t]=e[t]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){const e=this.height.value;if(null===e)return!1;const t=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(null==t?void 0:t.wrapRef)){let e=!0;const n=this.scrollY.value;return e=t.wrapRef.scrollHeight>t.wrapRef.clientHeight,this.scrollY.value=e,n!==e}return!1}setHeight(e,t="height"){if(!jr)return;const r=this.table.vnode.el;if(e=Ug(e),this.height.value=Number(e),!r&&(e||0===e))return(0,n.nextTick)((()=>this.setHeight(e,t)));"number"===typeof e?(r.style[t]=`${e}px`,this.updateElsHeight()):"string"===typeof e&&(r.style[t]=e,this.updateElsHeight())}setMaxHeight(e){this.setHeight(e,"max-height")}getFlattenColumns(){const e=[],t=this.table.store.states.columns.value;return t.forEach((t=>{t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)})),e}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(e){if(!e)return!0;let t=e;while("DIV"!==t.tagName){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}updateColumnsWidth(){if(!jr)return;const e=this.fit,t=this.table.vnode.el.clientWidth;let n=0;const r=this.getFlattenColumns(),o=r.filter((e=>"number"!==typeof e.width));if(r.forEach((e=>{"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)})),o.length>0&&e){if(r.forEach((e=>{n+=Number(e.width||e.minWidth||80)})),n<=t){this.scrollX.value=!1;const e=t-n;if(1===o.length)o[0].realWidth=Number(o[0].minWidth||80)+e;else{const t=o.reduce(((e,t)=>e+Number(t.minWidth||80)),0),n=e/t;let r=0;o.forEach(((e,t)=>{if(0===t)return;const o=Math.floor(Number(e.minWidth||80)*n);r+=o,e.realWidth=Number(e.minWidth||80)+o})),o[0].realWidth=Number(o[0].minWidth||80)+e-r}}else this.scrollX.value=!0,o.forEach((e=>{e.realWidth=Number(e.minWidth)}));this.bodyWidth.value=Math.max(n,t),this.table.state.resizeState.value.width=this.bodyWidth.value}else r.forEach((e=>{e.width||e.minWidth?e.realWidth=Number(e.width||e.minWidth):e.realWidth=80,n+=e.realWidth})),this.scrollX.value=n>t,this.bodyWidth.value=n;const i=this.store.states.fixedColumns.value;if(i.length>0){let e=0;i.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.fixedWidth.value=e}const s=this.store.states.rightFixedColumns.value;if(s.length>0){let e=0;s.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.rightFixedWidth.value=e}this.notifyObservers("columns")}addObserver(e){this.observers.push(e)}removeObserver(e){const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}notifyObservers(e){const t=this.observers;t.forEach((t=>{var n,r;switch(e){case"columns":null==(n=t.state)||n.onColumnsChange(this);break;case"scrollable":null==(r=t.state)||r.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${e}.`)}}))}}const ym={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:Hn,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},bm={[Xc]:e=>an(e)||yn(e)||vn(e),change:e=>an(e)||yn(e)||vn(e)},wm=Symbol("checkboxGroupContextKey"),Cm=e=>{const t=(0,n.getCurrentInstance)();return(0,n.computed)((()=>{var n,r;return null==(r=null==(n=null==t?void 0:t.proxy)?void 0:n.$props)?void 0:r[e]}))},Sm=(e,t={})=>{const r=(0,n.ref)(void 0),o=t.prop?r:Cm("size"),i=t.global?r:jn(),s=t.form?{size:void 0}:(0,n.inject)(Ha,void 0),a=t.formItem?{size:void 0}:(0,n.inject)(Ma,void 0);return(0,n.computed)((()=>o.value||(0,n.unref)(e)||(null==a?void 0:a.size)||(null==s?void 0:s.size)||i.value||""))},Em=e=>{const t=Cm("disabled"),r=(0,n.inject)(Ha,void 0);return(0,n.computed)((()=>t.value||(0,n.unref)(e)||(null==r?void 0:r.disabled)||!1))},Tm=({model:e,isChecked:t})=>{const r=(0,n.inject)(wm,void 0),o=(0,n.computed)((()=>{var n,o;const i=null==(n=null==r?void 0:r.max)?void 0:n.value,s=null==(o=null==r?void 0:r.min)?void 0:o.value;return!mn(i)&&e.value.length>=i&&!t.value||!mn(s)&&e.value.length<=s&&t.value})),i=Em((0,n.computed)((()=>(null==r?void 0:r.disabled.value)||o.value)));return{isDisabled:i,isLimitDisabled:o}},km=()=>{const e=(0,n.inject)(Ha,void 0),t=(0,n.inject)(Ma,void 0);return{form:e,formItem:t}},xm=(e,{formItemContext:t,disableIdGeneration:r,disableIdManagement:o})=>{r||(r=(0,n.ref)(!1)),o||(o=(0,n.ref)(!1));const i=(0,n.ref)();let s;const a=(0,n.computed)((()=>{var n;return!!(!e.label&&t&&t.inputIds&&(null==(n=t.inputIds)?void 0:n.length)<=1)}));return(0,n.onMounted)((()=>{s=(0,n.watch)([(0,n.toRef)(e,"id"),r],(([e,n])=>{const r=null!=e?e:n?void 0:ba().value;r!==i.value&&((null==t?void 0:t.removeInputId)&&(i.value&&t.removeInputId(i.value),(null==o?void 0:o.value)||n||!r||t.addInputId(r)),i.value=r)}),{immediate:!0})})),(0,n.onUnmounted)((()=>{s&&s(),(null==t?void 0:t.removeInputId)&&i.value&&t.removeInputId(i.value)})),{isLabeledByFormItem:a,inputId:i}},Nm=(e,{model:t,isLimitExceeded:r,hasOwnLabel:o,isDisabled:i,isLabeledByFormItem:s})=>{const a=(0,n.inject)(wm,void 0),{formItem:l}=km(),{emit:c}=(0,n.getCurrentInstance)();function u(t){var n,r;return t===e.trueLabel||!0===t?null==(n=e.trueLabel)||n:null!=(r=e.falseLabel)&&r}function d(e,t){c("change",u(e),t)}function p(e){if(r.value)return;const t=e.target;c("change",u(t.checked),e)}async function h(a){if(!r.value&&!o.value&&!i.value&&s.value){const r=a.composedPath(),o=r.some((e=>"LABEL"===e.tagName));o||(t.value=u([!1,e.falseLabel].includes(t.value)),await(0,n.nextTick)(),d(t.value,a))}}const f=(0,n.computed)((()=>(null==a?void 0:a.validateEvent)||e.validateEvent));return(0,n.watch)((()=>e.modelValue),(()=>{f.value&&(null==l||l.validate("change").catch((e=>Nn(e))))})),{handleChange:p,onClickRoot:h}},Rm=e=>{const t=(0,n.ref)(!1),{emit:r}=(0,n.getCurrentInstance)(),o=(0,n.inject)(wm,void 0),i=(0,n.computed)((()=>!1===mn(o))),s=(0,n.ref)(!1),a=(0,n.computed)({get(){var n,r;return i.value?null==(n=null==o?void 0:o.modelValue)?void 0:n.value:null!=(r=e.modelValue)?r:t.value},set(e){var n,l;i.value&&on(e)?(s.value=void 0!==(null==(n=null==o?void 0:o.max)?void 0:n.value)&&e.length>(null==o?void 0:o.max.value)&&e.length>a.value.length,!1===s.value&&(null==(l=null==o?void 0:o.changeEvent)||l.call(o,e))):(r(Xc,e),t.value=e)}});return{model:a,isGroup:i,isLimitExceeded:s}};function Im(e,t){return Vf(e,t)}var _m=Im;const Om=(e,t,{model:r})=>{const o=(0,n.inject)(wm,void 0),i=(0,n.ref)(!1),s=(0,n.computed)((()=>{const t=r.value;return vn(t)?t:on(t)?ln(e.label)?t.map(n.toRaw).some((t=>_m(t,e.label))):t.map(n.toRaw).includes(e.label):null!==t&&void 0!==t?t===e.trueLabel:!!t})),a=Sm((0,n.computed)((()=>{var e;return null==(e=null==o?void 0:o.size)?void 0:e.value})),{prop:!0}),l=Sm((0,n.computed)((()=>{var e;return null==(e=null==o?void 0:o.size)?void 0:e.value}))),c=(0,n.computed)((()=>!!t.default||!Ns(e.label)));return{checkboxButtonSize:a,isChecked:s,isFocused:i,checkboxSize:l,hasOwnLabel:c}},Am=(e,{model:t})=>{function n(){on(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&n()},Bm=(e,t)=>{const{formItem:n}=km(),{model:r,isGroup:o,isLimitExceeded:i}=Rm(e),{isFocused:s,isChecked:a,checkboxButtonSize:l,checkboxSize:c,hasOwnLabel:u}=Om(e,t,{model:r}),{isDisabled:d}=Tm({model:r,isChecked:a}),{inputId:p,isLabeledByFormItem:h}=xm(e,{formItemContext:n,disableIdGeneration:u,disableIdManagement:o}),{handleChange:f,onClickRoot:g}=Nm(e,{model:r,isLimitExceeded:i,hasOwnLabel:u,isDisabled:d,isLabeledByFormItem:h});return Am(e,{model:r}),{inputId:p,isLabeledByFormItem:h,isChecked:a,isDisabled:d,isFocused:s,checkboxButtonSize:l,checkboxSize:c,hasOwnLabel:u,model:r,handleChange:f,onClickRoot:g}},Dm=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],Pm=["id","indeterminate","disabled","value","name","tabindex"],Hm=(0,n.defineComponent)({name:"ElCheckbox"}),Mm=(0,n.defineComponent)({...Hm,props:ym,emits:bm,setup(e){const t=e,r=(0,n.useSlots)(),{inputId:o,isLabeledByFormItem:i,isChecked:s,isDisabled:a,isFocused:l,checkboxSize:u,hasOwnLabel:d,model:p,handleChange:h,onClickRoot:f}=Bm(t,r),g=c("checkbox"),m=(0,n.computed)((()=>[g.b(),g.m(u.value),g.is("disabled",a.value),g.is("bordered",t.border),g.is("checked",s.value)])),v=(0,n.computed)((()=>[g.e("input"),g.is("disabled",a.value),g.is("checked",s.value),g.is("indeterminate",t.indeterminate),g.is("focus",l.value)]));return(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(!(0,n.unref)(d)&&(0,n.unref)(i)?"span":"label"),{class:(0,n.normalizeClass)((0,n.unref)(m)),"aria-controls":e.indeterminate?e.controls:null,onClick:(0,n.unref)(f)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v))},[e.trueLabel||e.falseLabel?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:0,id:(0,n.unref)(o),"onUpdate:modelValue":t[0]||(t[0]=e=>(0,n.isRef)(p)?p.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(g).e("original")),type:"checkbox",indeterminate:e.indeterminate,name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(a),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e)),onFocus:t[2]||(t[2]=e=>l.value=!0),onBlur:t[3]||(t[3]=e=>l.value=!1),onClick:t[4]||(t[4]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Dm)),[[n.vModelCheckbox,(0,n.unref)(p)]]):(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:1,id:(0,n.unref)(o),"onUpdate:modelValue":t[5]||(t[5]=e=>(0,n.isRef)(p)?p.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(g).e("original")),type:"checkbox",indeterminate:e.indeterminate,disabled:(0,n.unref)(a),value:e.label,name:e.name,tabindex:e.tabindex,onChange:t[6]||(t[6]=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e)),onFocus:t[7]||(t[7]=e=>l.value=!0),onBlur:t[8]||(t[8]=e=>l.value=!1),onClick:t[9]||(t[9]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Pm)),[[n.vModelCheckbox,(0,n.unref)(p)]]),(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(g).e("inner"))},null,2)],2),(0,n.unref)(d)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(g).e("label"))},[(0,n.renderSlot)(e.$slots,"default"),e.$slots.default?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createTextVNode)((0,n.toDisplayString)(e.label),1)],64))],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["class","aria-controls","onClick"]))}});var jm=Cr(Mm,[["__file","checkbox.vue"]]);const Vm=["name","tabindex","disabled","true-value","false-value"],$m=["name","tabindex","disabled","value"],Lm=(0,n.defineComponent)({name:"ElCheckboxButton"}),qm=(0,n.defineComponent)({...Lm,props:ym,emits:bm,setup(e){const t=e,r=(0,n.useSlots)(),{isFocused:o,isChecked:i,isDisabled:s,checkboxButtonSize:a,model:l,handleChange:u}=Bm(t,r),d=(0,n.inject)(wm,void 0),p=c("checkbox"),h=(0,n.computed)((()=>{var e,t,n,r;const o=null!=(t=null==(e=null==d?void 0:d.fill)?void 0:e.value)?t:"";return{backgroundColor:o,borderColor:o,color:null!=(r=null==(n=null==d?void 0:d.textColor)?void 0:n.value)?r:"",boxShadow:o?`-1px 0 0 0 ${o}`:void 0}})),f=(0,n.computed)((()=>[p.b("button"),p.bm("button",a.value),p.is("disabled",s.value),p.is("checked",i.value),p.is("focus",o.value)]));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("label",{class:(0,n.normalizeClass)((0,n.unref)(f))},[e.trueLabel||e.falseLabel?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=e=>(0,n.isRef)(l)?l.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(p).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(s),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e)),onFocus:t[2]||(t[2]=e=>o.value=!0),onBlur:t[3]||(t[3]=e=>o.value=!1),onClick:t[4]||(t[4]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Vm)),[[n.vModelCheckbox,(0,n.unref)(l)]]):(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:1,"onUpdate:modelValue":t[5]||(t[5]=e=>(0,n.isRef)(l)?l.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(p).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(s),value:e.label,onChange:t[6]||(t[6]=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e)),onFocus:t[7]||(t[7]=e=>o.value=!0),onBlur:t[8]||(t[8]=e=>o.value=!1),onClick:t[9]||(t[9]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,$m)),[[n.vModelCheckbox,(0,n.unref)(l)]]),e.$slots.default||e.label?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:2,class:(0,n.normalizeClass)((0,n.unref)(p).be("button","inner")),style:(0,n.normalizeStyle)((0,n.unref)(i)?(0,n.unref)(h):void 0)},[(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.label),1)]))],6)):(0,n.createCommentVNode)("v-if",!0)],2))}});var Fm=Cr(qm,[["__file","checkbox-button.vue"]]);function Um(e,t,n){var r=-1,o=t.length,i={};while(++r<o){var s=t[r],a=Kt(e,s);n(a,s)&&Xn(i,Lt(s,e),a)}return i}var zm=Um;function Km(e,t){return zm(e,t,(function(t,n){return rg(e,n)}))}var Wm=Km;function Gm(e){var t=null==e?0:e.length;return t?Id(e,1):[]}var Ym=Gm;function Jm(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var Zm=Jm,Xm=Math.max;function Qm(e,t,n){return t=Xm(void 0===t?e.length-1:t,0),function(){var r=arguments,o=-1,i=Xm(r.length-t,0),s=Array(i);while(++o<i)s[o]=r[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=r[o];return a[t]=n(s),Zm(e,this,a)}}var ev=Qm;function tv(e){return function(){return e}}var nv=tv,rv=$n?function(e,t){return $n(e,"toString",{configurable:!0,enumerable:!1,value:nv(t),writable:!0})}:cg,ov=rv,iv=800,sv=16,av=Date.now;function lv(e){var t=0,n=0;return function(){var r=av(),o=sv-(r-n);if(n=r,o>0){if(++t>=iv)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var cv=lv,uv=cv(ov),dv=uv;function pv(e){return dv(ev(e,void 0,Ym),e+"")}var hv=pv,fv=hv((function(e,t){return null==e?{}:Wm(e,t)})),gv=fv;const mv=Dn({modelValue:{type:On(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Hn,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),vv={[Xc]:e=>on(e),change:e=>on(e)},yv=(0,n.defineComponent)({name:"ElCheckboxGroup"}),bv=(0,n.defineComponent)({...yv,props:mv,emits:vv,setup(e,{emit:t}){const r=e,o=c("checkbox"),{formItem:i}=km(),{inputId:s,isLabeledByFormItem:a}=xm(r,{formItemContext:i}),l=async e=>{t(Xc,e),await(0,n.nextTick)(),t("change",e)},u=(0,n.computed)({get(){return r.modelValue},set(e){l(e)}});return(0,n.provide)(wm,{...gv((0,n.toRefs)(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),(0,n.watch)((()=>r.modelValue),(()=>{r.validateEvent&&(null==i||i.validate("change").catch((e=>Nn(e))))})),(e,t)=>{var r;return(0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),{id:(0,n.unref)(s),class:(0,n.normalizeClass)((0,n.unref)(o).b("group")),role:"group","aria-label":(0,n.unref)(a)?void 0:e.label||"checkbox-group","aria-labelledby":(0,n.unref)(a)?null==(r=(0,n.unref)(i))?void 0:r.labelId:void 0},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var wv=Cr(bv,[["__file","checkbox-group.vue"]]);const Cv=dr(jm,{CheckboxButton:Fm,CheckboxGroup:wv}),Sv=(fr(Fm),fr(wv),new Map);let Ev;function Tv(e,t){let n=[];return Array.isArray(t.arg)?n=t.arg:bn(t.arg)&&n.push(t.arg),function(r,o){const i=t.instance.popperRef,s=r.target,a=null==o?void 0:o.target,l=!t||!t.instance,c=!s||!a,u=e.contains(s)||e.contains(a),d=e===s,p=n.length&&n.some((e=>null==e?void 0:e.contains(s)))||n.length&&n.includes(a),h=i&&(i.contains(s)||i.contains(a));l||c||u||d||p||h||t.value(r,o)}}jr&&(document.addEventListener("mousedown",(e=>Ev=e)),document.addEventListener("mouseup",(e=>{for(const t of Sv.values())for(const{documentHandler:n}of t)n(e,Ev)})));const kv={beforeMount(e,t){Sv.has(e)||Sv.set(e,[]),Sv.get(e).push({documentHandler:Tv(e,t),bindingFn:t.value})},updated(e,t){Sv.has(e)||Sv.set(e,[]);const n=Sv.get(e),r=n.findIndex((e=>e.bindingFn===t.oldValue)),o={documentHandler:Tv(e,t),bindingFn:t.value};r>=0?n.splice(r,1,o):n.push(o)},unmounted(e){Sv.delete(e)}},{CheckboxGroup:xv}=Cv,Nv=(0,n.defineComponent)({name:"ElTableFilterPanel",components:{ElCheckbox:Cv,ElCheckboxGroup:xv,ElScrollbar:fd,ElTooltip:Ol,ElIcon:wu,ArrowDown:Bl,ArrowUp:Vl},directives:{ClickOutside:kv},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=(0,n.getCurrentInstance)(),{t:r}=en(),o=c("table-filter"),i=null==t?void 0:t.parent;i.filterPanels.value[e.column.id]||(i.filterPanels.value[e.column.id]=t);const s=(0,n.ref)(!1),a=(0,n.ref)(null),l=(0,n.computed)((()=>e.column&&e.column.filters)),u=(0,n.computed)((()=>e.column.filterClassName?`${o.b()} ${e.column.filterClassName}`:o.b())),d=(0,n.computed)({get:()=>{var t;return((null==(t=e.column)?void 0:t.filteredValue)||[])[0]},set:e=>{p.value&&("undefined"!==typeof e&&null!==e?p.value.splice(0,1,e):p.value.splice(0,1))}}),p=(0,n.computed)({get(){return e.column&&e.column.filteredValue||[]},set(t){e.column&&e.upDataColumn("filteredValue",t)}}),h=(0,n.computed)((()=>!e.column||e.column.filterMultiple)),f=e=>e.value===d.value,g=()=>{s.value=!1},m=e=>{e.stopPropagation(),s.value=!s.value},v=()=>{s.value=!1},y=()=>{C(p.value),g()},b=()=>{p.value=[],C(p.value),g()},w=e=>{d.value=e,C("undefined"!==typeof e&&null!==e?p.value:[]),g()},C=t=>{e.store.commit("filterChange",{column:e.column,values:t}),e.store.updateAllSelected()};(0,n.watch)(s,(t=>{e.column&&e.upDataColumn("filterOpened",t)}),{immediate:!0});const S=(0,n.computed)((()=>{var e,t;return null==(t=null==(e=a.value)?void 0:e.popperRef)?void 0:t.contentRef}));return{tooltipVisible:s,multiple:h,filterClassName:u,filteredValue:p,filterValue:d,filters:l,handleConfirm:y,handleReset:b,handleSelect:w,isActive:f,t:r,ns:o,showFilterPanel:m,hideFilterPanel:v,popperPaneRef:S,tooltip:a}}}),Rv={key:0},Iv=["disabled"],_v=["label","onClick"];function Ov(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-checkbox"),l=(0,n.resolveComponent)("el-checkbox-group"),c=(0,n.resolveComponent)("el-scrollbar"),u=(0,n.resolveComponent)("arrow-up"),d=(0,n.resolveComponent)("arrow-down"),p=(0,n.resolveComponent)("el-icon"),h=(0,n.resolveComponent)("el-tooltip"),f=(0,n.resolveDirective)("click-outside");return(0,n.openBlock)(),(0,n.createBlock)(h,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.filterClassName,persistent:""},{content:(0,n.withCtx)((()=>[e.multiple?((0,n.openBlock)(),(0,n.createElementBlock)("div",Rv,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("content"))},[(0,n.createVNode)(c,{"wrap-class":e.ns.e("wrap")},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=t=>e.filteredValue=t),class:(0,n.normalizeClass)(e.ns.e("checkbox-group"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.filters,(e=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.value,label:e.value},{default:(0,n.withCtx)((()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.text),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue","class"])])),_:1},8,["wrap-class"])],2),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("bottom"))},[(0,n.createElementVNode)("button",{class:(0,n.normalizeClass)({[e.ns.is("disabled")]:0===e.filteredValue.length}),disabled:0===e.filteredValue.length,type:"button",onClick:t[1]||(t[1]=(...t)=>e.handleConfirm&&e.handleConfirm(...t))},(0,n.toDisplayString)(e.t("el.table.confirmFilter")),11,Iv),(0,n.createElementVNode)("button",{type:"button",onClick:t[2]||(t[2]=(...t)=>e.handleReset&&e.handleReset(...t))},(0,n.toDisplayString)(e.t("el.table.resetFilter")),1)],2)])):((0,n.openBlock)(),(0,n.createElementBlock)("ul",{key:1,class:(0,n.normalizeClass)(e.ns.e("list"))},[(0,n.createElementVNode)("li",{class:(0,n.normalizeClass)([e.ns.e("list-item"),{[e.ns.is("active")]:void 0===e.filterValue||null===e.filterValue}]),onClick:t[3]||(t[3]=t=>e.handleSelect(null))},(0,n.toDisplayString)(e.t("el.table.clearFilter")),3),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.filters,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("li",{key:t.value,class:(0,n.normalizeClass)([e.ns.e("list-item"),e.ns.is("active",e.isActive(t))]),label:t.value,onClick:n=>e.handleSelect(t.value)},(0,n.toDisplayString)(t.text),11,_v)))),128))],2))])),default:(0,n.withCtx)((()=>[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{class:(0,n.normalizeClass)([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...t)=>e.showFilterPanel&&e.showFilterPanel(...t))},[(0,n.createVNode)(p,null,{default:(0,n.withCtx)((()=>[e.column.filterOpened?((0,n.openBlock)(),(0,n.createBlock)(u,{key:0})):((0,n.openBlock)(),(0,n.createBlock)(d,{key:1}))])),_:1})],2)),[[f,e.hideFilterPanel,e.popperPaneRef]])])),_:1},8,["visible","placement","popper-class"])}var Av=Cr(Nv,[["render",Ov],["__file","filter-panel.vue"]]);function Bv(e){const t=(0,n.getCurrentInstance)();(0,n.onBeforeMount)((()=>{r.value.addObserver(t)})),(0,n.onMounted)((()=>{o(r.value),i(r.value)})),(0,n.onUpdated)((()=>{o(r.value),i(r.value)})),(0,n.onUnmounted)((()=>{r.value.removeObserver(t)}));const r=(0,n.computed)((()=>{const t=e.layout;if(!t)throw new Error("Can not find table layout.");return t})),o=t=>{var n;const r=(null==(n=e.vnode.el)?void 0:n.querySelectorAll("colgroup > col"))||[];if(!r.length)return;const o=t.getFlattenColumns(),i={};o.forEach((e=>{i[e.id]=e}));for(let e=0,s=r.length;e<s;e++){const t=r[e],n=t.getAttribute("name"),o=i[n];o&&t.setAttribute("width",o.realWidth||o.width)}},i=t=>{var n,r;const o=(null==(n=e.vnode.el)?void 0:n.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let e=0,s=o.length;e<s;e++){const n=o[e];n.setAttribute("width",t.scrollY.value?t.gutterWidth:"0")}const i=(null==(r=e.vnode.el)?void 0:r.querySelectorAll("th.gutter"))||[];for(let e=0,s=i.length;e<s;e++){const n=i[e];n.style.width=t.scrollY.value?`${t.gutterWidth}px`:"0",n.style.display=t.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:o,onScrollableChange:i}}const Dv=Symbol("ElTable");function Pv(e,t){const r=(0,n.getCurrentInstance)(),o=(0,n.inject)(Dv),i=e=>{e.stopPropagation()},s=(e,t)=>{!t.filters&&t.sortable?g(e,t,!1):t.filterable&&!t.sortable&&i(e),null==o||o.emit("header-click",t,e)},a=(e,t)=>{null==o||o.emit("header-contextmenu",t,e)},l=(0,n.ref)(null),c=(0,n.ref)(!1),u=(0,n.ref)({}),d=(n,i)=>{if(jr&&!(i.children&&i.children.length>0)&&l.value&&e.border){c.value=!0;const s=o;t("set-drag-visible",!0);const a=null==s?void 0:s.vnode.el,d=a.getBoundingClientRect().left,p=r.vnode.el.querySelector(`th.${i.id}`),h=p.getBoundingClientRect(),f=h.left-d+30;Vc(p,"noclick"),u.value={startMouseLeft:n.clientX,startLeft:h.right-d,startColumnLeft:h.left-d,tableLeft:d};const g=null==s?void 0:s.refs.resizeProxy;g.style.left=`${u.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const m=e=>{const t=e.clientX-u.value.startMouseLeft,n=u.value.startLeft+t;g.style.left=`${Math.max(f,n)}px`},v=()=>{if(c.value){const{startColumnLeft:r,startLeft:o}=u.value,a=Number.parseInt(g.style.left,10),d=a-r;i.width=i.realWidth=d,null==s||s.emit("header-dragend",i.width,o-r,i,n),requestAnimationFrame((()=>{e.store.scheduleLayout(!1,!0)})),document.body.style.cursor="",c.value=!1,l.value=null,u.value={},t("set-drag-visible",!1)}document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v),document.onselectstart=null,document.ondragstart=null,setTimeout((()=>{$c(p,"noclick")}),0)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",v)}},p=(t,n)=>{if(n.children&&n.children.length>0)return;const r=t.target;if(!bn(r))return;const o=null==r?void 0:r.closest("th");if(n&&n.resizable&&!c.value&&e.border){const e=o.getBoundingClientRect(),r=document.body.style;e.width>12&&e.right-t.pageX<8?(r.cursor="col-resize",jc(o,"is-sortable")&&(o.style.cursor="col-resize"),l.value=n):c.value||(r.cursor="",jc(o,"is-sortable")&&(o.style.cursor="pointer"),l.value=null)}},h=()=>{jr&&(document.body.style.cursor="")},f=({order:e,sortOrders:t})=>{if(""===e)return t[0];const n=t.indexOf(e||null);return t[n>t.length-2?0:n+1]},g=(t,n,r)=>{var i;t.stopPropagation();const s=n.order===r?null:r||f(n),a=null==(i=t.target)?void 0:i.closest("th");if(a&&jc(a,"noclick"))return void $c(a,"noclick");if(!n.sortable)return;const l=e.store.states;let c,u=l.sortProp.value;const d=l.sortingColumn.value;(d!==n||d===n&&null===d.order)&&(d&&(d.order=null),l.sortingColumn.value=n,u=n.property),c=n.order=s||null,l.sortProp.value=u,l.sortOrder.value=c,null==o||o.store.commit("changeSortCondition")};return{handleHeaderClick:s,handleHeaderContextMenu:a,handleMouseDown:d,handleMouseMove:p,handleMouseOut:h,handleSortClick:g,handleFilterClick:i}}function Hv(e){const t=(0,n.inject)(Dv),r=c("table"),o=e=>{const n=null==t?void 0:t.props.headerRowStyle;return"function"===typeof n?n.call(null,{rowIndex:e}):n},i=e=>{const n=[],r=null==t?void 0:t.props.headerRowClassName;return"string"===typeof r?n.push(r):"function"===typeof r&&n.push(r.call(null,{rowIndex:e})),n.join(" ")},s=(n,r,o,i)=>{var s;let a=null!=(s=null==t?void 0:t.props.headerCellStyle)?s:{};"function"===typeof a&&(a=a.call(null,{rowIndex:n,columnIndex:r,row:o,column:i}));const l=tm(r,i.fixed,e.store,o);return nm(l,"left"),nm(l,"right"),Object.assign({},a,l)},a=(n,o,i,s)=>{const a=Qg(r.b(),o,s.fixed,e.store,i),l=[s.id,s.order,s.headerAlign,s.className,s.labelClassName,...a];s.children||l.push("is-leaf"),s.sortable&&l.push("is-sortable");const c=null==t?void 0:t.props.headerCellClassName;return"string"===typeof c?l.push(c):"function"===typeof c&&l.push(c.call(null,{rowIndex:n,columnIndex:o,row:i,column:s})),l.push(r.e("cell")),l.filter((e=>Boolean(e))).join(" ")};return{getHeaderRowStyle:o,getHeaderRowClass:i,getHeaderCellStyle:s,getHeaderCellClass:a}}const Mv=e=>{const t=[];return e.forEach((e=>{e.children?(t.push(e),t.push.apply(t,Mv(e.children))):t.push(e)})),t},jv=e=>{let t=1;const n=(e,r)=>{if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=1};e.forEach((e=>{e.level=1,n(e,void 0)}));const r=[];for(let i=0;i<t;i++)r.push([]);const o=Mv(e);return o.forEach((e=>{e.children?(e.rowSpan=1,e.children.forEach((e=>e.isSubColumn=!0))):e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r};function Vv(e){const t=(0,n.inject)(Dv),r=(0,n.computed)((()=>jv(e.store.states.originColumns.value))),o=(0,n.computed)((()=>{const e=r.value.length>1;return e&&t&&(t.state.isGroup.value=!0),e})),i=e=>{e.stopPropagation(),null==t||t.store.commit("toggleAllSelection")};return{isGroup:o,toggleAllSelection:i,columnRows:r}}var $v=(0,n.defineComponent)({name:"ElTableHeader",components:{ElCheckbox:Cv},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const r=(0,n.getCurrentInstance)(),o=(0,n.inject)(Dv),i=c("table"),s=(0,n.ref)({}),{onColumnsChange:a,onScrollableChange:l}=Bv(o);(0,n.onMounted)((async()=>{await(0,n.nextTick)(),await(0,n.nextTick)();const{prop:t,order:r}=e.defaultSort;null==o||o.store.commit("sort",{prop:t,order:r,init:!0})}));const{handleHeaderClick:u,handleHeaderContextMenu:d,handleMouseDown:p,handleMouseMove:h,handleMouseOut:f,handleSortClick:g,handleFilterClick:m}=Pv(e,t),{getHeaderRowStyle:v,getHeaderRowClass:y,getHeaderCellStyle:b,getHeaderCellClass:w}=Hv(e),{isGroup:C,toggleAllSelection:S,columnRows:E}=Vv(e);return r.state={onColumnsChange:a,onScrollableChange:l},r.filterPanels=s,{ns:i,filterPanels:s,onColumnsChange:a,onScrollableChange:l,columnRows:E,getHeaderRowClass:y,getHeaderRowStyle:v,getHeaderCellClass:w,getHeaderCellStyle:b,handleHeaderClick:u,handleHeaderContextMenu:d,handleMouseDown:p,handleMouseMove:h,handleMouseOut:f,handleSortClick:g,handleFilterClick:m,isGroup:C,toggleAllSelection:S}},render(){const{ns:e,isGroup:t,columnRows:r,getHeaderCellStyle:o,getHeaderCellClass:i,getHeaderRowClass:s,getHeaderRowStyle:a,handleHeaderClick:l,handleHeaderContextMenu:c,handleMouseDown:u,handleMouseMove:d,handleSortClick:p,handleMouseOut:h,store:f,$parent:g}=this;let m=1;return(0,n.h)("thead",{class:{[e.is("group")]:t}},r.map(((e,t)=>(0,n.h)("tr",{class:s(t),key:t,style:a(t)},e.map(((r,s)=>(r.rowSpan>m&&(m=r.rowSpan),(0,n.h)("th",{class:i(t,s,e,r),colspan:r.colSpan,key:`${r.id}-thead`,rowspan:r.rowSpan,style:o(t,s,e,r),onClick:e=>l(e,r),onContextmenu:e=>c(e,r),onMousedown:e=>u(e,r),onMousemove:e=>d(e,r),onMouseout:h},[(0,n.h)("div",{class:["cell",r.filteredValue&&r.filteredValue.length>0?"highlight":""]},[r.renderHeader?r.renderHeader({column:r,$index:s,store:f,_self:g}):r.label,r.sortable&&(0,n.h)("span",{onClick:e=>p(e,r),class:"caret-wrapper"},[(0,n.h)("i",{onClick:e=>p(e,r,"ascending"),class:"sort-caret ascending"}),(0,n.h)("i",{onClick:e=>p(e,r,"descending"),class:"sort-caret descending"})]),r.filterable&&(0,n.h)(Av,{store:f,placement:r.filterPlacement||"bottom-start",column:r,upDataColumn:(e,t)=>{r[e]=t}})])]))))))))}});function Lv(e,t,n){(void 0!==n&&!qe(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}var qv=Lv,Fv="object"==typeof exports&&exports&&!exports.nodeType&&exports,Uv=Fv&&"object"==typeof module&&module&&!module.nodeType&&module,zv=Uv&&Uv.exports===Fv,Kv=zv?m.Buffer:void 0,Wv=Kv?Kv.allocUnsafe:void 0;function Gv(e,t){if(t)return e.slice();var n=e.length,r=Wv?Wv(n):new e.constructor(n);return e.copy(r),r}var Yv=Gv;function Jv(e){var t=new e.constructor(e.byteLength);return new ip(t).set(new ip(e)),t}var Zv=Jv;function Xv(e,t){var n=t?Zv(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Qv=Xv;function ey(e,t){var n=-1,r=e.length;t||(t=Array(r));while(++n<r)t[n]=e[n];return t}var ty=ey,ny=Object.create,ry=function(){function e(){}return function(t){if(!U(t))return{};if(ny)return ny(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),oy=ry,iy=Uh(Object.getPrototypeOf,Object),sy=iy;function ay(e){return"function"!=typeof e.constructor||qh(e)?{}:oy(sy(e))}var ly=ay;function cy(e){return P(e)&&Xh(e)}var uy=cy,dy="[object Object]",py=Function.prototype,hy=Object.prototype,fy=py.toString,gy=hy.hasOwnProperty,my=fy.call(Object);function vy(e){if(!P(e)||B(e)!=dy)return!1;var t=sy(e);if(null===t)return!0;var n=gy.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&fy.call(n)==my}var yy=vy;function by(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var wy=by;function Cy(e,t,n,r){var o=!n;n||(n={});var i=-1,s=t.length;while(++i<s){var a=t[i],l=r?r(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),o?qn(n,a,l):Kn(n,a,l)}return n}var Sy=Cy;function Ey(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}var Ty=Ey,ky=Object.prototype,xy=ky.hasOwnProperty;function Ny(e){if(!U(e))return Ty(e);var t=qh(e),n=[];for(var r in e)("constructor"!=r||!t&&xy.call(e,r))&&n.push(r);return n}var Ry=Ny;function Iy(e){return Xh(e)?Vh(e,!0):Ry(e)}var _y=Iy;function Oy(e){return Sy(e,_y(e))}var Ay=Oy;function By(e,t,n,r,o,i,s){var a=wy(e,n),l=wy(t,n),c=s.get(l);if(c)qv(e,n,c);else{var u=i?i(a,l,n+"",e,t,s):void 0,p=void 0===u;if(p){var h=d(l),f=!h&&Gp(l),g=!h&&!f&&Ph(l);u=l,h||f||g?d(a)?u=a:uy(a)?u=ty(a):f?(p=!1,u=Yv(l,!0)):g?(p=!1,u=Qv(l,!0)):u=[]:yy(l)||Td(l)?(u=a,Td(a)?u=Ay(a):U(a)&&!J(a)||(u=ly(l))):p=!1}p&&(s.set(l,u),o(u,l,r,i,s),s["delete"](l)),qv(e,n,u)}}var Dy=By;function Py(e,t,n,r,o){e!==t&&Cg(t,(function(i,s){if(o||(o=new qd),U(i))Dy(e,t,s,n,Py,r,o);else{var a=r?r(wy(e,s),i,s+"",e,t,o):void 0;void 0===a&&(a=i),qv(e,s,a)}}),_y)}var Hy=Py;function My(e,t){return dv(ev(e,t,cg),e+"")}var jy=My;function Vy(e,t,n){if(!U(n))return!1;var r=typeof t;return!!("number"==r?Xh(n)&&Jn(t,n.length):"string"==r&&t in n)&&qe(n[t],e)}var $y=Vy;function Ly(e){return jy((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;i=e.length>3&&"function"==typeof i?(o--,i):void 0,s&&$y(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);while(++r<o){var a=n[r];a&&e(t,a,r,i)}return t}))}var qy=Ly,Fy=qy((function(e,t,n){Hy(e,t,n)})),Uy=Fy;function zy(e){const t=(0,n.inject)(Dv),r=(0,n.ref)(""),o=(0,n.ref)((0,n.h)("div")),i=(n,r,o)=>{var i;const s=t,a=Dg(n);let l;const c=null==(i=null==s?void 0:s.vnode.el)?void 0:i.dataset.prefix;a&&(l=jg({columns:e.store.states.columns.value},a,c),l&&(null==s||s.emit(`cell-${o}`,r,l,a,n))),null==s||s.emit(`row-${o}`,r,l,n)},s=(e,t)=>{i(e,t,"dblclick")},a=(t,n)=>{e.store.commit("setCurrentRow",n),i(t,n,"click")},l=(e,t)=>{i(e,t,"contextmenu")},c=Ju((t=>{e.store.commit("setHoverRow",t)}),30),u=Ju((()=>{e.store.commit("setHoverRow",null)}),30),d=e=>{const t=window.getComputedStyle(e,null),n=Number.parseInt(t.paddingLeft,10)||0,r=Number.parseInt(t.paddingRight,10)||0,o=Number.parseInt(t.paddingTop,10)||0,i=Number.parseInt(t.paddingBottom,10)||0;return{left:n,right:r,top:o,bottom:i}},p=(e,t,n)=>{let r=t.target.parentNode;while(e>1){if(r=null==r?void 0:r.nextSibling,!r||"TR"!==r.nodeName)break;n(r,"hover-row hover-fixed-row"),e--}},h=(n,r,o)=>{var i;const s=t,a=Dg(n),l=null==(i=null==s?void 0:s.vnode.el)?void 0:i.dataset.prefix;if(a){const t=jg({columns:e.store.states.columns.value},a,l);a.rowSpan>1&&p(a.rowSpan,n,Vc);const o=s.hoverState={cell:a,column:t,row:r};null==s||s.emit("cell-mouse-enter",o.row,o.column,o.cell,n)}if(!o)return;const c=n.target.querySelector(".cell");if(!jc(c,`${l}-tooltip`)||!c.childNodes.length)return;const u=document.createRange();u.setStart(c,0),u.setEnd(c,c.childNodes.length);let h=u.getBoundingClientRect().width,f=u.getBoundingClientRect().height;const g=h-Math.floor(h);g<.001&&(h=Math.floor(h));const m=f-Math.floor(f);m<.001&&(f=Math.floor(f));const{top:v,left:y,right:b,bottom:w}=d(c),C=y+b,S=v+w;(h+C>c.offsetWidth||f+S>c.offsetHeight||c.scrollWidth>c.offsetWidth)&&Yg(o,a.innerText||a.textContent,a,s)},f=e=>{const n=Dg(e);if(!n)return;n.rowSpan>1&&p(n.rowSpan,e,$c);const r=null==t?void 0:t.hoverState;null==t||t.emit("cell-mouse-leave",null==r?void 0:r.row,null==r?void 0:r.column,null==r?void 0:r.cell,e)};return{handleDoubleClick:s,handleClick:a,handleContextMenu:l,handleMouseEnter:c,handleMouseLeave:u,handleCellMouseEnter:h,handleCellMouseLeave:f,tooltipContent:r,tooltipTrigger:o}}function Ky(e){const t=(0,n.inject)(Dv),r=c("table"),o=(e,n)=>{const r=null==t?void 0:t.props.rowStyle;return"function"===typeof r?r.call(null,{row:e,rowIndex:n}):r||null},i=(n,o)=>{const i=[r.e("row")];(null==t?void 0:t.props.highlightCurrentRow)&&n===e.store.states.currentRow.value&&i.push("current-row"),e.stripe&&o%2===1&&i.push(r.em("row","striped"));const s=null==t?void 0:t.props.rowClassName;return"string"===typeof s?i.push(s):"function"===typeof s&&i.push(s.call(null,{row:n,rowIndex:o})),i},s=(n,r,o,i)=>{const s=null==t?void 0:t.props.cellStyle;let a=null!=s?s:{};"function"===typeof s&&(a=s.call(null,{rowIndex:n,columnIndex:r,row:o,column:i}));const l=tm(r,null==e?void 0:e.fixed,e.store);return nm(l,"left"),nm(l,"right"),Object.assign({},a,l)},a=(n,o,i,s,a)=>{const l=Qg(r.b(),o,null==e?void 0:e.fixed,e.store,void 0,a),c=[s.id,s.align,s.className,...l],u=null==t?void 0:t.props.cellClassName;return"string"===typeof u?c.push(u):"function"===typeof u&&c.push(u.call(null,{rowIndex:n,columnIndex:o,row:i,column:s})),c.push(r.e("cell")),c.filter((e=>Boolean(e))).join(" ")},l=(e,n,r,o)=>{let i=1,s=1;const a=null==t?void 0:t.props.spanMethod;if("function"===typeof a){const t=a({row:e,column:n,rowIndex:r,columnIndex:o});Array.isArray(t)?(i=t[0],s=t[1]):"object"===typeof t&&(i=t.rowspan,s=t.colspan)}return{rowspan:i,colspan:s}},u=(e,t,n)=>{if(t<1)return e[n].realWidth;const r=e.map((({realWidth:e,width:t})=>e||t)).slice(n,n+t);return Number(r.reduce(((e,t)=>Number(e)+Number(t)),-1))};return{getRowStyle:o,getRowClass:i,getCellStyle:s,getCellClass:a,getSpan:l,getColspanRealWidth:u}}function Wy(e){const t=(0,n.inject)(Dv),r=c("table"),{handleDoubleClick:o,handleClick:i,handleContextMenu:s,handleMouseEnter:a,handleMouseLeave:l,handleCellMouseEnter:u,handleCellMouseLeave:d,tooltipContent:p,tooltipTrigger:h}=zy(e),{getRowStyle:f,getRowClass:g,getCellStyle:m,getCellClass:v,getSpan:y,getColspanRealWidth:b}=Ky(e),w=(0,n.computed)((()=>e.store.states.columns.value.findIndex((({type:e})=>"default"===e)))),C=(e,n)=>{const r=t.props.rowKey;return r?Vg(e,r):n},S=(c,p,h,S=!1)=>{const{tooltipEffect:T,tooltipOptions:k,store:x}=e,{indent:N,columns:R}=x.states,I=g(c,p);let _=!0;h&&(I.push(r.em("row",`level-${h.level}`)),_=h.display);const O=_?null:{display:"none"};return(0,n.h)("tr",{style:[O,f(c,p)],class:I,key:C(c,p),onDblclick:e=>o(e,c),onClick:e=>i(e,c),onContextmenu:e=>s(e,c),onMouseenter:()=>a(p),onMouseleave:l},R.value.map(((r,o)=>{const{rowspan:i,colspan:s}=y(c,r,p,o);if(!i||!s)return null;const a=Object.assign({},r);a.realWidth=b(R.value,s,o);const l={store:e.store,_self:e.context||t,column:a,row:c,$index:p,cellIndex:o,expanded:S};o===w.value&&h&&(l.treeNode={indent:h.level*N.value,level:h.level},"boolean"===typeof h.expanded&&(l.treeNode.expanded=h.expanded,"loading"in h&&(l.treeNode.loading=h.loading),"noLazyChildren"in h&&(l.treeNode.noLazyChildren=h.noLazyChildren)));const f=`${p},${o}`,g=a.columnKey||a.rawColumnKey||"",C=E(o,r,l),x=r.showOverflowTooltip&&Uy({effect:T},k,r.showOverflowTooltip);return(0,n.h)("td",{style:m(p,o,c,r),class:v(p,o,c,r,s-1),key:`${g}${f}`,rowspan:i,colspan:s,onMouseenter:e=>u(e,c,x),onMouseleave:d},[C])})))},E=(e,t,n)=>t.renderCell(n),T=(o,i)=>{const s=e.store,{isRowExpanded:a,assertRowKey:l}=s,{treeData:c,lazyTreeNodeMap:u,childrenColumnName:d,rowKey:p}=s.states,h=s.states.columns.value,f=h.some((({type:e})=>"expand"===e));if(f){const e=a(o),l=S(o,i,void 0,e),c=t.renderExpanded;return e?c?[[l,(0,n.h)("tr",{key:`expanded-row__${l.key}`},[(0,n.h)("td",{colspan:h.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[c({row:o,$index:i,store:s,expanded:e})])])]]:(console.error("[Element Error]renderExpanded is required."),l):[[l]]}if(Object.keys(c.value).length){l();const e=Vg(o,p.value);let t=c.value[e],n=null;t&&(n={expanded:t.expanded,level:t.level,display:!0},"boolean"===typeof t.lazy&&("boolean"===typeof t.loaded&&t.loaded&&(n.noLazyChildren=!(t.children&&t.children.length)),n.loading=t.loading));const r=[S(o,i,n)];if(t){let n=0;const s=(e,o)=>{e&&e.length&&o&&e.forEach((e=>{const a={display:o.display&&o.expanded,level:o.level+1,expanded:!1,noLazyChildren:!1,loading:!1},l=Vg(e,p.value);if(void 0===l||null===l)throw new Error("For nested data item, row-key is required.");if(t={...c.value[l]},t&&(a.expanded=t.expanded,t.level=t.level||a.level,t.display=!(!t.expanded||!a.display),"boolean"===typeof t.lazy&&("boolean"===typeof t.loaded&&t.loaded&&(a.noLazyChildren=!(t.children&&t.children.length)),a.loading=t.loading)),n++,r.push(S(e,i+n,a)),t){const n=u.value[l]||e[d.value];s(n,t)}}))};t.display=!0;const a=u.value[e]||o[d.value];s(a,t)}return r}return S(o,i,void 0)};return{wrappedRowRender:T,tooltipContent:p,tooltipTrigger:h}}const Gy={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean},Yy=e=>jr?window.requestAnimationFrame(e):setTimeout(e,16);var Jy=(0,n.defineComponent)({name:"ElTableBody",props:Gy,setup(e){const t=(0,n.getCurrentInstance)(),r=(0,n.inject)(Dv),o=c("table"),{wrappedRowRender:i,tooltipContent:s,tooltipTrigger:a}=Wy(e),{onColumnsChange:l,onScrollableChange:u}=Bv(r),d=[];return(0,n.watch)(e.store.states.hoverRow,((n,r)=>{var i;const s=null==t?void 0:t.vnode.el,a=Array.from((null==s?void 0:s.children)||[]).filter((e=>null==e?void 0:e.classList.contains(`${o.e("row")}`)));let l=n;const c=null==(i=a[l])?void 0:i.childNodes;if(null==c?void 0:c.length){const e=Array.from(c).reduce(((e,t,n)=>{var r,o;const i=(null==(r=c[n-1])?void 0:r.colSpan)>1,s=(null==(o=c[n+1])?void 0:o.colSpan)>1;return"TD"===t.nodeName||i||s||e.push(n),e}),[]);e.forEach((e=>{var t;while(l>0){const n=null==(t=a[l-1])?void 0:t.childNodes;if(n[e]&&"TD"===n[e].nodeName){Vc(n[e],"hover-cell"),d.push(n[e]);break}l--}}))}else d.forEach((e=>$c(e,"hover-cell"))),d.length=0;e.store.states.isComplex.value&&jr&&Yy((()=>{const e=a[r],t=a[n];e&&!e.classList.contains("hover-fixed-row")&&$c(e,"hover-row"),t&&Vc(t,"hover-row")}))})),(0,n.onUnmounted)((()=>{var e;null==(e=Gg)||e()})),{ns:o,onColumnsChange:l,onScrollableChange:u,wrappedRowRender:i,tooltipContent:s,tooltipTrigger:a}},render(){const{wrappedRowRender:e,store:t}=this,r=t.states.data.value||[];return(0,n.h)("tbody",{tabIndex:-1},[r.reduce(((t,n)=>t.concat(e(n,t.length))),[])])}});function Zy(){const e=(0,n.inject)(Dv),t=null==e?void 0:e.store,r=(0,n.computed)((()=>t.states.fixedLeafColumnsLength.value)),o=(0,n.computed)((()=>t.states.rightFixedColumns.value.length)),i=(0,n.computed)((()=>t.states.columns.value.length)),s=(0,n.computed)((()=>t.states.fixedColumns.value.length)),a=(0,n.computed)((()=>t.states.rightFixedColumns.value.length));return{leftFixedLeafCount:r,rightFixedLeafCount:o,columnsCount:i,leftFixedCount:s,rightFixedCount:a,columns:t.states.columns}}function Xy(e){const{columns:t}=Zy(),n=c("table"),r=(t,r)=>{const o=t[r],i=[n.e("cell"),o.id,o.align,o.labelClassName,...Qg(n.b(),r,o.fixed,e.store)];return o.className&&i.push(o.className),o.children||i.push(n.is("leaf")),i},o=(t,n)=>{const r=tm(n,t.fixed,e.store);return nm(r,"left"),nm(r,"right"),r};return{getCellClasses:r,getCellStyles:o,columns:t}}var Qy=(0,n.defineComponent)({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:n,columns:r}=Xy(e),o=c("table");return{ns:o,getCellClasses:t,getCellStyles:n,columns:r}},render(){const{columns:e,getCellStyles:t,getCellClasses:r,summaryMethod:o,sumText:i}=this,s=this.store.states.data.value;let a=[];return o?a=o({columns:e,data:s}):e.forEach(((e,t)=>{if(0===t)return void(a[t]=i);const n=s.map((t=>Number(t[e.property]))),r=[];let o=!0;n.forEach((e=>{if(!Number.isNaN(+e)){o=!1;const t=`${e}`.split(".")[1];r.push(t?t.length:0)}}));const l=Math.max.apply(null,r);a[t]=o?"":n.reduce(((e,t)=>{const n=Number(t);return Number.isNaN(+n)?e:Number.parseFloat((e+t).toFixed(Math.min(l,20)))}),0)})),(0,n.h)((0,n.h)("tfoot",[(0,n.h)("tr",{},[...e.map(((o,i)=>(0,n.h)("td",{key:i,colspan:o.colSpan,rowspan:o.rowSpan,class:r(e,i),style:t(o,i)},[(0,n.h)("div",{class:["cell",o.labelClassName]},[a[i]])])))])]))}});function eb(e){const t=t=>{e.commit("setCurrentRow",t)},n=()=>e.getSelectionRows(),r=(t,n)=>{e.toggleRowSelection(t,n,!1),e.updateAllSelected()},o=()=>{e.clearSelection()},i=t=>{e.clearFilter(t)},s=()=>{e.commit("toggleAllSelection")},a=(t,n)=>{e.toggleRowExpansionAdapter(t,n)},l=()=>{e.clearSort()},c=(t,n)=>{e.commit("sort",{prop:t,order:n})};return{setCurrentRow:t,getSelectionRows:n,toggleRowSelection:r,clearSelection:o,clearFilter:i,toggleAllSelection:s,toggleRowExpansion:a,clearSort:l,sort:c}}function tb(e,t,r,o){const i=(0,n.ref)(!1),s=(0,n.ref)(null),a=(0,n.ref)(!1),l=e=>{a.value=e},c=(0,n.ref)({width:null,height:null,headerHeight:null}),u=(0,n.ref)(!1),d={display:"inline-block",verticalAlign:"middle"},p=(0,n.ref)(),h=(0,n.ref)(0),f=(0,n.ref)(0),g=(0,n.ref)(0),m=(0,n.ref)(0),v=(0,n.ref)(0);(0,n.watchEffect)((()=>{t.setHeight(e.height)})),(0,n.watchEffect)((()=>{t.setMaxHeight(e.maxHeight)})),(0,n.watch)((()=>[e.currentRowKey,r.states.rowKey]),(([e,t])=>{(0,n.unref)(t)&&(0,n.unref)(e)&&r.setCurrentRowKey(`${e}`)}),{immediate:!0}),(0,n.watch)((()=>e.data),(e=>{o.store.commit("setData",e)}),{immediate:!0,deep:!0}),(0,n.watchEffect)((()=>{e.expandRowKeys&&r.setExpandRowKeysAdapter(e.expandRowKeys)}));const y=()=>{o.store.commit("setHoverRow",null),o.hoverState&&(o.hoverState=null)},b=(e,t)=>{const{pixelX:n,pixelY:r}=t;Math.abs(n)>=Math.abs(r)&&(o.refs.bodyWrapper.scrollLeft+=t.pixelX/5)},w=(0,n.computed)((()=>e.height||e.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0)),C=(0,n.computed)((()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""}))),S=()=>{w.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(x)};(0,n.onMounted)((async()=>{await(0,n.nextTick)(),r.updateColumns(),N(),requestAnimationFrame(S);const t=o.vnode.el,i=o.refs.headerWrapper;e.flexible&&t&&t.parentElement&&(t.parentElement.style.minWidth="0"),c.value={width:p.value=t.offsetWidth,height:t.offsetHeight,headerHeight:e.showHeader&&i?i.offsetHeight:null},r.states.columns.value.forEach((e=>{e.filteredValue&&e.filteredValue.length&&o.store.commit("filterChange",{column:e,values:e.filteredValue,silent:!0})})),o.$ready=!0}));const E=(e,n)=>{if(!e)return;const r=Array.from(e.classList).filter((e=>!e.startsWith("is-scrolling-")));r.push(t.scrollX.value?n:"is-scrolling-none"),e.className=r.join(" ")},T=e=>{const{tableWrapper:t}=o.refs;E(t,e)},k=e=>{const{tableWrapper:t}=o.refs;return!(!t||!t.classList.contains(e))},x=function(){if(!o.refs.scrollBarRef)return;if(!t.scrollX.value){const e="is-scrolling-none";return void(k(e)||T(e))}const e=o.refs.scrollBarRef.wrapRef;if(!e)return;const{scrollLeft:n,offsetWidth:r,scrollWidth:i}=e,{headerWrapper:s,footerWrapper:a}=o.refs;s&&(s.scrollLeft=n),a&&(a.scrollLeft=n);const l=i-r-1;T(n>=l?"is-scrolling-right":0===n?"is-scrolling-left":"is-scrolling-middle")},N=()=>{o.refs.scrollBarRef&&(o.refs.scrollBarRef.wrapRef&&Os(o.refs.scrollBarRef.wrapRef,"scroll",x,{passive:!0}),e.fit?qs(o.vnode.el,R):Os(window,"resize",R),qs(o.refs.bodyWrapper,(()=>{var e,t;R(),null==(t=null==(e=o.refs)?void 0:e.scrollBarRef)||t.update()})))},R=()=>{var t,n,r,i;const s=o.vnode.el;if(!o.$ready||!s)return;let a=!1;const{width:l,height:u,headerHeight:d}=c.value,y=p.value=s.offsetWidth;l!==y&&(a=!0);const b=s.offsetHeight;(e.height||w.value)&&u!==b&&(a=!0);const C="fixed"===e.tableLayout?o.refs.headerWrapper:null==(t=o.refs.tableHeaderRef)?void 0:t.$el;e.showHeader&&(null==C?void 0:C.offsetHeight)!==d&&(a=!0),h.value=(null==(n=o.refs.tableWrapper)?void 0:n.scrollHeight)||0,g.value=(null==C?void 0:C.scrollHeight)||0,m.value=(null==(r=o.refs.footerWrapper)?void 0:r.offsetHeight)||0,v.value=(null==(i=o.refs.appendWrapper)?void 0:i.offsetHeight)||0,f.value=h.value-g.value-m.value-v.value,a&&(c.value={width:y,height:b,headerHeight:e.showHeader&&(null==C?void 0:C.offsetHeight)||0},S())},I=Sm(),_=(0,n.computed)((()=>{const{bodyWidth:e,scrollY:n,gutterWidth:r}=t;return e.value?e.value-(n.value?r:0)+"px":""})),O=(0,n.computed)((()=>e.maxHeight?"fixed":e.tableLayout)),A=(0,n.computed)((()=>{if(e.data&&e.data.length)return null;let t="100%";e.height&&f.value&&(t=`${f.value}px`);const n=p.value;return{width:n?`${n}px`:"",height:t}})),B=(0,n.computed)((()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{})),D=(0,n.computed)((()=>e.height?{height:"100%"}:e.maxHeight?Number.isNaN(Number(e.maxHeight))?{maxHeight:`calc(${e.maxHeight} - ${g.value+m.value}px)`}:{maxHeight:e.maxHeight-g.value-m.value+"px"}:{})),P=(e,t)=>{const n=o.refs.bodyWrapper;if(Math.abs(t.spinY)>0){const r=n.scrollTop;t.pixelY<0&&0!==r&&e.preventDefault(),t.pixelY>0&&n.scrollHeight-n.clientHeight>r&&e.preventDefault(),n.scrollTop+=Math.ceil(t.pixelY/5)}else n.scrollLeft+=Math.ceil(t.pixelX/5)};return{isHidden:i,renderExpanded:s,setDragVisible:l,isGroup:u,handleMouseLeave:y,handleHeaderFooterMousewheel:b,tableSize:I,emptyBlockStyle:A,handleFixedMousewheel:P,resizeProxyVisible:a,bodyWidth:_,resizeState:c,doLayout:S,tableBodyStyles:C,tableLayout:O,scrollbarViewStyle:d,tableInnerStyle:B,scrollbarStyle:D}}function nb(e){const t=(0,n.ref)(),r=()=>{const n=e.vnode.el,r=n.querySelector(".hidden-columns"),o={childList:!0,subtree:!0},i=e.store.states.updateOrderFns;t.value=new MutationObserver((()=>{i.forEach((e=>e()))})),t.value.observe(r,o)};(0,n.onMounted)((()=>{r()})),(0,n.onUnmounted)((()=>{var e;null==(e=t.value)||e.disconnect()}))}var rb={data:{type:Array,default:()=>[]},size:Hn,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};function ob(e){const t="auto"===e.tableLayout;let r=e.columns||[];t&&r.every((e=>void 0===e.width))&&(r=[]);const o=n=>{const r={key:`${e.tableLayout}_${n.id}`,style:{},name:void 0};return t?r.style={width:`${n.width}px`}:r.name=n.id,r};return(0,n.h)("colgroup",{},r.map((e=>(0,n.h)("col",o(e)))))}ob.props=["columns","tableLayout"];const ib=()=>{const e=(0,n.ref)(),t=(t,n)=>{const r=e.value;r&&r.scrollTo(t,n)},r=(t,n)=>{const r=e.value;r&&yn(n)&&["Top","Left"].includes(t)&&r[`setScroll${t}`](n)},o=e=>r("Top",e),i=e=>r("Left",e);return{scrollBarRef:e,scrollTo:t,setScrollTop:o,setScrollLeft:i}};var sb,ab,lb,cb,ub,db,pb,hb,fb,gb,mb,vb,yb,bb,wb,Cb=!1;function Sb(){if(!Cb){Cb=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(vb=/\b(iPhone|iP[ao]d)/.exec(e),yb=/\b(iP[ao]d)/.exec(e),gb=/Android/i.exec(e),bb=/FBAN\/\w+;/i.exec(e),wb=/Mobile/i.exec(e),mb=!!/Win64/.exec(e),t){sb=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,sb&&document&&document.documentMode&&(sb=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);db=r?parseFloat(r[1])+4:sb,ab=t[2]?parseFloat(t[2]):NaN,lb=t[3]?parseFloat(t[3]):NaN,cb=t[4]?parseFloat(t[4]):NaN,cb?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),ub=t&&t[1]?parseFloat(t[1]):NaN):ub=NaN}else sb=ab=lb=ub=cb=NaN;if(n){if(n[1]){var o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);pb=!o||parseFloat(o[1].replace("_","."))}else pb=!1;hb=!!n[2],fb=!!n[3]}else pb=hb=fb=!1}}var Eb,Tb={ie:function(){return Sb()||sb},ieCompatibilityMode:function(){return Sb()||db>sb},ie64:function(){return Tb.ie()&&mb},firefox:function(){return Sb()||ab},opera:function(){return Sb()||lb},webkit:function(){return Sb()||cb},safari:function(){return Tb.webkit()},chrome:function(){return Sb()||ub},windows:function(){return Sb()||hb},osx:function(){return Sb()||pb},linux:function(){return Sb()||fb},iphone:function(){return Sb()||vb},mobile:function(){return Sb()||vb||yb||gb||wb},nativeApp:function(){return Sb()||bb},android:function(){return Sb()||gb},ipad:function(){return Sb()||yb}},kb=Tb,xb=!!(typeof window<"u"&&window.document&&window.document.createElement),Nb={canUseDOM:xb,canUseWorkers:typeof Worker<"u",canUseEventListeners:xb&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:xb&&!!window.screen,isInWorker:!xb},Rb=Nb;function Ib(e,t){if(!Rb.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var o=document.createElement("div");o.setAttribute(n,"return;"),r="function"==typeof o[n]}return!r&&Eb&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}Rb.canUseDOM&&(Eb=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var _b=Ib,Ob=10,Ab=40,Bb=800;function Db(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*Ob,o=n*Ob,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=Ab,o*=Ab):(r*=Bb,o*=Bb)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}Db.getEventType=function(){return kb.firefox()?"DOMMouseScroll":_b("wheel")?"wheel":"mousewheel"};var Pb=Db;
34
+ var Fl=(0,n.defineComponent)({name:"ArrowDown",__name:"arrow-down",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"})]))}}),Ul=Fl,zl=(0,n.defineComponent)({name:"ArrowLeft",__name:"arrow-left",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"})]))}}),Kl=zl,Wl=(0,n.defineComponent)({name:"ArrowRight",__name:"arrow-right",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}}),Gl=Wl,Yl=(0,n.defineComponent)({name:"ArrowUp",__name:"arrow-up",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),Jl=Yl,Zl=(0,n.defineComponent)({name:"CaretRight",__name:"caret-right",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})]))}}),Xl=Zl,Ql=(0,n.defineComponent)({name:"CircleCheck",__name:"circle-check",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),ec=Ql,tc=(0,n.defineComponent)({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),nc=tc,rc=(0,n.defineComponent)({name:"CircleClose",__name:"circle-close",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),oc=rc,ic=(0,n.defineComponent)({name:"Close",__name:"close",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),sc=ic,ac=(0,n.defineComponent)({name:"Hide",__name:"hide",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),(0,n.createElementVNode)("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),lc=ac,cc=(0,n.defineComponent)({name:"InfoFilled",__name:"info-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),uc=cc,dc=(0,n.defineComponent)({name:"Loading",__name:"loading",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),pc=dc,hc=(0,n.defineComponent)({name:"Minus",__name:"minus",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),fc=hc,gc=(0,n.defineComponent)({name:"Plus",__name:"plus",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),mc=gc,vc=(0,n.defineComponent)({name:"SuccessFilled",__name:"success-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),yc=vc,bc=(0,n.defineComponent)({name:"View",__name:"view",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),wc=bc,Cc=(0,n.defineComponent)({name:"WarningFilled",__name:"warning-filled",setup(e){return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[(0,n.createElementVNode)("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),Sc=Cc;const Ec=On([String,Object,Function]),Tc={Close:sc,SuccessFilled:yc,InfoFilled:uc,WarningFilled:Sc,CircleCloseFilled:nc},kc={success:yc,warning:Sc,error:nc,info:uc},xc={validating:pc,success:ec,error:oc},Nc=(0,n.defineComponent)({inheritAttrs:!1});function Rc(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var Ic=Ar(Nc,[["render",Rc],["__file","collection.vue"]]);const _c=(0,n.defineComponent)({name:"ElCollectionItem",inheritAttrs:!1});function Oc(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var Ac=Ar(_c,[["render",Oc],["__file","collection-item.vue"]]);const Bc="data-el-collection-item",Dc=e=>{const t=`El${e}Collection`,r=`${t}Item`,o=Symbol(t),i=Symbol(r),s={...Ic,name:t,setup(){const e=(0,n.ref)(null),t=new Map,r=()=>{const r=(0,n.unref)(e);if(!r)return[];const o=Array.from(r.querySelectorAll(`[${Bc}]`)),i=[...t.values()];return i.sort(((e,t)=>o.indexOf(e.ref)-o.indexOf(t.ref)))};(0,n.provide)(o,{itemMap:t,getItems:r,collectionRef:e})}},a={...Ac,name:r,setup(e,{attrs:t}){const r=(0,n.ref)(null),s=(0,n.inject)(o,void 0);(0,n.provide)(i,{collectionItemRef:r}),(0,n.onMounted)((()=>{const e=(0,n.unref)(r);e&&s.itemMap.set(e,{ref:e,...t})})),(0,n.onBeforeUnmount)((()=>{const e=(0,n.unref)(r);s.itemMap.delete(e)}))}};return{COLLECTION_INJECTION_KEY:o,COLLECTION_ITEM_INJECTION_KEY:i,ElCollection:s,ElCollectionItem:a}},Pc=Dn({trigger:ws.trigger,effect:{...vs.effect,default:"light"},type:{type:On(String)},placement:{type:On(String),default:"bottom"},popperOptions:{type:On(Object),default:()=>({})},id:String,size:{type:String,default:""},splitButton:Boolean,hideOnClick:{type:Boolean,default:!0},loop:{type:Boolean,default:!0},showTimeout:{type:Number,default:150},hideTimeout:{type:Number,default:150},tabindex:{type:On([Number,String]),default:0},maxHeight:{type:On([Number,String]),default:""},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},role:{type:String,default:"menu"},buttonProps:{type:On(Object)},teleported:vs.teleported}),Hc=Dn({command:{type:[Object,String,Number],default:()=>({})},disabled:Boolean,divided:Boolean,textValue:String,icon:{type:Ec}}),Mc=Dn({onKeydown:{type:On(Function)}}),jc=[bs.down,bs.pageDown,bs.home],Vc=[bs.up,bs.pageUp,bs.end],Lc=[...jc,...Vc],{ElCollection:$c,ElCollectionItem:qc,COLLECTION_INJECTION_KEY:Fc,COLLECTION_ITEM_INJECTION_KEY:Uc}=Dc("Dropdown"),zc=Dn({trigger:ws.trigger,placement:Pc.placement,disabled:ws.disabled,visible:vs.visible,transition:vs.transition,popperOptions:Pc.popperOptions,tabindex:Pc.tabindex,content:vs.content,popperStyle:vs.popperStyle,popperClass:vs.popperClass,enterable:{...vs.enterable,default:!0},effect:{...vs.effect,default:"light"},teleported:vs.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Kc={"update:visible":e=>vn(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},Wc="utils/dom/style",Gc=(e="")=>e.split(" ").filter((e=>!!e.trim())),Yc=(e,t)=>{if(!e||!t)return!1;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},Jc=(e,t)=>{e&&t.trim()&&e.classList.add(...Gc(t))},Zc=(e,t)=>{e&&t.trim()&&e.classList.remove(...Gc(t))};function Xc(e,t="px"){return e?yn(e)||wn(e)?`${e}${t}`:an(e)?e:void Nn(Wc,"binding value must be a string or number"):""}const Qc="onUpdate:visible",eu=(0,n.defineComponent)({name:"ElPopover"}),tu=(0,n.defineComponent)({...eu,props:zc,emits:Kc,setup(e,{expose:t,emit:r}){const o=e,i=(0,n.computed)((()=>o[Qc])),s=c("popover"),a=(0,n.ref)(),l=(0,n.computed)((()=>{var e;return null==(e=(0,n.unref)(a))?void 0:e.popperRef})),u=(0,n.computed)((()=>[{width:Xc(o.width)},o.popperStyle])),d=(0,n.computed)((()=>[s.b(),o.popperClass,{[s.m("plain")]:!!o.content}])),p=(0,n.computed)((()=>o.transition===`${s.namespace.value}-fade-in-linear`)),h=()=>{var e;null==(e=a.value)||e.hide()},f=()=>{r("before-enter")},g=()=>{r("before-leave")},m=()=>{r("after-enter")},v=()=>{r("update:visible",!1),r("after-leave")};return t({popperRef:l,hide:h}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(ql),(0,n.mergeProps)({ref_key:"tooltipRef",ref:a},e.$attrs,{trigger:e.trigger,placement:e.placement,disabled:e.disabled,visible:e.visible,transition:e.transition,"popper-options":e.popperOptions,tabindex:e.tabindex,content:e.content,offset:e.offset,"show-after":e.showAfter,"hide-after":e.hideAfter,"auto-close":e.autoClose,"show-arrow":e.showArrow,"aria-label":e.title,effect:e.effect,enterable:e.enterable,"popper-class":(0,n.unref)(d),"popper-style":(0,n.unref)(u),teleported:e.teleported,persistent:e.persistent,"gpu-acceleration":(0,n.unref)(p),"onUpdate:visible":(0,n.unref)(i),onBeforeShow:f,onBeforeHide:g,onShow:m,onHide:v}),{content:(0,n.withCtx)((()=>[e.title?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)((0,n.unref)(s).e("title")),role:"title"},(0,n.toDisplayString)(e.title),3)):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.content),1)]))])),default:(0,n.withCtx)((()=>[e.$slots.reference?(0,n.renderSlot)(e.$slots,"reference",{key:0}):(0,n.createCommentVNode)("v-if",!0)])),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var nu=Ar(tu,[["__file","popover.vue"]]);const ru=(e,t)=>{const n=t.arg||t.value,r=null==n?void 0:n.popperRef;r&&(r.triggerRef=e)};var ou={mounted(e,t){ru(e,t)},updated(e,t){ru(e,t)}};const iu="popover",su=hr(ou,iu),au=dr(nu,{directive:su}),lu=e=>e,cu="update:modelValue",uu="change",du="input",pu=e=>yn(e)||an(e)||on(e),hu=Dn({accordion:Boolean,modelValue:{type:On([Array,String,Number]),default:()=>lu([])}}),fu={[cu]:pu,[uu]:pu},gu=Symbol("collapseContextKey");function mu(){if(!arguments.length)return[];var e=arguments[0];return d(e)?e:[e]}var vu=mu;const yu=(e,t)=>{const r=(0,n.ref)(vu(e.modelValue)),o=n=>{r.value=n;const o=e.accordion?r.value[0]:r.value;t(cu,o),t(uu,o)},i=t=>{if(e.accordion)o([r.value[0]===t?"":t]);else{const e=[...r.value],n=e.indexOf(t);n>-1?e.splice(n,1):e.push(t),o(e)}};return(0,n.watch)((()=>e.modelValue),(()=>r.value=vu(e.modelValue)),{deep:!0}),(0,n.provide)(gu,{activeNames:r,handleItemClick:i}),{activeNames:r,setActiveNames:o}},bu=()=>{const e=c("collapse"),t=(0,n.computed)((()=>e.b()));return{rootKls:t}},wu=(0,n.defineComponent)({name:"ElCollapse"}),Cu=(0,n.defineComponent)({...wu,props:hu,emits:fu,setup(e,{expose:t,emit:r}){const o=e,{activeNames:i,setActiveNames:s}=yu(o,r),{rootKls:a}=bu();return t({activeNames:i,setActiveNames:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(a))},[(0,n.renderSlot)(e.$slots,"default")],2))}});var Su=Ar(Cu,[["__file","collapse.vue"]]);const Eu=(0,n.defineComponent)({name:"ElCollapseTransition"}),Tu=(0,n.defineComponent)({...Eu,setup(e){const t=c("collapse-transition"),r=e=>{e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom},o={beforeEnter(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.style.height&&(e.dataset.elExistsHeight=e.style.height),e.style.maxHeight=0,e.style.paddingTop=0,e.style.paddingBottom=0},enter(e){requestAnimationFrame((()=>{e.dataset.oldOverflow=e.style.overflow,e.dataset.elExistsHeight?e.style.maxHeight=e.dataset.elExistsHeight:0!==e.scrollHeight?e.style.maxHeight=`${e.scrollHeight}px`:e.style.maxHeight=0,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom,e.style.overflow="hidden"}))},afterEnter(e){e.style.maxHeight="",e.style.overflow=e.dataset.oldOverflow},enterCancelled(e){r(e)},beforeLeave(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.maxHeight=`${e.scrollHeight}px`,e.style.overflow="hidden"},leave(e){0!==e.scrollHeight&&(e.style.maxHeight=0,e.style.paddingTop=0,e.style.paddingBottom=0)},afterLeave(e){r(e)},leaveCancelled(e){r(e)}};return(e,r)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,(0,n.mergeProps)({name:(0,n.unref)(t).b()},(0,n.toHandlers)(o)),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["name"]))}});var ku=Ar(Tu,[["__file","collapse-transition.vue"]]);ku.install=e=>{e.component(ku.name,ku)};const xu=ku,Nu=Dn({size:{type:On([Number,String])},color:{type:String}}),Ru=(0,n.defineComponent)({name:"ElIcon",inheritAttrs:!1}),Iu=(0,n.defineComponent)({...Ru,props:Nu,setup(e){const t=e,r=c("icon"),o=(0,n.computed)((()=>{const{size:e,color:n}=t;return e||n?{fontSize:mn(e)?void 0:Xc(e),"--color":n}:{}}));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("i",(0,n.mergeProps)({class:(0,n.unref)(r).b(),style:(0,n.unref)(o)},e.$attrs),[(0,n.renderSlot)(e.$slots,"default")],16))}});var _u=Ar(Iu,[["__file","icon.vue"]]);const Ou=dr(_u),Au=Dn({title:{type:String,default:""},name:{type:On([String,Number]),default:void 0},disabled:Boolean}),Bu=e=>{const t=(0,n.inject)(gu),{namespace:r}=c("collapse"),o=(0,n.ref)(!1),i=(0,n.ref)(!1),s=Ia(),a=(0,n.computed)((()=>s.current++)),l=(0,n.computed)((()=>{var t;return null!=(t=e.name)?t:`${r.value}-id-${s.prefix}-${(0,n.unref)(a)}`})),u=(0,n.computed)((()=>null==t?void 0:t.activeNames.value.includes((0,n.unref)(l)))),d=()=>{setTimeout((()=>{i.value?i.value=!1:o.value=!0}),50)},p=()=>{e.disabled||(null==t||t.handleItemClick((0,n.unref)(l)),o.value=!1,i.value=!0)},h=()=>{null==t||t.handleItemClick((0,n.unref)(l))};return{focusing:o,id:a,isActive:u,handleFocus:d,handleHeaderClick:p,handleEnterClick:h}},Du=(e,{focusing:t,isActive:r,id:o})=>{const i=c("collapse"),s=(0,n.computed)((()=>[i.b("item"),i.is("active",(0,n.unref)(r)),i.is("disabled",e.disabled)])),a=(0,n.computed)((()=>[i.be("item","header"),i.is("active",(0,n.unref)(r)),{focusing:(0,n.unref)(t)&&!e.disabled}])),l=(0,n.computed)((()=>[i.be("item","arrow"),i.is("active",(0,n.unref)(r))])),u=(0,n.computed)((()=>i.be("item","wrap"))),d=(0,n.computed)((()=>i.be("item","content"))),p=(0,n.computed)((()=>i.b(`content-${(0,n.unref)(o)}`))),h=(0,n.computed)((()=>i.b(`head-${(0,n.unref)(o)}`)));return{arrowKls:l,headKls:a,rootKls:s,itemWrapperKls:u,itemContentKls:d,scopedContentId:p,scopedHeadId:h}},Pu=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],Hu=["id","aria-hidden","aria-labelledby"],Mu=(0,n.defineComponent)({name:"ElCollapseItem"}),ju=(0,n.defineComponent)({...Mu,props:Au,setup(e,{expose:t}){const r=e,{focusing:o,id:i,isActive:s,handleFocus:a,handleHeaderClick:l,handleEnterClick:c}=Bu(r),{arrowKls:u,headKls:d,rootKls:p,itemWrapperKls:h,itemContentKls:f,scopedContentId:g,scopedHeadId:m}=Du(r,{focusing:o,isActive:s,id:i});return t({isActive:s}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(p))},[(0,n.createElementVNode)("button",{id:(0,n.unref)(m),class:(0,n.normalizeClass)((0,n.unref)(d)),"aria-expanded":(0,n.unref)(s),"aria-controls":(0,n.unref)(g),"aria-describedby":(0,n.unref)(g),tabindex:e.disabled?-1:0,type:"button",onClick:t[0]||(t[0]=(...e)=>(0,n.unref)(l)&&(0,n.unref)(l)(...e)),onKeydown:t[1]||(t[1]=(0,n.withKeys)((0,n.withModifiers)(((...e)=>(0,n.unref)(c)&&(0,n.unref)(c)(...e)),["stop","prevent"]),["space","enter"])),onFocus:t[2]||(t[2]=(...e)=>(0,n.unref)(a)&&(0,n.unref)(a)(...e)),onBlur:t[3]||(t[3]=e=>o.value=!1)},[(0,n.renderSlot)(e.$slots,"title",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.title),1)])),(0,n.createVNode)((0,n.unref)(Ou),{class:(0,n.normalizeClass)((0,n.unref)(u))},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(Gl))])),_:1},8,["class"])],42,Pu),(0,n.createVNode)((0,n.unref)(xu),null,{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{id:(0,n.unref)(g),role:"region",class:(0,n.normalizeClass)((0,n.unref)(h)),"aria-hidden":!(0,n.unref)(s),"aria-labelledby":(0,n.unref)(m)},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)((0,n.unref)(f))},[(0,n.renderSlot)(e.$slots,"default")],2)],10,Hu),[[n.vShow,(0,n.unref)(s)]])])),_:3})],2))}});var Vu=Ar(ju,[["__file","collapse-item.vue"]]);const Lu=dr(Su,{CollapseItem:Vu}),$u=fr(Vu);var qu=function(){return m.Date.now()},Fu=qu,Uu=/\s/;function zu(e){var t=e.length;while(t--&&Uu.test(e.charAt(t)));return t}var Ku=zu,Wu=/^\s+/;function Gu(e){return e?e.slice(0,Ku(e)+1).replace(Wu,""):e}var Yu=Gu,Ju=NaN,Zu=/^[-+]0x[0-9a-f]+$/i,Xu=/^0b[01]+$/i,Qu=/^0o[0-7]+$/i,ed=parseInt;function td(e){if("number"==typeof e)return e;if(j(e))return Ju;if(U(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=U(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yu(e);var n=Xu.test(e);return n||Qu.test(e)?ed(e.slice(2),n?2:8):Zu.test(e)?Ju:+e}var nd=td,rd="Expected a function",od=Math.max,id=Math.min;function sd(e,t,n){var r,o,i,s,a,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(rd);function h(t){var n=r,i=o;return r=o=void 0,c=t,s=e.apply(i,n),s}function f(e){return c=e,a=setTimeout(v,t),u?h(e):s}function g(e){var n=e-l,r=e-c,o=t-n;return d?id(o,i-r):o}function m(e){var n=e-l,r=e-c;return void 0===l||n>=t||n<0||d&&r>=i}function v(){var e=Fu();if(m(e))return y(e);a=setTimeout(v,g(e))}function y(e){return a=void 0,p&&r?h(e):(r=o=void 0,s)}function b(){void 0!==a&&clearTimeout(a),c=0,r=l=o=a=void 0}function w(){return void 0===a?s:y(Fu())}function C(){var e=Fu(),n=m(e);if(r=arguments,o=this,l=e,n){if(void 0===a)return f(l);if(d)return clearTimeout(a),a=setTimeout(v,t),h(l)}return void 0===a&&(a=setTimeout(v,t)),s}return t=nd(t)||0,U(n)&&(u=!!n.leading,d="maxWait"in n,i=d?od(nd(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),C.cancel=b,C.flush=w,C}var ad=sd;const ld=4,cd={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},ud=({move:e,size:t,bar:n})=>({[n.size]:t,transform:`translate${n.axis}(${e}%)`}),dd=Symbol("scrollbarContextKey"),pd=Dn({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),hd="Thumb",fd=(0,n.defineComponent)({__name:"thumb",props:pd,setup(e){const t=e,r=(0,n.inject)(dd),o=c("scrollbar");r||xn(hd,"can not inject scrollbar context");const i=(0,n.ref)(),s=(0,n.ref)(),a=(0,n.ref)({}),l=(0,n.ref)(!1);let u=!1,d=!1,p=Yr?document.onselectstart:null;const h=(0,n.computed)((()=>cd[t.vertical?"vertical":"horizontal"])),f=(0,n.computed)((()=>ud({size:t.size,move:t.move,bar:h.value}))),g=(0,n.computed)((()=>i.value[h.value.offset]**2/r.wrapElement[h.value.scrollSize]/t.ratio/s.value[h.value.offset])),m=e=>{var t;if(e.stopPropagation(),e.ctrlKey||[1,2].includes(e.button))return;null==(t=window.getSelection())||t.removeAllRanges(),y(e);const n=e.currentTarget;n&&(a.value[h.value.axis]=n[h.value.offset]-(e[h.value.client]-n.getBoundingClientRect()[h.value.direction]))},v=e=>{if(!s.value||!i.value||!r.wrapElement)return;const t=Math.abs(e.target.getBoundingClientRect()[h.value.direction]-e[h.value.client]),n=s.value[h.value.offset]/2,o=100*(t-n)*g.value/i.value[h.value.offset];r.wrapElement[h.value.scroll]=o*r.wrapElement[h.value.scrollSize]/100},y=e=>{e.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",b),document.addEventListener("mouseup",w),p=document.onselectstart,document.onselectstart=()=>!1},b=e=>{if(!i.value||!s.value)return;if(!1===u)return;const t=a.value[h.value.axis];if(!t)return;const n=-1*(i.value.getBoundingClientRect()[h.value.direction]-e[h.value.client]),o=s.value[h.value.offset]-t,l=100*(n-o)*g.value/i.value[h.value.offset];r.wrapElement[h.value.scroll]=l*r.wrapElement[h.value.scrollSize]/100},w=()=>{u=!1,a.value[h.value.axis]=0,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",w),E(),d&&(l.value=!1)},C=()=>{d=!1,l.value=!!t.size},S=()=>{d=!0,l.value=u};(0,n.onBeforeUnmount)((()=>{E(),document.removeEventListener("mouseup",w)}));const E=()=>{document.onselectstart!==p&&(document.onselectstart=p)};return qs((0,n.toRef)(r,"scrollbarElement"),"mousemove",C),qs((0,n.toRef)(r,"scrollbarElement"),"mouseleave",S),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{name:(0,n.unref)(o).b("fade"),persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{ref_key:"instance",ref:i,class:(0,n.normalizeClass)([(0,n.unref)(o).e("bar"),(0,n.unref)(o).is((0,n.unref)(h).key)]),onMousedown:v},[(0,n.createElementVNode)("div",{ref_key:"thumb",ref:s,class:(0,n.normalizeClass)((0,n.unref)(o).e("thumb")),style:(0,n.normalizeStyle)((0,n.unref)(f)),onMousedown:m},null,38)],34),[[n.vShow,e.always||l.value]])])),_:1},8,["name"]))}});var gd=Ar(fd,[["__file","thumb.vue"]]);const md=Dn({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),vd=(0,n.defineComponent)({__name:"bar",props:md,setup(e,{expose:t}){const r=e,o=(0,n.inject)(dd),i=(0,n.ref)(0),s=(0,n.ref)(0),a=(0,n.ref)(""),l=(0,n.ref)(""),c=(0,n.ref)(1),u=(0,n.ref)(1),d=e=>{if(e){const t=e.offsetHeight-ld,n=e.offsetWidth-ld;s.value=100*e.scrollTop/t*c.value,i.value=100*e.scrollLeft/n*u.value}},p=()=>{const e=null==o?void 0:o.wrapElement;if(!e)return;const t=e.offsetHeight-ld,n=e.offsetWidth-ld,i=t**2/e.scrollHeight,s=n**2/e.scrollWidth,d=Math.max(i,r.minSize),p=Math.max(s,r.minSize);c.value=i/(t-i)/(d/(t-d)),u.value=s/(n-s)/(p/(n-p)),l.value=d+ld<t?`${d}px`:"",a.value=p+ld<n?`${p}px`:""};return t({handleScroll:d,update:p}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[(0,n.createVNode)(gd,{move:i.value,ratio:u.value,size:a.value,always:e.always},null,8,["move","ratio","size","always"]),(0,n.createVNode)(gd,{move:s.value,ratio:c.value,size:l.value,vertical:"",always:e.always},null,8,["move","ratio","size","always"])],64))}});var yd=Ar(vd,[["__file","bar.vue"]]);const bd=Dn({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:On([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},id:String,role:String,ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical"]}}),wd={scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(yn)},Cd="ElScrollbar",Sd=(0,n.defineComponent)({name:Cd}),Ed=(0,n.defineComponent)({...Sd,props:bd,emits:wd,setup(e,{expose:t,emit:r}){const o=e,i=c("scrollbar");let s,a;const l=(0,n.ref)(),u=(0,n.ref)(),d=(0,n.ref)(),p=(0,n.ref)(),h=(0,n.computed)((()=>{const e={};return o.height&&(e.height=Xc(o.height)),o.maxHeight&&(e.maxHeight=Xc(o.maxHeight)),[o.wrapStyle,e]})),f=(0,n.computed)((()=>[o.wrapClass,i.e("wrap"),{[i.em("wrap","hidden-default")]:!o.native}])),g=(0,n.computed)((()=>[i.e("view"),o.viewClass])),m=()=>{var e;u.value&&(null==(e=p.value)||e.handleScroll(u.value),r("scroll",{scrollTop:u.value.scrollTop,scrollLeft:u.value.scrollLeft}))};function v(e,t){ln(e)?u.value.scrollTo(e):yn(e)&&yn(t)&&u.value.scrollTo(e,t)}const y=e=>{yn(e)?u.value.scrollTop=e:Nn(Cd,"value must be a number")},b=e=>{yn(e)?u.value.scrollLeft=e:Nn(Cd,"value must be a number")},w=()=>{var e;null==(e=p.value)||e.update()};return(0,n.watch)((()=>o.noresize),(e=>{e?(null==s||s(),null==a||a()):(({stop:s}=Qs(d,w)),a=qs("resize",w))}),{immediate:!0}),(0,n.watch)((()=>[o.maxHeight,o.height]),(()=>{o.native||(0,n.nextTick)((()=>{var e;w(),u.value&&(null==(e=p.value)||e.handleScroll(u.value))}))})),(0,n.provide)(dd,(0,n.reactive)({scrollbarElement:l,wrapElement:u})),(0,n.onMounted)((()=>{o.native||(0,n.nextTick)((()=>{w()}))})),(0,n.onUpdated)((()=>w())),t({wrapRef:u,update:w,scrollTo:v,setScrollTop:y,setScrollLeft:b,handleScroll:m}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"scrollbarRef",ref:l,class:(0,n.normalizeClass)((0,n.unref)(i).b())},[(0,n.createElementVNode)("div",{ref_key:"wrapRef",ref:u,class:(0,n.normalizeClass)((0,n.unref)(f)),style:(0,n.normalizeStyle)((0,n.unref)(h)),onScroll:m},[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),{id:e.id,ref_key:"resizeRef",ref:d,class:(0,n.normalizeClass)((0,n.unref)(g)),style:(0,n.normalizeStyle)(e.viewStyle),role:e.role,"aria-label":e.ariaLabel,"aria-orientation":e.ariaOrientation},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],38),e.native?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createBlock)(yd,{key:0,ref_key:"barRef",ref:p,always:e.always,"min-size":e.minSize},null,8,["always","min-size"]))],2))}});var Td=Ar(Ed,[["__file","scrollbar.vue"]]);const kd=dr(Td);function xd(e,t){var n=-1,r=t.length,o=e.length;while(++n<r)e[o+n]=t[n];return e}var Nd=xd,Rd="[object Arguments]";function Id(e){return P(e)&&B(e)==Rd}var _d=Id,Od=Object.prototype,Ad=Od.hasOwnProperty,Bd=Od.propertyIsEnumerable,Dd=_d(function(){return arguments}())?_d:function(e){return P(e)&&Ad.call(e,"callee")&&!Bd.call(e,"callee")},Pd=Dd,Hd=y?y.isConcatSpreadable:void 0;function Md(e){return d(e)||Pd(e)||!!(Hd&&e&&e[Hd])}var jd=Md;function Vd(e,t,n,r,o){var i=-1,s=e.length;n||(n=jd),o||(o=[]);while(++i<s){var a=e[i];t>0&&n(a)?t>1?Vd(a,t-1,n,r,o):Nd(o,a):r||(o[o.length]=a)}return o}var Ld=Vd;function $d(){this.__data__=new nt,this.size=0}var qd=$d;function Fd(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}var Ud=Fd;function zd(e){return this.__data__.get(e)}var Kd=zd;function Wd(e){return this.__data__.has(e)}var Gd=Wd,Yd=200;function Jd(e,t){var n=this.__data__;if(n instanceof nt){var r=n.__data__;if(!ot||r.length<Yd-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new wt(r)}return n.set(e,t),this.size=n.size,this}var Zd=Jd;function Xd(e){var t=this.__data__=new nt(e);this.size=t.size}Xd.prototype.clear=qd,Xd.prototype["delete"]=Ud,Xd.prototype.get=Kd,Xd.prototype.has=Gd,Xd.prototype.set=Zd;var Qd=Xd,ep="__lodash_hash_undefined__";function tp(e){return this.__data__.set(e,ep),this}var np=tp;function rp(e){return this.__data__.has(e)}var op=rp;function ip(e){var t=-1,n=null==e?0:e.length;this.__data__=new wt;while(++t<n)this.add(e[t])}ip.prototype.add=ip.prototype.push=np,ip.prototype.has=op;var sp=ip;function ap(e,t){var n=-1,r=null==e?0:e.length;while(++n<r)if(t(e[n],n,e))return!0;return!1}var lp=ap;function cp(e,t){return e.has(t)}var up=cp,dp=1,pp=2;function hp(e,t,n,r,o,i){var s=n&dp,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=n&pp?new sp:void 0;i.set(e,t),i.set(t,e);while(++d<a){var f=e[d],g=t[d];if(r)var m=s?r(g,f,d,t,e,i):r(f,g,d,e,t,i);if(void 0!==m){if(m)continue;p=!1;break}if(h){if(!lp(t,(function(e,t){if(!up(h,t)&&(f===e||o(f,e,n,r,i)))return h.push(t)}))){p=!1;break}}else if(f!==g&&!o(f,g,n,r,i)){p=!1;break}}return i["delete"](e),i["delete"](t),p}var fp=hp,gp=m.Uint8Array,mp=gp;function vp(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}var yp=vp;function bp(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var wp=bp,Cp=1,Sp=2,Ep="[object Boolean]",Tp="[object Date]",kp="[object Error]",xp="[object Map]",Np="[object Number]",Rp="[object RegExp]",Ip="[object Set]",_p="[object String]",Op="[object Symbol]",Ap="[object ArrayBuffer]",Bp="[object DataView]",Dp=y?y.prototype:void 0,Pp=Dp?Dp.valueOf:void 0;function Hp(e,t,n,r,o,i,s){switch(n){case Bp:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Ap:return!(e.byteLength!=t.byteLength||!i(new mp(e),new mp(t)));case Ep:case Tp:case Np:return qe(+e,+t);case kp:return e.name==t.name&&e.message==t.message;case Rp:case _p:return e==t+"";case xp:var a=yp;case Ip:var l=r&Cp;if(a||(a=wp),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=Sp,s.set(e,t);var u=fp(a(e),a(t),r,o,i,s);return s["delete"](e),u;case Op:if(Pp)return Pp.call(e)==Pp.call(t)}return!1}var Mp=Hp;function jp(e,t,n){var r=t(e);return d(e)?r:Nd(r,n(e))}var Vp=jp;function Lp(e,t){var n=-1,r=null==e?0:e.length,o=0,i=[];while(++n<r){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}var $p=Lp;function qp(){return[]}var Fp=qp,Up=Object.prototype,zp=Up.propertyIsEnumerable,Kp=Object.getOwnPropertySymbols,Wp=Kp?function(e){return null==e?[]:(e=Object(e),$p(Kp(e),(function(t){return zp.call(e,t)})))}:Fp,Gp=Wp;function Yp(e,t){var n=-1,r=Array(e);while(++n<e)r[n]=t(n);return r}var Jp=Yp;function Zp(){return!1}var Xp=Zp,Qp="object"==typeof exports&&exports&&!exports.nodeType&&exports,eh=Qp&&"object"==typeof module&&module&&!module.nodeType&&module,th=eh&&eh.exports===Qp,nh=th?m.Buffer:void 0,rh=nh?nh.isBuffer:void 0,oh=rh||Xp,ih=oh,sh=9007199254740991;function ah(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=sh}var lh=ah,ch="[object Arguments]",uh="[object Array]",dh="[object Boolean]",ph="[object Date]",hh="[object Error]",fh="[object Function]",gh="[object Map]",mh="[object Number]",vh="[object Object]",yh="[object RegExp]",bh="[object Set]",wh="[object String]",Ch="[object WeakMap]",Sh="[object ArrayBuffer]",Eh="[object DataView]",Th="[object Float32Array]",kh="[object Float64Array]",xh="[object Int8Array]",Nh="[object Int16Array]",Rh="[object Int32Array]",Ih="[object Uint8Array]",_h="[object Uint8ClampedArray]",Oh="[object Uint16Array]",Ah="[object Uint32Array]",Bh={};function Dh(e){return P(e)&&lh(e.length)&&!!Bh[B(e)]}Bh[Th]=Bh[kh]=Bh[xh]=Bh[Nh]=Bh[Rh]=Bh[Ih]=Bh[_h]=Bh[Oh]=Bh[Ah]=!0,Bh[ch]=Bh[uh]=Bh[Sh]=Bh[dh]=Bh[Eh]=Bh[ph]=Bh[hh]=Bh[fh]=Bh[gh]=Bh[mh]=Bh[vh]=Bh[yh]=Bh[bh]=Bh[wh]=Bh[Ch]=!1;var Ph=Dh;function Hh(e){return function(t){return e(t)}}var Mh=Hh,jh="object"==typeof exports&&exports&&!exports.nodeType&&exports,Vh=jh&&"object"==typeof module&&module&&!module.nodeType&&module,Lh=Vh&&Vh.exports===jh,$h=Lh&&h.process,qh=function(){try{var e=Vh&&Vh.require&&Vh.require("util").types;return e||$h&&$h.binding&&$h.binding("util")}catch(t){}}(),Fh=qh,Uh=Fh&&Fh.isTypedArray,zh=Uh?Mh(Uh):Ph,Kh=zh,Wh=Object.prototype,Gh=Wh.hasOwnProperty;function Yh(e,t){var n=d(e),r=!n&&Pd(e),o=!n&&!r&&ih(e),i=!n&&!r&&!o&&Kh(e),s=n||r||o||i,a=s?Jp(e.length,String):[],l=a.length;for(var c in e)!t&&!Gh.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Jn(c,l))||a.push(c);return a}var Jh=Yh,Zh=Object.prototype;function Xh(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||Zh;return e===n}var Qh=Xh;function ef(e,t){return function(n){return e(t(n))}}var tf=ef,nf=tf(Object.keys,Object),rf=nf,of=Object.prototype,sf=of.hasOwnProperty;function af(e){if(!Qh(e))return rf(e);var t=[];for(var n in Object(e))sf.call(e,n)&&"constructor"!=n&&t.push(n);return t}var lf=af;function cf(e){return null!=e&&lh(e.length)&&!J(e)}var uf=cf;function df(e){return uf(e)?Jh(e):lf(e)}var pf=df;function hf(e){return Vp(e,pf,Gp)}var ff=hf,gf=1,mf=Object.prototype,vf=mf.hasOwnProperty;function yf(e,t,n,r,o,i){var s=n&gf,a=ff(e),l=a.length,c=ff(t),u=c.length;if(l!=u&&!s)return!1;var d=l;while(d--){var p=a[d];if(!(s?p in t:vf.call(t,p)))return!1}var h=i.get(e),f=i.get(t);if(h&&f)return h==t&&f==e;var g=!0;i.set(e,t),i.set(t,e);var m=s;while(++d<l){p=a[d];var v=e[p],y=t[p];if(r)var b=s?r(y,v,p,t,e,i):r(v,y,p,e,t,i);if(!(void 0===b?v===y||o(v,y,n,r,i):b)){g=!1;break}m||(m="constructor"==p)}if(g&&!m){var w=e.constructor,C=t.constructor;w==C||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof C&&C instanceof C||(g=!1)}return i["delete"](e),i["delete"](t),g}var bf=yf,wf=ye(m,"DataView"),Cf=wf,Sf=ye(m,"Promise"),Ef=Sf,Tf=ye(m,"Set"),kf=Tf,xf=ye(m,"WeakMap"),Nf=xf,Rf="[object Map]",If="[object Object]",_f="[object Promise]",Of="[object Set]",Af="[object WeakMap]",Bf="[object DataView]",Df=ie(Cf),Pf=ie(ot),Hf=ie(Ef),Mf=ie(kf),jf=ie(Nf),Vf=B;(Cf&&Vf(new Cf(new ArrayBuffer(1)))!=Bf||ot&&Vf(new ot)!=Rf||Ef&&Vf(Ef.resolve())!=_f||kf&&Vf(new kf)!=Of||Nf&&Vf(new Nf)!=Af)&&(Vf=function(e){var t=B(e),n=t==If?e.constructor:void 0,r=n?ie(n):"";if(r)switch(r){case Df:return Bf;case Pf:return Rf;case Hf:return _f;case Mf:return Of;case jf:return Af}return t});var Lf=Vf,$f=1,qf="[object Arguments]",Ff="[object Array]",Uf="[object Object]",zf=Object.prototype,Kf=zf.hasOwnProperty;function Wf(e,t,n,r,o,i){var s=d(e),a=d(t),l=s?Ff:Lf(e),c=a?Ff:Lf(t);l=l==qf?Uf:l,c=c==qf?Uf:c;var u=l==Uf,p=c==Uf,h=l==c;if(h&&ih(e)){if(!ih(t))return!1;s=!0,u=!1}if(h&&!u)return i||(i=new Qd),s||Kh(e)?fp(e,t,n,r,o,i):Mp(e,t,l,n,r,o,i);if(!(n&$f)){var f=u&&Kf.call(e,"__wrapped__"),g=p&&Kf.call(t,"__wrapped__");if(f||g){var m=f?e.value():e,v=g?t.value():t;return i||(i=new Qd),o(m,v,n,r,i)}}return!!h&&(i||(i=new Qd),bf(e,t,n,r,o,i))}var Gf=Wf;function Yf(e,t,n,r,o){return e===t||(null==e||null==t||!P(e)&&!P(t)?e!==e&&t!==t:Gf(e,t,n,r,Yf,o))}var Jf=Yf,Zf=1,Xf=2;function Qf(e,t,n,r){var o=n.length,i=o,s=!r;if(null==e)return!i;e=Object(e);while(o--){var a=n[o];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}while(++o<i){a=n[o];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(void 0===c&&!(l in e))return!1}else{var d=new Qd;if(r)var p=r(c,u,l,e,t,d);if(!(void 0===p?Jf(u,c,Zf|Xf,r,d):p))return!1}}return!0}var eg=Qf;function tg(e){return e===e&&!U(e)}var ng=tg;function rg(e){var t=pf(e),n=t.length;while(n--){var r=t[n],o=e[r];t[n]=[r,o,ng(o)]}return t}var og=rg;function ig(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}var sg=ig;function ag(e){var t=og(e);return 1==t.length&&t[0][2]?sg(t[0][0],t[0][1]):function(n){return n===e||eg(n,e,t)}}var lg=ag;function cg(e,t){return null!=e&&t in Object(e)}var ug=cg;function dg(e,t,n){t=$t(t,e);var r=-1,o=t.length,i=!1;while(++r<o){var s=Ut(t[r]);if(!(i=null!=e&&n(e,s)))break;e=e[s]}return i||++r!=o?i:(o=null==e?0:e.length,!!o&&lh(o)&&Jn(s,o)&&(d(e)||Pd(e)))}var pg=dg;function hg(e,t){return null!=e&&pg(e,t,ug)}var fg=hg,gg=1,mg=2;function vg(e,t){return q(e)&&ng(t)?sg(Ut(e),t):function(n){var r=Gt(n,e);return void 0===r&&r===t?fg(n,e):Jf(t,r,gg|mg)}}var yg=vg;function bg(e){return e}var wg=bg;function Cg(e){return function(t){return null==t?void 0:t[e]}}var Sg=Cg;function Eg(e){return function(t){return Kt(t,e)}}var Tg=Eg;function kg(e){return q(e)?Sg(Ut(e)):Tg(e)}var xg=kg;function Ng(e){return"function"==typeof e?e:null==e?wg:"object"==typeof e?d(e)?yg(e[0],e[1]):lg(e):xg(e)}var Rg=Ng;function Ig(e){return function(t,n,r){var o=-1,i=Object(t),s=r(t),a=s.length;while(a--){var l=s[e?a:++o];if(!1===n(i[l],l,i))break}return t}}var _g=Ig,Og=_g(),Ag=Og;function Bg(e,t){return e&&Ag(e,t,pf)}var Dg=Bg;function Pg(e,t){return function(n,r){if(null==n)return n;if(!uf(n))return e(n,r);var o=n.length,i=t?o:-1,s=Object(n);while(t?i--:++i<o)if(!1===r(s[i],i,s))break;return n}}var Hg=Pg,Mg=Hg(Dg),jg=Mg;function Vg(e,t){var n=-1,r=uf(e)?Array(e.length):[];return jg(e,(function(e,o,i){r[++n]=t(e,o,i)})),r}var Lg=Vg;function $g(e,t){var n=d(e)?At:Lg;return n(e,Rg(t,3))}var qg=$g;function Fg(e,t){return Ld(qg(e,t),1)}var Ug=Fg;const zg=function(e){var t;return null==(t=e.target)?void 0:t.closest("td")},Kg=function(e,t,n,r,o){if(!t&&!r&&(!o||Array.isArray(o)&&!o.length))return e;n="string"===typeof n?"descending"===n?-1:1:n&&n<0?-1:1;const i=r?null:function(n,r){return o?(Array.isArray(o)||(o=[o]),o.map((t=>"string"===typeof t?Gt(n,t):t(n,r,e)))):("$key"!==t&&ln(n)&&"$value"in n&&(n=n.$value),[ln(n)?Gt(n,t):n])},s=function(e,t){if(r)return r(e.value,t.value);for(let n=0,r=e.key.length;n<r;n++){if(e.key[n]<t.key[n])return-1;if(e.key[n]>t.key[n])return 1}return 0};return e.map(((e,t)=>({value:e,index:t,key:i?i(e,t):null}))).sort(((e,t)=>{let r=s(e,t);return r||(r=e.index-t.index),r*+n})).map((e=>e.value))},Wg=function(e,t){let n=null;return e.columns.forEach((e=>{e.id===t&&(n=e)})),n},Gg=function(e,t){let n=null;for(let r=0;r<e.columns.length;r++){const o=e.columns[r];if(o.columnKey===t){n=o;break}}return n||xn("ElTable",`No column matching with column-key: ${t}`),n},Yg=function(e,t,n){const r=(t.className||"").match(new RegExp(`${n}-table_[^\\s]+`,"gm"));return r?Wg(e,r[0]):null},Jg=(e,t)=>{if(!e)throw new Error("Row is required when get row identity");if("string"===typeof t){if(!t.includes("."))return`${e[t]}`;const n=t.split(".");let r=e;for(const e of n)r=r[e];return`${r}`}if("function"===typeof t)return t.call(null,e)},Zg=function(e,t){const n={};return(e||[]).forEach(((e,r)=>{n[Jg(e,t)]={row:e,index:r}})),n};function Xg(e,t){const n={};let r;for(r in e)n[r]=e[r];for(r in t)if(rn(t,r)){const e=t[r];"undefined"!==typeof e&&(n[r]=e)}return n}function Qg(e){return""===e||void 0!==e&&(e=Number.parseInt(e,10),Number.isNaN(e)&&(e="")),e}function em(e){return""===e||void 0!==e&&(e=Qg(e),Number.isNaN(e)&&(e=80)),e}function tm(e){return"number"===typeof e?e:"string"===typeof e?/^\d+(?:px)?$/.test(e)?Number.parseInt(e,10):e:null}function nm(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function rm(e,t,n){let r=!1;const o=e.indexOf(t),i=-1!==o,s=s=>{"add"===s?e.push(t):e.splice(o,1),r=!0,on(t.children)&&t.children.forEach((t=>{rm(e,t,null!=n?n:!i)}))};return vn(n)?n&&!i?s("add"):!n&&i&&s("remove"):s(i?"remove":"add"),r}function om(e,t,n="children",r="hasChildren"){const o=e=>!(Array.isArray(e)&&e.length);function i(e,s,a){t(e,s,a),s.forEach((e=>{if(e[r])return void t(e,null,a+1);const s=e[n];o(s)||i(e,s,a+1)}))}e.forEach((e=>{if(e[r])return void t(e,null,0);const s=e[n];o(s)||i(e,s,0)}))}let im=null;function sm(e,t,r,o){if((null==im?void 0:im.trigger)===r)return;null==im||im();const i=null==o?void 0:o.refs.tableWrapper,s=null==i?void 0:i.dataset.prefix,a={strategy:"fixed",...e.popperOptions},l=(0,n.createVNode)(ql,{content:t,virtualTriggering:!0,virtualRef:r,appendTo:i,placement:"top",transition:"none",offset:0,hideAfter:0,...e,popperOptions:a,onHide:()=>{null==im||im()}});l.appContext={...o.appContext,...o};const c=document.createElement("div");(0,n.render)(l,c),l.component.exposed.onOpen();const u=null==i?void 0:i.querySelector(`.${s}-scrollbar__wrap`);im=()=>{(0,n.render)(null,c),null==u||u.removeEventListener("scroll",im),im=null},im.trigger=r,null==u||u.addEventListener("scroll",im)}function am(e){return e.children?Ug(e.children,am):[e]}function lm(e,t){return e+t.colSpan}const cm=(e,t,n,r)=>{let o=0,i=e;const s=n.states.columns.value;if(r){const t=am(r[e]),n=s.slice(0,s.indexOf(t[0]));o=n.reduce(lm,0),i=o+t.reduce(lm,0)-1}else o=e;let a;switch(t){case"left":i<n.states.fixedLeafColumnsLength.value&&(a="left");break;case"right":o>=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right");break;default:i<n.states.fixedLeafColumnsLength.value?a="left":o>=s.length-n.states.rightFixedLeafColumnsLength.value&&(a="right")}return a?{direction:a,start:o,after:i}:{}},um=(e,t,n,r,o,i=0)=>{const s=[],{direction:a,start:l,after:c}=cm(t,n,r,o);if(a){const t="left"===a;s.push(`${e}-fixed-column--${a}`),t&&c+i===r.states.fixedLeafColumnsLength.value-1?s.push("is-last-column"):t||l-i!==r.states.columns.value.length-r.states.rightFixedLeafColumnsLength.value||s.push("is-first-column")}return s};function dm(e,t){return e+(null===t.realWidth||Number.isNaN(t.realWidth)?Number(t.width):t.realWidth)}const pm=(e,t,n,r)=>{const{direction:o,start:i=0,after:s=0}=cm(e,t,n,r);if(!o)return;const a={},l="left"===o,c=n.states.columns.value;return l?a.left=c.slice(0,i).reduce(dm,0):a.right=c.slice(s+1).reverse().reduce(dm,0),a},hm=(e,t)=>{e&&(Number.isNaN(e[t])||(e[t]=`${e[t]}px`))};function fm(e){const t=(0,n.getCurrentInstance)(),r=(0,n.ref)(!1),o=(0,n.ref)([]),i=()=>{const t=e.data.value||[],n=e.rowKey.value;if(r.value)o.value=t.slice();else if(n){const e=Zg(o.value,n);o.value=t.reduce(((t,r)=>{const o=Jg(r,n),i=e[o];return i&&t.push(r),t}),[])}else o.value=[]},s=(e,n)=>{const r=rm(o.value,e,n);r&&t.emit("expand-change",e,o.value.slice())},a=n=>{t.store.assertRowKey();const r=e.data.value||[],i=e.rowKey.value,s=Zg(r,i);o.value=n.reduce(((e,t)=>{const n=s[t];return n&&e.push(n.row),e}),[])},l=t=>{const n=e.rowKey.value;if(n){const e=Zg(o.value,n);return!!e[Jg(t,n)]}return o.value.includes(t)};return{updateExpandRows:i,toggleRowExpansion:s,setExpandRowKeys:a,isRowExpanded:l,states:{expandRows:o,defaultExpandAll:r}}}function gm(e){const t=(0,n.getCurrentInstance)(),r=(0,n.ref)(null),o=(0,n.ref)(null),i=e=>{t.store.assertRowKey(),r.value=e,a(e)},s=()=>{r.value=null},a=r=>{const{data:i,rowKey:s}=e;let a=null;s.value&&(a=((0,n.unref)(i)||[]).find((e=>Jg(e,s.value)===r))),o.value=a,t.emit("current-change",o.value,null)},l=e=>{const n=o.value;if(e&&e!==n)return o.value=e,void t.emit("current-change",o.value,n);!e&&n&&(o.value=null,t.emit("current-change",null,n))},c=()=>{const n=e.rowKey.value,i=e.data.value||[],l=o.value;if(!i.includes(l)&&l){if(n){const e=Jg(l,n);a(e)}else o.value=null;null===o.value&&t.emit("current-change",null,l)}else r.value&&(a(r.value),s())};return{setCurrentRowKey:i,restoreCurrentRowKey:s,setCurrentRowByKey:a,updateCurrentRow:l,updateCurrentRowData:c,states:{_currentRowKey:r,currentRow:o}}}function mm(e){const t=(0,n.ref)([]),r=(0,n.ref)({}),o=(0,n.ref)(16),i=(0,n.ref)(!1),s=(0,n.ref)({}),a=(0,n.ref)("hasChildren"),l=(0,n.ref)("children"),c=(0,n.getCurrentInstance)(),u=(0,n.computed)((()=>{if(!e.rowKey.value)return{};const t=e.data.value||[];return p(t)})),d=(0,n.computed)((()=>{const t=e.rowKey.value,n=Object.keys(s.value),r={};return n.length?(n.forEach((e=>{if(s.value[e].length){const n={children:[]};s.value[e].forEach((e=>{const o=Jg(e,t);n.children.push(o),e[a.value]&&!r[o]&&(r[o]={children:[]})})),r[e]=n}})),r):r})),p=t=>{const n=e.rowKey.value,r={};return om(t,((e,t,o)=>{const s=Jg(e,n);Array.isArray(t)?r[s]={children:t.map((e=>Jg(e,n))),level:o}:i.value&&(r[s]={children:[],lazy:!0,level:o})}),l.value,a.value),r},h=(e=!1,o=(e=>null==(e=c.store)?void 0:e.states.defaultExpandAll.value)())=>{var s;const a=u.value,l=d.value,p=Object.keys(a),h={};if(p.length){const s=(0,n.unref)(r),c=[],u=(n,r)=>{if(e)return t.value?o||t.value.includes(r):!(!o&&!(null==n?void 0:n.expanded));{const e=o||t.value&&t.value.includes(r);return!(!(null==n?void 0:n.expanded)&&!e)}};p.forEach((e=>{const t=s[e],n={...a[e]};if(n.expanded=u(t,e),n.lazy){const{loaded:r=!1,loading:o=!1}=t||{};n.loaded=!!r,n.loading=!!o,c.push(e)}h[e]=n}));const d=Object.keys(l);i.value&&d.length&&c.length&&d.forEach((e=>{const t=s[e],n=l[e].children;if(c.includes(e)){if(0!==h[e].children.length)throw new Error("[ElTable]children must be an empty array.");h[e].children=n}else{const{loaded:r=!1,loading:o=!1}=t||{};h[e]={lazy:!0,loaded:!!r,loading:!!o,expanded:u(t,e),children:n,level:""}}}))}r.value=h,null==(s=c.store)||s.updateTableScrollY()};(0,n.watch)((()=>t.value),(()=>{h(!0)})),(0,n.watch)((()=>u.value),(()=>{h()})),(0,n.watch)((()=>d.value),(()=>{h()}));const f=e=>{t.value=e,h()},g=(t,n)=>{c.store.assertRowKey();const o=e.rowKey.value,i=Jg(t,o),s=i&&r.value[i];if(i&&s&&"expanded"in s){const e=s.expanded;n="undefined"===typeof n?!s.expanded:n,r.value[i].expanded=n,e!==n&&c.emit("expand-change",t,n),c.store.updateTableScrollY()}},m=t=>{c.store.assertRowKey();const n=e.rowKey.value,o=Jg(t,n),s=r.value[o];i.value&&s&&"loaded"in s&&!s.loaded?v(t,o,s):g(t,void 0)},v=(e,t,n)=>{const{load:o}=c.props;o&&!r.value[t].loaded&&(r.value[t].loading=!0,o(e,n,(n=>{if(!Array.isArray(n))throw new TypeError("[ElTable] data must be an array");r.value[t].loading=!1,r.value[t].loaded=!0,r.value[t].expanded=!0,n.length&&(s.value[t]=n),c.emit("expand-change",e,!0)})))};return{loadData:v,loadOrToggle:m,toggleTreeExpansion:g,updateTreeExpandKeys:f,updateTreeData:h,normalize:p,states:{expandRowKeys:t,treeData:r,indent:o,lazy:i,lazyTreeNodeMap:s,lazyColumnIdentifier:a,childrenColumnName:l}}}const vm=(e,t)=>{const n=t.sortingColumn;return n&&"string"!==typeof n.sortable?Kg(e,t.sortProp,t.sortOrder,n.sortMethod,n.sortBy):e},ym=e=>{const t=[];return e.forEach((e=>{e.children&&e.children.length>0?t.push.apply(t,ym(e.children)):t.push(e)})),t};function bm(){var e;const t=(0,n.getCurrentInstance)(),{size:r}=(0,n.toRefs)(null==(e=t.proxy)?void 0:e.$props),o=(0,n.ref)(null),i=(0,n.ref)([]),s=(0,n.ref)([]),a=(0,n.ref)(!1),l=(0,n.ref)([]),c=(0,n.ref)([]),u=(0,n.ref)([]),d=(0,n.ref)([]),p=(0,n.ref)([]),h=(0,n.ref)([]),f=(0,n.ref)([]),g=(0,n.ref)([]),m=[],v=(0,n.ref)(0),y=(0,n.ref)(0),b=(0,n.ref)(0),w=(0,n.ref)(!1),C=(0,n.ref)([]),S=(0,n.ref)(!1),E=(0,n.ref)(!1),T=(0,n.ref)(null),k=(0,n.ref)({}),x=(0,n.ref)(null),N=(0,n.ref)(null),R=(0,n.ref)(null),I=(0,n.ref)(null),_=(0,n.ref)(null);(0,n.watch)(i,(()=>t.state&&D(!1)),{deep:!0});const O=()=>{if(!o.value)throw new Error("[ElTable] prop row-key is required")},A=e=>{var t;null==(t=e.children)||t.forEach((t=>{t.fixed=e.fixed,A(t)}))},B=()=>{l.value.forEach((e=>{A(e)})),d.value=l.value.filter((e=>!0===e.fixed||"left"===e.fixed)),p.value=l.value.filter((e=>"right"===e.fixed)),d.value.length>0&&l.value[0]&&"selection"===l.value[0].type&&!l.value[0].fixed&&(l.value[0].fixed=!0,d.value.unshift(l.value[0]));const e=l.value.filter((e=>!e.fixed));c.value=[].concat(d.value).concat(e).concat(p.value);const t=ym(e),n=ym(d.value),r=ym(p.value);v.value=t.length,y.value=n.length,b.value=r.length,u.value=[].concat(n).concat(t).concat(r),a.value=d.value.length>0||p.value.length>0},D=(e,n=!1)=>{e&&B(),n?t.state.doLayout():t.state.debouncedUpdateLayout()},P=e=>C.value.includes(e),H=()=>{w.value=!1;const e=C.value;e.length&&(C.value=[],t.emit("selection-change",[]))},M=()=>{let e;if(o.value){e=[];const t=Zg(C.value,o.value),n=Zg(i.value,o.value);for(const r in t)rn(t,r)&&!n[r]&&e.push(t[r].row)}else e=C.value.filter((e=>!i.value.includes(e)));if(e.length){const n=C.value.filter((t=>!e.includes(t)));C.value=n,t.emit("selection-change",n.slice())}},j=()=>(C.value||[]).slice(),V=(e,n=void 0,r=!0)=>{const o=rm(C.value,e,n);if(o){const n=(C.value||[]).slice();r&&t.emit("select",n,e),t.emit("selection-change",n)}},L=()=>{var e,n;const r=E.value?!w.value:!(w.value||C.value.length);w.value=r;let o=!1,s=0;const a=null==(n=null==(e=null==t?void 0:t.store)?void 0:e.states)?void 0:n.rowKey.value;i.value.forEach(((e,t)=>{const n=t+s;T.value?T.value.call(null,e,n)&&rm(C.value,e,r)&&(o=!0):rm(C.value,e,r)&&(o=!0),s+=F(Jg(e,a))})),o&&t.emit("selection-change",C.value?C.value.slice():[]),t.emit("select-all",C.value)},$=()=>{const e=Zg(C.value,o.value);i.value.forEach((t=>{const n=Jg(t,o.value),r=e[n];r&&(C.value[r.index]=t)}))},q=()=>{var e,n,r;if(0===(null==(e=i.value)?void 0:e.length))return void(w.value=!1);let s;o.value&&(s=Zg(C.value,o.value));const a=function(e){return s?!!s[Jg(e,o.value)]:C.value.includes(e)};let l=!0,c=0,u=0;for(let o=0,d=(i.value||[]).length;o<d;o++){const e=null==(r=null==(n=null==t?void 0:t.store)?void 0:n.states)?void 0:r.rowKey.value,s=o+u,d=i.value[o],p=T.value&&T.value.call(null,d,s);if(a(d))c++;else if(!T.value||p){l=!1;break}u+=F(Jg(d,e))}0===c&&(l=!1),w.value=l},F=e=>{var n;if(!t||!t.store)return 0;const{treeData:r}=t.store.states;let o=0;const i=null==(n=r.value[e])?void 0:n.children;return i&&(o+=i.length,i.forEach((e=>{o+=F(e)}))),o},U=(e,t)=>{Array.isArray(e)||(e=[e]);const n={};return e.forEach((e=>{k.value[e.id]=t,n[e.columnKey||e.id]=t})),n},z=(e,t,n)=>{N.value&&N.value!==e&&(N.value.order=null),N.value=e,R.value=t,I.value=n},K=()=>{let e=(0,n.unref)(s);Object.keys(k.value).forEach((t=>{const n=k.value[t];if(!n||0===n.length)return;const r=Wg({columns:u.value},t);r&&r.filterMethod&&(e=e.filter((e=>n.some((t=>r.filterMethod.call(null,t,e,r))))))})),x.value=e},W=()=>{i.value=vm(x.value,{sortingColumn:N.value,sortProp:R.value,sortOrder:I.value})},G=(e=void 0)=>{e&&e.filter||K(),W()},Y=e=>{const{tableHeaderRef:n}=t.refs;if(!n)return;const r=Object.assign({},n.filterPanels),o=Object.keys(r);if(o.length)if("string"===typeof e&&(e=[e]),Array.isArray(e)){const n=e.map((e=>Gg({columns:u.value},e)));o.forEach((e=>{const t=n.find((t=>t.id===e));t&&(t.filteredValue=[])})),t.store.commit("filterChange",{column:n,values:[],silent:!0,multi:!0})}else o.forEach((e=>{const t=u.value.find((t=>t.id===e));t&&(t.filteredValue=[])})),k.value={},t.store.commit("filterChange",{column:{},values:[],silent:!0})},J=()=>{N.value&&(z(null,null,null),t.store.commit("changeSortCondition",{silent:!0}))},{setExpandRowKeys:Z,toggleRowExpansion:X,updateExpandRows:Q,states:ee,isRowExpanded:te}=fm({data:i,rowKey:o}),{updateTreeExpandKeys:ne,toggleTreeExpansion:re,updateTreeData:oe,loadOrToggle:ie,states:se}=mm({data:i,rowKey:o}),{updateCurrentRowData:ae,updateCurrentRow:le,setCurrentRowKey:ce,states:ue}=gm({data:i,rowKey:o}),de=e=>{Z(e),ne(e)},pe=(e,t)=>{const n=u.value.some((({type:e})=>"expand"===e));n?X(e,t):re(e,t)};return{assertRowKey:O,updateColumns:B,scheduleLayout:D,isSelected:P,clearSelection:H,cleanSelection:M,getSelectionRows:j,toggleRowSelection:V,_toggleAllSelection:L,toggleAllSelection:null,updateSelectionByRowKey:$,updateAllSelected:q,updateFilters:U,updateCurrentRow:le,updateSort:z,execFilter:K,execSort:W,execQuery:G,clearFilter:Y,clearSort:J,toggleRowExpansion:X,setExpandRowKeysAdapter:de,setCurrentRowKey:ce,toggleRowExpansionAdapter:pe,isRowExpanded:te,updateExpandRows:Q,updateCurrentRowData:ae,loadOrToggle:ie,updateTreeData:oe,states:{tableSize:r,rowKey:o,data:i,_data:s,isComplex:a,_columns:l,originColumns:c,columns:u,fixedColumns:d,rightFixedColumns:p,leafColumns:h,fixedLeafColumns:f,rightFixedLeafColumns:g,updateOrderFns:m,leafColumnsLength:v,fixedLeafColumnsLength:y,rightFixedLeafColumnsLength:b,isAllSelected:w,selection:C,reserveSelection:S,selectOnIndeterminate:E,selectable:T,filters:k,filteredData:x,sortingColumn:N,sortProp:R,sortOrder:I,hoverRow:_,...ee,...se,...ue}}}function wm(e,t){return e.map((e=>{var n;return e.id===t.id?t:((null==(n=e.children)?void 0:n.length)&&(e.children=wm(e.children,t)),e)}))}function Cm(e){e.forEach((e=>{var t,n;e.no=null==(t=e.getColumnIndex)?void 0:t.call(e),(null==(n=e.children)?void 0:n.length)&&Cm(e.children)})),e.sort(((e,t)=>e.no-t.no))}function Sm(){const e=(0,n.getCurrentInstance)(),t=bm(),r=c("table"),o={setData(t,r){const o=(0,n.unref)(t._data)!==r;t.data.value=r,t._data.value=r,e.store.execQuery(),e.store.updateCurrentRowData(),e.store.updateExpandRows(),e.store.updateTreeData(e.store.states.defaultExpandAll.value),(0,n.unref)(t.reserveSelection)?(e.store.assertRowKey(),e.store.updateSelectionByRowKey()):o?e.store.clearSelection():e.store.cleanSelection(),e.store.updateAllSelected(),e.$ready&&e.store.scheduleLayout()},insertColumn(t,r,o,i){const s=(0,n.unref)(t._columns);let a=[];o?(o&&!o.children&&(o.children=[]),o.children.push(r),a=wm(s,o)):(s.push(r),a=s),Cm(a),t._columns.value=a,t.updateOrderFns.push(i),"selection"===r.type&&(t.selectable.value=r.selectable,t.reserveSelection.value=r.reserveSelection),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},updateColumnOrder(t,n){var r;const o=null==(r=n.getColumnIndex)?void 0:r.call(n);o!==n.no&&(Cm(t._columns.value),e.$ready&&e.store.updateColumns())},removeColumn(t,r,o,i){const s=(0,n.unref)(t._columns)||[];if(o)o.children.splice(o.children.findIndex((e=>e.id===r.id)),1),(0,n.nextTick)((()=>{var e;0===(null==(e=o.children)?void 0:e.length)&&delete o.children})),t._columns.value=wm(s,o);else{const e=s.indexOf(r);e>-1&&(s.splice(e,1),t._columns.value=s)}const a=t.updateOrderFns.indexOf(i);a>-1&&t.updateOrderFns.splice(a,1),e.$ready&&(e.store.updateColumns(),e.store.scheduleLayout())},sort(t,r){const{prop:o,order:i,init:s}=r;if(o){const r=(0,n.unref)(t.columns).find((e=>e.property===o));r&&(r.order=i,e.store.updateSort(r,o,i),e.store.commit("changeSortCondition",{init:s}))}},changeSortCondition(t,r){const{sortingColumn:o,sortProp:i,sortOrder:s}=t,a=(0,n.unref)(o),l=(0,n.unref)(i),c=(0,n.unref)(s);null===c&&(t.sortingColumn.value=null,t.sortProp.value=null);const u={filter:!0};e.store.execQuery(u),r&&(r.silent||r.init)||e.emit("sort-change",{column:a,prop:l,order:c}),e.store.updateTableScrollY()},filterChange(t,n){const{column:r,values:o,silent:i}=n,s=e.store.updateFilters(r,o);e.store.execQuery(),i||e.emit("filter-change",s),e.store.updateTableScrollY()},toggleAllSelection(){e.store.toggleAllSelection()},rowSelectedChanged(t,n){e.store.toggleRowSelection(n),e.store.updateAllSelected()},setHoverRow(e,t){e.hoverRow.value=t},setCurrentRow(t,n){e.store.updateCurrentRow(n)}},i=function(t,...n){const r=e.store.mutations;if(!r[t])throw new Error(`Action not found: ${t}`);r[t].apply(e,[e.store.states].concat(n))},s=function(){(0,n.nextTick)((()=>e.layout.updateScrollY.apply(e.layout)))};return{ns:r,...t,mutations:o,commit:i,updateTableScrollY:s}}const Em={rowKey:"rowKey",defaultExpandAll:"defaultExpandAll",selectOnIndeterminate:"selectOnIndeterminate",indent:"indent",lazy:"lazy",data:"data",["treeProps.hasChildren"]:{key:"lazyColumnIdentifier",default:"hasChildren"},["treeProps.children"]:{key:"childrenColumnName",default:"children"}};function Tm(e,t){if(!e)throw new Error("Table is required.");const n=Sm();return n.toggleAllSelection=ad(n._toggleAllSelection,10),Object.keys(Em).forEach((e=>{xm(Nm(t,e),e,n)})),km(n,t),n}function km(e,t){Object.keys(Em).forEach((r=>{(0,n.watch)((()=>Nm(t,r)),(t=>{xm(t,r,e)}))}))}function xm(e,t,n){let r=e,o=Em[t];"object"===typeof Em[t]&&(o=o.key,r=r||Em[t].default),n.states[o].value=r}function Nm(e,t){if(t.includes(".")){const n=t.split(".");let r=e;return n.forEach((e=>{r=r[e]})),r}return e[t]}class Rm{constructor(e){this.observers=[],this.table=null,this.store=null,this.columns=[],this.fit=!0,this.showHeader=!0,this.height=(0,n.ref)(null),this.scrollX=(0,n.ref)(!1),this.scrollY=(0,n.ref)(!1),this.bodyWidth=(0,n.ref)(null),this.fixedWidth=(0,n.ref)(null),this.rightFixedWidth=(0,n.ref)(null),this.gutterWidth=0;for(const t in e)rn(e,t)&&((0,n.isRef)(this[t])?this[t].value=e[t]:this[t]=e[t]);if(!this.table)throw new Error("Table is required for Table Layout");if(!this.store)throw new Error("Store is required for Table Layout")}updateScrollY(){const e=this.height.value;if(null===e)return!1;const t=this.table.refs.scrollBarRef;if(this.table.vnode.el&&(null==t?void 0:t.wrapRef)){let e=!0;const n=this.scrollY.value;return e=t.wrapRef.scrollHeight>t.wrapRef.clientHeight,this.scrollY.value=e,n!==e}return!1}setHeight(e,t="height"){if(!Yr)return;const r=this.table.vnode.el;if(e=tm(e),this.height.value=Number(e),!r&&(e||0===e))return(0,n.nextTick)((()=>this.setHeight(e,t)));"number"===typeof e?(r.style[t]=`${e}px`,this.updateElsHeight()):"string"===typeof e&&(r.style[t]=e,this.updateElsHeight())}setMaxHeight(e){this.setHeight(e,"max-height")}getFlattenColumns(){const e=[],t=this.table.store.states.columns.value;return t.forEach((t=>{t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)})),e}updateElsHeight(){this.updateScrollY(),this.notifyObservers("scrollable")}headerDisplayNone(e){if(!e)return!0;let t=e;while("DIV"!==t.tagName){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}updateColumnsWidth(){if(!Yr)return;const e=this.fit,t=this.table.vnode.el.clientWidth;let n=0;const r=this.getFlattenColumns(),o=r.filter((e=>"number"!==typeof e.width));if(r.forEach((e=>{"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)})),o.length>0&&e){if(r.forEach((e=>{n+=Number(e.width||e.minWidth||80)})),n<=t){this.scrollX.value=!1;const e=t-n;if(1===o.length)o[0].realWidth=Number(o[0].minWidth||80)+e;else{const t=o.reduce(((e,t)=>e+Number(t.minWidth||80)),0),n=e/t;let r=0;o.forEach(((e,t)=>{if(0===t)return;const o=Math.floor(Number(e.minWidth||80)*n);r+=o,e.realWidth=Number(e.minWidth||80)+o})),o[0].realWidth=Number(o[0].minWidth||80)+e-r}}else this.scrollX.value=!0,o.forEach((e=>{e.realWidth=Number(e.minWidth)}));this.bodyWidth.value=Math.max(n,t),this.table.state.resizeState.value.width=this.bodyWidth.value}else r.forEach((e=>{e.width||e.minWidth?e.realWidth=Number(e.width||e.minWidth):e.realWidth=80,n+=e.realWidth})),this.scrollX.value=n>t,this.bodyWidth.value=n;const i=this.store.states.fixedColumns.value;if(i.length>0){let e=0;i.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.fixedWidth.value=e}const s=this.store.states.rightFixedColumns.value;if(s.length>0){let e=0;s.forEach((t=>{e+=Number(t.realWidth||t.width)})),this.rightFixedWidth.value=e}this.notifyObservers("columns")}addObserver(e){this.observers.push(e)}removeObserver(e){const t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)}notifyObservers(e){const t=this.observers;t.forEach((t=>{var n,r;switch(e){case"columns":null==(n=t.state)||n.onColumnsChange(this);break;case"scrollable":null==(r=t.state)||r.onScrollableChange(this);break;default:throw new Error(`Table Layout don't have event ${e}.`)}}))}}const Im={modelValue:{type:[Number,String,Boolean],default:void 0},label:{type:[String,Boolean,Number,Object],default:void 0},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:{type:String,default:void 0},trueLabel:{type:[String,Number],default:void 0},falseLabel:{type:[String,Number],default:void 0},id:{type:String,default:void 0},controls:{type:String,default:void 0},border:Boolean,size:Hn,tabindex:[String,Number],validateEvent:{type:Boolean,default:!0}},_m={[cu]:e=>an(e)||yn(e)||vn(e),change:e=>an(e)||yn(e)||vn(e)},Om=Symbol("checkboxGroupContextKey"),Am=e=>{const t=(0,n.getCurrentInstance)();return(0,n.computed)((()=>{var n,r;return null==(r=null==(n=null==t?void 0:t.proxy)?void 0:n.$props)?void 0:r[e]}))},Bm=(e,t={})=>{const r=(0,n.ref)(void 0),o=t.prop?r:Am("size"),i=t.global?r:jn(),s=t.form?{size:void 0}:(0,n.inject)(Wa,void 0),a=t.formItem?{size:void 0}:(0,n.inject)(Ga,void 0);return(0,n.computed)((()=>o.value||(0,n.unref)(e)||(null==a?void 0:a.size)||(null==s?void 0:s.size)||i.value||""))},Dm=e=>{const t=Am("disabled"),r=(0,n.inject)(Wa,void 0);return(0,n.computed)((()=>t.value||(0,n.unref)(e)||(null==r?void 0:r.disabled)||!1))},Pm=({model:e,isChecked:t})=>{const r=(0,n.inject)(Om,void 0),o=(0,n.computed)((()=>{var n,o;const i=null==(n=null==r?void 0:r.max)?void 0:n.value,s=null==(o=null==r?void 0:r.min)?void 0:o.value;return!mn(i)&&e.value.length>=i&&!t.value||!mn(s)&&e.value.length<=s&&t.value})),i=Dm((0,n.computed)((()=>(null==r?void 0:r.disabled.value)||o.value)));return{isDisabled:i,isLimitDisabled:o}},Hm=()=>{const e=(0,n.inject)(Wa,void 0),t=(0,n.inject)(Ga,void 0);return{form:e,formItem:t}},Mm=(e,{formItemContext:t,disableIdGeneration:r,disableIdManagement:o})=>{r||(r=(0,n.ref)(!1)),o||(o=(0,n.ref)(!1));const i=(0,n.ref)();let s;const a=(0,n.computed)((()=>{var n;return!!(!e.label&&t&&t.inputIds&&(null==(n=t.inputIds)?void 0:n.length)<=1)}));return(0,n.onMounted)((()=>{s=(0,n.watch)([(0,n.toRef)(e,"id"),r],(([e,n])=>{const r=null!=e?e:n?void 0:_a().value;r!==i.value&&((null==t?void 0:t.removeInputId)&&(i.value&&t.removeInputId(i.value),(null==o?void 0:o.value)||n||!r||t.addInputId(r)),i.value=r)}),{immediate:!0})})),(0,n.onUnmounted)((()=>{s&&s(),(null==t?void 0:t.removeInputId)&&i.value&&t.removeInputId(i.value)})),{isLabeledByFormItem:a,inputId:i}},jm=(e,{model:t,isLimitExceeded:r,hasOwnLabel:o,isDisabled:i,isLabeledByFormItem:s})=>{const a=(0,n.inject)(Om,void 0),{formItem:l}=Hm(),{emit:c}=(0,n.getCurrentInstance)();function u(t){var n,r;return t===e.trueLabel||!0===t?null==(n=e.trueLabel)||n:null!=(r=e.falseLabel)&&r}function d(e,t){c("change",u(e),t)}function p(e){if(r.value)return;const t=e.target;c("change",u(t.checked),e)}async function h(a){if(!r.value&&!o.value&&!i.value&&s.value){const r=a.composedPath(),o=r.some((e=>"LABEL"===e.tagName));o||(t.value=u([!1,e.falseLabel].includes(t.value)),await(0,n.nextTick)(),d(t.value,a))}}const f=(0,n.computed)((()=>(null==a?void 0:a.validateEvent)||e.validateEvent));return(0,n.watch)((()=>e.modelValue),(()=>{f.value&&(null==l||l.validate("change").catch((e=>Nn(e))))})),{handleChange:p,onClickRoot:h}},Vm=e=>{const t=(0,n.ref)(!1),{emit:r}=(0,n.getCurrentInstance)(),o=(0,n.inject)(Om,void 0),i=(0,n.computed)((()=>!1===mn(o))),s=(0,n.ref)(!1),a=(0,n.computed)({get(){var n,r;return i.value?null==(n=null==o?void 0:o.modelValue)?void 0:n.value:null!=(r=e.modelValue)?r:t.value},set(e){var n,l;i.value&&on(e)?(s.value=void 0!==(null==(n=null==o?void 0:o.max)?void 0:n.value)&&e.length>(null==o?void 0:o.max.value)&&e.length>a.value.length,!1===s.value&&(null==(l=null==o?void 0:o.changeEvent)||l.call(o,e))):(r(cu,e),t.value=e)}});return{model:a,isGroup:i,isLimitExceeded:s}};function Lm(e,t){return Jf(e,t)}var $m=Lm;const qm=(e,t,{model:r})=>{const o=(0,n.inject)(Om,void 0),i=(0,n.ref)(!1),s=(0,n.computed)((()=>{const t=r.value;return vn(t)?t:on(t)?ln(e.label)?t.map(n.toRaw).some((t=>$m(t,e.label))):t.map(n.toRaw).includes(e.label):null!==t&&void 0!==t?t===e.trueLabel:!!t})),a=Bm((0,n.computed)((()=>{var e;return null==(e=null==o?void 0:o.size)?void 0:e.value})),{prop:!0}),l=Bm((0,n.computed)((()=>{var e;return null==(e=null==o?void 0:o.size)?void 0:e.value}))),c=(0,n.computed)((()=>!!t.default||!js(e.label)));return{checkboxButtonSize:a,isChecked:s,isFocused:i,checkboxSize:l,hasOwnLabel:c}},Fm=(e,{model:t})=>{function n(){on(t.value)&&!t.value.includes(e.label)?t.value.push(e.label):t.value=e.trueLabel||!0}e.checked&&n()},Um=(e,t)=>{const{formItem:n}=Hm(),{model:r,isGroup:o,isLimitExceeded:i}=Vm(e),{isFocused:s,isChecked:a,checkboxButtonSize:l,checkboxSize:c,hasOwnLabel:u}=qm(e,t,{model:r}),{isDisabled:d}=Pm({model:r,isChecked:a}),{inputId:p,isLabeledByFormItem:h}=Mm(e,{formItemContext:n,disableIdGeneration:u,disableIdManagement:o}),{handleChange:f,onClickRoot:g}=jm(e,{model:r,isLimitExceeded:i,hasOwnLabel:u,isDisabled:d,isLabeledByFormItem:h});return Fm(e,{model:r}),{inputId:p,isLabeledByFormItem:h,isChecked:a,isDisabled:d,isFocused:s,checkboxButtonSize:l,checkboxSize:c,hasOwnLabel:u,model:r,handleChange:f,onClickRoot:g}},zm=["id","indeterminate","name","tabindex","disabled","true-value","false-value"],Km=["id","indeterminate","disabled","value","name","tabindex"],Wm=(0,n.defineComponent)({name:"ElCheckbox"}),Gm=(0,n.defineComponent)({...Wm,props:Im,emits:_m,setup(e){const t=e,r=(0,n.useSlots)(),{inputId:o,isLabeledByFormItem:i,isChecked:s,isDisabled:a,isFocused:l,checkboxSize:u,hasOwnLabel:d,model:p,handleChange:h,onClickRoot:f}=Um(t,r),g=c("checkbox"),m=(0,n.computed)((()=>[g.b(),g.m(u.value),g.is("disabled",a.value),g.is("bordered",t.border),g.is("checked",s.value)])),v=(0,n.computed)((()=>[g.e("input"),g.is("disabled",a.value),g.is("checked",s.value),g.is("indeterminate",t.indeterminate),g.is("focus",l.value)]));return(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(!(0,n.unref)(d)&&(0,n.unref)(i)?"span":"label"),{class:(0,n.normalizeClass)((0,n.unref)(m)),"aria-controls":e.indeterminate?e.controls:null,onClick:(0,n.unref)(f)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v))},[e.trueLabel||e.falseLabel?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:0,id:(0,n.unref)(o),"onUpdate:modelValue":t[0]||(t[0]=e=>(0,n.isRef)(p)?p.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(g).e("original")),type:"checkbox",indeterminate:e.indeterminate,name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(a),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e)),onFocus:t[2]||(t[2]=e=>l.value=!0),onBlur:t[3]||(t[3]=e=>l.value=!1),onClick:t[4]||(t[4]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,zm)),[[n.vModelCheckbox,(0,n.unref)(p)]]):(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:1,id:(0,n.unref)(o),"onUpdate:modelValue":t[5]||(t[5]=e=>(0,n.isRef)(p)?p.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(g).e("original")),type:"checkbox",indeterminate:e.indeterminate,disabled:(0,n.unref)(a),value:e.label,name:e.name,tabindex:e.tabindex,onChange:t[6]||(t[6]=(...e)=>(0,n.unref)(h)&&(0,n.unref)(h)(...e)),onFocus:t[7]||(t[7]=e=>l.value=!0),onBlur:t[8]||(t[8]=e=>l.value=!1),onClick:t[9]||(t[9]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Km)),[[n.vModelCheckbox,(0,n.unref)(p)]]),(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(g).e("inner"))},null,2)],2),(0,n.unref)(d)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(g).e("label"))},[(0,n.renderSlot)(e.$slots,"default"),e.$slots.default?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createTextVNode)((0,n.toDisplayString)(e.label),1)],64))],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["class","aria-controls","onClick"]))}});var Ym=Ar(Gm,[["__file","checkbox.vue"]]);const Jm=["name","tabindex","disabled","true-value","false-value"],Zm=["name","tabindex","disabled","value"],Xm=(0,n.defineComponent)({name:"ElCheckboxButton"}),Qm=(0,n.defineComponent)({...Xm,props:Im,emits:_m,setup(e){const t=e,r=(0,n.useSlots)(),{isFocused:o,isChecked:i,isDisabled:s,checkboxButtonSize:a,model:l,handleChange:u}=Um(t,r),d=(0,n.inject)(Om,void 0),p=c("checkbox"),h=(0,n.computed)((()=>{var e,t,n,r;const o=null!=(t=null==(e=null==d?void 0:d.fill)?void 0:e.value)?t:"";return{backgroundColor:o,borderColor:o,color:null!=(r=null==(n=null==d?void 0:d.textColor)?void 0:n.value)?r:"",boxShadow:o?`-1px 0 0 0 ${o}`:void 0}})),f=(0,n.computed)((()=>[p.b("button"),p.bm("button",a.value),p.is("disabled",s.value),p.is("checked",i.value),p.is("focus",o.value)]));return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("label",{class:(0,n.normalizeClass)((0,n.unref)(f))},[e.trueLabel||e.falseLabel?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=e=>(0,n.isRef)(l)?l.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(p).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(s),"true-value":e.trueLabel,"false-value":e.falseLabel,onChange:t[1]||(t[1]=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e)),onFocus:t[2]||(t[2]=e=>o.value=!0),onBlur:t[3]||(t[3]=e=>o.value=!1),onClick:t[4]||(t[4]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Jm)),[[n.vModelCheckbox,(0,n.unref)(l)]]):(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("input",{key:1,"onUpdate:modelValue":t[5]||(t[5]=e=>(0,n.isRef)(l)?l.value=e:null),class:(0,n.normalizeClass)((0,n.unref)(p).be("button","original")),type:"checkbox",name:e.name,tabindex:e.tabindex,disabled:(0,n.unref)(s),value:e.label,onChange:t[6]||(t[6]=(...e)=>(0,n.unref)(u)&&(0,n.unref)(u)(...e)),onFocus:t[7]||(t[7]=e=>o.value=!0),onBlur:t[8]||(t[8]=e=>o.value=!1),onClick:t[9]||(t[9]=(0,n.withModifiers)((()=>{}),["stop"]))},null,42,Zm)),[[n.vModelCheckbox,(0,n.unref)(l)]]),e.$slots.default||e.label?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:2,class:(0,n.normalizeClass)((0,n.unref)(p).be("button","inner")),style:(0,n.normalizeStyle)((0,n.unref)(i)?(0,n.unref)(h):void 0)},[(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.label),1)]))],6)):(0,n.createCommentVNode)("v-if",!0)],2))}});var ev=Ar(Qm,[["__file","checkbox-button.vue"]]);function tv(e,t,n){var r=-1,o=t.length,i={};while(++r<o){var s=t[r],a=Kt(e,s);n(a,s)&&Xn(i,$t(s,e),a)}return i}var nv=tv;function rv(e,t){return nv(e,t,(function(t,n){return fg(e,n)}))}var ov=rv;function iv(e){var t=null==e?0:e.length;return t?Ld(e,1):[]}var sv=iv;function av(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var lv=av,cv=Math.max;function uv(e,t,n){return t=cv(void 0===t?e.length-1:t,0),function(){var r=arguments,o=-1,i=cv(r.length-t,0),s=Array(i);while(++o<i)s[o]=r[t+o];o=-1;var a=Array(t+1);while(++o<t)a[o]=r[o];return a[t]=n(s),lv(e,this,a)}}var dv=uv;function pv(e){return function(){return e}}var hv=pv,fv=Ln?function(e,t){return Ln(e,"toString",{configurable:!0,enumerable:!1,value:hv(t),writable:!0})}:wg,gv=fv,mv=800,vv=16,yv=Date.now;function bv(e){var t=0,n=0;return function(){var r=yv(),o=vv-(r-n);if(n=r,o>0){if(++t>=mv)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var wv=bv,Cv=wv(gv),Sv=Cv;function Ev(e){return Sv(dv(e,void 0,sv),e+"")}var Tv=Ev,kv=Tv((function(e,t){return null==e?{}:ov(e,t)})),xv=kv;const Nv=Dn({modelValue:{type:On(Array),default:()=>[]},disabled:Boolean,min:Number,max:Number,size:Hn,label:String,fill:String,textColor:String,tag:{type:String,default:"div"},validateEvent:{type:Boolean,default:!0}}),Rv={[cu]:e=>on(e),change:e=>on(e)},Iv=(0,n.defineComponent)({name:"ElCheckboxGroup"}),_v=(0,n.defineComponent)({...Iv,props:Nv,emits:Rv,setup(e,{emit:t}){const r=e,o=c("checkbox"),{formItem:i}=Hm(),{inputId:s,isLabeledByFormItem:a}=Mm(r,{formItemContext:i}),l=async e=>{t(cu,e),await(0,n.nextTick)(),t("change",e)},u=(0,n.computed)({get(){return r.modelValue},set(e){l(e)}});return(0,n.provide)(Om,{...xv((0,n.toRefs)(r),["size","min","max","disabled","validateEvent","fill","textColor"]),modelValue:u,changeEvent:l}),(0,n.watch)((()=>r.modelValue),(()=>{r.validateEvent&&(null==i||i.validate("change").catch((e=>Nn(e))))})),(e,t)=>{var r;return(0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),{id:(0,n.unref)(s),class:(0,n.normalizeClass)((0,n.unref)(o).b("group")),role:"group","aria-label":(0,n.unref)(a)?void 0:e.label||"checkbox-group","aria-labelledby":(0,n.unref)(a)?null==(r=(0,n.unref)(i))?void 0:r.labelId:void 0},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","class","aria-label","aria-labelledby"])}}});var Ov=Ar(_v,[["__file","checkbox-group.vue"]]);const Av=dr(Ym,{CheckboxButton:ev,CheckboxGroup:Ov}),Bv=(fr(ev),fr(Ov),new Map);let Dv;function Pv(e,t){let n=[];return Array.isArray(t.arg)?n=t.arg:bn(t.arg)&&n.push(t.arg),function(r,o){const i=t.instance.popperRef,s=r.target,a=null==o?void 0:o.target,l=!t||!t.instance,c=!s||!a,u=e.contains(s)||e.contains(a),d=e===s,p=n.length&&n.some((e=>null==e?void 0:e.contains(s)))||n.length&&n.includes(a),h=i&&(i.contains(s)||i.contains(a));l||c||u||d||p||h||t.value(r,o)}}Yr&&(document.addEventListener("mousedown",(e=>Dv=e)),document.addEventListener("mouseup",(e=>{for(const t of Bv.values())for(const{documentHandler:n}of t)n(e,Dv)})));const Hv={beforeMount(e,t){Bv.has(e)||Bv.set(e,[]),Bv.get(e).push({documentHandler:Pv(e,t),bindingFn:t.value})},updated(e,t){Bv.has(e)||Bv.set(e,[]);const n=Bv.get(e),r=n.findIndex((e=>e.bindingFn===t.oldValue)),o={documentHandler:Pv(e,t),bindingFn:t.value};r>=0?n.splice(r,1,o):n.push(o)},unmounted(e){Bv.delete(e)}},{CheckboxGroup:Mv}=Av,jv=(0,n.defineComponent)({name:"ElTableFilterPanel",components:{ElCheckbox:Av,ElCheckboxGroup:Mv,ElScrollbar:kd,ElTooltip:ql,ElIcon:Ou,ArrowDown:Ul,ArrowUp:Jl},directives:{ClickOutside:Hv},props:{placement:{type:String,default:"bottom-start"},store:{type:Object},column:{type:Object},upDataColumn:{type:Function}},setup(e){const t=(0,n.getCurrentInstance)(),{t:r}=en(),o=c("table-filter"),i=null==t?void 0:t.parent;i.filterPanels.value[e.column.id]||(i.filterPanels.value[e.column.id]=t);const s=(0,n.ref)(!1),a=(0,n.ref)(null),l=(0,n.computed)((()=>e.column&&e.column.filters)),u=(0,n.computed)((()=>e.column.filterClassName?`${o.b()} ${e.column.filterClassName}`:o.b())),d=(0,n.computed)({get:()=>{var t;return((null==(t=e.column)?void 0:t.filteredValue)||[])[0]},set:e=>{p.value&&("undefined"!==typeof e&&null!==e?p.value.splice(0,1,e):p.value.splice(0,1))}}),p=(0,n.computed)({get(){return e.column&&e.column.filteredValue||[]},set(t){e.column&&e.upDataColumn("filteredValue",t)}}),h=(0,n.computed)((()=>!e.column||e.column.filterMultiple)),f=e=>e.value===d.value,g=()=>{s.value=!1},m=e=>{e.stopPropagation(),s.value=!s.value},v=()=>{s.value=!1},y=()=>{C(p.value),g()},b=()=>{p.value=[],C(p.value),g()},w=e=>{d.value=e,C("undefined"!==typeof e&&null!==e?p.value:[]),g()},C=t=>{e.store.commit("filterChange",{column:e.column,values:t}),e.store.updateAllSelected()};(0,n.watch)(s,(t=>{e.column&&e.upDataColumn("filterOpened",t)}),{immediate:!0});const S=(0,n.computed)((()=>{var e,t;return null==(t=null==(e=a.value)?void 0:e.popperRef)?void 0:t.contentRef}));return{tooltipVisible:s,multiple:h,filterClassName:u,filteredValue:p,filterValue:d,filters:l,handleConfirm:y,handleReset:b,handleSelect:w,isActive:f,t:r,ns:o,showFilterPanel:m,hideFilterPanel:v,popperPaneRef:S,tooltip:a}}}),Vv={key:0},Lv=["disabled"],$v=["label","onClick"];function qv(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-checkbox"),l=(0,n.resolveComponent)("el-checkbox-group"),c=(0,n.resolveComponent)("el-scrollbar"),u=(0,n.resolveComponent)("arrow-up"),d=(0,n.resolveComponent)("arrow-down"),p=(0,n.resolveComponent)("el-icon"),h=(0,n.resolveComponent)("el-tooltip"),f=(0,n.resolveDirective)("click-outside");return(0,n.openBlock)(),(0,n.createBlock)(h,{ref:"tooltip",visible:e.tooltipVisible,offset:0,placement:e.placement,"show-arrow":!1,"stop-popper-mouse-event":!1,teleported:"",effect:"light",pure:"","popper-class":e.filterClassName,persistent:""},{content:(0,n.withCtx)((()=>[e.multiple?((0,n.openBlock)(),(0,n.createElementBlock)("div",Vv,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("content"))},[(0,n.createVNode)(c,{"wrap-class":e.ns.e("wrap")},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,{modelValue:e.filteredValue,"onUpdate:modelValue":t[0]||(t[0]=t=>e.filteredValue=t),class:(0,n.normalizeClass)(e.ns.e("checkbox-group"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.filters,(e=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.value,label:e.value},{default:(0,n.withCtx)((()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.text),1)])),_:2},1032,["label"])))),128))])),_:1},8,["modelValue","class"])])),_:1},8,["wrap-class"])],2),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("bottom"))},[(0,n.createElementVNode)("button",{class:(0,n.normalizeClass)({[e.ns.is("disabled")]:0===e.filteredValue.length}),disabled:0===e.filteredValue.length,type:"button",onClick:t[1]||(t[1]=(...t)=>e.handleConfirm&&e.handleConfirm(...t))},(0,n.toDisplayString)(e.t("el.table.confirmFilter")),11,Lv),(0,n.createElementVNode)("button",{type:"button",onClick:t[2]||(t[2]=(...t)=>e.handleReset&&e.handleReset(...t))},(0,n.toDisplayString)(e.t("el.table.resetFilter")),1)],2)])):((0,n.openBlock)(),(0,n.createElementBlock)("ul",{key:1,class:(0,n.normalizeClass)(e.ns.e("list"))},[(0,n.createElementVNode)("li",{class:(0,n.normalizeClass)([e.ns.e("list-item"),{[e.ns.is("active")]:void 0===e.filterValue||null===e.filterValue}]),onClick:t[3]||(t[3]=t=>e.handleSelect(null))},(0,n.toDisplayString)(e.t("el.table.clearFilter")),3),((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.filters,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("li",{key:t.value,class:(0,n.normalizeClass)([e.ns.e("list-item"),e.ns.is("active",e.isActive(t))]),label:t.value,onClick:n=>e.handleSelect(t.value)},(0,n.toDisplayString)(t.text),11,$v)))),128))],2))])),default:(0,n.withCtx)((()=>[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{class:(0,n.normalizeClass)([`${e.ns.namespace.value}-table__column-filter-trigger`,`${e.ns.namespace.value}-none-outline`]),onClick:t[4]||(t[4]=(...t)=>e.showFilterPanel&&e.showFilterPanel(...t))},[(0,n.createVNode)(p,null,{default:(0,n.withCtx)((()=>[e.column.filterOpened?((0,n.openBlock)(),(0,n.createBlock)(u,{key:0})):((0,n.openBlock)(),(0,n.createBlock)(d,{key:1}))])),_:1})],2)),[[f,e.hideFilterPanel,e.popperPaneRef]])])),_:1},8,["visible","placement","popper-class"])}var Fv=Ar(jv,[["render",qv],["__file","filter-panel.vue"]]);function Uv(e){const t=(0,n.getCurrentInstance)();(0,n.onBeforeMount)((()=>{r.value.addObserver(t)})),(0,n.onMounted)((()=>{o(r.value),i(r.value)})),(0,n.onUpdated)((()=>{o(r.value),i(r.value)})),(0,n.onUnmounted)((()=>{r.value.removeObserver(t)}));const r=(0,n.computed)((()=>{const t=e.layout;if(!t)throw new Error("Can not find table layout.");return t})),o=t=>{var n;const r=(null==(n=e.vnode.el)?void 0:n.querySelectorAll("colgroup > col"))||[];if(!r.length)return;const o=t.getFlattenColumns(),i={};o.forEach((e=>{i[e.id]=e}));for(let e=0,s=r.length;e<s;e++){const t=r[e],n=t.getAttribute("name"),o=i[n];o&&t.setAttribute("width",o.realWidth||o.width)}},i=t=>{var n,r;const o=(null==(n=e.vnode.el)?void 0:n.querySelectorAll("colgroup > col[name=gutter]"))||[];for(let e=0,s=o.length;e<s;e++){const n=o[e];n.setAttribute("width",t.scrollY.value?t.gutterWidth:"0")}const i=(null==(r=e.vnode.el)?void 0:r.querySelectorAll("th.gutter"))||[];for(let e=0,s=i.length;e<s;e++){const n=i[e];n.style.width=t.scrollY.value?`${t.gutterWidth}px`:"0",n.style.display=t.scrollY.value?"":"none"}};return{tableLayout:r.value,onColumnsChange:o,onScrollableChange:i}}const zv=Symbol("ElTable");function Kv(e,t){const r=(0,n.getCurrentInstance)(),o=(0,n.inject)(zv),i=e=>{e.stopPropagation()},s=(e,t)=>{!t.filters&&t.sortable?g(e,t,!1):t.filterable&&!t.sortable&&i(e),null==o||o.emit("header-click",t,e)},a=(e,t)=>{null==o||o.emit("header-contextmenu",t,e)},l=(0,n.ref)(null),c=(0,n.ref)(!1),u=(0,n.ref)({}),d=(n,i)=>{if(Yr&&!(i.children&&i.children.length>0)&&l.value&&e.border){c.value=!0;const s=o;t("set-drag-visible",!0);const a=null==s?void 0:s.vnode.el,d=a.getBoundingClientRect().left,p=r.vnode.el.querySelector(`th.${i.id}`),h=p.getBoundingClientRect(),f=h.left-d+30;Jc(p,"noclick"),u.value={startMouseLeft:n.clientX,startLeft:h.right-d,startColumnLeft:h.left-d,tableLeft:d};const g=null==s?void 0:s.refs.resizeProxy;g.style.left=`${u.value.startLeft}px`,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};const m=e=>{const t=e.clientX-u.value.startMouseLeft,n=u.value.startLeft+t;g.style.left=`${Math.max(f,n)}px`},v=()=>{if(c.value){const{startColumnLeft:r,startLeft:o}=u.value,a=Number.parseInt(g.style.left,10),d=a-r;i.width=i.realWidth=d,null==s||s.emit("header-dragend",i.width,o-r,i,n),requestAnimationFrame((()=>{e.store.scheduleLayout(!1,!0)})),document.body.style.cursor="",c.value=!1,l.value=null,u.value={},t("set-drag-visible",!1)}document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",v),document.onselectstart=null,document.ondragstart=null,setTimeout((()=>{Zc(p,"noclick")}),0)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",v)}},p=(t,n)=>{if(n.children&&n.children.length>0)return;const r=t.target;if(!bn(r))return;const o=null==r?void 0:r.closest("th");if(n&&n.resizable&&!c.value&&e.border){const e=o.getBoundingClientRect(),r=document.body.style;e.width>12&&e.right-t.pageX<8?(r.cursor="col-resize",Yc(o,"is-sortable")&&(o.style.cursor="col-resize"),l.value=n):c.value||(r.cursor="",Yc(o,"is-sortable")&&(o.style.cursor="pointer"),l.value=null)}},h=()=>{Yr&&(document.body.style.cursor="")},f=({order:e,sortOrders:t})=>{if(""===e)return t[0];const n=t.indexOf(e||null);return t[n>t.length-2?0:n+1]},g=(t,n,r)=>{var i;t.stopPropagation();const s=n.order===r?null:r||f(n),a=null==(i=t.target)?void 0:i.closest("th");if(a&&Yc(a,"noclick"))return void Zc(a,"noclick");if(!n.sortable)return;const l=e.store.states;let c,u=l.sortProp.value;const d=l.sortingColumn.value;(d!==n||d===n&&null===d.order)&&(d&&(d.order=null),l.sortingColumn.value=n,u=n.property),c=n.order=s||null,l.sortProp.value=u,l.sortOrder.value=c,null==o||o.store.commit("changeSortCondition")};return{handleHeaderClick:s,handleHeaderContextMenu:a,handleMouseDown:d,handleMouseMove:p,handleMouseOut:h,handleSortClick:g,handleFilterClick:i}}function Wv(e){const t=(0,n.inject)(zv),r=c("table"),o=e=>{const n=null==t?void 0:t.props.headerRowStyle;return"function"===typeof n?n.call(null,{rowIndex:e}):n},i=e=>{const n=[],r=null==t?void 0:t.props.headerRowClassName;return"string"===typeof r?n.push(r):"function"===typeof r&&n.push(r.call(null,{rowIndex:e})),n.join(" ")},s=(n,r,o,i)=>{var s;let a=null!=(s=null==t?void 0:t.props.headerCellStyle)?s:{};"function"===typeof a&&(a=a.call(null,{rowIndex:n,columnIndex:r,row:o,column:i}));const l=pm(r,i.fixed,e.store,o);return hm(l,"left"),hm(l,"right"),Object.assign({},a,l)},a=(n,o,i,s)=>{const a=um(r.b(),o,s.fixed,e.store,i),l=[s.id,s.order,s.headerAlign,s.className,s.labelClassName,...a];s.children||l.push("is-leaf"),s.sortable&&l.push("is-sortable");const c=null==t?void 0:t.props.headerCellClassName;return"string"===typeof c?l.push(c):"function"===typeof c&&l.push(c.call(null,{rowIndex:n,columnIndex:o,row:i,column:s})),l.push(r.e("cell")),l.filter((e=>Boolean(e))).join(" ")};return{getHeaderRowStyle:o,getHeaderRowClass:i,getHeaderCellStyle:s,getHeaderCellClass:a}}const Gv=e=>{const t=[];return e.forEach((e=>{e.children?(t.push(e),t.push.apply(t,Gv(e.children))):t.push(e)})),t},Yv=e=>{let t=1;const n=(e,r)=>{if(r&&(e.level=r.level+1,t<e.level&&(t=e.level)),e.children){let t=0;e.children.forEach((r=>{n(r,e),t+=r.colSpan})),e.colSpan=t}else e.colSpan=1};e.forEach((e=>{e.level=1,n(e,void 0)}));const r=[];for(let i=0;i<t;i++)r.push([]);const o=Gv(e);return o.forEach((e=>{e.children?(e.rowSpan=1,e.children.forEach((e=>e.isSubColumn=!0))):e.rowSpan=t-e.level+1,r[e.level-1].push(e)})),r};function Jv(e){const t=(0,n.inject)(zv),r=(0,n.computed)((()=>Yv(e.store.states.originColumns.value))),o=(0,n.computed)((()=>{const e=r.value.length>1;return e&&t&&(t.state.isGroup.value=!0),e})),i=e=>{e.stopPropagation(),null==t||t.store.commit("toggleAllSelection")};return{isGroup:o,toggleAllSelection:i,columnRows:r}}var Zv=(0,n.defineComponent)({name:"ElTableHeader",components:{ElCheckbox:Av},props:{fixed:{type:String,default:""},store:{required:!0,type:Object},border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e,{emit:t}){const r=(0,n.getCurrentInstance)(),o=(0,n.inject)(zv),i=c("table"),s=(0,n.ref)({}),{onColumnsChange:a,onScrollableChange:l}=Uv(o);(0,n.onMounted)((async()=>{await(0,n.nextTick)(),await(0,n.nextTick)();const{prop:t,order:r}=e.defaultSort;null==o||o.store.commit("sort",{prop:t,order:r,init:!0})}));const{handleHeaderClick:u,handleHeaderContextMenu:d,handleMouseDown:p,handleMouseMove:h,handleMouseOut:f,handleSortClick:g,handleFilterClick:m}=Kv(e,t),{getHeaderRowStyle:v,getHeaderRowClass:y,getHeaderCellStyle:b,getHeaderCellClass:w}=Wv(e),{isGroup:C,toggleAllSelection:S,columnRows:E}=Jv(e);return r.state={onColumnsChange:a,onScrollableChange:l},r.filterPanels=s,{ns:i,filterPanels:s,onColumnsChange:a,onScrollableChange:l,columnRows:E,getHeaderRowClass:y,getHeaderRowStyle:v,getHeaderCellClass:w,getHeaderCellStyle:b,handleHeaderClick:u,handleHeaderContextMenu:d,handleMouseDown:p,handleMouseMove:h,handleMouseOut:f,handleSortClick:g,handleFilterClick:m,isGroup:C,toggleAllSelection:S}},render(){const{ns:e,isGroup:t,columnRows:r,getHeaderCellStyle:o,getHeaderCellClass:i,getHeaderRowClass:s,getHeaderRowStyle:a,handleHeaderClick:l,handleHeaderContextMenu:c,handleMouseDown:u,handleMouseMove:d,handleSortClick:p,handleMouseOut:h,store:f,$parent:g}=this;let m=1;return(0,n.h)("thead",{class:{[e.is("group")]:t}},r.map(((e,t)=>(0,n.h)("tr",{class:s(t),key:t,style:a(t)},e.map(((r,s)=>(r.rowSpan>m&&(m=r.rowSpan),(0,n.h)("th",{class:i(t,s,e,r),colspan:r.colSpan,key:`${r.id}-thead`,rowspan:r.rowSpan,style:o(t,s,e,r),onClick:e=>l(e,r),onContextmenu:e=>c(e,r),onMousedown:e=>u(e,r),onMousemove:e=>d(e,r),onMouseout:h},[(0,n.h)("div",{class:["cell",r.filteredValue&&r.filteredValue.length>0?"highlight":""]},[r.renderHeader?r.renderHeader({column:r,$index:s,store:f,_self:g}):r.label,r.sortable&&(0,n.h)("span",{onClick:e=>p(e,r),class:"caret-wrapper"},[(0,n.h)("i",{onClick:e=>p(e,r,"ascending"),class:"sort-caret ascending"}),(0,n.h)("i",{onClick:e=>p(e,r,"descending"),class:"sort-caret descending"})]),r.filterable&&(0,n.h)(Fv,{store:f,placement:r.filterPlacement||"bottom-start",column:r,upDataColumn:(e,t)=>{r[e]=t}})])]))))))))}});function Xv(e,t,n){(void 0!==n&&!qe(e[t],n)||void 0===n&&!(t in e))&&qn(e,t,n)}var Qv=Xv,ey="object"==typeof exports&&exports&&!exports.nodeType&&exports,ty=ey&&"object"==typeof module&&module&&!module.nodeType&&module,ny=ty&&ty.exports===ey,ry=ny?m.Buffer:void 0,oy=ry?ry.allocUnsafe:void 0;function iy(e,t){if(t)return e.slice();var n=e.length,r=oy?oy(n):new e.constructor(n);return e.copy(r),r}var sy=iy;function ay(e){var t=new e.constructor(e.byteLength);return new mp(t).set(new mp(e)),t}var ly=ay;function cy(e,t){var n=t?ly(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var uy=cy;function dy(e,t){var n=-1,r=e.length;t||(t=Array(r));while(++n<r)t[n]=e[n];return t}var py=dy,hy=Object.create,fy=function(){function e(){}return function(t){if(!U(t))return{};if(hy)return hy(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),gy=fy,my=tf(Object.getPrototypeOf,Object),vy=my;function yy(e){return"function"!=typeof e.constructor||Qh(e)?{}:gy(vy(e))}var by=yy;function wy(e){return P(e)&&uf(e)}var Cy=wy,Sy="[object Object]",Ey=Function.prototype,Ty=Object.prototype,ky=Ey.toString,xy=Ty.hasOwnProperty,Ny=ky.call(Object);function Ry(e){if(!P(e)||B(e)!=Sy)return!1;var t=vy(e);if(null===t)return!0;var n=xy.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ky.call(n)==Ny}var Iy=Ry;function _y(e,t){if(("constructor"!==t||"function"!==typeof e[t])&&"__proto__"!=t)return e[t]}var Oy=_y;function Ay(e,t,n,r){var o=!n;n||(n={});var i=-1,s=t.length;while(++i<s){var a=t[i],l=r?r(n[a],e[a],a,n,e):void 0;void 0===l&&(l=e[a]),o?qn(n,a,l):Kn(n,a,l)}return n}var By=Ay;function Dy(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}var Py=Dy,Hy=Object.prototype,My=Hy.hasOwnProperty;function jy(e){if(!U(e))return Py(e);var t=Qh(e),n=[];for(var r in e)("constructor"!=r||!t&&My.call(e,r))&&n.push(r);return n}var Vy=jy;function Ly(e){return uf(e)?Jh(e,!0):Vy(e)}var $y=Ly;function qy(e){return By(e,$y(e))}var Fy=qy;function Uy(e,t,n,r,o,i,s){var a=Oy(e,n),l=Oy(t,n),c=s.get(l);if(c)Qv(e,n,c);else{var u=i?i(a,l,n+"",e,t,s):void 0,p=void 0===u;if(p){var h=d(l),f=!h&&ih(l),g=!h&&!f&&Kh(l);u=l,h||f||g?d(a)?u=a:Cy(a)?u=py(a):f?(p=!1,u=sy(l,!0)):g?(p=!1,u=uy(l,!0)):u=[]:Iy(l)||Pd(l)?(u=a,Pd(a)?u=Fy(a):U(a)&&!J(a)||(u=by(l))):p=!1}p&&(s.set(l,u),o(u,l,r,i,s),s["delete"](l)),Qv(e,n,u)}}var zy=Uy;function Ky(e,t,n,r,o){e!==t&&Ag(t,(function(i,s){if(o||(o=new Qd),U(i))zy(e,t,s,n,Ky,r,o);else{var a=r?r(Oy(e,s),i,s+"",e,t,o):void 0;void 0===a&&(a=i),Qv(e,s,a)}}),$y)}var Wy=Ky;function Gy(e,t){return Sv(dv(e,t,wg),e+"")}var Yy=Gy;function Jy(e,t,n){if(!U(n))return!1;var r=typeof t;return!!("number"==r?uf(n)&&Jn(t,n.length):"string"==r&&t in n)&&qe(n[t],e)}var Zy=Jy;function Xy(e){return Yy((function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;i=e.length>3&&"function"==typeof i?(o--,i):void 0,s&&Zy(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);while(++r<o){var a=n[r];a&&e(t,a,r,i)}return t}))}var Qy=Xy,eb=Qy((function(e,t,n){Wy(e,t,n)})),tb=eb;function nb(e){const t=(0,n.inject)(zv),r=(0,n.ref)(""),o=(0,n.ref)((0,n.h)("div")),i=(n,r,o)=>{var i;const s=t,a=zg(n);let l;const c=null==(i=null==s?void 0:s.vnode.el)?void 0:i.dataset.prefix;a&&(l=Yg({columns:e.store.states.columns.value},a,c),l&&(null==s||s.emit(`cell-${o}`,r,l,a,n))),null==s||s.emit(`row-${o}`,r,l,n)},s=(e,t)=>{i(e,t,"dblclick")},a=(t,n)=>{e.store.commit("setCurrentRow",n),i(t,n,"click")},l=(e,t)=>{i(e,t,"contextmenu")},c=ad((t=>{e.store.commit("setHoverRow",t)}),30),u=ad((()=>{e.store.commit("setHoverRow",null)}),30),d=e=>{const t=window.getComputedStyle(e,null),n=Number.parseInt(t.paddingLeft,10)||0,r=Number.parseInt(t.paddingRight,10)||0,o=Number.parseInt(t.paddingTop,10)||0,i=Number.parseInt(t.paddingBottom,10)||0;return{left:n,right:r,top:o,bottom:i}},p=(e,t,n)=>{let r=t.target.parentNode;while(e>1){if(r=null==r?void 0:r.nextSibling,!r||"TR"!==r.nodeName)break;n(r,"hover-row hover-fixed-row"),e--}},h=(n,r,o)=>{var i;const s=t,a=zg(n),l=null==(i=null==s?void 0:s.vnode.el)?void 0:i.dataset.prefix;if(a){const t=Yg({columns:e.store.states.columns.value},a,l);a.rowSpan>1&&p(a.rowSpan,n,Jc);const o=s.hoverState={cell:a,column:t,row:r};null==s||s.emit("cell-mouse-enter",o.row,o.column,o.cell,n)}if(!o)return;const c=n.target.querySelector(".cell");if(!Yc(c,`${l}-tooltip`)||!c.childNodes.length)return;const u=document.createRange();u.setStart(c,0),u.setEnd(c,c.childNodes.length);let h=u.getBoundingClientRect().width,f=u.getBoundingClientRect().height;const g=h-Math.floor(h);g<.001&&(h=Math.floor(h));const m=f-Math.floor(f);m<.001&&(f=Math.floor(f));const{top:v,left:y,right:b,bottom:w}=d(c),C=y+b,S=v+w;(h+C>c.offsetWidth||f+S>c.offsetHeight||c.scrollWidth>c.offsetWidth)&&sm(o,a.innerText||a.textContent,a,s)},f=e=>{const n=zg(e);if(!n)return;n.rowSpan>1&&p(n.rowSpan,e,Zc);const r=null==t?void 0:t.hoverState;null==t||t.emit("cell-mouse-leave",null==r?void 0:r.row,null==r?void 0:r.column,null==r?void 0:r.cell,e)};return{handleDoubleClick:s,handleClick:a,handleContextMenu:l,handleMouseEnter:c,handleMouseLeave:u,handleCellMouseEnter:h,handleCellMouseLeave:f,tooltipContent:r,tooltipTrigger:o}}function rb(e){const t=(0,n.inject)(zv),r=c("table"),o=(e,n)=>{const r=null==t?void 0:t.props.rowStyle;return"function"===typeof r?r.call(null,{row:e,rowIndex:n}):r||null},i=(n,o)=>{const i=[r.e("row")];(null==t?void 0:t.props.highlightCurrentRow)&&n===e.store.states.currentRow.value&&i.push("current-row"),e.stripe&&o%2===1&&i.push(r.em("row","striped"));const s=null==t?void 0:t.props.rowClassName;return"string"===typeof s?i.push(s):"function"===typeof s&&i.push(s.call(null,{row:n,rowIndex:o})),i},s=(n,r,o,i)=>{const s=null==t?void 0:t.props.cellStyle;let a=null!=s?s:{};"function"===typeof s&&(a=s.call(null,{rowIndex:n,columnIndex:r,row:o,column:i}));const l=pm(r,null==e?void 0:e.fixed,e.store);return hm(l,"left"),hm(l,"right"),Object.assign({},a,l)},a=(n,o,i,s,a)=>{const l=um(r.b(),o,null==e?void 0:e.fixed,e.store,void 0,a),c=[s.id,s.align,s.className,...l],u=null==t?void 0:t.props.cellClassName;return"string"===typeof u?c.push(u):"function"===typeof u&&c.push(u.call(null,{rowIndex:n,columnIndex:o,row:i,column:s})),c.push(r.e("cell")),c.filter((e=>Boolean(e))).join(" ")},l=(e,n,r,o)=>{let i=1,s=1;const a=null==t?void 0:t.props.spanMethod;if("function"===typeof a){const t=a({row:e,column:n,rowIndex:r,columnIndex:o});Array.isArray(t)?(i=t[0],s=t[1]):"object"===typeof t&&(i=t.rowspan,s=t.colspan)}return{rowspan:i,colspan:s}},u=(e,t,n)=>{if(t<1)return e[n].realWidth;const r=e.map((({realWidth:e,width:t})=>e||t)).slice(n,n+t);return Number(r.reduce(((e,t)=>Number(e)+Number(t)),-1))};return{getRowStyle:o,getRowClass:i,getCellStyle:s,getCellClass:a,getSpan:l,getColspanRealWidth:u}}function ob(e){const t=(0,n.inject)(zv),r=c("table"),{handleDoubleClick:o,handleClick:i,handleContextMenu:s,handleMouseEnter:a,handleMouseLeave:l,handleCellMouseEnter:u,handleCellMouseLeave:d,tooltipContent:p,tooltipTrigger:h}=nb(e),{getRowStyle:f,getRowClass:g,getCellStyle:m,getCellClass:v,getSpan:y,getColspanRealWidth:b}=rb(e),w=(0,n.computed)((()=>e.store.states.columns.value.findIndex((({type:e})=>"default"===e)))),C=(e,n)=>{const r=t.props.rowKey;return r?Jg(e,r):n},S=(c,p,h,S=!1)=>{const{tooltipEffect:T,tooltipOptions:k,store:x}=e,{indent:N,columns:R}=x.states,I=g(c,p);let _=!0;h&&(I.push(r.em("row",`level-${h.level}`)),_=h.display);const O=_?null:{display:"none"};return(0,n.h)("tr",{style:[O,f(c,p)],class:I,key:C(c,p),onDblclick:e=>o(e,c),onClick:e=>i(e,c),onContextmenu:e=>s(e,c),onMouseenter:()=>a(p),onMouseleave:l},R.value.map(((r,o)=>{const{rowspan:i,colspan:s}=y(c,r,p,o);if(!i||!s)return null;const a=Object.assign({},r);a.realWidth=b(R.value,s,o);const l={store:e.store,_self:e.context||t,column:a,row:c,$index:p,cellIndex:o,expanded:S};o===w.value&&h&&(l.treeNode={indent:h.level*N.value,level:h.level},"boolean"===typeof h.expanded&&(l.treeNode.expanded=h.expanded,"loading"in h&&(l.treeNode.loading=h.loading),"noLazyChildren"in h&&(l.treeNode.noLazyChildren=h.noLazyChildren)));const f=`${p},${o}`,g=a.columnKey||a.rawColumnKey||"",C=E(o,r,l),x=r.showOverflowTooltip&&tb({effect:T},k,r.showOverflowTooltip);return(0,n.h)("td",{style:m(p,o,c,r),class:v(p,o,c,r,s-1),key:`${g}${f}`,rowspan:i,colspan:s,onMouseenter:e=>u(e,c,x),onMouseleave:d},[C])})))},E=(e,t,n)=>t.renderCell(n),T=(o,i)=>{const s=e.store,{isRowExpanded:a,assertRowKey:l}=s,{treeData:c,lazyTreeNodeMap:u,childrenColumnName:d,rowKey:p}=s.states,h=s.states.columns.value,f=h.some((({type:e})=>"expand"===e));if(f){const e=a(o),l=S(o,i,void 0,e),c=t.renderExpanded;return e?c?[[l,(0,n.h)("tr",{key:`expanded-row__${l.key}`},[(0,n.h)("td",{colspan:h.length,class:`${r.e("cell")} ${r.e("expanded-cell")}`},[c({row:o,$index:i,store:s,expanded:e})])])]]:(console.error("[Element Error]renderExpanded is required."),l):[[l]]}if(Object.keys(c.value).length){l();const e=Jg(o,p.value);let t=c.value[e],n=null;t&&(n={expanded:t.expanded,level:t.level,display:!0},"boolean"===typeof t.lazy&&("boolean"===typeof t.loaded&&t.loaded&&(n.noLazyChildren=!(t.children&&t.children.length)),n.loading=t.loading));const r=[S(o,i,n)];if(t){let n=0;const s=(e,o)=>{e&&e.length&&o&&e.forEach((e=>{const a={display:o.display&&o.expanded,level:o.level+1,expanded:!1,noLazyChildren:!1,loading:!1},l=Jg(e,p.value);if(void 0===l||null===l)throw new Error("For nested data item, row-key is required.");if(t={...c.value[l]},t&&(a.expanded=t.expanded,t.level=t.level||a.level,t.display=!(!t.expanded||!a.display),"boolean"===typeof t.lazy&&("boolean"===typeof t.loaded&&t.loaded&&(a.noLazyChildren=!(t.children&&t.children.length)),a.loading=t.loading)),n++,r.push(S(e,i+n,a)),t){const n=u.value[l]||e[d.value];s(n,t)}}))};t.display=!0;const a=u.value[e]||o[d.value];s(a,t)}return r}return S(o,i,void 0)};return{wrappedRowRender:T,tooltipContent:p,tooltipTrigger:h}}const ib={store:{required:!0,type:Object},stripe:Boolean,tooltipEffect:String,tooltipOptions:{type:Object},context:{default:()=>({}),type:Object},rowClassName:[String,Function],rowStyle:[Object,Function],fixed:{type:String,default:""},highlight:Boolean},sb=e=>Yr?window.requestAnimationFrame(e):setTimeout(e,16);var ab=(0,n.defineComponent)({name:"ElTableBody",props:ib,setup(e){const t=(0,n.getCurrentInstance)(),r=(0,n.inject)(zv),o=c("table"),{wrappedRowRender:i,tooltipContent:s,tooltipTrigger:a}=ob(e),{onColumnsChange:l,onScrollableChange:u}=Uv(r),d=[];return(0,n.watch)(e.store.states.hoverRow,((n,r)=>{var i;const s=null==t?void 0:t.vnode.el,a=Array.from((null==s?void 0:s.children)||[]).filter((e=>null==e?void 0:e.classList.contains(`${o.e("row")}`)));let l=n;const c=null==(i=a[l])?void 0:i.childNodes;if(null==c?void 0:c.length){const e=Array.from(c).reduce(((e,t,n)=>{var r,o;const i=(null==(r=c[n-1])?void 0:r.colSpan)>1,s=(null==(o=c[n+1])?void 0:o.colSpan)>1;return"TD"===t.nodeName||i||s||e.push(n),e}),[]);e.forEach((e=>{var t;while(l>0){const n=null==(t=a[l-1])?void 0:t.childNodes;if(n[e]&&"TD"===n[e].nodeName){Jc(n[e],"hover-cell"),d.push(n[e]);break}l--}}))}else d.forEach((e=>Zc(e,"hover-cell"))),d.length=0;e.store.states.isComplex.value&&Yr&&sb((()=>{const e=a[r],t=a[n];e&&!e.classList.contains("hover-fixed-row")&&Zc(e,"hover-row"),t&&Jc(t,"hover-row")}))})),(0,n.onUnmounted)((()=>{var e;null==(e=im)||e()})),{ns:o,onColumnsChange:l,onScrollableChange:u,wrappedRowRender:i,tooltipContent:s,tooltipTrigger:a}},render(){const{wrappedRowRender:e,store:t}=this,r=t.states.data.value||[];return(0,n.h)("tbody",{tabIndex:-1},[r.reduce(((t,n)=>t.concat(e(n,t.length))),[])])}});function lb(){const e=(0,n.inject)(zv),t=null==e?void 0:e.store,r=(0,n.computed)((()=>t.states.fixedLeafColumnsLength.value)),o=(0,n.computed)((()=>t.states.rightFixedColumns.value.length)),i=(0,n.computed)((()=>t.states.columns.value.length)),s=(0,n.computed)((()=>t.states.fixedColumns.value.length)),a=(0,n.computed)((()=>t.states.rightFixedColumns.value.length));return{leftFixedLeafCount:r,rightFixedLeafCount:o,columnsCount:i,leftFixedCount:s,rightFixedCount:a,columns:t.states.columns}}function cb(e){const{columns:t}=lb(),n=c("table"),r=(t,r)=>{const o=t[r],i=[n.e("cell"),o.id,o.align,o.labelClassName,...um(n.b(),r,o.fixed,e.store)];return o.className&&i.push(o.className),o.children||i.push(n.is("leaf")),i},o=(t,n)=>{const r=pm(n,t.fixed,e.store);return hm(r,"left"),hm(r,"right"),r};return{getCellClasses:r,getCellStyles:o,columns:t}}var ub=(0,n.defineComponent)({name:"ElTableFooter",props:{fixed:{type:String,default:""},store:{required:!0,type:Object},summaryMethod:Function,sumText:String,border:Boolean,defaultSort:{type:Object,default:()=>({prop:"",order:""})}},setup(e){const{getCellClasses:t,getCellStyles:n,columns:r}=cb(e),o=c("table");return{ns:o,getCellClasses:t,getCellStyles:n,columns:r}},render(){const{columns:e,getCellStyles:t,getCellClasses:r,summaryMethod:o,sumText:i}=this,s=this.store.states.data.value;let a=[];return o?a=o({columns:e,data:s}):e.forEach(((e,t)=>{if(0===t)return void(a[t]=i);const n=s.map((t=>Number(t[e.property]))),r=[];let o=!0;n.forEach((e=>{if(!Number.isNaN(+e)){o=!1;const t=`${e}`.split(".")[1];r.push(t?t.length:0)}}));const l=Math.max.apply(null,r);a[t]=o?"":n.reduce(((e,t)=>{const n=Number(t);return Number.isNaN(+n)?e:Number.parseFloat((e+t).toFixed(Math.min(l,20)))}),0)})),(0,n.h)((0,n.h)("tfoot",[(0,n.h)("tr",{},[...e.map(((o,i)=>(0,n.h)("td",{key:i,colspan:o.colSpan,rowspan:o.rowSpan,class:r(e,i),style:t(o,i)},[(0,n.h)("div",{class:["cell",o.labelClassName]},[a[i]])])))])]))}});function db(e){const t=t=>{e.commit("setCurrentRow",t)},n=()=>e.getSelectionRows(),r=(t,n)=>{e.toggleRowSelection(t,n,!1),e.updateAllSelected()},o=()=>{e.clearSelection()},i=t=>{e.clearFilter(t)},s=()=>{e.commit("toggleAllSelection")},a=(t,n)=>{e.toggleRowExpansionAdapter(t,n)},l=()=>{e.clearSort()},c=(t,n)=>{e.commit("sort",{prop:t,order:n})};return{setCurrentRow:t,getSelectionRows:n,toggleRowSelection:r,clearSelection:o,clearFilter:i,toggleAllSelection:s,toggleRowExpansion:a,clearSort:l,sort:c}}function pb(e,t,r,o){const i=(0,n.ref)(!1),s=(0,n.ref)(null),a=(0,n.ref)(!1),l=e=>{a.value=e},c=(0,n.ref)({width:null,height:null,headerHeight:null}),u=(0,n.ref)(!1),d={display:"inline-block",verticalAlign:"middle"},p=(0,n.ref)(),h=(0,n.ref)(0),f=(0,n.ref)(0),g=(0,n.ref)(0),m=(0,n.ref)(0),v=(0,n.ref)(0);(0,n.watchEffect)((()=>{t.setHeight(e.height)})),(0,n.watchEffect)((()=>{t.setMaxHeight(e.maxHeight)})),(0,n.watch)((()=>[e.currentRowKey,r.states.rowKey]),(([e,t])=>{(0,n.unref)(t)&&(0,n.unref)(e)&&r.setCurrentRowKey(`${e}`)}),{immediate:!0}),(0,n.watch)((()=>e.data),(e=>{o.store.commit("setData",e)}),{immediate:!0,deep:!0}),(0,n.watchEffect)((()=>{e.expandRowKeys&&r.setExpandRowKeysAdapter(e.expandRowKeys)}));const y=()=>{o.store.commit("setHoverRow",null),o.hoverState&&(o.hoverState=null)},b=(e,t)=>{const{pixelX:n,pixelY:r}=t;Math.abs(n)>=Math.abs(r)&&(o.refs.bodyWrapper.scrollLeft+=t.pixelX/5)},w=(0,n.computed)((()=>e.height||e.maxHeight||r.states.fixedColumns.value.length>0||r.states.rightFixedColumns.value.length>0)),C=(0,n.computed)((()=>({width:t.bodyWidth.value?`${t.bodyWidth.value}px`:""}))),S=()=>{w.value&&t.updateElsHeight(),t.updateColumnsWidth(),requestAnimationFrame(x)};(0,n.onMounted)((async()=>{await(0,n.nextTick)(),r.updateColumns(),N(),requestAnimationFrame(S);const t=o.vnode.el,i=o.refs.headerWrapper;e.flexible&&t&&t.parentElement&&(t.parentElement.style.minWidth="0"),c.value={width:p.value=t.offsetWidth,height:t.offsetHeight,headerHeight:e.showHeader&&i?i.offsetHeight:null},r.states.columns.value.forEach((e=>{e.filteredValue&&e.filteredValue.length&&o.store.commit("filterChange",{column:e,values:e.filteredValue,silent:!0})})),o.$ready=!0}));const E=(e,n)=>{if(!e)return;const r=Array.from(e.classList).filter((e=>!e.startsWith("is-scrolling-")));r.push(t.scrollX.value?n:"is-scrolling-none"),e.className=r.join(" ")},T=e=>{const{tableWrapper:t}=o.refs;E(t,e)},k=e=>{const{tableWrapper:t}=o.refs;return!(!t||!t.classList.contains(e))},x=function(){if(!o.refs.scrollBarRef)return;if(!t.scrollX.value){const e="is-scrolling-none";return void(k(e)||T(e))}const e=o.refs.scrollBarRef.wrapRef;if(!e)return;const{scrollLeft:n,offsetWidth:r,scrollWidth:i}=e,{headerWrapper:s,footerWrapper:a}=o.refs;s&&(s.scrollLeft=n),a&&(a.scrollLeft=n);const l=i-r-1;T(n>=l?"is-scrolling-right":0===n?"is-scrolling-left":"is-scrolling-middle")},N=()=>{o.refs.scrollBarRef&&(o.refs.scrollBarRef.wrapRef&&qs(o.refs.scrollBarRef.wrapRef,"scroll",x,{passive:!0}),e.fit?Qs(o.vnode.el,R):qs(window,"resize",R),Qs(o.refs.bodyWrapper,(()=>{var e,t;R(),null==(t=null==(e=o.refs)?void 0:e.scrollBarRef)||t.update()})))},R=()=>{var t,n,r,i;const s=o.vnode.el;if(!o.$ready||!s)return;let a=!1;const{width:l,height:u,headerHeight:d}=c.value,y=p.value=s.offsetWidth;l!==y&&(a=!0);const b=s.offsetHeight;(e.height||w.value)&&u!==b&&(a=!0);const C="fixed"===e.tableLayout?o.refs.headerWrapper:null==(t=o.refs.tableHeaderRef)?void 0:t.$el;e.showHeader&&(null==C?void 0:C.offsetHeight)!==d&&(a=!0),h.value=(null==(n=o.refs.tableWrapper)?void 0:n.scrollHeight)||0,g.value=(null==C?void 0:C.scrollHeight)||0,m.value=(null==(r=o.refs.footerWrapper)?void 0:r.offsetHeight)||0,v.value=(null==(i=o.refs.appendWrapper)?void 0:i.offsetHeight)||0,f.value=h.value-g.value-m.value-v.value,a&&(c.value={width:y,height:b,headerHeight:e.showHeader&&(null==C?void 0:C.offsetHeight)||0},S())},I=Bm(),_=(0,n.computed)((()=>{const{bodyWidth:e,scrollY:n,gutterWidth:r}=t;return e.value?e.value-(n.value?r:0)+"px":""})),O=(0,n.computed)((()=>e.maxHeight?"fixed":e.tableLayout)),A=(0,n.computed)((()=>{if(e.data&&e.data.length)return null;let t="100%";e.height&&f.value&&(t=`${f.value}px`);const n=p.value;return{width:n?`${n}px`:"",height:t}})),B=(0,n.computed)((()=>e.height?{height:Number.isNaN(Number(e.height))?e.height:`${e.height}px`}:e.maxHeight?{maxHeight:Number.isNaN(Number(e.maxHeight))?e.maxHeight:`${e.maxHeight}px`}:{})),D=(0,n.computed)((()=>e.height?{height:"100%"}:e.maxHeight?Number.isNaN(Number(e.maxHeight))?{maxHeight:`calc(${e.maxHeight} - ${g.value+m.value}px)`}:{maxHeight:e.maxHeight-g.value-m.value+"px"}:{})),P=(e,t)=>{const n=o.refs.bodyWrapper;if(Math.abs(t.spinY)>0){const r=n.scrollTop;t.pixelY<0&&0!==r&&e.preventDefault(),t.pixelY>0&&n.scrollHeight-n.clientHeight>r&&e.preventDefault(),n.scrollTop+=Math.ceil(t.pixelY/5)}else n.scrollLeft+=Math.ceil(t.pixelX/5)};return{isHidden:i,renderExpanded:s,setDragVisible:l,isGroup:u,handleMouseLeave:y,handleHeaderFooterMousewheel:b,tableSize:I,emptyBlockStyle:A,handleFixedMousewheel:P,resizeProxyVisible:a,bodyWidth:_,resizeState:c,doLayout:S,tableBodyStyles:C,tableLayout:O,scrollbarViewStyle:d,tableInnerStyle:B,scrollbarStyle:D}}function hb(e){const t=(0,n.ref)(),r=()=>{const n=e.vnode.el,r=n.querySelector(".hidden-columns"),o={childList:!0,subtree:!0},i=e.store.states.updateOrderFns;t.value=new MutationObserver((()=>{i.forEach((e=>e()))})),t.value.observe(r,o)};(0,n.onMounted)((()=>{r()})),(0,n.onUnmounted)((()=>{var e;null==(e=t.value)||e.disconnect()}))}var fb={data:{type:Array,default:()=>[]},size:Hn,width:[String,Number],height:[String,Number],maxHeight:[String,Number],fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,rowKey:[String,Function],showHeader:{type:Boolean,default:!0},showSummary:Boolean,sumText:String,summaryMethod:Function,rowClassName:[String,Function],rowStyle:[Object,Function],cellClassName:[String,Function],cellStyle:[Object,Function],headerRowClassName:[String,Function],headerRowStyle:[Object,Function],headerCellClassName:[String,Function],headerCellStyle:[Object,Function],highlightCurrentRow:Boolean,currentRowKey:[String,Number],emptyText:String,expandRowKeys:Array,defaultExpandAll:Boolean,defaultSort:Object,tooltipEffect:String,tooltipOptions:Object,spanMethod:Function,selectOnIndeterminate:{type:Boolean,default:!0},indent:{type:Number,default:16},treeProps:{type:Object,default:()=>({hasChildren:"hasChildren",children:"children"})},lazy:Boolean,load:Function,style:{type:Object,default:()=>({})},className:{type:String,default:""},tableLayout:{type:String,default:"fixed"},scrollbarAlwaysOn:{type:Boolean,default:!1},flexible:Boolean,showOverflowTooltip:[Boolean,Object]};function gb(e){const t="auto"===e.tableLayout;let r=e.columns||[];t&&r.every((e=>void 0===e.width))&&(r=[]);const o=n=>{const r={key:`${e.tableLayout}_${n.id}`,style:{},name:void 0};return t?r.style={width:`${n.width}px`}:r.name=n.id,r};return(0,n.h)("colgroup",{},r.map((e=>(0,n.h)("col",o(e)))))}gb.props=["columns","tableLayout"];const mb=()=>{const e=(0,n.ref)(),t=(t,n)=>{const r=e.value;r&&r.scrollTo(t,n)},r=(t,n)=>{const r=e.value;r&&yn(n)&&["Top","Left"].includes(t)&&r[`setScroll${t}`](n)},o=e=>r("Top",e),i=e=>r("Left",e);return{scrollBarRef:e,scrollTo:t,setScrollTop:o,setScrollLeft:i}};var vb,yb,bb,wb,Cb,Sb,Eb,Tb,kb,xb,Nb,Rb,Ib,_b,Ob,Ab=!1;function Bb(){if(!Ab){Ab=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(Rb=/\b(iPhone|iP[ao]d)/.exec(e),Ib=/\b(iP[ao]d)/.exec(e),xb=/Android/i.exec(e),_b=/FBAN\/\w+;/i.exec(e),Ob=/Mobile/i.exec(e),Nb=!!/Win64/.exec(e),t){vb=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,vb&&document&&document.documentMode&&(vb=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);Sb=r?parseFloat(r[1])+4:vb,yb=t[2]?parseFloat(t[2]):NaN,bb=t[3]?parseFloat(t[3]):NaN,wb=t[4]?parseFloat(t[4]):NaN,wb?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),Cb=t&&t[1]?parseFloat(t[1]):NaN):Cb=NaN}else vb=yb=bb=Cb=wb=NaN;if(n){if(n[1]){var o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);Eb=!o||parseFloat(o[1].replace("_","."))}else Eb=!1;Tb=!!n[2],kb=!!n[3]}else Eb=Tb=kb=!1}}var Db,Pb={ie:function(){return Bb()||vb},ieCompatibilityMode:function(){return Bb()||Sb>vb},ie64:function(){return Pb.ie()&&Nb},firefox:function(){return Bb()||yb},opera:function(){return Bb()||bb},webkit:function(){return Bb()||wb},safari:function(){return Pb.webkit()},chrome:function(){return Bb()||Cb},windows:function(){return Bb()||Tb},osx:function(){return Bb()||Eb},linux:function(){return Bb()||kb},iphone:function(){return Bb()||Rb},mobile:function(){return Bb()||Rb||Ib||xb||Ob},nativeApp:function(){return Bb()||_b},android:function(){return Bb()||xb},ipad:function(){return Bb()||Ib}},Hb=Pb,Mb=!!(typeof window<"u"&&window.document&&window.document.createElement),jb={canUseDOM:Mb,canUseWorkers:typeof Worker<"u",canUseEventListeners:Mb&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:Mb&&!!window.screen,isInWorker:!Mb},Vb=jb;function Lb(e,t){if(!Vb.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var o=document.createElement("div");o.setAttribute(n,"return;"),r="function"==typeof o[n]}return!r&&Db&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}Vb.canUseDOM&&(Db=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("",""));var $b=Lb,qb=10,Fb=40,Ub=800;function zb(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*qb,o=n*qb,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=Fb,o*=Fb):(r*=Ub,o*=Ub)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}zb.getEventType=function(){return Hb.firefox()?"DOMMouseScroll":$b("wheel")?"wheel":"mousewheel"};var Kb=zb;
35
35
  /**
36
36
  * Checks if an event is supported in the current execution environment.
37
37
  *
@@ -45,5 +45,5 @@ var Al=(0,n.defineComponent)({name:"ArrowDown",__name:"arrow-down",setup(e){retu
45
45
  * @return {boolean} True if the event is supported.
46
46
  * @internal
47
47
  * @license Modernizr 3.0.0pre (Custom Build) | MIT
48
- */const Hb=function(e,t){if(e&&e.addEventListener){const n=function(e){const n=Pb(e);t&&Reflect.apply(t,this,[e,n])};e.addEventListener("wheel",n,{passive:!0})}},Mb={beforeMount(e,t){Hb(e,t.value)}};let jb=1;const Vb=(0,n.defineComponent)({name:"ElTable",directives:{Mousewheel:Mb},components:{TableHeader:$v,TableBody:Jy,TableFooter:Qy,ElScrollbar:fd,hColgroup:ob},props:rb,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t:t}=en(),r=c("table"),o=(0,n.getCurrentInstance)();(0,n.provide)(Dv,o);const i=hm(o,e);o.store=i;const s=new vm({store:o.store,table:o,fit:e.fit,showHeader:e.showHeader});o.layout=s;const a=(0,n.computed)((()=>0===(i.states.data.value||[]).length)),{setCurrentRow:l,getSelectionRows:u,toggleRowSelection:d,clearSelection:p,clearFilter:h,toggleAllSelection:f,toggleRowExpansion:g,clearSort:m,sort:v}=eb(i),{isHidden:y,renderExpanded:b,setDragVisible:w,isGroup:C,handleMouseLeave:S,handleHeaderFooterMousewheel:E,tableSize:T,emptyBlockStyle:k,handleFixedMousewheel:x,resizeProxyVisible:N,bodyWidth:R,resizeState:I,doLayout:_,tableBodyStyles:O,tableLayout:A,scrollbarViewStyle:B,tableInnerStyle:D,scrollbarStyle:P}=tb(e,s,i,o),{scrollBarRef:H,scrollTo:M,setScrollLeft:j,setScrollTop:V}=ib(),$=Ju(_,50),L=`${r.namespace.value}-table_${jb++}`;o.tableId=L,o.state={isGroup:C,resizeState:I,doLayout:_,debouncedUpdateLayout:$};const q=(0,n.computed)((()=>e.sumText||t("el.table.sumText"))),F=(0,n.computed)((()=>e.emptyText||t("el.table.emptyText")));return nb(o),{ns:r,layout:s,store:i,handleHeaderFooterMousewheel:E,handleMouseLeave:S,tableId:L,tableSize:T,isHidden:y,isEmpty:a,renderExpanded:b,resizeProxyVisible:N,resizeState:I,isGroup:C,bodyWidth:R,tableBodyStyles:O,emptyBlockStyle:k,debouncedUpdateLayout:$,handleFixedMousewheel:x,setCurrentRow:l,getSelectionRows:u,toggleRowSelection:d,clearSelection:p,clearFilter:h,toggleAllSelection:f,toggleRowExpansion:g,clearSort:m,doLayout:_,sort:v,t:t,setDragVisible:w,context:o,computedSumText:q,computedEmptyText:F,tableLayout:A,scrollbarViewStyle:B,tableInnerStyle:D,scrollbarStyle:P,scrollBarRef:H,scrollTo:M,setScrollLeft:j,setScrollTop:V}}}),$b=["data-prefix"],Lb={ref:"hiddenColumns",class:"hidden-columns"};function qb(e,t,r,o,i,s){const a=(0,n.resolveComponent)("hColgroup"),l=(0,n.resolveComponent)("table-header"),c=(0,n.resolveComponent)("table-body"),u=(0,n.resolveComponent)("table-footer"),d=(0,n.resolveComponent)("el-scrollbar"),p=(0,n.resolveDirective)("mousewheel");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"tableWrapper",class:(0,n.normalizeClass)([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:0!==(e.store.states.data.value||[]).length&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:(0,n.normalizeStyle)(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=(...t)=>e.handleMouseLeave&&e.handleMouseLeave(...t))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("inner-wrapper")),style:(0,n.normalizeStyle)(e.tableInnerStyle)},[(0,n.createElementVNode)("div",Lb,[(0,n.renderSlot)(e.$slots,"default")],512),e.showHeader&&"fixed"===e.tableLayout?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"headerWrapper",class:(0,n.normalizeClass)(e.ns.e("header-wrapper"))},[(0,n.createElementVNode)("table",{ref:"tableHeader",class:(0,n.normalizeClass)(e.ns.e("header")),style:(0,n.normalizeStyle)(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),(0,n.createVNode)(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[p,e.handleHeaderFooterMousewheel]]):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref:"bodyWrapper",class:(0,n.normalizeClass)(e.ns.e("body-wrapper"))},[(0,n.createVNode)(d,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("table",{ref:"tableBody",class:(0,n.normalizeClass)(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:(0,n.normalizeStyle)({width:e.bodyWidth,tableLayout:e.tableLayout})},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&"auto"===e.tableLayout?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,ref:"tableHeaderRef",class:(0,n.normalizeClass)(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","onSetDragVisible"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(c,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&"auto"===e.tableLayout?((0,n.openBlock)(),(0,n.createBlock)(u,{key:1,class:(0,n.normalizeClass)(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):(0,n.createCommentVNode)("v-if",!0)],6),e.isEmpty?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"emptyBlock",style:(0,n.normalizeStyle)(e.emptyBlockStyle),class:(0,n.normalizeClass)(e.ns.e("empty-block"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.ns.e("empty-text"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.computedEmptyText),1)]))],2)],6)):(0,n.createCommentVNode)("v-if",!0),e.$slots.append?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,ref:"appendWrapper",class:(0,n.normalizeClass)(e.ns.e("append-wrapper"))},[(0,n.renderSlot)(e.$slots,"append")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary&&"fixed"===e.tableLayout?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,ref:"footerWrapper",class:(0,n.normalizeClass)(e.ns.e("footer-wrapper"))},[(0,n.createElementVNode)("table",{class:(0,n.normalizeClass)(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:(0,n.normalizeStyle)(e.tableBodyStyles)},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),(0,n.createVNode)(u,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[n.vShow,!e.isEmpty],[p,e.handleHeaderFooterMousewheel]]):(0,n.createCommentVNode)("v-if",!0),e.border||e.isGroup?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)(e.ns.e("border-left-patch"))},null,2)):(0,n.createCommentVNode)("v-if",!0)],6),(0,n.withDirectives)((0,n.createElementVNode)("div",{ref:"resizeProxy",class:(0,n.normalizeClass)(e.ns.e("column-resize-proxy"))},null,2),[[n.vShow,e.resizeProxyVisible]])],46,$b)}var Fb=Cr(Vb,[["render",qb],["__file","table.vue"]]);const Ub={selection:"table-column--selection",expand:"table__expand-column"},zb={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Kb=e=>Ub[e]||"",Wb={selection:{renderHeader({store:e,column:t}){function r(){return e.states.data.value&&0===e.states.data.value.length}return(0,n.h)(Cv,{disabled:r(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:r,$index:o}){return(0,n.h)(Cv,{disabled:!!t.selectable&&!t.selectable.call(null,e,o),size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",e)},onClick:e=>e.stopPropagation(),modelValue:r.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let r=t+1;const o=e.index;return"number"===typeof o?r=t+o:"function"===typeof o&&(r=o(t)),(0,n.h)("div",{},[r])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:r}){const{ns:o}=t,i=[o.e("expand-icon")];r&&i.push(o.em("expand-icon","expanded"));const s=function(n){n.stopPropagation(),t.toggleRowExpansion(e)};return(0,n.h)("div",{class:i,onClick:s},{default:()=>[(0,n.h)(wu,null,{default:()=>[(0,n.h)(Ml)]})]})},sortable:!1,resizable:!1}};function Gb({row:e,column:t,$index:n}){var r;const o=t.property,i=o&&nr(e,o).value;return t&&t.formatter?t.formatter(e,t,i,n):(null==(r=null==i?void 0:i.toString)?void 0:r.call(i))||""}function Yb({row:e,treeNode:t,store:r},o=!1){const{ns:i}=r;if(!t)return o?[(0,n.h)("span",{class:i.e("placeholder")})]:null;const s=[],a=function(n){n.stopPropagation(),t.loading||r.loadOrToggle(e)};if(t.indent&&s.push((0,n.h)("span",{class:i.e("indent"),style:{"padding-left":`${t.indent}px`}})),"boolean"!==typeof t.expanded||t.noLazyChildren)s.push((0,n.h)("span",{class:i.e("placeholder")}));else{const e=[i.e("expand-icon"),t.expanded?i.em("expand-icon","expanded"):""];let r=Ml;t.loading&&(r=tc),s.push((0,n.h)("div",{class:e,onClick:a},{default:()=>[(0,n.h)(wu,{class:{[i.is("loading")]:t.loading}},{default:()=>[(0,n.h)(r)]})]}))}return s}function Jb(e,t){return e.reduce(((e,t)=>(e[t]=t,e)),t)}function Zb(e,t){const r=(0,n.getCurrentInstance)(),o=()=>{const o=["fixed"],i={realWidth:"width",realMinWidth:"minWidth"},s=Jb(o,i);Object.keys(s).forEach((o=>{const s=i[o];rn(t,s)&&(0,n.watch)((()=>t[s]),(t=>{let n=t;"width"===s&&"realWidth"===o&&(n=qg(t)),"minWidth"===s&&"realMinWidth"===o&&(n=Fg(t)),r.columnConfig.value[s]=n,r.columnConfig.value[o]=n;const i="fixed"===s;e.value.store.scheduleLayout(i)}))}))},i=()=>{const e=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip"],o={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},i=Jb(e,o);Object.keys(i).forEach((e=>{const i=o[e];rn(t,i)&&(0,n.watch)((()=>t[i]),(t=>{r.columnConfig.value[e]=t}))}))};return{registerComplexWatchers:o,registerNormalWatchers:i}}function Xb(e,t,r){const o=(0,n.getCurrentInstance)(),i=(0,n.ref)(""),s=(0,n.ref)(!1),a=(0,n.ref)(),l=(0,n.ref)(),u=c("table");(0,n.watchEffect)((()=>{a.value=e.align?`is-${e.align}`:null,a.value})),(0,n.watchEffect)((()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value}));const d=(0,n.computed)((()=>{let e=o.vnode.vParent||o.parent;while(e&&!e.tableId&&!e.columnId)e=e.vnode.vParent||e.parent;return e})),p=(0,n.computed)((()=>{const{store:e}=o.parent;if(!e)return!1;const{treeData:t}=e.states,n=t.value;return n&&Object.keys(n).length>0})),h=(0,n.ref)(qg(e.width)),f=(0,n.ref)(Fg(e.minWidth)),g=e=>(h.value&&(e.width=h.value),f.value&&(e.minWidth=f.value),!h.value&&f.value&&(e.width=void 0),e.minWidth||(e.minWidth=80),e.realWidth=Number(void 0===e.width?e.minWidth:e.width),e),m=e=>{const t=e.type,r=Wb[t]||{};Object.keys(r).forEach((t=>{const n=r[t];"className"!==t&&void 0!==n&&(e[t]=n)}));const o=Kb(t);if(o){const t=`${(0,n.unref)(u.namespace)}-${o}`;e.className=e.className?`${e.className} ${t}`:t}return e},v=e=>{function t(e){var t;"ElTableColumn"===(null==(t=null==e?void 0:e.type)?void 0:t.name)&&(e.vParent=o)}Array.isArray(e)?e.forEach((e=>t(e))):t(e)},y=i=>{e.renderHeader?Nn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):"selection"!==i.type&&(i.renderHeader=e=>(o.columnConfig.value["label"],(0,n.renderSlot)(t,"header",e,(()=>[i.label]))));let s=i.renderCell;return"expand"===i.type?(i.renderCell=e=>(0,n.h)("div",{class:"cell"},[s(e)]),r.value.renderExpanded=e=>t.default?t.default(e):t.default):(s=s||Gb,i.renderCell=e=>{let o=null;if(t.default){const r=t.default(e);o=r.some((e=>e.type!==n.Comment))?r:s(e)}else o=s(e);const{columns:a}=r.value.store.states,l=a.value.findIndex((e=>"default"===e.type)),c=p.value&&e.cellIndex===l,d=Yb(e,c),h={class:"cell",style:{}};return i.showOverflowTooltip&&(h.class=`${h.class} ${(0,n.unref)(u.namespace)}-tooltip`,h.style={width:(e.column.realWidth||Number(e.column.width))-1+"px"}),v(o),(0,n.h)("div",h,[d,o])}),i},b=(...t)=>t.reduce(((t,n)=>(Array.isArray(n)&&n.forEach((n=>{t[n]=e[n]})),t)),{}),w=(e,t)=>Array.prototype.indexOf.call(e,t),C=()=>{r.value.store.commit("updateColumnOrder",o.columnConfig.value)};return{columnId:i,realAlign:a,isSubColumn:s,realHeaderAlign:l,columnOrTableParent:d,setColumnWidth:g,setColumnForcedProps:m,setColumnRenders:y,getPropsData:b,getColumnElIndex:w,updateColumnOrder:C}}var Qb={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every((e=>["ascending","descending",null].includes(e)))}};let ew=1;var tw=(0,n.defineComponent)({name:"ElTableColumn",components:{ElCheckbox:Cv},props:Qb,setup(e,{slots:t}){const r=(0,n.getCurrentInstance)(),o=(0,n.ref)({}),i=(0,n.computed)((()=>{let e=r.parent;while(e&&!e.tableId)e=e.parent;return e})),{registerNormalWatchers:s,registerComplexWatchers:a}=Zb(i,e),{columnId:l,isSubColumn:c,realHeaderAlign:u,columnOrTableParent:d,setColumnWidth:p,setColumnForcedProps:h,setColumnRenders:f,getPropsData:g,getColumnElIndex:m,realAlign:v,updateColumnOrder:y}=Xb(e,t,i),b=d.value;l.value=`${b.tableId||b.columnId}_column_${ew++}`,(0,n.onBeforeMount)((()=>{c.value=i.value!==b;const t=e.type||"default",n=""===e.sortable||e.sortable,d=mn(e.showOverflowTooltip)?b.props.showOverflowTooltip:e.showOverflowTooltip,m={...zb[t],id:l.value,type:t,property:e.prop||e.property,align:v,headerAlign:u,showOverflowTooltip:d,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:n,index:e.index,rawColumnKey:r.vnode.key},y=["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],w=["sortMethod","sortBy","sortOrders"],C=["selectable","reserveSelection"],S=["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"];let E=g(y,w,C,S);E=Lg(m,E);const T=zg(f,p,h);E=T(E),o.value=E,s(),a()})),(0,n.onMounted)((()=>{var e;const t=d.value,n=c.value?t.vnode.el.children:null==(e=t.refs.hiddenColumns)?void 0:e.children,s=()=>m(n||[],r.vnode.el);o.value.getColumnIndex=s;const a=s();a>-1&&i.value.store.commit("insertColumn",o.value,c.value?t.columnConfig.value:null,y)})),(0,n.onBeforeUnmount)((()=>{i.value.store.commit("removeColumn",o.value,c.value?b.columnConfig.value:null,y)})),r.columnId=l.value,r.columnConfig=o},render(){var e,t,r;try{const o=null==(t=(e=this.$slots).default)?void 0:t.call(e,{row:{},column:{},$index:-1}),i=[];if(Array.isArray(o))for(const e of o)"ElTableColumn"===(null==(r=e.type)?void 0:r.name)||2&e.shapeFlag?i.push(e):e.type===n.Fragment&&Array.isArray(e.children)&&e.children.forEach((e=>{1024===(null==e?void 0:e.patchFlag)||an(null==e?void 0:e.children)||i.push(e)}));const s=(0,n.h)("div",i);return s}catch(o){return(0,n.h)("div",[])}}});const nw=dr(Fb,{TableColumn:tw}),rw=fr(tw),ow=Dn({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"}}),iw=["textContent"],sw=(0,n.defineComponent)({name:"ElBadge"}),aw=(0,n.defineComponent)({...sw,props:ow,setup(e,{expose:t}){const r=e,o=c("badge"),i=(0,n.computed)((()=>r.isDot?"":yn(r.value)&&yn(r.max)&&r.max<r.value?`${r.max}+`:`${r.value}`));return t({content:i}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(o).b())},[(0,n.renderSlot)(e.$slots,"default"),(0,n.createVNode)(n.Transition,{name:`${(0,n.unref)(o).namespace.value}-zoom-in-center`,persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("sup",{class:(0,n.normalizeClass)([(0,n.unref)(o).e("content"),(0,n.unref)(o).em("content",e.type),(0,n.unref)(o).is("fixed",!!e.$slots.default),(0,n.unref)(o).is("dot",e.isDot)]),textContent:(0,n.toDisplayString)((0,n.unref)(i))},null,10,iw),[[n.vShow,!e.hidden&&((0,n.unref)(i)||e.isDot)]])])),_:1},8,["name"])],2))}});var lw=Cr(aw,[["__file","badge.vue"]]);const cw=dr(lw),uw=e=>((0,n.pushScopeId)("data-v-c2152182"),e=e(),(0,n.popScopeId)(),e),dw={class:"call-queue-bar"},pw=uw((()=>(0,n.createElementVNode)("div",{class:"queue-btn"},[(0,n.createElementVNode)("span",null,"呼叫队列"),(0,n.createElementVNode)("i",{class:"ue-ccc ue-cccDown",style:{"font-size":"12px"}})],-1))),hw={class:"flex-box justify-item"},fw=uw((()=>(0,n.createElementVNode)("div",{class:"blue-txt border-bto padding-bot"},"我所在的服务组",-1))),gw={class:"padding-bot"},mw=(0,n.createTextVNode)(" 当前排队数:"),vw={class:"blue-txt"},yw=(0,n.createTextVNode)("个 "),bw={class:"queue-collapse"},ww={class:"flex-box justify-item"},Cw={class:"flex-box"},Sw={class:"mar-r16"},Ew=uw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"登录:",-1))),Tw={class:"mar-r16"},kw=uw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"空闲:",-1))),xw={class:"blue-txt"},Nw={class:"mar-r16"},Rw=uw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"通话中:",-1))),Iw={class:"mar-r16"},_w=uw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"当前排队客户:",-1)));var Ow=(0,n.defineComponent)({props:{callQueueBarMsg:{type:Object,default:()=>null}},setup(e){const t=e,r=(0,n.ref)(!1),o=(0,n.ref)(""),i=(0,n.ref)([]),s=(0,n.ref)(0),a=async()=>{r.value=!0,document.addEventListener("click",l)},l=async e=>{await(0,n.nextTick)();const t=document.getElementsByClassName("call-queue-pop")[0],o=document.getElementsByClassName("queue-btn")[0];t&&t.contains(e.target)||o&&o.contains(e.target)||(r.value=!1)},c=e=>e.reduce(((e,t)=>e+t.currentWait),0);return(0,n.watch)(t,(()=>{null!=t.callQueueBarMsg&&(i.value=t.callQueueBarMsg,s.value="{}"!=JSON.stringify(i.value)?c(i.value):0)}),{immediate:!0,deep:!0}),(e,t)=>{const l=cw,c=rw,u=nw,d=_u,p=Iu,h=Jc;return(0,n.openBlock)(),(0,n.createBlock)(h,{placement:"bottom",visible:r.value,"popper-class":"call-queue-pop",width:560},{reference:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",dw,[(0,n.createVNode)(l,{value:s.value,max:99,onClick:a},{default:(0,n.withCtx)((()=>[pw])),_:1},8,["value"])])])),default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("div",hw,[fw,(0,n.createElementVNode)("div",gw,[mw,(0,n.createElementVNode)("span",vw,(0,n.toDisplayString)(s.value),1),yw])]),(0,n.createElementVNode)("div",bw,[(0,n.createVNode)(p,{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),accordion:""},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i.value,((e,t)=>((0,n.openBlock)(),(0,n.createBlock)(d,{name:e.queueNumber,key:t},{title:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",ww,[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(e.queueName+"("+e.queueNumber+")"),1),(0,n.createElementVNode)("div",Cw,[(0,n.createElementVNode)("div",Sw,[Ew,(0,n.createTextVNode)((0,n.toDisplayString)(e.onlineCount),1)]),(0,n.createElementVNode)("div",Tw,[kw,(0,n.createElementVNode)("span",xw,(0,n.toDisplayString)(e.idleCount),1)]),(0,n.createElementVNode)("div",Nw,[Rw,(0,n.createTextVNode)((0,n.toDisplayString)(e.callingCount),1)]),(0,n.createElementVNode)("div",Iw,[_w,(0,n.createTextVNode)((0,n.toDisplayString)(e.currentWait),1)])])])])),default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{data:e.currentQueue,"max-height":"180",style:{width:"100%"}},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{prop:"customerNumber",label:"客户号码"}),(0,n.createVNode)(c,{prop:"trunkNumber",label:"服务号"}),(0,n.createVNode)(c,{prop:"queueStartTime",label:"开始时间",width:"180"}),(0,n.createVNode)(c,{prop:"waitDuration",label:"排队时长"},{default:(0,n.withCtx)((e=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.row.waitDuration),1)])),_:1})])),_:2},1032,["data"])])),_:2},1032,["name"])))),128))])),_:1},8,["modelValue"])])])])),_:1},8,["visible"])}}}),Aw=__webpack_require__(559);const Bw=(0,Aw.A)(Ow,[["__scopeId","data-v-c2152182"]]);var Dw=Bw;const Pw=Symbol("buttonGroupContextKey"),Hw=({from:e,replacement:t,scope:r,version:o,ref:i,type:s="API"},a)=>{(0,n.watch)((()=>(0,n.unref)(a)),(n=>{n&&Nn(r,`[${s}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.\nFor more detail, please visit: ${i}\n`)}),{immediate:!0})},Mw=(e,t)=>{Hw({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},(0,n.computed)((()=>"text"===e.type)));const r=(0,n.inject)(Pw,void 0),o=or("button"),{form:i}=km(),s=Sm((0,n.computed)((()=>null==r?void 0:r.size))),a=Em(),l=(0,n.ref)(),c=(0,n.useSlots)(),u=(0,n.computed)((()=>e.type||(null==r?void 0:r.type)||"")),d=(0,n.computed)((()=>{var t,n,r;return null!=(r=null!=(n=e.autoInsertSpace)?n:null==(t=o.value)?void 0:t.autoInsertSpace)&&r})),p=(0,n.computed)((()=>"button"===e.tag?{ariaDisabled:a.value||e.loading,disabled:a.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{})),h=(0,n.computed)((()=>{var e;const t=null==(e=c.default)?void 0:e.call(c);if(d.value&&1===(null==t?void 0:t.length)){const e=t[0];if((null==e?void 0:e.type)===n.Text){const t=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(t.trim())}}return!1})),f=n=>{"reset"===e.nativeType&&(null==i||i.resetFields()),t("click",n)};return{_disabled:a,_size:s,_type:u,_ref:l,_props:p,shouldAddSpace:h,handleClick:f}},jw=["default","primary","success","warning","info","danger","text",""],Vw=["button","submit","reset"],$w=Dn({size:Hn,disabled:Boolean,type:{type:String,values:jw,default:""},icon:{type:pc},nativeType:{type:String,values:Vw,default:"button"},loading:Boolean,loadingIcon:{type:pc,default:()=>tc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:On([String,Object]),default:"button"}}),Lw={click:e=>e instanceof MouseEvent};function qw(e,t){Uw(e)&&(e="100%");var n=zw(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function Fw(e){return Math.min(1,Math.max(0,e))}function Uw(e){return"string"===typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)}function zw(e){return"string"===typeof e&&-1!==e.indexOf("%")}function Kw(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ww(e){return e<=1?"".concat(100*Number(e),"%"):e}function Gw(e){return 1===e.length?"0"+e:String(e)}function Yw(e,t,n){return{r:255*qw(e,255),g:255*qw(t,255),b:255*qw(n,255)}}function Jw(e,t,n){e=qw(e,255),t=qw(t,255),n=qw(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,s=0,a=(r+o)/2;if(r===o)s=0,i=0;else{var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break;default:break}i/=6}return{h:i,s:s,l:a}}function Zw(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Xw(e,t,n){var r,o,i;if(e=qw(e,360),t=qw(t,100),n=qw(n,100),0===t)o=n,i=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=Zw(a,s,e+1/3),o=Zw(a,s,e),i=Zw(a,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}function Qw(e,t,n){e=qw(e,255),t=qw(t,255),n=qw(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,s=r,a=r-o,l=0===r?0:a/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break;default:break}i/=6}return{h:i,s:l,v:s}}function eC(e,t,n){e=6*qw(e,360),t=qw(t,100),n=qw(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),s=n*(1-o*t),a=n*(1-(1-o)*t),l=r%6,c=[n,s,i,i,a,n][l],u=[a,n,n,s,i,i][l],d=[i,i,a,n,n,s][l];return{r:255*c,g:255*u,b:255*d}}function tC(e,t,n,r){var o=[Gw(Math.round(e).toString(16)),Gw(Math.round(t).toString(16)),Gw(Math.round(n).toString(16))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function nC(e,t,n,r,o){var i=[Gw(Math.round(e).toString(16)),Gw(Math.round(t).toString(16)),Gw(Math.round(n).toString(16)),Gw(rC(r))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function rC(e){return Math.round(255*parseFloat(e)).toString(16)}function oC(e){return iC(e)/255}function iC(e){return parseInt(e,16)}function sC(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}var aC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function lC(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,s=!1,a=!1;return"string"===typeof e&&(e=gC(e)),"object"===typeof e&&(mC(e.r)&&mC(e.g)&&mC(e.b)?(t=Yw(e.r,e.g,e.b),s=!0,a="%"===String(e.r).substr(-1)?"prgb":"rgb"):mC(e.h)&&mC(e.s)&&mC(e.v)?(r=Ww(e.s),o=Ww(e.v),t=eC(e.h,r,o),s=!0,a="hsv"):mC(e.h)&&mC(e.s)&&mC(e.l)&&(r=Ww(e.s),i=Ww(e.l),t=Xw(e.h,r,i),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Kw(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var cC="[-\\+]?\\d+%?",uC="[-\\+]?\\d*\\.\\d+%?",dC="(?:".concat(uC,")|(?:").concat(cC,")"),pC="[\\s|\\(]+(".concat(dC,")[,|\\s]+(").concat(dC,")[,|\\s]+(").concat(dC,")\\s*\\)?"),hC="[\\s|\\(]+(".concat(dC,")[,|\\s]+(").concat(dC,")[,|\\s]+(").concat(dC,")[,|\\s]+(").concat(dC,")\\s*\\)?"),fC={CSS_UNIT:new RegExp(dC),rgb:new RegExp("rgb"+pC),rgba:new RegExp("rgba"+hC),hsl:new RegExp("hsl"+pC),hsla:new RegExp("hsla"+hC),hsv:new RegExp("hsv"+pC),hsva:new RegExp("hsva"+hC),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 gC(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(aC[e])e=aC[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=fC.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=fC.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=fC.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=fC.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=fC.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=fC.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=fC.hex8.exec(e),n?{r:iC(n[1]),g:iC(n[2]),b:iC(n[3]),a:oC(n[4]),format:t?"name":"hex8"}:(n=fC.hex6.exec(e),n?{r:iC(n[1]),g:iC(n[2]),b:iC(n[3]),format:t?"name":"hex"}:(n=fC.hex4.exec(e),n?{r:iC(n[1]+n[1]),g:iC(n[2]+n[2]),b:iC(n[3]+n[3]),a:oC(n[4]+n[4]),format:t?"name":"hex8"}:(n=fC.hex3.exec(e),!!n&&{r:iC(n[1]+n[1]),g:iC(n[2]+n[2]),b:iC(n[3]+n[3]),format:t?"name":"hex"})))))))))}function mC(e){return Boolean(fC.CSS_UNIT.exec(String(e)))}var vC=function(){function e(t,n){var r;if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"===typeof t&&(t=sC(t)),this.originalInput=t;var o=lC(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e,t,n,r=this.toRgb(),o=r.r/255,i=r.g/255,s=r.b/255;return e=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),t=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),n=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),.2126*e+.7152*t+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=Kw(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var e=this.toHsl().s;return 0===e},e.prototype.toHsv=function(){var e=Qw(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=Qw(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=Jw(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=Jw(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),tC(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),nC(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*qw(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*qw(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+tC(this.r,this.g,this.b,!1),t=0,n=Object.entries(aC);t<n.length;t++){var r=n[t],o=r[0],i=r[1];if(e===i)return o}return!1},e.prototype.toString=function(e){var t=Boolean(e);e=null!==e&&void 0!==e?e:this.format;var n=!1,r=this.a<1&&this.a>=0,o=!t&&r&&(e.startsWith("hex")||"name"===e);return o?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Fw(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Fw(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Fw(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Fw(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100,s={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return new e(s)},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);var n=this.toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/t;while(t--)s.push(new e({h:r,s:o,v:i})),i=(i+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),o=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/o,g:(n.g*n.a+r.g*r.a*(1-n.a))/o,b:(n.b*n.a+r.b*r.a*(1-n.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,s=1;s<t;s++)o.push(new e({h:(r+s*i)%360,s:n.s,l:n.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function yC(e,t=20){return e.mix("#141414",t).toString()}function bC(e){const t=Em(),r=c("button");return(0,n.computed)((()=>{let n={};const o=e.color;if(o){const i=new vC(o),s=e.dark?i.tint(20).toString():yC(i,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?yC(i,90):i.tint(90).toString(),"text-color":o,"border-color":e.dark?yC(i,50):i.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":o,"hover-border-color":o,"active-bg-color":s,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":s}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?yC(i,90):i.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?yC(i,50):i.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?yC(i,80):i.tint(80).toString());else{const a=e.dark?yC(i,30):i.tint(30).toString(),l=i.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":o,"text-color":l,"border-color":o,"hover-bg-color":a,"hover-text-color":l,"hover-border-color":a,"active-bg-color":s,"active-border-color":s}),t.value){const t=e.dark?yC(i,50):i.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=t,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=t}}}return n}))}const wC=(0,n.defineComponent)({name:"ElButton"}),CC=(0,n.defineComponent)({...wC,props:$w,emits:Lw,setup(e,{expose:t,emit:r}){const o=e,i=bC(o),s=c("button"),{_ref:a,_size:l,_type:u,_disabled:d,_props:p,shouldAddSpace:h,handleClick:f}=Mw(o,r);return t({ref:a,size:l,type:u,disabled:d,shouldAddSpace:h}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),(0,n.mergeProps)({ref_key:"_ref",ref:a},(0,n.unref)(p),{class:[(0,n.unref)(s).b(),(0,n.unref)(s).m((0,n.unref)(u)),(0,n.unref)(s).m((0,n.unref)(l)),(0,n.unref)(s).is("disabled",(0,n.unref)(d)),(0,n.unref)(s).is("loading",e.loading),(0,n.unref)(s).is("plain",e.plain),(0,n.unref)(s).is("round",e.round),(0,n.unref)(s).is("circle",e.circle),(0,n.unref)(s).is("text",e.text),(0,n.unref)(s).is("link",e.link),(0,n.unref)(s).is("has-bg",e.bg)],style:(0,n.unref)(i),onClick:(0,n.unref)(f)}),{default:(0,n.withCtx)((()=>[e.loading?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[e.$slots.loading?(0,n.renderSlot)(e.$slots,"loading",{key:0}):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:1,class:(0,n.normalizeClass)((0,n.unref)(s).is("loading"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.loadingIcon)))])),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:1},{default:(0,n.withCtx)((()=>[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon),{key:0})):(0,n.renderSlot)(e.$slots,"icon",{key:1})])),_:3})):(0,n.createCommentVNode)("v-if",!0),e.$slots.default?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:2,class:(0,n.normalizeClass)({[(0,n.unref)(s).em("text","expand")]:(0,n.unref)(h)})},[(0,n.renderSlot)(e.$slots,"default")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},16,["class","style","onClick"]))}});var SC=Cr(CC,[["__file","button.vue"]]);const EC={size:$w.size,type:$w.type},TC=(0,n.defineComponent)({name:"ElButtonGroup"}),kC=(0,n.defineComponent)({...TC,props:EC,setup(e){const t=e;(0,n.provide)(Pw,(0,n.reactive)({size:(0,n.toRef)(t,"size"),type:(0,n.toRef)(t,"type")}));const r=c("button");return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(`${(0,n.unref)(r).b("group")}`)},[(0,n.renderSlot)(e.$slots,"default")],2))}});var xC=Cr(kC,[["__file","button-group.vue"]]);const NC=dr(SC,{ButtonGroup:xC}),RC=(fr(xC),()=>jr&&/firefox/i.test(window.navigator.userAgent));let IC;const _C=`\n height:0 !important;\n visibility:hidden !important;\n ${RC()?"":"overflow:hidden !important;"}\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n`,OC=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function AC(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),r=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),o=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width")),i=OC.map((e=>`${e}:${t.getPropertyValue(e)}`)).join(";");return{contextStyle:i,paddingSize:r,borderSize:o,boxSizing:n}}function BC(e,t=1,n){var r;IC||(IC=document.createElement("textarea"),document.body.appendChild(IC));const{paddingSize:o,borderSize:i,boxSizing:s,contextStyle:a}=AC(e);IC.setAttribute("style",`${a};${_C}`),IC.value=e.value||e.placeholder||"";let l=IC.scrollHeight;const c={};"border-box"===s?l+=i:"content-box"===s&&(l-=o),IC.value="";const u=IC.scrollHeight-o;if(yn(t)){let e=u*t;"border-box"===s&&(e=e+o+i),l=Math.max(e,l),c.minHeight=`${e}px`}if(yn(n)){let e=u*n;"border-box"===s&&(e=e+o+i),l=Math.min(e,l)}return c.height=`${l}px`,null==(r=IC.parentNode)||r.removeChild(IC),IC=void 0,c}const DC=Dn({id:{type:String,default:void 0},size:Hn,disabled:Boolean,modelValue:{type:On([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:On([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:pc},prefixIcon:{type:pc},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:On([Object,Array,String]),default:()=>Zc({})},autofocus:{type:Boolean,default:!1}}),PC={[Xc]:e=>an(e),input:e=>an(e),change:e=>an(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},HC=["class","style"],MC=/^on[A-Z]/,jC=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,o=(0,n.computed)((()=>((null==r?void 0:r.value)||[]).concat(HC))),i=(0,n.getCurrentInstance)();return i?(0,n.computed)((()=>{var e;return In(Object.entries(null==(e=i.proxy)?void 0:e.$attrs).filter((([e])=>!o.value.includes(e)&&!(t&&MC.test(e)))))})):(Nn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),(0,n.computed)((()=>({}))))};function VC(e,{afterFocus:t,beforeBlur:r,afterBlur:o}={}){const i=(0,n.getCurrentInstance)(),{emit:s}=i,a=(0,n.shallowRef)(),l=(0,n.ref)(!1),c=e=>{l.value||(l.value=!0,s("focus",e),null==t||t())},u=e=>{var t;const n=!!sn(r)&&r(e);n||e.relatedTarget&&(null==(t=a.value)?void 0:t.contains(e.relatedTarget))||(l.value=!1,s("blur",e),null==o||o())},d=()=>{var t;null==(t=e.value)||t.focus()};return(0,n.watch)(a,(e=>{e&&e.setAttribute("tabindex","-1")})),Os(a,"click",d),{wrapperRef:a,isFocused:l,handleFocus:c,handleBlur:u}}function $C(e){const t=(0,n.ref)();function r(){if(void 0==e.value)return;const{selectionStart:n,selectionEnd:r,value:o}=e.value;if(null==n||null==r)return;const i=o.slice(0,Math.max(0,n)),s=o.slice(Math.max(0,r));t.value={selectionStart:n,selectionEnd:r,value:o,beforeTxt:i,afterTxt:s}}function o(){if(void 0==e.value||void 0==t.value)return;const{value:n}=e.value,{beforeTxt:r,afterTxt:o,selectionStart:i}=t.value;if(void 0==r||void 0==o||void 0==i)return;let s=n.length;if(n.endsWith(o))s=n.length-o.length;else if(n.startsWith(r))s=r.length;else{const e=r[i-1],t=n.indexOf(e,i-1);-1!==t&&(s=t+1)}e.value.setSelectionRange(s,s)}return[r,o]}const LC=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),qC=["role"],FC=["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],UC=["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],zC=(0,n.defineComponent)({name:"ElInput",inheritAttrs:!1}),KC=(0,n.defineComponent)({...zC,props:DC,emits:PC,setup(e,{expose:t,emit:r}){const o=e,i=(0,n.useAttrs)(),s=(0,n.useSlots)(),a=(0,n.computed)((()=>{const e={};return"combobox"===o.containerRole&&(e["aria-haspopup"]=i["aria-haspopup"],e["aria-owns"]=i["aria-owns"],e["aria-expanded"]=i["aria-expanded"]),e})),l=(0,n.computed)((()=>["textarea"===o.type?y.b():v.b(),v.m(g.value),v.is("disabled",m.value),v.is("exceed",q.value),{[v.b("group")]:s.prepend||s.append,[v.bm("group","append")]:s.append,[v.bm("group","prepend")]:s.prepend,[v.m("prefix")]:s.prefix||o.prefixIcon,[v.m("suffix")]:s.suffix||o.suffixIcon||o.clearable||o.showPassword,[v.bm("suffix","password-clear")]:j.value&&V.value},i.class])),u=(0,n.computed)((()=>[v.e("wrapper"),v.is("focus",R.value)])),d=jC({excludeKeys:(0,n.computed)((()=>Object.keys(a.value)))}),{form:p,formItem:h}=km(),{inputId:f}=xm(o,{formItemContext:h}),g=Sm(),m=Em(),v=c("input"),y=c("textarea"),b=(0,n.shallowRef)(),w=(0,n.shallowRef)(),C=(0,n.ref)(!1),S=(0,n.ref)(!1),E=(0,n.ref)(!1),T=(0,n.ref)(),k=(0,n.shallowRef)(o.inputStyle),x=(0,n.computed)((()=>b.value||w.value)),{wrapperRef:N,isFocused:R,handleFocus:I,handleBlur:_}=VC(x,{afterBlur(){var e;o.validateEvent&&(null==(e=null==h?void 0:h.validate)||e.call(h,"blur").catch((e=>Nn(e))))}}),O=(0,n.computed)((()=>{var e;return null!=(e=null==p?void 0:p.statusIcon)&&e})),A=(0,n.computed)((()=>(null==h?void 0:h.validateState)||"")),B=(0,n.computed)((()=>A.value&&gc[A.value])),D=(0,n.computed)((()=>E.value?cc:Zl)),P=(0,n.computed)((()=>[i.style])),H=(0,n.computed)((()=>[o.inputStyle,k.value,{resize:o.resize}])),M=(0,n.computed)((()=>Ns(o.modelValue)?"":String(o.modelValue))),j=(0,n.computed)((()=>o.clearable&&!m.value&&!o.readonly&&!!M.value&&(R.value||C.value))),V=(0,n.computed)((()=>o.showPassword&&!m.value&&!o.readonly&&!!M.value&&(!!M.value||R.value))),$=(0,n.computed)((()=>o.showWordLimit&&!!o.maxlength&&("text"===o.type||"textarea"===o.type)&&!m.value&&!o.readonly&&!o.showPassword)),L=(0,n.computed)((()=>M.value.length)),q=(0,n.computed)((()=>!!$.value&&L.value>Number(o.maxlength))),F=(0,n.computed)((()=>!!s.suffix||!!o.suffixIcon||j.value||o.showPassword||$.value||!!A.value&&O.value)),[U,z]=$C(b);qs(w,(e=>{if(G(),!$.value||"both"!==o.resize)return;const t=e[0],{width:n}=t.contentRect;T.value={right:`calc(100% - ${n+15+6}px)`}}));const K=()=>{const{type:e,autosize:t}=o;if(jr&&"textarea"===e&&w.value)if(t){const e=ln(t)?t.minRows:void 0,r=ln(t)?t.maxRows:void 0,o=BC(w.value,e,r);k.value={overflowY:"hidden",...o},(0,n.nextTick)((()=>{w.value.offsetHeight,k.value=o}))}else k.value={minHeight:BC(w.value).minHeight}},W=e=>{let t=!1;return()=>{var n;if(t||!o.autosize)return;const r=null===(null==(n=w.value)?void 0:n.offsetParent);r||(e(),t=!0)}},G=W(K),Y=()=>{const e=x.value,t=o.formatter?o.formatter(M.value):M.value;e&&e.value!==t&&(e.value=t)},J=async e=>{U();let{value:t}=e.target;o.formatter&&(t=o.parser?o.parser(t):t),S.value||(t!==M.value?(r(Xc,t),r("input",t),await(0,n.nextTick)(),Y(),z()):Y())},Z=e=>{r("change",e.target.value)},X=e=>{r("compositionstart",e),S.value=!0},Q=e=>{var t;r("compositionupdate",e);const n=null==(t=e.target)?void 0:t.value,o=n[n.length-1]||"";S.value=!LC(o)},ee=e=>{r("compositionend",e),S.value&&(S.value=!1,J(e))},te=()=>{E.value=!E.value,ne()},ne=async()=>{var e;await(0,n.nextTick)(),null==(e=x.value)||e.focus()},re=()=>{var e;return null==(e=x.value)?void 0:e.blur()},oe=e=>{C.value=!1,r("mouseleave",e)},ie=e=>{C.value=!0,r("mouseenter",e)},se=e=>{r("keydown",e)},ae=()=>{var e;null==(e=x.value)||e.select()},le=()=>{r(Xc,""),r("change",""),r("clear"),r("input","")};return(0,n.watch)((()=>o.modelValue),(()=>{var e;(0,n.nextTick)((()=>K())),o.validateEvent&&(null==(e=null==h?void 0:h.validate)||e.call(h,"change").catch((e=>Nn(e))))})),(0,n.watch)(M,(()=>Y())),(0,n.watch)((()=>o.type),(async()=>{await(0,n.nextTick)(),Y(),K()})),(0,n.onMounted)((()=>{!o.formatter&&o.parser&&Nn("ElInput","If you set the parser, you also need to set the formatter."),Y(),(0,n.nextTick)(K)})),t({input:b,textarea:w,ref:x,textareaStyle:H,autosize:(0,n.toRef)(o,"autosize"),focus:ne,blur:re,select:ae,clear:le,resizeTextarea:K}),(e,t)=>(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)((0,n.unref)(a),{class:(0,n.unref)(l),style:(0,n.unref)(P),role:e.containerRole,onMouseenter:ie,onMouseleave:oe}),[(0,n.createCommentVNode)(" input "),"textarea"!==e.type?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createCommentVNode)(" prepend slot "),e.$slots.prepend?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).be("group","prepend"))},[(0,n.renderSlot)(e.$slots,"prepend")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref_key:"wrapperRef",ref:N,class:(0,n.normalizeClass)((0,n.unref)(u))},[(0,n.createCommentVNode)(" prefix slot "),e.$slots.prefix||e.prefixIcon?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("prefix"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("prefix-inner"))},[(0,n.renderSlot)(e.$slots,"prefix"),e.prefixIcon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("icon"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.prefixIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("input",(0,n.mergeProps)({id:(0,n.unref)(f),ref_key:"input",ref:b,class:(0,n.unref)(v).e("inner")},(0,n.unref)(d),{minlength:e.minlength,maxlength:e.maxlength,type:e.showPassword?E.value?"text":"password":e.type,disabled:(0,n.unref)(m),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.label,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,onCompositionstart:X,onCompositionupdate:Q,onCompositionend:ee,onInput:J,onFocus:t[0]||(t[0]=(...e)=>(0,n.unref)(I)&&(0,n.unref)(I)(...e)),onBlur:t[1]||(t[1]=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)),onChange:Z,onKeydown:se}),null,16,FC),(0,n.createCommentVNode)(" suffix slot "),(0,n.unref)(F)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,class:(0,n.normalizeClass)((0,n.unref)(v).e("suffix"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("suffix-inner"))},[(0,n.unref)(j)&&(0,n.unref)(V)&&(0,n.unref)($)?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.renderSlot)(e.$slots,"suffix"),e.suffixIcon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("icon"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.suffixIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],64)),(0,n.unref)(j)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:1,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("clear")]),onMousedown:(0,n.withModifiers)((0,n.unref)(tn),["prevent"]),onClick:le},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(Wl))])),_:1},8,["class","onMousedown"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:2,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("password")]),onClick:te},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(D))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)($)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:3,class:(0,n.normalizeClass)((0,n.unref)(v).e("count"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("count-inner"))},(0,n.toDisplayString)((0,n.unref)(L))+" / "+(0,n.toDisplayString)(e.maxlength),3)],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(A)&&(0,n.unref)(B)&&(0,n.unref)(O)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:4,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("validateIcon"),(0,n.unref)(v).is("loading","validating"===(0,n.unref)(A))])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(B))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)):(0,n.createCommentVNode)("v-if",!0)],2),(0,n.createCommentVNode)(" append slot "),e.$slots.append?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)((0,n.unref)(v).be("group","append"))},[(0,n.renderSlot)(e.$slots,"append")],2)):(0,n.createCommentVNode)("v-if",!0)],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(" textarea "),(0,n.createElementVNode)("textarea",(0,n.mergeProps)({id:(0,n.unref)(f),ref_key:"textarea",ref:w,class:(0,n.unref)(y).e("inner")},(0,n.unref)(d),{minlength:e.minlength,maxlength:e.maxlength,tabindex:e.tabindex,disabled:(0,n.unref)(m),readonly:e.readonly,autocomplete:e.autocomplete,style:(0,n.unref)(H),"aria-label":e.label,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,onCompositionstart:X,onCompositionupdate:Q,onCompositionend:ee,onInput:J,onFocus:t[2]||(t[2]=(...e)=>(0,n.unref)(I)&&(0,n.unref)(I)(...e)),onBlur:t[3]||(t[3]=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)),onChange:Z,onKeydown:se}),null,16,UC),(0,n.unref)($)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,style:(0,n.normalizeStyle)(T.value),class:(0,n.normalizeClass)((0,n.unref)(v).e("count"))},(0,n.toDisplayString)((0,n.unref)(L))+" / "+(0,n.toDisplayString)(e.maxlength),7)):(0,n.createCommentVNode)("v-if",!0)],64))],16,qC)),[[n.vShow,"hidden"!==e.type]])}});var WC=Cr(KC,[["__file","input.vue"]]);const GC=dr(WC),YC=Dn({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Hn,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:e=>null===e||yn(e)||["min","max"].includes(e),default:null},name:String,label:String,placeholder:String,precision:{type:Number,validator:e=>e>=0&&e===Number.parseInt(`${e}`,10)},validateEvent:{type:Boolean,default:!0}}),JC={[Qc]:(e,t)=>t!==e,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,[eu]:e=>yn(e)||Ns(e),[Xc]:e=>yn(e)||Ns(e)},ZC=100,XC=600,QC={beforeMount(e,t){const n=t.value,{interval:r=ZC,delay:o=XC}=sn(n)?{}:n;let i,s;const a=()=>sn(n)?n():n.handler(),l=()=>{s&&(clearTimeout(s),s=void 0),i&&(clearInterval(i),i=void 0)};e.addEventListener("mousedown",(e=>{0===e.button&&(l(),a(),document.addEventListener("mouseup",(()=>l()),{once:!0}),s=setTimeout((()=>{i=setInterval((()=>{a()}),r)}),o))}))}},eS=["aria-label","onKeydown"],tS=["aria-label","onKeydown"],nS=(0,n.defineComponent)({name:"ElInputNumber"}),rS=(0,n.defineComponent)({...nS,props:YC,emits:JC,setup(e,{expose:t,emit:r}){const o=e,{t:i}=en(),s=c("input-number"),a=(0,n.ref)(),l=(0,n.reactive)({currentValue:o.modelValue,userInput:null}),{formItem:u}=km(),d=(0,n.computed)((()=>yn(o.modelValue)&&o.modelValue<=o.min)),p=(0,n.computed)((()=>yn(o.modelValue)&&o.modelValue>=o.max)),h=(0,n.computed)((()=>{const e=b(o.step);return mn(o.precision)?Math.max(b(o.modelValue),e):(e>o.precision&&Nn("InputNumber","precision should not be less than the decimal places of step"),o.precision)})),f=(0,n.computed)((()=>o.controls&&"right"===o.controlsPosition)),g=Sm(),m=Em(),v=(0,n.computed)((()=>{if(null!==l.userInput)return l.userInput;let e=l.currentValue;if(Ns(e))return"";if(yn(e)){if(Number.isNaN(e))return"";mn(o.precision)||(e=e.toFixed(o.precision))}return e})),y=(e,t)=>{if(mn(t)&&(t=h.value),0===t)return Math.round(e);let n=String(e);const r=n.indexOf(".");if(-1===r)return e;const o=n.replace(".","").split(""),i=o[r+t];if(!i)return e;const s=n.length;return"5"===n.charAt(s-1)&&(n=`${n.slice(0,Math.max(0,s-1))}6`),Number.parseFloat(Number(n).toFixed(t))},b=e=>{if(Ns(e))return 0;const t=e.toString(),n=t.indexOf(".");let r=0;return-1!==n&&(r=t.length-n-1),r},w=(e,t=1)=>yn(e)?y(e+o.step*t):l.currentValue,C=()=>{if(o.readonly||m.value||p.value)return;const e=Number(v.value)||0,t=w(e);T(t),r(eu,l.currentValue),O()},S=()=>{if(o.readonly||m.value||d.value)return;const e=Number(v.value)||0,t=w(e,-1);T(t),r(eu,l.currentValue),O()},E=(e,t)=>{const{max:n,min:i,step:s,precision:a,stepStrictly:l,valueOnClear:c}=o;n<i&&xn("InputNumber","min should not be greater than max.");let u=Number(e);if(Ns(e)||Number.isNaN(u))return null;if(""===e){if(null===c)return null;u=an(c)?{min:i,max:n}[c]:c}return l&&(u=y(Math.round(u/s)*s,a)),mn(a)||(u=y(u,a)),(u>n||u<i)&&(u=u>n?n:i,t&&r(Xc,u)),u},T=(e,t=!0)=>{var n;const i=l.currentValue,s=E(e);t?i!==s&&(l.userInput=null,r(Xc,s),r(Qc,s,i),o.validateEvent&&(null==(n=null==u?void 0:u.validate)||n.call(u,"change").catch((e=>Nn(e)))),l.currentValue=s):r(Xc,s)},k=e=>{l.userInput=e;const t=""===e?null:Number(e);r(eu,t),T(t,!1)},x=e=>{const t=""!==e?Number(e):"";(yn(t)&&!Number.isNaN(t)||""===e)&&T(t),O(),l.userInput=null},N=()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.focus)||t.call(e)},R=()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.blur)||t.call(e)},I=e=>{r("focus",e)},_=e=>{var t;l.userInput=null,r("blur",e),o.validateEvent&&(null==(t=null==u?void 0:u.validate)||t.call(u,"blur").catch((e=>Nn(e))))},O=()=>{l.currentValue!==o.modelValue&&(l.currentValue=o.modelValue)},A=e=>{document.activeElement===e.target&&e.preventDefault()};return(0,n.watch)((()=>o.modelValue),((e,t)=>{const n=E(e,!0);null===l.userInput&&n!==t&&(l.currentValue=n)}),{immediate:!0}),(0,n.onMounted)((()=>{var e;const{min:t,max:n,modelValue:i}=o,s=null==(e=a.value)?void 0:e.input;if(s.setAttribute("role","spinbutton"),Number.isFinite(n)?s.setAttribute("aria-valuemax",String(n)):s.removeAttribute("aria-valuemax"),Number.isFinite(t)?s.setAttribute("aria-valuemin",String(t)):s.removeAttribute("aria-valuemin"),s.setAttribute("aria-valuenow",l.currentValue||0===l.currentValue?String(l.currentValue):""),s.setAttribute("aria-disabled",String(m.value)),!yn(i)&&null!=i){let e=Number(i);Number.isNaN(e)&&(e=null),r(Xc,e)}})),(0,n.onUpdated)((()=>{var e,t;const n=null==(e=a.value)?void 0:e.input;null==n||n.setAttribute("aria-valuenow",`${null!=(t=l.currentValue)?t:""}`)})),t({focus:N,blur:R}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([(0,n.unref)(s).b(),(0,n.unref)(s).m((0,n.unref)(g)),(0,n.unref)(s).is("disabled",(0,n.unref)(m)),(0,n.unref)(s).is("without-controls",!e.controls),(0,n.unref)(s).is("controls-right",(0,n.unref)(f))]),onDragstart:t[0]||(t[0]=(0,n.withModifiers)((()=>{}),["prevent"]))},[e.controls?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,role:"button","aria-label":(0,n.unref)(i)("el.inputNumber.decrease"),class:(0,n.normalizeClass)([(0,n.unref)(s).e("decrease"),(0,n.unref)(s).is("disabled",(0,n.unref)(d))]),onKeydown:(0,n.withKeys)(S,["enter"])},[(0,n.createVNode)((0,n.unref)(wu),null,{default:(0,n.withCtx)((()=>[(0,n.unref)(f)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Bl),{key:0})):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(rc),{key:1}))])),_:1})],42,eS)),[[(0,n.unref)(QC),S]]):(0,n.createCommentVNode)("v-if",!0),e.controls?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,role:"button","aria-label":(0,n.unref)(i)("el.inputNumber.increase"),class:(0,n.normalizeClass)([(0,n.unref)(s).e("increase"),(0,n.unref)(s).is("disabled",(0,n.unref)(p))]),onKeydown:(0,n.withKeys)(C,["enter"])},[(0,n.createVNode)((0,n.unref)(wu),null,{default:(0,n.withCtx)((()=>[(0,n.unref)(f)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Vl),{key:0})):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(ic),{key:1}))])),_:1})],42,tS)),[[(0,n.unref)(QC),C]]):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)((0,n.unref)(GC),{id:e.id,ref_key:"input",ref:a,type:"number",step:e.step,"model-value":(0,n.unref)(v),placeholder:e.placeholder,readonly:e.readonly,disabled:(0,n.unref)(m),size:(0,n.unref)(g),max:e.max,min:e.min,name:e.name,label:e.label,"validate-event":!1,onWheel:A,onKeydown:[(0,n.withKeys)((0,n.withModifiers)(C,["prevent"]),["up"]),(0,n.withKeys)((0,n.withModifiers)(S,["prevent"]),["down"])],onBlur:_,onFocus:I,onInput:k,onChange:x},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","label","onKeydown"])],34))}});var oS=Cr(rS,[["__file","input-number.vue"]]);const iS=dr(oS),sS=Dn({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Pn},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),aS={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},lS=(0,n.defineComponent)({name:"ElTag"}),cS=(0,n.defineComponent)({...lS,props:sS,emits:aS,setup(e,{emit:t}){const r=e,o=Sm(),i=c("tag"),s=(0,n.computed)((()=>{const{type:e,hit:t,effect:n,closable:s,round:a}=r;return[i.b(),i.is("closable",s),i.m(e||"primary"),i.m(o.value),i.m(n),i.is("hit",t),i.is("round",a)]})),a=e=>{t("close",e)},l=e=>{t("click",e)};return(e,t)=>e.disableTransitions?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(s)),style:(0,n.normalizeStyle)({backgroundColor:e.color}),onClick:l},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},[(0,n.renderSlot)(e.$slots,"default")],2),e.closable?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("close")),onClick:(0,n.withModifiers)(a,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(Yl))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],6)):((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{key:1,name:`${(0,n.unref)(i).namespace.value}-zoom-in-center`,appear:""},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(s)),style:(0,n.normalizeStyle)({backgroundColor:e.color}),onClick:l},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},[(0,n.renderSlot)(e.$slots,"default")],2),e.closable?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("close")),onClick:(0,n.withModifiers)(a,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(Yl))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],6)])),_:3},8,["name"]))}});var uS=Cr(cS,[["__file","tag.vue"]]);const dS=dr(uS),pS=Symbol("ElSelectGroup"),hS=Symbol("ElSelect"),fS=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),gS=e=>gn(e);function mS(e,t){const r=(0,n.inject)(hS),o=(0,n.inject)(pS,{disabled:!1}),i=(0,n.computed)((()=>r.props.multiple?d(r.props.modelValue,e.value):d([r.props.modelValue],e.value))),s=(0,n.computed)((()=>{if(r.props.multiple){const e=r.props.modelValue||[];return!i.value&&e.length>=r.props.multipleLimit&&r.props.multipleLimit>0}return!1})),a=(0,n.computed)((()=>e.label||(ln(e.value)?"":e.value))),l=(0,n.computed)((()=>e.value||e.label||"")),c=(0,n.computed)((()=>e.disabled||t.groupDisabled||s.value)),u=(0,n.getCurrentInstance)(),d=(t=[],o)=>{if(ln(e.value)){const e=r.props.valueKey;return t&&t.some((t=>(0,n.toRaw)(Gt(t,e))===Gt(o,e)))}return t&&t.includes(o)},p=()=>{e.disabled||o.disabled||(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},h=n=>{const r=new RegExp(fS(n),"i");t.visible=r.test(a.value)||e.created};return(0,n.watch)((()=>a.value),(()=>{e.created||r.props.remote||r.setSelected()})),(0,n.watch)((()=>e.value),((t,n)=>{const{remote:o,valueKey:i}=r.props;if(_m(t,n)||(r.onOptionDestroy(n,u.proxy),r.onOptionCreate(u.proxy)),!e.created&&!o){if(i&&ln(t)&&ln(n)&&t[i]===n[i])return;r.setSelected()}})),(0,n.watch)((()=>o.disabled),(()=>{t.groupDisabled=o.disabled}),{immediate:!0}),{select:r,currentLabel:a,currentValue:l,itemSelected:i,isDisabled:c,hoverItem:p,updateOption:h}}const vS=(0,n.defineComponent)({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=c("select"),r=ba(),o=(0,n.computed)((()=>[t.be("dropdown","item"),t.is("disabled",(0,n.unref)(l)),t.is("selected",(0,n.unref)(a)),t.is("hovering",(0,n.unref)(f))])),i=(0,n.reactive)({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:a,isDisabled:l,select:u,hoverItem:d,updateOption:p}=mS(e,i),{visible:h,hover:f}=(0,n.toRefs)(i),g=(0,n.getCurrentInstance)().proxy;function m(){!0!==e.disabled&&!0!==i.groupDisabled&&u.handleOptionSelect(g)}return u.onOptionCreate(g),(0,n.onBeforeUnmount)((()=>{const e=g.value,{selected:t}=u.states,r=u.props.multiple?t:[t],o=r.some((e=>e.value===g.value));(0,n.nextTick)((()=>{u.states.cachedOptions.get(e)!==g||o||u.states.cachedOptions.delete(e)})),u.onOptionDestroy(e,g)})),{ns:t,id:r,containerKls:o,currentLabel:s,itemSelected:a,isDisabled:l,select:u,hoverItem:d,updateOption:p,visible:h,hover:f,selectOptionClick:m,states:i}}}),yS=["id","aria-disabled","aria-selected"];function bS(e,t,r,o,i,s){return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("li",{id:e.id,class:(0,n.normalizeClass)(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...t)=>e.hoverItem&&e.hoverItem(...t)),onClick:t[1]||(t[1]=(0,n.withModifiers)(((...t)=>e.selectOptionClick&&e.selectOptionClick(...t)),["stop"]))},[(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentLabel),1)]))],42,yS)),[[n.vShow,e.visible]])}var wS=Cr(vS,[["render",bS],["__file","option.vue"]]);const CS=(0,n.defineComponent)({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=(0,n.inject)(hS),t=c("select"),r=(0,n.computed)((()=>e.props.popperClass)),o=(0,n.computed)((()=>e.props.multiple)),i=(0,n.computed)((()=>e.props.fitInputWidth)),s=(0,n.ref)("");function a(){var t;s.value=`${null==(t=e.selectRef)?void 0:t.offsetWidth}px`}return(0,n.onMounted)((()=>{a(),qs(e.selectRef,a)})),{ns:t,minWidth:s,popperClass:r,isMultiple:o,isFitInputWidth:i}}});function SS(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:(0,n.normalizeStyle)({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.be("dropdown","header"))},[(0,n.renderSlot)(e.$slots,"header")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default"),e.$slots.footer?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(e.ns.be("dropdown","footer"))},[(0,n.renderSlot)(e.$slots,"footer")],2)):(0,n.createCommentVNode)("v-if",!0)],6)}var ES=Cr(CS,[["render",SS],["__file","select-dropdown.vue"]]);function TS(e,t,n,r){var o=e.length,i=n+(r?1:-1);while(r?i--:++i<o)if(t(e[i],i,e))return i;return-1}var kS=TS,xS=1/0,NS=17976931348623157e292;function RS(e){if(!e)return 0===e?e:0;if(e=zu(e),e===xS||e===-xS){var t=e<0?-1:1;return t*NS}return e===e?e:0}var IS=RS;function _S(e){var t=IS(e),n=t%1;return t===t?n?t-n:t:0}var OS=_S,AS=Math.max,BS=Math.min;function DS(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=OS(n),o=n<0?AS(r+o,0):BS(o,r-1)),kS(e,vg(t,3),o,!0)}var PS=DS;function HS(e){const t=(0,n.ref)(!1),r=()=>{t.value=!0},o=e=>{const n=e.target.value,r=n[n.length-1]||"";t.value=!LC(r)},i=n=>{t.value&&(t.value=!1,sn(e)&&e(n))};return{handleCompositionStart:r,handleCompositionUpdate:o,handleCompositionEnd:i}}function MS(e,t){if(!jr)return;if(!t)return void(e.scrollTop=0);const n=[];let r=t.offsetParent;while(null!==r&&e!==r&&e.contains(r))n.push(r),r=r.offsetParent;const o=t.offsetTop+n.reduce(((e,t)=>e+t.offsetTop),0),i=o+t.offsetHeight,s=e.scrollTop,a=s+e.clientHeight;o<s?e.scrollTop=o:i>a&&(e.scrollTop=i-e.clientHeight)}const jS=11,VS=(e,t)=>{const{t:r}=en(),o=ba(),i=c("select"),s=c("input"),a=(0,n.reactive)({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:e.multiple?[]:{},selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1});Hw({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},(0,n.computed)((()=>!1===e.suffixTransition)));const l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.ref)(null),h=(0,n.ref)(null),f=(0,n.ref)(null),g=(0,n.ref)(null),m=(0,n.ref)(null),v=(0,n.ref)(null),y=(0,n.ref)(null),b=(0,n.ref)(null),w=(0,n.ref)(null),{wrapperRef:C,isFocused:S,handleFocus:E,handleBlur:T}=VC(h,{afterFocus(){e.automaticDropdown&&!k.value&&(k.value=!0,a.menuVisibleOnFocus=!0)},beforeBlur(e){var t,n;return(null==(t=d.value)?void 0:t.isFocusInsideContent(e))||(null==(n=p.value)?void 0:n.isFocusInsideContent(e))},afterBlur(){k.value=!1,a.menuVisibleOnFocus=!1}}),k=(0,n.ref)(!1),x=(0,n.ref)(),{form:N,formItem:R}=km(),{inputId:I}=xm(e,{formItemContext:R}),_=(0,n.computed)((()=>e.disabled||(null==N?void 0:N.disabled))),O=(0,n.computed)((()=>e.multiple?on(e.modelValue)&&e.modelValue.length>0:void 0!==e.modelValue&&null!==e.modelValue&&""!==e.modelValue)),A=(0,n.computed)((()=>{const t=e.clearable&&!_.value&&a.inputHovering&&O.value;return t})),B=(0,n.computed)((()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon)),D=(0,n.computed)((()=>i.is("reverse",B.value&&k.value&&e.suffixTransition))),P=(0,n.computed)((()=>(null==R?void 0:R.validateState)||"")),H=(0,n.computed)((()=>gc[P.value])),M=(0,n.computed)((()=>e.remote?300:0)),j=(0,n.computed)((()=>e.loading?e.loadingText||r("el.select.loading"):!(e.remote&&!a.inputValue&&0===a.options.size)&&(e.filterable&&a.inputValue&&a.options.size>0&&0===V.value?e.noMatchText||r("el.select.noMatch"):0===a.options.size?e.noDataText||r("el.select.noData"):null))),V=(0,n.computed)((()=>$.value.filter((e=>e.visible)).length)),$=(0,n.computed)((()=>{const e=Array.from(a.options.values()),t=[];return a.optionValues.forEach((n=>{const r=e.findIndex((e=>e.value===n));r>-1&&t.push(e[r])})),t.length>=e.length?t:e})),L=(0,n.computed)((()=>Array.from(a.cachedOptions.values()))),q=(0,n.computed)((()=>{const t=$.value.filter((e=>!e.created)).some((e=>e.currentLabel===a.inputValue));return e.filterable&&e.allowCreate&&""!==a.inputValue&&!t})),F=()=>{e.filterable&&sn(e.filterMethod)||e.filterable&&e.remote&&sn(e.remoteMethod)||$.value.forEach((e=>{e.updateOption(a.inputValue)}))},U=Sm(),z=(0,n.computed)((()=>["small"].includes(U.value)?"small":"default")),K=(0,n.computed)({get(){return k.value&&!1!==j.value},set(e){k.value=e}}),W=(0,n.computed)((()=>on(e.modelValue)?0===e.modelValue.length&&!a.inputValue:!e.filterable||!a.inputValue)),G=(0,n.computed)((()=>{var t;const n=null!=(t=e.placeholder)?t:r("el.select.placeholder");return e.multiple||!O.value?n:a.selectedLabel}));(0,n.watch)((()=>e.modelValue),((t,n)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(a.inputValue="",Y("")),Z(),!_m(t,n)&&e.validateEvent&&(null==R||R.validate("change").catch((e=>Nn(e))))}),{flush:"post",deep:!0}),(0,n.watch)((()=>k.value),(e=>{e?Y(a.inputValue):(a.inputValue="",a.previousQuery=null,a.isBeforeHide=!0),t("visible-change",e)})),(0,n.watch)((()=>a.options.entries()),(()=>{var t;if(!jr)return;const n=(null==(t=l.value)?void 0:t.querySelectorAll("input"))||[];(e.filterable||e.defaultFirstOption||mn(e.modelValue))&&Array.from(n).includes(document.activeElement)||Z(),e.defaultFirstOption&&(e.filterable||e.remote)&&V.value&&J()}),{flush:"post"}),(0,n.watch)((()=>a.hoveringIndex),(e=>{yn(e)&&e>-1?x.value=$.value[e]||{}:x.value={},$.value.forEach((e=>{e.hover=x.value===e}))})),(0,n.watchEffect)((()=>{a.isBeforeHide||F()}));const Y=t=>{a.previousQuery!==t&&(a.previousQuery=t,e.filterable&&sn(e.filterMethod)?e.filterMethod(t):e.filterable&&e.remote&&sn(e.remoteMethod)&&e.remoteMethod(t),e.defaultFirstOption&&(e.filterable||e.remote)&&V.value?(0,n.nextTick)(J):(0,n.nextTick)(Q))},J=()=>{const e=$.value.filter((e=>e.visible&&!e.disabled&&!e.states.groupDisabled)),t=e.find((e=>e.created)),n=e[0];a.hoveringIndex=fe($.value,t||n)},Z=()=>{if(!e.multiple){const t=X(e.modelValue);return a.selectedLabel=t.currentLabel,void(a.selected=t)}a.selectedLabel="";const t=[];on(e.modelValue)&&e.modelValue.forEach((e=>{t.push(X(e))})),a.selected=t},X=t=>{let n;const r="object"===dn(t).toLowerCase(),o="null"===dn(t).toLowerCase(),i="undefined"===dn(t).toLowerCase();for(let c=a.cachedOptions.size-1;c>=0;c--){const o=L.value[c],i=r?Gt(o.value,e.valueKey)===Gt(t,e.valueKey):o.value===t;if(i){n={value:t,currentLabel:o.currentLabel,isDisabled:o.isDisabled};break}}if(n)return n;const s=r?t.label:o||i?"":t,l={value:t,currentLabel:s};return l},Q=()=>{e.multiple?a.selected.length>0?a.hoveringIndex=Math.min(...a.selected.map((e=>$.value.findIndex((t=>_e(t)===_e(e)))))):a.hoveringIndex=-1:a.hoveringIndex=$.value.findIndex((e=>_e(e)===_e(a.selected)))},ee=()=>{a.selectionWidth=u.value.getBoundingClientRect().width},te=()=>{a.calculatorWidth=f.value.getBoundingClientRect().width},ne=()=>{a.collapseItemWidth=b.value.getBoundingClientRect().width},re=()=>{var e,t;null==(t=null==(e=d.value)?void 0:e.updatePopper)||t.call(e)},oe=()=>{var e,t;null==(t=null==(e=p.value)?void 0:e.updatePopper)||t.call(e)},ie=()=>{a.inputValue.length>0&&!k.value&&(k.value=!0),Y(a.inputValue)},se=t=>{if(a.inputValue=t.target.value,!e.remote)return ie();ae()},ae=Ju((()=>{ie()}),M.value),le=n=>{_m(e.modelValue,n)||t(Qc,n)},ce=e=>PS(e,(e=>!a.disabledOptions.has(e))),ue=n=>{if(e.multiple&&n.code!==ls.delete&&n.target.value.length<=0){const n=e.modelValue.slice(),r=ce(n);if(r<0)return;n.splice(r,1),t(Xc,n),le(n)}},de=(n,r)=>{const o=a.selected.indexOf(r);if(o>-1&&!_.value){const n=e.modelValue.slice();n.splice(o,1),t(Xc,n),le(n),t("remove-tag",r.value)}n.stopPropagation(),Ee()},pe=n=>{n.stopPropagation();const r=e.multiple?[]:"";if(!an(r))for(const e of a.selected)e.isDisabled&&r.push(e.value);t(Xc,r),le(r),a.hoveringIndex=-1,k.value=!1,t("clear"),Ee()},he=r=>{if(e.multiple){const n=(e.modelValue||[]).slice(),o=fe(n,r.value);o>-1?n.splice(o,1):(e.multipleLimit<=0||n.length<e.multipleLimit)&&n.push(r.value),t(Xc,n),le(n),r.created&&Y(""),e.filterable&&!e.reserveKeyword&&(a.inputValue="")}else t(Xc,r.value),le(r.value),k.value=!1;Ee(),k.value||(0,n.nextTick)((()=>{ge(r)}))},fe=(t=[],r)=>{if(!ln(r))return t.indexOf(r);const o=e.valueKey;let i=-1;return t.some(((e,t)=>(0,n.toRaw)(Gt(e,o))===Gt(r,o)&&(i=t,!0))),i},ge=e=>{var t,n,r,o,s;const a=on(e)?e[0]:e;let l=null;if(null==a?void 0:a.value){const e=$.value.filter((e=>e.value===a.value));e.length>0&&(l=e[0].$el)}if(d.value&&l){const e=null==(o=null==(r=null==(n=null==(t=d.value)?void 0:t.popperRef)?void 0:n.contentRef)?void 0:r.querySelector)?void 0:o.call(r,`.${i.be("dropdown","wrap")}`);e&&MS(e,l)}null==(s=w.value)||s.handleScroll()},me=e=>{a.options.set(e.value,e),a.cachedOptions.set(e.value,e),e.disabled&&a.disabledOptions.set(e.value,e)},ve=(e,t)=>{a.options.get(e)===t&&a.options.delete(e)},{handleCompositionStart:ye,handleCompositionUpdate:be,handleCompositionEnd:we}=HS((e=>se(e))),Ce=(0,n.computed)((()=>{var e,t;return null==(t=null==(e=d.value)?void 0:e.popperRef)?void 0:t.contentRef})),Se=()=>{(0,n.nextTick)((()=>ge(a.selected)))},Ee=()=>{var e;null==(e=h.value)||e.focus()},Te=()=>{xe()},ke=e=>{pe(e)},xe=e=>{if(k.value=!1,S.value){const t=new FocusEvent("focus",e);(0,n.nextTick)((()=>T(t)))}},Ne=()=>{a.inputValue.length>0?a.inputValue="":k.value=!1},Re=()=>{_.value||(a.menuVisibleOnFocus?a.menuVisibleOnFocus=!1:k.value=!k.value)},Ie=()=>{k.value?$.value[a.hoveringIndex]&&he($.value[a.hoveringIndex]):Re()},_e=t=>ln(t.value)?Gt(t.value,e.valueKey):t.value,Oe=(0,n.computed)((()=>$.value.filter((e=>e.visible)).every((e=>e.disabled)))),Ae=(0,n.computed)((()=>e.multiple?e.collapseTags?a.selected.slice(0,e.maxCollapseTags):a.selected:[])),Be=(0,n.computed)((()=>e.multiple&&e.collapseTags?a.selected.slice(e.maxCollapseTags):[])),De=e=>{if(k.value){if(0!==a.options.size&&0!==V.value&&!Oe.value){"next"===e?(a.hoveringIndex++,a.hoveringIndex===a.options.size&&(a.hoveringIndex=0)):"prev"===e&&(a.hoveringIndex--,a.hoveringIndex<0&&(a.hoveringIndex=a.options.size-1));const t=$.value[a.hoveringIndex];!0!==t.disabled&&!0!==t.states.groupDisabled&&t.visible||De(e),(0,n.nextTick)((()=>ge(x.value)))}}else k.value=!0},Pe=()=>{if(!u.value)return 0;const e=window.getComputedStyle(u.value);return Number.parseFloat(e.gap||"6px")},He=(0,n.computed)((()=>{const t=Pe(),n=b.value&&1===e.maxCollapseTags?a.selectionWidth-a.collapseItemWidth-t:a.selectionWidth;return{maxWidth:`${n}px`}})),Me=(0,n.computed)((()=>({maxWidth:`${a.selectionWidth}px`}))),je=(0,n.computed)((()=>({width:`${Math.max(a.calculatorWidth,jS)}px`})));return e.multiple&&!on(e.modelValue)&&t(Xc,[]),!e.multiple&&on(e.modelValue)&&t(Xc,""),qs(u,ee),qs(f,te),qs(v,re),qs(C,re),qs(y,oe),qs(b,ne),(0,n.onMounted)((()=>{Z()})),{inputId:I,contentId:o,nsSelect:i,nsInput:s,states:a,isFocused:S,expanded:k,optionsArray:$,hoverOption:x,selectSize:U,filteredOptionsCount:V,resetCalculatorWidth:te,updateTooltip:re,updateTagTooltip:oe,debouncedOnInputChange:ae,onInput:se,deletePrevTag:ue,deleteTag:de,deleteSelected:pe,handleOptionSelect:he,scrollToOption:ge,hasModelValue:O,shouldShowPlaceholder:W,currentPlaceholder:G,showClose:A,iconComponent:B,iconReverse:D,validateState:P,validateIcon:H,showNewOption:q,updateOptions:F,collapseTagSize:z,setSelected:Z,selectDisabled:_,emptyText:j,handleCompositionStart:ye,handleCompositionUpdate:be,handleCompositionEnd:we,onOptionCreate:me,onOptionDestroy:ve,handleMenuEnter:Se,handleFocus:E,focus:Ee,blur:Te,handleBlur:T,handleClearClick:ke,handleClickOutside:xe,handleEsc:Ne,toggleMenu:Re,selectOption:Ie,getValueKey:_e,navigateOptions:De,dropdownMenuVisible:K,showTagList:Ae,collapseTagList:Be,tagStyle:He,collapseTagStyle:Me,inputStyle:je,popperRef:Ce,inputRef:h,tooltipRef:d,tagTooltipRef:p,calculatorRef:f,prefixRef:g,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:w,menuRef:v,tagMenuRef:y,collapseItemRef:b}};var $S=(0,n.defineComponent)({name:"ElOptions",setup(e,{slots:t}){const r=(0,n.inject)(hS);let o=[];return()=>{var e,n;const i=null==(e=t.default)?void 0:e.call(t),s=[];function a(e){on(e)&&e.forEach((e=>{var t,n,r,o;const i=null==(t=(null==e?void 0:e.type)||{})?void 0:t.name;"ElOptionGroup"===i?a(an(e.children)||on(e.children)||!sn(null==(n=e.children)?void 0:n.default)?e.children:null==(r=e.children)?void 0:r.default()):"ElOption"===i?s.push(null==(o=e.props)?void 0:o.value):on(e.children)&&a(e.children)}))}return i.length&&a(null==(n=i[0])?void 0:n.children),_m(s,o)||(o=s,r&&(r.states.optionValues=s)),i}}});const LS=Dn({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Hn,effect:{type:On(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:On(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:ss.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:pc,default:Wl},fitInputWidth:Boolean,suffixIcon:{type:pc,default:Bl},tagType:{...sS.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:On(String),values:co,default:"bottom-start"},fallbackPlacements:{type:On(Array),default:["bottom-start","top-start","right","left"]},ariaLabel:{type:String,default:void 0}}),qS="ElSelect",FS=(0,n.defineComponent)({name:qS,componentName:qS,components:{ElInput:GC,ElSelectMenu:ES,ElOption:wS,ElOptions:$S,ElTag:dS,ElScrollbar:fd,ElTooltip:Ol,ElIcon:wu},directives:{ClickOutside:kv},props:LS,emits:[Xc,Qc,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:t}){const r=VS(e,t);return(0,n.provide)(hS,(0,n.reactive)({props:e,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r}}}),US=["id","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label"],zS=["textContent"];function KS(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-tag"),l=(0,n.resolveComponent)("el-tooltip"),c=(0,n.resolveComponent)("el-icon"),u=(0,n.resolveComponent)("el-option"),d=(0,n.resolveComponent)("el-options"),p=(0,n.resolveComponent)("el-scrollbar"),h=(0,n.resolveComponent)("el-select-menu"),f=(0,n.resolveDirective)("click-outside");return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"selectRef",class:(0,n.normalizeClass)([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),onMouseenter:t[14]||(t[14]=t=>e.states.inputHovering=!0),onMouseleave:t[15]||(t[15]=t=>e.states.inputHovering=!1),onClick:t[16]||(t[16]=(0,n.withModifiers)(((...t)=>e.toggleMenu&&e.toggleMenu(...t)),["stop"]))},[(0,n.createVNode)(l,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:t[13]||(t[13]=t=>e.states.isBeforeHide=!1)},{default:(0,n.withCtx)((()=>{var r;return[(0,n.createElementVNode)("div",{ref:"wrapperRef",class:(0,n.normalizeClass)([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)])},[e.$slots.prefix?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"prefixRef",class:(0,n.normalizeClass)(e.nsSelect.e("prefix"))},[(0,n.renderSlot)(e.$slots,"prefix")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref:"selectionRef",class:(0,n.normalizeClass)([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?(0,n.renderSlot)(e.$slots,"tag",{key:0},(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.showTagList,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.getValueKey(t),class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:(0,n.normalizeStyle)(e.tagStyle),onClose:n=>e.deleteTag(n,t)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))},(0,n.toDisplayString)(t.currentLabel),3)])),_:2},1032,["closable","size","type","style","onClose"])],2)))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",{ref:"collapseItemRef",class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:(0,n.normalizeStyle)(e.collapseTagStyle)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))}," + "+(0,n.toDisplayString)(e.states.selected.length-e.maxCollapseTags),3)])),_:1},8,["size","type","style"])],2)])),content:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",{ref:"tagMenuRef",class:(0,n.normalizeClass)(e.nsSelect.e("selection"))},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.collapseTagList,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.getValueKey(t),class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{class:"in-tooltip",closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",onClose:n=>e.deleteTag(n,t)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))},(0,n.toDisplayString)(t.currentLabel),3)])),_:2},1032,["closable","size","type","onClose"])],2)))),128))],2)])),_:1},8,["disabled","effect","teleported"])):(0,n.createCommentVNode)("v-if",!0)])):(0,n.createCommentVNode)("v-if",!0),e.selectDisabled?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[(0,n.withDirectives)((0,n.createElementVNode)("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":t[0]||(t[0]=t=>e.states.inputValue=t),type:"text",class:(0,n.normalizeClass)([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:(0,n.normalizeStyle)(e.inputStyle),role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":(null==(r=e.hoverOption)?void 0:r.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onBlur:t[2]||(t[2]=(...t)=>e.handleBlur&&e.handleBlur(...t)),onKeydown:[t[3]||(t[3]=(0,n.withKeys)((0,n.withModifiers)((t=>e.navigateOptions("next")),["stop","prevent"]),["down"])),t[4]||(t[4]=(0,n.withKeys)((0,n.withModifiers)((t=>e.navigateOptions("prev")),["stop","prevent"]),["up"])),t[5]||(t[5]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop","prevent"]),["esc"])),t[6]||(t[6]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.selectOption&&e.selectOption(...t)),["stop","prevent"]),["enter"])),t[7]||(t[7]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.deletePrevTag&&e.deletePrevTag(...t)),["stop"]),["delete"]))],onCompositionstart:t[8]||(t[8]=(...t)=>e.handleCompositionStart&&e.handleCompositionStart(...t)),onCompositionupdate:t[9]||(t[9]=(...t)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...t)),onCompositionend:t[10]||(t[10]=(...t)=>e.handleCompositionEnd&&e.handleCompositionEnd(...t)),onInput:t[11]||(t[11]=(...t)=>e.onInput&&e.onInput(...t)),onClick:t[12]||(t[12]=(0,n.withModifiers)(((...t)=>e.toggleMenu&&e.toggleMenu(...t)),["stop"]))},null,46,US),[[n.vModelText,e.states.inputValue]]),e.filterable?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:(0,n.normalizeClass)(e.nsSelect.e("input-calculator")),textContent:(0,n.toDisplayString)(e.states.inputValue)},null,10,zS)):(0,n.createCommentVNode)("v-if",!0)],2)),e.shouldShowPlaceholder?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentPlaceholder),1)],2)):(0,n.createCommentVNode)("v-if",!0)],2),(0,n.createElementVNode)("div",{ref:"suffixRef",class:(0,n.normalizeClass)(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,class:(0,n.normalizeClass)([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.iconComponent)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),e.showClose&&e.clearIcon?((0,n.openBlock)(),(0,n.createBlock)(c,{key:1,class:(0,n.normalizeClass)([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.clearIcon)))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0),e.validateState&&e.validateIcon?((0,n.openBlock)(),(0,n.createBlock)(c,{key:2,class:(0,n.normalizeClass)([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.validateIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)]})),content:(0,n.withCtx)((()=>[(0,n.createVNode)(h,{ref:"menuRef"},{default:(0,n.withCtx)((()=>[e.$slots.header?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","header"))},[(0,n.renderSlot)(e.$slots,"header")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.withDirectives)((0,n.createVNode)(p,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:(0,n.normalizeClass)([e.nsSelect.is("empty",0===e.filteredOptionsCount)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:(0,n.withCtx)((()=>[e.showNewOption?((0,n.openBlock)(),(0,n.createBlock)(u,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(d,null,{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3})])),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[n.vShow,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","loading"))},[(0,n.renderSlot)(e.$slots,"loading")],2)):e.loading||0===e.filteredOptionsCount?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","empty"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.emptyText),1)]))],2)):(0,n.createCommentVNode)("v-if",!0),e.$slots.footer?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:3,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","footer"))},[(0,n.renderSlot)(e.$slots,"footer")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},512)])),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","onBeforeShow"])],34)),[[f,e.handleClickOutside,e.popperRef]])}var WS=Cr(FS,[["render",KS],["__file","select.vue"]]);const GS=(0,n.defineComponent)({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=c("select"),r=(0,n.ref)(null),o=(0,n.getCurrentInstance)(),i=(0,n.ref)([]);(0,n.provide)(pS,(0,n.reactive)({...(0,n.toRefs)(e)}));const s=(0,n.computed)((()=>i.value.some((e=>!0===e.visible)))),a=e=>{const t=[];return on(e.children)&&e.children.forEach((e=>{var n,r;e.type&&"ElOption"===e.type.name&&e.component&&e.component.proxy?t.push(e.component.proxy):(null==(n=e.children)?void 0:n.length)?t.push(...a(e)):(null==(r=e.component)?void 0:r.subTree)&&t.push(...a(e.component.subTree))})),t},l=()=>{i.value=a(o.subTree)};return(0,n.onMounted)((()=>{l()})),Ws(r,l,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:s,ns:t}}});function YS(e,t,r,o,i,s){return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("ul",{ref:"groupRef",class:(0,n.normalizeClass)(e.ns.be("group","wrap"))},[(0,n.createElementVNode)("li",{class:(0,n.normalizeClass)(e.ns.be("group","title"))},(0,n.toDisplayString)(e.label),3),(0,n.createElementVNode)("li",null,[(0,n.createElementVNode)("ul",{class:(0,n.normalizeClass)(e.ns.b("group"))},[(0,n.renderSlot)(e.$slots,"default")],2)])],2)),[[n.vShow,e.visible]])}var JS=Cr(GS,[["render",YS],["__file","option-group.vue"]]);const ZS=dr(WS,{Option:wS,OptionGroup:JS}),XS=fr(wS),QS=(fr(JS),Dn({type:{type:String,values:["primary","success","warning","info","danger","default"],default:"default"},underline:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:pc}})),eE={click:e=>e instanceof MouseEvent},tE=["href","target"],nE=(0,n.defineComponent)({name:"ElLink"}),rE=(0,n.defineComponent)({...nE,props:QS,emits:eE,setup(e,{emit:t}){const r=e,o=c("link"),i=(0,n.computed)((()=>[o.b(),o.m(r.type),o.is("disabled",r.disabled),o.is("underline",r.underline&&!r.disabled)]));function s(e){r.disabled||t("click",e)}return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("a",{class:(0,n.normalizeClass)((0,n.unref)(i)),href:e.disabled||!e.href?void 0:e.href,target:e.disabled||!e.href?void 0:e.target,onClick:s},[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:0},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon)))])),_:1})):(0,n.createCommentVNode)("v-if",!0),e.$slots.default?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,class:(0,n.normalizeClass)((0,n.unref)(o).e("inner"))},[(0,n.renderSlot)(e.$slots,"default")],2)):(0,n.createCommentVNode)("v-if",!0),e.$slots.icon?(0,n.renderSlot)(e.$slots,"icon",{key:2}):(0,n.createCommentVNode)("v-if",!0)],10,tE))}});var oE=Cr(rE,[["__file","link.vue"]]);const iE=dr(oE),sE=Symbol("elDropdown"),aE=Dn({style:{type:On([String,Array,Object])},currentTabId:{type:On(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:On(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:lE,ElCollectionItem:cE,COLLECTION_INJECTION_KEY:uE,COLLECTION_ITEM_INJECTION_KEY:dE}=Ec("RovingFocusGroup"),pE=Symbol("elRovingFocusGroup"),hE=Symbol("elRovingFocusGroupItem"),fE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},gE=(e,t)=>{if("rtl"!==t)return e;switch(e){case ls.right:return ls.left;case ls.left:return ls.right;default:return e}},mE=(e,t,n)=>{const r=gE(e.key,n);if(("vertical"!==t||![ls.left,ls.right].includes(r))&&("horizontal"!==t||![ls.up,ls.down].includes(r)))return fE[r]},vE=(e,t)=>e.map(((n,r)=>e[(r+t)%e.length])),yE=e=>{const{activeElement:t}=document;for(const n of e){if(n===t)return;if(n.focus(),t!==document.activeElement)return}},bE="currentTabIdChange",wE="rovingFocusGroup.entryFocus",CE={bubbles:!1,cancelable:!0},SE=(0,n.defineComponent)({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:aE,emits:[bE,"entryFocus"],setup(e,{emit:t}){var r;const o=(0,n.ref)(null!=(r=e.currentTabId||e.defaultCurrentTabId)?r:null),i=(0,n.ref)(!1),s=(0,n.ref)(!1),a=(0,n.ref)(null),{getItems:l}=(0,n.inject)(uE,void 0),c=(0,n.computed)((()=>[{outline:"none"},e.style])),u=e=>{t(bE,e)},d=()=>{i.value=!0},p=Ts((t=>{var n;null==(n=e.onMousedown)||n.call(e,t)}),(()=>{s.value=!0})),h=Ts((t=>{var n;null==(n=e.onFocus)||n.call(e,t)}),(e=>{const t=!(0,n.unref)(s),{target:r,currentTarget:a}=e;if(r===a&&t&&!(0,n.unref)(i)){const e=new Event(wE,CE);if(null==a||a.dispatchEvent(e),!e.defaultPrevented){const e=l().filter((e=>e.focusable)),t=e.find((e=>e.active)),r=e.find((e=>e.id===(0,n.unref)(o))),i=[t,r,...e].filter(Boolean),s=i.map((e=>e.ref));yE(s)}}s.value=!1})),f=Ts((t=>{var n;null==(n=e.onBlur)||n.call(e,t)}),(()=>{i.value=!1})),g=(...e)=>{t("entryFocus",...e)};(0,n.provide)(pE,{currentTabbedId:(0,n.readonly)(o),loop:(0,n.toRef)(e,"loop"),tabIndex:(0,n.computed)((()=>(0,n.unref)(i)?-1:0)),rovingFocusGroupRef:a,rovingFocusGroupRootStyle:c,orientation:(0,n.toRef)(e,"orientation"),dir:(0,n.toRef)(e,"dir"),onItemFocus:u,onItemShiftTab:d,onBlur:f,onFocus:h,onMousedown:p}),(0,n.watch)((()=>e.currentTabId),(e=>{o.value=null!=e?e:null})),Os(a,wE,g)}});function EE(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var TE=Cr(SE,[["render",EE],["__file","roving-focus-group-impl.vue"]]);const kE=(0,n.defineComponent)({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:lE,ElRovingFocusGroupImpl:TE}});function xE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-roving-focus-group-impl"),l=(0,n.resolveComponent)("el-focus-group-collection");return(0,n.openBlock)(),(0,n.createBlock)(l,null,{default:(0,n.withCtx)((()=>[(0,n.createVNode)(a,(0,n.normalizeProps)((0,n.guardReactiveProps)(e.$attrs)),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16)])),_:3})}var NE=Cr(kE,[["render",xE],["__file","roving-focus-group.vue"]]);const{ButtonGroup:RE}=NC,IE=(0,n.defineComponent)({name:"ElDropdown",components:{ElButton:NC,ElButtonGroup:RE,ElScrollbar:fd,ElDropdownCollection:_c,ElTooltip:Ol,ElRovingFocusGroup:NE,ElOnlyChild:aa,ElIcon:wu,ArrowDown:Bl},props:Tc,emits:["visible-change","click","command"],setup(e,{emit:t}){const r=(0,n.getCurrentInstance)(),o=c("dropdown"),{t:i}=en(),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.ref)(null),h=(0,n.ref)(!1),f=[ls.enter,ls.space,ls.down],g=(0,n.computed)((()=>({maxHeight:Lc(e.maxHeight)}))),m=(0,n.computed)((()=>[o.m(E.value)])),v=(0,n.computed)((()=>su(e.trigger))),y=ba().value,b=(0,n.computed)((()=>e.id||y));function w(){C()}function C(){var e;null==(e=l.value)||e.onClose()}function S(){var e;null==(e=l.value)||e.onOpen()}(0,n.watch)([s,v],(([e,t],[n])=>{var r,o,i;(null==(r=null==n?void 0:n.$el)?void 0:r.removeEventListener)&&n.$el.removeEventListener("pointerenter",k),(null==(o=null==e?void 0:e.$el)?void 0:o.removeEventListener)&&e.$el.removeEventListener("pointerenter",k),(null==(i=null==e?void 0:e.$el)?void 0:i.addEventListener)&&t.includes("hover")&&e.$el.addEventListener("pointerenter",k)}),{immediate:!0}),(0,n.onBeforeUnmount)((()=>{var e,t;(null==(t=null==(e=s.value)?void 0:e.$el)?void 0:t.removeEventListener)&&s.value.$el.removeEventListener("pointerenter",k)}));const E=Sm();function T(...e){t("command",...e)}function k(){var e,t;null==(t=null==(e=s.value)?void 0:e.$el)||t.focus()}function x(){}function N(){const e=(0,n.unref)(u);v.value.includes("hover")&&(null==e||e.focus()),p.value=null}function R(e){p.value=e}function I(e){h.value||(e.preventDefault(),e.stopImmediatePropagation())}function _(){t("visible-change",!0)}function O(e){"keydown"===(null==e?void 0:e.type)&&u.value.focus()}function A(){t("visible-change",!1)}(0,n.provide)(sE,{contentRef:u,role:(0,n.computed)((()=>e.role)),triggerId:b,isUsingKeyboard:h,onItemEnter:x,onItemLeave:N}),(0,n.provide)("elDropdown",{instance:r,dropdownSize:E,handleClick:w,commandHandler:T,trigger:(0,n.toRef)(e,"trigger"),hideOnClick:(0,n.toRef)(e,"hideOnClick")});const B=e=>{var t,n;e.preventDefault(),null==(n=null==(t=u.value)?void 0:t.focus)||n.call(t,{preventScroll:!0})},D=e=>{t("click",e)};return{t:i,ns:o,scrollbar:d,wrapStyle:g,dropdownTriggerKls:m,dropdownSize:E,triggerId:b,triggerKeys:f,currentTabId:p,handleCurrentTabIdChange:R,handlerMainButtonClick:D,handleEntryFocus:I,handleClose:C,handleOpen:S,handleBeforeShowTooltip:_,handleShowTooltip:O,handleBeforeHideTooltip:A,onFocusAfterTrapped:B,popperRef:l,contentRef:u,triggeringElementRef:s,referenceElementRef:a}}});function _E(e,t,r,o,i,s){var a;const l=(0,n.resolveComponent)("el-dropdown-collection"),c=(0,n.resolveComponent)("el-roving-focus-group"),u=(0,n.resolveComponent)("el-scrollbar"),d=(0,n.resolveComponent)("el-only-child"),p=(0,n.resolveComponent)("el-tooltip"),h=(0,n.resolveComponent)("el-button"),f=(0,n.resolveComponent)("arrow-down"),g=(0,n.resolveComponent)("el-icon"),m=(0,n.resolveComponent)("el-button-group");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([e.ns.b(),e.ns.is("disabled",e.disabled)])},[(0,n.createVNode)(p,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":"hover"===e.trigger?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":null==(a=e.referenceElementRef)?void 0:a.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":"hover"===e.trigger?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:"",onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},(0,n.createSlots)({content:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,null,{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"dropdown")])),_:3})])),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])])),_:3},8,["wrap-style","view-class"])])),_:2},[e.splitButton?void 0:{name:"default",fn:(0,n.withCtx)((()=>[(0,n.createVNode)(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","tabindex"])]))}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?((0,n.openBlock)(),(0,n.createBlock)(m,{key:0},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(h,(0,n.mergeProps)({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["size","type","disabled","tabindex","onClick"]),(0,n.createVNode)(h,(0,n.mergeProps)({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:(0,n.withCtx)((()=>[(0,n.createVNode)(g,{class:(0,n.normalizeClass)(e.ns.e("icon"))},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(f)])),_:1},8,["class"])])),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])])),_:3})):(0,n.createCommentVNode)("v-if",!0)],2)}var OE=Cr(IE,[["render",_E],["__file","dropdown.vue"]]);const AE=(...e)=>t=>{e.forEach((e=>{sn(e)?e(t):e.value=t}))},BE=(0,n.defineComponent)({name:"DropdownItemImpl",components:{ElIcon:wu},props:kc,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const r=c("dropdown"),{role:o}=(0,n.inject)(sE,void 0),{collectionItemRef:i}=(0,n.inject)(Bc,void 0),{collectionItemRef:s}=(0,n.inject)(dE,void 0),{rovingFocusGroupItemRef:a,tabIndex:l,handleFocus:u,handleKeydown:d,handleMousedown:p}=(0,n.inject)(hE,void 0),h=AE(i,s,a),f=(0,n.computed)((()=>"menu"===o.value?"menuitem":"navigation"===o.value?"link":"button")),g=Ts((e=>{const{code:n}=e;if(n===ls.enter||n===ls.space)return e.preventDefault(),e.stopImmediatePropagation(),t("clickimpl",e),!0}),d);return{ns:r,itemRef:h,dataset:{[Sc]:""},role:f,tabIndex:l,handleFocus:u,handleKeydown:g,handleMousedown:p}}}),DE=["aria-disabled","tabindex","role"];function PE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-icon");return(0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[e.divided?((0,n.openBlock)(),(0,n.createElementBlock)("li",(0,n.mergeProps)({key:0,role:"separator",class:e.ns.bem("menu","item","divided")},e.$attrs),null,16)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("li",(0,n.mergeProps)({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t[0]||(t[0]=t=>e.$emit("clickimpl",t)),onFocus:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onKeydown:t[2]||(t[2]=(0,n.withModifiers)(((...t)=>e.handleKeydown&&e.handleKeydown(...t)),["self"])),onMousedown:t[3]||(t[3]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),onPointermove:t[4]||(t[4]=t=>e.$emit("pointermove",t)),onPointerleave:t[5]||(t[5]=t=>e.$emit("pointerleave",t))}),[e.icon?((0,n.openBlock)(),(0,n.createBlock)(a,{key:0},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon)))])),_:1})):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default")],16,DE)],64)}var HE=Cr(BE,[["render",PE],["__file","dropdown-item-impl.vue"]]);const ME=()=>{const e=(0,n.inject)("elDropdown",{}),t=(0,n.computed)((()=>null==e?void 0:e.dropdownSize));return{elDropdown:e,_elDropdownSize:t}},jE=(0,n.defineComponent)({components:{ElRovingFocusCollectionItem:cE},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:r,loop:o,onItemFocus:i,onItemShiftTab:s}=(0,n.inject)(pE,void 0),{getItems:a}=(0,n.inject)(uE,void 0),l=ba(),c=(0,n.ref)(null),u=Ts((e=>{t("mousedown",e)}),(t=>{e.focusable?i((0,n.unref)(l)):t.preventDefault()})),d=Ts((e=>{t("focus",e)}),(()=>{i((0,n.unref)(l))})),p=Ts((e=>{t("keydown",e)}),(e=>{const{key:t,shiftKey:r,target:i,currentTarget:l}=e;if(t===ls.tab&&r)return void s();if(i!==l)return;const c=mE(e);if(c){e.preventDefault();const t=a().filter((e=>e.focusable));let r=t.map((e=>e.ref));switch(c){case"last":r.reverse();break;case"prev":case"next":{"prev"===c&&r.reverse();const e=r.indexOf(l);r=o.value?vE(r,e+1):r.slice(e+1);break}default:break}(0,n.nextTick)((()=>{yE(r)}))}})),h=(0,n.computed)((()=>r.value===(0,n.unref)(l)));return(0,n.provide)(hE,{rovingFocusGroupItemRef:c,tabIndex:(0,n.computed)((()=>(0,n.unref)(h)?0:-1)),handleMousedown:u,handleFocus:d,handleKeydown:p}),{id:l,handleKeydown:p,handleFocus:d,handleMousedown:u}}});function VE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-roving-focus-collection-item");return(0,n.openBlock)(),(0,n.createBlock)(a,{id:e.id,focusable:e.focusable,active:e.active},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","focusable","active"])}var $E=Cr(jE,[["render",VE],["__file","roving-focus-item.vue"]]);const LE=(0,n.defineComponent)({name:"ElDropdownItem",components:{ElDropdownCollectionItem:Oc,ElRovingFocusItem:$E,ElDropdownItemImpl:HE},inheritAttrs:!1,props:kc,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:r}){const{elDropdown:o}=ME(),i=(0,n.getCurrentInstance)(),s=(0,n.ref)(null),a=(0,n.computed)((()=>{var e,t;return null!=(t=null==(e=(0,n.unref)(s))?void 0:e.textContent)?t:""})),{onItemEnter:l,onItemLeave:c}=(0,n.inject)(sE,void 0),u=Ts((e=>(t("pointermove",e),e.defaultPrevented)),ks((t=>{if(e.disabled)return void c(t);const n=t.currentTarget;n===document.activeElement||n.contains(document.activeElement)||(l(t),t.defaultPrevented||null==n||n.focus())}))),d=Ts((e=>(t("pointerleave",e),e.defaultPrevented)),ks((e=>{c(e)}))),p=Ts((n=>{if(!e.disabled)return t("click",n),"keydown"!==n.type&&n.defaultPrevented}),(t=>{var n,r,s;e.disabled?t.stopImmediatePropagation():((null==(n=null==o?void 0:o.hideOnClick)?void 0:n.value)&&(null==(r=o.handleClick)||r.call(o)),null==(s=o.commandHandler)||s.call(o,e.command,i,t))})),h=(0,n.computed)((()=>({...e,...r})));return{handleClick:p,handlePointerMove:u,handlePointerLeave:d,textContent:a,propsAndAttrs:h}}});function qE(e,t,r,o,i,s){var a;const l=(0,n.resolveComponent)("el-dropdown-item-impl"),c=(0,n.resolveComponent)("el-roving-focus-item"),u=(0,n.resolveComponent)("el-dropdown-collection-item");return(0,n.openBlock)(),(0,n.createBlock)(u,{disabled:e.disabled,"text-value":null!=(a=e.textValue)?a:e.textContent},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{focusable:!e.disabled},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,(0,n.mergeProps)(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["onPointerleave","onPointermove","onClickimpl"])])),_:3},8,["focusable"])])),_:3},8,["disabled","text-value"])}var FE=Cr(LE,[["render",qE],["__file","dropdown-item.vue"]]);const UE=(0,n.defineComponent)({name:"ElDropdownMenu",props:xc,setup(e){const t=c("dropdown"),{_elDropdownSize:r}=ME(),o=r.value,{focusTrapRef:i,onKeydown:s}=(0,n.inject)(za,void 0),{contentRef:a,role:l,triggerId:u}=(0,n.inject)(sE,void 0),{collectionRef:d,getItems:p}=(0,n.inject)(Ac,void 0),{rovingFocusGroupRef:h,rovingFocusGroupRootStyle:f,tabIndex:g,onBlur:m,onFocus:v,onMousedown:y}=(0,n.inject)(pE,void 0),{collectionRef:b}=(0,n.inject)(uE,void 0),w=(0,n.computed)((()=>[t.b("menu"),t.bm("menu",null==o?void 0:o.value)])),C=AE(a,d,i,h,b),S=Ts((t=>{var n;null==(n=e.onKeydown)||n.call(e,t)}),(e=>{const{currentTarget:t,code:r,target:o}=e;t.contains(o);if(ls.tab===r&&e.stopImmediatePropagation(),e.preventDefault(),o!==(0,n.unref)(a))return;if(!Ic.includes(r))return;const i=p().filter((e=>!e.disabled)),s=i.map((e=>e.ref));Rc.includes(r)&&s.reverse(),yE(s)})),E=e=>{S(e),s(e)};return{size:o,rovingFocusGroupRootStyle:f,tabIndex:g,dropdownKls:w,role:l,triggerId:u,dropdownListWrapperRef:C,handleKeydown:E,onBlur:m,onFocus:v,onMousedown:y}}}),zE=["role","aria-labelledby"];function KE(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("ul",{ref:e.dropdownListWrapperRef,class:(0,n.normalizeClass)(e.dropdownKls),style:(0,n.normalizeStyle)(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:t[0]||(t[0]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:t[1]||(t[1]=(...t)=>e.onFocus&&e.onFocus(...t)),onKeydown:t[2]||(t[2]=(0,n.withModifiers)(((...t)=>e.handleKeydown&&e.handleKeydown(...t)),["self"])),onMousedown:t[3]||(t[3]=(0,n.withModifiers)(((...t)=>e.onMousedown&&e.onMousedown(...t)),["self"]))},[(0,n.renderSlot)(e.$slots,"default")],46,zE)}var WE=Cr(UE,[["render",KE],["__file","dropdown-menu.vue"]]);const GE=dr(OE,{DropdownItem:FE,DropdownMenu:WE}),YE=fr(FE),JE=fr(WE),ZE=e=>((0,n.pushScopeId)("data-v-c433d258"),e=e(),(0,n.popScopeId)(),e),XE={class:"peerStatus",drag:""},QE={class:"login-type"},eT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-fangxiang-you-mian-xiao"},null,-1))),tT={class:"status-name"},nT=["title"],rT={class:"wtue wtue-fangxiang-xia-mian-xiao"},oT={class:"status-name-text ue-call-variable"},iT={class:"dialState-box"},sT={class:"call-btn-right"},aT={class:"customer-info",drag:""},lT={class:"customer-item"},cT={class:"customer-name"},uT={class:"time"},dT={class:"customer-item"},pT={class:"region"},hT={class:"quick-operation-box drag",drag:""},fT={class:"quick-btn"},gT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-guaji1"},null,-1))),mT=[gT],vT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting"},null,-1))),yT=[vT],bT={key:0,class:"error"},wT={class:"opacity80"},CT=(0,n.createTextVNode)("刷新状态"),ST={class:"oprate-wrap link-hangup"},ET=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-guaji1 right8 font12"},null,-1))),TT=(0,n.createTextVNode)("挂断 "),kT=[ET,TT],xT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting right8 font12"},null,-1))),NT=(0,n.createTextVNode)("接听 "),RT=[xT,NT],IT={class:"oprate-wrap link-oprate"},_T=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),OT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),AT=[_T,OT],BT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),DT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),PT=[BT,DT],HT={class:"oprate-wrap link-oprate"},MT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-baochi"},null,-1))),jT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"保持",-1))),VT=[MT,jT],$T=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaobaochi"},null,-1))),LT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"取消保持",-1))),qT=[$T,LT],FT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jingyin"},null,-1))),UT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"静音",-1))),zT=[FT,UT],KT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaojingyin"},null,-1))),WT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"取消静音",-1))),GT=[KT,WT],YT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jiehui"},null,-1))),JT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"接回",-1))),ZT=[YT,JT],XT=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zixun"},null,-1))),QT=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"咨询",-1))),ek=[XT,QT],tk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaozixun"},null,-1))),nk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"取消咨询",-1))),rk=[tk,nk],ok=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaozixun"},null,-1))),ik=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"取消咨询",-1))),sk=[ok,ik],ak=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zixunzhuanyi"},null,-1))),lk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"咨询转移",-1))),ck=[ak,lk],uk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-sanfangtonghua"},null,-1))),dk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"三方通话",-1))),pk=[uk,dk],hk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),fk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"转接",-1))),gk=[hk,fk],mk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-manyidu"},null,-1))),vk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"满意度",-1))),yk=[mk,vk],bk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jianpan"},null,-1))),wk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"键盘",-1))),Ck=[bk,wk],Sk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaojianpan"},null,-1))),Ek=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"取消键盘",-1))),Tk=[Sk,Ek],kk={key:1},xk=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),Nk=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),Rk=[xk,Nk],Ik={key:2},_k=ZE((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),Ok=ZE((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),Ak=[_k,Ok],Bk={key:3,class:"dial"},Dk={class:"dial-input"},Pk=ZE((()=>(0,n.createElementVNode)("use",{"xlink:href":"#wtue-jianpanshanchu"},null,-1))),Hk=[Pk],Mk={class:"call-btn",style:{color:"rgb(28, 146, 233)","font-weight":"600","font-size":"16px"}},jk={key:0,class:"dial-box"},Vk=["onClick"],$k={key:4,class:"setting"},Lk=ZE((()=>(0,n.createElementVNode)("div",{class:"label"},"通话设置",-1))),qk=(0,n.createTextVNode)(" 接听方式 "),Fk=(0,n.createTextVNode)("自动接听"),Uk={key:1},zk=(0,n.createTextVNode)(" 振铃 "),Kk=(0,n.createTextVNode)(" 后接听 "),Wk=(0,n.createTextVNode)(" SIP号 "),Gk={class:"footer"},Yk=(0,n.createTextVNode)("取消"),Jk=(0,n.createTextVNode)("确定");function Zk(e,t,r,o,i,s){const a=YE,l=JE,c=GE,u=(0,n.resolveComponent)("phoneBarTimer"),d=iE,p=(0,n.resolveComponent)("transferOprate"),h=(0,n.resolveComponent)("consuleOprate"),f=GC,g=XS,m=ZS,v=(0,n.resolveComponent)("formItem"),y=Cv,b=iS,w=(0,n.resolveComponent)("input-suffix"),C=NC,S=Dw,E=(0,n.resolveComponent)("networkDelay"),T=(0,n.resolveDirective)("int"),k=(0,n.resolveDirective)("move");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)({"red-border":"busy"==e.stateType,"success-border":"free"==e.stateType,"phone-bar":!0,"ue-call-variable":!0})},[(0,n.withDirectives)((0,n.createElementVNode)("div",XE,[(0,n.withDirectives)((0,n.createElementVNode)("div",QE,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["middle pointer",{"red-border":"busy"==e.stateType,"success-border":"free"==e.stateType}]),onClick:t[0]||(t[0]=(0,n.withModifiers)(((...t)=>e.goToSetting&&e.goToSetting(...t)),["stop"]))},[(0,n.createTextVNode)((0,n.toDisplayString)(e.loginTypeMap[e.loginType])+" ",1),eT],2)],512),[[n.vShow,!e.showConfig&&!e.disabledSwitch]]),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["peerStatus-center",e.stateType])},[(0,n.createVNode)(c,{class:"pointer",onCommand:e.updateAgentStatus,trigger:"click",disabled:e.disabledSwitch,style:{"min-width":"55px"}},{dropdown:(0,n.withCtx)((()=>[(0,n.createVNode)(l,{"visible-arrow":!1,class:"cep-dropdown-menu phoneMenu"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.agentStatusList,(t=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:t.number,command:t.number,class:(0,n.normalizeClass)({"hide-dropdown-item":t.name===e.currentStatusName})},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",oT,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["status",{idle:0===t.number}])},null,2),(0,n.createTextVNode)(" "+(0,n.toDisplayString)(t.name),1)])])),_:2},1032,["command","class"])))),128))])),_:1})])),default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",tT,[(0,n.createElementVNode)("span",{class:"name-ellipsis",title:e.currentStatusName},(0,n.toDisplayString)(e.currentStatusName),9,nT),(0,n.withDirectives)((0,n.createElementVNode)("i",rT,null,512),[[n.vShow,!e.disabledSwitch]]),(0,n.withDirectives)((0,n.createElementVNode)("span",null,(0,n.toDisplayString)(": "+e.callingNumber),513),[[n.vShow,e.disabledSwitch&&e.callingNumber]])])])),_:1},8,["onCommand","disabled"]),(0,n.createElementVNode)("div",iT,[(0,n.createVNode)(u,{class:"pointer",ref:"phoneBarPeerTimeRef"},null,512),e.showDial&&!e.hiddenOprate?((0,n.openBlock)(),(0,n.createElementBlock)("i",{key:0,class:"icon wtue wtue-kuozhan-shouqi-xian",onClick:t[1]||(t[1]=(...t)=>e.toggleDialState&&e.toggleDialState(...t))})):(0,n.createCommentVNode)("",!0),e.showDial||e.hiddenOprate?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("i",{key:1,onClick:t[2]||(t[2]=(...t)=>e.toggleDialState&&e.toggleDialState(...t)),class:"icon wtue wtue-a-hujiaojieting"}))])],2),(0,n.createElementVNode)("div",sT,[(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting success-back pointer",onClick:t[3]||(t[3]=(0,n.withModifiers)((t=>e.showInput=!e.showInput),["stop"]))})])],512),[[n.vShow,!e.disabledSwitch]]),(0,n.withDirectives)((0,n.createElementVNode)("div",aT,[(0,n.createElementVNode)("div",lT,[(0,n.createElementVNode)("div",cT,(0,n.toDisplayString)(e.customerInfo.name||e.customerInfo.number),1),(0,n.createElementVNode)("div",uT,[(0,n.createVNode)(u,{ref:"phoneBarStatusTimeRef"},null,512)])]),(0,n.createElementVNode)("div",dT,[(0,n.createElementVNode)("div",pT,(0,n.toDisplayString)(e.customerInfo.place||"未知地点"),1),(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"tag"},(0,n.toDisplayString)(e.customerInfo.tag||""),513),[[n.vShow,e.customerInfo.tag]])])],512),[[n.vShow,e.disabledSwitch&&!e.quickState]]),(0,n.withDirectives)((0,n.createElementVNode)("div",hT,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["quick-state",e.stateType]),drag:""},[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentStatusName),1),(0,n.createElementVNode)("span",null,[(0,n.createVNode)(u,{ref:"phoneBarQuickStatusTimeRef"},null,512),(0,n.createElementVNode)("i",{class:"wtue wtue-kuozhan-zhankai-xian",onClick:t[4]||(t[4]=t=>e.switchQuickState(!1))})])],2),(0,n.createElementVNode)("div",fT,[(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"btn-item hangup",onClick:t[5]||(t[5]=(0,n.withModifiers)(((...t)=>e.hangup&&e.hangup(...t)),["stop"]))},mT,512),[[n.vShow,e.isVisibleBtn("hangup")]]),(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"btn-item accept",onClick:t[6]||(t[6]=(0,n.withModifiers)(((...t)=>e.accept&&e.accept(...t)),["stop"]))},yT,512),[[n.vShow,e.isVisibleBtn("answer")]])])],512),[[n.vShow,e.disabledSwitch]]),e.errorObj.isError?((0,n.openBlock)(),(0,n.createElementBlock)("div",bT,[(0,n.createElementVNode)("div",wT,(0,n.toDisplayString)(e.errorObj.message),1),(0,n.createVNode)(d,{style:{"margin-top":"8px"},underline:!1,type:"primary",onClick:(0,n.withModifiers)(e.connect,["stop"])},{default:(0,n.withCtx)((()=>[CT])),_:1},8,["onClick"])])):(0,n.createCommentVNode)("",!0),(0,n.withDirectives)((0,n.createElementVNode)("div",ST,[e.isVisibleBtn("hangup")&&e.showHangupBtn?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn error-back pointer hangup-btn",onClick:t[7]||(t[7]=(0,n.withModifiers)(((...t)=>e.hangup&&e.hangup(...t)),["stop"]))},kT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("answer")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn success-back pointer",onClick:t[8]||(t[8]=(0,n.withModifiers)(((...t)=>e.accept&&e.accept(...t)),["stop"])),style:{"min-width":"200px"}},RT)):(0,n.createCommentVNode)("",!0)],512),[[n.vShow,e.disabledSwitch&&!e.quickState]]),(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("div",IT,[e.isVisibleBtn("concul")&&e.consulSelect?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn btn-middle pointer bak-btn",onClick:t[9]||(t[9]=(0,n.withModifiers)((t=>e.setConsulState(!1)),["stop"]))},AT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("transfer")&&e.transferState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn btn-middle pointer bak-btn",onClick:t[10]||(t[10]=(0,n.withModifiers)((t=>e.setTransferState(!1)),["stop"]))},PT)):(0,n.createCommentVNode)("",!0)]),(0,n.createElementVNode)("div",HT,[e.isVisibleBtn("hold")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn btn-middle pointer",onClick:t[11]||(t[11]=(0,n.withModifiers)((t=>e.holdOrUnHold("1")),["stop"]))},VT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("holdcancel")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn btn-middle pointer flex1",onClick:t[12]||(t[12]=(0,n.withModifiers)((t=>e.holdOrUnHold("2")),["stop"]))},qT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("mute")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:"btn btn-middle pointer",onClick:t[13]||(t[13]=(0,n.withModifiers)((t=>e.muteOrUnMute("1")),["stop"]))},zT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("mutecancel")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:3,class:"btn btn-middle pointer flex1",onClick:t[14]||(t[14]=(0,n.withModifiers)((t=>e.muteOrUnMute("2")),["stop"]))},GT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("takeback")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:4,class:"btn btn-middle pointer",onClick:t[15]||(t[15]=(0,n.withModifiers)(((...t)=>e.resumeConsult&&e.resumeConsult(...t)),["stop"]))},ZT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("concul")&&!e.consulSelect?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:5,class:"btn btn-middle pointer",onClick:t[16]||(t[16]=(0,n.withModifiers)((t=>e.setConsulState(!0)),["stop"]))},ek)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("cancelconcul")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:6,class:"btn btn-middle pointer",onClick:t[17]||(t[17]=(0,n.withModifiers)(((...t)=>e.cancelConsult&&e.cancelConsult(...t)),["stop"]))},rk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("endconsul")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:7,class:"btn btn-middle pointer",onClick:t[18]||(t[18]=(0,n.withModifiers)(((...t)=>e.stopConsult&&e.stopConsult(...t)),["stop"]))},sk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("concultransfer")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:8,class:"btn btn-middle pointer",onClick:t[19]||(t[19]=(0,n.withModifiers)(((...t)=>e.consultTransfer&&e.consultTransfer(...t)),["stop"]))},ck)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("threepartycall")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:9,class:"btn btn-middle pointer",onClick:t[20]||(t[20]=(0,n.withModifiers)(((...t)=>e.threeWayCall&&e.threeWayCall(...t)),["stop"]))},pk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("transfer")&&!e.transferState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:10,class:"btn btn-middle pointer",onClick:t[21]||(t[21]=(0,n.withModifiers)((t=>e.setTransferState(!0)),["stop"]))},gk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("satisfaction")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:11,class:"btn btn-middle pointer",onClick:t[22]||(t[22]=(0,n.withModifiers)(((...t)=>e.satisfaction&&e.satisfaction(...t)),["stop"]))},yk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("key")&&e.webrtcKeyState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:12,class:"btn btn-middle pointer",onClick:t[23]||(t[23]=(0,n.withModifiers)((t=>e.setWebrtcKeyState(!1)),["stop"]))},Ck)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("key")&&!e.webrtcKeyState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:13,class:"btn btn-middle pointer",onClick:t[24]||(t[24]=(0,n.withModifiers)((t=>e.setWebrtcKeyState(!0)),["stop"]))},Tk)):(0,n.createCommentVNode)("",!0)])]),e.isVisibleBtn("transferoprate")?((0,n.openBlock)(),(0,n.createElementBlock)("div",kk,[(0,n.createElementVNode)("div",{class:"btn btn-middle pointer bak-btn",onClick:t[25]||(t[25]=(0,n.withModifiers)((t=>e.setTransferState(!1)),["stop"]))},Rk),(0,n.createVNode)(p)])):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("consuleoprate")?((0,n.openBlock)(),(0,n.createElementBlock)("div",Ik,[(0,n.createElementVNode)("div",{class:"btn btn-middle pointer bak-btn",onClick:t[26]||(t[26]=(0,n.withModifiers)((t=>e.setConsulState(!1)),["stop"]))},Ak),(0,n.createVNode)(h)])):(0,n.createCommentVNode)("",!0),!e.showConfig&&!e.disabledSwitch||e.isVisibleBtn("key")&&!e.webrtcKeyState&&e.disabledSwitch?((0,n.openBlock)(),(0,n.createElementBlock)("div",Bk,[(0,n.withDirectives)((0,n.createElementVNode)("div",Dk,[(0,n.createVNode)(f,{class:"input",type:"",placeholder:e.showKeyboardPlaceholder?e.defaultKeyboardPlaceholder:"",ref:"input",clearable:"",modelValue:e.dialoutNumber,"onUpdate:modelValue":e.inputChange,onKeyup:(0,n.withKeys)(e.keyDowndialout,["enter"]),onFocus:t[27]||(t[27]=t=>e.showKeyboardPlaceholder=!1),onBlur:t[28]||(t[28]=t=>e.showKeyboardPlaceholder=!0)},null,8,["placeholder","modelValue","onUpdate:modelValue","onKeyup"]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("svg",{class:"ue-num-keyboard back pointer",onClick:t[29]||(t[29]=(0,n.withModifiers)(((...t)=>e.deleteNum&&e.deleteNum(...t)),["stop"]))},Hk,512)),[[n.vShow,e.isVisibleBtn("key")]]),(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)([{color:e.showNum?"rgb(28, 146, 233)":"rgb(140, 140, 140)"},{"font-weight":"600","font-size":"16px"}])},[(0,n.createElementVNode)("i",{class:"wtue wtue-jianpan pointer",onClick:t[30]||(t[30]=(0,n.withModifiers)((t=>e.showNum=!e.showNum),["stop"]))})],4),(0,n.createElementVNode)("div",Mk,[(0,n.createElementVNode)("i",{class:(0,n.normalizeClass)(["wtue wtue-hujiaohuojieting success-back pointer",{"dialout-disabled":!(e.isVisibleBtn("dialout")&&!e.isVisibleBtn("key"))}]),onClick:t[31]||(t[31]=(0,n.withModifiers)((t=>e.dialout(e.dialoutNumber,e.isVisibleBtn("dialout")&&!e.isVisibleBtn("key"))),["stop"]))},null,2)])],512),[[n.vShow,e.showInput]]),e.showNum&&e.showInput?((0,n.openBlock)(),(0,n.createElementBlock)("div",jk,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.keyList,((t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:r,class:"ue-num-keyboard pointer",onClick:(0,n.withModifiers)((n=>e.sendDTMF(t)),["stop"])},(0,n.toDisplayString)(t),9,Vk)))),128)),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer star",onClick:t[32]||(t[32]=(0,n.withModifiers)((t=>e.sendDTMF("*")),["stop"]))},"*"),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer",onClick:t[33]||(t[33]=(0,n.withModifiers)((t=>e.sendDTMF("0")),["stop"]))},"0"),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer",onClick:t[34]||(t[34]=(0,n.withModifiers)((t=>e.sendDTMF("#")),["stop"]))},"#")])):(0,n.createCommentVNode)("",!0)])):(0,n.createCommentVNode)("",!0),e.showConfig&&!e.hiddenOprate?((0,n.openBlock)(),(0,n.createElementBlock)("div",$k,[Lk,(0,n.createVNode)(v,{class:"width-full type"},{field:(0,n.withCtx)((()=>[(0,n.createVNode)(m,{modelValue:e.callConfig.loginType,"onUpdate:modelValue":t[35]||(t[35]=t=>e.callConfig.loginType=t),"popper-append-to-body":!0,class:"width-full","popper-class":"accept-select",onChange:e.changeType},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.loginTypeList,(e=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.value,value:e.value,label:e.label},null,8,["value","label"])))),128))])),_:1},8,["modelValue","onChange"])])),default:(0,n.withCtx)((()=>[qk])),_:1}),"WEBRTC"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createBlock)(y,{key:0,modelValue:e.callConfig.autoAnswer,"onUpdate:modelValue":t[36]||(t[36]=t=>e.callConfig.autoAnswer=t)},{default:(0,n.withCtx)((()=>[Fk])),_:1},8,["modelValue"])):(0,n.createCommentVNode)("",!0),e.callConfig.autoAnswer&&"WEBRTC"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createElementBlock)("div",Uk,[zk,(0,n.createVNode)(w,{suffix:"秒"},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createVNode)(b,{style:{width:"120px"},controls:!1,modelValue:e.callConfig.autoAnswerTime,"onUpdate:modelValue":t[37]||(t[37]=t=>e.callConfig.autoAnswerTime=t),min:0,"controls-position":"right",size:"middle"},null,8,["modelValue"]),[[T]])])),_:1}),Kk])):(0,n.createCommentVNode)("",!0),"SIP"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createBlock)(v,{key:2,class:"width-full type"},{field:(0,n.withCtx)((()=>[(0,n.createVNode)(m,{placeholder:"请选择sip号",modelValue:e.callConfig.sipNumber,"onUpdate:modelValue":t[38]||(t[38]=t=>e.callConfig.sipNumber=t),clearable:"",class:"width-full","popper-append-to-body":!1},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.sipNumberList,(e=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.id,value:e.number,label:e.number},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),default:(0,n.withCtx)((()=>[Wk])),_:1})):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",Gk,[(0,n.createVNode)(C,{class:"cancel",onClick:(0,n.withModifiers)(e.setBack,["stop"])},{default:(0,n.withCtx)((()=>[Yk])),_:1},8,["onClick"]),(0,n.createVNode)(C,{type:"primary",onClick:(0,n.withModifiers)(e.updateLoginType,["stop"])},{default:(0,n.withCtx)((()=>[Jk])),_:1},8,["onClick"])])])):(0,n.createCommentVNode)("",!0)],2)),[[k,{top:150,left:90}]]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",null,[e.callQueueBar?((0,n.openBlock)(),(0,n.createBlock)(S,{key:0,callQueueBarMsg:e.callQueueBarMsg},null,8,["callQueueBarMsg"])):(0,n.createCommentVNode)("",!0)])),[[k,{top:157,left:490}]]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",null,[e.networkDelayBar?((0,n.openBlock)(),(0,n.createBlock)(E,{key:0,networkdelayBarMsg:e.networkdelayBarMsg},null,8,["networkdelayBarMsg"])):(0,n.createCommentVNode)("",!0)])),[[k,{top:157,left:620}]])])}function Xk(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("span",null,(0,n.toDisplayString)(e.timing),1)}var Qk=(0,n.defineComponent)({name:"phoneBarTimes",components:{},setup(){const e=(0,n.reactive)({phoneBarTimer:"",timing:"00:00:00",currentTime:0});(0,n.onBeforeUnmount)((()=>{t.clearPhonebarTimer()}));const t=(0,n.reactive)({timerTypeChange(n){e.currentTime=parseInt(n.statusTime,10)||0,"timing"===n.timeType?t.timingInterval():"countDown"===n.timeType&&t.countDownInterval()},timingInterval(){null!==e.phoneBarTimer&&(window.clearInterval(e.phoneBarTimer),e.phoneBarTimer=window.setInterval((()=>{e.timing=t.ctiUiGetTimer(e.currentTime),e.currentTime=e.currentTime-0+1}),1e3))},countDownInterval(){let n=30;n=parseInt(n,10)-e.currentTime||0,n<1||(null!==e.phoneBarTimer&&window.clearInterval(e.phoneBarTimer),e.phoneBarTimer=window.setInterval((()=>{n--,n<=1&&(e.currentTime=0),e.timing=t.ctiUiAutoBusyTime(n)}),1e3))},ctiUiGetTimer(e){let t,n;e=1+parseInt(e,10),n=e/3600,n=parseInt(n,10),t=e%3600/60,t=parseInt(t,10);const r=e%3600%60;let o=n<10?"0"+n:n;return o+=":",o+=t<10?"0"+t:t,o+=":",o+=r<10?"0"+r:r,o},ctiUiAutoBusyTime(e){let t,n,r;e>=3600?(r=e/3600,r=parseInt(r,10),t=(e-3600*r)/60,t=parseInt(t,10),n=e-3600*r-60*t):e>=60&&e<3600?(r="0",t=e/60,t=parseInt(t,10),n=e-60*t):e>0&&e<60?(r="0",t="0",n=e):e<=0&&(r="0",t="0",n="0"),r<0&&(r=0),t<0&&(t=0),n<0&&(n=0);const o=(r<10?"0"+r:r)+":"+(t<10?"0"+t:t)+":"+(n<10?"0"+n:n);return o},clearPhonebarTimer(){window.clearInterval(e.phoneBarTimer)}});return{...(0,n.toRefs)(e),...(0,n.toRefs)(t)}}});const ex=(0,Aw.A)(Qk,[["render",Xk]]);var tx=ex;const nx={class:"border-form-item"},rx={class:"label"};function ox(e,t){return(0,n.openBlock)(),(0,n.createElementBlock)("div",nx,[(0,n.createElementVNode)("span",rx,[(0,n.renderSlot)(e.$slots,"default",{},void 0,!0)]),(0,n.renderSlot)(e.$slots,"field",{},void 0,!0)])}const ix={},sx=(0,Aw.A)(ix,[["render",ox],["__scopeId","data-v-7ac60f29"]]);var ax=sx;const lx={mounted(e,t){const n=t&&t.value&&t.value.left?t.value.left:0,r=t&&t.value&&t.value.top?t.value.top:0;e.style.top=`${r}px`,e.style.left=`${n}px`;const o=e,i=t.modifiers?.boundary??!1,s=(t.value,"false"!==e.getAttribute("dht-move-x")),a="false"!==e.getAttribute("dht-move-y");o.style.position="fixed";const l=o.parentNode,c=l.offsetWidth,u=l.offsetHeight,d=o.offsetWidth,p=2*o.offsetHeight,h=c-d+o.offsetLeft,f=u-p+o.offsetHeight,g=0,m=0;o.onmousedown=e=>{e.preventDefault(),o.style.cursor="move";const t=e.x-o.offsetLeft,n=e.y-o.offsetTop;document.onmousemove=e=>{let r=e.clientX-t,l=e.clientY-n,c=0,u=0;i&&(r=r>h?h:r<g?g:r,l=l>f?f:l<m?m:l,c=Number((r/h*100).toFixed(2)),u=Number((l/f*100).toFixed(2))),s&&(r<=0&&(r=0),o.style.left=r+"px"),a&&(l<=0&&(l=0),o.style.top=l+"px"),a&&(o.style.top=l+"px")},document.onmouseup=e=>{document.onmousemove=null,document.onmouseup=null,o.style.cursor="default"}}}};var cx=lx;const ux=e=>{let t;if("object"===typeof e)if(null===e)t=null;else if(e instanceof Date)t=e;else if(e instanceof Array){t=[];for(let n=0,r=e.length;n<r;n++)t.push(ux(e[n]))}else{t={};for(const n in e)t[n]=ux(e[n])}else t=e;return t},dx=["success","info","warning","error"],px=Zc({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:jr?document.body:void 0}),hx=Dn({customClass:{type:String,default:px.customClass},center:{type:Boolean,default:px.center},dangerouslyUseHTMLString:{type:Boolean,default:px.dangerouslyUseHTMLString},duration:{type:Number,default:px.duration},icon:{type:pc,default:px.icon},id:{type:String,default:px.id},message:{type:On([String,Object,Function]),default:px.message},onClose:{type:On(Function),required:!1},showClose:{type:Boolean,default:px.showClose},type:{type:String,values:dx,default:px.type},offset:{type:Number,default:px.offset},zIndex:{type:Number,default:px.zIndex},grouping:{type:Boolean,default:px.grouping},repeatNum:{type:Number,default:px.repeatNum}}),fx={destroy:()=>!0},gx=(0,n.shallowReactive)([]),mx=e=>{const t=gx.findIndex((t=>t.id===e)),n=gx[t];let r;return t>0&&(r=gx[t-1]),{current:n,prev:r}},vx=e=>{const{prev:t}=mx(e);return t?t.vm.exposed.bottom.value:0},yx=(e,t)=>{const n=gx.findIndex((t=>t.id===e));return n>0?20:t},bx=["id"],wx=["innerHTML"],Cx=(0,n.defineComponent)({name:"ElMessage"}),Sx=(0,n.defineComponent)({...Cx,props:hx,emits:fx,setup(e,{expose:t}){const r=e,{Close:o}=hc,{ns:i,zIndex:s}=ir("message"),{currentZIndex:a,nextZIndex:l}=s,c=(0,n.ref)(),u=(0,n.ref)(!1),d=(0,n.ref)(0);let p;const h=(0,n.computed)((()=>r.type?"error"===r.type?"danger":r.type:"info")),f=(0,n.computed)((()=>{const e=r.type;return{[i.bm("icon",e)]:e&&fc[e]}})),g=(0,n.computed)((()=>r.icon||fc[r.type]||"")),m=(0,n.computed)((()=>vx(r.id))),v=(0,n.computed)((()=>yx(r.id,r.offset)+m.value)),y=(0,n.computed)((()=>d.value+v.value)),b=(0,n.computed)((()=>({top:`${v.value}px`,zIndex:a.value})));function w(){0!==r.duration&&({stop:p}=Kr((()=>{S()}),r.duration))}function C(){null==p||p()}function S(){u.value=!1}function E({code:e}){e===ls.esc&&S()}return(0,n.onMounted)((()=>{w(),l(),u.value=!0})),(0,n.watch)((()=>r.repeatNum),(()=>{C(),w()})),Os(document,"keydown",E),qs(c,(()=>{d.value=c.value.getBoundingClientRect().height})),t({visible:u,bottom:y,close:S}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{name:(0,n.unref)(i).b("fade"),onBeforeLeave:e.onClose,onAfterLeave:t[0]||(t[0]=t=>e.$emit("destroy")),persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{id:e.id,ref_key:"messageRef",ref:c,class:(0,n.normalizeClass)([(0,n.unref)(i).b(),{[(0,n.unref)(i).m(e.type)]:e.type},(0,n.unref)(i).is("center",e.center),(0,n.unref)(i).is("closable",e.showClose),e.customClass]),style:(0,n.normalizeStyle)((0,n.unref)(b)),role:"alert",onMouseenter:C,onMouseleave:w},[e.repeatNum>1?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(cw),{key:0,value:e.repeatNum,type:(0,n.unref)(h),class:(0,n.normalizeClass)((0,n.unref)(i).e("badge"))},null,8,["value","type","class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(g)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:1,class:(0,n.normalizeClass)([(0,n.unref)(i).e("icon"),(0,n.unref)(f)])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(g))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default",{},(()=>[e.dangerouslyUseHTMLString?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(" Caution here, message could've been compromised, never use user's input as message "),(0,n.createElementVNode)("p",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content")),innerHTML:e.message},null,10,wx)],2112)):((0,n.openBlock)(),(0,n.createElementBlock)("p",{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},(0,n.toDisplayString)(e.message),3))])),e.showClose?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(wu),{key:2,class:(0,n.normalizeClass)((0,n.unref)(i).e("closeBtn")),onClick:(0,n.withModifiers)(S,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(o))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],46,bx),[[n.vShow,u.value]])])),_:3},8,["name","onBeforeLeave"]))}});var Ex=Cr(Sx,[["__file","message.vue"]]);let Tx=1;const kx=e=>{const t=!e||an(e)||(0,n.isVNode)(e)||sn(e)?{message:e}:e,r={...px,...t};if(r.appendTo){if(an(r.appendTo)){let e=document.querySelector(r.appendTo);bn(e)||(Nn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body),r.appendTo=e}}else r.appendTo=document.body;return r},xx=e=>{const t=gx.indexOf(e);if(-1===t)return;gx.splice(t,1);const{handler:n}=e;n.close()},Nx=({appendTo:e,...t},r)=>{const o="message_"+Tx++,i=t.onClose,s=document.createElement("div"),a={...t,id:o,onClose:()=>{null==i||i(),xx(d)},onDestroy:()=>{(0,n.render)(null,s)}},l=(0,n.createVNode)(Ex,a,sn(a.message)||(0,n.isVNode)(a.message)?{default:sn(a.message)?a.message:()=>a.message}:null);l.appContext=r||Rx._context,(0,n.render)(l,s),e.appendChild(s.firstElementChild);const c=l.component,u={close:()=>{c.exposed.visible.value=!1}},d={id:o,vnode:l,vm:c,handler:u,props:l.component.props};return d},Rx=(e={},t)=>{if(!jr)return{close:()=>{}};if(yn(cr.max)&&gx.length>=cr.max)return{close:()=>{}};const n=kx(e);if(n.grouping&&gx.length){const e=gx.find((({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===n.message}));if(e)return e.props.repeatNum+=1,e.props.type=n.type,e.handler}const r=Nx(n,t);return gx.push(r),r.handler};function Ix(e){for(const t of gx)e&&e!==t.props.type||t.handler.close()}dx.forEach((e=>{Rx[e]=(t={},n)=>{const r=kx(t);return Rx({...r,type:e},n)}})),Rx.closeAll=Ix,Rx._context=null;const _x=pr(Rx,"$message"),Ox=e=>/^\d+(\.\d{1,2})?$/.test(e),Ax=e=>/^\d+$/.test(e),Bx={onChange(e){const t=e.target,n=+t.value;Number.isInteger(n)||(t.value=Number.parseInt(n))},mounted(e,t){t.input=e.querySelector("input"),t.input?.addEventListener("change",t.dir.onChange)},beforeUnmount(e,t){t.input?.removeEventListener("change",t.dir.onChange)}},Dx=Symbol("tabsRootContextKey"),Px=Dn({tabs:{type:On(Array),default:()=>Zc([])}}),Hx="ElTabBar",Mx=(0,n.defineComponent)({name:Hx}),jx=(0,n.defineComponent)({...Mx,props:Px,setup(e,{expose:t}){const r=e,o=(0,n.getCurrentInstance)(),i=(0,n.inject)(Dx);i||xn(Hx,"<el-tabs><el-tab-bar /></el-tabs>");const s=c("tabs"),a=(0,n.ref)(),l=(0,n.ref)(),u=()=>{let e=0,t=0;const n=["top","bottom"].includes(i.props.tabPosition)?"width":"height",s="width"===n?"x":"y",a="x"===s?"left":"top";return r.tabs.every((i=>{var s,l;const c=null==(l=null==(s=o.parent)?void 0:s.refs)?void 0:l[`tab-${i.uid}`];if(!c)return!1;if(!i.active)return!0;e=c[`offset${gS(a)}`],t=c[`client${gS(n)}`];const u=window.getComputedStyle(c);return"width"===n&&(r.tabs.length>1&&(t-=Number.parseFloat(u.paddingLeft)+Number.parseFloat(u.paddingRight)),e+=Number.parseFloat(u.paddingLeft)),!1})),{[n]:`${t}px`,transform:`translate${gS(s)}(${e}px)`}},d=()=>l.value=u();return(0,n.watch)((()=>r.tabs),(async()=>{await(0,n.nextTick)(),d()}),{immediate:!0}),qs(a,(()=>d())),t({ref:a,update:d}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"barRef",ref:a,class:(0,n.normalizeClass)([(0,n.unref)(s).e("active-bar"),(0,n.unref)(s).is((0,n.unref)(i).props.tabPosition)]),style:(0,n.normalizeStyle)(l.value)},null,6))}});var Vx=Cr(jx,[["__file","tab-bar.vue"]]);const $x=Dn({panes:{type:On(Array),default:()=>Zc([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),Lx={tabClick:(e,t,n)=>n instanceof Event,tabRemove:(e,t)=>t instanceof Event},qx="ElTabNav",Fx=(0,n.defineComponent)({name:qx,props:$x,emits:Lx,setup(e,{expose:t,emit:r}){const o=(0,n.getCurrentInstance)(),i=(0,n.inject)(Dx);i||xn(qx,"<el-tabs><tab-nav /></el-tabs>");const s=c("tabs"),a=Ms(),l=na(),u=(0,n.ref)(),d=(0,n.ref)(),p=(0,n.ref)(),h=(0,n.ref)(),f=(0,n.ref)(!1),g=(0,n.ref)(0),m=(0,n.ref)(!1),v=(0,n.ref)(!0),y=(0,n.computed)((()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height")),b=(0,n.computed)((()=>{const e="width"===y.value?"X":"Y";return{transform:`translate${e}(-${g.value}px)`}})),w=()=>{if(!u.value)return;const e=u.value[`offset${gS(y.value)}`],t=g.value;if(!t)return;const n=t>e?t-e:0;g.value=n},C=()=>{if(!u.value||!d.value)return;const e=d.value[`offset${gS(y.value)}`],t=u.value[`offset${gS(y.value)}`],n=g.value;if(e-n<=t)return;const r=e-n>2*t?n+t:e-t;g.value=r},S=async()=>{const e=d.value;if(!f.value||!p.value||!u.value||!e)return;await(0,n.nextTick)();const t=p.value.querySelector(".is-active");if(!t)return;const r=u.value,o=["top","bottom"].includes(i.props.tabPosition),s=t.getBoundingClientRect(),a=r.getBoundingClientRect(),l=o?e.offsetWidth-a.width:e.offsetHeight-a.height,c=g.value;let h=c;o?(s.left<a.left&&(h=c-(a.left-s.left)),s.right>a.right&&(h=c+s.right-a.right)):(s.top<a.top&&(h=c-(a.top-s.top)),s.bottom>a.bottom&&(h=c+(s.bottom-a.bottom))),h=Math.max(h,0),g.value=Math.min(h,l)},E=()=>{var t;if(!d.value||!u.value)return;e.stretch&&(null==(t=h.value)||t.update());const n=d.value[`offset${gS(y.value)}`],r=u.value[`offset${gS(y.value)}`],o=g.value;r<n?(f.value=f.value||{},f.value.prev=o,f.value.next=o+r<n,n-o<r&&(g.value=n-r)):(f.value=!1,o>0&&(g.value=0))},T=e=>{const t=e.code,{up:n,down:r,left:o,right:i}=ls;if(![n,r,o,i].includes(t))return;const s=Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),a=s.indexOf(e.target);let l;l=t===o||t===n?0===a?s.length-1:a-1:a<s.length-1?a+1:0,s[l].focus({preventScroll:!0}),s[l].click(),k()},k=()=>{v.value&&(m.value=!0)},x=()=>m.value=!1;return(0,n.watch)(a,(e=>{"hidden"===e?v.value=!1:"visible"===e&&setTimeout((()=>v.value=!0),50)})),(0,n.watch)(l,(e=>{e?setTimeout((()=>v.value=!0),50):v.value=!1})),qs(p,E),(0,n.onMounted)((()=>setTimeout((()=>S()),0))),(0,n.onUpdated)((()=>E())),t({scrollToActiveTab:S,removeFocus:x}),(0,n.watch)((()=>e.panes),(()=>o.update()),{flush:"post",deep:!0}),()=>{const t=f.value?[(0,n.createVNode)("span",{class:[s.e("nav-prev"),s.is("disabled",!f.value.prev)],onClick:w},[(0,n.createVNode)(wu,null,{default:()=>[(0,n.createVNode)(Pl,null,null)]})]),(0,n.createVNode)("span",{class:[s.e("nav-next"),s.is("disabled",!f.value.next)],onClick:C},[(0,n.createVNode)(wu,null,{default:()=>[(0,n.createVNode)(Ml,null,null)]})])]:null,o=e.panes.map(((t,o)=>{var a,l,c,u;const d=t.uid,p=t.props.disabled,h=null!=(l=null!=(a=t.props.name)?a:t.index)?l:`${o}`,f=!p&&(t.isClosable||e.editable);t.index=`${o}`;const g=f?(0,n.createVNode)(wu,{class:"is-icon-close",onClick:e=>r("tabRemove",t,e)},{default:()=>[(0,n.createVNode)(Yl,null,null)]}):null,v=(null==(u=(c=t.slots).label)?void 0:u.call(c))||t.props.label,y=!p&&t.active?0:-1;return(0,n.createVNode)("div",{ref:`tab-${d}`,class:[s.e("item"),s.is(i.props.tabPosition),s.is("active",t.active),s.is("disabled",p),s.is("closable",f),s.is("focus",m.value)],id:`tab-${h}`,key:`tab-${d}`,"aria-controls":`pane-${h}`,role:"tab","aria-selected":t.active,tabindex:y,onFocus:()=>k(),onBlur:()=>x(),onClick:e=>{x(),r("tabClick",t,h,e)},onKeydown:e=>{!f||e.code!==ls.delete&&e.code!==ls.backspace||r("tabRemove",t,e)}},[v,g])}));return(0,n.createVNode)("div",{ref:p,class:[s.e("nav-wrap"),s.is("scrollable",!!f.value),s.is(i.props.tabPosition)]},[t,(0,n.createVNode)("div",{class:s.e("nav-scroll"),ref:u},[(0,n.createVNode)("div",{class:[s.e("nav"),s.is(i.props.tabPosition),s.is("stretch",e.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:d,style:b.value,role:"tablist",onKeydown:T},[e.type?null:(0,n.createVNode)(Vx,{ref:h,tabs:[...e.panes]},null),o])])])}}});const Ux=e=>{const t=on(e)?e:[e],r=[];return t.forEach((e=>{var t;on(e)?r.push(...Ux(e)):(0,n.isVNode)(e)&&on(e.children)?r.push(...Ux(e.children)):(r.push(e),(0,n.isVNode)(e)&&(null==(t=e.component)?void 0:t.subTree)&&r.push(...Ux(e.component.subTree)))})),r},zx=(e,t,r)=>{const o=Ux(e.subTree).filter((e=>{var r;return(0,n.isVNode)(e)&&(null==(r=e.type)?void 0:r.name)===t&&!!e.component})),i=o.map((e=>e.component.uid));return i.map((e=>r[e])).filter((e=>!!e))},Kx=(e,t)=>{const r={},o=(0,n.shallowRef)([]),i=n=>{r[n.uid]=n,o.value=zx(e,t,r)},s=e=>{delete r[e],o.value=o.value.filter((t=>t.uid!==e))};return{children:o,addChild:i,removeChild:s}},Wx=Dn({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:On(Function),default:()=>!0},stretch:Boolean}),Gx=e=>an(e)||yn(e),Yx={[Xc]:e=>Gx(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>Gx(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>Gx(e),tabAdd:()=>!0},Jx=(0,n.defineComponent)({name:"ElTabs",props:Wx,emits:Yx,setup(e,{emit:t,slots:r,expose:o}){var i,s;const a=c("tabs"),{children:l,addChild:u,removeChild:d}=Kx((0,n.getCurrentInstance)(),"ElTabPane"),p=(0,n.ref)(),h=(0,n.ref)(null!=(s=null!=(i=e.modelValue)?i:e.activeName)?s:"0"),f=async(n,r=!1)=>{var o,i,s;if(h.value!==n&&!mn(n))try{const a=await(null==(o=e.beforeLeave)?void 0:o.call(e,n,h.value));!1!==a&&(h.value=n,r&&(t(Xc,n),t("tabChange",n)),null==(s=null==(i=p.value)?void 0:i.removeFocus)||s.call(i))}catch(a){}},g=(e,n,r)=>{e.props.disabled||(f(n,!0),t("tabClick",e,r))},m=(e,n)=>{e.props.disabled||mn(e.props.name)||(n.stopPropagation(),t("edit",e.props.name,"remove"),t("tabRemove",e.props.name))},v=()=>{t("edit",void 0,"add"),t("tabAdd")};return Hw({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},(0,n.computed)((()=>!!e.activeName))),Hw({from:'"addIcon"',replacement:'"add-icon"',scope:"ElTabs",version:"2.6.0",ref:"https://element-plus.org/en-US/component/tabs.html#slots",type:"Slot"},(0,n.computed)((()=>!!r.addIcon))),(0,n.watch)((()=>e.activeName),(e=>f(e))),(0,n.watch)((()=>e.modelValue),(e=>f(e))),(0,n.watch)(h,(async()=>{var e;await(0,n.nextTick)(),null==(e=p.value)||e.scrollToActiveTab()})),(0,n.provide)(Dx,{props:e,currentName:h,registerPane:u,unregisterPane:d}),o({currentName:h}),()=>{const t=r["add-icon"]||r["addIcon"],o=t&&r["addIcon"],i=e.editable||e.addable?(0,n.createVNode)("span",{class:a.e("new-tab"),tabindex:"0",onClick:v,onKeydown:e=>{e.code===ls.enter&&v()}},[t?(0,n.renderSlot)(r,o?"addIcon":"add-icon"):(0,n.createVNode)(wu,{class:a.is("icon-plus")},{default:()=>[(0,n.createVNode)(ic,null,null)]})]):null,s=(0,n.createVNode)("div",{class:[a.e("header"),a.is(e.tabPosition)]},[i,(0,n.createVNode)(Fx,{ref:p,currentName:h.value,editable:e.editable,type:e.type,panes:l.value,stretch:e.stretch,onTabClick:g,onTabRemove:m},null)]),c=(0,n.createVNode)("div",{class:a.e("content")},[(0,n.renderSlot)(r,"default")]);return(0,n.createVNode)("div",{class:[a.b(),a.m(e.tabPosition),{[a.m("card")]:"card"===e.type,[a.m("border-card")]:"border-card"===e.type}]},[..."bottom"!==e.tabPosition?[s,c]:[c,s]])}}}),Zx=Dn({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),Xx=["id","aria-hidden","aria-labelledby"],Qx="ElTabPane",eN=(0,n.defineComponent)({name:Qx}),tN=(0,n.defineComponent)({...eN,props:Zx,setup(e){const t=e,r=(0,n.getCurrentInstance)(),o=(0,n.useSlots)(),i=(0,n.inject)(Dx);i||xn(Qx,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=c("tab-pane"),a=(0,n.ref)(),l=(0,n.computed)((()=>t.closable||i.props.closable)),u=Mr((()=>{var e;return i.currentName.value===(null!=(e=t.name)?e:a.value)})),d=(0,n.ref)(u.value),p=(0,n.computed)((()=>{var e;return null!=(e=t.name)?e:a.value})),h=Mr((()=>!t.lazy||d.value||u.value));(0,n.watch)(u,(e=>{e&&(d.value=!0)}));const f=(0,n.reactive)({uid:r.uid,slots:o,props:t,paneName:p,active:u,index:a,isClosable:l});return(0,n.onMounted)((()=>{i.registerPane(f)})),(0,n.onUnmounted)((()=>{i.unregisterPane(f.uid)})),(e,t)=>(0,n.unref)(h)?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,id:`pane-${(0,n.unref)(p)}`,class:(0,n.normalizeClass)((0,n.unref)(s).b()),role:"tabpanel","aria-hidden":!(0,n.unref)(u),"aria-labelledby":`tab-${(0,n.unref)(p)}`},[(0,n.renderSlot)(e.$slots,"default")],10,Xx)),[[n.vShow,(0,n.unref)(u)]]):(0,n.createCommentVNode)("v-if",!0)}});var nN=Cr(tN,[["__file","tab-pane.vue"]]);const rN=dr(Jx,{TabPane:nN}),oN=fr(nN),iN="$treeNodeId",sN=function(e,t){t&&!t[iN]&&Object.defineProperty(t,iN,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},aN=function(e,t){return e?t[e]:t[iN]},lN=(e,t,n)=>{const r=e.value.currentNode;n();const o=e.value.currentNode;r!==o&&t("current-change",o?o.data:null,o)},cN=e=>{let t=!0,n=!0,r=!0;for(let o=0,i=e.length;o<i;o++){const i=e[o];(!0!==i.checked||i.indeterminate)&&(t=!1,i.disabled||(r=!1)),(!1!==i.checked||i.indeterminate)&&(n=!1)}return{all:t,none:n,allWithoutDisable:r,half:!t&&!n}},uN=function(e){if(0===e.childNodes.length||e.loading)return;const{all:t,none:n,half:r}=cN(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):r?(e.checked=!1,e.indeterminate=!0):n&&(e.checked=!1,e.indeterminate=!1);const o=e.parent;o&&0!==o.level&&(e.store.checkStrictly||uN(o))},dN=function(e,t){const n=e.store.props,r=e.data||{},o=n[t];if("function"===typeof o)return o(r,e);if("string"===typeof o)return r[o];if("undefined"===typeof o){const e=r[t];return void 0===e?"":e}};let pN=0;class hN{constructor(e){this.id=pN++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const t in e)rn(e,t)&&(this[t]=e[t]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const t=e.props;if(t&&"undefined"!==typeof t.isLeaf){const e=dN(this,"isLeaf");"boolean"===typeof e&&(this.isLeafByUser=e)}if(!0!==e.lazy&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&this.expand(),Array.isArray(this.data)||sN(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,r=e.key;r&&n&&n.includes(this.key)&&this.expand(null,e.autoExpandParent),r&&void 0!==e.currentNodeKey&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),!this.parent||1!==this.level&&!0!==this.parent.expanded||(this.canFocus=!0)}setData(e){let t;Array.isArray(e)||sN(this,e),this.data=e,this.childNodes=[],t=0===this.level&&Array.isArray(this.data)?this.data:dN(this,"children")||[];for(let n=0,r=t.length;n<r;n++)this.insertChild({data:t[n]})}get label(){return dN(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return dN(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}get previousSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}contains(e,t=!0){return(this.childNodes||[]).some((n=>n===e||t&&n.contains(e)))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,t,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof hN)){if(!r){const n=this.getChildren(!0);n.includes(e.data)||("undefined"===typeof t||t<0?n.push(e.data):n.splice(t,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=(0,n.reactive)(new hN(e)),e instanceof hN&&e.initialize()}e.level=this.level+1,"undefined"===typeof t||t<0?this.childNodes.push(e):this.childNodes.splice(t,0,e),this.updateLeafState()}insertBefore(e,t){let n;t&&(n=this.childNodes.indexOf(t)),this.insertChild(e,n)}insertAfter(e,t){let n;t&&(n=this.childNodes.indexOf(t),-1!==n&&(n+=1)),this.insertChild(e,n)}removeChild(e){const t=this.getChildren()||[],n=t.indexOf(e.data);n>-1&&t.splice(n,1);const r=this.childNodes.indexOf(e);r>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(r,1)),this.updateLeafState()}removeChildByData(e){let t=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){t=this.childNodes[n];break}t&&this.removeChild(t)}expand(e,t){const n=()=>{if(t){let e=this.parent;while(e.level>0)e.expanded=!0,e=e.parent}this.expanded=!0,e&&e(),this.childNodes.forEach((e=>{e.canFocus=!0}))};this.shouldLoadData()?this.loadData((e=>{Array.isArray(e)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||uN(this),n())})):n()}doCreateChildren(e,t={}){e.forEach((e=>{this.insertChild(Object.assign({data:e},t),void 0,!0)}))}collapse(){this.expanded=!1,this.childNodes.forEach((e=>{e.canFocus=!1}))}shouldLoadData(){return!0===this.store.lazy&&this.store.load&&!this.loaded}updateLeafState(){if(!0===this.store.lazy&&!0!==this.loaded&&"undefined"!==typeof this.isLeafByUser)return void(this.isLeaf=this.isLeafByUser);const e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}setChecked(e,t,n,r){if(this.indeterminate="half"===e,this.checked=!0===e,this.store.checkStrictly)return;if(!this.shouldLoadData()||this.store.checkDescendants){const{all:n,allWithoutDisable:o}=cN(this.childNodes);this.isLeaf||n||!o||(this.checked=!1,e=!1);const i=()=>{if(t){const n=this.childNodes;for(let s=0,a=n.length;s<a;s++){const o=n[s];r=r||!1!==e;const i=o.disabled?o.checked:r;o.setChecked(i,t,!0,r)}const{half:o,all:i}=cN(n);i||(this.checked=i,this.indeterminate=o)}};if(this.shouldLoadData())return void this.loadData((()=>{i(),uN(this)}),{checked:!1!==e});i()}const o=this.parent;o&&0!==o.level&&(n||uN(o))}getChildren(e=!1){if(0===this.level)return this.data;const t=this.data;if(!t)return null;const n=this.store.props;let r="children";return n&&(r=n.children||"children"),void 0===t[r]&&(t[r]=null),e&&!t[r]&&(t[r]=[]),t[r]}updateChildren(){const e=this.getChildren()||[],t=this.childNodes.map((e=>e.data)),n={},r=[];e.forEach(((e,o)=>{const i=e[iN],s=!!i&&t.findIndex((e=>e[iN]===i))>=0;s?n[i]={index:o,data:e}:r.push({index:o,data:e})})),this.store.lazy||t.forEach((e=>{n[e[iN]]||this.removeChildByData(e)})),r.forEach((({index:e,data:t})=>{this.insertChild({data:t},e)})),this.updateLeafState()}loadData(e,t={}){if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(t).length)e&&e.call(this);else{this.loading=!0;const n=n=>{this.childNodes=[],this.doCreateChildren(n,t),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,n)};this.store.load(this,n)}}}class fN{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const t in e)rn(e,t)&&(this[t]=e[t]);this.nodesMap={}}initialize(){if(this.root=new hN({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,(e=>{this.root.doCreateChildren(e),this._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}filter(e){const t=this.filterNodeMethod,n=this.lazy,r=function(o){const i=o.root?o.root.childNodes:o.childNodes;if(i.forEach((n=>{n.visible=t.call(n,e,n.data,n),r(n)})),!o.visible&&i.length){let e=!0;e=!i.some((e=>e.visible)),o.root?o.root.visible=!1===e:o.visible=!1===e}e&&o.visible&&!o.isLeaf&&(n&&!o.loaded||o.expand())};r(this)}setData(e){const t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof hN)return e;const t=ln(e)?aN(this.key,e):e;return this.nodesMap[t]||null}insertBefore(e,t){const n=this.getNode(t);n.parent.insertBefore({data:e},n)}insertAfter(e,t){const n=this.getNode(t);n.parent.insertAfter({data:e},n)}remove(e){const t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))}append(e,t){const n=t?this.getNode(t):this.root;n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;e.forEach((e=>{const n=t[e];n&&n.setChecked(!0,!this.checkStrictly)}))}_initDefaultCheckedNode(e){const t=this.defaultCheckedKeys||[];t.includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const t=this.key;if(e&&e.data)if(t){const t=e.key;void 0!==t&&(this.nodesMap[e.key]=e)}else this.nodesMap[e.id]=e}deregisterNode(e){const t=this.key;t&&e&&e.data&&(e.childNodes.forEach((e=>{this.deregisterNode(e)})),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,t=!1){const n=[],r=function(o){const i=o.root?o.root.childNodes:o.childNodes;i.forEach((o=>{(o.checked||t&&o.indeterminate)&&(!e||e&&o.isLeaf)&&n.push(o.data),r(o)}))};return r(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map((e=>(e||{})[this.key]))}getHalfCheckedNodes(){const e=[],t=function(n){const r=n.root?n.root.childNodes:n.childNodes;r.forEach((n=>{n.indeterminate&&e.push(n.data),t(n)}))};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map((e=>(e||{})[this.key]))}_getAllNodes(){const e=[],t=this.nodesMap;for(const n in t)rn(t,n)&&e.push(t[n]);return e}updateChildren(e,t){const n=this.nodesMap[e];if(!n)return;const r=n.childNodes;for(let o=r.length-1;o>=0;o--){const e=r[o];this.remove(e.data)}for(let o=0,i=t.length;o<i;o++){const e=t[o];this.append(e,n.data)}}_setCheckedKeys(e,t=!1,n){const r=this._getAllNodes().sort(((e,t)=>e.level-t.level)),o=Object.create(null),i=Object.keys(n);r.forEach((e=>e.setChecked(!1,!1)));const s=t=>{t.childNodes.forEach((t=>{var n;o[t.data[e]]=!0,(null==(n=t.childNodes)?void 0:n.length)&&s(t)}))};for(let a=0,l=r.length;a<l;a++){const n=r[a],l=n.data[e].toString(),c=i.includes(l);if(c){if(n.childNodes.length&&s(n),n.isLeaf||this.checkStrictly)n.setChecked(!0,!1);else if(n.setChecked(!0,!0),t){n.setChecked(!1,!1);const e=function(t){const n=t.childNodes;n.forEach((t=>{t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(n)}}else n.checked&&!o[l]&&n.setChecked(!1,!1)}}setCheckedNodes(e,t=!1){const n=this.key,r={};e.forEach((e=>{r[(e||{})[n]]=!0})),this._setCheckedKeys(n,t,r)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const n=this.key,r={};e.forEach((e=>{r[e]=!0})),this._setCheckedKeys(n,t,r)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach((e=>{const t=this.getNode(e);t&&t.expand(null,this.autoExpandParent)}))}setChecked(e,t,n){const r=this.getNode(e);r&&r.setChecked(!!t,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,t=!0){const n=e[this.key],r=this.nodesMap[n];this.setCurrentNode(r),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,t=!0){if(null===e||void 0===e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const n=this.getNode(e);n&&(this.setCurrentNode(n),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const gN=(0,n.defineComponent)({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=c("tree"),r=(0,n.inject)("NodeInstance"),o=(0,n.inject)("RootTree");return()=>{const i=e.node,{data:s,store:a}=i;return e.renderContent?e.renderContent(n.h,{_self:r,node:i,data:s,store:a}):(0,n.renderSlot)(o.ctx.slots,"default",{node:i,data:s},(()=>[(0,n.h)("span",{class:t.be("node","label")},[i.label])]))}}});var mN=Cr(gN,[["__file","tree-node-content.vue"]]);function vN(e){const t=(0,n.inject)("TreeNodeMap",null),r={treeNodeExpand:t=>{e.node!==t&&e.node.collapse()},children:[]};return t&&t.children.push(r),(0,n.provide)("TreeNodeMap",r),{broadcastExpanded:t=>{if(e.accordion)for(const e of r.children)e.treeNodeExpand(t)}}}const yN=Symbol("dragEvents");function bN({props:e,ctx:t,el$:r,dropIndicator$:o,store:i}){const s=c("tree"),a=(0,n.ref)({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:n,treeNode:r})=>{if("function"===typeof e.allowDrag&&!e.allowDrag(r.node))return n.preventDefault(),!1;n.dataTransfer.effectAllowed="move";try{n.dataTransfer.setData("text/plain","")}catch(o){}a.value.draggingNode=r,t.emit("node-drag-start",r.node,n)},u=({event:n,treeNode:i})=>{const l=i,c=a.value.dropNode;c&&c.node.id!==l.node.id&&$c(c.$el,s.is("drop-inner"));const u=a.value.draggingNode;if(!u||!l)return;let d=!0,p=!0,h=!0,f=!0;"function"===typeof e.allowDrop&&(d=e.allowDrop(u.node,l.node,"prev"),f=p=e.allowDrop(u.node,l.node,"inner"),h=e.allowDrop(u.node,l.node,"next")),n.dataTransfer.dropEffect=p||d||h?"move":"none",(d||p||h)&&(null==c?void 0:c.node.id)!==l.node.id&&(c&&t.emit("node-drag-leave",u.node,c.node,n),t.emit("node-drag-enter",u.node,l.node,n)),a.value.dropNode=d||p||h?l:null,l.node.nextSibling===u.node&&(h=!1),l.node.previousSibling===u.node&&(d=!1),l.node.contains(u.node,!1)&&(p=!1),(u.node===l.node||u.node.contains(l.node))&&(d=!1,p=!1,h=!1);const g=l.$el.querySelector(`.${s.be("node","content")}`).getBoundingClientRect(),m=r.value.getBoundingClientRect();let v;const y=d?p?.25:h?.45:1:-1,b=h?p?.75:d?.55:0:1;let w=-9999;const C=n.clientY-g.top;v=C<g.height*y?"before":C>g.height*b?"after":p?"inner":"none";const S=l.$el.querySelector(`.${s.be("node","expand-icon")}`).getBoundingClientRect(),E=o.value;"before"===v?w=S.top-m.top:"after"===v&&(w=S.bottom-m.top),E.style.top=`${w}px`,E.style.left=S.right-m.left+"px","inner"===v?Vc(l.$el,s.is("drop-inner")):$c(l.$el,s.is("drop-inner")),a.value.showDropIndicator="before"===v||"after"===v,a.value.allowDrop=a.value.showDropIndicator||f,a.value.dropType=v,t.emit("node-drag-over",u.node,l.node,n)},d=e=>{const{draggingNode:n,dropType:r,dropNode:o}=a.value;if(e.preventDefault(),e.dataTransfer.dropEffect="move",n&&o){const a={data:n.node.data};"none"!==r&&n.node.remove(),"before"===r?o.node.parent.insertBefore(a,o.node):"after"===r?o.node.parent.insertAfter(a,o.node):"inner"===r&&o.node.insertChild(a),"none"!==r&&i.value.registerNode(a),$c(o.$el,s.is("drop-inner")),t.emit("node-drag-end",n.node,o.node,r,e),"none"!==r&&t.emit("node-drop",n.node,o.node,r,e)}n&&!o&&t.emit("node-drag-end",n.node,null,r,e),a.value.showDropIndicator=!1,a.value.draggingNode=null,a.value.dropNode=null,a.value.allowDrop=!0};return(0,n.provide)(yN,{treeNodeDragStart:l,treeNodeDragOver:u,treeNodeDragEnd:d}),{dragState:a}}const wN=(0,n.defineComponent)({name:"ElTreeNode",components:{ElCollapseTransition:gu,ElCheckbox:Cv,NodeContent:mN,ElIcon:wu,Loading:tc},props:{node:{type:hN,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=c("tree"),{broadcastExpanded:o}=vN(e),i=(0,n.inject)("RootTree"),s=(0,n.ref)(!1),a=(0,n.ref)(!1),l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.inject)(yN),h=(0,n.getCurrentInstance)();(0,n.provide)("NodeInstance",h),i||Nn("Tree","Can not find node's tree."),e.node.expanded&&(s.value=!0,a.value=!0);const f=i.props.props["children"]||"children";(0,n.watch)((()=>{const t=e.node.data[f];return t&&[...t]}),(()=>{e.node.updateChildren()})),(0,n.watch)((()=>e.node.indeterminate),(t=>{v(e.node.checked,t)})),(0,n.watch)((()=>e.node.checked),(t=>{v(t,e.node.indeterminate)})),(0,n.watch)((()=>e.node.expanded),(e=>{(0,n.nextTick)((()=>s.value=e)),e&&(a.value=!0)}));const g=e=>aN(i.props.nodeKey,e.data),m=t=>{const n=e.props.class;if(!n)return{};let r;if(sn(n)){const{data:e}=t;r=n(e,t)}else r=n;return an(r)?{[r]:!0}:r},v=(t,n)=>{l.value===t&&u.value===n||i.ctx.emit("check-change",e.node.data,t,n),l.value=t,u.value=n},y=t=>{lN(i.store,i.ctx.emit,(()=>i.store.value.setCurrentNode(e.node))),i.currentNode.value=e.node,i.props.expandOnClickNode&&w(),i.props.checkOnClickNode&&!e.node.disabled&&C(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,h,t)},b=t=>{i.instance.vnode.props["onNodeContextmenu"]&&(t.stopPropagation(),t.preventDefault()),i.ctx.emit("node-contextmenu",t,e.node.data,e.node,h)},w=()=>{e.node.isLeaf||(s.value?(i.ctx.emit("node-collapse",e.node.data,e.node,h),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,h)))},C=(t,r)=>{e.node.setChecked(r.target.checked,!i.props.checkStrictly),(0,n.nextTick)((()=>{const t=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:t.getCheckedNodes(),checkedKeys:t.getCheckedKeys(),halfCheckedNodes:t.getHalfCheckedNodes(),halfCheckedKeys:t.getHalfCheckedKeys()})}))},S=(e,t,n)=>{o(t),i.ctx.emit("node-expand",e,t,n)},E=t=>{i.props.draggable&&p.treeNodeDragStart({event:t,treeNode:e})},T=t=>{t.preventDefault(),i.props.draggable&&p.treeNodeDragOver({event:t,treeNode:{$el:d.value,node:e.node}})},k=e=>{e.preventDefault()},x=e=>{i.props.draggable&&p.treeNodeDragEnd(e)};return{ns:r,node$:d,tree:i,expanded:s,childNodeRendered:a,oldChecked:l,oldIndeterminate:u,getNodeKey:g,getNodeClass:m,handleSelectChange:v,handleClick:y,handleContextMenu:b,handleExpandIconClick:w,handleCheckChange:C,handleChildNodeExpand:S,handleDragStart:E,handleDragOver:T,handleDrop:k,handleDragEnd:x,CaretRight:Ll}}}),CN=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],SN=["aria-expanded"];function EN(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-icon"),l=(0,n.resolveComponent)("el-checkbox"),c=(0,n.resolveComponent)("loading"),u=(0,n.resolveComponent)("node-content"),d=(0,n.resolveComponent)("el-tree-node"),p=(0,n.resolveComponent)("el-collapse-transition");return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"node$",class:(0,n.normalizeClass)([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=(0,n.withModifiers)(((...t)=>e.handleClick&&e.handleClick(...t)),["stop"])),onContextmenu:t[2]||(t[2]=(...t)=>e.handleContextMenu&&e.handleContextMenu(...t)),onDragstart:t[3]||(t[3]=(0,n.withModifiers)(((...t)=>e.handleDragStart&&e.handleDragStart(...t)),["stop"])),onDragover:t[4]||(t[4]=(0,n.withModifiers)(((...t)=>e.handleDragOver&&e.handleDragOver(...t)),["stop"])),onDragend:t[5]||(t[5]=(0,n.withModifiers)(((...t)=>e.handleDragEnd&&e.handleDragEnd(...t)),["stop"])),onDrop:t[6]||(t[6]=(0,n.withModifiers)(((...t)=>e.handleDrop&&e.handleDrop(...t)),["stop"]))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.be("node","content")),style:(0,n.normalizeStyle)({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?((0,n.openBlock)(),(0,n.createBlock)(a,{key:0,class:(0,n.normalizeClass)([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:(0,n.withModifiers)(e.handleExpandIconClick,["stop"])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tree.props.icon||e.CaretRight)))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0),e.showCheckbox?((0,n.openBlock)(),(0,n.createBlock)(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=(0,n.withModifiers)((()=>{}),["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):(0,n.createCommentVNode)("v-if",!0),e.node.loading?((0,n.openBlock)(),(0,n.createBlock)(a,{key:2,class:(0,n.normalizeClass)([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c)])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),(0,n.createVNode)(p,null,{default:(0,n.withCtx)((()=>[!e.renderAfterExpand||e.childNodeRendered?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.node.childNodes,(t=>((0,n.openBlock)(),(0,n.createBlock)(d,{key:e.getNodeKey(t),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:t,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"])))),128))],10,SN)),[[n.vShow,e.expanded]]):(0,n.createCommentVNode)("v-if",!0)])),_:1})],42,CN)),[[n.vShow,e.node.visible]])}var TN=Cr(wN,[["render",EN],["__file","tree-node.vue"]]);function kN({el$:e},t){const r=c("tree"),o=(0,n.shallowRef)([]),i=(0,n.shallowRef)([]);(0,n.onMounted)((()=>{a()})),(0,n.onUpdated)((()=>{o.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))})),(0,n.watch)(i,(e=>{e.forEach((e=>{e.setAttribute("tabindex","-1")}))}));const s=n=>{const i=n.target;if(!i.className.includes(r.b("node")))return;const s=n.code;o.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const a=o.value.indexOf(i);let l;if([ls.up,ls.down].includes(s)){if(n.preventDefault(),s===ls.up){l=-1===a?0:0!==a?a-1:o.value.length-1;const e=l;while(1){if(t.value.getNode(o.value[l].dataset.key).canFocus)break;if(l--,l===e){l=-1;break}l<0&&(l=o.value.length-1)}}else{l=-1===a?0:a<o.value.length-1?a+1:0;const e=l;while(1){if(t.value.getNode(o.value[l].dataset.key).canFocus)break;if(l++,l===e){l=-1;break}l>=o.value.length&&(l=0)}}-1!==l&&o.value[l].focus()}[ls.left,ls.right].includes(s)&&(n.preventDefault(),i.click());const c=i.querySelector('[type="checkbox"]');[ls.enter,ls.space].includes(s)&&c&&(n.preventDefault(),c.click())};Os(e,"keydown",s);const a=()=>{var t;o.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const n=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);n.length?n[0].setAttribute("tabindex","0"):null==(t=o.value[0])||t.setAttribute("tabindex","0")}}const xN=(0,n.defineComponent)({name:"ElTree",components:{ElTreeNode:TN},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:pc}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=en(),o=c("tree"),i=(0,n.ref)(new fN({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const s=(0,n.ref)(i.value.root),a=(0,n.ref)(null),l=(0,n.ref)(null),u=(0,n.ref)(null),{broadcastExpanded:d}=vN(e),{dragState:p}=bN({props:e,ctx:t,el$:l,dropIndicator$:u,store:i});kN({el$:l},i);const h=(0,n.computed)((()=>{const{childNodes:e}=s.value;return!e||0===e.length||e.every((({visible:e})=>!e))}));(0,n.watch)((()=>e.currentNodeKey),(e=>{i.value.setCurrentNodeKey(e)})),(0,n.watch)((()=>e.defaultCheckedKeys),(e=>{i.value.setDefaultCheckedKey(e)})),(0,n.watch)((()=>e.defaultExpandedKeys),(e=>{i.value.setDefaultExpandedKeys(e)})),(0,n.watch)((()=>e.data),(e=>{i.value.setData(e)}),{deep:!0}),(0,n.watch)((()=>e.checkStrictly),(e=>{i.value.checkStrictly=e}));const f=t=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(t)},g=t=>aN(e.nodeKey,t.data),m=t=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const n=i.value.getNode(t);if(!n)return[];const r=[n.data];let o=n.parent;while(o&&o!==s.value)r.push(o.data),o=o.parent;return r.reverse()},v=(e,t)=>i.value.getCheckedNodes(e,t),y=e=>i.value.getCheckedKeys(e),b=()=>{const e=i.value.getCurrentNode();return e?e.data:null},w=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const t=b();return t?t[e.nodeKey]:null},C=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(t,n)},S=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(t,n)},E=(e,t,n)=>{i.value.setChecked(e,t,n)},T=()=>i.value.getHalfCheckedNodes(),k=()=>i.value.getHalfCheckedKeys(),x=(n,r=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");lN(i,t.emit,(()=>i.value.setUserCurrentNode(n,r)))},N=(n,r=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");lN(i,t.emit,(()=>i.value.setCurrentNodeKey(n,r)))},R=e=>i.value.getNode(e),I=e=>{i.value.remove(e)},_=(e,t)=>{i.value.append(e,t)},O=(e,t)=>{i.value.insertBefore(e,t)},A=(e,t)=>{i.value.insertAfter(e,t)},B=(e,n,r)=>{d(n),t.emit("node-expand",e,n,r)},D=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(t,n)};return(0,n.provide)("RootTree",{ctx:t,props:e,store:i,root:s,currentNode:a,instance:(0,n.getCurrentInstance)()}),(0,n.provide)(Ma,void 0),{ns:o,store:i,root:s,currentNode:a,dragState:p,el$:l,dropIndicator$:u,isEmpty:h,filter:f,getNodeKey:g,getNodePath:m,getCheckedNodes:v,getCheckedKeys:y,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:S,setChecked:E,getHalfCheckedNodes:T,getHalfCheckedKeys:k,setCurrentNode:x,setCurrentKey:N,t:r,getNode:R,remove:I,append:_,insertBefore:O,insertAfter:A,handleNodeExpand:B,updateKeyChildren:D}}});function NN(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-tree-node");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"el$",class:(0,n.normalizeClass)([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner","inner"===e.dragState.dropType),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.root.childNodes,(t=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.getNodeKey(t),node:t,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"])))),128)),e.isEmpty?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.e("empty-block"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>{var t;return[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.ns.e("empty-text"))},(0,n.toDisplayString)(null!=(t=e.emptyText)?t:e.t("el.tree.emptyText")),3)]}))],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.withDirectives)((0,n.createElementVNode)("div",{ref:"dropIndicator$",class:(0,n.normalizeClass)(e.ns.e("drop-indicator"))},null,2),[[n.vShow,e.dragState.showDropIndicator]])],2)}var RN=Cr(xN,[["render",NN],["__file","tree.vue"]]);RN.install=e=>{e.component(RN.name,RN)};const IN=RN,_N=IN,ON=e=>((0,n.pushScopeId)("data-v-414390b9"),e=e(),(0,n.popScopeId)(),e),AN={class:"transfer-box"},BN={key:0},DN={key:1,class:"idle-agent-box"},PN=["onClick"],HN=ON((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),MN=[HN],jN={class:"outline-box"},VN=(0,n.createTextVNode)("转移");function $N(e,t,r,o,i,s){const a=XS,l=_N,c=ZS,u=oN,d=GC,p=NC,h=rN;return(0,n.openBlock)(),(0,n.createElementBlock)("div",AN,[(0,n.createVNode)(h,{modelValue:e.activeName,"onUpdate:modelValue":t[3]||(t[3]=t=>e.activeName=t),onTabClick:e.handleClick},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{label:"其他员工",name:"agent"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{class:"transfer-select","popper-class":"transfer-select",placeholder:"请输入座席工号、姓名、技能组名称查询",onVisibleChange:e.visibleChange,"filter-method":e.dataFilter,filterable:"",modelValue:e.form.id,"onUpdate:modelValue":t[0]||(t[0]=t=>e.form.id=t),ref:"selectTree"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.form.id,value:e.form.id,label:e.form.label,hidden:""},null,8,["value","label"])),(0,n.createVNode)(l,{data:e.agentOptions,props:e.props,"node-key":"id",accordion:"",ref:"tree","highlight-current":"","filter-node-method":e.filterNode},{default:(0,n.withCtx)((({data:t})=>[t.freeNumber>=0?((0,n.openBlock)(),(0,n.createElementBlock)("div",BN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label),1),(0,n.createElementVNode)("span",null,"("+(0,n.toDisplayString)(t.freeNumber)+")",1)])):(0,n.createCommentVNode)("",!0),t.agentNumber?((0,n.openBlock)(),(0,n.createElementBlock)("div",DN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label)+" ("+(0,n.toDisplayString)(t.agentNumber)+") ",1),(0,n.createElementVNode)("span",{onClick:n=>e.transferAction(t.agentNumber,"agent")},MN,8,PN)])):(0,n.createCommentVNode)("",!0)])),_:1},8,["data","props","filter-node-method"])])),_:1},8,["onVisibleChange","filter-method","modelValue"])])),_:1}),(0,n.createVNode)(u,{label:"外线电话",name:"outline"},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",jN,[(0,n.createVNode)(d,{modelValue:e.outlineNumber,"onUpdate:modelValue":t[1]||(t[1]=t=>e.outlineNumber=t),size:"mini",clearable:"",placeholder:"请输入手机或完整的区号电话号码",style:{width:"244px"}},null,8,["modelValue"]),(0,n.createVNode)(p,{type:"primary",size:"default",class:"action-btn",disabled:!e.outlineNumber,onClick:t[2]||(t[2]=(0,n.withModifiers)((t=>e.transferAction(e.outlineNumber,"outline",e.outlineNumber)),["stop"]))},{default:(0,n.withCtx)((()=>[VN])),_:1},8,["disabled"])])])),_:1})])),_:1},8,["modelValue","onTabClick"])])}var LN=(0,n.defineComponent)({name:"transferConsult",components:{},props:{module:{type:String,default:""}},setup(){(0,n.ref)(null);const e=(0,n.reactive)({activeName:"agent",outlineNumber:"",ivrList:[],ivrObj:{name:"",nodeId:""},agentOptions:[],form:{id:"",label:""},props:{children:"children",label:"label"}}),t=(e,t)=>{if("outline"===t&&(!Ax(e)||!e))return _x.error("请输入正确的号码"),!1;window.ueSoftphone.call.transfer({type:t,number:e,success:e=>{console.log(e,"success============")}})},r=()=>{window.ueSoftphone.agent.findIdleAgentsForQueue({success:t=>{if(t&&t.success&&t.dataList){const n=[];t.dataList.forEach((e=>{const t={value:e._id,label:e.name,freeNumber:0};let r=0;const o=[];e.members&&e.members.length>0?e.members.forEach((n=>{if("00000"!==n.agentId){const e={value:n.agentId,label:`${n.agentName}[${n.agentNumber}]`,callStatus:n.callStatus,callStatusName:n.callStatusName,agentNumber:n.agentNumber};"0"===n.callStatus?r++:e.disabled=!0,o.push(e)}else 1===e.members.length&&(t.disabled=!0)})):t.disabled=!0,t.freeNumber=r,o.length>0&&(t.children=o),t.freeNumber>0&&n.push(t)})),e.agentOptions=n}}})},o=e=>{window.ueSoftphone.call.transfer({type:"agent",number:e.agentNumber,success:e=>{console.log(e,"success============")}})},i=()=>{(0,n.nextTick)((()=>{console.log("切换")}))},s=e=>{e&&r()};return{...(0,n.toRefs)(e),transferClick:o,fetchQueueOnlineAgents:r,handleClick:i,transferAction:t,visibleChange:s}}});const qN=(0,Aw.A)(LN,[["render",$N],["__scopeId","data-v-414390b9"]]);var FN=qN;const UN=e=>((0,n.pushScopeId)("data-v-1618b142"),e=e(),(0,n.popScopeId)(),e),zN={class:"transfer-box"},KN={key:0},WN={key:1,class:"idle-agent-box"},GN=["onClick"],YN=UN((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),JN=[YN],ZN={class:"outline-box"},XN=(0,n.createTextVNode)("咨询");function QN(e,t,r,o,i,s){const a=XS,l=_N,c=ZS,u=oN,d=GC,p=NC,h=rN;return(0,n.openBlock)(),(0,n.createElementBlock)("div",zN,[(0,n.createVNode)(h,{modelValue:e.activeName,"onUpdate:modelValue":t[3]||(t[3]=t=>e.activeName=t),onTabClick:e.handleClick},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{label:"其他员工",name:"agent"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{class:"transfer-select","popper-class":"transfer-select",placeholder:"请输入座席工号、姓名、技能组名称查询",onVisibleChange:e.visibleChange,"filter-method":e.dataFilter,filterable:"",modelValue:e.form.id,"onUpdate:modelValue":t[0]||(t[0]=t=>e.form.id=t),ref:"selectTree"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.form.id,value:e.form.id,label:e.form.label,hidden:""},null,8,["value","label"])),(0,n.createVNode)(l,{data:e.agentOptions,props:e.props,"node-key":"id",accordion:"",ref:"tree","highlight-current":"","filter-node-method":e.filterNode},{default:(0,n.withCtx)((({data:t})=>[t.freeNumber>=0?((0,n.openBlock)(),(0,n.createElementBlock)("div",KN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label),1),(0,n.createElementVNode)("span",null,"("+(0,n.toDisplayString)(t.freeNumber)+")",1)])):(0,n.createCommentVNode)("",!0),t.agentNumber?((0,n.openBlock)(),(0,n.createElementBlock)("div",WN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label)+" ("+(0,n.toDisplayString)(t.agentNumber)+") ",1),(0,n.createElementVNode)("span",{onClick:n=>e.transferAction(t.agentNumber,"agent")},JN,8,GN)])):(0,n.createCommentVNode)("",!0)])),_:1},8,["data","props","filter-node-method"])])),_:1},8,["onVisibleChange","filter-method","modelValue"])])),_:1}),(0,n.createVNode)(u,{label:"外线电话",name:"outline"},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",ZN,[(0,n.createVNode)(d,{modelValue:e.outlineNumber,"onUpdate:modelValue":t[1]||(t[1]=t=>e.outlineNumber=t),size:"mini",clearable:"",placeholder:"请输入手机或完整的区号电话号码",style:{width:"244px"}},null,8,["modelValue"]),(0,n.createVNode)(p,{type:"primary",size:"default",class:"action-btn",disabled:!e.outlineNumber,onClick:t[2]||(t[2]=(0,n.withModifiers)((t=>e.transferAction(e.outlineNumber,"outline",e.outlineNumber)),["stop"]))},{default:(0,n.withCtx)((()=>[XN])),_:1},8,["disabled"])])])),_:1})])),_:1},8,["modelValue","onTabClick"])])}var eR=(0,n.defineComponent)({name:"transferConsult",components:{},props:{module:{type:String,default:""}},setup(){(0,n.ref)(null);const e=(0,n.reactive)({activeName:"agent",outlineNumber:"",ivrList:[],ivrObj:{name:"",nodeId:""},agentOptions:[],form:{id:"",label:""},props:{children:"children",label:"label"}}),t=(e,t)=>{if("outline"===t&&(!Ax(e)||!e))return _x.error("请输入正确的号码"),!1;window.ueSoftphone.call.consult({mode:t,agentNumber:e,fail:e=>{console.log(e,"success============")}})},r=()=>{window.ueSoftphone.agent.findIdleAgentsForQueue({success:t=>{if(t&&t.success&&t.dataList){const n=[];t.dataList.forEach((e=>{const t={value:e._id,label:e.name,freeNumber:0};let r=0;const o=[];e.members&&e.members.length>0?e.members.forEach((n=>{if("00000"!==n.agentId){const e={value:n.agentId,label:`${n.agentName}[${n.agentNumber}]`,callStatus:n.callStatus,callStatusName:n.callStatusName,agentNumber:n.agentNumber};"0"===n.callStatus?r++:e.disabled=!0,o.push(e)}else 1===e.members.length&&(t.disabled=!0)})):t.disabled=!0,t.freeNumber=r,o.length>0&&(t.children=o),t.freeNumber>0&&n.push(t)})),e.agentOptions=n}}})},o=e=>{window.ueSoftphone.call.transfer({type:"agent",number:e.agentNumber,success:e=>{console.log(e,"success============")}})},i=()=>{(0,n.nextTick)((()=>{console.log("切换")}))},s=e=>{e&&r()};return{...(0,n.toRefs)(e),transferClick:o,fetchQueueOnlineAgents:r,handleClick:i,transferAction:t,visibleChange:s}}});const tR=(0,Aw.A)(eR,[["render",QN],["__scopeId","data-v-1618b142"]]);var nR=tR,rR=__webpack_require__.p+"img/wifi1.b7af5ed5.svg",oR=__webpack_require__.p+"img/wifi2.1648a543.svg",iR=__webpack_require__.p+"img/wifi3.ec030889.svg",sR=__webpack_require__.p+"img/wifi4.101d572a.svg";const aR=["src"];var lR=(0,n.defineComponent)({props:{networkdelayBarMsg:{type:Object,default:()=>null}},setup(e){const t=e,r=(0,n.computed)((()=>{let e=sR;const n=t.networkdelayBarMsg.delay;return 0<n&&n<100?e=rR:n>=100&&n<200?e=oR:n>=200&&n<500?e=iR:n>=500&&(e=sR),e}));return(t,o)=>{const i=Ol;return(0,n.openBlock)(),(0,n.createBlock)(i,{placement:"bottom",content:"延迟:"+e.networkdelayBarMsg.delay+"ms"},{default:(0,n.withCtx)((()=>[(0,n.unref)(r)?((0,n.openBlock)(),(0,n.createElementBlock)("img",{key:0,src:(0,n.unref)(r)},null,8,aR)):(0,n.createCommentVNode)("",!0)])),_:1},8,["content"])}}});const cR=lR;var uR=cR,dR=__webpack_require__(798),pR=__webpack_require__.n(dR),hR=(0,n.defineComponent)({name:"telephoneStrip",components:{phoneBarTimer:tx,formItem:ax,transferOprate:FN,consuleOprate:nR,callQueue:Dw,networkDelay:uR},directives:{move:cx,int:Bx},created(){this.initPhone()},setup(){const e=(0,n.ref)(!0),t=(0,n.ref)(null),r=(0,n.ref)(null),o=(0,n.ref)(null),i=((0,n.ref)(null),(0,n.ref)(!1)),s=(0,n.ref)({}),a=(0,n.ref)(!1),l=(0,n.ref)({}),c=(0,n.ref)(!1),u=(0,n.ref)({}),d=(0,n.reactive)({actionModule:"transfer",errorObj:{isError:!1,type:"",message:""},stateType:"free",currentCallType:"",showConfig:!1,callConfig:{autoAnswer:!1,sipNumber:"",autoAnswerTime:"0",mobile:"",loginType:""},showNum:!0,accountConfig:{forbidDialInHangup:!1,forbidDialOutHangup:!1,ringCard:!1},defaultConfig:{},AnswerOffline:!1,sipNumberList:[],dialoutNumber:"",renderMap:{PSTN_INVALID:["dialout"],PSTN_CALLIN_CALLING:["hangup"],PSTN_CALLOUT_CALLING:["hangup"],PSTN_CALLIN_RING:["hangup","animation"],PSTN_CALLOUT_RING:["hangup"],PSTN_TRANSFER_RING:["hangup","animation"],PSTN_CALLIN_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_CALLOUT_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_TRANSFER_ARRANGE:["dialout"],PSTN_CONSULTTRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_CALLIN_MUTE:["hangup","mutecancel"],PSTN_CALLOUT_MUTE:["hangup","mutecancel"],PSTN_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],PSTN_CALLIN_HOLD:["hangup","holdcancel"],PSTN_CALLOUT_HOLD:["hangup","holdcancel"],PSTN_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],PSTN_CALLIN_ARRANGE:["dialout"],PSTN_CALLOUT_ARRANGE:["dialout"],PSTN_CONSULTTRANSFER_ARRANGE:["dialout"],PSTN_BUSY:["dialout"],PSTN_CALLOUT_BUSY:["dialout"],PSTN_CALLIN_BUSY:["dialout"],PSTN_DISCONNECTED:["showquick"],WAITCONSUL:["hangup","cancelconcul"],CONSULCANCEL:["hangup","concul","takeback"],CONSULPICKUP:["hangup","endconsul","threepartycall","concultransfer"],CONSULING:["hangup"],THREECALL:["hangup"],LISTEN:["hangup"],WHISPER:["hangup"],PSTN_CONSULT_RING:["hangup"],SIP_INVALID:["dialout"],SIP_CALLIN_CALLING:["hangup"],SIP_CALLOUT_CALLING:["hangup"],SIP_CALLIN_RING:["hangup"],SIP_CALLOUT_RING:["hangup"],SIP_TRANSFER_RING:["hangup"],SIP_CALLIN_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CALLOUT_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CONSULTTRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CALLIN_MUTE:["hangup","mutecancel"],SIP_CALLOUT_MUTE:["hangup","mutecancel"],SIP_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],SIP_CALLIN_HOLD:["hangup","holdcancel"],SIP_CALLOUT_HOLD:["hangup","holdcancel"],SIP_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],SIP_CALLIN_ARRANGE:["dialout"],SIP_CALLOUT_ARRANGE:["dialout"],SIP_CONSULTTRANSFER_ARRANGE:["dialout"],SIP_TRANSFER_ARRANGE:["dialout"],SIP_BUSY:["dialout"],SIP_CALLOUT_BUSY:["dialout"],SIP_CALLIN_BUSY:["dialout"],SIP_DISCONNECTED:["showquick"],SIP_CONSULT_RING:["hangup"],WEBRTC_INVALID:["dialout","disconnect"],WEBRTC_CALLIN_CALLING:["hangup"],WEBRTC_CALLOUT_CALLING:["hangup"],WEBRTC_CALLIN_RING:["hangup","answer"],WEBRTC_CALLOUT_RING:["hangup"],WEBRTC_TRANSFER_RING:["hangup","answer","animation"],WEBRTC_CALLIN_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_CALLOUT_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction","key"],WEBRTC_CONSULTTRANSFER_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_CALLIN_MUTE:["hangup","mutecancel"],WEBRTC_CALLOUT_MUTE:["hangup","mutecancel"],WEBRTC_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],WEBRTC_CALLIN_HOLD:["hangup","holdcancel"],WEBRTC_CALLOUT_HOLD:["hangup","holdcancel"],WEBRTC_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],WEBRTC_CALLIN_ARRANGE:["dialout"],WEBRTC_CALLOUT_ARRANGE:["dialout"],WEBRTC_CONSULTTRANSFER_ARRANGE:["dialout"],WEBRTC_TRANSFER_ARRANGE:["dialout"],WEBRTC_DISCONNECTED:["connect","showquick"],WEBRTC_BUSY:["dialout"],WEBRTC_CALLOUT_BUSY:["dialout"],WEBRTC_CALLIN_BUSY:["dialout"],WEBRTC_CONSULT_RING:["hangup","answer"],TRANSFER_OPRATE:["transferoprate","hangup"],CONSULE_OPRATE:["consuleoprate","hangup"]},currentStatus:"PSTN_INVALID",currentStatusName:"空闲",callingNumber:"",keyList:["1","2","3","4","5","6","7","8","9"],loginType:"",loginTypeMap:{PSTN:"手机模式",SIP:"SIP话机",WEBRTC:"软电话"},loginTypeList:[{value:"PSTN",label:"手机模式"},{value:"SIP",label:"SIP话机"},{value:"WEBRTC",label:"软电话"}],ivrList:[],agentStatusList:[],agentStatusNumber:"",isTransterBtn:!0,isOpenpanel:!1,quickToWhole:!1,showInput:!1,showDial:!0,transferState:!1,consulSelect:!1,webrtcKeyState:!1,callRcentState:!0,quickState:!1,customerInfo:{number:"",name:"",place:"",tag:"",displayNumber:"",active:!1},backStatus:"",switchQuickState(e){d.quickState=e},switchKey(e){d.callRcentState=e},setTransferState(e){e?(d.backStatus=d.currentStatus,d.currentStatus="TRANSFER_OPRATE"):d.currentStatus=d.backStatus},setConsulState(e){e?(d.backStatus=d.currentStatus,d.currentStatus="CONSULE_OPRATE"):d.currentStatus=d.backStatus},setWebrtcKeyState(e){d.webrtcKeyState=e},toAnswerOffline(e){const t=e?"1":"0";window.ueSoftphone.agent.setAnswerOffline({toAnswerOffline:t,success:()=>{console.log({message:"设置成功",type:"success"})},fail:()=>{console.log({message:"设置失败",type:"error"})}})},inputChange(e){/^[0-9*#]*$/.test(e)&&(d.dialoutNumber=e)},initPhone(){let t;window&&window.ueSimpleSoftphone&&window.ueSimpleSoftphone.initParams?(t=window.ueSimpleSoftphone.initParams,i.value=!!t.isOpenCallQueue,a.value=!!t.isOpenNetwork,a.value=!!t.openNlsTranslation):(t={accountId:"useasyTest",agentNumber:"8045",password:"Aa123456",loginType:"WEBRTC",isOpenCallQueue:!1,isOpenNetwork:!0,openNlsTranslation:!0},i.value=!!t.isOpenCallQueue,a.value=!!t.isOpenNetwork,c.value=!!t.openNlsTranslation);const n=t.loginType||"WEBRTC";window.ueSoftphone=new(pR())({accountId:t.accountId,agentNumber:t.agentNumber,password:t.password,loginType:n,server:t.server||null,isOpenCallQueue:t.isOpenCallQueue||!1,isOpenNetwork:t.isOpenNetwork||!1,openNlsTranslation:t.openNlsTranslation||!1,error(e){"2005"===e.code?(d.errorObj.isError=!0,d.errorObj.message="当前License数量不足请联系管理员"):e.message&&console.log({message:e.message,type:"error"})},success(e){d.callConfig.loginType=n,d.errorObj.isError=!1,d.getAgentPhoneBarList(),d.getAvailableSipNumberList()}}),window.ueSoftphone.listenCallEvent({event:t=>{const n=t.data;window.ueSimpleSoftphone&&window.ueSimpleSoftphone.backEventFunction&&window.ueSimpleSoftphone.backEventFunction(t),"KICK_OFF"===n.subType&&n.data.kickoff&&(e.value=!1)},success(e){console.log(e,"989909")},error(e){e.message&&console.log({message:e.message,type:"error"})},message:e=>{console.log(e,"89999");const t=e.data;if("status"===e.subtype){d.currentStatusName=t.stateName;const e="5"===t.state?"countDown":"timing";t.statusTime?d.timeRecording(e,t.statusTime):d.timeRecording(e)}else"login"===e.subtype&&(d.loginType=t.loginType||"WEBRTC");window.ueSimpleSoftphone&&window.ueSimpleSoftphone.backEventFunction&&window.ueSimpleSoftphone.backEventFunction(t),d.currentStatus=d.getCurrentStatus(t.state,t.callType,t.eventType)}}),window.ueSoftphone.listenCallQueueEvent({success(e){console.log("简易监听呼叫队列socket成功",e)},message(e){e.success&&(s.value=e.data),console.log(e,"简易获取呼叫队列数据成功")}}),window.ueSoftphone.listenCallNetork({message(e){l.value=e,console.log(e,"简易监听网络检测事件")}})},setCustomerInfo(e){const t=e.callType||"";e.callEvent;if("calling"===d.stateType||"ring"===d.stateType||"called"===d.stateType){d.customerInfo.displayNumber="dialout"===t?e.displayNumber?"外显号:"+e.displayNumber:"":e.trunkNumber?"服务号:"+e.trunkNumber:"",e.number&&(d.customerInfo.number=e.number,d.customerInfo.name||(d.customerInfo.active||(d.customerInfo.active=!0),console.log("未设置名称")));let n="";"86"===e.customerCountryCode?e.customerProvince&&(n=e.customerProvince+"-"+e.customerCity):e.customerCountry&&(n=e.customerCountry),d.customerInfo.place=n}["calling","called","ring"].includes(d.stateType)||(d.customerInfo={number:"",name:"",place:"",tag:"",displayNumber:"",active:!1}),console.log(e,"")},initPhoneOpenState(){const e=localStorage.getItem("phoneUnfoldState");null===e||"true"===e?d.setUnfoldState(!0):d.setUnfoldState(!1)},setBack(){d.showDial=!0,d.showConfig=!1},goToSetting(){d.showDial=!1,d.showConfig=!0},deleteNum(){if(d.dialoutNumber){const e=d.dialoutNumber.length;d.dialoutNumber=d.dialoutNumber.substring(0,e-1)}},dialout(e,t){t&&(e?window.ueSoftphone&&window.ueSoftphone.call.callout({customerNumber:e,success(e){console.log({message:"外呼成功",type:"success",duration:5e3})},fail(e){_x.error({message:e.message,type:"error"}),console.log({message:e.message,type:"error"})}}):_x.error({message:"请填写外呼号码",type:"error"}))},hangup(){window.ueSoftphone&&window.ueSoftphone.call.hangup({fail(e){console.error(e,"error")}})},holdOrUnHold(e){window.ueSoftphone&&window.ueSoftphone.call.holdOrUnHold({type:e,fail(e){console.error(e,"error")}})},muteOrUnMute(e){window.ueSoftphone&&window.ueSoftphone.call.muteOrUnMute({type:e,fail(e){console.error(e,"error")}})},resumeConsult(){window.ueSoftphone.call.callbackConsult({success:()=>{console.log("取消咨询")}})},consultTransfer(){window.ueSoftphone.call.consultTransfer({success:()=>{console.log("咨询转移成功")}})},threeWayCall(){window.ueSoftphone.call.threeWayCall({success:()=>{console.log("三方通话成功")}})},stopConsult(){window.ueSoftphone.call.cancelconsult({success:()=>{console.log("取消咨询")}})},cancelConsult(){window.ueSoftphone.call.cancelconsult({success:()=>{console.log("取消咨询")}})},satisfaction(){window.ueSoftphone.call.evaluate({type:"SATISFACTION"})},transOrUntrans(){d.isTransterBtn=!d.isTransterBtn},accept(){window.ueSoftphone.webrtc.accept()},sendDTMF(e){d.dialoutNumber+=e,d.isVisibleBtn("key")&&window.ueSoftphone.call.sendDTMF(e)},connect(){window.ueSoftphone=null,d.initPhone()},disconnect(){window.ueSoftphone.call.disconnect()},keyDowndialout(e){13===e.keyCode&&d.dialout(d.dialoutNumber,!1)},updateLoginType(){const{loginType:e,sipNumber:t}=d.callConfig,n={loginType:e};"SIP"===e&&t&&(n.loginNumber=t),window.ueSoftphone.agent.switchLoginType({...n,success:()=>{d.loginType=e,localStorage.setItem("phoneLoginType",e),d.setBack(),d.updateCurrentStatus(),console.log({message:"切换成功",type:"success"})},fail:()=>{console.log({message:"切换失败",type:"error"})}})},getAgentPhoneBarList(){window.ueSoftphone.agent.findPhoneBarList({success:e=>{d.agentStatusList=e.data}})},updateAgentStatus(e){window.ueSoftphone.agent.switchPhoneBar({stateNumber:e})},getAvailableSipNumberList(){window.ueSoftphone.agent.getAvailableSipNumberList({success:e=>{e.success&&(d.sipNumberList=e.data)}})},initUserConfig(e){d.AnswerOffline=!(!e.toAnswerOffline||"1"!==e.toAnswerOffline)},isVisibleBtn(e){if(d.currentStatus){const t=d.renderMap[d.currentStatus]||"";return t&&t.indexOf(e)>-1}},getCurrentStatus(e,t,n){let r="";console.log(e,t,n,"687678676"),t&&(d.currentCallType=t);const o=t?"_"+t.toUpperCase():"";switch(d.quickToWhole=!1,e){case"0":r=d.loginType+"_INVALID",d.stateType="free";break;case"1":r=d.loginType+o+"_BUSY",d.stateType="busy";break;case"2":r=d.loginType+o+"_CALLING",d.stateType="calling";break;case"3":r="consult"===n?d.loginType+"_CONSULT_RING":d.loginType+o+"_RING",d.stateType="ring";break;case"4":r="consult"===n?"WAITCONSUL":"callBack"===n?"CONSULCANCEL":d.loginType+o+"_LINK",d.stateType="called";break;case"5":r=d.loginType+o+"_ARRANGE",d.stateType="busy";break;case"6":r=d.loginType+o+"_HOLD",d.stateType="called";break;case"7":r=d.loginType+o+"_MUTE",d.stateType="called";break;case"8":r=d.loginType+o+"_DISCONNECTED",d.stateType="disconnect";break;case"9":r=d.loginType+o+"_DISCONNECTED",d.stateType="disconnect";break;case"10":r="callback"===n?"CONSULCANCEL":"CONSULPICKUP",d.stateType="called";break;case"11":r="THREECALL",d.stateType="called";break;case"12":r="CONSULING",d.stateType="called";break;case"13":r="THREECALL",d.stateType="called";break;case"14":r="LISTEN",d.stateType="called";break;case"15":r="WHISPER",d.stateType="called";break;default:r=d.loginType+o+"_BUSY",d.stateType="busy";break}return r},updateCurrentStatus(){const e=d.currentStatus.split("_");e[0]!==d.loginType&&(e[0]=d.loginType,d.currentStatus=e.join("_"))},timeRecording(e,n){let i=0;if(n){const e=new Date(n),t=new Date,r=t.getTime()-e.getTime();i=r>0?r/1e3:0}console.log(t,"cccccccccccccccccccccccccccccccccccccccccccccc"),t.value.timerTypeChange({timeType:e,statusTime:i}),r.value.timerTypeChange({timeType:e,statusTime:i}),o.value.timerTypeChange({timeType:e,statusTime:i})},changeOpenState(){d.setUnfoldState(!d.isOpenpanel)},setUnfoldState(e){d.isOpenpanel=e,localStorage.setItem("phoneUnfoldState",JSON.stringify(e))}}),p=(0,n.reactive)({setDialState(e){e.showDial=e},toggleDialState(){d.showDial=!d.showDial}}),h=(0,n.computed)((()=>d.isVisibleBtn("answer")));(0,n.watch)(h,(e=>{if(e&&d.callConfig.autoAnswer){const e=d.callConfig.autoAnswerTime?1e3*Number(d.callConfig.autoAnswerTime):0;setTimeout((()=>{d.accept()}),e)}}));const f=(0,n.computed)((()=>"")),g=(0,n.computed)((()=>["calling","called","ring"].includes(d.stateType)));(0,n.watch)(g,(e=>{e&&(d.dialoutNumber="",d.accountConfig.ringCard?d.quickState=!1:d.quickState=!0)}));const m=(0,n.computed)((()=>(console.log(d.stateType,"990990"),!["free","busy","disconnect"].includes(d.stateType)||d.errorObj.isError))),v=(0,n.computed)((()=>"dialout"===d.currentCallType?!d.accountConfig.forbidDialOutHangup:"incoming"!==d.currentCallType||!d.accountConfig.forbidDialInHangup)),y=(0,n.reactive)({defaultKeyboardPlaceholder:"输入号码点击回车键发起呼叫",showKeyboardPlaceholder:!0}),b=()=>{const e={...d.defaultConfig,loginType:d.callConfig.loginType};d.callConfig=ux(e)},w=e=>{Ox(e)||(d.callConfig.mobile="",_x.error("只能输入数字"))},C=()=>{};(0,n.onMounted)((()=>{C()}));const S=e=>{if(d.currentStatus){const t=d.renderMap[d.currentStatus]||"";return t&&t.indexOf(e)>-1}};return{...(0,n.toRefs)(d),...(0,n.toRefs)(y),...(0,n.toRefs)(p),isVisibleBtn:S,disabledSwitch:g,hiddenOprate:m,phoneBarPeerTimeRef:t,phoneBarStatusTimeRef:r,phoneBarQuickStatusTimeRef:o,pushServe:f,validFun:w,changeType:b,showHangupBtn:v,aaa:e,callQueueBar:i,callQueueBarMsg:s,networkDelayBar:a,networkdelayBarMsg:l,openNlsTranslationBar:c,openNlsTranslationBarMsg:u}}});const fR=(0,Aw.A)(hR,[["render",Zk],["__scopeId","data-v-c433d258"]]);var gR=fR,mR=(0,n.defineComponent)({name:"App",components:{telephoneStrip:gR}});const vR=(0,Aw.A)(mR,[["render",mr]]);var yR=vR,bR=yR}(),__webpack_exports__=__webpack_exports__["default"],__webpack_exports__}()}));
48
+ */const Wb=function(e,t){if(e&&e.addEventListener){const n=function(e){const n=Kb(e);t&&Reflect.apply(t,this,[e,n])};e.addEventListener("wheel",n,{passive:!0})}},Gb={beforeMount(e,t){Wb(e,t.value)}};let Yb=1;const Jb=(0,n.defineComponent)({name:"ElTable",directives:{Mousewheel:Gb},components:{TableHeader:Zv,TableBody:ab,TableFooter:ub,ElScrollbar:kd,hColgroup:gb},props:fb,emits:["select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-contextmenu","cell-click","cell-dblclick","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],setup(e){const{t:t}=en(),r=c("table"),o=(0,n.getCurrentInstance)();(0,n.provide)(zv,o);const i=Tm(o,e);o.store=i;const s=new Rm({store:o.store,table:o,fit:e.fit,showHeader:e.showHeader});o.layout=s;const a=(0,n.computed)((()=>0===(i.states.data.value||[]).length)),{setCurrentRow:l,getSelectionRows:u,toggleRowSelection:d,clearSelection:p,clearFilter:h,toggleAllSelection:f,toggleRowExpansion:g,clearSort:m,sort:v}=db(i),{isHidden:y,renderExpanded:b,setDragVisible:w,isGroup:C,handleMouseLeave:S,handleHeaderFooterMousewheel:E,tableSize:T,emptyBlockStyle:k,handleFixedMousewheel:x,resizeProxyVisible:N,bodyWidth:R,resizeState:I,doLayout:_,tableBodyStyles:O,tableLayout:A,scrollbarViewStyle:B,tableInnerStyle:D,scrollbarStyle:P}=pb(e,s,i,o),{scrollBarRef:H,scrollTo:M,setScrollLeft:j,setScrollTop:V}=mb(),L=ad(_,50),$=`${r.namespace.value}-table_${Yb++}`;o.tableId=$,o.state={isGroup:C,resizeState:I,doLayout:_,debouncedUpdateLayout:L};const q=(0,n.computed)((()=>e.sumText||t("el.table.sumText"))),F=(0,n.computed)((()=>e.emptyText||t("el.table.emptyText")));return hb(o),{ns:r,layout:s,store:i,handleHeaderFooterMousewheel:E,handleMouseLeave:S,tableId:$,tableSize:T,isHidden:y,isEmpty:a,renderExpanded:b,resizeProxyVisible:N,resizeState:I,isGroup:C,bodyWidth:R,tableBodyStyles:O,emptyBlockStyle:k,debouncedUpdateLayout:L,handleFixedMousewheel:x,setCurrentRow:l,getSelectionRows:u,toggleRowSelection:d,clearSelection:p,clearFilter:h,toggleAllSelection:f,toggleRowExpansion:g,clearSort:m,doLayout:_,sort:v,t:t,setDragVisible:w,context:o,computedSumText:q,computedEmptyText:F,tableLayout:A,scrollbarViewStyle:B,tableInnerStyle:D,scrollbarStyle:P,scrollBarRef:H,scrollTo:M,setScrollLeft:j,setScrollTop:V}}}),Zb=["data-prefix"],Xb={ref:"hiddenColumns",class:"hidden-columns"};function Qb(e,t,r,o,i,s){const a=(0,n.resolveComponent)("hColgroup"),l=(0,n.resolveComponent)("table-header"),c=(0,n.resolveComponent)("table-body"),u=(0,n.resolveComponent)("table-footer"),d=(0,n.resolveComponent)("el-scrollbar"),p=(0,n.resolveDirective)("mousewheel");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"tableWrapper",class:(0,n.normalizeClass)([{[e.ns.m("fit")]:e.fit,[e.ns.m("striped")]:e.stripe,[e.ns.m("border")]:e.border||e.isGroup,[e.ns.m("hidden")]:e.isHidden,[e.ns.m("group")]:e.isGroup,[e.ns.m("fluid-height")]:e.maxHeight,[e.ns.m("scrollable-x")]:e.layout.scrollX.value,[e.ns.m("scrollable-y")]:e.layout.scrollY.value,[e.ns.m("enable-row-hover")]:!e.store.states.isComplex.value,[e.ns.m("enable-row-transition")]:0!==(e.store.states.data.value||[]).length&&(e.store.states.data.value||[]).length<100,"has-footer":e.showSummary},e.ns.m(e.tableSize),e.className,e.ns.b(),e.ns.m(`layout-${e.tableLayout}`)]),style:(0,n.normalizeStyle)(e.style),"data-prefix":e.ns.namespace.value,onMouseleave:t[0]||(t[0]=(...t)=>e.handleMouseLeave&&e.handleMouseLeave(...t))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.e("inner-wrapper")),style:(0,n.normalizeStyle)(e.tableInnerStyle)},[(0,n.createElementVNode)("div",Xb,[(0,n.renderSlot)(e.$slots,"default")],512),e.showHeader&&"fixed"===e.tableLayout?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"headerWrapper",class:(0,n.normalizeClass)(e.ns.e("header-wrapper"))},[(0,n.createElementVNode)("table",{ref:"tableHeader",class:(0,n.normalizeClass)(e.ns.e("header")),style:(0,n.normalizeStyle)(e.tableBodyStyles),border:"0",cellpadding:"0",cellspacing:"0"},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),(0,n.createVNode)(l,{ref:"tableHeaderRef",border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["border","default-sort","store","onSetDragVisible"])],6)],2)),[[p,e.handleHeaderFooterMousewheel]]):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref:"bodyWrapper",class:(0,n.normalizeClass)(e.ns.e("body-wrapper"))},[(0,n.createVNode)(d,{ref:"scrollBarRef","view-style":e.scrollbarViewStyle,"wrap-style":e.scrollbarStyle,always:e.scrollbarAlwaysOn},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("table",{ref:"tableBody",class:(0,n.normalizeClass)(e.ns.e("body")),cellspacing:"0",cellpadding:"0",border:"0",style:(0,n.normalizeStyle)({width:e.bodyWidth,tableLayout:e.tableLayout})},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),e.showHeader&&"auto"===e.tableLayout?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,ref:"tableHeaderRef",class:(0,n.normalizeClass)(e.ns.e("body-header")),border:e.border,"default-sort":e.defaultSort,store:e.store,onSetDragVisible:e.setDragVisible},null,8,["class","border","default-sort","store","onSetDragVisible"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(c,{context:e.context,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"tooltip-effect":e.tooltipEffect,"tooltip-options":e.tooltipOptions,"row-style":e.rowStyle,store:e.store,stripe:e.stripe},null,8,["context","highlight","row-class-name","tooltip-effect","tooltip-options","row-style","store","stripe"]),e.showSummary&&"auto"===e.tableLayout?((0,n.openBlock)(),(0,n.createBlock)(u,{key:1,class:(0,n.normalizeClass)(e.ns.e("body-footer")),border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["class","border","default-sort","store","sum-text","summary-method"])):(0,n.createCommentVNode)("v-if",!0)],6),e.isEmpty?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"emptyBlock",style:(0,n.normalizeStyle)(e.emptyBlockStyle),class:(0,n.normalizeClass)(e.ns.e("empty-block"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.ns.e("empty-text"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.computedEmptyText),1)]))],2)],6)):(0,n.createCommentVNode)("v-if",!0),e.$slots.append?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,ref:"appendWrapper",class:(0,n.normalizeClass)(e.ns.e("append-wrapper"))},[(0,n.renderSlot)(e.$slots,"append")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},8,["view-style","wrap-style","always"])],2),e.showSummary&&"fixed"===e.tableLayout?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,ref:"footerWrapper",class:(0,n.normalizeClass)(e.ns.e("footer-wrapper"))},[(0,n.createElementVNode)("table",{class:(0,n.normalizeClass)(e.ns.e("footer")),cellspacing:"0",cellpadding:"0",border:"0",style:(0,n.normalizeStyle)(e.tableBodyStyles)},[(0,n.createVNode)(a,{columns:e.store.states.columns.value,"table-layout":e.tableLayout},null,8,["columns","table-layout"]),(0,n.createVNode)(u,{border:e.border,"default-sort":e.defaultSort,store:e.store,"sum-text":e.computedSumText,"summary-method":e.summaryMethod},null,8,["border","default-sort","store","sum-text","summary-method"])],6)],2)),[[n.vShow,!e.isEmpty],[p,e.handleHeaderFooterMousewheel]]):(0,n.createCommentVNode)("v-if",!0),e.border||e.isGroup?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)(e.ns.e("border-left-patch"))},null,2)):(0,n.createCommentVNode)("v-if",!0)],6),(0,n.withDirectives)((0,n.createElementVNode)("div",{ref:"resizeProxy",class:(0,n.normalizeClass)(e.ns.e("column-resize-proxy"))},null,2),[[n.vShow,e.resizeProxyVisible]])],46,Zb)}var ew=Ar(Jb,[["render",Qb],["__file","table.vue"]]);const tw={selection:"table-column--selection",expand:"table__expand-column"},nw={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:""},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},rw=e=>tw[e]||"",ow={selection:{renderHeader({store:e,column:t}){function r(){return e.states.data.value&&0===e.states.data.value.length}return(0,n.h)(Av,{disabled:r(),size:e.states.tableSize.value,indeterminate:e.states.selection.value.length>0&&!e.states.isAllSelected.value,"onUpdate:modelValue":e.toggleAllSelection,modelValue:e.states.isAllSelected.value,ariaLabel:t.label})},renderCell({row:e,column:t,store:r,$index:o}){return(0,n.h)(Av,{disabled:!!t.selectable&&!t.selectable.call(null,e,o),size:r.states.tableSize.value,onChange:()=>{r.commit("rowSelectedChanged",e)},onClick:e=>e.stopPropagation(),modelValue:r.isSelected(e),ariaLabel:t.label})},sortable:!1,resizable:!1},index:{renderHeader({column:e}){return e.label||"#"},renderCell({column:e,$index:t}){let r=t+1;const o=e.index;return"number"===typeof o?r=t+o:"function"===typeof o&&(r=o(t)),(0,n.h)("div",{},[r])},sortable:!1},expand:{renderHeader({column:e}){return e.label||""},renderCell({row:e,store:t,expanded:r}){const{ns:o}=t,i=[o.e("expand-icon")];r&&i.push(o.em("expand-icon","expanded"));const s=function(n){n.stopPropagation(),t.toggleRowExpansion(e)};return(0,n.h)("div",{class:i,onClick:s},{default:()=>[(0,n.h)(Ou,null,{default:()=>[(0,n.h)(Gl)]})]})},sortable:!1,resizable:!1}};function iw({row:e,column:t,$index:n}){var r;const o=t.property,i=o&&nr(e,o).value;return t&&t.formatter?t.formatter(e,t,i,n):(null==(r=null==i?void 0:i.toString)?void 0:r.call(i))||""}function sw({row:e,treeNode:t,store:r},o=!1){const{ns:i}=r;if(!t)return o?[(0,n.h)("span",{class:i.e("placeholder")})]:null;const s=[],a=function(n){n.stopPropagation(),t.loading||r.loadOrToggle(e)};if(t.indent&&s.push((0,n.h)("span",{class:i.e("indent"),style:{"padding-left":`${t.indent}px`}})),"boolean"!==typeof t.expanded||t.noLazyChildren)s.push((0,n.h)("span",{class:i.e("placeholder")}));else{const e=[i.e("expand-icon"),t.expanded?i.em("expand-icon","expanded"):""];let r=Gl;t.loading&&(r=pc),s.push((0,n.h)("div",{class:e,onClick:a},{default:()=>[(0,n.h)(Ou,{class:{[i.is("loading")]:t.loading}},{default:()=>[(0,n.h)(r)]})]}))}return s}function aw(e,t){return e.reduce(((e,t)=>(e[t]=t,e)),t)}function lw(e,t){const r=(0,n.getCurrentInstance)(),o=()=>{const o=["fixed"],i={realWidth:"width",realMinWidth:"minWidth"},s=aw(o,i);Object.keys(s).forEach((o=>{const s=i[o];rn(t,s)&&(0,n.watch)((()=>t[s]),(t=>{let n=t;"width"===s&&"realWidth"===o&&(n=Qg(t)),"minWidth"===s&&"realMinWidth"===o&&(n=em(t)),r.columnConfig.value[s]=n,r.columnConfig.value[o]=n;const i="fixed"===s;e.value.store.scheduleLayout(i)}))}))},i=()=>{const e=["label","filters","filterMultiple","filteredValue","sortable","index","formatter","className","labelClassName","filterClassName","showOverflowTooltip"],o={property:"prop",align:"realAlign",headerAlign:"realHeaderAlign"},i=aw(e,o);Object.keys(i).forEach((e=>{const i=o[e];rn(t,i)&&(0,n.watch)((()=>t[i]),(t=>{r.columnConfig.value[e]=t}))}))};return{registerComplexWatchers:o,registerNormalWatchers:i}}function cw(e,t,r){const o=(0,n.getCurrentInstance)(),i=(0,n.ref)(""),s=(0,n.ref)(!1),a=(0,n.ref)(),l=(0,n.ref)(),u=c("table");(0,n.watchEffect)((()=>{a.value=e.align?`is-${e.align}`:null,a.value})),(0,n.watchEffect)((()=>{l.value=e.headerAlign?`is-${e.headerAlign}`:a.value,l.value}));const d=(0,n.computed)((()=>{let e=o.vnode.vParent||o.parent;while(e&&!e.tableId&&!e.columnId)e=e.vnode.vParent||e.parent;return e})),p=(0,n.computed)((()=>{const{store:e}=o.parent;if(!e)return!1;const{treeData:t}=e.states,n=t.value;return n&&Object.keys(n).length>0})),h=(0,n.ref)(Qg(e.width)),f=(0,n.ref)(em(e.minWidth)),g=e=>(h.value&&(e.width=h.value),f.value&&(e.minWidth=f.value),!h.value&&f.value&&(e.width=void 0),e.minWidth||(e.minWidth=80),e.realWidth=Number(void 0===e.width?e.minWidth:e.width),e),m=e=>{const t=e.type,r=ow[t]||{};Object.keys(r).forEach((t=>{const n=r[t];"className"!==t&&void 0!==n&&(e[t]=n)}));const o=rw(t);if(o){const t=`${(0,n.unref)(u.namespace)}-${o}`;e.className=e.className?`${e.className} ${t}`:t}return e},v=e=>{function t(e){var t;"ElTableColumn"===(null==(t=null==e?void 0:e.type)?void 0:t.name)&&(e.vParent=o)}Array.isArray(e)?e.forEach((e=>t(e))):t(e)},y=i=>{e.renderHeader?Nn("TableColumn","Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header."):"selection"!==i.type&&(i.renderHeader=e=>(o.columnConfig.value["label"],(0,n.renderSlot)(t,"header",e,(()=>[i.label]))));let s=i.renderCell;return"expand"===i.type?(i.renderCell=e=>(0,n.h)("div",{class:"cell"},[s(e)]),r.value.renderExpanded=e=>t.default?t.default(e):t.default):(s=s||iw,i.renderCell=e=>{let o=null;if(t.default){const r=t.default(e);o=r.some((e=>e.type!==n.Comment))?r:s(e)}else o=s(e);const{columns:a}=r.value.store.states,l=a.value.findIndex((e=>"default"===e.type)),c=p.value&&e.cellIndex===l,d=sw(e,c),h={class:"cell",style:{}};return i.showOverflowTooltip&&(h.class=`${h.class} ${(0,n.unref)(u.namespace)}-tooltip`,h.style={width:(e.column.realWidth||Number(e.column.width))-1+"px"}),v(o),(0,n.h)("div",h,[d,o])}),i},b=(...t)=>t.reduce(((t,n)=>(Array.isArray(n)&&n.forEach((n=>{t[n]=e[n]})),t)),{}),w=(e,t)=>Array.prototype.indexOf.call(e,t),C=()=>{r.value.store.commit("updateColumnOrder",o.columnConfig.value)};return{columnId:i,realAlign:a,isSubColumn:s,realHeaderAlign:l,columnOrTableParent:d,setColumnWidth:g,setColumnForcedProps:m,setColumnRenders:y,getPropsData:b,getColumnElIndex:w,updateColumnOrder:C}}var uw={type:{type:String,default:"default"},label:String,className:String,labelClassName:String,property:String,prop:String,width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},renderHeader:Function,sortable:{type:[Boolean,String],default:!1},sortMethod:Function,sortBy:[String,Function,Array],resizable:{type:Boolean,default:!0},columnKey:String,align:String,headerAlign:String,showOverflowTooltip:{type:[Boolean,Object],default:void 0},fixed:[Boolean,String],formatter:Function,selectable:Function,reserveSelection:Boolean,filterMethod:Function,filteredValue:Array,filters:Array,filterPlacement:String,filterMultiple:{type:Boolean,default:!0},filterClassName:String,index:[Number,Function],sortOrders:{type:Array,default:()=>["ascending","descending",null],validator:e=>e.every((e=>["ascending","descending",null].includes(e)))}};let dw=1;var pw=(0,n.defineComponent)({name:"ElTableColumn",components:{ElCheckbox:Av},props:uw,setup(e,{slots:t}){const r=(0,n.getCurrentInstance)(),o=(0,n.ref)({}),i=(0,n.computed)((()=>{let e=r.parent;while(e&&!e.tableId)e=e.parent;return e})),{registerNormalWatchers:s,registerComplexWatchers:a}=lw(i,e),{columnId:l,isSubColumn:c,realHeaderAlign:u,columnOrTableParent:d,setColumnWidth:p,setColumnForcedProps:h,setColumnRenders:f,getPropsData:g,getColumnElIndex:m,realAlign:v,updateColumnOrder:y}=cw(e,t,i),b=d.value;l.value=`${b.tableId||b.columnId}_column_${dw++}`,(0,n.onBeforeMount)((()=>{c.value=i.value!==b;const t=e.type||"default",n=""===e.sortable||e.sortable,d=mn(e.showOverflowTooltip)?b.props.showOverflowTooltip:e.showOverflowTooltip,m={...nw[t],id:l.value,type:t,property:e.prop||e.property,align:v,headerAlign:u,showOverflowTooltip:d,filterable:e.filters||e.filterMethod,filteredValue:[],filterPlacement:"",filterClassName:"",isColumnGroup:!1,isSubColumn:!1,filterOpened:!1,sortable:n,index:e.index,rawColumnKey:r.vnode.key},y=["columnKey","label","className","labelClassName","type","renderHeader","formatter","fixed","resizable"],w=["sortMethod","sortBy","sortOrders"],C=["selectable","reserveSelection"],S=["filterMethod","filters","filterMultiple","filterOpened","filteredValue","filterPlacement","filterClassName"];let E=g(y,w,C,S);E=Xg(m,E);const T=nm(f,p,h);E=T(E),o.value=E,s(),a()})),(0,n.onMounted)((()=>{var e;const t=d.value,n=c.value?t.vnode.el.children:null==(e=t.refs.hiddenColumns)?void 0:e.children,s=()=>m(n||[],r.vnode.el);o.value.getColumnIndex=s;const a=s();a>-1&&i.value.store.commit("insertColumn",o.value,c.value?t.columnConfig.value:null,y)})),(0,n.onBeforeUnmount)((()=>{i.value.store.commit("removeColumn",o.value,c.value?b.columnConfig.value:null,y)})),r.columnId=l.value,r.columnConfig=o},render(){var e,t,r;try{const o=null==(t=(e=this.$slots).default)?void 0:t.call(e,{row:{},column:{},$index:-1}),i=[];if(Array.isArray(o))for(const e of o)"ElTableColumn"===(null==(r=e.type)?void 0:r.name)||2&e.shapeFlag?i.push(e):e.type===n.Fragment&&Array.isArray(e.children)&&e.children.forEach((e=>{1024===(null==e?void 0:e.patchFlag)||an(null==e?void 0:e.children)||i.push(e)}));const s=(0,n.h)("div",i);return s}catch(o){return(0,n.h)("div",[])}}});const hw=dr(ew,{TableColumn:pw}),fw=fr(pw),gw=Dn({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"}}),mw=["textContent"],vw=(0,n.defineComponent)({name:"ElBadge"}),yw=(0,n.defineComponent)({...vw,props:gw,setup(e,{expose:t}){const r=e,o=c("badge"),i=(0,n.computed)((()=>r.isDot?"":yn(r.value)&&yn(r.max)&&r.max<r.value?`${r.max}+`:`${r.value}`));return t({content:i}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)((0,n.unref)(o).b())},[(0,n.renderSlot)(e.$slots,"default"),(0,n.createVNode)(n.Transition,{name:`${(0,n.unref)(o).namespace.value}-zoom-in-center`,persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("sup",{class:(0,n.normalizeClass)([(0,n.unref)(o).e("content"),(0,n.unref)(o).em("content",e.type),(0,n.unref)(o).is("fixed",!!e.$slots.default),(0,n.unref)(o).is("dot",e.isDot)]),textContent:(0,n.toDisplayString)((0,n.unref)(i))},null,10,mw),[[n.vShow,!e.hidden&&((0,n.unref)(i)||e.isDot)]])])),_:1},8,["name"])],2))}});var bw=Ar(yw,[["__file","badge.vue"]]);const ww=dr(bw),Cw=e=>((0,n.pushScopeId)("data-v-c2152182"),e=e(),(0,n.popScopeId)(),e),Sw={class:"call-queue-bar"},Ew=Cw((()=>(0,n.createElementVNode)("div",{class:"queue-btn"},[(0,n.createElementVNode)("span",null,"呼叫队列"),(0,n.createElementVNode)("i",{class:"ue-ccc ue-cccDown",style:{"font-size":"12px"}})],-1))),Tw={class:"flex-box justify-item"},kw=Cw((()=>(0,n.createElementVNode)("div",{class:"blue-txt border-bto padding-bot"},"我所在的服务组",-1))),xw={class:"padding-bot"},Nw=(0,n.createTextVNode)(" 当前排队数:"),Rw={class:"blue-txt"},Iw=(0,n.createTextVNode)("个 "),_w={class:"queue-collapse"},Ow={class:"flex-box justify-item"},Aw={class:"flex-box"},Bw={class:"mar-r16"},Dw=Cw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"登录:",-1))),Pw={class:"mar-r16"},Hw=Cw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"空闲:",-1))),Mw={class:"blue-txt"},jw={class:"mar-r16"},Vw=Cw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"通话中:",-1))),Lw={class:"mar-r16"},$w=Cw((()=>(0,n.createElementVNode)("span",{class:"black-txt1"},"当前排队客户:",-1)));var qw=(0,n.defineComponent)({props:{callQueueBarMsg:{type:Object,default:()=>null}},setup(e){const t=e,r=(0,n.ref)(!1),o=(0,n.ref)(""),i=(0,n.ref)([]),s=(0,n.ref)(0),a=async()=>{r.value=!0,document.addEventListener("click",l)},l=async e=>{await(0,n.nextTick)();const t=document.getElementsByClassName("call-queue-pop")[0],o=document.getElementsByClassName("queue-btn")[0];t&&t.contains(e.target)||o&&o.contains(e.target)||(r.value=!1)},c=e=>e.reduce(((e,t)=>e+t.currentWait),0);return(0,n.watch)(t,(()=>{null!=t.callQueueBarMsg&&(i.value=t.callQueueBarMsg,s.value="{}"!=JSON.stringify(i.value)?c(i.value):0)}),{immediate:!0,deep:!0}),(e,t)=>{const l=ww,c=fw,u=hw,d=$u,p=Lu,h=au;return(0,n.openBlock)(),(0,n.createBlock)(h,{placement:"bottom",visible:r.value,"popper-class":"call-queue-pop",width:560},{reference:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",Sw,[(0,n.createVNode)(l,{value:s.value,max:99,onClick:a},{default:(0,n.withCtx)((()=>[Ew])),_:1},8,["value"])])])),default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("div",Tw,[kw,(0,n.createElementVNode)("div",xw,[Nw,(0,n.createElementVNode)("span",Rw,(0,n.toDisplayString)(s.value),1),Iw])]),(0,n.createElementVNode)("div",_w,[(0,n.createVNode)(p,{modelValue:o.value,"onUpdate:modelValue":t[0]||(t[0]=e=>o.value=e),accordion:""},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(i.value,((e,t)=>((0,n.openBlock)(),(0,n.createBlock)(d,{name:e.queueNumber,key:t},{title:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",Ow,[(0,n.createElementVNode)("div",null,(0,n.toDisplayString)(e.queueName+"("+e.queueNumber+")"),1),(0,n.createElementVNode)("div",Aw,[(0,n.createElementVNode)("div",Bw,[Dw,(0,n.createTextVNode)((0,n.toDisplayString)(e.onlineCount),1)]),(0,n.createElementVNode)("div",Pw,[Hw,(0,n.createElementVNode)("span",Mw,(0,n.toDisplayString)(e.idleCount),1)]),(0,n.createElementVNode)("div",jw,[Vw,(0,n.createTextVNode)((0,n.toDisplayString)(e.callingCount),1)]),(0,n.createElementVNode)("div",Lw,[$w,(0,n.createTextVNode)((0,n.toDisplayString)(e.currentWait),1)])])])])),default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{data:e.currentQueue,"max-height":"180",style:{width:"100%"}},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{prop:"customerNumber",label:"客户号码"}),(0,n.createVNode)(c,{prop:"trunkNumber",label:"服务号"}),(0,n.createVNode)(c,{prop:"queueStartTime",label:"开始时间",width:"180"}),(0,n.createVNode)(c,{prop:"waitDuration",label:"排队时长"},{default:(0,n.withCtx)((e=>[(0,n.createTextVNode)((0,n.toDisplayString)(e.row.waitDuration),1)])),_:1})])),_:2},1032,["data"])])),_:2},1032,["name"])))),128))])),_:1},8,["modelValue"])])])])),_:1},8,["visible"])}}}),Fw=__webpack_require__(559);const Uw=(0,Fw.A)(qw,[["__scopeId","data-v-c2152182"]]);var zw=Uw;const Kw=Symbol("buttonGroupContextKey"),Ww=({from:e,replacement:t,scope:r,version:o,ref:i,type:s="API"},a)=>{(0,n.watch)((()=>(0,n.unref)(a)),(n=>{n&&Nn(r,`[${s}] ${e} is about to be deprecated in version ${o}, please use ${t} instead.\nFor more detail, please visit: ${i}\n`)}),{immediate:!0})},Gw=(e,t)=>{Ww({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},(0,n.computed)((()=>"text"===e.type)));const r=(0,n.inject)(Kw,void 0),o=or("button"),{form:i}=Hm(),s=Bm((0,n.computed)((()=>null==r?void 0:r.size))),a=Dm(),l=(0,n.ref)(),c=(0,n.useSlots)(),u=(0,n.computed)((()=>e.type||(null==r?void 0:r.type)||"")),d=(0,n.computed)((()=>{var t,n,r;return null!=(r=null!=(n=e.autoInsertSpace)?n:null==(t=o.value)?void 0:t.autoInsertSpace)&&r})),p=(0,n.computed)((()=>"button"===e.tag?{ariaDisabled:a.value||e.loading,disabled:a.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{})),h=(0,n.computed)((()=>{var e;const t=null==(e=c.default)?void 0:e.call(c);if(d.value&&1===(null==t?void 0:t.length)){const e=t[0];if((null==e?void 0:e.type)===n.Text){const t=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(t.trim())}}return!1})),f=n=>{"reset"===e.nativeType&&(null==i||i.resetFields()),t("click",n)};return{_disabled:a,_size:s,_type:u,_ref:l,_props:p,shouldAddSpace:h,handleClick:f}},Yw=["default","primary","success","warning","info","danger","text",""],Jw=["button","submit","reset"],Zw=Dn({size:Hn,disabled:Boolean,type:{type:String,values:Yw,default:""},icon:{type:Ec},nativeType:{type:String,values:Jw,default:"button"},loading:Boolean,loadingIcon:{type:Ec,default:()=>pc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:On([String,Object]),default:"button"}}),Xw={click:e=>e instanceof MouseEvent};function Qw(e,t){tC(e)&&(e="100%");var n=nC(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t)),e)}function eC(e){return Math.min(1,Math.max(0,e))}function tC(e){return"string"===typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)}function nC(e){return"string"===typeof e&&-1!==e.indexOf("%")}function rC(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function oC(e){return e<=1?"".concat(100*Number(e),"%"):e}function iC(e){return 1===e.length?"0"+e:String(e)}function sC(e,t,n){return{r:255*Qw(e,255),g:255*Qw(t,255),b:255*Qw(n,255)}}function aC(e,t,n){e=Qw(e,255),t=Qw(t,255),n=Qw(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,s=0,a=(r+o)/2;if(r===o)s=0,i=0;else{var l=r-o;switch(s=a>.5?l/(2-r-o):l/(r+o),r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break;default:break}i/=6}return{h:i,s:s,l:a}}function lC(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function cC(e,t,n){var r,o,i;if(e=Qw(e,360),t=Qw(t,100),n=Qw(n,100),0===t)o=n,i=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=lC(a,s,e+1/3),o=lC(a,s,e),i=lC(a,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}function uC(e,t,n){e=Qw(e,255),t=Qw(t,255),n=Qw(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,s=r,a=r-o,l=0===r?0:a/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/a+(t<n?6:0);break;case t:i=(n-e)/a+2;break;case n:i=(e-t)/a+4;break;default:break}i/=6}return{h:i,s:l,v:s}}function dC(e,t,n){e=6*Qw(e,360),t=Qw(t,100),n=Qw(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),s=n*(1-o*t),a=n*(1-(1-o)*t),l=r%6,c=[n,s,i,i,a,n][l],u=[a,n,n,s,i,i][l],d=[i,i,a,n,n,s][l];return{r:255*c,g:255*u,b:255*d}}function pC(e,t,n,r){var o=[iC(Math.round(e).toString(16)),iC(Math.round(t).toString(16)),iC(Math.round(n).toString(16))];return r&&o[0].startsWith(o[0].charAt(1))&&o[1].startsWith(o[1].charAt(1))&&o[2].startsWith(o[2].charAt(1))?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0):o.join("")}function hC(e,t,n,r,o){var i=[iC(Math.round(e).toString(16)),iC(Math.round(t).toString(16)),iC(Math.round(n).toString(16)),iC(fC(r))];return o&&i[0].startsWith(i[0].charAt(1))&&i[1].startsWith(i[1].charAt(1))&&i[2].startsWith(i[2].charAt(1))&&i[3].startsWith(i[3].charAt(1))?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function fC(e){return Math.round(255*parseFloat(e)).toString(16)}function gC(e){return mC(e)/255}function mC(e){return parseInt(e,16)}function vC(e){return{r:e>>16,g:(65280&e)>>8,b:255&e}}var yC={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function bC(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,s=!1,a=!1;return"string"===typeof e&&(e=xC(e)),"object"===typeof e&&(NC(e.r)&&NC(e.g)&&NC(e.b)?(t=sC(e.r,e.g,e.b),s=!0,a="%"===String(e.r).substr(-1)?"prgb":"rgb"):NC(e.h)&&NC(e.s)&&NC(e.v)?(r=oC(e.s),o=oC(e.v),t=dC(e.h,r,o),s=!0,a="hsv"):NC(e.h)&&NC(e.s)&&NC(e.l)&&(r=oC(e.s),i=oC(e.l),t=cC(e.h,r,i),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=rC(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var wC="[-\\+]?\\d+%?",CC="[-\\+]?\\d*\\.\\d+%?",SC="(?:".concat(CC,")|(?:").concat(wC,")"),EC="[\\s|\\(]+(".concat(SC,")[,|\\s]+(").concat(SC,")[,|\\s]+(").concat(SC,")\\s*\\)?"),TC="[\\s|\\(]+(".concat(SC,")[,|\\s]+(").concat(SC,")[,|\\s]+(").concat(SC,")[,|\\s]+(").concat(SC,")\\s*\\)?"),kC={CSS_UNIT:new RegExp(SC),rgb:new RegExp("rgb"+EC),rgba:new RegExp("rgba"+TC),hsl:new RegExp("hsl"+EC),hsla:new RegExp("hsla"+TC),hsv:new RegExp("hsv"+EC),hsva:new RegExp("hsva"+TC),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 xC(e){if(e=e.trim().toLowerCase(),0===e.length)return!1;var t=!1;if(yC[e])e=yC[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=kC.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=kC.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=kC.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=kC.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=kC.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=kC.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=kC.hex8.exec(e),n?{r:mC(n[1]),g:mC(n[2]),b:mC(n[3]),a:gC(n[4]),format:t?"name":"hex8"}:(n=kC.hex6.exec(e),n?{r:mC(n[1]),g:mC(n[2]),b:mC(n[3]),format:t?"name":"hex"}:(n=kC.hex4.exec(e),n?{r:mC(n[1]+n[1]),g:mC(n[2]+n[2]),b:mC(n[3]+n[3]),a:gC(n[4]+n[4]),format:t?"name":"hex8"}:(n=kC.hex3.exec(e),!!n&&{r:mC(n[1]+n[1]),g:mC(n[2]+n[2]),b:mC(n[3]+n[3]),format:t?"name":"hex"})))))))))}function NC(e){return Boolean(kC.CSS_UNIT.exec(String(e)))}var RC=function(){function e(t,n){var r;if(void 0===t&&(t=""),void 0===n&&(n={}),t instanceof e)return t;"number"===typeof t&&(t=vC(t)),this.originalInput=t;var o=bC(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e,t,n,r=this.toRgb(),o=r.r/255,i=r.g/255,s=r.b/255;return e=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),t=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4),n=s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4),.2126*e+.7152*t+.0722*n},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=rC(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var e=this.toHsl().s;return 0===e},e.prototype.toHsv=function(){var e=uC(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=uC(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var e=aC(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=aC(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(e){return void 0===e&&(e=!1),pC(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),hC(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toHexShortString=function(e){return void 0===e&&(e=!1),1===this.a?this.toHexString(e):this.toHex8String(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var e=function(e){return"".concat(Math.round(100*Qw(e,255)),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*Qw(e,255))};return 1===this.a?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+pC(this.r,this.g,this.b,!1),t=0,n=Object.entries(yC);t<n.length;t++){var r=n[t],o=r[0],i=r[1];if(e===i)return o}return!1},e.prototype.toString=function(e){var t=Boolean(e);e=null!==e&&void 0!==e?e:this.format;var n=!1,r=this.a<1&&this.a>=0,o=!t&&r&&(e.startsWith("hex")||"name"===e);return o?"name"===e&&0===this.a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=eC(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=eC(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=eC(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=eC(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100,s={r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a};return new e(s)},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);var n=this.toHsv(),r=n.h,o=n.s,i=n.v,s=[],a=1/t;while(t--)s.push(new e({h:r,s:o,v:i})),i=(i+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),o=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/o,g:(n.g*n.a+r.g*r.a*(1-n.a))/o,b:(n.b*n.a+r.b*r.a*(1-n.a))/o,a:o})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,s=1;s<t;s++)o.push(new e({h:(r+s*i)%360,s:n.s,l:n.l}));return o},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e}();function IC(e,t=20){return e.mix("#141414",t).toString()}function _C(e){const t=Dm(),r=c("button");return(0,n.computed)((()=>{let n={};const o=e.color;if(o){const i=new RC(o),s=e.dark?i.tint(20).toString():IC(i,20);if(e.plain)n=r.cssVarBlock({"bg-color":e.dark?IC(i,90):i.tint(90).toString(),"text-color":o,"border-color":e.dark?IC(i,50):i.tint(50).toString(),"hover-text-color":`var(${r.cssVarName("color-white")})`,"hover-bg-color":o,"hover-border-color":o,"active-bg-color":s,"active-text-color":`var(${r.cssVarName("color-white")})`,"active-border-color":s}),t.value&&(n[r.cssVarBlockName("disabled-bg-color")]=e.dark?IC(i,90):i.tint(90).toString(),n[r.cssVarBlockName("disabled-text-color")]=e.dark?IC(i,50):i.tint(50).toString(),n[r.cssVarBlockName("disabled-border-color")]=e.dark?IC(i,80):i.tint(80).toString());else{const a=e.dark?IC(i,30):i.tint(30).toString(),l=i.isDark()?`var(${r.cssVarName("color-white")})`:`var(${r.cssVarName("color-black")})`;if(n=r.cssVarBlock({"bg-color":o,"text-color":l,"border-color":o,"hover-bg-color":a,"hover-text-color":l,"hover-border-color":a,"active-bg-color":s,"active-border-color":s}),t.value){const t=e.dark?IC(i,50):i.tint(50).toString();n[r.cssVarBlockName("disabled-bg-color")]=t,n[r.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${r.cssVarName("color-white")})`,n[r.cssVarBlockName("disabled-border-color")]=t}}}return n}))}const OC=(0,n.defineComponent)({name:"ElButton"}),AC=(0,n.defineComponent)({...OC,props:Zw,emits:Xw,setup(e,{expose:t,emit:r}){const o=e,i=_C(o),s=c("button"),{_ref:a,_size:l,_type:u,_disabled:d,_props:p,shouldAddSpace:h,handleClick:f}=Gw(o,r);return t({ref:a,size:l,type:u,disabled:d,shouldAddSpace:h}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tag),(0,n.mergeProps)({ref_key:"_ref",ref:a},(0,n.unref)(p),{class:[(0,n.unref)(s).b(),(0,n.unref)(s).m((0,n.unref)(u)),(0,n.unref)(s).m((0,n.unref)(l)),(0,n.unref)(s).is("disabled",(0,n.unref)(d)),(0,n.unref)(s).is("loading",e.loading),(0,n.unref)(s).is("plain",e.plain),(0,n.unref)(s).is("round",e.round),(0,n.unref)(s).is("circle",e.circle),(0,n.unref)(s).is("text",e.text),(0,n.unref)(s).is("link",e.link),(0,n.unref)(s).is("has-bg",e.bg)],style:(0,n.unref)(i),onClick:(0,n.unref)(f)}),{default:(0,n.withCtx)((()=>[e.loading?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[e.$slots.loading?(0,n.renderSlot)(e.$slots,"loading",{key:0}):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:1,class:(0,n.normalizeClass)((0,n.unref)(s).is("loading"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.loadingIcon)))])),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:1},{default:(0,n.withCtx)((()=>[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon),{key:0})):(0,n.renderSlot)(e.$slots,"icon",{key:1})])),_:3})):(0,n.createCommentVNode)("v-if",!0),e.$slots.default?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:2,class:(0,n.normalizeClass)({[(0,n.unref)(s).em("text","expand")]:(0,n.unref)(h)})},[(0,n.renderSlot)(e.$slots,"default")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},16,["class","style","onClick"]))}});var BC=Ar(AC,[["__file","button.vue"]]);const DC={size:Zw.size,type:Zw.type},PC=(0,n.defineComponent)({name:"ElButtonGroup"}),HC=(0,n.defineComponent)({...PC,props:DC,setup(e){const t=e;(0,n.provide)(Kw,(0,n.reactive)({size:(0,n.toRef)(t,"size"),type:(0,n.toRef)(t,"type")}));const r=c("button");return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)(`${(0,n.unref)(r).b("group")}`)},[(0,n.renderSlot)(e.$slots,"default")],2))}});var MC=Ar(HC,[["__file","button-group.vue"]]);const jC=dr(BC,{ButtonGroup:MC}),VC=(fr(MC),()=>Yr&&/firefox/i.test(window.navigator.userAgent));let LC;const $C=`\n height:0 !important;\n visibility:hidden !important;\n ${VC()?"":"overflow:hidden !important;"}\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important;\n`,qC=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function FC(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),r=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),o=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width")),i=qC.map((e=>`${e}:${t.getPropertyValue(e)}`)).join(";");return{contextStyle:i,paddingSize:r,borderSize:o,boxSizing:n}}function UC(e,t=1,n){var r;LC||(LC=document.createElement("textarea"),document.body.appendChild(LC));const{paddingSize:o,borderSize:i,boxSizing:s,contextStyle:a}=FC(e);LC.setAttribute("style",`${a};${$C}`),LC.value=e.value||e.placeholder||"";let l=LC.scrollHeight;const c={};"border-box"===s?l+=i:"content-box"===s&&(l-=o),LC.value="";const u=LC.scrollHeight-o;if(yn(t)){let e=u*t;"border-box"===s&&(e=e+o+i),l=Math.max(e,l),c.minHeight=`${e}px`}if(yn(n)){let e=u*n;"border-box"===s&&(e=e+o+i),l=Math.min(e,l)}return c.height=`${l}px`,null==(r=LC.parentNode)||r.removeChild(LC),LC=void 0,c}const zC=Dn({id:{type:String,default:void 0},size:Hn,disabled:Boolean,modelValue:{type:On([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:On([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},suffixIcon:{type:Ec},prefixIcon:{type:Ec},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:On([Object,Array,String]),default:()=>lu({})},autofocus:{type:Boolean,default:!1}}),KC={[cu]:e=>an(e),input:e=>an(e),change:e=>an(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},WC=["class","style"],GC=/^on[A-Z]/,YC=(e={})=>{const{excludeListeners:t=!1,excludeKeys:r}=e,o=(0,n.computed)((()=>((null==r?void 0:r.value)||[]).concat(WC))),i=(0,n.getCurrentInstance)();return i?(0,n.computed)((()=>{var e;return In(Object.entries(null==(e=i.proxy)?void 0:e.$attrs).filter((([e])=>!o.value.includes(e)&&!(t&&GC.test(e)))))})):(Nn("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),(0,n.computed)((()=>({}))))};function JC(e,{afterFocus:t,beforeBlur:r,afterBlur:o}={}){const i=(0,n.getCurrentInstance)(),{emit:s}=i,a=(0,n.shallowRef)(),l=(0,n.ref)(!1),c=e=>{l.value||(l.value=!0,s("focus",e),null==t||t())},u=e=>{var t;const n=!!sn(r)&&r(e);n||e.relatedTarget&&(null==(t=a.value)?void 0:t.contains(e.relatedTarget))||(l.value=!1,s("blur",e),null==o||o())},d=()=>{var t;null==(t=e.value)||t.focus()};return(0,n.watch)(a,(e=>{e&&e.setAttribute("tabindex","-1")})),qs(a,"click",d),{wrapperRef:a,isFocused:l,handleFocus:c,handleBlur:u}}function ZC(e){const t=(0,n.ref)();function r(){if(void 0==e.value)return;const{selectionStart:n,selectionEnd:r,value:o}=e.value;if(null==n||null==r)return;const i=o.slice(0,Math.max(0,n)),s=o.slice(Math.max(0,r));t.value={selectionStart:n,selectionEnd:r,value:o,beforeTxt:i,afterTxt:s}}function o(){if(void 0==e.value||void 0==t.value)return;const{value:n}=e.value,{beforeTxt:r,afterTxt:o,selectionStart:i}=t.value;if(void 0==r||void 0==o||void 0==i)return;let s=n.length;if(n.endsWith(o))s=n.length-o.length;else if(n.startsWith(r))s=r.length;else{const e=r[i-1],t=n.indexOf(e,i-1);-1!==t&&(s=t+1)}e.value.setSelectionRange(s,s)}return[r,o]}const XC=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),QC=["role"],eS=["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],tS=["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],nS=(0,n.defineComponent)({name:"ElInput",inheritAttrs:!1}),rS=(0,n.defineComponent)({...nS,props:zC,emits:KC,setup(e,{expose:t,emit:r}){const o=e,i=(0,n.useAttrs)(),s=(0,n.useSlots)(),a=(0,n.computed)((()=>{const e={};return"combobox"===o.containerRole&&(e["aria-haspopup"]=i["aria-haspopup"],e["aria-owns"]=i["aria-owns"],e["aria-expanded"]=i["aria-expanded"]),e})),l=(0,n.computed)((()=>["textarea"===o.type?y.b():v.b(),v.m(g.value),v.is("disabled",m.value),v.is("exceed",q.value),{[v.b("group")]:s.prepend||s.append,[v.bm("group","append")]:s.append,[v.bm("group","prepend")]:s.prepend,[v.m("prefix")]:s.prefix||o.prefixIcon,[v.m("suffix")]:s.suffix||o.suffixIcon||o.clearable||o.showPassword,[v.bm("suffix","password-clear")]:j.value&&V.value},i.class])),u=(0,n.computed)((()=>[v.e("wrapper"),v.is("focus",R.value)])),d=YC({excludeKeys:(0,n.computed)((()=>Object.keys(a.value)))}),{form:p,formItem:h}=Hm(),{inputId:f}=Mm(o,{formItemContext:h}),g=Bm(),m=Dm(),v=c("input"),y=c("textarea"),b=(0,n.shallowRef)(),w=(0,n.shallowRef)(),C=(0,n.ref)(!1),S=(0,n.ref)(!1),E=(0,n.ref)(!1),T=(0,n.ref)(),k=(0,n.shallowRef)(o.inputStyle),x=(0,n.computed)((()=>b.value||w.value)),{wrapperRef:N,isFocused:R,handleFocus:I,handleBlur:_}=JC(x,{afterBlur(){var e;o.validateEvent&&(null==(e=null==h?void 0:h.validate)||e.call(h,"blur").catch((e=>Nn(e))))}}),O=(0,n.computed)((()=>{var e;return null!=(e=null==p?void 0:p.statusIcon)&&e})),A=(0,n.computed)((()=>(null==h?void 0:h.validateState)||"")),B=(0,n.computed)((()=>A.value&&xc[A.value])),D=(0,n.computed)((()=>E.value?wc:lc)),P=(0,n.computed)((()=>[i.style])),H=(0,n.computed)((()=>[o.inputStyle,k.value,{resize:o.resize}])),M=(0,n.computed)((()=>js(o.modelValue)?"":String(o.modelValue))),j=(0,n.computed)((()=>o.clearable&&!m.value&&!o.readonly&&!!M.value&&(R.value||C.value))),V=(0,n.computed)((()=>o.showPassword&&!m.value&&!o.readonly&&!!M.value&&(!!M.value||R.value))),L=(0,n.computed)((()=>o.showWordLimit&&!!o.maxlength&&("text"===o.type||"textarea"===o.type)&&!m.value&&!o.readonly&&!o.showPassword)),$=(0,n.computed)((()=>M.value.length)),q=(0,n.computed)((()=>!!L.value&&$.value>Number(o.maxlength))),F=(0,n.computed)((()=>!!s.suffix||!!o.suffixIcon||j.value||o.showPassword||L.value||!!A.value&&O.value)),[U,z]=ZC(b);Qs(w,(e=>{if(G(),!L.value||"both"!==o.resize)return;const t=e[0],{width:n}=t.contentRect;T.value={right:`calc(100% - ${n+15+6}px)`}}));const K=()=>{const{type:e,autosize:t}=o;if(Yr&&"textarea"===e&&w.value)if(t){const e=ln(t)?t.minRows:void 0,r=ln(t)?t.maxRows:void 0,o=UC(w.value,e,r);k.value={overflowY:"hidden",...o},(0,n.nextTick)((()=>{w.value.offsetHeight,k.value=o}))}else k.value={minHeight:UC(w.value).minHeight}},W=e=>{let t=!1;return()=>{var n;if(t||!o.autosize)return;const r=null===(null==(n=w.value)?void 0:n.offsetParent);r||(e(),t=!0)}},G=W(K),Y=()=>{const e=x.value,t=o.formatter?o.formatter(M.value):M.value;e&&e.value!==t&&(e.value=t)},J=async e=>{U();let{value:t}=e.target;o.formatter&&(t=o.parser?o.parser(t):t),S.value||(t!==M.value?(r(cu,t),r("input",t),await(0,n.nextTick)(),Y(),z()):Y())},Z=e=>{r("change",e.target.value)},X=e=>{r("compositionstart",e),S.value=!0},Q=e=>{var t;r("compositionupdate",e);const n=null==(t=e.target)?void 0:t.value,o=n[n.length-1]||"";S.value=!XC(o)},ee=e=>{r("compositionend",e),S.value&&(S.value=!1,J(e))},te=()=>{E.value=!E.value,ne()},ne=async()=>{var e;await(0,n.nextTick)(),null==(e=x.value)||e.focus()},re=()=>{var e;return null==(e=x.value)?void 0:e.blur()},oe=e=>{C.value=!1,r("mouseleave",e)},ie=e=>{C.value=!0,r("mouseenter",e)},se=e=>{r("keydown",e)},ae=()=>{var e;null==(e=x.value)||e.select()},le=()=>{r(cu,""),r("change",""),r("clear"),r("input","")};return(0,n.watch)((()=>o.modelValue),(()=>{var e;(0,n.nextTick)((()=>K())),o.validateEvent&&(null==(e=null==h?void 0:h.validate)||e.call(h,"change").catch((e=>Nn(e))))})),(0,n.watch)(M,(()=>Y())),(0,n.watch)((()=>o.type),(async()=>{await(0,n.nextTick)(),Y(),K()})),(0,n.onMounted)((()=>{!o.formatter&&o.parser&&Nn("ElInput","If you set the parser, you also need to set the formatter."),Y(),(0,n.nextTick)(K)})),t({input:b,textarea:w,ref:x,textareaStyle:H,autosize:(0,n.toRef)(o,"autosize"),focus:ne,blur:re,select:ae,clear:le,resizeTextarea:K}),(e,t)=>(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",(0,n.mergeProps)((0,n.unref)(a),{class:(0,n.unref)(l),style:(0,n.unref)(P),role:e.containerRole,onMouseenter:ie,onMouseleave:oe}),[(0,n.createCommentVNode)(" input "),"textarea"!==e.type?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.createCommentVNode)(" prepend slot "),e.$slots.prepend?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).be("group","prepend"))},[(0,n.renderSlot)(e.$slots,"prepend")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref_key:"wrapperRef",ref:N,class:(0,n.normalizeClass)((0,n.unref)(u))},[(0,n.createCommentVNode)(" prefix slot "),e.$slots.prefix||e.prefixIcon?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("prefix"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("prefix-inner"))},[(0,n.renderSlot)(e.$slots,"prefix"),e.prefixIcon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("icon"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.prefixIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("input",(0,n.mergeProps)({id:(0,n.unref)(f),ref_key:"input",ref:b,class:(0,n.unref)(v).e("inner")},(0,n.unref)(d),{minlength:e.minlength,maxlength:e.maxlength,type:e.showPassword?E.value?"text":"password":e.type,disabled:(0,n.unref)(m),readonly:e.readonly,autocomplete:e.autocomplete,tabindex:e.tabindex,"aria-label":e.label,placeholder:e.placeholder,style:e.inputStyle,form:e.form,autofocus:e.autofocus,onCompositionstart:X,onCompositionupdate:Q,onCompositionend:ee,onInput:J,onFocus:t[0]||(t[0]=(...e)=>(0,n.unref)(I)&&(0,n.unref)(I)(...e)),onBlur:t[1]||(t[1]=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)),onChange:Z,onKeydown:se}),null,16,eS),(0,n.createCommentVNode)(" suffix slot "),(0,n.unref)(F)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,class:(0,n.normalizeClass)((0,n.unref)(v).e("suffix"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("suffix-inner"))},[(0,n.unref)(j)&&(0,n.unref)(V)&&(0,n.unref)(L)?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:0},[(0,n.renderSlot)(e.$slots,"suffix"),e.suffixIcon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:0,class:(0,n.normalizeClass)((0,n.unref)(v).e("icon"))},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.suffixIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],64)),(0,n.unref)(j)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:1,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("clear")]),onMousedown:(0,n.withModifiers)((0,n.unref)(tn),["prevent"]),onClick:le},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(oc))])),_:1},8,["class","onMousedown"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(V)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:2,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("password")]),onClick:te},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(D))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(L)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:3,class:(0,n.normalizeClass)((0,n.unref)(v).e("count"))},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(v).e("count-inner"))},(0,n.toDisplayString)((0,n.unref)($))+" / "+(0,n.toDisplayString)(e.maxlength),3)],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(A)&&(0,n.unref)(B)&&(0,n.unref)(O)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:4,class:(0,n.normalizeClass)([(0,n.unref)(v).e("icon"),(0,n.unref)(v).e("validateIcon"),(0,n.unref)(v).is("loading","validating"===(0,n.unref)(A))])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(B))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)):(0,n.createCommentVNode)("v-if",!0)],2),(0,n.createCommentVNode)(" append slot "),e.$slots.append?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)((0,n.unref)(v).be("group","append"))},[(0,n.renderSlot)(e.$slots,"append")],2)):(0,n.createCommentVNode)("v-if",!0)],64)):((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(" textarea "),(0,n.createElementVNode)("textarea",(0,n.mergeProps)({id:(0,n.unref)(f),ref_key:"textarea",ref:w,class:(0,n.unref)(y).e("inner")},(0,n.unref)(d),{minlength:e.minlength,maxlength:e.maxlength,tabindex:e.tabindex,disabled:(0,n.unref)(m),readonly:e.readonly,autocomplete:e.autocomplete,style:(0,n.unref)(H),"aria-label":e.label,placeholder:e.placeholder,form:e.form,autofocus:e.autofocus,onCompositionstart:X,onCompositionupdate:Q,onCompositionend:ee,onInput:J,onFocus:t[2]||(t[2]=(...e)=>(0,n.unref)(I)&&(0,n.unref)(I)(...e)),onBlur:t[3]||(t[3]=(...e)=>(0,n.unref)(_)&&(0,n.unref)(_)(...e)),onChange:Z,onKeydown:se}),null,16,tS),(0,n.unref)(L)?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,style:(0,n.normalizeStyle)(T.value),class:(0,n.normalizeClass)((0,n.unref)(v).e("count"))},(0,n.toDisplayString)((0,n.unref)($))+" / "+(0,n.toDisplayString)(e.maxlength),7)):(0,n.createCommentVNode)("v-if",!0)],64))],16,QC)),[[n.vShow,"hidden"!==e.type]])}});var oS=Ar(rS,[["__file","input.vue"]]);const iS=dr(oS),sS=Dn({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:Hn,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:e=>null===e||yn(e)||["min","max"].includes(e),default:null},name:String,label:String,placeholder:String,precision:{type:Number,validator:e=>e>=0&&e===Number.parseInt(`${e}`,10)},validateEvent:{type:Boolean,default:!0}}),aS={[uu]:(e,t)=>t!==e,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,[du]:e=>yn(e)||js(e),[cu]:e=>yn(e)||js(e)},lS=100,cS=600,uS={beforeMount(e,t){const n=t.value,{interval:r=lS,delay:o=cS}=sn(n)?{}:n;let i,s;const a=()=>sn(n)?n():n.handler(),l=()=>{s&&(clearTimeout(s),s=void 0),i&&(clearInterval(i),i=void 0)};e.addEventListener("mousedown",(e=>{0===e.button&&(l(),a(),document.addEventListener("mouseup",(()=>l()),{once:!0}),s=setTimeout((()=>{i=setInterval((()=>{a()}),r)}),o))}))}},dS=["aria-label","onKeydown"],pS=["aria-label","onKeydown"],hS=(0,n.defineComponent)({name:"ElInputNumber"}),fS=(0,n.defineComponent)({...hS,props:sS,emits:aS,setup(e,{expose:t,emit:r}){const o=e,{t:i}=en(),s=c("input-number"),a=(0,n.ref)(),l=(0,n.reactive)({currentValue:o.modelValue,userInput:null}),{formItem:u}=Hm(),d=(0,n.computed)((()=>yn(o.modelValue)&&o.modelValue<=o.min)),p=(0,n.computed)((()=>yn(o.modelValue)&&o.modelValue>=o.max)),h=(0,n.computed)((()=>{const e=b(o.step);return mn(o.precision)?Math.max(b(o.modelValue),e):(e>o.precision&&Nn("InputNumber","precision should not be less than the decimal places of step"),o.precision)})),f=(0,n.computed)((()=>o.controls&&"right"===o.controlsPosition)),g=Bm(),m=Dm(),v=(0,n.computed)((()=>{if(null!==l.userInput)return l.userInput;let e=l.currentValue;if(js(e))return"";if(yn(e)){if(Number.isNaN(e))return"";mn(o.precision)||(e=e.toFixed(o.precision))}return e})),y=(e,t)=>{if(mn(t)&&(t=h.value),0===t)return Math.round(e);let n=String(e);const r=n.indexOf(".");if(-1===r)return e;const o=n.replace(".","").split(""),i=o[r+t];if(!i)return e;const s=n.length;return"5"===n.charAt(s-1)&&(n=`${n.slice(0,Math.max(0,s-1))}6`),Number.parseFloat(Number(n).toFixed(t))},b=e=>{if(js(e))return 0;const t=e.toString(),n=t.indexOf(".");let r=0;return-1!==n&&(r=t.length-n-1),r},w=(e,t=1)=>yn(e)?y(e+o.step*t):l.currentValue,C=()=>{if(o.readonly||m.value||p.value)return;const e=Number(v.value)||0,t=w(e);T(t),r(du,l.currentValue),O()},S=()=>{if(o.readonly||m.value||d.value)return;const e=Number(v.value)||0,t=w(e,-1);T(t),r(du,l.currentValue),O()},E=(e,t)=>{const{max:n,min:i,step:s,precision:a,stepStrictly:l,valueOnClear:c}=o;n<i&&xn("InputNumber","min should not be greater than max.");let u=Number(e);if(js(e)||Number.isNaN(u))return null;if(""===e){if(null===c)return null;u=an(c)?{min:i,max:n}[c]:c}return l&&(u=y(Math.round(u/s)*s,a)),mn(a)||(u=y(u,a)),(u>n||u<i)&&(u=u>n?n:i,t&&r(cu,u)),u},T=(e,t=!0)=>{var n;const i=l.currentValue,s=E(e);t?i!==s&&(l.userInput=null,r(cu,s),r(uu,s,i),o.validateEvent&&(null==(n=null==u?void 0:u.validate)||n.call(u,"change").catch((e=>Nn(e)))),l.currentValue=s):r(cu,s)},k=e=>{l.userInput=e;const t=""===e?null:Number(e);r(du,t),T(t,!1)},x=e=>{const t=""!==e?Number(e):"";(yn(t)&&!Number.isNaN(t)||""===e)&&T(t),O(),l.userInput=null},N=()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.focus)||t.call(e)},R=()=>{var e,t;null==(t=null==(e=a.value)?void 0:e.blur)||t.call(e)},I=e=>{r("focus",e)},_=e=>{var t;l.userInput=null,r("blur",e),o.validateEvent&&(null==(t=null==u?void 0:u.validate)||t.call(u,"blur").catch((e=>Nn(e))))},O=()=>{l.currentValue!==o.modelValue&&(l.currentValue=o.modelValue)},A=e=>{document.activeElement===e.target&&e.preventDefault()};return(0,n.watch)((()=>o.modelValue),((e,t)=>{const n=E(e,!0);null===l.userInput&&n!==t&&(l.currentValue=n)}),{immediate:!0}),(0,n.onMounted)((()=>{var e;const{min:t,max:n,modelValue:i}=o,s=null==(e=a.value)?void 0:e.input;if(s.setAttribute("role","spinbutton"),Number.isFinite(n)?s.setAttribute("aria-valuemax",String(n)):s.removeAttribute("aria-valuemax"),Number.isFinite(t)?s.setAttribute("aria-valuemin",String(t)):s.removeAttribute("aria-valuemin"),s.setAttribute("aria-valuenow",l.currentValue||0===l.currentValue?String(l.currentValue):""),s.setAttribute("aria-disabled",String(m.value)),!yn(i)&&null!=i){let e=Number(i);Number.isNaN(e)&&(e=null),r(cu,e)}})),(0,n.onUpdated)((()=>{var e,t;const n=null==(e=a.value)?void 0:e.input;null==n||n.setAttribute("aria-valuenow",`${null!=(t=l.currentValue)?t:""}`)})),t({focus:N,blur:R}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([(0,n.unref)(s).b(),(0,n.unref)(s).m((0,n.unref)(g)),(0,n.unref)(s).is("disabled",(0,n.unref)(m)),(0,n.unref)(s).is("without-controls",!e.controls),(0,n.unref)(s).is("controls-right",(0,n.unref)(f))]),onDragstart:t[0]||(t[0]=(0,n.withModifiers)((()=>{}),["prevent"]))},[e.controls?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,role:"button","aria-label":(0,n.unref)(i)("el.inputNumber.decrease"),class:(0,n.normalizeClass)([(0,n.unref)(s).e("decrease"),(0,n.unref)(s).is("disabled",(0,n.unref)(d))]),onKeydown:(0,n.withKeys)(S,["enter"])},[(0,n.createVNode)((0,n.unref)(Ou),null,{default:(0,n.withCtx)((()=>[(0,n.unref)(f)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ul),{key:0})):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(fc),{key:1}))])),_:1})],42,dS)),[[(0,n.unref)(uS),S]]):(0,n.createCommentVNode)("v-if",!0),e.controls?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,role:"button","aria-label":(0,n.unref)(i)("el.inputNumber.increase"),class:(0,n.normalizeClass)([(0,n.unref)(s).e("increase"),(0,n.unref)(s).is("disabled",(0,n.unref)(p))]),onKeydown:(0,n.withKeys)(C,["enter"])},[(0,n.createVNode)((0,n.unref)(Ou),null,{default:(0,n.withCtx)((()=>[(0,n.unref)(f)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Jl),{key:0})):((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(mc),{key:1}))])),_:1})],42,pS)),[[(0,n.unref)(uS),C]]):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)((0,n.unref)(iS),{id:e.id,ref_key:"input",ref:a,type:"number",step:e.step,"model-value":(0,n.unref)(v),placeholder:e.placeholder,readonly:e.readonly,disabled:(0,n.unref)(m),size:(0,n.unref)(g),max:e.max,min:e.min,name:e.name,label:e.label,"validate-event":!1,onWheel:A,onKeydown:[(0,n.withKeys)((0,n.withModifiers)(C,["prevent"]),["up"]),(0,n.withKeys)((0,n.withModifiers)(S,["prevent"]),["down"])],onBlur:_,onFocus:I,onInput:k,onChange:x},null,8,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","label","onKeydown"])],34))}});var gS=Ar(fS,[["__file","input-number.vue"]]);const mS=dr(gS),vS=Dn({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Pn},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),yS={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},bS=(0,n.defineComponent)({name:"ElTag"}),wS=(0,n.defineComponent)({...bS,props:vS,emits:yS,setup(e,{emit:t}){const r=e,o=Bm(),i=c("tag"),s=(0,n.computed)((()=>{const{type:e,hit:t,effect:n,closable:s,round:a}=r;return[i.b(),i.is("closable",s),i.m(e||"primary"),i.m(o.value),i.m(n),i.is("hit",t),i.is("round",a)]})),a=e=>{t("close",e)},l=e=>{t("click",e)};return(e,t)=>e.disableTransitions?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,class:(0,n.normalizeClass)((0,n.unref)(s)),style:(0,n.normalizeStyle)({backgroundColor:e.color}),onClick:l},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},[(0,n.renderSlot)(e.$slots,"default")],2),e.closable?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("close")),onClick:(0,n.withModifiers)(a,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(sc))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],6)):((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{key:1,name:`${(0,n.unref)(i).namespace.value}-zoom-in-center`,appear:""},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(s)),style:(0,n.normalizeStyle)({backgroundColor:e.color}),onClick:l},[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},[(0,n.renderSlot)(e.$slots,"default")],2),e.closable?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("close")),onClick:(0,n.withModifiers)(a,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(sc))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],6)])),_:3},8,["name"]))}});var CS=Ar(wS,[["__file","tag.vue"]]);const SS=dr(CS),ES=Symbol("ElSelectGroup"),TS=Symbol("ElSelect"),kS=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),xS=e=>gn(e);function NS(e,t){const r=(0,n.inject)(TS),o=(0,n.inject)(ES,{disabled:!1}),i=(0,n.computed)((()=>r.props.multiple?d(r.props.modelValue,e.value):d([r.props.modelValue],e.value))),s=(0,n.computed)((()=>{if(r.props.multiple){const e=r.props.modelValue||[];return!i.value&&e.length>=r.props.multipleLimit&&r.props.multipleLimit>0}return!1})),a=(0,n.computed)((()=>e.label||(ln(e.value)?"":e.value))),l=(0,n.computed)((()=>e.value||e.label||"")),c=(0,n.computed)((()=>e.disabled||t.groupDisabled||s.value)),u=(0,n.getCurrentInstance)(),d=(t=[],o)=>{if(ln(e.value)){const e=r.props.valueKey;return t&&t.some((t=>(0,n.toRaw)(Gt(t,e))===Gt(o,e)))}return t&&t.includes(o)},p=()=>{e.disabled||o.disabled||(r.states.hoveringIndex=r.optionsArray.indexOf(u.proxy))},h=n=>{const r=new RegExp(kS(n),"i");t.visible=r.test(a.value)||e.created};return(0,n.watch)((()=>a.value),(()=>{e.created||r.props.remote||r.setSelected()})),(0,n.watch)((()=>e.value),((t,n)=>{const{remote:o,valueKey:i}=r.props;if($m(t,n)||(r.onOptionDestroy(n,u.proxy),r.onOptionCreate(u.proxy)),!e.created&&!o){if(i&&ln(t)&&ln(n)&&t[i]===n[i])return;r.setSelected()}})),(0,n.watch)((()=>o.disabled),(()=>{t.groupDisabled=o.disabled}),{immediate:!0}),{select:r,currentLabel:a,currentValue:l,itemSelected:i,isDisabled:c,hoverItem:p,updateOption:h}}const RS=(0,n.defineComponent)({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const t=c("select"),r=_a(),o=(0,n.computed)((()=>[t.be("dropdown","item"),t.is("disabled",(0,n.unref)(l)),t.is("selected",(0,n.unref)(a)),t.is("hovering",(0,n.unref)(f))])),i=(0,n.reactive)({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:s,itemSelected:a,isDisabled:l,select:u,hoverItem:d,updateOption:p}=NS(e,i),{visible:h,hover:f}=(0,n.toRefs)(i),g=(0,n.getCurrentInstance)().proxy;function m(){!0!==e.disabled&&!0!==i.groupDisabled&&u.handleOptionSelect(g)}return u.onOptionCreate(g),(0,n.onBeforeUnmount)((()=>{const e=g.value,{selected:t}=u.states,r=u.props.multiple?t:[t],o=r.some((e=>e.value===g.value));(0,n.nextTick)((()=>{u.states.cachedOptions.get(e)!==g||o||u.states.cachedOptions.delete(e)})),u.onOptionDestroy(e,g)})),{ns:t,id:r,containerKls:o,currentLabel:s,itemSelected:a,isDisabled:l,select:u,hoverItem:d,updateOption:p,visible:h,hover:f,selectOptionClick:m,states:i}}}),IS=["id","aria-disabled","aria-selected"];function _S(e,t,r,o,i,s){return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("li",{id:e.id,class:(0,n.normalizeClass)(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:t[0]||(t[0]=(...t)=>e.hoverItem&&e.hoverItem(...t)),onClick:t[1]||(t[1]=(0,n.withModifiers)(((...t)=>e.selectOptionClick&&e.selectOptionClick(...t)),["stop"]))},[(0,n.renderSlot)(e.$slots,"default",{},(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentLabel),1)]))],42,IS)),[[n.vShow,e.visible]])}var OS=Ar(RS,[["render",_S],["__file","option.vue"]]);const AS=(0,n.defineComponent)({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=(0,n.inject)(TS),t=c("select"),r=(0,n.computed)((()=>e.props.popperClass)),o=(0,n.computed)((()=>e.props.multiple)),i=(0,n.computed)((()=>e.props.fitInputWidth)),s=(0,n.ref)("");function a(){var t;s.value=`${null==(t=e.selectRef)?void 0:t.offsetWidth}px`}return(0,n.onMounted)((()=>{a(),Qs(e.selectRef,a)})),{ns:t,minWidth:s,popperClass:r,isMultiple:o,isFitInputWidth:i}}});function BS(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:(0,n.normalizeStyle)({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.be("dropdown","header"))},[(0,n.renderSlot)(e.$slots,"header")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default"),e.$slots.footer?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(e.ns.be("dropdown","footer"))},[(0,n.renderSlot)(e.$slots,"footer")],2)):(0,n.createCommentVNode)("v-if",!0)],6)}var DS=Ar(AS,[["render",BS],["__file","select-dropdown.vue"]]);function PS(e,t,n,r){var o=e.length,i=n+(r?1:-1);while(r?i--:++i<o)if(t(e[i],i,e))return i;return-1}var HS=PS,MS=1/0,jS=17976931348623157e292;function VS(e){if(!e)return 0===e?e:0;if(e=nd(e),e===MS||e===-MS){var t=e<0?-1:1;return t*jS}return e===e?e:0}var LS=VS;function $S(e){var t=LS(e),n=t%1;return t===t?n?t-n:t:0}var qS=$S,FS=Math.max,US=Math.min;function zS(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return void 0!==n&&(o=qS(n),o=n<0?FS(r+o,0):US(o,r-1)),HS(e,Rg(t,3),o,!0)}var KS=zS;function WS(e){const t=(0,n.ref)(!1),r=()=>{t.value=!0},o=e=>{const n=e.target.value,r=n[n.length-1]||"";t.value=!XC(r)},i=n=>{t.value&&(t.value=!1,sn(e)&&e(n))};return{handleCompositionStart:r,handleCompositionUpdate:o,handleCompositionEnd:i}}function GS(e,t){if(!Yr)return;if(!t)return void(e.scrollTop=0);const n=[];let r=t.offsetParent;while(null!==r&&e!==r&&e.contains(r))n.push(r),r=r.offsetParent;const o=t.offsetTop+n.reduce(((e,t)=>e+t.offsetTop),0),i=o+t.offsetHeight,s=e.scrollTop,a=s+e.clientHeight;o<s?e.scrollTop=o:i>a&&(e.scrollTop=i-e.clientHeight)}const YS=11,JS=(e,t)=>{const{t:r}=en(),o=_a(),i=c("select"),s=c("input"),a=(0,n.reactive)({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:e.multiple?[]:{},selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1});Ww({from:"suffixTransition",replacement:"override style scheme",version:"2.3.0",scope:"props",ref:"https://element-plus.org/en-US/component/select.html#select-attributes"},(0,n.computed)((()=>!1===e.suffixTransition)));const l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.ref)(null),h=(0,n.ref)(null),f=(0,n.ref)(null),g=(0,n.ref)(null),m=(0,n.ref)(null),v=(0,n.ref)(null),y=(0,n.ref)(null),b=(0,n.ref)(null),w=(0,n.ref)(null),{wrapperRef:C,isFocused:S,handleFocus:E,handleBlur:T}=JC(h,{afterFocus(){e.automaticDropdown&&!k.value&&(k.value=!0,a.menuVisibleOnFocus=!0)},beforeBlur(e){var t,n;return(null==(t=d.value)?void 0:t.isFocusInsideContent(e))||(null==(n=p.value)?void 0:n.isFocusInsideContent(e))},afterBlur(){k.value=!1,a.menuVisibleOnFocus=!1}}),k=(0,n.ref)(!1),x=(0,n.ref)(),{form:N,formItem:R}=Hm(),{inputId:I}=Mm(e,{formItemContext:R}),_=(0,n.computed)((()=>e.disabled||(null==N?void 0:N.disabled))),O=(0,n.computed)((()=>e.multiple?on(e.modelValue)&&e.modelValue.length>0:void 0!==e.modelValue&&null!==e.modelValue&&""!==e.modelValue)),A=(0,n.computed)((()=>{const t=e.clearable&&!_.value&&a.inputHovering&&O.value;return t})),B=(0,n.computed)((()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon)),D=(0,n.computed)((()=>i.is("reverse",B.value&&k.value&&e.suffixTransition))),P=(0,n.computed)((()=>(null==R?void 0:R.validateState)||"")),H=(0,n.computed)((()=>xc[P.value])),M=(0,n.computed)((()=>e.remote?300:0)),j=(0,n.computed)((()=>e.loading?e.loadingText||r("el.select.loading"):!(e.remote&&!a.inputValue&&0===a.options.size)&&(e.filterable&&a.inputValue&&a.options.size>0&&0===V.value?e.noMatchText||r("el.select.noMatch"):0===a.options.size?e.noDataText||r("el.select.noData"):null))),V=(0,n.computed)((()=>L.value.filter((e=>e.visible)).length)),L=(0,n.computed)((()=>{const e=Array.from(a.options.values()),t=[];return a.optionValues.forEach((n=>{const r=e.findIndex((e=>e.value===n));r>-1&&t.push(e[r])})),t.length>=e.length?t:e})),$=(0,n.computed)((()=>Array.from(a.cachedOptions.values()))),q=(0,n.computed)((()=>{const t=L.value.filter((e=>!e.created)).some((e=>e.currentLabel===a.inputValue));return e.filterable&&e.allowCreate&&""!==a.inputValue&&!t})),F=()=>{e.filterable&&sn(e.filterMethod)||e.filterable&&e.remote&&sn(e.remoteMethod)||L.value.forEach((e=>{e.updateOption(a.inputValue)}))},U=Bm(),z=(0,n.computed)((()=>["small"].includes(U.value)?"small":"default")),K=(0,n.computed)({get(){return k.value&&!1!==j.value},set(e){k.value=e}}),W=(0,n.computed)((()=>on(e.modelValue)?0===e.modelValue.length&&!a.inputValue:!e.filterable||!a.inputValue)),G=(0,n.computed)((()=>{var t;const n=null!=(t=e.placeholder)?t:r("el.select.placeholder");return e.multiple||!O.value?n:a.selectedLabel}));(0,n.watch)((()=>e.modelValue),((t,n)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(a.inputValue="",Y("")),Z(),!$m(t,n)&&e.validateEvent&&(null==R||R.validate("change").catch((e=>Nn(e))))}),{flush:"post",deep:!0}),(0,n.watch)((()=>k.value),(e=>{e?Y(a.inputValue):(a.inputValue="",a.previousQuery=null,a.isBeforeHide=!0),t("visible-change",e)})),(0,n.watch)((()=>a.options.entries()),(()=>{var t;if(!Yr)return;const n=(null==(t=l.value)?void 0:t.querySelectorAll("input"))||[];(e.filterable||e.defaultFirstOption||mn(e.modelValue))&&Array.from(n).includes(document.activeElement)||Z(),e.defaultFirstOption&&(e.filterable||e.remote)&&V.value&&J()}),{flush:"post"}),(0,n.watch)((()=>a.hoveringIndex),(e=>{yn(e)&&e>-1?x.value=L.value[e]||{}:x.value={},L.value.forEach((e=>{e.hover=x.value===e}))})),(0,n.watchEffect)((()=>{a.isBeforeHide||F()}));const Y=t=>{a.previousQuery!==t&&(a.previousQuery=t,e.filterable&&sn(e.filterMethod)?e.filterMethod(t):e.filterable&&e.remote&&sn(e.remoteMethod)&&e.remoteMethod(t),e.defaultFirstOption&&(e.filterable||e.remote)&&V.value?(0,n.nextTick)(J):(0,n.nextTick)(Q))},J=()=>{const e=L.value.filter((e=>e.visible&&!e.disabled&&!e.states.groupDisabled)),t=e.find((e=>e.created)),n=e[0];a.hoveringIndex=fe(L.value,t||n)},Z=()=>{if(!e.multiple){const t=X(e.modelValue);return a.selectedLabel=t.currentLabel,void(a.selected=t)}a.selectedLabel="";const t=[];on(e.modelValue)&&e.modelValue.forEach((e=>{t.push(X(e))})),a.selected=t},X=t=>{let n;const r="object"===dn(t).toLowerCase(),o="null"===dn(t).toLowerCase(),i="undefined"===dn(t).toLowerCase();for(let c=a.cachedOptions.size-1;c>=0;c--){const o=$.value[c],i=r?Gt(o.value,e.valueKey)===Gt(t,e.valueKey):o.value===t;if(i){n={value:t,currentLabel:o.currentLabel,isDisabled:o.isDisabled};break}}if(n)return n;const s=r?t.label:o||i?"":t,l={value:t,currentLabel:s};return l},Q=()=>{e.multiple?a.selected.length>0?a.hoveringIndex=Math.min(...a.selected.map((e=>L.value.findIndex((t=>_e(t)===_e(e)))))):a.hoveringIndex=-1:a.hoveringIndex=L.value.findIndex((e=>_e(e)===_e(a.selected)))},ee=()=>{a.selectionWidth=u.value.getBoundingClientRect().width},te=()=>{a.calculatorWidth=f.value.getBoundingClientRect().width},ne=()=>{a.collapseItemWidth=b.value.getBoundingClientRect().width},re=()=>{var e,t;null==(t=null==(e=d.value)?void 0:e.updatePopper)||t.call(e)},oe=()=>{var e,t;null==(t=null==(e=p.value)?void 0:e.updatePopper)||t.call(e)},ie=()=>{a.inputValue.length>0&&!k.value&&(k.value=!0),Y(a.inputValue)},se=t=>{if(a.inputValue=t.target.value,!e.remote)return ie();ae()},ae=ad((()=>{ie()}),M.value),le=n=>{$m(e.modelValue,n)||t(uu,n)},ce=e=>KS(e,(e=>!a.disabledOptions.has(e))),ue=n=>{if(e.multiple&&n.code!==bs.delete&&n.target.value.length<=0){const n=e.modelValue.slice(),r=ce(n);if(r<0)return;n.splice(r,1),t(cu,n),le(n)}},de=(n,r)=>{const o=a.selected.indexOf(r);if(o>-1&&!_.value){const n=e.modelValue.slice();n.splice(o,1),t(cu,n),le(n),t("remove-tag",r.value)}n.stopPropagation(),Ee()},pe=n=>{n.stopPropagation();const r=e.multiple?[]:"";if(!an(r))for(const e of a.selected)e.isDisabled&&r.push(e.value);t(cu,r),le(r),a.hoveringIndex=-1,k.value=!1,t("clear"),Ee()},he=r=>{if(e.multiple){const n=(e.modelValue||[]).slice(),o=fe(n,r.value);o>-1?n.splice(o,1):(e.multipleLimit<=0||n.length<e.multipleLimit)&&n.push(r.value),t(cu,n),le(n),r.created&&Y(""),e.filterable&&!e.reserveKeyword&&(a.inputValue="")}else t(cu,r.value),le(r.value),k.value=!1;Ee(),k.value||(0,n.nextTick)((()=>{ge(r)}))},fe=(t=[],r)=>{if(!ln(r))return t.indexOf(r);const o=e.valueKey;let i=-1;return t.some(((e,t)=>(0,n.toRaw)(Gt(e,o))===Gt(r,o)&&(i=t,!0))),i},ge=e=>{var t,n,r,o,s;const a=on(e)?e[0]:e;let l=null;if(null==a?void 0:a.value){const e=L.value.filter((e=>e.value===a.value));e.length>0&&(l=e[0].$el)}if(d.value&&l){const e=null==(o=null==(r=null==(n=null==(t=d.value)?void 0:t.popperRef)?void 0:n.contentRef)?void 0:r.querySelector)?void 0:o.call(r,`.${i.be("dropdown","wrap")}`);e&&GS(e,l)}null==(s=w.value)||s.handleScroll()},me=e=>{a.options.set(e.value,e),a.cachedOptions.set(e.value,e),e.disabled&&a.disabledOptions.set(e.value,e)},ve=(e,t)=>{a.options.get(e)===t&&a.options.delete(e)},{handleCompositionStart:ye,handleCompositionUpdate:be,handleCompositionEnd:we}=WS((e=>se(e))),Ce=(0,n.computed)((()=>{var e,t;return null==(t=null==(e=d.value)?void 0:e.popperRef)?void 0:t.contentRef})),Se=()=>{(0,n.nextTick)((()=>ge(a.selected)))},Ee=()=>{var e;null==(e=h.value)||e.focus()},Te=()=>{xe()},ke=e=>{pe(e)},xe=e=>{if(k.value=!1,S.value){const t=new FocusEvent("focus",e);(0,n.nextTick)((()=>T(t)))}},Ne=()=>{a.inputValue.length>0?a.inputValue="":k.value=!1},Re=()=>{_.value||(a.menuVisibleOnFocus?a.menuVisibleOnFocus=!1:k.value=!k.value)},Ie=()=>{k.value?L.value[a.hoveringIndex]&&he(L.value[a.hoveringIndex]):Re()},_e=t=>ln(t.value)?Gt(t.value,e.valueKey):t.value,Oe=(0,n.computed)((()=>L.value.filter((e=>e.visible)).every((e=>e.disabled)))),Ae=(0,n.computed)((()=>e.multiple?e.collapseTags?a.selected.slice(0,e.maxCollapseTags):a.selected:[])),Be=(0,n.computed)((()=>e.multiple&&e.collapseTags?a.selected.slice(e.maxCollapseTags):[])),De=e=>{if(k.value){if(0!==a.options.size&&0!==V.value&&!Oe.value){"next"===e?(a.hoveringIndex++,a.hoveringIndex===a.options.size&&(a.hoveringIndex=0)):"prev"===e&&(a.hoveringIndex--,a.hoveringIndex<0&&(a.hoveringIndex=a.options.size-1));const t=L.value[a.hoveringIndex];!0!==t.disabled&&!0!==t.states.groupDisabled&&t.visible||De(e),(0,n.nextTick)((()=>ge(x.value)))}}else k.value=!0},Pe=()=>{if(!u.value)return 0;const e=window.getComputedStyle(u.value);return Number.parseFloat(e.gap||"6px")},He=(0,n.computed)((()=>{const t=Pe(),n=b.value&&1===e.maxCollapseTags?a.selectionWidth-a.collapseItemWidth-t:a.selectionWidth;return{maxWidth:`${n}px`}})),Me=(0,n.computed)((()=>({maxWidth:`${a.selectionWidth}px`}))),je=(0,n.computed)((()=>({width:`${Math.max(a.calculatorWidth,YS)}px`})));return e.multiple&&!on(e.modelValue)&&t(cu,[]),!e.multiple&&on(e.modelValue)&&t(cu,""),Qs(u,ee),Qs(f,te),Qs(v,re),Qs(C,re),Qs(y,oe),Qs(b,ne),(0,n.onMounted)((()=>{Z()})),{inputId:I,contentId:o,nsSelect:i,nsInput:s,states:a,isFocused:S,expanded:k,optionsArray:L,hoverOption:x,selectSize:U,filteredOptionsCount:V,resetCalculatorWidth:te,updateTooltip:re,updateTagTooltip:oe,debouncedOnInputChange:ae,onInput:se,deletePrevTag:ue,deleteTag:de,deleteSelected:pe,handleOptionSelect:he,scrollToOption:ge,hasModelValue:O,shouldShowPlaceholder:W,currentPlaceholder:G,showClose:A,iconComponent:B,iconReverse:D,validateState:P,validateIcon:H,showNewOption:q,updateOptions:F,collapseTagSize:z,setSelected:Z,selectDisabled:_,emptyText:j,handleCompositionStart:ye,handleCompositionUpdate:be,handleCompositionEnd:we,onOptionCreate:me,onOptionDestroy:ve,handleMenuEnter:Se,handleFocus:E,focus:Ee,blur:Te,handleBlur:T,handleClearClick:ke,handleClickOutside:xe,handleEsc:Ne,toggleMenu:Re,selectOption:Ie,getValueKey:_e,navigateOptions:De,dropdownMenuVisible:K,showTagList:Ae,collapseTagList:Be,tagStyle:He,collapseTagStyle:Me,inputStyle:je,popperRef:Ce,inputRef:h,tooltipRef:d,tagTooltipRef:p,calculatorRef:f,prefixRef:g,suffixRef:m,selectRef:l,wrapperRef:C,selectionRef:u,scrollbarRef:w,menuRef:v,tagMenuRef:y,collapseItemRef:b}};var ZS=(0,n.defineComponent)({name:"ElOptions",setup(e,{slots:t}){const r=(0,n.inject)(TS);let o=[];return()=>{var e,n;const i=null==(e=t.default)?void 0:e.call(t),s=[];function a(e){on(e)&&e.forEach((e=>{var t,n,r,o;const i=null==(t=(null==e?void 0:e.type)||{})?void 0:t.name;"ElOptionGroup"===i?a(an(e.children)||on(e.children)||!sn(null==(n=e.children)?void 0:n.default)?e.children:null==(r=e.children)?void 0:r.default()):"ElOption"===i?s.push(null==(o=e.props)?void 0:o.value):on(e.children)&&a(e.children)}))}return i.length&&a(null==(n=i[0])?void 0:n.children),$m(s,o)||(o=s,r&&(r.states.optionValues=s)),i}}});const XS=Dn({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:Hn,effect:{type:On(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:On(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:vs.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Ec,default:oc},fitInputWidth:Boolean,suffixIcon:{type:Ec,default:Ul},tagType:{...vS.type,default:"info"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,suffixTransition:{type:Boolean,default:!0},placement:{type:On(String),values:Co,default:"bottom-start"},fallbackPlacements:{type:On(Array),default:["bottom-start","top-start","right","left"]},ariaLabel:{type:String,default:void 0}}),QS="ElSelect",eE=(0,n.defineComponent)({name:QS,componentName:QS,components:{ElInput:iS,ElSelectMenu:DS,ElOption:OS,ElOptions:ZS,ElTag:SS,ElScrollbar:kd,ElTooltip:ql,ElIcon:Ou},directives:{ClickOutside:Hv},props:XS,emits:[cu,uu,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:t}){const r=JS(e,t);return(0,n.provide)(TS,(0,n.reactive)({props:e,states:r.states,optionsArray:r.optionsArray,handleOptionSelect:r.handleOptionSelect,onOptionCreate:r.onOptionCreate,onOptionDestroy:r.onOptionDestroy,selectRef:r.selectRef,setSelected:r.setSelected})),{...r}}}),tE=["id","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label"],nE=["textContent"];function rE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-tag"),l=(0,n.resolveComponent)("el-tooltip"),c=(0,n.resolveComponent)("el-icon"),u=(0,n.resolveComponent)("el-option"),d=(0,n.resolveComponent)("el-options"),p=(0,n.resolveComponent)("el-scrollbar"),h=(0,n.resolveComponent)("el-select-menu"),f=(0,n.resolveDirective)("click-outside");return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"selectRef",class:(0,n.normalizeClass)([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),onMouseenter:t[14]||(t[14]=t=>e.states.inputHovering=!0),onMouseleave:t[15]||(t[15]=t=>e.states.inputHovering=!1),onClick:t[16]||(t[16]=(0,n.withModifiers)(((...t)=>e.toggleMenu&&e.toggleMenu(...t)),["stop"]))},[(0,n.createVNode)(l,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,onBeforeShow:e.handleMenuEnter,onHide:t[13]||(t[13]=t=>e.states.isBeforeHide=!1)},{default:(0,n.withCtx)((()=>{var r;return[(0,n.createElementVNode)("div",{ref:"wrapperRef",class:(0,n.normalizeClass)([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)])},[e.$slots.prefix?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,ref:"prefixRef",class:(0,n.normalizeClass)(e.nsSelect.e("prefix"))},[(0,n.renderSlot)(e.$slots,"prefix")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("div",{ref:"selectionRef",class:(0,n.normalizeClass)([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?(0,n.renderSlot)(e.$slots,"tag",{key:0},(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.showTagList,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.getValueKey(t),class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:(0,n.normalizeStyle)(e.tagStyle),onClose:n=>e.deleteTag(n,t)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))},(0,n.toDisplayString)(t.currentLabel),3)])),_:2},1032,["closable","size","type","style","onClose"])],2)))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?((0,n.openBlock)(),(0,n.createBlock)(l,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",{ref:"collapseItemRef",class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{closable:!1,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",style:(0,n.normalizeStyle)(e.collapseTagStyle)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))}," + "+(0,n.toDisplayString)(e.states.selected.length-e.maxCollapseTags),3)])),_:1},8,["size","type","style"])],2)])),content:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",{ref:"tagMenuRef",class:(0,n.normalizeClass)(e.nsSelect.e("selection"))},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.collapseTagList,(t=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.getValueKey(t),class:(0,n.normalizeClass)(e.nsSelect.e("selected-item"))},[(0,n.createVNode)(a,{class:"in-tooltip",closable:!e.selectDisabled&&!t.isDisabled,size:e.collapseTagSize,type:e.tagType,"disable-transitions":"",onClose:n=>e.deleteTag(n,t)},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.nsSelect.e("tags-text"))},(0,n.toDisplayString)(t.currentLabel),3)])),_:2},1032,["closable","size","type","onClose"])],2)))),128))],2)])),_:1},8,["disabled","effect","teleported"])):(0,n.createCommentVNode)("v-if",!0)])):(0,n.createCommentVNode)("v-if",!0),e.selectDisabled?(0,n.createCommentVNode)("v-if",!0):((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[(0,n.withDirectives)((0,n.createElementVNode)("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":t[0]||(t[0]=t=>e.states.inputValue=t),type:"text",class:(0,n.normalizeClass)([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:(0,n.normalizeStyle)(e.inputStyle),role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":(null==(r=e.hoverOption)?void 0:r.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onFocus:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onBlur:t[2]||(t[2]=(...t)=>e.handleBlur&&e.handleBlur(...t)),onKeydown:[t[3]||(t[3]=(0,n.withKeys)((0,n.withModifiers)((t=>e.navigateOptions("next")),["stop","prevent"]),["down"])),t[4]||(t[4]=(0,n.withKeys)((0,n.withModifiers)((t=>e.navigateOptions("prev")),["stop","prevent"]),["up"])),t[5]||(t[5]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop","prevent"]),["esc"])),t[6]||(t[6]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.selectOption&&e.selectOption(...t)),["stop","prevent"]),["enter"])),t[7]||(t[7]=(0,n.withKeys)((0,n.withModifiers)(((...t)=>e.deletePrevTag&&e.deletePrevTag(...t)),["stop"]),["delete"]))],onCompositionstart:t[8]||(t[8]=(...t)=>e.handleCompositionStart&&e.handleCompositionStart(...t)),onCompositionupdate:t[9]||(t[9]=(...t)=>e.handleCompositionUpdate&&e.handleCompositionUpdate(...t)),onCompositionend:t[10]||(t[10]=(...t)=>e.handleCompositionEnd&&e.handleCompositionEnd(...t)),onInput:t[11]||(t[11]=(...t)=>e.onInput&&e.onInput(...t)),onClick:t[12]||(t[12]=(0,n.withModifiers)(((...t)=>e.toggleMenu&&e.toggleMenu(...t)),["stop"]))},null,46,tE),[[n.vModelText,e.states.inputValue]]),e.filterable?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:(0,n.normalizeClass)(e.nsSelect.e("input-calculator")),textContent:(0,n.toDisplayString)(e.states.inputValue)},null,10,nE)):(0,n.createCommentVNode)("v-if",!0)],2)),e.shouldShowPlaceholder?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentPlaceholder),1)],2)):(0,n.createCommentVNode)("v-if",!0)],2),(0,n.createElementVNode)("div",{ref:"suffixRef",class:(0,n.normalizeClass)(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?((0,n.openBlock)(),(0,n.createBlock)(c,{key:0,class:(0,n.normalizeClass)([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.iconComponent)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),e.showClose&&e.clearIcon?((0,n.openBlock)(),(0,n.createBlock)(c,{key:1,class:(0,n.normalizeClass)([e.nsSelect.e("caret"),e.nsSelect.e("icon")]),onClick:e.handleClearClick},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.clearIcon)))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0),e.validateState&&e.validateIcon?((0,n.openBlock)(),(0,n.createBlock)(c,{key:2,class:(0,n.normalizeClass)([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.validateIcon)))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0)],2)],2)]})),content:(0,n.withCtx)((()=>[(0,n.createVNode)(h,{ref:"menuRef"},{default:(0,n.withCtx)((()=>[e.$slots.header?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","header"))},[(0,n.renderSlot)(e.$slots,"header")],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.withDirectives)((0,n.createVNode)(p,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:(0,n.normalizeClass)([e.nsSelect.is("empty",0===e.filteredOptionsCount)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:(0,n.withCtx)((()=>[e.showNewOption?((0,n.openBlock)(),(0,n.createBlock)(u,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(d,null,{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3})])),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[n.vShow,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","loading"))},[(0,n.renderSlot)(e.$slots,"loading")],2)):e.loading||0===e.filteredOptionsCount?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","empty"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.emptyText),1)]))],2)):(0,n.createCommentVNode)("v-if",!0),e.$slots.footer?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:3,class:(0,n.normalizeClass)(e.nsSelect.be("dropdown","footer"))},[(0,n.renderSlot)(e.$slots,"footer")],2)):(0,n.createCommentVNode)("v-if",!0)])),_:3},512)])),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","onBeforeShow"])],34)),[[f,e.handleClickOutside,e.popperRef]])}var oE=Ar(eE,[["render",rE],["__file","select.vue"]]);const iE=(0,n.defineComponent)({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const t=c("select"),r=(0,n.ref)(null),o=(0,n.getCurrentInstance)(),i=(0,n.ref)([]);(0,n.provide)(ES,(0,n.reactive)({...(0,n.toRefs)(e)}));const s=(0,n.computed)((()=>i.value.some((e=>!0===e.visible)))),a=e=>{const t=[];return on(e.children)&&e.children.forEach((e=>{var n,r;e.type&&"ElOption"===e.type.name&&e.component&&e.component.proxy?t.push(e.component.proxy):(null==(n=e.children)?void 0:n.length)?t.push(...a(e)):(null==(r=e.component)?void 0:r.subTree)&&t.push(...a(e.component.subTree))})),t},l=()=>{i.value=a(o.subTree)};return(0,n.onMounted)((()=>{l()})),oa(r,l,{attributes:!0,subtree:!0,childList:!0}),{groupRef:r,visible:s,ns:t}}});function sE(e,t,r,o,i,s){return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("ul",{ref:"groupRef",class:(0,n.normalizeClass)(e.ns.be("group","wrap"))},[(0,n.createElementVNode)("li",{class:(0,n.normalizeClass)(e.ns.be("group","title"))},(0,n.toDisplayString)(e.label),3),(0,n.createElementVNode)("li",null,[(0,n.createElementVNode)("ul",{class:(0,n.normalizeClass)(e.ns.b("group"))},[(0,n.renderSlot)(e.$slots,"default")],2)])],2)),[[n.vShow,e.visible]])}var aE=Ar(iE,[["render",sE],["__file","option-group.vue"]]);const lE=dr(oE,{Option:OS,OptionGroup:aE}),cE=fr(OS),uE=(fr(aE),Dn({type:{type:String,values:["primary","success","warning","info","danger","default"],default:"default"},underline:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},href:{type:String,default:""},target:{type:String,default:"_self"},icon:{type:Ec}})),dE={click:e=>e instanceof MouseEvent},pE=["href","target"],hE=(0,n.defineComponent)({name:"ElLink"}),fE=(0,n.defineComponent)({...hE,props:uE,emits:dE,setup(e,{emit:t}){const r=e,o=c("link"),i=(0,n.computed)((()=>[o.b(),o.m(r.type),o.is("disabled",r.disabled),o.is("underline",r.underline&&!r.disabled)]));function s(e){r.disabled||t("click",e)}return(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("a",{class:(0,n.normalizeClass)((0,n.unref)(i)),href:e.disabled||!e.href?void 0:e.href,target:e.disabled||!e.href?void 0:e.target,onClick:s},[e.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:0},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon)))])),_:1})):(0,n.createCommentVNode)("v-if",!0),e.$slots.default?((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:1,class:(0,n.normalizeClass)((0,n.unref)(o).e("inner"))},[(0,n.renderSlot)(e.$slots,"default")],2)):(0,n.createCommentVNode)("v-if",!0),e.$slots.icon?(0,n.renderSlot)(e.$slots,"icon",{key:2}):(0,n.createCommentVNode)("v-if",!0)],10,pE))}});var gE=Ar(fE,[["__file","link.vue"]]);const mE=dr(gE),vE=Symbol("elDropdown"),yE=Dn({style:{type:On([String,Array,Object])},currentTabId:{type:On(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:On(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:bE,ElCollectionItem:wE,COLLECTION_INJECTION_KEY:CE,COLLECTION_ITEM_INJECTION_KEY:SE}=Dc("RovingFocusGroup"),EE=Symbol("elRovingFocusGroup"),TE=Symbol("elRovingFocusGroupItem"),kE={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},xE=(e,t)=>{if("rtl"!==t)return e;switch(e){case bs.right:return bs.left;case bs.left:return bs.right;default:return e}},NE=(e,t,n)=>{const r=xE(e.key,n);if(("vertical"!==t||![bs.left,bs.right].includes(r))&&("horizontal"!==t||![bs.up,bs.down].includes(r)))return kE[r]},RE=(e,t)=>e.map(((n,r)=>e[(r+t)%e.length])),IE=e=>{const{activeElement:t}=document;for(const n of e){if(n===t)return;if(n.focus(),t!==document.activeElement)return}},_E="currentTabIdChange",OE="rovingFocusGroup.entryFocus",AE={bubbles:!1,cancelable:!0},BE=(0,n.defineComponent)({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:yE,emits:[_E,"entryFocus"],setup(e,{emit:t}){var r;const o=(0,n.ref)(null!=(r=e.currentTabId||e.defaultCurrentTabId)?r:null),i=(0,n.ref)(!1),s=(0,n.ref)(!1),a=(0,n.ref)(null),{getItems:l}=(0,n.inject)(CE,void 0),c=(0,n.computed)((()=>[{outline:"none"},e.style])),u=e=>{t(_E,e)},d=()=>{i.value=!0},p=Ps((t=>{var n;null==(n=e.onMousedown)||n.call(e,t)}),(()=>{s.value=!0})),h=Ps((t=>{var n;null==(n=e.onFocus)||n.call(e,t)}),(e=>{const t=!(0,n.unref)(s),{target:r,currentTarget:a}=e;if(r===a&&t&&!(0,n.unref)(i)){const e=new Event(OE,AE);if(null==a||a.dispatchEvent(e),!e.defaultPrevented){const e=l().filter((e=>e.focusable)),t=e.find((e=>e.active)),r=e.find((e=>e.id===(0,n.unref)(o))),i=[t,r,...e].filter(Boolean),s=i.map((e=>e.ref));IE(s)}}s.value=!1})),f=Ps((t=>{var n;null==(n=e.onBlur)||n.call(e,t)}),(()=>{i.value=!1})),g=(...e)=>{t("entryFocus",...e)};(0,n.provide)(EE,{currentTabbedId:(0,n.readonly)(o),loop:(0,n.toRef)(e,"loop"),tabIndex:(0,n.computed)((()=>(0,n.unref)(i)?-1:0)),rovingFocusGroupRef:a,rovingFocusGroupRootStyle:c,orientation:(0,n.toRef)(e,"orientation"),dir:(0,n.toRef)(e,"dir"),onItemFocus:u,onItemShiftTab:d,onBlur:f,onFocus:h,onMousedown:p}),(0,n.watch)((()=>e.currentTabId),(e=>{o.value=null!=e?e:null})),qs(a,OE,g)}});function DE(e,t,r,o,i,s){return(0,n.renderSlot)(e.$slots,"default")}var PE=Ar(BE,[["render",DE],["__file","roving-focus-group-impl.vue"]]);const HE=(0,n.defineComponent)({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:bE,ElRovingFocusGroupImpl:PE}});function ME(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-roving-focus-group-impl"),l=(0,n.resolveComponent)("el-focus-group-collection");return(0,n.openBlock)(),(0,n.createBlock)(l,null,{default:(0,n.withCtx)((()=>[(0,n.createVNode)(a,(0,n.normalizeProps)((0,n.guardReactiveProps)(e.$attrs)),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16)])),_:3})}var jE=Ar(HE,[["render",ME],["__file","roving-focus-group.vue"]]);const{ButtonGroup:VE}=jC,LE=(0,n.defineComponent)({name:"ElDropdown",components:{ElButton:jC,ElButtonGroup:VE,ElScrollbar:kd,ElDropdownCollection:$c,ElTooltip:ql,ElRovingFocusGroup:jE,ElOnlyChild:ya,ElIcon:Ou,ArrowDown:Ul},props:Pc,emits:["visible-change","click","command"],setup(e,{emit:t}){const r=(0,n.getCurrentInstance)(),o=c("dropdown"),{t:i}=en(),s=(0,n.ref)(),a=(0,n.ref)(),l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.ref)(null),h=(0,n.ref)(!1),f=[bs.enter,bs.space,bs.down],g=(0,n.computed)((()=>({maxHeight:Xc(e.maxHeight)}))),m=(0,n.computed)((()=>[o.m(E.value)])),v=(0,n.computed)((()=>vu(e.trigger))),y=_a().value,b=(0,n.computed)((()=>e.id||y));function w(){C()}function C(){var e;null==(e=l.value)||e.onClose()}function S(){var e;null==(e=l.value)||e.onOpen()}(0,n.watch)([s,v],(([e,t],[n])=>{var r,o,i;(null==(r=null==n?void 0:n.$el)?void 0:r.removeEventListener)&&n.$el.removeEventListener("pointerenter",k),(null==(o=null==e?void 0:e.$el)?void 0:o.removeEventListener)&&e.$el.removeEventListener("pointerenter",k),(null==(i=null==e?void 0:e.$el)?void 0:i.addEventListener)&&t.includes("hover")&&e.$el.addEventListener("pointerenter",k)}),{immediate:!0}),(0,n.onBeforeUnmount)((()=>{var e,t;(null==(t=null==(e=s.value)?void 0:e.$el)?void 0:t.removeEventListener)&&s.value.$el.removeEventListener("pointerenter",k)}));const E=Bm();function T(...e){t("command",...e)}function k(){var e,t;null==(t=null==(e=s.value)?void 0:e.$el)||t.focus()}function x(){}function N(){const e=(0,n.unref)(u);v.value.includes("hover")&&(null==e||e.focus()),p.value=null}function R(e){p.value=e}function I(e){h.value||(e.preventDefault(),e.stopImmediatePropagation())}function _(){t("visible-change",!0)}function O(e){"keydown"===(null==e?void 0:e.type)&&u.value.focus()}function A(){t("visible-change",!1)}(0,n.provide)(vE,{contentRef:u,role:(0,n.computed)((()=>e.role)),triggerId:b,isUsingKeyboard:h,onItemEnter:x,onItemLeave:N}),(0,n.provide)("elDropdown",{instance:r,dropdownSize:E,handleClick:w,commandHandler:T,trigger:(0,n.toRef)(e,"trigger"),hideOnClick:(0,n.toRef)(e,"hideOnClick")});const B=e=>{var t,n;e.preventDefault(),null==(n=null==(t=u.value)?void 0:t.focus)||n.call(t,{preventScroll:!0})},D=e=>{t("click",e)};return{t:i,ns:o,scrollbar:d,wrapStyle:g,dropdownTriggerKls:m,dropdownSize:E,triggerId:b,triggerKeys:f,currentTabId:p,handleCurrentTabIdChange:R,handlerMainButtonClick:D,handleEntryFocus:I,handleClose:C,handleOpen:S,handleBeforeShowTooltip:_,handleShowTooltip:O,handleBeforeHideTooltip:A,onFocusAfterTrapped:B,popperRef:l,contentRef:u,triggeringElementRef:s,referenceElementRef:a}}});function $E(e,t,r,o,i,s){var a;const l=(0,n.resolveComponent)("el-dropdown-collection"),c=(0,n.resolveComponent)("el-roving-focus-group"),u=(0,n.resolveComponent)("el-scrollbar"),d=(0,n.resolveComponent)("el-only-child"),p=(0,n.resolveComponent)("el-tooltip"),h=(0,n.resolveComponent)("el-button"),f=(0,n.resolveComponent)("arrow-down"),g=(0,n.resolveComponent)("el-icon"),m=(0,n.resolveComponent)("el-button-group");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)([e.ns.b(),e.ns.is("disabled",e.disabled)])},[(0,n.createVNode)(p,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,"hide-after":"hover"===e.trigger?e.hideTimeout:0,"manual-mode":!0,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"reference-element":null==(a=e.referenceElementRef)?void 0:a.$el,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-after":"hover"===e.trigger?e.showTimeout:0,"stop-popper-mouse-event":!1,"virtual-ref":e.triggeringElementRef,"virtual-triggering":e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,pure:"",persistent:"",onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},(0,n.createSlots)({content:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange,onEntryFocus:e.handleEntryFocus},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,null,{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"dropdown")])),_:3})])),_:3},8,["loop","current-tab-id","onCurrentTabIdChange","onEntryFocus"])])),_:3},8,["wrap-style","view-class"])])),_:2},[e.splitButton?void 0:{name:"default",fn:(0,n.withCtx)((()=>[(0,n.createVNode)(d,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","tabindex"])]))}]),1032,["role","effect","popper-options","hide-after","placement","popper-class","reference-element","trigger","trigger-keys","trigger-target-el","show-after","virtual-ref","virtual-triggering","disabled","transition","teleported","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?((0,n.openBlock)(),(0,n.createBlock)(m,{key:0},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(h,(0,n.mergeProps)({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["size","type","disabled","tabindex","onClick"]),(0,n.createVNode)(h,(0,n.mergeProps)({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:(0,n.withCtx)((()=>[(0,n.createVNode)(g,{class:(0,n.normalizeClass)(e.ns.e("icon"))},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(f)])),_:1},8,["class"])])),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])])),_:3})):(0,n.createCommentVNode)("v-if",!0)],2)}var qE=Ar(LE,[["render",$E],["__file","dropdown.vue"]]);const FE=(...e)=>t=>{e.forEach((e=>{sn(e)?e(t):e.value=t}))},UE=(0,n.defineComponent)({name:"DropdownItemImpl",components:{ElIcon:Ou},props:Hc,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:t}){const r=c("dropdown"),{role:o}=(0,n.inject)(vE,void 0),{collectionItemRef:i}=(0,n.inject)(Uc,void 0),{collectionItemRef:s}=(0,n.inject)(SE,void 0),{rovingFocusGroupItemRef:a,tabIndex:l,handleFocus:u,handleKeydown:d,handleMousedown:p}=(0,n.inject)(TE,void 0),h=FE(i,s,a),f=(0,n.computed)((()=>"menu"===o.value?"menuitem":"navigation"===o.value?"link":"button")),g=Ps((e=>{const{code:n}=e;if(n===bs.enter||n===bs.space)return e.preventDefault(),e.stopImmediatePropagation(),t("clickimpl",e),!0}),d);return{ns:r,itemRef:h,dataset:{[Bc]:""},role:f,tabIndex:l,handleFocus:u,handleKeydown:g,handleMousedown:p}}}),zE=["aria-disabled","tabindex","role"];function KE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-icon");return(0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,[e.divided?((0,n.openBlock)(),(0,n.createElementBlock)("li",(0,n.mergeProps)({key:0,role:"separator",class:e.ns.bem("menu","item","divided")},e.$attrs),null,16)):(0,n.createCommentVNode)("v-if",!0),(0,n.createElementVNode)("li",(0,n.mergeProps)({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:t[0]||(t[0]=t=>e.$emit("clickimpl",t)),onFocus:t[1]||(t[1]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onKeydown:t[2]||(t[2]=(0,n.withModifiers)(((...t)=>e.handleKeydown&&e.handleKeydown(...t)),["self"])),onMousedown:t[3]||(t[3]=(...t)=>e.handleMousedown&&e.handleMousedown(...t)),onPointermove:t[4]||(t[4]=t=>e.$emit("pointermove",t)),onPointerleave:t[5]||(t[5]=t=>e.$emit("pointerleave",t))}),[e.icon?((0,n.openBlock)(),(0,n.createBlock)(a,{key:0},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.icon)))])),_:1})):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default")],16,zE)],64)}var WE=Ar(UE,[["render",KE],["__file","dropdown-item-impl.vue"]]);const GE=()=>{const e=(0,n.inject)("elDropdown",{}),t=(0,n.computed)((()=>null==e?void 0:e.dropdownSize));return{elDropdown:e,_elDropdownSize:t}},YE=(0,n.defineComponent)({components:{ElRovingFocusCollectionItem:wE},props:{focusable:{type:Boolean,default:!0},active:{type:Boolean,default:!1}},emits:["mousedown","focus","keydown"],setup(e,{emit:t}){const{currentTabbedId:r,loop:o,onItemFocus:i,onItemShiftTab:s}=(0,n.inject)(EE,void 0),{getItems:a}=(0,n.inject)(CE,void 0),l=_a(),c=(0,n.ref)(null),u=Ps((e=>{t("mousedown",e)}),(t=>{e.focusable?i((0,n.unref)(l)):t.preventDefault()})),d=Ps((e=>{t("focus",e)}),(()=>{i((0,n.unref)(l))})),p=Ps((e=>{t("keydown",e)}),(e=>{const{key:t,shiftKey:r,target:i,currentTarget:l}=e;if(t===bs.tab&&r)return void s();if(i!==l)return;const c=NE(e);if(c){e.preventDefault();const t=a().filter((e=>e.focusable));let r=t.map((e=>e.ref));switch(c){case"last":r.reverse();break;case"prev":case"next":{"prev"===c&&r.reverse();const e=r.indexOf(l);r=o.value?RE(r,e+1):r.slice(e+1);break}default:break}(0,n.nextTick)((()=>{IE(r)}))}})),h=(0,n.computed)((()=>r.value===(0,n.unref)(l)));return(0,n.provide)(TE,{rovingFocusGroupItemRef:c,tabIndex:(0,n.computed)((()=>(0,n.unref)(h)?0:-1)),handleMousedown:u,handleFocus:d,handleKeydown:p}),{id:l,handleKeydown:p,handleFocus:d,handleMousedown:u}}});function JE(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-roving-focus-collection-item");return(0,n.openBlock)(),(0,n.createBlock)(a,{id:e.id,focusable:e.focusable,active:e.active},{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},8,["id","focusable","active"])}var ZE=Ar(YE,[["render",JE],["__file","roving-focus-item.vue"]]);const XE=(0,n.defineComponent)({name:"ElDropdownItem",components:{ElDropdownCollectionItem:qc,ElRovingFocusItem:ZE,ElDropdownItemImpl:WE},inheritAttrs:!1,props:Hc,emits:["pointermove","pointerleave","click"],setup(e,{emit:t,attrs:r}){const{elDropdown:o}=GE(),i=(0,n.getCurrentInstance)(),s=(0,n.ref)(null),a=(0,n.computed)((()=>{var e,t;return null!=(t=null==(e=(0,n.unref)(s))?void 0:e.textContent)?t:""})),{onItemEnter:l,onItemLeave:c}=(0,n.inject)(vE,void 0),u=Ps((e=>(t("pointermove",e),e.defaultPrevented)),Hs((t=>{if(e.disabled)return void c(t);const n=t.currentTarget;n===document.activeElement||n.contains(document.activeElement)||(l(t),t.defaultPrevented||null==n||n.focus())}))),d=Ps((e=>(t("pointerleave",e),e.defaultPrevented)),Hs((e=>{c(e)}))),p=Ps((n=>{if(!e.disabled)return t("click",n),"keydown"!==n.type&&n.defaultPrevented}),(t=>{var n,r,s;e.disabled?t.stopImmediatePropagation():((null==(n=null==o?void 0:o.hideOnClick)?void 0:n.value)&&(null==(r=o.handleClick)||r.call(o)),null==(s=o.commandHandler)||s.call(o,e.command,i,t))})),h=(0,n.computed)((()=>({...e,...r})));return{handleClick:p,handlePointerMove:u,handlePointerLeave:d,textContent:a,propsAndAttrs:h}}});function QE(e,t,r,o,i,s){var a;const l=(0,n.resolveComponent)("el-dropdown-item-impl"),c=(0,n.resolveComponent)("el-roving-focus-item"),u=(0,n.resolveComponent)("el-dropdown-collection-item");return(0,n.openBlock)(),(0,n.createBlock)(u,{disabled:e.disabled,"text-value":null!=(a=e.textValue)?a:e.textContent},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{focusable:!e.disabled},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(l,(0,n.mergeProps)(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),{default:(0,n.withCtx)((()=>[(0,n.renderSlot)(e.$slots,"default")])),_:3},16,["onPointerleave","onPointermove","onClickimpl"])])),_:3},8,["focusable"])])),_:3},8,["disabled","text-value"])}var eT=Ar(XE,[["render",QE],["__file","dropdown-item.vue"]]);const tT=(0,n.defineComponent)({name:"ElDropdownMenu",props:Mc,setup(e){const t=c("dropdown"),{_elDropdownSize:r}=GE(),o=r.value,{focusTrapRef:i,onKeydown:s}=(0,n.inject)(nl,void 0),{contentRef:a,role:l,triggerId:u}=(0,n.inject)(vE,void 0),{collectionRef:d,getItems:p}=(0,n.inject)(Fc,void 0),{rovingFocusGroupRef:h,rovingFocusGroupRootStyle:f,tabIndex:g,onBlur:m,onFocus:v,onMousedown:y}=(0,n.inject)(EE,void 0),{collectionRef:b}=(0,n.inject)(CE,void 0),w=(0,n.computed)((()=>[t.b("menu"),t.bm("menu",null==o?void 0:o.value)])),C=FE(a,d,i,h,b),S=Ps((t=>{var n;null==(n=e.onKeydown)||n.call(e,t)}),(e=>{const{currentTarget:t,code:r,target:o}=e;t.contains(o);if(bs.tab===r&&e.stopImmediatePropagation(),e.preventDefault(),o!==(0,n.unref)(a))return;if(!Lc.includes(r))return;const i=p().filter((e=>!e.disabled)),s=i.map((e=>e.ref));Vc.includes(r)&&s.reverse(),IE(s)})),E=e=>{S(e),s(e)};return{size:o,rovingFocusGroupRootStyle:f,tabIndex:g,dropdownKls:w,role:l,triggerId:u,dropdownListWrapperRef:C,handleKeydown:E,onBlur:m,onFocus:v,onMousedown:y}}}),nT=["role","aria-labelledby"];function rT(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("ul",{ref:e.dropdownListWrapperRef,class:(0,n.normalizeClass)(e.dropdownKls),style:(0,n.normalizeStyle)(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onBlur:t[0]||(t[0]=(...t)=>e.onBlur&&e.onBlur(...t)),onFocus:t[1]||(t[1]=(...t)=>e.onFocus&&e.onFocus(...t)),onKeydown:t[2]||(t[2]=(0,n.withModifiers)(((...t)=>e.handleKeydown&&e.handleKeydown(...t)),["self"])),onMousedown:t[3]||(t[3]=(0,n.withModifiers)(((...t)=>e.onMousedown&&e.onMousedown(...t)),["self"]))},[(0,n.renderSlot)(e.$slots,"default")],46,nT)}var oT=Ar(tT,[["render",rT],["__file","dropdown-menu.vue"]]);const iT=dr(qE,{DropdownItem:eT,DropdownMenu:oT}),sT=fr(eT),aT=fr(oT),lT=e=>((0,n.pushScopeId)("data-v-168ff1fe"),e=e(),(0,n.popScopeId)(),e),cT={class:"peerStatus",drag:""},uT={class:"login-type"},dT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-fangxiang-you-mian-xiao"},null,-1))),pT={class:"status-name"},hT=["title"],fT={class:"wtue wtue-fangxiang-xia-mian-xiao"},gT={class:"status-name-text ue-call-variable"},mT={class:"dialState-box"},vT={class:"call-btn-right"},yT={class:"customer-info",drag:""},bT={class:"customer-item"},wT={class:"customer-name"},CT={class:"time"},ST={class:"customer-item"},ET={class:"region"},TT={class:"quick-operation-box drag",drag:""},kT={class:"quick-btn"},xT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-guaji1"},null,-1))),NT=[xT],RT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting"},null,-1))),IT=[RT],_T={key:0,class:"error"},OT={class:"opacity80"},AT=(0,n.createTextVNode)("刷新状态"),BT={class:"oprate-wrap link-hangup"},DT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-guaji1 right8 font12"},null,-1))),PT=(0,n.createTextVNode)("挂断 "),HT=[DT,PT],MT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting right8 font12"},null,-1))),jT=(0,n.createTextVNode)("接听 "),VT=[MT,jT],LT={class:"oprate-wrap link-oprate"},$T=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),qT=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),FT=[$T,qT],UT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),zT=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),KT=[UT,zT],WT={class:"oprate-wrap link-oprate"},GT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-baochi"},null,-1))),YT=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"保持",-1))),JT=[GT,YT],ZT=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaobaochi"},null,-1))),XT=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"取消保持",-1))),QT=[ZT,XT],ek=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jingyin"},null,-1))),tk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"静音",-1))),nk=[ek,tk],rk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaojingyin"},null,-1))),ok=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"取消静音",-1))),ik=[rk,ok],sk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jiehui"},null,-1))),ak=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"接回",-1))),lk=[sk,ak],ck=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zixun"},null,-1))),uk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"咨询",-1))),dk=[ck,uk],pk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaozixun"},null,-1))),hk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"取消咨询",-1))),fk=[pk,hk],gk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaozixun"},null,-1))),mk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"取消咨询",-1))),vk=[gk,mk],yk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zixunzhuanyi"},null,-1))),bk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"咨询转移",-1))),wk=[yk,bk],Ck=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-sanfangtonghua"},null,-1))),Sk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"三方通话",-1))),Ek=[Ck,Sk],Tk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),kk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"转接",-1))),xk=[Tk,kk],Nk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-manyidu"},null,-1))),Rk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"满意度",-1))),Ik=[Nk,Rk],_k=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-jianpan"},null,-1))),Ok=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"键盘",-1))),Ak=[_k,Ok],Bk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-quxiaojianpan"},null,-1))),Dk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"取消键盘",-1))),Pk=[Bk,Dk],Hk={key:1},Mk=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),jk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),Vk=[Mk,jk],Lk={key:2},$k=lT((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-a-jiantou-zuo-line"},null,-1))),qk=lT((()=>(0,n.createElementVNode)("span",{class:"text"},"返回",-1))),Fk=[$k,qk],Uk={key:3,class:"dial"},zk={class:"dial-input"},Kk=lT((()=>(0,n.createElementVNode)("use",{"xlink:href":"#wtue-jianpanshanchu"},null,-1))),Wk=[Kk],Gk={class:"call-btn",style:{color:"rgb(28, 146, 233)","font-weight":"600","font-size":"16px"}},Yk={key:0,class:"dial-box"},Jk=["onClick"],Zk={key:4,class:"setting"},Xk=lT((()=>(0,n.createElementVNode)("div",{class:"label"},"通话设置",-1))),Qk=(0,n.createTextVNode)(" 接听方式 "),ex=(0,n.createTextVNode)("自动接听"),tx={key:1},nx=(0,n.createTextVNode)(" 振铃 "),rx=(0,n.createTextVNode)(" 后接听 "),ox=(0,n.createTextVNode)(" SIP号 "),ix={class:"footer"},sx=(0,n.createTextVNode)("取消"),ax=(0,n.createTextVNode)("确定");function lx(e,t,r,o,i,s){const a=sT,l=aT,c=iT,u=(0,n.resolveComponent)("phoneBarTimer"),d=mE,p=(0,n.resolveComponent)("transferOprate"),h=(0,n.resolveComponent)("consuleOprate"),f=iS,g=cE,m=lE,v=(0,n.resolveComponent)("formItem"),y=Av,b=mS,w=(0,n.resolveComponent)("input-suffix"),C=jC,S=zw,E=(0,n.resolveComponent)("networkDelay"),T=Nr,k=(0,n.resolveDirective)("int"),x=(0,n.resolveDirective)("move");return(0,n.openBlock)(),(0,n.createElementBlock)("div",null,[(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{class:(0,n.normalizeClass)({"red-border":"busy"==e.stateType,"success-border":"free"==e.stateType,"phone-bar":!0,"ue-call-variable":!0})},[(0,n.withDirectives)((0,n.createElementVNode)("div",cT,[(0,n.withDirectives)((0,n.createElementVNode)("div",uT,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["middle pointer",{"red-border":"busy"==e.stateType,"success-border":"free"==e.stateType}]),onClick:t[0]||(t[0]=(0,n.withModifiers)(((...t)=>e.goToSetting&&e.goToSetting(...t)),["stop"]))},[(0,n.createTextVNode)((0,n.toDisplayString)(e.loginTypeMap[e.loginType])+" ",1),dT],2)],512),[[n.vShow,!e.showConfig&&!e.disabledSwitch]]),(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["peerStatus-center",e.stateType])},[(0,n.createVNode)(c,{class:"pointer",onCommand:e.updateAgentStatus,trigger:"click",disabled:e.disabledSwitch,style:{"min-width":"55px"}},{dropdown:(0,n.withCtx)((()=>[(0,n.createVNode)(l,{"visible-arrow":!1,class:"cep-dropdown-menu phoneMenu"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.agentStatusList,(t=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:t.number,command:t.number,class:(0,n.normalizeClass)({"hide-dropdown-item":t.name===e.currentStatusName})},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",gT,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["status",{idle:0===t.number}])},null,2),(0,n.createTextVNode)(" "+(0,n.toDisplayString)(t.name),1)])])),_:2},1032,["command","class"])))),128))])),_:1})])),default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("span",pT,[(0,n.createElementVNode)("span",{class:"name-ellipsis",title:e.currentStatusName},(0,n.toDisplayString)(e.currentStatusName),9,hT),(0,n.withDirectives)((0,n.createElementVNode)("i",fT,null,512),[[n.vShow,!e.disabledSwitch]]),(0,n.withDirectives)((0,n.createElementVNode)("span",null,(0,n.toDisplayString)(": "+e.callingNumber),513),[[n.vShow,e.disabledSwitch&&e.callingNumber]])])])),_:1},8,["onCommand","disabled"]),(0,n.createElementVNode)("div",mT,[(0,n.createVNode)(u,{class:"pointer",ref:"phoneBarPeerTimeRef"},null,512),e.showDial&&!e.hiddenOprate?((0,n.openBlock)(),(0,n.createElementBlock)("i",{key:0,class:"icon wtue wtue-kuozhan-shouqi-xian",onClick:t[1]||(t[1]=(...t)=>e.toggleDialState&&e.toggleDialState(...t))})):(0,n.createCommentVNode)("",!0),e.showDial||e.hiddenOprate?(0,n.createCommentVNode)("",!0):((0,n.openBlock)(),(0,n.createElementBlock)("i",{key:1,onClick:t[2]||(t[2]=(...t)=>e.toggleDialState&&e.toggleDialState(...t)),class:"icon wtue wtue-a-hujiaojieting"}))])],2),(0,n.createElementVNode)("div",vT,[(0,n.createElementVNode)("i",{class:"wtue wtue-hujiaohuojieting success-back pointer",onClick:t[3]||(t[3]=(0,n.withModifiers)((t=>e.showInput=!e.showInput),["stop"]))})])],512),[[n.vShow,!e.disabledSwitch]]),(0,n.withDirectives)((0,n.createElementVNode)("div",yT,[(0,n.createElementVNode)("div",bT,[(0,n.createElementVNode)("div",wT,(0,n.toDisplayString)(e.customerInfo.name||e.customerInfo.number),1),(0,n.createElementVNode)("div",CT,[(0,n.createVNode)(u,{ref:"phoneBarStatusTimeRef"},null,512)])]),(0,n.createElementVNode)("div",ST,[(0,n.createElementVNode)("div",ET,(0,n.toDisplayString)(e.customerInfo.place||"未知地点"),1),(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"tag"},(0,n.toDisplayString)(e.customerInfo.tag||""),513),[[n.vShow,e.customerInfo.tag]])])],512),[[n.vShow,e.disabledSwitch&&!e.quickState]]),(0,n.withDirectives)((0,n.createElementVNode)("div",TT,[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(["quick-state",e.stateType]),drag:""},[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(e.currentStatusName),1),(0,n.createElementVNode)("span",null,[(0,n.createVNode)(u,{ref:"phoneBarQuickStatusTimeRef"},null,512),(0,n.createElementVNode)("i",{class:"wtue wtue-kuozhan-zhankai-xian",onClick:t[4]||(t[4]=t=>e.switchQuickState(!1))})])],2),(0,n.createElementVNode)("div",kT,[(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"btn-item hangup",onClick:t[5]||(t[5]=(0,n.withModifiers)(((...t)=>e.hangup&&e.hangup(...t)),["stop"]))},NT,512),[[n.vShow,e.isVisibleBtn("hangup")]]),(0,n.withDirectives)((0,n.createElementVNode)("div",{class:"btn-item accept",onClick:t[6]||(t[6]=(0,n.withModifiers)(((...t)=>e.accept&&e.accept(...t)),["stop"]))},IT,512),[[n.vShow,e.isVisibleBtn("answer")]])])],512),[[n.vShow,e.disabledSwitch]]),e.errorObj.isError?((0,n.openBlock)(),(0,n.createElementBlock)("div",_T,[(0,n.createElementVNode)("div",OT,(0,n.toDisplayString)(e.errorObj.message),1),(0,n.createVNode)(d,{style:{"margin-top":"8px"},underline:!1,type:"primary",onClick:(0,n.withModifiers)(e.connect,["stop"])},{default:(0,n.withCtx)((()=>[AT])),_:1},8,["onClick"])])):(0,n.createCommentVNode)("",!0),(0,n.withDirectives)((0,n.createElementVNode)("div",BT,[e.isVisibleBtn("hangup")&&e.showHangupBtn?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn error-back pointer hangup-btn",onClick:t[7]||(t[7]=(0,n.withModifiers)(((...t)=>e.hangup&&e.hangup(...t)),["stop"]))},HT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("answer")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn success-back pointer",onClick:t[8]||(t[8]=(0,n.withModifiers)(((...t)=>e.accept&&e.accept(...t)),["stop"])),style:{"min-width":"200px"}},VT)):(0,n.createCommentVNode)("",!0)],512),[[n.vShow,e.disabledSwitch&&!e.quickState]]),(0,n.createElementVNode)("div",null,[(0,n.createElementVNode)("div",LT,[e.isVisibleBtn("concul")&&e.consulSelect?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn btn-middle pointer bak-btn",onClick:t[9]||(t[9]=(0,n.withModifiers)((t=>e.setConsulState(!1)),["stop"]))},FT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("transfer")&&e.transferState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn btn-middle pointer bak-btn",onClick:t[10]||(t[10]=(0,n.withModifiers)((t=>e.setTransferState(!1)),["stop"]))},KT)):(0,n.createCommentVNode)("",!0)]),(0,n.createElementVNode)("div",WT,[e.isVisibleBtn("hold")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:"btn btn-middle pointer",onClick:t[11]||(t[11]=(0,n.withModifiers)((t=>e.holdOrUnHold("1")),["stop"]))},JT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("holdcancel")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:1,class:"btn btn-middle pointer flex1",onClick:t[12]||(t[12]=(0,n.withModifiers)((t=>e.holdOrUnHold("2")),["stop"]))},QT)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("mute")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:2,class:"btn btn-middle pointer",onClick:t[13]||(t[13]=(0,n.withModifiers)((t=>e.muteOrUnMute("1")),["stop"]))},nk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("mutecancel")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:3,class:"btn btn-middle pointer flex1",onClick:t[14]||(t[14]=(0,n.withModifiers)((t=>e.muteOrUnMute("2")),["stop"]))},ik)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("takeback")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:4,class:"btn btn-middle pointer",onClick:t[15]||(t[15]=(0,n.withModifiers)(((...t)=>e.resumeConsult&&e.resumeConsult(...t)),["stop"]))},lk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("concul")&&!e.consulSelect?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:5,class:"btn btn-middle pointer",onClick:t[16]||(t[16]=(0,n.withModifiers)((t=>e.setConsulState(!0)),["stop"]))},dk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("cancelconcul")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:6,class:"btn btn-middle pointer",onClick:t[17]||(t[17]=(0,n.withModifiers)(((...t)=>e.cancelConsult&&e.cancelConsult(...t)),["stop"]))},fk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("endconsul")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:7,class:"btn btn-middle pointer",onClick:t[18]||(t[18]=(0,n.withModifiers)(((...t)=>e.stopConsult&&e.stopConsult(...t)),["stop"]))},vk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("concultransfer")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:8,class:"btn btn-middle pointer",onClick:t[19]||(t[19]=(0,n.withModifiers)(((...t)=>e.consultTransfer&&e.consultTransfer(...t)),["stop"]))},wk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("threepartycall")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:9,class:"btn btn-middle pointer",onClick:t[20]||(t[20]=(0,n.withModifiers)(((...t)=>e.threeWayCall&&e.threeWayCall(...t)),["stop"]))},Ek)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("transfer")&&!e.transferState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:10,class:"btn btn-middle pointer",onClick:t[21]||(t[21]=(0,n.withModifiers)((t=>e.setTransferState(!0)),["stop"]))},xk)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("satisfaction")?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:11,class:"btn btn-middle pointer",onClick:t[22]||(t[22]=(0,n.withModifiers)(((...t)=>e.satisfaction&&e.satisfaction(...t)),["stop"]))},Ik)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("key")&&e.webrtcKeyState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:12,class:"btn btn-middle pointer",onClick:t[23]||(t[23]=(0,n.withModifiers)((t=>e.setWebrtcKeyState(!1)),["stop"]))},Ak)):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("key")&&!e.webrtcKeyState?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:13,class:"btn btn-middle pointer",onClick:t[24]||(t[24]=(0,n.withModifiers)((t=>e.setWebrtcKeyState(!0)),["stop"]))},Pk)):(0,n.createCommentVNode)("",!0)])]),e.isVisibleBtn("transferoprate")?((0,n.openBlock)(),(0,n.createElementBlock)("div",Hk,[(0,n.createElementVNode)("div",{class:"btn btn-middle pointer bak-btn",onClick:t[25]||(t[25]=(0,n.withModifiers)((t=>e.setTransferState(!1)),["stop"]))},Vk),(0,n.createVNode)(p)])):(0,n.createCommentVNode)("",!0),e.isVisibleBtn("consuleoprate")?((0,n.openBlock)(),(0,n.createElementBlock)("div",Lk,[(0,n.createElementVNode)("div",{class:"btn btn-middle pointer bak-btn",onClick:t[26]||(t[26]=(0,n.withModifiers)((t=>e.setConsulState(!1)),["stop"]))},Fk),(0,n.createVNode)(h)])):(0,n.createCommentVNode)("",!0),!e.showConfig&&!e.disabledSwitch||e.isVisibleBtn("key")&&!e.webrtcKeyState&&e.disabledSwitch?((0,n.openBlock)(),(0,n.createElementBlock)("div",Uk,[(0,n.withDirectives)((0,n.createElementVNode)("div",zk,[(0,n.createVNode)(f,{class:"input",type:"",placeholder:e.showKeyboardPlaceholder?e.defaultKeyboardPlaceholder:"",ref:"input",clearable:"",modelValue:e.dialoutNumber,"onUpdate:modelValue":e.inputChange,onKeyup:(0,n.withKeys)(e.keyDowndialout,["enter"]),onFocus:t[27]||(t[27]=t=>e.showKeyboardPlaceholder=!1),onBlur:t[28]||(t[28]=t=>e.showKeyboardPlaceholder=!0)},null,8,["placeholder","modelValue","onUpdate:modelValue","onKeyup"]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("svg",{class:"ue-num-keyboard back pointer",onClick:t[29]||(t[29]=(0,n.withModifiers)(((...t)=>e.deleteNum&&e.deleteNum(...t)),["stop"]))},Wk,512)),[[n.vShow,e.isVisibleBtn("key")]]),(0,n.createElementVNode)("div",{style:(0,n.normalizeStyle)([{color:e.showNum?"rgb(28, 146, 233)":"rgb(140, 140, 140)"},{"font-weight":"600","font-size":"16px"}])},[(0,n.createElementVNode)("i",{class:"wtue wtue-jianpan pointer",onClick:t[30]||(t[30]=(0,n.withModifiers)((t=>e.showNum=!e.showNum),["stop"]))})],4),(0,n.createElementVNode)("div",Gk,[(0,n.createElementVNode)("i",{class:(0,n.normalizeClass)(["wtue wtue-hujiaohuojieting success-back pointer",{"dialout-disabled":!(e.isVisibleBtn("dialout")&&!e.isVisibleBtn("key"))}]),onClick:t[31]||(t[31]=(0,n.withModifiers)((t=>e.dialout(e.dialoutNumber,e.isVisibleBtn("dialout")&&!e.isVisibleBtn("key"))),["stop"]))},null,2)])],512),[[n.vShow,e.showInput]]),e.showNum&&e.showInput?((0,n.openBlock)(),(0,n.createElementBlock)("div",Yk,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.keyList,((t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)("span",{key:r,class:"ue-num-keyboard pointer",onClick:(0,n.withModifiers)((n=>e.sendDTMF(t)),["stop"])},(0,n.toDisplayString)(t),9,Jk)))),128)),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer star",onClick:t[32]||(t[32]=(0,n.withModifiers)((t=>e.sendDTMF("*")),["stop"]))},"*"),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer",onClick:t[33]||(t[33]=(0,n.withModifiers)((t=>e.sendDTMF("0")),["stop"]))},"0"),(0,n.createElementVNode)("span",{class:"ue-num-keyboard pointer",onClick:t[34]||(t[34]=(0,n.withModifiers)((t=>e.sendDTMF("#")),["stop"]))},"#")])):(0,n.createCommentVNode)("",!0)])):(0,n.createCommentVNode)("",!0),e.showConfig&&!e.hiddenOprate?((0,n.openBlock)(),(0,n.createElementBlock)("div",Zk,[Xk,(0,n.createVNode)(v,{class:"width-full type"},{field:(0,n.withCtx)((()=>[(0,n.createVNode)(m,{modelValue:e.callConfig.loginType,"onUpdate:modelValue":t[35]||(t[35]=t=>e.callConfig.loginType=t),"popper-append-to-body":!0,class:"width-full","popper-class":"accept-select",onChange:e.changeType},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.loginTypeList,(e=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.value,value:e.value,label:e.label},null,8,["value","label"])))),128))])),_:1},8,["modelValue","onChange"])])),default:(0,n.withCtx)((()=>[Qk])),_:1}),"WEBRTC"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createBlock)(y,{key:0,modelValue:e.callConfig.autoAnswer,"onUpdate:modelValue":t[36]||(t[36]=t=>e.callConfig.autoAnswer=t)},{default:(0,n.withCtx)((()=>[ex])),_:1},8,["modelValue"])):(0,n.createCommentVNode)("",!0),e.callConfig.autoAnswer&&"WEBRTC"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createElementBlock)("div",tx,[nx,(0,n.createVNode)(w,{suffix:"秒"},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createVNode)(b,{style:{width:"120px"},controls:!1,modelValue:e.callConfig.autoAnswerTime,"onUpdate:modelValue":t[37]||(t[37]=t=>e.callConfig.autoAnswerTime=t),min:0,"controls-position":"right",size:"middle"},null,8,["modelValue"]),[[k]])])),_:1}),rx])):(0,n.createCommentVNode)("",!0),"SIP"===e.callConfig.loginType?((0,n.openBlock)(),(0,n.createBlock)(v,{key:2,class:"width-full type"},{field:(0,n.withCtx)((()=>[(0,n.createVNode)(m,{placeholder:"请选择sip号",modelValue:e.callConfig.sipNumber,"onUpdate:modelValue":t[38]||(t[38]=t=>e.callConfig.sipNumber=t),clearable:"",class:"width-full","popper-append-to-body":!1},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.sipNumberList,(e=>((0,n.openBlock)(),(0,n.createBlock)(g,{key:e.id,value:e.number,label:e.number},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),default:(0,n.withCtx)((()=>[ox])),_:1})):(0,n.createCommentVNode)("",!0),(0,n.createElementVNode)("div",ix,[(0,n.createVNode)(C,{class:"cancel",onClick:(0,n.withModifiers)(e.setBack,["stop"])},{default:(0,n.withCtx)((()=>[sx])),_:1},8,["onClick"]),(0,n.createVNode)(C,{type:"primary",onClick:(0,n.withModifiers)(e.updateLoginType,["stop"])},{default:(0,n.withCtx)((()=>[ax])),_:1},8,["onClick"])])])):(0,n.createCommentVNode)("",!0)],2)),[[x,{top:150,left:90}]]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",null,[e.callQueueBar?((0,n.openBlock)(),(0,n.createBlock)(S,{key:0,callQueueBarMsg:e.callQueueBarMsg},null,8,["callQueueBarMsg"])):(0,n.createCommentVNode)("",!0)])),[[x,{top:157,left:490}]]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",null,[e.networkDelayBar?((0,n.openBlock)(),(0,n.createBlock)(E,{key:0,networkdelayBarMsg:e.networkdelayBarMsg},null,8,["networkdelayBarMsg"])):(0,n.createCommentVNode)("",!0)])),[[x,{top:157,left:620}]]),(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",null,[e.openNlsTranslationBar?((0,n.openBlock)(),(0,n.createBlock)(T,{key:0,openNlsTranslationBarMsg:e.openNlsTranslationBarMsg},null,8,["openNlsTranslationBarMsg"])):(0,n.createCommentVNode)("",!0)])),[[x,{top:157,left:680}]])])}function cx(e,t,r,o,i,s){return(0,n.openBlock)(),(0,n.createElementBlock)("span",null,(0,n.toDisplayString)(e.timing),1)}var ux=(0,n.defineComponent)({name:"phoneBarTimes",components:{},setup(){const e=(0,n.reactive)({phoneBarTimer:"",timing:"00:00:00",currentTime:0});(0,n.onBeforeUnmount)((()=>{t.clearPhonebarTimer()}));const t=(0,n.reactive)({timerTypeChange(n){e.currentTime=parseInt(n.statusTime,10)||0,"timing"===n.timeType?t.timingInterval():"countDown"===n.timeType&&t.countDownInterval()},timingInterval(){null!==e.phoneBarTimer&&(window.clearInterval(e.phoneBarTimer),e.phoneBarTimer=window.setInterval((()=>{e.timing=t.ctiUiGetTimer(e.currentTime),e.currentTime=e.currentTime-0+1}),1e3))},countDownInterval(){let n=30;n=parseInt(n,10)-e.currentTime||0,n<1||(null!==e.phoneBarTimer&&window.clearInterval(e.phoneBarTimer),e.phoneBarTimer=window.setInterval((()=>{n--,n<=1&&(e.currentTime=0),e.timing=t.ctiUiAutoBusyTime(n)}),1e3))},ctiUiGetTimer(e){let t,n;e=1+parseInt(e,10),n=e/3600,n=parseInt(n,10),t=e%3600/60,t=parseInt(t,10);const r=e%3600%60;let o=n<10?"0"+n:n;return o+=":",o+=t<10?"0"+t:t,o+=":",o+=r<10?"0"+r:r,o},ctiUiAutoBusyTime(e){let t,n,r;e>=3600?(r=e/3600,r=parseInt(r,10),t=(e-3600*r)/60,t=parseInt(t,10),n=e-3600*r-60*t):e>=60&&e<3600?(r="0",t=e/60,t=parseInt(t,10),n=e-60*t):e>0&&e<60?(r="0",t="0",n=e):e<=0&&(r="0",t="0",n="0"),r<0&&(r=0),t<0&&(t=0),n<0&&(n=0);const o=(r<10?"0"+r:r)+":"+(t<10?"0"+t:t)+":"+(n<10?"0"+n:n);return o},clearPhonebarTimer(){window.clearInterval(e.phoneBarTimer)}});return{...(0,n.toRefs)(e),...(0,n.toRefs)(t)}}});const dx=(0,Fw.A)(ux,[["render",cx]]);var px=dx;const hx={class:"border-form-item"},fx={class:"label"};function gx(e,t){return(0,n.openBlock)(),(0,n.createElementBlock)("div",hx,[(0,n.createElementVNode)("span",fx,[(0,n.renderSlot)(e.$slots,"default",{},void 0,!0)]),(0,n.renderSlot)(e.$slots,"field",{},void 0,!0)])}const mx={},vx=(0,Fw.A)(mx,[["render",gx],["__scopeId","data-v-7ac60f29"]]);var yx=vx;const bx={mounted(e,t){const n=t&&t.value&&t.value.left?t.value.left:0,r=t&&t.value&&t.value.top?t.value.top:0;e.style.top=`${r}px`,e.style.left=`${n}px`;const o=e,i=t.modifiers?.boundary??!1,s=(t.value,"false"!==e.getAttribute("dht-move-x")),a="false"!==e.getAttribute("dht-move-y");o.style.position="fixed";const l=o.parentNode,c=l.offsetWidth,u=l.offsetHeight,d=o.offsetWidth,p=2*o.offsetHeight,h=c-d+o.offsetLeft,f=u-p+o.offsetHeight,g=0,m=0;o.onmousedown=e=>{e.preventDefault(),o.style.cursor="move";const t=e.x-o.offsetLeft,n=e.y-o.offsetTop;document.onmousemove=e=>{let r=e.clientX-t,l=e.clientY-n,c=0,u=0;i&&(r=r>h?h:r<g?g:r,l=l>f?f:l<m?m:l,c=Number((r/h*100).toFixed(2)),u=Number((l/f*100).toFixed(2))),s&&(r<=0&&(r=0),o.style.left=r+"px"),a&&(l<=0&&(l=0),o.style.top=l+"px"),a&&(o.style.top=l+"px")},document.onmouseup=e=>{document.onmousemove=null,document.onmouseup=null,o.style.cursor="default"}}}};var wx=bx;const Cx=e=>{let t;if("object"===typeof e)if(null===e)t=null;else if(e instanceof Date)t=e;else if(e instanceof Array){t=[];for(let n=0,r=e.length;n<r;n++)t.push(Cx(e[n]))}else{t={};for(const n in e)t[n]=Cx(e[n])}else t=e;return t},Sx=["success","info","warning","error"],Ex=lu({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:Yr?document.body:void 0}),Tx=Dn({customClass:{type:String,default:Ex.customClass},center:{type:Boolean,default:Ex.center},dangerouslyUseHTMLString:{type:Boolean,default:Ex.dangerouslyUseHTMLString},duration:{type:Number,default:Ex.duration},icon:{type:Ec,default:Ex.icon},id:{type:String,default:Ex.id},message:{type:On([String,Object,Function]),default:Ex.message},onClose:{type:On(Function),required:!1},showClose:{type:Boolean,default:Ex.showClose},type:{type:String,values:Sx,default:Ex.type},offset:{type:Number,default:Ex.offset},zIndex:{type:Number,default:Ex.zIndex},grouping:{type:Boolean,default:Ex.grouping},repeatNum:{type:Number,default:Ex.repeatNum}}),kx={destroy:()=>!0},xx=(0,n.shallowReactive)([]),Nx=e=>{const t=xx.findIndex((t=>t.id===e)),n=xx[t];let r;return t>0&&(r=xx[t-1]),{current:n,prev:r}},Rx=e=>{const{prev:t}=Nx(e);return t?t.vm.exposed.bottom.value:0},Ix=(e,t)=>{const n=xx.findIndex((t=>t.id===e));return n>0?20:t},_x=["id"],Ox=["innerHTML"],Ax=(0,n.defineComponent)({name:"ElMessage"}),Bx=(0,n.defineComponent)({...Ax,props:Tx,emits:kx,setup(e,{expose:t}){const r=e,{Close:o}=Tc,{ns:i,zIndex:s}=ir("message"),{currentZIndex:a,nextZIndex:l}=s,c=(0,n.ref)(),u=(0,n.ref)(!1),d=(0,n.ref)(0);let p;const h=(0,n.computed)((()=>r.type?"error"===r.type?"danger":r.type:"info")),f=(0,n.computed)((()=>{const e=r.type;return{[i.bm("icon",e)]:e&&kc[e]}})),g=(0,n.computed)((()=>r.icon||kc[r.type]||"")),m=(0,n.computed)((()=>Rx(r.id))),v=(0,n.computed)((()=>Ix(r.id,r.offset)+m.value)),y=(0,n.computed)((()=>d.value+v.value)),b=(0,n.computed)((()=>({top:`${v.value}px`,zIndex:a.value})));function w(){0!==r.duration&&({stop:p}=ro((()=>{S()}),r.duration))}function C(){null==p||p()}function S(){u.value=!1}function E({code:e}){e===bs.esc&&S()}return(0,n.onMounted)((()=>{w(),l(),u.value=!0})),(0,n.watch)((()=>r.repeatNum),(()=>{C(),w()})),qs(document,"keydown",E),Qs(c,(()=>{d.value=c.value.getBoundingClientRect().height})),t({visible:u,bottom:y,close:S}),(e,t)=>((0,n.openBlock)(),(0,n.createBlock)(n.Transition,{name:(0,n.unref)(i).b("fade"),onBeforeLeave:e.onClose,onAfterLeave:t[0]||(t[0]=t=>e.$emit("destroy")),persisted:""},{default:(0,n.withCtx)((()=>[(0,n.withDirectives)((0,n.createElementVNode)("div",{id:e.id,ref_key:"messageRef",ref:c,class:(0,n.normalizeClass)([(0,n.unref)(i).b(),{[(0,n.unref)(i).m(e.type)]:e.type},(0,n.unref)(i).is("center",e.center),(0,n.unref)(i).is("closable",e.showClose),e.customClass]),style:(0,n.normalizeStyle)((0,n.unref)(b)),role:"alert",onMouseenter:C,onMouseleave:w},[e.repeatNum>1?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(ww),{key:0,value:e.repeatNum,type:(0,n.unref)(h),class:(0,n.normalizeClass)((0,n.unref)(i).e("badge"))},null,8,["value","type","class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.unref)(g)?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:1,class:(0,n.normalizeClass)([(0,n.unref)(i).e("icon"),(0,n.unref)(f)])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)((0,n.unref)(g))))])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.renderSlot)(e.$slots,"default",{},(()=>[e.dangerouslyUseHTMLString?((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,{key:1},[(0,n.createCommentVNode)(" Caution here, message could've been compromised, never use user's input as message "),(0,n.createElementVNode)("p",{class:(0,n.normalizeClass)((0,n.unref)(i).e("content")),innerHTML:e.message},null,10,Ox)],2112)):((0,n.openBlock)(),(0,n.createElementBlock)("p",{key:0,class:(0,n.normalizeClass)((0,n.unref)(i).e("content"))},(0,n.toDisplayString)(e.message),3))])),e.showClose?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(Ou),{key:2,class:(0,n.normalizeClass)((0,n.unref)(i).e("closeBtn")),onClick:(0,n.withModifiers)(S,["stop"])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)((0,n.unref)(o))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0)],46,_x),[[n.vShow,u.value]])])),_:3},8,["name","onBeforeLeave"]))}});var Dx=Ar(Bx,[["__file","message.vue"]]);let Px=1;const Hx=e=>{const t=!e||an(e)||(0,n.isVNode)(e)||sn(e)?{message:e}:e,r={...Ex,...t};if(r.appendTo){if(an(r.appendTo)){let e=document.querySelector(r.appendTo);bn(e)||(Nn("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body),r.appendTo=e}}else r.appendTo=document.body;return r},Mx=e=>{const t=xx.indexOf(e);if(-1===t)return;xx.splice(t,1);const{handler:n}=e;n.close()},jx=({appendTo:e,...t},r)=>{const o="message_"+Px++,i=t.onClose,s=document.createElement("div"),a={...t,id:o,onClose:()=>{null==i||i(),Mx(d)},onDestroy:()=>{(0,n.render)(null,s)}},l=(0,n.createVNode)(Dx,a,sn(a.message)||(0,n.isVNode)(a.message)?{default:sn(a.message)?a.message:()=>a.message}:null);l.appContext=r||Vx._context,(0,n.render)(l,s),e.appendChild(s.firstElementChild);const c=l.component,u={close:()=>{c.exposed.visible.value=!1}},d={id:o,vnode:l,vm:c,handler:u,props:l.component.props};return d},Vx=(e={},t)=>{if(!Yr)return{close:()=>{}};if(yn(cr.max)&&xx.length>=cr.max)return{close:()=>{}};const n=Hx(e);if(n.grouping&&xx.length){const e=xx.find((({vnode:e})=>{var t;return(null==(t=e.props)?void 0:t.message)===n.message}));if(e)return e.props.repeatNum+=1,e.props.type=n.type,e.handler}const r=jx(n,t);return xx.push(r),r.handler};function Lx(e){for(const t of xx)e&&e!==t.props.type||t.handler.close()}Sx.forEach((e=>{Vx[e]=(t={},n)=>{const r=Hx(t);return Vx({...r,type:e},n)}})),Vx.closeAll=Lx,Vx._context=null;const $x=pr(Vx,"$message"),qx=e=>/^\d+(\.\d{1,2})?$/.test(e),Fx=e=>/^\d+$/.test(e),Ux={onChange(e){const t=e.target,n=+t.value;Number.isInteger(n)||(t.value=Number.parseInt(n))},mounted(e,t){t.input=e.querySelector("input"),t.input?.addEventListener("change",t.dir.onChange)},beforeUnmount(e,t){t.input?.removeEventListener("change",t.dir.onChange)}},zx=Symbol("tabsRootContextKey"),Kx=Dn({tabs:{type:On(Array),default:()=>lu([])}}),Wx="ElTabBar",Gx=(0,n.defineComponent)({name:Wx}),Yx=(0,n.defineComponent)({...Gx,props:Kx,setup(e,{expose:t}){const r=e,o=(0,n.getCurrentInstance)(),i=(0,n.inject)(zx);i||xn(Wx,"<el-tabs><el-tab-bar /></el-tabs>");const s=c("tabs"),a=(0,n.ref)(),l=(0,n.ref)(),u=()=>{let e=0,t=0;const n=["top","bottom"].includes(i.props.tabPosition)?"width":"height",s="width"===n?"x":"y",a="x"===s?"left":"top";return r.tabs.every((i=>{var s,l;const c=null==(l=null==(s=o.parent)?void 0:s.refs)?void 0:l[`tab-${i.uid}`];if(!c)return!1;if(!i.active)return!0;e=c[`offset${xS(a)}`],t=c[`client${xS(n)}`];const u=window.getComputedStyle(c);return"width"===n&&(r.tabs.length>1&&(t-=Number.parseFloat(u.paddingLeft)+Number.parseFloat(u.paddingRight)),e+=Number.parseFloat(u.paddingLeft)),!1})),{[n]:`${t}px`,transform:`translate${xS(s)}(${e}px)`}},d=()=>l.value=u();return(0,n.watch)((()=>r.tabs),(async()=>{await(0,n.nextTick)(),d()}),{immediate:!0}),Qs(a,(()=>d())),t({ref:a,update:d}),(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"barRef",ref:a,class:(0,n.normalizeClass)([(0,n.unref)(s).e("active-bar"),(0,n.unref)(s).is((0,n.unref)(i).props.tabPosition)]),style:(0,n.normalizeStyle)(l.value)},null,6))}});var Jx=Ar(Yx,[["__file","tab-bar.vue"]]);const Zx=Dn({panes:{type:On(Array),default:()=>lu([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),Xx={tabClick:(e,t,n)=>n instanceof Event,tabRemove:(e,t)=>t instanceof Event},Qx="ElTabNav",eN=(0,n.defineComponent)({name:Qx,props:Zx,emits:Xx,setup(e,{expose:t,emit:r}){const o=(0,n.getCurrentInstance)(),i=(0,n.inject)(zx);i||xn(Qx,"<el-tabs><tab-nav /></el-tabs>");const s=c("tabs"),a=Gs(),l=ha(),u=(0,n.ref)(),d=(0,n.ref)(),p=(0,n.ref)(),h=(0,n.ref)(),f=(0,n.ref)(!1),g=(0,n.ref)(0),m=(0,n.ref)(!1),v=(0,n.ref)(!0),y=(0,n.computed)((()=>["top","bottom"].includes(i.props.tabPosition)?"width":"height")),b=(0,n.computed)((()=>{const e="width"===y.value?"X":"Y";return{transform:`translate${e}(-${g.value}px)`}})),w=()=>{if(!u.value)return;const e=u.value[`offset${xS(y.value)}`],t=g.value;if(!t)return;const n=t>e?t-e:0;g.value=n},C=()=>{if(!u.value||!d.value)return;const e=d.value[`offset${xS(y.value)}`],t=u.value[`offset${xS(y.value)}`],n=g.value;if(e-n<=t)return;const r=e-n>2*t?n+t:e-t;g.value=r},S=async()=>{const e=d.value;if(!f.value||!p.value||!u.value||!e)return;await(0,n.nextTick)();const t=p.value.querySelector(".is-active");if(!t)return;const r=u.value,o=["top","bottom"].includes(i.props.tabPosition),s=t.getBoundingClientRect(),a=r.getBoundingClientRect(),l=o?e.offsetWidth-a.width:e.offsetHeight-a.height,c=g.value;let h=c;o?(s.left<a.left&&(h=c-(a.left-s.left)),s.right>a.right&&(h=c+s.right-a.right)):(s.top<a.top&&(h=c-(a.top-s.top)),s.bottom>a.bottom&&(h=c+(s.bottom-a.bottom))),h=Math.max(h,0),g.value=Math.min(h,l)},E=()=>{var t;if(!d.value||!u.value)return;e.stretch&&(null==(t=h.value)||t.update());const n=d.value[`offset${xS(y.value)}`],r=u.value[`offset${xS(y.value)}`],o=g.value;r<n?(f.value=f.value||{},f.value.prev=o,f.value.next=o+r<n,n-o<r&&(g.value=n-r)):(f.value=!1,o>0&&(g.value=0))},T=e=>{const t=e.code,{up:n,down:r,left:o,right:i}=bs;if(![n,r,o,i].includes(t))return;const s=Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),a=s.indexOf(e.target);let l;l=t===o||t===n?0===a?s.length-1:a-1:a<s.length-1?a+1:0,s[l].focus({preventScroll:!0}),s[l].click(),k()},k=()=>{v.value&&(m.value=!0)},x=()=>m.value=!1;return(0,n.watch)(a,(e=>{"hidden"===e?v.value=!1:"visible"===e&&setTimeout((()=>v.value=!0),50)})),(0,n.watch)(l,(e=>{e?setTimeout((()=>v.value=!0),50):v.value=!1})),Qs(p,E),(0,n.onMounted)((()=>setTimeout((()=>S()),0))),(0,n.onUpdated)((()=>E())),t({scrollToActiveTab:S,removeFocus:x}),(0,n.watch)((()=>e.panes),(()=>o.update()),{flush:"post",deep:!0}),()=>{const t=f.value?[(0,n.createVNode)("span",{class:[s.e("nav-prev"),s.is("disabled",!f.value.prev)],onClick:w},[(0,n.createVNode)(Ou,null,{default:()=>[(0,n.createVNode)(Kl,null,null)]})]),(0,n.createVNode)("span",{class:[s.e("nav-next"),s.is("disabled",!f.value.next)],onClick:C},[(0,n.createVNode)(Ou,null,{default:()=>[(0,n.createVNode)(Gl,null,null)]})])]:null,o=e.panes.map(((t,o)=>{var a,l,c,u;const d=t.uid,p=t.props.disabled,h=null!=(l=null!=(a=t.props.name)?a:t.index)?l:`${o}`,f=!p&&(t.isClosable||e.editable);t.index=`${o}`;const g=f?(0,n.createVNode)(Ou,{class:"is-icon-close",onClick:e=>r("tabRemove",t,e)},{default:()=>[(0,n.createVNode)(sc,null,null)]}):null,v=(null==(u=(c=t.slots).label)?void 0:u.call(c))||t.props.label,y=!p&&t.active?0:-1;return(0,n.createVNode)("div",{ref:`tab-${d}`,class:[s.e("item"),s.is(i.props.tabPosition),s.is("active",t.active),s.is("disabled",p),s.is("closable",f),s.is("focus",m.value)],id:`tab-${h}`,key:`tab-${d}`,"aria-controls":`pane-${h}`,role:"tab","aria-selected":t.active,tabindex:y,onFocus:()=>k(),onBlur:()=>x(),onClick:e=>{x(),r("tabClick",t,h,e)},onKeydown:e=>{!f||e.code!==bs.delete&&e.code!==bs.backspace||r("tabRemove",t,e)}},[v,g])}));return(0,n.createVNode)("div",{ref:p,class:[s.e("nav-wrap"),s.is("scrollable",!!f.value),s.is(i.props.tabPosition)]},[t,(0,n.createVNode)("div",{class:s.e("nav-scroll"),ref:u},[(0,n.createVNode)("div",{class:[s.e("nav"),s.is(i.props.tabPosition),s.is("stretch",e.stretch&&["top","bottom"].includes(i.props.tabPosition))],ref:d,style:b.value,role:"tablist",onKeydown:T},[e.type?null:(0,n.createVNode)(Jx,{ref:h,tabs:[...e.panes]},null),o])])])}}});const tN=e=>{const t=on(e)?e:[e],r=[];return t.forEach((e=>{var t;on(e)?r.push(...tN(e)):(0,n.isVNode)(e)&&on(e.children)?r.push(...tN(e.children)):(r.push(e),(0,n.isVNode)(e)&&(null==(t=e.component)?void 0:t.subTree)&&r.push(...tN(e.component.subTree)))})),r},nN=(e,t,r)=>{const o=tN(e.subTree).filter((e=>{var r;return(0,n.isVNode)(e)&&(null==(r=e.type)?void 0:r.name)===t&&!!e.component})),i=o.map((e=>e.component.uid));return i.map((e=>r[e])).filter((e=>!!e))},rN=(e,t)=>{const r={},o=(0,n.shallowRef)([]),i=n=>{r[n.uid]=n,o.value=nN(e,t,r)},s=e=>{delete r[e],o.value=o.value.filter((t=>t.uid!==e))};return{children:o,addChild:i,removeChild:s}},oN=Dn({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:On(Function),default:()=>!0},stretch:Boolean}),iN=e=>an(e)||yn(e),sN={[cu]:e=>iN(e),tabClick:(e,t)=>t instanceof Event,tabChange:e=>iN(e),edit:(e,t)=>["remove","add"].includes(t),tabRemove:e=>iN(e),tabAdd:()=>!0},aN=(0,n.defineComponent)({name:"ElTabs",props:oN,emits:sN,setup(e,{emit:t,slots:r,expose:o}){var i,s;const a=c("tabs"),{children:l,addChild:u,removeChild:d}=rN((0,n.getCurrentInstance)(),"ElTabPane"),p=(0,n.ref)(),h=(0,n.ref)(null!=(s=null!=(i=e.modelValue)?i:e.activeName)?s:"0"),f=async(n,r=!1)=>{var o,i,s;if(h.value!==n&&!mn(n))try{const a=await(null==(o=e.beforeLeave)?void 0:o.call(e,n,h.value));!1!==a&&(h.value=n,r&&(t(cu,n),t("tabChange",n)),null==(s=null==(i=p.value)?void 0:i.removeFocus)||s.call(i))}catch(a){}},g=(e,n,r)=>{e.props.disabled||(f(n,!0),t("tabClick",e,r))},m=(e,n)=>{e.props.disabled||mn(e.props.name)||(n.stopPropagation(),t("edit",e.props.name,"remove"),t("tabRemove",e.props.name))},v=()=>{t("edit",void 0,"add"),t("tabAdd")};return Ww({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},(0,n.computed)((()=>!!e.activeName))),Ww({from:'"addIcon"',replacement:'"add-icon"',scope:"ElTabs",version:"2.6.0",ref:"https://element-plus.org/en-US/component/tabs.html#slots",type:"Slot"},(0,n.computed)((()=>!!r.addIcon))),(0,n.watch)((()=>e.activeName),(e=>f(e))),(0,n.watch)((()=>e.modelValue),(e=>f(e))),(0,n.watch)(h,(async()=>{var e;await(0,n.nextTick)(),null==(e=p.value)||e.scrollToActiveTab()})),(0,n.provide)(zx,{props:e,currentName:h,registerPane:u,unregisterPane:d}),o({currentName:h}),()=>{const t=r["add-icon"]||r["addIcon"],o=t&&r["addIcon"],i=e.editable||e.addable?(0,n.createVNode)("span",{class:a.e("new-tab"),tabindex:"0",onClick:v,onKeydown:e=>{e.code===bs.enter&&v()}},[t?(0,n.renderSlot)(r,o?"addIcon":"add-icon"):(0,n.createVNode)(Ou,{class:a.is("icon-plus")},{default:()=>[(0,n.createVNode)(mc,null,null)]})]):null,s=(0,n.createVNode)("div",{class:[a.e("header"),a.is(e.tabPosition)]},[i,(0,n.createVNode)(eN,{ref:p,currentName:h.value,editable:e.editable,type:e.type,panes:l.value,stretch:e.stretch,onTabClick:g,onTabRemove:m},null)]),c=(0,n.createVNode)("div",{class:a.e("content")},[(0,n.renderSlot)(r,"default")]);return(0,n.createVNode)("div",{class:[a.b(),a.m(e.tabPosition),{[a.m("card")]:"card"===e.type,[a.m("border-card")]:"border-card"===e.type}]},[..."bottom"!==e.tabPosition?[s,c]:[c,s]])}}}),lN=Dn({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),cN=["id","aria-hidden","aria-labelledby"],uN="ElTabPane",dN=(0,n.defineComponent)({name:uN}),pN=(0,n.defineComponent)({...dN,props:lN,setup(e){const t=e,r=(0,n.getCurrentInstance)(),o=(0,n.useSlots)(),i=(0,n.inject)(zx);i||xn(uN,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const s=c("tab-pane"),a=(0,n.ref)(),l=(0,n.computed)((()=>t.closable||i.props.closable)),u=Gr((()=>{var e;return i.currentName.value===(null!=(e=t.name)?e:a.value)})),d=(0,n.ref)(u.value),p=(0,n.computed)((()=>{var e;return null!=(e=t.name)?e:a.value})),h=Gr((()=>!t.lazy||d.value||u.value));(0,n.watch)(u,(e=>{e&&(d.value=!0)}));const f=(0,n.reactive)({uid:r.uid,slots:o,props:t,paneName:p,active:u,index:a,isClosable:l});return(0,n.onMounted)((()=>{i.registerPane(f)})),(0,n.onUnmounted)((()=>{i.unregisterPane(f.uid)})),(e,t)=>(0,n.unref)(h)?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,id:`pane-${(0,n.unref)(p)}`,class:(0,n.normalizeClass)((0,n.unref)(s).b()),role:"tabpanel","aria-hidden":!(0,n.unref)(u),"aria-labelledby":`tab-${(0,n.unref)(p)}`},[(0,n.renderSlot)(e.$slots,"default")],10,cN)),[[n.vShow,(0,n.unref)(u)]]):(0,n.createCommentVNode)("v-if",!0)}});var hN=Ar(pN,[["__file","tab-pane.vue"]]);const fN=dr(aN,{TabPane:hN}),gN=fr(hN),mN="$treeNodeId",vN=function(e,t){t&&!t[mN]&&Object.defineProperty(t,mN,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},yN=function(e,t){return e?t[e]:t[mN]},bN=(e,t,n)=>{const r=e.value.currentNode;n();const o=e.value.currentNode;r!==o&&t("current-change",o?o.data:null,o)},wN=e=>{let t=!0,n=!0,r=!0;for(let o=0,i=e.length;o<i;o++){const i=e[o];(!0!==i.checked||i.indeterminate)&&(t=!1,i.disabled||(r=!1)),(!1!==i.checked||i.indeterminate)&&(n=!1)}return{all:t,none:n,allWithoutDisable:r,half:!t&&!n}},CN=function(e){if(0===e.childNodes.length||e.loading)return;const{all:t,none:n,half:r}=wN(e.childNodes);t?(e.checked=!0,e.indeterminate=!1):r?(e.checked=!1,e.indeterminate=!0):n&&(e.checked=!1,e.indeterminate=!1);const o=e.parent;o&&0!==o.level&&(e.store.checkStrictly||CN(o))},SN=function(e,t){const n=e.store.props,r=e.data||{},o=n[t];if("function"===typeof o)return o(r,e);if("string"===typeof o)return r[o];if("undefined"===typeof o){const e=r[t];return void 0===e?"":e}};let EN=0;class TN{constructor(e){this.id=EN++,this.text=null,this.checked=!1,this.indeterminate=!1,this.data=null,this.expanded=!1,this.parent=null,this.visible=!0,this.isCurrent=!1,this.canFocus=!1;for(const t in e)rn(e,t)&&(this[t]=e[t]);this.level=0,this.loaded=!1,this.childNodes=[],this.loading=!1,this.parent&&(this.level=this.parent.level+1)}initialize(){const e=this.store;if(!e)throw new Error("[Node]store is required!");e.registerNode(this);const t=e.props;if(t&&"undefined"!==typeof t.isLeaf){const e=SN(this,"isLeaf");"boolean"===typeof e&&(this.isLeafByUser=e)}if(!0!==e.lazy&&this.data?(this.setData(this.data),e.defaultExpandAll&&(this.expanded=!0,this.canFocus=!0)):this.level>0&&e.lazy&&e.defaultExpandAll&&this.expand(),Array.isArray(this.data)||vN(this,this.data),!this.data)return;const n=e.defaultExpandedKeys,r=e.key;r&&n&&n.includes(this.key)&&this.expand(null,e.autoExpandParent),r&&void 0!==e.currentNodeKey&&this.key===e.currentNodeKey&&(e.currentNode=this,e.currentNode.isCurrent=!0),e.lazy&&e._initDefaultCheckedNode(this),this.updateLeafState(),!this.parent||1!==this.level&&!0!==this.parent.expanded||(this.canFocus=!0)}setData(e){let t;Array.isArray(e)||vN(this,e),this.data=e,this.childNodes=[],t=0===this.level&&Array.isArray(this.data)?this.data:SN(this,"children")||[];for(let n=0,r=t.length;n<r;n++)this.insertChild({data:t[n]})}get label(){return SN(this,"label")}get key(){const e=this.store.key;return this.data?this.data[e]:null}get disabled(){return SN(this,"disabled")}get nextSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}get previousSibling(){const e=this.parent;if(e){const t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}contains(e,t=!0){return(this.childNodes||[]).some((n=>n===e||t&&n.contains(e)))}remove(){const e=this.parent;e&&e.removeChild(this)}insertChild(e,t,r){if(!e)throw new Error("InsertChild error: child is required.");if(!(e instanceof TN)){if(!r){const n=this.getChildren(!0);n.includes(e.data)||("undefined"===typeof t||t<0?n.push(e.data):n.splice(t,0,e.data))}Object.assign(e,{parent:this,store:this.store}),e=(0,n.reactive)(new TN(e)),e instanceof TN&&e.initialize()}e.level=this.level+1,"undefined"===typeof t||t<0?this.childNodes.push(e):this.childNodes.splice(t,0,e),this.updateLeafState()}insertBefore(e,t){let n;t&&(n=this.childNodes.indexOf(t)),this.insertChild(e,n)}insertAfter(e,t){let n;t&&(n=this.childNodes.indexOf(t),-1!==n&&(n+=1)),this.insertChild(e,n)}removeChild(e){const t=this.getChildren()||[],n=t.indexOf(e.data);n>-1&&t.splice(n,1);const r=this.childNodes.indexOf(e);r>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(r,1)),this.updateLeafState()}removeChildByData(e){let t=null;for(let n=0;n<this.childNodes.length;n++)if(this.childNodes[n].data===e){t=this.childNodes[n];break}t&&this.removeChild(t)}expand(e,t){const n=()=>{if(t){let e=this.parent;while(e.level>0)e.expanded=!0,e=e.parent}this.expanded=!0,e&&e(),this.childNodes.forEach((e=>{e.canFocus=!0}))};this.shouldLoadData()?this.loadData((e=>{Array.isArray(e)&&(this.checked?this.setChecked(!0,!0):this.store.checkStrictly||CN(this),n())})):n()}doCreateChildren(e,t={}){e.forEach((e=>{this.insertChild(Object.assign({data:e},t),void 0,!0)}))}collapse(){this.expanded=!1,this.childNodes.forEach((e=>{e.canFocus=!1}))}shouldLoadData(){return!0===this.store.lazy&&this.store.load&&!this.loaded}updateLeafState(){if(!0===this.store.lazy&&!0!==this.loaded&&"undefined"!==typeof this.isLeafByUser)return void(this.isLeaf=this.isLeafByUser);const e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}setChecked(e,t,n,r){if(this.indeterminate="half"===e,this.checked=!0===e,this.store.checkStrictly)return;if(!this.shouldLoadData()||this.store.checkDescendants){const{all:n,allWithoutDisable:o}=wN(this.childNodes);this.isLeaf||n||!o||(this.checked=!1,e=!1);const i=()=>{if(t){const n=this.childNodes;for(let s=0,a=n.length;s<a;s++){const o=n[s];r=r||!1!==e;const i=o.disabled?o.checked:r;o.setChecked(i,t,!0,r)}const{half:o,all:i}=wN(n);i||(this.checked=i,this.indeterminate=o)}};if(this.shouldLoadData())return void this.loadData((()=>{i(),CN(this)}),{checked:!1!==e});i()}const o=this.parent;o&&0!==o.level&&(n||CN(o))}getChildren(e=!1){if(0===this.level)return this.data;const t=this.data;if(!t)return null;const n=this.store.props;let r="children";return n&&(r=n.children||"children"),void 0===t[r]&&(t[r]=null),e&&!t[r]&&(t[r]=[]),t[r]}updateChildren(){const e=this.getChildren()||[],t=this.childNodes.map((e=>e.data)),n={},r=[];e.forEach(((e,o)=>{const i=e[mN],s=!!i&&t.findIndex((e=>e[mN]===i))>=0;s?n[i]={index:o,data:e}:r.push({index:o,data:e})})),this.store.lazy||t.forEach((e=>{n[e[mN]]||this.removeChildByData(e)})),r.forEach((({index:e,data:t})=>{this.insertChild({data:t},e)})),this.updateLeafState()}loadData(e,t={}){if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(t).length)e&&e.call(this);else{this.loading=!0;const n=n=>{this.childNodes=[],this.doCreateChildren(n,t),this.loaded=!0,this.loading=!1,this.updateLeafState(),e&&e.call(this,n)};this.store.load(this,n)}}}class kN{constructor(e){this.currentNode=null,this.currentNodeKey=null;for(const t in e)rn(e,t)&&(this[t]=e[t]);this.nodesMap={}}initialize(){if(this.root=new TN({data:this.data,store:this}),this.root.initialize(),this.lazy&&this.load){const e=this.load;e(this.root,(e=>{this.root.doCreateChildren(e),this._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}filter(e){const t=this.filterNodeMethod,n=this.lazy,r=function(o){const i=o.root?o.root.childNodes:o.childNodes;if(i.forEach((n=>{n.visible=t.call(n,e,n.data,n),r(n)})),!o.visible&&i.length){let e=!0;e=!i.some((e=>e.visible)),o.root?o.root.visible=!1===e:o.visible=!1===e}e&&o.visible&&!o.isLeaf&&(n&&!o.loaded||o.expand())};r(this)}setData(e){const t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()}getNode(e){if(e instanceof TN)return e;const t=ln(e)?yN(this.key,e):e;return this.nodesMap[t]||null}insertBefore(e,t){const n=this.getNode(t);n.parent.insertBefore({data:e},n)}insertAfter(e,t){const n=this.getNode(t);n.parent.insertAfter({data:e},n)}remove(e){const t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))}append(e,t){const n=t?this.getNode(t):this.root;n&&n.insertChild({data:e})}_initDefaultCheckedNodes(){const e=this.defaultCheckedKeys||[],t=this.nodesMap;e.forEach((e=>{const n=t[e];n&&n.setChecked(!0,!this.checkStrictly)}))}_initDefaultCheckedNode(e){const t=this.defaultCheckedKeys||[];t.includes(e.key)&&e.setChecked(!0,!this.checkStrictly)}setDefaultCheckedKey(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())}registerNode(e){const t=this.key;if(e&&e.data)if(t){const t=e.key;void 0!==t&&(this.nodesMap[e.key]=e)}else this.nodesMap[e.id]=e}deregisterNode(e){const t=this.key;t&&e&&e.data&&(e.childNodes.forEach((e=>{this.deregisterNode(e)})),delete this.nodesMap[e.key])}getCheckedNodes(e=!1,t=!1){const n=[],r=function(o){const i=o.root?o.root.childNodes:o.childNodes;i.forEach((o=>{(o.checked||t&&o.indeterminate)&&(!e||e&&o.isLeaf)&&n.push(o.data),r(o)}))};return r(this),n}getCheckedKeys(e=!1){return this.getCheckedNodes(e).map((e=>(e||{})[this.key]))}getHalfCheckedNodes(){const e=[],t=function(n){const r=n.root?n.root.childNodes:n.childNodes;r.forEach((n=>{n.indeterminate&&e.push(n.data),t(n)}))};return t(this),e}getHalfCheckedKeys(){return this.getHalfCheckedNodes().map((e=>(e||{})[this.key]))}_getAllNodes(){const e=[],t=this.nodesMap;for(const n in t)rn(t,n)&&e.push(t[n]);return e}updateChildren(e,t){const n=this.nodesMap[e];if(!n)return;const r=n.childNodes;for(let o=r.length-1;o>=0;o--){const e=r[o];this.remove(e.data)}for(let o=0,i=t.length;o<i;o++){const e=t[o];this.append(e,n.data)}}_setCheckedKeys(e,t=!1,n){const r=this._getAllNodes().sort(((e,t)=>e.level-t.level)),o=Object.create(null),i=Object.keys(n);r.forEach((e=>e.setChecked(!1,!1)));const s=t=>{t.childNodes.forEach((t=>{var n;o[t.data[e]]=!0,(null==(n=t.childNodes)?void 0:n.length)&&s(t)}))};for(let a=0,l=r.length;a<l;a++){const n=r[a],l=n.data[e].toString(),c=i.includes(l);if(c){if(n.childNodes.length&&s(n),n.isLeaf||this.checkStrictly)n.setChecked(!0,!1);else if(n.setChecked(!0,!0),t){n.setChecked(!1,!1);const e=function(t){const n=t.childNodes;n.forEach((t=>{t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(n)}}else n.checked&&!o[l]&&n.setChecked(!1,!1)}}setCheckedNodes(e,t=!1){const n=this.key,r={};e.forEach((e=>{r[(e||{})[n]]=!0})),this._setCheckedKeys(n,t,r)}setCheckedKeys(e,t=!1){this.defaultCheckedKeys=e;const n=this.key,r={};e.forEach((e=>{r[e]=!0})),this._setCheckedKeys(n,t,r)}setDefaultExpandedKeys(e){e=e||[],this.defaultExpandedKeys=e,e.forEach((e=>{const t=this.getNode(e);t&&t.expand(null,this.autoExpandParent)}))}setChecked(e,t,n){const r=this.getNode(e);r&&r.setChecked(!!t,n)}getCurrentNode(){return this.currentNode}setCurrentNode(e){const t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0}setUserCurrentNode(e,t=!0){const n=e[this.key],r=this.nodesMap[n];this.setCurrentNode(r),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0)}setCurrentNodeKey(e,t=!0){if(null===e||void 0===e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);const n=this.getNode(e);n&&(this.setCurrentNode(n),t&&this.currentNode.level>1&&this.currentNode.parent.expand(null,!0))}}const xN=(0,n.defineComponent)({name:"ElTreeNodeContent",props:{node:{type:Object,required:!0},renderContent:Function},setup(e){const t=c("tree"),r=(0,n.inject)("NodeInstance"),o=(0,n.inject)("RootTree");return()=>{const i=e.node,{data:s,store:a}=i;return e.renderContent?e.renderContent(n.h,{_self:r,node:i,data:s,store:a}):(0,n.renderSlot)(o.ctx.slots,"default",{node:i,data:s},(()=>[(0,n.h)("span",{class:t.be("node","label")},[i.label])]))}}});var NN=Ar(xN,[["__file","tree-node-content.vue"]]);function RN(e){const t=(0,n.inject)("TreeNodeMap",null),r={treeNodeExpand:t=>{e.node!==t&&e.node.collapse()},children:[]};return t&&t.children.push(r),(0,n.provide)("TreeNodeMap",r),{broadcastExpanded:t=>{if(e.accordion)for(const e of r.children)e.treeNodeExpand(t)}}}const IN=Symbol("dragEvents");function _N({props:e,ctx:t,el$:r,dropIndicator$:o,store:i}){const s=c("tree"),a=(0,n.ref)({showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0,dropType:null}),l=({event:n,treeNode:r})=>{if("function"===typeof e.allowDrag&&!e.allowDrag(r.node))return n.preventDefault(),!1;n.dataTransfer.effectAllowed="move";try{n.dataTransfer.setData("text/plain","")}catch(o){}a.value.draggingNode=r,t.emit("node-drag-start",r.node,n)},u=({event:n,treeNode:i})=>{const l=i,c=a.value.dropNode;c&&c.node.id!==l.node.id&&Zc(c.$el,s.is("drop-inner"));const u=a.value.draggingNode;if(!u||!l)return;let d=!0,p=!0,h=!0,f=!0;"function"===typeof e.allowDrop&&(d=e.allowDrop(u.node,l.node,"prev"),f=p=e.allowDrop(u.node,l.node,"inner"),h=e.allowDrop(u.node,l.node,"next")),n.dataTransfer.dropEffect=p||d||h?"move":"none",(d||p||h)&&(null==c?void 0:c.node.id)!==l.node.id&&(c&&t.emit("node-drag-leave",u.node,c.node,n),t.emit("node-drag-enter",u.node,l.node,n)),a.value.dropNode=d||p||h?l:null,l.node.nextSibling===u.node&&(h=!1),l.node.previousSibling===u.node&&(d=!1),l.node.contains(u.node,!1)&&(p=!1),(u.node===l.node||u.node.contains(l.node))&&(d=!1,p=!1,h=!1);const g=l.$el.querySelector(`.${s.be("node","content")}`).getBoundingClientRect(),m=r.value.getBoundingClientRect();let v;const y=d?p?.25:h?.45:1:-1,b=h?p?.75:d?.55:0:1;let w=-9999;const C=n.clientY-g.top;v=C<g.height*y?"before":C>g.height*b?"after":p?"inner":"none";const S=l.$el.querySelector(`.${s.be("node","expand-icon")}`).getBoundingClientRect(),E=o.value;"before"===v?w=S.top-m.top:"after"===v&&(w=S.bottom-m.top),E.style.top=`${w}px`,E.style.left=S.right-m.left+"px","inner"===v?Jc(l.$el,s.is("drop-inner")):Zc(l.$el,s.is("drop-inner")),a.value.showDropIndicator="before"===v||"after"===v,a.value.allowDrop=a.value.showDropIndicator||f,a.value.dropType=v,t.emit("node-drag-over",u.node,l.node,n)},d=e=>{const{draggingNode:n,dropType:r,dropNode:o}=a.value;if(e.preventDefault(),e.dataTransfer.dropEffect="move",n&&o){const a={data:n.node.data};"none"!==r&&n.node.remove(),"before"===r?o.node.parent.insertBefore(a,o.node):"after"===r?o.node.parent.insertAfter(a,o.node):"inner"===r&&o.node.insertChild(a),"none"!==r&&i.value.registerNode(a),Zc(o.$el,s.is("drop-inner")),t.emit("node-drag-end",n.node,o.node,r,e),"none"!==r&&t.emit("node-drop",n.node,o.node,r,e)}n&&!o&&t.emit("node-drag-end",n.node,null,r,e),a.value.showDropIndicator=!1,a.value.draggingNode=null,a.value.dropNode=null,a.value.allowDrop=!0};return(0,n.provide)(IN,{treeNodeDragStart:l,treeNodeDragOver:u,treeNodeDragEnd:d}),{dragState:a}}const ON=(0,n.defineComponent)({name:"ElTreeNode",components:{ElCollapseTransition:xu,ElCheckbox:Av,NodeContent:NN,ElIcon:Ou,Loading:pc},props:{node:{type:TN,default:()=>({})},props:{type:Object,default:()=>({})},accordion:Boolean,renderContent:Function,renderAfterExpand:Boolean,showCheckbox:{type:Boolean,default:!1}},emits:["node-expand"],setup(e,t){const r=c("tree"),{broadcastExpanded:o}=RN(e),i=(0,n.inject)("RootTree"),s=(0,n.ref)(!1),a=(0,n.ref)(!1),l=(0,n.ref)(null),u=(0,n.ref)(null),d=(0,n.ref)(null),p=(0,n.inject)(IN),h=(0,n.getCurrentInstance)();(0,n.provide)("NodeInstance",h),i||Nn("Tree","Can not find node's tree."),e.node.expanded&&(s.value=!0,a.value=!0);const f=i.props.props["children"]||"children";(0,n.watch)((()=>{const t=e.node.data[f];return t&&[...t]}),(()=>{e.node.updateChildren()})),(0,n.watch)((()=>e.node.indeterminate),(t=>{v(e.node.checked,t)})),(0,n.watch)((()=>e.node.checked),(t=>{v(t,e.node.indeterminate)})),(0,n.watch)((()=>e.node.expanded),(e=>{(0,n.nextTick)((()=>s.value=e)),e&&(a.value=!0)}));const g=e=>yN(i.props.nodeKey,e.data),m=t=>{const n=e.props.class;if(!n)return{};let r;if(sn(n)){const{data:e}=t;r=n(e,t)}else r=n;return an(r)?{[r]:!0}:r},v=(t,n)=>{l.value===t&&u.value===n||i.ctx.emit("check-change",e.node.data,t,n),l.value=t,u.value=n},y=t=>{bN(i.store,i.ctx.emit,(()=>i.store.value.setCurrentNode(e.node))),i.currentNode.value=e.node,i.props.expandOnClickNode&&w(),i.props.checkOnClickNode&&!e.node.disabled&&C(null,{target:{checked:!e.node.checked}}),i.ctx.emit("node-click",e.node.data,e.node,h,t)},b=t=>{i.instance.vnode.props["onNodeContextmenu"]&&(t.stopPropagation(),t.preventDefault()),i.ctx.emit("node-contextmenu",t,e.node.data,e.node,h)},w=()=>{e.node.isLeaf||(s.value?(i.ctx.emit("node-collapse",e.node.data,e.node,h),e.node.collapse()):(e.node.expand(),t.emit("node-expand",e.node.data,e.node,h)))},C=(t,r)=>{e.node.setChecked(r.target.checked,!i.props.checkStrictly),(0,n.nextTick)((()=>{const t=i.store.value;i.ctx.emit("check",e.node.data,{checkedNodes:t.getCheckedNodes(),checkedKeys:t.getCheckedKeys(),halfCheckedNodes:t.getHalfCheckedNodes(),halfCheckedKeys:t.getHalfCheckedKeys()})}))},S=(e,t,n)=>{o(t),i.ctx.emit("node-expand",e,t,n)},E=t=>{i.props.draggable&&p.treeNodeDragStart({event:t,treeNode:e})},T=t=>{t.preventDefault(),i.props.draggable&&p.treeNodeDragOver({event:t,treeNode:{$el:d.value,node:e.node}})},k=e=>{e.preventDefault()},x=e=>{i.props.draggable&&p.treeNodeDragEnd(e)};return{ns:r,node$:d,tree:i,expanded:s,childNodeRendered:a,oldChecked:l,oldIndeterminate:u,getNodeKey:g,getNodeClass:m,handleSelectChange:v,handleClick:y,handleContextMenu:b,handleExpandIconClick:w,handleCheckChange:C,handleChildNodeExpand:S,handleDragStart:E,handleDragOver:T,handleDrop:k,handleDragEnd:x,CaretRight:Xl}}}),AN=["aria-expanded","aria-disabled","aria-checked","draggable","data-key"],BN=["aria-expanded"];function DN(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-icon"),l=(0,n.resolveComponent)("el-checkbox"),c=(0,n.resolveComponent)("loading"),u=(0,n.resolveComponent)("node-content"),d=(0,n.resolveComponent)("el-tree-node"),p=(0,n.resolveComponent)("el-collapse-transition");return(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"node$",class:(0,n.normalizeClass)([e.ns.b("node"),e.ns.is("expanded",e.expanded),e.ns.is("current",e.node.isCurrent),e.ns.is("hidden",!e.node.visible),e.ns.is("focusable",!e.node.disabled),e.ns.is("checked",!e.node.disabled&&e.node.checked),e.getNodeClass(e.node)]),role:"treeitem",tabindex:"-1","aria-expanded":e.expanded,"aria-disabled":e.node.disabled,"aria-checked":e.node.checked,draggable:e.tree.props.draggable,"data-key":e.getNodeKey(e.node),onClick:t[1]||(t[1]=(0,n.withModifiers)(((...t)=>e.handleClick&&e.handleClick(...t)),["stop"])),onContextmenu:t[2]||(t[2]=(...t)=>e.handleContextMenu&&e.handleContextMenu(...t)),onDragstart:t[3]||(t[3]=(0,n.withModifiers)(((...t)=>e.handleDragStart&&e.handleDragStart(...t)),["stop"])),onDragover:t[4]||(t[4]=(0,n.withModifiers)(((...t)=>e.handleDragOver&&e.handleDragOver(...t)),["stop"])),onDragend:t[5]||(t[5]=(0,n.withModifiers)(((...t)=>e.handleDragEnd&&e.handleDragEnd(...t)),["stop"])),onDrop:t[6]||(t[6]=(0,n.withModifiers)(((...t)=>e.handleDrop&&e.handleDrop(...t)),["stop"]))},[(0,n.createElementVNode)("div",{class:(0,n.normalizeClass)(e.ns.be("node","content")),style:(0,n.normalizeStyle)({paddingLeft:(e.node.level-1)*e.tree.props.indent+"px"})},[e.tree.props.icon||e.CaretRight?((0,n.openBlock)(),(0,n.createBlock)(a,{key:0,class:(0,n.normalizeClass)([e.ns.be("node","expand-icon"),e.ns.is("leaf",e.node.isLeaf),{expanded:!e.node.isLeaf&&e.expanded}]),onClick:(0,n.withModifiers)(e.handleExpandIconClick,["stop"])},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.tree.props.icon||e.CaretRight)))])),_:1},8,["class","onClick"])):(0,n.createCommentVNode)("v-if",!0),e.showCheckbox?((0,n.openBlock)(),(0,n.createBlock)(l,{key:1,"model-value":e.node.checked,indeterminate:e.node.indeterminate,disabled:!!e.node.disabled,onClick:t[0]||(t[0]=(0,n.withModifiers)((()=>{}),["stop"])),onChange:e.handleCheckChange},null,8,["model-value","indeterminate","disabled","onChange"])):(0,n.createCommentVNode)("v-if",!0),e.node.loading?((0,n.openBlock)(),(0,n.createBlock)(a,{key:2,class:(0,n.normalizeClass)([e.ns.be("node","loading-icon"),e.ns.is("loading")])},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c)])),_:1},8,["class"])):(0,n.createCommentVNode)("v-if",!0),(0,n.createVNode)(u,{node:e.node,"render-content":e.renderContent},null,8,["node","render-content"])],6),(0,n.createVNode)(p,null,{default:(0,n.withCtx)((()=>[!e.renderAfterExpand||e.childNodeRendered?(0,n.withDirectives)(((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.be("node","children")),role:"group","aria-expanded":e.expanded},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.node.childNodes,(t=>((0,n.openBlock)(),(0,n.createBlock)(d,{key:e.getNodeKey(t),"render-content":e.renderContent,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,node:t,accordion:e.accordion,props:e.props,onNodeExpand:e.handleChildNodeExpand},null,8,["render-content","render-after-expand","show-checkbox","node","accordion","props","onNodeExpand"])))),128))],10,BN)),[[n.vShow,e.expanded]]):(0,n.createCommentVNode)("v-if",!0)])),_:1})],42,AN)),[[n.vShow,e.node.visible]])}var PN=Ar(ON,[["render",DN],["__file","tree-node.vue"]]);function HN({el$:e},t){const r=c("tree"),o=(0,n.shallowRef)([]),i=(0,n.shallowRef)([]);(0,n.onMounted)((()=>{a()})),(0,n.onUpdated)((()=>{o.value=Array.from(e.value.querySelectorAll("[role=treeitem]")),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"))})),(0,n.watch)(i,(e=>{e.forEach((e=>{e.setAttribute("tabindex","-1")}))}));const s=n=>{const i=n.target;if(!i.className.includes(r.b("node")))return;const s=n.code;o.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`));const a=o.value.indexOf(i);let l;if([bs.up,bs.down].includes(s)){if(n.preventDefault(),s===bs.up){l=-1===a?0:0!==a?a-1:o.value.length-1;const e=l;while(1){if(t.value.getNode(o.value[l].dataset.key).canFocus)break;if(l--,l===e){l=-1;break}l<0&&(l=o.value.length-1)}}else{l=-1===a?0:a<o.value.length-1?a+1:0;const e=l;while(1){if(t.value.getNode(o.value[l].dataset.key).canFocus)break;if(l++,l===e){l=-1;break}l>=o.value.length&&(l=0)}}-1!==l&&o.value[l].focus()}[bs.left,bs.right].includes(s)&&(n.preventDefault(),i.click());const c=i.querySelector('[type="checkbox"]');[bs.enter,bs.space].includes(s)&&c&&(n.preventDefault(),c.click())};qs(e,"keydown",s);const a=()=>{var t;o.value=Array.from(e.value.querySelectorAll(`.${r.is("focusable")}[role=treeitem]`)),i.value=Array.from(e.value.querySelectorAll("input[type=checkbox]"));const n=e.value.querySelectorAll(`.${r.is("checked")}[role=treeitem]`);n.length?n[0].setAttribute("tabindex","0"):null==(t=o.value[0])||t.setAttribute("tabindex","0")}}const MN=(0,n.defineComponent)({name:"ElTree",components:{ElTreeNode:PN},props:{data:{type:Array,default:()=>[]},emptyText:{type:String},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{type:Object,default:()=>({children:"children",label:"label",disabled:"disabled"})},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},icon:{type:Ec}},emits:["check-change","current-change","node-click","node-contextmenu","node-collapse","node-expand","check","node-drag-start","node-drag-end","node-drop","node-drag-leave","node-drag-enter","node-drag-over"],setup(e,t){const{t:r}=en(),o=c("tree"),i=(0,n.ref)(new kN({key:e.nodeKey,data:e.data,lazy:e.lazy,props:e.props,load:e.load,currentNodeKey:e.currentNodeKey,checkStrictly:e.checkStrictly,checkDescendants:e.checkDescendants,defaultCheckedKeys:e.defaultCheckedKeys,defaultExpandedKeys:e.defaultExpandedKeys,autoExpandParent:e.autoExpandParent,defaultExpandAll:e.defaultExpandAll,filterNodeMethod:e.filterNodeMethod}));i.value.initialize();const s=(0,n.ref)(i.value.root),a=(0,n.ref)(null),l=(0,n.ref)(null),u=(0,n.ref)(null),{broadcastExpanded:d}=RN(e),{dragState:p}=_N({props:e,ctx:t,el$:l,dropIndicator$:u,store:i});HN({el$:l},i);const h=(0,n.computed)((()=>{const{childNodes:e}=s.value;return!e||0===e.length||e.every((({visible:e})=>!e))}));(0,n.watch)((()=>e.currentNodeKey),(e=>{i.value.setCurrentNodeKey(e)})),(0,n.watch)((()=>e.defaultCheckedKeys),(e=>{i.value.setDefaultCheckedKey(e)})),(0,n.watch)((()=>e.defaultExpandedKeys),(e=>{i.value.setDefaultExpandedKeys(e)})),(0,n.watch)((()=>e.data),(e=>{i.value.setData(e)}),{deep:!0}),(0,n.watch)((()=>e.checkStrictly),(e=>{i.value.checkStrictly=e}));const f=t=>{if(!e.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");i.value.filter(t)},g=t=>yN(e.nodeKey,t.data),m=t=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");const n=i.value.getNode(t);if(!n)return[];const r=[n.data];let o=n.parent;while(o&&o!==s.value)r.push(o.data),o=o.parent;return r.reverse()},v=(e,t)=>i.value.getCheckedNodes(e,t),y=e=>i.value.getCheckedKeys(e),b=()=>{const e=i.value.getCurrentNode();return e?e.data:null},w=()=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");const t=b();return t?t[e.nodeKey]:null},C=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");i.value.setCheckedNodes(t,n)},S=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");i.value.setCheckedKeys(t,n)},E=(e,t,n)=>{i.value.setChecked(e,t,n)},T=()=>i.value.getHalfCheckedNodes(),k=()=>i.value.getHalfCheckedKeys(),x=(n,r=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");bN(i,t.emit,(()=>i.value.setUserCurrentNode(n,r)))},N=(n,r=!0)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");bN(i,t.emit,(()=>i.value.setCurrentNodeKey(n,r)))},R=e=>i.value.getNode(e),I=e=>{i.value.remove(e)},_=(e,t)=>{i.value.append(e,t)},O=(e,t)=>{i.value.insertBefore(e,t)},A=(e,t)=>{i.value.insertAfter(e,t)},B=(e,n,r)=>{d(n),t.emit("node-expand",e,n,r)},D=(t,n)=>{if(!e.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");i.value.updateChildren(t,n)};return(0,n.provide)("RootTree",{ctx:t,props:e,store:i,root:s,currentNode:a,instance:(0,n.getCurrentInstance)()}),(0,n.provide)(Ga,void 0),{ns:o,store:i,root:s,currentNode:a,dragState:p,el$:l,dropIndicator$:u,isEmpty:h,filter:f,getNodeKey:g,getNodePath:m,getCheckedNodes:v,getCheckedKeys:y,getCurrentNode:b,getCurrentKey:w,setCheckedNodes:C,setCheckedKeys:S,setChecked:E,getHalfCheckedNodes:T,getHalfCheckedKeys:k,setCurrentNode:x,setCurrentKey:N,t:r,getNode:R,remove:I,append:_,insertBefore:O,insertAfter:A,handleNodeExpand:B,updateKeyChildren:D}}});function jN(e,t,r,o,i,s){const a=(0,n.resolveComponent)("el-tree-node");return(0,n.openBlock)(),(0,n.createElementBlock)("div",{ref:"el$",class:(0,n.normalizeClass)([e.ns.b(),e.ns.is("dragging",!!e.dragState.draggingNode),e.ns.is("drop-not-allow",!e.dragState.allowDrop),e.ns.is("drop-inner","inner"===e.dragState.dropType),{[e.ns.m("highlight-current")]:e.highlightCurrent}]),role:"tree"},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.root.childNodes,(t=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.getNodeKey(t),node:t,props:e.props,accordion:e.accordion,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent,onNodeExpand:e.handleNodeExpand},null,8,["node","props","accordion","render-after-expand","show-checkbox","render-content","onNodeExpand"])))),128)),e.isEmpty?((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:0,class:(0,n.normalizeClass)(e.ns.e("empty-block"))},[(0,n.renderSlot)(e.$slots,"empty",{},(()=>{var t;return[(0,n.createElementVNode)("span",{class:(0,n.normalizeClass)(e.ns.e("empty-text"))},(0,n.toDisplayString)(null!=(t=e.emptyText)?t:e.t("el.tree.emptyText")),3)]}))],2)):(0,n.createCommentVNode)("v-if",!0),(0,n.withDirectives)((0,n.createElementVNode)("div",{ref:"dropIndicator$",class:(0,n.normalizeClass)(e.ns.e("drop-indicator"))},null,2),[[n.vShow,e.dragState.showDropIndicator]])],2)}var VN=Ar(MN,[["render",jN],["__file","tree.vue"]]);VN.install=e=>{e.component(VN.name,VN)};const LN=VN,$N=LN,qN=e=>((0,n.pushScopeId)("data-v-414390b9"),e=e(),(0,n.popScopeId)(),e),FN={class:"transfer-box"},UN={key:0},zN={key:1,class:"idle-agent-box"},KN=["onClick"],WN=qN((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),GN=[WN],YN={class:"outline-box"},JN=(0,n.createTextVNode)("转移");function ZN(e,t,r,o,i,s){const a=cE,l=$N,c=lE,u=gN,d=iS,p=jC,h=fN;return(0,n.openBlock)(),(0,n.createElementBlock)("div",FN,[(0,n.createVNode)(h,{modelValue:e.activeName,"onUpdate:modelValue":t[3]||(t[3]=t=>e.activeName=t),onTabClick:e.handleClick},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{label:"其他员工",name:"agent"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{class:"transfer-select","popper-class":"transfer-select",placeholder:"请输入座席工号、姓名、技能组名称查询",onVisibleChange:e.visibleChange,"filter-method":e.dataFilter,filterable:"",modelValue:e.form.id,"onUpdate:modelValue":t[0]||(t[0]=t=>e.form.id=t),ref:"selectTree"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.form.id,value:e.form.id,label:e.form.label,hidden:""},null,8,["value","label"])),(0,n.createVNode)(l,{data:e.agentOptions,props:e.props,"node-key":"id",accordion:"",ref:"tree","highlight-current":"","filter-node-method":e.filterNode},{default:(0,n.withCtx)((({data:t})=>[t.freeNumber>=0?((0,n.openBlock)(),(0,n.createElementBlock)("div",UN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label),1),(0,n.createElementVNode)("span",null,"("+(0,n.toDisplayString)(t.freeNumber)+")",1)])):(0,n.createCommentVNode)("",!0),t.agentNumber?((0,n.openBlock)(),(0,n.createElementBlock)("div",zN,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label)+" ("+(0,n.toDisplayString)(t.agentNumber)+") ",1),(0,n.createElementVNode)("span",{onClick:n=>e.transferAction(t.agentNumber,"agent")},GN,8,KN)])):(0,n.createCommentVNode)("",!0)])),_:1},8,["data","props","filter-node-method"])])),_:1},8,["onVisibleChange","filter-method","modelValue"])])),_:1}),(0,n.createVNode)(u,{label:"外线电话",name:"outline"},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",YN,[(0,n.createVNode)(d,{modelValue:e.outlineNumber,"onUpdate:modelValue":t[1]||(t[1]=t=>e.outlineNumber=t),size:"mini",clearable:"",placeholder:"请输入手机或完整的区号电话号码",style:{width:"244px"}},null,8,["modelValue"]),(0,n.createVNode)(p,{type:"primary",size:"default",class:"action-btn",disabled:!e.outlineNumber,onClick:t[2]||(t[2]=(0,n.withModifiers)((t=>e.transferAction(e.outlineNumber,"outline",e.outlineNumber)),["stop"]))},{default:(0,n.withCtx)((()=>[JN])),_:1},8,["disabled"])])])),_:1})])),_:1},8,["modelValue","onTabClick"])])}var XN=(0,n.defineComponent)({name:"transferConsult",components:{},props:{module:{type:String,default:""}},setup(){(0,n.ref)(null);const e=(0,n.reactive)({activeName:"agent",outlineNumber:"",ivrList:[],ivrObj:{name:"",nodeId:""},agentOptions:[],form:{id:"",label:""},props:{children:"children",label:"label"}}),t=(e,t)=>{if("outline"===t&&(!Fx(e)||!e))return $x.error("请输入正确的号码"),!1;window.ueSoftphone.call.transfer({type:t,number:e,success:e=>{console.log(e,"success============")}})},r=()=>{window.ueSoftphone.agent.findIdleAgentsForQueue({success:t=>{if(t&&t.success&&t.dataList){const n=[];t.dataList.forEach((e=>{const t={value:e._id,label:e.name,freeNumber:0};let r=0;const o=[];e.members&&e.members.length>0?e.members.forEach((n=>{if("00000"!==n.agentId){const e={value:n.agentId,label:`${n.agentName}[${n.agentNumber}]`,callStatus:n.callStatus,callStatusName:n.callStatusName,agentNumber:n.agentNumber};"0"===n.callStatus?r++:e.disabled=!0,o.push(e)}else 1===e.members.length&&(t.disabled=!0)})):t.disabled=!0,t.freeNumber=r,o.length>0&&(t.children=o),t.freeNumber>0&&n.push(t)})),e.agentOptions=n}}})},o=e=>{window.ueSoftphone.call.transfer({type:"agent",number:e.agentNumber,success:e=>{console.log(e,"success============")}})},i=()=>{(0,n.nextTick)((()=>{console.log("切换")}))},s=e=>{e&&r()};return{...(0,n.toRefs)(e),transferClick:o,fetchQueueOnlineAgents:r,handleClick:i,transferAction:t,visibleChange:s}}});const QN=(0,Fw.A)(XN,[["render",ZN],["__scopeId","data-v-414390b9"]]);var eR=QN;const tR=e=>((0,n.pushScopeId)("data-v-1618b142"),e=e(),(0,n.popScopeId)(),e),nR={class:"transfer-box"},rR={key:0},oR={key:1,class:"idle-agent-box"},iR=["onClick"],sR=tR((()=>(0,n.createElementVNode)("i",{class:"wtue wtue-zhuanjie"},null,-1))),aR=[sR],lR={class:"outline-box"},cR=(0,n.createTextVNode)("咨询");function uR(e,t,r,o,i,s){const a=cE,l=$N,c=lE,u=gN,d=iS,p=jC,h=fN;return(0,n.openBlock)(),(0,n.createElementBlock)("div",nR,[(0,n.createVNode)(h,{modelValue:e.activeName,"onUpdate:modelValue":t[3]||(t[3]=t=>e.activeName=t),onTabClick:e.handleClick},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(u,{label:"其他员工",name:"agent"},{default:(0,n.withCtx)((()=>[(0,n.createVNode)(c,{class:"transfer-select","popper-class":"transfer-select",placeholder:"请输入座席工号、姓名、技能组名称查询",onVisibleChange:e.visibleChange,"filter-method":e.dataFilter,filterable:"",modelValue:e.form.id,"onUpdate:modelValue":t[0]||(t[0]=t=>e.form.id=t),ref:"selectTree"},{default:(0,n.withCtx)((()=>[((0,n.openBlock)(),(0,n.createBlock)(a,{key:e.form.id,value:e.form.id,label:e.form.label,hidden:""},null,8,["value","label"])),(0,n.createVNode)(l,{data:e.agentOptions,props:e.props,"node-key":"id",accordion:"",ref:"tree","highlight-current":"","filter-node-method":e.filterNode},{default:(0,n.withCtx)((({data:t})=>[t.freeNumber>=0?((0,n.openBlock)(),(0,n.createElementBlock)("div",rR,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label),1),(0,n.createElementVNode)("span",null,"("+(0,n.toDisplayString)(t.freeNumber)+")",1)])):(0,n.createCommentVNode)("",!0),t.agentNumber?((0,n.openBlock)(),(0,n.createElementBlock)("div",oR,[(0,n.createElementVNode)("span",null,(0,n.toDisplayString)(t.label)+" ("+(0,n.toDisplayString)(t.agentNumber)+") ",1),(0,n.createElementVNode)("span",{onClick:n=>e.transferAction(t.agentNumber,"agent")},aR,8,iR)])):(0,n.createCommentVNode)("",!0)])),_:1},8,["data","props","filter-node-method"])])),_:1},8,["onVisibleChange","filter-method","modelValue"])])),_:1}),(0,n.createVNode)(u,{label:"外线电话",name:"outline"},{default:(0,n.withCtx)((()=>[(0,n.createElementVNode)("div",lR,[(0,n.createVNode)(d,{modelValue:e.outlineNumber,"onUpdate:modelValue":t[1]||(t[1]=t=>e.outlineNumber=t),size:"mini",clearable:"",placeholder:"请输入手机或完整的区号电话号码",style:{width:"244px"}},null,8,["modelValue"]),(0,n.createVNode)(p,{type:"primary",size:"default",class:"action-btn",disabled:!e.outlineNumber,onClick:t[2]||(t[2]=(0,n.withModifiers)((t=>e.transferAction(e.outlineNumber,"outline",e.outlineNumber)),["stop"]))},{default:(0,n.withCtx)((()=>[cR])),_:1},8,["disabled"])])])),_:1})])),_:1},8,["modelValue","onTabClick"])])}var dR=(0,n.defineComponent)({name:"transferConsult",components:{},props:{module:{type:String,default:""}},setup(){(0,n.ref)(null);const e=(0,n.reactive)({activeName:"agent",outlineNumber:"",ivrList:[],ivrObj:{name:"",nodeId:""},agentOptions:[],form:{id:"",label:""},props:{children:"children",label:"label"}}),t=(e,t)=>{if("outline"===t&&(!Fx(e)||!e))return $x.error("请输入正确的号码"),!1;window.ueSoftphone.call.consult({mode:t,agentNumber:e,fail:e=>{console.log(e,"success============")}})},r=()=>{window.ueSoftphone.agent.findIdleAgentsForQueue({success:t=>{if(t&&t.success&&t.dataList){const n=[];t.dataList.forEach((e=>{const t={value:e._id,label:e.name,freeNumber:0};let r=0;const o=[];e.members&&e.members.length>0?e.members.forEach((n=>{if("00000"!==n.agentId){const e={value:n.agentId,label:`${n.agentName}[${n.agentNumber}]`,callStatus:n.callStatus,callStatusName:n.callStatusName,agentNumber:n.agentNumber};"0"===n.callStatus?r++:e.disabled=!0,o.push(e)}else 1===e.members.length&&(t.disabled=!0)})):t.disabled=!0,t.freeNumber=r,o.length>0&&(t.children=o),t.freeNumber>0&&n.push(t)})),e.agentOptions=n}}})},o=e=>{window.ueSoftphone.call.transfer({type:"agent",number:e.agentNumber,success:e=>{console.log(e,"success============")}})},i=()=>{(0,n.nextTick)((()=>{console.log("切换")}))},s=e=>{e&&r()};return{...(0,n.toRefs)(e),transferClick:o,fetchQueueOnlineAgents:r,handleClick:i,transferAction:t,visibleChange:s}}});const pR=(0,Fw.A)(dR,[["render",uR],["__scopeId","data-v-1618b142"]]);var hR=pR,fR=__webpack_require__.p+"img/wifi1.b7af5ed5.svg",gR=__webpack_require__.p+"img/wifi2.1648a543.svg",mR=__webpack_require__.p+"img/wifi3.ec030889.svg",vR=__webpack_require__.p+"img/wifi4.101d572a.svg";const yR=["src"];var bR=(0,n.defineComponent)({props:{networkdelayBarMsg:{type:Object,default:()=>null}},setup(e){const t=e,r=(0,n.computed)((()=>{let e=vR;const n=t.networkdelayBarMsg.delay;return 0<n&&n<100?e=fR:n>=100&&n<200?e=gR:n>=200&&n<500?e=mR:n>=500&&(e=vR),e}));return(t,o)=>{const i=ql;return(0,n.openBlock)(),(0,n.createBlock)(i,{placement:"bottom",content:"延迟:"+e.networkdelayBarMsg.delay+"ms"},{default:(0,n.withCtx)((()=>[(0,n.unref)(r)?((0,n.openBlock)(),(0,n.createElementBlock)("img",{key:0,src:(0,n.unref)(r)},null,8,yR)):(0,n.createCommentVNode)("",!0)])),_:1},8,["content"])}}});const wR=bR;var CR=wR,SR=__webpack_require__(436),ER=__webpack_require__.n(SR),TR=(0,n.defineComponent)({name:"telephoneStrip",components:{phoneBarTimer:px,formItem:yx,transferOprate:eR,consuleOprate:hR,callQueue:zw,networkDelay:CR,translationTxt:Nr},directives:{move:wx,int:Ux},created(){this.initPhone()},setup(){const e=(0,n.ref)(!0),t=(0,n.ref)(null),r=(0,n.ref)(null),o=(0,n.ref)(null),i=((0,n.ref)(null),(0,n.ref)(!1)),s=(0,n.ref)({}),a=(0,n.ref)(!1),l=(0,n.ref)({}),c=(0,n.ref)(!1),u=(0,n.ref)([]),d=(0,n.reactive)({actionModule:"transfer",errorObj:{isError:!1,type:"",message:""},stateType:"free",currentCallType:"",showConfig:!1,callConfig:{autoAnswer:!1,sipNumber:"",autoAnswerTime:"0",mobile:"",loginType:""},showNum:!0,accountConfig:{forbidDialInHangup:!1,forbidDialOutHangup:!1,ringCard:!1},defaultConfig:{},AnswerOffline:!1,sipNumberList:[],dialoutNumber:"",renderMap:{PSTN_INVALID:["dialout"],PSTN_CALLIN_CALLING:["hangup"],PSTN_CALLOUT_CALLING:["hangup"],PSTN_CALLIN_RING:["hangup","animation"],PSTN_CALLOUT_RING:["hangup"],PSTN_TRANSFER_RING:["hangup","animation"],PSTN_CALLIN_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_CALLOUT_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_TRANSFER_ARRANGE:["dialout"],PSTN_CONSULTTRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],PSTN_CALLIN_MUTE:["hangup","mutecancel"],PSTN_CALLOUT_MUTE:["hangup","mutecancel"],PSTN_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],PSTN_CALLIN_HOLD:["hangup","holdcancel"],PSTN_CALLOUT_HOLD:["hangup","holdcancel"],PSTN_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],PSTN_CALLIN_ARRANGE:["dialout"],PSTN_CALLOUT_ARRANGE:["dialout"],PSTN_CONSULTTRANSFER_ARRANGE:["dialout"],PSTN_BUSY:["dialout"],PSTN_CALLOUT_BUSY:["dialout"],PSTN_CALLIN_BUSY:["dialout"],PSTN_DISCONNECTED:["showquick"],WAITCONSUL:["hangup","cancelconcul"],CONSULCANCEL:["hangup","concul","takeback"],CONSULPICKUP:["hangup","endconsul","threepartycall","concultransfer"],CONSULING:["hangup"],THREECALL:["hangup"],LISTEN:["hangup"],WHISPER:["hangup"],PSTN_CONSULT_RING:["hangup"],SIP_INVALID:["dialout"],SIP_CALLIN_CALLING:["hangup"],SIP_CALLOUT_CALLING:["hangup"],SIP_CALLIN_RING:["hangup"],SIP_CALLOUT_RING:["hangup"],SIP_TRANSFER_RING:["hangup"],SIP_CALLIN_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CALLOUT_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CONSULTTRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction"],SIP_CALLIN_MUTE:["hangup","mutecancel"],SIP_CALLOUT_MUTE:["hangup","mutecancel"],SIP_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],SIP_CALLIN_HOLD:["hangup","holdcancel"],SIP_CALLOUT_HOLD:["hangup","holdcancel"],SIP_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],SIP_CALLIN_ARRANGE:["dialout"],SIP_CALLOUT_ARRANGE:["dialout"],SIP_CONSULTTRANSFER_ARRANGE:["dialout"],SIP_TRANSFER_ARRANGE:["dialout"],SIP_BUSY:["dialout"],SIP_CALLOUT_BUSY:["dialout"],SIP_CALLIN_BUSY:["dialout"],SIP_DISCONNECTED:["showquick"],SIP_CONSULT_RING:["hangup"],WEBRTC_INVALID:["dialout","disconnect"],WEBRTC_CALLIN_CALLING:["hangup"],WEBRTC_CALLOUT_CALLING:["hangup"],WEBRTC_CALLIN_RING:["hangup","answer"],WEBRTC_CALLOUT_RING:["hangup"],WEBRTC_TRANSFER_RING:["hangup","answer","animation"],WEBRTC_CALLIN_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_CALLOUT_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_TRANSFER_LINK:["hangup","hold","mute","transfer","concul","satisfaction","key"],WEBRTC_CONSULTTRANSFER_LINK:["hangup","hold","mute","key","transfer","concul","satisfaction"],WEBRTC_CALLIN_MUTE:["hangup","mutecancel"],WEBRTC_CALLOUT_MUTE:["hangup","mutecancel"],WEBRTC_CONSULTTRANSFER_MUTE:["hangup","mutecancel"],WEBRTC_CALLIN_HOLD:["hangup","holdcancel"],WEBRTC_CALLOUT_HOLD:["hangup","holdcancel"],WEBRTC_CONSULTTRANSFER_HOLD:["hangup","holdcancel"],WEBRTC_CALLIN_ARRANGE:["dialout"],WEBRTC_CALLOUT_ARRANGE:["dialout"],WEBRTC_CONSULTTRANSFER_ARRANGE:["dialout"],WEBRTC_TRANSFER_ARRANGE:["dialout"],WEBRTC_DISCONNECTED:["connect","showquick"],WEBRTC_BUSY:["dialout"],WEBRTC_CALLOUT_BUSY:["dialout"],WEBRTC_CALLIN_BUSY:["dialout"],WEBRTC_CONSULT_RING:["hangup","answer"],TRANSFER_OPRATE:["transferoprate","hangup"],CONSULE_OPRATE:["consuleoprate","hangup"]},currentStatus:"PSTN_INVALID",currentStatusName:"空闲",callingNumber:"",keyList:["1","2","3","4","5","6","7","8","9"],loginType:"",loginTypeMap:{PSTN:"手机模式",SIP:"SIP话机",WEBRTC:"软电话"},loginTypeList:[{value:"PSTN",label:"手机模式"},{value:"SIP",label:"SIP话机"},{value:"WEBRTC",label:"软电话"}],ivrList:[],agentStatusList:[],agentStatusNumber:"",isTransterBtn:!0,isOpenpanel:!1,quickToWhole:!1,showInput:!1,showDial:!0,transferState:!1,consulSelect:!1,webrtcKeyState:!1,callRcentState:!0,quickState:!1,customerInfo:{number:"",name:"",place:"",tag:"",displayNumber:"",active:!1},backStatus:"",switchQuickState(e){d.quickState=e},switchKey(e){d.callRcentState=e},setTransferState(e){e?(d.backStatus=d.currentStatus,d.currentStatus="TRANSFER_OPRATE"):d.currentStatus=d.backStatus},setConsulState(e){e?(d.backStatus=d.currentStatus,d.currentStatus="CONSULE_OPRATE"):d.currentStatus=d.backStatus},setWebrtcKeyState(e){d.webrtcKeyState=e},toAnswerOffline(e){const t=e?"1":"0";window.ueSoftphone.agent.setAnswerOffline({toAnswerOffline:t,success:()=>{console.log({message:"设置成功",type:"success"})},fail:()=>{console.log({message:"设置失败",type:"error"})}})},inputChange(e){/^[0-9*#]*$/.test(e)&&(d.dialoutNumber=e)},initPhone(){let t;window&&window.ueSimpleSoftphone&&window.ueSimpleSoftphone.initParams?(t=window.ueSimpleSoftphone.initParams,i.value=!!t.isOpenCallQueue,a.value=!!t.isOpenNetwork,c.value=!!t.openNlsTranslation):(t={accountId:"uecs1",agentNumber:"8005",password:"Aa132456@",loginType:"WEBRTC",isOpenCallQueue:!1,isOpenNetwork:!0,openNlsTranslation:!0,server:"https://dev1.useasy.cn/api"},i.value=!!t.isOpenCallQueue,a.value=!!t.isOpenNetwork,c.value=!!t.openNlsTranslation);const n=t.loginType||"WEBRTC";window.ueSoftphone=new(ER())({accountId:t.accountId,agentNumber:t.agentNumber,password:t.password,loginType:n,server:t.server||null,isOpenCallQueue:t.isOpenCallQueue||!1,isOpenNetwork:t.isOpenNetwork||!1,openNlsTranslation:t.openNlsTranslation||!1,error(e){"2005"===e.code?(d.errorObj.isError=!0,d.errorObj.message="当前License数量不足请联系管理员"):e.message&&console.log({message:e.message,type:"error"})},success(e){d.callConfig.loginType=n,d.errorObj.isError=!1,d.getAgentPhoneBarList(),d.getAvailableSipNumberList()}}),window.ueSoftphone.listenCallEvent({event:t=>{const n=t.data;window.ueSimpleSoftphone&&window.ueSimpleSoftphone.backEventFunction&&window.ueSimpleSoftphone.backEventFunction(t),"KICK_OFF"===n.subType&&n.data.kickoff&&(e.value=!1)},success(e){console.log(e,"989909")},error(e){e.message&&console.log({message:e.message,type:"error"})},message:e=>{console.log(e,"89999");const t=e.data;if("status"===e.subtype){d.currentStatusName=t.stateName;const e="5"===t.state?"countDown":"timing";t.statusTime?d.timeRecording(e,t.statusTime):d.timeRecording(e)}else"login"===e.subtype&&(d.loginType=t.loginType||"WEBRTC");window.ueSimpleSoftphone&&window.ueSimpleSoftphone.backEventFunction&&window.ueSimpleSoftphone.backEventFunction(t),d.currentStatus=d.getCurrentStatus(t.state,t.callType,t.eventType)}}),window.ueSoftphone.listenCallQueueEvent({success(e){console.log("简易监听呼叫队列socket成功",e)},message(e){e.success&&(s.value=e.data),console.log(e,"简易获取呼叫队列数据成功")}}),window.ueSoftphone.listenTranslationEvent({success(e){console.log("简易监听实时转译socket成功",e)},message(e){console.log(e,"简易获取实时转译数据成功"),"translation"==e.subtype&&("translationStart"==e.data.eventType&&(u.value=[]),"translationText"==e.data.eventType&&u.value.push(e.data))}}),window.ueSoftphone.listenCallNetork({message(e){l.value=e,console.log(e,"简易监听网络检测事件")}})},setCustomerInfo(e){const t=e.callType||"";e.callEvent;if("calling"===d.stateType||"ring"===d.stateType||"called"===d.stateType){d.customerInfo.displayNumber="dialout"===t?e.displayNumber?"外显号:"+e.displayNumber:"":e.trunkNumber?"服务号:"+e.trunkNumber:"",e.number&&(d.customerInfo.number=e.number,d.customerInfo.name||(d.customerInfo.active||(d.customerInfo.active=!0),console.log("未设置名称")));let n="";"86"===e.customerCountryCode?e.customerProvince&&(n=e.customerProvince+"-"+e.customerCity):e.customerCountry&&(n=e.customerCountry),d.customerInfo.place=n}["calling","called","ring"].includes(d.stateType)||(d.customerInfo={number:"",name:"",place:"",tag:"",displayNumber:"",active:!1}),console.log(e,"")},initPhoneOpenState(){const e=localStorage.getItem("phoneUnfoldState");null===e||"true"===e?d.setUnfoldState(!0):d.setUnfoldState(!1)},setBack(){d.showDial=!0,d.showConfig=!1},goToSetting(){d.showDial=!1,d.showConfig=!0},deleteNum(){if(d.dialoutNumber){const e=d.dialoutNumber.length;d.dialoutNumber=d.dialoutNumber.substring(0,e-1)}},dialout(e,t){t&&(e?window.ueSoftphone&&window.ueSoftphone.call.callout({customerNumber:e,success(e){console.log({message:"外呼成功",type:"success",duration:5e3})},fail(e){$x.error({message:e.message,type:"error"}),console.log({message:e.message,type:"error"})}}):$x.error({message:"请填写外呼号码",type:"error"}))},hangup(){window.ueSoftphone&&window.ueSoftphone.call.hangup({fail(e){console.error(e,"error")}})},holdOrUnHold(e){window.ueSoftphone&&window.ueSoftphone.call.holdOrUnHold({type:e,fail(e){console.error(e,"error")}})},muteOrUnMute(e){window.ueSoftphone&&window.ueSoftphone.call.muteOrUnMute({type:e,fail(e){console.error(e,"error")}})},resumeConsult(){window.ueSoftphone.call.callbackConsult({success:()=>{console.log("取消咨询")}})},consultTransfer(){window.ueSoftphone.call.consultTransfer({success:()=>{console.log("咨询转移成功")}})},threeWayCall(){window.ueSoftphone.call.threeWayCall({success:()=>{console.log("三方通话成功")}})},stopConsult(){window.ueSoftphone.call.cancelconsult({success:()=>{console.log("取消咨询")}})},cancelConsult(){window.ueSoftphone.call.cancelconsult({success:()=>{console.log("取消咨询")}})},satisfaction(){window.ueSoftphone.call.evaluate({type:"SATISFACTION"})},transOrUntrans(){d.isTransterBtn=!d.isTransterBtn},accept(){window.ueSoftphone.webrtc.accept()},sendDTMF(e){d.dialoutNumber+=e,d.isVisibleBtn("key")&&window.ueSoftphone.call.sendDTMF(e)},connect(){window.ueSoftphone=null,d.initPhone()},disconnect(){window.ueSoftphone.call.disconnect()},keyDowndialout(e){13===e.keyCode&&d.dialout(d.dialoutNumber,!1)},updateLoginType(){const{loginType:e,sipNumber:t}=d.callConfig,n={loginType:e};"SIP"===e&&t&&(n.loginNumber=t),window.ueSoftphone.agent.switchLoginType({...n,success:()=>{d.loginType=e,localStorage.setItem("phoneLoginType",e),d.setBack(),d.updateCurrentStatus(),console.log({message:"切换成功",type:"success"})},fail:()=>{console.log({message:"切换失败",type:"error"})}})},getAgentPhoneBarList(){window.ueSoftphone.agent.findPhoneBarList({success:e=>{d.agentStatusList=e.data}})},updateAgentStatus(e){window.ueSoftphone.agent.switchPhoneBar({stateNumber:e})},getAvailableSipNumberList(){window.ueSoftphone.agent.getAvailableSipNumberList({success:e=>{e.success&&(d.sipNumberList=e.data)}})},initUserConfig(e){d.AnswerOffline=!(!e.toAnswerOffline||"1"!==e.toAnswerOffline)},isVisibleBtn(e){if(d.currentStatus){const t=d.renderMap[d.currentStatus]||"";return t&&t.indexOf(e)>-1}},getCurrentStatus(e,t,n){let r="";console.log(e,t,n,"687678676"),t&&(d.currentCallType=t);const o=t?"_"+t.toUpperCase():"";switch(d.quickToWhole=!1,e){case"0":r=d.loginType+"_INVALID",d.stateType="free";break;case"1":r=d.loginType+o+"_BUSY",d.stateType="busy";break;case"2":r=d.loginType+o+"_CALLING",d.stateType="calling";break;case"3":r="consult"===n?d.loginType+"_CONSULT_RING":d.loginType+o+"_RING",d.stateType="ring";break;case"4":r="consult"===n?"WAITCONSUL":"callBack"===n?"CONSULCANCEL":d.loginType+o+"_LINK",d.stateType="called";break;case"5":r=d.loginType+o+"_ARRANGE",d.stateType="busy";break;case"6":r=d.loginType+o+"_HOLD",d.stateType="called";break;case"7":r=d.loginType+o+"_MUTE",d.stateType="called";break;case"8":r=d.loginType+o+"_DISCONNECTED",d.stateType="disconnect";break;case"9":r=d.loginType+o+"_DISCONNECTED",d.stateType="disconnect";break;case"10":r="callback"===n?"CONSULCANCEL":"CONSULPICKUP",d.stateType="called";break;case"11":r="THREECALL",d.stateType="called";break;case"12":r="CONSULING",d.stateType="called";break;case"13":r="THREECALL",d.stateType="called";break;case"14":r="LISTEN",d.stateType="called";break;case"15":r="WHISPER",d.stateType="called";break;default:r=d.loginType+o+"_BUSY",d.stateType="busy";break}return r},updateCurrentStatus(){const e=d.currentStatus.split("_");e[0]!==d.loginType&&(e[0]=d.loginType,d.currentStatus=e.join("_"))},timeRecording(e,n){let i=0;if(n){const e=new Date(n),t=new Date,r=t.getTime()-e.getTime();i=r>0?r/1e3:0}console.log(t,"cccccccccccccccccccccccccccccccccccccccccccccc"),t.value.timerTypeChange({timeType:e,statusTime:i}),r.value.timerTypeChange({timeType:e,statusTime:i}),o.value.timerTypeChange({timeType:e,statusTime:i})},changeOpenState(){d.setUnfoldState(!d.isOpenpanel)},setUnfoldState(e){d.isOpenpanel=e,localStorage.setItem("phoneUnfoldState",JSON.stringify(e))}}),p=(0,n.reactive)({setDialState(e){e.showDial=e},toggleDialState(){d.showDial=!d.showDial}}),h=(0,n.computed)((()=>d.isVisibleBtn("answer")));(0,n.watch)(h,(e=>{if(e&&d.callConfig.autoAnswer){const e=d.callConfig.autoAnswerTime?1e3*Number(d.callConfig.autoAnswerTime):0;setTimeout((()=>{d.accept()}),e)}}));const f=(0,n.computed)((()=>"")),g=(0,n.computed)((()=>["calling","called","ring"].includes(d.stateType)));(0,n.watch)(g,(e=>{e&&(d.dialoutNumber="",d.accountConfig.ringCard?d.quickState=!1:d.quickState=!0)}));const m=(0,n.computed)((()=>(console.log(d.stateType,"990990"),!["free","busy","disconnect"].includes(d.stateType)||d.errorObj.isError))),v=(0,n.computed)((()=>"dialout"===d.currentCallType?!d.accountConfig.forbidDialOutHangup:"incoming"!==d.currentCallType||!d.accountConfig.forbidDialInHangup)),y=(0,n.reactive)({defaultKeyboardPlaceholder:"输入号码点击回车键发起呼叫",showKeyboardPlaceholder:!0}),b=()=>{const e={...d.defaultConfig,loginType:d.callConfig.loginType};d.callConfig=Cx(e)},w=e=>{qx(e)||(d.callConfig.mobile="",$x.error("只能输入数字"))},C=()=>{};(0,n.onMounted)((()=>{C()}));const S=e=>{if(d.currentStatus){const t=d.renderMap[d.currentStatus]||"";return t&&t.indexOf(e)>-1}};return{...(0,n.toRefs)(d),...(0,n.toRefs)(y),...(0,n.toRefs)(p),isVisibleBtn:S,disabledSwitch:g,hiddenOprate:m,phoneBarPeerTimeRef:t,phoneBarStatusTimeRef:r,phoneBarQuickStatusTimeRef:o,pushServe:f,validFun:w,changeType:b,showHangupBtn:v,aaa:e,callQueueBar:i,callQueueBarMsg:s,networkDelayBar:a,networkdelayBarMsg:l,openNlsTranslationBar:c,openNlsTranslationBarMsg:u}}});const kR=(0,Fw.A)(TR,[["render",lx],["__scopeId","data-v-168ff1fe"]]);var xR=kR,NR=(0,n.defineComponent)({name:"App",components:{telephoneStrip:xR}});const RR=(0,Fw.A)(NR,[["render",mr]]);var IR=RR,_R=IR}(),__webpack_exports__=__webpack_exports__["default"],__webpack_exports__}()}));
49
49
  //# sourceMappingURL=myLib.umd.min.js.map