@useparagon/connect 1.0.3-experimental.4 → 1.0.3
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/src/index.js +1 -1
- package/package.json +1 -1
- package/.env-prod +0 -9
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={773:(t,e,n)=>{"use strict";var r=n(155);Object.defineProperty(e,"__esModule",{value:!0}),e.PARAGON_OVERFLOW_EMPTY_VALUE=void 0;const i=n(655),o=i.__importDefault(n(245)),a=n(59),s=n(343),l=n(643),c=n(429),u=i.__importDefault(n(892)),h=n(821),d=n(158),f=n(846),p=n(321),_=n(35),g="paragon-connect-frame",E=`${g}-container`,v="paragon-connect-user-state";e.PARAGON_OVERFLOW_EMPTY_VALUE="PARAGON_OVERFLOW_EMPTY_VALUE";class S extends u.default{constructor(){if(super(),this.rootLoaded=!1,this.modalState={integration:null,onClose:this.onClose.bind(this),overlayStyle:{overflow:"auto"},onOpen:this.onOpen.bind(this),apiInstallationOptions:{isApiInstallation:!1,showPortalAfterInstall:!1}},this.userState={authenticated:!1},this.loadedConfigs={},this.loadedIntegrations={},this.endUserIntegrationConfig={},this.metadata={},this.cachedApiResponse=new _.CacheThrottle({ttl:5e3}),this.keyToRequestPromiseMap={},this.originalBodyOverflow=e.PARAGON_OVERFLOW_EMPTY_VALUE,"undefined"==typeof window)return void console.warn("connect sdk can only be used on browser");const t=(0,d.getAssetUrl)({CDN_PUBLIC_URL:"https://cdn.useparagon.com",DASHBOARD_PUBLIC_URL:"https://dashboard.useparagon.com",NODE_ENV:"production",PLATFORM_ENV:"production",VERSION:r.env.VERSION||""});if(this.environments={CDN_PUBLIC_URL:t,CONNECT_PUBLIC_URL:"https://connect.useparagon.com",DASHBOARD_PUBLIC_URL:"https://dashboard.useparagon.com",NODE_ENV:"production",PASSPORT_PUBLIC_URL:"https://passport.useparagon.com",PLATFORM_ENV:"production",VERSION:r.env.VERSION,ZEUS_PUBLIC_URL:"https://zeus.useparagon.com"},!this.environments.CONNECT_PUBLIC_URL)throw new Error("Paragon SDK error! No `CONNECT_PUBLIC_URL` configured.");if(!this.environments.DASHBOARD_PUBLIC_URL)throw new Error("Paragon SDK error! No `DASHBOARD_PUBLIC_URL` configured.");if(!this.environments.PASSPORT_PUBLIC_URL)throw new Error("Paragon SDK error! No `PASSPORT_PUBLIC_URL` configured.");if(!this.environments.ZEUS_PUBLIC_URL)throw new Error("Paragon SDK error! No `ZEUS_PUBLIC_URL` configured.");this.loadState(),window.addEventListener("message",this.eventMessageHandler.bind(this)),window.document.readyState===h.DocumentLoadingState.LOADING?window.document.addEventListener("DOMContentLoaded",(()=>{this.createReactRoot()})):this.createReactRoot()}async eventMessageHandler(t){switch(t.data.type){case"oauth_success_callback":await this._oauthCallback(t.data.credential);break;case"oauth_error_callback":await this._oauthErrorCallback(t.data.error);break;default:await this.functionInvocationHandler(t)}}async functionInvocationHandler(t){if("SDK_FUNCTION_INVOCATION"!==t.data.messageType)return;const{type:e,id:n,parameters:r}=t.data;let i;try{i={messageType:"SDK_FUNCTION_RESPONSE",id:n,type:e,result:await this[e](...r)}}catch(t){i={messageType:"SDK_FUNCTION_ERROR",error:!0,message:t.message,id:n}}t.source.postMessage(i,this.environments.CONNECT_PUBLIC_URL)}createReactRoot(){var t;this.root=document.createElement("iframe"),this.root.onload=()=>{this.rootLoaded=!0,this.render()};const e=!!document.querySelector(`#${E}`);this.root.id=g,this.root.src=`${this.environments.CONNECT_PUBLIC_URL}/ui${this.projectId?`?projectId=${this.projectId}`:""}`,this.root.style.position=e?"absolute":"fixed",this.root.style.top="0",this.root.style.left="0",this.root.style.width=e?"100%":"100vw",this.root.style.height=e?"100%":"100vh",this.root.style.zIndex="2147483647",this.root.style.display="none",null===(t=document.querySelector(`#${E}`)||document.body)||void 0===t||t.appendChild(this.root)}validateAction(t){var e;if(!this.loadedIntegrations[t]&&!(0,s.isCustomIntegrationTypeName)(t))throw new Error(`"${t}" is not a valid integration type. The integrations you have configured for this Paragon project are:\n\n${Object.keys(this.loadedConfigs).map((t=>`- "${t}"`)).join("\n")}\n`);if(!this.loadedConfigs[t])throw new Error(`integration "${t}" has not been set up in your Paragon project yet.\n\n${Object.keys(this.loadedConfigs).map((t=>`- "${t}"`)).join("\n")}`);if(!(null===(e=this.loadedIntegrations[t])||void 0===e?void 0:e.isActive))throw new Error(`integration "${t}" is not active in your Paragon project yet.`)}isAlreadyInstalled(t,e){var n;return Boolean(null===(n=e.integrations[t])||void 0===n?void 0:n.enabled)}async bootstrapSDKState(t){this.projectId&&this.userState.authenticated&&(this.project=await this.sendConnectRequest(`/sdk/projects/${this.projectId}`,{headers:{"X-Paragon-Cache-Metadata":"1",...t?{"X-Paragon-User-Metadata":JSON.stringify(t)}:{}}},!1),await this.updateLocalState())}setModalState(t){this.modalState={config:void 0,...this.modalState,...t},this.render()}loadState(){if("undefined"!=typeof window)try{const t=window.localStorage.getItem(v)?JSON.parse(window.localStorage.getItem(v)):{};if(t.projectId&&(this.projectId=t.projectId),t.userState){const{userState:e}=t;if(!("authenticated"in e&&e.authenticated&&"token"in e))throw new Error("Malformatted or unauthenticated user was persisted into localStorage. Refusing to load.");this.updateAuthenticatedUser(e),this.bootstrapSDKState().catch((()=>{this.clearState()}))}}catch{this.clearState()}}saveState(){"undefined"!=typeof window&&this.userState.authenticated&&window.localStorage.setItem(v,JSON.stringify({projectId:this.projectId,userState:this.userState}))}clearState(){"undefined"!=typeof window&&window.localStorage.removeItem(v)}render(){if(this.root&&this.rootLoaded){const{onClose:t,onOpen:e,...n}=this.modalState,r={messageType:"UI_UPDATE",nextContext:{user:this.userState,projectId:this.projectId,environments:this.environments,project:this.project,endUserIntegrationConfig:this.modalState.integration?this.endUserIntegrationConfig[this.modalState.integration.type]:void 0},nextModalState:n};if(!this.root.contentWindow)throw new Error("Browser not supported");this.root.contentWindow.postMessage(r,this.environments.CONNECT_PUBLIC_URL)}}updateContainerStyle(t){let{isModalShown:e}=t;this.root&&(this.root.style.display=e?"block":"none")}async authenticate(t,e,n){var r;if(!t||!e)throw new Error("projectId or token not specified to paragon.authenticate()");let i={};try{i=(0,o.default)(e)}catch(t){throw new Error("A well-formed JWT was not provided to paragon.authenticate()")}this.projectId=t,this.userState={authenticated:!0,token:e,userId:i.sub||i.id,integrations:{},meta:null!==(r=null==n?void 0:n.metadata)&&void 0!==r?r:{}};try{await this.bootstrapSDKState(null==n?void 0:n.metadata)}catch(t){throw console.warn("paragon.authenticate() could not login user",t),this.logout(),new Error(`Failed to authenticate user with Paragon: ${t.message}`)}this.render()}getUser(){return Object.fromEntries(Object.entries(this.userState).filter((t=>{let[e]=t;return"token"!==e})))}updateAuthenticatedUser(t){this.userState.authenticated?this.userState={...this.userState,...t}:t.authenticated&&(this.userState=t),this.render()}logout(){this.userState={authenticated:!1},this.clearState(),this.render()}async connect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._connect(t,e)}async _connect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{mapObjectFields:n,overrideRedirectUrl:r,isApiInstallation:i=!1,showPortalAfterInstall:o,bypassPostOAuthPrompt:a,allowMultipleCredentials:l,selectedCredentialId:u,...d}=e;return new Promise(((f,_)=>{this.subscribeToIntegration(t,{...d,onInstall:(t,e)=>{var n;f(),(null==d?void 0:d.onInstall)?d.onInstall(t,e):null===(n=null==d?void 0:d.onSuccess)||void 0===n||n.call(d,t,e)},onError:t=>{var e;_(t),null===(e=null==d?void 0:d.onError)||void 0===e||e.call(d,t)}});try{if(n&&!this.project.accessibleFeatures.includes(h.ConnectAddOn.DynamicFieldMapper))throw new Error("Dynamic Field Mapping is available on our Enterprise plan. Contact sales@useparagon.com to learn more or upgrade.");if(this.validateAction(t),r&&!(0,p.isValidUrl)(r))throw new Error(`${r} is not valid url.`);this.endUserIntegrationConfig[t]={mapObjectFields:n,overrideRedirectUrl:r?(0,p.sanitizeUrl)(r):void 0};const d=Object.values(this.loadedIntegrations).find((e=>(0,s.getIntegrationTypeName)(e)===t));e.isApiInstallation&&!d.needPreOauthInputs&&(0,c.startOAuthFlow)({context:{user:this.userState,projectId:this.projectId,environments:this.environments,endUserIntegrationConfig:this.modalState.integration?this.endUserIntegrationConfig[this.modalState.integration.type]:void 0},integration:d}),this.setModalState({integration:d,config:this.loadedConfigs[t],apiInstallationOptions:{isApiInstallation:i,showPortalAfterInstall:o,bypassPostOAuthPrompt:a,allowMultipleCredentials:l,selectedCredentialId:u}})}catch(e){this.emitError(e,t)}}))}async _oauthCallback(t,e){var n;const{integrationId:r,payload:i}=t,o=Object.values(this.loadedIntegrations).find((t=>t.id===r));if(!o)return;const l=(0,s.getIntegrationTypeName)(o),c=(null===(n=this.modalState.apiInstallationOptions)||void 0===n?void 0:n.isApiInstallation)?this.modalState.apiInstallationOptions:{};try{const t=e?`/sdk/credentials/${e}/complete-setup`:"/sdk/credentials",n=await this.sendConnectRequest(t,{method:"POST",body:JSON.stringify({integrationId:o.id,config:{},payload:i,installOptions:c})});if(!n)throw new Error("Unable to save oauth credentials");this.updateCredentialData(n,o),n.status===a.CredentialStatus.VALID&&this.triggerSDKEvent({type:h.SDK_EVENT.ON_INTEGRATION_INSTALL,integrationId:o.id,integrationType:l})}catch(t){this.emitError(t,l),await this._oauthErrorCallback(t.message)}}async _oauthErrorCallback(t){let e=t;console.error("Failed to connect account to Paragon over OAuth",e),"object"==typeof e&&(e=JSON.stringify(e)),window.alert(`Something went wrong connecting your account. Please try again or ${e}`)}async sendConnectRequest(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.userState.authenticated||!this.projectId)throw new Error("Connect SDK attempted to make an API request, but no user was authenticated.\nCall paragon.authenticate(<projectId>, <user token>) before using the SDK.");const r=`${this.environments.ZEUS_PUBLIC_URL}${n?`/projects/${this.projectId}`:""}${t}`,i=(0,f.hash)(JSON.stringify({url:r,payload:{...e}})),o=await this.cachedApiResponse.get(i,!0);if((null==e?void 0:e.cacheResult)&&o)return o;const a=Boolean(!e||"GET"===e.method||e.cacheResult);if(a&&"object"==typeof this.keyToRequestPromiseMap[i])return this.keyToRequestPromiseMap[i];const s=this.userState.token,l=new Promise(((t,n)=>{(async()=>{try{const n=await this.sendRequest(r,{...e,headers:{Accept:"application/json","Content-Type":"application/json",...null==e?void 0:e.headers,Authorization:`Bearer ${s}`}},a?i:void 0);t(n)}catch(t){n(t)}})()}));return a&&(this.keyToRequestPromiseMap[i]=l),l}async sendRequest(t,e,n){let r,i,o;try{r=await fetch(t,e)}catch(t){o=t}if(r&&!r.ok||o){const e=401===(null==r?void 0:r.status)||403===(null==r?void 0:r.status);!t.includes("proxy")&&e&&this.logout();const i=r?await(0,p.getErrorMessage)(r):null==o?void 0:o.message;throw n&&(await this.cachedApiResponse.del(n),delete this.keyToRequestPromiseMap[n]),new Error(i)}try{i=await(null==r?void 0:r.json())}catch{i=void 0}return n&&(await this.cachedApiResponse.set(n,i),delete this.keyToRequestPromiseMap[n]),i}async request(t,e,n){var r,i;let o=`/sdk/proxy/${t}`;(0,s.isCustomIntegrationTypeName)(t)&&(o=`/sdk/proxy/custom/${null===(r=Object.values(this.loadedIntegrations).find((e=>!!e.customIntegration&&e.customIntegration.slug===t)))||void 0===r?void 0:r.id}`);const a=e.startsWith("/")?e:`/${e}`,l=n.selectedCredentialId?n.selectedCredentialId:null===(i=this.userState.integrations[t])||void 0===i?void 0:i.credentialId,c=await this.sendConnectRequest(`${o}${a}`,{method:n.method,body:"object"==typeof n.body?JSON.stringify(n.body):n.body,headers:{"Content-Type":h.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS,...l?{[h.SELECTED_CREDENTIAL_ID_HEADER]:l}:{},...n.headers}});return null==c?void 0:c.output}async event(t,e){await this.sendConnectRequest(`/v2/projects/${this.projectId}/sdk/events/trigger`,{method:"POST",body:JSON.stringify({name:t,payload:e})},!1)}onClose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{integration:n,apiInstallationOptions:r}=this.modalState;n&&(this.triggerSDKEvent({type:h.SDK_EVENT.ON_PORTAL_CLOSE,integrationId:n.id,integrationType:(0,s.getIntegrationTypeName)(n)}),this.originalBodyOverflow!==e.PARAGON_OVERFLOW_EMPTY_VALUE&&(window.document.body.style.overflow=this.originalBodyOverflow,this.originalBodyOverflow=e.PARAGON_OVERFLOW_EMPTY_VALUE),!t&&(null==r?void 0:r.isApiInstallation)||this.setModalState({integration:null}))}onOpen(){const{integration:t}=this.modalState;if(t&&(this.triggerSDKEvent({type:h.SDK_EVENT.ON_PORTAL_OPEN,integrationId:t.id,integrationType:(0,s.getIntegrationTypeName)(t)}),this.root&&this.originalBodyOverflow===e.PARAGON_OVERFLOW_EMPTY_VALUE)){const t=this.root.getBoundingClientRect();window.innerHeight<=t.height&&window.innerWidth<=t.width&&(this.originalBodyOverflow=window.document.body.style.overflow,window.document.body.style.overflow="hidden")}}triggerSDKEvent(t){this.triggerEvent(t,this.userState)}getIntegrationMetadata(t){if(!t)return Object.values(this.metadata);if(!this.metadata[t])throw new Error(`${t} is not a valid integration name`);return this.metadata[t]}workflow(t){let{selectedCredentialId:e,body:n={},query:r={},headers:i={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var o;if(!t)throw new Error("workflowId is required.");const a=new URLSearchParams(r).toString(),s=e||(null===(o=this.getIntegrationForWorkflow(t))||void 0===o?void 0:o.credentialId);return this.sendConnectRequest(`/sdk/triggers/${t}?${a}`,{method:"POST",body:JSON.stringify(n),headers:{...s?{[h.SELECTED_CREDENTIAL_ID_HEADER]:s}:{},...i}},!0)}installIntegration(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");const n={showPortalAfterInstall:!1,bypassPostOAuthPrompt:!1,allowMultipleCredentials:!1,...e,isApiInstallation:!0};if(n.bypassPostOAuthPrompt&&n.showPortalAfterInstall)throw new Error("Could not use both `bypassPostOAuthPrompt` and `showPortalAfterInstall` as true at the same time.");if(this.ensureHeadlessIsSupported(),this.validateAction(t),!n.allowMultipleCredentials&&this.isAlreadyInstalled(t,this.userState))throw new Error(`Integration "${t}" is already installed.`);return this.setModalState({integration:null}),this._connect(t,n)}ensureHeadlessIsSupported(){if(!this.project.accessibleFeatures.includes(h.ConnectAddOn.HeadlessConnectPortal))throw new Error("Headless Connect Portal is available on our Pro plan and above. Contact sales@useparagon.com to learn more or upgrade.")}async uninstallIntegration(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).selectedCredentialId;if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");if(this.ensureHeadlessIsSupported(),this.validateAction(t),!this.isAlreadyInstalled(t,this.userState))throw new Error(`Integration "${t}" is not installed.`);const n=this.loadedIntegrations[t].id,r=this.userState.integrations[t],i=e||(null==r?void 0:r.credentialId);if(!i||!r)throw new Error("No credential found for uninstall");await this.sendConnectRequest(`/sdk/integrations/${n}`,{method:"DELETE",headers:{...i?{[h.SELECTED_CREDENTIAL_ID_HEADER]:i}:{}}}),this.updateAuthenticatedUser({integrations:{...this.userState.integrations,[t]:(0,l.getActionStateForCredentialDelete)(i,r)}}),this.saveState(),this.triggerSDKEvent({type:h.SDK_EVENT.ON_INTEGRATION_UNINSTALL,integrationId:n,integrationType:t})}async disableWorkflow(t){var e;const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).selectedCredentialId;if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");if(!this.isWorkflowEnabled(t,n))throw new Error(`Workflow ${t} cannot be disabled for this user.`);const r=n||(null===(e=this.getIntegrationForWorkflow(t))||void 0===e?void 0:e.credentialId);await this.sendConnectRequest(`/sdk/workflows/${t}`,{method:"DELETE",headers:r?{[h.SELECTED_CREDENTIAL_ID_HEADER]:r}:{}}),await this.updateLocalState()}getIntegrationForWorkflow(t){return Object.values(this.userState.integrations).find((e=>{var n;return null===(n=null==e?void 0:e.configuredWorkflows)||void 0===n?void 0:n[t]}))}async updateLocalState(){const[t,e]=await Promise.all([this.fetchUserData(),this.fetchIntegrations()]);this.updateAuthenticatedUser({integrations:t.integrations,meta:t.meta}),this.updateIntegrations(e),this.saveState()}isWorkflowEnabled(t,e){var n,r,i;if(e){const o=Object.values(this.userState.integrations).map((t=>t.allCredentials)).flat().find((t=>t.id===e));return Boolean(null===(i=null===(r=null===(n=null==o?void 0:o.config)||void 0===n?void 0:n.configuredWorkflows)||void 0===r?void 0:r[t])||void 0===i?void 0:i.enabled)}const o=Object.values(this.userState.integrations).find((e=>{var n,r;return null===(r=null===(n=null==e?void 0:e.configuredWorkflows)||void 0===n?void 0:n[t])||void 0===r?void 0:r.enabled}));return void 0!==o}async fetchUserData(){const t=await this.sendConnectRequest("/sdk/me");if(t)return t;throw new Error("Unable to get user Data")}async fetchIntegrations(){const t=await this.sendConnectRequest("/sdk/integrations");if(!t)throw new Error("Unable to fetch integrations");return t}updateIntegrations(t){t.forEach((t=>{var e,n,r;if(t.configs.length)try{const i=(0,s.getIntegrationTypeName)(t);this.loadedConfigs[i]=t.configs[0].values,this.loadedIntegrations[i]=t,Boolean(t.isActive)&&(this.metadata[i]={type:i,name:t.name,brandColor:t.brandColor,icon:null!==(n=null===(e=t.customIntegration)||void 0===e?void 0:e.icon)&&void 0!==n?n:`${this.environments.CDN_PUBLIC_URL}/integrations/${h.overrideActionAlias[t.type]||t.type}.svg`}),(null===(r=this.modalState.integration)||void 0===r?void 0:r.id)===t.id&&this.setModalState({integration:t})}catch(t){console.warn(t)}}))}async setUserMetadata(t){return await this.sendConnectRequest("/sdk/me",{method:"PATCH",body:JSON.stringify({meta:t})}),await this.updateLocalState(),this.render(),this.userState}configureGlobal(t){if(!t||!t.host)throw new Error("host not specified");const e=t.host.indexOf("http")>-1?new URL(t.host).hostname:t.host;this.environments.CONNECT_PUBLIC_URL=(0,p.getServiceUrl)("connect",e),this.environments.DASHBOARD_PUBLIC_URL=(0,p.getServiceUrl)("dashboard",e),this.environments.PASSPORT_PUBLIC_URL=(0,p.getServiceUrl)("passport",e),this.environments.ZEUS_PUBLIC_URL=(0,p.getServiceUrl)("zeus",e),this.environments.CDN_PUBLIC_URL=(0,p.getServiceUrl)("dashboard",e),this.userState.authenticated=!1,this.root?this.root.src=`${this.environments.CONNECT_PUBLIC_URL}/ui${this.projectId?`?projectId=${this.projectId}`:""}`:console.error("Root element not defined")}async completeInstall(t,e){var n;if(!this.userState.authenticated)throw new Error("Authentication is required");if(!e||!e.authorizationCode)throw new Error("authorizationCode is required");if(e.redirectUrl&&!(0,p.isValidUrl)(e.redirectUrl))throw new Error(`${e.redirectUrl} is not valid url`);this.validateAction(t);const r=Object.values(this.loadedIntegrations).find((e=>(0,s.getIntegrationTypeName)(e)===t)),i=null===(n=e.showPortalAfterInstall)||void 0===n||n,o=await this.sendConnectRequest("/sdk/credentials",{method:"POST",body:JSON.stringify({code:e.authorizationCode,integrationId:r.id,redirectUrl:e.redirectUrl?(0,p.sanitizeUrl)(e.redirectUrl):void 0,integrationOptions:e.integrationOptions||{}})});if(!o)throw new Error("Unable to create credential");this.updateCredentialData(o,r),i&&this.setModalState({integration:r,config:this.loadedConfigs[t],apiInstallationOptions:{}})}updateCredentialData(t,e){const n=this.userState,r=(0,s.getIntegrationTypeName)(e),i=n.integrations[r],o=i.allCredentials.findIndex((e=>e.id===t.id));o>-1?i.allCredentials[o]=t:i.allCredentials.push(t),this.updateAuthenticatedUser({integrations:{...n.integrations,[r]:{...i,...t.config,credentialStatus:t.status,enabled:t.status===a.CredentialStatus.VALID,credentialId:t.id,providerId:t.providerId,providerData:t.providerData}}})}}e.default=S},892:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(821);e.default=class{constructor(){this.eventListenersMap={},this.integrationStateCallbacks={}}subscribe(t,e){var n;if(this.assertEventType(t),"function"!=typeof e)throw new Error(`no listener is provided for ${t}`);return this.eventListenersMap={...this.eventListenersMap,[t]:[...null!==(n=this.eventListenersMap[t])&&void 0!==n?n:[],e]},()=>this.unsubscribe(t,e)}subscribeToIntegration(t,e){this.integrationStateCallbacks[t]={...e}}unsubscribe(t,e){var n,r;if(this.assertEventType(t),"function"!=typeof e)throw new Error("listener is required for unsubscription");const i=(null!==(n=this.eventListenersMap[t])&&void 0!==n?n:[]).length;return this.eventListenersMap={...this.eventListenersMap,[t]:(null!==(r=this.eventListenersMap[t])&&void 0!==r?r:[]).filter((t=>t!==e))},i>this.eventListenersMap[t].length}assertEventType(t){if(!Object.values(r.SDK_EVENT).includes(t))throw new Error(`${t} is not valid paragon event`)}emitSafe(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i;(null!==(i=this.eventListenersMap[t])&&void 0!==i?i:[]).forEach((t=>{try{t(...n)}catch(t){console.error(t)}}))}emitError(t,e){this.invokeCallbackSafe(e,"onError",t)}invokeCallbackSafe(t,e){var n,r;try{for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];null===(r=null===(n=this.integrationStateCallbacks[t])||void 0===n?void 0:n[e])||void 0===r||r.call(n,...o)}catch(t){console.error(t)}}triggerEvent(t,e){let{type:n,integrationId:i,integrationType:o,workflowId:a,workflowStateChange:s}=t;if(i&&o)switch(n){case r.SDK_EVENT.ON_INTEGRATION_INSTALL:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onInstall",...t),this.emitSafe(r.SDK_EVENT.ON_INTEGRATION_INSTALL,...t);break}case r.SDK_EVENT.ON_INTEGRATION_UNINSTALL:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onUninstall",...t),this.emitSafe(r.SDK_EVENT.ON_INTEGRATION_UNINSTALL,...t);break}case r.SDK_EVENT.ON_PORTAL_OPEN:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onOpen",...t),this.emitSafe(r.SDK_EVENT.ON_PORTAL_OPEN,...t);break}case r.SDK_EVENT.ON_PORTAL_CLOSE:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onClose",...t),this.emitSafe(r.SDK_EVENT.ON_PORTAL_CLOSE,...t);break}case r.SDK_EVENT.ON_WORKFLOW_CHANGE:{const t=[{integrationId:i,workflowId:a,workflowStateChange:s||{}},e];this.invokeCallbackSafe(o,"onWorkflowChange",...t),this.emitSafe(r.SDK_EVENT.ON_WORKFLOW_CHANGE,...t);break}default:throw new Error(`${n} is not valid event.`)}}}},931:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ACTION_CUSTOM=void 0,e.ACTION_CUSTOM="custom"},59:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CredentialStatus=void 0,function(t){t.PENDING="PENDING",t.INVALID="INVALID",t.VALID="VALID"}(e.CredentialStatus||(e.CredentialStatus={}))},663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateSlugForIntegration=void 0,e.generateSlugForIntegration=function(t){if(!t.name)return;return`custom.${t.name?t.name.replace(/[\W_]+/g,"").trim().toLowerCase():void 0}`}},343:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCustomIntegrationTypeName=e.getIntegrationTypeName=void 0;const r=n(931),i=n(663);e.getIntegrationTypeName=function(t){if(t.type===r.ACTION_CUSTOM){if(t.customIntegration)return(0,i.generateSlugForIntegration)(t.customIntegration);throw new Error(`Custom integration details are missing from this integration: ${t.id}`)}return t.type},e.isCustomIntegrationTypeName=function(t){return t.startsWith("custom.")}},643:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getActionStateForCredentialDelete=e.stripUndefinedAndNull=e.parseKeyedSource=void 0;const r=n(59);e.parseKeyedSource=function(t){return t&&(null==t?void 0:t.length)?Object.fromEntries(t.map((t=>[t.key,"VALUE"===t.source.type?t.source.value:void 0]))):{}},e.stripUndefinedAndNull=function t(e){const n={};return Object.keys(e).forEach((r=>{var i;(i=e[r])&&"object"==typeof i&&!Array.isArray(i)?n[r]=t(e[r]):void 0!==e[r]&&null!==e[r]&&(n[r]=e[r])})),n};e.getActionStateForCredentialDelete=(t,e)=>{var n;const i=(null!==(n=null==e?void 0:e.allCredentials)&&void 0!==n?n:[]).filter((e=>e.id!==t));if(0===i.length)return{enabled:!1,configuredWorkflows:{},allCredentials:[]};{const t=i[0];return{...e,credentialStatus:t.status,enabled:t.status===r.CredentialStatus.VALID,credentialId:t.id,providerId:t.providerId,providerData:t.providerData,allCredentials:i}}}},429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.startOAuthFlow=void 0;const r=n(931),i=n(343),o=n(643);e.startOAuthFlow=async t=>{let{context:e,integration:n,endUserSuppliedValues:a={},authParams:s}=t;var l;const c=(0,i.getIntegrationTypeName)(n);if(!c)return;const u=s?(0,o.parseKeyedSource)(s):{},h=(0,o.stripUndefinedAndNull)({action:c&&(0,i.isCustomIntegrationTypeName)(c)?r.ACTION_CUSTOM:c,endUserSuppliedValues:JSON.stringify(a),parameters:JSON.stringify(u),userToken:e.user.token,integrationId:n.id,redirectUrl:null===(l=e.endUserIntegrationConfig)||void 0===l?void 0:l.overrideRedirectUrl,originForPostMessage:window.location.origin}),d=`${e.environments.ZEUS_PUBLIC_URL}/projects/${e.projectId}/sdk/actions/build-oauth?${new URLSearchParams(h).toString()}`;window.open(d,void 0,"width=500,height=600,left=100,top=150")}},56:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.paragon=void 0;const r=n(655),i=r.__importDefault(n(773));r.__exportStar(n(821),e);const o=new i.default;e.paragon={authenticate:o.authenticate.bind(o),connect:o.connect.bind(o),event:o.event.bind(o),getIntegrationMetadata:o.getIntegrationMetadata.bind(o),getUser:o.getUser.bind(o),request:o.request.bind(o),subscribe:o.subscribe.bind(o),unsubscribe:o.unsubscribe.bind(o),workflow:o.workflow.bind(o),_oauthCallback:o._oauthCallback.bind(o),_oauthErrorCallback:o._oauthErrorCallback.bind(o),installIntegration:o.installIntegration.bind(o),uninstallIntegration:o.uninstallIntegration.bind(o),disableWorkflow:o.disableWorkflow.bind(o),setUserMetadata:o.setUserMetadata.bind(o),configureGlobal:o.configureGlobal.bind(o),completeInstall:o.completeInstall.bind(o)},e.default={ConnectSDK:i.default}},992:(t,e)=>{"use strict";var n,r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.overrideActionAlias=e.TokenType=e.SidebarInputType=void 0,function(t){t.Auth="AUTH",t.Enum="ENUM",t.DynamicEnum="DYNAMIC_ENUM",t.Intent="INTENT",t.Text="TEXT",t.TextArea="TEXTAREA",t.ValueText="TEXT_NO_VARS",t.ValueTextArea="TEXTAREA_NO_VARS",t.Code="CODE",t.ActionButton="ACTION_BUTTON",t.Conditional="CONDITIONAL",t.DynamicConditional="DYNAMIC_CONDITIONAL",t.NestedList="NESTED_LIST",t.File="FILE",t.EditableDynamicEnum="EDITABLE_DYNAMIC_ENUM",t.EditableEnum="EDITABLE_ENUM",t.BooleanInput="BOOLEAN_INPUT",t.UserSuppliedCredential="USER_SUPPLIED_CREDENTIAL",t.NativeDynamicEnumInput="NATIVE_DYNAMIC_INPUT",t.TimeConstraintInput="TIME_CONSTRAINT_INPUT",t.LinesListInput="LinesListInput",t.LinesListDynamicInput="LinesListDynamicInput",t.Number="NUMBER",t.Email="EMAIL",t.URL="URL",t.EnumTextAreaPairInput="EnumTextAreaPairInput",t.FieldMapper="FIELD_MAPPER",t.ComboInput="COMBO_INPUT",t.Password="PASSWORD",t.Switch="SWITCH"}(e.SidebarInputType||(e.SidebarInputType={})),function(t){t.ACCESS_TOKEN="ACCESS_TOKEN",t.REFRESH_TOKEN="REFRESH_TOKEN",t.BOT_TOKEN="BOT_TOKEN",t.KLAVIYO_API_KEY="KLAVIYO_API_KEY",t.MARKETO_CLIENT_ID="MARKETO_CLIENT_ID",t.MARKETO_CLIENT_SECRET="MARKETO_CLIENT_SECRETI",t.MARKETO_ENDPOINT="MARKETO_ENDPOINT",t.MARKETO_IDENTITY="MARKETO_IDENTITY",t.MONDAY_API_TOKEN="MONDAY_API_TOKEN",t.ORACLE_CLOUD_URL="ORACLE_CLOUD_URL",t.ORACLE_PASSWORD="ORACLE_PASSWORD",t.ORACLE_USERNAME="ORACLE_USERNAME",t.SAGE_INTACCT_COMPANY_ID="SAGE_INTACCT_COMPANY_ID",t.SAGE_INTACCT_USER_ID="SAGE_INTACCT_USER_ID",t.SAGE_INTACCT_USER_PASSWORD="SAGE_INTACCT_USER_PASSWORD",t.SAILTHRU_COMPANY_KEY="SAILTHRU_COMPANY_KEY",t.SAILTHRU_COMPANY_SECRET="SAILTHRU_COMPANY_SECRET",t.SERVICENOW_PASSWORD="SERVICENOW_PASSWORD",t.SERVICENOW_SUBDOMAIN="SERVICENOW_SUBDOMAIN",t.SERVICENOW_USERNAME="SERVICENOW_USERNAME",t.TABLEAU_PERSONAL_ACCESS_TOKEN_NAME="TABLEAU_PERSONAL_ACCESS_TOKEN_NAME",t.TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET="TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET",t.TABLEAU_SERVER_NAME="TABLEAU_SERVER_NAME",t.TABLEAU_SITE_ID="TABLEAU_SITE_ID",t.TRELLO_API_KEY="TRELLO_API_KEY",t.TRELLO_API_TOKEN="TRELLO_API_TOKEN",t.WOOCOMMERCE_CONSUMER_KEY="WOOCOMMERCE_CONSUMER_KEY",t.WOOCOMMERCE_CONSUMER_SECRET="WOOCOMMERCE_CONSUMER_SECRET",t.WOOCOMMERCE_STORE_DOMAIN="WOOCOMMERCE_STORE_DOMAIN",t.WORKABLE_API_ACCESS_TOKEN="WORKABLE_API_ACCESS_TOKEN",t.WORKABLE_ACCOUNT_SUBDOMAIN="WORKABLE_ACCOUNT_SUBDOMAIN",t.ZOHO_CRM_ACCOUNTS_SERVER="ZOHO_CRM_ACCOUNTS_SERVER",t.ZOHO_CRM_API_DOMAIN="ZOHO_CRM_API_DOMAIN"}(e.TokenType||(e.TokenType={})),function(t){t.INFO="INFO",t.ERROR="ERROR",t.SUCCESS="SUCCESS"}(n||(n={})),function(t){t.NONE="NONE",t.RE_AUTHENTICATE="RE_AUTHENTICATE",t.ALERT="ALERT",t.DISPATCH="DISPATCH"}(r||(r={})),function(t){t.DYNAMIC="DYNAMIC_DATA_SOURCE",t.STATIC_ENUM="STATIC_ENUM_DATA_SOURCE",t.FIELD_MAPPER="FIELD_MAPPER_DATA_SOURCE",t.COMBO_INPUT="COMBO_INPUT_DATA_SOURCE"}(i||(i={})),e.overrideActionAlias={monday:"monday"}},34:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONNECT_PLAN_FEATURE_MAP=void 0;const r=n(471);e.CONNECT_PLAN_FEATURE_MAP={[r.BillingPlan.ConnectBasic]:[],[r.BillingPlan.ConnectPro]:[r.ConnectAddOn.CustomIntegrationBuilder,r.ConnectAddOn.HeadlessConnectPortal,r.ConnectAddOn.Monitoring,r.ConnectAddOn.UserMetadata,r.ConnectAddOn.WhiteLabeling],[r.BillingPlan.ConnectEnterprise]:[r.ConnectAddOn.CustomIntegrationBuilder,r.ConnectAddOn.DynamicFieldMapper,r.ConnectAddOn.HeadlessConnectPortal,r.ConnectAddOn.TaskHistoryAPI,r.ConnectAddOn.Monitoring,r.ConnectAddOn.RoleBasedAccessControl,r.ConnectAddOn.UserMetadata,r.ConnectAddOn.WhiteLabeling,r.ConnectAddOn.WorkflowPermission]}},935:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SELECTED_CREDENTIAL_ID_HEADER=e.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS=void 0;const r=n(992);var i;!function(t){t.NOT_STARTED="NOT_STARTED",t.DELAYED="DELAYED",t.PAUSED="PAUSED",t.EXECUTING="EXECUTING",t.FAILED="FAILED",t.SUCCEEDED="SUCCEEDED",t.WAITING="WAITING"}(i||(i={}));r.SidebarInputType.ValueText,r.SidebarInputType.DynamicEnum,r.SidebarInputType.Enum,r.SidebarInputType.Number,r.SidebarInputType.Email,r.SidebarInputType.URL,r.SidebarInputType.FieldMapper,r.SidebarInputType.BooleanInput,r.SidebarInputType.ComboInput,r.SidebarInputType.Password,r.SidebarInputType.Switch,r.SidebarInputType.ValueTextArea;e.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS="auto",e.SELECTED_CREDENTIAL_ID_HEADER="X-Paragon-Credential"},977:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},914:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PLATFORM_ENV=e.NODE_ENV=void 0,function(t){t.PRODUCTION="production",t.DEVELOPMENT="development",t.TEST="test"}(e.NODE_ENV||(e.NODE_ENV={})),function(t){t.PRODUCTION="production",t.PRODUCTION_MIRROR_1="p-m1",t.STAGING="staging",t.STAGING_MIRROR_1="s-m1",t.DEVELOPMENT="dev",t.TEST="test",t.SANDBOX="sandbox",t.RELEASE="release",t.ENTERPRISE="enterprise"}(e.PLATFORM_ENV||(e.PLATFORM_ENV={}))},65:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},821:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(655);r.__exportStar(n(992),e),r.__exportStar(n(34),e),r.__exportStar(n(935),e),r.__exportStar(n(977),e),r.__exportStar(n(914),e),r.__exportStar(n(65),e),r.__exportStar(n(835),e),r.__exportStar(n(750),e),r.__exportStar(n(471),e)},835:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DataType=void 0,function(t){t.STRING="STRING",t.NUMBER="NUMBER",t.DATE="DATE",t.BOOLEAN="BOOLEAN",t.EMAIL="EMAIL",t.OBJECT="OBJECT",t.ARRAY="ARRAY",t.ANY="ANY",t.FILE="FILE",t.NON_DECIMAL="NON_DECIMAL"}(e.DataType||(e.DataType={})),function(t){t.None="$none",t.StringContains="$stringContains",t.StringDoesNotContain="$stringDoesNotContain",t.StringExactlyMatches="$stringExactlyMatches",t.StringDoesNotExactlyMatch="$stringDoesNotExactlyMatch",t.StringIsIn="$stringIsIn",t.StringIsNotIn="$stringIsNotIn",t.StringStartsWith="$stringStartsWith",t.StringDoesNotStartWith="$stringDoesNotStartWith",t.StringEndsWith="$stringEndsWith",t.StringDoesNotEndWith="$stringDoesNotEndWith",t.NumberGreaterThan="$numberGreaterThan",t.NumberLessThan="$numberLessThan",t.NumberEquals="$numberEquals",t.NumberDoesNotEqual="$numberDoesNotEqual",t.NumberLessThanOrEqualTo="$numberLessThanOrEqualTo",t.NumberGreaterThanOrEqualTo="$numberGreaterThanOrEqualTo",t.DateTimeAfter="$dateTimeAfter",t.DateTimeBefore="$dateTimeBefore",t.DateTimeEquals="$dateTimeEquals",t.BooleanTrue="$booleanTrue",t.BooleanFalse="$booleanFalse",t.IsNotNull="$exists",t.IsNull="$doesNotExist",t.Exists="$isNotUndefinedOrNull",t.DoesNotExist="$isUndefinedOrNull",t.ArrayIsIn="$arrayIsIn",t.ArrayIsNotIn="$arrayIsNotIn",t.ArrayIsEmpty="$arrayIsEmpty",t.ArrayIsNotEmpty="$arrayIsNotEmpty",t.StringGreaterThan="$stringGreaterThan",t.StringLessThan="$stringLessThan"}(n||(n={}))},750:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentLoadingState=e.SDK_EVENT=e.ModalView=void 0,function(t){t.OVERVIEW="overview",t.CONFIGURATION="configuration"}(e.ModalView||(e.ModalView={})),function(t){t.ON_INTEGRATION_INSTALL="onIntegrationInstall",t.ON_INTEGRATION_UNINSTALL="onIntegrationUninstall",t.ON_WORKFLOW_CHANGE="onWorkflowChange",t.ON_PORTAL_OPEN="onPortalOpen",t.ON_PORTAL_CLOSE="onPortalClose"}(e.SDK_EVENT||(e.SDK_EVENT={})),function(t){t.LOADING="loading",t.INTERACTIVE="interactive",t.COMPLETE="complete"}(e.DocumentLoadingState||(e.DocumentLoadingState={}))},471:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectAddOn=e.BillingPlan=void 0,function(t){t.ClassicFree="free",t.ClassicStarter="starter",t.ClassicBusiness="business",t.ClassicPremium="premium",t.ClassicEnterprise="enterprise",t.ConnectTrial="connect_trial",t.ConnectBasic="basic",t.ConnectPro="pro",t.ConnectEnterprise="connect_enterprise"}(e.BillingPlan||(e.BillingPlan={})),function(t){t.CustomIntegrationBuilder="byo",t.DynamicFieldMapper="dfm",t.HeadlessConnectPortal="headless-cp",t.TaskHistoryAPI="th-api",t.Monitoring="monitoring",t.RoleBasedAccessControl="rbac",t.UserMetadata="user-metadata",t.WhiteLabeling="whitelabel",t.WorkflowPermission="workflow-permissions"}(e.ConnectAddOn||(e.ConnectAddOn={}))},158:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAssetUrl=void 0;const r=n(914);e.getAssetUrl=t=>{let{CDN_PUBLIC_URL:e,DASHBOARD_PUBLIC_URL:n,VERSION:i,PLATFORM_ENV:o,NODE_ENV:a}=t;return e&&a===r.NODE_ENV.PRODUCTION&&o!==r.PLATFORM_ENV.ENTERPRISE?`${e}/${i}/dashboard/public`:n}},846:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hash=void 0;const r=n(715);e.hash=function(t){return null==t?t:(0,r.sha256)().update(t).digest("hex").substr(0,10)}},572:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sleep=e.generateMatrix=e.DeferredPromise=void 0;e.DeferredPromise=class{get state(){return this._state}constructor(){this._state="pending",this._promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}resolve(t){this._resolve(t),this._state="fulfilled"}reject(t){this._reject(t),this._state="rejected"}finally(t){return null==t||t(),this._promise}},Symbol.toStringTag,e.generateMatrix=function(t,e){const n=Object.keys(t);if(n.reduce(((e,n)=>e+t[n].length),0)&&n.length)for(const e of n)t[e].length||t[e].push(void 0);const r=Object.entries(t).reduce(((t,e)=>{let[,n]=e;return t.length?t.reduce(((t,e)=>(n.forEach((n=>{const r=e.slice();r.push(n),t.push(r)}),[]),t)),[]):n.map((t=>[t]))}),[]).reduce(((t,e)=>{const r=e.reduce(((t,e,r)=>({...t,[n[r]]:e})),{});return[...t,r]}),[]);return e?r.slice(-1*e):r},e.sleep=function(t){return new Promise((e=>setTimeout(e,t)))}},321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorMessage=e.getServiceUrl=e.sanitizeUrl=e.isValidUrl=void 0;function n(t){return t?t.match(/^[a-zA-Z]+:\/\//)?t:`https://${t}`:t}function r(t){return Array.isArray(t)?t.flatMap((t=>[t,r(t.children||[])].flatMap((t=>"string"==typeof t?t:r(t))))).filter((t=>t)).join(", "):Object.values(t.constraints||{}).join(", ")}e.isValidUrl=t=>{const e=n(t);try{return new globalThis.URL(e),!0}catch(t){return!1}},e.sanitizeUrl=n,e.getServiceUrl=function(t,e){return`https://${t}${`.${e}`}`},e.getErrorMessage=async function(t){var e,n;const i=null===(e=t.headers)||void 0===e?void 0:e.get("content-type");if(i&&-1!==i.indexOf("application/json")){const e=await t.json();return"string"==typeof e.message?e.message:400===t.status&&Array.isArray(e.message)?r(e.message):JSON.stringify(e)}return null===(n=t.text)||void 0===n?void 0:n.call(t)}},35:(t,e,n)=>{"use strict";var r,i,o,a,s=n(155);Object.defineProperty(e,"__esModule",{value:!0}),e.CacheThrottle=e.CacheMode=void 0;const l=n(655),c=n(572);var u,h,d;!function(t){t.Debounce="debounce",t.Throttle="throttle"}(u=e.CacheMode||(e.CacheMode={})),function(t){t.Closed="closed",t.Idle="idle",t.Processing="processing"}(h||(h={})),function(t){t[t.Get=0]="Get",t[t.Set=1]="Set",t[t.GetOrSet=2]="GetOrSet",t[t.Del=3]="Del",t[t.Do=4]="Do"}(d||(d={}));e.CacheThrottle=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.set(this,h.Idle),i.set(this,{}),o.set(this,void 0),a.set(this,[]),l.__classPrivateFieldSet(this,o,{mode:u.Debounce,ttl:0,...t},"f")}async get(t,e){const n=this.serializeKey(t),r=async()=>{const e=l.__classPrivateFieldGet(this,i,"f")[n],{mode:r,ttl:a,value:s}=null!=e?e:{};return!e||!a||r&&r!==u.Debounce||this.refreshTimeout(t,n,a),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(n,s),s};return e?r():this.enqueue(n,d.Get,r)}async set(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const s=this.serializeKey(t),c=async()=>{const a=l.__classPrivateFieldGet(this,i,"f")[s],c=!!a;return l.__classPrivateFieldGet(this,i,"f")[s]={...a,mode:r,ttl:n,value:e},c&&r===u.Throttle||this.refreshTimeout(t,s,n),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(s,e),e};return a?c():this.enqueue(s,d.Set,c)}async getOrSet(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.__classPrivateFieldGet(this,o,"f").mode,a=arguments.length>4?arguments[4]:void 0;const s=this.serializeKey(t),c=async()=>{if(l.__classPrivateFieldGet(this,i,"f")[s])return l.__classPrivateFieldGet(this,i,"f")[s].value;const a=await e();return await this.set(t,a,n,r,!0),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(s,a),a};return a?c():this.enqueue(s,d.GetOrSet,c)}async del(t){let e=arguments.length>2?arguments[2]:void 0;const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t:this.serializeKey(t),r=async()=>{const t=l.__classPrivateFieldGet(this,i,"f")[n];let e;return(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),t&&(e=t.value,delete l.__classPrivateFieldGet(this,i,"f")[n],await(async()=>{var t,n;return null===(n=(t=l.__classPrivateFieldGet(this,o,"f")).onDeregister)||void 0===n?void 0:n.call(t,e)})().catch((t=>{}))),e};return e?r():this.enqueue(n,d.Del,r)}keys(){return Object.keys(l.__classPrivateFieldGet(this,i,"f"))}async do(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.__classPrivateFieldGet(this,o,"f").mode;const a=this.serializeKey(t);return this.enqueue(a,d.Do,(async()=>{if(l.__classPrivateFieldGet(this,i,"f")[a])return l.__classPrivateFieldGet(this,i,"f")[a].value;const o=await e();return await this.set(t,o,n,r,!0)}))}async close(){l.__classPrivateFieldSet(this,r,h.Closed,"f"),await Promise.all(Object.keys(l.__classPrivateFieldGet(this,i,"f")).map((t=>this.del(t,!0,!0))))}refreshTimeout(t,e,n){if(l.__classPrivateFieldGet(this,r,"f")===h.Closed)return;const o=l.__classPrivateFieldGet(this,i,"f")[e];return n&&void 0!==(null==o?void 0:o.timeout)&&clearTimeout(o.timeout),n?(o.timeout=setTimeout((()=>this.del(t)),n),o.timeout):void 0}clearPendingDeletesOnKey(t,e){l.__classPrivateFieldSet(this,a,l.__classPrivateFieldGet(this,a,"f").filter((n=>{let[r,i,o,a]=n;return t!==r||i!==d.Del||(a.resolve(e),!1)})),"f")}serializeKey(t){var e,n,r;return null!==(r=null===(n=(e=l.__classPrivateFieldGet(this,o,"f")).serializeKey)||void 0===n?void 0:n.call(e,t))&&void 0!==r?r:t}async enqueue(t,e,n){const i=new c.DeferredPromise;return l.__classPrivateFieldGet(this,a,"f").push([t,e,n,i]),l.__classPrivateFieldGet(this,r,"f")===h.Idle&&this.flush(),i}flush(){l.__classPrivateFieldSet(this,r,h.Processing,"f"),s.nextTick((async()=>{for(;l.__classPrivateFieldGet(this,a,"f").length&&l.__classPrivateFieldGet(this,r,"f")!==h.Closed;){const t=l.__classPrivateFieldGet(this,a,"f").shift();if(t){const[,,e,n]=t;try{const t=await e();n.resolve(t)}catch(t){n.reject(t)}}}l.__classPrivateFieldSet(this,r,h.Idle,"f")}))}},r=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap},715:(t,e,n)=>{var r=e;r.utils=n(436),r.common=n(772),r.sha=n(41),r.ripemd=n(949),r.hmac=n(326),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},772:(t,e,n)=>{"use strict";var r=n(436),i=n(746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=t>>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r}},326:(t,e,n)=>{"use strict";var r=n(436),i=n(746);function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,n))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},949:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=r.rotl32,a=r.sum32,s=r.sum32_3,l=r.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}r.inherits(u,c),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var n=this.h[0],r=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],v=n,S=r,O=i,I=c,y=u,T=0;T<80;T++){var A=a(o(l(n,h(T,r,i,c),t[p[T]+e],d(T)),g[T]),u);n=u,u=c,c=o(i,10),i=r,r=A,A=a(o(l(v,h(79-T,S,O,I),t[_[T]+e],f(T)),E[T]),y),v=y,y=I,I=o(O,10),O=S,S=A}A=s(this.h[1],i,I),this.h[1]=s(this.h[2],c,y),this.h[2]=s(this.h[3],u,v),this.h[3]=s(this.h[4],n,S),this.h[4]=s(this.h[0],r,O),this.h[0]=A},u.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},41:(t,e,n)=>{"use strict";e.sha1=n(761),e.sha224=n(799),e.sha256=n(344),e.sha384=n(978),e.sha512=n(900)},761:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(38),a=r.rotl32,s=r.sum32,l=r.sum32_5,c=o.ft_1,u=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=a(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],f=this.h[4];for(r=0;r<n.length;r++){var p=~~(r/20),_=l(a(i,5),c(p,o,u,d),f,n[r],h[p]);f=d,d=u,u=a(o,30),o=i,i=_}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],f)},d.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},799:(t,e,n)=>{"use strict";var r=n(436),i=n(344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},344:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(38),a=n(746),s=r.sum32,l=r.sum32_4,c=r.sum32_5,u=o.ch32,h=o.maj32,d=o.s0_256,f=o.s1_256,p=o.g0_256,_=o.g1_256,g=i.BlockHash,E=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E,this.W=new Array(64)}r.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=l(_(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],g=this.h[2],E=this.h[3],v=this.h[4],S=this.h[5],O=this.h[6],I=this.h[7];for(a(this.k.length===n.length),r=0;r<n.length;r++){var y=c(I,f(v),u(v,S,O),this.k[r],n[r]),T=s(d(i),h(i,o,g));I=O,O=S,S=v,v=s(E,y),E=g,g=o,o=i,i=s(y,T)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],E),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],S),this.h[6]=s(this.h[6],O),this.h[7]=s(this.h[7],I)},v.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},978:(t,e,n)=>{"use strict";var r=n(436),i=n(900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},900:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(746),a=r.rotr64_hi,s=r.rotr64_lo,l=r.shr64_hi,c=r.shr64_lo,u=r.sum64,h=r.sum64_hi,d=r.sum64_lo,f=r.sum64_4_hi,p=r.sum64_4_lo,_=r.sum64_5_hi,g=r.sum64_5_lo,E=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function S(){if(!(this instanceof S))return new S;E.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function O(t,e,n,r,i){var o=t&n^~t&i;return o<0&&(o+=4294967296),o}function I(t,e,n,r,i,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function y(t,e,n,r,i){var o=t&n^t&i^n&i;return o<0&&(o+=4294967296),o}function T(t,e,n,r,i,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function A(t,e){var n=a(t,e,28)^a(e,t,2)^a(e,t,7);return n<0&&(n+=4294967296),n}function C(t,e){var n=s(t,e,28)^s(e,t,2)^s(e,t,7);return n<0&&(n+=4294967296),n}function m(t,e){var n=a(t,e,14)^a(t,e,18)^a(e,t,9);return n<0&&(n+=4294967296),n}function N(t,e){var n=s(t,e,14)^s(t,e,18)^s(e,t,9);return n<0&&(n+=4294967296),n}function w(t,e){var n=a(t,e,1)^a(t,e,8)^l(t,e,7);return n<0&&(n+=4294967296),n}function b(t,e){var n=s(t,e,1)^s(t,e,8)^c(t,e,7);return n<0&&(n+=4294967296),n}function P(t,e){var n=a(t,e,19)^a(e,t,29)^l(t,e,6);return n<0&&(n+=4294967296),n}function R(t,e){var n=s(t,e,19)^s(e,t,29)^c(t,e,6);return n<0&&(n+=4294967296),n}r.inherits(S,E),t.exports=S,S.blockSize=1024,S.outSize=512,S.hmacStrength=192,S.padLength=128,S.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var i=P(n[r-4],n[r-3]),o=R(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],l=w(n[r-30],n[r-29]),c=b(n[r-30],n[r-29]),u=n[r-32],h=n[r-31];n[r]=f(i,o,a,s,l,c,u,h),n[r+1]=p(i,o,a,s,l,c,u,h)}},S.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],l=this.h[4],c=this.h[5],f=this.h[6],p=this.h[7],E=this.h[8],v=this.h[9],S=this.h[10],w=this.h[11],b=this.h[12],P=this.h[13],R=this.h[14],L=this.h[15];o(this.k.length===n.length);for(var D=0;D<n.length;D+=2){var U=R,M=L,k=m(E,v),j=N(E,v),B=O(E,v,S,w,b),F=I(E,v,S,w,b,P),x=this.k[D],K=this.k[D+1],V=n[D],$=n[D+1],G=_(U,M,k,j,B,F,x,K,V,$),W=g(U,M,k,j,B,F,x,K,V,$);U=A(r,i),M=C(r,i),k=y(r,i,a,s,l),j=T(r,i,a,s,l,c);var H=h(U,M,k,j),q=d(U,M,k,j);R=b,L=P,b=S,P=w,S=E,w=v,E=h(f,p,G,W),v=d(p,p,G,W),f=l,p=c,l=a,c=s,a=r,s=i,r=h(G,W,H,q),i=d(G,W,H,q)}u(this.h,0,r,i),u(this.h,2,a,s),u(this.h,4,l,c),u(this.h,6,f,p),u(this.h,8,E,v),u(this.h,10,S,w),u(this.h,12,b,P),u(this.h,14,R,L)},S.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},38:(t,e,n)=>{"use strict";var r=n(436).rotr32;function i(t,e,n){return t&e^~t&n}function o(t,e,n){return t&e^t&n^e&n}function a(t,e,n){return t^e^n}e.ft_1=function(t,e,n,r){return 0===t?i(e,n,r):1===t||3===t?a(e,n,r):2===t?o(e,n,r):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},436:(t,e,n)=>{"use strict";var r=n(746),i=n(717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function l(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16))}else for(var r=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i<t.length;i++)n[i]=0|t[i];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=s(t[n].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var i=t[r];"little"===e&&(i=a(i)),n+=l(i.toString(16))}return n},e.zero2=s,e.zero8=l,e.join32=function(t,e,n,i){var o=n-e;r(o%4==0);for(var a=new Array(o/4),s=0,l=e;s<a.length;s++,l+=4){var c;c="big"===i?t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3]:t[l+3]<<24|t[l+2]<<16|t[l+1]<<8|t[l],a[s]=c>>>0}return a},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r<t.length;r++,i+=4){var o=t[r];"big"===e?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,i){return t+e+n+r+i>>>0},e.sum64=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+n+i;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,i,o,a,s){var l=0,c=e;return l+=(c=c+r>>>0)<e?1:0,l+=(c=c+o>>>0)<o?1:0,t+n+i+a+(l+=(c=c+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,i,o,a,s){return e+r+o+s>>>0},e.sum64_5_hi=function(t,e,n,r,i,o,a,s,l,c){var u=0,h=e;return u+=(h=h+r>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,u+=(h=h+s>>>0)<s?1:0,t+n+i+a+l+(u+=(h=h+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,i,o,a,s,l,c){return e+r+o+s+c>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},245:(t,e,n)=>{"use strict";function r(t){this.message=t}n.r(e),n.d(e,{InvalidTokenError:()=>a,default:()=>s}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,a=0,s="";i=e.charAt(a++);~i&&(n=o%4?64*n+i:i,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return s};function o(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(i(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return i(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const s=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(o(t.split(".")[n]))}catch(t){throw new a("Invalid token specified: "+t.message)}}},746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},155:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&d())}function d(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},655:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__assign:()=>o,__asyncDelegator:()=>I,__asyncGenerator:()=>O,__asyncValues:()=>y,__await:()=>S,__awaiter:()=>u,__classPrivateFieldGet:()=>N,__classPrivateFieldSet:()=>w,__createBinding:()=>d,__decorate:()=>s,__exportStar:()=>f,__extends:()=>i,__generator:()=>h,__importDefault:()=>m,__importStar:()=>C,__makeTemplateObject:()=>T,__metadata:()=>c,__param:()=>l,__read:()=>_,__rest:()=>a,__spread:()=>g,__spreadArray:()=>v,__spreadArrays:()=>E,__values:()=>p});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var d=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function f(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function E(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function v(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function O(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof S?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(t){u(o[0][3],t)}var n}function l(t){s("next",t)}function c(t){s("throw",t)}function u(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function I(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:S(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function y(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function T(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var A=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function C(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return A(e,t),e}function m(t){return t&&t.__esModule?t:{default:t}}function N(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function w(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r=n(56);module.exports=r})();
|
|
2
|
+
(()=>{var t={773:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PARAGON_OVERFLOW_EMPTY_VALUE=void 0;const r=n(655),i=r.__importDefault(n(245)),o=n(59),a=n(343),s=n(643),l=n(429),c=r.__importDefault(n(892)),u=n(821),h=n(158),d=n(846),f=n(321),p=n(35),_="paragon-connect-frame",g=`${_}-container`,E="paragon-connect-user-state";e.PARAGON_OVERFLOW_EMPTY_VALUE="PARAGON_OVERFLOW_EMPTY_VALUE";class v extends c.default{constructor(){if(super(),this.rootLoaded=!1,this.modalState={integration:null,onClose:this.onClose.bind(this),overlayStyle:{overflow:"auto"},onOpen:this.onOpen.bind(this),apiInstallationOptions:{isApiInstallation:!1,showPortalAfterInstall:!1}},this.userState={authenticated:!1},this.loadedConfigs={},this.loadedIntegrations={},this.endUserIntegrationConfig={},this.metadata={},this.cachedApiResponse=new p.CacheThrottle({ttl:5e3}),this.keyToRequestPromiseMap={},this.originalBodyOverflow=e.PARAGON_OVERFLOW_EMPTY_VALUE,"undefined"==typeof window)return void console.warn("connect sdk can only be used on browser");const t=(0,h.getAssetUrl)({CDN_PUBLIC_URL:"https://cdn.useparagon.com",DASHBOARD_PUBLIC_URL:"https://dashboard.useparagon.com",NODE_ENV:"production",PLATFORM_ENV:"production",VERSION:"latest"});if(this.environments={CDN_PUBLIC_URL:t,CONNECT_PUBLIC_URL:"https://connect.useparagon.com",DASHBOARD_PUBLIC_URL:"https://dashboard.useparagon.com",NODE_ENV:"production",PASSPORT_PUBLIC_URL:"https://passport.useparagon.com",PLATFORM_ENV:"production",VERSION:"latest",ZEUS_PUBLIC_URL:"https://zeus.useparagon.com"},!this.environments.CONNECT_PUBLIC_URL)throw new Error("Paragon SDK error! No `CONNECT_PUBLIC_URL` configured.");if(!this.environments.DASHBOARD_PUBLIC_URL)throw new Error("Paragon SDK error! No `DASHBOARD_PUBLIC_URL` configured.");if(!this.environments.PASSPORT_PUBLIC_URL)throw new Error("Paragon SDK error! No `PASSPORT_PUBLIC_URL` configured.");if(!this.environments.ZEUS_PUBLIC_URL)throw new Error("Paragon SDK error! No `ZEUS_PUBLIC_URL` configured.");this.loadState(),window.addEventListener("message",this.eventMessageHandler.bind(this)),window.document.readyState===u.DocumentLoadingState.LOADING?window.document.addEventListener("DOMContentLoaded",(()=>{this.createReactRoot()})):this.createReactRoot()}async eventMessageHandler(t){switch(t.data.type){case"oauth_success_callback":await this._oauthCallback(t.data.credential);break;case"oauth_error_callback":await this._oauthErrorCallback(t.data.error);break;default:await this.functionInvocationHandler(t)}}async functionInvocationHandler(t){if("SDK_FUNCTION_INVOCATION"!==t.data.messageType)return;const{type:e,id:n,parameters:r}=t.data;let i;try{i={messageType:"SDK_FUNCTION_RESPONSE",id:n,type:e,result:await this[e](...r)}}catch(t){i={messageType:"SDK_FUNCTION_ERROR",error:!0,message:t.message,id:n}}t.source.postMessage(i,this.environments.CONNECT_PUBLIC_URL)}createReactRoot(){var t;this.root=document.createElement("iframe"),this.root.onload=()=>{this.rootLoaded=!0,this.render()};const e=!!document.querySelector(`#${g}`);this.root.id=_,this.root.src=`${this.environments.CONNECT_PUBLIC_URL}/ui${this.projectId?`?projectId=${this.projectId}`:""}`,this.root.style.position=e?"absolute":"fixed",this.root.style.top="0",this.root.style.left="0",this.root.style.width=e?"100%":"100vw",this.root.style.height=e?"100%":"100vh",this.root.style.zIndex="2147483647",this.root.style.display="none",null===(t=document.querySelector(`#${g}`)||document.body)||void 0===t||t.appendChild(this.root)}validateAction(t){var e;if(!this.loadedIntegrations[t]&&!(0,a.isCustomIntegrationTypeName)(t))throw new Error(`"${t}" is not a valid integration type. The integrations you have configured for this Paragon project are:\n\n${Object.keys(this.loadedConfigs).map((t=>`- "${t}"`)).join("\n")}\n`);if(!this.loadedConfigs[t])throw new Error(`integration "${t}" has not been set up in your Paragon project yet.\n\n${Object.keys(this.loadedConfigs).map((t=>`- "${t}"`)).join("\n")}`);if(!(null===(e=this.loadedIntegrations[t])||void 0===e?void 0:e.isActive))throw new Error(`integration "${t}" is not active in your Paragon project yet.`)}isAlreadyInstalled(t,e){var n;return Boolean(null===(n=e.integrations[t])||void 0===n?void 0:n.enabled)}async bootstrapSDKState(t){this.projectId&&this.userState.authenticated&&(this.project=await this.sendConnectRequest(`/sdk/projects/${this.projectId}`,{headers:{"X-Paragon-Cache-Metadata":"1",...t?{"X-Paragon-User-Metadata":JSON.stringify(t)}:{}}},!1),await this.updateLocalState())}setModalState(t){this.modalState={config:void 0,...this.modalState,...t},this.render()}loadState(){if("undefined"!=typeof window)try{const t=window.localStorage.getItem(E)?JSON.parse(window.localStorage.getItem(E)):{};if(t.projectId&&(this.projectId=t.projectId),t.userState){const{userState:e}=t;if(!("authenticated"in e&&e.authenticated&&"token"in e))throw new Error("Malformatted or unauthenticated user was persisted into localStorage. Refusing to load.");this.updateAuthenticatedUser(e),this.bootstrapSDKState().catch((()=>{this.clearState()}))}}catch{this.clearState()}}saveState(){"undefined"!=typeof window&&this.userState.authenticated&&window.localStorage.setItem(E,JSON.stringify({projectId:this.projectId,userState:this.userState}))}clearState(){"undefined"!=typeof window&&window.localStorage.removeItem(E)}render(){if(this.root&&this.rootLoaded){const{onClose:t,onOpen:e,...n}=this.modalState,r={messageType:"UI_UPDATE",nextContext:{user:this.userState,projectId:this.projectId,environments:this.environments,project:this.project,endUserIntegrationConfig:this.modalState.integration?this.endUserIntegrationConfig[this.modalState.integration.type]:void 0},nextModalState:n};if(!this.root.contentWindow)throw new Error("Browser not supported");this.root.contentWindow.postMessage(r,this.environments.CONNECT_PUBLIC_URL)}}updateContainerStyle(t){let{isModalShown:e}=t;this.root&&(this.root.style.display=e?"block":"none")}async authenticate(t,e,n){var r;if(!t||!e)throw new Error("projectId or token not specified to paragon.authenticate()");let o={};try{o=(0,i.default)(e)}catch(t){throw new Error("A well-formed JWT was not provided to paragon.authenticate()")}this.projectId=t,this.userState={authenticated:!0,token:e,userId:o.sub||o.id,integrations:{},meta:null!==(r=null==n?void 0:n.metadata)&&void 0!==r?r:{}};try{await this.bootstrapSDKState(null==n?void 0:n.metadata)}catch(t){throw console.warn("paragon.authenticate() could not login user",t),this.logout(),new Error(`Failed to authenticate user with Paragon: ${t.message}`)}this.render()}getUser(){return Object.fromEntries(Object.entries(this.userState).filter((t=>{let[e]=t;return"token"!==e})))}updateAuthenticatedUser(t){this.userState.authenticated?this.userState={...this.userState,...t}:t.authenticated&&(this.userState=t),this.render()}logout(){this.userState={authenticated:!1},this.clearState(),this.render()}async connect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._connect(t,e)}async _connect(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{mapObjectFields:n,overrideRedirectUrl:r,isApiInstallation:i=!1,showPortalAfterInstall:o,bypassPostOAuthPrompt:s,allowMultipleCredentials:c,selectedCredentialId:h,...d}=e;return new Promise(((p,_)=>{this.subscribeToIntegration(t,{...d,onInstall:(t,e)=>{var n;p(),(null==d?void 0:d.onInstall)?d.onInstall(t,e):null===(n=null==d?void 0:d.onSuccess)||void 0===n||n.call(d,t,e)},onError:t=>{var e;_(t),null===(e=null==d?void 0:d.onError)||void 0===e||e.call(d,t)}});try{if(n&&!this.project.accessibleFeatures.includes(u.ConnectAddOn.DynamicFieldMapper))throw new Error("Dynamic Field Mapping is available on our Enterprise plan. Contact sales@useparagon.com to learn more or upgrade.");if(this.validateAction(t),r&&!(0,f.isValidUrl)(r))throw new Error(`${r} is not valid url.`);this.endUserIntegrationConfig[t]={mapObjectFields:n,overrideRedirectUrl:r?(0,f.sanitizeUrl)(r):void 0};const d=Object.values(this.loadedIntegrations).find((e=>(0,a.getIntegrationTypeName)(e)===t));e.isApiInstallation&&!d.needPreOauthInputs&&(0,l.startOAuthFlow)({context:{user:this.userState,projectId:this.projectId,environments:this.environments,endUserIntegrationConfig:this.modalState.integration?this.endUserIntegrationConfig[this.modalState.integration.type]:void 0},integration:d}),this.setModalState({integration:d,config:this.loadedConfigs[t],apiInstallationOptions:{isApiInstallation:i,showPortalAfterInstall:o,bypassPostOAuthPrompt:s,allowMultipleCredentials:c,selectedCredentialId:h}})}catch(e){this.emitError(e,t)}}))}async _oauthCallback(t,e){var n;const{integrationId:r,payload:i}=t,s=Object.values(this.loadedIntegrations).find((t=>t.id===r));if(!s)return;const l=(0,a.getIntegrationTypeName)(s),c=(null===(n=this.modalState.apiInstallationOptions)||void 0===n?void 0:n.isApiInstallation)?this.modalState.apiInstallationOptions:{};try{const t=e?`/sdk/credentials/${e}/complete-setup`:"/sdk/credentials",n=await this.sendConnectRequest(t,{method:"POST",body:JSON.stringify({integrationId:s.id,config:{},payload:i,installOptions:c})});if(!n)throw new Error("Unable to save oauth credentials");this.updateCredentialData(n,s),n.status===o.CredentialStatus.VALID&&this.triggerSDKEvent({type:u.SDK_EVENT.ON_INTEGRATION_INSTALL,integrationId:s.id,integrationType:l})}catch(t){this.emitError(t,l),await this._oauthErrorCallback(t.message)}}async _oauthErrorCallback(t){let e=t;console.error("Failed to connect account to Paragon over OAuth",e),"object"==typeof e&&(e=JSON.stringify(e)),window.alert(`Something went wrong connecting your account. Please try again or ${e}`)}async sendConnectRequest(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.userState.authenticated||!this.projectId)throw new Error("Connect SDK attempted to make an API request, but no user was authenticated.\nCall paragon.authenticate(<projectId>, <user token>) before using the SDK.");const r=`${this.environments.ZEUS_PUBLIC_URL}${n?`/projects/${this.projectId}`:""}${t}`,i=(0,d.hash)(JSON.stringify({url:r,payload:{...e}})),o=await this.cachedApiResponse.get(i,!0);if((null==e?void 0:e.cacheResult)&&o)return o;const a=Boolean(!e||"GET"===e.method||e.cacheResult);if(a&&"object"==typeof this.keyToRequestPromiseMap[i])return this.keyToRequestPromiseMap[i];const s=this.userState.token,l=new Promise(((t,n)=>{(async()=>{try{const n=await this.sendRequest(r,{...e,headers:{Accept:"application/json","Content-Type":"application/json",...null==e?void 0:e.headers,Authorization:`Bearer ${s}`}},a?i:void 0);t(n)}catch(t){n(t)}})()}));return a&&(this.keyToRequestPromiseMap[i]=l),l}async sendRequest(t,e,n){let r,i,o;try{r=await fetch(t,e)}catch(t){o=t}if(r&&!r.ok||o){const e=401===(null==r?void 0:r.status)||403===(null==r?void 0:r.status);!t.includes("proxy")&&e&&this.logout();const i=r?await(0,f.getErrorMessage)(r):null==o?void 0:o.message;throw n&&(await this.cachedApiResponse.del(n),delete this.keyToRequestPromiseMap[n]),new Error(i)}try{i=await(null==r?void 0:r.json())}catch{i=void 0}return n&&(await this.cachedApiResponse.set(n,i),delete this.keyToRequestPromiseMap[n]),i}async request(t,e,n){var r,i;let o=`/sdk/proxy/${t}`;(0,a.isCustomIntegrationTypeName)(t)&&(o=`/sdk/proxy/custom/${null===(r=Object.values(this.loadedIntegrations).find((e=>!!e.customIntegration&&e.customIntegration.slug===t)))||void 0===r?void 0:r.id}`);const s=e.startsWith("/")?e:`/${e}`,l=n.selectedCredentialId?n.selectedCredentialId:null===(i=this.userState.integrations[t])||void 0===i?void 0:i.credentialId,c=await this.sendConnectRequest(`${o}${s}`,{method:n.method,body:"object"==typeof n.body?JSON.stringify(n.body):n.body,headers:{"Content-Type":u.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS,...l?{[u.SELECTED_CREDENTIAL_ID_HEADER]:l}:{},...n.headers}});return null==c?void 0:c.output}async event(t,e){await this.sendConnectRequest(`/v2/projects/${this.projectId}/sdk/events/trigger`,{method:"POST",body:JSON.stringify({name:t,payload:e})},!1)}onClose(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{integration:n,apiInstallationOptions:r}=this.modalState;n&&(this.triggerSDKEvent({type:u.SDK_EVENT.ON_PORTAL_CLOSE,integrationId:n.id,integrationType:(0,a.getIntegrationTypeName)(n)}),this.originalBodyOverflow!==e.PARAGON_OVERFLOW_EMPTY_VALUE&&(window.document.body.style.overflow=this.originalBodyOverflow,this.originalBodyOverflow=e.PARAGON_OVERFLOW_EMPTY_VALUE),!t&&(null==r?void 0:r.isApiInstallation)||this.setModalState({integration:null}))}onOpen(){const{integration:t}=this.modalState;if(t&&(this.triggerSDKEvent({type:u.SDK_EVENT.ON_PORTAL_OPEN,integrationId:t.id,integrationType:(0,a.getIntegrationTypeName)(t)}),this.root&&this.originalBodyOverflow===e.PARAGON_OVERFLOW_EMPTY_VALUE)){const t=this.root.getBoundingClientRect();window.innerHeight<=t.height&&window.innerWidth<=t.width&&(this.originalBodyOverflow=window.document.body.style.overflow,window.document.body.style.overflow="hidden")}}triggerSDKEvent(t){this.triggerEvent(t,this.userState)}getIntegrationMetadata(t){if(!t)return Object.values(this.metadata);if(!this.metadata[t])throw new Error(`${t} is not a valid integration name`);return this.metadata[t]}workflow(t){let{selectedCredentialId:e,body:n={},query:r={},headers:i={}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var o;if(!t)throw new Error("workflowId is required.");const a=new URLSearchParams(r).toString(),s=e||(null===(o=this.getIntegrationForWorkflow(t))||void 0===o?void 0:o.credentialId);return this.sendConnectRequest(`/sdk/triggers/${t}?${a}`,{method:"POST",body:JSON.stringify(n),headers:{...s?{[u.SELECTED_CREDENTIAL_ID_HEADER]:s}:{},...i}},!0)}installIntegration(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");const n={showPortalAfterInstall:!1,bypassPostOAuthPrompt:!1,allowMultipleCredentials:!1,...e,isApiInstallation:!0};if(n.bypassPostOAuthPrompt&&n.showPortalAfterInstall)throw new Error("Could not use both `bypassPostOAuthPrompt` and `showPortalAfterInstall` as true at the same time.");if(this.ensureHeadlessIsSupported(),this.validateAction(t),!n.allowMultipleCredentials&&this.isAlreadyInstalled(t,this.userState))throw new Error(`Integration "${t}" is already installed.`);return this.setModalState({integration:null}),this._connect(t,n)}ensureHeadlessIsSupported(){if(!this.project.accessibleFeatures.includes(u.ConnectAddOn.HeadlessConnectPortal))throw new Error("Headless Connect Portal is available on our Pro plan and above. Contact sales@useparagon.com to learn more or upgrade.")}async uninstallIntegration(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).selectedCredentialId;if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");if(this.ensureHeadlessIsSupported(),this.validateAction(t),!this.isAlreadyInstalled(t,this.userState))throw new Error(`Integration "${t}" is not installed.`);const n=this.loadedIntegrations[t].id,r=this.userState.integrations[t],i=e||(null==r?void 0:r.credentialId);if(!i||!r)throw new Error("No credential found for uninstall");await this.sendConnectRequest(`/sdk/integrations/${n}`,{method:"DELETE",headers:{...i?{[u.SELECTED_CREDENTIAL_ID_HEADER]:i}:{}}}),this.updateAuthenticatedUser({integrations:{...this.userState.integrations,[t]:(0,s.getActionStateForCredentialDelete)(i,r)}}),this.saveState(),this.triggerSDKEvent({type:u.SDK_EVENT.ON_INTEGRATION_UNINSTALL,integrationId:n,integrationType:t})}async disableWorkflow(t){var e;const n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).selectedCredentialId;if(!this.userState.authenticated)throw new Error("User not authenticated, Call paragon.authenticate(<projectId>, <user token>) before using the SDK.");if(!this.isWorkflowEnabled(t,n))throw new Error(`Workflow ${t} cannot be disabled for this user.`);const r=n||(null===(e=this.getIntegrationForWorkflow(t))||void 0===e?void 0:e.credentialId);await this.sendConnectRequest(`/sdk/workflows/${t}`,{method:"DELETE",headers:r?{[u.SELECTED_CREDENTIAL_ID_HEADER]:r}:{}}),await this.updateLocalState()}getIntegrationForWorkflow(t){return Object.values(this.userState.integrations).find((e=>{var n;return null===(n=null==e?void 0:e.configuredWorkflows)||void 0===n?void 0:n[t]}))}async updateLocalState(){const[t,e]=await Promise.all([this.fetchUserData(),this.fetchIntegrations()]);this.updateAuthenticatedUser({integrations:t.integrations,meta:t.meta}),this.updateIntegrations(e),this.saveState()}isWorkflowEnabled(t,e){var n,r,i;if(e){const o=Object.values(this.userState.integrations).map((t=>t.allCredentials)).flat().find((t=>t.id===e));return Boolean(null===(i=null===(r=null===(n=null==o?void 0:o.config)||void 0===n?void 0:n.configuredWorkflows)||void 0===r?void 0:r[t])||void 0===i?void 0:i.enabled)}const o=Object.values(this.userState.integrations).find((e=>{var n,r;return null===(r=null===(n=null==e?void 0:e.configuredWorkflows)||void 0===n?void 0:n[t])||void 0===r?void 0:r.enabled}));return void 0!==o}async fetchUserData(){const t=await this.sendConnectRequest("/sdk/me");if(t)return t;throw new Error("Unable to get user Data")}async fetchIntegrations(){const t=await this.sendConnectRequest("/sdk/integrations");if(!t)throw new Error("Unable to fetch integrations");return t}updateIntegrations(t){t.forEach((t=>{var e,n,r;if(t.configs.length)try{const i=(0,a.getIntegrationTypeName)(t);this.loadedConfigs[i]=t.configs[0].values,this.loadedIntegrations[i]=t,Boolean(t.isActive)&&(this.metadata[i]={type:i,name:t.name,brandColor:t.brandColor,icon:null!==(n=null===(e=t.customIntegration)||void 0===e?void 0:e.icon)&&void 0!==n?n:`${this.environments.CDN_PUBLIC_URL}/integrations/${u.overrideActionAlias[t.type]||t.type}.svg`}),(null===(r=this.modalState.integration)||void 0===r?void 0:r.id)===t.id&&this.setModalState({integration:t})}catch(t){console.warn(t)}}))}async setUserMetadata(t){return await this.sendConnectRequest("/sdk/me",{method:"PATCH",body:JSON.stringify({meta:t})}),await this.updateLocalState(),this.render(),this.userState}configureGlobal(t){if(!t||!t.host)throw new Error("host not specified");const e=t.host.indexOf("http")>-1?new URL(t.host).hostname:t.host;this.environments.CONNECT_PUBLIC_URL=(0,f.getServiceUrl)("connect",e),this.environments.DASHBOARD_PUBLIC_URL=(0,f.getServiceUrl)("dashboard",e),this.environments.PASSPORT_PUBLIC_URL=(0,f.getServiceUrl)("passport",e),this.environments.ZEUS_PUBLIC_URL=(0,f.getServiceUrl)("zeus",e),this.environments.CDN_PUBLIC_URL=(0,f.getServiceUrl)("dashboard",e),this.userState.authenticated=!1,this.root?this.root.src=`${this.environments.CONNECT_PUBLIC_URL}/ui${this.projectId?`?projectId=${this.projectId}`:""}`:console.error("Root element not defined")}async completeInstall(t,e){var n;if(!this.userState.authenticated)throw new Error("Authentication is required");if(!e||!e.authorizationCode)throw new Error("authorizationCode is required");if(e.redirectUrl&&!(0,f.isValidUrl)(e.redirectUrl))throw new Error(`${e.redirectUrl} is not valid url`);this.validateAction(t);const r=Object.values(this.loadedIntegrations).find((e=>(0,a.getIntegrationTypeName)(e)===t)),i=null===(n=e.showPortalAfterInstall)||void 0===n||n,o=await this.sendConnectRequest("/sdk/credentials",{method:"POST",body:JSON.stringify({code:e.authorizationCode,integrationId:r.id,redirectUrl:e.redirectUrl?(0,f.sanitizeUrl)(e.redirectUrl):void 0,integrationOptions:e.integrationOptions||{}})});if(!o)throw new Error("Unable to create credential");this.updateCredentialData(o,r),i&&this.setModalState({integration:r,config:this.loadedConfigs[t],apiInstallationOptions:{}})}updateCredentialData(t,e){const n=this.userState,r=(0,a.getIntegrationTypeName)(e),i=n.integrations[r],s=i.allCredentials.findIndex((e=>e.id===t.id));s>-1?i.allCredentials[s]=t:i.allCredentials.push(t),this.updateAuthenticatedUser({integrations:{...n.integrations,[r]:{...i,...t.config,credentialStatus:t.status,enabled:t.status===o.CredentialStatus.VALID,credentialId:t.id,providerId:t.providerId,providerData:t.providerData}}})}}e.default=v},892:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(821);e.default=class{constructor(){this.eventListenersMap={},this.integrationStateCallbacks={}}subscribe(t,e){var n;if(this.assertEventType(t),"function"!=typeof e)throw new Error(`no listener is provided for ${t}`);return this.eventListenersMap={...this.eventListenersMap,[t]:[...null!==(n=this.eventListenersMap[t])&&void 0!==n?n:[],e]},()=>this.unsubscribe(t,e)}subscribeToIntegration(t,e){this.integrationStateCallbacks[t]={...e}}unsubscribe(t,e){var n,r;if(this.assertEventType(t),"function"!=typeof e)throw new Error("listener is required for unsubscription");const i=(null!==(n=this.eventListenersMap[t])&&void 0!==n?n:[]).length;return this.eventListenersMap={...this.eventListenersMap,[t]:(null!==(r=this.eventListenersMap[t])&&void 0!==r?r:[]).filter((t=>t!==e))},i>this.eventListenersMap[t].length}assertEventType(t){if(!Object.values(r.SDK_EVENT).includes(t))throw new Error(`${t} is not valid paragon event`)}emitSafe(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i;(null!==(i=this.eventListenersMap[t])&&void 0!==i?i:[]).forEach((t=>{try{t(...n)}catch(t){console.error(t)}}))}emitError(t,e){this.invokeCallbackSafe(e,"onError",t)}invokeCallbackSafe(t,e){var n,r;try{for(var i=arguments.length,o=new Array(i>2?i-2:0),a=2;a<i;a++)o[a-2]=arguments[a];null===(r=null===(n=this.integrationStateCallbacks[t])||void 0===n?void 0:n[e])||void 0===r||r.call(n,...o)}catch(t){console.error(t)}}triggerEvent(t,e){let{type:n,integrationId:i,integrationType:o,workflowId:a,workflowStateChange:s}=t;if(i&&o)switch(n){case r.SDK_EVENT.ON_INTEGRATION_INSTALL:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onInstall",...t),this.emitSafe(r.SDK_EVENT.ON_INTEGRATION_INSTALL,...t);break}case r.SDK_EVENT.ON_INTEGRATION_UNINSTALL:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onUninstall",...t),this.emitSafe(r.SDK_EVENT.ON_INTEGRATION_UNINSTALL,...t);break}case r.SDK_EVENT.ON_PORTAL_OPEN:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onOpen",...t),this.emitSafe(r.SDK_EVENT.ON_PORTAL_OPEN,...t);break}case r.SDK_EVENT.ON_PORTAL_CLOSE:{const t=[{integrationId:i,integrationType:o},e];this.invokeCallbackSafe(o,"onClose",...t),this.emitSafe(r.SDK_EVENT.ON_PORTAL_CLOSE,...t);break}case r.SDK_EVENT.ON_WORKFLOW_CHANGE:{const t=[{integrationId:i,workflowId:a,workflowStateChange:s||{}},e];this.invokeCallbackSafe(o,"onWorkflowChange",...t),this.emitSafe(r.SDK_EVENT.ON_WORKFLOW_CHANGE,...t);break}default:throw new Error(`${n} is not valid event.`)}}}},931:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ACTION_CUSTOM=void 0,e.ACTION_CUSTOM="custom"},59:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CredentialStatus=void 0,function(t){t.PENDING="PENDING",t.INVALID="INVALID",t.VALID="VALID"}(e.CredentialStatus||(e.CredentialStatus={}))},663:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.generateSlugForIntegration=void 0,e.generateSlugForIntegration=function(t){if(!t.name)return;return`custom.${t.name?t.name.replace(/[\W_]+/g,"").trim().toLowerCase():void 0}`}},343:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCustomIntegrationTypeName=e.getIntegrationTypeName=void 0;const r=n(931),i=n(663);e.getIntegrationTypeName=function(t){if(t.type===r.ACTION_CUSTOM){if(t.customIntegration)return(0,i.generateSlugForIntegration)(t.customIntegration);throw new Error(`Custom integration details are missing from this integration: ${t.id}`)}return t.type},e.isCustomIntegrationTypeName=function(t){return t.startsWith("custom.")}},643:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getActionStateForCredentialDelete=e.stripUndefinedAndNull=e.parseKeyedSource=void 0;const r=n(59);e.parseKeyedSource=function(t){return t&&(null==t?void 0:t.length)?Object.fromEntries(t.map((t=>[t.key,"VALUE"===t.source.type?t.source.value:void 0]))):{}},e.stripUndefinedAndNull=function t(e){const n={};return Object.keys(e).forEach((r=>{var i;(i=e[r])&&"object"==typeof i&&!Array.isArray(i)?n[r]=t(e[r]):void 0!==e[r]&&null!==e[r]&&(n[r]=e[r])})),n};e.getActionStateForCredentialDelete=(t,e)=>{var n;const i=(null!==(n=null==e?void 0:e.allCredentials)&&void 0!==n?n:[]).filter((e=>e.id!==t));if(0===i.length)return{enabled:!1,configuredWorkflows:{},allCredentials:[]};{const t=i[0];return{...e,credentialStatus:t.status,enabled:t.status===r.CredentialStatus.VALID,credentialId:t.id,providerId:t.providerId,providerData:t.providerData,allCredentials:i}}}},429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.startOAuthFlow=void 0;const r=n(931),i=n(343),o=n(643);e.startOAuthFlow=async t=>{let{context:e,integration:n,endUserSuppliedValues:a={},authParams:s}=t;var l;const c=(0,i.getIntegrationTypeName)(n);if(!c)return;const u=s?(0,o.parseKeyedSource)(s):{},h=(0,o.stripUndefinedAndNull)({action:c&&(0,i.isCustomIntegrationTypeName)(c)?r.ACTION_CUSTOM:c,endUserSuppliedValues:JSON.stringify(a),parameters:JSON.stringify(u),userToken:e.user.token,integrationId:n.id,redirectUrl:null===(l=e.endUserIntegrationConfig)||void 0===l?void 0:l.overrideRedirectUrl,originForPostMessage:window.location.origin}),d=`${e.environments.ZEUS_PUBLIC_URL}/projects/${e.projectId}/sdk/actions/build-oauth?${new URLSearchParams(h).toString()}`;window.open(d,void 0,"width=500,height=600,left=100,top=150")}},56:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.paragon=void 0;const r=n(655),i=r.__importDefault(n(773));r.__exportStar(n(821),e);const o=new i.default;e.paragon={authenticate:o.authenticate.bind(o),connect:o.connect.bind(o),event:o.event.bind(o),getIntegrationMetadata:o.getIntegrationMetadata.bind(o),getUser:o.getUser.bind(o),request:o.request.bind(o),subscribe:o.subscribe.bind(o),unsubscribe:o.unsubscribe.bind(o),workflow:o.workflow.bind(o),_oauthCallback:o._oauthCallback.bind(o),_oauthErrorCallback:o._oauthErrorCallback.bind(o),installIntegration:o.installIntegration.bind(o),uninstallIntegration:o.uninstallIntegration.bind(o),disableWorkflow:o.disableWorkflow.bind(o),setUserMetadata:o.setUserMetadata.bind(o),configureGlobal:o.configureGlobal.bind(o),completeInstall:o.completeInstall.bind(o)},e.default={ConnectSDK:i.default}},992:(t,e)=>{"use strict";var n,r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.overrideActionAlias=e.TokenType=e.SidebarInputType=void 0,function(t){t.Auth="AUTH",t.Enum="ENUM",t.DynamicEnum="DYNAMIC_ENUM",t.Intent="INTENT",t.Text="TEXT",t.TextArea="TEXTAREA",t.ValueText="TEXT_NO_VARS",t.ValueTextArea="TEXTAREA_NO_VARS",t.Code="CODE",t.ActionButton="ACTION_BUTTON",t.Conditional="CONDITIONAL",t.DynamicConditional="DYNAMIC_CONDITIONAL",t.NestedList="NESTED_LIST",t.File="FILE",t.EditableDynamicEnum="EDITABLE_DYNAMIC_ENUM",t.EditableEnum="EDITABLE_ENUM",t.BooleanInput="BOOLEAN_INPUT",t.UserSuppliedCredential="USER_SUPPLIED_CREDENTIAL",t.NativeDynamicEnumInput="NATIVE_DYNAMIC_INPUT",t.TimeConstraintInput="TIME_CONSTRAINT_INPUT",t.LinesListInput="LinesListInput",t.LinesListDynamicInput="LinesListDynamicInput",t.Number="NUMBER",t.Email="EMAIL",t.URL="URL",t.EnumTextAreaPairInput="EnumTextAreaPairInput",t.FieldMapper="FIELD_MAPPER",t.ComboInput="COMBO_INPUT",t.Password="PASSWORD",t.Switch="SWITCH"}(e.SidebarInputType||(e.SidebarInputType={})),function(t){t.ACCESS_TOKEN="ACCESS_TOKEN",t.REFRESH_TOKEN="REFRESH_TOKEN",t.BOT_TOKEN="BOT_TOKEN",t.KLAVIYO_API_KEY="KLAVIYO_API_KEY",t.MARKETO_CLIENT_ID="MARKETO_CLIENT_ID",t.MARKETO_CLIENT_SECRET="MARKETO_CLIENT_SECRETI",t.MARKETO_ENDPOINT="MARKETO_ENDPOINT",t.MARKETO_IDENTITY="MARKETO_IDENTITY",t.MONDAY_API_TOKEN="MONDAY_API_TOKEN",t.ORACLE_CLOUD_URL="ORACLE_CLOUD_URL",t.ORACLE_PASSWORD="ORACLE_PASSWORD",t.ORACLE_USERNAME="ORACLE_USERNAME",t.SAGE_INTACCT_COMPANY_ID="SAGE_INTACCT_COMPANY_ID",t.SAGE_INTACCT_USER_ID="SAGE_INTACCT_USER_ID",t.SAGE_INTACCT_USER_PASSWORD="SAGE_INTACCT_USER_PASSWORD",t.SAILTHRU_COMPANY_KEY="SAILTHRU_COMPANY_KEY",t.SAILTHRU_COMPANY_SECRET="SAILTHRU_COMPANY_SECRET",t.SERVICENOW_PASSWORD="SERVICENOW_PASSWORD",t.SERVICENOW_SUBDOMAIN="SERVICENOW_SUBDOMAIN",t.SERVICENOW_USERNAME="SERVICENOW_USERNAME",t.TABLEAU_PERSONAL_ACCESS_TOKEN_NAME="TABLEAU_PERSONAL_ACCESS_TOKEN_NAME",t.TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET="TABLEAU_PERSONAL_ACCESS_TOKEN_SECRET",t.TABLEAU_SERVER_NAME="TABLEAU_SERVER_NAME",t.TABLEAU_SITE_ID="TABLEAU_SITE_ID",t.TRELLO_API_KEY="TRELLO_API_KEY",t.TRELLO_API_TOKEN="TRELLO_API_TOKEN",t.WOOCOMMERCE_CONSUMER_KEY="WOOCOMMERCE_CONSUMER_KEY",t.WOOCOMMERCE_CONSUMER_SECRET="WOOCOMMERCE_CONSUMER_SECRET",t.WOOCOMMERCE_STORE_DOMAIN="WOOCOMMERCE_STORE_DOMAIN",t.WORKABLE_API_ACCESS_TOKEN="WORKABLE_API_ACCESS_TOKEN",t.WORKABLE_ACCOUNT_SUBDOMAIN="WORKABLE_ACCOUNT_SUBDOMAIN",t.ZOHO_CRM_ACCOUNTS_SERVER="ZOHO_CRM_ACCOUNTS_SERVER",t.ZOHO_CRM_API_DOMAIN="ZOHO_CRM_API_DOMAIN"}(e.TokenType||(e.TokenType={})),function(t){t.INFO="INFO",t.ERROR="ERROR",t.SUCCESS="SUCCESS"}(n||(n={})),function(t){t.NONE="NONE",t.RE_AUTHENTICATE="RE_AUTHENTICATE",t.ALERT="ALERT",t.DISPATCH="DISPATCH"}(r||(r={})),function(t){t.DYNAMIC="DYNAMIC_DATA_SOURCE",t.STATIC_ENUM="STATIC_ENUM_DATA_SOURCE",t.FIELD_MAPPER="FIELD_MAPPER_DATA_SOURCE",t.COMBO_INPUT="COMBO_INPUT_DATA_SOURCE"}(i||(i={})),e.overrideActionAlias={monday:"monday"}},34:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CONNECT_PLAN_FEATURE_MAP=void 0;const r=n(471);e.CONNECT_PLAN_FEATURE_MAP={[r.BillingPlan.ConnectBasic]:[],[r.BillingPlan.ConnectPro]:[r.ConnectAddOn.CustomIntegrationBuilder,r.ConnectAddOn.HeadlessConnectPortal,r.ConnectAddOn.Monitoring,r.ConnectAddOn.UserMetadata,r.ConnectAddOn.WhiteLabeling],[r.BillingPlan.ConnectEnterprise]:[r.ConnectAddOn.CustomIntegrationBuilder,r.ConnectAddOn.DynamicFieldMapper,r.ConnectAddOn.HeadlessConnectPortal,r.ConnectAddOn.TaskHistoryAPI,r.ConnectAddOn.Monitoring,r.ConnectAddOn.RoleBasedAccessControl,r.ConnectAddOn.UserMetadata,r.ConnectAddOn.WhiteLabeling,r.ConnectAddOn.WorkflowPermission]}},935:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SELECTED_CREDENTIAL_ID_HEADER=e.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS=void 0;const r=n(992);var i;!function(t){t.NOT_STARTED="NOT_STARTED",t.DELAYED="DELAYED",t.PAUSED="PAUSED",t.EXECUTING="EXECUTING",t.FAILED="FAILED",t.SUCCEEDED="SUCCEEDED",t.WAITING="WAITING"}(i||(i={}));r.SidebarInputType.ValueText,r.SidebarInputType.DynamicEnum,r.SidebarInputType.Enum,r.SidebarInputType.Number,r.SidebarInputType.Email,r.SidebarInputType.URL,r.SidebarInputType.FieldMapper,r.SidebarInputType.BooleanInput,r.SidebarInputType.ComboInput,r.SidebarInputType.Password,r.SidebarInputType.Switch,r.SidebarInputType.ValueTextArea;e.INFER_CONTENT_TYPE_FROM_CONNECT_OPTIONS="auto",e.SELECTED_CREDENTIAL_ID_HEADER="X-Paragon-Credential"},977:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},914:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PLATFORM_ENV=e.NODE_ENV=void 0,function(t){t.PRODUCTION="production",t.DEVELOPMENT="development",t.TEST="test"}(e.NODE_ENV||(e.NODE_ENV={})),function(t){t.PRODUCTION="production",t.PRODUCTION_MIRROR_1="p-m1",t.STAGING="staging",t.STAGING_MIRROR_1="s-m1",t.DEVELOPMENT="dev",t.TEST="test",t.SANDBOX="sandbox",t.RELEASE="release",t.ENTERPRISE="enterprise"}(e.PLATFORM_ENV||(e.PLATFORM_ENV={}))},65:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},821:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(655);r.__exportStar(n(992),e),r.__exportStar(n(34),e),r.__exportStar(n(935),e),r.__exportStar(n(977),e),r.__exportStar(n(914),e),r.__exportStar(n(65),e),r.__exportStar(n(835),e),r.__exportStar(n(750),e),r.__exportStar(n(471),e)},835:(t,e)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DataType=void 0,function(t){t.STRING="STRING",t.NUMBER="NUMBER",t.DATE="DATE",t.BOOLEAN="BOOLEAN",t.EMAIL="EMAIL",t.OBJECT="OBJECT",t.ARRAY="ARRAY",t.ANY="ANY",t.FILE="FILE",t.NON_DECIMAL="NON_DECIMAL"}(e.DataType||(e.DataType={})),function(t){t.None="$none",t.StringContains="$stringContains",t.StringDoesNotContain="$stringDoesNotContain",t.StringExactlyMatches="$stringExactlyMatches",t.StringDoesNotExactlyMatch="$stringDoesNotExactlyMatch",t.StringIsIn="$stringIsIn",t.StringIsNotIn="$stringIsNotIn",t.StringStartsWith="$stringStartsWith",t.StringDoesNotStartWith="$stringDoesNotStartWith",t.StringEndsWith="$stringEndsWith",t.StringDoesNotEndWith="$stringDoesNotEndWith",t.NumberGreaterThan="$numberGreaterThan",t.NumberLessThan="$numberLessThan",t.NumberEquals="$numberEquals",t.NumberDoesNotEqual="$numberDoesNotEqual",t.NumberLessThanOrEqualTo="$numberLessThanOrEqualTo",t.NumberGreaterThanOrEqualTo="$numberGreaterThanOrEqualTo",t.DateTimeAfter="$dateTimeAfter",t.DateTimeBefore="$dateTimeBefore",t.DateTimeEquals="$dateTimeEquals",t.BooleanTrue="$booleanTrue",t.BooleanFalse="$booleanFalse",t.IsNotNull="$exists",t.IsNull="$doesNotExist",t.Exists="$isNotUndefinedOrNull",t.DoesNotExist="$isUndefinedOrNull",t.ArrayIsIn="$arrayIsIn",t.ArrayIsNotIn="$arrayIsNotIn",t.ArrayIsEmpty="$arrayIsEmpty",t.ArrayIsNotEmpty="$arrayIsNotEmpty",t.StringGreaterThan="$stringGreaterThan",t.StringLessThan="$stringLessThan"}(n||(n={}))},750:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DocumentLoadingState=e.SDK_EVENT=e.ModalView=void 0,function(t){t.OVERVIEW="overview",t.CONFIGURATION="configuration"}(e.ModalView||(e.ModalView={})),function(t){t.ON_INTEGRATION_INSTALL="onIntegrationInstall",t.ON_INTEGRATION_UNINSTALL="onIntegrationUninstall",t.ON_WORKFLOW_CHANGE="onWorkflowChange",t.ON_PORTAL_OPEN="onPortalOpen",t.ON_PORTAL_CLOSE="onPortalClose"}(e.SDK_EVENT||(e.SDK_EVENT={})),function(t){t.LOADING="loading",t.INTERACTIVE="interactive",t.COMPLETE="complete"}(e.DocumentLoadingState||(e.DocumentLoadingState={}))},471:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConnectAddOn=e.BillingPlan=void 0,function(t){t.ClassicFree="free",t.ClassicStarter="starter",t.ClassicBusiness="business",t.ClassicPremium="premium",t.ClassicEnterprise="enterprise",t.ConnectTrial="connect_trial",t.ConnectBasic="basic",t.ConnectPro="pro",t.ConnectEnterprise="connect_enterprise"}(e.BillingPlan||(e.BillingPlan={})),function(t){t.CustomIntegrationBuilder="byo",t.DynamicFieldMapper="dfm",t.HeadlessConnectPortal="headless-cp",t.TaskHistoryAPI="th-api",t.Monitoring="monitoring",t.RoleBasedAccessControl="rbac",t.UserMetadata="user-metadata",t.WhiteLabeling="whitelabel",t.WorkflowPermission="workflow-permissions"}(e.ConnectAddOn||(e.ConnectAddOn={}))},158:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAssetUrl=void 0;const r=n(914);e.getAssetUrl=t=>{let{CDN_PUBLIC_URL:e,DASHBOARD_PUBLIC_URL:n,VERSION:i,PLATFORM_ENV:o,NODE_ENV:a}=t;return e&&a===r.NODE_ENV.PRODUCTION&&o!==r.PLATFORM_ENV.ENTERPRISE?`${e}/${i}/dashboard/public`:n}},846:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hash=void 0;const r=n(715);e.hash=function(t){return null==t?t:(0,r.sha256)().update(t).digest("hex").substr(0,10)}},572:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sleep=e.generateMatrix=e.DeferredPromise=void 0;e.DeferredPromise=class{get state(){return this._state}constructor(){this._state="pending",this._promise=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}then(t,e){return this._promise.then(t,e)}catch(t){return this._promise.catch(t)}resolve(t){this._resolve(t),this._state="fulfilled"}reject(t){this._reject(t),this._state="rejected"}finally(t){return null==t||t(),this._promise}},Symbol.toStringTag,e.generateMatrix=function(t,e){const n=Object.keys(t);if(n.reduce(((e,n)=>e+t[n].length),0)&&n.length)for(const e of n)t[e].length||t[e].push(void 0);const r=Object.entries(t).reduce(((t,e)=>{let[,n]=e;return t.length?t.reduce(((t,e)=>(n.forEach((n=>{const r=e.slice();r.push(n),t.push(r)}),[]),t)),[]):n.map((t=>[t]))}),[]).reduce(((t,e)=>{const r=e.reduce(((t,e,r)=>({...t,[n[r]]:e})),{});return[...t,r]}),[]);return e?r.slice(-1*e):r},e.sleep=function(t){return new Promise((e=>setTimeout(e,t)))}},321:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getErrorMessage=e.getServiceUrl=e.sanitizeUrl=e.isValidUrl=void 0;function n(t){return t?t.match(/^[a-zA-Z]+:\/\//)?t:`https://${t}`:t}function r(t){return Array.isArray(t)?t.flatMap((t=>[t,r(t.children||[])].flatMap((t=>"string"==typeof t?t:r(t))))).filter((t=>t)).join(", "):Object.values(t.constraints||{}).join(", ")}e.isValidUrl=t=>{const e=n(t);try{return new globalThis.URL(e),!0}catch(t){return!1}},e.sanitizeUrl=n,e.getServiceUrl=function(t,e){return`https://${t}${`.${e}`}`},e.getErrorMessage=async function(t){var e,n;const i=null===(e=t.headers)||void 0===e?void 0:e.get("content-type");if(i&&-1!==i.indexOf("application/json")){const e=await t.json();return"string"==typeof e.message?e.message:400===t.status&&Array.isArray(e.message)?r(e.message):JSON.stringify(e)}return null===(n=t.text)||void 0===n?void 0:n.call(t)}},35:(t,e,n)=>{"use strict";var r,i,o,a,s=n(155);Object.defineProperty(e,"__esModule",{value:!0}),e.CacheThrottle=e.CacheMode=void 0;const l=n(655),c=n(572);var u,h,d;!function(t){t.Debounce="debounce",t.Throttle="throttle"}(u=e.CacheMode||(e.CacheMode={})),function(t){t.Closed="closed",t.Idle="idle",t.Processing="processing"}(h||(h={})),function(t){t[t.Get=0]="Get",t[t.Set=1]="Set",t[t.GetOrSet=2]="GetOrSet",t[t.Del=3]="Del",t[t.Do=4]="Do"}(d||(d={}));e.CacheThrottle=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.set(this,h.Idle),i.set(this,{}),o.set(this,void 0),a.set(this,[]),l.__classPrivateFieldSet(this,o,{mode:u.Debounce,ttl:0,...t},"f")}async get(t,e){const n=this.serializeKey(t),r=async()=>{const e=l.__classPrivateFieldGet(this,i,"f")[n],{mode:r,ttl:a,value:s}=null!=e?e:{};return!e||!a||r&&r!==u.Debounce||this.refreshTimeout(t,n,a),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(n,s),s};return e?r():this.enqueue(n,d.Get,r)}async set(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;const s=this.serializeKey(t),c=async()=>{const a=l.__classPrivateFieldGet(this,i,"f")[s],c=!!a;return l.__classPrivateFieldGet(this,i,"f")[s]={...a,mode:r,ttl:n,value:e},c&&r===u.Throttle||this.refreshTimeout(t,s,n),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(s,e),e};return a?c():this.enqueue(s,d.Set,c)}async getOrSet(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.__classPrivateFieldGet(this,o,"f").mode,a=arguments.length>4?arguments[4]:void 0;const s=this.serializeKey(t),c=async()=>{if(l.__classPrivateFieldGet(this,i,"f")[s])return l.__classPrivateFieldGet(this,i,"f")[s].value;const a=await e();return await this.set(t,a,n,r,!0),l.__classPrivateFieldGet(this,o,"f").clearPendingDeletes&&this.clearPendingDeletesOnKey(s,a),a};return a?c():this.enqueue(s,d.GetOrSet,c)}async del(t){let e=arguments.length>2?arguments[2]:void 0;const n=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t:this.serializeKey(t),r=async()=>{const t=l.__classPrivateFieldGet(this,i,"f")[n];let e;return(null==t?void 0:t.timeout)&&clearTimeout(t.timeout),t&&(e=t.value,delete l.__classPrivateFieldGet(this,i,"f")[n],await(async()=>{var t,n;return null===(n=(t=l.__classPrivateFieldGet(this,o,"f")).onDeregister)||void 0===n?void 0:n.call(t,e)})().catch((t=>{}))),e};return e?r():this.enqueue(n,d.Del,r)}keys(){return Object.keys(l.__classPrivateFieldGet(this,i,"f"))}async do(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.__classPrivateFieldGet(this,o,"f").ttl,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.__classPrivateFieldGet(this,o,"f").mode;const a=this.serializeKey(t);return this.enqueue(a,d.Do,(async()=>{if(l.__classPrivateFieldGet(this,i,"f")[a])return l.__classPrivateFieldGet(this,i,"f")[a].value;const o=await e();return await this.set(t,o,n,r,!0)}))}async close(){l.__classPrivateFieldSet(this,r,h.Closed,"f"),await Promise.all(Object.keys(l.__classPrivateFieldGet(this,i,"f")).map((t=>this.del(t,!0,!0))))}refreshTimeout(t,e,n){if(l.__classPrivateFieldGet(this,r,"f")===h.Closed)return;const o=l.__classPrivateFieldGet(this,i,"f")[e];return n&&void 0!==(null==o?void 0:o.timeout)&&clearTimeout(o.timeout),n?(o.timeout=setTimeout((()=>this.del(t)),n),o.timeout):void 0}clearPendingDeletesOnKey(t,e){l.__classPrivateFieldSet(this,a,l.__classPrivateFieldGet(this,a,"f").filter((n=>{let[r,i,o,a]=n;return t!==r||i!==d.Del||(a.resolve(e),!1)})),"f")}serializeKey(t){var e,n,r;return null!==(r=null===(n=(e=l.__classPrivateFieldGet(this,o,"f")).serializeKey)||void 0===n?void 0:n.call(e,t))&&void 0!==r?r:t}async enqueue(t,e,n){const i=new c.DeferredPromise;return l.__classPrivateFieldGet(this,a,"f").push([t,e,n,i]),l.__classPrivateFieldGet(this,r,"f")===h.Idle&&this.flush(),i}flush(){l.__classPrivateFieldSet(this,r,h.Processing,"f"),s.nextTick((async()=>{for(;l.__classPrivateFieldGet(this,a,"f").length&&l.__classPrivateFieldGet(this,r,"f")!==h.Closed;){const t=l.__classPrivateFieldGet(this,a,"f").shift();if(t){const[,,e,n]=t;try{const t=await e();n.resolve(t)}catch(t){n.reject(t)}}}l.__classPrivateFieldSet(this,r,h.Idle,"f")}))}},r=new WeakMap,i=new WeakMap,o=new WeakMap,a=new WeakMap},715:(t,e,n)=>{var r=e;r.utils=n(436),r.common=n(772),r.sha=n(41),r.ripemd=n(949),r.hmac=n(326),r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160},772:(t,e,n)=>{"use strict";var r=n(436),i=n(746);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=o,o.prototype.update=function(t,e){if(t=r.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,n=e-(t+this.padLength)%e,r=new Array(n+this.padLength);r[0]=128;for(var i=1;i<n;i++)r[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)r[i++]=0;r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=t>>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o<this.padLength;o++)r[i++]=0;return r}},326:(t,e,n)=>{"use strict";var r=n(436),i=n(746);function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(e,n))}t.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},949:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=r.rotl32,a=r.sum32,s=r.sum32_3,l=r.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(t,e,n,r){return t<=15?e^n^r:t<=31?e&n|~e&r:t<=47?(e|~n)^r:t<=63?e&r|n&~r:e^(n|~r)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function f(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}r.inherits(u,c),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(t,e){for(var n=this.h[0],r=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],v=n,S=r,O=i,y=c,I=u,T=0;T<80;T++){var A=a(o(l(n,h(T,r,i,c),t[p[T]+e],d(T)),g[T]),u);n=u,u=c,c=o(i,10),i=r,r=A,A=a(o(l(v,h(79-T,S,O,y),t[_[T]+e],f(T)),E[T]),I),v=I,I=y,y=o(O,10),O=S,S=A}A=s(this.h[1],i,y),this.h[1]=s(this.h[2],c,I),this.h[2]=s(this.h[3],u,v),this.h[3]=s(this.h[4],n,S),this.h[4]=s(this.h[0],r,O),this.h[0]=A},u.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"little"):r.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},41:(t,e,n)=>{"use strict";e.sha1=n(761),e.sha224=n(799),e.sha256=n(344),e.sha384=n(978),e.sha512=n(900)},761:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(38),a=r.rotl32,s=r.sum32,l=r.sum32_5,c=o.ft_1,u=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}r.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=a(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],d=this.h[3],f=this.h[4];for(r=0;r<n.length;r++){var p=~~(r/20),_=l(a(i,5),c(p,o,u,d),f,n[r],h[p]);f=d,d=u,u=a(o,30),o=i,i=_}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],f)},d.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},799:(t,e,n)=>{"use strict";var r=n(436),i=n(344);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}r.inherits(o,i),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}},344:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(38),a=n(746),s=r.sum32,l=r.sum32_4,c=r.sum32_5,u=o.ch32,h=o.maj32,d=o.s0_256,f=o.s1_256,p=o.g0_256,_=o.g1_256,g=i.BlockHash,E=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E,this.W=new Array(64)}r.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var n=this.W,r=0;r<16;r++)n[r]=t[e+r];for(;r<n.length;r++)n[r]=l(_(n[r-2]),n[r-7],p(n[r-15]),n[r-16]);var i=this.h[0],o=this.h[1],g=this.h[2],E=this.h[3],v=this.h[4],S=this.h[5],O=this.h[6],y=this.h[7];for(a(this.k.length===n.length),r=0;r<n.length;r++){var I=c(y,f(v),u(v,S,O),this.k[r],n[r]),T=s(d(i),h(i,o,g));y=O,O=S,S=v,v=s(E,I),E=g,g=o,o=i,i=s(I,T)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],E),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],S),this.h[6]=s(this.h[6],O),this.h[7]=s(this.h[7],y)},v.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},978:(t,e,n)=>{"use strict";var r=n(436),i=n(900);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}r.inherits(o,i),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}},900:(t,e,n)=>{"use strict";var r=n(436),i=n(772),o=n(746),a=r.rotr64_hi,s=r.rotr64_lo,l=r.shr64_hi,c=r.shr64_lo,u=r.sum64,h=r.sum64_hi,d=r.sum64_lo,f=r.sum64_4_hi,p=r.sum64_4_lo,_=r.sum64_5_hi,g=r.sum64_5_lo,E=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function S(){if(!(this instanceof S))return new S;E.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function O(t,e,n,r,i){var o=t&n^~t&i;return o<0&&(o+=4294967296),o}function y(t,e,n,r,i,o){var a=e&r^~e&o;return a<0&&(a+=4294967296),a}function I(t,e,n,r,i){var o=t&n^t&i^n&i;return o<0&&(o+=4294967296),o}function T(t,e,n,r,i,o){var a=e&r^e&o^r&o;return a<0&&(a+=4294967296),a}function A(t,e){var n=a(t,e,28)^a(e,t,2)^a(e,t,7);return n<0&&(n+=4294967296),n}function C(t,e){var n=s(t,e,28)^s(e,t,2)^s(e,t,7);return n<0&&(n+=4294967296),n}function m(t,e){var n=a(t,e,14)^a(t,e,18)^a(e,t,9);return n<0&&(n+=4294967296),n}function N(t,e){var n=s(t,e,14)^s(t,e,18)^s(e,t,9);return n<0&&(n+=4294967296),n}function w(t,e){var n=a(t,e,1)^a(t,e,8)^l(t,e,7);return n<0&&(n+=4294967296),n}function b(t,e){var n=s(t,e,1)^s(t,e,8)^c(t,e,7);return n<0&&(n+=4294967296),n}function P(t,e){var n=a(t,e,19)^a(e,t,29)^l(t,e,6);return n<0&&(n+=4294967296),n}function R(t,e){var n=s(t,e,19)^s(e,t,29)^c(t,e,6);return n<0&&(n+=4294967296),n}r.inherits(S,E),t.exports=S,S.blockSize=1024,S.outSize=512,S.hmacStrength=192,S.padLength=128,S.prototype._prepareBlock=function(t,e){for(var n=this.W,r=0;r<32;r++)n[r]=t[e+r];for(;r<n.length;r+=2){var i=P(n[r-4],n[r-3]),o=R(n[r-4],n[r-3]),a=n[r-14],s=n[r-13],l=w(n[r-30],n[r-29]),c=b(n[r-30],n[r-29]),u=n[r-32],h=n[r-31];n[r]=f(i,o,a,s,l,c,u,h),n[r+1]=p(i,o,a,s,l,c,u,h)}},S.prototype._update=function(t,e){this._prepareBlock(t,e);var n=this.W,r=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],l=this.h[4],c=this.h[5],f=this.h[6],p=this.h[7],E=this.h[8],v=this.h[9],S=this.h[10],w=this.h[11],b=this.h[12],P=this.h[13],R=this.h[14],L=this.h[15];o(this.k.length===n.length);for(var D=0;D<n.length;D+=2){var U=R,M=L,k=m(E,v),j=N(E,v),B=O(E,v,S,w,b),F=y(E,v,S,w,b,P),x=this.k[D],K=this.k[D+1],V=n[D],$=n[D+1],G=_(U,M,k,j,B,F,x,K,V,$),W=g(U,M,k,j,B,F,x,K,V,$);U=A(r,i),M=C(r,i),k=I(r,i,a,s,l),j=T(r,i,a,s,l,c);var H=h(U,M,k,j),q=d(U,M,k,j);R=b,L=P,b=S,P=w,S=E,w=v,E=h(f,p,G,W),v=d(p,p,G,W),f=l,p=c,l=a,c=s,a=r,s=i,r=h(G,W,H,q),i=d(G,W,H,q)}u(this.h,0,r,i),u(this.h,2,a,s),u(this.h,4,l,c),u(this.h,6,f,p),u(this.h,8,E,v),u(this.h,10,S,w),u(this.h,12,b,P),u(this.h,14,R,L)},S.prototype._digest=function(t){return"hex"===t?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},38:(t,e,n)=>{"use strict";var r=n(436).rotr32;function i(t,e,n){return t&e^~t&n}function o(t,e,n){return t&e^t&n^e&n}function a(t,e,n){return t^e^n}e.ft_1=function(t,e,n,r){return 0===t?i(e,n,r):1===t||3===t?a(e,n,r):2===t?o(e,n,r):void 0},e.ch32=i,e.maj32=o,e.p32=a,e.s0_256=function(t){return r(t,2)^r(t,13)^r(t,22)},e.s1_256=function(t){return r(t,6)^r(t,11)^r(t,25)},e.g0_256=function(t){return r(t,7)^r(t,18)^t>>>3},e.g1_256=function(t){return r(t,17)^r(t,19)^t>>>10}},436:(t,e,n)=>{"use strict";var r=n(746),i=n(717);function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function l(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)n.push(parseInt(t[i]+t[i+1],16))}else for(var r=0,i=0;i<t.length;i++){var a=t.charCodeAt(i);a<128?n[r++]=a:a<2048?(n[r++]=a>>6|192,n[r++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i<t.length;i++)n[i]=0|t[i];return n},e.toHex=function(t){for(var e="",n=0;n<t.length;n++)e+=s(t[n].toString(16));return e},e.htonl=a,e.toHex32=function(t,e){for(var n="",r=0;r<t.length;r++){var i=t[r];"little"===e&&(i=a(i)),n+=l(i.toString(16))}return n},e.zero2=s,e.zero8=l,e.join32=function(t,e,n,i){var o=n-e;r(o%4==0);for(var a=new Array(o/4),s=0,l=e;s<a.length;s++,l+=4){var c;c="big"===i?t[l]<<24|t[l+1]<<16|t[l+2]<<8|t[l+3]:t[l+3]<<24|t[l+2]<<16|t[l+1]<<8|t[l],a[s]=c>>>0}return a},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r<t.length;r++,i+=4){var o=t[r];"big"===e?(n[i]=o>>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,i){return t+e+n+r+i>>>0},e.sum64=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o<r?1:0)+n+i;t[e]=a>>>0,t[e+1]=o},e.sum64_hi=function(t,e,n,r){return(e+r>>>0<e?1:0)+t+n>>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,i,o,a,s){var l=0,c=e;return l+=(c=c+r>>>0)<e?1:0,l+=(c=c+o>>>0)<o?1:0,t+n+i+a+(l+=(c=c+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,n,r,i,o,a,s){return e+r+o+s>>>0},e.sum64_5_hi=function(t,e,n,r,i,o,a,s,l,c){var u=0,h=e;return u+=(h=h+r>>>0)<e?1:0,u+=(h=h+o>>>0)<o?1:0,u+=(h=h+s>>>0)<s?1:0,t+n+i+a+l+(u+=(h=h+c>>>0)<c?1:0)>>>0},e.sum64_5_lo=function(t,e,n,r,i,o,a,s,l,c){return e+r+o+s+c>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},245:(t,e,n)=>{"use strict";function r(t){this.message=t}n.r(e),n.d(e,{InvalidTokenError:()=>a,default:()=>s}),r.prototype=new Error,r.prototype.name="InvalidCharacterError";var i="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new r("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,o=0,a=0,s="";i=e.charAt(a++);~i&&(n=o%4?64*n+i:i,o++%4)?s+=String.fromCharCode(255&n>>(-2*o&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return s};function o(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return function(t){return decodeURIComponent(i(t).replace(/(.)/g,(function(t,e){var n=e.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(e)}catch(t){return i(e)}}function a(t){this.message=t}a.prototype=new Error,a.prototype.name="InvalidTokenError";const s=function(t,e){if("string"!=typeof t)throw new a("Invalid token specified");var n=!0===(e=e||{}).header?0:1;try{return JSON.parse(o(t.split(".")[n]))}catch(t){throw new a("Invalid token specified: "+t.message)}}},746:t=>{function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},155:t=>{var e,n,r=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(n){try{return e.call(null,t,0)}catch(n){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var s,l=[],c=!1,u=-1;function h(){c&&s&&(c=!1,s.length?l=s.concat(l):u=-1,l.length&&d())}function d(){if(!c){var t=a(h);c=!0;for(var e=l.length;e;){for(s=l,l=[];++u<e;)s&&s[u].run();u=-1,e=l.length}s=null,c=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{return n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function p(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];l.push(new f(t,e)),1!==l.length||c||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},655:(t,e,n)=>{"use strict";n.r(e),n.d(e,{__assign:()=>o,__asyncDelegator:()=>y,__asyncGenerator:()=>O,__asyncValues:()=>I,__await:()=>S,__awaiter:()=>u,__classPrivateFieldGet:()=>N,__classPrivateFieldSet:()=>w,__createBinding:()=>d,__decorate:()=>s,__exportStar:()=>f,__extends:()=>i,__generator:()=>h,__importDefault:()=>m,__importStar:()=>C,__makeTemplateObject:()=>T,__metadata:()=>c,__param:()=>l,__read:()=>_,__rest:()=>a,__spread:()=>g,__spreadArray:()=>v,__spreadArrays:()=>E,__values:()=>p});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},o.apply(this,arguments)};function a(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function s(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,r){e(n,r,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function h(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var d=Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]};function f(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||d(e,t,n)}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(_(arguments[e]));return t}function E(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function v(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function S(t){return this instanceof S?(this.v=t,this):new S(t)}function O(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(t){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||s(t,e)}))})}function s(t,e){try{(n=i[t](e)).value instanceof S?Promise.resolve(n.value.v).then(l,c):u(o[0][2],n)}catch(t){u(o[0][3],t)}var n}function l(t){s("next",t)}function c(t){s("throw",t)}function u(t,e){t(e),o.shift(),o.length&&s(o[0][0],o[0][1])}}function y(t){var e,n;return e={},r("next"),r("throw",(function(t){throw t})),r("return"),e[Symbol.iterator]=function(){return this},e;function r(r,i){e[r]=t[r]?function(e){return(n=!n)?{value:S(t[r](e)),done:"return"===r}:i?i(e):e}:i}}function I(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=p(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}function T(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var A=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function C(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&d(e,t,n);return A(e,t),e}function m(t){return t&&t.__esModule?t:{default:t}}function N(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}function w(t,e,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(t,n):i?i.value=n:e.set(t,n),n}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r=n(56);module.exports=r})();
|
package/package.json
CHANGED
package/.env-prod
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# default endpoints
|
|
2
|
-
CDN_PUBLIC_URL=https://cdn.useparagon.com
|
|
3
|
-
CONNECT_PUBLIC_URL=https://connect.useparagon.com
|
|
4
|
-
DASHBOARD_PUBLIC_URL=https://dashboard.useparagon.com
|
|
5
|
-
PASSPORT_PUBLIC_URL=https://passport.useparagon.com
|
|
6
|
-
ZEUS_PUBLIC_URL=https://zeus.useparagon.com
|
|
7
|
-
|
|
8
|
-
ASSET_VERSION=latest
|
|
9
|
-
PLATFORM_ENV=production
|