@descope/react-sdk 2.0.9 → 2.0.11
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/cjs/index.cjs.js +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/examples/app/ManageAccessKeys.d.ts +3 -0
- package/dist/examples/app/ManageRoles.d.ts +3 -0
- package/dist/index.d.ts +43 -11
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -3
package/dist/index.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Descope={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);const o=r.default.createContext(void 0),i=e=>(...t)=>{if(!e)throw Error("You can only use this function after sdk initialization. Make sure to supply 'projectId' to <AuthProvider /> component");return e(...t)},d=e=>(...t)=>{let n;try{n=e(...t)}catch(e){console.error(e)}return n},s={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.0.9"},a="undefined"!=typeof window;var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)};function c(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function d(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(d,s)}a((r=r.apply(e,t||[])).next())}))}function h(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function f(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function p(e){this.message=e}"function"==typeof SuppressedError&&SuppressedError,p.prototype=new Error,p.prototype.name="InvalidCharacterError";var $="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new p("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,d="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?d+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return d};function g(e){this.message=e}function v(e,t){if("string"!=typeof e)throw new g("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent($(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return $(t)}}(e.split(".")[n]))}catch(e){throw new g("Invalid token specified: "+e.message)}}g.prototype=new Error,g.prototype.name="InvalidTokenError";var m="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b="__lodash_hash_undefined__",w="[object Function]",O="[object GeneratorFunction]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,C=/^\w*$/,I=/^\./,k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,x=/^\[object .+?Constructor\]$/,j="object"==typeof m&&m&&m.Object===Object&&m,N="object"==typeof self&&self&&self.Object===Object&&self,_=j||N||Function("return this")();var P,A=Array.prototype,R=Function.prototype,M=Object.prototype,T=_["__core-js_shared__"],U=(P=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"",D=R.toString,L=M.hasOwnProperty,F=M.toString,W=RegExp("^"+D.call(L).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=_.Symbol,q=A.splice,B=te(_,"Map"),H=te(Object,"create"),G=V?V.prototype:void 0,K=G?G.toString:void 0;function z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function J(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e,t){for(var n,r,o=e.length;o--;)if((n=e[o][0])===(r=t)||n!=n&&r!=r)return o;return-1}function X(e,t){var n;t=function(e,t){if(ie(e))return!1;var n=typeof e;if("number"==n||"symbol"==n||"boolean"==n||null==e||se(e))return!0;return C.test(e)||!E.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:ie(n=t)?n:ne(n);for(var r=0,o=t.length;null!=e&&r<o;)e=e[re(t[r++])];return r&&r==o?e:void 0}function Q(e){if(!de(e)||(t=e,U&&U in t))return!1;var t,n=function(e){var t=de(e)?F.call(e):"";return t==w||t==O}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?W:x;return n.test(function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ee(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function te(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Q(n)?n:void 0}z.prototype.clear=function(){this.__data__=H?H(null):{}},z.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},z.prototype.get=function(e){var t=this.__data__;if(H){var n=t[e];return n===b?void 0:n}return L.call(t,e)?t[e]:void 0},z.prototype.has=function(e){var t=this.__data__;return H?void 0!==t[e]:L.call(t,e)},z.prototype.set=function(e,t){return this.__data__[e]=H&&void 0===t?b:t,this},J.prototype.clear=function(){this.__data__=[]},J.prototype.delete=function(e){var t=this.__data__,n=Y(t,e);return!(n<0)&&(n==t.length-1?t.pop():q.call(t,n,1),!0)},J.prototype.get=function(e){var t=this.__data__,n=Y(t,e);return n<0?void 0:t[n][1]},J.prototype.has=function(e){return Y(this.__data__,e)>-1},J.prototype.set=function(e,t){var n=this.__data__,r=Y(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Z.prototype.clear=function(){this.__data__={hash:new z,map:new(B||J),string:new z}},Z.prototype.delete=function(e){return ee(this,e).delete(e)},Z.prototype.get=function(e){return ee(this,e).get(e)},Z.prototype.has=function(e){return ee(this,e).has(e)},Z.prototype.set=function(e,t){return ee(this,e).set(e,t),this};var ne=oe((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(se(e))return K?K.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return I.test(e)&&n.push(""),e.replace(k,(function(e,t,r,o){n.push(r?o.replace(S,"$1"):t||e)})),n}));function re(e){if("string"==typeof e||se(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function oe(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var d=e.apply(this,r);return n.cache=i.set(o,d),d};return n.cache=new(oe.Cache||Z),n}oe.Cache=Z;var ie=Array.isArray;function de(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function se(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==F.call(e)}var ae=function(e,t,n){var r=null==e?void 0:X(e,t);return void 0===r?n:r},le=y(ae),ce="/v1/auth/accesskey/exchange",ue="/v1/auth/otp/verify",he="/v1/auth/otp/signin",fe="/v1/auth/otp/signup",pe={email:"/v1/auth/otp/update/email",phone:"/v1/auth/otp/update/phone"},$e="/v1/auth/otp/signup-in",ge="/v1/auth/magiclink/verify",ve="/v1/auth/magiclink/signin",me="/v1/auth/magiclink/signup",ye={email:"/v1/auth/magiclink/update/email",phone:"/v1/auth/magiclink/update/phone"},be="/v1/auth/magiclink/signup-in",we="/v1/auth/enchantedlink/verify",Oe="/v1/auth/enchantedlink/signin",Ee="/v1/auth/enchantedlink/signup",Ce="/v1/auth/enchantedlink/pending-session",Ie={email:"/v1/auth/enchantedlink/update/email"},ke="/v1/auth/enchantedlink/signup-in",Se="/v1/auth/oauth/authorize",xe="/v1/auth/oauth/exchange",je="v1/auth/oauth/native/start",Ne="v1/auth/oauth/native/finish",_e="/v1/auth/saml/authorize",Pe="/v1/auth/saml/exchange",Ae="/v1/auth/totp/verify",Re="/v1/auth/totp/signup",Me="/v1/auth/totp/update",Te={start:"/v1/auth/webauthn/signup/start",finish:"/v1/auth/webauthn/signup/finish"},Ue={start:"/v1/auth/webauthn/signin/start",finish:"/v1/auth/webauthn/signin/finish"},De={start:"/v1/auth/webauthn/signup-in/start"},Le={start:"v1/auth/webauthn/update/start",finish:"/v1/auth/webauthn/update/finish"},Fe="/v1/auth/password/signup",We="/v1/auth/password/signin",Ve="/v1/auth/password/reset",qe="/v1/auth/password/update",Be="/v1/auth/password/replace",He="/v1/auth/password/policy",Ge="/v1/auth/refresh",Ke="/v1/auth/tenant/select",ze="/v1/auth/logout",Je="/v1/auth/logoutall",Ze="/v1/auth/me",Ye="/v1/auth/me/history",Xe="/v1/flow/start",Qe="/v1/flow/next";const et="<region>",tt=`https://api.${et}descope.com`,nt=6e5,rt=()=>{const e={};return{headers(t){const n="function"==typeof t.entries?Object.fromEntries(t.entries()):t;return e.Headers=JSON.stringify(n),this},body(t){return e.Body=t,this},url(t){return e.Url=t.toString(),this},method(t){return e.Method=t,this},title(t){return e.Title=t,this},status(t){return e.Status=t,this},build:()=>Object.keys(e).flatMap((t=>e[t]?[`${"Title"!==t?`${t}: `:""}${e[t]}`]:[])).join("\n")}};var ot;!function(e){e.get="GET",e.delete="DELETE",e.post="POST",e.put="PUT"}(ot||(ot={}));const it=(...e)=>new Headers(e.reduce(((e,t)=>{const n=(e=>Array.isArray(e)?e:e instanceof Headers?Array.from(e.entries()):e?Object.entries(e):[])(t);return n.reduce(((t,[n,r])=>(e[n]=r,e)),e),e}),{})),dt=e=>void 0===e?void 0:JSON.stringify(e),st=(e,t="")=>{let n=e;return t&&(n=n+":"+t),{Authorization:`Bearer ${n}`}},at=({baseUrl:e,projectId:t,baseConfig:n,logger:r,hooks:o,cookiePolicy:i,fetch:d})=>{const s=((e,t)=>{const n=(e=>async(...t)=>{const n=await e(...t),r=await n.text();return n.text=()=>Promise.resolve(r),n.json=()=>Promise.resolve(JSON.parse(r)),n.clone=()=>n,n})(t||fetch);return n||null==e||e.warn("Fetch is not defined, you will not be able to send http requests, if you are running in a test, make sure fetch is defined globally"),e?async(...t)=>{if(!n)throw Error("Cannot send http request, fetch is not defined, if you are running in a test, make sure fetch is defined globally");e.log((e=>rt().title("Request").url(e[0]).method(e[1].method).headers(e[1].headers).body(e[1].body).build())(t));const r=await n(...t);return e[r.ok?"log":"error"](await(async e=>{const t=await e.text();return rt().title("Response").url(e.url.toString()).status(`${e.status} ${e.statusText}`).headers(e.headers).body(t).build()})(r)),r}:n})(r,d),a=async r=>{const d=(null==o?void 0:o.beforeRequest)?o.beforeRequest(r):r,{path:a,body:l,headers:c,queryParams:u,method:h,token:f}=d,p={headers:it(st(t,f),{"x-descope-sdk-name":"core-js","x-descope-sdk-version":"2.11.3"},(null==n?void 0:n.baseHeaders)||{},c),method:h,body:dt(l)};null!==i&&(p.credentials=i||"include");const $=await s((({path:e,baseUrl:t,queryParams:n,projectId:r})=>{const o=r.slice(1,-27);t=t.replace(et,o?o+".":"");const i=new URL(e,t);return n&&(i.search=new URLSearchParams(n).toString()),i})({path:a,baseUrl:e,queryParams:u,projectId:t}),p);return(null==o?void 0:o.afterRequest)&&await o.afterRequest(r,null==$?void 0:$.clone()),$};return{get:(e,{headers:t,queryParams:n,token:r}={})=>a({path:e,headers:t,queryParams:n,body:void 0,method:ot.get,token:r}),post:(e,t,{headers:n,queryParams:r,token:o}={})=>a({path:e,headers:n,queryParams:r,body:t,method:ot.post,token:o}),put:(e,t,{headers:n,queryParams:r,token:o}={})=>a({path:e,headers:n,queryParams:r,body:t,method:ot.put,token:o}),delete:(e,{headers:t,queryParams:n,token:r}={})=>a({path:e,headers:t,queryParams:n,body:void 0,method:ot.delete,token:r}),hooks:o}};var lt=429;function ct(e,t,n){var r;let o=ut(e);t&&(o=null===(r=null==o?void 0:o.tenants)||void 0===r?void 0:r[t]);const i=null==o?void 0:o[n];return Array.isArray(i)?i:[]}function ut(e){if("string"!=typeof e||!e)throw new Error("Invalid token provided");return v(e)}function ht(e){const{exp:t}=ut(e);return(new Date).getTime()/1e3>t}function ft(e){let t=ut(e);const n=Object.keys(null==t?void 0:t.tenants);return Array.isArray(n)?n:[]}function pt(e,t){return ct(e,t,"permissions")}function $t(e,t){return ct(e,t,"roles")}const gt=(...e)=>e.join("/").replace(/\/{2,}/g,"/");async function vt(e,t){var n;const r=await e,o={code:r.status,ok:r.ok,response:r},i=await r.clone().json();return r.ok?o.data=t?t(i):i:(o.error=i,r.status===lt&&Object.assign(o.error,{retryAfter:Number.parseInt(null===(n=r.headers)||void 0===n?void 0:n.get("retry-after"))||0})),o}const mt=(e,t)=>(n=t)=>t=>!e(t)&&n.replace("{val}",t),yt=(...e)=>({validate:t=>(e.forEach((e=>{const n=e(t);if(n)throw new Error(n)})),!0)}),bt=e=>t=>e.test(t),wt=bt(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),Ot=bt(/^\+[1-9]{1}[0-9]{3,14}$/),Et=mt(wt,'"{val}" is not a valid email'),Ct=mt(Ot,'"{val}" is not a valid phone number'),It=mt((1,e=>e.length>=1),"Minimum length is 1");const kt=mt((e=>"string"==typeof e),"Input is not a string"),St=mt((e=>void 0===e),"Input is defined"),xt=(jt=[kt(),St()],"Input is not a string or undefined",(e="Input is not a string or undefined")=>t=>{const n=jt.filter((e=>e(t)));return!(n.length<jt.length)&&(e?e.replace("{val}",t):n.join(" OR "))});var jt;const Nt=(...e)=>t=>(...n)=>(e.forEach(((e,t)=>yt(...e).validate(n[t]))),t(...n)),_t=e=>[kt(`"${e}" must be a string`),It(`"${e}" must not be empty`)],Pt=e=>[kt(`"${e}" must be a string`),Et()],At=e=>[kt(`"${e}" must be a string`),Ct()],Rt=Nt(_t("accessKey")),Mt=e=>({exchange:Rt(((t,n)=>vt(e.post(ce,{loginOptions:n},{token:t}))))});var Tt,Ut;!function(e){e.sms="sms",e.whatsapp="whatsapp"}(Tt||(Tt={})),function(e){e.email="email"}(Ut||(Ut={}));const Dt=Object.assign(Object.assign({},Tt),Ut);var Lt;!function(e){e.waiting="waiting",e.running="running",e.completed="completed",e.failed="failed"}(Lt||(Lt={}));const Ft=_t("loginId"),Wt=Nt(_t("token")),Vt=Nt(Ft),qt=Nt(_t("pendingRef")),Bt=Nt(Ft,Pt("email")),Ht=e=>({verify:Wt((t=>vt(e.post(we,{token:t})))),signIn:Vt(((t,n,r,o)=>vt(e.post(gt(Oe,Dt.email),{loginId:t,URI:n,loginOptions:r},{token:o})))),signUpOrIn:Vt(((t,n,r)=>vt(e.post(gt(ke,Dt.email),{loginId:t,URI:n,loginOptions:r})))),signUp:Vt(((t,n,r,o)=>vt(e.post(gt(Ee,Dt.email),{loginId:t,URI:n,user:r,loginOptions:o})))),waitForSession:qt(((t,n)=>new Promise((r=>{const{pollingIntervalMs:o,timeoutMs:i}=(({pollingIntervalMs:e=1e3,timeoutMs:t=6e5}={})=>({pollingIntervalMs:Math.max(e||1e3,1e3),timeoutMs:Math.min(t||nt,nt)}))(n);let d;const s=setInterval((async()=>{const n=await e.post(Ce,{pendingRef:t});n.ok&&(clearInterval(s),d&&clearTimeout(d),r(vt(Promise.resolve(n))))}),o);d=setTimeout((()=>{r({error:{errorDescription:`Session polling timeout exceeded: ${i}ms`,errorCode:"0"},ok:!1}),clearInterval(s)}),i)})))),update:{email:Bt(((t,n,r,o,i)=>vt(e.post(Ie.email,Object.assign({loginId:t,email:n,URI:r},i),{token:o}))))}}),Gt=Nt(_t("flowId")),Kt=Nt(_t("executionId"),_t("stepId"),_t("interactionId")),zt=e=>({start:Gt(((t,n,r,o,i,d,s)=>vt(e.post(Xe,{flowId:t,options:n,conditionInteractionId:r,interactionId:o,version:i,componentsVersion:d,input:s})))),next:Kt(((t,n,r,o,i,d)=>vt(e.post(Qe,{executionId:t,stepId:n,interactionId:r,version:o,componentsVersion:i,input:d}))))}),Jt=_t("loginId"),Zt=Nt(_t("token")),Yt=Nt(Jt),Xt=Nt(Jt,At("phone")),Qt=Nt(Jt,Pt("email")),en=e=>({verify:Zt((t=>vt(e.post(ge,{token:t})))),signIn:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Yt(((t,r,o,i)=>vt(e.post(gt(ve,n),{loginId:t,URI:r,loginOptions:o},{token:i}))))})),{}),signUp:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Yt(((t,r,o,i)=>vt(e.post(gt(me,n),{loginId:t,URI:r,user:o,loginOptions:i}))))})),{}),signUpOrIn:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Yt(((t,r,o)=>vt(e.post(gt(be,n),{loginId:t,URI:r,loginOptions:o}))))})),{}),update:{email:Qt(((t,n,r,o,i)=>vt(e.post(ye.email,Object.assign({loginId:t,email:n,URI:r},i),{token:o})))),phone:Object.keys(Tt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Xt(((t,r,o,i,d)=>vt(e.post(gt(ye.phone,n),Object.assign({loginId:t,phone:r,URI:o},d),{token:i}))))})),{})}});var tn;!function(e){e.facebook="facebook",e.github="github",e.google="google",e.microsoft="microsoft",e.gitlab="gitlab",e.apple="apple",e.discord="discord",e.linkedin="linkedin",e.slack="slack"}(tn||(tn={}));const nn=Nt(_t("code")),rn=e=>({start:Object.assign(((t,n,r,o)=>vt(e.post(Se,r||{},{queryParams:Object.assign({provider:t},n&&{redirectURL:n}),token:o}))),Object.keys(tn).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:(t,r,o)=>vt(e.post(Se,r||{},{queryParams:Object.assign({provider:n},t&&{redirectURL:t}),token:o}))})),{})),exchange:nn((t=>vt(e.post(xe,{code:t})))),startNative:(t,n)=>vt(e.post(je,{provider:t,loginOptions:n})),finishNative:(t,n,r,o,i)=>vt(e.post(Ne,{provider:t,stateId:n,user:r,code:o,idToken:i}))}),on=_t("loginId"),dn=Nt(on,_t("code")),sn=Nt(on),an=Nt(on,At("phone")),ln=Nt(on,Pt("email")),cn=e=>({verify:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:dn(((t,r)=>vt(e.post(gt(ue,n),{code:r,loginId:t}))))})),{}),signIn:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:sn(((t,r,o)=>vt(e.post(gt(he,n),{loginId:t,loginOptions:r},{token:o}))))})),{}),signUp:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:sn(((t,r,o)=>vt(e.post(gt(fe,n),{loginId:t,user:r,loginOptions:o}))))})),{}),signUpOrIn:Object.keys(Dt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:sn(((t,r)=>vt(e.post(gt($e,n),{loginId:t,loginOptions:r}))))})),{}),update:{email:ln(((t,n,r,o)=>vt(e.post(pe.email,Object.assign({loginId:t,email:n},o),{token:r})))),phone:Object.keys(Tt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:an(((t,r,o,i)=>vt(e.post(gt(pe.phone,n),Object.assign({loginId:t,phone:r},i),{token:o}))))})),{})}}),un=Nt(_t("tenant")),hn=Nt(_t("code")),fn=e=>({start:un(((t,n,r,o)=>vt(e.post(_e,r||{},{queryParams:{tenant:t,redirectURL:n},token:o})))),exchange:hn((t=>vt(e.post(Pe,{code:t}))))}),pn=_t("loginId"),$n=Nt(pn,_t("code")),gn=Nt(pn),vn=Nt(pn),mn=e=>({signUp:gn(((t,n)=>vt(e.post(Re,{loginId:t,user:n})))),verify:$n(((t,n,r,o)=>vt(e.post(Ae,{loginId:t,code:n,loginOptions:r},{token:o})))),update:vn(((t,n)=>vt(e.post(Me,{loginId:t},{token:n}))))}),yn=_t("loginId"),bn=_t("newPassword"),wn=Nt(yn,_t("password")),On=Nt(yn),En=Nt(yn,bn),Cn=Nt(yn,_t("oldPassword"),bn),In=e=>({signUp:wn(((t,n,r)=>vt(e.post(Fe,{loginId:t,password:n,user:r})))),signIn:wn(((t,n)=>vt(e.post(We,{loginId:t,password:n})))),sendReset:On(((t,n,r)=>vt(e.post(Ve,{loginId:t,redirectUrl:n,templateOptions:r})))),update:En(((t,n,r)=>vt(e.post(qe,{loginId:t,newPassword:n},{token:r})))),replace:Cn(((t,n,r)=>vt(e.post(Be,{loginId:t,oldPassword:n,newPassword:r})))),policy:()=>vt(e.get(He))}),kn=[kt('"loginId" must be a string')],Sn=_t("loginId"),xn=_t("origin"),jn=Nt(Sn,xn,_t("name")),Nn=Nt(Sn,xn),_n=Nt(kn,xn),Pn=Nt(Sn,xn,_t("token")),An=Nt(_t("transactionId"),_t("response")),Rn=e=>({signUp:{start:jn(((t,n,r)=>vt(e.post(Te.start,{user:{loginId:t,name:r},origin:n})))),finish:An(((t,n)=>vt(e.post(Te.finish,{transactionId:t,response:n}))))},signIn:{start:_n(((t,n,r,o)=>vt(e.post(Ue.start,{loginId:t,origin:n,loginOptions:r},{token:o})))),finish:An(((t,n)=>vt(e.post(Ue.finish,{transactionId:t,response:n}))))},signUpOrIn:{start:Nn(((t,n)=>vt(e.post(De.start,{loginId:t,origin:n}))))},update:{start:Pn(((t,n,r)=>vt(e.post(Le.start,{loginId:t,origin:n},{token:r})))),finish:An(((t,n)=>vt(e.post(Le.finish,{transactionId:t,response:n}))))}}),Mn=Nt(_t("token")),Tn=Nt([xt('"token" must be string or undefined')]);var Un,Dn=Nt([("projectId",Un=_t("projectId"),mt(((e,t)=>n=>yt(...t).validate(le(n,e)))("projectId",Un))())])((e=>(({projectId:e,logger:t,baseUrl:n,hooks:r,cookiePolicy:o,baseHeaders:i={},fetch:d})=>{return s=at({baseUrl:n||tt,projectId:e,logger:t,hooks:r,cookiePolicy:o,baseConfig:{baseHeaders:i},fetch:d}),{accessKey:Mt(s),otp:cn(s),magicLink:en(s),enchantedLink:Ht(s),oauth:rn(s),saml:fn(s),totp:mn(s),webauthn:Rn(s),password:In(s),flow:zt(s),refresh:Tn((e=>vt(s.post(Ge,{},{token:e})))),selectTenant:Nt([kt("tenantId")],[xt('"token" must be string or undefined')])(((e,t)=>vt(s.post(Ke,{tenant:e},{token:t})))),logout:Tn((e=>vt(s.post(ze,{},{token:e})))),logoutAll:Tn((e=>vt(s.post(Je,{},{token:e})))),me:Tn((e=>vt(s.get(Ze,{token:e})))),history:Tn((e=>vt(s.get(Ye,{token:e})))),isJwtExpired:Mn(ht),getTenants:Mn(ft),getJwtPermissions:Mn(pt),getJwtRoles:Mn($t),httpClient:s};var s})(Object.assign(Object.assign({},e),{hooks:{beforeRequest:t=>{var n;const r=[].concat((null===(n=e.hooks)||void 0===n?void 0:n.beforeRequest)||[]);return null==r?void 0:r.reduce(((e,t)=>t(e)),t)},afterRequest:async(t,n)=>{var r;const o=[].concat((null===(r=e.hooks)||void 0===r?void 0:r.afterRequest)||[]);(await Promise.allSettled(null==o?void 0:o.map((e=>e(t,null==n?void 0:n.clone()))))).forEach((t=>{var n;return"rejected"===t.status&&(null===(n=e.logger)||void 0===n?void 0:n.error(t.reason))}))}}}))));const Ln=(e,t,n)=>(t.forEach((t=>{const r=t.split(".");let o=r.shift(),i=e;for(;r.length>0;){if(i=i[o],!o||!i)throw Error(`Invalid path "${t}", "${o}" is missing or has no value`);o=r.shift()}if("function"!=typeof i[o])throw Error(`"${t}" is not a function`);const d=i[o];i[o]=n(d)})),e);var Fn=Object.assign(Dn,{DeliveryMethods:Dt});var Wn={default:"endpoint"},Vn="Blocked by CSP",qn="9319";function Bn(e,t){var n=[];return function(e,t){var n,r,o=(r=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0),{current:function(){return r[0]},postpone:function(){var e=r.shift();void 0!==e&&r.push(e)},exclude:function(){r.shift()}}),i=(100,3e3,n=0,function(){return Math.random()*Math.min(3e3,100*Math.pow(2,n++))}),d=o.current();if(void 0===d)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var s=function(e,n){return t(e).catch((function(e){if(n+1>=5)throw e;!function(e){if(!(e instanceof Error))return!1;var t=e.message;return t===Vn||t===qn}(e)?o.postpone():o.exclude();var t,r=o.current();if(void 0===r)throw e;return(t=i(),new Promise((function(e){return setTimeout(e,t)}))).then((function(){return s(r,n+1)}))}))};return s(d,0)}(e,(function(e){var r=new Date,o=function(t){return n.push({url:e,startedAt:r,finishedAt:new Date,error:t})},i=t(e);return i.then((function(){return o()}),o),i})).then((function(e){return[e,{attempts:n}]}))}var Hn="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",Gn=Hn,Kn="Failed to load the JS script of the agent";function zn(e){var t;e.scriptUrlPattern;var n=e.token,r=e.apiKey,o=void 0===r?n:r,i=c(e,["scriptUrlPattern","token","apiKey"]),d=null!==(t=function(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)?e[t]:void 0}(e,"scriptUrlPattern"))&&void 0!==t?t:Hn;return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error("API key required");var e=function(e,t){return(Array.isArray(e)?e:[e]).map((function(e){return function(e,t){var n=encodeURIComponent;return e.replace(/<[^<>]+>/g,(function(e){return"<version>"===e?"3":"<apiKey>"===e?n(t):"<loaderVersion>"===e?n("3.8.5"):e}))}(String(e),t)}))}(d,o);return Bn(e,Jn).catch(Yn)})).then((function(e){var t=e[0],n=e[1];return t.load(l(l({},i),{ldi:n}))}))}function Jn(e){return function(e,t,n,r){var o,i=document,d="securitypolicyviolation",s=function(t){var n=new URL(e,location.href),r=t.blockedURI;r!==n.href&&r!==n.protocol.slice(0,-1)&&r!==n.origin||(o=t,a())};i.addEventListener(d,s);var a=function(){return i.removeEventListener(d,s)};return Promise.resolve().then(t).then((function(e){return a(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(a(),o)return function(){throw new Error(Vn)}();throw e}))}))}(e,(function(){return function(e){return new Promise((function(t,n){var r=document.createElement("script"),o=function(){var e;return null===(e=r.parentNode)||void 0===e?void 0:e.removeChild(r)},i=document.head||document.getElementsByTagName("head")[0];r.onload=function(){o(),t()},r.onerror=function(){o(),n(new Error(Kn))},r.async=!0,r.src=e,i.appendChild(r)}))}(e)})).then(Zn)}function Zn(){var e=window,t="__fpjs_p_l_b",n=e[t];if(function(e,t){var n,r=null===(n=Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,t);(null==r?void 0:r.configurable)?delete e[t]:r&&!r.writable||(e[t]=void 0)}(e,t),"function"!=typeof(null==n?void 0:n.load))throw new Error(qn);return n}function Yn(e){throw e instanceof Error&&e.message===qn?new Error(Kn):e}var Xn={exports:{}};
|
|
2
|
-
/*! js-cookie v3.0.5 | MIT */!function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function t(n,r){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=e({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var d="";for(var s in i)i[s]&&(d+="; "+s,!0!==i[s]&&(d+="="+i[s].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+d}}function i(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},o=0;o<t.length;o++){var i=t[o].split("="),d=i.slice(1).join("=");try{var s=decodeURIComponent(i[0]);if(r[s]=n.read(d,s),e===s)break}catch(e){}}return e?r[e]:r}}return Object.create({set:o,get:i,remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}return t({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()}(Xn);var Qn=y(Xn.exports);const er=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,r)=>{var o;return n[r]=[].concat((null===(o=e.hooks)||void 0===o?void 0:o[r])||[]).concat((null==t?void 0:t[r])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},tr=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json());return(null==t?void 0:t.authInfo)||t||{}},nr=async e=>{const t=await tr(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)},rr="undefined"!=typeof localStorage,or=(e,t)=>rr&&(null===localStorage||void 0===localStorage?void 0:localStorage.setItem(e,t)),ir=e=>rr&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e)),dr=e=>rr&&(null===localStorage||void 0===localStorage?void 0:localStorage.removeItem(e)),sr=(...e)=>{console.debug(...e)},ar="undefined"!=typeof window,lr=Math.pow(2,31)-1,cr=ar&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://api.descope.com",ur="fp",hr=(e=!1)=>{const t=localStorage.getItem(ur);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},fr=async(e,t=cr)=>{try{if(hr())return;const n=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),r=new URL(t);r.pathname="/fXj8gt3x8VulJBna/x96Emn69oZwcd7I6";const o=new URL(t);o.pathname="/fXj8gt3x8VulJBna/w78aRZnnDZ3Aqw0I";const i=o.toString()+"?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>",d=zn({apiKey:e,endpoint:[r.toString(),Wn],scriptUrlPattern:[i,Gn]}),s=await d,{requestId:a}=await s.get({linkedId:n}),l=((e,t)=>({vsid:e,vrid:t}))(n,a);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};localStorage.setItem(ur,JSON.stringify(t))})(l)}catch(e){console.warn("Could not load fingerprint",e)}},pr=e=>{const t=hr(!0);return t&&e.body&&(e.body.fpData=t),e},$r="dls_last_user_login_id",gr="dls_last_user_display_name",vr=()=>ir($r),mr=()=>ir(gr),yr=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,r={}]=t,o=vr(),i=mr();return o&&(null!==(n=r.lastAuth)&&void 0!==n||(r.lastAuth={}),r.lastAuth.loginId=o,r.lastAuth.name=i),await e(...t)},br=e=>async(...t)=>{const n=await e(...t);return dr($r),dr(gr),n};function wr(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const Or="DS",Er="DSR";function Cr(e=""){return ir(`${e}${Er}`)||""}function Ir(e=""){dr(`${e}${Er}`),dr(`${e}${Or}`),Qn.remove(Or)}async function kr(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=Pr(n.publicKey.challenge),n.publicKey.user.id=Pr(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=Pr(e.id)})),n}(e);return n=await navigator.credentials.create(t),JSON.stringify({id:n.id,rawId:Ar(n.rawId),type:n.type,response:{attestationObject:Ar(n.response.attestationObject),clientDataJSON:Ar(n.response.clientDataJSON)}});var n}async function Sr(e){const t=Nr(e);return _r(await navigator.credentials.get(t))}async function xr(e,t){const n=Nr(e);return n.signal=t.signal,n.mediation="conditional",_r(await navigator.credentials.get(n))}async function jr(e=!1){if(!ar)return Promise.resolve(!1);const t=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return t&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():t}function Nr(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=Pr(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=Pr(e.id)})),n}function _r(e){return JSON.stringify({id:e.id,rawId:Ar(e.rawId),type:e.type,response:{authenticatorData:Ar(e.response.authenticatorData),clientDataJSON:Ar(e.response.clientDataJSON),signature:Ar(e.response.signature),userHandle:e.response.userHandle?Ar(e.response.userHandle):void 0}})}function Pr(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function Ar(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var Rr,Mr=(Rr=e=>({async signUp(t,n){const r=await e.webauthn.signUp.start(t,window.location.origin,n);if(!r.ok)return r;const o=await kr(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,o)},async signIn(t){const n=await e.webauthn.signIn.start(t,window.location.origin);if(!n.ok)return n;const r=await Sr(n.data.options);return await e.webauthn.signIn.finish(n.data.transactionId,r)},async signUpOrIn(t){var n;const r=await e.webauthn.signUpOrIn.start(t,window.location.origin);if(!r.ok)return r;if(null===(n=r.data)||void 0===n?void 0:n.create){const t=await kr(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,t)}{const t=await Sr(r.data.options);return await e.webauthn.signIn.finish(r.data.transactionId,t)}},async update(t,n){const r=await e.webauthn.update.start(t,window.location.origin,n);if(!r.ok)return r;const o=await kr(r.data.options);return await e.webauthn.update.finish(r.data.transactionId,o)},helpers:{create:kr,get:Sr,isSupported:jr,conditional:xr}}),(...e)=>{const t=Rr(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});const Tr=e=>({async oneTap(t,n,r,o){const i=null!=t?t:"google",d=await e.oauth.startNative(i,r);if(!d.ok)return d;const{clientId:s,stateId:a,nonce:l}=d.data,c=await async function(){return new Promise(((e,t)=>{if(window.google)return void e(window.google.accounts.id);let n=document.getElementById("google-gsi-client-script");n||(n=document.createElement("script"),document.head.appendChild(n),n.async=!0,n.defer=!0,n.id="google-gsi-client-script",n.src="https://accounts.google.com/gsi/client"),n.onload=function(){window.google?e(window.google.accounts.id):t("Failed to load Google GSI client script - not loaded properly")},n.onerror=function(){t("Failed to load Google GSI client script - failed to load")}}))}();return new Promise((t=>{var r,d;c.initialize(Object.assign(Object.assign({},n),{itp_support:null===(r=null==n?void 0:n.itp_support)||void 0===r||r,use_fedcm_for_prompt:null===(d=null==n?void 0:n.use_fedcm_for_prompt)||void 0===d||d,client_id:s,callback:n=>{t(e.oauth.finishNative(i,a,"","",n.credential))},nonce:l})),c.prompt((e=>{(null==e?void 0:e.isSkippedMoment())&&(null==o||o())}))}))}});var Ur=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await jr(),r=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=r,e.flow.start(...t)}});const Dr=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((e=>t=>{var{fpKey:n,fpLoad:r}=t,o=c(t,["fpKey","fpLoad"]);return ar?(n&&r&&fr(n).catch((()=>null)),e(er(o,{beforeRequest:pr}))):(console.warn("Fingerprint is a client side only capability and will not work when running in the server"),e(o))}),(e=>t=>{var{autoRefresh:n}=t,r=c(t,["autoRefresh"]);if(!n)return e(r);const{clearAllTimers:o,setTimer:i}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let d,s;document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&new Date>d&&(sr("Expiration time passed, refreshing session"),a.refresh(s))}));const a=e(er(r,{afterRequest:async(e,t)=>{const{refreshJwt:n,sessionJwt:r}=await tr(t);if(401===(null==t?void 0:t.status))sr("Received 401, canceling all timers"),o();else if(r){d=(e=>{const t=e.split(".");try{if(3===t.length){const e=JSON.parse(window.atob(t[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(e){}return null})(r),s=n;let e=((l=d)?l.getTime()-(new Date).getTime():0)-2e4;e>lr&&(sr(`Timeout is too large (${e}ms), setting it to ${lr}ms`),e=lr),o();const t=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});sr(`Setting refresh timer for ${t}. (${e}ms)`),i((()=>{sr("Refreshing session due to timer"),a.refresh(n)}),e)}var l}}));return Ln(a,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return sr("Clearing all timers"),o(),n}))}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.10.5"},t.baseHeaders)}))),(e=>t=>{const n=wr(),r=wr(),o=e(er(t,{afterRequest:async(e,t)=>{if(401===(null==t?void 0:t.status))n.pub(null),r.pub(null);else{const e=await nr(t);e&&r.pub(e);const{sessionJwt:o}=await tr(t);o&&n.pub(o)}}})),i=Ln(o,["logout","logoutAll"],(e=>async(...t)=>{const o=await e(...t);return n.pub(null),r.pub(null),o}));return Object.assign(i,{onSessionTokenChange:n.sub,onUserChange:r.sub})}),(e=>t=>{const n=e(er(t,{afterRequest:async(e,t)=>{var n;const r=await nr(t),o=null===(n=null==r?void 0:r.loginIds)||void 0===n?void 0:n[0],i=null==r?void 0:r.name;o&&((e=>{or($r,e)})(o),(e=>{or(gr,e)})(i))}}));let r=Ln(n,["flow.start"],yr);return r=Ln(r,["logout","logoutAll"],br),Object.assign(r,{getLastUserLoginId:vr,getLastUserDisplayName:mr})}),(e=>t=>{var{persistTokens:n,sessionTokenViaCookie:r,storagePrefix:o}=t,i=c(t,["persistTokens","sessionTokenViaCookie","storagePrefix"]);if(!n||!ar)return n&&console.warn("Storing auth tokens in local storage and cookies are a client side only capabilities and will not be done when running in the server"),e(i);const d=e(er(i,{beforeRequest:(s=o,e=>Object.assign(e,{token:e.token||Cr(s)})),afterRequest:async(e,t)=>{401===(null==t?void 0:t.status)?Ir(o):((e={},t,n)=>{var{refreshJwt:r,sessionJwt:o}=e,i=c(e,["refreshJwt","sessionJwt"]);void 0===t&&(t=!1),void 0===n&&(n=""),r&&or(`${n}${Er}`,r),o&&(t?function(e,t,{cookiePath:n,cookieDomain:r,cookieExpiration:o}){if(t){const i=new Date(1e3*o),d=function(e){const t=window.location.hostname.split("."),n=e.split(".");return t.slice(-n.length).join(".")===e}(r);Qn.set(e,t,{path:n,domain:d?r:void 0,expires:i,sameSite:"Strict",secure:!0})}}(Or,o,i):or(`${n}${Or}`,o))})(await tr(t),r,o)}}));var s;const a=Ln(d,["logout","logoutAll"],(e=>t=>async(...n)=>{const r=await t(...n);return Ir(e),r})(o));return Object.assign(a,{getRefreshToken:()=>Cr(o),getSessionToken:()=>function(e=""){return Qn.get(Or)||ir(`${e}${Or}`)||""}(o)})}))(((...e)=>{const t=Fn(...e);return Object.assign(Object.assign({},t),{flow:Ur(t),webauthn:Mr(t),fedcm:Tr(t)})}));let Lr;const Fr=e=>{const t=Dr(Object.assign(Object.assign({},e),{persistTokens:a,autoRefresh:a}));return Lr=t,t};Lr=Fr({projectId:"temp pid"});const Wr=()=>a?null==Lr?void 0:Lr.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),Vr=()=>a?null==Lr?void 0:Lr.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),qr=d(((e=Wr(),t)=>null==Lr?void 0:Lr.getJwtPermissions(e,t))),Br=d(((e=Wr(),t)=>null==Lr?void 0:Lr.getJwtRoles(e,t)));const Hr=t.lazy((async()=>((await Promise.resolve().then((function(){return Ki}))).default.sdkConfigOverrides={baseHeaders:s,persistTokens:!1,hooks:{get beforeRequest(){return Lr.httpClient.hooks.beforeRequest},set beforeRequest(e){}}},{default:({projectId:e,flowId:t,baseUrl:n,innerRef:o,tenant:i,theme:d,locale:s,debug:a,redirectUrl:l,client:c,form:u,autoFocus:h})=>r.default.createElement("descope-wc",{"project-id":e,"flow-id":t,"base-url":n,ref:o,tenant:i,theme:d,locale:s,debug:a,client:c,form:u,"redirect-url":l,"auto-focus":h})}))),Gr=r.default.forwardRef((({flowId:e,onSuccess:n,onError:i,onReady:d,logger:s,tenant:a,theme:l,locale:c,debug:u,client:h,form:f,telemetryKey:p,redirectUrl:$,autoFocus:g,errorTransformer:v},m)=>{const[y,b]=t.useState(null);t.useImperativeHandle(m,(()=>y));const{projectId:w,baseUrl:O,sdk:E}=r.default.useContext(o),C=t.useCallback((async e=>{await E.httpClient.hooks.afterRequest({},new Response(JSON.stringify(e.detail))),n&&n(e)}),[n]);t.useEffect((()=>{const e=y;return null==e||e.addEventListener("success",C),i&&(null==e||e.addEventListener("error",i)),d&&(null==e||e.addEventListener("ready",d)),()=>{i&&(null==e||e.removeEventListener("error",i)),d&&(null==e||e.removeEventListener("ready",d)),null==e||e.removeEventListener("success",C)}}),[y,i,C]),t.useEffect((()=>{const e=y;return null==e||e.addEventListener("success",C),()=>{null==e||e.removeEventListener("success",C)}}),[y,C]),t.useEffect((()=>{const e=y;return i&&(null==e||e.addEventListener("error",i)),()=>{i&&(null==e||e.removeEventListener("error",i))}}),[y,i]),t.useEffect((()=>{const e=y;return d&&(null==e||e.addEventListener("ready",d)),()=>{d&&(null==e||e.removeEventListener("error",d))}}),[y,d]),t.useEffect((()=>{y&&(y.errorTransformer=v)}),[y,v]),t.useEffect((()=>{y&&s&&(y.logger=s)}),[y,s]);const{form:I,client:k}=t.useMemo((()=>({form:JSON.stringify(f||{}),client:JSON.stringify(h||{})})),[f,h]);return r.default.createElement("form",null,r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(Hr,{projectId:w,flowId:e,baseUrl:O,innerRef:b,tenant:a,theme:l,locale:c,debug:u,form:I,client:k,telemetryKey:p,redirectUrl:$,autoFocus:g})))})),Kr=t.lazy((async()=>(await Promise.resolve().then((function(){return _h})),{default:({projectId:e,baseUrl:t,innerRef:n,tenant:o,widgetId:i,theme:d,debug:s})=>r.default.createElement("descope-user-management-widget",{"project-id":e,"widget-id":i,"base-url":t,theme:d,tenant:o,debug:s,ref:n})}))),zr=r.default.forwardRef((({logger:e,tenant:n,theme:i,debug:d,widgetId:s},a)=>{const[l,c]=t.useState(null);t.useImperativeHandle(a,(()=>l));const{projectId:u,baseUrl:h}=r.default.useContext(o);return t.useEffect((()=>{l&&e&&(l.logger=e)}),[l,e]),r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(Kr,{projectId:u,widgetId:s,baseUrl:h,innerRef:c,tenant:n,theme:i,debug:d}))}));var Jr=()=>{const e=t.useContext(o);if(!e)throw Error("You can only use this hook in the context of <AuthProvider />");return e};const Zr=e=>`You can only use this ${e} after sdk initialization. Make sure to supply 'projectId' to <AuthProvider /> component`,Yr={get(e,t){if("object"==typeof e[t]&&null!==e[t])return new Proxy(e[t],Yr);if("function"==typeof e[t])return()=>{throw Error(Zr("function"))};throw Error(Zr("attribute"))}},Xr="undefined"!=typeof localStorage,Qr=Xr&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",eo="config.json",to="base.ui.components.url",no=Xr&&localStorage.getItem(to)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",ro=Xr&&localStorage.getItem(to)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",oo="descope-login-flow",io="code",so="ra-challenge",ao="ra-callback",lo="ra-backup-callback",co="ra-initiator",uo="data-exclude-field",ho="dls_last_auth",fo="state_id",po="saml_idp_state_id",$o="saml_idp_username",go="sso_app_id",vo="oidc_login_hint",mo="data-type",yo="poll",bo="webauthnCreate",wo="submit",Oo="polling",Eo=["descope-multi-select-combo-box"];var Co;function Io(e){return new URLSearchParams(window.location.search).get(e)}function ko(e){if(window.history.replaceState&&Io(e)){const t=new URL(window.location.href),n=new URLSearchParams(t.search);n.delete(e),t.search=n.toString(),window.history.replaceState({},"",t.toString())}}function So(e,t){return u(this,void 0,void 0,(function*(){const n=yield fetch(e,{cache:"default"});if(!n.ok)throw Error(`Error fetching URL ${e} [${n.status}]`);return{body:yield n[t||"text"](),headers:Object.fromEntries(n.headers.entries())}}))}function xo(e,t,n="v2-beta"){const r=new URL(Qr);return r.pathname=((...e)=>e.join("/").replace(/\/+/g,"/"))(r.pathname,e,n,t),r.toString()}function jo(e,t){if(!Number.isNaN(e)&&!Number.isNaN(t))return e>t?Co.forward:e<t?Co.backward:void 0}!function(e){e.backward="backward",e.forward="forward"}(Co||(Co={}));const No=()=>{const[e="",t=""]=(Io(oo)||"").split("_");return{executionId:e,stepId:t}};function _o(){ko(oo)}const Po=e=>e.replace(/-./g,(e=>e[1].toUpperCase())),Ao=e=>{let t,n;return(...r)=>{return t&&(i=r,(o=t).length===i.length&&o.every(((e,t)=>e===i[t])))||(t=r,n=e(...r)),n;var o,i}},Ro=(e,t,n,r,o,i)=>e&&!t&&e&&!n&&!r&&e&&!o&&e&&!i,Mo=e=>null==e?void 0:e.submit(),To=(e,t)=>{const n=t.find((t=>e[t]));return n?e[n]:null},Uo=(e,t=100)=>{let n;return function(...r){n||e.apply(this,r),clearTimeout(n),n=setTimeout((()=>{n=null}),t)}};var Do,Lo,Fo,Wo;function Vo(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r+=1){const o=n[r],i=e[o],d=t[o];if(null===i||null===d){if(i!==d)return!1}else if("object"==typeof i&&"object"==typeof d){if(!Vo(i,d))return!1}else if(i!==d)return!1}return!0}class qo{constructor(e={},{updateOnlyOnChange:t=!0}={}){Do.set(this,void 0),Lo.set(this,{}),Fo.set(this,0),Wo.set(this,!1),this.update=e=>{const t="function"==typeof e?e(h(this,Do,"f")):e,n=Object.assign(Object.assign({},h(this,Do,"f")),t);if(!h(this,Wo,"f")||!Vo(h(this,Do,"f"),n)){const e=h(this,Do,"f");f(this,Do,n,"f"),Object.freeze(h(this,Do,"f")),setTimeout((()=>{Object.values(h(this,Lo,"f")).forEach((t=>t(n,e,((e,t)=>n=>e[n]!==t[n])(n,e))))}),0)}},f(this,Do,e,"f"),f(this,Wo,t,"f")}get current(){return Object.assign({},h(this,Do,"f"))}subscribe(e){return f(this,Fo,h(this,Fo,"f")+1,"f"),h(this,Lo,"f")[h(this,Fo,"f")]=e,h(this,Fo,"f").toString()}unsubscribe(e){const t=!!h(this,Lo,"f")[e];return t&&delete h(this,Lo,"f")[e],t}unsubscribeAll(){return f(this,Lo,{},"f"),!0}}Do=new WeakMap,Lo=new WeakMap,Fo=new WeakMap,Wo=new WeakMap;const Bo=(e,t)=>{Object.entries(t||{}).forEach((([t,n])=>{Array.from(e.querySelectorAll(`*[name="${t}"]:not([${uo}])`)).forEach((e=>{e.value=n}))}))},Ho=(e,t)=>e.replace(/{{(.+?)}}/g,((e,n)=>{return r=t,n.split(".").reduce(((e,t)=>(null==e?void 0:e[t])||""),r);var r})),Go=Ao((()=>u(void 0,void 0,void 0,(function*(){var e,t,n,r;if(!window.PublicKeyCredential||!PublicKeyCredential.isConditionalMediationAvailable||!PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)return!1;try{const o=Promise.all([null===(e=window.PublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable(),null===(t=window.PublicKeyCredential)||void 0===t?void 0:t.isUserVerifyingPlatformAuthenticatorAvailable()]).then((e=>e.every((e=>!!e)))),i=(()=>{var e;const t=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.brands,n=null==t?void 0:t.find((({brand:e,version:t})=>"Chromium"===e&&parseFloat(t)));return n?n.version:0})()>=108;return yield(100,n=o,r=i,new Promise(((e,t)=>{let o=!1;const i=setTimeout((()=>{o=!0,void 0!==r?e(r):t(new Error("Promise timed out after 100 ms"))}),100);n.then((t=>{o||(clearTimeout(i),e(t))})).catch((e=>{o||(clearTimeout(i),t(e))}))})))}catch(e){return console.error("Conditional login check failed",e),!1}})))),Ko={"lastAuth.loginId":{"not-empty":e=>!!e.loginId,empty:e=>!e.loginId},idpInitiated:{"is-true":e=>!!e.code,"is-false":e=>!e.code},externalToken:{"is-true":e=>!!e.token,"is-false":e=>!e.token},abTestingKey:{"greater-than":(e,t)=>(e.abTestingKey||0)>t,"less-than":(e,t)=>(e.abTestingKey||0)<t}};function zo(e){const t={};if(e)try{Object.assign(t,JSON.parse(localStorage.getItem(ho)))}catch(e){}return t}const Jo="dls_ab_testing_id",Zo=document.createElement("template");var Yo,Xo,Qo,ei,ti,ni,ri,oi,ii,di,si,ai,li,ci,ui,hi,fi,pi,$i,gi,vi,mi,yi,bi,wi,Oi,Ei,Ci,Ii,ki,Si,xi,ji,Ni,_i,Pi,Ai,Ri,Mi,Ti,Ui,Di,Li,Fi,Wi,Vi,qi,Bi;Zo.innerHTML='\n\t<style>\n\t\t:host {\n all: initial;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\n\t\t#wc-root {\n\t\t\theight: 100%;\n\t\t\ttransition: opacity 300ms ease-in-out;\n\t\t}\n\n\t\t#wc-root[data-theme] {\n\t\t\tbackground-color: transparent;\n\t\t}\n\n\t\t.fade-out {\n\t\t\topacity: 0.1;\n\t\t}\n\n\t</style>\n\t<div id="wc-root"></div>\n\t';class Hi extends HTMLElement{static get observedAttributes(){return["project-id","flow-id","base-url","tenant","theme","locale","debug","storage-prefix","preview","redirect-url","auto-focus"]}constructor(e){super(),Yo.add(this),this.logger=console,Xo.set(this,!1),this.loggerWrapper={error:(e,t="")=>{this.logger.error(e,t,new Error),h(this,Yo,"m",Ei).call(this,e,t)},warn:(e,t="")=>{this.logger.warn(e,t)},info:(e,t="",n={})=>{this.logger.info(e,t,n)}},Qo.set(this,new qo({deferredRedirect:!1})),ei.set(this,new qo),ti.set(this,{}),this.getComponentsContext=()=>h(this,ti,"f"),this.nextRequestStatus=new qo({isLoading:!1}),ni.set(this,void 0),ri.set(this,{popstate:h(this,Yo,"m",li).bind(this),visibilitychange:h(this,Yo,"m",ci).bind(this),componentsContext:h(this,Yo,"m",yi).bind(this)}),oi.set(this,void 0),$i.set(this,Ao((()=>u(this,void 0,void 0,(function*(){const e=xo(this.projectId,eo);try{const{body:t,headers:n}=yield So(e,"json");return{projectConfig:t,executionContext:{geo:n["x-geo"]}}}catch(e){return{isMissingConfig:!0}}}))))),f(this,oi,e,"f"),h(this,Yo,"m",ii).call(this)}get projectId(){return this.getAttribute("project-id")}get flowId(){return this.getAttribute("flow-id")}get form(){try{const e=JSON.parse(this.getAttribute("form"))||{};return Object.entries(e).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[`form.${t}`]:n})),e)}catch(e){return{}}}get client(){try{return JSON.parse(this.getAttribute("client"))||{}}catch(e){return{}}}get baseUrl(){return this.getAttribute("base-url")||void 0}get tenant(){return this.getAttribute("tenant")||void 0}get redirectUrl(){return this.getAttribute("redirect-url")||void 0}get debug(){return"true"===this.getAttribute("debug")}get locale(){return this.getAttribute("locale")||void 0}get theme(){var e,t;const n=this.getAttribute("theme");return"os"===n?window.matchMedia&&(null===(t=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)"))||void 0===t?void 0:t.matches)?"dark":"light":n||"light"}get autoFocus(){var e;const t=null!==(e=this.getAttribute("auto-focus"))&&void 0!==e?e:"true";return"skipFirstScreen"===t?t:"true"===t}get storagePrefix(){return this.getAttribute("storage-prefix")||""}get preview(){return!!this.getAttribute("preview")}getExecutionContext(){return u(this,void 0,void 0,(function*(){const{executionContext:e}=yield h(this,$i,"f").call(this);return e}))}getProjectConfig(){return u(this,void 0,void 0,(function*(){const{projectConfig:e}=yield h(this,$i,"f").call(this);return e}))}getFlowConfig(){var e,t;return u(this,void 0,void 0,(function*(){const n=yield this.getProjectConfig(),r=(null===(e=null==n?void 0:n.flows)||void 0===e?void 0:e[this.flowId])||{};return null!==(t=r.version)&&void 0!==t||(r.version=0),r}))}getTargetLocales(){return u(this,void 0,void 0,(function*(){const e=yield this.getFlowConfig();return((null==e?void 0:e.targetLocales)||[]).map((e=>e.toLowerCase()))}))}connectedCallback(){return u(this,void 0,void 0,(function*(){if(this.shadowRoot.isConnected){if(h(this,ei,"f").subscribe(h(this,Yo,"m",Oi).bind(this)),h(this,ei,"f").update({isDebug:this.debug}),h(this,Yo,"m",di).call(this))return void h(this,Yo,"m",si).call(this);if(h(this,Yo,"m",ai).call(this),yield h(this,Yo,"m",fi).call(this))return void this.loggerWrapper.error("This SDK version does not support your flows version","Make sure to upgrade your flows to the latest version or use an older SDK version");if((yield h(this,$i,"f").call(this)).isMissingConfig)return void this.loggerWrapper.error("Cannot get config file","Make sure that your projectId & flowId are correct");yield h(this,Yo,"m",ki).call(this),yield h(this,Yo,"m",vi).call(this),h(this,Yo,"m",gi).call(this),h(this,Yo,"m",Ci).call(this);const{executionId:e,stepId:t,token:n,code:r,exchangeError:o,redirectAuthCallbackUrl:i,redirectAuthBackupCallbackUri:d,redirectAuthCodeChallenge:s,redirectAuthInitiator:a,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,ssoAppId:p,oidcLoginHint:$}=(()=>{const{executionId:e,stepId:t}=No();(e||t)&&_o();const n=Io("t")||void 0;n&&ko("t");const r=Io(io)||void 0;r&&ko(io);const o=Io("err")||void 0;o&&ko("err");const{redirectAuthCodeChallenge:i,redirectAuthCallbackUrl:d,redirectAuthBackupCallbackUri:s,redirectAuthInitiator:a}={redirectAuthCodeChallenge:Io(so),redirectAuthCallbackUrl:Io(ao),redirectAuthBackupCallbackUri:Io(lo),redirectAuthInitiator:Io(co)};(i||d||s||a)&&(ko(so),ko(ao),ko(lo),ko(co));const l=Io(fo);l&&ko(fo);const c=Io(po);c&&ko(po);const u=Io($o);c&&ko($o);const h=Io(go);h&&ko(go);const f=Io(vo);return f&&ko(vo),{executionId:e,stepId:t,token:n,code:r,exchangeError:o,redirectAuthCodeChallenge:i,redirectAuthCallbackUrl:d,redirectAuthBackupCallbackUri:s,redirectAuthInitiator:a,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,ssoAppId:h,oidcLoginHint:f}})();window.addEventListener("popstate",h(this,ri,"f").popstate),window.addEventListener("components-context",h(this,ri,"f").componentsContext),window.addEventListener("visibilitychange",h(this,ri,"f").visibilitychange),h(this,Qo,"f").subscribe(h(this,Yo,"m",hi).bind(this)),h(this,Qo,"f").update({projectId:this.projectId,flowId:this.flowId,baseUrl:this.baseUrl,tenant:this.tenant,redirectUrl:this.redirectUrl,locale:this.locale,stepId:t,executionId:e,token:n,code:r,exchangeError:o,redirectAuthCallbackUrl:i,redirectAuthBackupCallbackUri:d,redirectAuthCodeChallenge:s,redirectAuthInitiator:a,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,ssoAppId:p,oidcLoginHint:$}),f(this,Xo,!0,"f")}}))}disconnectedCallback(){h(this,Qo,"f").unsubscribeAll(),h(this,ei,"f").unsubscribeAll(),h(this,Yo,"m",wi).call(this),window.removeEventListener("popstate",h(this,ri,"f").popstate),window.removeEventListener("visibilitychange",h(this,ri,"f").visibilitychange),window.removeEventListener("components-context",h(this,ri,"f").componentsContext)}attributeChangedCallback(e,t,n){if(this.shadowRoot.isConnected&&h(this,Xo,"f")&&t!==n&&Hi.observedAttributes.includes(e)){h(this,Yo,"m",ai).call(this);const r=null===t;h(this,Qo,"f").update((({stepId:t,executionId:o})=>{let i=t,d=o;return r||(d=null,i=null,_o()),{[Po(e)]:n,stepId:i,executionId:d}})),h(this,ei,"f").update({isDebug:this.debug})}}}Xo=new WeakMap,Qo=new WeakMap,ei=new WeakMap,ti=new WeakMap,ni=new WeakMap,ri=new WeakMap,oi=new WeakMap,$i=new WeakMap,Yo=new WeakSet,ii=function(){this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Zo.content.cloneNode(!0)),this.rootElement=this.shadowRoot.querySelector("#wc-root")},di=function(){return!this.shadowRoot.host.closest("form")&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)},si=function(){const e=this.shadowRoot.host,t=document.createElement("form");e.parentElement.appendChild(t),t.appendChild(e)},ai=function(){const e=["base-url","tenant","theme","locale","debug","redirect-url","auto-focus","preview","storage-prefix","form","client"];if(Hi.observedAttributes.forEach((t=>{if(!e.includes(t)&&!this[Po(t)])throw Error(`${t} cannot be empty`)})),this.theme&&"light"!==this.theme&&"dark"!==this.theme)throw Error('Supported theme values are "light", "dark", or leave empty for using the OS theme')},li=function(){const{stepId:e,executionId:t}=No();h(this,Qo,"f").update({stepId:e,executionId:t})},ci=function(){document.hidden||setTimeout((()=>{h(this,Qo,"f").update({deferredRedirect:!1})}),300)},ui=function(e,t){this.sdk=Dr(Object.assign(Object.assign({persistTokens:!0,preview:this.preview,storagePrefix:this.storagePrefix},Hi.sdkConfigOverrides),{projectId:e,baseUrl:t})),["start","next"].forEach((e=>{const t=this.sdk.flow[e];this.sdk.flow[e]=(...e)=>u(this,void 0,void 0,(function*(){this.nextRequestStatus.update({isLoading:!0});try{return yield t(...e)}finally{this.nextRequestStatus.update({isLoading:!1})}}))}))},hi=function(e,t,n){return u(this,void 0,void 0,(function*(){const{projectId:t,baseUrl:r}=e;if(n("projectId")||n("baseUrl")){if(!t)return;h(this,Yo,"m",ui).call(this,t,r)}h(this,oi,"f").call(this,e)}))},fi=function(){return u(this,void 0,void 0,(function*(){return(yield h(this,$i,"f").call(this)).isMissingConfig&&(yield h(this,Yo,"m",pi).call(this))}))},pi=function(){return u(this,void 0,void 0,(function*(){const e=xo(this.projectId,eo,"v2-alpha");try{return yield So(e,"json"),!0}catch(e){return!1}}))},gi=function(){var e,t;return u(this,void 0,void 0,(function*(){const{projectConfig:n}=yield h(this,$i,"f").call(this),r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>(e=>{if(!e)return;const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url)))}))},vi=function(){return u(this,void 0,void 0,(function*(){yield h(this,Yo,"m",mi).call(this),yield h(this,Yo,"m",bi).call(this)}))},mi=function(){var e,t,n,r;return u(this,void 0,void 0,(function*(){const o=document.createElement("style"),i=xo(this.projectId,"theme.json");try{const{body:d}=yield So(i,"json");o.innerText=((null===(e=null==d?void 0:d.light)||void 0===e?void 0:e.globals)||"")+((null===(t=null==d?void 0:d.dark)||void 0===t?void 0:t.globals)||"");const s=yield Hi.descopeUI;(null==s?void 0:s.componentsThemeManager)&&(s.componentsThemeManager.themes={light:null===(n=null==d?void 0:d.light)||void 0===n?void 0:n.components,dark:null===(r=null==d?void 0:d.dark)||void 0===r?void 0:r.components})}catch(o){this.loggerWrapper.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}this.shadowRoot.appendChild(o)}))},yi=function(e){f(this,ti,Object.assign(Object.assign({},e.detail),h(this,ti,"f")),"f")},bi=function(){return u(this,void 0,void 0,(function*(){this.rootElement.setAttribute("data-theme",this.theme);const e=yield Hi.descopeUI;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)}))},wi=function(){var e;null===(e=h(this,ni,"f"))||void 0===e||e.remove(),f(this,ni,null,"f")},Oi=function({isDebug:e}){return u(this,void 0,void 0,(function*(){e?(f(this,ni,document.createElement("descope-debugger"),"f"),Object.assign(h(this,ni,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),yield Promise.resolve().then((function(){return Jh})),document.body.appendChild(h(this,ni,"f"))):h(this,Yo,"m",wi).call(this)}))},Ei=function(e,t){var n;e&&this.debug&&(null===(n=h(this,ni,"f"))||void 0===n||n.updateData({title:e,description:t}))},Ci=function(){this.rootElement.onkeydown=e=>{var t,n,r;const o=!!(null===(t=this.shadowRoot.activeElement)||void 0===t?void 0:t.getAttribute("href")),i=Eo.includes(null!==(r=null===(n=this.shadowRoot.activeElement)||void 0===n?void 0:n.localName)&&void 0!==r?r:"");if("Enter"!==e.key||o||i)return;e.preventDefault();const d=this.rootElement.querySelectorAll("descope-button");if(1===d.length&&"false"!==d[0].getAttribute("auto-submit"))return void d[0].click();const s=Array.from(d).filter((e=>"true"===e.getAttribute("auto-submit")));if(1===s.length)return void s[0].click();const a=Array.from(d).filter((e=>"button"===e.getAttribute("data-type")));if(1===a.length)"false"!==a[0].getAttribute("auto-submit")&&a[0].click();else if(0===a.length){const e=Array.from(d).filter((e=>"sso"===e.getAttribute("data-type")));1===e.length&&"false"!==e[0].getAttribute("auto-submit")&&e[0].click()}}},Ii=function(){var e,t;return u(this,void 0,void 0,(function*(){return(null===(t=null===(e=yield h(this,$i,"f").call(this))||void 0===e?void 0:e.projectConfig)||void 0===t?void 0:t.componentsVersion)||(this.logger.error("Did not get components version, using latest version"),"latest")}))},ki=function(){return u(this,void 0,void 0,(function*(){Hi.descopeUI?this.loggerWrapper.info("DescopeUI is already loading, probably multiple flows are running on the same page"):Hi.descopeUI=new Promise((e=>{if(globalThis.DescopeUI)return void e(globalThis.DescopeUI);const t=e=>{const t=document.createElement("script");return t.id="load-descope-ui",t.src=e,t},n=(e,t)=>e.replace("<version>",t),r=(t,n)=>{const r=()=>{this.loggerWrapper.error("Cannot load DescopeUI",`Make sure this URL is valid and return the correct script: "${t.src}"`),n()};t.addEventListener("load",(()=>{globalThis.DescopeUI||r(),e(globalThis.DescopeUI)})),t.addEventListener("error",r)};(()=>{u(this,void 0,void 0,(function*(){const o=yield h(this,Yo,"m",Ii).call(this),i=t(n(no,o));r(i,(()=>{i.remove(),this.loggerWrapper.info("Trying to load DescopeUI from a fallback URL");const d=t(n(ro,o));r(d,(()=>{e(void 0)})),document.body.append(d)})),document.body.append(i)}))})()}))}))},Hi.sdkConfigOverrides={baseHeaders:{"x-descope-sdk-name":"web-component","x-descope-sdk-version":"3.8.10"}};class Gi extends Hi{static set sdkConfigOverrides(e){Hi.sdkConfigOverrides=e}constructor(){const e=new qo;super(e.update.bind(e)),Si.add(this),this.stepState=new qo({},{updateOnlyOnChange:!1}),xi.set(this,void 0),ji.set(this,null),Ni.set(this,((e,t,n,r,o)=>{n===yo&&f(this,xi,setTimeout((()=>u(this,void 0,void 0,(function*(){var n;const i=yield this.sdk.flow.next(e,t,Oo,r,o,{});h(this,Pi,"f").call(this,i);const{action:d}=null!==(n=null==i?void 0:i.data)&&void 0!==n?n:{};h(this,Ni,"f").call(this,e,t,d,r,o)}))),2e3),"f")})),_i.set(this,(()=>{clearTimeout(h(this,xi,"f")),f(this,xi,null,"f")})),Pi.set(this,(e=>{var t,n,r,o,i,d,s,a,l;if(!(null==e?void 0:e.ok)){h(this,Si,"m",Bi).call(this,"error",null==e?void 0:e.error);const d=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.url,s=`${null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.status} - ${null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.statusText}`;return void this.loggerWrapper.error((null===(o=null==e?void 0:e.error)||void 0===o?void 0:o.errorDescription)||d,(null===(i=null==e?void 0:e.error)||void 0===i?void 0:i.errorMessage)||s)}const c=null===(a=null===(s=null===(d=e.data)||void 0===d?void 0:d.screen)||void 0===s?void 0:s.state)||void 0===a?void 0:a.errorText;(null===(l=e.data)||void 0===l?void 0:l.error)?this.loggerWrapper.error(`[${e.data.error.code}]: ${e.data.error.description}`,`${c?`${c} - `:""}${e.data.error.message}`):c&&this.loggerWrapper.error(c);const{status:u,authInfo:f,lastAuth:p}=e.data;if("completed"===u)return function(e){(null==e?void 0:e.authMethod)&&Xr&&localStorage.setItem(ho,JSON.stringify(e))}(p),void h(this,Si,"m",Bi).call(this,"success",f);const{executionId:$,stepId:g,stepName:v,action:m,screen:y,redirect:b,webauthn:w,error:O,samlIdpResponse:E}=e.data;m!==yo?(this.loggerWrapper.info(`Step "${v||`#${g}`}" is ${u}`,"",{screen:y,status:u,stepId:g,stepName:v,action:m,error:O}),this.flowState.update({stepId:g,executionId:$,action:m,redirectTo:null==b?void 0:b.url,screenId:null==y?void 0:y.id,screenState:null==y?void 0:y.state,webauthnTransactionId:null==w?void 0:w.transactionId,webauthnOptions:null==w?void 0:w.options,samlIdpResponseUrl:null==E?void 0:E.url,samlIdpResponseSamlResponse:null==E?void 0:E.samlResponse,samlIdpResponseRelayState:null==E?void 0:E.relayState})):this.flowState.update({action:m})})),Ai.set(this,Ao((()=>u(this,void 0,void 0,(function*(){var e;try{const t=yield this.sdk.webauthn.signIn.start("",window.location.origin);return t.ok||this.loggerWrapper.warn("Webauthn start failed",null===(e=null==t?void 0:t.error)||void 0===e?void 0:e.errorMessage),t.data}catch(e){this.loggerWrapper.warn("Webauthn start failed",e.message)}}))))),Fi.set(this,Uo(((e,t)=>u(this,void 0,void 0,(function*(){if("true"===e.getAttribute("formnovalidate")||h(this,Si,"m",Ti).call(this)){const r=null==e?void 0:e.getAttribute("id");h(this,Si,"m",Di).call(this,e);const o=yield h(this,Si,"m",Ui).call(this),i=(n=e,Array.from((null==n?void 0:n.attributes)||[]).reduce(((e,t)=>{var n;const r=null===(n=new RegExp("^data-descope-(\\S+)$").exec(t.name))||void 0===n?void 0:n[1];return r?Object.assign(e,{[r]:t.value}):e}),{})),d=this.getComponentsContext(),s=Object.assign(Object.assign(Object.assign(Object.assign({},d),i),o),{origin:window.location.origin}),a=yield this.getFlowConfig(),l=yield this.getProjectConfig(),c=yield t(r,a.version,l.componentsVersion,s);h(this,Pi,"f").call(this,c),h(this,Si,"m",Li).call(this,o)}var n}))))),this.flowState=e}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t,n;return u(this,void 0,void 0,(function*(){this.shadowRoot.isConnected&&(null===(t=this.flowState)||void 0===t||t.subscribe(this.onFlowChange.bind(this)),null===(n=this.stepState)||void 0===n||n.subscribe(this.onStepChange.bind(this))),yield e.connectedCallback.call(this)}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.flowState.unsubscribeAll(),this.stepState.unsubscribeAll(),null===(e=h(this,ji,"f"))||void 0===e||e.abort(),f(this,ji,null,"f")}getHtmlFilenameWithLocale(e,t){return u(this,void 0,void 0,(function*(){let n,r=navigator.language;r&&"zh-TW"!==r&&(r=r.split("-")[0]);const o=(e||r||"").toLowerCase();return(yield this.getTargetLocales()).includes(o)&&(n=`${t}-${o}.html`),n}))}getPageContent(e,t){return u(this,void 0,void 0,(function*(){if(t)try{const{body:e}=yield So(t,"text");return e}catch(n){this.loggerWrapper.error(`Failed to fetch flow page from ${t}. Fallback to url ${e}`,n)}try{const{body:t}=yield So(e,"text");return t}catch(e){this.loggerWrapper.error("Failed to fetch flow page",e.message)}return null}))}onFlowChange(e,t,n){var r,o;return u(this,void 0,void 0,(function*(){const{projectId:i,flowId:d,tenant:s,stepId:a,executionId:l,action:c,screenId:u,screenState:p,redirectTo:$,redirectUrl:g,token:v,code:m,exchangeError:y,webauthnTransactionId:b,webauthnOptions:w,redirectAuthCodeChallenge:O,redirectAuthCallbackUrl:E,redirectAuthBackupCallbackUri:C,redirectAuthInitiator:I,oidcIdpStateId:k,locale:S,samlIdpStateId:x,samlIdpUsername:j,samlIdpResponseUrl:N,samlIdpResponseSamlResponse:_,samlIdpResponseRelayState:P,ssoAppId:A,oidcLoginHint:R}=e;let M,T;const U=(()=>{const e=localStorage.getItem(Jo);if(!e){const e=Math.floor(100*Math.random()+1);return localStorage.setItem(Jo,e.toString()),e}return Number(e)})(),D=this.sdk.getLastUserLoginId(),L=yield this.getFlowConfig(),F=yield this.getProjectConfig(),W=E&&O?{callbackUrl:E,codeChallenge:O,backupCallbackUri:C}:void 0;if(!l&&(L.fingerprintEnabled&&L.fingerprintKey?yield fr(L.fingerprintKey,this.baseUrl):localStorage.removeItem(ur),L.conditions?({startScreenId:M,conditionInteractionId:T}=((e,t)=>{const n=null==t?void 0:t.find((({key:t,operator:n,predicate:r})=>{var o;if("ELSE"===t)return!0;const i=null===(o=Ko[t])||void 0===o?void 0:o[n];return!!(null==i?void 0:i(e,r))}));return n?{startScreenId:n.met.screenId,conditionInteractionId:n.met.interactionId}:{}})({loginId:D,code:m,token:v,abTestingKey:U},L.conditions)):L.condition?({startScreenId:M,conditionInteractionId:T}=((e,t)=>{var n;const r=null===(n=Ko[null==e?void 0:e.key])||void 0===n?void 0:n[e.operator];if(!r)return{};const o=r(t,e.predicate)?e.met:e.unmet;return{startScreenId:null==o?void 0:o.screenId,conditionInteractionId:null==o?void 0:o.interactionId}})(L.condition,{loginId:D,code:m,token:v,abTestingKey:U})):M=L.startScreenId,!Ro(M,k,x,j,A,R))){const e=yield this.sdk.flow.start(d,Object.assign(Object.assign({tenant:s,redirectAuth:W,oidcIdpStateId:k,samlIdpStateId:x,samlIdpUsername:j,ssoAppId:A,oidcLoginHint:R,client:this.client},g&&{redirectUrl:g}),{lastAuth:zo(D),abTestingKey:U}),T,"",L.version,F.componentsVersion,Object.assign(Object.assign(Object.assign(Object.assign({},this.form),m?{exchangeCode:m,idpInitiated:!0}:{}),v?{token:v}:{}),R?{externalId:R}:{}));return h(this,Pi,"f").call(this,e),void("completed"!==(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.status)&&this.flowState.update({code:void 0,token:void 0}))}if(l&&(n("token")&&v||n("code")&&m||n("exchangeError")&&y)){const e=yield this.sdk.flow.next(l,a,wo,L.version,F.componentsVersion,{token:v,exchangeCode:m,exchangeError:y});return h(this,Pi,"f").call(this,e),void this.flowState.update({token:void 0,code:void 0,exchangeError:void 0})}if("loadForm"===c&&["samlIdpResponseUrl","samlIdpResponseSamlResponse","samlIdpResponseRelayState"].some((e=>n(e)))){if(!N||!_)return void this.loggerWrapper.error("Did not get saml idp params data to load");((e,t,n,r)=>{const o=document.createElement("form");o.method="POST",o.action=e,o.innerHTML=`\n <input type="hidden" role="saml-response" name="SAMLResponse" value="${t}" />\n <input type="hidden" role="saml-relay-state" name="RelayState" value="${n}" />\n <input style="display: none;" id="SAMLSubmitButton" type="submit" value="Continue" />\n `,document.body.appendChild(o),r(o)})(N,_,P||"",Mo)}if("redirect"===c&&(n("redirectTo")||n("deferredRedirect")))return $?"android"===I&&document.hidden?void this.flowState.update({deferredRedirect:!0}):void window.location.assign($):void this.loggerWrapper.error("Did not get redirect url");if(c===bo||"webauthnGet"===c){if(!b||!w)return void this.loggerWrapper.error("Did not get webauthn transaction id or options");let e,t;null===(o=h(this,ji,"f"))||void 0===o||o.abort(),f(this,ji,null,"f");try{e=c===bo?yield this.sdk.webauthn.helpers.create(w):yield this.sdk.webauthn.helpers.get(w)}catch(i){"InvalidStateError"===i.name?this.loggerWrapper.warn("WebAuthn operation failed",i.message):"NotAllowedError"!==i.name&&this.loggerWrapper.error(i.message),t=i.name}const n=yield this.sdk.flow.next(l,a,wo,L.version,F.componentsVersion,{transactionId:b,response:e,failure:t});h(this,Pi,"f").call(this,n)}if(h(this,Ni,"f").call(this,l,a,c,L.version,F.componentsVersion),!u&&!M)return void this.loggerWrapper.warn("No screen was found to show");const V=M||u,q=yield this.getHtmlFilenameWithLocale(S,V),B={direction:jo(+a,+t.stepId),screenState:Object.assign(Object.assign({},p),{form:Object.assign(Object.assign({},this.form),null==p?void 0:p.form),lastAuth:{loginId:D,name:this.sdk.getLastUserDisplayName()||D}}),htmlUrl:xo(i,`${V}.html`),htmlLocaleUrl:q&&xo(i,q),samlIdpUsername:j,oidcLoginHint:R},H=zo(D);Ro(M,k,x,j,A,R)?B.next=(e,t,n,r)=>this.sdk.flow.start(d,Object.assign({tenant:s,redirectAuth:W,oidcIdpStateId:k,samlIdpStateId:x,samlIdpUsername:j,ssoAppId:A,oidcLoginHint:R,lastAuth:H,preview:this.preview,abTestingKey:U,client:this.client},g&&{redirectUrl:g}),T,e,t,n,Object.assign(Object.assign(Object.assign(Object.assign({},this.form),r),m&&{exchangeCode:m,idpInitiated:!0}),v&&{token:v})):(n("projectId")||n("baseUrl")||n("executionId")||n("stepId"))&&(B.next=(...e)=>this.sdk.flow.next(l,a,...e)),this.stepState.update(B)}))}loadDescopeUiComponents(e){return u(this,void 0,void 0,(function*(){const t=yield Hi.descopeUI;if(!t)return;const n=(e=>[...Array.from(e.querySelectorAll("*")).reduce(((e,t)=>t.tagName.startsWith("DESCOPE-")?e.add(t.tagName.toLocaleLowerCase()):e),new Set)])(e);yield Promise.all(n.map((e=>u(this,void 0,void 0,(function*(){if(!customElements.get(e))if(t[e])try{return yield t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`${e} is already registered`)}else this.loggerWrapper.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)})))))}))}onStepChange(e,t){var n,r;return u(this,void 0,void 0,(function*(){const{htmlUrl:o,htmlLocaleUrl:i,direction:d,next:s,screenState:a}=e,l=document.createElement("template");l.innerHTML=yield this.getPageContent(o,i);const c=l.content.cloneNode(!0),f=this.loadDescopeUiComponents(l.content);this.sdk.webauthn.helpers.isSupported()?yield h(this,Si,"m",Mi).call(this,c,s):c.querySelectorAll(`descope-button[${mo}="biometrics"]`).forEach((e=>e.setAttribute("disabled","true"))),!e.samlIdpUsername||(null===(n=a.form)||void 0===n?void 0:n.loginId)||(null===(r=a.form)||void 0===r?void 0:r.email)||(a.form||(a.form={}),a.form.loginId=e.samlIdpUsername,a.form.email=e.samlIdpUsername),((e,t,n,r,o)=>{var i;let d=null==t?void 0:t.errorText;try{d=(null==r?void 0:r({text:null==t?void 0:t.errorText,type:null==t?void 0:t.errorType}))||(null==t?void 0:t.errorText)}catch(e){o.error("Error transforming error message",e.message)}((e,t,n="")=>{e.querySelectorAll(`[${mo}="${t}"]`).forEach((e=>{e.textContent=n,e.classList[n?"remove":"add"]("hide")}))})(e,"error-message",d),((e,t)=>{e.querySelectorAll(`[${mo}="totp-link"]`).forEach((e=>{e.setAttribute("href",t)}))})(e,null===(i=null==t?void 0:t.totp)||void 0===i?void 0:i.provisionUrl),((e,t)=>{e.querySelectorAll("descope-text,descope-link").forEach((e=>{e.textContent=Ho(e.textContent,t)}))})(e,t),((e,t,n)=>{t&&Object.keys(t).forEach((r=>{e.querySelectorAll(`[name=${r}]`).forEach((e=>{const o=t[r];Object.keys(o).forEach((t=>{let r=o[t];if("string"!=typeof r)try{r=JSON.stringify(r)}catch(e){n.error(`Could not stringify value "${r}" for "${t}"`,e.message),r=""}e.setAttribute(t,r)}))}))}))})(e,n,o),((e,t)=>{e.querySelectorAll("[data-has-dynamic-attr-values]").forEach((e=>{Array.from(e.attributes).forEach((e=>{e.value=Ho(e.value,t)}))}))})(e,t)})(c,a,a.componentsConfig,this.errorTransformer,this.loggerWrapper);const{geo:p}=yield this.getExecutionContext();((e,t)=>{Array.from(e.querySelectorAll('descope-phone-field[default-code="autoDetect"]')).forEach((e=>{e.setAttribute("default-code",t)}))})(c,p);const $=()=>u(this,void 0,void 0,(function*(){var e;yield f,((e,t)=>{var n,r;const o=null===(n=customElements.get("descope-totp-image"))||void 0===n?void 0:n.cssVarList.url;t&&o&&(null===(r=null==e?void 0:e.style)||void 0===r||r.setProperty(o,`url(data:image/jpg;base64,${t})`))})(this.shadowRoot.querySelector("div"),null===(e=null==a?void 0:a.totp)||void 0===e?void 0:e.image),this.rootElement.replaceChildren(c),setTimeout((()=>((e,t)=>{Bo(e,null==t?void 0:t.inputs),Bo(e,null==t?void 0:t.form)})(this.rootElement,a)));const n=!t.htmlUrl;if(((e,t,n)=>{if(!0===t||"skipFirstScreen"===t&&!n){const t=e.querySelector("*[name]");setTimeout((()=>{null==t||t.focus()}))}})(this.rootElement,this.autoFocus,n),h(this,Si,"m",Vi).call(this,s),n&&h(this,Si,"m",Bi).call(this,"ready",{}),h(this,Si,"m",Bi).call(this,"page-updated",{}),this.rootElement.querySelector(`[${mo}="polling"]`)){const e=yield this.getFlowConfig(),t=yield this.getProjectConfig(),n=yield s(Oo,e.version,t.componentsVersion,{});h(this,Pi,"f").call(this,n)}}));d?h(this,Si,"m",qi).call(this,$,d):$()}))}}xi=new WeakMap,ji=new WeakMap,Ni=new WeakMap,_i=new WeakMap,Pi=new WeakMap,Ai=new WeakMap,Fi=new WeakMap,Si=new WeakSet,Ri=function(e){const t=e.getAttribute("name");if(!["email"].includes(t)){const n=`user-${t}`;e.setAttribute("name",n),e.addEventListener("input",(()=>{e.setAttribute("name",e.value?t:n)}))}},Mi=function(e,t){var n;return u(this,void 0,void 0,(function*(){null===(n=h(this,ji,"f"))||void 0===n||n.abort();const r=e.querySelector('*[autocomplete="webauthn"]');if(r&&(yield Go())){const{options:e,transactionId:n}=(yield h(this,Ai,"f").call(this))||{};if(e&&n){h(this,Si,"m",Ri).call(this,r),f(this,ji,new AbortController,"f");const o=yield this.getFlowConfig(),i=yield this.getProjectConfig();this.sdk.webauthn.helpers.conditional(e,h(this,ji,"f")).then((e=>u(this,void 0,void 0,(function*(){const d=yield t(r.id,o.version,i.componentsVersion,{transactionId:n,response:e});h(this,Pi,"f").call(this,d)})))).catch((e=>{"AbortError"!==e.name&&this.loggerWrapper.error("Conditional login failed",e.message)}))}}}))},Ti=function(){return Array.from(this.shadowRoot.querySelectorAll("*[name]")).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))},Ui=function(){return u(this,void 0,void 0,(function*(){const e=Array.from(this.shadowRoot.querySelectorAll(`*[name]:not([${uo}])`));return(yield Promise.all(e.map((e=>u(this,void 0,void 0,(function*(){return{name:e.getAttribute("name"),value:e.value}})))))).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.name]:t.value})),{})}))},Di=function(e){const t=this.nextRequestStatus.subscribe((({isLoading:n})=>{n?e.setAttribute("loading","true"):(this.nextRequestStatus.unsubscribe(t),e.removeAttribute("loading"))}))},Li=function(e={}){var t,n;const r=To(e,["externalId","email","phone"]),o=To(e,["newPassword","password"]);if(r&&o)try{const e=new globalThis.PasswordCredential({id:r,password:o});null===(n=null===(t=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===t?void 0:t.store)||void 0===n||n.call(t,e)}catch(e){this.loggerWrapper.error("Could not store credentials",e.message)}},Wi=function(e){this.rootElement.querySelectorAll('descope-passcode[data-auto-submit="true"]').forEach((t=>{t.addEventListener("input",(()=>{var n;(null===(n=t.checkValidity)||void 0===n?void 0:n.call(t))&&h(this,Fi,"f").call(this,t,e)}))}))},Vi=function(e){this.rootElement.querySelectorAll("descope-button:not([data-exclude-next])").forEach((t=>{t.onclick=()=>{h(this,Fi,"f").call(this,t,e)}})),h(this,Si,"m",Wi).call(this,e)},qi=function(e,t){this.rootElement.addEventListener("transitionend",(()=>{this.rootElement.classList.remove("fade-out"),e()}),{once:!0});const n=t===Co.forward?"slide-forward":"slide-backward";Array.from(this.rootElement.getElementsByClassName("input-container")).forEach(((e,t)=>{e.style["transition-delay"]=40*t+"ms",e.classList.add(n)})),this.rootElement.classList.add("fade-out")},Bi=function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))},customElements.define("descope-wc",Gi);var Ki=Object.freeze({__proto__:null,default:Gi}),zi=e=>{let t=!1;try{const n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",{stack:e})}},Ji=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:i,inputSelectorResultsCopy:d}=e,s=r((()=>({})),...o);if(!(s.apply(null,i)===s.apply(null,d))){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",{arguments:n,firstInputs:i,secondInputs:d,stack:e})}},Zi={inputStabilityCheck:"once",identityFunctionCheck:"once"};var Yi=e=>Array.isArray(e)?e:[e];function Xi(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Qi(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var ed=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Zi,...t};return{identityFunctionCheck:{shouldRun:"always"===n||"once"===n&&e,run:zi},inputStabilityCheck:{shouldRun:"always"===r||"once"===r&&e,run:Ji}}},td="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function nd(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function d(){let t=n;const{length:d}=arguments;for(let e=0,n=d;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}}const s=t;let a;if(1===t.s?a=t.v:(a=e.apply(null,arguments),i++),s.s=1,r){const e=o?.deref()??o;null!=e&&r(e,a)&&(a=e,0!==i&&i--);o="object"==typeof a&&null!==a||"function"==typeof a?new td(a):a}return s.v=a,a}return d.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},d.resetResultsCount()},d.resultsCount=()=>i,d.resetResultsCount=()=>{i=0},d}function rd(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e;return(...e)=>{let t,r=0,o=0,i={},d=e.pop();"object"==typeof d&&(i=d,d=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const s={...n,...i},{memoize:a,memoizeOptions:l=[],argsMemoize:c=nd,argsMemoizeOptions:u=[],devModeChecks:h={}}=s,f=Yi(l),p=Yi(u),$=Xi(e),g=a((function(){return r++,d.apply(null,arguments)}),...f);let v=!0;const m=c((function(){o++;const e=Qi($,arguments);if("production"!==process.env.NODE_ENV){const{identityFunctionCheck:t,inputStabilityCheck:n}=ed(v,h);if(t.shouldRun&&t.run(d),n.shouldRun){const t=Qi($,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:a,memoizeOptions:f},arguments)}v&&(v=!1)}return t=g.apply(null,e),t}),...p);return Object.assign(m,{resultFunc:d,memoizedResultFunc:g,dependencies:$,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:a,argsMemoize:c})}}var od=rd(nd);function id(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var dd=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),sd=()=>Math.random().toString(36).substring(7).split("").join("."),ad={INIT:`@@redux/INIT${sd()}`,REPLACE:`@@redux/REPLACE${sd()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sd()}`};function ld(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function cd(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ud(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=cd(e)),t}function hd(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?id(2):`Expected the root reducer to be a function. Instead, received: '${ud(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?id(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?id(1):`Expected the enhancer to be a function. Instead, received: '${ud(n)}'`);return n(hd)(e,t)}let r=e,o=t,i=new Map,d=i,s=0,a=!1;function l(){d===i&&(d=new Map,i.forEach(((e,t)=>{d.set(t,e)})))}function c(){if(a)throw new Error("production"===process.env.NODE_ENV?id(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?id(4):`Expected the listener to be a function. Instead, received: '${ud(e)}'`);if(a)throw new Error("production"===process.env.NODE_ENV?id(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;l();const n=s++;return d.set(n,e),function(){if(t){if(a)throw new Error("production"===process.env.NODE_ENV?id(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,l(),d.delete(n),i=null}}}function h(e){if(!ld(e))throw new Error("production"===process.env.NODE_ENV?id(7):`Actions must be plain objects. Instead, the actual type was: '${ud(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?id(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?id(17):`Action "type" property must be a string. Instead, the actual type was: '${ud(e.type)}'. Value was: '${e.type}' (stringified)`);if(a)throw new Error("production"===process.env.NODE_ENV?id(9):"Reducers may not dispatch actions.");try{a=!0,o=r(o,e)}finally{a=!1}return(i=d).forEach((e=>{e()})),e}function f(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?id(10):`Expected the nextReducer to be a function. Instead, received: '${ud(e)}`);r=e,h({type:ad.REPLACE})}function p(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?id(11):`Expected the observer to be an object. Instead, received: '${ud(t)}'`);function n(){const e=t;e.next&&e.next(c())}n();return{unsubscribe:e(n)}},[dd](){return this}}}h({type:ad.INIT});const $={dispatch:h,subscribe:u,getState:c,replaceReducer:f,[dd]:p};return $}function fd(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function pd(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&fd(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:ad.INIT}))throw new Error("production"===process.env.NODE_ENV?id(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:ad.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?id(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${ad.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)}))}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===ad.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!ld(e))return`The ${i} has unexpected type of "${ud(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const d=Object.keys(e).filter((e=>!t.hasOwnProperty(e)&&!r[e]));return d.forEach((e=>{r[e]=!0})),n&&n.type===ad.REPLACE?void 0:d.length>0?`Unexpected ${d.length>1?"keys":"key"} "${d.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&fd(r)}let d=!1;const s={};for(let o=0;o<r.length;o++){const i=r[o],a=n[i],l=e[i],c=a(l,t);if(void 0===c){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?id(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}s[i]=c,d=d||c!==l}return d=d||r.length!==Object.keys(e).length,d?s:e}}function $d(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function gd(e){return ld(e)&&"type"in e&&"string"==typeof e.type}var vd=Symbol.for("immer-nothing"),md=Symbol.for("immer-draftable"),yd=Symbol.for("immer-state"),bd="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function wd(e,...t){if("production"!==process.env.NODE_ENV){const n=bd[e],r="function"==typeof n?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Od=Object.getPrototypeOf;function Ed(e){return!!e&&!!e[yd]}function Cd(e){return!!e&&(kd(e)||Array.isArray(e)||!!e[md]||!!e.constructor?.[md]||_d(e)||Pd(e))}var Id=Object.prototype.constructor.toString();function kd(e){if(!e||"object"!=typeof e)return!1;const t=Od(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Id}function Sd(e,t){0===xd(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function xd(e){const t=e[yd];return t?t.type_:Array.isArray(e)?1:_d(e)?2:Pd(e)?3:0}function jd(e,t){return 2===xd(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Nd(e,t,n){const r=xd(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function _d(e){return e instanceof Map}function Pd(e){return e instanceof Set}function Ad(e){return e.copy_||e.base_}function Rd(e,t){if(_d(e))return new Map(e);if(Pd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&kd(e)){if(!Od(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[yd];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Od(e),n)}function Md(e,t=!1){return Ud(e)||Ed(e)||!Cd(e)||(xd(e)>1&&(e.set=e.add=e.clear=e.delete=Td),Object.freeze(e),t&&Sd(e,((e,t)=>Md(t,!0)))),e}function Td(){wd(2)}function Ud(e){return Object.isFrozen(e)}var Dd,Ld={};function Fd(e){const t=Ld[e];return t||wd(0,e),t}function Wd(){return Dd}function Vd(e,t){t&&(Fd("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function qd(e){Bd(e),e.drafts_.forEach(Gd),e.drafts_=null}function Bd(e){e===Dd&&(Dd=e.parent_)}function Hd(e){return Dd={drafts_:[],parent_:Dd,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Gd(e){const t=e[yd];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Kd(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[yd].modified_&&(qd(t),wd(4)),Cd(e)&&(e=zd(t,e),t.parent_||Zd(t,e)),t.patches_&&Fd("Patches").generateReplacementPatches_(n[yd].base_,e,t.patches_,t.inversePatches_)):e=zd(t,n,[]),qd(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vd?e:void 0}function zd(e,t,n){if(Ud(t))return t;const r=t[yd];if(!r)return Sd(t,((o,i)=>Jd(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Zd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Sd(o,((o,d)=>Jd(e,r,t,o,d,n,i))),Zd(e,t,!1),n&&e.patches_&&Fd("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Jd(e,t,n,r,o,i,d){if("production"!==process.env.NODE_ENV&&o===n&&wd(5),Ed(o)){const d=zd(e,o,i&&t&&3!==t.type_&&!jd(t.assigned_,r)?i.concat(r):void 0);if(Nd(n,r,d),!Ed(d))return;e.canAutoFreeze_=!1}else d&&n.add(o);if(Cd(o)&&!Ud(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;zd(e,o),t&&t.scope_.parent_||Zd(e,o)}}function Zd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Md(t,n)}var Yd={get(e,t){if(t===yd)return e;const n=Ad(e);if(!jd(n,t))return function(e,t,n){const r=es(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!Cd(r)?r:r===Qd(e.base_,t)?(ns(e),e.copy_[t]=rs(r,e)):r},has:(e,t)=>t in Ad(e),ownKeys:e=>Reflect.ownKeys(Ad(e)),set(e,t,n){const r=es(Ad(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Qd(Ad(e),t),o=r?.[yd];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||jd(e.base_,t)))return!0;ns(e),ts(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Qd(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ns(e),ts(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Ad(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){wd(11)},getPrototypeOf:e=>Od(e.base_),setPrototypeOf(){wd(12)}},Xd={};function Qd(e,t){const n=e[yd];return(n?Ad(n):e)[t]}function es(e,t){if(!(t in e))return;let n=Od(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Od(n)}}function ts(e){e.modified_||(e.modified_=!0,e.parent_&&ts(e.parent_))}function ns(e){e.copy_||(e.copy_=Rd(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Sd(Yd,((e,t)=>{Xd[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Xd.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&wd(13),Xd.set.call(this,e,t,void 0)},Xd.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&wd(14),Yd.set.call(this,e[0],t,n,e[0])};function rs(e,t){const n=_d(e)?Fd("MapSet").proxyMap_(e,t):Pd(e)?Fd("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Wd(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Yd;n&&(o=[r],i=Xd);const{revoke:d,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=d,s}(e,t);return(t?t.scope_:Wd()).drafts_.push(n),n}function os(e){return Ed(e)||wd(10,e),is(e)}function is(e){if(!Cd(e)||Ud(e))return e;const t=e[yd];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Rd(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Rd(e,!0);return Sd(n,((e,t)=>{Nd(n,e,is(t))})),t&&(t.finalized_=!1),n}var ds=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&wd(6),void 0!==n&&"function"!=typeof n&&wd(7),Cd(e)){const o=Hd(this),i=rs(e,void 0);let d=!0;try{r=t(i),d=!1}finally{d?qd(o):Bd(o)}return Vd(o,n),Kd(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===vd&&(r=void 0),this.autoFreeze_&&Md(r,!0),n){const t=[],o=[];Fd("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}wd(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;const o=this.produce(e,t,((e,t)=>{n=e,r=t}));return[o,n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Cd(e)||wd(8),Ed(e)&&(e=os(e));const t=Hd(this),n=rs(e,void 0);return n[yd].isManual_=!0,Bd(t),n}finishDraft(e,t){const n=e&&e[yd];n&&n.isManual_||wd(9);const{scope_:r}=n;return Vd(r,t),Kd(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Fd("Patches").applyPatches_;return Ed(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},ss=ds.produce;function as(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}ds.produceWithPatches.bind(ds),ds.setAutoFreeze.bind(ds),ds.setUseStrictShallowCopy.bind(ds),ds.applyPatches.bind(ds),ds.createDraft.bind(ds),ds.finishDraft.bind(ds);var ls=as(),cs=as;((...e)=>{const t=rd(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(Ed(e)?os(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(nd);var us="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?$d:$d.apply(null,arguments)},hs=e=>e&&"function"==typeof e.match;function fs(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("production"===process.env.NODE_ENV?Xs(0):"prepareAction did not return an object");return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>gd(t)&&t.type===e,n}function ps(e){return"function"==typeof e&&"type"in e&&hs(e)}function $s(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var gs=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function vs(e){return Cd(e)?ss(e,(()=>{})):e}function ms(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error("production"===process.env.NODE_ENV?Xs(10):"No insert provided for key not already in map");const r=n.insert(t,e);return e.set(t,r),r}function ys(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function bs(e,t,n){const r=ws(e,t,n);return{detectMutations:()=>Os(e,t,r,n)}}function ws(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const d=r?r+"."+o:o;t.length&&-1!==t.indexOf(d)||(i.children[o]=ws(e,t,n[o],d))}}return i}function Os(e,t=[],n,r,o=!1,i=""){const d=n?n.value:void 0,s=d===r;if(o&&!s&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(d)||e(r))return{wasMutated:!1};const a={};for(let e in n.children)a[e]=!0;for(let e in r)a[e]=!0;const l=t.length>0;for(let o in a){const d=i?i+"."+o:o;if(l){if(t.some((e=>e instanceof RegExp?e.test(d):d===e)))continue}const a=Os(e,t,n.children[o],r[o],s,d);if(a.wasMutated)return a}return{wasMutated:!1}}function Es(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||ld(e)}function Cs(e,t="",n=Es,r,o=[],i){let d;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const s=null!=r?r(e):Object.entries(e),a=o.length>0;for(const[e,l]of s){const s=t?t+"."+e:e;if(a){if(o.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}if(!n(l))return{keyPath:s,value:l};if("object"==typeof l&&(d=Cs(l,s,n,r,o,i),d))return d}return i&&Is(e)&&i.add(e),!1}function Is(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!Is(t))return!1;return!0}function ks(e){return"boolean"==typeof e}var Ss=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new gs;if(t&&(ks(t)?i.push(ls):i.push(cs(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ks(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var d=n.indexOf(this);~d?n.splice(d+1):n.push(this),~d?r.splice(d,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=ys,ignoredPaths:o,warnAfter:i=32}=e;const d=bs.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=d(r);return s=>a=>{const l=$s(i,"ImmutableStateInvariantMiddleware");l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=d(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Xs(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const c=s(a);return l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=d(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Xs(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(a)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),l.warnIfExceeded(),c}}}}(e))}if(r){let e={};ks(r)||(e=r),i.push(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=Es,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:d=32,ignoreState:s=!1,ignoreActions:a=!1,disableCache:l=!1}=e,c=!l&&WeakSet?new WeakSet:void 0;return e=>l=>u=>{if(!gd(u))return l(u);const h=l(u),f=$s(d,"SerializableStateInvariantMiddleware");return a||r.length&&-1!==r.indexOf(u.type)||f.measureTime((()=>{const e=Cs(u,"",t,n,o,c);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",u,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),s||(f.measureTime((()=>{const r=Cs(e.getState(),"",t,n,i,c);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${u.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),h}}}(e))}if(o){let e={};ks(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=ps}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},xs=e=>t=>{setTimeout(t,e)},js="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:xs(10),Ns=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new gs(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,d=!1;const s=new Set,a="tick"===e.type?queueMicrotask:"raf"===e.type?js:"callback"===e.type?e.queueNotification:xs(e.timeout),l=()=>{d=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(d||(d=!0,a(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},_s="production"===process.env.NODE_ENV;function Ps(e){const t=Ss(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:d}=e||{};let s,a;if("function"==typeof n)s=n;else{if(!ld(n))throw new Error("production"===process.env.NODE_ENV?Xs(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");s=pd(n)}if(!_s&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?Xs(2):"`middleware` field must be a callback");if("function"==typeof r){if(a=r(t),!_s&&!Array.isArray(a))throw new Error("production"===process.env.NODE_ENV?Xs(3):"when using a middleware builder function, an array of middleware must be returned")}else a=t();if(!_s&&a.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Xs(4):"each middleware provided to configureStore must be a function");let l=$d;o&&(l=us({trace:!_s,..."object"==typeof o&&o}));const c=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?id(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const d={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(d)));return i=$d(...s)(o.dispatch),{...o,dispatch:i}}}(...a),u=Ns(c);if(!_s&&d&&"function"!=typeof d)throw new Error("production"===process.env.NODE_ENV?Xs(5):"`enhancers` field must be a callback");let h="function"==typeof d?d(u):u();if(!_s&&!Array.isArray(h))throw new Error("production"===process.env.NODE_ENV?Xs(6):"`enhancers` callback must return an array");if(!_s&&h.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Xs(7):"each enhancer provided to configureStore must be a function");_s||!a.length||h.includes(c)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");return hd(s,i,l(...h))}function As(e){const t={},n=[];let r;const o={addCase(e,i){if("production"!==process.env.NODE_ENV){if(n.length>0)throw new Error("production"===process.env.NODE_ENV?Xs(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error("production"===process.env.NODE_ENV?Xs(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const d="string"==typeof e?e:e.type;if(!d)throw new Error("production"===process.env.NODE_ENV?Xs(28):"`builder.addCase` cannot be called with an empty action type");if(d in t)throw new Error("production"===process.env.NODE_ENV?Xs(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${d}'`);return t[d]=i,o},addMatcher(e,t){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?Xs(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?Xs(31):"`builder.addDefaultCase` can only be called once");return r=e,o}};return e(o),[t,n,r]}var Rs=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function Ms(...e){return t=>e.some((e=>((e,t)=>hs(e)?e.match(t):e(t))(e,t)))}var Ts=["name","message","stack","code"],Us=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ds=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ls=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of Ts)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},Fs=(()=>{function e(e,t,n){const r=fs(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=fs(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=fs(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||Ls)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(d,s,a)=>{const l=n?.idGenerator?n.idGenerator(e):Rs(),c=new AbortController;let u,h;function f(e){h=e,c.abort()}const p=async function(){let p;try{let i=n?.condition?.(e,{getState:s,extra:a});if(null!==($=i)&&"object"==typeof $&&"function"==typeof $.then&&(i=await i),!1===i||c.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const g=new Promise(((e,t)=>{u=()=>{t({name:"AbortError",message:h||"Aborted"})},c.signal.addEventListener("abort",u)}));d(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:a}))),p=await Promise.race([g,Promise.resolve(t(e,{dispatch:d,getState:s,extra:a,requestId:l,signal:c.signal,abort:f,rejectWithValue:(e,t)=>new Us(e,t),fulfillWithValue:(e,t)=>new Ds(e,t)})).then((t=>{if(t instanceof Us)throw t;return t instanceof Ds?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){p=t instanceof Us?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{u&&c.signal.removeEventListener("abort",u)}var $;return n&&!n.dispatchConditionRejection&&i.match(p)&&p.meta.condition||d(p),p}();return Object.assign(p,{abort:f,requestId:l,arg:e,unwrap:()=>p.then(Ws)})}}),{pending:o,rejected:i,fulfilled:r,settled:Ms(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Ws(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Vs=Symbol.for("rtk-slice-createasyncthunk");function qs(e,t){return`${e}/${t}`}function Bs(e,t,n,r){function o(o,...i){let d=t(o);if(void 0===d)if(r)d=n();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?Xs(16):"selectState returned undefined for an uninjected slice reducer");return e(d,...i)}return o.unwrapped=e,o}var Hs=function({creators:e}={}){const t=e?.asyncThunk?.[Vs];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error("production"===process.env.NODE_ENV?Xs(11):"`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&void 0===e.initialState&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error("production"===process.env.NODE_ENV?Xs(12):"`context.addCase` cannot be called with an empty action type");if(n in d.sliceCaseReducersByType)throw new Error("production"===process.env.NODE_ENV?Xs(13):"`context.addCase` cannot be called with two reducers for the same action type: "+n);return d.sliceCaseReducersByType[n]=t,s},addMatcher:(e,t)=>(d.sliceMatchers.push({matcher:e,reducer:t}),s),exposeAction:(e,t)=>(d.actionCreators[e]=t,s),exposeCaseReducer:(e,t)=>(d.sliceCaseReducersByName[e]=t,s)};function a(){if("production"!==process.env.NODE_ENV&&"object"==typeof e.extraReducers)throw new Error("production"===process.env.NODE_ENV?Xs(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[t={},n=[],r]="function"==typeof e.extraReducers?As(e.extraReducers):[e.extraReducers],o={...t,...d.sliceCaseReducersByType};return function(e,t){if("production"!==process.env.NODE_ENV&&"object"==typeof t)throw new Error("production"===process.env.NODE_ENV?Xs(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let n,[r,o,i]=As(t);if(function(e){return"function"==typeof e}(e))n=()=>vs(e());else{const t=vs(e);n=()=>t}function d(e=n(),t){let d=[r[t.type],...o.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===d.filter((e=>!!e)).length&&(d=[i]),d.reduce(((e,n)=>{if(n){if(Ed(e)){const r=n(e,t);return void 0===r?e:r}if(Cd(e))return ss(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error("production"===process.env.NODE_ENV?Xs(9):"A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return d.getInitialState=n,d}(e.initialState,(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of d.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}))}i.forEach((r=>{const i=o[r],d={reducerName:r,type:qs(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,d;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error("production"===process.env.NODE_ENV?Xs(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=r.reducer,d=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,d?fs(e,d):fs(e))}(d,i,s):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error("production"===process.env.NODE_ENV?Xs(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:d,pending:s,rejected:a,settled:l,options:c}=n,u=o(e,i,c);r.exposeAction(t,u),d&&r.addCase(u.fulfilled,d);s&&r.addCase(u.pending,s);a&&r.addCase(u.rejected,a);l&&r.addMatcher(u.settled,l);r.exposeCaseReducer(t,{fulfilled:d||Gs,pending:s||Gs,rejected:a||Gs,settled:l||Gs})}(d,i,s,t)}));const l=e=>e,c=new Map;let u;function h(e,t){return u||(u=a()),u(e,t)}function f(){return u||(u=a()),u.getInitialState()}function p(t,n=!1){function r(e){let r=e[t];if(void 0===r)if(n)r=f();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?Xs(15):"selectSlice returned undefined for an uninjected slice reducer");return r}function o(t=l){const r=ms(c,n,{insert:()=>new WeakMap});return ms(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=Bs(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const $={name:n,reducer:h,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:f,...p(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:h},n),{...$,...p(o,!0)}}};return $}}();function Gs(){}var Ks="listenerMiddleware",zs=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=fs(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("production"===process.env.NODE_ENV?Xs(21):"Creating or removing a listener requires one of the known fields for matching an action");return((e,t)=>{if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Xs(32):`${t} is not a function`)})(i,"options.listener"),{predicate:o,type:t,effect:i}},Js=Object.assign((e=>{const{type:t,predicate:n,effect:r}=zs(e);return{id:Rs(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("production"===process.env.NODE_ENV?Xs(22):"Unsubscribe not initialized")}}}),{withTypes:()=>Js}),Zs=Object.assign(fs(`${Ks}/add`),{withTypes:()=>Zs});fs(`${Ks}/removeAll`);var Ys=Object.assign(fs(`${Ks}/remove`),{withTypes:()=>Ys});function Xs(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Qs=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,r)=>{var o;return n[r]=[].concat((null===(o=e.hooks)||void 0===o?void 0:o[r])||[]).concat((null==t?void 0:t[r])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},ea=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json());return(null==t?void 0:t.authInfo)||t||{}},ta=async e=>{const t=await ea(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)},na="undefined"!=typeof localStorage,ra=(e,t)=>na&&(null===localStorage||void 0===localStorage?void 0:localStorage.setItem(e,t)),oa=e=>na&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e)),ia=e=>na&&(null===localStorage||void 0===localStorage?void 0:localStorage.removeItem(e)),da=(...e)=>{console.debug(...e)},sa="undefined"!=typeof window,aa=Math.pow(2,31)-1,la=sa&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://fp.descope.com",ca=(e=!1)=>{const t=localStorage.getItem("fp");if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},ua=e=>{const t=ca(!0);return t&&e.body&&(e.body.fpData=t),e},ha="dls_last_user_login_id",fa="dls_last_user_display_name",pa=()=>oa(ha),$a=()=>oa(fa),ga=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,r={}]=t,o=pa(),i=$a();return o&&(null!==(n=r.lastAuth)&&void 0!==n||(r.lastAuth={}),r.lastAuth.loginId=o,r.lastAuth.name=i),await e(...t)},va=e=>async(...t)=>{const n=await e(...t);return ia(ha),ia(fa),n};function ma(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const ya="DS",ba="DSR";function wa(e=""){return oa(`${e}${ba}`)||""}function Oa(e=""){ia(`${e}${ba}`),ia(`${e}${ya}`),Qn.remove(ya)}async function Ea(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=ja(n.publicKey.challenge),n.publicKey.user.id=ja(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=ja(e.id)})),n}(e);return n=await navigator.credentials.create(t),JSON.stringify({id:n.id,rawId:Na(n.rawId),type:n.type,response:{attestationObject:Na(n.response.attestationObject),clientDataJSON:Na(n.response.clientDataJSON)}});var n}async function Ca(e){const t=Sa(e);return xa(await navigator.credentials.get(t))}async function Ia(e,t){const n=Sa(e);return n.signal=t.signal,n.mediation="conditional",xa(await navigator.credentials.get(n))}async function ka(e=!1){if(!sa)return Promise.resolve(!1);const t=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return t&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():t}function Sa(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=ja(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=ja(e.id)})),n}function xa(e){return JSON.stringify({id:e.id,rawId:Na(e.rawId),type:e.type,response:{authenticatorData:Na(e.response.authenticatorData),clientDataJSON:Na(e.response.clientDataJSON),signature:Na(e.response.signature),userHandle:e.response.userHandle?Na(e.response.userHandle):void 0}})}function ja(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function Na(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var _a,Pa=(_a=e=>({async signUp(t,n){const r=await e.webauthn.signUp.start(t,window.location.origin,n);if(!r.ok)return r;const o=await Ea(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,o)},async signIn(t){const n=await e.webauthn.signIn.start(t,window.location.origin);if(!n.ok)return n;const r=await Ca(n.data.options);return await e.webauthn.signIn.finish(n.data.transactionId,r)},async signUpOrIn(t){var n;const r=await e.webauthn.signUpOrIn.start(t,window.location.origin);if(!r.ok)return r;if(null===(n=r.data)||void 0===n?void 0:n.create){const t=await Ea(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,t)}{const t=await Ca(r.data.options);return await e.webauthn.signIn.finish(r.data.transactionId,t)}},async update(t,n){const r=await e.webauthn.update.start(t,window.location.origin,n);if(!r.ok)return r;const o=await Ea(r.data.options);return await e.webauthn.update.finish(r.data.transactionId,o)},helpers:{create:Ea,get:Ca,isSupported:ka,conditional:Ia}}),(...e)=>{const t=_a(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});const Aa=e=>({async oneTap(t,n,r,o){const i=null!=t?t:"google",d=await e.oauth.startNative(i,r);if(!d.ok)return d;const{clientId:s,stateId:a,nonce:l}=d.data,c=await async function(){return new Promise(((e,t)=>{if(window.google)return void e(window.google.accounts.id);let n=document.getElementById("google-gsi-client-script");n||(n=document.createElement("script"),document.head.appendChild(n),n.async=!0,n.defer=!0,n.id="google-gsi-client-script",n.src="https://accounts.google.com/gsi/client"),n.onload=function(){window.google?e(window.google.accounts.id):t("Failed to load Google GSI client script - not loaded properly")},n.onerror=function(){t("Failed to load Google GSI client script - failed to load")}}))}();return new Promise((t=>{var r,d;c.initialize(Object.assign(Object.assign({},n),{itp_support:null===(r=null==n?void 0:n.itp_support)||void 0===r||r,use_fedcm_for_prompt:null===(d=null==n?void 0:n.use_fedcm_for_prompt)||void 0===d||d,client_id:s,callback:n=>{t(e.oauth.finishNative(i,a,"","",n.credential))},nonce:l})),c.prompt((e=>{(null==e?void 0:e.isSkippedMoment())&&(null==o||o())}))}))}});var Ra=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await ka(),r=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=r,e.flow.start(...t)}});const Ma=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((e=>t=>{var{fpKey:n,fpLoad:r}=t,o=c(t,["fpKey","fpLoad"]);return sa?(n&&r&&(async e=>{try{if(ca())return;const t=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),n=zn({apiKey:e,endpoint:la}),r=await n,{requestId:o}=await r.get({linkedId:t}),i=((e,t)=>({vsid:e,vrid:t}))(t,o);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};localStorage.setItem("fp",JSON.stringify(t))})(i)}catch(e){global.FB_DEBUG&&console.error(e)}})(n).catch((()=>null)),e(Qs(o,{beforeRequest:ua}))):(console.warn("Fingerprint is a client side only capability and will not work when running in the server"),e(o))}),(e=>t=>{var{autoRefresh:n}=t,r=c(t,["autoRefresh"]);if(!n)return e(r);const{clearAllTimers:o,setTimer:i}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let d,s;document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&new Date>d&&(da("Expiration time passed, refreshing session"),a.refresh(s))}));const a=e(Qs(r,{afterRequest:async(e,t)=>{const{refreshJwt:n,sessionJwt:r}=await ea(t);if(401===(null==t?void 0:t.status))da("Received 401, canceling all timers"),o();else if(r){d=(e=>{const t=e.split(".");try{if(3===t.length){const e=JSON.parse(window.atob(t[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(e){}return null})(r),s=n;let e=((l=d)?l.getTime()-(new Date).getTime():0)-2e4;e>aa&&(da(`Timeout is too large (${e}ms), setting it to ${aa}ms`),e=aa),o();const t=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});da(`Setting refresh timer for ${t}. (${e}ms)`),i((()=>{da("Refreshing session due to timer"),a.refresh(n)}),e)}var l}}));return Ln(a,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return da("Clearing all timers"),o(),n}))}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.10.4"},t.baseHeaders)}))),(e=>t=>{const n=ma(),r=ma(),o=e(Qs(t,{afterRequest:async(e,t)=>{if(401===(null==t?void 0:t.status))n.pub(null),r.pub(null);else{const e=await ta(t);e&&r.pub(e);const{sessionJwt:o}=await ea(t);o&&n.pub(o)}}})),i=Ln(o,["logout","logoutAll"],(e=>async(...t)=>{const o=await e(...t);return n.pub(null),r.pub(null),o}));return Object.assign(i,{onSessionTokenChange:n.sub,onUserChange:r.sub})}),(e=>t=>{const n=e(Qs(t,{afterRequest:async(e,t)=>{var n;const r=await ta(t),o=null===(n=null==r?void 0:r.loginIds)||void 0===n?void 0:n[0],i=null==r?void 0:r.name;o&&((e=>{ra(ha,e)})(o),(e=>{ra(fa,e)})(i))}}));let r=Ln(n,["flow.start"],ga);return r=Ln(r,["logout","logoutAll"],va),Object.assign(r,{getLastUserLoginId:pa,getLastUserDisplayName:$a})}),(e=>t=>{var{persistTokens:n,sessionTokenViaCookie:r,storagePrefix:o}=t,i=c(t,["persistTokens","sessionTokenViaCookie","storagePrefix"]);if(!n||!sa)return n&&console.warn("Storing auth tokens in local storage and cookies are a client side only capabilities and will not be done when running in the server"),e(i);const d=e(Qs(i,{beforeRequest:(s=o,e=>Object.assign(e,{token:e.token||wa(s)})),afterRequest:async(e,t)=>{401===(null==t?void 0:t.status)?Oa(o):((e={},t,n)=>{var{refreshJwt:r,sessionJwt:o}=e,i=c(e,["refreshJwt","sessionJwt"]);void 0===t&&(t=!1),void 0===n&&(n=""),r&&ra(`${n}${ba}`,r),o&&(t?function(e,t,{cookiePath:n,cookieDomain:r,cookieExpiration:o}){if(t){const i=new Date(1e3*o),d=function(e){const t=window.location.hostname.split("."),n=e.split(".");return t.slice(-n.length).join(".")===e}(r);Qn.set(e,t,{path:n,domain:d?r:void 0,expires:i,sameSite:"Strict",secure:!0})}}(ya,o,i):ra(`${n}${ya}`,o))})(await ea(t),r,o)}}));var s;const a=Ln(d,["logout","logoutAll"],(e=>t=>async(...n)=>{const r=await t(...n);return Oa(e),r})(o));return Object.assign(a,{getRefreshToken:()=>wa(o),getSessionToken:()=>function(e=""){return Qn.get(ya)||oa(`${e}${ya}`)||""}(o)})}))(((...e)=>{const t=Fn(...e);return Object.assign(Object.assign({},t),{flow:Ra(t),webauthn:Pa(t),fedcm:Aa(t)})}));var Ta={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:1[3-79]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-79])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:22|44|7[27]|87|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","2[0-24-9]\\d{8}|[78]\\d{10,13}|[7-9]\\d{9}|[1-9]\\d{7}|[124-7]\\d{6}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:0[0-689]|[1-79])|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:5056(?:[0-35-9]\\d|4[468])|7302[0-3]\\d)\\d{4}|(?:472[24]|505[2-57-9]|7306|983[237-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:20|33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Ua(e,t){var n=Array.prototype.slice.call(t);return n.push(Ta),e.apply(this,n)}function Da(e){return Da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Da(e)}function La(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Fa(e,t){if(t&&("object"===Da(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wa(e)}function Wa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Va(e){var t="function"==typeof Map?new Map:void 0;return Va=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return qa(e,arguments,Ga(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ha(r,e)},Va(e)}function qa(e,t,n){return qa=Ba()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Ha(o,n.prototype),o},qa.apply(null,arguments)}function Ba(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Ha(e,t){return Ha=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ha(e,t)}function Ga(e){return Ga=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Ga(e)}var Ka=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ha(e,t)}(s,e);var t,n,r,o,i,d=(t=s,n=Ba(),function(){var e,r=Ga(t);if(n){var o=Ga(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Fa(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=d.call(this,e),Object.setPrototypeOf(Wa(t),s.prototype),t.name=t.constructor.name,t}return r=s,o&&La(r.prototype,o),i&&La(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}(Va(Error)),za="0-90-9٠-٩۰-۹",Ja="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~");function Za(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),o=0;o<3;o++){var i=Number(n[o]),d=Number(r[o]);if(i>d)return 1;if(d>i)return-1;if(!isNaN(i)&&isNaN(d))return 1;if(isNaN(i)&&!isNaN(d))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var Ya={}.constructor;function Xa(e){return null!=e&&e.constructor===Ya}function Qa(e){return Qa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qa(e)}function el(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nl(e,t,n){return t&&tl(e.prototype,t),n&&tl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var rl=" ext. ",ol=/^\d+$/,il=function(){function e(t){el(this,e),function(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Xa(e)||!Xa(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Xa(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+ul(e)+": "+e,"."))}(t),this.metadata=t,fl.call(this,t)}return nl(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&ol.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new dl(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new dl(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),dl=function(){function e(t,n){el(this,e),this.globalMetadataObject=n,this.metadata=t,fl.call(this,n.metadata)}return nl(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,t=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return t.map((function(t){return new sl(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&cl(this.types(),e))return new ll(cl(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?rl:this.metadata[13]||rl}}]),e}(),sl=function(){function e(t,n){el(this,e),this._format=t,this.metadata=n}return nl(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||al.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),al=/^\(?\$1\)?$/,ll=function(){function e(t,n){el(this,e),this.type=t,this.metadata=n}return nl(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function cl(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var ul=function(e){return Qa(e)};function hl(e,t){if((t=new il(t)).hasCountry(e))return t.country(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function fl(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===Za(t,"1.2.0")?this.v2=!0:-1===Za(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var pl=function(e){return"([".concat(za,"]{1,").concat(e,"})")};function $l(e){var t="[ \\t,]*",n="[:\\..]?[ \\t,-]*",r="#?",o="[ \\t]*";return";ext="+pl("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+pl("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+pl("9")+r)+"|"+("[- ]+"+pl("6")+"#")+"|"+(o+"(?:,{2}|;)"+n+pl("15")+r)+"|"+(o+"(?:,)+"+n+pl("9")+r)}var gl="["+za+"]{2}",vl="[++]{0,1}(?:["+Ja+"]*["+za+"]){3,}["+Ja+za+"]*",ml=new RegExp("^[++]{0,1}(?:["+Ja+"]*["+za+"]){1,2}$","i"),yl=vl+"(?:"+$l()+")?",bl=new RegExp("^"+gl+"$|^"+yl+"$","i");var wl=new RegExp("(?:"+$l()+")$","i");var Ol={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function El(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Cl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Il(e){for(var t,n="",r=El(e.split(""));!(t=r()).done;){n+=kl(t.value,n)||""}return n}function kl(e,t,n){return"+"===e?t?void("function"==typeof n&&n("end")):"+":function(e){return Ol[e]}(e)}function Sl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jl(e,t){return Nl(e,void 0,t)}function Nl(e,t,n){var r=n.type(t),o=r&&r.possibleLengths()||n.possibleLengths();if(!o)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!n.type("FIXED_LINE"))return Nl(e,"MOBILE",n);var i=n.type("MOBILE");i&&(o=function(e,t){for(var n,r=e.slice(),o=Sl(t);!(n=o()).done;){var i=n.value;e.indexOf(i)<0&&r.push(i)}return r.sort((function(e,t){return e-t}))}(o,i.possibleLengths()))}else if(t&&!r)return"INVALID_LENGTH";var d=e.length,s=o[0];return s===d?"IS_POSSIBLE":s>d?"TOO_SHORT":o[o.length-1]<d?"TOO_LONG":o.indexOf(d,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function _l(e,t){return"IS_POSSIBLE"===jl(e,t)}function Pl(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function Al(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Rl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Rl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Rl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ml=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Tl(e,t,n){if(t=t||{},e.country||e.countryCallingCode){(n=new il(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(Pl(r,n.nationalNumberPattern())){if(Ul(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Ul(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var o,i=Al(Ml);!(o=i()).done;){var d=o.value;if(Ul(r,d,n))return d}}}}function Ul(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&Pl(e,t.pattern()))}function Dl(e,t,n){var r=new il(n).getCountryCodesForCallingCode(e);return r?r.filter((function(e){return function(e,t,n){var r=new il(n);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)})):[]}var Ll=/(\$\d)/;function Fl(e,t,n){var r=n.useInternationalFormat,o=n.withNationalPrefix;n.carrierCode,n.metadata;var i=e.replace(new RegExp(t.pattern()),r?t.internationalFormat():o&&t.nationalPrefixFormattingRule()?t.format().replace(Ll,t.nationalPrefixFormattingRule()):t.format());return r?function(e){return e.replace(new RegExp("[".concat(Ja,"]+"),"g")," ").trim()}(i):i}var Wl=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Vl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return ql(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ql(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Bl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Hl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bl(Object(n),!0).forEach((function(t){Gl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kl={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function zl(e,t,n,r){if(n=n?Hl(Hl({},Kl),n):Kl,r=new il(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var o,i=r.countryCallingCode(),d=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return d?Zl(o=Jl(d,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return d?(o=Jl(d,null,"INTERNATIONAL",r,n),Zl(o="+".concat(i," ").concat(o),e.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(d);case"RFC3966":return function(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}({number:"+".concat(i).concat(d),ext:e.ext});case"IDD":if(!n.fromCountry)return;var s=function(e,t,n,r,o){var i=hl(r,o.metadata);if(i===n){var d=Jl(e,t,"NATIONAL",o);return"1"===n?n+" "+d:d}var s=function(e,t,n){var r=new il(n);return r.selectNumberingPlan(e,t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Wl.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,o.metadata);if(s)return"".concat(s," ").concat(n," ").concat(Jl(e,null,"INTERNATIONAL",o))}(d,e.carrierCode,i,n.fromCountry,r);return Zl(s,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function Jl(e,t,n,r,o){var i=function(e,t){for(var n,r=Vl(e);!(n=r()).done;){var o=n.value;if(o.leadingDigitsPatterns().length>0){var i=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==t.search(i))continue}if(Pl(t,o.pattern()))return o}}(r.formats(),e);return i?Fl(e,i,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!o||!1!==o.nationalPrefix,carrierCode:t,metadata:r}):e}function Zl(e,t,n,r){return t?r(e,t,n):e}function Yl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Yl(Object(n),!0).forEach((function(t){Ql(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ql(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ec(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var tc=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("`country` or `countryCallingCode` not passed");if(!n)throw new TypeError("`nationalNumber` not passed");if(!r)throw new TypeError("`metadata` not passed");var o=function(e,t){var n,r,o=new il(t);i=e,/^[A-Z]{2}$/.test(i)?(n=e,o.selectNumberingPlan(n),r=o.countryCallingCode()):r=e;var i;return{country:n,countryCallingCode:r}}(t,r),i=o.country,d=o.countryCallingCode;this.country=i,this.countryCallingCode=d,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}var t,n,r;return t=e,n=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Dl(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(e,t,n){if(void 0===t&&(t={}),n=new il(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return _l(e.phone||e.nationalNumber,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(e,t,n){return t=t||{},(n=new il(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==Tl(e,t,n.metadata):Pl(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new il(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return Tl(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return zl(this,e,t?Xl(Xl({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],n&&ec(t.prototype,n),r&&ec(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();var nc=new RegExp("(["+za+"])");function rc(e,t){var n=function(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var o,i,d,s=r.length-1,a=s>0&&r[s];if(t.nationalPrefixTransformRule()&&a)o=e.replace(n,t.nationalPrefixTransformRule()),s>1&&(i=r[1]);else{var l=r[0];o=e.slice(l.length),a&&(i=r[1])}if(a){var c=e.indexOf(r[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(d=t.numberingPlan.nationalPrefix())}else d=r[0];return{nationalNumber:o,nationalPrefix:d,carrierCode:i}}}return{nationalNumber:e}}(e,t),r=n.carrierCode,o=n.nationalNumber;if(o!==e){if(!function(e,t,n){if(Pl(e,n.nationalNumberPattern())&&!Pl(t,n.nationalNumberPattern()))return!1;return!0}(e,o,t))return{nationalNumber:e};if(t.possibleLengths()&&!function(e,t){switch(jl(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(o,t))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:r}}function oc(e,t,n,r){if(!e)return{};var o;if("+"!==e[0]){var i=function(e,t,n,r){if(t){var o=new il(r);o.selectNumberingPlan(t,n);var i=new RegExp(o.IDDPrefix());if(0===e.search(i)){var d=(e=e.slice(e.match(i)[0].length)).match(nc);if(!(d&&null!=d[1]&&d[1].length>0&&"0"===d[1]))return e}}}(e,t,n,r);if(!i||i===e){if(t||n){var d=function(e,t,n,r){var o=t?hl(t,r):n;if(0===e.indexOf(o)){(r=new il(r)).selectNumberingPlan(t,n);var i=e.slice(o.length),d=rc(i,r).nationalNumber,s=rc(e,r).nationalNumber;if(!Pl(s,r.nationalNumberPattern())&&Pl(d,r.nationalNumberPattern())||"TOO_LONG"===jl(s,r))return{countryCallingCode:o,number:i}}return{number:e}}(e,t,n,r),s=d.countryCallingCode,a=d.number;if(s)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:s,number:a}}return{number:e}}o=!0,e="+"+i}if("0"===e[1])return{};r=new il(r);for(var l=2;l-1<=3&&l<=e.length;){var c=e.slice(1,l);if(r.hasCallingCode(c))return r.selectNumberingPlan(c),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(l)};l++}return{}}function ic(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return dc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return dc(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function dc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sc(e,t){var n=t.nationalNumber,r=t.defaultCountry,o=t.metadata,i=o.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:function(e,t){var n=t.countries,r=t.defaultCountry,o=t.metadata;o=new il(o);for(var i,d=[],s=ic(n);!(i=s()).done;){var a=i.value;if(o.country(a),o.leadingDigits()){if(e&&0===e.search(o.leadingDigits()))return a}else if(Tl({phone:e,country:a},void 0,o.metadata)){if(!r)return a;if(a===r)return a;d.push(a)}}if(d.length>0)return d[0]}(n,{countries:i,defaultCountry:r,metadata:o.metadata})}var ac="(["+za+"]|[\\-\\.\\(\\)]?)",lc=new RegExp("^\\+"+ac+"*["+za+"]"+ac+"*$","g"),cc=new RegExp("^("+("["+za+"]+((\\-)*["+za+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+za+"])*")+"\\.?$","g"),uc="tel:",hc=";phone-context=";function fc(e,t){var n,r=t.extractFormattedPhoneNumber,o=function(e){var t=e.indexOf(hc);if(t<0)return null;var n=t+hc.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(lc.test(e)||cc.test(e))}(o))throw new Ka("NOT_A_NUMBER");if(null===o)n=r(e)||"";else{n="","+"===o.charAt(0)&&(n+=o);var i,d=e.indexOf(uc);i=d>=0?d+uc.length:0;var s=e.indexOf(hc);n+=e.substring(i,s)}var a=n.indexOf(";isub=");if(a>0&&(n=n.substring(0,a)),""!==n)return n}var pc=new RegExp("[++"+za+"]"),$c=new RegExp("[^"+za+"#]+$");function gc(e,t,n){if(t=t||{},n=new il(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new Ka("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=fc(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>250){if(n)throw new Ka("TOO_LONG");return}if(!1===t)return e;var r=e.search(pc);if(r<0)return;return e.slice(r).replace($c,"")}(e,n,t)}});if(!r)return{};if(!function(e){return e.length>=2&&bl.test(e)}(r))return function(e){return ml.test(e)}(r)?{error:"TOO_SHORT"}:{};var o=function(e){var t=e.search(wl);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(wl),o=1;o<r.length;){if(r[o])return{number:n,ext:r[o]};o++}}(r);if(o.ext)return o;return{number:r}}(e,t.v2,t.extract),o=r.number,i=r.ext,d=r.error;if(!o){if(t.v2){if("TOO_SHORT"===d)throw new Ka("TOO_SHORT");throw new Ka("NOT_A_NUMBER")}return{}}var s=function(e,t,n,r){var o,i=oc(Il(e),t,n,r.metadata),d=i.countryCallingCodeSource,s=i.countryCallingCode,a=i.number;if(s)r.selectNumberingPlan(s);else{if(!a||!t&&!n)return{};r.selectNumberingPlan(t,n),t&&(o=t),s=n||hl(t,r.metadata)}if(!a)return{countryCallingCodeSource:d,countryCallingCode:s};var l=rc(Il(a),r),c=l.nationalNumber,u=l.carrierCode,h=sc(s,{nationalNumber:c,defaultCountry:t,metadata:r});h&&(o=h,"001"===h||r.country(o));return{country:o,countryCallingCode:s,countryCallingCodeSource:d,nationalNumber:c,carrierCode:u}}(o,t.defaultCountry,t.defaultCallingCode,n),a=s.country,l=s.nationalNumber,c=s.countryCallingCode,u=s.countryCallingCodeSource,h=s.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new Ka("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(t.v2)throw new Ka("TOO_SHORT");return{}}if(l.length>17){if(t.v2)throw new Ka("TOO_LONG");return{}}if(t.v2){var f=new tc(c,l,n.metadata);return a&&(f.country=a),h&&(f.carrierCode=h),i&&(f.ext=i),f.__countryCallingCodeSource=u,f}var p=!!(t.extended?n.hasSelectedNumberingPlan():a)&&Pl(l,n.nationalNumberPattern());return t.extended?{country:a,countryCallingCode:c,carrierCode:h,valid:p,possible:!!p||!(!0!==t.extended||!n.possibleLengths()||!_l(l,n)),phone:l,ext:i}:p?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(a,l,i):{}}function vc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function mc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vc(Object(n),!0).forEach((function(t){yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function wc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],d=!0,s=!1;try{for(n=n.call(e);!(d=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);d=!0);}catch(e){s=!0,o=e}finally{try{d||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Ec(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ec(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ec(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cc(e){var t,n,r,o=Oc(Array.prototype.slice.call(e),4),i=o[0],d=o[1],s=o[2],a=o[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(t=i,d&&"string"!=typeof d){if(!Xa(d))throw new Error("Invalid second argument: ".concat(d));s?(n=d,r=s):r=d}else a?(n=s,r=a):(n=void 0,r=s),d&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bc(Object(n),!0).forEach((function(t){wc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({defaultCountry:d},n));return{text:t,options:n,metadata:r}}function Ic(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ic(Object(n),!0).forEach((function(t){Sc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ic(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Sc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xc(e,t,n){t&&t.defaultCountry&&!function(e,t){return t.countries.hasOwnProperty(e)}(t.defaultCountry,n)&&(t=kc(kc({},t),{},{defaultCountry:void 0}));try{return function(e,t,n){return gc(e,mc(mc({},t),{},{v2:!0}),n)}(e,t,n)}catch(e){if(!(e instanceof Ka))throw e}}function jc(){var e=Cc(arguments),t=e.text,n=e.options,r=e.metadata;return xc(t,n,r)}function Nc(...e){return t=>e.reduce(((e,t)=>t(e)),t)}const _c=e=>{const t=Symbol((e=>{const t=e.toString();let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n&=n;return n.toString(16)})(e));return n=>{if(n[t])return n;const r=e(n);return r[t]=!0,r}},Pc=_c((e=>{var t,n;return n=class extends e{constructor(){super(...arguments),t.set(this,!0)}connectedCallback(){var e,n;null===(e=super.connectedCallback)||void 0===e||e.call(this),(null===(n=this.shadowRoot)||void 0===n?void 0:n.isConnected)&&h(this,t,"f")&&(f(this,t,!1,"f"),this.init())}init(){return u(this,void 0,void 0,(function*(){}))}},t=new WeakMap,n})),Ac=["error","warn","info","debug"],Rc=_c((e=>{var t,n,r,o;return o=class extends e{constructor(){super(...arguments),t.add(this),n.set(this,h(this,t,"m",r).call(this,console))}set logger(e){f(this,n,h(this,t,"m",r).call(this,e),"f")}get logger(){return h(this,n,"f")}onLogEvent(e,t){}},n=new WeakMap,t=new WeakSet,r=function(e){return Ac.reduce(((t,n)=>(t[n]=(...t)=>{var r;this.onLogEvent(n,t),null===(r=e[n])||void 0===r||r.call(e,...t)},t)),{})},o})),Mc=_c((e=>{var t,n,r,o,i,d,s;return s=class extends(Nc(Pc,Rc)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),this.attributeChangedCallback=(e,n,r)=>{var o;null===(o=super.attributeChangedCallback)||void 0===o||o.call(this,e,n,r),"debug"===e&&h(this,t,"m",i).call(this)}}get debug(){return"true"===this.getAttribute("debug")}onLogEvent(e,n){var r;null===(r=super.onLogEvent)||void 0===r||r.call(this,e,n),"error"===e&&h(this,t,"m",d).call(this,n[0]||"Error",n[1])}init(){const e=Object.create(null,{init:{get:()=>super.init}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.init)||void 0===n?void 0:n.call(this),h(this,t,"m",i).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){var e;null===(e=h(this,n,"f"))||void 0===e||e.remove(),f(this,n,null,"f")},o=function(){return u(this,void 0,void 0,(function*(){f(this,n,document.createElement("descope-debugger"),"f"),Object.assign(h(this,n,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),yield Promise.resolve().then((function(){return hf})),document.body.appendChild(h(this,n,"f"))}))},i=function(){this.debug?h(this,t,"m",o).call(this):h(this,t,"m",r).call(this)},d=function(e,t){var r;e&&(null===(r=h(this,n,"f"))||void 0===r||r.updateData({title:e,description:t}))},s})),Tc=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),Uc=e=>{let t,n;return(...r)=>(t&&Tc(t,r)||(t=r,n=e(...r)),n)},Dc=e=>(t,...n)=>t.reduce(((t,r,o)=>{var i;return`${t}${r}${(null===(i=null==n?void 0:n[o])||void 0===i?void 0:i[e>1?1:0])||""}`}),""),Lc=(e,t=500)=>{let n;return function(...r){clearTimeout(n),n=setTimeout((()=>e.apply(this,r)),t)}},Fc="undefined"!=typeof localStorage,Wc=Fc&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",Vc=(e,t)=>!t&&`${e} cannot be empty`,qc=_c((e=>{var t,n;const r=Nc(Rc,Pc)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,{})}init(){const e=Object.create(null,{init:{get:()=>super.init}});var n;return u(this,void 0,void 0,(function*(){var r;yield null===(n=e.init)||void 0===n?void 0:n.call(this),r=e=>{var n;null===(n=h(this,t,"f")[e])||void 0===n||n.forEach((t=>{t(e,this.getAttribute(e))}))},Array.from(this.attributes).forEach((e=>r(e.name))),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&r(e.attributeName)}))})).observe(this,{attributes:!0})}))}observeAttribute(e,n){h(this,t,"f")[e]||(h(this,t,"f")[e]=[]);const r=h(this,t,"f")[e].push(n);return()=>h(this,t,"f")[e].splice(r,1)}observeAttributes(e,t){const n=e.reduce(((e,n)=>(e.push(this.observeAttribute(n,t)),e)),[]);return()=>n.forEach((e=>e()))}},t=new WeakMap,n})),Bc=e=>t=>{var n,r,o;const i=Nc(Rc,Pc,qc)(t),d=Object.keys(e);return o=class extends i{constructor(...e){super(...e),n.add(this),this.observeAttributes(d,h(this,n,"m",r).bind(this))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),d.forEach((e=>h(this,n,"m",r).call(this,e,this.getAttribute(e))))}))}},n=new WeakSet,r=function(t,n){const r=e[t],o="function"==typeof r?r(t,n):r;o&&this.logger.error(o)},o},Hc=_c((e=>{const t=Nc(Bc({"project-id":Vc}))(e);return class extends t{get projectId(){return this.getAttribute("project-id")}}})),Gc=_c((e=>{const t=Nc(Rc,Hc)(e);return class extends t{fetchStaticResource(e,t){return u(this,void 0,void 0,(function*(){const n=function(e,t,n="v2-beta"){const r=new URL(Wc);return r.pathname=((...e)=>e.join("/").replace(/\/+/g,"/"))(r.pathname,e,n,t),r.toString()}(this.projectId,e),r=yield fetch(n,{cache:"default"});return r.ok||this.logger.error(`Error fetching URL ${n} [${r.status}]`),{body:yield r[t](),headers:Object.fromEntries(r.headers.entries())}}))}}})),Kc=_c((e=>{var t,n,r;const o=Nc(Gc)(e);return r=class extends o{constructor(){super(...arguments),t.set(this,void 0),n.set(this,(()=>u(this,void 0,void 0,(function*(){try{const{body:e,headers:t}=yield this.fetchStaticResource("config.json","json");return{projectConfig:e,executionContext:{geo:t["x-geo"]}}}catch(e){this.logger.error("Cannot fetch config file","make sure that your projectId & flowId are correct")}}))))}get config(){return h(this,t,"f")||f(this,t,h(this,n,"f").call(this),"f"),h(this,t,"f")}},t=new WeakMap,n=new WeakMap,r})),zc="load-descope-ui",Jc="base.ui.components.url",Zc=Fc&&localStorage.getItem(Jc)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",Yc=Fc&&localStorage.getItem(Jc)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",Xc=e=>{const t=document.createElement("script");return t.id=e,t},Qc=(e,t)=>e.replace("<version>",t),eu=_c((e=>{var t,n,r,o,i,d,s,a,l,c,p,$;const g=Nc(Rc,Kc)(e);return $=class extends g{constructor(){super(...arguments),t.add(this),n.set(this,Symbol("errorCbs")),r.set(this,Symbol("loadCbs")),l.set(this,void 0)}get descopeUi(){return h(this,l,"f")||f(this,l,h(this,t,"m",p).call(this),"f"),h(this,l,"f")}loadDescopeUiComponents(e){return u(this,void 0,void 0,(function*(){const n=Array.isArray(e)?e:(r=e,[...Array.from(r.content.querySelectorAll("*")).reduce(((e,t)=>t.localName.startsWith("descope-")?e.add(t.localName):e),new Set)]);var r;return Promise.all(n.map((e=>h(this,t,"m",c).call(this,e))))}))}},n=new WeakMap,r=new WeakMap,l=new WeakMap,t=new WeakSet,o=function(){var e;return u(this,void 0,void 0,(function*(){const t=yield this.config,n=null===(e=null==t?void 0:t.projectConfig)||void 0===e?void 0:e.componentsVersion;return n?this.logger.debug(`Got component version "${n}"`):this.logger.error("Could not get components version"),n}))},i=function(e){const t=h(this,n,"f"),o=h(this,r,"f");e[t]=[],e[o]=[],Object.defineProperty(e,"onerror",{set(n){e[t].push(n)}}),Object.defineProperty(e,"onload",{set(t){e[o].push(t)}})},d=function(e,n){return u(this,void 0,void 0,(function*(){this.logger.debug("Trying to load DescopeUI from a fallback URL");const r=Xc("load-descope-ui-fallback-script");document.body.append(r),r.addEventListener("error",(()=>{e.forEach((e=>e(`Cannot load DescopeUI from fallback URL, Make sure this URL is valid and return the correct script: "${r.src}"`)))})),r.addEventListener("load",(()=>{n.forEach((e=>e()))})),r.src=Qc(Yc,yield h(this,t,"m",o).call(this))}))},s=function(e){e.addEventListener("error",(()=>{e[h(this,n,"f")].forEach((t=>t(`Cannot load DescopeUI from main URL, Make sure this URL is valid and return the correct script: "${e.src}"`))),h(this,t,"m",d).call(this,e[h(this,n,"f")],e[h(this,r,"f")])})),e.addEventListener("load",(()=>{e[h(this,r,"f")].forEach((e=>e()))}))},a=function(){return u(this,void 0,void 0,(function*(){if(document.querySelector(`script#${zc}`))this.logger.debug("DescopeUI loading script already exists",this);else{this.logger.debug("DescopeUI loading script does not exist, creating it",this);const e=Xc(zc);document.body.append(e),h(this,t,"m",i).call(this,e),h(this,t,"m",s).call(this,e),e.src=Qc(Zc,yield h(this,t,"m",o).call(this))}return document.getElementById(zc)}))},c=function(e){return u(this,void 0,void 0,(function*(){if(customElements.get(e))return void this.logger.debug(`Loading component "${e}" is skipped as it is already defined`);const t=yield this.descopeUi;if(t[e])try{return yield t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`Encountered an error while attempting to define the "${e}" component, it is likely that this component is already defined`)}else this.logger.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)}))},p=function(){return new Promise((e=>{globalThis.DescopeUI&&e(globalThis.DescopeUI),h(this,t,"m",a).call(this).then((t=>{t.onerror=this.logger.error,t.onload=()=>{this.logger.debug("DescopeUI was loaded"),e(globalThis.DescopeUI)},setTimeout((()=>{globalThis.DescopeUI&&e(globalThis.DescopeUI)}))}))}))},$})),tu="content-root",nu="root",ru=_c((e=>class extends e{constructor(...e){var t,n;super(...e),this.attachShadow({mode:"open"}).innerHTML=`\n\n <style>\n #${nu}, #${tu} {\n height: 100%;\n }\n </style>\n <div id="${nu}">\n <div id="${tu}"></div>\n </div>\n `,this.contentRootElement=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(tu),this.rootElement=null===(n=this.shadowRoot)||void 0===n?void 0:n.getElementById(nu)}})),ou=(e,t)=>!!t&&"light"!==t&&"dark"!==t&&'Supported theme values are "light", "dark", or leave empty for using the OS theme',iu=_c((e=>{var t,n,r,o,i,d,s,a,l;const c=Nc(Bc({theme:ou}),Gc,Pc,eu,Kc,ru)(e);return l=class extends c{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get theme(){var e,t;const n=this.getAttribute("theme");return"os"===n?window.matchMedia&&(null===(t=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)"))||void 0===t?void 0:t.matches)?"dark":"light":n||"light"}init(){const e=Object.create(null,{init:{get:()=>super.init}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.init)||void 0===n?void 0:n.call(this),h(this,t,"m",i).call(this),h(this,t,"m",d).call(this),h(this,t,"m",s).call(this),h(this,t,"m",a).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){return u(this,void 0,void 0,(function*(){try{const{body:e}=yield this.fetchStaticResource("theme.json","json");return e}catch(e){this.logger.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}}))},o=function(){return h(this,n,"f")||(f(this,n,h(this,t,"m",r).call(this),"f"),h(this,n,"f").then((e=>this.logger.debug("Fetched theme",e)))),h(this,n,"f")},i=function(){var e,n;return u(this,void 0,void 0,(function*(){const r=yield h(this,t,"a",o);if(!r)return;const i=document.createElement("style");i.innerText=((null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.globals)||"")+((null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.globals)||""),this.shadowRoot.appendChild(i)}))},d=function(){var e,n;return u(this,void 0,void 0,(function*(){const r=Object.assign({},yield h(this,t,"a",o));if(!r)return;const i=yield this.descopeUi;(null==i?void 0:i.componentsThemeManager)&&(i.componentsThemeManager.themes={light:null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.components,dark:null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.components})}))},s=function(){var e,t;return u(this,void 0,void 0,(function*(){const{projectConfig:n}=yield this.config,r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>{e.url&&(this.logger.debug(`Loading font from URL "${e.url}"`),(e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url))}))}))},a=function(){return u(this,void 0,void 0,(function*(){this.rootElement.setAttribute("data-theme",this.theme);const e=yield this.descopeUi;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)}))},l}));var du;class su{constructor(e,t){du.set(this,void 0),this.nodeName="",f(this,du,e,"f"),this.logger=t.logger}get asyncEle(){return e=h(this,du,"f"),1e3,u(void 0,void 0,void 0,(function*(){return new Promise((t=>{const n=setInterval((()=>{const r="function"==typeof e?e():e;r&&(clearInterval(n),t(r))}),100);setTimeout((()=>{clearInterval(n),t(null)}),1e3)}))}));var e}get ele(){var e,t;const n="function"==typeof h(this,du,"f")?h(this,du,"f").call(this):h(this,du,"f");return n?(null==n?void 0:n.localName)!==this.nodeName?(null===(t=this.logger)||void 0===t||t.debug(`node name do not match, expected "${this.nodeName}", received "${n.localName}" `,Error()),null):n:(null===(e=this.logger)||void 0===e||e.debug("no element for driver ",this.constructor.name,new Error),null)}}du=new WeakMap;class au extends su{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}const lu=e=>{const t=document.createElement("template");return t.innerHTML=e,t},cu=_c((e=>class extends(Rc(e)){validateForm(e){return this.getFormInputs(e).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))}getFormInputs(e){return e?Array.from(e.querySelectorAll("[name]")):(this.logger.debug("cannot get form inputs, no root element was received"),[])}getFormData(e){return this.getFormInputs(e).reduce(((e,t)=>Object.assign(e,{[t.getAttribute("name")]:t.value})),{})}setFormData(e,t){this.getFormInputs(e).forEach((e=>{t.hasOwnProperty(e.getAttribute("name"))&&(e.value=t[e.getAttribute("name")])}))}resetFormData(e){this.getFormInputs(e).forEach((e=>{e.value=""}))}})),uu="descope-modal";var hu;class fu extends su{constructor(){super(...arguments),hu.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}open(){var e,t;return u(this,void 0,void 0,(function*(){yield null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}))}reset(){var e;this.ele&&(this.ele.innerHTML=""),h(this,hu,"f")&&(null===(e=this.ele)||void 0===e||e.append(h(this,hu,"f").content.cloneNode(!0)))}setContent(e){f(this,hu,e,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}hu=new WeakMap;const pu=_c((e=>{var t,n;const r=Nc(Pc,ru,eu)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends fu{setContent(t){e(t),super.setContent(t)}}})())}createModal(e){const n=((e={})=>{const t=document.createElement(uu);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){this.loadDescopeUiComponents([uu]),yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}},t=new WeakMap,n}));class $u extends su{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}setData(e){var t;return u(this,void 0,void 0,(function*(){null===(t=yield this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}))}}const gu={enabled:"active"},vu=e=>e.tenantRoles.data,mu=e=>e.selectedUsersLoginIds,yu=e=>e.notifications,bu=od((e=>e.usersList.data),(e=>e.map((e=>Object.assign(Object.assign({},e),{status:gu[e.status]||e.status,roles:e.roleNames}))))),wu=od(bu,mu,((e,t)=>e.filter((e=>t.includes(e.loginIds))).map((e=>e.userId)))),Ou=od(mu,bu,((e,t)=>t.filter((t=>e.includes(t.loginIds))))),Eu=od(mu,(e=>!!e.length)),Cu=od(mu,(e=>1===e.length)),Iu=od(Ou,(e=>1===e.length?e[0].email:`${e.length} users`)),ku=e=>_c((t=>{const n=Hs(e),r=Object.assign(Object.assign({},n.actions),e.asyncActions);return class extends(Nc(Rc)(t)){constructor(...e){super(...e);const t=Ps({reducer:n.reducer,middleware:e=>e({thunk:{extraArgument:this},serializableCheck:!1}),devTools:!1}),o=e=>(...n)=>u(this,void 0,void 0,(function*(){const r=yield t.dispatch(e(...n));try{Ws(r)}catch(e){this.logger.error(e.message,r.type,e.stack)}return r})),i=Object.keys(r).reduce(((e,t)=>(e[t]=o(r[t]),e)),{});this.actions=i,this.subscribe=(e,n=(e=>e))=>t.subscribe((()=>e(n(t.getState()))))}}})),Su=e=>(...t)=>n=>{n.addCase(e.pending,((e,n)=>{t.forEach((({onPending:t})=>{null==t||t(e,n)}))})),n.addCase(e.fulfilled,((e,n)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,n)}))})),n.addCase(e.rejected,((e,n)=>{t.forEach((({onRejected:t})=>{null==t||t(e,n)}))}))},xu=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,n)=>{e(t).loading=!1,e(t).error=n.error}}),ju=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,n)=>{t&&e.notifications.push({type:"success",msg:t(n)})},onRejected:(t,n)=>{e&&t.notifications.push({type:"error",msg:e(n)})}}),Nu=Fs("users/create",((e,{extra:{api:t}})=>t.user.create(e))),_u=Su(Nu)({onFulfilled:(e,t)=>{e.usersList.data.unshift(t.payload)}},xu((e=>e.createUser)),ju({getSuccessMsg:()=>"User created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Pu={action:Nu,reducer:_u},Au=Fs("users/delete",((e,{extra:{api:t}})=>t.user.deleteBatch(e))),Ru=Su(Au)({onFulfilled:(e,t)=>{e.usersList.data=e.usersList.data.filter((e=>!t.meta.arg.includes(e.userId))),e.selectedUsersLoginIds=[]}},xu((e=>e.deleteUser)),ju({getSuccessMsg:e=>Dc(e.meta.arg.length)`${["",e.meta.arg.length]} ${["U","u"]}ser${["","s"]} deleted successfully`,getErrorMsg:e=>Dc(e.meta.arg.length)`Failed to delete user${["","s"]}`})),Mu={action:Au,reducer:Ru},Tu=Fs("users/expirePassword",((e,{extra:{api:t}})=>t.user.expirePassword(e))),Uu={action:Tu,reducer:Su(Tu)(xu((e=>e.expireUserPassword)))},Du=Fs("users/getCustomAttributes",((e,{extra:{api:t}})=>t.user.getCustomAttributes())),Lu=Su(Du)({onFulfilled:(e,t)=>{e.customAttributes.data=t.payload}},xu((e=>e.customAttributes))),Fu={action:Du,reducer:Lu},Wu=Fs("users/search",((e,{extra:{api:t},getState:n})=>{const r=n().searchParams;return t.user.search(Object.assign(Object.assign({},r),e))})),Vu=Su(Wu)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.usersList.data=t.payload}},xu((e=>e.usersList))),qu={action:Wu,reducer:Vu},Bu=Fs("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),Hu=Su(Bu)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},xu((e=>e.tenantRoles))),Gu={action:Bu,reducer:Hu},Ku=Fs("users/update",((e,{extra:{api:t}})=>t.user.update(e))),zu={action:Ku,reducer:Su(Ku)({onFulfilled:(e,t)=>{const n=e.usersList.data.findIndex((e=>Tc(e.loginIds,t.payload.loginIds)));-1!==n&&(e.usersList.data[n]=t.payload)}},xu((e=>e.updateUser)),ju({getSuccessMsg:()=>"User updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}}))},Ju={usersList:{data:[],loading:!1,error:null},createUser:{loading:!1,error:null},updateUser:{loading:!1,error:null},deleteUser:{loading:!1,error:null},expireUserPassword:{loading:!1,error:null},customAttributes:{loading:!1,error:null,data:{}},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedUsersLoginIds:[],notifications:[]},Zu="/v1/mgmt/user/search",Yu="/v1/mgmt/user/delete/batch",Xu="/v1/mgmt/user/create",Qu="/v1/mgmt/user/update",eh="/v1/mgmt/user/password/expire",th="/v1/mgmt/user/customattributes",nh="/v1/mgmt/role/all",rh=e=>u(void 0,void 0,void 0,(function*(){const t=yield e.text(),n=JSON.parse(t);if(!e.ok){const t=`${n.errorDescription}${n.errorMessage?`: ${n.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(n),e.text=()=>Promise.resolve(t)})),oh=({httpClient:e,tenant:t})=>({search:({page:n,limit:r=1e4,customAttributes:o,statuses:i,emails:d,phones:s,text:a,sort:l}={})=>u(void 0,void 0,void 0,(function*(){const c=yield e.post(Zu,{limit:r,page:n,withTestUser:!1,customAttributes:o,statuses:i,emails:d,phones:s,text:a,sort:l},{queryParams:{tenant:t}});return yield rh(c),(yield c.json()).users})),deleteBatch:n=>u(void 0,void 0,void 0,(function*(){const r=yield e.post(Yu,{userIds:n},{queryParams:{tenant:t}});return yield rh(r),r.json()})),create:({loginId:n,email:r,phone:o,displayName:i,roles:d,customAttributes:s,picture:a,verifiedEmail:l,verifiedPhone:c,givenName:h,middleName:f,familyName:p,additionalLoginIds:$,sendSMS:g,sendMail:v,inviteUrl:m,invite:y})=>u(void 0,void 0,void 0,(function*(){const u=yield e.post(Xu,{loginId:n,email:r,phone:o,displayName:i,givenName:h,middleName:f,familyName:p,roleNames:d,userTenants:[{tenantId:t}],customAttributes:s,picture:a,verifiedEmail:l,verifiedPhone:c,additionalLoginIds:$,sendSMS:g,sendMail:v,inviteUrl:m,invite:y},{queryParams:{tenant:t}});return yield rh(u),(yield u.json()).user})),update:({loginId:n,email:r,phone:o,displayName:i,roles:d,customAttributes:s,picture:a,verifiedEmail:l,verifiedPhone:c,givenName:h,middleName:f,familyName:p,additionalLoginIds:$})=>u(void 0,void 0,void 0,(function*(){const u=yield e.post(Qu,{loginId:n,email:r,phone:o,displayName:i,givenName:h,middleName:f,familyName:p,roleNames:d,customAttributes:s,picture:a,verifiedEmail:l,verifiedPhone:c,additionalLoginIds:$},{queryParams:{tenant:t}});return yield rh(u),(yield u.json()).user})),expirePassword:n=>u(void 0,void 0,void 0,(function*(){const r=yield e.post(eh,{loginId:n[0]},{queryParams:{tenant:t}});return yield rh(r),r.json()})),getCustomAttributes:()=>u(void 0,void 0,void 0,(function*(){const n=yield e.get(th,{queryParams:{tenant:t}});return yield rh(n),n.json()}))}),ih=({httpClient:e,tenant:t})=>({getTenantRoles:()=>u(void 0,void 0,void 0,(function*(){const n=yield e.get(nh,{queryParams:{tenant:t}});return yield rh(n),n.json()}))}),dh=_c((e=>{var t,n,r,o;const i=Nc(Hc,qc,Rc,Bc({tenant:Vc}))(e);return o=class extends i{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get tenant(){return this.getAttribute("tenant")}get api(){return h(this,n,"f")||h(this,t,"m",r).call(this),h(this,n,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{h(this,n,"f")&&h(this,t,"m",r).call(this)}))}))}},n=new WeakMap,t=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),f(this,n,((e,t)=>{const n=Ma(Object.assign(Object.assign({},e),{persistTokens:!0}));return{user:oh({httpClient:n.httpClient,tenant:t}),tenant:ih({httpClient:n.httpClient,tenant:t})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenant),"f")},o})),sh=_c((e=>{const t=Nc(ku({name:"widget",initialState:Ju,reducers:{setSelectedUsersIds:(e,{payload:t})=>{e.selectedUsersLoginIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{Pu.reducer(e),zu.reducer(e),Mu.reducer(e),qu.reducer(e),Uu.reducer(e),Fu.reducer(e),Gu.reducer(e)},asyncActions:{searchUsers:qu.action,createUser:Pu.action,updateUser:zu.action,deleteUsers:Mu.action,expireUserPassword:Uu.action,getCustomAttributes:Fu.action,getTenantRoles:Gu.action}}),Pc,Rc,dh)(e);return class extends t{constructor(...e){super(...e),this.state=Ju,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),ah=_c((e=>{const t=Nc(Gc,Bc({"widget-id":Vc}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return u(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),lh=_c((e=>{var t,n,r;return r=class extends(Nc(Rc,Pc,eu,ru,ah,sh)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return u(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.init)||void 0===r?void 0:r.call(this),yield Promise.all([h(this,t,"m",n).call(this),this.actions.searchUsers(),this.actions.getTenantRoles()]),this.onWidgetRootReady()}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){const e=lu(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),ch=_c((e=>{var t,n,r,o,i;return i=class extends(Nc(sh,pu,cu,Rc,lh)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),o.set(this,(()=>u(this,void 0,void 0,(function*(){yield h(this,n,"f").setData(vu(this.state).map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,o=new WeakMap,t=new WeakSet,r=function(){return u(this,void 0,void 0,(function*(){this.createUserModal=this.createModal(),this.createUserModal.setContent(lu(yield this.fetchWidgetPage("create-user-modal.html")));const e=new au((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});e.onClick((()=>{this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}));const t=new au((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});t.onClick((()=>u(this,void 0,void 0,(function*(){this.validateForm(this.createUserModal.ele)&&(this.actions.createUser(Object.assign(Object.assign({},this.getFormData(this.createUserModal.ele)),{invite:!0,verifiedEmail:!0,verifiedPhone:!0})),this.createUserModal.close(),this.resetFormData(this.createUserModal.ele))})))),f(this,n,new $u((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),h(this,o,"f").call(this)}))},i})),uh=_c((e=>{var t,n,r;return r=class extends(Nc(Rc,ch,lh)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;this.createButton=new au(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-user"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createUserModal.open()))},r}));class hh extends su{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}}const fh=_c((e=>{var t,n,r;return r=class extends(Nc(sh,pu,Rc,lh)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.deleteUsersModal=this.createModal(),this.deleteUsersModal.setContent(lu(yield this.fetchWidgetPage("delete-users-modal.html")));const t=new au((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteUsersModal.close()));const n=new au((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=wu(this.state);this.actions.deleteUsers(e),this.deleteUsersModal.close()}));const r=new hh(null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteUsersModal.beforeOpen=()=>{const e=Iu(this.state);r.text=`Delete ${e}?`}}))},r})),ph=_c((e=>{var t,n,r,o;return o=class extends(Nc(Rc,lh,sh,fh)(e)){constructor(){super(...arguments),t.add(this),r.set(this,Uc((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Eu)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.deleteButton=new au(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-users"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteUsersModal.open()}))},o}));class $h extends su{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}const gh=_c((e=>{var t,n,r,o;return o=class extends(Nc(Rc,lh,sh)(e)){constructor(){super(...arguments),t.add(this),n.set(this,Lc((()=>{this.actions.searchUsers({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){var e;this.searchInput=new $h(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(h(this,n,"f"))},o})),vh="descope-notification";class mh extends su{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}const yh=_c((e=>{var t,n;const r=Nc(Pc,ru,eu)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends mh{setContent(t){const n="string"==typeof t?lu(t):t;e(n),super.setContent(n)}}})())}createNotification(e){const n=((e={})=>{const t=document.createElement(vh);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.loadDescopeUiComponents([vh])}))}},t=new WeakMap,n})),bh={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="#FFDFDD"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},wh=_c((e=>{var t,n,r,o,i;return i=class extends(Nc(Rc,sh,yh,Pc)(e)){constructor(){super(...arguments),t.add(this),o.set(this,Uc((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const i=h(this,t,"m",r).call(this,e);i.setContent(h(this,t,"m",n).call(this,{type:e,msg:o})),i.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(h(this,o,"f").bind(this),yu)}))}},o=new WeakMap,t=new WeakSet,n=function({type:e,msg:t}){const n=bh[e],r=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==n?void 0:n.outerHTML)||""}${t}${r.outerHTML}`},r=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},i})),Oh=/^descope-grid-([^-]+)-column$/,Eh={text:class extends su{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends su{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};class Ch extends su{constructor(){super(...arguments),this.nodeName="descope-grid"}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var n;const r=null===(n=Oh.exec(t.localName))||void 0===n?void 0:n[1],o=Eh[r];return o?(e.push(new o(t,{logger:this.logger})),e):e}),[]):[]}}const Ih=_c((e=>{var t,n,r,o,i;return i=class extends(Nc(sh,Rc,lh)(e)){constructor(){super(...arguments),t.add(this),r.set(this,Uc((e=>{this.usersTable.data=e}))),o.set(this,Lc(((e,t)=>{const n=[],{value:r}=t;if(r){const t=e.path;n.push({field:t,desc:"desc"===r})}this.actions.searchUsers({sort:n})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var i;return u(this,void 0,void 0,(function*(){yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),h(this,t,"m",n).call(this),this.usersTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{h(this,o,"f").call(this,e.target,e.detail)}))})),h(this,r,"f").call(this,bu(this.state)),this.subscribe(h(this,r,"f").bind(this),bu)}))}},r=new WeakMap,o=new WeakMap,t=new WeakSet,n=function(){var e;this.usersTable=new Ch(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="users-table"]'),{logger:this.logger}),this.usersTable.onSelectedItemsChange((e=>{this.actions.setSelectedUsersIds(e.detail.value.map((({loginIds:e})=>e)))}))},i})),kh=e=>{if(!e)return e;const t=function(){return Ua(jc,arguments)}(e),n=new RegExp(`(\\+?${t.countryCallingCode})(.*)`);return t.number.replace(n,"$1-$2")},Sh=_c((e=>{var t,n,r,o,i,d,s,a,l;return l=class extends(Nc(sh,pu,Rc,cu,lh)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),r.set(this,void 0),d.set(this,(()=>u(this,void 0,void 0,(function*(){yield h(this,r,"f").setData(vu(this.state).map((({name:e})=>({value:e,label:e}))))})))),s.set(this,(()=>{var e,t;const n=null===(e=Ou(this.state))||void 0===e?void 0:e[0],r={loginId:null===(t=null==n?void 0:n.loginIds)||void 0===t?void 0:t.join(", "),displayName:null==n?void 0:n.name,email:null==n?void 0:n.email,phone:kh(null==n?void 0:n.phone),roles:null==n?void 0:n.roles};this.setFormData(this.editUserModal.ele,r)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",a).call(this)}))}},n=new WeakMap,r=new WeakMap,d=new WeakMap,s=new WeakMap,t=new WeakSet,o=function(){new au((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editUserModal.close()))},i=function(){new au((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{if(this.validateForm(this.editUserModal.ele)){const e=this.getFormData(this.editUserModal.ele),{loginId:t}=e,n=c(e,["loginId"]);this.actions.updateUser(Object.assign({loginId:t.split(", ")[0]},n)),this.editUserModal.close(),this.resetFormData(this.editUserModal.ele)}}))},a=function(){var e;return u(this,void 0,void 0,(function*(){this.editUserModal=this.createModal(),this.editUserModal.setContent(lu(yield this.fetchWidgetPage("edit-user-modal.html"))),h(this,t,"m",o).call(this),h(this,t,"m",i).call(this),f(this,n,new $h(null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[name="loginId"]'),{logger:this.logger}),"f"),f(this,r,new $u((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),this.editUserModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){yield h(this,d,"f").call(this),h(this,n,"f").disable(),h(this,s,"f").call(this)}))}))},l})),xh=_c((e=>{var t,n,r,o;return o=class extends(Nc(Rc,lh,sh,Sh,cu)(e)){constructor(){super(...arguments),t.add(this),r.set(this,Uc((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Cu)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.editButton=new au(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-user"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editUserModal.open()}))},o})),jh=_c((e=>class extends(Nc(Mc,iu,Ih,uh,ph,xh,gh,wh)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Nh=Nc((e=>class extends(jh(e)){}))(HTMLElement);customElements.define("descope-user-management-widget",Nh);var _h=Object.freeze({__proto__:null,default:Nh});const Ph=(e,t,n,r={})=>{var o,i,d,s;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(d=r.top)&&void 0!==d?d:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(s=r.bottom)&&void 0!==s?s:0))]};var Ah,Rh,Mh,Th,Uh,Dh,Lh,Fh,Wh,Vh;const qh=document.createElement("template");qh.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class Bh extends HTMLElement{constructor(){super(),Ah.add(this),Rh.set(this,new qo({messages:[]})),Mh.set(this,void 0),Th.set(this,void 0),Uh.set(this,void 0),Dh.set(this,{resize:h(this,Ah,"m",Vh).bind(this)}),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(qh.content.cloneNode(!0)),f(this,Mh,this.shadowRoot.querySelector(".debugger"),"f"),f(this,Th,h(this,Mh,"f").querySelector(".content"),"f"),f(this,Uh,h(this,Mh,"f").querySelector(".header"),"f")}updateData(e){h(this,Rh,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,d=0;function s(t){t.preventDefault(),r=i-t.clientX,o=d-t.clientY,i=t.clientX,d=t.clientY;const[s,a]=Ph(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${a}px`,e.style.left=`${s}px`}function a(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,d=e.clientY,document.onmouseup=a,document.onmousemove=s}t?t.onmousedown=l:e.onmousedown=l})(h(this,Mh,"f"),h(this,Uh,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,Dh,"f").resize),(e=h(this,Mh,"f")).onmousemove=t=>{(t.target.w&&t.target.w!==t.target.offsetWidth||t.target.h&&t.target.h!==t.target.offsetHeight)&&e.onresize(t),t.target.w=t.target.offsetWidth,t.target.h=t.target.offsetHeight},h(this,Mh,"f").onresize=h(this,Ah,"m",Wh).bind(this),h(this,Rh,"f").subscribe(h(this,Ah,"m",Lh).bind(this))}disconnectedCallback(){h(this,Rh,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,Dh,"f").resize)}}Rh=new WeakMap,Mh=new WeakMap,Th=new WeakMap,Uh=new WeakMap,Dh=new WeakMap,Ah=new WeakSet,Lh=function(e){h(this,Ah,"m",Fh).call(this,e),h(this,Ah,"m",Wh).call(this)},Fh=function(e){h(this,Th,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},Wh=function(){h(this,Th,"f").querySelectorAll(".msg").forEach((e=>{const t=e.querySelector(".msg_desc"),n=t.scrollWidth>t.clientWidth,r=t.clientHeight>20;n||r?(e.classList.add("collapsible"),e.onclick=t=>{t.target.classList.contains("msg_desc")||e.classList.toggle("collapsed")}):(e.classList.remove("collapsible"),e.onclick=null)}))},Vh=function(){const[e,t]=Ph(h(this,Mh,"f"),Number.parseInt(h(this,Mh,"f").style.left,10),Number.parseInt(h(this,Mh,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,Mh,"f").style.top=`${t}px`,h(this,Mh,"f").style.left=`${e}px`},customElements.define("descope-debugger",Bh);var Hh,Gh,Kh,zh,Jh=Object.freeze({__proto__:null,default:Bh});function Zh(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r+=1){const o=n[r],i=e[o],d=t[o];if(null===i||null===d){if(i!==d)return!1}else if("object"==typeof i&&"object"==typeof d){if(!Zh(i,d))return!1}else if(i!==d)return!1}return!0}class Yh{constructor(e={},{updateOnlyOnChange:t=!0}={}){Hh.set(this,void 0),Gh.set(this,{}),Kh.set(this,0),zh.set(this,!1),this.update=e=>{const t="function"==typeof e?e(h(this,Hh,"f")):e,n=Object.assign(Object.assign({},h(this,Hh,"f")),t);if(!h(this,zh,"f")||!Zh(h(this,Hh,"f"),n)){const e=h(this,Hh,"f");f(this,Hh,n,"f"),Object.freeze(h(this,Hh,"f")),setTimeout((()=>{Object.values(h(this,Gh,"f")).forEach((t=>t(n,e,((e,t)=>n=>e[n]!==t[n])(n,e))))}),0)}},f(this,Hh,e,"f"),f(this,zh,t,"f")}get current(){return Object.assign({},h(this,Hh,"f"))}subscribe(e){return f(this,Kh,h(this,Kh,"f")+1,"f"),h(this,Gh,"f")[h(this,Kh,"f")]=e,h(this,Kh,"f").toString()}unsubscribe(e){const t=!!h(this,Gh,"f")[e];return t&&delete h(this,Gh,"f")[e],t}unsubscribeAll(){return f(this,Gh,{},"f"),!0}}Hh=new WeakMap,Gh=new WeakMap,Kh=new WeakMap,zh=new WeakMap;const Xh=(e,t,n,r={})=>{var o,i,d,s;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(d=r.top)&&void 0!==d?d:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(s=r.bottom)&&void 0!==s?s:0))]};var Qh,ef,tf,nf,rf,of,df,sf,af,lf;const cf=document.createElement("template");cf.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class uf extends HTMLElement{constructor(){var e;super(),Qh.add(this),ef.set(this,new Yh({messages:[]})),tf.set(this,void 0),nf.set(this,void 0),rf.set(this,void 0),of.set(this,{resize:h(this,Qh,"m",lf).bind(this)}),this.attachShadow({mode:"open"}),null===(e=this.shadowRoot)||void 0===e||e.appendChild(cf.content.cloneNode(!0)),f(this,tf,this.shadowRoot.querySelector(".debugger"),"f"),f(this,nf,h(this,tf,"f").querySelector(".content"),"f"),f(this,rf,h(this,tf,"f").querySelector(".header"),"f")}updateData(e){h(this,ef,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,d=0;function s(t){t.preventDefault(),r=i-t.clientX,o=d-t.clientY,i=t.clientX,d=t.clientY;const[s,a]=Xh(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${a}px`,e.style.left=`${s}px`}function a(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,d=e.clientY,document.onmouseup=a,document.onmousemove=s}t?t.onmousedown=l:e.onmousedown=l})(h(this,tf,"f"),h(this,rf,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,of,"f").resize),(e=h(this,tf,"f")).onmousemove=t=>{var n;const r=t.target;(r.w&&r.w!==r.offsetWidth||r.h&&r.h!==r.offsetHeight)&&(null===(n=e.onresize)||void 0===n||n.call(e,t)),r.w=r.offsetWidth,r.h=r.offsetHeight},h(this,tf,"f").onresize=h(this,Qh,"m",af).bind(this),h(this,ef,"f").subscribe(h(this,Qh,"m",df).bind(this))}disconnectedCallback(){h(this,ef,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,of,"f").resize)}}ef=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf=new WeakMap,of=new WeakMap,Qh=new WeakSet,df=function(e){h(this,Qh,"m",sf).call(this,e),h(this,Qh,"m",af).call(this)},sf=function(e){h(this,nf,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description||""}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},af=function(){h(this,nf,"f").querySelectorAll(".msg").forEach((e=>{const t=e,n=t.querySelector(".msg_desc"),r=n.scrollWidth>n.clientWidth,o=n.clientHeight>20;r||o?(t.classList.add("collapsible"),t.onclick=e=>{e.target.classList.contains("msg_desc")||t.classList.toggle("collapsed")}):(t.classList.remove("collapsible"),t.onclick=null)}))},lf=function(){const[e,t]=Xh(h(this,tf,"f"),Number.parseInt(h(this,tf,"f").style.left,10),Number.parseInt(h(this,tf,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,tf,"f").style.top=`${t}px`,h(this,tf,"f").style.left=`${e}px`},customElements.define("descope-debugger",uf);var hf=Object.freeze({__proto__:null,default:uf});e.AuthProvider=({projectId:e,baseUrl:n="",sessionTokenViaCookie:d=!1,children:a})=>{const[l,c]=t.useState(),[u,h]=t.useState(),[f,p]=t.useState(!1),[$,g]=t.useState(!1),v=(({projectId:e,baseUrl:n,sessionTokenViaCookie:r})=>t.useMemo((()=>{if(e)return Fr({projectId:e,baseUrl:n,sessionTokenViaCookie:r,baseHeaders:s,persistToken:!0,autoRefresh:!0})}),[e,n,r]))({projectId:e,baseUrl:n,sessionTokenViaCookie:d});t.useEffect((()=>{if(v){const e=v.onSessionTokenChange(h),t=v.onUserChange(c);return()=>{e(),t()}}}),[v]);const m=t.useRef(!1),y=t.useCallback((()=>{m.current||(m.current=!0,g(!0),i(null==v?void 0:v.refresh)().then((()=>{g(!1)})))}),[v]),b=t.useCallback((()=>{p(!0),i(v.me)().then((()=>{p(!1)}))}),[v]),w=t.useMemo((()=>({fetchUser:b,user:l,isUserLoading:f,fetchSession:y,session:u,isSessionLoading:$,isSessionFetched:m.current,projectId:e,baseUrl:n,setUser:c,setSession:h,sdk:v})),[b,l,f,y,u,$,m.current,e,n,c,h,v]);return r.default.createElement(o.Provider,{value:w},a)},e.Descope=Gr,e.SignInFlow=e=>r.default.createElement(Gr,Object.assign({},e,{flowId:"sign-in"})),e.SignUpFlow=e=>r.default.createElement(Gr,Object.assign({},e,{flowId:"sign-up"})),e.SignUpOrInFlow=e=>r.default.createElement(Gr,Object.assign({},e,{flowId:"sign-up-or-in"})),e.UserManagement=zr,e.baseHeaders=s,e.getJwtPermissions=qr,e.getJwtRoles=Br,e.getRefreshToken=Vr,e.getSessionToken=Wr,e.refresh=(e=Vr())=>null==Lr?void 0:Lr.refresh(e),e.useDescope=()=>{const{sdk:e}=Jr();return t.useMemo((()=>e||new Proxy(Fr({projectId:"dummy"}),Yr)),[e])},e.useSession=()=>{const{session:e,isSessionLoading:n,fetchSession:r,isSessionFetched:o}=Jr(),i=t.useRef(n);t.useMemo((()=>{i.current=n}),[n]);const d=!e&&!n;return t.useMemo((()=>{d&&!o&&(i.current=!0)}),[o]),t.useEffect((()=>{d&&r()}),[r]),{isSessionLoading:i.current,sessionToken:e,isAuthenticated:!!e}},e.useUser=()=>{const{user:e,fetchUser:n,isUserLoading:r,session:o}=Jr(),[i,d]=t.useState(!1),s=t.useRef(r),a=t.useMemo((()=>!e&&!r&&o&&!i),[n,o,i]);return t.useMemo((()=>{s.current=r}),[r]),t.useMemo((()=>{a&&(s.current=!0)}),[a]),t.useEffect((()=>{a&&(d(!0),n())}),[a]),{isUserLoading:s.current,user:e}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Descope={},e.React)}(this,(function(e,t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=n(t);const o=r.default.createContext(void 0),i=e=>(...t)=>{if(!e)throw Error("You can only use this function after sdk initialization. Make sure to supply 'projectId' to <AuthProvider /> component");return e(...t)},s=e=>(...t)=>{let n;try{n=e(...t)}catch(e){console.error(e)}return n},a={"x-descope-sdk-name":"react","x-descope-sdk-version":"2.0.11"},d="undefined"!=typeof window;var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)};function c(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{d(r.next(e))}catch(e){i(e)}}function a(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}d((r=r.apply(e,t||[])).next())}))}function h(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function f(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function p(e){this.message=e}"function"==typeof SuppressedError&&SuppressedError,p.prototype=new Error,p.prototype.name="InvalidCharacterError";var g="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new p("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,i=0,s="";r=t.charAt(i++);~r&&(n=o%4?64*n+r:r,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function v(e){this.message=e}function m(e,t){if("string"!=typeof e)throw new v("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(g(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return g(t)}}(e.split(".")[n]))}catch(e){throw new v("Invalid token specified: "+e.message)}}v.prototype=new Error,v.prototype.name="InvalidTokenError";var $="/v1/auth/accesskey/exchange",y="/v1/auth/otp/verify",b="/v1/auth/otp/signin",w="/v1/auth/otp/signup",E={email:"/v1/auth/otp/update/email",phone:"/v1/auth/otp/update/phone"},C="/v1/auth/otp/signup-in",k="/v1/auth/magiclink/verify",O="/v1/auth/magiclink/signin",x="/v1/auth/magiclink/signup",S={email:"/v1/auth/magiclink/update/email",phone:"/v1/auth/magiclink/update/phone"},I="/v1/auth/magiclink/signup-in",R="/v1/auth/enchantedlink/verify",j="/v1/auth/enchantedlink/signin",N="/v1/auth/enchantedlink/signup",M="/v1/auth/enchantedlink/pending-session",A={email:"/v1/auth/enchantedlink/update/email"},P="/v1/auth/enchantedlink/signup-in",T="/v1/auth/oauth/authorize",D="/v1/auth/oauth/exchange",_="v1/auth/oauth/native/start",L="v1/auth/oauth/native/finish",W="/v1/auth/saml/authorize",U="/v1/auth/saml/exchange",F="/v1/auth/totp/verify",V="/v1/auth/totp/signup",q="/v1/auth/totp/update",B={start:"/v1/auth/webauthn/signup/start",finish:"/v1/auth/webauthn/signup/finish"},K={start:"/v1/auth/webauthn/signin/start",finish:"/v1/auth/webauthn/signin/finish"},z={start:"/v1/auth/webauthn/signup-in/start"},H={start:"v1/auth/webauthn/update/start",finish:"/v1/auth/webauthn/update/finish"},G="/v1/auth/password/signup",J="/v1/auth/password/signin",Z="/v1/auth/password/reset",X="/v1/auth/password/update",Y="/v1/auth/password/replace",Q="/v1/auth/password/policy",ee="/v1/auth/refresh",te="/v1/auth/tenant/select",ne="/v1/auth/logout",re="/v1/auth/logoutall",oe="/v1/auth/me",ie="/v1/auth/me/history",se="/v1/flow/start",ae="/v1/flow/next";const de="<region>",le=`https://api.${de}descope.com`,ce=6e5,ue=()=>{const e={};return{headers(t){const n="function"==typeof t.entries?Object.fromEntries(t.entries()):t;return e.Headers=JSON.stringify(n),this},body(t){return e.Body=t,this},url(t){return e.Url=t.toString(),this},method(t){return e.Method=t,this},title(t){return e.Title=t,this},status(t){return e.Status=t,this},build:()=>Object.keys(e).flatMap((t=>e[t]?[`${"Title"!==t?`${t}: `:""}${e[t]}`]:[])).join("\n")}};var he;!function(e){e.get="GET",e.delete="DELETE",e.post="POST",e.put="PUT"}(he||(he={}));const fe=(...e)=>new Headers(e.reduce(((e,t)=>{const n=(e=>Array.isArray(e)?e:e instanceof Headers?Array.from(e.entries()):e?Object.entries(e):[])(t);return n.reduce(((t,[n,r])=>(e[n]=r,e)),e),e}),{})),pe=e=>void 0===e?void 0:JSON.stringify(e),ge=(e,t="")=>{let n=e;return t&&(n=n+":"+t),{Authorization:`Bearer ${n}`}},ve=({baseUrl:e,projectId:t,baseConfig:n,logger:r,hooks:o,cookiePolicy:i,fetch:s})=>{const a=((e,t)=>{const n=(e=>async(...t)=>{const n=await e(...t),r=await n.text();return n.text=()=>Promise.resolve(r),n.json=()=>Promise.resolve(JSON.parse(r)),n.clone=()=>n,n})(t||fetch);return n||null==e||e.warn("Fetch is not defined, you will not be able to send http requests, if you are running in a test, make sure fetch is defined globally"),e?async(...t)=>{if(!n)throw Error("Cannot send http request, fetch is not defined, if you are running in a test, make sure fetch is defined globally");e.log((e=>ue().title("Request").url(e[0]).method(e[1].method).headers(e[1].headers).body(e[1].body).build())(t));const r=await n(...t);return e[r.ok?"log":"error"](await(async e=>{const t=await e.text();return ue().title("Response").url(e.url.toString()).status(`${e.status} ${e.statusText}`).headers(e.headers).body(t).build()})(r)),r}:n})(r,s),d=async r=>{const s=(null==o?void 0:o.beforeRequest)?o.beforeRequest(r):r,{path:d,body:l,headers:c,queryParams:u,method:h,token:f}=s,p={headers:fe(ge(t,f),{"x-descope-sdk-name":"core-js","x-descope-sdk-version":"2.11.15"},(null==n?void 0:n.baseHeaders)||{},c),method:h,body:pe(l)};null!==i&&(p.credentials=i||"include");const g=await a((({path:e,baseUrl:t,queryParams:n,projectId:r})=>{const o=r.slice(1,-27);t=t.replace(de,o?o+".":"");const i=new URL(e,t);return n&&(i.search=new URLSearchParams(n).toString()),i})({path:d,baseUrl:e,queryParams:u,projectId:t}),p);return(null==o?void 0:o.afterRequest)&&await o.afterRequest(r,null==g?void 0:g.clone()),g};return{get:(e,{headers:t,queryParams:n,token:r}={})=>d({path:e,headers:t,queryParams:n,body:void 0,method:he.get,token:r}),post:(e,t,{headers:n,queryParams:r,token:o}={})=>d({path:e,headers:n,queryParams:r,body:t,method:he.post,token:o}),put:(e,t,{headers:n,queryParams:r,token:o}={})=>d({path:e,headers:n,queryParams:r,body:t,method:he.put,token:o}),delete:(e,{headers:t,queryParams:n,token:r}={})=>d({path:e,headers:t,queryParams:n,body:void 0,method:he.delete,token:r}),hooks:o}};var me=429;function $e(e,t,n){var r;let o=ye(e);t&&(o=null===(r=null==o?void 0:o.tenants)||void 0===r?void 0:r[t]);const i=null==o?void 0:o[n];return Array.isArray(i)?i:[]}function ye(e){if("string"!=typeof e||!e)throw new Error("Invalid token provided");return m(e)}function be(e){const{exp:t}=ye(e);return(new Date).getTime()/1e3>t}function we(e){let t=ye(e);const n=Object.keys(null==t?void 0:t.tenants);return Array.isArray(n)?n:[]}function Ee(e,t){return $e(e,t,"permissions")}function Ce(e,t){return $e(e,t,"roles")}const ke=(...e)=>e.join("/").replace(/\/{2,}/g,"/");async function Oe(e,t){var n;const r=await e,o={code:r.status,ok:r.ok,response:r},i=await r.clone().json();return r.ok?o.data=t?t(i):i:(o.error=i,r.status===me&&Object.assign(o.error,{retryAfter:Number.parseInt(null===(n=r.headers)||void 0===n?void 0:n.get("retry-after"))||0})),o}const xe=(e,t)=>(n=t)=>t=>!e(t)&&n.replace("{val}",t),Se=(...e)=>({validate:t=>(e.forEach((e=>{const n=e(t);if(n)throw new Error(n)})),!0)}),Ie=e=>t=>e.test(t),Re=Ie(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/),je=Ie(/^\+[1-9]{1}[0-9]{3,14}$/),Ne=xe(Re,'"{val}" is not a valid email'),Me=xe(je,'"{val}" is not a valid phone number'),Ae=xe((1,e=>e.length>=1),"Minimum length is 1");const Pe=xe((e=>"string"==typeof e),"Input is not a string"),Te=xe((e=>void 0===e),"Input is defined"),De=(_e=[Pe(),Te()],"Input is not a string or undefined",(e="Input is not a string or undefined")=>t=>{const n=_e.filter((e=>e(t)));return!(n.length<_e.length)&&(e?e.replace("{val}",t):n.join(" OR "))});var _e;const Le=(...e)=>t=>(...n)=>(e.forEach(((e,t)=>Se(...e).validate(n[t]))),t(...n)),We=e=>[Pe(`"${e}" must be a string`),Ae(`"${e}" must not be empty`)],Ue=e=>[Pe(`"${e}" must be a string`),Ne()],Fe=e=>[Pe(`"${e}" must be a string`),Me()],Ve=Le(We("accessKey")),qe=e=>({exchange:Ve(((t,n)=>Oe(e.post($,{loginOptions:n},{token:t}))))});var Be,Ke;!function(e){e.sms="sms",e.whatsapp="whatsapp"}(Be||(Be={})),function(e){e.email="email"}(Ke||(Ke={}));const ze=Object.assign(Object.assign({},Be),Ke);var He;!function(e){e.waiting="waiting",e.running="running",e.completed="completed",e.failed="failed"}(He||(He={}));const Ge=We("loginId"),Je=Le(We("token")),Ze=Le(Ge),Xe=Le(We("pendingRef")),Ye=Le(Ge,Ue("email")),Qe=e=>({verify:Je((t=>Oe(e.post(R,{token:t})))),signIn:Ze(((t,n,r,o)=>Oe(e.post(ke(j,ze.email),{loginId:t,URI:n,loginOptions:r},{token:o})))),signUpOrIn:Ze(((t,n,r)=>Oe(e.post(ke(P,ze.email),{loginId:t,URI:n,loginOptions:r})))),signUp:Ze(((t,n,r,o)=>Oe(e.post(ke(N,ze.email),{loginId:t,URI:n,user:r,loginOptions:o})))),waitForSession:Xe(((t,n)=>new Promise((r=>{const{pollingIntervalMs:o,timeoutMs:i}=(({pollingIntervalMs:e=1e3,timeoutMs:t=6e5}={})=>({pollingIntervalMs:Math.max(e||1e3,1e3),timeoutMs:Math.min(t||ce,ce)}))(n);let s;const a=setInterval((async()=>{const n=await e.post(M,{pendingRef:t});n.ok&&(clearInterval(a),s&&clearTimeout(s),r(Oe(Promise.resolve(n))))}),o);s=setTimeout((()=>{r({error:{errorDescription:`Session polling timeout exceeded: ${i}ms`,errorCode:"0"},ok:!1}),clearInterval(a)}),i)})))),update:{email:Ye(((t,n,r,o,i)=>Oe(e.post(A.email,Object.assign({loginId:t,email:n,URI:r},i),{token:o}))))}}),et=Le(We("flowId")),tt=Le(We("executionId"),We("stepId"),We("interactionId")),nt=e=>({start:et(((t,n,r,o,i,s,a)=>Oe(e.post(se,{flowId:t,options:n,conditionInteractionId:r,interactionId:o,version:i,componentsVersion:s,input:a})))),next:tt(((t,n,r,o,i,s)=>Oe(e.post(ae,{executionId:t,stepId:n,interactionId:r,version:o,componentsVersion:i,input:s}))))}),rt=We("loginId"),ot=Le(We("token")),it=Le(rt),st=Le(rt,Fe("phone")),at=Le(rt,Ue("email")),dt=e=>({verify:ot((t=>Oe(e.post(k,{token:t})))),signIn:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r,o,i)=>Oe(e.post(ke(O,n),{loginId:t,URI:r,loginOptions:o},{token:i}))))})),{}),signUp:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r,o,i)=>Oe(e.post(ke(x,n),{loginId:t,URI:r,user:o,loginOptions:i}))))})),{}),signUpOrIn:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:it(((t,r,o)=>Oe(e.post(ke(I,n),{loginId:t,URI:r,loginOptions:o}))))})),{}),update:{email:at(((t,n,r,o,i)=>Oe(e.post(S.email,Object.assign({loginId:t,email:n,URI:r},i),{token:o})))),phone:Object.keys(Be).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:st(((t,r,o,i,s)=>Oe(e.post(ke(S.phone,n),Object.assign({loginId:t,phone:r,URI:o},s),{token:i}))))})),{})}});var lt;!function(e){e.facebook="facebook",e.github="github",e.google="google",e.microsoft="microsoft",e.gitlab="gitlab",e.apple="apple",e.discord="discord",e.linkedin="linkedin",e.slack="slack"}(lt||(lt={}));const ct=Le(We("code")),ut=e=>({start:Object.assign(((t,n,r,o)=>Oe(e.post(T,r||{},{queryParams:Object.assign({provider:t},n&&{redirectURL:n}),token:o}))),Object.keys(lt).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:(t,r,o)=>Oe(e.post(T,r||{},{queryParams:Object.assign({provider:n},t&&{redirectURL:t}),token:o}))})),{})),exchange:ct((t=>Oe(e.post(D,{code:t})))),startNative:(t,n)=>Oe(e.post(_,{provider:t,loginOptions:n})),finishNative:(t,n,r,o,i)=>Oe(e.post(L,{provider:t,stateId:n,user:r,code:o,idToken:i}))}),ht=We("loginId"),ft=Le(ht,We("code")),pt=Le(ht),gt=Le(ht,Fe("phone")),vt=Le(ht,Ue("email")),mt=e=>({verify:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:ft(((t,r)=>Oe(e.post(ke(y,n),{code:r,loginId:t}))))})),{}),signIn:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:pt(((t,r,o)=>Oe(e.post(ke(b,n),{loginId:t,loginOptions:r},{token:o}))))})),{}),signUp:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:pt(((t,r,o)=>Oe(e.post(ke(w,n),{loginId:t,user:r,loginOptions:o}))))})),{}),signUpOrIn:Object.keys(ze).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:pt(((t,r)=>Oe(e.post(ke(C,n),{loginId:t,loginOptions:r}))))})),{}),update:{email:vt(((t,n,r,o)=>Oe(e.post(E.email,Object.assign({loginId:t,email:n},o),{token:r})))),phone:Object.keys(Be).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:gt(((t,r,o,i)=>Oe(e.post(ke(E.phone,n),Object.assign({loginId:t,phone:r},i),{token:o}))))})),{})}}),$t=Le(We("tenant")),yt=Le(We("code")),bt=e=>({start:$t(((t,n,r,o)=>Oe(e.post(W,r||{},{queryParams:{tenant:t,redirectURL:n},token:o})))),exchange:yt((t=>Oe(e.post(U,{code:t}))))}),wt=We("loginId"),Et=Le(wt,We("code")),Ct=Le(wt),kt=Le(wt),Ot=e=>({signUp:Ct(((t,n)=>Oe(e.post(V,{loginId:t,user:n})))),verify:Et(((t,n,r,o)=>Oe(e.post(F,{loginId:t,code:n,loginOptions:r},{token:o})))),update:kt(((t,n)=>Oe(e.post(q,{loginId:t},{token:n}))))}),xt=We("loginId"),St=We("newPassword"),It=Le(xt,We("password")),Rt=Le(xt),jt=Le(xt,St),Nt=Le(xt,We("oldPassword"),St),Mt=e=>({signUp:It(((t,n,r)=>Oe(e.post(G,{loginId:t,password:n,user:r})))),signIn:It(((t,n)=>Oe(e.post(J,{loginId:t,password:n})))),sendReset:Rt(((t,n,r)=>Oe(e.post(Z,{loginId:t,redirectUrl:n,templateOptions:r})))),update:jt(((t,n,r)=>Oe(e.post(X,{loginId:t,newPassword:n},{token:r})))),replace:Nt(((t,n,r)=>Oe(e.post(Y,{loginId:t,oldPassword:n,newPassword:r})))),policy:()=>Oe(e.get(Q))}),At=[Pe('"loginId" must be a string')],Pt=We("loginId"),Tt=We("origin"),Dt=Le(Pt,Tt,We("name")),_t=Le(Pt,Tt),Lt=Le(At,Tt),Wt=Le(Pt,Tt,We("token")),Ut=Le(We("transactionId"),We("response")),Ft=e=>({signUp:{start:Dt(((t,n,r)=>Oe(e.post(B.start,{user:{loginId:t,name:r},origin:n})))),finish:Ut(((t,n)=>Oe(e.post(B.finish,{transactionId:t,response:n}))))},signIn:{start:Lt(((t,n,r,o)=>Oe(e.post(K.start,{loginId:t,origin:n,loginOptions:r},{token:o})))),finish:Ut(((t,n)=>Oe(e.post(K.finish,{transactionId:t,response:n}))))},signUpOrIn:{start:_t(((t,n)=>Oe(e.post(z.start,{loginId:t,origin:n}))))},update:{start:Wt(((t,n,r)=>Oe(e.post(H.start,{loginId:t,origin:n},{token:r})))),finish:Ut(((t,n)=>Oe(e.post(H.finish,{transactionId:t,response:n}))))}}),Vt=Le(We("token")),qt=Le([De('"token" must be string or undefined')]);var Bt,Kt=Le([("projectId",Bt=We("projectId"),xe(((e,t)=>n=>Se(...t).validate(((e,t,n)=>{const r=(Array.isArray(t)?t.join("."):String(t)).replace(/\[\\?("|')?(\w|d)+\\?("|')?\]/g,((e,t,n)=>"."+n)).split("."),o=r.length;let i=0,s=e===Object(e)?e:void 0;for(;null!=s&&i<o;)s=s[r[i++]];return i&&i===o&&void 0!==s?s:void 0})(n,e)))("projectId",Bt))())])((e=>(({projectId:e,logger:t,baseUrl:n,hooks:r,cookiePolicy:o,baseHeaders:i={},fetch:s})=>{return a=ve({baseUrl:n||le,projectId:e,logger:t,hooks:r,cookiePolicy:o,baseConfig:{baseHeaders:i},fetch:s}),{accessKey:qe(a),otp:mt(a),magicLink:dt(a),enchantedLink:Qe(a),oauth:ut(a),saml:bt(a),totp:Ot(a),webauthn:Ft(a),password:Mt(a),flow:nt(a),refresh:qt((e=>Oe(a.post(ee,{},{token:e})))),selectTenant:Le([Pe("tenantId")],[De('"token" must be string or undefined')])(((e,t)=>Oe(a.post(te,{tenant:e},{token:t})))),logout:qt((e=>Oe(a.post(ne,{},{token:e})))),logoutAll:qt((e=>Oe(a.post(re,{},{token:e})))),me:qt((e=>Oe(a.get(oe,{token:e})))),history:qt((e=>Oe(a.get(ie,{token:e})))),isJwtExpired:Vt(be),getTenants:Vt(we),getJwtPermissions:Vt(Ee),getJwtRoles:Vt(Ce),httpClient:a};var a})(Object.assign(Object.assign({},e),{hooks:{beforeRequest:t=>{var n;const r=[].concat((null===(n=e.hooks)||void 0===n?void 0:n.beforeRequest)||[]);return null==r?void 0:r.reduce(((e,t)=>t(e)),t)},afterRequest:async(t,n)=>{var r;const o=[].concat((null===(r=e.hooks)||void 0===r?void 0:r.afterRequest)||[]);(await Promise.allSettled(null==o?void 0:o.map((e=>e(t,null==n?void 0:n.clone()))))).forEach((t=>{var n;return"rejected"===t.status&&(null===(n=e.logger)||void 0===n?void 0:n.error(t.reason))}))}}}))));const zt=(e,t,n)=>(t.forEach((t=>{const r=t.split(".");let o=r.shift(),i=e;for(;r.length>0;){if(i=i[o],!o||!i)throw Error(`Invalid path "${t}", "${o}" is missing or has no value`);o=r.shift()}if("function"!=typeof i[o])throw Error(`"${t}" is not a function`);const s=i[o];i[o]=n(s)})),e);var Ht=Object.assign(Kt,{DeliveryMethods:ze});var Gt={default:"endpoint"},Jt="Blocked by CSP",Zt="The endpoint parameter is not a valid URL",Xt="Failed to load the JS script of the agent",Yt="9319";function Qt(e,t){var n,r,o,i,s=[],a=(n=function(e){var t=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([],e,!0);return{current:function(){return t[0]},postpone:function(){var e=t.shift();void 0!==e&&t.push(e)},exclude:function(){t.shift()}}}(e),100,3e3,i=0,r=function(){return Math.random()*Math.min(3e3,100*Math.pow(2,i++))},o=new Set,[n.current(),function(e,t){var i,s=t instanceof Error?t.message:"";if(s===Jt||s===Zt)n.exclude(),i=0;else if(s===Yt)n.exclude();else if(s===Xt){var a=Date.now()-e.getTime()<50,d=n.current();d&&a&&!o.has(d)&&(o.add(d),i=0),n.postpone()}else n.postpone();var l=n.current();return void 0===l?void 0:[l,null!=i?i:e.getTime()+r()-Date.now()]}]),d=a[0],l=a[1];if(void 0===d)return Promise.reject(new TypeError("The list of script URL patterns is empty"));var c=function(e){var n=new Date,r=function(t){return s.push({url:e,startedAt:n,finishedAt:new Date,error:t})},o=t(e);return o.then((function(){return r()}),r),o.catch((function(e){if(s.length>=5)throw e;var t=l(n,e);if(!t)throw e;var r,o=t[0],i=t[1];return(r=i,new Promise((function(e){return setTimeout(e,r)}))).then((function(){return c(o)}))}))};return c(d).then((function(e){return[e,s]}))}var en="https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js",tn=en;function nn(e){var t;e.scriptUrlPattern;var n=e.token,r=e.apiKey,o=void 0===r?n:r,i=c(e,["scriptUrlPattern","token","apiKey"]),s=null!==(t=function(e,t){return function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t)?e[t]:void 0}(e,"scriptUrlPattern"))&&void 0!==t?t:en,a=function(){var e=[],t=function(){e.push({time:new Date,state:document.visibilityState})},n=function(e,t,n,r){return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n,r)}}(document,"visibilitychange",t);return t(),[e,n]}(),d=a[0],u=a[1];return Promise.resolve().then((function(){if(!o||"string"!=typeof o)throw new Error("API key required");var e=function(e,t){return(Array.isArray(e)?e:[e]).map((function(e){return function(e,t){var n=encodeURIComponent;return e.replace(/<[^<>]+>/g,(function(e){return"<version>"===e?"3":"<apiKey>"===e?n(t):"<loaderVersion>"===e?n("3.9.0"):e}))}(String(e),t)}))}(s,o);return Qt(e,rn)})).catch((function(e){throw u(),function(e){return e instanceof Error&&e.message===Yt?new Error(Xt):e}(e)})).then((function(e){var t=e[0],n=e[1];return u(),t.load(l(l({},i),{ldi:{attempts:n,visibilityStates:d}}))}))}function rn(e){return function(e,t,n,r){var o,i=document,s="securitypolicyviolation",a=function(t){var n=new URL(e,location.href),r=t.blockedURI;r!==n.href&&r!==n.protocol.slice(0,-1)&&r!==n.origin||(o=t,d())};i.addEventListener(s,a);var d=function(){return i.removeEventListener(s,a)};return Promise.resolve().then(t).then((function(e){return d(),e}),(function(e){return new Promise((function(e){return setTimeout(e)})).then((function(){if(d(),o)return function(){throw new Error(Jt)}();throw e}))}))}(e,(function(){return function(e){return new Promise((function(t,n){if(function(e){if(URL.prototype)try{return new URL(e,location.href),!1}catch(e){if(e instanceof Error&&"TypeError"===e.name)return!0;throw e}}(e))throw new Error(Zt);var r=document.createElement("script"),o=function(){var e;return null===(e=r.parentNode)||void 0===e?void 0:e.removeChild(r)},i=document.head||document.getElementsByTagName("head")[0];r.onload=function(){o(),t()},r.onerror=function(){o(),n(new Error(Xt))},r.async=!0,r.src=e,i.appendChild(r)}))}(e)})).then(on)}function on(){var e=window,t="__fpjs_p_l_b",n=e[t];if(function(e,t){var n,r=null===(n=Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,t);(null==r?void 0:r.configurable)?delete e[t]:r&&!r.writable||(e[t]=void 0)}(e,t),"function"!=typeof(null==n?void 0:n.load))throw new Error(Yt);return n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var an={exports:{}};
|
|
2
|
+
/*! js-cookie v3.0.5 | MIT */!function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function t(n,r){function o(t,o,i){if("undefined"!=typeof document){"number"==typeof(i=e({},r,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in i)i[a]&&(s+="; "+a,!0!==i[a]&&(s+="="+i[a].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+s}}function i(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},o=0;o<t.length;o++){var i=t[o].split("="),s=i.slice(1).join("=");try{var a=decodeURIComponent(i[0]);if(r[a]=n.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}}return Object.create({set:o,get:i,remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}return t({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()}(an);var dn=sn(an.exports);const ln=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,r)=>{var o;return n[r]=[].concat((null===(o=e.hooks)||void 0===o?void 0:o[r])||[]).concat((null==t?void 0:t[r])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},cn=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json());return(null==t?void 0:t.authInfo)||t||{}},un=async e=>{const t=await cn(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)},hn="undefined"!=typeof localStorage,fn=(e,t)=>hn&&(null===localStorage||void 0===localStorage?void 0:localStorage.setItem(e,t)),pn=e=>hn&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem(e)),gn=e=>hn&&(null===localStorage||void 0===localStorage?void 0:localStorage.removeItem(e)),vn=(...e)=>{console.debug(...e)},mn="undefined"!=typeof window,$n=Math.pow(2,31)-1,yn=mn&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://api.descope.com",bn="fp",wn=(e=!1)=>{const t=localStorage.getItem(bn);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},En=async(e,t=yn)=>{try{if(wn())return;const n=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),r=new URL(t);r.pathname="/fXj8gt3x8VulJBna/x96Emn69oZwcd7I6";const o=new URL(t);o.pathname="/fXj8gt3x8VulJBna/w78aRZnnDZ3Aqw0I";const i=o.toString()+"?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>",s=nn({apiKey:e,endpoint:[r.toString(),Gt],scriptUrlPattern:[i,tn]}),a=await s,{requestId:d}=await a.get({linkedId:n}),l=((e,t)=>({vsid:e,vrid:t}))(n,d);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};localStorage.setItem(bn,JSON.stringify(t))})(l)}catch(e){console.warn("Could not load fingerprint",e)}},Cn=e=>{const t=wn(!0);return t&&e.body&&(e.body.fpData=t),e},kn="dls_last_user_login_id",On="dls_last_user_display_name",xn=()=>pn(kn),Sn=()=>pn(On),In=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,r={}]=t,o=xn(),i=Sn();return o&&(null!==(n=r.lastAuth)&&void 0!==n||(r.lastAuth={}),r.lastAuth.loginId=o,r.lastAuth.name=i),await e(...t)},Rn=e=>async(...t)=>{const n=await e(...t);return gn(kn),gn(On),n};function jn(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const Nn="DS",Mn="DSR";function An(e=""){return pn(`${e}${Mn}`)||""}function Pn(e=""){gn(`${e}${Mn}`),gn(`${e}${Nn}`),dn.remove(Nn)}async function Tn(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=Fn(n.publicKey.challenge),n.publicKey.user.id=Fn(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=Fn(e.id)})),n}(e);return n=await navigator.credentials.create(t),JSON.stringify({id:n.id,rawId:Vn(n.rawId),type:n.type,response:{attestationObject:Vn(n.response.attestationObject),clientDataJSON:Vn(n.response.clientDataJSON)}});var n}async function Dn(e){const t=Wn(e);return Un(await navigator.credentials.get(t))}async function _n(e,t){const n=Wn(e);return n.signal=t.signal,n.mediation="conditional",Un(await navigator.credentials.get(n))}async function Ln(e=!1){if(!mn)return Promise.resolve(!1);const t=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return t&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():t}function Wn(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=Fn(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=Fn(e.id)})),n}function Un(e){return JSON.stringify({id:e.id,rawId:Vn(e.rawId),type:e.type,response:{authenticatorData:Vn(e.response.authenticatorData),clientDataJSON:Vn(e.response.clientDataJSON),signature:Vn(e.response.signature),userHandle:e.response.userHandle?Vn(e.response.userHandle):void 0}})}function Fn(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function Vn(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var qn,Bn=(qn=e=>({async signUp(t,n){const r=await e.webauthn.signUp.start(t,window.location.origin,n);if(!r.ok)return r;const o=await Tn(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,o)},async signIn(t){const n=await e.webauthn.signIn.start(t,window.location.origin);if(!n.ok)return n;const r=await Dn(n.data.options);return await e.webauthn.signIn.finish(n.data.transactionId,r)},async signUpOrIn(t){var n;const r=await e.webauthn.signUpOrIn.start(t,window.location.origin);if(!r.ok)return r;if(null===(n=r.data)||void 0===n?void 0:n.create){const t=await Tn(r.data.options);return await e.webauthn.signUp.finish(r.data.transactionId,t)}{const t=await Dn(r.data.options);return await e.webauthn.signIn.finish(r.data.transactionId,t)}},async update(t,n){const r=await e.webauthn.update.start(t,window.location.origin,n);if(!r.ok)return r;const o=await Tn(r.data.options);return await e.webauthn.update.finish(r.data.transactionId,o)},helpers:{create:Tn,get:Dn,isSupported:Ln,conditional:_n}}),(...e)=>{const t=qn(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});const Kn=e=>({async oneTap(t,n,r,o){const i=null!=t?t:"google",s=await e.oauth.startNative(i,r);if(!s.ok)return s;const{clientId:a,stateId:d,nonce:l}=s.data,c=await async function(){return new Promise(((e,t)=>{if(window.google)return void e(window.google.accounts.id);let n=document.getElementById("google-gsi-client-script");n||(n=document.createElement("script"),document.head.appendChild(n),n.async=!0,n.defer=!0,n.id="google-gsi-client-script",n.src="https://accounts.google.com/gsi/client"),n.onload=function(){window.google?e(window.google.accounts.id):t("Failed to load Google GSI client script - not loaded properly")},n.onerror=function(){t("Failed to load Google GSI client script - failed to load")}}))}();return new Promise((t=>{var r,s;c.initialize(Object.assign(Object.assign({},n),{itp_support:null===(r=null==n?void 0:n.itp_support)||void 0===r||r,use_fedcm_for_prompt:null===(s=null==n?void 0:n.use_fedcm_for_prompt)||void 0===s||s,client_id:a,callback:n=>{t(e.oauth.finishNative(i,d,"","",n.credential))},nonce:l})),c.prompt((e=>{(null==e?void 0:e.isSkippedMoment())&&(null==o||o())}))}))}});var zn=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await Ln(),r=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=r,e.flow.start(...t)}});const Hn=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((e=>t=>{var{fpKey:n,fpLoad:r}=t,o=c(t,["fpKey","fpLoad"]);return mn?(n&&r&&En(n).catch((()=>null)),e(ln(o,{beforeRequest:Cn}))):(console.warn("Fingerprint is a client side only capability and will not work when running in the server"),e(o))}),(e=>t=>{var{autoRefresh:n}=t,r=c(t,["autoRefresh"]);if(!n)return e(r);const{clearAllTimers:o,setTimer:i}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let s,a;document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&new Date>s&&(vn("Expiration time passed, refreshing session"),d.refresh(a))}));const d=e(ln(r,{afterRequest:async(e,t)=>{const{refreshJwt:n,sessionJwt:r}=await cn(t);if(401===(null==t?void 0:t.status))vn("Received 401, canceling all timers"),o();else if(r){s=(e=>{const t=e.split(".");try{if(3===t.length){const e=JSON.parse(window.atob(t[1]));if(e.exp)return new Date(1e3*e.exp)}}catch(e){}return null})(r),a=n;let e=((l=s)?l.getTime()-(new Date).getTime():0)-2e4;e>$n&&(vn(`Timeout is too large (${e}ms), setting it to ${$n}ms`),e=$n),o();const t=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});vn(`Setting refresh timer for ${t}. (${e}ms)`),i((()=>{vn("Refreshing session due to timer"),d.refresh(n)}),e)}var l}}));return zt(d,["logout","logoutAll"],(e=>async(...t)=>{const n=await e(...t);return vn("Clearing all timers"),o(),n}))}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.10.21"},t.baseHeaders)}))),(e=>t=>{const n=jn(),r=jn(),o=e(ln(t,{afterRequest:async(e,t)=>{if(401===(null==t?void 0:t.status))n.pub(null),r.pub(null);else{const e=await un(t);e&&r.pub(e);const{sessionJwt:o}=await cn(t);o&&n.pub(o)}}})),i=zt(o,["logout","logoutAll"],(e=>async(...t)=>{const o=await e(...t);return n.pub(null),r.pub(null),o}));return Object.assign(i,{onSessionTokenChange:n.sub,onUserChange:r.sub})}),(e=>t=>{const n=e(ln(t,{afterRequest:async(e,t)=>{var n;const r=await un(t),o=null===(n=null==r?void 0:r.loginIds)||void 0===n?void 0:n[0],i=null==r?void 0:r.name;o&&((e=>{fn(kn,e)})(o),(e=>{fn(On,e)})(i))}}));let r=zt(n,["flow.start"],In);return r=zt(r,["logout","logoutAll"],Rn),Object.assign(r,{getLastUserLoginId:xn,getLastUserDisplayName:Sn})}),(e=>t=>{var{persistTokens:n,sessionTokenViaCookie:r,storagePrefix:o}=t,i=c(t,["persistTokens","sessionTokenViaCookie","storagePrefix"]);if(!n||!mn)return n&&console.warn("Storing auth tokens in local storage and cookies are a client side only capabilities and will not be done when running in the server"),e(i);const s=e(ln(i,{beforeRequest:(a=o,e=>Object.assign(e,{token:e.token||An(a)})),afterRequest:async(e,t)=>{401===(null==t?void 0:t.status)?Pn(o):((e={},t,n)=>{var{refreshJwt:r,sessionJwt:o}=e,i=c(e,["refreshJwt","sessionJwt"]);void 0===t&&(t=!1),void 0===n&&(n=""),r&&fn(`${n}${Mn}`,r),o&&(t?function(e,t,{cookiePath:n,cookieDomain:r,cookieExpiration:o}){if(t){const i=new Date(1e3*o),s=function(e){const t=window.location.hostname.split("."),n=e.split(".");return t.slice(-n.length).join(".")===e}(r);dn.set(e,t,{path:n,domain:s?r:void 0,expires:i,sameSite:"Strict",secure:!0})}}(Nn,o,i):fn(`${n}${Nn}`,o))})(await cn(t),r,o)}}));var a;const d=zt(s,["logout","logoutAll"],(e=>t=>async(...n)=>{const r=await t(...n);return Pn(e),r})(o));return Object.assign(d,{getRefreshToken:()=>An(o),getSessionToken:()=>function(e=""){return dn.get(Nn)||pn(`${e}${Nn}`)||""}(o)})}))(((...e)=>{const t=Ht(...e);return Object.assign(Object.assign({},t),{flow:zn(t),webauthn:Bn(t),fedcm:Kn(t)})}));let Gn;const Jn=e=>{const t=Hn(Object.assign(Object.assign({},e),{persistTokens:d,autoRefresh:d}));return Gn=t,t};Gn=Jn({projectId:"temp pid"});const Zn=()=>d?null==Gn?void 0:Gn.getSessionToken():(console.warn("Get session token is not supported in SSR"),""),Xn=()=>d?null==Gn?void 0:Gn.getRefreshToken():(console.warn("Get refresh token is not supported in SSR"),""),Yn=s(((e=Zn(),t)=>null==Gn?void 0:Gn.getJwtPermissions(e,t))),Qn=s(((e=Zn(),t)=>null==Gn?void 0:Gn.getJwtRoles(e,t)));const er=t.lazy((async()=>((await Promise.resolve().then((function(){return li}))).default.sdkConfigOverrides={baseHeaders:a,persistTokens:!1,hooks:{get beforeRequest(){return Gn.httpClient.hooks.beforeRequest},set beforeRequest(e){}}},{default:({projectId:e,flowId:t,baseUrl:n,innerRef:o,tenant:i,theme:s,locale:a,debug:d,redirectUrl:l,client:c,form:u,autoFocus:h})=>r.default.createElement("descope-wc",{"project-id":e,"flow-id":t,"base-url":n,ref:o,tenant:i,theme:s,locale:a,debug:d,client:c,form:u,"redirect-url":l,"auto-focus":h})}))),tr=r.default.forwardRef((({flowId:e,onSuccess:n,onError:i,onReady:s,logger:a,tenant:d,theme:l,locale:c,debug:u,client:h,form:f,telemetryKey:p,redirectUrl:g,autoFocus:v,errorTransformer:m},$)=>{const[y,b]=t.useState(null);t.useImperativeHandle($,(()=>y));const{projectId:w,baseUrl:E,sdk:C}=r.default.useContext(o),k=t.useCallback((async e=>{await C.httpClient.hooks.afterRequest({},new Response(JSON.stringify(e.detail))),n&&n(e)}),[n]);t.useEffect((()=>{const e=y;return null==e||e.addEventListener("success",k),i&&(null==e||e.addEventListener("error",i)),s&&(null==e||e.addEventListener("ready",s)),()=>{i&&(null==e||e.removeEventListener("error",i)),s&&(null==e||e.removeEventListener("ready",s)),null==e||e.removeEventListener("success",k)}}),[y,i,k]),t.useEffect((()=>{const e=y;return null==e||e.addEventListener("success",k),()=>{null==e||e.removeEventListener("success",k)}}),[y,k]),t.useEffect((()=>{const e=y;return i&&(null==e||e.addEventListener("error",i)),()=>{i&&(null==e||e.removeEventListener("error",i))}}),[y,i]),t.useEffect((()=>{const e=y;return s&&(null==e||e.addEventListener("ready",s)),()=>{s&&(null==e||e.removeEventListener("error",s))}}),[y,s]),t.useEffect((()=>{y&&(y.errorTransformer=m)}),[y,m]),t.useEffect((()=>{y&&a&&(y.logger=a)}),[y,a]);const{form:O,client:x}=t.useMemo((()=>({form:JSON.stringify(f||{}),client:JSON.stringify(h||{})})),[f,h]);return r.default.createElement("form",null,r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(er,{projectId:w,flowId:e,baseUrl:E,innerRef:b,tenant:d,theme:l,locale:c,debug:u,form:O,client:x,telemetryKey:p,redirectUrl:g,autoFocus:v})))})),nr=t.lazy((async()=>(await Promise.resolve().then((function(){return ph})),{default:({projectId:e,baseUrl:t,innerRef:n,tenant:o,widgetId:i,theme:s,debug:a})=>r.default.createElement("descope-user-management-widget",{"project-id":e,"widget-id":i,"base-url":t,theme:s,tenant:o,debug:a,ref:n})}))),rr=r.default.forwardRef((({logger:e,tenant:n,theme:i,debug:s,widgetId:a},d)=>{const[l,c]=t.useState(null);t.useImperativeHandle(d,(()=>l));const{projectId:u,baseUrl:h}=r.default.useContext(o);return t.useEffect((()=>{l&&e&&(l.logger=e)}),[l,e]),r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(nr,{projectId:u,widgetId:a,baseUrl:h,innerRef:c,tenant:n,theme:i,debug:s}))})),or=t.lazy((async()=>(await Promise.resolve().then((function(){return Bp})),{default:({projectId:e,baseUrl:t,innerRef:n,tenant:o,widgetId:i,theme:s,debug:a})=>r.default.createElement("descope-role-management-widget",{"project-id":e,"widget-id":i,"base-url":t,theme:s,tenant:o,debug:a,ref:n})}))),ir=r.default.forwardRef((({logger:e,tenant:n,theme:i,debug:s,widgetId:a},d)=>{const[l,c]=t.useState(null);t.useImperativeHandle(d,(()=>l));const{projectId:u,baseUrl:h}=r.default.useContext(o);return t.useEffect((()=>{l&&e&&(l.logger=e)}),[l,e]),r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(or,{projectId:u,widgetId:a,baseUrl:h,innerRef:c,tenant:n,theme:i,debug:s}))})),sr=t.lazy((async()=>(await Promise.resolve().then((function(){return xm})),{default:({projectId:e,baseUrl:t,innerRef:n,tenant:o,widgetId:i,theme:s,debug:a})=>r.default.createElement("descope-access-key-management-widget",{"project-id":e,"widget-id":i,"base-url":t,theme:s,tenant:o,debug:a,ref:n})}))),ar=r.default.forwardRef((({logger:e,tenant:n,theme:i,debug:s,widgetId:a},d)=>{const[l,c]=t.useState(null);t.useImperativeHandle(d,(()=>l));const{projectId:u,baseUrl:h}=r.default.useContext(o);return t.useEffect((()=>{l&&e&&(l.logger=e)}),[l,e]),r.default.createElement(t.Suspense,{fallback:null},r.default.createElement(sr,{projectId:u,widgetId:a,baseUrl:h,innerRef:c,tenant:n,theme:i,debug:s}))}));var dr=()=>{const e=t.useContext(o);if(!e)throw Error("You can only use this hook in the context of <AuthProvider />");return e};const lr=e=>`You can only use this ${e} after sdk initialization. Make sure to supply 'projectId' to <AuthProvider /> component`,cr={get(e,t){if("object"==typeof e[t]&&null!==e[t])return new Proxy(e[t],cr);if("function"==typeof e[t])return()=>{throw Error(lr("function"))};throw Error(lr("attribute"))}},ur="undefined"!=typeof localStorage,hr=ur&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",fr="config.json",pr="base.ui.components.url",gr=ur&&localStorage.getItem(pr)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",vr=ur&&localStorage.getItem(pr)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",mr="descope-login-flow",$r="code",yr="ra-challenge",br="ra-callback",wr="ra-backup-callback",Er="ra-initiator",Cr="data-exclude-field",kr="dls_last_auth",Or="state_id",xr="saml_idp_state_id",Sr="saml_idp_username",Ir="descope_idp_initiated",Rr="sso_app_id",jr="oidc_login_hint",Nr="data-type",Mr="poll",Ar="webauthnCreate",Pr="submit",Tr="polling",Dr=["descope-multi-select-combo-box"];var _r;function Lr(e){return new URLSearchParams(window.location.search).get(e)}function Wr(e){if(window.history.replaceState&&Lr(e)){const t=new URL(window.location.href),n=new URLSearchParams(t.search);n.delete(e),t.search=n.toString(),window.history.replaceState({},"",t.toString())}}function Ur(e,t){return u(this,void 0,void 0,(function*(){const n=yield fetch(e,{cache:"default"});if(!n.ok)throw Error(`Error fetching URL ${e} [${n.status}]`);return{body:yield n[t||"text"](),headers:Object.fromEntries(n.headers.entries())}}))}function Fr(e,t,n="v2-beta"){const r=new URL(hr);return r.pathname=((...e)=>e.join("/").replace(/\/+/g,"/"))(r.pathname,e,n,t),r.toString()}function Vr(e,t){if(!Number.isNaN(e)&&!Number.isNaN(t))return e>t?_r.forward:e<t?_r.backward:void 0}!function(e){e.backward="backward",e.forward="forward"}(_r||(_r={}));const qr=()=>{const[e="",t=""]=(Lr(mr)||"").split("_");return{executionId:e,stepId:t}};function Br(){Wr(mr)}const Kr=e=>e.replace(/-./g,(e=>e[1].toUpperCase())),zr=e=>{let t,n;return(...r)=>{return t&&(i=r,(o=t).length===i.length&&o.every(((e,t)=>e===i[t])))||(t=r,n=e(...r)),n;var o,i}},Hr=(e,t,n,r,o,i)=>e&&!t&&e&&!n&&!r&&e&&!o&&e&&!i,Gr=e=>null==e?void 0:e.submit(),Jr=(e,t)=>{const n=t.find((t=>e[t]));return n?e[n]:null},Zr=(e,t=100)=>{let n;return function(...r){n||e.apply(this,r),clearTimeout(n),n=setTimeout((()=>{n=null}),t)}};var Xr,Yr,Qr,eo;function to(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r+=1){const o=n[r],i=e[o],s=t[o];if(null===i||null===s){if(i!==s)return!1}else if("object"==typeof i&&"object"==typeof s){if(!to(i,s))return!1}else if(i!==s)return!1}return!0}class no{constructor(e={},{updateOnlyOnChange:t=!0}={}){Xr.set(this,void 0),Yr.set(this,{}),Qr.set(this,0),eo.set(this,!1),this.update=e=>{const t="function"==typeof e?e(h(this,Xr,"f")):e,n=Object.assign(Object.assign({},h(this,Xr,"f")),t);if(!h(this,eo,"f")||!to(h(this,Xr,"f"),n)){const e=h(this,Xr,"f");f(this,Xr,n,"f"),Object.freeze(h(this,Xr,"f")),setTimeout((()=>{Object.values(h(this,Yr,"f")).forEach((t=>t(n,e,((e,t)=>n=>e[n]!==t[n])(n,e))))}),0)}},f(this,Xr,e,"f"),f(this,eo,t,"f")}get current(){return Object.assign({},h(this,Xr,"f"))}subscribe(e){return f(this,Qr,h(this,Qr,"f")+1,"f"),h(this,Yr,"f")[h(this,Qr,"f")]=e,h(this,Qr,"f").toString()}unsubscribe(e){const t=!!h(this,Yr,"f")[e];return t&&delete h(this,Yr,"f")[e],t}unsubscribeAll(){return f(this,Yr,{},"f"),!0}}Xr=new WeakMap,Yr=new WeakMap,Qr=new WeakMap,eo=new WeakMap;const ro=(e,t)=>{Object.entries(t||{}).forEach((([t,n])=>{Array.from(e.querySelectorAll(`*[name="${t}"]:not([${Cr}])`)).forEach((e=>{e.value=n}))}))},oo=(e,t)=>e.replace(/{{(.+?)}}/g,((e,n)=>{return r=t,n.split(".").reduce(((e,t)=>(null==e?void 0:e[t])||""),r);var r})),io=zr((()=>u(void 0,void 0,void 0,(function*(){var e,t,n,r;if(!window.PublicKeyCredential||!PublicKeyCredential.isConditionalMediationAvailable||!PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable)return!1;try{const o=Promise.all([null===(e=window.PublicKeyCredential)||void 0===e?void 0:e.isConditionalMediationAvailable(),null===(t=window.PublicKeyCredential)||void 0===t?void 0:t.isUserVerifyingPlatformAuthenticatorAvailable()]).then((e=>e.every((e=>!!e)))),i=(()=>{var e;const t=null===(e=null===navigator||void 0===navigator?void 0:navigator.userAgentData)||void 0===e?void 0:e.brands,n=null==t?void 0:t.find((({brand:e,version:t})=>"Chromium"===e&&parseFloat(t)));return n?n.version:0})()>=108;return yield(100,n=o,r=i,new Promise(((e,t)=>{let o=!1;const i=setTimeout((()=>{o=!0,void 0!==r?e(r):t(new Error("Promise timed out after 100 ms"))}),100);n.then((t=>{o||(clearTimeout(i),e(t))})).catch((e=>{o||(clearTimeout(i),t(e))}))})))}catch(e){return console.error("Conditional login check failed",e),!1}})))),so={"lastAuth.loginId":{"not-empty":e=>!!e.loginId,empty:e=>!e.loginId},idpInitiated:{"is-true":e=>!!e.code,"is-false":e=>!e.code},externalToken:{"is-true":e=>!!e.token,"is-false":e=>!e.token},abTestingKey:{"greater-than":(e,t)=>(e.abTestingKey||0)>t,"less-than":(e,t)=>(e.abTestingKey||0)<t}};function ao(e){const t={};if(e)try{Object.assign(t,JSON.parse(localStorage.getItem(kr)))}catch(e){}return t}const lo="dls_ab_testing_id",co=document.createElement("template");var uo,ho,fo,po,go,vo,mo,$o,yo,bo,wo,Eo,Co,ko,Oo,xo,So,Io,Ro,jo,No,Mo,Ao,Po,To,Do,_o,Lo,Wo,Uo,Fo,Vo,qo,Bo,Ko,zo,Ho,Go,Jo,Zo,Xo,Yo,Qo,ei,ti,ni,ri,oi,ii,si;co.innerHTML='\n\t<style>\n\t\t:host {\n all: initial;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t}\n\n\t\t#wc-root {\n\t\t\theight: 100%;\n\t\t\ttransition: opacity 300ms ease-in-out;\n\t\t}\n\n\t\t#wc-root[data-theme] {\n\t\t\tbackground-color: transparent;\n\t\t}\n\n\t\t.fade-out {\n\t\t\topacity: 0.1;\n\t\t}\n\n\t</style>\n\t<div id="wc-root"></div>\n\t';class ai extends HTMLElement{static get observedAttributes(){return["project-id","flow-id","base-url","tenant","theme","locale","debug","storage-prefix","preview","redirect-url","auto-focus"]}constructor(e){super(),uo.add(this),this.logger=console,ho.set(this,!1),this.loggerWrapper={error:(e,t="")=>{this.logger.error(e,t,new Error),h(this,uo,"m",Wo).call(this,e,t)},warn:(e,t="")=>{this.logger.warn(e,t)},info:(e,t="",n={})=>{this.logger.info(e,t,n)}},fo.set(this,new no({deferredRedirect:!1})),po.set(this,new no),go.set(this,{}),this.getComponentsContext=()=>h(this,go,"f"),this.nextRequestStatus=new no({isLoading:!1}),vo.set(this,void 0),mo.set(this,{popstate:h(this,uo,"m",Co).bind(this),visibilitychange:h(this,uo,"m",ko).bind(this),componentsContext:h(this,uo,"m",To).bind(this)}),$o.set(this,void 0),Ro.set(this,zr((()=>u(this,void 0,void 0,(function*(){const e=Fr(this.projectId,fr);try{const{body:t,headers:n}=yield Ur(e,"json");return{projectConfig:t,executionContext:{geo:n["x-geo"]}}}catch(e){return{isMissingConfig:!0}}}))))),No.set(this,void 0),f(this,$o,e,"f"),h(this,uo,"m",yo).call(this)}get projectId(){return this.getAttribute("project-id")}get flowId(){return this.getAttribute("flow-id")}get form(){try{const e=JSON.parse(this.getAttribute("form"))||{};return Object.entries(e).reduce(((e,[t,n])=>Object.assign(Object.assign({},e),{[`form.${t}`]:n})),e)}catch(e){return{}}}get client(){try{return JSON.parse(this.getAttribute("client"))||{}}catch(e){return{}}}get baseUrl(){return this.getAttribute("base-url")||void 0}get tenant(){return this.getAttribute("tenant")||void 0}get redirectUrl(){return this.getAttribute("redirect-url")||void 0}get debug(){return"true"===this.getAttribute("debug")}get locale(){return this.getAttribute("locale")||void 0}get theme(){var e,t;const n=this.getAttribute("theme");return"os"===n?window.matchMedia&&(null===(t=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)"))||void 0===t?void 0:t.matches)?"dark":"light":n||"light"}get autoFocus(){var e;const t=null!==(e=this.getAttribute("auto-focus"))&&void 0!==e?e:"true";return"skipFirstScreen"===t?t:"true"===t}get storagePrefix(){return this.getAttribute("storage-prefix")||""}get preview(){return!!this.getAttribute("preview")}getExecutionContext(){return u(this,void 0,void 0,(function*(){const{executionContext:e}=yield h(this,Ro,"f").call(this);return e}))}getProjectConfig(){return u(this,void 0,void 0,(function*(){const{projectConfig:e}=yield h(this,Ro,"f").call(this);return e}))}getFlowConfig(){var e,t;return u(this,void 0,void 0,(function*(){const n=yield this.getProjectConfig(),r=(null===(e=null==n?void 0:n.flows)||void 0===e?void 0:e[this.flowId])||{};return null!==(t=r.version)&&void 0!==t||(r.version=0),r}))}getTargetLocales(){return u(this,void 0,void 0,(function*(){const e=yield this.getFlowConfig();return((null==e?void 0:e.targetLocales)||[]).map((e=>e.toLowerCase()))}))}connectedCallback(){return u(this,void 0,void 0,(function*(){if(this.shadowRoot.isConnected){if(h(this,po,"f").subscribe(h(this,uo,"m",Lo).bind(this)),h(this,po,"f").update({isDebug:this.debug}),h(this,uo,"m",bo).call(this))return void h(this,uo,"m",wo).call(this);if(h(this,uo,"m",Eo).call(this),f(this,No,h(this,uo,"m",jo).call(this),"f"),yield h(this,uo,"m",So).call(this))return void this.loggerWrapper.error("This SDK version does not support your flows version","Make sure to upgrade your flows to the latest version or use an older SDK version");if((yield h(this,Ro,"f").call(this)).isMissingConfig)return void this.loggerWrapper.error("Cannot get config file","Make sure that your projectId & flowId are correct");h(this,uo,"m",Mo).call(this),yield h(this,uo,"m",Vo).call(this),yield h(this,uo,"m",Ao).call(this),h(this,uo,"m",Uo).call(this);const{executionId:e,stepId:t,token:n,code:r,exchangeError:o,redirectAuthCallbackUrl:i,redirectAuthBackupCallbackUri:s,redirectAuthCodeChallenge:a,redirectAuthInitiator:d,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,descopeIdpInitiated:p,ssoAppId:g,oidcLoginHint:v}=(()=>{const{executionId:e,stepId:t}=qr();(e||t)&&Br();const n=Lr("t")||void 0;n&&Wr("t");const r=Lr($r)||void 0;r&&Wr($r);const o=Lr("err")||void 0;o&&Wr("err");const{redirectAuthCodeChallenge:i,redirectAuthCallbackUrl:s,redirectAuthBackupCallbackUri:a,redirectAuthInitiator:d}={redirectAuthCodeChallenge:Lr(yr),redirectAuthCallbackUrl:Lr(br),redirectAuthBackupCallbackUri:Lr(wr),redirectAuthInitiator:Lr(Er)};(i||s||a||d)&&(Wr(yr),Wr(br),Wr(wr),Wr(Er));const l=Lr(Or);l&&Wr(Or);const c=Lr(xr);c&&Wr(xr);const u=Lr(Sr);c&&Wr(Sr);const h=Lr(Ir);h&&Wr(Ir);const f=Lr(Rr);f&&Wr(Rr);const p=Lr(jr);return p&&Wr(jr),{executionId:e,stepId:t,token:n,code:r,exchangeError:o,redirectAuthCodeChallenge:i,redirectAuthCallbackUrl:s,redirectAuthBackupCallbackUri:a,redirectAuthInitiator:d,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,descopeIdpInitiated:"true"===h,ssoAppId:f,oidcLoginHint:p}})();window.addEventListener("popstate",h(this,mo,"f").popstate),window.addEventListener("components-context",h(this,mo,"f").componentsContext),window.addEventListener("visibilitychange",h(this,mo,"f").visibilitychange),h(this,fo,"f").subscribe(h(this,uo,"m",xo).bind(this)),h(this,fo,"f").update({projectId:this.projectId,flowId:this.flowId,baseUrl:this.baseUrl,tenant:this.tenant,redirectUrl:this.redirectUrl,locale:this.locale,stepId:t,executionId:e,token:n,code:r,exchangeError:o,redirectAuthCallbackUrl:i,redirectAuthBackupCallbackUri:s,redirectAuthCodeChallenge:a,redirectAuthInitiator:d,oidcIdpStateId:l,samlIdpStateId:c,samlIdpUsername:u,descopeIdpInitiated:p,ssoAppId:g,oidcLoginHint:v}),f(this,ho,!0,"f")}}))}disconnectedCallback(){h(this,fo,"f").unsubscribeAll(),h(this,po,"f").unsubscribeAll(),h(this,uo,"m",_o).call(this),window.removeEventListener("popstate",h(this,mo,"f").popstate),window.removeEventListener("visibilitychange",h(this,mo,"f").visibilitychange),window.removeEventListener("components-context",h(this,mo,"f").componentsContext)}attributeChangedCallback(e,t,n){if(this.shadowRoot.isConnected&&h(this,ho,"f")&&t!==n&&ai.observedAttributes.includes(e)){h(this,uo,"m",Eo).call(this);const r=null===t;h(this,fo,"f").update((({stepId:t,executionId:o})=>{let i=t,s=o;return r||(s=null,i=null,Br()),{[Kr(e)]:n,stepId:i,executionId:s}})),h(this,po,"f").update({isDebug:this.debug})}}}ho=new WeakMap,fo=new WeakMap,po=new WeakMap,go=new WeakMap,vo=new WeakMap,mo=new WeakMap,$o=new WeakMap,Ro=new WeakMap,No=new WeakMap,uo=new WeakSet,yo=function(){this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(co.content.cloneNode(!0)),this.rootElement=this.shadowRoot.querySelector("#wc-root")},bo=function(){return!this.shadowRoot.host.closest("form")&&/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)},wo=function(){const e=this.shadowRoot.host,t=document.createElement("form");e.parentElement.appendChild(t),t.appendChild(e)},Eo=function(){const e=["base-url","tenant","theme","locale","debug","redirect-url","auto-focus","preview","storage-prefix","form","client"];if(ai.observedAttributes.forEach((t=>{if(!e.includes(t)&&!this[Kr(t)])throw Error(`${t} cannot be empty`)})),this.theme&&"light"!==this.theme&&"dark"!==this.theme)throw Error('Supported theme values are "light", "dark", or leave empty for using the OS theme')},Co=function(){const{stepId:e,executionId:t}=qr();h(this,fo,"f").update({stepId:e,executionId:t})},ko=function(){document.hidden||setTimeout((()=>{h(this,fo,"f").update({deferredRedirect:!1})}),300)},Oo=function(e,t){this.sdk=Hn(Object.assign(Object.assign({persistTokens:!0,preview:this.preview,storagePrefix:this.storagePrefix},ai.sdkConfigOverrides),{projectId:e,baseUrl:t})),["start","next"].forEach((e=>{const t=this.sdk.flow[e];this.sdk.flow[e]=(...e)=>u(this,void 0,void 0,(function*(){this.nextRequestStatus.update({isLoading:!0});try{return yield t(...e)}finally{this.nextRequestStatus.update({isLoading:!1})}}))}))},xo=function(e,t,n){return u(this,void 0,void 0,(function*(){const{projectId:t,baseUrl:r}=e;if(n("projectId")||n("baseUrl")){if(!t)return;h(this,uo,"m",Oo).call(this,t,r)}h(this,$o,"f").call(this,e)}))},So=function(){return u(this,void 0,void 0,(function*(){return(yield h(this,Ro,"f").call(this)).isMissingConfig&&(yield h(this,uo,"m",Io).call(this))}))},Io=function(){return u(this,void 0,void 0,(function*(){const e=Fr(this.projectId,fr,"v2-alpha");try{return yield Ur(e,"json"),!0}catch(e){return!1}}))},jo=function(){return u(this,void 0,void 0,(function*(){const e=Fr(this.projectId,"theme.json");try{const{body:t}=yield Ur(e,"json");return t}catch(e){return void this.loggerWrapper.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}}))},Mo=function(){var e,t;return u(this,void 0,void 0,(function*(){const{projectConfig:n}=yield h(this,Ro,"f").call(this),r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>(e=>{if(!e)return;const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url)))}))},Ao=function(){return u(this,void 0,void 0,(function*(){yield h(this,uo,"m",Po).call(this),yield h(this,uo,"m",Do).call(this)}))},Po=function(){var e,t,n,r;return u(this,void 0,void 0,(function*(){const o=document.createElement("style"),i=yield h(this,No,"f");o.innerText=((null===(e=null==i?void 0:i.light)||void 0===e?void 0:e.globals)||"")+((null===(t=null==i?void 0:i.dark)||void 0===t?void 0:t.globals)||"");const s=yield ai.descopeUI;(null==s?void 0:s.componentsThemeManager)&&(s.componentsThemeManager.themes={light:null===(n=null==i?void 0:i.light)||void 0===n?void 0:n.components,dark:null===(r=null==i?void 0:i.dark)||void 0===r?void 0:r.components}),this.shadowRoot.appendChild(o)}))},To=function(e){f(this,go,Object.assign(Object.assign({},e.detail),h(this,go,"f")),"f")},Do=function(){return u(this,void 0,void 0,(function*(){this.rootElement.setAttribute("data-theme",this.theme);const e=yield ai.descopeUI;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)}))},_o=function(){var e;null===(e=h(this,vo,"f"))||void 0===e||e.remove(),f(this,vo,null,"f")},Lo=function({isDebug:e}){return u(this,void 0,void 0,(function*(){e?(f(this,vo,document.createElement("descope-debugger"),"f"),Object.assign(h(this,vo,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),yield Promise.resolve().then((function(){return Um})),document.body.appendChild(h(this,vo,"f"))):h(this,uo,"m",_o).call(this)}))},Wo=function(e,t){var n;e&&this.debug&&(null===(n=h(this,vo,"f"))||void 0===n||n.updateData({title:e,description:t}))},Uo=function(){this.rootElement.onkeydown=e=>{var t,n,r;const o=!!(null===(t=this.shadowRoot.activeElement)||void 0===t?void 0:t.getAttribute("href")),i=Dr.includes(null!==(r=null===(n=this.shadowRoot.activeElement)||void 0===n?void 0:n.localName)&&void 0!==r?r:"");if("Enter"!==e.key||o||i)return;e.preventDefault();const s=this.rootElement.querySelectorAll("descope-button");if(1===s.length&&"false"!==s[0].getAttribute("auto-submit"))return void s[0].click();const a=Array.from(s).filter((e=>"true"===e.getAttribute("auto-submit")));if(1===a.length)return void a[0].click();const d=Array.from(s).filter((e=>"button"===e.getAttribute("data-type")));if(1===d.length)"false"!==d[0].getAttribute("auto-submit")&&d[0].click();else if(0===d.length){const e=Array.from(s).filter((e=>"sso"===e.getAttribute("data-type")));1===e.length&&"false"!==e[0].getAttribute("auto-submit")&&e[0].click()}}},Fo=function(){var e,t;return u(this,void 0,void 0,(function*(){return(null===(t=null===(e=yield h(this,Ro,"f").call(this))||void 0===e?void 0:e.projectConfig)||void 0===t?void 0:t.componentsVersion)||(this.logger.error("Did not get components version, using latest version"),"latest")}))},Vo=function(){return u(this,void 0,void 0,(function*(){ai.descopeUI?this.loggerWrapper.info("DescopeUI is already loading, probably multiple flows are running on the same page"):ai.descopeUI=new Promise((e=>{if(globalThis.DescopeUI)return void e(globalThis.DescopeUI);const t=e=>{const t=document.createElement("script");return t.id="load-descope-ui",t.src=e,t},n=(e,t)=>e.replace("<version>",t),r=(t,n)=>{const r=()=>{this.loggerWrapper.error("Cannot load DescopeUI",`Make sure this URL is valid and return the correct script: "${t.src}"`),n()};t.addEventListener("load",(()=>{globalThis.DescopeUI||r(),e(globalThis.DescopeUI)})),t.addEventListener("error",r)};(()=>{u(this,void 0,void 0,(function*(){const o=yield h(this,uo,"m",Fo).call(this),i=t(n(gr,o));r(i,(()=>{i.remove(),this.loggerWrapper.info("Trying to load DescopeUI from a fallback URL");const s=t(n(vr,o));r(s,(()=>{e(void 0)})),document.body.append(s)})),document.body.append(i)}))})()}))}))},ai.sdkConfigOverrides={baseHeaders:{"x-descope-sdk-name":"web-component","x-descope-sdk-version":"3.8.28"}};class di extends ai{static set sdkConfigOverrides(e){ai.sdkConfigOverrides=e}constructor(){const e=new no;super(e.update.bind(e)),qo.add(this),this.stepState=new no({},{updateOnlyOnChange:!1}),Bo.set(this,void 0),Ko.set(this,null),zo.set(this,((e,t,n,r,o)=>{n===Mr&&f(this,Bo,setTimeout((()=>u(this,void 0,void 0,(function*(){var n;const i=yield this.sdk.flow.next(e,t,Tr,r,o,{});h(this,Go,"f").call(this,i);const{action:s}=null!==(n=null==i?void 0:i.data)&&void 0!==n?n:{};h(this,zo,"f").call(this,e,t,s,r,o)}))),2e3),"f")})),Ho.set(this,(()=>{clearTimeout(h(this,Bo,"f")),f(this,Bo,null,"f")})),Go.set(this,(e=>{var t,n,r,o,i,s,a,d,l;if(!(null==e?void 0:e.ok)){h(this,qo,"m",si).call(this,"error",null==e?void 0:e.error);const s=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.url,a=`${null===(n=null==e?void 0:e.response)||void 0===n?void 0:n.status} - ${null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.statusText}`;return void this.loggerWrapper.error((null===(o=null==e?void 0:e.error)||void 0===o?void 0:o.errorDescription)||s,(null===(i=null==e?void 0:e.error)||void 0===i?void 0:i.errorMessage)||a)}const c=null===(d=null===(a=null===(s=e.data)||void 0===s?void 0:s.screen)||void 0===a?void 0:a.state)||void 0===d?void 0:d.errorText;(null===(l=e.data)||void 0===l?void 0:l.error)?this.loggerWrapper.error(`[${e.data.error.code}]: ${e.data.error.description}`,`${c?`${c} - `:""}${e.data.error.message}`):c&&this.loggerWrapper.error(c);const{status:u,authInfo:f,lastAuth:p}=e.data;if("completed"===u)return function(e){(null==e?void 0:e.authMethod)&&ur&&localStorage.setItem(kr,JSON.stringify(e))}(p),void h(this,qo,"m",si).call(this,"success",f);const{executionId:g,stepId:v,stepName:m,action:$,screen:y,redirect:b,webauthn:w,error:E,samlIdpResponse:C}=e.data;$!==Mr?(this.loggerWrapper.info(`Step "${m||`#${v}`}" is ${u}`,"",{screen:y,status:u,stepId:v,stepName:m,action:$,error:E}),this.flowState.update({stepId:v,executionId:g,action:$,redirectTo:null==b?void 0:b.url,screenId:null==y?void 0:y.id,screenState:null==y?void 0:y.state,webauthnTransactionId:null==w?void 0:w.transactionId,webauthnOptions:null==w?void 0:w.options,samlIdpResponseUrl:null==C?void 0:C.url,samlIdpResponseSamlResponse:null==C?void 0:C.samlResponse,samlIdpResponseRelayState:null==C?void 0:C.relayState})):this.flowState.update({action:$})})),Jo.set(this,zr((()=>u(this,void 0,void 0,(function*(){var e;try{const t=yield this.sdk.webauthn.signIn.start("",window.location.origin);return t.ok||this.loggerWrapper.warn("Webauthn start failed",null===(e=null==t?void 0:t.error)||void 0===e?void 0:e.errorMessage),t.data}catch(e){this.loggerWrapper.warn("Webauthn start failed",e.message)}}))))),ni.set(this,Zr(((e,t)=>u(this,void 0,void 0,(function*(){if("true"===e.getAttribute("formnovalidate")||h(this,qo,"m",Yo).call(this)){const r=null==e?void 0:e.getAttribute("id");h(this,qo,"m",ei).call(this,e);const o=yield h(this,qo,"m",Qo).call(this),i=(n=e,Array.from((null==n?void 0:n.attributes)||[]).reduce(((e,t)=>{var n;const r=null===(n=new RegExp("^data-descope-(\\S+)$").exec(t.name))||void 0===n?void 0:n[1];return r?Object.assign(e,{[r]:t.value}):e}),{})),s=this.getComponentsContext(),a=Object.assign(Object.assign(Object.assign(Object.assign({},s),i),o),{origin:window.location.origin}),d=yield this.getFlowConfig(),l=yield this.getProjectConfig(),c=yield t(r,d.version,l.componentsVersion,a);h(this,Go,"f").call(this,c),h(this,qo,"m",ti).call(this,o)}var n}))))),this.flowState=e}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t,n;return u(this,void 0,void 0,(function*(){this.shadowRoot.isConnected&&(null===(t=this.flowState)||void 0===t||t.subscribe(this.onFlowChange.bind(this)),null===(n=this.stepState)||void 0===n||n.subscribe(this.onStepChange.bind(this))),yield e.connectedCallback.call(this)}))}disconnectedCallback(){var e;super.disconnectedCallback(),this.flowState.unsubscribeAll(),this.stepState.unsubscribeAll(),null===(e=h(this,Ko,"f"))||void 0===e||e.abort(),f(this,Ko,null,"f")}getHtmlFilenameWithLocale(e,t){return u(this,void 0,void 0,(function*(){let n,r=navigator.language;r&&"zh-TW"!==r&&(r=r.split("-")[0]);const o=(e||r||"").toLowerCase();return(yield this.getTargetLocales()).includes(o)&&(n=`${t}-${o}.html`),n}))}getPageContent(e,t){return u(this,void 0,void 0,(function*(){if(t)try{const{body:e}=yield Ur(t,"text");return e}catch(n){this.loggerWrapper.error(`Failed to fetch flow page from ${t}. Fallback to url ${e}`,n)}try{const{body:t}=yield Ur(e,"text");return t}catch(e){this.loggerWrapper.error("Failed to fetch flow page",e.message)}return null}))}onFlowChange(e,t,n){var r,o;return u(this,void 0,void 0,(function*(){const{projectId:i,flowId:s,tenant:a,stepId:d,executionId:l,action:c,screenId:u,screenState:p,redirectTo:g,redirectUrl:v,token:m,code:$,exchangeError:y,webauthnTransactionId:b,webauthnOptions:w,redirectAuthCodeChallenge:E,redirectAuthCallbackUrl:C,redirectAuthBackupCallbackUri:k,redirectAuthInitiator:O,oidcIdpStateId:x,locale:S,samlIdpStateId:I,samlIdpUsername:R,descopeIdpInitiated:j,samlIdpResponseUrl:N,samlIdpResponseSamlResponse:M,samlIdpResponseRelayState:A,ssoAppId:P,oidcLoginHint:T}=e;let D,_;const L=(()=>{const e=localStorage.getItem(lo);if(!e){const e=Math.floor(100*Math.random()+1);return localStorage.setItem(lo,e.toString()),e}return Number(e)})(),W=this.sdk.getLastUserLoginId(),U=yield this.getFlowConfig(),F=yield this.getProjectConfig(),V=C&&E?{callbackUrl:C,codeChallenge:E,backupCallbackUri:k}:void 0;if(!l&&(U.fingerprintEnabled&&U.fingerprintKey?yield En(U.fingerprintKey,this.baseUrl):localStorage.removeItem(bn),U.conditions?({startScreenId:D,conditionInteractionId:_}=((e,t)=>{const n=null==t?void 0:t.find((({key:t,operator:n,predicate:r})=>{var o;if("ELSE"===t)return!0;const i=null===(o=so[t])||void 0===o?void 0:o[n];return!!(null==i?void 0:i(e,r))}));return n?{startScreenId:n.met.screenId,conditionInteractionId:n.met.interactionId}:{}})({loginId:W,code:$,token:m,abTestingKey:L},U.conditions)):U.condition?({startScreenId:D,conditionInteractionId:_}=((e,t)=>{var n;const r=null===(n=so[null==e?void 0:e.key])||void 0===n?void 0:n[e.operator];if(!r)return{};const o=r(t,e.predicate)?e.met:e.unmet;return{startScreenId:null==o?void 0:o.screenId,conditionInteractionId:null==o?void 0:o.interactionId}})(U.condition,{loginId:W,code:$,token:m,abTestingKey:L})):D=U.startScreenId,!Hr(D,x,I,R,P,T))){const e=yield this.sdk.flow.start(s,Object.assign(Object.assign({tenant:a,redirectAuth:V,oidcIdpStateId:x,samlIdpStateId:I,samlIdpUsername:R,ssoAppId:P,oidcLoginHint:T,client:this.client},v&&{redirectUrl:v}),{lastAuth:ao(W),abTestingKey:L}),_,"",U.version,F.componentsVersion,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.form),$?{exchangeCode:$,idpInitiated:!0}:{}),j&&{idpInitiated:!0}),m?{token:m}:{}),T?{externalId:T}:{}));return h(this,Go,"f").call(this,e),void("completed"!==(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.status)&&this.flowState.update({code:void 0,token:void 0}))}if(l&&(n("token")&&m||n("code")&&$||n("exchangeError")&&y)){const e=yield this.sdk.flow.next(l,d,Pr,U.version,F.componentsVersion,{token:m,exchangeCode:$,exchangeError:y});return h(this,Go,"f").call(this,e),void this.flowState.update({token:void 0,code:void 0,exchangeError:void 0})}if("loadForm"===c&&["samlIdpResponseUrl","samlIdpResponseSamlResponse","samlIdpResponseRelayState"].some((e=>n(e)))){if(!N||!M)return void this.loggerWrapper.error("Did not get saml idp params data to load");((e,t,n,r)=>{const o=document.createElement("form");o.method="POST",o.action=e,o.innerHTML=`\n <input type="hidden" role="saml-response" name="SAMLResponse" value="${t}" />\n <input type="hidden" role="saml-relay-state" name="RelayState" value="${n}" />\n <input style="display: none;" id="SAMLSubmitButton" type="submit" value="Continue" />\n `,document.body.appendChild(o),r(o)})(N,M,A||"",Gr)}if("redirect"===c&&(n("redirectTo")||n("deferredRedirect")))return g?"android"===O&&document.hidden?void this.flowState.update({deferredRedirect:!0}):void window.location.assign(g):void this.loggerWrapper.error("Did not get redirect url");if(c===Ar||"webauthnGet"===c){if(!b||!w)return void this.loggerWrapper.error("Did not get webauthn transaction id or options");let e,t;null===(o=h(this,Ko,"f"))||void 0===o||o.abort(),f(this,Ko,null,"f");try{e=c===Ar?yield this.sdk.webauthn.helpers.create(w):yield this.sdk.webauthn.helpers.get(w)}catch(i){"InvalidStateError"===i.name?this.loggerWrapper.warn("WebAuthn operation failed",i.message):"NotAllowedError"!==i.name&&this.loggerWrapper.error(i.message),t=i.name}const n=yield this.sdk.flow.next(l,d,Pr,U.version,F.componentsVersion,{transactionId:b,response:e,failure:t});h(this,Go,"f").call(this,n)}if(h(this,zo,"f").call(this,l,d,c,U.version,F.componentsVersion),!u&&!D)return void this.loggerWrapper.warn("No screen was found to show");const q=D||u,B=yield this.getHtmlFilenameWithLocale(S,q),K={direction:Vr(+d,+t.stepId),screenState:Object.assign(Object.assign({},p),{form:Object.assign(Object.assign({},this.form),null==p?void 0:p.form),lastAuth:{loginId:W,name:this.sdk.getLastUserDisplayName()||W}}),htmlUrl:Fr(i,`${q}.html`),htmlLocaleUrl:B&&Fr(i,B),samlIdpUsername:R,oidcLoginHint:T},z=ao(W);Hr(D,x,I,R,P,T)?K.next=(e,t,n,r)=>this.sdk.flow.start(s,Object.assign({tenant:a,redirectAuth:V,oidcIdpStateId:x,samlIdpStateId:I,samlIdpUsername:R,ssoAppId:P,oidcLoginHint:T,lastAuth:z,preview:this.preview,abTestingKey:L,client:this.client},v&&{redirectUrl:v}),_,e,t,n,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},this.form),r),$&&{exchangeCode:$,idpInitiated:!0}),j&&{idpInitiated:!0}),m&&{token:m})):(n("projectId")||n("baseUrl")||n("executionId")||n("stepId"))&&(K.next=(...e)=>this.sdk.flow.next(l,d,...e)),this.stepState.update(K)}))}loadDescopeUiComponents(e){return u(this,void 0,void 0,(function*(){const t=yield ai.descopeUI;if(!t)return;const n=(e=>[...Array.from(e.querySelectorAll("*")).reduce(((e,t)=>t.tagName.startsWith("DESCOPE-")?e.add(t.tagName.toLocaleLowerCase()):e),new Set)])(e);yield Promise.all(n.map((e=>u(this,void 0,void 0,(function*(){if(!customElements.get(e))if(t[e])try{return yield t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`${e} is already registered`)}else this.loggerWrapper.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)})))))}))}onStepChange(e,t){var n,r;return u(this,void 0,void 0,(function*(){const{htmlUrl:o,htmlLocaleUrl:i,direction:s,next:a,screenState:d}=e,l=document.createElement("template");l.innerHTML=yield this.getPageContent(o,i);const c=l.content.cloneNode(!0),f=this.loadDescopeUiComponents(l.content);this.sdk.webauthn.helpers.isSupported()?yield h(this,qo,"m",Xo).call(this,c,a):c.querySelectorAll(`descope-button[${Nr}="biometrics"]`).forEach((e=>e.setAttribute("disabled","true"))),!e.samlIdpUsername||(null===(n=d.form)||void 0===n?void 0:n.loginId)||(null===(r=d.form)||void 0===r?void 0:r.email)||(d.form||(d.form={}),d.form.loginId=e.samlIdpUsername,d.form.email=e.samlIdpUsername),((e,t,n,r,o)=>{var i;let s=null==t?void 0:t.errorText;try{s=(null==r?void 0:r({text:null==t?void 0:t.errorText,type:null==t?void 0:t.errorType}))||(null==t?void 0:t.errorText)}catch(e){o.error("Error transforming error message",e.message)}((e,t,n="")=>{e.querySelectorAll(`[${Nr}="${t}"]`).forEach((e=>{e.textContent=n,e.classList[n?"remove":"add"]("hide")}))})(e,"error-message",s),((e,t)=>{e.querySelectorAll(`[${Nr}="totp-link"]`).forEach((e=>{e.setAttribute("href",t)}))})(e,null===(i=null==t?void 0:t.totp)||void 0===i?void 0:i.provisionUrl),((e,t)=>{e.querySelectorAll("descope-text,descope-link").forEach((e=>{e.textContent=oo(e.textContent,t)}))})(e,t),((e,t,n)=>{t&&Object.keys(t).forEach((r=>{e.querySelectorAll(`[name=${r}]`).forEach((e=>{const o=t[r];Object.keys(o).forEach((t=>{let r=o[t];if("string"!=typeof r)try{r=JSON.stringify(r)}catch(e){n.error(`Could not stringify value "${r}" for "${t}"`,e.message),r=""}e.setAttribute(t,r)}))}))}))})(e,n,o),((e,t)=>{e.querySelectorAll("[data-has-dynamic-attr-values]").forEach((e=>{Array.from(e.attributes).forEach((e=>{e.value=oo(e.value,t)}))}))})(e,t)})(c,d,d.componentsConfig,this.errorTransformer,this.loggerWrapper);const{geo:p}=yield this.getExecutionContext();((e,t)=>{Array.from(e.querySelectorAll('descope-phone-field[default-code="autoDetect"]')).forEach((e=>{e.setAttribute("default-code",t)}))})(c,p);const g=()=>u(this,void 0,void 0,(function*(){var e;yield f,((e,t)=>{var n,r;const o=null===(n=customElements.get("descope-totp-image"))||void 0===n?void 0:n.cssVarList.url;t&&o&&(null===(r=null==e?void 0:e.style)||void 0===r||r.setProperty(o,`url(data:image/jpg;base64,${t})`))})(this.shadowRoot.querySelector("div"),null===(e=null==d?void 0:d.totp)||void 0===e?void 0:e.image),this.rootElement.replaceChildren(c),setTimeout((()=>((e,t)=>{ro(e,null==t?void 0:t.inputs),ro(e,null==t?void 0:t.form)})(this.rootElement,d)));const n=!t.htmlUrl;if(((e,t,n)=>{if(!0===t||"skipFirstScreen"===t&&!n){const t=e.querySelector("*[name]");setTimeout((()=>{null==t||t.focus()}))}})(this.rootElement,this.autoFocus,n),h(this,qo,"m",oi).call(this,a),n&&h(this,qo,"m",si).call(this,"ready",{}),h(this,qo,"m",si).call(this,"page-updated",{}),this.rootElement.querySelector(`[${Nr}="polling"]`)){const e=yield this.getFlowConfig(),t=yield this.getProjectConfig(),n=yield a(Tr,e.version,t.componentsVersion,{});h(this,Go,"f").call(this,n)}}));s?h(this,qo,"m",ii).call(this,g,s):g()}))}}Bo=new WeakMap,Ko=new WeakMap,zo=new WeakMap,Ho=new WeakMap,Go=new WeakMap,Jo=new WeakMap,ni=new WeakMap,qo=new WeakSet,Zo=function(e){const t=e.getAttribute("name");if(!["email"].includes(t)){const n=`user-${t}`;e.setAttribute("name",n),e.addEventListener("input",(()=>{e.setAttribute("name",e.value?t:n)}))}},Xo=function(e,t){var n;return u(this,void 0,void 0,(function*(){null===(n=h(this,Ko,"f"))||void 0===n||n.abort();const r=e.querySelector('*[autocomplete="webauthn"]');if(r&&(yield io())){const{options:e,transactionId:n}=(yield h(this,Jo,"f").call(this))||{};if(e&&n){h(this,qo,"m",Zo).call(this,r),f(this,Ko,new AbortController,"f");const o=yield this.getFlowConfig(),i=yield this.getProjectConfig();this.sdk.webauthn.helpers.conditional(e,h(this,Ko,"f")).then((e=>u(this,void 0,void 0,(function*(){const s=yield t(r.id,o.version,i.componentsVersion,{transactionId:n,response:e});h(this,Go,"f").call(this,s)})))).catch((e=>{"AbortError"!==e.name&&this.loggerWrapper.error("Conditional login failed",e.message)}))}}}))},Yo=function(){return Array.from(this.shadowRoot.querySelectorAll("*[name]")).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))},Qo=function(){return u(this,void 0,void 0,(function*(){const e=Array.from(this.shadowRoot.querySelectorAll(`*[name]:not([${Cr}])`));return(yield Promise.all(e.map((e=>u(this,void 0,void 0,(function*(){return{name:e.getAttribute("name"),value:e.value}})))))).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.name]:t.value})),{})}))},ei=function(e){const t=this.nextRequestStatus.subscribe((({isLoading:n})=>{n?e.setAttribute("loading","true"):(this.nextRequestStatus.unsubscribe(t),e.removeAttribute("loading"))}))},ti=function(e={}){var t,n;const r=Jr(e,["externalId","email","phone"]),o=Jr(e,["newPassword","password"]);if(r&&o)try{const e=new globalThis.PasswordCredential({id:r,password:o});null===(n=null===(t=null===navigator||void 0===navigator?void 0:navigator.credentials)||void 0===t?void 0:t.store)||void 0===n||n.call(t,e)}catch(e){this.loggerWrapper.error("Could not store credentials",e.message)}},ri=function(e){this.rootElement.querySelectorAll('descope-passcode[data-auto-submit="true"]').forEach((t=>{t.addEventListener("input",(()=>{var n;(null===(n=t.checkValidity)||void 0===n?void 0:n.call(t))&&h(this,ni,"f").call(this,t,e)}))}))},oi=function(e){this.rootElement.querySelectorAll("descope-button:not([data-exclude-next])").forEach((t=>{t.onclick=()=>{h(this,ni,"f").call(this,t,e)}})),h(this,qo,"m",ri).call(this,e)},ii=function(e,t){this.rootElement.addEventListener("transitionend",(()=>{this.rootElement.classList.remove("fade-out"),e()}),{once:!0});const n=t===_r.forward?"slide-forward":"slide-backward";Array.from(this.rootElement.getElementsByClassName("input-container")).forEach(((e,t)=>{e.style["transition-delay"]=40*t+"ms",e.classList.add(n)})),this.rootElement.classList.add("fade-out")},si=function(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t}))},customElements.define("descope-wc",di);var li=Object.freeze({__proto__:null,default:di});function ci(...e){return t=>e.reduce(((e,t)=>t(e)),t)}const ui=e=>{const t=document.createElement("template");return t.innerHTML=e,t},hi=(...e)=>e.join("/").replace(/\/+/g,"/"),fi=(e,t)=>e.length===t.length&&e.every(((e,n)=>e===t[n])),pi=e=>{let t,n;return(...r)=>(t&&fi(t,r)||(t=r,n=e(...r)),n)},gi=e=>(t,...n)=>t.reduce(((t,r,o)=>{var i;return`${t}${r}${(null===(i=null==n?void 0:n[o])||void 0===i?void 0:i[e>1?1:0])||""}`}),""),vi=(e,t=500)=>{let n;return function(...r){clearTimeout(n),n=setTimeout((()=>e.apply(this,r)),t)}},mi=e=>{const t=Symbol((e=>{const t=e.toString();let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n&=n;return n.toString(16)})(e));return n=>{if(n[t])return n;const r=e(n);return r[t]=!0,r}};var $i,yi,bi,wi,Ei,Ci;function ki(e,t){const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertyNames(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r+=1){const o=n[r],i=e[o],s=t[o];if(null===i||null===s){if(i!==s)return!1}else if("object"==typeof i&&"object"==typeof s){if(!ki(i,s))return!1}else if(i!==s)return!1}return!0}class Oi{constructor(e={},{updateOnlyOnChange:t=!0}={}){$i.set(this,void 0),yi.set(this,{}),bi.set(this,0),wi.set(this,!1),this.update=e=>{const t="function"==typeof e?e(h(this,$i,"f")):e,n=Object.assign(Object.assign({},h(this,$i,"f")),t);if(!h(this,wi,"f")||!ki(h(this,$i,"f"),n)){const e=h(this,$i,"f");f(this,$i,n,"f"),Object.freeze(h(this,$i,"f")),setTimeout((()=>{Object.values(h(this,yi,"f")).forEach((t=>t(n,e,((e,t)=>n=>e[n]!==t[n])(n,e))))}),0)}},f(this,$i,e,"f"),f(this,wi,t,"f")}get current(){return Object.assign({},h(this,$i,"f"))}subscribe(e){return f(this,bi,h(this,bi,"f")+1,"f"),h(this,yi,"f")[h(this,bi,"f")]=e,h(this,bi,"f").toString()}unsubscribe(e){const t=!!h(this,yi,"f")[e];return t&&delete h(this,yi,"f")[e],t}unsubscribeAll(){return f(this,yi,{},"f"),!0}}$i=new WeakMap,yi=new WeakMap,bi=new WeakMap,wi=new WeakMap;class xi{constructor(e,t){Ei.set(this,void 0),this.nodeName="",f(this,Ei,e,"f"),this.logger=t.logger}get asyncEle(){return(async(e,t)=>new Promise((t=>{const n=setInterval((()=>{const r="function"==typeof e?e():e;r&&(clearInterval(n),t(r))}),100);setTimeout((()=>{clearInterval(n),t(null)}),1e3)})))(h(this,Ei,"f"))}get ele(){var e,t;const n="function"==typeof h(this,Ei,"f")?h(this,Ei,"f").call(this):h(this,Ei,"f");return n?(null==n?void 0:n.localName)!==this.nodeName?(null===(t=this.logger)||void 0===t||t.debug(`node name do not match, expected "${this.nodeName}", received "${n.localName}" `,Error()),null):n:(null===(e=this.logger)||void 0===e||e.debug("no element for driver ",this.constructor.name,new Error),null)}}Ei=new WeakMap;const Si=/^descope-grid-([^-]+)-column$/,Ii={text:class extends xi{constructor(){super(...arguments),this.nodeName="descope-grid-text-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}},custom:class extends xi{constructor(){super(...arguments),this.nodeName="descope-grid-custom-column"}onSortDirectionChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("direction-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}}};class Ri extends xi{constructor(){super(...arguments),this.nodeName="descope-grid",Ci.set(this,void 0)}onSelectedItemsChange(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("selected-items-changed",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("selected-items-changed",e)}}get ele(){return super.ele}get data(){var e;return null===(e=this.ele)||void 0===e?void 0:e.data}set data(e){this.ele&&(this.ele.data=e)}get columns(){return this.ele?Array.from(this.ele.children).reduce(((e,t)=>{var n;const r=null===(n=Si.exec(t.localName))||void 0===n?void 0:n[1],o=Ii[r];return o?(e.push(new o(t,{logger:this.logger})),e):e}),[]):[]}filterColumns(e){var t;const n=this.ele.columns.filter(e);fi(n,this.ele.columns)||(this.ele.columns=n,null===(t=h(this,Ci,"f"))||void 0===t||t.call(this,n))}onColumnsChange(e){f(this,Ci,e,"f")}set renderColumn(e){this.ele.renderColumn=e}}Ci=new WeakMap;class ji extends xi{constructor(){super(...arguments),this.nodeName="descope-button"}onClick(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("click",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("click",e)}}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}var Ni;class Mi extends xi{constructor(){super(...arguments),Ni.set(this,void 0),this.nodeName="descope-modal"}close(){var e,t;null===(e=this.ele)||void 0===e||e.removeAttribute("opened"),null===(t=this.afterClose)||void 0===t||t.call(this)}async open(){var e,t;await(null===(e=this.beforeOpen)||void 0===e?void 0:e.call(this)),null===(t=this.ele)||void 0===t||t.setAttribute("opened","true")}reset(){var e;this.ele&&(this.ele.innerHTML=""),h(this,Ni,"f")&&(null===(e=this.ele)||void 0===e||e.append(h(this,Ni,"f").content.cloneNode(!0)))}setContent(e){f(this,Ni,e,"f"),this.reset()}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}Ni=new WeakMap;class Ai extends xi{constructor(){super(...arguments),this.nodeName="descope-multi-select-combo-box"}async setData(e){var t;null===(t=await this.asyncEle)||void 0===t||t.setAttribute("data",JSON.stringify(e.sort()))}}class Pi extends xi{constructor(){super(...arguments),this.nodeName="descope-notification"}close(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("opened")}show(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("opened","true")}setContent(e){this.ele.innerHTML="",this.ele.appendChild(e.content.cloneNode(!0))}remove(){var e;null===(e=this.ele)||void 0===e||e.remove()}}class Ti extends xi{constructor(){super(...arguments),this.nodeName="descope-text"}get ele(){return super.ele}get text(){var e;return null===(e=this.ele)||void 0===e?void 0:e.innerText}set text(e){this.ele&&(this.ele.innerText=e)}}class Di extends xi{constructor(){super(...arguments),this.nodeName="descope-text-field"}onInput(e){var t;return null===(t=this.ele)||void 0===t||t.addEventListener("input",e),()=>{var t;return null===(t=this.ele)||void 0===t?void 0:t.removeEventListener("input",e)}}get value(){var e;return null===(e=this.ele)||void 0===e?void 0:e.value}set value(e){this.ele&&(this.ele.value=e)}disable(){var e;null===(e=this.ele)||void 0===e||e.setAttribute("disabled","true")}enable(){var e;null===(e=this.ele)||void 0===e||e.removeAttribute("disabled")}}function _i(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Li=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),Wi=()=>Math.random().toString(36).substring(7).split("").join("."),Ui={INIT:`@@redux/INIT${Wi()}`,REPLACE:`@@redux/REPLACE${Wi()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Wi()}`};function Fi(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Vi(e){if(void 0===e)return"undefined";if(null===e)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";const n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function qi(e){let t=typeof e;return"production"!==process.env.NODE_ENV&&(t=Vi(e)),t}function Bi(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?_i(2):`Expected the root reducer to be a function. Instead, received: '${qi(e)}'`);if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?_i(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?_i(1):`Expected the enhancer to be a function. Instead, received: '${qi(n)}'`);return n(Bi)(e,t)}let r=e,o=t,i=new Map,s=i,a=0,d=!1;function l(){s===i&&(s=new Map,i.forEach(((e,t)=>{s.set(t,e)})))}function c(){if(d)throw new Error("production"===process.env.NODE_ENV?_i(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function u(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?_i(4):`Expected the listener to be a function. Instead, received: '${qi(e)}'`);if(d)throw new Error("production"===process.env.NODE_ENV?_i(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let t=!0;l();const n=a++;return s.set(n,e),function(){if(t){if(d)throw new Error("production"===process.env.NODE_ENV?_i(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,l(),s.delete(n),i=null}}}function h(e){if(!Fi(e))throw new Error("production"===process.env.NODE_ENV?_i(7):`Actions must be plain objects. Instead, the actual type was: '${qi(e)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?_i(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?_i(17):`Action "type" property must be a string. Instead, the actual type was: '${qi(e.type)}'. Value was: '${e.type}' (stringified)`);if(d)throw new Error("production"===process.env.NODE_ENV?_i(9):"Reducers may not dispatch actions.");try{d=!0,o=r(o,e)}finally{d=!1}return(i=s).forEach((e=>{e()})),e}function f(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?_i(10):`Expected the nextReducer to be a function. Instead, received: '${qi(e)}`);r=e,h({type:Ui.REPLACE})}function p(){const e=u;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error("production"===process.env.NODE_ENV?_i(11):`Expected the observer to be an object. Instead, received: '${qi(t)}'`);function n(){const e=t;e.next&&e.next(c())}n();return{unsubscribe:e(n)}},[Li](){return this}}}h({type:Ui.INIT});const g={dispatch:h,subscribe:u,getState:c,replaceReducer:f,[Li]:p};return g}function Ki(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function zi(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&Ki(`No reducer provided for key "${o}"`),"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o,i;"production"!==process.env.NODE_ENV&&(o={});try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Ui.INIT}))throw new Error("production"===process.env.NODE_ENV?_i(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(void 0===n(void 0,{type:Ui.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?_i(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Ui.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)}))}(n)}catch(e){i=e}return function(e={},t){if(i)throw i;if("production"!==process.env.NODE_ENV){const r=function(e,t,n,r){const o=Object.keys(t),i=n&&n.type===Ui.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Fi(e))return`The ${i} has unexpected type of "${qi(e)}". Expected argument to be an object with the following keys: "${o.join('", "')}"`;const s=Object.keys(e).filter((e=>!t.hasOwnProperty(e)&&!r[e]));return s.forEach((e=>{r[e]=!0})),n&&n.type===Ui.REPLACE?void 0:s.length>0?`Unexpected ${s.length>1?"keys":"key"} "${s.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${o.join('", "')}". Unexpected keys will be ignored.`:void 0}(e,n,t,o);r&&Ki(r)}let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],d=n[i],l=e[i],c=d(l,t);if(void 0===c){const e=t&&t.type;throw new Error("production"===process.env.NODE_ENV?_i(14):`When called with an action of type ${e?`"${String(e)}"`:"(unknown type)"}, the slice reducer for key "${i}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}a[i]=c,s=s||c!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function Hi(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function Gi(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error("production"===process.env.NODE_ENV?_i(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const s={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},a=e.map((e=>e(s)));return i=Hi(...a)(o.dispatch),{...o,dispatch:i}}}function Ji(e){return Fi(e)&&"type"in e&&"string"==typeof e.type}var Zi=Symbol.for("immer-nothing"),Xi=Symbol.for("immer-draftable"),Yi=Symbol.for("immer-state"),Qi="production"!==process.env.NODE_ENV?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function es(e,...t){if("production"!==process.env.NODE_ENV){const n=Qi[e],r="function"==typeof n?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ts=Object.getPrototypeOf;function ns(e){return!!e&&!!e[Yi]}function rs(e){return!!e&&(is(e)||Array.isArray(e)||!!e[Xi]||!!e.constructor?.[Xi]||cs(e)||us(e))}var os=Object.prototype.constructor.toString();function is(e){if(!e||"object"!=typeof e)return!1;const t=ts(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===os}function ss(e,t){0===as(e)?Object.entries(e).forEach((([n,r])=>{t(n,r,e)})):e.forEach(((n,r)=>t(r,n,e)))}function as(e){const t=e[Yi];return t?t.type_:Array.isArray(e)?1:cs(e)?2:us(e)?3:0}function ds(e,t){return 2===as(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ls(e,t,n){const r=as(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function cs(e){return e instanceof Map}function us(e){return e instanceof Set}function hs(e){return e.copy_||e.base_}function fs(e,t){if(cs(e))return new Map(e);if(us(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&is(e)){if(!ts(e)){const t=Object.create(null);return Object.assign(t,e)}return{...e}}const n=Object.getOwnPropertyDescriptors(e);delete n[Yi];let r=Reflect.ownKeys(n);for(let t=0;t<r.length;t++){const o=r[t],i=n[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(n[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(ts(e),n)}function ps(e,t=!1){return vs(e)||ns(e)||!rs(e)||(as(e)>1&&(e.set=e.add=e.clear=e.delete=gs),Object.freeze(e),t&&ss(e,((e,t)=>ps(t,!0)))),e}function gs(){es(2)}function vs(e){return Object.isFrozen(e)}var ms,$s={};function ys(e){const t=$s[e];return t||es(0,e),t}function bs(){return ms}function ws(e,t){t&&(ys("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Es(e){Cs(e),e.drafts_.forEach(Os),e.drafts_=null}function Cs(e){e===ms&&(ms=e.parent_)}function ks(e){return ms={drafts_:[],parent_:ms,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Os(e){const t=e[Yi];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function xs(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Yi].modified_&&(Es(t),es(4)),rs(e)&&(e=Ss(t,e),t.parent_||Rs(t,e)),t.patches_&&ys("Patches").generateReplacementPatches_(n[Yi].base_,e,t.patches_,t.inversePatches_)):e=Ss(t,n,[]),Es(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zi?e:void 0}function Ss(e,t,n){if(vs(t))return t;const r=t[Yi];if(!r)return ss(t,((o,i)=>Is(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return Rs(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),ss(o,((o,s)=>Is(e,r,t,o,s,n,i))),Rs(e,t,!1),n&&e.patches_&&ys("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Is(e,t,n,r,o,i,s){if("production"!==process.env.NODE_ENV&&o===n&&es(5),ns(o)){const s=Ss(e,o,i&&t&&3!==t.type_&&!ds(t.assigned_,r)?i.concat(r):void 0);if(ls(n,r,s),!ns(s))return;e.canAutoFreeze_=!1}else s&&n.add(o);if(rs(o)&&!vs(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ss(e,o),t&&t.scope_.parent_||Rs(e,o)}}function Rs(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ps(t,n)}var js={get(e,t){if(t===Yi)return e;const n=hs(e);if(!ds(n,t))return function(e,t,n){const r=As(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!rs(r)?r:r===Ms(e.base_,t)?(Ts(e),e.copy_[t]=Ds(r,e)):r},has:(e,t)=>t in hs(e),ownKeys:e=>Reflect.ownKeys(hs(e)),set(e,t,n){const r=As(hs(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ms(hs(e),t),o=r?.[Yi];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||ds(e.base_,t)))return!0;Ts(e),Ps(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ms(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Ts(e),Ps(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=hs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){es(11)},getPrototypeOf:e=>ts(e.base_),setPrototypeOf(){es(12)}},Ns={};function Ms(e,t){const n=e[Yi];return(n?hs(n):e)[t]}function As(e,t){if(!(t in e))return;let n=ts(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ts(n)}}function Ps(e){e.modified_||(e.modified_=!0,e.parent_&&Ps(e.parent_))}function Ts(e){e.copy_||(e.copy_=fs(e.base_,e.scope_.immer_.useStrictShallowCopy_))}ss(js,((e,t)=>{Ns[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Ns.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&es(13),Ns.set.call(this,e,t,void 0)},Ns.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&es(14),js.set.call(this,e[0],t,n,e[0])};function Ds(e,t){const n=cs(e)?ys("MapSet").proxyMap_(e,t):us(e)?ys("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:bs(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=js;n&&(o=[r],i=Ns);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}(e,t);return(t?t.scope_:bs()).drafts_.push(n),n}function _s(e){return ns(e)||es(10,e),Ls(e)}function Ls(e){if(!rs(e)||vs(e))return e;const t=e[Yi];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fs(e,t.scope_.immer_.useStrictShallowCopy_)}else n=fs(e,!0);return ss(n,((e,t)=>{ls(n,e,Ls(t))})),t&&(t.finalized_=!1),n}var Ws=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&es(6),void 0!==n&&"function"!=typeof n&&es(7),rs(e)){const o=ks(this),i=Ds(e,void 0);let s=!0;try{r=t(i),s=!1}finally{s?Es(o):Cs(o)}return ws(o,n),xs(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Zi&&(r=void 0),this.autoFreeze_&&ps(r,!0),n){const t=[],o=[];ys("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}es(1,e)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;const o=this.produce(e,t,((e,t)=>{n=e,r=t}));return[o,n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){rs(e)||es(8),ns(e)&&(e=_s(e));const t=ks(this),n=Ds(e,void 0);return n[Yi].isManual_=!0,Cs(t),n}finishDraft(e,t){const n=e&&e[Yi];n&&n.isManual_||es(9);const{scope_:r}=n;return ws(r,t),xs(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=ys("Patches").applyPatches_;return ns(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},Us=Ws.produce;Ws.produceWithPatches.bind(Ws),Ws.setAutoFreeze.bind(Ws),Ws.setUseStrictShallowCopy.bind(Ws),Ws.applyPatches.bind(Ws),Ws.createDraft.bind(Ws),Ws.finishDraft.bind(Ws);var Fs=(e,t,n)=>{if(1===t.length&&t[0]===n){let t=!1;try{const n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("The result function returned its own inputs without modification. e.g\n`createSelector([state => state.todos], todos => todos)`\nThis could lead to inefficient memoization and unnecessary re-renders.\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.",{stack:e})}}},Vs=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:i,inputSelectorResultsCopy:s}=e,a=r((()=>({})),...o);if(!(a.apply(null,i)===a.apply(null,s))){let e;try{throw new Error}catch(t){({stack:e}=t)}console.warn("An input selector returned a different result when passed same arguments.\nThis means your output selector will likely run more frequently than intended.\nAvoid returning a new reference inside your input selector, e.g.\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`",{arguments:n,firstInputs:i,secondInputs:s,stack:e})}},qs={inputStabilityCheck:"once",identityFunctionCheck:"once"};var Bs=e=>Array.isArray(e)?e:[e];function Ks(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function zs(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Hs=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...qs,...t};return{identityFunctionCheck:{shouldRun:"always"===n||"once"===n&&e,run:Fs},inputStabilityCheck:{shouldRun:"always"===r||"once"===r&&e,run:Vs}}},Gs="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function Js(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,i=0;function s(){let t=n;const{length:s}=arguments;for(let e=0,n=s;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t={s:0,v:void 0,o:null,p:null},e.set(n,t)):t=r}}const a=t;let d;if(1===t.s?d=t.v:(d=e.apply(null,arguments),i++),a.s=1,r){const e=o?.deref?.()??o;null!=e&&r(e,d)&&(d=e,0!==i&&i--);o="object"==typeof d&&null!==d||"function"==typeof d?new Gs(d):d}return a.v=d,d}return s.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function Zs(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},s=e.pop();"object"==typeof s&&(i=s,s=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(s,`createSelector expects an output function after the inputs, but received: [${typeof s}]`);const a={...n,...i},{memoize:d,memoizeOptions:l=[],argsMemoize:c=Js,argsMemoizeOptions:u=[],devModeChecks:h={}}=a,f=Bs(l),p=Bs(u),g=Ks(e),v=d((function(){return r++,s.apply(null,arguments)}),...f);let m=!0;const $=c((function(){o++;const e=zs(g,arguments);if(t=v.apply(null,e),"production"!==process.env.NODE_ENV){const{identityFunctionCheck:n,inputStabilityCheck:r}=Hs(m,h);if(n.shouldRun&&n.run(s,e,t),r.shouldRun){const t=zs(g,arguments);r.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:d,memoizeOptions:f},arguments)}m&&(m=!1)}return t}),...p);return Object.assign($,{resultFunc:s,memoizedResultFunc:v,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:d,argsMemoize:c})};return Object.assign(r,{withTypes:()=>r}),r}var Xs=Zs(Js),Ys=Object.assign(((e,t=Xs)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e),r=t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})));return r}),{withTypes:()=>Ys});function Qs(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ea=Qs(),ta=Qs;((...e)=>{const t=Zs(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(ns(e)?_s(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(Js);var na="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Hi:Hi.apply(null,arguments)},ra=e=>e&&"function"==typeof e.match;function oa(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("production"===process.env.NODE_ENV?qa(0):"prepareAction did not return an object");return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Ji(t)&&t.type===e,n}function ia(e){return"function"==typeof e&&"type"in e&&ra(e)}function sa(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var aa=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function da(e){return rs(e)?Us(e,(()=>{})):e}function la(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error("production"===process.env.NODE_ENV?qa(10):"No insert provided for key not already in map");const r=n.insert(t,e);return e.set(t,r),r}function ca(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function ua(e,t,n){const r=ha(e,t,n);return{detectMutations:()=>fa(e,t,r,n)}}function ha(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=ha(e,t,n[o],s))}}return i}function fa(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||e(r))return{wasMutated:!1};const d={};for(let e in n.children)d[e]=!0;for(let e in r)d[e]=!0;const l=t.length>0;for(let o in d){const s=i?i+"."+o:o;if(l){if(t.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}const d=fa(e,t,n.children[o],r[o],a,s);if(d.wasMutated)return d}return{wasMutated:!1}}function pa(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||Fi(e)}function ga(e,t="",n=pa,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),d=o.length>0;for(const[e,l]of a){const a=t?t+"."+e:e;if(d){if(o.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}if(!n(l))return{keyPath:a,value:l};if("object"==typeof l&&(s=ga(l,a,n,r,o,i),s))return s}return i&&va(e)&&i.add(e),!1}function va(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!va(t))return!1;return!0}function ma(e){return"boolean"==typeof e}var $a=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new aa;if(t&&(ma(t)?i.push(ea):i.push(ta(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};ma(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=ca,ignoredPaths:o,warnAfter:i=32}=e;const s=ua.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return a=>d=>{const l=sa(i,"ImmutableStateInvariantMiddleware");l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?qa(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const c=a(d);return l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?qa(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(d)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),l.warnIfExceeded(),c}}}}(e))}if(r){let e={};ma(r)||(e=r),i.push(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=pa,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:d=!1,disableCache:l=!1}=e,c=!l&&WeakSet?new WeakSet:void 0;return e=>l=>u=>{if(!Ji(u))return l(u);const h=l(u),f=sa(s,"SerializableStateInvariantMiddleware");return d||r.length&&-1!==r.indexOf(u.type)||f.measureTime((()=>{const e=ga(u,"",t,n,o,c);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",u,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),a||(f.measureTime((()=>{const r=ga(e.getState(),"",t,n,i,c);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${u.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),h}}}(e))}if(o){let e={};ma(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=ia}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},ya=e=>t=>{setTimeout(t,e)},ba="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:ya(10),wa=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new aa(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,d="tick"===e.type?queueMicrotask:"raf"===e.type?ba:"callback"===e.type?e.queueNotification:ya(e.timeout),l=()=>{s=!1,i&&(i=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,d(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},Ea="production"===process.env.NODE_ENV;function Ca(e){const t={},n=[];let r;const o={addCase(e,i){if("production"!==process.env.NODE_ENV){if(n.length>0)throw new Error("production"===process.env.NODE_ENV?qa(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error("production"===process.env.NODE_ENV?qa(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const s="string"==typeof e?e:e.type;if(!s)throw new Error("production"===process.env.NODE_ENV?qa(28):"`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error("production"===process.env.NODE_ENV?qa(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);return t[s]=i,o},addMatcher(e,t){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?qa(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?qa(31):"`builder.addDefaultCase` can only be called once");return r=e,o}};return e(o),[t,n,r]}var ka=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function Oa(...e){return t=>e.some((e=>((e,t)=>ra(e)?e.match(t):e(t))(e,t)))}var xa=["name","message","stack","code"],Sa=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ia=class{constructor(e,t){this.payload=e,this.meta=t}_type},Ra=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of xa)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ja=(()=>{function e(e,t,n){const r=oa(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=oa(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=oa(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||Ra)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(s,a,d)=>{const l=n?.idGenerator?n.idGenerator(e):ka(),c=new AbortController;let u,h;function f(e){h=e,c.abort()}const p=async function(){let p;try{let i=n?.condition?.(e,{getState:a,extra:d});if(null!==(g=i)&&"object"==typeof g&&"function"==typeof g.then&&(i=await i),!1===i||c.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{u=()=>{t({name:"AbortError",message:h||"Aborted"})},c.signal.addEventListener("abort",u)}));s(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:d}))),p=await Promise.race([v,Promise.resolve(t(e,{dispatch:s,getState:a,extra:d,requestId:l,signal:c.signal,abort:f,rejectWithValue:(e,t)=>new Sa(e,t),fulfillWithValue:(e,t)=>new Ia(e,t)})).then((t=>{if(t instanceof Sa)throw t;return t instanceof Ia?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){p=t instanceof Sa?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{u&&c.signal.removeEventListener("abort",u)}var g;return n&&!n.dispatchConditionRejection&&i.match(p)&&p.meta.condition||s(p),p}();return Object.assign(p,{abort:f,requestId:l,arg:e,unwrap:()=>p.then(Na)})}}),{pending:o,rejected:i,fulfilled:r,settled:Oa(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Na(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Ma=Symbol.for("rtk-slice-createasyncthunk");function Aa(e,t){return`${e}/${t}`}function Pa({creators:e}={}){const t=e?.asyncThunk?.[Ma];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error("production"===process.env.NODE_ENV?qa(11):"`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&void 0===e.initialState&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error("production"===process.env.NODE_ENV?qa(12):"`context.addCase` cannot be called with an empty action type");if(n in s.sliceCaseReducersByType)throw new Error("production"===process.env.NODE_ENV?qa(13):"`context.addCase` cannot be called with two reducers for the same action type: "+n);return s.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(s.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(s.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(s.sliceCaseReducersByName[e]=t,a)};function d(){if("production"!==process.env.NODE_ENV&&"object"==typeof e.extraReducers)throw new Error("production"===process.env.NODE_ENV?qa(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[t={},n=[],r]="function"==typeof e.extraReducers?Ca(e.extraReducers):[e.extraReducers],o={...t,...s.sliceCaseReducersByType};return function(e,t){if("production"!==process.env.NODE_ENV&&"object"==typeof t)throw new Error("production"===process.env.NODE_ENV?qa(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let n,[r,o,i]=Ca(t);if(function(e){return"function"==typeof e}(e))n=()=>da(e());else{const t=da(e);n=()=>t}function s(e=n(),t){let s=[r[t.type],...o.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===s.filter((e=>!!e)).length&&(s=[i]),s.reduce(((e,n)=>{if(n){if(ns(e)){const r=n(e,t);return void 0===r?e:r}if(rs(e))return Us(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error("production"===process.env.NODE_ENV?qa(9):"A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=n,s}(e.initialState,(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of s.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}))}i.forEach((r=>{const i=o[r],s={reducerName:r,type:Aa(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,s;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error("production"===process.env.NODE_ENV?qa(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=r.reducer,s=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?oa(e,s):oa(e))}(s,i,a):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error("production"===process.env.NODE_ENV?qa(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:s,pending:a,rejected:d,settled:l,options:c}=n,u=o(e,i,c);r.exposeAction(t,u),s&&r.addCase(u.fulfilled,s);a&&r.addCase(u.pending,a);d&&r.addCase(u.rejected,d);l&&r.addMatcher(u.settled,l);r.exposeCaseReducer(t,{fulfilled:s||_a,pending:a||_a,rejected:d||_a,settled:l||_a})}(s,i,a,t)}));const l=e=>e,c=new Map;let u;function h(e,t){return u||(u=d()),u(e,t)}function f(){return u||(u=d()),u.getInitialState()}function p(t,n=!1){function r(e){let r=e[t];if(void 0===r)if(n)r=f();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?qa(15):"selectSlice returned undefined for an uninjected slice reducer");return r}function o(t=l){const r=la(c,n,{insert:()=>new WeakMap});return la(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=Ta(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:h,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:f,...p(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:h},n),{...g,...p(o,!0)}}};return g}}function Ta(e,t,n,r){function o(o,...i){let s=t(o);if(void 0===s)if(r)s=n();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?qa(16):"selectState returned undefined for an uninjected slice reducer");return e(s,...i)}return o.unwrapped=e,o}var Da=Pa();function _a(){}var La="listenerMiddleware",Wa=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=oa(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("production"===process.env.NODE_ENV?qa(21):"Creating or removing a listener requires one of the known fields for matching an action");return((e,t)=>{if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?qa(32):`${t} is not a function`)})(i,"options.listener"),{predicate:o,type:t,effect:i}},Ua=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Wa(e);return{id:ka(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("production"===process.env.NODE_ENV?qa(22):"Unsubscribe not initialized")}}}),{withTypes:()=>Ua}),Fa=Object.assign(oa(`${La}/add`),{withTypes:()=>Fa});oa(`${La}/removeAll`);var Va=Object.assign(oa(`${La}/remove`),{withTypes:()=>Va});function qa(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Ba=["error","warn","info","debug"],Ka=mi((e=>{var t,n,r,o;return o=class extends e{constructor(){super(...arguments),t.add(this),n.set(this,h(this,t,"m",r).call(this,console))}set logger(e){f(this,n,h(this,t,"m",r).call(this,e),"f")}get logger(){return h(this,n,"f")}onLogEvent(e,t){}},n=new WeakMap,t=new WeakSet,r=function(e){return Ba.reduce(((t,n)=>(t[n]=(...t)=>{var r;this.onLogEvent(n,t),null===(r=e[n])||void 0===r||r.call(e,...t)},t)),{})},o})),za="undefined"!=typeof localStorage,Ha=za&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",Ga=(e,t)=>!t&&`${e} cannot be empty`,Ja=mi((e=>{var t,n;return n=class extends e{constructor(){super(...arguments),t.set(this,!0)}connectedCallback(){var e,n;null===(e=super.connectedCallback)||void 0===e||e.call(this),(null===(n=this.shadowRoot)||void 0===n?void 0:n.isConnected)&&h(this,t,"f")&&(f(this,t,!1,"f"),this.init())}async init(){}},t=new WeakMap,n})),Za=mi((e=>{var t,n;const r=ci(Ka,Ja)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,{})}async init(){var e,n,r;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),n=this,r=e=>{var n;null===(n=h(this,t,"f")[e])||void 0===n||n.forEach((t=>{t(e,this.getAttribute(e))}))},Array.from(n.attributes).forEach((e=>r(e.name))),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&r(e.attributeName)}))})).observe(n,{attributes:!0})}observeAttribute(e,n){h(this,t,"f")[e]||(h(this,t,"f")[e]=[]);const r=h(this,t,"f")[e].push(n);return()=>h(this,t,"f")[e].splice(r,1)}observeAttributes(e,t){const n=e.reduce(((e,n)=>(e.push(this.observeAttribute(n,t)),e)),[]);return()=>n.forEach((e=>e()))}},t=new WeakMap,n})),Xa=e=>t=>{var n,r,o;const i=ci(Ka,Ja,Za)(t),s=Object.keys(e);return o=class extends i{constructor(...e){super(...e),n.add(this),this.observeAttributes(s,h(this,n,"m",r).bind(this))}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),s.forEach((e=>h(this,n,"m",r).call(this,e,this.getAttribute(e))))}},n=new WeakSet,r=function(t,n){const r=e[t],o="function"==typeof r?r(t,n):r;o&&this.logger.error(o)},o};Xa.missingAttrValidator=Ga;const Ya=mi((e=>{const t=ci(Xa({"project-id":Ga}))(e);return class extends t{get projectId(){return this.getAttribute("project-id")}}}));const Qa=mi((e=>{const t=ci(Ka,Ya)(e);return class extends t{async fetchStaticResource(e,t){const n=function(e,t,n="v2-beta"){const r=new URL(Ha);return r.pathname=hi(r.pathname,e,n,t),r.toString()}(this.projectId,e),r=await fetch(n,{cache:"default"});return r.ok||this.logger.error(`Error fetching URL ${n} [${r.status}]`),{body:await r[t](),headers:Object.fromEntries(r.headers.entries())}}}})),ed=mi((e=>{var t,n,r;const o=ci(Qa)(e);return r=class extends o{constructor(){super(...arguments),t.set(this,void 0),n.set(this,(async()=>{try{const{body:e,headers:t}=await this.fetchStaticResource("config.json","json");return{projectConfig:e,executionContext:{geo:t["x-geo"]}}}catch(e){this.logger.error("Cannot fetch config file","make sure that your projectId & flowId are correct")}}))}get config(){return h(this,t,"f")||f(this,t,h(this,n,"f").call(this),"f"),h(this,t,"f")}},t=new WeakMap,n=new WeakMap,r})),td=mi((e=>{var t,n,r,o,i,s,a;return a=class extends(ci(Ja,Ka)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),this.attributeChangedCallback=(e,n,r)=>{var o;null===(o=super.attributeChangedCallback)||void 0===o||o.call(this,e,n,r),"debug"===e&&h(this,t,"m",i).call(this)}}get debug(){return"true"===this.getAttribute("debug")}onLogEvent(e,n){var r;null===(r=super.onLogEvent)||void 0===r||r.call(this,e,n),"error"===e&&h(this,t,"m",s).call(this,n[0]||"Error",n[1])}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this)}},n=new WeakMap,t=new WeakSet,r=function(){var e;null===(e=h(this,n,"f"))||void 0===e||e.remove(),f(this,n,null,"f")},o=async function(){f(this,n,document.createElement("descope-debugger"),"f"),Object.assign(h(this,n,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),await Promise.resolve().then((function(){return Ad})),document.body.appendChild(h(this,n,"f"))},i=function(){this.debug?h(this,t,"m",o).call(this):h(this,t,"m",r).call(this)},s=function(e,t){var r;e&&(null===(r=h(this,n,"f"))||void 0===r||r.updateData({title:e,description:t}))},a})),nd="load-descope-ui",rd="base.ui.components.url",od=za&&localStorage.getItem(rd)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",id=za&&localStorage.getItem(rd)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",sd=e=>{const t=document.createElement("script");return t.id=e,t},ad=(e,t)=>e.replace("<version>",t),dd=mi((e=>{var t,n,r,o,i,s,a,d,l,c,u,p;const g=ci(Ka,ed)(e);return p=class extends g{constructor(){super(...arguments),t.add(this),n.set(this,Symbol("errorCbs")),r.set(this,Symbol("loadCbs")),l.set(this,void 0)}get descopeUi(){return h(this,l,"f")||f(this,l,h(this,t,"m",u).call(this),"f"),h(this,l,"f")}async loadDescopeUiComponents(e){const n=Array.isArray(e)?e:(e=>[...Array.from(e.content.querySelectorAll("*")).reduce(((e,t)=>t.localName.startsWith("descope-")?e.add(t.localName):e),new Set)])(e);return Promise.all(n.map((e=>h(this,t,"m",c).call(this,e))))}},n=new WeakMap,r=new WeakMap,l=new WeakMap,t=new WeakSet,o=async function(){var e;const t=await this.config,n=null===(e=null==t?void 0:t.projectConfig)||void 0===e?void 0:e.componentsVersion;return n?this.logger.debug(`Got component version "${n}"`):this.logger.error("Could not get components version"),n},i=function(e){const t=h(this,n,"f"),o=h(this,r,"f");e[t]=[],e[o]=[],Object.defineProperty(e,"onerror",{set(n){e[t].push(n)}}),Object.defineProperty(e,"onload",{set(t){e[o].push(t)}})},s=async function(e,n){this.logger.debug("Trying to load DescopeUI from a fallback URL");const r=sd("load-descope-ui-fallback-script");document.body.append(r),r.addEventListener("error",(()=>{e.forEach((e=>e(`Cannot load DescopeUI from fallback URL, Make sure this URL is valid and return the correct script: "${r.src}"`)))})),r.addEventListener("load",(()=>{n.forEach((e=>e()))})),r.src=ad(id,await h(this,t,"m",o).call(this))},a=function(e){e.addEventListener("error",(()=>{e[h(this,n,"f")].forEach((t=>t(`Cannot load DescopeUI from main URL, Make sure this URL is valid and return the correct script: "${e.src}"`))),h(this,t,"m",s).call(this,e[h(this,n,"f")],e[h(this,r,"f")])})),e.addEventListener("load",(()=>{e[h(this,r,"f")].forEach((e=>e()))}))},d=async function(){if(document.querySelector(`script#${nd}`))this.logger.debug("DescopeUI loading script already exists",this);else{this.logger.debug("DescopeUI loading script does not exist, creating it",this);const e=sd(nd);document.body.append(e),h(this,t,"m",i).call(this,e),h(this,t,"m",a).call(this,e),e.src=ad(od,await h(this,t,"m",o).call(this))}return document.getElementById(nd)},c=async function(e){if(!!customElements.get(e))return void this.logger.debug(`Loading component "${e}" is skipped as it is already defined`);const t=await this.descopeUi;if(t[e])try{return await t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`Encountered an error while attempting to define the "${e}" component, it is likely that this component is already defined`)}else this.logger.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)},u=function(){return new Promise((e=>{globalThis.DescopeUI&&e(globalThis.DescopeUI),h(this,t,"m",d).call(this).then((t=>{t.onerror=this.logger.error,t.onload=()=>{this.logger.debug("DescopeUI was loaded"),e(globalThis.DescopeUI)},setTimeout((()=>{globalThis.DescopeUI&&e(globalThis.DescopeUI)}))}))}))},p})),ld="content-root",cd="root",ud=mi((e=>class extends e{constructor(...e){var t,n;super(...e),this.attachShadow({mode:"open"}).innerHTML=`\n\n <style>\n #${cd}, #${ld} {\n height: 100%;\n }\n #${cd} {\n position: relative;\n }\n #${ld} {\n display: flex;\n }\n </style>\n <div id="${cd}">\n <div id="${ld}"></div>\n </div>\n `,this.contentRootElement=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(ld),this.rootElement=null===(n=this.shadowRoot)||void 0===n?void 0:n.getElementById(cd)}})),hd="descope-modal",fd=mi((e=>{var t,n;const r=ci(Ja,ud,dd)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Mi{setContent(t){e(t),super.setContent(t)}}})())}createModal(e){const n=((e={})=>{const t=document.createElement(hd);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;this.loadDescopeUiComponents([hd]),await(null===(e=super.init)||void 0===e?void 0:e.call(this))}},t=new WeakMap,n})),pd="descope-notification",gd=mi((e=>{var t,n;const r=ci(Ja,ud,dd)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Pi{setContent(t){const n="string"==typeof t?ui(t):t;e(n),super.setContent(n)}}})())}createNotification(e){const n=((e={})=>{const t=document.createElement(pd);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),this.loadDescopeUiComponents([pd])}},t=new WeakMap,n})),vd=(e,t)=>!!t&&"light"!==t&&"dark"!==t&&'Supported theme values are "light", "dark", or leave empty for using the OS theme',md=mi((e=>{var t,n,r,o,i,s,a,d,l;const c=ci(Xa({theme:vd}),Qa,Ja,dd,ed,ud)(e);return l=class extends c{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get theme(){return"light"}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this),h(this,t,"m",s).call(this),h(this,t,"m",a).call(this),h(this,t,"m",d).call(this)}},n=new WeakMap,t=new WeakSet,r=async function(){try{const{body:e}=await this.fetchStaticResource("theme.json","json");return e}catch(e){this.logger.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}},o=function(){return h(this,n,"f")||(f(this,n,h(this,t,"m",r).call(this),"f"),h(this,n,"f").then((e=>this.logger.debug("Fetched theme",e)))),h(this,n,"f")},i=async function(){var e,n;const r=await h(this,t,"a",o);if(!r)return;const i=document.createElement("style");i.innerText=((null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.globals)||"")+((null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.globals)||""),this.shadowRoot.appendChild(i)},s=async function(){var e,n;const r=Object.assign({},await h(this,t,"a",o));if(!r)return;const i=await this.descopeUi;(null==i?void 0:i.componentsThemeManager)&&(i.componentsThemeManager.themes={light:null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.components,dark:null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.components})},a=async function(){var e,t;const{projectConfig:n}=await this.config,r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>{e.url&&(this.logger.debug(`Loading font from URL "${e.url}"`),(e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url))}))},d=async function(){this.rootElement.setAttribute("data-theme",this.theme);const e=await this.descopeUi;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)},l})),$d=e=>mi((t=>{const n=Da(e),r=Object.assign(Object.assign({},n.actions),e.asyncActions);return class extends(ci(Ka)(t)){constructor(...e){super(...e);const t=function(e){const t=$a(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:s}=e||{};let a,d;if("function"==typeof n)a=n;else{if(!Fi(n))throw new Error("production"===process.env.NODE_ENV?qa(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");a=zi(n)}if(!Ea&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?qa(2):"`middleware` field must be a callback");if("function"==typeof r){if(d=r(t),!Ea&&!Array.isArray(d))throw new Error("production"===process.env.NODE_ENV?qa(3):"when using a middleware builder function, an array of middleware must be returned")}else d=t();if(!Ea&&d.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?qa(4):"each middleware provided to configureStore must be a function");let l=Hi;o&&(l=na({trace:!Ea,..."object"==typeof o&&o}));const c=Gi(...d),u=wa(c);if(!Ea&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?qa(5):"`enhancers` field must be a callback");let h="function"==typeof s?s(u):u();if(!Ea&&!Array.isArray(h))throw new Error("production"===process.env.NODE_ENV?qa(6):"`enhancers` callback must return an array");if(!Ea&&h.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?qa(7):"each enhancer provided to configureStore must be a function");return Ea||!d.length||h.includes(c)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),Bi(a,i,l(...h))}({reducer:n.reducer,middleware:e=>e({thunk:{extraArgument:this},serializableCheck:!1}),devTools:!1}),o=e=>async(...n)=>{const r=await t.dispatch(e(...n));try{Na(r)}catch(e){this.logger.error(e.message,r.type,e.stack)}return r},i=Object.keys(r).reduce(((e,t)=>(e[t]=o(r[t]),e)),{});this.actions=i,this.subscribe=(e,n=(e=>e))=>t.subscribe((()=>e(n(t.getState()))))}}})),yd=mi((e=>class extends(Ka(e)){validateForm(e){return this.getFormInputs(e).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))}getFormInputs(e){return e?Array.from(e.querySelectorAll("[name]")):(this.logger.debug("cannot get form inputs, no root element was received"),[])}getFormData(e){return this.getFormInputs(e).reduce(((e,t)=>Object.assign(e,{[t.getAttribute("name")]:t.value})),{})}setFormData(e,t){this.getFormInputs(e).forEach((e=>{t.hasOwnProperty(e.getAttribute("name"))&&(e.value=t[e.getAttribute("name")])}))}resetFormData(e){this.getFormInputs(e).forEach((e=>{e.value="",e.checked=!1}))}getFormFieldNames(e){return this.getFormInputs(e).map((e=>e.name))}disableFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.setAttribute("disabled","true")}removeFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.remove()}})),bd=(e,t,n,r={})=>{var o,i,s,a;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(s=r.top)&&void 0!==s?s:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(a=r.bottom)&&void 0!==a?a:0))]};var wd,Ed,Cd,kd,Od,xd,Sd,Id,Rd,jd;const Nd=document.createElement("template");Nd.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class Md extends HTMLElement{constructor(){var e;super(),wd.add(this),Ed.set(this,new Oi({messages:[]})),Cd.set(this,void 0),kd.set(this,void 0),Od.set(this,void 0),xd.set(this,{resize:h(this,wd,"m",jd).bind(this)}),this.attachShadow({mode:"open"}),null===(e=this.shadowRoot)||void 0===e||e.appendChild(Nd.content.cloneNode(!0)),f(this,Cd,this.shadowRoot.querySelector(".debugger"),"f"),f(this,kd,h(this,Cd,"f").querySelector(".content"),"f"),f(this,Od,h(this,Cd,"f").querySelector(".header"),"f")}updateData(e){h(this,Ed,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,s=0;function a(t){t.preventDefault(),r=i-t.clientX,o=s-t.clientY,i=t.clientX,s=t.clientY;const[a,d]=bd(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${d}px`,e.style.left=`${a}px`}function d(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,s=e.clientY,document.onmouseup=d,document.onmousemove=a}t?t.onmousedown=l:e.onmousedown=l})(h(this,Cd,"f"),h(this,Od,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,xd,"f").resize),(e=h(this,Cd,"f")).onmousemove=t=>{var n;const r=t.target;(r.w&&r.w!==r.offsetWidth||r.h&&r.h!==r.offsetHeight)&&(null===(n=e.onresize)||void 0===n||n.call(e,t)),r.w=r.offsetWidth,r.h=r.offsetHeight},h(this,Cd,"f").onresize=h(this,wd,"m",Rd).bind(this),h(this,Ed,"f").subscribe(h(this,wd,"m",Sd).bind(this))}disconnectedCallback(){h(this,Ed,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,xd,"f").resize)}}Ed=new WeakMap,Cd=new WeakMap,kd=new WeakMap,Od=new WeakMap,xd=new WeakMap,wd=new WeakSet,Sd=function(e){h(this,wd,"m",Id).call(this,e),h(this,wd,"m",Rd).call(this)},Id=function(e){h(this,kd,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description||""}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},Rd=function(){h(this,kd,"f").querySelectorAll(".msg").forEach((e=>{const t=e,n=t.querySelector(".msg_desc"),r=n.scrollWidth>n.clientWidth,o=n.clientHeight>20;r||o?(t.classList.add("collapsible"),t.onclick=e=>{e.target.classList.contains("msg_desc")||t.classList.toggle("collapsed")}):(t.classList.remove("collapsible"),t.onclick=null)}))},jd=function(){const[e,t]=bd(h(this,Cd,"f"),Number.parseInt(h(this,Cd,"f").style.left,10),Number.parseInt(h(this,Cd,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,Cd,"f").style.top=`${t}px`,h(this,Cd,"f").style.left=`${e}px`},customElements.get("descope-debugger")||customElements.define("descope-debugger",Md);var Ad=Object.freeze({__proto__:null}),Pd={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|7(?:[013-57-9]\\d|2[0-8]))\\d|3(?:(?:[0-3589]\\d|6[1-9]|7[0-35-9])\\d|4(?:[0-578]\\d|90)))\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|3\\d\\d)|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[0-36-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|31)"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:1[3-79]|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-79])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[245]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-46-9]|3[3-9]|9)|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[0167]\\d|2[0-4]|5[01]|8[0-3]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:22|44|7[27]|87|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-689]|8[1-69]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","2[0-24-9]\\d{8}|[78]\\d{10,13}|[7-9]\\d{9}|[1-9]\\d{7}|[124-7]\\d{6}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-6]|7(?:0[0-689]|[1-79])|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["(?:5056(?:[0-35-9]\\d|4[468])|7302[0-3]\\d)\\d{4}|(?:472[24]|505[2-57-9]|7306|983[237-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013569]|3[0-24679]|4[167]|5[0-2]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[6,7,8,9,10,11,12,13],[["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","(?:20|33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Td(e,t){var n=Array.prototype.slice.call(t);return n.push(Pd),e.apply(this,n)}function Dd(e){return Dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dd(e)}function _d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ld(e,t){if(t&&("object"===Dd(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Wd(e)}function Wd(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ud(e){var t="function"==typeof Map?new Map:void 0;return Ud=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Fd(e,arguments,Bd(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),qd(r,e)},Ud(e)}function Fd(e,t,n){return Fd=Vd()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&qd(o,n.prototype),o},Fd.apply(null,arguments)}function Vd(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function qd(e,t){return qd=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},qd(e,t)}function Bd(e){return Bd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Bd(e)}var Kd=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&qd(e,t)}(a,e);var t,n,r,o,i,s=(t=a,n=Vd(),function(){var e,r=Bd(t);if(n){var o=Bd(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ld(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=s.call(this,e),Object.setPrototypeOf(Wd(t),a.prototype),t.name=t.constructor.name,t}return r=a,o&&_d(r.prototype,o),i&&_d(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r}(Ud(Error)),zd="0-90-9٠-٩۰-۹",Hd="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~");function Gd(e,t){e=e.split("-"),t=t.split("-");for(var n=e[0].split("."),r=t[0].split("."),o=0;o<3;o++){var i=Number(n[o]),s=Number(r[o]);if(i>s)return 1;if(s>i)return-1;if(!isNaN(i)&&isNaN(s))return 1;if(isNaN(i)&&!isNaN(s))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}var Jd={}.constructor;function Zd(e){return null!=e&&e.constructor===Jd}function Xd(e){return Xd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xd(e)}function Yd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function el(e,t,n){return t&&Qd(e.prototype,t),n&&Qd(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var tl=" ext. ",nl=/^\d+$/,rl=function(){function e(t){Yd(this,e),function(e){if(!e)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Zd(e)||!Zd(e.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Zd(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+ll(e)+": "+e,"."))}(t),this.metadata=t,ul.call(this,t)}return el(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&nl.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw new Error("Unknown country: ".concat(e));this.numberingPlan=new ol(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw new Error("Unknown calling code: ".concat(t));this.numberingPlan=new ol(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var n=this.nonGeographic()[e];if(n)return n}else{var r=this.countryCallingCodes()[e];if(r&&1===r.length&&"001"===r[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),ol=function(){function e(t,n){Yd(this,e),this.globalMetadataObject=n,this.metadata=t,ul.call(this,n.metadata)}return el(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this,t=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return t.map((function(t){return new il(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return(!this.types()||0!==this.types().length)&&!!this.types()}},{key:"type",value:function(e){if(this.hasTypes()&&dl(this.types(),e))return new al(dl(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?tl:this.metadata[13]||tl}}]),e}(),il=function(){function e(t,n){Yd(this,e),this._format=t,this.metadata=n}return el(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||sl.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),sl=/^\(?\$1\)?$/,al=function(){function e(t,n){Yd(this,e),this.type=t,this.metadata=n}return el(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function dl(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var ll=function(e){return Xd(e)};function cl(e,t){if((t=new rl(t)).hasCountry(e))return t.country(e).countryCallingCode();throw new Error("Unknown country: ".concat(e))}function ul(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===Gd(t,"1.2.0")?this.v2=!0:-1===Gd(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var hl=function(e){return"([".concat(zd,"]{1,").concat(e,"})")};function fl(e){var t="[ \\t,]*",n="[:\\..]?[ \\t,-]*",r="#?",o="[ \\t]*";return";ext="+hl("20")+"|"+(t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+n+hl("20")+r)+"|"+(t+"(?:[xx##~~]|int|int)"+n+hl("9")+r)+"|"+("[- ]+"+hl("6")+"#")+"|"+(o+"(?:,{2}|;)"+n+hl("15")+r)+"|"+(o+"(?:,)+"+n+hl("9")+r)}var pl="["+zd+"]{2}",gl="[++]{0,1}(?:["+Hd+"]*["+zd+"]){3,}["+Hd+zd+"]*",vl=new RegExp("^[++]{0,1}(?:["+Hd+"]*["+zd+"]){1,2}$","i"),ml=gl+"(?:"+fl()+")?",$l=new RegExp("^"+pl+"$|^"+ml+"$","i");var yl=new RegExp("(?:"+fl()+")$","i");var bl={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function wl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return El(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return El(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function El(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Cl(e){for(var t,n="",r=wl(e.split(""));!(t=r()).done;){n+=kl(t.value,n)||""}return n}function kl(e,t,n){return"+"===e?t?void("function"==typeof n&&n("end")):"+":function(e){return bl[e]}(e)}function Ol(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return xl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function xl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Sl(e,t){return Il(e,void 0,t)}function Il(e,t,n){var r=n.type(t),o=r&&r.possibleLengths()||n.possibleLengths();if(!o)return"IS_POSSIBLE";if("FIXED_LINE_OR_MOBILE"===t){if(!n.type("FIXED_LINE"))return Il(e,"MOBILE",n);var i=n.type("MOBILE");i&&(o=function(e,t){for(var n,r=e.slice(),o=Ol(t);!(n=o()).done;){var i=n.value;e.indexOf(i)<0&&r.push(i)}return r.sort((function(e,t){return e-t}))}(o,i.possibleLengths()))}else if(t&&!r)return"INVALID_LENGTH";var s=e.length,a=o[0];return a===s?"IS_POSSIBLE":a>s?"TOO_SHORT":o[o.length-1]<s?"TOO_LONG":o.indexOf(s,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function Rl(e,t){return"IS_POSSIBLE"===Sl(e,t)}function jl(e,t){return e=e||"",new RegExp("^(?:"+t+")$").test(e)}function Nl(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ml(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ml(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ml(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Al=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Pl(e,t,n){if(t=t||{},e.country||e.countryCallingCode){(n=new rl(n)).selectNumberingPlan(e.country,e.countryCallingCode);var r=t.v2?e.nationalNumber:e.phone;if(jl(r,n.nationalNumberPattern())){if(Tl(r,"FIXED_LINE",n))return n.type("MOBILE")&&""===n.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":n.type("MOBILE")?Tl(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var o,i=Nl(Al);!(o=i()).done;){var s=o.value;if(Tl(r,s,n))return s}}}}function Tl(e,t,n){return!(!(t=n.type(t))||!t.pattern())&&(!(t.possibleLengths()&&t.possibleLengths().indexOf(e.length)<0)&&jl(e,t.pattern()))}function Dl(e,t,n){var r=new rl(n).getCountryCodesForCallingCode(e);return r?r.filter((function(e){return function(e,t,n){var r=new rl(n);if(r.selectNumberingPlan(t),r.numberingPlan.possibleLengths().indexOf(e.length)>=0)return!0;return!1}(t,e,n)})):[]}var _l=/(\$\d)/;function Ll(e,t,n){var r=n.useInternationalFormat,o=n.withNationalPrefix;n.carrierCode,n.metadata;var i=e.replace(new RegExp(t.pattern()),r?t.internationalFormat():o&&t.nationalPrefixFormattingRule()?t.format().replace(_l,t.nationalPrefixFormattingRule()):t.format());return r?function(e){return e.replace(new RegExp("[".concat(Hd,"]+"),"g")," ").trim()}(i):i}var Wl=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Ul(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ql(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vl(Object(n),!0).forEach((function(t){Bl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Kl={formatExtension:function(e,t,n){return"".concat(e).concat(n.ext()).concat(t)}};function zl(e,t,n,r){if(n=n?ql(ql({},Kl),n):Kl,r=new rl(r),e.country&&"001"!==e.country){if(!r.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";r.selectNumberingPlan(e.countryCallingCode)}var o,i=r.countryCallingCode(),s=n.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return s?Gl(o=Hl(s,e.carrierCode,"NATIONAL",r,n),e.ext,r,n.formatExtension):"";case"INTERNATIONAL":return s?(o=Hl(s,null,"INTERNATIONAL",r,n),Gl(o="+".concat(i," ").concat(o),e.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(s);case"RFC3966":return function(e){var t=e.number,n=e.ext;if(!t)return"";if("+"!==t[0])throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(n?";ext="+n:"")}({number:"+".concat(i).concat(s),ext:e.ext});case"IDD":if(!n.fromCountry)return;var a=function(e,t,n,r,o){var i=cl(r,o.metadata);if(i===n){var s=Hl(e,t,"NATIONAL",o);return"1"===n?n+" "+s:s}var a=function(e,t,n){var r=new rl(n);return r.selectNumberingPlan(e,t),r.defaultIDDPrefix()?r.defaultIDDPrefix():Wl.test(r.IDDPrefix())?r.IDDPrefix():void 0}(r,void 0,o.metadata);if(a)return"".concat(a," ").concat(n," ").concat(Hl(e,null,"INTERNATIONAL",o))}(s,e.carrierCode,i,n.fromCountry,r);return Gl(a,e.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}function Hl(e,t,n,r,o){var i=function(e,t){for(var n,r=Ul(e);!(n=r()).done;){var o=n.value;if(o.leadingDigitsPatterns().length>0){var i=o.leadingDigitsPatterns()[o.leadingDigitsPatterns().length-1];if(0!==t.search(i))continue}if(jl(t,o.pattern()))return o}}(r.formats(),e);return i?Ll(e,i,{useInternationalFormat:"INTERNATIONAL"===n,withNationalPrefix:!i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!o||!1!==o.nationalPrefix,carrierCode:t,metadata:r}):e}function Gl(e,t,n,r){return t?r(e,t,n):e}function Jl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jl(Object(n),!0).forEach((function(t){Xl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var Ql=function(){function e(t,n,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t)throw new TypeError("`country` or `countryCallingCode` not passed");if(!n)throw new TypeError("`nationalNumber` not passed");if(!r)throw new TypeError("`metadata` not passed");var o=function(e,t){var n,r,o=new rl(t);i=e,/^[A-Z]{2}$/.test(i)?(n=e,o.selectNumberingPlan(n),r=o.countryCallingCode()):r=e;var i;return{country:n,countryCallingCode:r}}(t,r),i=o.country,s=o.countryCallingCode;this.country=i,this.countryCallingCode=s,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}var t,n,r;return t=e,n=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:Dl(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return function(e,t,n){if(void 0===t&&(t={}),n=new rl(n),t.v2){if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!n.hasCountry(e.country))throw new Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(e.countryCallingCode)}}if(n.possibleLengths())return Rl(e.phone||e.nationalNumber,n);if(e.countryCallingCode&&n.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(e,t,n){return t=t||{},(n=new rl(n)).selectNumberingPlan(e.country,e.countryCallingCode),n.hasTypes()?void 0!==Pl(e,t,n.metadata):jl(t.v2?e.nationalNumber:e.phone,n.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new rl(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return Pl(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return zl(this,e,t?Zl(Zl({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],n&&Yl(t.prototype,n),r&&Yl(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();var ec=new RegExp("(["+zd+"])");function tc(e,t){var n=function(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(e);if(r){var o,i,s,a=r.length-1,d=a>0&&r[a];if(t.nationalPrefixTransformRule()&&d)o=e.replace(n,t.nationalPrefixTransformRule()),a>1&&(i=r[1]);else{var l=r[0];o=e.slice(l.length),d&&(i=r[1])}if(d){var c=e.indexOf(r[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(s=t.numberingPlan.nationalPrefix())}else s=r[0];return{nationalNumber:o,nationalPrefix:s,carrierCode:i}}}return{nationalNumber:e}}(e,t),r=n.carrierCode,o=n.nationalNumber;if(o!==e){if(!function(e,t,n){if(jl(e,n.nationalNumberPattern())&&!jl(t,n.nationalNumberPattern()))return!1;return!0}(e,o,t))return{nationalNumber:e};if(t.possibleLengths()&&!function(e,t){switch(Sl(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(o,t))return{nationalNumber:e}}return{nationalNumber:o,carrierCode:r}}function nc(e,t,n,r){if(!e)return{};var o;if("+"!==e[0]){var i=function(e,t,n,r){if(t){var o=new rl(r);o.selectNumberingPlan(t,n);var i=new RegExp(o.IDDPrefix());if(0===e.search(i)){var s=(e=e.slice(e.match(i)[0].length)).match(ec);if(!(s&&null!=s[1]&&s[1].length>0&&"0"===s[1]))return e}}}(e,t,n,r);if(!i||i===e){if(t||n){var s=function(e,t,n,r){var o=t?cl(t,r):n;if(0===e.indexOf(o)){(r=new rl(r)).selectNumberingPlan(t,n);var i=e.slice(o.length),s=tc(i,r).nationalNumber,a=tc(e,r).nationalNumber;if(!jl(a,r.nationalNumberPattern())&&jl(s,r.nationalNumberPattern())||"TOO_LONG"===Sl(a,r))return{countryCallingCode:o,number:i}}return{number:e}}(e,t,n,r),a=s.countryCallingCode,d=s.number;if(a)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:a,number:d}}return{number:e}}o=!0,e="+"+i}if("0"===e[1])return{};r=new rl(r);for(var l=2;l-1<=3&&l<=e.length;){var c=e.slice(1,l);if(r.hasCallingCode(c))return r.selectNumberingPlan(c),{countryCallingCodeSource:o?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(l)};l++}return{}}function rc(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return oc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oc(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ic(e,t){var n=t.nationalNumber,r=t.defaultCountry,o=t.metadata,i=o.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:function(e,t){var n=t.countries,r=t.defaultCountry,o=t.metadata;o=new rl(o);for(var i,s=[],a=rc(n);!(i=a()).done;){var d=i.value;if(o.country(d),o.leadingDigits()){if(e&&0===e.search(o.leadingDigits()))return d}else if(Pl({phone:e,country:d},void 0,o.metadata)){if(!r)return d;if(d===r)return d;s.push(d)}}if(s.length>0)return s[0]}(n,{countries:i,defaultCountry:r,metadata:o.metadata})}var sc="(["+zd+"]|[\\-\\.\\(\\)]?)",ac=new RegExp("^\\+"+sc+"*["+zd+"]"+sc+"*$","g"),dc=new RegExp("^("+("["+zd+"]+((\\-)*["+zd+"])*")+"\\.)*"+("[a-zA-Z]+((\\-)*["+zd+"])*")+"\\.?$","g"),lc="tel:",cc=";phone-context=";function uc(e,t){var n,r=t.extractFormattedPhoneNumber,o=function(e){var t=e.indexOf(cc);if(t<0)return null;var n=t+cc.length;if(n>=e.length)return"";var r=e.indexOf(";",n);return r>=0?e.substring(n,r):e.substring(n)}(e);if(!function(e){return null===e||0!==e.length&&(ac.test(e)||dc.test(e))}(o))throw new Kd("NOT_A_NUMBER");if(null===o)n=r(e)||"";else{n="","+"===o.charAt(0)&&(n+=o);var i,s=e.indexOf(lc);i=s>=0?s+lc.length:0;var a=e.indexOf(cc);n+=e.substring(i,a)}var d=n.indexOf(";isub=");if(d>0&&(n=n.substring(0,d)),""!==n)return n}var hc=new RegExp("[++"+zd+"]"),fc=new RegExp("[^"+zd+"#]+$");function pc(e,t,n){if(t=t||{},n=new rl(n),t.defaultCountry&&!n.hasCountry(t.defaultCountry)){if(t.v2)throw new Kd("INVALID_COUNTRY");throw new Error("Unknown country: ".concat(t.defaultCountry))}var r=function(e,t,n){var r=uc(e,{extractFormattedPhoneNumber:function(e){return function(e,t,n){if(!e)return;if(e.length>250){if(n)throw new Kd("TOO_LONG");return}if(!1===t)return e;var r=e.search(hc);if(r<0)return;return e.slice(r).replace(fc,"")}(e,n,t)}});if(!r)return{};if(!function(e){return e.length>=2&&$l.test(e)}(r))return function(e){return vl.test(e)}(r)?{error:"TOO_SHORT"}:{};var o=function(e){var t=e.search(yl);if(t<0)return{};for(var n=e.slice(0,t),r=e.match(yl),o=1;o<r.length;){if(r[o])return{number:n,ext:r[o]};o++}}(r);if(o.ext)return o;return{number:r}}(e,t.v2,t.extract),o=r.number,i=r.ext,s=r.error;if(!o){if(t.v2){if("TOO_SHORT"===s)throw new Kd("TOO_SHORT");throw new Kd("NOT_A_NUMBER")}return{}}var a=function(e,t,n,r){var o,i=nc(Cl(e),t,n,r.metadata),s=i.countryCallingCodeSource,a=i.countryCallingCode,d=i.number;if(a)r.selectNumberingPlan(a);else{if(!d||!t&&!n)return{};r.selectNumberingPlan(t,n),t&&(o=t),a=n||cl(t,r.metadata)}if(!d)return{countryCallingCodeSource:s,countryCallingCode:a};var l=tc(Cl(d),r),c=l.nationalNumber,u=l.carrierCode,h=ic(a,{nationalNumber:c,defaultCountry:t,metadata:r});h&&(o=h,"001"===h||r.country(o));return{country:o,countryCallingCode:a,countryCallingCodeSource:s,nationalNumber:c,carrierCode:u}}(o,t.defaultCountry,t.defaultCallingCode,n),d=a.country,l=a.nationalNumber,c=a.countryCallingCode,u=a.countryCallingCodeSource,h=a.carrierCode;if(!n.hasSelectedNumberingPlan()){if(t.v2)throw new Kd("INVALID_COUNTRY");return{}}if(!l||l.length<2){if(t.v2)throw new Kd("TOO_SHORT");return{}}if(l.length>17){if(t.v2)throw new Kd("TOO_LONG");return{}}if(t.v2){var f=new Ql(c,l,n.metadata);return d&&(f.country=d),h&&(f.carrierCode=h),i&&(f.ext=i),f.__countryCallingCodeSource=u,f}var p=!!(t.extended?n.hasSelectedNumberingPlan():d)&&jl(l,n.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:c,carrierCode:h,valid:p,possible:!!p||!(!0!==t.extended||!n.possibleLengths()||!Rl(l,n)),phone:l,ext:i}:p?function(e,t,n){var r={country:e,phone:t};n&&(r.ext=n);return r}(d,l,i):{}}function gc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gc(Object(n),!0).forEach((function(t){mc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function mc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bc(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);s=!0);}catch(e){a=!0,o=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return wc(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ec(e){var t,n,r,o=bc(Array.prototype.slice.call(e),4),i=o[0],s=o[1],a=o[2],d=o[3];if("string"!=typeof i)throw new TypeError("A text for parsing must be a string.");if(t=i,s&&"string"!=typeof s){if(!Zd(s))throw new Error("Invalid second argument: ".concat(s));a?(n=s,r=a):r=s}else d?(n=a,r=d):(n=void 0,r=a),s&&(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(n),!0).forEach((function(t){yc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({defaultCountry:s},n));return{text:t,options:n,metadata:r}}function Cc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(n),!0).forEach((function(t){Oc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Oc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xc(e,t,n){t&&t.defaultCountry&&!function(e,t){return t.countries.hasOwnProperty(e)}(t.defaultCountry,n)&&(t=kc(kc({},t),{},{defaultCountry:void 0}));try{return function(e,t,n){return pc(e,vc(vc({},t),{},{v2:!0}),n)}(e,t,n)}catch(e){if(!(e instanceof Kd))throw e}}function Sc(){var e=Ec(arguments),t=e.text,n=e.options,r=e.metadata;return xc(t,n,r)}const Ic={enabled:"active",disabled:"disabled",invited:"invited"},Rc=e=>e.tenantRoles.data,jc=e=>e.selectedUsersLoginIds,Nc=e=>e.notifications,Mc=e=>e.customAttributes.data,Ac=Xs((e=>e.usersList.data),(e=>e.map((e=>Object.assign(Object.assign({},e),{status:Ic[e.status]||e.status,roles:e.roleNames}))))),Pc=Xs(jc,Ac,((e,t)=>t.filter((t=>e.includes(t.loginIds))))),Tc=Xs(Pc,(e=>e.map((e=>e.userId)))),Dc=Xs(Pc,(e=>e.map((e=>e.status)))),_c=Xs(Pc,(e=>e.every((e=>e.editable)))),Lc=Xs(jc,(e=>!!e.length)),Wc=Xs(jc,(e=>1===e.length)),Uc=Xs(jc,(e=>{var t;return null===(t=null==e?void 0:e[0])||void 0===t?void 0:t[0]})),Fc=Xs(Wc,Dc,((e,t)=>e&&t.every((e=>e===Ic.enabled)))),Vc=Xs(Dc,(e=>e.every((e=>e===Ic.disabled)))),qc=Xs(Pc,(e=>{var t;return 1===e.length?e[0].name||e[0].email||(null===(t=e[0].loginIds)||void 0===t?void 0:t[0]):`${e.length} users`})),Bc=Xs(Wc,Vc,_c,((e,t,n)=>e&&t&&n)),Kc=Xs(Wc,Fc,_c,((e,t,n)=>e&&t&&n)),zc=Xs(Wc,_c,((e,t)=>e&&t)),Hc=Xs(Wc,_c,((e,t)=>e&&t)),Gc=Xs(Wc,_c,((e,t)=>e&&t)),Jc=Xs(Lc,_c,((e,t)=>e&&t)),Zc=e=>(...t)=>n=>{n.addCase(e.pending,((e,n)=>{t.forEach((({onPending:t})=>{null==t||t(e,n)}))})),n.addCase(e.fulfilled,((e,n)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,n)}))})),n.addCase(e.rejected,((e,n)=>{t.forEach((({onRejected:t})=>{null==t||t(e,n)}))}))},Xc=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,n)=>{e(t).loading=!1,e(t).error=n.error}}),Yc=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,n)=>{t&&e.notifications.push({type:"success",msg:t(n)})},onRejected:(t,n)=>{e&&t.notifications.push({type:"error",msg:e(n)})}}),Qc=ja("users/create",((e,{extra:{api:t}})=>t.user.create(e))),eu=Zc(Qc)({onFulfilled:(e,t)=>{e.usersList.data.unshift(t.payload)}},Xc((e=>e.createUser)),Yc({getSuccessMsg:()=>"User created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),tu={action:Qc,reducer:eu},nu=ja("users/delete",((e,{extra:{api:t}})=>t.user.deleteBatch(e))),ru=Zc(nu)({onFulfilled:(e,t)=>{e.usersList.data=e.usersList.data.filter((e=>!t.meta.arg.includes(e.userId))),e.selectedUsersLoginIds=[]}},Xc((e=>e.deleteUser)),Yc({getSuccessMsg:e=>gi(e.meta.arg.length)`${["",e.meta.arg.length]} ${["U","u"]}ser${["","s"]} deleted successfully`,getErrorMsg:e=>gi(e.meta.arg.length)`Failed to delete user${["","s"]}`})),ou={action:nu,reducer:ru},iu=ja("users/setTempPassword",((e,{extra:{api:t}})=>t.user.setTempPassword(e))),su=Zc(iu)(Xc((e=>e.setTempUserPassword)),Yc({getSuccessMsg:()=>"Successfully reset user password",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to reset user's password</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),au={action:iu,reducer:su},du=ja("users/getCustomAttributes",((e,{extra:{api:t}})=>t.user.getCustomAttributes())),lu=Zc(du)({onFulfilled:(e,t)=>{e.customAttributes.data=t.payload}},Xc((e=>e.customAttributes))),cu={action:du,reducer:lu},uu=ja("users/search",((e,{extra:{api:t},getState:n})=>{const r=n().searchParams;return t.user.search(Object.assign(Object.assign({},r),e))})),hu=Zc(uu)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.usersList.data=t.payload}},Xc((e=>e.usersList))),fu={action:uu,reducer:hu},pu=ja("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),gu=Zc(pu)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},Xc((e=>e.tenantRoles))),vu={action:pu,reducer:gu},mu=ja("users/update",((e,{extra:{api:t}})=>t.user.update(e))),$u=Zc(mu)({onFulfilled:(e,t)=>{const n=e.usersList.data.findIndex((e=>fi(e.loginIds,t.payload.loginIds)));-1!==n&&(e.usersList.data[n]=t.payload)}},Xc((e=>e.updateUser)),Yc({getSuccessMsg:()=>"User updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),yu={action:mu,reducer:$u},bu=ja("users/enable",((e,{extra:{api:t}})=>t.user.enable(e))),wu=Zc(bu)({onFulfilled:(e,t)=>{var n;const r=e.usersList.data.findIndex((e=>{var n;return fi(e.loginIds,null===(n=t.payload.user)||void 0===n?void 0:n.loginIds)}));-1!==r&&(e.usersList.data[r].status=null===(n=t.payload.user)||void 0===n?void 0:n.status)}},Xc((e=>e.enableUser)),Yc({getSuccessMsg:()=>"User enabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to enable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Eu={action:bu,reducer:wu},Cu=ja("users/disable",((e,{extra:{api:t}})=>t.user.disable(e))),ku=Zc(Cu)({onFulfilled:(e,t)=>{var n;const r=e.usersList.data.findIndex((e=>{var n;return fi(e.loginIds,null===(n=t.payload.user)||void 0===n?void 0:n.loginIds)}));-1!==r&&(e.usersList.data[r].status=null===(n=t.payload.user)||void 0===n?void 0:n.status)}},Xc((e=>e.disableUser)),Yc({getSuccessMsg:()=>"User disabled successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to disable user</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Ou={action:Cu,reducer:ku},xu=ja("users/removePasskey",((e,{extra:{api:t}})=>t.user.removePasskey(e))),Su={action:xu,reducer:Zc(xu)(Xc((e=>e.removePasskey)),Yc({getSuccessMsg:()=>"Successfully removed user's passkey",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to remove user's passkey</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}}))},Iu={usersList:{data:[],loading:!1,error:null},createUser:{loading:!1,error:null},updateUser:{loading:!1,error:null},deleteUser:{loading:!1,error:null},enableUser:{loading:!1,error:null},disableUser:{loading:!1,error:null},removePasskey:{loading:!1,error:null},setTempUserPassword:{loading:!1,error:null},customAttributes:{loading:!1,error:null,data:[]},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedUsersLoginIds:[],notifications:[]},Ru="/v1/mgmt/user/search",ju="/v1/mgmt/user/delete/batch",Nu="/v1/mgmt/user/create",Mu="/v1/mgmt/user/update",Au="/v1/mgmt/user/update/status",Pu="/v1/mgmt/user/password/set/temporary",Tu="/v1/mgmt/user/passkeys/delete",Du="/v1/mgmt/user/customattributes",_u="/v1/mgmt/role/all",Lu=e=>u(void 0,void 0,void 0,(function*(){const t=yield e.text(),n=JSON.parse(t);if(!e.ok){const t=`${n.errorDescription}${n.errorMessage?`: ${n.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(n),e.text=()=>Promise.resolve(t)})),Wu=({httpClient:e,tenant:t,mock:n})=>({search:({page:r,limit:o=1e4,customAttributes:i,statuses:s,emails:a,phones:d,text:l,sort:c}={})=>u(void 0,void 0,void 0,(function*(){if(n)return(({text:e,sort:t})=>u(void 0,void 0,void 0,(function*(){return new Promise((n=>{const r=[];for(let e=1;e<9;e+=1)r.push({loginIds:[`user${e}@company.com`],externalIds:[`user${e}@company.com`],userId:`user-${e}`,name:`User ${e}`,email:`user${e}@company.com`,roleNames:[`Role ${e}`],phone:`+1-202-555-010${e}`,verifiedEmail:!0,verifiedPhone:!0,userTenants:[],status:"enabled",editable:!0,createdTime:(new Date).getTime(),customAttributes:{},familyName:"",givenName:"",middleName:"",picture:"",password:!0,SAML:!1,test:!1,TOTP:!1,webauthn:!1});t.forEach((e=>{r.sort(((t,n)=>{var r,o;return e.desc?null===(o=n[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(r=t[e.field])||void 0===r?void 0:r.localeCompare(n[e.field])}))})),n(r.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.phone.toLowerCase().includes(e.toLowerCase())||t.status.toLowerCase().includes(e.toLowerCase())||"active"===e.toLowerCase()||t.familyName.toLowerCase().includes(e.toLowerCase())||t.givenName.toLowerCase().includes(e.toLowerCase())||t.middleName.toLowerCase().includes(e.toLowerCase())||t.email.toLowerCase().includes(e.toLowerCase()))))}))})))({page:r,limit:o,customAttributes:i,statuses:s,emails:a,phones:d,text:l,sort:c});const h=yield e.post(Ru,{limit:o,page:r,withTestUser:!1,customAttributes:i,statuses:s,emails:a,phones:d,text:l,sort:c},{queryParams:{tenant:t}});return yield Lu(h),(yield h.json()).users})),deleteBatch:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(ju,{userIds:r},{queryParams:{tenant:t}});return yield Lu(o),o.json()})),create:({loginId:r,email:o,phone:i,displayName:s,roles:a,customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,givenName:f,middleName:p,familyName:g,additionalLoginIds:v,sendSMS:m,sendMail:$,inviteUrl:y,invite:b})=>u(void 0,void 0,void 0,(function*(){if(n)return(({loginId:e,email:t,phone:n,displayName:r,roles:o,customAttributes:i,picture:s,verifiedEmail:a,verifiedPhone:d,givenName:l,middleName:c,familyName:h})=>u(void 0,void 0,void 0,(function*(){return new Promise((u=>{const f=Math.random().toString(10).substring(15);u({loginIds:[e],externalIds:[e],userId:`user-${f}`,email:t,phone:n,name:r,roleNames:o,customAttributes:i,picture:s,verifiedEmail:a,verifiedPhone:d,givenName:l,middleName:c,familyName:h,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})))({loginId:r,email:o,phone:i,displayName:s,roles:a,customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,givenName:f,middleName:p,familyName:g,additionalLoginIds:v,sendSMS:m,sendMail:$,inviteUrl:y,invite:b});const w=yield e.post(Nu,{loginId:r,email:o,phone:i,displayName:s,givenName:f,middleName:p,familyName:g,roleNames:a,userTenants:[{tenantId:t}],customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,additionalLoginIds:v,sendSMS:m,sendMail:$,inviteUrl:y,invite:b},{queryParams:{tenant:t}});return yield Lu(w),(yield w.json()).user})),update:({loginId:r,email:o,phone:i,displayName:s,roles:a,customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,givenName:f,middleName:p,familyName:g,additionalLoginIds:v})=>u(void 0,void 0,void 0,(function*(){if(n)return(({loginId:e,email:t,phone:n,displayName:r,roles:o,customAttributes:i,picture:s,verifiedEmail:a,verifiedPhone:d,givenName:l,middleName:c,familyName:h})=>u(void 0,void 0,void 0,(function*(){return new Promise((u=>{u({loginIds:[e],externalIds:[e],userId:e,email:t,phone:n,name:r,roleNames:o,customAttributes:i,picture:s,verifiedEmail:a,verifiedPhone:d,givenName:l,middleName:c,familyName:h,createdTime:(new Date).getTime(),editable:!0,password:!0,SAML:!1,status:"enabled",test:!1,TOTP:!1,userTenants:[],webauthn:!1})}))})))({loginId:r,email:o,phone:i,displayName:s,roles:a,customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,givenName:f,middleName:p,familyName:g,additionalLoginIds:v});const m=yield e.post(Mu,{loginId:r,email:o,phone:i,displayName:s,givenName:f,middleName:p,familyName:g,roleNames:a,customAttributes:d,picture:l,verifiedEmail:c,verifiedPhone:h,additionalLoginIds:v},{queryParams:{tenant:t}});return yield Lu(m),(yield m.json()).user})),enable:r=>u(void 0,void 0,void 0,(function*(){if(n)return(e=>u(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"enabled"}})}))})))(r);const o=yield e.post(Au,{loginId:r,status:"enabled"},{queryParams:{tenant:t}});return yield Lu(o),o.json()})),disable:r=>u(void 0,void 0,void 0,(function*(){if(n)return(e=>u(void 0,void 0,void 0,(function*(){return new Promise((t=>{t({user:{loginIds:[e],status:"disabled"}})}))})))(r);const o=yield e.post(Au,{loginId:r,status:"disabled"},{queryParams:{tenant:t}});return yield Lu(o),o.json()})),removePasskey:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(Tu,{loginId:r},{queryParams:{tenant:t}});return yield Lu(o),o.json()})),setTempPassword:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){return new Promise((e=>{e({cleartext:Math.random().toString(20).substring(2)})}))}));const o=yield e.post(Pu,{loginId:r},{queryParams:{tenant:t}});return yield Lu(o),o.json()})),getCustomAttributes:()=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){return new Promise((e=>{e([])}))}));const r=yield e.get(Du,{queryParams:{tenant:t}});return yield Lu(r),(yield r.json()).data}))}),Uu=({httpClient:e,tenant:t,mock:n})=>({getTenantRoles:()=>u(void 0,void 0,void 0,(function*(){if(n)return(e=>new Promise((t=>{const n=[];for(let t=1;t<5;t+=1)n.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:n})})))(t);const r=yield e.get(_u,{queryParams:{tenant:t}});return yield Lu(r),r.json()}))}),Fu=mi((e=>{var t,n,r,o;const i=ci(Ya,Za,Ka,Xa({tenant:Xa.missingAttrValidator}))(e);return o=class extends i{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get tenant(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get api(){return h(this,n,"f")||h(this,t,"m",r).call(this),h(this,n,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{h(this,n,"f")&&h(this,t,"m",r).call(this)}))}))}},n=new WeakMap,t=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),f(this,n,((e,t,n)=>{const r=Hn(Object.assign(Object.assign({},e),{persistTokens:!0}));return{user:Wu({httpClient:r.httpClient,tenant:t,mock:n}),tenant:Uu({httpClient:r.httpClient,tenant:t,mock:n})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenant,"true"===this.mock),"f")},o})),Vu=mi((e=>{const t=ci($d({name:"widget",initialState:Iu,reducers:{setSelectedUsersIds:(e,{payload:t})=>{e.selectedUsersLoginIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{tu.reducer(e),yu.reducer(e),Eu.reducer(e),Ou.reducer(e),ou.reducer(e),fu.reducer(e),au.reducer(e),Su.reducer(e),cu.reducer(e),vu.reducer(e)},asyncActions:{searchUsers:fu.action,createUser:tu.action,updateUser:yu.action,enableUser:Eu.action,disableUser:Ou.action,deleteUsers:ou.action,removePasskey:Su.action,getCustomAttributes:cu.action,getTenantRoles:vu.action,setTempUserPassword:au.action}}),Ja,Ka,Fu)(e);return class extends t{constructor(...e){super(...e),this.state=Iu,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),qu=mi((e=>{const t=ci(Qa,Xa({"widget-id":Xa.missingAttrValidator}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return u(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`user-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Bu=mi((e=>{var t,n,r;return r=class extends(ci(Ka,Ja,dd,ud,qu,Vu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return u(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.init)||void 0===r?void 0:r.call(this),yield Promise.all([h(this,t,"m",n).call(this),this.actions.searchUsers(),this.actions.getTenantRoles(),this.actions.getCustomAttributes()]),this.onWidgetRootReady()}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){const e=ui(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),Ku=mi((e=>{var t,n,r,o,i,s;return s=class extends(ci(Vu,fd,yd,Ka,Bu)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),i.set(this,(()=>u(this,void 0,void 0,(function*(){yield h(this,n,"f").setData(Rc(this.state).map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,i=new WeakMap,t=new WeakSet,r=function(){return u(this,void 0,void 0,(function*(){this.createUserModal=this.createModal(),this.createUserModal.setContent(ui(yield this.fetchWidgetPage("create-user-modal.html")));new ji((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createUserModal.close(),this.resetFormData(this.createUserModal.ele)}));const e=new ji((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});e.onClick((()=>u(this,void 0,void 0,(function*(){this.validateForm(this.createUserModal.ele)&&(this.actions.createUser(Object.assign(Object.assign({},this.getFormData(this.createUserModal.ele)),{invite:!0,verifiedEmail:!0,verifiedPhone:!0})),this.createUserModal.close(),this.resetFormData(this.createUserModal.ele))})))),f(this,n,new Ai((()=>{var e;return null===(e=this.createUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),h(this,i,"f").call(this),this.createUserModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){yield h(this,i,"f").call(this),h(this,t,"m",o).call(this)}))}))},o=function(){const e=Mc(this.state);this.getFormFieldNames(this.createUserModal.ele).forEach((t=>{const[n,r]=t.split(".");if("customAttributes"!==n)return;const o=e.find((e=>e.name===r));o?o.editable||this.disableFormField(this.createUserModal.ele,t):this.removeFormField(this.createUserModal.ele,t)}))},s})),zu=mi((e=>{var t,n,r;return r=class extends(ci(Ka,Ku,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;this.createButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-user"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createUserModal.open()))},r})),Hu=mi((e=>{var t,n,r;return r=class extends(ci(Vu,fd,Ka,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.deleteUsersModal=this.createModal(),this.deleteUsersModal.setContent(ui(yield this.fetchWidgetPage("delete-users-modal.html")));const t=new ji((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteUsersModal.close()));const n=new ji((()=>{var e;return null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=Tc(this.state);this.actions.deleteUsers(e),this.deleteUsersModal.close()}));const r=new Ti(null===(e=this.deleteUsersModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteUsersModal.beforeOpen=()=>{const e=qc(this.state);r.text=`Delete ${e}?`}}))},r})),Gu=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,Hu)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),Jc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.deleteButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-users"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteUsersModal.open()}))},o})),Ju=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Vu,fd,Ka,yd,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",o).call(this)}))}},t=new WeakSet,n=function(){new ji((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.disableUserModal.close()))},r=function(){new ji((()=>{var e;return null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=Uc(this.state);this.actions.disableUser(e),this.disableUserModal.close()}))},o=function(){var e;return u(this,void 0,void 0,(function*(){this.disableUserModal=this.createModal(),this.disableUserModal.setContent(ui(yield this.fetchWidgetPage("disable-user-modal.html"))),h(this,t,"m",n).call(this),h(this,t,"m",r).call(this);const o=new Ti(null===(e=this.disableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.disableUserModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){const e=qc(this.state);o.text=`Disable ${e}?`}))}))},i})),Zu=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,Ju,yd)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.disableButton.enable():this.disableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),Kc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.disableButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="disable-user"]'),{logger:this.logger}),this.disableButton.disable(),this.disableButton.onClick((()=>{this.disableUserModal.open()}))},o})),Xu=["customAttributes"],Yu=e=>{if(!e)return e;const t=function(){return Td(Sc,arguments)}(e),n=new RegExp(`(\\+?${null==t?void 0:t.countryCallingCode})(.*)`);return t.number.replace(n,"$1-$2")},Qu=mi((e=>{var t,n,r,o,i,s,a,d,l,p;return p=class extends(ci(Vu,fd,Ka,yd,Bu)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),r.set(this,void 0),s.set(this,(()=>u(this,void 0,void 0,(function*(){yield h(this,r,"f").setData(Rc(this.state).map((({name:e})=>({value:e,label:e}))))})))),d.set(this,(()=>{var e,t;const n=null===(e=Pc(this.state))||void 0===e?void 0:e[0],r=Object.assign({loginId:null===(t=null==n?void 0:n.loginIds)||void 0===t?void 0:t.join(", "),displayName:null==n?void 0:n.name,email:null==n?void 0:n.email,phone:Yu(null==n?void 0:n.phone),roles:null==n?void 0:n.roles},(o=n.customAttributes,"customAttributes.",Object.fromEntries(Object.entries(o||{}).map((([e,t])=>[`customAttributes.${e}`,t])))));var o;this.setFormData(this.editUserModal.ele,r)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",l).call(this)}))}},n=new WeakMap,r=new WeakMap,s=new WeakMap,d=new WeakMap,t=new WeakSet,o=function(){new ji((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editUserModal.close()))},i=function(){new ji((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{if(this.validateForm(this.editUserModal.ele)){const e=this.getFormData(this.editUserModal.ele),{loginId:t}=e,n=c(e,["loginId"]);this.actions.updateUser(Object.assign({loginId:t.split(", ")[0]},(e=>Object.entries(e).reduce(((e,[t,n])=>{const[r,...o]=t.split(".");return Xu.includes(r)?(e[r]||(e[r]={}),e[r][o.join(".")]=n,e):Object.assign(e,{[t]:n})}),{}))(n))),this.editUserModal.close(),this.resetFormData(this.editUserModal.ele)}}))},a=function(){const e=Mc(this.state);this.getFormFieldNames(this.editUserModal.ele).forEach((t=>{const[n,r]=t.split(".");if("customAttributes"!==n)return;const o=e.find((e=>e.name===r));o?o.editable||this.disableFormField(this.editUserModal.ele,t):this.removeFormField(this.editUserModal.ele,t)}))},l=function(){var e;return u(this,void 0,void 0,(function*(){this.editUserModal=this.createModal(),this.editUserModal.setContent(ui(yield this.fetchWidgetPage("edit-user-modal.html"))),h(this,t,"m",o).call(this),h(this,t,"m",i).call(this),f(this,n,new Di(null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[name="loginId"]'),{logger:this.logger}),"f"),f(this,r,new Ai((()=>{var e;return null===(e=this.editUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),this.editUserModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){yield h(this,s,"f").call(this),h(this,n,"f").disable(),h(this,d,"f").call(this),h(this,t,"m",a).call(this)}))}))},p})),eh=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,Qu,yd)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),zc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.editButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-user"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editUserModal.open()}))},o})),th=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Vu,fd,Ka,yd,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",o).call(this)}))}},t=new WeakSet,n=function(){new ji((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.enableUserModal.close()))},r=function(){new ji((()=>{var e;return null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=Uc(this.state);this.actions.enableUser(e),this.enableUserModal.close()}))},o=function(){var e;return u(this,void 0,void 0,(function*(){this.enableUserModal=this.createModal(),this.enableUserModal.setContent(ui(yield this.fetchWidgetPage("enable-user-modal.html"))),h(this,t,"m",n).call(this),h(this,t,"m",r).call(this);const o=new Ti(null===(e=this.enableUserModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.enableUserModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){const e=qc(this.state);o.text=`Activate ${e}?`}))}))},i})),nh=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,th,yd)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.enableButton.enable():this.enableButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),Bc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.enableButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="enable-user"]'),{logger:this.logger}),this.enableButton.disable(),this.enableButton.onClick((()=>{this.enableUserModal.open()}))},o})),rh=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu)(e)){constructor(){super(...arguments),t.add(this),n.set(this,vi((()=>{this.actions.searchUsers({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){var e;this.searchInput=new Di(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(h(this,n,"f"))},o})),oh={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="#FFDFDD"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},ih=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Ka,Vu,gd,Ja)(e)){constructor(){super(...arguments),t.add(this),o.set(this,pi((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const i=h(this,t,"m",r).call(this,e);i.setContent(h(this,t,"m",n).call(this,{type:e,msg:o})),i.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(h(this,o,"f").bind(this),Nc)}))}},o=new WeakMap,t=new WeakSet,n=function({type:e,msg:t}){const n=oh[e],r=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==n?void 0:n.outerHTML)||""}${t}${r.outerHTML}`},r=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},i})),sh=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Vu,fd,Ka,yd,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",o).call(this)}))}},t=new WeakSet,n=function(){new ji((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.removePasskeyModal.close()))},r=function(){new ji((()=>{var e;return null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{const e=Uc(this.state);this.actions.removePasskey(e),this.removePasskeyModal.close()}))},o=function(){var e;return u(this,void 0,void 0,(function*(){this.removePasskeyModal=this.createModal(),this.removePasskeyModal.setContent(ui(yield this.fetchWidgetPage("remove-passkey-modal.html"))),h(this,t,"m",n).call(this),h(this,t,"m",r).call(this);const o=new Ti(null===(e=this.removePasskeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.removePasskeyModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){const e=qc(this.state);o.text=`Remove passkey for ${e}?`}))}))},i})),ah=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,sh,yd)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.removePasskeyButton.enable():this.removePasskeyButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),Hc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.removePasskeyButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="remove-passkey"]'),{logger:this.logger}),this.removePasskeyButton.disable(),this.removePasskeyButton.onClick((()=>{this.removePasskeyModal.open()}))},o})),dh=mi((e=>{var t,n,r,o,i,s,a,d;return d=class extends(ci(Vu,Ka,Bu)(e)){constructor(){super(...arguments),t.add(this),o.set(this,pi((e=>{this.usersTable.data=e}))),i.set(this,vi(((e,t)=>{const n=[],{value:r}=t;if(r){const t=e.path;n.push({field:t,desc:"desc"===r})}this.actions.searchUsers({sort:n})}))),s.set(this,pi((e=>{this.usersTable.filterColumns((t=>{var n;const[r,o]=(null===(n=t.path)||void 0===n?void 0:n.split("."))||[];return"customAttributes"!==r||!!(null==e?void 0:e.find((e=>e.name===o)))}))})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this),h(this,o,"f").call(this,Ac(this.state)),h(this,s,"f").call(this,Mc(this.state)),this.subscribe(h(this,s,"f").bind(this),Mc),this.subscribe(h(this,o,"f").bind(this),Ac)}))}},o=new WeakMap,i=new WeakMap,s=new WeakMap,t=new WeakSet,n=function(){const e=e=>{var t;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(`[path="${e}"]`)},t=e=>{var t;const n=`descope-grid-${e}-column`;return null===(t=this.usersTable.ele)||void 0===t?void 0:t.querySelector(n)},n=this.usersTable.renderColumn;this.usersTable.renderColumn=({path:r,header:o,type:i,attrs:s})=>{const a=e(r)||t(i);if(!a)return n({path:r,header:o,type:i,attrs:s});const d=a.cloneNode(!0),l=Object.assign(Object.assign({},s),{header:o});return Object.entries(l).forEach((([e,t])=>{d.setAttribute(e,t)})),d.outerHTML}},r=function(){var e;this.usersTable=new Ri(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="users-table"]'),{logger:this.logger}),this.usersTable.onSelectedItemsChange((e=>{this.actions.setSelectedUsersIds(e.detail.value.map((({loginIds:e})=>e)))})),this.usersTable.onColumnsChange(h(this,t,"m",a).bind(this)),h(this,t,"m",n).call(this),h(this,t,"m",a).call(this)},a=function(){this.usersTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{h(this,i,"f").call(this,e.target,e.detail)}))}))},d})),lh=mi((e=>{var t,n,r;return r=class extends(ci(Vu,fd,Ka,yd,Bu)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){this.generatedPasswordModal=this.createModal(),this.generatedPasswordModal.setContent(ui(yield this.fetchWidgetPage("generated-password-modal.html")));new ji((()=>{var e;return null===(e=this.generatedPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.generatedPasswordModal.ele)["generated-password"]),this.resetFormData(this.generatedPasswordModal.ele),this.generatedPasswordModal.close()}))}))},r})),ch=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Vu,fd,Ka,yd,Bu,lh)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",o).call(this)}))}},t=new WeakSet,n=function(){new ji((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.resetPasswordModal.close()))},r=function(){new ji((()=>{var e;return null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>u(this,void 0,void 0,(function*(){var e;const t=Uc(this.state),n=yield this.actions.setTempUserPassword(t);this.resetPasswordModal.close(),this.setFormData(this.generatedPasswordModal.ele,{"generated-password":null===(e=null==n?void 0:n.payload)||void 0===e?void 0:e.cleartext}),this.generatedPasswordModal.open()}))))},o=function(){var e;return u(this,void 0,void 0,(function*(){this.resetPasswordModal=this.createModal(),this.resetPasswordModal.setContent(ui(yield this.fetchWidgetPage("reset-password-modal.html"))),h(this,t,"m",n).call(this),h(this,t,"m",r).call(this);const o=new Ti(null===(e=this.resetPasswordModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.resetPasswordModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){const e=qc(this.state);o.text=`This will generate a new temporary password for ${e}?`}))}))},i})),uh=mi((e=>{var t,n,r,o;return o=class extends(ci(Ka,Bu,Vu,ch,yd)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.resetPasswordButton.enable():this.resetPasswordButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){h(this,t,"m",n).call(this),yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),this.subscribe(h(this,r,"f").bind(this),Gc)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.resetPasswordButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="reset-password"]'),{logger:this.logger}),this.resetPasswordButton.disable(),this.resetPasswordButton.onClick((()=>{this.resetPasswordModal.open()}))},o})),hh=mi((e=>class extends(ci(td,md,dh,zu,Gu,eh,nh,Zu,uh,ah,rh,ih)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),fh=ci((e=>class extends(hh(e)){}))(HTMLElement);customElements.define("descope-user-management-widget",fh);var ph=Object.freeze({__proto__:null,default:fh});((...e)=>{const t=Zs(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(ns(e)?_s(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(Js);var gh="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Hi:Hi.apply(null,arguments)},vh=e=>e&&"function"==typeof e.match;function mh(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("production"===process.env.NODE_ENV?nf(0):"prepareAction did not return an object");return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Ji(t)&&t.type===e,n}function $h(e){return"function"==typeof e&&"type"in e&&vh(e)}function yh(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var bh=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function wh(e){return rs(e)?Us(e,(()=>{})):e}function Eh(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error("production"===process.env.NODE_ENV?nf(10):"No insert provided for key not already in map");const r=n.insert(t,e);return e.set(t,r),r}function Ch(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function kh(e,t,n){const r=Oh(e,t,n);return{detectMutations:()=>xh(e,t,r,n)}}function Oh(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=Oh(e,t,n[o],s))}}return i}function xh(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||e(r))return{wasMutated:!1};const d={};for(let e in n.children)d[e]=!0;for(let e in r)d[e]=!0;const l=t.length>0;for(let o in d){const s=i?i+"."+o:o;if(l){if(t.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}const d=xh(e,t,n.children[o],r[o],a,s);if(d.wasMutated)return d}return{wasMutated:!1}}function Sh(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||Fi(e)}function Ih(e,t="",n=Sh,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),d=o.length>0;for(const[e,l]of a){const a=t?t+"."+e:e;if(d){if(o.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}if(!n(l))return{keyPath:a,value:l};if("object"==typeof l&&(s=Ih(l,a,n,r,o,i),s))return s}return i&&Rh(e)&&i.add(e),!1}function Rh(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!Rh(t))return!1;return!0}function jh(e){return"boolean"==typeof e}var Nh=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new bh;if(t&&(jh(t)?i.push(ea):i.push(ta(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};jh(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=Ch,ignoredPaths:o,warnAfter:i=32}=e;const s=kh.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return a=>d=>{const l=yh(i,"ImmutableStateInvariantMiddleware");l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?nf(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const c=a(d);return l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?nf(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(d)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),l.warnIfExceeded(),c}}}}(e))}if(r){let e={};jh(r)||(e=r),i.push(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=Sh,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:d=!1,disableCache:l=!1}=e,c=!l&&WeakSet?new WeakSet:void 0;return e=>l=>u=>{if(!Ji(u))return l(u);const h=l(u),f=yh(s,"SerializableStateInvariantMiddleware");return d||r.length&&-1!==r.indexOf(u.type)||f.measureTime((()=>{const e=Ih(u,"",t,n,o,c);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",u,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),a||(f.measureTime((()=>{const r=Ih(e.getState(),"",t,n,i,c);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${u.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),h}}}(e))}if(o){let e={};jh(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=$h}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},Mh=e=>t=>{setTimeout(t,e)},Ah="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Mh(10),Ph=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new bh(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,d="tick"===e.type?queueMicrotask:"raf"===e.type?Ah:"callback"===e.type?e.queueNotification:Mh(e.timeout),l=()=>{s=!1,i&&(i=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,d(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},Th="production"===process.env.NODE_ENV;function Dh(e){const t={},n=[];let r;const o={addCase(e,i){if("production"!==process.env.NODE_ENV){if(n.length>0)throw new Error("production"===process.env.NODE_ENV?nf(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error("production"===process.env.NODE_ENV?nf(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const s="string"==typeof e?e:e.type;if(!s)throw new Error("production"===process.env.NODE_ENV?nf(28):"`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error("production"===process.env.NODE_ENV?nf(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);return t[s]=i,o},addMatcher(e,t){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?nf(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?nf(31):"`builder.addDefaultCase` can only be called once");return r=e,o}};return e(o),[t,n,r]}var _h=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function Lh(...e){return t=>e.some((e=>((e,t)=>vh(e)?e.match(t):e(t))(e,t)))}var Wh=["name","message","stack","code"],Uh=class{constructor(e,t){this.payload=e,this.meta=t}_type},Fh=class{constructor(e,t){this.payload=e,this.meta=t}_type},Vh=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of Wh)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},qh=(()=>{function e(e,t,n){const r=mh(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=mh(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=mh(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||Vh)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(s,a,d)=>{const l=n?.idGenerator?n.idGenerator(e):_h(),c=new AbortController;let u,h;function f(e){h=e,c.abort()}const p=async function(){let p;try{let i=n?.condition?.(e,{getState:a,extra:d});if(null!==(g=i)&&"object"==typeof g&&"function"==typeof g.then&&(i=await i),!1===i||c.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{u=()=>{t({name:"AbortError",message:h||"Aborted"})},c.signal.addEventListener("abort",u)}));s(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:d}))),p=await Promise.race([v,Promise.resolve(t(e,{dispatch:s,getState:a,extra:d,requestId:l,signal:c.signal,abort:f,rejectWithValue:(e,t)=>new Uh(e,t),fulfillWithValue:(e,t)=>new Fh(e,t)})).then((t=>{if(t instanceof Uh)throw t;return t instanceof Fh?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){p=t instanceof Uh?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{u&&c.signal.removeEventListener("abort",u)}var g;return n&&!n.dispatchConditionRejection&&i.match(p)&&p.meta.condition||s(p),p}();return Object.assign(p,{abort:f,requestId:l,arg:e,unwrap:()=>p.then(Bh)})}}),{pending:o,rejected:i,fulfilled:r,settled:Lh(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Bh(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Kh=Symbol.for("rtk-slice-createasyncthunk");function zh(e,t){return`${e}/${t}`}function Hh({creators:e}={}){const t=e?.asyncThunk?.[Kh];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error("production"===process.env.NODE_ENV?nf(11):"`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&void 0===e.initialState&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error("production"===process.env.NODE_ENV?nf(12):"`context.addCase` cannot be called with an empty action type");if(n in s.sliceCaseReducersByType)throw new Error("production"===process.env.NODE_ENV?nf(13):"`context.addCase` cannot be called with two reducers for the same action type: "+n);return s.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(s.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(s.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(s.sliceCaseReducersByName[e]=t,a)};function d(){if("production"!==process.env.NODE_ENV&&"object"==typeof e.extraReducers)throw new Error("production"===process.env.NODE_ENV?nf(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[t={},n=[],r]="function"==typeof e.extraReducers?Dh(e.extraReducers):[e.extraReducers],o={...t,...s.sliceCaseReducersByType};return function(e,t){if("production"!==process.env.NODE_ENV&&"object"==typeof t)throw new Error("production"===process.env.NODE_ENV?nf(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let n,[r,o,i]=Dh(t);if(function(e){return"function"==typeof e}(e))n=()=>wh(e());else{const t=wh(e);n=()=>t}function s(e=n(),t){let s=[r[t.type],...o.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===s.filter((e=>!!e)).length&&(s=[i]),s.reduce(((e,n)=>{if(n){if(ns(e)){const r=n(e,t);return void 0===r?e:r}if(rs(e))return Us(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error("production"===process.env.NODE_ENV?nf(9):"A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=n,s}(e.initialState,(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of s.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}))}i.forEach((r=>{const i=o[r],s={reducerName:r,type:zh(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,s;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error("production"===process.env.NODE_ENV?nf(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=r.reducer,s=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?mh(e,s):mh(e))}(s,i,a):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error("production"===process.env.NODE_ENV?nf(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:s,pending:a,rejected:d,settled:l,options:c}=n,u=o(e,i,c);r.exposeAction(t,u),s&&r.addCase(u.fulfilled,s);a&&r.addCase(u.pending,a);d&&r.addCase(u.rejected,d);l&&r.addMatcher(u.settled,l);r.exposeCaseReducer(t,{fulfilled:s||Zh,pending:a||Zh,rejected:d||Zh,settled:l||Zh})}(s,i,a,t)}));const l=e=>e,c=new Map;let u;function h(e,t){return u||(u=d()),u(e,t)}function f(){return u||(u=d()),u.getInitialState()}function p(t,n=!1){function r(e){let r=e[t];if(void 0===r)if(n)r=f();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?nf(15):"selectSlice returned undefined for an uninjected slice reducer");return r}function o(t=l){const r=Eh(c,n,{insert:()=>new WeakMap});return Eh(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=Gh(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:h,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:f,...p(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:h},n),{...g,...p(o,!0)}}};return g}}function Gh(e,t,n,r){function o(o,...i){let s=t(o);if(void 0===s)if(r)s=n();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?nf(16):"selectState returned undefined for an uninjected slice reducer");return e(s,...i)}return o.unwrapped=e,o}var Jh=Hh();function Zh(){}var Xh="listenerMiddleware",Yh=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=mh(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("production"===process.env.NODE_ENV?nf(21):"Creating or removing a listener requires one of the known fields for matching an action");return((e,t)=>{if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?nf(32):`${t} is not a function`)})(i,"options.listener"),{predicate:o,type:t,effect:i}},Qh=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Yh(e);return{id:_h(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("production"===process.env.NODE_ENV?nf(22):"Unsubscribe not initialized")}}}),{withTypes:()=>Qh}),ef=Object.assign(mh(`${Xh}/add`),{withTypes:()=>ef});mh(`${Xh}/removeAll`);var tf=Object.assign(mh(`${Xh}/remove`),{withTypes:()=>tf});function nf(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const rf=["error","warn","info","debug"],of=mi((e=>{var t,n,r,o;return o=class extends e{constructor(){super(...arguments),t.add(this),n.set(this,h(this,t,"m",r).call(this,console))}set logger(e){f(this,n,h(this,t,"m",r).call(this,e),"f")}get logger(){return h(this,n,"f")}onLogEvent(e,t){}},n=new WeakMap,t=new WeakSet,r=function(e){return rf.reduce(((t,n)=>(t[n]=(...t)=>{var r;this.onLogEvent(n,t),null===(r=e[n])||void 0===r||r.call(e,...t)},t)),{})},o})),sf="undefined"!=typeof localStorage,af=sf&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",df=(e,t)=>!t&&`${e} cannot be empty`,lf=mi((e=>{var t,n;return n=class extends e{constructor(){super(...arguments),t.set(this,!0)}connectedCallback(){var e,n;null===(e=super.connectedCallback)||void 0===e||e.call(this),(null===(n=this.shadowRoot)||void 0===n?void 0:n.isConnected)&&h(this,t,"f")&&(f(this,t,!1,"f"),this.init())}async init(){}},t=new WeakMap,n})),cf=mi((e=>{var t,n;const r=ci(of,lf)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,{})}async init(){var e,n,r;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),n=this,r=e=>{var n;null===(n=h(this,t,"f")[e])||void 0===n||n.forEach((t=>{t(e,this.getAttribute(e))}))},Array.from(n.attributes).forEach((e=>r(e.name))),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&r(e.attributeName)}))})).observe(n,{attributes:!0})}observeAttribute(e,n){h(this,t,"f")[e]||(h(this,t,"f")[e]=[]);const r=h(this,t,"f")[e].push(n);return()=>h(this,t,"f")[e].splice(r,1)}observeAttributes(e,t){const n=e.reduce(((e,n)=>(e.push(this.observeAttribute(n,t)),e)),[]);return()=>n.forEach((e=>e()))}},t=new WeakMap,n})),uf=e=>t=>{var n,r,o;const i=ci(of,lf,cf)(t),s=Object.keys(e);return o=class extends i{constructor(...e){super(...e),n.add(this),this.observeAttributes(s,h(this,n,"m",r).bind(this))}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),s.forEach((e=>h(this,n,"m",r).call(this,e,this.getAttribute(e))))}},n=new WeakSet,r=function(t,n){const r=e[t],o="function"==typeof r?r(t,n):r;o&&this.logger.error(o)},o};uf.missingAttrValidator=df;const hf=mi((e=>{const t=ci(uf({"project-id":df}))(e);return class extends t{get projectId(){return this.getAttribute("project-id")}}}));const ff=mi((e=>{const t=ci(of,hf)(e);return class extends t{async fetchStaticResource(e,t){const n=function(e,t,n="v2-beta"){const r=new URL(af);return r.pathname=hi(r.pathname,e,n,t),r.toString()}(this.projectId,e),r=await fetch(n,{cache:"default"});return r.ok||this.logger.error(`Error fetching URL ${n} [${r.status}]`),{body:await r[t](),headers:Object.fromEntries(r.headers.entries())}}}})),pf=mi((e=>{var t,n,r;const o=ci(ff)(e);return r=class extends o{constructor(){super(...arguments),t.set(this,void 0),n.set(this,(async()=>{try{const{body:e,headers:t}=await this.fetchStaticResource("config.json","json");return{projectConfig:e,executionContext:{geo:t["x-geo"]}}}catch(e){this.logger.error("Cannot fetch config file","make sure that your projectId & flowId are correct")}}))}get config(){return h(this,t,"f")||f(this,t,h(this,n,"f").call(this),"f"),h(this,t,"f")}},t=new WeakMap,n=new WeakMap,r})),gf=mi((e=>{var t,n,r,o,i,s,a;return a=class extends(ci(lf,of)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),this.attributeChangedCallback=(e,n,r)=>{var o;null===(o=super.attributeChangedCallback)||void 0===o||o.call(this,e,n,r),"debug"===e&&h(this,t,"m",i).call(this)}}get debug(){return"true"===this.getAttribute("debug")}onLogEvent(e,n){var r;null===(r=super.onLogEvent)||void 0===r||r.call(this,e,n),"error"===e&&h(this,t,"m",s).call(this,n[0]||"Error",n[1])}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this)}},n=new WeakMap,t=new WeakSet,r=function(){var e;null===(e=h(this,n,"f"))||void 0===e||e.remove(),f(this,n,null,"f")},o=async function(){f(this,n,document.createElement("descope-debugger"),"f"),Object.assign(h(this,n,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),await Promise.resolve().then((function(){return Hf})),document.body.appendChild(h(this,n,"f"))},i=function(){this.debug?h(this,t,"m",o).call(this):h(this,t,"m",r).call(this)},s=function(e,t){var r;e&&(null===(r=h(this,n,"f"))||void 0===r||r.updateData({title:e,description:t}))},a})),vf="load-descope-ui",mf="base.ui.components.url",$f=sf&&localStorage.getItem(mf)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",yf=sf&&localStorage.getItem(mf)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",bf=e=>{const t=document.createElement("script");return t.id=e,t},wf=(e,t)=>e.replace("<version>",t),Ef=mi((e=>{var t,n,r,o,i,s,a,d,l,c,u,p;const g=ci(of,pf)(e);return p=class extends g{constructor(){super(...arguments),t.add(this),n.set(this,Symbol("errorCbs")),r.set(this,Symbol("loadCbs")),l.set(this,void 0)}get descopeUi(){return h(this,l,"f")||f(this,l,h(this,t,"m",u).call(this),"f"),h(this,l,"f")}async loadDescopeUiComponents(e){const n=Array.isArray(e)?e:(e=>[...Array.from(e.content.querySelectorAll("*")).reduce(((e,t)=>t.localName.startsWith("descope-")?e.add(t.localName):e),new Set)])(e);return Promise.all(n.map((e=>h(this,t,"m",c).call(this,e))))}},n=new WeakMap,r=new WeakMap,l=new WeakMap,t=new WeakSet,o=async function(){var e;const t=await this.config,n=null===(e=null==t?void 0:t.projectConfig)||void 0===e?void 0:e.componentsVersion;return n?this.logger.debug(`Got component version "${n}"`):this.logger.error("Could not get components version"),n},i=function(e){const t=h(this,n,"f"),o=h(this,r,"f");e[t]=[],e[o]=[],Object.defineProperty(e,"onerror",{set(n){e[t].push(n)}}),Object.defineProperty(e,"onload",{set(t){e[o].push(t)}})},s=async function(e,n){this.logger.debug("Trying to load DescopeUI from a fallback URL");const r=bf("load-descope-ui-fallback-script");document.body.append(r),r.addEventListener("error",(()=>{e.forEach((e=>e(`Cannot load DescopeUI from fallback URL, Make sure this URL is valid and return the correct script: "${r.src}"`)))})),r.addEventListener("load",(()=>{n.forEach((e=>e()))})),r.src=wf(yf,await h(this,t,"m",o).call(this))},a=function(e){e.addEventListener("error",(()=>{e[h(this,n,"f")].forEach((t=>t(`Cannot load DescopeUI from main URL, Make sure this URL is valid and return the correct script: "${e.src}"`))),h(this,t,"m",s).call(this,e[h(this,n,"f")],e[h(this,r,"f")])})),e.addEventListener("load",(()=>{e[h(this,r,"f")].forEach((e=>e()))}))},d=async function(){if(document.querySelector(`script#${vf}`))this.logger.debug("DescopeUI loading script already exists",this);else{this.logger.debug("DescopeUI loading script does not exist, creating it",this);const e=bf(vf);document.body.append(e),h(this,t,"m",i).call(this,e),h(this,t,"m",a).call(this,e),e.src=wf($f,await h(this,t,"m",o).call(this))}return document.getElementById(vf)},c=async function(e){if(!!customElements.get(e))return void this.logger.debug(`Loading component "${e}" is skipped as it is already defined`);const t=await this.descopeUi;if(t[e])try{return await t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`Encountered an error while attempting to define the "${e}" component, it is likely that this component is already defined`)}else this.logger.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)},u=function(){return new Promise((e=>{globalThis.DescopeUI&&e(globalThis.DescopeUI),h(this,t,"m",d).call(this).then((t=>{t.onerror=this.logger.error,t.onload=()=>{this.logger.debug("DescopeUI was loaded"),e(globalThis.DescopeUI)},setTimeout((()=>{globalThis.DescopeUI&&e(globalThis.DescopeUI)}))}))}))},p})),Cf="content-root",kf="root",Of=mi((e=>class extends e{constructor(...e){var t,n;super(...e),this.attachShadow({mode:"open"}).innerHTML=`\n\n <style>\n #${kf}, #${Cf} {\n height: 100%;\n }\n #${kf} {\n position: relative;\n }\n #${Cf} {\n display: flex;\n }\n </style>\n <div id="${kf}">\n <div id="${Cf}"></div>\n </div>\n `,this.contentRootElement=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(Cf),this.rootElement=null===(n=this.shadowRoot)||void 0===n?void 0:n.getElementById(kf)}})),xf="descope-modal",Sf=mi((e=>{var t,n;const r=ci(lf,Of,Ef)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Mi{setContent(t){e(t),super.setContent(t)}}})())}createModal(e){const n=((e={})=>{const t=document.createElement(xf);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;this.loadDescopeUiComponents([xf]),await(null===(e=super.init)||void 0===e?void 0:e.call(this))}},t=new WeakMap,n})),If="descope-notification",Rf=mi((e=>{var t,n;const r=ci(lf,Of,Ef)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Pi{setContent(t){const n="string"==typeof t?ui(t):t;e(n),super.setContent(n)}}})())}createNotification(e){const n=((e={})=>{const t=document.createElement(If);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),this.loadDescopeUiComponents([If])}},t=new WeakMap,n})),jf=(e,t)=>!!t&&"light"!==t&&"dark"!==t&&'Supported theme values are "light", "dark", or leave empty for using the OS theme',Nf=mi((e=>{var t,n,r,o,i,s,a,d,l;const c=ci(uf({theme:jf}),ff,lf,Ef,pf,Of)(e);return l=class extends c{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get theme(){return"light"}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this),h(this,t,"m",s).call(this),h(this,t,"m",a).call(this),h(this,t,"m",d).call(this)}},n=new WeakMap,t=new WeakSet,r=async function(){try{const{body:e}=await this.fetchStaticResource("theme.json","json");return e}catch(e){this.logger.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}},o=function(){return h(this,n,"f")||(f(this,n,h(this,t,"m",r).call(this),"f"),h(this,n,"f").then((e=>this.logger.debug("Fetched theme",e)))),h(this,n,"f")},i=async function(){var e,n;const r=await h(this,t,"a",o);if(!r)return;const i=document.createElement("style");i.innerText=((null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.globals)||"")+((null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.globals)||""),this.shadowRoot.appendChild(i)},s=async function(){var e,n;const r=Object.assign({},await h(this,t,"a",o));if(!r)return;const i=await this.descopeUi;(null==i?void 0:i.componentsThemeManager)&&(i.componentsThemeManager.themes={light:null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.components,dark:null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.components})},a=async function(){var e,t;const{projectConfig:n}=await this.config,r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>{e.url&&(this.logger.debug(`Loading font from URL "${e.url}"`),(e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url))}))},d=async function(){this.rootElement.setAttribute("data-theme",this.theme);const e=await this.descopeUi;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)},l})),Mf=e=>mi((t=>{const n=Jh(e),r=Object.assign(Object.assign({},n.actions),e.asyncActions);return class extends(ci(of)(t)){constructor(...e){super(...e);const t=function(e){const t=Nh(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:s}=e||{};let a,d;if("function"==typeof n)a=n;else{if(!Fi(n))throw new Error("production"===process.env.NODE_ENV?nf(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");a=zi(n)}if(!Th&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?nf(2):"`middleware` field must be a callback");if("function"==typeof r){if(d=r(t),!Th&&!Array.isArray(d))throw new Error("production"===process.env.NODE_ENV?nf(3):"when using a middleware builder function, an array of middleware must be returned")}else d=t();if(!Th&&d.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?nf(4):"each middleware provided to configureStore must be a function");let l=Hi;o&&(l=gh({trace:!Th,..."object"==typeof o&&o}));const c=Gi(...d),u=Ph(c);if(!Th&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?nf(5):"`enhancers` field must be a callback");let h="function"==typeof s?s(u):u();if(!Th&&!Array.isArray(h))throw new Error("production"===process.env.NODE_ENV?nf(6):"`enhancers` callback must return an array");if(!Th&&h.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?nf(7):"each enhancer provided to configureStore must be a function");return Th||!d.length||h.includes(c)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),Bi(a,i,l(...h))}({reducer:n.reducer,middleware:e=>e({thunk:{extraArgument:this},serializableCheck:!1}),devTools:!1}),o=e=>async(...n)=>{const r=await t.dispatch(e(...n));try{Bh(r)}catch(e){this.logger.error(e.message,r.type,e.stack)}return r},i=Object.keys(r).reduce(((e,t)=>(e[t]=o(r[t]),e)),{});this.actions=i,this.subscribe=(e,n=(e=>e))=>t.subscribe((()=>e(n(t.getState()))))}}})),Af=mi((e=>class extends(of(e)){validateForm(e){return this.getFormInputs(e).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))}getFormInputs(e){return e?Array.from(e.querySelectorAll("[name]")):(this.logger.debug("cannot get form inputs, no root element was received"),[])}getFormData(e){return this.getFormInputs(e).reduce(((e,t)=>Object.assign(e,{[t.getAttribute("name")]:t.value})),{})}setFormData(e,t){this.getFormInputs(e).forEach((e=>{t.hasOwnProperty(e.getAttribute("name"))&&(e.value=t[e.getAttribute("name")])}))}resetFormData(e){this.getFormInputs(e).forEach((e=>{e.value="",e.checked=!1}))}getFormFieldNames(e){return this.getFormInputs(e).map((e=>e.name))}disableFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.setAttribute("disabled","true")}removeFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.remove()}})),Pf=(e,t,n,r={})=>{var o,i,s,a;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(s=r.top)&&void 0!==s?s:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(a=r.bottom)&&void 0!==a?a:0))]};var Tf,Df,_f,Lf,Wf,Uf,Ff,Vf,qf,Bf;const Kf=document.createElement("template");Kf.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class zf extends HTMLElement{constructor(){var e;super(),Tf.add(this),Df.set(this,new Oi({messages:[]})),_f.set(this,void 0),Lf.set(this,void 0),Wf.set(this,void 0),Uf.set(this,{resize:h(this,Tf,"m",Bf).bind(this)}),this.attachShadow({mode:"open"}),null===(e=this.shadowRoot)||void 0===e||e.appendChild(Kf.content.cloneNode(!0)),f(this,_f,this.shadowRoot.querySelector(".debugger"),"f"),f(this,Lf,h(this,_f,"f").querySelector(".content"),"f"),f(this,Wf,h(this,_f,"f").querySelector(".header"),"f")}updateData(e){h(this,Df,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,s=0;function a(t){t.preventDefault(),r=i-t.clientX,o=s-t.clientY,i=t.clientX,s=t.clientY;const[a,d]=Pf(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${d}px`,e.style.left=`${a}px`}function d(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,s=e.clientY,document.onmouseup=d,document.onmousemove=a}t?t.onmousedown=l:e.onmousedown=l})(h(this,_f,"f"),h(this,Wf,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,Uf,"f").resize),(e=h(this,_f,"f")).onmousemove=t=>{var n;const r=t.target;(r.w&&r.w!==r.offsetWidth||r.h&&r.h!==r.offsetHeight)&&(null===(n=e.onresize)||void 0===n||n.call(e,t)),r.w=r.offsetWidth,r.h=r.offsetHeight},h(this,_f,"f").onresize=h(this,Tf,"m",qf).bind(this),h(this,Df,"f").subscribe(h(this,Tf,"m",Ff).bind(this))}disconnectedCallback(){h(this,Df,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,Uf,"f").resize)}}Df=new WeakMap,_f=new WeakMap,Lf=new WeakMap,Wf=new WeakMap,Uf=new WeakMap,Tf=new WeakSet,Ff=function(e){h(this,Tf,"m",Vf).call(this,e),h(this,Tf,"m",qf).call(this)},Vf=function(e){h(this,Lf,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description||""}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},qf=function(){h(this,Lf,"f").querySelectorAll(".msg").forEach((e=>{const t=e,n=t.querySelector(".msg_desc"),r=n.scrollWidth>n.clientWidth,o=n.clientHeight>20;r||o?(t.classList.add("collapsible"),t.onclick=e=>{e.target.classList.contains("msg_desc")||t.classList.toggle("collapsed")}):(t.classList.remove("collapsible"),t.onclick=null)}))},Bf=function(){const[e,t]=Pf(h(this,_f,"f"),Number.parseInt(h(this,_f,"f").style.left,10),Number.parseInt(h(this,_f,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,_f,"f").style.top=`${t}px`,h(this,_f,"f").style.left=`${e}px`},customElements.get("descope-debugger")||customElements.define("descope-debugger",zf);var Hf=Object.freeze({__proto__:null});const Gf=e=>e.selectedRolesIds,Jf=e=>e.notifications,Zf=e=>e.tenantPermissions.data||[],Xf=Xs((e=>e.rolesList.data),(e=>e.map((e=>{var t;return Object.assign(Object.assign({},e),{editable:0===(null===(t=null==e?void 0:e.tenantId)||void 0===t?void 0:t.length)?"no":"yes"})})))),Yf=Xs(Gf,Xf,((e,t)=>t.filter((t=>e.includes(t.name))))),Qf=Xs(Gf,(e=>!!e.length)),ep=Xs(Gf,(e=>1===e.length)),tp=Xs(Yf,(e=>1===e.length?e[0].name:`${e.length} roles`)),np=e=>(...t)=>n=>{n.addCase(e.pending,((e,n)=>{t.forEach((({onPending:t})=>{null==t||t(e,n)}))})),n.addCase(e.fulfilled,((e,n)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,n)}))})),n.addCase(e.rejected,((e,n)=>{t.forEach((({onRejected:t})=>{null==t||t(e,n)}))}))},rp=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,n)=>{e(t).loading=!1,e(t).error=n.error}}),op=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,n)=>{t&&e.notifications.push({type:"success",msg:t(n)})},onRejected:(t,n)=>{e&&t.notifications.push({type:"error",msg:e(n)})}}),ip=qh("roles/create",((e,{extra:{api:t}})=>t.role.create(e))),sp=np(ip)({onFulfilled:(e,t)=>{e.rolesList.data.unshift(t.payload)}},rp((e=>e.createRole)),op({getSuccessMsg:()=>"Role created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),ap={action:ip,reducer:sp},dp=qh("roles/delete",((e,{extra:{api:t}})=>t.role.deleteBatch(e))),lp=np(dp)({onFulfilled:(e,t)=>{e.rolesList.data=e.rolesList.data.filter((e=>{var n;return 0===(null===(n=null==e?void 0:e.tenantId)||void 0===n?void 0:n.length)||!t.meta.arg.includes(e.name)})),e.selectedRolesIds=[]}},rp((e=>e.deleteRole)),op({getSuccessMsg:e=>gi(e.meta.arg.length)`${["",e.meta.arg.length]} ${["R","r"]}ole${["","s"]} deleted successfully`,getErrorMsg:e=>gi(e.meta.arg.length)`Failed to delete role${["","s"]}`})),cp={action:dp,reducer:lp},up=qh("roles/search",((e,{extra:{api:t},getState:n})=>{const r=n().searchParams;return t.role.search(Object.assign(Object.assign({},r),e))})),hp=np(up)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.rolesList.data=t.payload}},rp((e=>e.rolesList))),fp={action:up,reducer:hp},pp=qh("roles/update",((e,{extra:{api:t}})=>t.role.update(e))),gp=np(pp)({onFulfilled:(e,t)=>{const n=e.rolesList.data.findIndex((e=>e.name===t.payload.oldName));-1!==n&&(e.rolesList.data[n]=t.payload)}},rp((e=>e.updateRole)),op({getSuccessMsg:()=>"Role updated successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to update role</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),vp={action:pp,reducer:gp},mp=qh("tenant/getTenantPermissions",((e,{extra:{api:t}})=>t.tenant.getTenantPermissions())),$p={action:mp,reducer:np(mp)({onFulfilled:(e,t)=>{e.tenantPermissions.data=t.payload.permissions}},rp((e=>e.tenantPermissions)))},yp={rolesList:{data:[],loading:!1,error:null},createRole:{loading:!1,error:null},updateRole:{loading:!1,error:null},deleteRole:{loading:!1,error:null},tenantPermissions:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedRolesIds:[],notifications:[]},bp="/v1/mgmt/role/search",wp="/v1/mgmt/role/delete/batch",Ep="/v1/mgmt/role/create",Cp="/v1/mgmt/role/update",kp="/v1/mgmt/permission/all",Op=e=>u(void 0,void 0,void 0,(function*(){const t=yield e.text(),n=JSON.parse(t);if(!e.ok){const t=`${n.errorDescription}${n.errorMessage?`: ${n.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(n),e.text=()=>Promise.resolve(t)})),xp=({httpClient:e,tenant:t,mock:n})=>({search:({page:r,limit:o=1e4,text:i,sort:s}={})=>u(void 0,void 0,void 0,(function*(){if(n)return(({text:e,sort:t},n)=>u(void 0,void 0,void 0,(function*(){return new Promise((r=>{const o=[];for(let e=1;e<9;e+=1)o.push({name:`Role ${e}`,description:`Role description ${e}`,permissionNames:[`Permission ${e}`],createdTime:new Date,tenantId:n});t.forEach((e=>{o.sort(((t,n)=>{var r,o;return e.desc?null===(o=n[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(r=t[e.field])||void 0===r?void 0:r.localeCompare(n[e.field])}))})),r(o.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.description.toLowerCase().includes(e.toLowerCase()))))}))})))({page:r,limit:o,text:i,sort:s},t);const a=yield e.post(bp,{limit:o,page:r,text:i,sort:s},{queryParams:{tenant:t}});return yield Op(a),(yield a.json()).roles})),deleteBatch:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(wp,{roleNames:r},{queryParams:{tenant:t}});return yield Op(o),o.json()})),create:({name:r,description:o,permissionNames:i})=>u(void 0,void 0,void 0,(function*(){if(n)return(({name:e,description:t,permissionNames:n},r)=>u(void 0,void 0,void 0,(function*(){return new Promise((o=>{o({name:e,description:t,permissionNames:n,createdTime:new Date,tenantId:r})}))})))({name:r,description:o,permissionNames:i},t);const s=yield e.post(Ep,{name:r,description:o,permissionNames:i,tenantId:t},{queryParams:{tenant:t}});return yield Op(s),yield s.json()})),update:({name:r,newName:o,description:i,permissionNames:s})=>u(void 0,void 0,void 0,(function*(){if(n)return(({name:e,newName:t,description:n,permissionNames:r},o)=>u(void 0,void 0,void 0,(function*(){return new Promise((i=>{i({name:t,description:n,permissionNames:r,createdTime:new Date,oldName:e,tenantId:o})}))})))({name:r,newName:o,description:i,permissionNames:s},t);const a=yield e.post(Cp,{name:r,newName:o,description:i,permissionNames:s,tenantId:t},{queryParams:{tenant:t}});yield Op(a);const d=yield a.json();return d.oldName=r,d}))}),Sp=({httpClient:e,tenant:t,mock:n})=>({getTenantPermissions:()=>u(void 0,void 0,void 0,(function*(){if(n)return new Promise((e=>{const t=[];for(let e=1;e<5;e+=1)t.push({name:`Permission ${e}`});e({permissions:t})}));const r=yield e.get(kp,{queryParams:{tenant:t}});return yield Op(r),r.json()}))}),Ip=mi((e=>{var t,n,r,o;const i=ci(hf,cf,of,uf({tenant:uf.missingAttrValidator}))(e);return o=class extends i{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get tenant(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get api(){return h(this,n,"f")||h(this,t,"m",r).call(this),h(this,n,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{h(this,n,"f")&&h(this,t,"m",r).call(this)}))}))}},n=new WeakMap,t=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),f(this,n,((e,t,n)=>{const r=Hn(Object.assign(Object.assign({},e),{persistTokens:!0}));return{role:xp({httpClient:r.httpClient,tenant:t,mock:n}),tenant:Sp({httpClient:r.httpClient,tenant:t,mock:n})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenant,"true"===this.mock),"f")},o})),Rp=mi((e=>{const t=ci(Mf({name:"widget",initialState:yp,reducers:{setSelectedRolesIds:(e,{payload:t})=>{e.selectedRolesIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{ap.reducer(e),vp.reducer(e),cp.reducer(e),fp.reducer(e),$p.reducer(e)},asyncActions:{searchRoles:fp.action,createRole:ap.action,updateRole:vp.action,deleteRoles:cp.action,getTenantPermissions:$p.action}}),lf,of,Ip)(e);return class extends t{constructor(...e){super(...e),this.state=yp,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),jp=mi((e=>{const t=ci(ff,uf({"widget-id":uf.missingAttrValidator}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return u(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`role-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),Np=mi((e=>{var t,n,r;return r=class extends(ci(of,lf,Ef,Of,jp,Rp)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return u(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.init)||void 0===r?void 0:r.call(this),yield Promise.all([h(this,t,"m",n).call(this),this.actions.searchRoles(),this.actions.getTenantPermissions()]),this.onWidgetRootReady()}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){const e=ui(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),Mp=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Rp,Sf,Af,of,Np)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),o.set(this,(()=>u(this,void 0,void 0,(function*(){var e;yield h(this,n,"f").setData(null===(e=Zf(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,o=new WeakMap,t=new WeakSet,r=function(){return u(this,void 0,void 0,(function*(){this.createRoleModal=this.createModal(),this.createRoleModal.setContent(ui(yield this.fetchWidgetPage("create-role-modal.html")));new ji((()=>{var e;return null===(e=this.createRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>{this.createRoleModal.close(),this.resetFormData(this.createRoleModal.ele)}));const e=new ji((()=>{var e;return null===(e=this.createRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});e.onClick((()=>u(this,void 0,void 0,(function*(){this.validateForm(this.createRoleModal.ele)&&(this.actions.createRole(Object.assign({},this.getFormData(this.createRoleModal.ele))),this.createRoleModal.close(),this.resetFormData(this.createRoleModal.ele))})))),f(this,n,new Ai((()=>{var e;return null===(e=this.createRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),h(this,o,"f").call(this)}))},i})),Ap=mi((e=>{var t,n,r;return r=class extends(ci(of,Mp,Np)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;this.createButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-role"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createRoleModal.open()))},r})),Pp=mi((e=>{var t,n,r;return r=class extends(ci(Rp,Sf,of,Np)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.deleteRolesModal=this.createModal(),this.deleteRolesModal.setContent(ui(yield this.fetchWidgetPage("delete-roles-modal.html")));const t=new ji((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteRolesModal.close()));const n=new ji((()=>{var e;return null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=Yf(this.state);this.actions.deleteRoles(null==e?void 0:e.map((e=>e.name))),this.deleteRolesModal.close()}));const r=new Ti(null===(e=this.deleteRolesModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteRolesModal.beforeOpen=()=>{const e=tp(this.state);r.text=`Delete ${e}?`}}))},r})),Tp=mi((e=>{var t,n,r,o;return o=class extends(ci(of,Np,Rp,Pp)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Qf)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.deleteButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-roles"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteRolesModal.open()}))},o})),Dp=mi((e=>{var t,n,r,o,i,s,a,d;return d=class extends(ci(Rp,Sf,of,Af,Np)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),i.set(this,(()=>u(this,void 0,void 0,(function*(){var e;yield h(this,n,"f").setData(null===(e=Zf(this.state))||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))})))),s.set(this,(()=>{var e;const t=null===(e=Yf(this.state))||void 0===e?void 0:e[0],n={name:null==t?void 0:t.name,description:null==t?void 0:t.description,permissionNames:null==t?void 0:t.permissionNames};this.setFormData(this.editRoleModal.ele,n)}))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),yield h(this,t,"m",a).call(this)}))}},n=new WeakMap,i=new WeakMap,s=new WeakMap,t=new WeakSet,r=function(){new ji((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger}).onClick((()=>this.editRoleModal.close()))},o=function(){new ji((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger}).onClick((()=>{var e;if(this.validateForm(this.editRoleModal.ele)){const t=this.getFormData(this.editRoleModal.ele),{name:n}=t,r=c(t,["name"]),o=null===(e=Yf(this.state))||void 0===e?void 0:e[0];this.actions.updateRole(Object.assign({newName:n,name:o.name},r)),this.editRoleModal.close(),this.resetFormData(this.editRoleModal.ele)}}))},a=function(){return u(this,void 0,void 0,(function*(){this.editRoleModal=this.createModal(),this.editRoleModal.setContent(ui(yield this.fetchWidgetPage("edit-role-modal.html"))),h(this,t,"m",r).call(this),h(this,t,"m",o).call(this),f(this,n,new Ai((()=>{var e;return null===(e=this.editRoleModal.ele)||void 0===e?void 0:e.querySelector('[data-id="permissions-multiselect"]')}),{logger:this.logger}),"f"),this.editRoleModal.beforeOpen=()=>u(this,void 0,void 0,(function*(){yield h(this,i,"f").call(this),h(this,s,"f").call(this)}))}))},d})),_p=mi((e=>{var t,n,r,o;return o=class extends(ci(of,Np,Rp,Dp,Af)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.editButton.enable():this.editButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),ep)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.editButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="edit-role"]'),{logger:this.logger}),this.editButton.disable(),this.editButton.onClick((()=>{this.editRoleModal.open()}))},o})),Lp=mi((e=>{var t,n,r,o;return o=class extends(ci(of,Np,Rp)(e)){constructor(){super(...arguments),t.add(this),n.set(this,vi((()=>{this.actions.searchRoles({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){var e;this.searchInput=new Di(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(h(this,n,"f"))},o})),Wp={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="#FFDFDD"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},Up=mi((e=>{var t,n,r,o,i;return i=class extends(ci(of,Rp,Rf,lf)(e)){constructor(){super(...arguments),t.add(this),o.set(this,pi((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const i=h(this,t,"m",r).call(this,e);i.setContent(h(this,t,"m",n).call(this,{type:e,msg:o})),i.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(h(this,o,"f").bind(this),Jf)}))}},o=new WeakMap,t=new WeakSet,n=function({type:e,msg:t}){const n=Wp[e],r=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==n?void 0:n.outerHTML)||""}${t}${r.outerHTML}`},r=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},i})),Fp=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Rp,of,Np)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{this.rolesTable.data=e}))),o.set(this,vi(((e,t)=>{const n=[],{value:r}=t;if(r){const t=e.path;n.push({field:t,desc:"desc"===r})}this.actions.searchRoles({sort:n})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var i;return u(this,void 0,void 0,(function*(){yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),h(this,t,"m",n).call(this),this.rolesTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{h(this,o,"f").call(this,e.target,e.detail)}))})),h(this,r,"f").call(this,Xf(this.state)),this.subscribe(h(this,r,"f").bind(this),Xf)}))}},r=new WeakMap,o=new WeakMap,t=new WeakSet,n=function(){var e;this.rolesTable=new Ri(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="roles-table"]'),{logger:this.logger}),this.rolesTable.onSelectedItemsChange((e=>{this.actions.setSelectedRolesIds(e.detail.value.map((({name:e})=>e)))}))},i})),Vp=mi((e=>class extends(ci(gf,Nf,Fp,Ap,Tp,_p,Lp,Up)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),qp=ci((e=>class extends(Vp(e)){}))(HTMLElement);customElements.define("descope-role-management-widget",qp);var Bp=Object.freeze({__proto__:null,default:qp});((...e)=>{const t=Zs(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(ns(e)?_s(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(Js);var Kp="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Hi:Hi.apply(null,arguments)},zp=e=>e&&"function"==typeof e.match;function Hp(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error("production"===process.env.NODE_ENV?Mg(0):"prepareAction did not return an object");return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>Ji(t)&&t.type===e,n}function Gp(e){return"function"==typeof e&&"type"in e&&zp(e)}function Jp(e,t){let n=0;return{measureTime(e){const t=Date.now();try{return e()}finally{const e=Date.now();n+=e-t}},warnIfExceeded(){n>e&&console.warn(`${t} took ${n}ms, which is more than the warning threshold of ${e}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`)}}}var Zp=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function Xp(e){return rs(e)?Us(e,(()=>{})):e}function Yp(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error("production"===process.env.NODE_ENV?Mg(10):"No insert provided for key not already in map");const r=n.insert(t,e);return e.set(t,r),r}function Qp(e){return"object"!=typeof e||null==e||Object.isFrozen(e)}function eg(e,t,n){const r=tg(e,t,n);return{detectMutations:()=>ng(e,t,r,n)}}function tg(e,t=[],n,r="",o=new Set){const i={value:n};if(!e(n)&&!o.has(n)){o.add(n),i.children={};for(const o in n){const s=r?r+"."+o:o;t.length&&-1!==t.indexOf(s)||(i.children[o]=tg(e,t,n[o],s))}}return i}function ng(e,t=[],n,r,o=!1,i=""){const s=n?n.value:void 0,a=s===r;if(o&&!a&&!Number.isNaN(r))return{wasMutated:!0,path:i};if(e(s)||e(r))return{wasMutated:!1};const d={};for(let e in n.children)d[e]=!0;for(let e in r)d[e]=!0;const l=t.length>0;for(let o in d){const s=i?i+"."+o:o;if(l){if(t.some((e=>e instanceof RegExp?e.test(s):s===e)))continue}const d=ng(e,t,n.children[o],r[o],a,s);if(d.wasMutated)return d}return{wasMutated:!1}}function rg(e){const t=typeof e;return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||Fi(e)}function og(e,t="",n=rg,r,o=[],i){let s;if(!n(e))return{keyPath:t||"<root>",value:e};if("object"!=typeof e||null===e)return!1;if(i?.has(e))return!1;const a=null!=r?r(e):Object.entries(e),d=o.length>0;for(const[e,l]of a){const a=t?t+"."+e:e;if(d){if(o.some((e=>e instanceof RegExp?e.test(a):a===e)))continue}if(!n(l))return{keyPath:a,value:l};if("object"==typeof l&&(s=og(l,a,n,r,o,i),s))return s}return i&&ig(e)&&i.add(e),!1}function ig(e){if(!Object.isFrozen(e))return!1;for(const t of Object.values(e))if("object"==typeof t&&null!==t&&!ig(t))return!1;return!0}function sg(e){return"boolean"==typeof e}var ag=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Zp;if(t&&(sg(t)?i.push(ea):i.push(ta(t.extraArgument))),"production"!==process.env.NODE_ENV){if(n){let e={};sg(n)||(e=n),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{let t=function(e,t,r,o){return JSON.stringify(e,n(t,o),r)},n=function(e,t){let n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,i){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?r.splice(s,1/0,o):r.push(o),~n.indexOf(i)&&(i=t.call(this,o,i))}else n.push(i);return null==e?i:e.call(this,o,i)}},{isImmutable:r=Qp,ignoredPaths:o,warnAfter:i=32}=e;const s=eg.bind(null,r,o);return({getState:e})=>{let n,r=e(),o=s(r);return a=>d=>{const l=Jp(i,"ImmutableStateInvariantMiddleware");l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Mg(19):`A state mutation was detected between dispatches, in the path '${n.path||""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)}));const c=a(d);return l.measureTime((()=>{if(r=e(),n=o.detectMutations(),o=s(r),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?Mg(20):`A state mutation was detected inside a dispatch, in the path: ${n.path||""}. Take a look at the reducer(s) handling the action ${t(d)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`)})),l.warnIfExceeded(),c}}}}(e))}if(r){let e={};sg(r)||(e=r),i.push(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);{const{isSerializable:t=rg,getEntries:n,ignoredActions:r=[],ignoredActionPaths:o=["meta.arg","meta.baseQueryMeta"],ignoredPaths:i=[],warnAfter:s=32,ignoreState:a=!1,ignoreActions:d=!1,disableCache:l=!1}=e,c=!l&&WeakSet?new WeakSet:void 0;return e=>l=>u=>{if(!Ji(u))return l(u);const h=l(u),f=Jp(s,"SerializableStateInvariantMiddleware");return d||r.length&&-1!==r.indexOf(u.type)||f.measureTime((()=>{const e=og(u,"",t,n,o,c);if(e){const{keyPath:t,value:n}=e;console.error(`A non-serializable value was detected in an action, in the path: \`${t}\`. Value:`,n,"\nTake a look at the logic that dispatched this action: ",u,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),a||(f.measureTime((()=>{const r=og(e.getState(),"",t,n,i,c);if(r){const{keyPath:e,value:t}=r;console.error(`A non-serializable value was detected in the state, in the path: \`${e}\`. Value:`,t,`\nTake a look at the reducer(s) handling this action type: ${u.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}})),f.warnIfExceeded()),h}}}(e))}if(o){let e={};sg(o)||(e=o),i.unshift(function(e={}){if("production"===process.env.NODE_ENV)return()=>e=>t=>e(t);const{isActionCreator:t=Gp}=e;return()=>e=>n=>(t(n)&&console.warn(function(e){const t=e?`${e}`.split("/"):[],n=t[t.length-1]||"actionCreator";return`Detected an action creator with type "${e||"unknown"}" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \`dispatch(${n}())\` instead of \`dispatch(${n})\`. This is necessary even if the action has no payload.`}(n.type)),e(n))}(e))}}return i},dg=e=>t=>{setTimeout(t,e)},lg="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:dg(10),cg=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Zp(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const a=new Set,d="tick"===e.type?queueMicrotask:"raf"===e.type?lg:"callback"===e.type?e.queueNotification:dg(e.timeout),l=()=>{s=!1,i&&(i=!1,a.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(s||(s=!0,d(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},ug="production"===process.env.NODE_ENV;function hg(e){const t={},n=[];let r;const o={addCase(e,i){if("production"!==process.env.NODE_ENV){if(n.length>0)throw new Error("production"===process.env.NODE_ENV?Mg(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(r)throw new Error("production"===process.env.NODE_ENV?Mg(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const s="string"==typeof e?e:e.type;if(!s)throw new Error("production"===process.env.NODE_ENV?Mg(28):"`builder.addCase` cannot be called with an empty action type");if(s in t)throw new Error("production"===process.env.NODE_ENV?Mg(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);return t[s]=i,o},addMatcher(e,t){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?Mg(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){if("production"!==process.env.NODE_ENV&&r)throw new Error("production"===process.env.NODE_ENV?Mg(31):"`builder.addDefaultCase` can only be called once");return r=e,o}};return e(o),[t,n,r]}var fg=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function pg(...e){return t=>e.some((e=>((e,t)=>zp(e)?e.match(t):e(t))(e,t)))}var gg=["name","message","stack","code"],vg=class{constructor(e,t){this.payload=e,this.meta=t}_type},mg=class{constructor(e,t){this.payload=e,this.meta=t}_type},$g=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of gg)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},yg=(()=>{function e(e,t,n){const r=Hp(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=Hp(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Hp(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||$g)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(s,a,d)=>{const l=n?.idGenerator?n.idGenerator(e):fg(),c=new AbortController;let u,h;function f(e){h=e,c.abort()}const p=async function(){let p;try{let i=n?.condition?.(e,{getState:a,extra:d});if(null!==(g=i)&&"object"==typeof g&&"function"==typeof g.then&&(i=await i),!1===i||c.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{u=()=>{t({name:"AbortError",message:h||"Aborted"})},c.signal.addEventListener("abort",u)}));s(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:a,extra:d}))),p=await Promise.race([v,Promise.resolve(t(e,{dispatch:s,getState:a,extra:d,requestId:l,signal:c.signal,abort:f,rejectWithValue:(e,t)=>new vg(e,t),fulfillWithValue:(e,t)=>new mg(e,t)})).then((t=>{if(t instanceof vg)throw t;return t instanceof mg?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){p=t instanceof vg?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{u&&c.signal.removeEventListener("abort",u)}var g;return n&&!n.dispatchConditionRejection&&i.match(p)&&p.meta.condition||s(p),p}();return Object.assign(p,{abort:f,requestId:l,arg:e,unwrap:()=>p.then(bg)})}}),{pending:o,rejected:i,fulfilled:r,settled:pg(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function bg(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var wg=Symbol.for("rtk-slice-createasyncthunk");function Eg(e,t){return`${e}/${t}`}function Cg({creators:e}={}){const t=e?.asyncThunk?.[wg];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error("production"===process.env.NODE_ENV?Mg(11):"`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&void 0===e.initialState&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),s={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},a={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error("production"===process.env.NODE_ENV?Mg(12):"`context.addCase` cannot be called with an empty action type");if(n in s.sliceCaseReducersByType)throw new Error("production"===process.env.NODE_ENV?Mg(13):"`context.addCase` cannot be called with two reducers for the same action type: "+n);return s.sliceCaseReducersByType[n]=t,a},addMatcher:(e,t)=>(s.sliceMatchers.push({matcher:e,reducer:t}),a),exposeAction:(e,t)=>(s.actionCreators[e]=t,a),exposeCaseReducer:(e,t)=>(s.sliceCaseReducersByName[e]=t,a)};function d(){if("production"!==process.env.NODE_ENV&&"object"==typeof e.extraReducers)throw new Error("production"===process.env.NODE_ENV?Mg(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[t={},n=[],r]="function"==typeof e.extraReducers?hg(e.extraReducers):[e.extraReducers],o={...t,...s.sliceCaseReducersByType};return function(e,t){if("production"!==process.env.NODE_ENV&&"object"==typeof t)throw new Error("production"===process.env.NODE_ENV?Mg(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let n,[r,o,i]=hg(t);if(function(e){return"function"==typeof e}(e))n=()=>Xp(e());else{const t=Xp(e);n=()=>t}function s(e=n(),t){let s=[r[t.type],...o.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===s.filter((e=>!!e)).length&&(s=[i]),s.reduce(((e,n)=>{if(n){if(ns(e)){const r=n(e,t);return void 0===r?e:r}if(rs(e))return Us(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error("production"===process.env.NODE_ENV?Mg(9):"A case reducer on a non-draftable value must not return undefined")}return r}}return e}),e)}return s.getInitialState=n,s}(e.initialState,(e=>{for(let t in o)e.addCase(t,o[t]);for(let t of s.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}))}i.forEach((r=>{const i=o[r],s={reducerName:r,type:Eg(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,s;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error("production"===process.env.NODE_ENV?Mg(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=r.reducer,s=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Hp(e,s):Hp(e))}(s,i,a):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error("production"===process.env.NODE_ENV?Mg(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:s,pending:a,rejected:d,settled:l,options:c}=n,u=o(e,i,c);r.exposeAction(t,u),s&&r.addCase(u.fulfilled,s);a&&r.addCase(u.pending,a);d&&r.addCase(u.rejected,d);l&&r.addMatcher(u.settled,l);r.exposeCaseReducer(t,{fulfilled:s||xg,pending:a||xg,rejected:d||xg,settled:l||xg})}(s,i,a,t)}));const l=e=>e,c=new Map;let u;function h(e,t){return u||(u=d()),u(e,t)}function f(){return u||(u=d()),u.getInitialState()}function p(t,n=!1){function r(e){let r=e[t];if(void 0===r)if(n)r=f();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?Mg(15):"selectSlice returned undefined for an uninjected slice reducer");return r}function o(t=l){const r=Yp(c,n,{insert:()=>new WeakMap});return Yp(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=kg(i,t,f,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const g={name:n,reducer:h,actions:s.actionCreators,caseReducers:s.sliceCaseReducersByName,getInitialState:f,...p(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:h},n),{...g,...p(o,!0)}}};return g}}function kg(e,t,n,r){function o(o,...i){let s=t(o);if(void 0===s)if(r)s=n();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?Mg(16):"selectState returned undefined for an uninjected slice reducer");return e(s,...i)}return o.unwrapped=e,o}var Og=Cg();function xg(){}var Sg="listenerMiddleware",Ig=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=Hp(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error("production"===process.env.NODE_ENV?Mg(21):"Creating or removing a listener requires one of the known fields for matching an action");return((e,t)=>{if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?Mg(32):`${t} is not a function`)})(i,"options.listener"),{predicate:o,type:t,effect:i}},Rg=Object.assign((e=>{const{type:t,predicate:n,effect:r}=Ig(e);return{id:fg(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error("production"===process.env.NODE_ENV?Mg(22):"Unsubscribe not initialized")}}}),{withTypes:()=>Rg}),jg=Object.assign(Hp(`${Sg}/add`),{withTypes:()=>jg});Hp(`${Sg}/removeAll`);var Ng=Object.assign(Hp(`${Sg}/remove`),{withTypes:()=>Ng});function Mg(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const Ag=["error","warn","info","debug"],Pg=mi((e=>{var t,n,r,o;return o=class extends e{constructor(){super(...arguments),t.add(this),n.set(this,h(this,t,"m",r).call(this,console))}set logger(e){f(this,n,h(this,t,"m",r).call(this,e),"f")}get logger(){return h(this,n,"f")}onLogEvent(e,t){}},n=new WeakMap,t=new WeakSet,r=function(e){return Ag.reduce(((t,n)=>(t[n]=(...t)=>{var r;this.onLogEvent(n,t),null===(r=e[n])||void 0===r||r.call(e,...t)},t)),{})},o})),Tg="undefined"!=typeof localStorage,Dg=Tg&&localStorage.getItem("base.content.url")||"https://static.descope.com/pages",_g=(e,t)=>!t&&`${e} cannot be empty`,Lg=mi((e=>{var t,n;return n=class extends e{constructor(){super(...arguments),t.set(this,!0)}connectedCallback(){var e,n;null===(e=super.connectedCallback)||void 0===e||e.call(this),(null===(n=this.shadowRoot)||void 0===n?void 0:n.isConnected)&&h(this,t,"f")&&(f(this,t,!1,"f"),this.init())}async init(){}},t=new WeakMap,n})),Wg=mi((e=>{var t,n;const r=ci(Pg,Lg)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,{})}async init(){var e,n,r;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),n=this,r=e=>{var n;null===(n=h(this,t,"f")[e])||void 0===n||n.forEach((t=>{t(e,this.getAttribute(e))}))},Array.from(n.attributes).forEach((e=>r(e.name))),new MutationObserver((e=>{e.forEach((e=>{"attributes"===e.type&&r(e.attributeName)}))})).observe(n,{attributes:!0})}observeAttribute(e,n){h(this,t,"f")[e]||(h(this,t,"f")[e]=[]);const r=h(this,t,"f")[e].push(n);return()=>h(this,t,"f")[e].splice(r,1)}observeAttributes(e,t){const n=e.reduce(((e,n)=>(e.push(this.observeAttribute(n,t)),e)),[]);return()=>n.forEach((e=>e()))}},t=new WeakMap,n})),Ug=e=>t=>{var n,r,o;const i=ci(Pg,Lg,Wg)(t),s=Object.keys(e);return o=class extends i{constructor(...e){super(...e),n.add(this),this.observeAttributes(s,h(this,n,"m",r).bind(this))}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),s.forEach((e=>h(this,n,"m",r).call(this,e,this.getAttribute(e))))}},n=new WeakSet,r=function(t,n){const r=e[t],o="function"==typeof r?r(t,n):r;o&&this.logger.error(o)},o};Ug.missingAttrValidator=_g;const Fg=mi((e=>{const t=ci(Ug({"project-id":_g}))(e);return class extends t{get projectId(){return this.getAttribute("project-id")}}}));const Vg=mi((e=>{const t=ci(Pg,Fg)(e);return class extends t{async fetchStaticResource(e,t){const n=function(e,t,n="v2-beta"){const r=new URL(Dg);return r.pathname=hi(r.pathname,e,n,t),r.toString()}(this.projectId,e),r=await fetch(n,{cache:"default"});return r.ok||this.logger.error(`Error fetching URL ${n} [${r.status}]`),{body:await r[t](),headers:Object.fromEntries(r.headers.entries())}}}})),qg=mi((e=>{var t,n,r;const o=ci(Vg)(e);return r=class extends o{constructor(){super(...arguments),t.set(this,void 0),n.set(this,(async()=>{try{const{body:e,headers:t}=await this.fetchStaticResource("config.json","json");return{projectConfig:e,executionContext:{geo:t["x-geo"]}}}catch(e){this.logger.error("Cannot fetch config file","make sure that your projectId & flowId are correct")}}))}get config(){return h(this,t,"f")||f(this,t,h(this,n,"f").call(this),"f"),h(this,t,"f")}},t=new WeakMap,n=new WeakMap,r})),Bg=mi((e=>{var t,n,r,o,i,s,a;return a=class extends(ci(Lg,Pg)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),this.attributeChangedCallback=(e,n,r)=>{var o;null===(o=super.attributeChangedCallback)||void 0===o||o.call(this,e,n,r),"debug"===e&&h(this,t,"m",i).call(this)}}get debug(){return"true"===this.getAttribute("debug")}onLogEvent(e,n){var r;null===(r=super.onLogEvent)||void 0===r||r.call(this,e,n),"error"===e&&h(this,t,"m",s).call(this,n[0]||"Error",n[1])}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this)}},n=new WeakMap,t=new WeakSet,r=function(){var e;null===(e=h(this,n,"f"))||void 0===e||e.remove(),f(this,n,null,"f")},o=async function(){f(this,n,document.createElement("descope-debugger"),"f"),Object.assign(h(this,n,"f").style,{position:"fixed",top:"0",right:"0",height:"100vh",width:"100vw",pointerEvents:"none",zIndex:99999}),await Promise.resolve().then((function(){return Ev})),document.body.appendChild(h(this,n,"f"))},i=function(){this.debug?h(this,t,"m",o).call(this):h(this,t,"m",r).call(this)},s=function(e,t){var r;e&&(null===(r=h(this,n,"f"))||void 0===r||r.updateData({title:e,description:t}))},a})),Kg="load-descope-ui",zg="base.ui.components.url",Hg=Tg&&localStorage.getItem(zg)||"https://static.descope.com/npm/@descope/web-components-ui@<version>/dist/umd/index.js",Gg=Tg&&localStorage.getItem(zg)||"https://cdn.jsdelivr.net/npm/@descope/web-components-ui@<version>/dist/umd/index.js",Jg=e=>{const t=document.createElement("script");return t.id=e,t},Zg=(e,t)=>e.replace("<version>",t),Xg=mi((e=>{var t,n,r,o,i,s,a,d,l,c,u,p;const g=ci(Pg,qg)(e);return p=class extends g{constructor(){super(...arguments),t.add(this),n.set(this,Symbol("errorCbs")),r.set(this,Symbol("loadCbs")),l.set(this,void 0)}get descopeUi(){return h(this,l,"f")||f(this,l,h(this,t,"m",u).call(this),"f"),h(this,l,"f")}async loadDescopeUiComponents(e){const n=Array.isArray(e)?e:(e=>[...Array.from(e.content.querySelectorAll("*")).reduce(((e,t)=>t.localName.startsWith("descope-")?e.add(t.localName):e),new Set)])(e);return Promise.all(n.map((e=>h(this,t,"m",c).call(this,e))))}},n=new WeakMap,r=new WeakMap,l=new WeakMap,t=new WeakSet,o=async function(){var e;const t=await this.config,n=null===(e=null==t?void 0:t.projectConfig)||void 0===e?void 0:e.componentsVersion;return n?this.logger.debug(`Got component version "${n}"`):this.logger.error("Could not get components version"),n},i=function(e){const t=h(this,n,"f"),o=h(this,r,"f");e[t]=[],e[o]=[],Object.defineProperty(e,"onerror",{set(n){e[t].push(n)}}),Object.defineProperty(e,"onload",{set(t){e[o].push(t)}})},s=async function(e,n){this.logger.debug("Trying to load DescopeUI from a fallback URL");const r=Jg("load-descope-ui-fallback-script");document.body.append(r),r.addEventListener("error",(()=>{e.forEach((e=>e(`Cannot load DescopeUI from fallback URL, Make sure this URL is valid and return the correct script: "${r.src}"`)))})),r.addEventListener("load",(()=>{n.forEach((e=>e()))})),r.src=Zg(Gg,await h(this,t,"m",o).call(this))},a=function(e){e.addEventListener("error",(()=>{e[h(this,n,"f")].forEach((t=>t(`Cannot load DescopeUI from main URL, Make sure this URL is valid and return the correct script: "${e.src}"`))),h(this,t,"m",s).call(this,e[h(this,n,"f")],e[h(this,r,"f")])})),e.addEventListener("load",(()=>{e[h(this,r,"f")].forEach((e=>e()))}))},d=async function(){if(document.querySelector(`script#${Kg}`))this.logger.debug("DescopeUI loading script already exists",this);else{this.logger.debug("DescopeUI loading script does not exist, creating it",this);const e=Jg(Kg);document.body.append(e),h(this,t,"m",i).call(this,e),h(this,t,"m",a).call(this,e),e.src=Zg(Hg,await h(this,t,"m",o).call(this))}return document.getElementById(Kg)},c=async function(e){if(!!customElements.get(e))return void this.logger.debug(`Loading component "${e}" is skipped as it is already defined`);const t=await this.descopeUi;if(t[e])try{return await t[e]()}catch(t){if("NotSupportedError"!==t.name)throw t;console.debug(`Encountered an error while attempting to define the "${e}" component, it is likely that this component is already defined`)}else this.logger.error(`Cannot load UI component "${e}"`,`Descope UI does not have a component named "${e}", available components are: "${Object.keys(t).join(", ")}"`)},u=function(){return new Promise((e=>{globalThis.DescopeUI&&e(globalThis.DescopeUI),h(this,t,"m",d).call(this).then((t=>{t.onerror=this.logger.error,t.onload=()=>{this.logger.debug("DescopeUI was loaded"),e(globalThis.DescopeUI)},setTimeout((()=>{globalThis.DescopeUI&&e(globalThis.DescopeUI)}))}))}))},p})),Yg="content-root",Qg="root",ev=mi((e=>class extends e{constructor(...e){var t,n;super(...e),this.attachShadow({mode:"open"}).innerHTML=`\n\n <style>\n #${Qg}, #${Yg} {\n height: 100%;\n }\n #${Qg} {\n position: relative;\n }\n #${Yg} {\n display: flex;\n }\n </style>\n <div id="${Qg}">\n <div id="${Yg}"></div>\n </div>\n `,this.contentRootElement=null===(t=this.shadowRoot)||void 0===t?void 0:t.getElementById(Yg),this.rootElement=null===(n=this.shadowRoot)||void 0===n?void 0:n.getElementById(Qg)}})),tv="descope-modal",nv=mi((e=>{var t,n;const r=ci(Lg,ev,Xg)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Mi{setContent(t){e(t),super.setContent(t)}}})())}createModal(e){const n=((e={})=>{const t=document.createElement(tv);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;this.loadDescopeUiComponents([tv]),await(null===(e=super.init)||void 0===e?void 0:e.call(this))}},t=new WeakMap,n})),rv="descope-notification",ov=mi((e=>{var t,n;const r=ci(Lg,ev,Xg)(e);return n=class extends r{constructor(){super(...arguments),t.set(this,(()=>{const e=this.loadDescopeUiComponents.bind(this);return class extends Pi{setContent(t){const n="string"==typeof t?ui(t):t;e(n),super.setContent(n)}}})())}createNotification(e){const n=((e={})=>{const t=document.createElement(rv);return Object.keys(e).forEach((n=>{t.setAttribute(n,e[n])})),t})(Object.assign(Object.assign({},{}),e));return this.rootElement.append(n),new(h(this,t,"f"))(n,{logger:this.logger})}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),this.loadDescopeUiComponents([rv])}},t=new WeakMap,n})),iv=(e,t)=>!!t&&"light"!==t&&"dark"!==t&&'Supported theme values are "light", "dark", or leave empty for using the OS theme',sv=mi((e=>{var t,n,r,o,i,s,a,d,l;const c=ci(Ug({theme:iv}),Vg,Lg,Xg,qg,ev)(e);return l=class extends c{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get theme(){return"light"}async init(){var e;await(null===(e=super.init)||void 0===e?void 0:e.call(this)),h(this,t,"m",i).call(this),h(this,t,"m",s).call(this),h(this,t,"m",a).call(this),h(this,t,"m",d).call(this)}},n=new WeakMap,t=new WeakSet,r=async function(){try{const{body:e}=await this.fetchStaticResource("theme.json","json");return e}catch(e){this.logger.error("Cannot fetch theme file","make sure that your projectId & flowId are correct")}},o=function(){return h(this,n,"f")||(f(this,n,h(this,t,"m",r).call(this),"f"),h(this,n,"f").then((e=>this.logger.debug("Fetched theme",e)))),h(this,n,"f")},i=async function(){var e,n;const r=await h(this,t,"a",o);if(!r)return;const i=document.createElement("style");i.innerText=((null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.globals)||"")+((null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.globals)||""),this.shadowRoot.appendChild(i)},s=async function(){var e,n;const r=Object.assign({},await h(this,t,"a",o));if(!r)return;const i=await this.descopeUi;(null==i?void 0:i.componentsThemeManager)&&(i.componentsThemeManager.themes={light:null===(e=null==r?void 0:r.light)||void 0===e?void 0:e.components,dark:null===(n=null==r?void 0:r.dark)||void 0===n?void 0:n.components})},a=async function(){var e,t;const{projectConfig:n}=await this.config,r=null===(t=null===(e=null==n?void 0:n.cssTemplate)||void 0===e?void 0:e[this.theme])||void 0===t?void 0:t.fonts;r&&Object.values(r).forEach((e=>{e.url&&(this.logger.debug(`Loading font from URL "${e.url}"`),(e=>{const t=document.createElement("link");t.href=e,t.rel="stylesheet",document.head.appendChild(t)})(e.url))}))},d=async function(){this.rootElement.setAttribute("data-theme",this.theme);const e=await this.descopeUi;(null==e?void 0:e.componentsThemeManager)&&(e.componentsThemeManager.currentThemeName=this.theme)},l})),av=e=>mi((t=>{const n=Og(e),r=Object.assign(Object.assign({},n.actions),e.asyncActions);return class extends(ci(Pg)(t)){constructor(...e){super(...e);const t=function(e){const t=ag(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:s}=e||{};let a,d;if("function"==typeof n)a=n;else{if(!Fi(n))throw new Error("production"===process.env.NODE_ENV?Mg(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");a=zi(n)}if(!ug&&r&&"function"!=typeof r)throw new Error("production"===process.env.NODE_ENV?Mg(2):"`middleware` field must be a callback");if("function"==typeof r){if(d=r(t),!ug&&!Array.isArray(d))throw new Error("production"===process.env.NODE_ENV?Mg(3):"when using a middleware builder function, an array of middleware must be returned")}else d=t();if(!ug&&d.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Mg(4):"each middleware provided to configureStore must be a function");let l=Hi;o&&(l=Kp({trace:!ug,..."object"==typeof o&&o}));const c=Gi(...d),u=cg(c);if(!ug&&s&&"function"!=typeof s)throw new Error("production"===process.env.NODE_ENV?Mg(5):"`enhancers` field must be a callback");let h="function"==typeof s?s(u):u();if(!ug&&!Array.isArray(h))throw new Error("production"===process.env.NODE_ENV?Mg(6):"`enhancers` callback must return an array");if(!ug&&h.some((e=>"function"!=typeof e)))throw new Error("production"===process.env.NODE_ENV?Mg(7):"each enhancer provided to configureStore must be a function");return ug||!d.length||h.includes(c)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),Bi(a,i,l(...h))}({reducer:n.reducer,middleware:e=>e({thunk:{extraArgument:this},serializableCheck:!1}),devTools:!1}),o=e=>async(...n)=>{const r=await t.dispatch(e(...n));try{bg(r)}catch(e){this.logger.error(e.message,r.type,e.stack)}return r},i=Object.keys(r).reduce(((e,t)=>(e[t]=o(r[t]),e)),{});this.actions=i,this.subscribe=(e,n=(e=>e))=>t.subscribe((()=>e(n(t.getState()))))}}})),dv=mi((e=>class extends(Pg(e)){validateForm(e){return this.getFormInputs(e).every((e=>{var t,n;return null===(t=e.reportValidity)||void 0===t||t.call(e),null===(n=e.checkValidity)||void 0===n?void 0:n.call(e)}))}getFormInputs(e){return e?Array.from(e.querySelectorAll("[name]")):(this.logger.debug("cannot get form inputs, no root element was received"),[])}getFormData(e){return this.getFormInputs(e).reduce(((e,t)=>Object.assign(e,{[t.getAttribute("name")]:t.value})),{})}setFormData(e,t){this.getFormInputs(e).forEach((e=>{t.hasOwnProperty(e.getAttribute("name"))&&(e.value=t[e.getAttribute("name")])}))}resetFormData(e){this.getFormInputs(e).forEach((e=>{e.value="",e.checked=!1}))}getFormFieldNames(e){return this.getFormInputs(e).map((e=>e.name))}disableFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.setAttribute("disabled","true")}removeFormField(e,t){var n;null===(n=this.getFormInputs(e).find((e=>e.name===t)))||void 0===n||n.remove()}})),lv=(e,t,n,r={})=>{var o,i,s,a;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(s=r.top)&&void 0!==s?s:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(a=r.bottom)&&void 0!==a?a:0))]};var cv,uv,hv,fv,pv,gv,vv,mv,$v,yv;const bv=document.createElement("template");bv.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class wv extends HTMLElement{constructor(){var e;super(),cv.add(this),uv.set(this,new Oi({messages:[]})),hv.set(this,void 0),fv.set(this,void 0),pv.set(this,void 0),gv.set(this,{resize:h(this,cv,"m",yv).bind(this)}),this.attachShadow({mode:"open"}),null===(e=this.shadowRoot)||void 0===e||e.appendChild(bv.content.cloneNode(!0)),f(this,hv,this.shadowRoot.querySelector(".debugger"),"f"),f(this,fv,h(this,hv,"f").querySelector(".content"),"f"),f(this,pv,h(this,hv,"f").querySelector(".header"),"f")}updateData(e){h(this,uv,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,s=0;function a(t){t.preventDefault(),r=i-t.clientX,o=s-t.clientY,i=t.clientX,s=t.clientY;const[a,d]=lv(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${d}px`,e.style.left=`${a}px`}function d(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,s=e.clientY,document.onmouseup=d,document.onmousemove=a}t?t.onmousedown=l:e.onmousedown=l})(h(this,hv,"f"),h(this,pv,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,gv,"f").resize),(e=h(this,hv,"f")).onmousemove=t=>{var n;const r=t.target;(r.w&&r.w!==r.offsetWidth||r.h&&r.h!==r.offsetHeight)&&(null===(n=e.onresize)||void 0===n||n.call(e,t)),r.w=r.offsetWidth,r.h=r.offsetHeight},h(this,hv,"f").onresize=h(this,cv,"m",$v).bind(this),h(this,uv,"f").subscribe(h(this,cv,"m",vv).bind(this))}disconnectedCallback(){h(this,uv,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,gv,"f").resize)}}uv=new WeakMap,hv=new WeakMap,fv=new WeakMap,pv=new WeakMap,gv=new WeakMap,cv=new WeakSet,vv=function(e){h(this,cv,"m",mv).call(this,e),h(this,cv,"m",$v).call(this)},mv=function(e){h(this,fv,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description||""}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},$v=function(){h(this,fv,"f").querySelectorAll(".msg").forEach((e=>{const t=e,n=t.querySelector(".msg_desc"),r=n.scrollWidth>n.clientWidth,o=n.clientHeight>20;r||o?(t.classList.add("collapsible"),t.onclick=e=>{e.target.classList.contains("msg_desc")||t.classList.toggle("collapsed")}):(t.classList.remove("collapsible"),t.onclick=null)}))},yv=function(){const[e,t]=lv(h(this,hv,"f"),Number.parseInt(h(this,hv,"f").style.left,10),Number.parseInt(h(this,hv,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,hv,"f").style.top=`${t}px`,h(this,hv,"f").style.left=`${e}px`},customElements.get("descope-debugger")||customElements.define("descope-debugger",wv);var Ev=Object.freeze({__proto__:null});const Cv=e=>e.selectedAccessKeysIds,kv=e=>e.notifications,Ov=Xs((e=>e.accessKeysList.data),(e=>e.map((e=>Object.assign(Object.assign({},e),{expireTimeFormatted:(null==e?void 0:e.expireTime)?new Date(1e3*((null==e?void 0:e.expireTime)||0)).toLocaleString():"Never",createdTimeFormatted:new Date(1e3*((null==e?void 0:e.createdTime)||0)).toLocaleString(),status:(null==e?void 0:e.expireTime)&&new Date(1e3*((null==e?void 0:e.expireTime)||0))<new Date?"expired":null==e?void 0:e.status}))))),xv=Xs(Cv,Ov,((e,t)=>t.filter((t=>e.includes(t.id))))),Sv=Xs(Cv,(e=>!!e.length)),Iv=Xs(xv,(e=>e.every((e=>e.editable)))),Rv=Xs(Iv,Sv,((e,t)=>e&&t));Xs(Cv,(e=>1===e.length));const jv=Xs(xv,(e=>1===e.length?e[0].name:`${e.length} access keys`)),Nv=e=>(...t)=>n=>{n.addCase(e.pending,((e,n)=>{t.forEach((({onPending:t})=>{null==t||t(e,n)}))})),n.addCase(e.fulfilled,((e,n)=>{t.forEach((({onFulfilled:t})=>{null==t||t(e,n)}))})),n.addCase(e.rejected,((e,n)=>{t.forEach((({onRejected:t})=>{null==t||t(e,n)}))}))},Mv=e=>({onFulfilled:t=>{e(t).loading=!1},onPending:t=>{e(t).loading=!0,e(t).error=null},onRejected:(t,n)=>{e(t).loading=!1,e(t).error=n.error}}),Av=({getErrorMsg:e,getSuccessMsg:t})=>({onFulfilled:(e,n)=>{t&&e.notifications.push({type:"success",msg:t(n)})},onRejected:(t,n)=>{e&&t.notifications.push({type:"error",msg:e(n)})}}),Pv=yg("accessKeys/create",((e,{extra:{api:t}})=>t.accesskey.create(e))),Tv=Nv(Pv)({onFulfilled:(e,t)=>{e.accessKeysList.data.unshift(t.payload.key)}},Mv((e=>e.createAccessKey)),Av({getSuccessMsg:()=>"Access Key created successfully",getErrorMsg:e=>{var t;return`\n <div>\n <div>Failed to create access key</div>\n ${null===(t=e.error)||void 0===t?void 0:t.message}\n </div>`}})),Dv={action:Pv,reducer:Tv},_v=yg("accessKeys/delete",((e,{extra:{api:t}})=>t.accesskey.deleteBatch(e))),Lv=Nv(_v)({onFulfilled:(e,t)=>{e.accessKeysList.data=e.accessKeysList.data.filter((e=>!t.meta.arg.includes(e.id))),e.selectedAccessKeysIds=[]}},Mv((e=>e.deleteAccessKey)),Av({getSuccessMsg:e=>gi(e.meta.arg.length)`${["",e.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deleted successfully`,getErrorMsg:e=>gi(e.meta.arg.length)`Failed to delete access key${["","s"]}`})),Wv={action:_v,reducer:Lv},Uv=yg("accessKeys/search",((e,{extra:{api:t},getState:n})=>{const r=n().searchParams;return t.accesskey.search(Object.assign(Object.assign({},r),e))})),Fv=Nv(Uv)({onPending:(e,t)=>{e.searchParams=Object.assign(Object.assign({},e.searchParams),t.meta.arg)},onFulfilled:(e,t)=>{e.accessKeysList.data=t.payload}},Mv((e=>e.accessKeysList))),Vv={action:Uv,reducer:Fv},qv=yg("accessKeys/activate",((e,{extra:{api:t}})=>t.accesskey.activate(e))),Bv=Nv(qv)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="active")}))}},Mv((e=>e.activateAccessKey)),Av({getSuccessMsg:e=>gi(e.meta.arg.length)`${["",e.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} activated successfully`,getErrorMsg:e=>gi(e.meta.arg.length)`Failed to activate access key${["","s"]}`})),Kv={action:qv,reducer:Bv},zv=yg("accessKeys/deactivate",((e,{extra:{api:t}})=>t.accesskey.deactivate(e))),Hv=Nv(zv)({onFulfilled:(e,t)=>{e.accessKeysList.data.forEach((e=>{t.meta.arg.includes(e.id)&&(e.status="inactive")}))}},Mv((e=>e.deactivateAccessKey)),Av({getSuccessMsg:e=>gi(e.meta.arg.length)`${["",e.meta.arg.length]} ${["A","a"]}ccess key${["","s"]} deactivated successfully`,getErrorMsg:e=>gi(e.meta.arg.length)`Failed to deactivate access key${["","s"]}`})),Gv={action:zv,reducer:Hv},Jv=yg("tenant/getTenantRoles",((e,{extra:{api:t}})=>t.tenant.getTenantRoles())),Zv={action:Jv,reducer:Nv(Jv)({onFulfilled:(e,t)=>{e.tenantRoles.data=t.payload.roles}},Mv((e=>e.tenantRoles)))},Xv={accessKeysList:{data:[],loading:!1,error:null},createAccessKey:{loading:!1,error:null},activateAccessKey:{loading:!1,error:null},deactivateAccessKey:{loading:!1,error:null},deleteAccessKey:{loading:!1,error:null},tenantRoles:{loading:!1,error:null,data:[]},searchParams:{text:"",sort:[]},selectedAccessKeysIds:[],notifications:[]},Yv="/v1/mgmt/accesskey/search",Qv="/v1/mgmt/accesskey/delete/batch",em="/v1/mgmt/accesskey/create",tm="/v1/mgmt/accesskey/deactivate/batch",nm="/v1/mgmt/accesskey/activate/batch",rm="/v1/mgmt/role/all",om=e=>u(void 0,void 0,void 0,(function*(){const t=yield e.text(),n=JSON.parse(t);if(!e.ok){const t=`${n.errorDescription}${n.errorMessage?`: ${n.errorMessage}`:""}`;throw Error(t||`${e.status} ${e.statusText}`)}e.json=()=>Promise.resolve(n),e.text=()=>Promise.resolve(t)})),im=({httpClient:e,tenant:t,mock:n})=>({search:({page:r,limit:o=1e4,text:i,sort:s}={})=>u(void 0,void 0,void 0,(function*(){if(n)return(({text:e,sort:t}={})=>u(void 0,void 0,void 0,(function*(){return new Promise((n=>{const r=[];for(let e=1;e<9;e+=1)r.push({id:`access-key-id-${e}`,name:`Access Key ${e}`,createdBy:`User ${e}`,editable:!0,expireTime:(new Date).getTime()/1e3+2592e3,createdTime:(new Date).getTime()/1e3,roleNames:[`Role ${e}`],status:"active",clientId:`Client ID ${e}`});t.forEach((e=>{r.sort(((t,n)=>{var r,o;return e.desc?null===(o=n[e.field])||void 0===o?void 0:o.localeCompare(t[e.field]):null===(r=t[e.field])||void 0===r?void 0:r.localeCompare(n[e.field])}))})),n(r.filter((t=>t.name.toLowerCase().includes(e.toLowerCase())||t.createdBy.toLowerCase().includes(e.toLowerCase()))))}))})))({page:r,limit:o,text:i,sort:s});const a=yield e.post(Yv,{limit:o,page:r,text:i,sort:s},{queryParams:{tenant:t}});return yield om(a),(yield a.json()).keys})),deleteBatch:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(Qv,{ids:r},{queryParams:{tenant:t}});return yield om(o),o.json()})),create:({name:r,expiration:o,roleNames:i,userId:s})=>u(void 0,void 0,void 0,(function*(){const a=new Date;a.setDate(a.getDate()+ +o);const d="0"===o[0]?0:Math.floor(a.getTime()/1e3);if(n)return(({name:e,roleNames:t,userId:n},r)=>u(void 0,void 0,void 0,(function*(){const o=Math.random().toString(10).substring(15);return new Promise((i=>{i({cleartext:Math.random().toString(20).substring(2),key:{id:`access-key-id-${o}`,name:e||`Access Key ${o}`,createdBy:n||`User ${o}`,editable:!0,expireTime:r,createdTime:(new Date).getTime()/1e3,roleNames:t,status:"active",clientId:`Client ID ${o}`}})}))})))({name:r,expiration:o,roleNames:i,userId:s},d);const l=yield e.post(em,{name:r,expireTime:d,roleNames:i,userId:s},{queryParams:{tenant:t}});return yield om(l),yield l.json()})),activate:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(nm,{ids:r},{queryParams:{tenant:t}});return yield om(o),yield o.json()})),deactivate:r=>u(void 0,void 0,void 0,(function*(){if(n)return u(void 0,void 0,void 0,(function*(){}));const o=yield e.post(tm,{ids:r},{queryParams:{tenant:t}});return yield om(o),yield o.json()}))}),sm=({httpClient:e,tenant:t,mock:n})=>({getTenantRoles:()=>u(void 0,void 0,void 0,(function*(){if(n)return(e=>new Promise((t=>{const n=[];for(let t=1;t<5;t+=1)n.push({name:`Role ${t}`,description:`Role description ${t}`,createdTime:new Date,permissionNames:[`Permission ${t}`],tenantId:e});t({roles:n})})))(t);const r=yield e.get(rm,{queryParams:{tenant:t}});return yield om(r),r.json()}))}),am=mi((e=>{var t,n,r,o;const i=ci(Fg,Wg,Pg,Ug({tenant:Ug.missingAttrValidator}))(e);return o=class extends i{constructor(){super(...arguments),t.add(this),n.set(this,void 0)}get baseUrl(){return this.getAttribute("base-url")}get tenant(){return this.getAttribute("tenant")}get mock(){return this.getAttribute("mock")}get api(){return h(this,n,"f")||h(this,t,"m",r).call(this),h(this,n,"f")}init(){const e=Object.create(null,{init:{get:()=>super.init}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.init)||void 0===o?void 0:o.call(this),this.observeAttributes(["project-id","base-url","tenant"],(()=>{h(this,n,"f")&&h(this,t,"m",r).call(this)}))}))}},n=new WeakMap,t=new WeakSet,r=function(){this.logger.debug("creating an sdk instance"),f(this,n,((e,t,n)=>{const r=Hn(Object.assign(Object.assign({},e),{persistTokens:!0}));return{accesskey:im({httpClient:r.httpClient,tenant:t,mock:n}),tenant:sm({httpClient:r.httpClient,tenant:t,mock:n})}})({projectId:this.projectId,baseUrl:this.baseUrl},this.tenant,"true"===this.mock),"f")},o})),dm=mi((e=>{const t=ci(av({name:"widget",initialState:Xv,reducers:{setSelectedAccessKeysIds:(e,{payload:t})=>{e.selectedAccessKeysIds=t},clearNotifications:e=>{e.notifications=[]}},extraReducers:e=>{Dv.reducer(e),Wv.reducer(e),Vv.reducer(e),Kv.reducer(e),Gv.reducer(e),Zv.reducer(e)},asyncActions:{searchAccessKeys:Vv.action,createAccessKey:Dv.action,activateAccessKeys:Kv.action,deactivateAccessKeys:Gv.action,deleteAccessKeys:Wv.action,getTenantRoles:Zv.action}}),Lg,Pg,am)(e);return class extends t{constructor(...e){super(...e),this.state=Xv,this.subscribe((e=>{this.logger.debug("State update:",e),this.state=e}))}}})),lm=mi((e=>{const t=ci(Vg,Ug({"widget-id":Ug.missingAttrValidator}))(e);return class extends t{get widgetId(){return this.getAttribute("widget-id")}fetchWidgetPage(e){return u(this,void 0,void 0,(function*(){return(yield this.fetchStaticResource(`access-key-management-widget/${this.widgetId}/${e}`,"text")).body}))}}})),cm=mi((e=>{var t,n,r;return r=class extends(ci(Pg,Lg,Xg,ev,lm,dm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){return u(this,void 0,void 0,(function*(){}))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.init)||void 0===r?void 0:r.call(this),yield Promise.all([h(this,t,"m",n).call(this),this.actions.searchAccessKeys(),this.actions.getTenantRoles()]),this.onWidgetRootReady()}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){const e=ui(yield this.fetchWidgetPage("root.html"));yield this.loadDescopeUiComponents(e),this.contentRootElement.append(e.content.cloneNode(!0))}))},r})),um=mi((e=>{var t,n,r,o,i;return i=class extends(ci(dm,Pg,cm)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{this.accessKeysTable.data=e}))),o.set(this,vi(((e,t)=>{const n=[],{value:r}=t;if(r){const t=e.path;n.push({field:t,desc:"desc"===r})}this.actions.searchAccessKeys({sort:n})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var i;return u(this,void 0,void 0,(function*(){yield null===(i=e.onWidgetRootReady)||void 0===i?void 0:i.call(this),h(this,t,"m",n).call(this),this.accessKeysTable.columns.forEach((e=>{e.onSortDirectionChange((e=>{h(this,o,"f").call(this,e.target,e.detail)}))})),h(this,r,"f").call(this,Ov(this.state)),this.subscribe(h(this,r,"f").bind(this),Ov)}))}},r=new WeakMap,o=new WeakMap,t=new WeakSet,n=function(){var e;this.accessKeysTable=new Ri(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="access-keys-table"]'),{logger:this.logger}),this.accessKeysTable.onSelectedItemsChange((e=>{this.actions.setSelectedAccessKeysIds(e.detail.value.map((({id:e})=>e)))}))},i})),hm=mi((e=>{var t,n,r;return r=class extends(ci(dm,nv,Pg,cm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.activateAccessKeysModal=this.createModal(),this.activateAccessKeysModal.setContent(ui(yield this.fetchWidgetPage("activate-access-keys-modal.html")));const t=new ji((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.activateAccessKeysModal.close()));const n=new ji((()=>{var e;return null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=xv(this.state);this.actions.activateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.activateAccessKeysModal.close()}));const r=new Ti(null===(e=this.activateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.activateAccessKeysModal.beforeOpen=()=>{const e=jv(this.state);r.text=`Activate ${e}?`}}))},r})),fm=mi((e=>{var t,n,r,o;return o=class extends(ci(Pg,cm,dm,hm)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.activateButton.enable():this.activateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Rv)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.activateButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="activate-access-keys"]'),{logger:this.logger}),this.activateButton.disable(),this.activateButton.onClick((()=>{this.activateAccessKeysModal.open()}))},o})),pm=mi((e=>{var t,n,r;return r=class extends(ci(dm,nv,dv,Pg,cm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){return u(this,void 0,void 0,(function*(){this.createdAccessKeyModal=this.createModal(),this.createdAccessKeyModal.setContent(ui(yield this.fetchWidgetPage("created-access-key-modal.html")));new ji((()=>{var e;return null===(e=this.createdAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-close"]')}),{logger:this.logger}).onClick((()=>{navigator.clipboard.writeText(this.getFormData(this.createdAccessKeyModal.ele)["generated-key"]),this.resetFormData(this.createdAccessKeyModal.ele),this.createdAccessKeyModal.close()}))}))},r})),gm=mi((e=>{var t,n,r,o,i;return i=class extends(ci(dm,nv,dv,Pg,cm,pm)(e)){constructor(){super(...arguments),t.add(this),n.set(this,void 0),o.set(this,(()=>u(this,void 0,void 0,(function*(){var e,t;yield h(this,n,"f").setData(null===(t=this.state,e=t.tenantRoles.data||[])||void 0===e?void 0:e.map((({name:e})=>({value:e,label:e}))))}))))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,o=new WeakMap,t=new WeakSet,r=function e(){return u(this,void 0,void 0,(function*(){this.createAccessKeyModal=this.createModal(),this.createAccessKeyModal.setContent(ui(yield this.fetchWidgetPage("create-access-key-modal.html")));const r=new ji((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});r.onClick((()=>{this.createAccessKeyModal.close(),this.resetFormData(this.createAccessKeyModal.ele)}));const i=new ji((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});i.onClick((()=>u(this,void 0,void 0,(function*(){var e;if(this.validateForm(this.createAccessKeyModal.ele)){const t=yield this.actions.createAccessKey(Object.assign({},this.getFormData(this.createAccessKeyModal.ele)));this.createAccessKeyModal.close(),this.setFormData(this.createdAccessKeyModal.ele,{"generated-key":null===(e=null==t?void 0:t.payload)||void 0===e?void 0:e.cleartext}),this.createdAccessKeyModal.open()}})))),f(this,n,new Ai((()=>{var e;return null===(e=this.createAccessKeyModal.ele)||void 0===e?void 0:e.querySelector('[data-id="roles-multiselect"]')}),{logger:this.logger}),"f"),h(this,o,"f").call(this),this.createAccessKeyModal.afterClose=()=>{h(this,t,"m",e).call(this)}}))},i})),vm=mi((e=>{var t,n,r;return r=class extends(ci(Pg,gm,cm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;this.createButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="create-access-key"]'),{logger:this.logger}),this.createButton.onClick((()=>this.createAccessKeyModal.open()))},r})),mm=mi((e=>{var t,n,r;return r=class extends(ci(dm,nv,Pg,cm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.deactivateAccessKeysModal=this.createModal(),this.deactivateAccessKeysModal.setContent(ui(yield this.fetchWidgetPage("deactivate-access-keys-modal.html")));const t=new ji((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deactivateAccessKeysModal.close()));const n=new ji((()=>{var e;return null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=xv(this.state);this.actions.deactivateAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deactivateAccessKeysModal.close()}));const r=new Ti(null===(e=this.deactivateAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deactivateAccessKeysModal.beforeOpen=()=>{const e=jv(this.state);r.text=`Deactivate ${e}?`}}))},r})),$m=mi((e=>{var t,n,r,o;return o=class extends(ci(Pg,cm,dm,mm)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.deactivateButton.enable():this.deactivateButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Rv)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.deactivateButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="deactivate-access-keys"]'),{logger:this.logger}),this.deactivateButton.disable(),this.deactivateButton.onClick((()=>{this.deactivateAccessKeysModal.open()}))},o})),ym=mi((e=>{var t,n,r;return r=class extends(ci(dm,nv,Pg,cm)(e)){constructor(){super(...arguments),t.add(this)}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var r;return u(this,void 0,void 0,(function*(){yield null===(r=e.onWidgetRootReady)||void 0===r?void 0:r.call(this),yield h(this,t,"m",n).call(this)}))}},t=new WeakSet,n=function(){var e;return u(this,void 0,void 0,(function*(){this.deleteAccessKeysModal=this.createModal(),this.deleteAccessKeysModal.setContent(ui(yield this.fetchWidgetPage("delete-access-keys-modal.html")));const t=new ji((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-cancel"]')}),{logger:this.logger});t.onClick((()=>this.deleteAccessKeysModal.close()));const n=new ji((()=>{var e;return null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="modal-submit"]')}),{logger:this.logger});n.onClick((()=>{const e=xv(this.state);this.actions.deleteAccessKeys(null==e?void 0:e.map((e=>e.id))),this.deleteAccessKeysModal.close()}));const r=new Ti(null===(e=this.deleteAccessKeysModal.ele)||void 0===e?void 0:e.querySelector('[data-id="body-text"]'),{logger:this.logger});this.deleteAccessKeysModal.beforeOpen=()=>{const e=jv(this.state);r.text=`Delete ${e}?`}}))},r})),bm=mi((e=>{var t,n,r,o;return o=class extends(ci(Pg,cm,dm,ym)(e)){constructor(){super(...arguments),t.add(this),r.set(this,pi((e=>{e?this.deleteButton.enable():this.deleteButton.disable()})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var o;return u(this,void 0,void 0,(function*(){yield null===(o=e.onWidgetRootReady)||void 0===o?void 0:o.call(this),h(this,t,"m",n).call(this),this.subscribe(h(this,r,"f").bind(this),Rv)}))}},r=new WeakMap,t=new WeakSet,n=function(){var e;this.deleteButton=new ji(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="delete-access-keys"]'),{logger:this.logger}),this.deleteButton.disable(),this.deleteButton.onClick((()=>{this.deleteAccessKeysModal.open()}))},o})),wm=mi((e=>{var t,n,r,o;return o=class extends(ci(Pg,cm,dm)(e)){constructor(){super(...arguments),t.add(this),n.set(this,vi((()=>{this.actions.searchAccessKeys({text:this.searchInput.value})})))}onWidgetRootReady(){const e=Object.create(null,{onWidgetRootReady:{get:()=>super.onWidgetRootReady}});var n;return u(this,void 0,void 0,(function*(){yield null===(n=e.onWidgetRootReady)||void 0===n?void 0:n.call(this),h(this,t,"m",r).call(this)}))}},n=new WeakMap,t=new WeakSet,r=function(){var e;this.searchInput=new Di(null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector('[data-id="search-input"]'),{logger:this.logger}),this.searchInput.onInput(h(this,n,"f"))},o})),Em={success:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Checkmark">\n<path id="Shape" d="M10.0485 15.6396C9.5799 15.171 8.8201 15.171 8.35147 15.6396C7.88284 16.1082 7.88284 16.868 8.35147 17.3367L12.7072 21.6924C13.1759 22.1611 13.9357 22.1611 14.4043 21.6924L24.7152 11.3815C25.1838 10.9129 25.1838 10.1531 24.7152 9.68448C24.2466 9.21585 23.4868 9.21585 23.0181 9.68448L13.5558 19.1469L10.0485 15.6396Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,error:(new DOMParser).parseFromString('<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Vector" d="M15.9998 26.6558C10.1118 26.6558 5.34375 21.8878 5.34375 15.9998C5.34375 10.1118 10.1118 5.34375 15.9998 5.34375C21.8878 5.34375 26.6558 10.1118 26.6558 15.9998C26.6558 21.8878 21.8878 26.6558 15.9998 26.6558ZM15.9998 24.4798C20.6718 24.4798 24.4798 20.7038 24.4798 15.9998C24.4798 11.3278 20.7038 7.51975 15.9998 7.51975C11.3278 7.51975 7.51975 11.2958 7.51975 15.9998C7.51975 20.6718 11.2958 24.4798 15.9998 24.4798ZM15.3278 9.34375H16.6718C17.0558 9.34375 17.3438 9.63175 17.3118 9.98375L16.9598 16.9278C16.9598 17.1838 16.7678 17.3438 16.5438 17.3438H15.4558C15.2318 17.3438 15.0398 17.1518 15.0398 16.9278L14.6878 9.98375C14.6878 9.63175 14.9758 9.34375 15.3278 9.34375ZM15.4558 19.4558H16.5438C16.9278 19.4558 17.2158 19.7438 17.1838 20.1278V21.1838C17.1838 21.5678 16.8958 21.8558 16.5438 21.8558H15.4558C15.0718 21.8558 14.7838 21.5678 14.7838 21.1838V20.1278C14.7838 19.7438 15.0718 19.4558 15.4558 19.4558Z" fill="#FFDFDD"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild},Cm=mi((e=>{var t,n,r,o,i;return i=class extends(ci(Pg,dm,ov,Lg)(e)){constructor(){super(...arguments),t.add(this),o.set(this,pi((e=>{e.length&&(e.forEach((({type:e,msg:o})=>{const i=h(this,t,"m",r).call(this,e);i.setContent(h(this,t,"m",n).call(this,{type:e,msg:o})),i.show()})),setTimeout((()=>this.actions.clearNotifications())))})))}init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this),this.subscribe(h(this,o,"f").bind(this),kv)}))}},o=new WeakMap,t=new WeakSet,n=function({type:e,msg:t}){const n=Em[e],r=Object.assign((new DOMParser).parseFromString('<svg width="2em" height="2em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g id="Icon">\n<path id="Shape" d="M10.6712 12L7.27521 8.60406C6.90826 8.23711 6.90826 7.64216 7.27521 7.27521C7.64216 6.90826 8.23711 6.90826 8.60406 7.27521L12 10.6712L15.3959 7.27521C15.7629 6.90826 16.3578 6.90826 16.7248 7.27521C17.0917 7.64216 17.0917 8.23711 16.7248 8.60406L13.3288 12L16.7248 15.3959C17.0917 15.7629 17.0917 16.3578 16.7248 16.7248C16.3578 17.0917 15.7629 17.0917 15.3959 16.7248L12 13.3288L8.60406 16.7248C8.23711 17.0917 7.64216 17.0917 7.27521 16.7248C6.90826 16.3578 6.90826 15.7629 7.27521 15.3959L10.6712 12Z" fill="white"/>\n</g>\n</svg>\n',"image/svg+xml").firstChild,{slot:"close"});return`${(null==n?void 0:n.outerHTML)||""}${t}${r.outerHTML}`},r=function(e){return this.createNotification({mode:e,duration:"error"===e?0:3e3,position:"bottom-start",size:"sm"})},i})),km=mi((e=>class extends(ci(Bg,sv,um,vm,bm,wm,fm,$m,Cm)(e)){init(){const e=Object.create(null,{init:{get:()=>super.init}});var t;return u(this,void 0,void 0,(function*(){yield null===(t=e.init)||void 0===t?void 0:t.call(this)}))}})),Om=ci((e=>class extends(km(e)){}))(HTMLElement);customElements.define("descope-access-key-management-widget",Om);var xm=Object.freeze({__proto__:null,default:Om});const Sm=(e,t,n,r={})=>{var o,i,s,a;return[Math.min(Math.max(t,("all"===r.left?e.offsetWidth:null!==(o=r.left)&&void 0!==o?o:0)-e.offsetWidth),window.innerWidth-("all"===r.right?e.offsetWidth:null!==(i=r.right)&&void 0!==i?i:0)),Math.min(Math.max(n,("all"===r.top?e.offsetHeight:null!==(s=r.top)&&void 0!==s?s:0)-e.offsetHeight),window.innerHeight-("all"===r.bottom?e.offsetHeight:null!==(a=r.bottom)&&void 0!==a?a:0))]};var Im,Rm,jm,Nm,Mm,Am,Pm,Tm,Dm,_m;const Lm=document.createElement("template");Lm.innerHTML=`\n<style>\n .debugger {\n width: 300px;\n height: 200px;\n background-color: #FAFAFA;\n position: fixed;\n font-family: "Helvetica Neue", sans-serif;\n box-shadow: rgba(0, 0, 0, 0.1) 0px 5px 10px;\n border-radius: 8px;\n overflow: hidden;\n border: 1px solid lightgrey;\n pointer-events: initial;\n display: flex;\n flex-direction: column;\n min-width: 200px;\n max-width: 600px;\n max-height: calc(100% - 64px);\n min-height: 200px;\n resize: both;\n }\n\n .header {\n padding: 8px 16px;\n display: flex;\n align-items: center;\n background-color: #EEEEEE;\n cursor: move;\n border-bottom: 1px solid #e0e0e0;\n }\n\n .content {\n font-size: 14px;\n flex-grow: 1;\n overflow: auto;\n }\n\n .msg {\n border-bottom: 1px solid lightgrey;\n padding: 8px 16px;\n display: flex;\n gap: 5px;\n background-color: #FAFAFA;\n }\n\n .msg.collapsible {\n cursor: pointer;\n }\n\n .empty-state {\n padding: 8px 16px;\n background-color: #FAFAFA;\n }\n\n\n .msg.collapsible:not(.collapsed) {\n background-color: #F5F5F5;\n }\n\n .msg_title {\n padding-bottom: 5px;\n display: flex;\n gap: 8px;\n font-weight: 500;\n }\n\n .msg svg {\n padding: 1px;\n flex-shrink: 0;\n margin-top: -2px;\n }\n\n .msg_content {\n overflow: hidden;\n flex-grow: 1;\n margin-right:5px;\n }\n\n .msg_desc {\n color: #646464;\n cursor: initial;\n word-wrap: break-word;\n }\n\n .msg.collapsed .msg_desc {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .msg.collapsible.collapsed .chevron {\n transform: rotate(-45deg) translateX(-2px);\n }\n\n .msg.collapsible .chevron {\n content: "";\n width:6px;\n height:6px;\n border-bottom: 2px solid grey;\n border-right: 2px solid grey;\n transform: rotate(45deg) translateX(-1px);\n margin: 5px;\n flex-shrink:0;\n }\n</style>\n\n<div style="top:32px; left:${window.innerWidth-300-32}px;" class="debugger">\n <div class="header">\n <span>Debugger messages</span>\n </div>\n <div class="content">\n <div class="empty-state">\n No errors detected 👀\n </div>\n </div>\n</div>\n`;class Wm extends HTMLElement{constructor(){super(),Im.add(this),Rm.set(this,new no({messages:[]})),jm.set(this,void 0),Nm.set(this,void 0),Mm.set(this,void 0),Am.set(this,{resize:h(this,Im,"m",_m).bind(this)}),this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Lm.content.cloneNode(!0)),f(this,jm,this.shadowRoot.querySelector(".debugger"),"f"),f(this,Nm,h(this,jm,"f").querySelector(".content"),"f"),f(this,Mm,h(this,jm,"f").querySelector(".header"),"f")}updateData(e){h(this,Rm,"f").update((t=>({messages:t.messages.concat(e)})))}connectedCallback(){var e;((e,t,n)=>{let r=0,o=0,i=0,s=0;function a(t){t.preventDefault(),r=i-t.clientX,o=s-t.clientY,i=t.clientX,s=t.clientY;const[a,d]=Sm(e,e.offsetLeft-r,e.offsetTop-o,n);e.style.top=`${d}px`,e.style.left=`${a}px`}function d(){document.onmouseup=null,document.onmousemove=null}function l(e){e.preventDefault(),i=e.clientX,s=e.clientY,document.onmouseup=d,document.onmousemove=a}t?t.onmousedown=l:e.onmousedown=l})(h(this,jm,"f"),h(this,Mm,"f"),{top:"all",bottom:100,left:100,right:100}),window.addEventListener("resize",h(this,Am,"f").resize),(e=h(this,jm,"f")).onmousemove=t=>{(t.target.w&&t.target.w!==t.target.offsetWidth||t.target.h&&t.target.h!==t.target.offsetHeight)&&e.onresize(t),t.target.w=t.target.offsetWidth,t.target.h=t.target.offsetHeight},h(this,jm,"f").onresize=h(this,Im,"m",Dm).bind(this),h(this,Rm,"f").subscribe(h(this,Im,"m",Pm).bind(this))}disconnectedCallback(){h(this,Rm,"f").unsubscribeAll(),window.removeEventListener("resize",h(this,Am,"f").resize)}}Rm=new WeakMap,jm=new WeakMap,Nm=new WeakMap,Mm=new WeakMap,Am=new WeakMap,Im=new WeakSet,Pm=function(e){h(this,Im,"m",Tm).call(this,e),h(this,Im,"m",Dm).call(this)},Tm=function(e){h(this,Nm,"f").innerHTML=e.messages.map((e=>`\n <div class="msg">\n <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M5.99984 13.167L8.99984 10.167L11.9998 13.167L13.1665 12.0003L10.1665 9.00033L13.1665 6.00033L11.9998 4.83366L8.99984 7.83366L5.99984 4.83366L4.83317 6.00033L7.83317 9.00033L4.83317 12.0003L5.99984 13.167ZM8.99984 17.3337C7.84706 17.3337 6.76373 17.1148 5.74984 16.677C4.73595 16.2398 3.854 15.6462 3.104 14.8962C2.354 14.1462 1.76039 13.2642 1.32317 12.2503C0.885393 11.2364 0.666504 10.1531 0.666504 9.00033C0.666504 7.84755 0.885393 6.76421 1.32317 5.75033C1.76039 4.73644 2.354 3.85449 3.104 3.10449C3.854 2.35449 4.73595 1.7606 5.74984 1.32283C6.76373 0.885603 7.84706 0.666992 8.99984 0.666992C10.1526 0.666992 11.2359 0.885603 12.2498 1.32283C13.2637 1.7606 14.1457 2.35449 14.8957 3.10449C15.6457 3.85449 16.2393 4.73644 16.6765 5.75033C17.1143 6.76421 17.3332 7.84755 17.3332 9.00033C17.3332 10.1531 17.1143 11.2364 16.6765 12.2503C16.2393 13.2642 15.6457 14.1462 14.8957 14.8962C14.1457 15.6462 13.2637 16.2398 12.2498 16.677C11.2359 17.1148 10.1526 17.3337 8.99984 17.3337ZM8.99984 15.667C10.8609 15.667 12.4373 15.0212 13.729 13.7295C15.0207 12.4378 15.6665 10.8614 15.6665 9.00033C15.6665 7.13921 15.0207 5.56283 13.729 4.27116C12.4373 2.97949 10.8609 2.33366 8.99984 2.33366C7.13873 2.33366 5.56234 2.97949 4.27067 4.27116C2.979 5.56283 2.33317 7.13921 2.33317 9.00033C2.33317 10.8614 2.979 12.4378 4.27067 13.7295C5.56234 15.0212 7.13873 15.667 8.99984 15.667Z" fill="#ED404A"/>\n</svg>\n\n <div class="msg_content">\n <div class="msg_title">\n ${e.title}\n </div>\n <div class="msg_desc">\n ${e.description}\n </div>\n </div>\n <div class="chevron"></div>\n </div>\n `)).join("")},Dm=function(){h(this,Nm,"f").querySelectorAll(".msg").forEach((e=>{const t=e.querySelector(".msg_desc"),n=t.scrollWidth>t.clientWidth,r=t.clientHeight>20;n||r?(e.classList.add("collapsible"),e.onclick=t=>{t.target.classList.contains("msg_desc")||e.classList.toggle("collapsed")}):(e.classList.remove("collapsible"),e.onclick=null)}))},_m=function(){const[e,t]=Sm(h(this,jm,"f"),Number.parseInt(h(this,jm,"f").style.left,10),Number.parseInt(h(this,jm,"f").style.top,10),{top:"all",bottom:100,left:100,right:100});h(this,jm,"f").style.top=`${t}px`,h(this,jm,"f").style.left=`${e}px`},customElements.get("descope-debugger")||customElements.define("descope-debugger",Wm);var Um=Object.freeze({__proto__:null,default:Wm});e.AccessKeyManagement=ar,e.AuthProvider=({projectId:e,baseUrl:n="",sessionTokenViaCookie:s=!1,children:d})=>{const[l,c]=t.useState(),[u,h]=t.useState(),[f,p]=t.useState(!1),[g,v]=t.useState(!1),m=(({projectId:e,baseUrl:n,sessionTokenViaCookie:r})=>t.useMemo((()=>{if(e)return Jn({projectId:e,baseUrl:n,sessionTokenViaCookie:r,baseHeaders:a,persistToken:!0,autoRefresh:!0})}),[e,n,r]))({projectId:e,baseUrl:n,sessionTokenViaCookie:s});t.useEffect((()=>{if(m){const e=m.onSessionTokenChange(h),t=m.onUserChange(c);return()=>{e(),t()}}}),[m]);const $=t.useRef(!1),y=t.useCallback((()=>{$.current||($.current=!0,v(!0),i(null==m?void 0:m.refresh)().then((()=>{v(!1)})))}),[m]),b=t.useCallback((()=>{p(!0),i(m.me)().then((()=>{p(!1)}))}),[m]),w=t.useMemo((()=>({fetchUser:b,user:l,isUserLoading:f,fetchSession:y,session:u,isSessionLoading:g,isSessionFetched:$.current,projectId:e,baseUrl:n,setUser:c,setSession:h,sdk:m})),[b,l,f,y,u,g,$.current,e,n,c,h,m]);return r.default.createElement(o.Provider,{value:w},d)},e.Descope=tr,e.RoleManagement=ir,e.SignInFlow=e=>r.default.createElement(tr,Object.assign({},e,{flowId:"sign-in"})),e.SignUpFlow=e=>r.default.createElement(tr,Object.assign({},e,{flowId:"sign-up"})),e.SignUpOrInFlow=e=>r.default.createElement(tr,Object.assign({},e,{flowId:"sign-up-or-in"})),e.UserManagement=rr,e.baseHeaders=a,e.getJwtPermissions=Yn,e.getJwtRoles=Qn,e.getRefreshToken=Xn,e.getSessionToken=Zn,e.refresh=(e=Xn())=>null==Gn?void 0:Gn.refresh(e),e.useDescope=()=>{const{sdk:e}=dr();return t.useMemo((()=>e||new Proxy(Jn({projectId:"dummy"}),cr)),[e])},e.useSession=()=>{const{session:e,isSessionLoading:n,fetchSession:r,isSessionFetched:o}=dr(),i=t.useRef(n);t.useMemo((()=>{i.current=n}),[n]);const s=!e&&!n;return t.useMemo((()=>{s&&!o&&(i.current=!0)}),[o]),t.useEffect((()=>{s&&r()}),[r]),{isSessionLoading:i.current,sessionToken:e,isAuthenticated:!!e}},e.useUser=()=>{const{user:e,fetchUser:n,isUserLoading:r,session:o}=dr(),[i,s]=t.useState(!1),a=t.useRef(r),d=t.useMemo((()=>!e&&!r&&o&&!i),[n,o,i]);return t.useMemo((()=>{a.current=r}),[r]),t.useMemo((()=>{d&&(a.current=!0)}),[d]),t.useEffect((()=>{d&&(s(!0),n())}),[d]),{isUserLoading:a.current,user:e}},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
3
3
|
//# sourceMappingURL=index.umd.js.map
|