oauth0-js-lib 2.2.7 → 2.2.9

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/dist/index.umd.js CHANGED
@@ -1,9 +1,4 @@
1
- (function(U,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(U=typeof globalThis<"u"?globalThis:U||self,q(U["oauth0-js-lib"]={}))})(this,(function(U){"use strict";var qo=Object.defineProperty;var jo=(U,q,re)=>q in U?qo(U,q,{enumerable:!0,configurable:!0,writable:!0,value:re}):U[q]=re;var x=(U,q,re)=>jo(U,typeof q!="symbol"?q+"":q,re);const q={baseUrl:"",createEndpoint:"/api/oauth0/create",authEventEndpoint:"/api/oauth0/auth-events",authConfirmEndpoint:"/api/oauth0/auth-confirm"},re=typeof __OAUTH_LIB_CONFIG__<"u"?__OAUTH_LIB_CONFIG__:void 0,qn=typeof globalThis<"u"&&globalThis.OAUTH_LIB_CONFIG?globalThis.OAUTH_LIB_CONFIG:void 0;let _e={...q,...re,...qn};function jn(e){_e={..._e,...e}}function ve(){return _e}function mt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Hn}=Object.prototype,{getPrototypeOf:Ue}=Object,{iterator:be,toStringTag:yt}=Symbol,Ee=(e=>t=>{const r=Hn.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),H=e=>(e=e.toLowerCase(),t=>Ee(t)===e),Ce=e=>t=>typeof t===e,{isArray:oe}=Array,ie=Ce("undefined");function fe(e){return e!==null&&!ie(e)&&e.constructor!==null&&!ie(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const wt=H("ArrayBuffer");function zn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&wt(e.buffer),t}const $n=Ce("string"),D=Ce("function"),bt=Ce("number"),de=e=>e!==null&&typeof e=="object",Vn=e=>e===!0||e===!1,Se=e=>{if(Ee(e)!=="object")return!1;const t=Ue(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(yt in e)&&!(be in e)},Jn=e=>{if(!de(e)||fe(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Kn=H("Date"),Qn=H("File"),Wn=H("Blob"),Gn=H("FileList"),Yn=e=>de(e)&&D(e.pipe),Xn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=Ee(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},Zn=H("URLSearchParams"),[er,tr,nr,rr]=["ReadableStream","Request","Response","Headers"].map(H),or=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function he(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),oe(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(fe(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function Et(e,t){if(fe(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ct=e=>!ie(e)&&e!==Y;function Fe(){const{caseless:e,skipUndefined:t}=Ct(this)&&this||{},r={},n=(o,i)=>{const s=e&&Et(r,i)||i;Se(r[s])&&Se(o)?r[s]=Fe(r[s],o):Se(o)?r[s]=Fe({},o):oe(o)?r[s]=o.slice():(!t||!ie(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&he(arguments[o],n);return r}const ir=(e,t,r,{allOwnKeys:n}={})=>(he(t,(o,i)=>{r&&D(o)?e[i]=mt(o,r):e[i]=o},{allOwnKeys:n}),e),sr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ar=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ur=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&Ue(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},cr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},lr=e=>{if(!e)return null;if(oe(e))return e;let t=e.length;if(!bt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},fr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ue(Uint8Array)),dr=(e,t)=>{const n=(e&&e[be]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},hr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},pr=H("HTMLFormElement"),gr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),St=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),mr=H("RegExp"),Rt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};he(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},yr=e=>{Rt(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},wr=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return oe(e)?n(e):n(String(e).split(t)),r},br=()=>{},Er=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Cr(e){return!!(e&&D(e.append)&&e[yt]==="FormData"&&e[be])}const Sr=e=>{const t=new Array(10),r=(n,o)=>{if(de(n)){if(t.indexOf(n)>=0)return;if(fe(n))return n;if(!("toJSON"in n)){t[o]=n;const i=oe(n)?[]:{};return he(n,(s,a)=>{const u=r(s,o+1);!ie(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},Rr=H("AsyncFunction"),Tr=e=>e&&(de(e)||D(e))&&D(e.then)&&D(e.catch),Tt=((e,t)=>e?setImmediate:t?((r,n)=>(Y.addEventListener("message",({source:o,data:i})=>{o===Y&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Y.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(Y.postMessage)),Ar=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||Tt,l={isArray:oe,isArrayBuffer:wt,isBuffer:fe,isFormData:Xn,isArrayBufferView:zn,isString:$n,isNumber:bt,isBoolean:Vn,isObject:de,isPlainObject:Se,isEmptyObject:Jn,isReadableStream:er,isRequest:tr,isResponse:nr,isHeaders:rr,isUndefined:ie,isDate:Kn,isFile:Qn,isBlob:Wn,isRegExp:mr,isFunction:D,isStream:Yn,isURLSearchParams:Zn,isTypedArray:fr,isFileList:Gn,forEach:he,merge:Fe,extend:ir,trim:or,stripBOM:sr,inherits:ar,toFlatObject:ur,kindOf:Ee,kindOfTest:H,endsWith:cr,toArray:lr,forEachEntry:dr,matchAll:hr,isHTMLForm:pr,hasOwnProperty:St,hasOwnProp:St,reduceDescriptors:Rt,freezeMethods:yr,toObjectSet:wr,toCamelCase:gr,noop:br,toFiniteNumber:Er,findKey:Et,global:Y,isContextDefined:Ct,isSpecCompliantForm:Cr,toJSONObject:Sr,isAsyncFn:Rr,isThenable:Tr,setImmediate:Tt,asap:Ar,isIterable:e=>e!=null&&D(e[be])};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}l.inherits(I,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:l.toJSONObject(this.config),code:this.code,status:this.status}}});const At=I.prototype,Bt={};["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(e=>{Bt[e]={value:e}}),Object.defineProperties(I,Bt),Object.defineProperty(At,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,i)=>{const s=Object.create(At);l.toFlatObject(e,s,function(f){return f!==Error.prototype},c=>c!=="isAxiosError");const a=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return I.call(s,a,u,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Br=null;function Me(e){return l.isPlainObject(e)||l.isArray(e)}function Nt(e){return l.endsWith(e,"[]")?e.slice(0,-2):e}function Pt(e,t,r){return e?e.concat(t).map(function(o,i){return o=Nt(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Nr(e){return l.isArray(e)&&!e.some(Me)}const Pr=l.toFlatObject(l,{},null,function(t){return/^is[A-Z]/.test(t)});function Re(e,t,r){if(!l.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=l.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!l.isUndefined(g[p])});const n=r.metaTokens,o=r.visitor||f,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&l.isSpecCompliantForm(t);if(!l.isFunction(o))throw new TypeError("visitor must be a function");function c(d){if(d===null)return"";if(l.isDate(d))return d.toISOString();if(l.isBoolean(d))return d.toString();if(!u&&l.isBlob(d))throw new I("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(d)||l.isTypedArray(d)?u&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,p,g){let w=d;if(d&&!g&&typeof d=="object"){if(l.endsWith(p,"{}"))p=n?p:p.slice(0,-2),d=JSON.stringify(d);else if(l.isArray(d)&&Nr(d)||(l.isFileList(d)||l.endsWith(p,"[]"))&&(w=l.toArray(d)))return p=Nt(p),w.forEach(function(E,R){!(l.isUndefined(E)||E===null)&&t.append(s===!0?Pt([p],R,i):s===null?p:p+"[]",c(E))}),!1}return Me(d)?!0:(t.append(Pt(g,p,i),c(d)),!1)}const h=[],m=Object.assign(Pr,{defaultVisitor:f,convertValue:c,isVisitable:Me});function y(d,p){if(!l.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(d),l.forEach(d,function(w,P){(!(l.isUndefined(w)||w===null)&&o.call(t,w,l.isString(P)?P.trim():P,p,m))===!0&&y(w,p?p.concat(P):[P])}),h.pop()}}if(!l.isObject(e))throw new TypeError("data must be an object");return y(e),t}function Ot(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function xe(e,t){this._pairs=[],e&&Re(e,this,t)}const Lt=xe.prototype;Lt.append=function(t,r){this._pairs.push([t,r])},Lt.toString=function(t){const r=t?function(n){return t.call(this,n,Ot)}:Ot;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Or(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function It(e,t,r){if(!t)return e;const n=r&&r.encode||Or;l.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=l.isURLSearchParams(t)?t.toString():new xe(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class _t{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){l.forEach(this.handlers,function(n){n!==null&&t(n)})}}const vt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:xe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},De=typeof window<"u"&&typeof document<"u",ke=typeof navigator=="object"&&navigator||void 0,Ir=De&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),_r=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",vr=De&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:De,hasStandardBrowserEnv:Ir,hasStandardBrowserWebWorkerEnv:_r,navigator:ke,origin:vr},Symbol.toStringTag,{value:"Module"})),...Lr};function Ur(e,t){return Re(e,new F.classes.URLSearchParams,{visitor:function(r,n,o,i){return F.isNode&&l.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function Fr(e){return l.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Mr(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function Ut(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=r.length;return s=!s&&l.isArray(o)?o.length:s,u?(l.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!l.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&l.isArray(o[s])&&(o[s]=Mr(o[s])),!a)}if(l.isFormData(e)&&l.isFunction(e.entries)){const r={};return l.forEachEntry(e,(n,o)=>{t(Fr(n),o,r,0)}),r}return null}function xr(e,t,r){if(l.isString(e))try{return(t||JSON.parse)(e),l.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const pe={transitional:vt,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=l.isObject(t);if(i&&l.isHTMLForm(t)&&(t=new FormData(t)),l.isFormData(t))return o?JSON.stringify(Ut(t)):t;if(l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t)||l.isReadableStream(t))return t;if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Ur(t,this.formSerializer).toString();if((a=l.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Re(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),xr(t)):t}],transformResponse:[function(t){const r=this.transitional||pe.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(l.isResponse(t)||l.isReadableStream(t))return t;if(t&&l.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?I.from(a,I.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],e=>{pe.headers[e]={}});const Dr=l.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"]),kr=e=>{const t={};let r,n,o;return e&&e.split(`
2
- `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&Dr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Ft=Symbol("internals");function ge(e){return e&&String(e).trim().toLowerCase()}function Te(e){return e===!1||e==null?e:l.isArray(e)?e.map(Te):String(e)}function qr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const jr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function qe(e,t,r,n,o){if(l.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!l.isString(t)){if(l.isString(n))return t.indexOf(n)!==-1;if(l.isRegExp(n))return n.test(t)}}function Hr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function zr(e,t){const r=l.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let k=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,c){const f=ge(u);if(!f)throw new Error("header name must be a non-empty string");const h=l.findKey(o,f);(!h||o[h]===void 0||c===!0||c===void 0&&o[h]!==!1)&&(o[h||u]=Te(a))}const s=(a,u)=>l.forEach(a,(c,f)=>i(c,f,u));if(l.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(l.isString(t)&&(t=t.trim())&&!jr(t))s(kr(t),r);else if(l.isObject(t)&&l.isIterable(t)){let a={},u,c;for(const f of t){if(!l.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[c=f[0]]=(u=a[c])?l.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}s(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ge(t),t){const n=l.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return qr(o);if(l.isFunction(r))return r.call(this,o,n);if(l.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ge(t),t){const n=l.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||qe(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=ge(s),s){const a=l.findKey(n,s);a&&(!r||qe(n,n[a],a,r))&&(delete n[a],o=!0)}}return l.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||qe(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return l.forEach(this,(o,i)=>{const s=l.findKey(n,i);if(s){r[s]=Te(o),delete r[i];return}const a=t?Hr(i):String(i).trim();a!==i&&delete r[i],r[a]=Te(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return l.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&l.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Ft]=this[Ft]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=ge(s);n[a]||(zr(o,s),n[a]=!0)}return l.isArray(t)?t.forEach(i):i(t),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),l.reduceDescriptors(k.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),l.freezeMethods(k);function je(e,t){const r=this||pe,n=t||r,o=k.from(n.headers);let i=n.data;return l.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function Mt(e){return!!(e&&e.__CANCEL__)}function se(e,t,r){I.call(this,e??"canceled",I.ERR_CANCELED,t,r),this.name="CanceledError"}l.inherits(se,I,{__CANCEL__:!0});function xt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const c=Date.now(),f=n[i];s||(s=c),r[o]=u,n[o]=c;let h=i,m=0;for(;h!==o;)m+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s<t)return;const y=f&&c-f;return y?Math.round(m*1e3/y):void 0}}function Jr(e,t){let r=0,n=1e3/t,o,i;const s=(c,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const f=Date.now(),h=f-r;h>=n?s(c,f):(o=c,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}const Ae=(e,t,r=3)=>{let n=0;const o=Vr(50,250);return Jr(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,c=o(u),f=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:c||void 0,estimated:c&&a&&f?(a-s)/c:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},Dt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},kt=e=>(...t)=>l.asap(()=>e(...t)),Kr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];l.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),l.isString(n)&&a.push(`path=${n}`),l.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),l.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Wr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function qt(e,t,r){let n=!Wr(t);return e&&(n||r==!1)?Gr(e,t):t}const jt=e=>e instanceof k?{...e}:e;function X(e,t){t=t||{};const r={};function n(c,f,h,m){return l.isPlainObject(c)&&l.isPlainObject(f)?l.merge.call({caseless:m},c,f):l.isPlainObject(f)?l.merge({},f):l.isArray(f)?f.slice():f}function o(c,f,h,m){if(l.isUndefined(f)){if(!l.isUndefined(c))return n(void 0,c,h,m)}else return n(c,f,h,m)}function i(c,f){if(!l.isUndefined(f))return n(void 0,f)}function s(c,f){if(l.isUndefined(f)){if(!l.isUndefined(c))return n(void 0,c)}else return n(void 0,f)}function a(c,f,h){if(h in t)return n(c,f);if(h in e)return n(void 0,c)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,f,h)=>o(jt(c),jt(f),h,!0)};return l.forEach(Object.keys({...e,...t}),function(f){const h=u[f]||o,m=h(e[f],t[f],f);l.isUndefined(m)&&h!==a||(r[f]=m)}),r}const Ht=e=>{const t=X({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=k.from(s),t.url=It(qt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),l.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(l.isFunction(r.getHeaders)){const u=r.getHeaders(),c=["content-type","content-length"];Object.entries(u).forEach(([f,h])=>{c.includes(f.toLowerCase())&&s.set(f,h)})}}if(F.hasStandardBrowserEnv&&(n&&l.isFunction(n)&&(n=n(t)),n||n!==!1&&Kr(t.url))){const u=o&&i&&Qr.read(i);u&&s.set(o,u)}return t},Yr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Ht(e);let i=o.data;const s=k.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:c}=o,f,h,m,y,d;function p(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function w(){if(!g)return;const E=k.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};xt(function(S){r(S),p()},function(S){n(S),p()},_),g=null}"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(w)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,e,g)),g=null)},g.onerror=function(R){const _=R&&R.message?R.message:"Network Error",b=new I(_,I.ERR_NETWORK,e,g);b.event=R||null,n(b),g=null},g.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||vt;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new I(R,_.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&l.forEach(s.toJSON(),function(R,_){g.setRequestHeader(_,R)}),l.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),a&&a!=="json"&&(g.responseType=o.responseType),c&&([m,d]=Ae(c,!0),g.addEventListener("progress",m)),u&&g.upload&&([h,y]=Ae(u),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(f=E=>{g&&(n(!E||E.type?new se(null,e,g):E),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const P=$r(o.url);if(P&&F.protocols.indexOf(P)===-1){n(new I("Unsupported protocol "+P+":",I.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Xr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(c){if(!o){o=!0,a();const f=c instanceof Error?c:this.reason;n.abort(f instanceof I?f:new se(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout ${t} of ms exceeded`,I.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>l.asap(a),u}},Zr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},eo=async function*(e,t){for await(const r of to(e))yield*Zr(r,t)},to=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},zt=(e,t,r,n)=>{const o=eo(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:c,value:f}=await o.next();if(c){a(),u.close();return}let h=f.byteLength;if(r){let m=i+=h;r(m)}u.enqueue(new Uint8Array(f))}catch(c){throw a(c),c}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},$t=64*1024,{isFunction:Be}=l,no=(({Request:e,Response:t})=>({Request:e,Response:t}))(l.global),{ReadableStream:Vt,TextEncoder:Jt}=l.global,Kt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ro=e=>{e=l.merge.call({skipUndefined:!0},no,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):typeof fetch=="function",i=Be(r),s=Be(n);if(!o)return!1;const a=o&&Be(Vt),u=o&&(typeof Jt=="function"?(d=>p=>d.encode(p))(new Jt):async d=>new Uint8Array(await new r(d).arrayBuffer())),c=i&&a&&Kt(()=>{let d=!1;const p=new r(F.origin,{body:new Vt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),f=s&&a&&Kt(()=>l.isReadableStream(new n("").body)),h={stream:f&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(p,g)=>{let w=p&&p[d];if(w)return w.call(p);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const m=async d=>{if(d==null)return 0;if(l.isBlob(d))return d.size;if(l.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(l.isArrayBufferView(d)||l.isArrayBuffer(d))return d.byteLength;if(l.isURLSearchParams(d)&&(d=d+""),l.isString(d))return(await u(d)).byteLength},y=async(d,p)=>{const g=l.toFiniteNumber(d.getContentLength());return g??m(p)};return async d=>{let{url:p,method:g,data:w,signal:P,cancelToken:E,timeout:R,onDownloadProgress:_,onUploadProgress:b,responseType:S,headers:A,withCredentials:C="same-origin",fetchOptions:L}=Ht(d),B=t||fetch;S=S?(S+"").toLowerCase():"text";let N=Xr([P,E&&E.toAbortSignal()],R),T=null;const O=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let z;try{if(b&&c&&g!=="get"&&g!=="head"&&(z=await y(A,w))!==0){let j=new r(p,{method:"POST",body:w,duplex:"half"}),K;if(l.isFormData(w)&&(K=j.headers.get("content-type"))&&A.setContentType(K),j.body){const[ne,ue]=Dt(z,Ae(kt(b)));w=zt(j.body,$t,ne,ue)}}l.isString(C)||(C=C?"include":"omit");const M=i&&"credentials"in r.prototype,Le={...L,signal:N,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:w,duplex:"half",credentials:M?C:void 0};T=i&&new r(p,Le);let $=await(i?B(T,L):B(p,Le));const Ie=f&&(S==="stream"||S==="response");if(f&&(_||Ie&&O)){const j={};["status","statusText","headers"].forEach(ce=>{j[ce]=$[ce]});const K=l.toFiniteNumber($.headers.get("content-length")),[ne,ue]=_&&Dt(K,Ae(kt(_),!0))||[];$=new n(zt($.body,$t,ne,()=>{ue&&ue(),O&&O()}),j)}S=S||"text";let we=await h[l.findKey(h,S)||"text"]($,d);return!Ie&&O&&O(),await new Promise((j,K)=>{xt(j,K,{data:we,headers:k.from($.headers),status:$.status,statusText:$.statusText,config:d,request:T})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,T),{cause:M.cause||M}):I.from(M,M&&M.code,d,T)}}},oo=new Map,Qt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,c,f=oo;for(;a--;)u=i[a],c=f.get(u),c===void 0&&f.set(u,c=a?new Map:ro(t)),f=c;return c};Qt();const He={http:Br,xhr:Yr,fetch:{get:Qt}};l.forEach(He,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wt=e=>`- ${e}`,io=e=>l.isFunction(e)||e===null||e===!1;function so(e,t){e=l.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let a;if(o=n,!io(n)&&(o=He[(a=String(n)).toLowerCase()],o===void 0))throw new I(`Unknown adapter '${a}'`);if(o&&(l.isFunction(o)||(o=o.get(t))))break;i[a||"#"+s]=o}if(!o){const s=Object.entries(i).map(([u,c])=>`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since :
4
- `+s.map(Wt).join(`
5
- `):" "+Wt(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Gt={getAdapter:so,adapters:He};function ze(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new se(null,e)}function Yt(e){return ze(e),e.headers=k.from(e.headers),e.data=je.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gt.getAdapter(e.adapter||pe.adapter,e)(e).then(function(n){return ze(e),n.data=je.call(e,e.transformResponse,n),n.headers=k.from(n.headers),n},function(n){return Mt(n)||(ze(e),n&&n.response&&(n.response.data=je.call(e,e.transformResponse,n.response),n.response.headers=k.from(n.response.headers))),Promise.reject(n)})}const Xt="1.13.1",Ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Zt={};Ne.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Xt+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new I(o(s," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!Zt[s]&&(Zt[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}},Ne.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ao(e,t,r){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new I("option "+i+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Pe={assertOptions:ao,validators:Ne},V=Pe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _t,response:new _t}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Pe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),o!=null&&(l.isFunction(o)?r.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:V.function,serialize:V.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Pe.assertOptions(r,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&l.merge(i.common,i[r.method]);i&&l.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=k.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const c=[];this.interceptors.response.forEach(function(p){c.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Yt.bind(this),void 0];for(d.unshift(...a),d.push(...c),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Yt.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=c.length;h<m;)f=f.then(c[h++],c[h++]);return f}getUri(t){t=X(this.defaults,t);const r=qt(t.baseURL,t.url,t.allowAbsoluteUrls);return It(r,t.params,t.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,n){return this.request(X(n||{},{method:t,url:r,data:(n||{}).data}))}}),l.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(X(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});let uo=class kn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new se(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new kn(function(o){t=o}),cancel:t}}};function co(e){return function(r){return e.apply(null,r)}}function lo(e){return l.isObject(e)&&e.isAxiosError===!0}const $e={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($e).forEach(([e,t])=>{$e[t]=e});function en(e){const t=new Z(e),r=mt(Z.prototype.request,t);return l.extend(r,Z.prototype,t,{allOwnKeys:!0}),l.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return en(X(e,o))},r}const v=en(pe);v.Axios=Z,v.CanceledError=se,v.CancelToken=uo,v.isCancel=Mt,v.VERSION=Xt,v.toFormData=Re,v.AxiosError=I,v.Cancel=v.CanceledError,v.all=function(t){return Promise.all(t)},v.spread=co,v.isAxiosError=lo,v.mergeConfig=X,v.AxiosHeaders=k,v.formToJSON=e=>Ut(l.isHTMLForm(e)?new FormData(e):e),v.getAdapter=Gt.getAdapter,v.HttpStatusCode=$e,v.default=v;const{Axios:Qo,AxiosError:Wo,CanceledError:Go,isCancel:Yo,CancelToken:Xo,VERSION:Zo,all:ei,Cancel:ti,isAxiosError:ni,spread:ri,toFormData:oi,AxiosHeaders:ii,HttpStatusCode:si,formToJSON:ai,getAdapter:ui,mergeConfig:ci}=v,fo=`.oauth-modal-overlay {\r
1
+ (function(U,q){typeof exports=="object"&&typeof module<"u"?q(exports):typeof define=="function"&&define.amd?define(["exports"],q):(U=typeof globalThis<"u"?globalThis:U||self,q(U["oauth0-js-lib"]={}))})(this,(function(U){"use strict";var qo=Object.defineProperty;var jo=(U,q,re)=>q in U?qo(U,q,{enumerable:!0,configurable:!0,writable:!0,value:re}):U[q]=re;var k=(U,q,re)=>jo(U,typeof q!="symbol"?q+"":q,re);const q={baseUrl:Hn(),createEndpoint:"/api/oauth0/create",authEventEndpoint:"/api/oauth0/auth-events",authConfirmEndpoint:"/api/oauth0/auth-confirm"},re=typeof __OAUTH_LIB_CONFIG__<"u"?__OAUTH_LIB_CONFIG__:void 0,qn=typeof globalThis<"u"&&globalThis.OAUTH_LIB_CONFIG?globalThis.OAUTH_LIB_CONFIG:void 0;let _e={...q,...re,...qn};function jn(e){_e={..._e,...e}}function gt(){return _e}function Hn(){var e,t;return typeof window<"u"&&((e=window.location)!=null&&e.origin)?window.location.origin:typeof globalThis<"u"&&((t=globalThis.location)!=null&&t.origin)?globalThis.location.origin:""}const zn=`.oauth-modal-overlay {\r
7
2
  position: fixed;\r
8
3
  top: 0;\r
9
4
  left: 0;\r
@@ -171,17 +166,22 @@
171
166
  color: #555;\r
172
167
  margin-top: -10px;\r
173
168
  margin-bottom: 10px;\r
174
- }`;var ae={},Ve,tn;function ho(){return tn||(tn=1,Ve=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ve}var Je={},G={},nn;function ee(){if(nn)return G;nn=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return G.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},G.getSymbolTotalCodewords=function(n){return t[n]},G.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},G.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},G.isKanjiModeEnabled=function(){return typeof e<"u"},G.toSJIS=function(n){return e(n)},G}var Ke={},rn;function Qe(){return rn||(rn=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(Ke)),Ke}var We,on;function po(){if(on)return We;on=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},We=e,We}var Ge,sn;function go(){if(sn)return Ge;sn=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,o){const i=t*this.size+r;this.data[i]=n,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},Ge=e,Ge}var Ye={},an;function mo(){return an||(an=1,(function(e){const t=ee().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let u=1;u<o-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(n){const o=[],i=e.getRowColCoords(n),s=i.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||o.push([i[a],i[u]]);return o}})(Ye)),Ye}var Xe={},un;function yo(){if(un)return Xe;un=1;const e=ee().getSymbolSize,t=7;return Xe.getPositions=function(n){const o=e(n);return[[0,0],[o-t,0],[0,o-t]]},Xe}var Ze={},cn;function wo(){return cn||(cn=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,u=0,c=null,f=null;for(let h=0;h<i;h++){a=u=0,c=f=null;for(let m=0;m<i;m++){let y=o.get(h,m);y===c?a++:(a>=5&&(s+=t.N1+(a-5)),c=y,a=1),y=o.get(m,h),y===f?u++:(u>=5&&(s+=t.N1+(u-5)),f=y,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a<i-1;a++)for(let u=0;u<i-1;u++){const c=o.get(a,u)+o.get(a,u+1)+o.get(a+1,u)+o.get(a+1,u+1);(c===4||c===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const i=o.size;let s=0,a=0,u=0;for(let c=0;c<i;c++){a=u=0;for(let f=0;f<i;f++)a=a<<1&2047|o.get(c,f),f>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(f,c),f>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let u=0;u<s;u++)i+=o.data[u];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function r(n,o,i){switch(n){case e.Patterns.PATTERN000:return(o+i)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(o+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return o*i%2+o*i%3===0;case e.Patterns.PATTERN110:return(o*i%2+o*i%3)%2===0;case e.Patterns.PATTERN111:return(o*i%3+(o+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(o,i){const s=i.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)i.isReserved(u,a)||i.xor(u,a,r(o,u,a))},e.getBestMask=function(o,i){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let c=0;c<s;c++){i(c),e.applyMask(c,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(c,o),f<u&&(u=f,a=c)}return a}})(Ze)),Ze}var Oe={},ln;function fn(){if(ln)return Oe;ln=1;const e=Qe(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Oe.getBlocksCount=function(o,i){switch(i){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},Oe.getTotalCodewordsCount=function(o,i){switch(i){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},Oe}var et={},me={},dn;function bo(){if(dn)return me;dn=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let o=0;o<255;o++)e[o]=n,t[n]=o,n<<=1,n&256&&(n^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),me.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},me.exp=function(n){return e[n]},me.mul=function(n,o){return n===0||o===0?0:e[t[n]+t[o]]},me}var hn;function Eo(){return hn||(hn=1,(function(e){const t=bo();e.mul=function(n,o){const i=new Uint8Array(n.length+o.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<o.length;a++)i[s+a]^=t.mul(n[s],o[a]);return i},e.mod=function(n,o){let i=new Uint8Array(n);for(;i.length-o.length>=0;){const s=i[0];for(let u=0;u<o.length;u++)i[u]^=t.mul(o[u],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let i=0;i<n;i++)o=e.mul(o,new Uint8Array([1,t.exp(i)]));return o}})(et)),et}var tt,pn;function Co(){if(pn)return tt;pn=1;const e=Eo();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(n.length+this.degree);o.set(n);const i=e.mod(o,this.genPoly),s=this.degree-i.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i},tt=t,tt}var nt={},rt={},ot={},gn;function mn(){return gn||(gn=1,ot.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),ot}var J={},yn;function wn(){if(yn)return J;yn=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
175
- ]))+`;J.KANJI=new RegExp(r,"g"),J.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),J.BYTE=new RegExp(n,"g"),J.NUMERIC=new RegExp(e,"g"),J.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+r+"$"),i=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return J.testKanji=function(u){return o.test(u)},J.testNumeric=function(u){return i.test(u)},J.testAlphanumeric=function(u){return s.test(u)},J}var bn;function te(){return bn||(bn=1,(function(e){const t=mn(),r=wn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(rt)),rt}var En;function So(){return En||(En=1,(function(e){const t=ee(),r=fn(),n=Qe(),o=te(),i=mn(),s=7973,a=t.getBCHDigit(s);function u(m,y,d){for(let p=1;p<=40;p++)if(y<=e.getCapacity(p,d,m))return p}function c(m,y){return o.getCharCountIndicator(m,y)+4}function f(m,y){let d=0;return m.forEach(function(p){const g=c(p.mode,y);d+=g+p.getBitsLength()}),d}function h(m,y){for(let d=1;d<=40;d++)if(f(m,d)<=e.getCapacity(d,y,o.MIXED))return d}e.from=function(y,d){return i.isValid(y)?parseInt(y,10):d},e.getCapacity=function(y,d,p){if(!i.isValid(y))throw new Error("Invalid QR Code version");typeof p>"u"&&(p=o.BYTE);const g=t.getSymbolTotalCodewords(y),w=r.getTotalCodewordsCount(y,d),P=(g-w)*8;if(p===o.MIXED)return P;const E=P-c(p,y);switch(p){case o.NUMERIC:return Math.floor(E/10*3);case o.ALPHANUMERIC:return Math.floor(E/11*2);case o.KANJI:return Math.floor(E/13);case o.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(y,d){let p;const g=n.from(d,n.M);if(Array.isArray(y)){if(y.length>1)return h(y,g);if(y.length===0)return 1;p=y[0]}else p=y;return u(p.mode,p.getLength(),g)},e.getEncodedBits=function(y){if(!i.isValid(y)||y<7)throw new Error("Invalid QR Code version");let d=y<<12;for(;t.getBCHDigit(d)-a>=0;)d^=s<<t.getBCHDigit(d)-a;return y<<12|d}})(nt)),nt}var it={},Cn;function Ro(){if(Cn)return it;Cn=1;const e=ee(),t=1335,r=21522,n=e.getBCHDigit(t);return it.getEncodedBits=function(i,s){const a=i.bit<<3|s;let u=a<<10;for(;e.getBCHDigit(u)-n>=0;)u^=t<<e.getBCHDigit(u)-n;return(a<<10|u)^r},it}var st={},at,Sn;function To(){if(Sn)return at;Sn=1;const e=te();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let o,i,s;for(o=0;o+3<=this.data.length;o+=3)i=this.data.substr(o,3),s=parseInt(i,10),n.put(s,10);const a=this.data.length-o;a>0&&(i=this.data.substr(o),s=parseInt(i,10),n.put(s,a*3+1))},at=t,at}var ut,Rn;function Ao(){if(Rn)return ut;Rn=1;const e=te(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let i;for(i=0;i+2<=this.data.length;i+=2){let s=t.indexOf(this.data[i])*45;s+=t.indexOf(this.data[i+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[i]),6)},ut=r,ut}var ct,Tn;function Bo(){if(Tn)return ct;Tn=1;const e=te();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,o=this.data.length;n<o;n++)r.put(this.data[n],8)},ct=t,ct}var lt,An;function No(){if(An)return lt;An=1;const e=te(),t=ee();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o<this.data.length;o++){let i=t.toSJIS(this.data[o]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
176
- Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13)}},lt=r,lt}var ft={exports:{}},Bn;function Po(){return Bn||(Bn=1,(function(e){var t={single_source_shortest_paths:function(r,n,o){var i={},s={};s[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var u,c,f,h,m,y,d,p,g;!a.empty();){u=a.pop(),c=u.value,h=u.cost,m=r[c]||{};for(f in m)m.hasOwnProperty(f)&&(y=m[f],d=h+y,p=s[f],g=typeof s[f]>"u",(g||p>d)&&(s[f]=d,a.push(f,d),i[f]=c))}if(typeof o<"u"&&typeof s[o]>"u"){var w=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],i=n;i;)o.push(i),r[i],i=r[i];return o.reverse(),o},find_path:function(r,n,o){var i=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},i;r=r||{};for(i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(ft)),ft.exports}var Nn;function Oo(){return Nn||(Nn=1,(function(e){const t=te(),r=To(),n=Ao(),o=Bo(),i=No(),s=wn(),a=ee(),u=Po();function c(w){return unescape(encodeURIComponent(w)).length}function f(w,P,E){const R=[];let _;for(;(_=w.exec(E))!==null;)R.push({data:_[0],index:_.index,mode:P,length:_[0].length});return R}function h(w){const P=f(s.NUMERIC,t.NUMERIC,w),E=f(s.ALPHANUMERIC,t.ALPHANUMERIC,w);let R,_;return a.isKanjiModeEnabled()?(R=f(s.BYTE,t.BYTE,w),_=f(s.KANJI,t.KANJI,w)):(R=f(s.BYTE_KANJI,t.BYTE,w),_=[]),P.concat(E,R,_).sort(function(S,A){return S.index-A.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function m(w,P){switch(P){case t.NUMERIC:return r.getBitsLength(w);case t.ALPHANUMERIC:return n.getBitsLength(w);case t.KANJI:return i.getBitsLength(w);case t.BYTE:return o.getBitsLength(w)}}function y(w){return w.reduce(function(P,E){const R=P.length-1>=0?P[P.length-1]:null;return R&&R.mode===E.mode?(P[P.length-1].data+=E.data,P):(P.push(E),P)},[])}function d(w){const P=[];for(let E=0;E<w.length;E++){const R=w[E];switch(R.mode){case t.NUMERIC:P.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:P.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:P.push([R,{data:R.data,mode:t.BYTE,length:c(R.data)}]);break;case t.BYTE:P.push([{data:R.data,mode:t.BYTE,length:c(R.data)}])}}return P}function p(w,P){const E={},R={start:{}};let _=["start"];for(let b=0;b<w.length;b++){const S=w[b],A=[];for(let C=0;C<S.length;C++){const L=S[C],B=""+b+C;A.push(B),E[B]={node:L,lastCount:0},R[B]={};for(let N=0;N<_.length;N++){const T=_[N];E[T]&&E[T].node.mode===L.mode?(R[T][B]=m(E[T].lastCount+L.length,L.mode)-m(E[T].lastCount,L.mode),E[T].lastCount+=L.length):(E[T]&&(E[T].lastCount=L.length),R[T][B]=m(L.length,L.mode)+4+t.getCharCountIndicator(L.mode,P))}}_=A}for(let b=0;b<_.length;b++)R[_[b]].end=0;return{map:R,table:E}}function g(w,P){let E;const R=t.getBestModeForData(w);if(E=t.from(P,R),E!==t.BYTE&&E.bit<R.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString(E)+`.
177
- Suggested mode is: `+t.toString(R));switch(E===t.KANJI&&!a.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new r(w);case t.ALPHANUMERIC:return new n(w);case t.KANJI:return new i(w);case t.BYTE:return new o(w)}}e.fromArray=function(P){return P.reduce(function(E,R){return typeof R=="string"?E.push(g(R,null)):R.data&&E.push(g(R.data,R.mode)),E},[])},e.fromString=function(P,E){const R=h(P,a.isKanjiModeEnabled()),_=d(R),b=p(_,E),S=u.find_path(b.map,"start","end"),A=[];for(let C=1;C<S.length-1;C++)A.push(b.table[S[C]].node);return e.fromArray(y(A))},e.rawSplit=function(P){return e.fromArray(h(P,a.isKanjiModeEnabled()))}})(st)),st}var Pn;function Lo(){if(Pn)return Je;Pn=1;const e=ee(),t=Qe(),r=po(),n=go(),o=mo(),i=yo(),s=wo(),a=fn(),u=Co(),c=So(),f=Ro(),h=te(),m=Oo();function y(b,S){const A=b.size,C=i.getPositions(S);for(let L=0;L<C.length;L++){const B=C[L][0],N=C[L][1];for(let T=-1;T<=7;T++)if(!(B+T<=-1||A<=B+T))for(let O=-1;O<=7;O++)N+O<=-1||A<=N+O||(T>=0&&T<=6&&(O===0||O===6)||O>=0&&O<=6&&(T===0||T===6)||T>=2&&T<=4&&O>=2&&O<=4?b.set(B+T,N+O,!0,!0):b.set(B+T,N+O,!1,!0))}}function d(b){const S=b.size;for(let A=8;A<S-8;A++){const C=A%2===0;b.set(A,6,C,!0),b.set(6,A,C,!0)}}function p(b,S){const A=o.getPositions(S);for(let C=0;C<A.length;C++){const L=A[C][0],B=A[C][1];for(let N=-2;N<=2;N++)for(let T=-2;T<=2;T++)N===-2||N===2||T===-2||T===2||N===0&&T===0?b.set(L+N,B+T,!0,!0):b.set(L+N,B+T,!1,!0)}}function g(b,S){const A=b.size,C=c.getEncodedBits(S);let L,B,N;for(let T=0;T<18;T++)L=Math.floor(T/3),B=T%3+A-8-3,N=(C>>T&1)===1,b.set(L,B,N,!0),b.set(B,L,N,!0)}function w(b,S,A){const C=b.size,L=f.getEncodedBits(S,A);let B,N;for(B=0;B<15;B++)N=(L>>B&1)===1,B<6?b.set(B,8,N,!0):B<8?b.set(B+1,8,N,!0):b.set(C-15+B,8,N,!0),B<8?b.set(8,C-B-1,N,!0):B<9?b.set(8,15-B-1+1,N,!0):b.set(8,15-B-1,N,!0);b.set(C-8,8,1,!0)}function P(b,S){const A=b.size;let C=-1,L=A-1,B=7,N=0;for(let T=A-1;T>0;T-=2)for(T===6&&T--;;){for(let O=0;O<2;O++)if(!b.isReserved(L,T-O)){let z=!1;N<S.length&&(z=(S[N]>>>B&1)===1),b.set(L,T-O,z),B--,B===-1&&(N++,B=7)}if(L+=C,L<0||A<=L){L-=C,C=-C;break}}}function E(b,S,A){const C=new r;A.forEach(function(O){C.put(O.mode.bit,4),C.put(O.getLength(),h.getCharCountIndicator(O.mode,b)),O.write(C)});const L=e.getSymbolTotalCodewords(b),B=a.getTotalCodewordsCount(b,S),N=(L-B)*8;for(C.getLengthInBits()+4<=N&&C.put(0,4);C.getLengthInBits()%8!==0;)C.putBit(0);const T=(N-C.getLengthInBits())/8;for(let O=0;O<T;O++)C.put(O%2?17:236,8);return R(C,b,S)}function R(b,S,A){const C=e.getSymbolTotalCodewords(S),L=a.getTotalCodewordsCount(S,A),B=C-L,N=a.getBlocksCount(S,A),T=C%N,O=N-T,z=Math.floor(C/N),M=Math.floor(B/N),Le=M+1,$=z-M,Ie=new u($);let we=0;const j=new Array(N),K=new Array(N);let ne=0;const ue=new Uint8Array(b.buffer);for(let le=0;le<N;le++){const gt=le<O?M:Le;j[le]=ue.slice(we,we+gt),K[le]=Ie.encode(j[le]),we+=gt,ne=Math.max(ne,gt)}const ce=new Uint8Array(C);let Dn=0,Q,W;for(Q=0;Q<ne;Q++)for(W=0;W<N;W++)Q<j[W].length&&(ce[Dn++]=j[W][Q]);for(Q=0;Q<$;Q++)for(W=0;W<N;W++)ce[Dn++]=K[W][Q];return ce}function _(b,S,A,C){let L;if(Array.isArray(b))L=m.fromArray(b);else if(typeof b=="string"){let z=S;if(!z){const M=m.rawSplit(b);z=c.getBestVersionForData(M,A)}L=m.fromString(b,z||40)}else throw new Error("Invalid data");const B=c.getBestVersionForData(L,A);if(!B)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=B;else if(S<B)throw new Error(`
169
+ }`;var oe={},ve,mt;function $n(){return mt||(mt=1,ve=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),ve}var Ue={},G={},yt;function Y(){if(yt)return G;yt=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return G.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},G.getSymbolTotalCodewords=function(n){return t[n]},G.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},G.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},G.isKanjiModeEnabled=function(){return typeof e<"u"},G.toSJIS=function(n){return e(n)},G}var Fe={},wt;function Me(){return wt||(wt=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(Fe)),Fe}var ke,bt;function Vn(){if(bt)return ke;bt=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},ke=e,ke}var xe,Et;function Jn(){if(Et)return xe;Et=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,o){const i=t*this.size+r;this.data[i]=n,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},xe=e,xe}var De={},Ct;function Kn(){return Ct||(Ct=1,(function(e){const t=Y().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let u=1;u<o-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(n){const o=[],i=e.getRowColCoords(n),s=i.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||o.push([i[a],i[u]]);return o}})(De)),De}var qe={},St;function Wn(){if(St)return qe;St=1;const e=Y().getSymbolSize,t=7;return qe.getPositions=function(n){const o=e(n);return[[0,0],[o-t,0],[0,o-t]]},qe}var je={},Rt;function Qn(){return Rt||(Rt=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,u=0,l=null,f=null;for(let h=0;h<i;h++){a=u=0,l=f=null;for(let m=0;m<i;m++){let y=o.get(h,m);y===l?a++:(a>=5&&(s+=t.N1+(a-5)),l=y,a=1),y=o.get(m,h),y===f?u++:(u>=5&&(s+=t.N1+(u-5)),f=y,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a<i-1;a++)for(let u=0;u<i-1;u++){const l=o.get(a,u)+o.get(a,u+1)+o.get(a+1,u)+o.get(a+1,u+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const i=o.size;let s=0,a=0,u=0;for(let l=0;l<i;l++){a=u=0;for(let f=0;f<i;f++)a=a<<1&2047|o.get(l,f),f>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(f,l),f>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let u=0;u<s;u++)i+=o.data[u];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function r(n,o,i){switch(n){case e.Patterns.PATTERN000:return(o+i)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(o+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return o*i%2+o*i%3===0;case e.Patterns.PATTERN110:return(o*i%2+o*i%3)%2===0;case e.Patterns.PATTERN111:return(o*i%3+(o+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(o,i){const s=i.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)i.isReserved(u,a)||i.xor(u,a,r(o,u,a))},e.getBestMask=function(o,i){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let l=0;l<s;l++){i(l),e.applyMask(l,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(l,o),f<u&&(u=f,a=l)}return a}})(je)),je}var be={},Tt;function At(){if(Tt)return be;Tt=1;const e=Me(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return be.getBlocksCount=function(o,i){switch(i){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},be.getTotalCodewordsCount=function(o,i){switch(i){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},be}var He={},fe={},Bt;function Gn(){if(Bt)return fe;Bt=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let o=0;o<255;o++)e[o]=n,t[n]=o,n<<=1,n&256&&(n^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),fe.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},fe.exp=function(n){return e[n]},fe.mul=function(n,o){return n===0||o===0?0:e[t[n]+t[o]]},fe}var Pt;function Yn(){return Pt||(Pt=1,(function(e){const t=Gn();e.mul=function(n,o){const i=new Uint8Array(n.length+o.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<o.length;a++)i[s+a]^=t.mul(n[s],o[a]);return i},e.mod=function(n,o){let i=new Uint8Array(n);for(;i.length-o.length>=0;){const s=i[0];for(let u=0;u<o.length;u++)i[u]^=t.mul(o[u],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let i=0;i<n;i++)o=e.mul(o,new Uint8Array([1,t.exp(i)]));return o}})(He)),He}var ze,Nt;function Xn(){if(Nt)return ze;Nt=1;const e=Yn();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(n.length+this.degree);o.set(n);const i=e.mod(o,this.genPoly),s=this.degree-i.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i},ze=t,ze}var $e={},Ve={},Je={},Ot;function Lt(){return Ot||(Ot=1,Je.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),Je}var V={},It;function _t(){if(It)return V;It=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
170
+ ]))+`;V.KANJI=new RegExp(r,"g"),V.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),V.BYTE=new RegExp(n,"g"),V.NUMERIC=new RegExp(e,"g"),V.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+r+"$"),i=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return V.testKanji=function(u){return o.test(u)},V.testNumeric=function(u){return i.test(u)},V.testAlphanumeric=function(u){return s.test(u)},V}var vt;function X(){return vt||(vt=1,(function(e){const t=Lt(),r=_t();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(Ve)),Ve}var Ut;function Zn(){return Ut||(Ut=1,(function(e){const t=Y(),r=At(),n=Me(),o=X(),i=Lt(),s=7973,a=t.getBCHDigit(s);function u(m,y,d){for(let p=1;p<=40;p++)if(y<=e.getCapacity(p,d,m))return p}function l(m,y){return o.getCharCountIndicator(m,y)+4}function f(m,y){let d=0;return m.forEach(function(p){const g=l(p.mode,y);d+=g+p.getBitsLength()}),d}function h(m,y){for(let d=1;d<=40;d++)if(f(m,d)<=e.getCapacity(d,y,o.MIXED))return d}e.from=function(y,d){return i.isValid(y)?parseInt(y,10):d},e.getCapacity=function(y,d,p){if(!i.isValid(y))throw new Error("Invalid QR Code version");typeof p>"u"&&(p=o.BYTE);const g=t.getSymbolTotalCodewords(y),w=r.getTotalCodewordsCount(y,d),N=(g-w)*8;if(p===o.MIXED)return N;const E=N-l(p,y);switch(p){case o.NUMERIC:return Math.floor(E/10*3);case o.ALPHANUMERIC:return Math.floor(E/11*2);case o.KANJI:return Math.floor(E/13);case o.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(y,d){let p;const g=n.from(d,n.M);if(Array.isArray(y)){if(y.length>1)return h(y,g);if(y.length===0)return 1;p=y[0]}else p=y;return u(p.mode,p.getLength(),g)},e.getEncodedBits=function(y){if(!i.isValid(y)||y<7)throw new Error("Invalid QR Code version");let d=y<<12;for(;t.getBCHDigit(d)-a>=0;)d^=s<<t.getBCHDigit(d)-a;return y<<12|d}})($e)),$e}var Ke={},Ft;function er(){if(Ft)return Ke;Ft=1;const e=Y(),t=1335,r=21522,n=e.getBCHDigit(t);return Ke.getEncodedBits=function(i,s){const a=i.bit<<3|s;let u=a<<10;for(;e.getBCHDigit(u)-n>=0;)u^=t<<e.getBCHDigit(u)-n;return(a<<10|u)^r},Ke}var We={},Qe,Mt;function tr(){if(Mt)return Qe;Mt=1;const e=X();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let o,i,s;for(o=0;o+3<=this.data.length;o+=3)i=this.data.substr(o,3),s=parseInt(i,10),n.put(s,10);const a=this.data.length-o;a>0&&(i=this.data.substr(o),s=parseInt(i,10),n.put(s,a*3+1))},Qe=t,Qe}var Ge,kt;function nr(){if(kt)return Ge;kt=1;const e=X(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let i;for(i=0;i+2<=this.data.length;i+=2){let s=t.indexOf(this.data[i])*45;s+=t.indexOf(this.data[i+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[i]),6)},Ge=r,Ge}var Ye,xt;function rr(){if(xt)return Ye;xt=1;const e=X();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,o=this.data.length;n<o;n++)r.put(this.data[n],8)},Ye=t,Ye}var Xe,Dt;function or(){if(Dt)return Xe;Dt=1;const e=X(),t=Y();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o<this.data.length;o++){let i=t.toSJIS(this.data[o]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
171
+ Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13)}},Xe=r,Xe}var Ze={exports:{}},qt;function ir(){return qt||(qt=1,(function(e){var t={single_source_shortest_paths:function(r,n,o){var i={},s={};s[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var u,l,f,h,m,y,d,p,g;!a.empty();){u=a.pop(),l=u.value,h=u.cost,m=r[l]||{};for(f in m)m.hasOwnProperty(f)&&(y=m[f],d=h+y,p=s[f],g=typeof s[f]>"u",(g||p>d)&&(s[f]=d,a.push(f,d),i[f]=l))}if(typeof o<"u"&&typeof s[o]>"u"){var w=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],i=n;i;)o.push(i),r[i],i=r[i];return o.reverse(),o},find_path:function(r,n,o){var i=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},i;r=r||{};for(i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Ze)),Ze.exports}var jt;function sr(){return jt||(jt=1,(function(e){const t=X(),r=tr(),n=nr(),o=rr(),i=or(),s=_t(),a=Y(),u=ir();function l(w){return unescape(encodeURIComponent(w)).length}function f(w,N,E){const R=[];let _;for(;(_=w.exec(E))!==null;)R.push({data:_[0],index:_.index,mode:N,length:_[0].length});return R}function h(w){const N=f(s.NUMERIC,t.NUMERIC,w),E=f(s.ALPHANUMERIC,t.ALPHANUMERIC,w);let R,_;return a.isKanjiModeEnabled()?(R=f(s.BYTE,t.BYTE,w),_=f(s.KANJI,t.KANJI,w)):(R=f(s.BYTE_KANJI,t.BYTE,w),_=[]),N.concat(E,R,_).sort(function(S,A){return S.index-A.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function m(w,N){switch(N){case t.NUMERIC:return r.getBitsLength(w);case t.ALPHANUMERIC:return n.getBitsLength(w);case t.KANJI:return i.getBitsLength(w);case t.BYTE:return o.getBitsLength(w)}}function y(w){return w.reduce(function(N,E){const R=N.length-1>=0?N[N.length-1]:null;return R&&R.mode===E.mode?(N[N.length-1].data+=E.data,N):(N.push(E),N)},[])}function d(w){const N=[];for(let E=0;E<w.length;E++){const R=w[E];switch(R.mode){case t.NUMERIC:N.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:N.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:N.push([R,{data:R.data,mode:t.BYTE,length:l(R.data)}]);break;case t.BYTE:N.push([{data:R.data,mode:t.BYTE,length:l(R.data)}])}}return N}function p(w,N){const E={},R={start:{}};let _=["start"];for(let b=0;b<w.length;b++){const S=w[b],A=[];for(let C=0;C<S.length;C++){const L=S[C],B=""+b+C;A.push(B),E[B]={node:L,lastCount:0},R[B]={};for(let P=0;P<_.length;P++){const T=_[P];E[T]&&E[T].node.mode===L.mode?(R[T][B]=m(E[T].lastCount+L.length,L.mode)-m(E[T].lastCount,L.mode),E[T].lastCount+=L.length):(E[T]&&(E[T].lastCount=L.length),R[T][B]=m(L.length,L.mode)+4+t.getCharCountIndicator(L.mode,N))}}_=A}for(let b=0;b<_.length;b++)R[_[b]].end=0;return{map:R,table:E}}function g(w,N){let E;const R=t.getBestModeForData(w);if(E=t.from(N,R),E!==t.BYTE&&E.bit<R.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString(E)+`.
172
+ Suggested mode is: `+t.toString(R));switch(E===t.KANJI&&!a.isKanjiModeEnabled()&&(E=t.BYTE),E){case t.NUMERIC:return new r(w);case t.ALPHANUMERIC:return new n(w);case t.KANJI:return new i(w);case t.BYTE:return new o(w)}}e.fromArray=function(N){return N.reduce(function(E,R){return typeof R=="string"?E.push(g(R,null)):R.data&&E.push(g(R.data,R.mode)),E},[])},e.fromString=function(N,E){const R=h(N,a.isKanjiModeEnabled()),_=d(R),b=p(_,E),S=u.find_path(b.map,"start","end"),A=[];for(let C=1;C<S.length-1;C++)A.push(b.table[S[C]].node);return e.fromArray(y(A))},e.rawSplit=function(N){return e.fromArray(h(N,a.isKanjiModeEnabled()))}})(We)),We}var Ht;function ar(){if(Ht)return Ue;Ht=1;const e=Y(),t=Me(),r=Vn(),n=Jn(),o=Kn(),i=Wn(),s=Qn(),a=At(),u=Xn(),l=Zn(),f=er(),h=X(),m=sr();function y(b,S){const A=b.size,C=i.getPositions(S);for(let L=0;L<C.length;L++){const B=C[L][0],P=C[L][1];for(let T=-1;T<=7;T++)if(!(B+T<=-1||A<=B+T))for(let O=-1;O<=7;O++)P+O<=-1||A<=P+O||(T>=0&&T<=6&&(O===0||O===6)||O>=0&&O<=6&&(T===0||T===6)||T>=2&&T<=4&&O>=2&&O<=4?b.set(B+T,P+O,!0,!0):b.set(B+T,P+O,!1,!0))}}function d(b){const S=b.size;for(let A=8;A<S-8;A++){const C=A%2===0;b.set(A,6,C,!0),b.set(6,A,C,!0)}}function p(b,S){const A=o.getPositions(S);for(let C=0;C<A.length;C++){const L=A[C][0],B=A[C][1];for(let P=-2;P<=2;P++)for(let T=-2;T<=2;T++)P===-2||P===2||T===-2||T===2||P===0&&T===0?b.set(L+P,B+T,!0,!0):b.set(L+P,B+T,!1,!0)}}function g(b,S){const A=b.size,C=l.getEncodedBits(S);let L,B,P;for(let T=0;T<18;T++)L=Math.floor(T/3),B=T%3+A-8-3,P=(C>>T&1)===1,b.set(L,B,P,!0),b.set(B,L,P,!0)}function w(b,S,A){const C=b.size,L=f.getEncodedBits(S,A);let B,P;for(B=0;B<15;B++)P=(L>>B&1)===1,B<6?b.set(B,8,P,!0):B<8?b.set(B+1,8,P,!0):b.set(C-15+B,8,P,!0),B<8?b.set(8,C-B-1,P,!0):B<9?b.set(8,15-B-1+1,P,!0):b.set(8,15-B-1,P,!0);b.set(C-8,8,1,!0)}function N(b,S){const A=b.size;let C=-1,L=A-1,B=7,P=0;for(let T=A-1;T>0;T-=2)for(T===6&&T--;;){for(let O=0;O<2;O++)if(!b.isReserved(L,T-O)){let z=!1;P<S.length&&(z=(S[P]>>>B&1)===1),b.set(L,T-O,z),B--,B===-1&&(P++,B=7)}if(L+=C,L<0||A<=L){L-=C,C=-C;break}}}function E(b,S,A){const C=new r;A.forEach(function(O){C.put(O.mode.bit,4),C.put(O.getLength(),h.getCharCountIndicator(O.mode,b)),O.write(C)});const L=e.getSymbolTotalCodewords(b),B=a.getTotalCodewordsCount(b,S),P=(L-B)*8;for(C.getLengthInBits()+4<=P&&C.put(0,4);C.getLengthInBits()%8!==0;)C.putBit(0);const T=(P-C.getLengthInBits())/8;for(let O=0;O<T;O++)C.put(O%2?17:236,8);return R(C,b,S)}function R(b,S,A){const C=e.getSymbolTotalCodewords(S),L=a.getTotalCodewordsCount(S,A),B=C-L,P=a.getBlocksCount(S,A),T=C%P,O=P-T,z=Math.floor(C/P),M=Math.floor(B/P),Le=M+1,$=z-M,Ie=new u($);let we=0;const j=new Array(P),K=new Array(P);let ne=0;const ue=new Uint8Array(b.buffer);for(let ce=0;ce<P;ce++){const pt=ce<O?M:Le;j[ce]=ue.slice(we,we+pt),K[ce]=Ie.encode(j[ce]),we+=pt,ne=Math.max(ne,pt)}const le=new Uint8Array(C);let xn=0,W,Q;for(W=0;W<ne;W++)for(Q=0;Q<P;Q++)W<j[Q].length&&(le[xn++]=j[Q][W]);for(W=0;W<$;W++)for(Q=0;Q<P;Q++)le[xn++]=K[Q][W];return le}function _(b,S,A,C){let L;if(Array.isArray(b))L=m.fromArray(b);else if(typeof b=="string"){let z=S;if(!z){const M=m.rawSplit(b);z=l.getBestVersionForData(M,A)}L=m.fromString(b,z||40)}else throw new Error("Invalid data");const B=l.getBestVersionForData(L,A);if(!B)throw new Error("The amount of data is too big to be stored in a QR Code");if(!S)S=B;else if(S<B)throw new Error(`
178
173
  The chosen QR Code version cannot contain this amount of data.
179
174
  Minimum version required to store current data is: `+B+`.
180
- `);const N=E(S,A,L),T=e.getSymbolSize(S),O=new n(T);return y(O,S),d(O),p(O,S),w(O,A,0),S>=7&&g(O,S),P(O,N),isNaN(C)&&(C=s.getBestMask(O,w.bind(null,O,A))),s.applyMask(C,O),w(O,A,C),{modules:O,version:S,errorCorrectionLevel:A,maskPattern:C,segments:L}}return Je.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let C=t.M,L,B;return typeof A<"u"&&(C=t.from(A.errorCorrectionLevel,t.M),L=c.from(A.version),B=s.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),_(S,L,C,B)},Je}var dt={},ht={},On;function Ln(){return On||(On=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),c=Math.floor((s+i.margin*2)*u),f=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m<c;m++)for(let y=0;y<c;y++){let d=(m*c+y)*4,p=i.color.light;if(m>=f&&y>=f&&m<c-f&&y<c-f){const g=Math.floor((m-f)/u),w=Math.floor((y-f)/u);p=h[a[g*s+w]?1:0]}n[d++]=p.r,n[d++]=p.g,n[d++]=p.b,n[d]=p.a}}})(ht)),ht}var In;function Io(){return In||(In=1,(function(e){const t=Ln();function r(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=n()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),h=c.getContext("2d"),m=h.createImageData(f,f);return t.qrToImageData(m.data,i,u),r(h,c,f),h.putImageData(m,0,0),c},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=e.render(i,s,u),f=u.type||"image/png",h=u.rendererOpts||{};return c.toDataURL(f,h.quality)}})(dt)),dt}var pt={},_n;function _o(){if(_n)return pt;_n=1;const e=Ln();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function r(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function n(o,i,s){let a="",u=0,c=!1,f=0;for(let h=0;h<o.length;h++){const m=Math.floor(h%i),y=Math.floor(h/i);!m&&!c&&(c=!0),o[h]?(f++,h>0&&m>0&&o[h-1]||(a+=c?r("M",m+s,.5+y+s):r("m",u,0),u=0,c=!1),m+1<i&&o[h+1]||(a+=r("h",f),f=0)):u++}return a}return pt.render=function(i,s,a){const u=e.getOptions(s),c=i.modules.size,f=i.modules.data,h=c+u.margin*2,m=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",y="<path "+t(u.color.dark,"stroke")+' d="'+n(f,c,u.margin)+'"/>',d='viewBox="0 0 '+h+" "+h+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+d+' shape-rendering="crispEdges">'+m+y+`</svg>
181
- `;return typeof a=="function"&&a(null,g),g},pt}var vn;function vo(){if(vn)return ae;vn=1;const e=ho(),t=Lo(),r=Io(),n=_o();function o(i,s,a,u,c){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(c=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);c(null,i(y,s,u))}catch(y){c(y)}}return ae.create=t.create,ae.toCanvas=o.bind(null,r.render),ae.toDataURL=o.bind(null,r.renderToDataURL),ae.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),ae}var Uo=vo();const ye=ve(),Un=v.create({baseURL:ye.baseUrl});async function Fn(e={}){return(await Un.post(ye.createEndpoint,e,{withCredentials:!0})).data}function Mn(e=()=>{},t=()=>{}){const r=new URL(ye.authEventEndpoint,ye.baseUrl),n=new EventSource(r,{withCredentials:!0});return n.addEventListener("auth-success",async o=>{try{await Un.post(ye.authConfirmEndpoint,null,{withCredentials:!0}),e()}catch(i){console.error(i),t(i)}finally{n.close()}}),n.onerror=o=>{console.error("EventSource failed:",o),n.close()},n}class Fo{constructor(){x(this,"overlay",null);x(this,"isOpen",!1);x(this,"authEvent",null);x(this,"contentContainer",null);x(this,"loader",null);x(this,"qrContainer",null);x(this,"separator",null);x(this,"loginButton",null);x(this,"errorContainer",null);x(this,"timerContainer",null);x(this,"timerInterval",null);x(this,"resolvePromise",null);x(this,"rejectPromise",null);x(this,"currentPromise",null);x(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{var n;r.target===this.overlay&&(this.close(),((n=this.errorContainer)==null?void 0:n.style.display)=="block"&&this.rejectPromise())}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await Uo.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t).getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=t.links[0].link;this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=Mn(()=>{this.close(),this.resolvePromise()},n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
175
+ `);const P=E(S,A,L),T=e.getSymbolSize(S),O=new n(T);return y(O,S),d(O),p(O,S),w(O,A,0),S>=7&&g(O,S),N(O,P),isNaN(C)&&(C=s.getBestMask(O,w.bind(null,O,A))),s.applyMask(C,O),w(O,A,C),{modules:O,version:S,errorCorrectionLevel:A,maskPattern:C,segments:L}}return Ue.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let C=t.M,L,B;return typeof A<"u"&&(C=t.from(A.errorCorrectionLevel,t.M),L=l.from(A.version),B=s.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),_(S,L,C,B)},Ue}var et={},tt={},zt;function $t(){return zt||(zt=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),l=Math.floor((s+i.margin*2)*u),f=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m<l;m++)for(let y=0;y<l;y++){let d=(m*l+y)*4,p=i.color.light;if(m>=f&&y>=f&&m<l-f&&y<l-f){const g=Math.floor((m-f)/u),w=Math.floor((y-f)/u);p=h[a[g*s+w]?1:0]}n[d++]=p.r,n[d++]=p.g,n[d++]=p.b,n[d]=p.a}}})(tt)),tt}var Vt;function ur(){return Vt||(Vt=1,(function(e){const t=$t();function r(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=n()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),h=l.getContext("2d"),m=h.createImageData(f,f);return t.qrToImageData(m.data,i,u),r(h,l,f),h.putImageData(m,0,0),l},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(i,s,u),f=u.type||"image/png",h=u.rendererOpts||{};return l.toDataURL(f,h.quality)}})(et)),et}var nt={},Jt;function lr(){if(Jt)return nt;Jt=1;const e=$t();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function r(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function n(o,i,s){let a="",u=0,l=!1,f=0;for(let h=0;h<o.length;h++){const m=Math.floor(h%i),y=Math.floor(h/i);!m&&!l&&(l=!0),o[h]?(f++,h>0&&m>0&&o[h-1]||(a+=l?r("M",m+s,.5+y+s):r("m",u,0),u=0,l=!1),m+1<i&&o[h+1]||(a+=r("h",f),f=0)):u++}return a}return nt.render=function(i,s,a){const u=e.getOptions(s),l=i.modules.size,f=i.modules.data,h=l+u.margin*2,m=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",y="<path "+t(u.color.dark,"stroke")+' d="'+n(f,l,u.margin)+'"/>',d='viewBox="0 0 '+h+" "+h+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+d+' shape-rendering="crispEdges">'+m+y+`</svg>
176
+ `;return typeof a=="function"&&a(null,g),g},nt}var Kt;function cr(){if(Kt)return oe;Kt=1;const e=$n(),t=ar(),r=ur(),n=lr();function o(i,s,a,u,l){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof l>"u"?(l=u,u=void 0):(l=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);l(null,i(y,s,u))}catch(y){l(y)}}return oe.create=t.create,oe.toCanvas=o.bind(null,r.render),oe.toDataURL=o.bind(null,r.renderToDataURL),oe.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),oe}var fr=cr();function Wt(e,t){return function(){return e.apply(t,arguments)}}const{toString:dr}=Object.prototype,{getPrototypeOf:rt}=Object,{iterator:Ee,toStringTag:Qt}=Symbol,Ce=(e=>t=>{const r=dr.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),H=e=>(e=e.toLowerCase(),t=>Ce(t)===e),Se=e=>t=>typeof t===e,{isArray:ie}=Array,se=Se("undefined");function de(e){return e!==null&&!se(e)&&e.constructor!==null&&!se(e.constructor)&&x(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Gt=H("ArrayBuffer");function hr(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Gt(e.buffer),t}const pr=Se("string"),x=Se("function"),Yt=Se("number"),he=e=>e!==null&&typeof e=="object",gr=e=>e===!0||e===!1,Re=e=>{if(Ce(e)!=="object")return!1;const t=rt(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Qt in e)&&!(Ee in e)},mr=e=>{if(!he(e)||de(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},yr=H("Date"),wr=H("File"),br=H("Blob"),Er=H("FileList"),Cr=e=>he(e)&&x(e.pipe),Sr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||x(e.append)&&((t=Ce(e))==="formdata"||t==="object"&&x(e.toString)&&e.toString()==="[object FormData]"))},Rr=H("URLSearchParams"),[Tr,Ar,Br,Pr]=["ReadableStream","Request","Response","Headers"].map(H),Nr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pe(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,o;if(typeof e!="object"&&(e=[e]),ie(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{if(de(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let a;for(n=0;n<s;n++)a=i[n],t.call(null,e[a],a,e)}}function Xt(e,t){if(de(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,o;for(;n-- >0;)if(o=r[n],t===o.toLowerCase())return o;return null}const Z=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Zt=e=>!se(e)&&e!==Z;function ot(){const{caseless:e,skipUndefined:t}=Zt(this)&&this||{},r={},n=(o,i)=>{const s=e&&Xt(r,i)||i;Re(r[s])&&Re(o)?r[s]=ot(r[s],o):Re(o)?r[s]=ot({},o):ie(o)?r[s]=o.slice():(!t||!se(o))&&(r[s]=o)};for(let o=0,i=arguments.length;o<i;o++)arguments[o]&&pe(arguments[o],n);return r}const Or=(e,t,r,{allOwnKeys:n}={})=>(pe(t,(o,i)=>{r&&x(o)?e[i]=Wt(o,r):e[i]=o},{allOwnKeys:n}),e),Lr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ir=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},_r=(e,t,r,n)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!n||n(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=r!==!1&&rt(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},vr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Ur=e=>{if(!e)return null;if(ie(e))return e;let t=e.length;if(!Yt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Fr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&rt(Uint8Array)),Mr=(e,t)=>{const n=(e&&e[Ee]).call(e);let o;for(;(o=n.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},kr=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},xr=H("HTMLFormElement"),Dr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,o){return n.toUpperCase()+o}),en=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),qr=H("RegExp"),tn=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};pe(r,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(n[i]=s||o)}),Object.defineProperties(e,n)},jr=e=>{tn(e,(t,r)=>{if(x(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(x(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Hr=(e,t)=>{const r={},n=o=>{o.forEach(i=>{r[i]=!0})};return ie(e)?n(e):n(String(e).split(t)),r},zr=()=>{},$r=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Vr(e){return!!(e&&x(e.append)&&e[Qt]==="FormData"&&e[Ee])}const Jr=e=>{const t=new Array(10),r=(n,o)=>{if(he(n)){if(t.indexOf(n)>=0)return;if(de(n))return n;if(!("toJSON"in n)){t[o]=n;const i=ie(n)?[]:{};return pe(n,(s,a)=>{const u=r(s,o+1);!se(u)&&(i[a]=u)}),t[o]=void 0,i}}return n};return r(e,0)},Kr=H("AsyncFunction"),Wr=e=>e&&(he(e)||x(e))&&x(e.then)&&x(e.catch),nn=((e,t)=>e?setImmediate:t?((r,n)=>(Z.addEventListener("message",({source:o,data:i})=>{o===Z&&i===r&&n.length&&n.shift()()},!1),o=>{n.push(o),Z.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",x(Z.postMessage)),Qr=typeof queueMicrotask<"u"?queueMicrotask.bind(Z):typeof process<"u"&&process.nextTick||nn,c={isArray:ie,isArrayBuffer:Gt,isBuffer:de,isFormData:Sr,isArrayBufferView:hr,isString:pr,isNumber:Yt,isBoolean:gr,isObject:he,isPlainObject:Re,isEmptyObject:mr,isReadableStream:Tr,isRequest:Ar,isResponse:Br,isHeaders:Pr,isUndefined:se,isDate:yr,isFile:wr,isBlob:br,isRegExp:qr,isFunction:x,isStream:Cr,isURLSearchParams:Rr,isTypedArray:Fr,isFileList:Er,forEach:pe,merge:ot,extend:Or,trim:Nr,stripBOM:Lr,inherits:Ir,toFlatObject:_r,kindOf:Ce,kindOfTest:H,endsWith:vr,toArray:Ur,forEachEntry:Mr,matchAll:kr,isHTMLForm:xr,hasOwnProperty:en,hasOwnProp:en,reduceDescriptors:tn,freezeMethods:jr,toObjectSet:Hr,toCamelCase:Dr,noop:zr,toFiniteNumber:$r,findKey:Xt,global:Z,isContextDefined:Zt,isSpecCompliantForm:Vr,toJSONObject:Jr,isAsyncFn:Kr,isThenable:Wr,setImmediate:nn,asap:Qr,isIterable:e=>e!=null&&x(e[Ee])};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(I,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:c.toJSONObject(this.config),code:this.code,status:this.status}}});const rn=I.prototype,on={};["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(e=>{on[e]={value:e}}),Object.defineProperties(I,on),Object.defineProperty(rn,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,i)=>{const s=Object.create(rn);c.toFlatObject(e,s,function(f){return f!==Error.prototype},l=>l!=="isAxiosError");const a=e&&e.message?e.message:"Error",u=t==null&&e?e.code:t;return I.call(s,a,u,r,n,o),e&&s.cause==null&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",i&&Object.assign(s,i),s};const Gr=null;function it(e){return c.isPlainObject(e)||c.isArray(e)}function sn(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function an(e,t,r){return e?e.concat(t).map(function(o,i){return o=sn(o),!r&&i?"["+o+"]":o}).join(r?".":""):t}function Yr(e){return c.isArray(e)&&!e.some(it)}const Xr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Te(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,g){return!c.isUndefined(g[p])});const n=r.metaTokens,o=r.visitor||f,i=r.dots,s=r.indexes,u=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!u&&c.isBlob(d))throw new I("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?u&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function f(d,p,g){let w=d;if(d&&!g&&typeof d=="object"){if(c.endsWith(p,"{}"))p=n?p:p.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&Yr(d)||(c.isFileList(d)||c.endsWith(p,"[]"))&&(w=c.toArray(d)))return p=sn(p),w.forEach(function(E,R){!(c.isUndefined(E)||E===null)&&t.append(s===!0?an([p],R,i):s===null?p:p+"[]",l(E))}),!1}return it(d)?!0:(t.append(an(g,p,i),l(d)),!1)}const h=[],m=Object.assign(Xr,{defaultVisitor:f,convertValue:l,isVisitable:it});function y(d,p){if(!c.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(d),c.forEach(d,function(w,N){(!(c.isUndefined(w)||w===null)&&o.call(t,w,c.isString(N)?N.trim():N,p,m))===!0&&y(w,p?p.concat(N):[N])}),h.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return y(e),t}function un(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function st(e,t){this._pairs=[],e&&Te(e,this,t)}const ln=st.prototype;ln.append=function(t,r){this._pairs.push([t,r])},ln.toString=function(t){const r=t?function(n){return t.call(this,n,un)}:un;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function Zr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function cn(e,t,r){if(!t)return e;const n=r&&r.encode||Zr;c.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let i;if(o?i=o(t,r):i=c.isURLSearchParams(t)?t.toString():new st(t,r).toString(n),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class fn{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dn={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eo={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:st,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},at=typeof window<"u"&&typeof document<"u",ut=typeof navigator=="object"&&navigator||void 0,to=at&&(!ut||["ReactNative","NativeScript","NS"].indexOf(ut.product)<0),no=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ro=at&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:at,hasStandardBrowserEnv:to,hasStandardBrowserWebWorkerEnv:no,navigator:ut,origin:ro},Symbol.toStringTag,{value:"Module"})),...eo};function oo(e,t){return Te(e,new F.classes.URLSearchParams,{visitor:function(r,n,o,i){return F.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function io(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function so(e){const t={},r=Object.keys(e);let n;const o=r.length;let i;for(n=0;n<o;n++)i=r[n],t[i]=e[i];return t}function hn(e){function t(r,n,o,i){let s=r[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),u=i>=r.length;return s=!s&&c.isArray(o)?o.length:s,u?(c.hasOwnProp(o,s)?o[s]=[o[s],n]:o[s]=n,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),t(r,n,o[s],i)&&c.isArray(o[s])&&(o[s]=so(o[s])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,o)=>{t(io(n),o,r,0)}),r}return null}function ao(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ge={transitional:dn,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",o=n.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return o?JSON.stringify(hn(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return oo(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Te(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(r.setContentType("application/json",!1),ao(t)):t}],transformResponse:[function(t){const r=this.transitional||ge.transitional,n=r&&r.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||o)){const s=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?I.from(a,I.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{ge.headers[e]={}});const uo=c.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"]),lo=e=>{const t={};let r,n,o;return e&&e.split(`
177
+ `).forEach(function(s){o=s.indexOf(":"),r=s.substring(0,o).trim().toLowerCase(),n=s.substring(o+1).trim(),!(!r||t[r]&&uo[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},pn=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return e===!1||e==null?e:c.isArray(e)?e.map(Ae):String(e)}function co(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const fo=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lt(e,t,r,n,o){if(c.isFunction(n))return n.call(this,t,r);if(o&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function ho(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function po(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(o,i,s){return this[n].call(this,t,o,i,s)},configurable:!0})})}let D=class{constructor(t){t&&this.set(t)}set(t,r,n){const o=this;function i(a,u,l){const f=me(u);if(!f)throw new Error("header name must be a non-empty string");const h=c.findKey(o,f);(!h||o[h]===void 0||l===!0||l===void 0&&o[h]!==!1)&&(o[h||u]=Ae(a))}const s=(a,u)=>c.forEach(a,(l,f)=>i(l,f,u));if(c.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(c.isString(t)&&(t=t.trim())&&!fo(t))s(lo(t),r);else if(c.isObject(t)&&c.isIterable(t)){let a={},u,l;for(const f of t){if(!c.isArray(f))throw TypeError("Object iterator must return a key-value pair");a[l=f[0]]=(u=a[l])?c.isArray(u)?[...u,f[1]]:[u,f[1]]:f[1]}s(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=me(t),t){const n=c.findKey(this,t);if(n){const o=this[n];if(!r)return o;if(r===!0)return co(o);if(c.isFunction(r))return r.call(this,o,n);if(c.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=me(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||lt(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let o=!1;function i(s){if(s=me(s),s){const a=c.findKey(n,s);a&&(!r||lt(n,n[a],a,r))&&(delete n[a],o=!0)}}return c.isArray(t)?t.forEach(i):i(t),o}clear(t){const r=Object.keys(this);let n=r.length,o=!1;for(;n--;){const i=r[n];(!t||lt(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const r=this,n={};return c.forEach(this,(o,i)=>{const s=c.findKey(n,i);if(s){r[s]=Ae(o),delete r[i];return}const a=t?ho(i):String(i).trim();a!==i&&delete r[i],r[a]=Ae(o),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,o)=>{n!=null&&n!==!1&&(r[o]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
178
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[pn]=this[pn]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=me(s);n[a]||(po(o,s),n[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};D.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(D.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(D);function ct(e,t){const r=this||ge,n=t||r,o=D.from(n.headers);let i=n.data;return c.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function gn(e){return!!(e&&e.__CANCEL__)}function ae(e,t,r){I.call(this,e??"canceled",I.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(ae,I,{__CANCEL__:!0});function mn(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function go(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mo(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];s||(s=l),r[o]=u,n[o]=l;let h=i,m=0;for(;h!==o;)m+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),l-s<t)return;const y=f&&l-f;return y?Math.round(m*1e3/y):void 0}}function yo(e,t){let r=0,n=1e3/t,o,i;const s=(l,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const f=Date.now(),h=f-r;h>=n?s(l,f):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}const Be=(e,t,r=3)=>{let n=0;const o=mo(50,250);return yo(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,l=o(u),f=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&f?(a-s)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},yn=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},wn=e=>(...t)=>c.asap(()=>e(...t)),wo=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,bo=F.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),c.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Eo(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Co(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function bn(e,t,r){let n=!Eo(t);return e&&(n||r==!1)?Co(e,t):t}const En=e=>e instanceof D?{...e}:e;function ee(e,t){t=t||{};const r={};function n(l,f,h,m){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:m},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function o(l,f,h,m){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,h,m)}else return n(l,f,h,m)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function s(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function a(l,f,h){if(h in t)return n(l,f);if(h in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,f,h)=>o(En(l),En(f),h,!0)};return c.forEach(Object.keys({...e,...t}),function(f){const h=u[f]||o,m=h(e[f],t[f],f);c.isUndefined(m)&&h!==a||(r[f]=m)}),r}const Cn=e=>{const t=ee({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=D.from(s),t.url=cn(bn(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const u=r.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,h])=>{l.includes(f.toLowerCase())&&s.set(f,h)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&wo(t.url))){const u=o&&i&&bo.read(i);u&&s.set(o,u)}return t},So=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=Cn(e);let i=o.data;const s=D.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:l}=o,f,h,m,y,d;function p(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function w(){if(!g)return;const E=D.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};mn(function(S){r(S),p()},function(S){n(S),p()},_),g=null}"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(w)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,e,g)),g=null)},g.onerror=function(R){const _=R&&R.message?R.message:"Network Error",b=new I(_,I.ERR_NETWORK,e,g);b.event=R||null,n(b),g=null},g.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||dn;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new I(R,_.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&c.forEach(s.toJSON(),function(R,_){g.setRequestHeader(_,R)}),c.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),a&&a!=="json"&&(g.responseType=o.responseType),l&&([m,d]=Be(l,!0),g.addEventListener("progress",m)),u&&g.upload&&([h,y]=Be(u),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(f=E=>{g&&(n(!E||E.type?new ae(null,e,g):E),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const N=go(o.url);if(N&&F.protocols.indexOf(N)===-1){n(new I("Unsupported protocol "+N+":",I.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Ro=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,a();const f=l instanceof Error?l:this.reason;n.abort(f instanceof I?f:new ae(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout ${t} of ms exceeded`,I.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>c.asap(a),u}},To=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},Ao=async function*(e,t){for await(const r of Bo(e))yield*To(r,t)},Bo=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Sn=(e,t,r,n)=>{const o=Ao(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){a(),u.close();return}let h=f.byteLength;if(r){let m=i+=h;r(m)}u.enqueue(new Uint8Array(f))}catch(l){throw a(l),l}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},Rn=64*1024,{isFunction:Pe}=c,Po=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Tn,TextEncoder:An}=c.global,Bn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},No=e=>{e=c.merge.call({skipUndefined:!0},Po,e);const{fetch:t,Request:r,Response:n}=e,o=t?Pe(t):typeof fetch=="function",i=Pe(r),s=Pe(n);if(!o)return!1;const a=o&&Pe(Tn),u=o&&(typeof An=="function"?(d=>p=>d.encode(p))(new An):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&a&&Bn(()=>{let d=!1;const p=new r(F.origin,{body:new Tn,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),f=s&&a&&Bn(()=>c.isReadableStream(new n("").body)),h={stream:f&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(p,g)=>{let w=p&&p[d];if(w)return w.call(p);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const m=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await u(d)).byteLength},y=async(d,p)=>{const g=c.toFiniteNumber(d.getContentLength());return g??m(p)};return async d=>{let{url:p,method:g,data:w,signal:N,cancelToken:E,timeout:R,onDownloadProgress:_,onUploadProgress:b,responseType:S,headers:A,withCredentials:C="same-origin",fetchOptions:L}=Cn(d),B=t||fetch;S=S?(S+"").toLowerCase():"text";let P=Ro([N,E&&E.toAbortSignal()],R),T=null;const O=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let z;try{if(b&&l&&g!=="get"&&g!=="head"&&(z=await y(A,w))!==0){let j=new r(p,{method:"POST",body:w,duplex:"half"}),K;if(c.isFormData(w)&&(K=j.headers.get("content-type"))&&A.setContentType(K),j.body){const[ne,ue]=yn(z,Be(wn(b)));w=Sn(j.body,Rn,ne,ue)}}c.isString(C)||(C=C?"include":"omit");const M=i&&"credentials"in r.prototype,Le={...L,signal:P,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:w,duplex:"half",credentials:M?C:void 0};T=i&&new r(p,Le);let $=await(i?B(T,L):B(p,Le));const Ie=f&&(S==="stream"||S==="response");if(f&&(_||Ie&&O)){const j={};["status","statusText","headers"].forEach(le=>{j[le]=$[le]});const K=c.toFiniteNumber($.headers.get("content-length")),[ne,ue]=_&&yn(K,Be(wn(_),!0))||[];$=new n(Sn($.body,Rn,ne,()=>{ue&&ue(),O&&O()}),j)}S=S||"text";let we=await h[c.findKey(h,S)||"text"]($,d);return!Ie&&O&&O(),await new Promise((j,K)=>{mn(j,K,{data:we,headers:D.from($.headers),status:$.status,statusText:$.statusText,config:d,request:T})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,T),{cause:M.cause||M}):I.from(M,M&&M.code,d,T)}}},Oo=new Map,Pn=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,l,f=Oo;for(;a--;)u=i[a],l=f.get(u),l===void 0&&f.set(u,l=a?new Map:No(t)),f=l;return l};Pn();const ft={http:Gr,xhr:So,fetch:{get:Pn}};c.forEach(ft,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Nn=e=>`- ${e}`,Lo=e=>c.isFunction(e)||e===null||e===!1;function Io(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let a;if(o=n,!Lo(n)&&(o=ft[(a=String(n)).toLowerCase()],o===void 0))throw new I(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(t))))break;i[a||"#"+s]=o}if(!o){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since :
179
+ `+s.map(Nn).join(`
180
+ `):" "+Nn(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const On={getAdapter:Io,adapters:ft};function dt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ae(null,e)}function Ln(e){return dt(e),e.headers=D.from(e.headers),e.data=ct.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),On.getAdapter(e.adapter||ge.adapter,e)(e).then(function(n){return dt(e),n.data=ct.call(e,e.transformResponse,n),n.headers=D.from(n.headers),n},function(n){return gn(n)||(dt(e),n&&n.response&&(n.response.data=ct.call(e,e.transformResponse,n.response),n.response.headers=D.from(n.response.headers))),Promise.reject(n)})}const In="1.13.1",Ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const _n={};Ne.transitional=function(t,r,n){function o(i,s){return"[Axios v"+In+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new I(o(s," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!_n[s]&&(_n[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}},Ne.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function _o(e,t,r){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new I("option "+i+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Oe={assertOptions:_o,validators:Ne},J=Oe.validators;let te=class{constructor(t){this.defaults=t||{},this.interceptors={request:new fn,response:new fn}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
181
+ `+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ee(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Oe.assertOptions(n,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:Oe.assertOptions(o,{encode:J.function,serialize:J.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Oe.assertOptions(r,{baseUrl:J.spelling("baseURL"),withXsrfToken:J.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=D.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Ln.bind(this),void 0];for(d.unshift(...a),d.push(...l),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Ln.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=l.length;h<m;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=ee(this.defaults,t);const r=bn(t.baseURL,t.url,t.allowAbsoluteUrls);return cn(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(r,n){return this.request(ee(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(ee(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}te.prototype[t]=r(),te.prototype[t+"Form"]=r(!0)});let vo=class Dn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new ae(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Dn(function(o){t=o}),cancel:t}}};function Uo(e){return function(r){return e.apply(null,r)}}function Fo(e){return c.isObject(e)&&e.isAxiosError===!0}const ht={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ht).forEach(([e,t])=>{ht[t]=e});function vn(e){const t=new te(e),r=Wt(te.prototype.request,t);return c.extend(r,te.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return vn(ee(e,o))},r}const v=vn(ge);v.Axios=te,v.CanceledError=ae,v.CancelToken=vo,v.isCancel=gn,v.VERSION=In,v.toFormData=Te,v.AxiosError=I,v.Cancel=v.CanceledError,v.all=function(t){return Promise.all(t)},v.spread=Uo,v.isAxiosError=Fo,v.mergeConfig=ee,v.AxiosHeaders=D,v.formToJSON=e=>hn(c.isHTMLForm(e)?new FormData(e):e),v.getAdapter=On.getAdapter,v.HttpStatusCode=ht,v.default=v;const{Axios:Wo,AxiosError:Qo,CanceledError:Go,isCancel:Yo,CancelToken:Xo,VERSION:Zo,all:ei,Cancel:ti,isAxiosError:ni,spread:ri,toFormData:oi,AxiosHeaders:ii,HttpStatusCode:si,formToJSON:ai,getAdapter:ui,mergeConfig:li}=v,ye=gt(),Un=v.create({baseURL:ye.baseUrl});async function Fn(e={}){return(await Un.post(ye.createEndpoint,e,{withCredentials:!0})).data}function Mn(e=()=>{},t=()=>{}){const r=new URL(ye.authEventEndpoint,ye.baseUrl),n=new EventSource(r,{withCredentials:!0});return n.addEventListener("auth-success",async o=>{try{await Un.post(ye.authConfirmEndpoint,null,{withCredentials:!0}),e()}catch(i){console.error(i),t(i)}finally{n.close()}}),n.onerror=o=>{console.error("EventSource failed:",o),n.close()},n}class Mo{constructor(){k(this,"overlay",null);k(this,"isOpen",!1);k(this,"authEvent",null);k(this,"contentContainer",null);k(this,"loader",null);k(this,"qrContainer",null);k(this,"separator",null);k(this,"loginButton",null);k(this,"errorContainer",null);k(this,"timerContainer",null);k(this,"timerInterval",null);k(this,"resolvePromise",null);k(this,"rejectPromise",null);k(this,"currentPromise",null);k(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{var n;r.target===this.overlay&&(this.close(),((n=this.errorContainer)==null?void 0:n.style.display)=="block"&&this.rejectPromise())}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await fr.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t).getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=this.chooseLink(t);this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=Mn(()=>{this.close(),this.resolvePromise()},n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}chooseLink(t){const r=t.links,n=r.find(i=>i.type=="WEB_APP");if(n)return n.link;const o=r.find(i=>i.type=="BOT");if(o)return o.link;if(r.length>0)return r[0].link;throw"Не удалось найти ссылку"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
182
182
  <p class="oauth-error-message">Ошибка: ${t.message||"Неизвестная ошибка"}</p>
183
183
  <button class="oauth-retry-button">Повторить</button>
184
184
  `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}renderExpiredState(){this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
185
185
  <p class="oauth-error-message">Срок действия ссылки истек.</p>
186
186
  <button class="oauth-retry-button">Обновить</button>
187
- `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}async show(t){return this.isOpen?this.currentPromise:(this.requestData=t,this.currentPromise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n}),this.overlay||this.createModal(),this.isOpen=!0,setTimeout(()=>{var r;return(r=this.overlay)==null?void 0:r.classList.add("active")},10),this.startAuthFlow(),this.currentPromise)}async startAuthFlow(){if(this.requestData){this.setLoadingState();try{const t=await Fn(this.requestData);this.renderSuccessState(t)}catch(t){this.renderErrorState(t)}}}close(){!this.isOpen||!this.overlay||(this.authEvent&&this.authEvent.close(),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null),this.overlay.classList.remove("active"),setTimeout(()=>{this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.isOpen=!1,this.requestData=null},400))}}ko();const Mo=ve();v.create({baseURL:Mo.baseUrl});const xn=new Fo;async function xo(e={}){return xn.show(e)}function Do(){xn.close()}function ko(){if(document.getElementById("oauth0-js-lib-styles"))return;const e=document.createElement("style");e.id="oauth0-js-lib-styles",e.innerHTML=fo,document.head.appendChild(e)}U.closeQrLogin=Do,U.createAuthEvent=Mn,U.createAuthSession=Fn,U.getConfig=ve,U.setConfig=jn,U.showQrLogin=xo,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
187
+ `,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}async show(t){return this.isOpen?this.currentPromise:(this.requestData=t,this.currentPromise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n}),this.overlay||this.createModal(),this.isOpen=!0,setTimeout(()=>{var r;return(r=this.overlay)==null?void 0:r.classList.add("active")},10),this.startAuthFlow(),this.currentPromise)}async startAuthFlow(){if(this.requestData){this.setLoadingState();try{const t=await Fn(this.requestData);this.renderSuccessState(t)}catch(t){this.renderErrorState(t)}}}close(){!this.isOpen||!this.overlay||(this.authEvent&&this.authEvent.close(),this.timerInterval&&(clearInterval(this.timerInterval),this.timerInterval=null),this.overlay.classList.remove("active"),setTimeout(()=>{this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.isOpen=!1,this.requestData=null},400))}}Do();const kn=new Mo;async function ko(e={}){return kn.show(e)}function xo(){kn.close()}function Do(){if(document.getElementById("oauth0-js-lib-styles"))return;const e=document.createElement("style");e.id="oauth0-js-lib-styles",e.innerHTML=zn,document.head.appendChild(e)}U.closeQrLogin=xo,U.createAuthEvent=Mn,U.createAuthSession=Fn,U.getConfig=gt,U.setConfig=jn,U.showQrLogin=ko,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
package/dist/modal.d.ts CHANGED
@@ -20,6 +20,7 @@ export declare class QRModal {
20
20
  private startTimer;
21
21
  private setLoadingState;
22
22
  private renderSuccessState;
23
+ private chooseLink;
23
24
  private renderErrorState;
24
25
  private renderExpiredState;
25
26
  private requestData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oauth0-js-lib",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.js",
6
6
  "module": "./dist/index.es.js",