"use strict";var Xe=Object.defineProperty;var Ge=(t,e,n)=>e in t?Xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var O=(t,e,n)=>(Ge(t,typeof e!="symbol"?e+"":e,n),n);function Ae(t,e){return function(){return t.apply(e,arguments)}}const{toString:Ye}=Object.prototype,{getPrototypeOf:ie}=Object,z=(t=>e=>{const n=Ye.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>z(e)===t),J=t=>e=>typeof e===t,{isArray:_}=Array,I=J("undefined");function Qe(t){return t!==null&&!I(t)&&t.constructor!==null&&!I(t.constructor)&&T(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ne=N("ArrayBuffer");function Ze(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ne(t.buffer),e}const et=J("string"),T=J("function"),Pe=J("number"),V=t=>t!==null&&typeof t=="object",tt=t=>t===!0||t===!1,j=t=>{if(z(t)!=="object")return!1;const e=ie(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},nt=N("Date"),rt=N("File"),st=N("Blob"),ot=N("FileList"),it=t=>V(t)&&T(t.pipe),at=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||T(t.append)&&((e=z(t))==="formdata"||e==="object"&&T(t.toString)&&t.toString()==="[object FormData]"))},ct=N("URLSearchParams"),[lt,ut,ft,dt]=["ReadableStream","Request","Response","Headers"].map(N),ht=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function q(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),_(t))for(r=0,s=t.length;r0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Le=t=>!I(t)&&t!==Ce;function Z(){const{caseless:t}=Le(this)&&this||{},e={},n=(r,s)=>{const o=t&&xe(e,s)||s;j(e[o])&&j(r)?e[o]=Z(e[o],r):j(r)?e[o]=Z({},r):_(r)?e[o]=r.slice():e[o]=r};for(let r=0,s=arguments.length;r(q(e,(s,o)=>{n&&T(s)?t[o]=Ae(s,n):t[o]=s},{allOwnKeys:r}),t),mt=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),yt=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},gt=(t,e,n,r)=>{let s,o,i;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),o=s.length;o-- >0;)i=s[o],(!r||r(i,t,e))&&!c[i]&&(e[i]=t[i],c[i]=!0);t=n!==!1&&ie(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},wt=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},bt=t=>{if(!t)return null;if(_(t))return t;let e=t.length;if(!Pe(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Et=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ie(Uint8Array)),St=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let s;for(;(s=r.next())&&!s.done;){const o=s.value;e.call(t,o[0],o[1])}},Ot=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Rt=N("HTMLFormElement"),Tt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),de=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),At=N("RegExp"),De=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};q(n,(s,o)=>{let i;(i=e(s,o,t))!==!1&&(r[o]=i||s)}),Object.defineProperties(t,r)},Nt=t=>{De(t,(e,n)=>{if(T(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(T(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Pt=(t,e)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return _(t)?r(t):r(String(t).split(e)),n},xt=()=>{},Ct=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e,X="abcdefghijklmnopqrstuvwxyz",he="0123456789",Fe={DIGIT:he,ALPHA:X,ALPHA_DIGIT:X+X.toUpperCase()+he},Lt=(t=16,e=Fe.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function Dt(t){return!!(t&&T(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const Ft=t=>{const e=new Array(10),n=(r,s)=>{if(V(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[s]=r;const o=_(r)?[]:{};return q(r,(i,c)=>{const f=n(i,s+1);!I(f)&&(o[c]=f)}),e[s]=void 0,o}}return r};return n(t,0)},_t=N("AsyncFunction"),Bt=t=>t&&(V(t)||T(t))&&T(t.then)&&T(t.catch),a={isArray:_,isArrayBuffer:Ne,isBuffer:Qe,isFormData:at,isArrayBufferView:Ze,isString:et,isNumber:Pe,isBoolean:tt,isObject:V,isPlainObject:j,isReadableStream:lt,isRequest:ut,isResponse:ft,isHeaders:dt,isUndefined:I,isDate:nt,isFile:rt,isBlob:st,isRegExp:At,isFunction:T,isStream:it,isURLSearchParams:ct,isTypedArray:Et,isFileList:ot,forEach:q,merge:Z,extend:pt,trim:ht,stripBOM:mt,inherits:yt,toFlatObject:gt,kindOf:z,kindOfTest:N,endsWith:wt,toArray:bt,forEachEntry:St,matchAll:Ot,isHTMLForm:Rt,hasOwnProperty:de,hasOwnProp:de,reduceDescriptors:De,freezeMethods:Nt,toObjectSet:Pt,toCamelCase:Tt,noop:xt,toFiniteNumber:Ct,findKey:xe,global:Ce,isContextDefined:Le,ALPHABET:Fe,generateString:Lt,isSpecCompliantForm:Dt,toJSONObject:Ft,isAsyncFn:_t,isThenable:Bt};function p(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(p,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const _e=p.prototype,Be={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Be[t]={value:t}});Object.defineProperties(p,Be);Object.defineProperty(_e,"isAxiosError",{value:!0});p.from=(t,e,n,r,s,o)=>{const i=Object.create(_e);return a.toFlatObject(t,i,function(f){return f!==Error.prototype},c=>c!=="isAxiosError"),p.call(i,t.message,e,n,r,s),i.cause=t,i.name=t.name,o&&Object.assign(i,o),i};const kt=null;function ee(t){return a.isPlainObject(t)||a.isArray(t)}function ke(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function pe(t,e,n){return t?t.concat(e).map(function(s,o){return s=ke(s),!n&&o?"["+s+"]":s}).join(n?".":""):e}function Ut(t){return a.isArray(t)&&!t.some(ee)}const It=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function v(t,e,n){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,E){return!a.isUndefined(E[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function u(h){if(h===null)return"";if(a.isDate(h))return h.toISOString();if(!f&&a.isBlob(h))throw new p("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(h)||a.isTypedArray(h)?f&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function l(h,m,E){let S=h;if(h&&!E&&typeof h=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(a.isArray(h)&&Ut(h)||(a.isFileList(h)||a.endsWith(m,"[]"))&&(S=a.toArray(h)))return m=ke(m),S.forEach(function(w,k){!(a.isUndefined(w)||w===null)&&e.append(i===!0?pe([m],k,o):i===null?m:m+"[]",u(w))}),!1}return ee(h)?!0:(e.append(pe(E,m,o),u(h)),!1)}const d=[],g=Object.assign(It,{defaultVisitor:l,convertValue:u,isVisitable:ee});function y(h,m){if(!a.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),a.forEach(h,function(S,P){(!(a.isUndefined(S)||S===null)&&s.call(e,S,a.isString(P)?P.trim():P,m,g))===!0&&y(S,m?m.concat(P):[P])}),d.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return y(t),e}function me(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function ae(t,e){this._pairs=[],t&&v(t,this,e)}const Ue=ae.prototype;Ue.append=function(e,n){this._pairs.push([e,n])};Ue.toString=function(e){const n=e?function(r){return e.call(this,r,me)}:me;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function qt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ie(t,e,n){if(!e)return t;const r=n&&n.encode||qt,s=n&&n.serialize;let o;if(s?o=s(e,n):o=a.isURLSearchParams(e)?e.toString():new ae(e,n).toString(r),o){const i=t.indexOf("#");i!==-1&&(t=t.slice(0,i)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class ye{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){a.forEach(this.handlers,function(r){r!==null&&e(r)})}}const qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ht=typeof URLSearchParams<"u"?URLSearchParams:ae,jt=typeof FormData<"u"?FormData:null,Mt=typeof Blob<"u"?Blob:null,$t={isBrowser:!0,classes:{URLSearchParams:Ht,FormData:jt,Blob:Mt},protocols:["http","https","file","blob","url","data"]},ce=typeof window<"u"&&typeof document<"u",Wt=(t=>ce&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),zt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jt=ce&&window.location.href||"http://localhost",Vt=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ce,hasStandardBrowserEnv:Wt,hasStandardBrowserWebWorkerEnv:zt,origin:Jt},Symbol.toStringTag,{value:"Module"})),A={...Vt,...$t};function vt(t,e){return v(t,new A.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,o){return A.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function Kt(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Xt(t){const e={},n=Object.keys(t);let r;const s=n.length;let o;for(r=0;r=n.length;return i=!i&&a.isArray(s)?s.length:i,f?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),e(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=Xt(s[i])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const n={};return a.forEachEntry(t,(r,s)=>{e(Kt(r),s,n,0)}),n}return null}function Gt(t,e,n){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const H={transitional:qe,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(e);if(o&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(He(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return vt(e,this.formSerializer).toString();if((c=a.isFileList(e))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return v(c?{"files[]":e}:e,f&&new f,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Gt(e)):e}],transformResponse:[function(e){const n=this.transitional||H.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e)}catch(c){if(i)throw c.name==="SyntaxError"?p.from(c,p.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{H.headers[t]={}});const Yt=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Qt=t=>{const e={};let n,r,s;return t&&t.split(` `).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||e[n]&&Yt[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},ge=Symbol("internals");function U(t){return t&&String(t).trim().toLowerCase()}function M(t){return t===!1||t==null?t:a.isArray(t)?t.map(M):String(t)}function Zt(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const en=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function G(t,e,n,r,s){if(a.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!a.isString(e)){if(a.isString(r))return e.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(e)}}function tn(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function nn(t,e){const n=a.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,o,i){return this[r].call(this,e,s,o,i)},configurable:!0})})}class R{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function o(c,f,u){const l=U(f);if(!l)throw new Error("header name must be a non-empty string");const d=a.findKey(s,l);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||f]=M(c))}const i=(c,f)=>a.forEach(c,(u,l)=>o(u,l,f));if(a.isPlainObject(e)||e instanceof this.constructor)i(e,n);else if(a.isString(e)&&(e=e.trim())&&!en(e))i(Qt(e),n);else if(a.isHeaders(e))for(const[c,f]of e.entries())o(f,c,r);else e!=null&&o(n,e,r);return this}get(e,n){if(e=U(e),e){const r=a.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return Zt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=U(e),e){const r=a.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||G(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function o(i){if(i=U(i),i){const c=a.findKey(r,i);c&&(!n||G(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(e)?e.forEach(o):o(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!e||G(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=M(s),delete n[o];return}const c=e?tn(o):String(o).trim();c!==o&&delete n[o],n[c]=M(s),r[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[ge]=this[ge]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=U(i);r[c]||(nn(s,i),r[c]=!0)}return a.isArray(e)?e.forEach(o):o(e),this}}R.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(R.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});a.freezeMethods(R);function Y(t,e){const n=this||H,r=e||n,s=R.from(r.headers);let o=r.data;return a.forEach(t,function(c){o=c.call(n,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function je(t){return!!(t&&t.__CANCEL__)}function B(t,e,n){p.call(this,t??"canceled",p.ERR_CANCELED,e,n),this.name="CanceledError"}a.inherits(B,p,{__CANCEL__:!0});function Me(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new p("Request failed with status code "+n.status,[p.ERR_BAD_REQUEST,p.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function rn(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function sn(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,o=0,i;return e=e!==void 0?e:1e3,function(f){const u=Date.now(),l=r[o];i||(i=u),n[s]=f,r[s]=u;let d=o,g=0;for(;d!==s;)g+=n[d++],d=d%t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),u-ir)return s&&(clearTimeout(s),s=null),n=c,t.apply(null,arguments);s||(s=setTimeout(()=>(s=null,n=Date.now(),t.apply(null,arguments)),r-(c-n)))}}const $=(t,e,n=3)=>{let r=0;const s=sn(50,250);return on(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,f=i-r,u=s(f),l=i<=c;r=i;const d={loaded:i,total:c,progress:c?i/c:void 0,bytes:f,rate:u||void 0,estimated:u&&c&&l?(c-i)/u:void 0,event:o,lengthComputable:c!=null};d[e?"download":"upload"]=!0,t(d)},n)},an=A.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(o){let i=o;return e&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(i){const c=a.isString(i)?s(i):i;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}(),cn=A.hasStandardBrowserEnv?{write(t,e,n,r,s,o){const i=[t+"="+encodeURIComponent(e)];a.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),a.isString(r)&&i.push("path="+r),a.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ln(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function un(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function $e(t,e){return t&&!ln(e)?un(t,e):e}const we=t=>t instanceof R?{...t}:t;function D(t,e){e=e||{};const n={};function r(u,l,d){return a.isPlainObject(u)&&a.isPlainObject(l)?a.merge.call({caseless:d},u,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(u,l,d){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u,d)}else return r(u,l,d)}function o(u,l){if(!a.isUndefined(l))return r(void 0,l)}function i(u,l){if(a.isUndefined(l)){if(!a.isUndefined(u))return r(void 0,u)}else return r(void 0,l)}function c(u,l,d){if(d in e)return r(u,l);if(d in t)return r(void 0,u)}const f={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(u,l)=>s(we(u),we(l),!0)};return a.forEach(Object.keys(Object.assign({},t,e)),function(l){const d=f[l]||s,g=d(t[l],e[l],l);a.isUndefined(g)&&d!==c||(n[l]=g)}),n}const We=t=>{const e=D({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=e;e.headers=i=R.from(i),e.url=Ie($e(e.baseURL,e.url),t.params,t.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")));let f;if(a.isFormData(n)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((f=i.getContentType())!==!1){const[u,...l]=f?f.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...l].join("; "))}}if(A.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(e)),r||r!==!1&&an(e.url))){const u=s&&o&&cn.read(o);u&&i.set(s,u)}return e},fn=typeof XMLHttpRequest<"u",dn=fn&&function(t){return new Promise(function(n,r){const s=We(t);let o=s.data;const i=R.from(s.headers).normalize();let{responseType:c}=s,f;function u(){s.cancelToken&&s.cancelToken.unsubscribe(f),s.signal&&s.signal.removeEventListener("abort",f)}let l=new XMLHttpRequest;l.open(s.method.toUpperCase(),s.url,!0),l.timeout=s.timeout;function d(){if(!l)return;const y=R.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),m={data:!c||c==="text"||c==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:y,config:t,request:l};Me(function(S){n(S),u()},function(S){r(S),u()},m),l=null}"onloadend"in l?l.onloadend=d:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(d)},l.onabort=function(){l&&(r(new p("Request aborted",p.ECONNABORTED,s,l)),l=null)},l.onerror=function(){r(new p("Network Error",p.ERR_NETWORK,s,l)),l=null},l.ontimeout=function(){let h=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const m=s.transitional||qe;s.timeoutErrorMessage&&(h=s.timeoutErrorMessage),r(new p(h,m.clarifyTimeoutError?p.ETIMEDOUT:p.ECONNABORTED,s,l)),l=null},o===void 0&&i.setContentType(null),"setRequestHeader"in l&&a.forEach(i.toJSON(),function(h,m){l.setRequestHeader(m,h)}),a.isUndefined(s.withCredentials)||(l.withCredentials=!!s.withCredentials),c&&c!=="json"&&(l.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&l.addEventListener("progress",$(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",$(s.onUploadProgress)),(s.cancelToken||s.signal)&&(f=y=>{l&&(r(!y||y.type?new B(null,t,l):y),l.abort(),l=null)},s.cancelToken&&s.cancelToken.subscribe(f),s.signal&&(s.signal.aborted?f():s.signal.addEventListener("abort",f)));const g=rn(s.url);if(g&&A.protocols.indexOf(g)===-1){r(new p("Unsupported protocol "+g+":",p.ERR_BAD_REQUEST,t));return}l.send(o||null)})},hn=(t,e)=>{let n=new AbortController,r;const s=function(f){if(!r){r=!0,i();const u=f instanceof Error?f:this.reason;n.abort(u instanceof p?u:new B(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{s(new p(`timeout ${e} of ms exceeded`,p.ETIMEDOUT))},e);const i=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(f=>{f&&(f.removeEventListener?f.removeEventListener("abort",s):f.unsubscribe(s))}),t=null)};t.forEach(f=>f&&f.addEventListener&&f.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=i,[c,()=>{o&&clearTimeout(o),o=null}]},pn=function*(t,e){let n=t.byteLength;if(!e||n{const o=mn(t,e,s);let i=0;return new ReadableStream({type:"bytes",async pull(c){const{done:f,value:u}=await o.next();if(f){c.close(),r();return}let l=u.byteLength;n&&n(i+=l),c.enqueue(new Uint8Array(u))},cancel(c){return r(c),o.return()}},{highWaterMark:2})},Ee=(t,e)=>{const n=t!=null;return r=>setTimeout(()=>e({lengthComputable:n,total:t,loaded:r}))},K=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",ze=K&&typeof ReadableStream=="function",te=K&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),yn=ze&&(()=>{let t=!1;const e=new Request(A.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})(),Se=64*1024,ne=ze&&!!(()=>{try{return a.isReadableStream(new Response("").body)}catch{}})(),W={stream:ne&&(t=>t.body)};K&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!W[e]&&(W[e]=a.isFunction(t[e])?n=>n[e]():(n,r)=>{throw new p(`Response type '${e}' is not supported`,p.ERR_NOT_SUPPORT,r)})})})(new Response);const gn=async t=>{if(t==null)return 0;if(a.isBlob(t))return t.size;if(a.isSpecCompliantForm(t))return(await new Request(t).arrayBuffer()).byteLength;if(a.isArrayBufferView(t))return t.byteLength;if(a.isURLSearchParams(t)&&(t=t+""),a.isString(t))return(await te(t)).byteLength},wn=async(t,e)=>{const n=a.toFiniteNumber(t.getContentLength());return n??gn(e)},bn=K&&(async t=>{let{url:e,method:n,data:r,signal:s,cancelToken:o,timeout:i,onDownloadProgress:c,onUploadProgress:f,responseType:u,headers:l,withCredentials:d="same-origin",fetchOptions:g}=We(t);u=u?(u+"").toLowerCase():"text";let[y,h]=s||o||i?hn([s,o],i):[],m,E;const S=()=>{!m&&setTimeout(()=>{y&&y.unsubscribe()}),m=!0};let P;try{if(f&&yn&&n!=="get"&&n!=="head"&&(P=await wn(l,r))!==0){let x=new Request(e,{method:"POST",body:r,duplex:"half"}),F;a.isFormData(r)&&(F=x.headers.get("content-type"))&&l.setContentType(F),x.body&&(r=be(x.body,Se,Ee(P,$(f)),null,te))}a.isString(d)||(d=d?"cors":"omit"),E=new Request(e,{...g,signal:y,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let w=await fetch(E);const k=ne&&(u==="stream"||u==="response");if(ne&&(c||k)){const x={};["status","statusText","headers"].forEach(fe=>{x[fe]=w[fe]});const F=a.toFiniteNumber(w.headers.get("content-length"));w=new Response(be(w.body,Se,c&&Ee(F,$(c,!0)),k&&S,te),x)}u=u||"text";let Ke=await W[a.findKey(W,u)||"text"](w,t);return!k&&S(),h&&h(),await new Promise((x,F)=>{Me(x,F,{data:Ke,headers:R.from(w.headers),status:w.status,statusText:w.statusText,config:t,request:E})})}catch(w){throw S(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new p("Network Error",p.ERR_NETWORK,t,E),{cause:w.cause||w}):p.from(w,w&&w.code,t,E)}}),re={http:kt,xhr:dn,fetch:bn};a.forEach(re,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Oe=t=>`- ${t}`,En=t=>a.isFunction(t)||t===null||t===!1,Je={getAdapter:t=>{t=a.isArray(t)?t:[t];const{length:e}=t;let n,r;const s={};for(let o=0;o`adapter ${c} `+(f===!1?"is not supported by the environment":"is not available in the build"));let i=e?o.length>1?`since : `+o.map(Oe).join(` `):" "+Oe(o[0]):"as no adapter specified";throw new p("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:re};function Q(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new B(null,t)}function Re(t){return Q(t),t.headers=R.from(t.headers),t.data=Y.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Je.getAdapter(t.adapter||H.adapter)(t).then(function(r){return Q(t),r.data=Y.call(t,t.transformResponse,r),r.headers=R.from(r.headers),r},function(r){return je(r)||(Q(t),r&&r.response&&(r.response.data=Y.call(t,t.transformResponse,r.response),r.response.headers=R.from(r.response.headers))),Promise.reject(r)})}const Ve="1.7.2",le={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{le[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Te={};le.transitional=function(e,n,r){function s(o,i){return"[Axios v"+Ve+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(e===!1)throw new p(s(i," has been removed"+(n?" in "+n:"")),p.ERR_DEPRECATED);return n&&!Te[i]&&(Te[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(o,i,c):!0}};function Sn(t,e,n){if(typeof t!="object")throw new p("options must be an object",p.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const c=t[o],f=c===void 0||i(c,o,t);if(f!==!0)throw new p("option "+o+" must be "+f,p.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new p("Unknown option "+o,p.ERR_BAD_OPTION)}}const se={assertOptions:Sn,validators:le},C=se.validators;class L{constructor(e){this.defaults=e,this.interceptors={request:new ye,response:new ye}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s;Error.captureStackTrace?Error.captureStackTrace(s={}):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=D(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&se.assertOptions(r,{silentJSONParsing:C.transitional(C.boolean),forcedJSONParsing:C.transitional(C.boolean),clarifyTimeoutError:C.transitional(C.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:se.assertOptions(s,{encode:C.function,serialize:C.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=R.concat(i,o);const c=[];let f=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(f=f&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let l,d=0,g;if(!f){const h=[Re.bind(this),void 0];for(h.unshift.apply(h,c),h.push.apply(h,u),g=h.length,l=Promise.resolve(n);d{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},e(function(o,i,c){r.reason||(r.reason=new B(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new ue(function(s){e=s}),cancel:e}}}function On(t){return function(n){return t.apply(null,n)}}function Rn(t){return a.isObject(t)&&t.isAxiosError===!0}const oe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(oe).forEach(([t,e])=>{oe[e]=t});function ve(t){const e=new L(t),n=Ae(L.prototype.request,e);return a.extend(n,L.prototype,e,{allOwnKeys:!0}),a.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return ve(D(t,s))},n}const b=ve(H);b.Axios=L;b.CanceledError=B;b.CancelToken=ue;b.isCancel=je;b.VERSION=Ve;b.toFormData=v;b.AxiosError=p;b.Cancel=b.CanceledError;b.all=function(e){return Promise.all(e)};b.spread=On;b.isAxiosError=Rn;b.mergeConfig=D;b.AxiosHeaders=R;b.formToJSON=t=>He(a.isHTMLForm(t)?new FormData(t):t);b.getAdapter=Je.getAdapter;b.HttpStatusCode=oe;b.default=b;async function Tn(t){let e=(t==null?void 0:t.url)||null,n=(t==null?void 0:t.method)||"get",r=(t==null?void 0:t.data)||null,s=(t==null?void 0:t.auth)||null,o={method:n,url:e,timeout:1e3*60*3,headers:{"Content-type":"application/json",Authorization:`Bearer ${s}`}};return r&&(o.data=JSON.stringify(r)),t!=null&&t.headers&&(o.headers={...o.headers,...t.headers}),await b(o).then(function(c){return c.data}).catch(function(c){return c})}class An{constructor(e){O(this,"pos1",0);O(this,"pos2",0);O(this,"pos3",0);O(this,"pos4",0);O(this,"host",null);O(this,"apikey",null);O(this,"userkey",null);O(this,"position","right");O(this,"width",250);O(this,"height",245);O(this,"widgetTitle",' ION Phone');O(this,"colorHeader",null);O(this,"settingDom",{embed:null,fit:!0});O(this,"callback",{"connection-status":e=>e,"registration-status":e=>e,"call-listen":e=>e,"call-status":e=>e,"dial-established":e=>e,unregistered:e=>e,"auto-dial":e=>e});var n,r,s,o,i,c,f,u,l,d,g;this.host=e.credential.host||null,this.apikey=e.credential.token||null,this.userkey=e.credential.userkey||null,this.position=((n=e==null?void 0:e.setting)==null?void 0:n.position)||"right",this.width=((r=e==null?void 0:e.setting)==null?void 0:r.width)||250,this.height=((s=e==null?void 0:e.setting)==null?void 0:s.height)||245,this.widgetTitle=((i=(o=e==null?void 0:e.setting)==null?void 0:o.header)==null?void 0:i.title)||' ION Phone',this.colorHeader=((f=(c=e==null?void 0:e.setting)==null?void 0:c.header)==null?void 0:f.color)||null,this.settingDom.embed=((l=(u=e==null?void 0:e.setting)==null?void 0:u.dom)==null?void 0:l.embed)||null,this.settingDom.fit=((g=(d=e==null?void 0:e.setting)==null?void 0:d.dom)==null?void 0:g.fit)||!0}async init(){try{const e=await Tn({url:`${this.host}/api/config`,method:"POST",auth:this.apikey,data:{userkey:this.userkey}}),n=e.result.token||null,r=e.result.webphone||null;this.generateFrame(n,r),window.addEventListener("message",this.receiveMessage.bind(this),!1)}catch{this.generateFrame()}if(this.colorHeader){const e=this.colorHeader.substring(0,1)=="#"?this.colorHeader.padEnd(7,"0"):`#${this.colorHeader.padEnd(7,"0")}`,n=document.querySelector(".IONPhone-header");n.style.background=`linear-gradient(#ffffffcc, ${e}cc, ${e})`,n.style.border=`1px solid ${e}`}}receiveMessage(e){var n,r,s,o,i,c;try{const f=(n=e==null?void 0:e.data)==null?void 0:n.message;if(f){const u=f.toString().toLowerCase().replace(/_/g,"-");this.callback[u]&&this.callback[u](((r=e==null?void 0:e.data)==null?void 0:r.payload)||null)}if(f=="CALL_STATUS"){const u=((o=(s=e==null?void 0:e.data)==null?void 0:s.payload)==null?void 0:o.status)||null;if(this.collapseWidget(!0),u==="FINISH")this.headerUpdate(null);else{const l=` Call ${u}`;this.headerUpdate(l)}}if(f=="CALL_LISTEN"){const u=((c=(i=e==null?void 0:e.data)==null?void 0:i.payload)==null?void 0:c.status)||null;this.collapseWidget(!0);const l=` Incoming Call - ${u}`;this.headerUpdate(l)}}catch{}}headerUpdate(e){try{const n=document.querySelector(".IONPhonetitle");e?n.innerHTML=e:n.innerHTML=this.widgetTitle}catch{}}generateFrame(e,n){let r='
';r+=`
${this.widgetTitle}
`,r+='
',r+='',r+='',r+="",r+="
",r+='
',r+="
",r+='
',r+='
',r+=`${n?"Loading Softphone":"System Error"}`,r+="
",n&&(r+=`
`,r+='',r+="
",r+=``),r+="
",r+="";let s=this.width>=250?this.width:250,o=this.height>=245?this.height:245;if(!document.querySelector("#IONPhone")){let d=document.createElement("div");if(d.setAttribute("id","IONPhone"),d.className="IONPhone",d.innerHTML=r,this.settingDom.embed instanceof HTMLElement){if(this.settingDom.embed.appendChild(d),this.settingDom.fit){const y=this.settingDom.embed.offsetWidth,h=this.settingDom.embed.offsetHeight;d.style.resize="none",s=y>=235?y:250,o=h>=230?h:245}const g=document.querySelector(".IONPhoneoptions");g.style.display="none"}else document.body.appendChild(d)}const c=["left","right"].indexOf(this.position)>=0?this.position:"right",f=document.querySelector(".IONPhone");if(f.style.width=`${s}px`,f.style.height=`${o}px`,f.dataset.height=`${o}px`,this.settingDom.embed||(f.style[c]="0px"),n){document.querySelector("#ion-iframe-dialer").addEventListener("onload",()=>{const y=document.querySelector(".IONPhone-loader");y.style.display="none"}),new Promise(async(y,h)=>{const m=document.querySelector('form.ion-form-plugin > [name="token"]');m&&e&&(m.value=e),e?y():h()}).then(()=>{const y=document.querySelector(".ion-form-plugin");y&&y.submit()}).catch(()=>{});const g=document.querySelector(".IONPhone-loader");g.style.display="none"}const u=document.querySelector(".IONPhone-header"),l=document.querySelector(".IONPhone-hideBtn");this.settingDom.embed?u.style.cursor="default":(u.addEventListener("mousedown",this.dragMouseDown.bind(this)),l.addEventListener("click",this.collapseWidget.bind(this,!1)))}collapseWidget(e=!1){const n=document.querySelector(".IONPhone"),r=document.querySelector(".IONPhonecontent"),s=document.querySelector(".IONPhoneoptions");try{n&&r&&(r.style.display=="none"||e?(r.style.display="block",s.style.transform="rotate(0deg)",n.dataset.height&&(n.style.height=`${n.dataset.height}px`)):(n.dataset.height=n.offsetHeight.toString(),setTimeout(()=>r.style.display="none",150),s.style.transform="rotate(180deg)",n.style.height="35px"))}catch{}}dragMouseDown(){const e=window==null?void 0:window.event;e.preventDefault(),this.pos3=e.clientX,this.pos4=e.clientY,document.onmousemove=this.elementDrag.bind(this),document.onmouseup=this.closeDragElement}elementDrag(){const e=window==null?void 0:window.event;e==null||e.preventDefault(),this.pos1=this.pos3-e.clientX,this.pos2=this.pos4-e.clientY,this.pos3=e.clientX,this.pos4=e==null?void 0:e.clientY;let n=window.innerWidth,r=window.innerHeight;const s=document.querySelector(".IONPhone"),o=n-s.offsetWidth,i=r-s.offsetHeight,c=s.offsetTop-this.pos2,f=s.offsetLeft-this.pos1;c>=0&&c<=i&&(s.style.top=c+"px"),f>=0&&f<=o&&(s.style.left=f+"px")}closeDragElement(){document.onmouseup=null,document.onmousemove=null}setNumber(e,n=null){try{let r={message:"SET_NUM",payload:{call_id:e,alias:n}};const s=document.querySelector("#ion-iframe-dialer");s.contentWindow&&(s.contentWindow.postMessage(r,"*"),this.collapseWidget(!0))}catch(r){console.trace(r)}}setDial(e,n=null){try{let r={message:"DIAL",payload:{call_id:e,alias:n}};const s=document.querySelector("#ion-iframe-dialer");s.contentWindow&&(s.contentWindow.postMessage(r,"*"),this.collapseWidget(!0))}catch(r){console.trace(r)}}on(e,n){try{this.callback[e]&&(this.callback[e]=n)}catch(r){console.trace(r)}}}module.exports=An; //# sourceMappingURL=ion-phone.cjs.map