@rebilly/instruments 3.15.0-beta.0 → 3.15.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ var Br=function(e,t,n){for(var r in e)if(!1===t.call(n,e[r],r,e))break},_r=Objec
|
|
|
43
43
|
*
|
|
44
44
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
45
45
|
* Released under the MIT License.
|
|
46
|
-
*/function Wr(e,t){switch(Nr(e)){case"object":return function(e,t){if(zr(e)){var n={};return Ur(e,(function(e,n){this[n]=Wr(e,t)}),n),n}return t?t(e):e}(e,t);case"array":return function(e,t){var n=e.length,r=[],a=-1;for(;++a<n;)r[a]=Wr(e[a],t);return r}(e,t);default:return Dr(e)}}var Vr=Wr;class Gr{constructor({id:e=null,created:t=null}={}){this.id=e||((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})(),this.created=t||(new Date).getTime(),this.cancelSource=yr.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,vr(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class Kr{constructor(){if(Kr.instance)return Kr.instance;this.requests={},Kr.instance=this}getAll(){return Object.values(this.requests)}getById(e){return this.requests[e]}deleteById(e){this.requests[e]&&delete this.requests[e]}save(){const e=new Gr;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var Jr=new Kr;class Xr{}Mt(Xr,"cancelById",((e,t)=>{try{Jr.getById(e).cancel(t),Jr.deleteById(e)}catch(e){}})),Mt(Xr,"cancelAll",(e=>Jr.getAll().forEach((t=>{t.cancel(e),Jr.deleteById(t.id)}))));var Zr=(...e)=>Xr.cancelAll(...e);const Yr={request:"request",response:"response"},Qr=e=>{if(!Object.values(Yr).includes(e))throw new Error(`There is no such interceptor type as "${e}"`);return!0};function ea({options:e}){const t=yr.create({baseURL:n(),timeout:e.requestTimeout,headers:r()});function n(){let t=e.isSandbox?e.apiEndpoints.sandbox:e.apiEndpoints.live;return e.apiVersion&&(t=`${t}/${e.apiVersion}`),e.organizationId&&(t=`${t}/organizations/${e.organizationId}`),`${t}`}function r(){const t={"REB-API-CONSUMER":"RebillySDK/JS-SDK 47.5.0"};return e.apiKey&&(t["REB-APIKEY"]=e.apiKey),t}function a(){return Vr(t.defaults.headers)}function i(e,{thenDelegate:n,catchDelegate:r=(()=>{})}){return Qr(e)&&t.interceptors[Yr[e]].use(n,r)}function o(e,n){return Qr(e)&&t.interceptors[Yr[e]].eject(n)}function s({request:e,isCollection:t,config:n}){const r=u(n),{id:a,cancelToken:i}=Jr.save();r.cancelToken=i;const o=async function(){try{return function({response:e,isCollection:t,config:n}){if(t)return new xr(e,n);return new br(e,n)}({response:await e(r),isCollection:t,config:r})}catch(e){return l({error:e,config:r})}finally{Jr.deleteById(a)}}();return o.cancel=e=>Xr.cancelById(a,e),o}function l({error:e}){if(yr.isCancel(e))throw new Ar.RebillyCanceledError(e);if(e.response)switch(Number(e.response.status)){case 401:throw new Ar.RebillyForbiddenError(e);case 404:throw new Ar.RebillyNotFoundError(e);case 405:throw new Ar.RebillyMethodNotAllowedError(e);case 409:throw new Ar.RebillyConflictError(e);case 422:throw new Ar.RebillyValidationError(e);default:throw new Ar.RebillyRequestError(e)}if("ECONNABORTED"===e.code)throw new Ar.RebillyTimeoutError(e);throw new Ar.RebillyRequestError(e)}function u(e={}){const t=function(e){return void 0!==e.params&&(e.params=Object.keys(e.params).filter((t=>null!==e.params[t]&&""!==e.params[t])).reduce(((t,n)=>(t[n]=e.params[n],t)),{})),e}(e);return Rt({},t)}function c(e,n={}){return s({request:n=>t.get(e,n),config:{params:n}})}function d(e,n,r={}){let i={};return!1===r.authenticate&&(i={headers:a()},delete i.headers.common["REB-APIKEY"],delete i.headers.common.Authorization),r.params&&(i.params=Rt({},r.params)),s({request:r=>t.post(e,n,r),config:i})}function p(e,n,r={}){return s({request:r=>t.put(e,n,r),config:{params:r}})}return{getInstance:function(){return t},addRequestInterceptor:function({thenDelegate:e,catchDelegate:t=(()=>{})}){return i(Yr.request,{thenDelegate:e,catchDelegate:t})},removeRequestInterceptor:function(e){o(Yr.request,e)},addResponseInterceptor:function({thenDelegate:e,catchDelegate:t=(()=>{})}){return i(Yr.response,{thenDelegate:e,catchDelegate:t})},removeResponseInterceptor:function(e){o(Yr.response,e)},setTimeout:function(n){e.requestTimeout=Number(n),t.defaults.timeout=e.requestTimeout},setProxyAgent:function({host:e,port:n,auth:r}){t.defaults.proxy={host:e,port:n,auth:r}},setSessionToken:function(n=e.jwt){const r=a();e.apiKey=null,e.jwt=n,delete r.common["REB-APIKEY"],r.common.Authorization=`Bearer ${n}`,t.defaults.headers=r},setPublishableKey:function(n=e.publishableKey){const r=a();e.publishableKey=n,r.common.Authorization=`${n}`,t.defaults.headers=r},setEndpoints:function({live:r=null,sandbox:a=null}){r&&(e.apiEndpoints.live=r),a&&(e.apiEndpoints.sandbox=a),t.defaults.baseURL=n()},get:c,getAll:function(e,n){return s({request:n=>t.get(e,n),config:{params:n},isCollection:!0})},post:d,put:p,patch:function(e,n){return s({request:r=>t.patch(e,n,r),config:{}})},delete:function(e){return s({request:n=>t.delete(e,n),config:{}})},deleteAll:function(e,n){return s({request:n=>t.delete(e,n),config:{data:Rt({},n)}})},create:async function(e,t,n,r={}){if(""===t)return d(e,n,{params:r});try{if(200===(await c(e)).response.status)throw new Ar.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(t){if("RebillyNotFoundError"===t.name)return p(e,n,r);throw t}},download:async function(e,n){const r=u(n);try{const n=await t.get(e,r);return new kr(n,r)}catch(e){return l({error:e,config:r})}}}}const ta={Accept:"text/csv"},na={Accept:"application/pdf"};class ra{constructor({apiHandler:e}){this.account=function({apiHandler:e}){return{activate:({token:t})=>e.post(`activation/${t}`,{authenticate:!1}),forgotPassword:({data:t})=>e.post("forgot-password",t,{authenticate:!1}),logout:()=>e.post("logout"),signIn:({data:t})=>e.post("signin",t,{authenticate:!1}),signUp:({data:t})=>e.post("signup",t,{authenticate:!1})}}({apiHandler:e}),this.aml=function({apiHandler:e}){return{getAll({firstName:t,lastName:n,dob:r=null,country:a=null}){const i={firstName:t,lastName:n,dob:r,country:a};return e.getAll("aml",i)}}}({apiHandler:e}),this.apiKeys=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null}={}){const a={limit:t,offset:n,sort:r};return e.getAll("api-keys",a)},create:({id:t="",data:n})=>e.create(`api-keys/${t}`,t,n),get:({id:t})=>e.get(`api-keys/${t}`),update:({id:t,data:n})=>e.put(`api-keys/${t}`,n),delete:({id:t})=>e.delete(`api-keys/${t}`)}}({apiHandler:e}),this.applicationInstances=function({apiHandler:e}){return{get:({applicationId:t})=>e.get(`application-instances/${t}`),upsert:({applicationId:t,data:n})=>e.put(`application-instances/${t}`,n),delete:({applicationId:t})=>e.delete(`application-instances/${t}`)}}({apiHandler:e}),this.applications=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("applications",l)},create:({data:t})=>e.post("applications",t),get:({id:t})=>e.get(`applications/${t}`),getInstances:({id:t})=>e.getAll(`applications/${t}/instances`),getInstance:({id:t,organizationId:n})=>e.get(`applications/${t}/instances/${n}`)}}({apiHandler:e}),this.balanceTransactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("balance-transactions",r)},get:({id:t})=>e.get(`balance-transactions/${t}`)}}({apiHandler:e}),this.billingPortals=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("billing-portals",o)},create:({id:t="",data:n})=>e.create(`billing-portals/${t}`,t,n),get:({id:t})=>e.get(`billing-portals/${t}`),update:({id:t,data:n})=>e.put(`billing-portals/${t}`,n),delete:({id:t})=>e.delete(`billing-portals/${t}`)}}({apiHandler:e}),this.blocklists=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("blocklists",o)},create:({id:t="",data:n})=>e.create(`blocklists/${t}`,t,n),get:({id:t})=>e.get(`blocklists/${t}`),delete:({id:t})=>e.delete(`blocklists/${t}`)}}({apiHandler:e}),this.broadcastMessages=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null}={}){const i={limit:t,offset:n,sort:r,filter:a};return e.getAll("broadcast-messages",i)},create:({data:t})=>e.post("broadcast-messages",t),get:({id:t})=>e.get(`broadcast-messages/${t}`),delete:({id:t})=>e.delete(`broadcast-messages/${t}`),update:({id:t,data:n})=>e.patch(`broadcast-messages/${t}`,n)}}({apiHandler:e}),this.checkoutForms=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("checkout-forms",o)},create:({id:t="",data:n})=>e.create(`checkout-forms/${t}`,t,n),get:({id:t})=>e.get(`checkout-forms/${t}`),update:({id:t,data:n})=>e.put(`checkout-forms/${t}`,n),delete:({id:t})=>e.delete(`checkout-forms/${t}`)}}({apiHandler:e}),this.coupons=function({apiHandler:e}){return{getAllRedemptions({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("coupons-redemptions",o)},redeem:({data:t})=>e.post("coupons-redemptions",t),getRedemption:({id:t})=>e.get(`coupons-redemptions/${t}`),cancelRedemption:({id:t})=>e.post(`coupons-redemptions/${t}/cancel`),getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("coupons",o)},create:({id:t="",data:n})=>e.create(`coupons/${t}`,t,n),get:({id:t})=>e.get(`coupons/${t}`),update:({id:t,data:n})=>e.put(`coupons/${t}`,n),setExpiration:({id:t,data:n})=>e.post(`coupons/${t}/expiration`,n)}}({apiHandler:e}),this.credentialHashes=function({apiHandler:e}){return{createAWSSESCredential:({data:t})=>e.post("credential-hashes/aws-ses",t),getAWSSESCredential:({hash:t})=>e.get(`credential-hashes/aws-ses/${t}`),updateAWSSESCredential:({hash:t,data:n})=>e.patch(`credential-hashes/aws-ses/${t}`,n),createEmailCredential:({data:t})=>e.post("credential-hashes/emails",t),getEmailCredential:({hash:t})=>e.get(`credential-hashes/emails/${t}`),patchEmailCredential:({hash:t,data:n})=>e.patch(`credential-hashes/emails/${t}`,n),createMailgunCredential:({data:t})=>e.post("credential-hashes/mailgun",t),getMailgunCredential:({hash:t})=>e.get(`credential-hashes/mailgun/${t}`),patchMailgunCredential:({hash:t,data:n})=>e.patch(`credential-hashes/mailgun/${t}`,n),getAllOAuth2Credentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/oauth2",o)},createOAuth2Credential:({data:t})=>e.post("credential-hashes/oauth2",t),getOAuth2Credential:({hash:t})=>e.get(`credential-hashes/oauth2/${t}`),updateOAuth2Credential:({hash:t,data:n})=>e.patch(`credential-hashes/oauth2/${t}`,n),getOAuth2CredentialItems({hash:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,fields:o=null,sort:s=null}){const l={limit:n,offset:r,filter:a,q:i,fields:o,sort:s};return e.getAll(`credential-hashes/oauth2/${t}/items`,l)},getAllPlaidCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/plaid",o)},createPlaidCredential:({data:t})=>e.post("credential-hashes/plaid",t),getPlaidCredential:({hash:t})=>e.get(`credential-hashes/plaid/${t}`),updatePlaidCredential:({hash:t,data:n})=>e.patch(`credential-hashes/plaid/${t}`,n),createPostmarkCredential:({data:t})=>e.post("credential-hashes/postmark",t),getPostmarkCredential:({hash:t})=>e.get(`credential-hashes/postmark/${t}`),patchPostmarkCredential:({hash:t,data:n})=>e.patch(`credential-hashes/postmark/${t}`,n),createSendGridCredential:({data:t})=>e.post("credential-hashes/sendgrid",t),getSendGridCredential:({hash:t})=>e.get(`credential-hashes/sendgrid/${t}`),patchSendGridCredential:({hash:t,data:n})=>e.patch(`credential-hashes/sendgrid/${t}`,n),createWebhookCredential:({data:t})=>e.post("credential-hashes/webhooks",t),getWebhookCredential:({hash:t})=>e.get(`credential-hashes/webhooks/${t}`),patchWebhookCredential:({hash:t,data:n})=>e.patch(`credential-hashes/webhooks/${t}`,n),getAllExperianCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/experian",o)},createExperianCredential:({data:t})=>e.post("credential-hashes/experian",t),getExperianCredential:({hash:t})=>e.get(`credential-hashes/experian/${t}`),updateExperianCredential:({hash:t,data:n})=>e.patch(`credential-hashes/experian/${t}`,n),getAllTaxJarCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/taxjar",o)},createTaxJarCredential:({data:t})=>e.post("credential-hashes/taxjar",t),getTaxJarCredential:({hash:t})=>e.get(`credential-hashes/taxjar/${t}`),updateTaxJarCredential:({hash:t,data:n})=>e.patch(`credential-hashes/taxjar/${t}`,n)}}({apiHandler:e}),this.customDomains=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("custom-domains",o)},create:({data:t})=>e.post("custom-domains",t),get:({domain:t})=>e.get(`custom-domains/${t}`),delete:({domain:t})=>e.delete(`custom-domains/${t}`)}}({apiHandler:e}),this.customFields=function({apiHandler:e}){return{getAll({resource:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.getAll(`custom-fields/${t}`,a)},get:({resource:t,name:n})=>e.get(`custom-fields/${t}/${n}`),create:({resource:t,name:n,data:r})=>e.put(`custom-fields/${t}/${n}`,r),update:({resource:t,name:n,data:r})=>e.put(`custom-fields/${t}/${n}`,r)}}({apiHandler:e}),this.customerAuthentication=function({apiHandler:e}){return{getAuthOptions:()=>e.get("authentication-options"),updateAuthOptions:({data:t})=>e.put("authentication-options",t),getAllAuthTokens({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("authentication-tokens",r)},login:({data:t})=>e.post("authentication-tokens",t),verify:({token:t})=>e.get(`authentication-tokens/${t}`),logout:({token:t})=>e.delete(`authentication-tokens/${t}`),exchangeToken:({token:t,data:n})=>e.post(`authentication-tokens/${t}/exchange`,n),getAllCredentials({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("credentials",r)},createCredential:({id:t="",data:n})=>e.create(`credentials/${t}`,t,n),getCredential:({id:t})=>e.get(`credentials/${t}`),updateCredential:({id:t,data:n})=>e.put(`credentials/${t}`,n),deleteCredential:({id:t})=>e.delete(`credentials/${t}`),getAllResetPasswordTokens({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("password-tokens",r)},createResetPasswordToken:({data:t})=>e.post("password-tokens",t),getResetPasswordToken:({id:t})=>e.get(`password-tokens/${t}`),deleteResetPasswordToken:({id:t})=>e.delete(`password-tokens/${t}`)}}({apiHandler:e}),this.customers=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("customers",l)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`customers/${t}`,t,n,a)},get({id:t,expand:n=null,fields:r=null}){const a={expand:n,fields:r};return e.get(`customers/${t}`,a)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`customers/${t}`,n,a)},merge:({id:t,targetCustomerId:n})=>e.delete(`customers/${t}?targetCustomerId=${n}`),getAml:({id:t})=>e.getAll(`customers/${t}/aml`),getLeadSource:({id:t})=>e.get(`customers/${t}/lead-source`),createLeadSource:({id:t,data:n})=>e.put(`customers/${t}/lead-source`,n),updateLeadSource:({id:t,data:n})=>e.put(`customers/${t}/lead-source`,n),deleteLeadSource:({id:t})=>e.delete(`customers/${t}/lead-source`),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`customers/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`customers/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`customers/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`customers/${t}/timeline/${n}`),getAllUpcomingInvoices({id:t,expand:n=null}){const r={expand:n};return e.getAll(`customers/${t}/upcoming-invoices`,r)},getCustomerEddScore:({id:t})=>e.get(`customers/${t}/edd-score`),patchCustomerEddScore:({id:t,data:n})=>e.patch(`customers/${t}/edd-score`,n),getEddTimelineCollection({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`customers/${t}/edd-timeline`,s)},createEddTimelineComment:({id:t,data:n})=>e.post(`customers/${t}/edd-timeline`,n),GetEddSearchResults:({id:t})=>e.get(`customers/${t}/edd-search-results`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("customers",s)}}}({apiHandler:e}),this.digitalWallets=function({apiHandler:e}){return{create:({data:t})=>e.post("digital-wallets/onboarding/apple-pay",t),validate:({data:t})=>e.post("digital-wallets/validation",t)}}({apiHandler:e}),this.disputes=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("disputes",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`disputes/${t}`,t,n,a)},get:({id:t})=>e.get(`disputes/${t}`),update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`disputes/${t}`,n,a)},downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("disputes",s)}}}({apiHandler:e}),this.emailDeliverySettings=function({apiHandler:e}){return{verify:({token:t})=>e.put(`email-delivery-setting-verifications/${t}`),getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null}={}){const o={limit:t,offset:n,filter:r,sort:a,q:i};return e.getAll("email-delivery-settings",o)},create:({data:t})=>e.post("email-delivery-settings",t),get:({id:t})=>e.get(`email-delivery-settings/${t}`),delete:({id:t})=>e.delete(`email-delivery-settings/${t}`),update:({id:t,data:n})=>e.patch(`email-delivery-settings/${t}`,n),resendVerification:({id:t})=>e.post(`email-delivery-settings/${t}/resend-email-verification`)}}({apiHandler:e}),this.emailMessages=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,q:r=null,sort:a=null,filter:i=null}={}){const o={limit:t,offset:n,q:r,sort:a,filter:i};return e.getAll("email-messages",o)},create:({data:t})=>e.post("email-messages",t),get:({id:t})=>e.get(`email-messages/${t}`),delete:({id:t})=>e.delete(`email-messages/${t}`),send:({id:t,data:n={status:"outbox"}})=>e.patch(`email-messages/${t}`,n)}}({apiHandler:e}),this.emailNotifications=function({apiHandler:e}){return{getAll:()=>e.getAll("email-notifications")}}({apiHandler:e}),this.events=function({apiHandler:e}){return{getAll:()=>e.getAll("events"),get:({eventType:t})=>e.get(`events/${t}`),getRules:({eventType:t})=>e.get(`events/${t}/rules`),createRules:({eventType:t,data:n})=>e.put(`events/${t}/rules`,n),updateRules:({eventType:t,data:n})=>e.put(`events/${t}/rules`,n),getAllTimelineMessages({eventType:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`events/${t}/timeline`,s)},createTimelineComment:({eventType:t,data:n})=>e.post(`events/${t}/timeline`,n),getTimelineMessage:({eventType:t,messageId:n})=>e.get(`events/${t}/timeline/${n}`),deleteTimelineMessage:({eventType:t,messageId:n})=>e.delete(`events/${t}/timeline/${n}`),getRulesHistory({eventType:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,sort:o=null,fields:s=null,expand:l=null}){const u={limit:n,offset:r,filter:a,q:i,sort:o,fields:s,expand:l};return e.getAll(`events/${t}/rules/history`,u)},getRulesVersionNumber({eventType:t,version:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/history/${n}`,i)},getRulesVersionDetail({eventType:t,version:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/versions/${n}`,i)},getAllDraftRulesets({eventType:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,sort:o=null,fields:s=null,expand:l=null}){const u={limit:n,offset:r,filter:a,q:i,sort:o,fields:s,expand:l};return e.getAll(`events/${t}/rules/drafts`,u)},createDraftRuleset:({eventType:t,data:n})=>e.post(`events/${t}/rules/drafts`,n),getDraftRuleset({eventType:t,id:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/drafts/${n}`,i)},updateDraftRuleset:({eventType:t,id:n,data:r})=>e.put(`events/${t}/rules/drafts/${n}`,r),deleteDraftRuleset:({eventType:t,id:n})=>e.delete(`events/${t}/rules/drafts/${n}`)}}({apiHandler:e}),this.fees=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("fees",r)},create:({id:t="",data:n})=>e.create(`fees/${t}`,t,n),get:({id:t})=>e.get(`fees/${t}`),upsert:({id:t,data:n})=>e.put(`fees/${t}`,n),patch:({id:t,data:n})=>e.patch(`fees/${t}`,n)}}({apiHandler:e}),this.files=function({apiHandler:e}){return{getAllAttachments({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("attachments",l)},attach({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`attachments/${t}`,t,n,a)},getAttachment:({id:t})=>e.get(`attachments/${t}`),updateAttachment({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`attachments/${t}`,n,a)},detach:({id:t})=>e.delete(`attachments/${t}`),getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("files",l)},upload:({fileObject:t})=>e.post("files",t),get:({id:t})=>e.get(`files/${t}`),update:({id:t,data:n})=>e.put(`files/${t}`,n),delete:({id:t})=>e.delete(`files/${t}`),download:({id:t})=>e.download(`files/${t}/download`,{responseType:"arraybuffer"}),detachAndDelete({id:t}){const n={filter:`fileId:${t}`};let r=[];const a=(async()=>{const a=this.getAllAttachments(n);r.push(a);const i=(await a).items.map((e=>this.detach({id:e.fields.id})));r=[...r,i],await Promise.all(i);const o=e.delete(`files/${t}`);return r.push(o),o})();return a.cancel=()=>{r.forEach((e=>e.cancel()))},a},uploadAndUpdate({fileObject:e,data:t={description:"",tags:[""]}}){const n=[],r=(async()=>{const r=this.upload({fileObject:e});n.push(r),await r;const a={name:r.name,extension:r.extension,description:t.description,tags:t.tags,url:""},i=this.update({id:r.fields.id,data:a});return n.push(i),i})();return r.cancel=()=>{n.forEach((e=>e.cancel()))},r}}}({apiHandler:e}),this.gatewayAccounts=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null,fields:o=null}={}){const s={limit:t,offset:n,sort:r,filter:a,q:i,fields:o};return e.getAll("gateway-accounts",s)},create:({id:t="",data:n})=>e.create(`gateway-accounts/${t}`,t,n),get:({id:t})=>e.get(`gateway-accounts/${t}`),update:({id:t,data:n})=>e.patch(`gateway-accounts/${t}`,n),delete:({id:t})=>e.delete(`gateway-accounts/${t}`),close:({id:t})=>e.post(`gateway-accounts/${t}/close`),disable:({id:t})=>e.post(`gateway-accounts/${t}/disable`),getAllDowntimeSchedules({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null}){const o={limit:n,offset:r,filter:a,sort:i};return e.getAll(`gateway-accounts/${t}/downtime-schedules`,o)},createDowntimeSchedule:({id:t,data:n})=>e.post(`gateway-accounts/${t}/downtime-schedules`,n),getDowntimeSchedule:({id:t,downtimeId:n})=>e.get(`gateway-accounts/${t}/downtime-schedules/${n}`),updateDowntimeSchedule:({id:t,downtimeId:n,data:r})=>e.put(`gateway-accounts/${t}/downtime-schedules/${n}`,r),deleteDowntimeSchedule:({id:t,downtimeId:n})=>e.delete(`gateway-accounts/${t}/downtime-schedules/${n}`),enable:({id:t})=>e.post(`gateway-accounts/${t}/enable`),getAllVolumeLimits:({id:t})=>e.getAll(`gateway-accounts/${t}/limits`),getVolumeLimit:({id:t,limitId:n})=>e.get(`gateway-accounts/${t}/limits/${n}`),updateVolumeLimit:({id:t,limitId:n,data:r})=>e.put(`gateway-accounts/${t}/limits/${n}`,r),deleteVolumeLimit:({id:t,limitId:n})=>e.delete(`gateway-accounts/${t}/limits/${n}`),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`gateway-accounts/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`gateway-accounts/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`gateway-accounts/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`gateway-accounts/${t}/timeline/${n}`),checkCredentials:({id:t})=>e.post(`gateway-accounts/${t}/check-credentials`),getFinancialSettings:({id:t})=>e.get(`gateway-accounts/${t}/financial-settings`),setFinancialSettings:({id:t,data:n})=>e.put(`gateway-accounts/${t}/financial-settings`,n)}}({apiHandler:e}),this.integrations=function({apiHandler:e}){return{getAll:()=>e.getAll("integrations"),get:({label:t})=>e.get(`integrations/${t}`)}}({apiHandler:e}),this.invoices=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("invoices",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`invoices/${t}`,t,n,a)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`invoices/${t}`,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`invoices/${t}`,n,a)},getAllInvoiceItems({id:t,limit:n=null,offset:r=null,expand:a=null}){const i={limit:n,offset:r,expand:a};return e.getAll(`invoices/${t}/items`,i)},createInvoiceItem:({id:t,data:n})=>e.post(`invoices/${t}/items`,n),getInvoiceItem:({id:t,itemId:n})=>e.get(`invoices/${t}/items/${n}`),updateInvoiceItem:({id:t,itemId:n,data:r})=>e.put(`invoices/${t}/items/${n}`,r),deleteInvoiceItem:({id:t,itemId:n})=>e.delete(`invoices/${t}/items/${n}`),issue:({id:t,data:n})=>e.post(`invoices/${t}/issue`,n),abandon:({id:t})=>e.post(`invoices/${t}/abandon`),void:({id:t})=>e.post(`invoices/${t}/void`),recalculate:({id:t})=>e.post(`invoices/${t}/recalculate`),reissue:({id:t,data:n})=>e.post(`invoices/${t}/reissue`,n),getAllTransactionAllocations({id:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.getAll(`invoices/${t}/transaction-allocations`,a)},applyTransaction:({id:t,data:n})=>e.post(`invoices/${t}/transaction`,n),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`invoices/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`invoices/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`invoices/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`invoices/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("invoices",s)},downloadPDF({id:t}){const n={headers:na,responseType:"arraybuffer"};return e.download(`invoices/${t}`,n)}}}({apiHandler:e}),this.kycDocuments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("kyc-documents",i)},create:({id:t="",data:n})=>e.create(`kyc-documents/${t}`,t,n),get:({id:t})=>e.get(`kyc-documents/${t}`),update:({id:t,data:n})=>e.put(`kyc-documents/${t}`,n),accept:({id:t})=>e.post(`kyc-documents/${t}/acceptance`),matches:({id:t,data:n})=>e.post(`kyc-documents/${t}/matches`,n),reject:({id:t,data:n})=>e.post(`kyc-documents/${t}/rejection`,n),review:({id:t})=>e.post(`kyc-documents/${t}/review`),startReview:({id:t})=>e.post(`kyc-documents/${t}/start-review`),stopReview:({id:t})=>e.post(`kyc-documents/${t}/stop-review`)}}({apiHandler:e}),this.kycRequests=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("kyc-requests",i)},create:({data:t})=>e.post("kyc-requests",t),get:({id:t})=>e.get(`kyc-requests/${t}`),delete:({id:t})=>e.delete(`kyc-requests/${t}`),update:({id:t,data:n})=>e.patch(`kyc-requests/${t}`,n)}}({apiHandler:e}),this.kycSettings=function({apiHandler:e}){return{updateKycSettings:({data:t})=>e.put("kyc-settings",t)}}({apiHandler:e}),this.lists=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,fields:i=null,q:o=null}={}){const s={limit:t,offset:n,filter:r,sort:a,fields:i,q:o};return e.getAll("lists",s)},create:({id:t="",data:n})=>e.create(`lists/${t}`,t,n),getLatestVersion:({id:t})=>e.get(`lists/${t}`),update:({id:t,data:n})=>e.put(`lists/${t}`,n),delete:({id:t})=>e.delete(`lists/${t}`),getByVersion:({id:t,version:n})=>e.get(`lists/${t}/${n}`)}}({apiHandler:e}),this.memberships=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("memberships",i)},get:({organizationId:t,userId:n})=>e.get(`memberships/${t}/${n}`),update:({organizationId:t,userId:n,data:r})=>e.put(`memberships/${t}/${n}`,r),delete:({organizationId:t,userId:n})=>e.delete(`memberships/${t}/${n}`)}}({apiHandler:e}),this.organizations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null}={}){const i={limit:t,offset:n,filter:r,q:a};return e.getAll("organizations",i)},create:({data:t})=>e.post("organizations",t),get:({id:t})=>e.get(`organizations/${t}`),update:({id:t,data:n})=>e.patch(`organizations/${t}`,n)}}({apiHandler:e}),this.paymentCardsBankNames=function({apiHandler:e}){return{getAll({limit:t=null,q:n=null}={}){const r={limit:t,q:n};return e.getAll("payment-cards-bank-names",r)}}}({apiHandler:e}),this.paymentInstruments=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("payment-instruments",s)},create:({data:t})=>e.post("payment-instruments",t),get:({id:t})=>e.get(`payment-instruments/${t}`),update:({id:t,data:n})=>e.patch(`payment-instruments/${t}`,n),deactivate:({id:t})=>e.post(`payment-instruments/${t}/deactivation`)}}({apiHandler:e}),this.paymentMethods=function({apiHandler:e}){return{getAll:()=>e.getAll("payment-methods"),get:({apiName:t})=>e.get(`payment-methods/${t}`)}}({apiHandler:e}),this.paymentTokens=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("tokens",r)},create:({data:t})=>e.post("tokens",t),get:({token:t})=>e.get(`tokens/${t}`)}}({apiHandler:e}),this.payouts=function({apiHandler:e}){return{create:({data:t})=>e.post("payouts",t)}}({apiHandler:e}),this.plans=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("plans",o)},create:({id:t="",data:n})=>e.create(`plans/${t}`,t,n),get:({id:t})=>e.get(`plans/${t}`),update:({id:t,data:n})=>e.put(`plans/${t}`,n),delete:({id:t})=>e.delete(`plans/${t}`)}}({apiHandler:e}),this.previews=function({apiHandler:e}){return{sendEmailRuleAction:({data:t})=>e.post("previews/rule-actions/send-email",t),triggerWebhookRuleAction:({data:t})=>e.post("previews/rule-actions/trigger-webhook",t),webhook:({data:t})=>e.post("previews/webhooks",t),order:({data:t})=>e.post("previews/orders",t)}}({apiHandler:e}),this.products=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("products",o)},create:({id:t="",data:n})=>e.create(`products/${t}`,t,n),get:({id:t})=>e.get(`products/${t}`),update:({id:t,data:n})=>e.put(`products/${t}`,n),delete:({id:t})=>e.delete(`products/${t}`)}}({apiHandler:e}),this.profile=function({apiHandler:e}){return{startPermissionsEmulation:({data:t})=>e.post("permissions-emulation",t),stopPermissionsEmulation:()=>e.delete("permissions-emulation"),get:()=>e.get("profile"),update:({data:t})=>e.put("profile",t),getMfa:()=>e.get("profile/mfa"),updateMfa:()=>e.post("profile/mfa"),deleteMfa:()=>e.delete("profile/mfa"),updatePassword:({data:t})=>e.post("profile/password",t),resetTotp:()=>e.post("profile/totp-reset")}}({apiHandler:e}),this.purchase=function({apiHandler:e}){return{readyToPay:({data:t})=>e.post("ready-to-pay",t)}}({apiHandler:e}),this.roles=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null,expand:o=null}={}){const s={limit:t,offset:n,filter:r,sort:a,q:i,expand:o};return e.getAll("roles",s)},create:({id:t="",data:n})=>e.create(`roles/${t}`,t,n),get({id:t,expand:n=null}){const r={expand:n};return e.get(`roles/${t}`,r)},update:({id:t,data:n})=>e.put(`roles/${t}`,n),delete:({id:t})=>e.delete(`roles/${t}`)}}({apiHandler:e}),this.search=function({apiHandler:e}){return{get({sort:t=null,limit:n=null,offset:r=null,q:a=null}){const i={sort:t,limit:n,offset:r,q:a};return e.get("search",i)}}}({apiHandler:e}),this.segments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("grid-segments",o)},create:({id:t="",data:n})=>e.create(`grid-segments/${t}`,t,n),get:({id:t})=>e.get(`grid-segments/${t}`),update:({id:t,data:n})=>e.put(`grid-segments/${t}`,n),delete:({id:t})=>e.delete(`grid-segments/${t}`)}}({apiHandler:e}),this.sendThroughAttribution=function({apiHandler:e}){return{getAll:({eventType:t})=>e.getAll(`send-through-attribution/${t}`)}}({apiHandler:e}),this.shippingRates=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null}={}){const o={limit:t,offset:n,filter:r,sort:a,q:i};return e.getAll("shipping-rates",o)},create:({id:t="",data:n})=>e.create(`shipping-rates/${t}`,t,n),get:({id:t})=>e.get(`shipping-rates/${t}`),update:({id:t,data:n})=>e.put(`shipping-rates/${t}`,n),delete:({id:t})=>e.delete(`shipping-rates/${t}`)}}({apiHandler:e}),this.status=function({apiHandler:e}){return{get:()=>e.get("status")}}({apiHandler:e}),this.subscriptionCancellations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-cancellations",i)},create:({id:t="",data:n})=>e.create(`subscription-cancellations/${t}`,t,n),get:({id:t})=>e.get(`subscription-cancellations/${t}`),delete:({id:t})=>e.delete(`subscription-cancellations/${t}`),patch:({id:t,data:n})=>e.patch(`subscription-cancellations/${t}`,n)}}({apiHandler:e}),this.subscriptionPauses=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-pauses",i)},pause:({id:t="",data:n})=>e.create(`subscription-pauses/${t}`,t,n),get:({id:t})=>e.get(`subscription-pauses/${t}`),update:({id:t,data:n})=>e.put(`subscription-pauses/${t}`,n),delete:({id:t})=>e.delete(`subscription-pauses/${t}`)}}({apiHandler:e}),this.subscriptionReactivations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-reactivations",i)},reactivate:({data:t})=>e.post("subscription-reactivations",t),get:({id:t})=>e.get(`subscription-reactivations/${t}`)}}({apiHandler:e}),this.subscriptions=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("subscriptions",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`subscriptions/${t}`,t,n,a)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`subscriptions/${t}`,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`subscriptions/${t}`,n,a)},delete:({id:t})=>e.delete(`subscriptions/${t}`),void:({id:t})=>e.post(`subscriptions/${t}/void`),changeItems:({id:t,data:n})=>e.post(`subscriptions/${t}/change-items`,n),createInterimInvoice:({id:t,data:n})=>e.post(`subscriptions/${t}/interim-invoice`,n),getAllUpcomingInvoices({id:t,expand:n=null}){const r={expand:n};return e.getAll(`subscriptions/${t}/upcoming-invoices`,r)},issueUpcomingInvoice:({id:t,invoiceId:n,data:r})=>e.post(`subscriptions/${t}/upcoming-invoices/${n}/issue`,r),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`subscriptions/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`subscriptions/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`subscriptions/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`subscriptions/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("subscriptions",s)}}}({apiHandler:e}),this.tags=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("tags",o)},create:({data:t})=>e.post("tags",t),get:({tag:t})=>e.get(`tags/${t}`),delete:({tag:t})=>e.delete(`tags/${t}`),update:({tag:t,data:n})=>e.patch(`tags/${t}`,n),tagCustomers:({tag:t,data:n})=>e.post(`tags/${t}/customers`,n),untagCustomers:({tag:t,data:n})=>e.delete(`tags/${t}/customers`,n),tagCustomer:({tag:t,customerId:n})=>e.post(`tags/${t}/customers/${n}`),untagCustomer:({tag:t,customerId:n})=>e.delete(`tags/${t}/customers/${n}`),tagKycDocuments:({tag:t,data:n})=>e.post(`tags/${t}/kyc-documents`,n),untagKycDocuments:({tag:t,data:n})=>e.delete(`tags/${t}/kyc-documents`,n),tagKycDocument:({tag:t,kycDocumentId:n})=>e.post(`tags/${t}/kyc-documents/${n}`),untagKycDocument:({tag:t,kycDocumentId:n})=>e.delete(`tags/${t}/kyc-documents/${n}`)}}({apiHandler:e}),this.tracking=function({apiHandler:e}){return{getAllApiLogs({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/api",o)},getApiLog:({id:t})=>e.get(`tracking/api/${t}`),getAllListsChangesHistory({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/webhooks",o)},getWebhookTrackingLog:({id:t})=>e.get(`tracking/webhooks/${t}`),resendWebhook:({id:t})=>e.post(`tracking/webhooks/${t}/resend`),downloadApiLogsCSV({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={params:{limit:t,offset:n,sort:r,filter:a,q:i},headers:ta};return e.download("tracking/api",o)}}}({apiHandler:e}),this.transactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null,expand:o=null}={}){const s={limit:t,offset:n,filter:r,q:a,sort:i,expand:o};return e.getAll("transactions",s)},create({data:t,expand:n=null}){const r={expand:n};return e.post("transactions",t,r)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`transactions/${t}`,r)},patch:({id:t,data:n})=>e.patch(`transactions/${t}`,n),query:({id:t})=>e.post(`transactions/${t}/query`),update:({id:t,data:n})=>e.post(`transactions/${t}/update`,n),refund:({id:t,data:n})=>e.post(`transactions/${t}/refund`,n),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null}){const i={limit:n,offset:r,filter:a};return e.getAll(`transactions/${t}/timeline`,i)},createTimelineComment:({id:t,data:n})=>e.post(`transactions/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`transactions/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`transactions/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("transactions",s)}}}({apiHandler:e}),this.users=function({apiHandler:e}){return{getResetPasswordToken:({token:t})=>e.get(`reset-password/${t}`),resetPassword:({token:t,data:n})=>e.post(`reset-password/${t}`,n),getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("users",o)},create:({id:t="",data:n})=>e.create(`users/${t}`,t,n),get:({id:t})=>e.get(`users/${t}`),update:({id:t,data:n})=>e.put(`users/${t}`,n),getMfa:({id:t})=>e.get(`users/${t}/mfa`),updatePassword:({id:t,data:n})=>e.post(`users/${t}/password`,n),resetTotp:({id:t})=>e.post(`users/${t}/totp-reset`)}}({apiHandler:e}),this.webhooks=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null}={}){const a={limit:t,offset:n,filter:r};return e.getAll("webhooks",a)},create:({id:t="",data:n})=>e.create(`webhooks/${t}`,t,n),get:({id:t})=>e.get(`webhooks/${t}`),update:({id:t,data:n})=>e.put(`webhooks/${t}`,n)}}({apiHandler:e}),this.websites=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,q:r=null,filter:a=null,sort:i=null}={}){const o={limit:t,offset:n,q:r,filter:a,sort:i};return e.getAll("websites",o)},create:({id:t="",data:n})=>e.create(`websites/${t}`,t,n),get:({id:t})=>e.get(`websites/${t}`),update:({id:t,data:n})=>e.put(`websites/${t}`,n),delete:({id:t})=>e.delete(`websites/${t}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("websites",s)}}}({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}const aa={CustomersResource:function({apiHandler:e}){return{getCustomerLifetimeSummaryMetrics({customerId:t=""}={}){const n={customerId:t};return e.get(`customers/${t}/summary-metrics`,n)}}},DataExportsResource:function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null,criteria:s=null}={}){const l={limit:t,offset:n,sort:r,expand:a,filter:i,q:o,criteria:s};return e.getAll("data-exports",l)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`data-exports/${t}`,r)},queue({data:t,expand:n=null}){const r={expand:n};return e.post("data-exports",t,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`data-exports/${t}`,n,a)},delete:({id:t})=>e.delete(`data-exports/${t}`)}},HistogramsResource:function({apiHandler:e}){return{getTransactionHistogramReport({periodStart:t="",periodEnd:n="",aggregationField:r="",aggregationPeriod:a="",metric:i="",filter:o=null,tz:s=null}={}){const l={periodStart:t,periodEnd:n,aggregationField:r,aggregationPeriod:a,metric:i,filter:o,tz:s};return e.get("histograms/transactions",l)}}},ReportsResource:function({apiHandler:e}){return{getApiLogSummary({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,tz:o=null}={}){const s={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,tz:o};return e.get("reports/api-log-summary",s)},getCumulativeSubscriptions({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/cumulative-subscriptions",u)},getDashboardMetrics({periodStart:t=null,periodEnd:n=null,tz:r=null,metrics:a=null,segments:i={}}={}){const o={periodStart:t,periodEnd:n,tz:r,segments:i,metrics:a};return e.getAll("reports/dashboard",o)},getDccMarkup({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,tz:s=null}={}){const l={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,tz:s};return e.get("reports/dcc-markup",l)},getDisputes({aggregationField:t,periodMonth:n,limit:r=null,offset:a=null,filter:i=null,tz:o=null}={}){const s={aggregationField:t,periodMonth:n,limit:r,offset:a,filter:i,tz:o};return e.get("reports/disputes",s)},getEventsTriggeredSummary({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/events-triggered",o)},getFutureRenewals({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/future-renewals",o)},getKycAcceptanceSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-acceptance-summary",r)},getKycRejectionSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-rejection-summary",r)},getKycRequestSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-request-summary",r)},getMonthlyRecurringRevenue({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/monthly-recurring-revenue",o)},getRulesMatchedSummary({eventType:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,tz:o=null}={}){const s={periodStart:n,periodEnd:r,limit:a,offset:i,tz:o};return e.get(`reports/events-triggered/${t}/rules`,s)},getRenewalSales({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/renewal-sales",o)},getRetentionPercentage({aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeSwitchedSubscriptions:i=null,limit:o=null,offset:s=null,filter:l=null,criteria:u=null,tz:c=null}={}){const d={aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeSwitchedSubscriptions:i,limit:o,offset:s,filter:l,criteria:u,tz:c};return e.get("reports/retention-percentage",d)},getRetentionValue({aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeRefunds:i=null,includeDisputes:o=null,limit:s=null,offset:l=null,sort:u=null,filter:c=null,criteria:d=null,tz:p=null}={}){const f={aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeRefunds:i,includeDisputes:o,limit:s,offset:l,sort:u,filter:c,criteria:d,tz:p};return e.get("reports/retention-value",f)},getRevenueWaterfall({currency:t,issuedFrom:n,issuedTo:r,recognizedTo:a,limit:i=null,offset:o=null,tz:s=null}){const l={currency:t,issuedFrom:n,issuedTo:r,recognizedTo:a,limit:i,offset:o,tz:s};return e.get("reports/revenue-waterfall",l)},getSubscriptionCancellation({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/subscription-cancellation",u)},getSubscriptionRenewalList({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.getAll("reports/subscription-renewal-list",o)},getSubscriptionRenewal({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/subscription-renewal",o)},getTimeSeriesTransaction({periodStart:t,periodEnd:n,type:r,subaggregate:a,limit:i=null,offset:o=null}={}){const s={periodStart:t,periodEnd:n,type:r,subaggregate:a,limit:i,offset:o};return e.get("reports/time-series-transaction",s)},getTransactionsTimeDispute({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/transactions-time-dispute",u)},getTransactions({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/transactions",u)}}},SubscriptionsResource:function({apiHandler:e}){return{getSubscriptionSummaryMetrics({subscriptionId:t=""}={}){const n={subscriptionId:t};return e.get(`subscriptions/${t}/summary-metrics`,n)}}},TimelinesResource:function({apiHandler:e}){return{getActivityFeed({eventTypes:t=null,limit:n=1e3,offset:r=0}){const a={eventTypes:t,limit:n,offset:r};return e.getAll("activity-feed",a)},getTransaction({id:t="",eventTypes:n=null,limit:r=1e3,offset:a=0}){const i={eventTypes:n,limit:r,offset:a};return e.getAll(`transactions/${t}/timeline`,i)},getCustomer({id:t="",eventTypes:n=null,limit:r=1e3,offset:a=0}){const i={eventTypes:n,limit:r,offset:a};return e.getAll(`customers/${t}/timeline`,i)}}},LocationResource:function({apiHandler:e}){return{query:()=>e.get("location")}}};class ia{constructor({apiHandler:e}){this.customers=aa.CustomersResource({apiHandler:e}),this.dataExports=aa.DataExportsResource({apiHandler:e}),this.histograms=aa.HistogramsResource({apiHandler:e}),this.reports=aa.ReportsResource({apiHandler:e}),this.subscriptions=aa.SubscriptionsResource({apiHandler:e}),this.timelines=aa.TimelinesResource({apiHandler:e}),this.location=aa.LocationResource({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken}}class oa{constructor({apiHandler:e}){this.account=function({apiHandler:e}){return{get:()=>e.get("account"),update:({data:t})=>e.patch("account",t),requestPasswordReset:({data:t})=>e.post("account/forgot-password",t),changePassword:({data:t})=>e.patch("account/password",t),resendEmailVerification:({data:t})=>e.post("account/resend-verification",t),confirmPasswordReset:({token:t,data:n})=>e.post(`account/reset-password/${t}`,n),verifyEmail:({token:t})=>e.post(`account/verification/${t}`),register:({data:t})=>e.post("register",t)}}({apiHandler:e}),this.authorization=function({apiHandler:e}){return{login:({data:t})=>e.post("login",t),logout:()=>e.post("logout")}}({apiHandler:e}),this.billingPortals=function({apiHandler:e}){return{get:({slug:t})=>e.get(`billing-portals/${t}`)}}({apiHandler:e}),this.checkoutForms=function({apiHandler:e}){return{get:({id:t})=>e.get(`checkout-forms/${t}`)}}({apiHandler:e}),this.invoices=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("invoices",o)},get:({id:t})=>e.get(`invoices/${t}`),downloadPDF({id:t}){const n={headers:na,responseType:"arraybuffer"};return e.download(`invoices/${t}`,n)}}}({apiHandler:e}),this.kycDocuments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("kyc-documents",r)},create:({data:t})=>e.post("kyc-documents",t),get:({id:t})=>e.get(`kyc-documents/${t}`),update:({id:t,data:n})=>e.patch(`kyc-documents/${t}`,n)}}({apiHandler:e}),this.kycRequests=function({apiHandler:e}){return{get:({id:t})=>e.get(`kyc-requests/${t}`)}}({apiHandler:e}),this.orders=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("orders",o)},get:({id:t})=>e.get(`orders/${t}`),update:({id:t,data:n})=>e.patch(`orders/${t}`,n),cancel:({id:t,data:n})=>e.post(`orders/${t}/cancellation`,n)}}({apiHandler:e}),this.paymentInstruments=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("payment-instruments",o)},create:({data:t})=>e.post("payment-instruments",t),get({id:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.get(`payment-instruments/${t}`,a)},update:({id:t,data:n})=>e.patch(`payment-instruments/${t}`,n),deactivate:({id:t})=>e.post(`payment-instruments/${t}/deactivation`),getSetupTransaction:({id:t})=>e.get(`payment-instruments/${t}/setup`),setup:({id:t,data:n})=>e.post(`payment-instruments/${t}/setup`,n)}}({apiHandler:e}),this.plans=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("plans",o)},get:({id:t})=>e.get(`plans/${t}`)}}({apiHandler:e}),this.products=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("products",o)},get:({id:t})=>e.get(`products/${t}`)}}({apiHandler:e}),this.purchase=function({apiHandler:e}){return{payment:({data:t})=>e.post("payment",t),purchase:({data:t})=>e.post("purchase",t),preview:({data:t})=>e.post("preview-purchase",t),readyToPay:({data:t})=>e.post("ready-to-pay",t)}}({apiHandler:e}),this.transactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("transactions",o)},get:({id:t})=>e.get(`transactions/${t}`),update:({id:t,data:n})=>e.patch(`transactions/${t}`,n)}}({apiHandler:e}),this.websites=function({apiHandler:e}){return{get:({id:t})=>e.get(`websites/${t}`)}}({apiHandler:e}),this.checkoutForm=this.checkoutForms,this.billingPortal=this.billingPortals,this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}const sa={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"};function la({apiKey:e=null,sandbox:t=!1,timeout:n=6e3,organizationId:r=null,urls:a=sa}={}){if(!a.live||!a.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof a.live||"string"!=typeof a.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");return function({apiHandler:e}){return new ra({apiHandler:e})}({apiHandler:ea({options:{apiEndpoints:a,apiKey:e,apiVersion:"",isSandbox:t,requestTimeout:n,jwt:null,organizationId:r}})})}function ua({apiKey:e=null,sandbox:t=!1,timeout:n=6e3,organizationId:r=null,urls:a=sa}={}){if(!a.live||!a.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof a.live||"string"!=typeof a.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");return function({apiHandler:e}){return new ia({apiHandler:e})}({apiHandler:ea({options:{apiEndpoints:a,apiKey:e,apiVersion:"experimental",isSandbox:t,requestTimeout:n,jwt:null,organizationId:r}})})}function ca({publishableKey:e=null,jwt:t=null,sandbox:n=!1,timeout:r=6e3,organizationId:a=null,urls:i=sa}={}){if(!i.live||!i.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof i.live||"string"!=typeof i.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:i,publishableKey:e,jwt:t,apiVersion:"storefront",isSandbox:n,requestTimeout:r,organizationId:a},s=ea({options:o});return s.setSessionToken(o.jwt),function({apiHandler:e}){return new oa({apiHandler:e})}({apiHandler:s})}async function da({state:e}={},t){try{return function({state:e}){if(!e.storefront)throw new Error("Could not access rebilly-js-sdk instance");if(!e.options)throw new Error("Could not use Rebilly Instruments mount options to fetch Rebilly data")}({state:e}),await t()}catch(e){throw Ge(e),e}}class pa{constructor({publishableKey:e=null,jwt:t=null,organizationId:n=null,mode:r="live",timeout:a=1e4,liveUrl:i=null,sandboxUrl:o=null}={}){const s={live:i||"https://api.rebilly.com",sandbox:o||"https://api-sandbox.rebilly.com"},l={organizationId:n,sandbox:"sandbox"===r,timeout:Number.isNaN(parseInt(a,10))?1e4:parseInt(a,10),urls:s},u=ca(l),c="function"==typeof la.default?la.default(l):la(l),d=ua(l);return u.setSessionToken(e||t),c.setSessionToken(e||t),d.setSessionToken(e||t),this.api=u,this.api.rebilly=c,this.api.rebilly.experimental=d,this.api}}async function fa({data:e=null,state:t=null}={}){return da({state:t},(async()=>{var n,r,a;const i={data:{websiteId:(null===(n=t.options)||void 0===n?void 0:n.websiteId)||null}};null!==(r=t.options)&&void 0!==r&&r.items&&(i.data.items=t.options.items),null!==(a=t.data)&&void 0!==a&&a.amountAndCurrency&&(i.data={...i.data,...t.data.amountAndCurrency}),null!=e&&e.billingAddress&&(i.data.billingAddress=e.billingAddress),null!=e&&e.deliveryAddress&&(i.data.deliveryAddress=e.deliveryAddress);const{fields:o}=await t.storefront.purchase.preview(i);return t.data.previewPurchase=o,new at(o)}))}async function ha({state:e,instrument:t}){await fa({data:t,state:e});const n={data:e.data.toPostmatesModel(),options:e.options};e.iframeComponents.summary.component.call("update",n),e.iframeComponents.form.component.call("update",n)}var ma,ga=(function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),o=new C(r||[]);return i._invoke=function(e,t,n){var r=d;return function(a,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===a)throw i;return H()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=E(o,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=c(e,t,n);if("normal"===l.type){if(r=n.done?h:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=h,n.method="throw",n.arg=l.arg)}}}(e,n,o),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function g(){}function y(){}function v(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&r.call(x,i)&&(b=x);var k=v.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(a,i,o,s){var l=c(e[a],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=c(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function $(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach($,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:H}}function H(){return{value:t,done:!0}}return y.prototype=k.constructor=v,v.constructor=y,y.displayName=l(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(A.prototype),A.prototype[o]=function(){return this},e.AsyncIterator=A,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new A(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(k),l(k,s,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;T(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(ma={path:undefined,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&ma.path)}},ma.exports),ma.exports);function ya(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}var va=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){ya(i,r,a,o,s,"next",e)}function s(e){ya(i,r,a,o,s,"throw",e)}o(void 0)}))}},ba=function(){return(ba=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function wa(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function xa(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function Sa(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),a=0;for(t=0;t<n;t++)for(var i=arguments[t],o=0,s=i.length;o<s;o++,a++)r[a]=i[o];return r}function Aa(e,t){return new Promise((function(n){return setTimeout(n,e,t)}))}function Ea(e,t){try{var n=e();(r=n)&&"function"==typeof r.then?n.then((function(e){return t(!0,e)}),(function(e){return t(!1,e)})):t(!0,n)}catch(e){t(!1,e)}var r}function $a(e,t,n){return void 0===n&&(n=16),wa(this,void 0,void 0,(function(){var r,a,i;return xa(this,(function(o){switch(o.label){case 0:r=Date.now(),a=0,o.label=1;case 1:return a<e.length?(t(e[a],a),(i=Date.now())>=r+n?(r=i,[4,Aa(0)]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++a,[3,1];case 4:return[2]}}))}))}function Ta(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Ca(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Ia(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function Ha(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function Fa(e,t){return[e[0]^t[0],e[1]^t[1]]}function ja(e){return e=Fa(e,[0,e[0]>>>1]),e=Fa(e=Ca(e,[4283543511,3981806797]),[0,e[0]>>>1]),Fa(e=Ca(e,[3301882366,444984403]),[0,e[0]>>>1])}function Pa(e){return parseInt(e)}function La(e){return parseFloat(e)}function Ra(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ma(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function Oa(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function qa(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Ba(e,t,n){var r=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}(n,e)})),a=Array(r.length);return $a(r,(function(n,r){a[r]=function(e,t){var n=function(e){return"function"!=typeof e},r=new Promise((function(r){var a=Date.now();Ea(e.bind(null,t),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Date.now()-a;if(!e[0])return r((function(){return{error:qa(e[1]),duration:i}}));var o=e[1];if(n(o))return r((function(){return{value:o,duration:i}}));r((function(){return new Promise((function(e){var t=Date.now();Ea(o,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=i+Date.now()-t;if(!n[0])return e({error:qa(n[1]),duration:a});e({value:n[1],duration:a})}))}))}))}))}));return function(){return r.then((function(e){return e()}))}}(e[n],t)})),function(){return wa(this,void 0,void 0,(function(){var e,t,n,i,o,s;return xa(this,(function(l){switch(l.label){case 0:for(e={},t=0,n=r;t<n.length;t++)i=n[t],e[i]=void 0;o=Array(r.length),s=function(){var t;return xa(this,(function(n){switch(n.label){case 0:return t=!0,[4,$a(r,(function(n,r){o[r]||(a[r]?o[r]=a[r]().then((function(t){return e[n]=t})):t=!1)}))];case 1:return n.sent(),t?[2,"break"]:[4,Aa(1)];case 2:return n.sent(),[2]}}))},l.label=1;case 1:return[5,s()];case 2:if("break"===l.sent())return[3,4];l.label=3;case 3:return[3,1];case 4:return[4,Promise.all(o)];case 5:return l.sent(),[2,e]}}))}))}}function _a(){var e=window,t=navigator;return Ma(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function za(){var e=window,t=navigator;return Ma(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Da(){var e=window,t=navigator;return Ma(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Na(){var e=window;return Ma(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Ua(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Wa(){var e=za(),t=function(){var e,t,n=window;return Ma(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}();if(!e&&!t)return!1;var n=window;return Ma(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function Va(e){var t=new Error(e);return t.name=e,t}function Ga(e,t,n){var r,a,i;return void 0===n&&(n=50),wa(this,void 0,void 0,(function(){var o,s;return xa(this,(function(l){switch(l.label){case 0:o=document,l.label=1;case 1:return o.body?[3,3]:[4,Aa(n)];case 2:return l.sent(),[3,1];case 3:s=o.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise((function(e,n){var r=!1,a=function(){r=!0,e()};s.onload=a,s.onerror=function(e){r=!0,n(e)};var i=s.style;i.setProperty("display","block","important"),i.position="absolute",i.top="0",i.left="0",i.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",o.body.appendChild(s);var l=function(){var e,t;r||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?a():setTimeout(l,10))};l()}))];case 5:l.sent(),l.label=6;case 6:return(null===(a=null===(r=s.contentWindow)||void 0===r?void 0:r.document)||void 0===a?void 0:a.body)?[3,8]:[4,Aa(n)];case 7:return l.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(i=s.parentNode)||void 0===i||i.removeChild(s),[7];case 11:return[2]}}))}))}function Ka(e){for(var t=function(e){for(var t,n,r="Unexpected syntax '"+e+"'",a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,o={},s=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){o[e]=o[e]||[],o[e].push(t)};;){var u=s.exec(a[2]);if(!u)break;var c=u[0];switch(c[0]){case".":l("class",c.slice(1));break;case"#":l("id",c.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(c);if(!d)throw new Error(r);l(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[i,o]}(e),n=t[0],r=t[1],a=document.createElement(null!=n?n:"div"),i=0,o=Object.keys(r);i<o.length;i++){var s=o[i],l=r[s].join(" ");"style"===s?Ja(a.style,l):a.setAttribute(s,l)}return a}function Ja(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var a=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var o=i[1],s=i[2],l=i[4];e.setProperty(o,s,l||"")}}}var Xa,Za,Ya=["monospace","sans-serif","serif"],Qa=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function ei(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function ti(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly "+String.fromCharCode(55357,56835);return t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45),ri(e)}function ni(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var a=r[n],i=a[0],o=a[1],s=a[2];t.fillStyle=i,t.beginPath(),t.arc(o,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}return t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd"),ri(e)}function ri(e){return e.toDataURL()}function ai(){var e=screen;return[Ra(La(e.availTop),null),Ra(La(e.width)-La(e.availWidth)-Ra(La(e.availLeft),0),null),Ra(La(e.height)-La(e.availHeight)-Ra(La(e.availTop),0),null),Ra(La(e.availLeft),null)]}function ii(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}var oi={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'a[title="7naga poker" i]','[title="ALIENBOLA" i]'],abpvn:["#quangcaomb",".iosAdsiosAds-layout",".quangcao",'[href^="https://r88.vn/"]','[href^="https://zbet.vn/"]'],adBlockFinland:[".mainostila",".sponsorit",".ylamainos",'a[href*="/clickthrgh.asp?"]','a[href^="https://app.readpeak.com/ads"]'],adBlockPersian:["#navbar_notice_50",'a[href^="http://g1.v.fwmrm.net/ad/"]',".kadr",'TABLE[width="140px"]',"#divAgahi"],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect"],adGuardAnnoyances:['amp-embed[type="zen"]',".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil"],adGuardBase:["#ad-after","#ad-p3",".BetterJsPopOverlay","#ad_300X250","#bannerfloat22"],adGuardChinese:['a[href*=".ttz5.cn"]','a[href*=".yabovip2027.com/"]',".tm3all2h4b",".cc5278_banner_ad"],adGuardFrench:[".zonepub",'[class*="_adLeaderboard"]','[id^="block-xiti_oas-"]','a[href^="http://ptapjmp.com/"]','a[href^="https://go.alvexo.com/"]'],adGuardGerman:[".banneritemwerbung_head_1",".boxstartwerbung",".werbung3",'a[href^="http://www.eis.de/index.phtml?refid="]','a[href^="https://www.tipico.com/?affiliateId="]'],adGuardJapanese:["#kauli_yad_1","#ad-giftext","#adsSPRBlock",'a[href^="http://ad2.trafficgate.net/"]','a[href^="http://www.rssad.jp/"]'],adGuardMobile:["amp-auto-ads","#mgid_iframe",".amp_ad",'amp-embed[type="24smi"]',"#mgid_iframe1"],adGuardRussian:['a[href^="https://ya-distrib.ru/r/"]','a[href^="https://ad.letmeads.com/"]',".reclama",'div[id^="smi2adblock"]','div[id^="AdFox_banner_"]'],adGuardSocial:['a[href^="//www.stumbleupon.com/submit?url="]','a[href^="//telegram.me/share/url?"]',".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",'[href^="http://ads.glispa.com/"]'],adGuardTrackingProtection:['amp-embed[type="taboola"]',"#qoo-counter",'a[href^="http://click.hotlog.ru/"]','a[href^="http://hitcounter.ru/top/stat.php"]','a[href^="http://top.mail.ru/jump"]'],adGuardTurkish:["#backkapat","#reklami",'a[href^="http://adserv.ontek.com.tr/"]','a[href^="http://izlenzi.com/campaign/"]','a[href^="http://www.installads.net/"]'],bulgarian:["td#freenet_table_ads","#adbody","#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:["#AD_banner_bottom","#Ads_google_02","#N-ad-article-rightRail-1","#ad-fullbanner2","#ad-zone-2"],easyListChina:['a[href*=".wensixuetang.com/"]','A[href*="/hth107.com/"]','.appguide-wrap[onclick*="bcebos.com"]',".frontpageAdvM","#taotaole"],easyListCookie:["#adtoniq-msg-bar","#CoockiesPage","#CookieModal_cookiemodal","#DO_CC_PANEL","#ShowCookie"],easyListCzechSlovak:["#onlajny-stickers","#reklamni-box",".reklama-megaboard",".sklik",'[id^="sklikReklama"]'],easyListDutch:["#advertentie","#vipAdmarktBannerBlock",".adstekst",'a[href^="https://xltube.nl/click/"]',"#semilo-lrectangle"],easyListGermany:['a[href^="http://www.hw-area.com/?dp="]','a[href^="https://ads.sunmaker.com/tracking.php?"]',".werbung-skyscraper2",".bannergroup_werbung",".ads_rechts"],easyListItaly:[".box_adv_annunci",".sb-box-pubbliredazionale",'a[href^="http://affiliazioniads.snai.it/"]','a[href^="https://adserver.html.it/"]','a[href^="https://affiliazioniads.snai.it/"]'],easyListLithuania:[".reklamos_tarpas",".reklamos_nuorodos",'img[alt="Reklaminis skydelis"]','img[alt="Dedikuoti.lt serveriai"]','img[alt="Hostingas Serveriai.lt"]'],estonian:['A[href*="http://pay4results24.eu"]'],fanboyAnnoyances:["#feedback-tab","#taboola-below-article",".feedburnerFeedBlock",".widget-feedburner-counter",'[title="Subscribe to our blog"]'],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:[".td-tags-and-social-wrapper-box",".twitterContainer",".youtube-social",'a[title^="Like us on Facebook"]','img[alt^="Share on Digg"]'],frellwitSwedish:['a[href*="casinopro.se"][target="_blank"]','a[href*="doktor-se.onelink.me"]',"article.category-samarbete","div.holidAds","ul.adsmodern"],greekAdBlock:['A[href*="adman.otenet.gr/click?"]','A[href*="http://axiabanners.exodus.gr/"]','A[href*="http://interactive.forthnet.gr/click?"]',"DIV.agores300","TABLE.advright"],hungarian:['A[href*="ad.eval.hu"]','A[href*="ad.netmedia.hu"]','A[href*="daserver.ultraweb.hu"]',"#cemp_doboz",".optimonk-iframe-container"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container",".cookie-msg-info-container","#cookies-policy-sticky"],icelandicAbp:['A[href^="/framework/resources/forms/ads.aspx"]'],latvian:['a[href="http://www.salidzini.lv/"][style="display: block; width: 120px; height: 40px; overflow: hidden; position: relative;"]','a[href="http://www.salidzini.lv/"][style="display: block; width: 88px; height: 31px; overflow: hidden; position: relative;"]'],listKr:['a[href*="//kingtoon.slnk.kr"]','a[href*="//playdsb.com/kr"]',"div.logly-lift-adz",'div[data-widget_id="ml6EJ074"]',"ins.daum_ddn_area"],listeAr:[".geminiLB1Ad",".right-and-left-sponsers",'a[href*=".aflam.info"]','a[href*="booraq.org"]','a[href*="dubizzle.com/ar/?utm_source="]'],listeFr:['a[href^="http://promo.vador.com/"]',"#adcontainer_recherche",'a[href*="weborama.fr/fcgi-bin/"]',".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",'[href^="https://aff.sendhub.pl/"]','a[href^="http://advmanager.techfun.pl/redirect/"]','a[href^="http://www.trizer.pl/?utm_source"]',"div#skapiec_ad"],ro:['a[href^="//afftrk.altex.ro/Counter/Click"]','a[href^="/magazin/"]','a[href^="https://blackfridaysales.ro/trk/shop/"]','a[href^="https://event.2performant.com/events/click"]','a[href^="https://l.profitshare.ro/"]'],ruAd:['a[href*="//febrare.ru/"]','a[href*="//utimg.ru/"]','a[href*="://chikidiki.ru"]',"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]","#ads-google-middle_rectangle-group",".ads300s",".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",".ctpl-fullbanner",".zergnet-recommend",".yt.btn-link.btn-md.btn"]};function si(e){var t;return wa(this,void 0,void 0,(function(){var n,r,a,i,o,s,l;return xa(this,(function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),a=new Array(e.length),i={},li(r),l=0;l<e.length;++l)o=Ka(e[l]),li(s=n.createElement("div")),s.appendChild(o),r.appendChild(s),a[l]=o;u.label=1;case 1:return n.body?[3,3]:[4,Aa(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(l=0;l<e.length;++l)a[l].offsetParent||(i[e[l]]=!0)}finally{null===(t=r.parentNode)||void 0===t||t.removeChild(r)}return[2,i]}}))}))}function li(e){e.style.setProperty("display","block","important")}function ui(e){return matchMedia("(inverted-colors: "+e+")").matches}function ci(e){return matchMedia("(forced-colors: "+e+")").matches}function di(e){return matchMedia("(prefers-contrast: "+e+")").matches}function pi(e){return matchMedia("(prefers-reduced-motion: "+e+")").matches}function fi(e){return matchMedia("(dynamic-range: "+e+")").matches}var hi=Math,mi=function(){return 0},gi={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]},yi={fonts:function(){return Ga((function(e,t){var n=t.document,r=n.body;r.style.fontSize="48px";var a=n.createElement("div"),i={},o={},s=function(e){var t=n.createElement("span"),r=t.style;return r.position="absolute",r.top="0",r.left="0",r.fontFamily=e,t.textContent="mmMwWLliI0O&1",a.appendChild(t),t},l=Ya.map(s),u=function(){for(var e={},t=function(t){e[t]=Ya.map((function(e){return function(e,t){return s("'"+e+"',"+t)}(t,e)}))},n=0,r=Qa;n<r.length;n++)t(r[n]);return e}();r.appendChild(a);for(var c=0;c<Ya.length;c++)i[Ya[c]]=l[c].offsetWidth,o[Ya[c]]=l[c].offsetHeight;return Qa.filter((function(e){return t=u[e],Ya.some((function(e,n){return t[n].offsetWidth!==i[e]||t[n].offsetHeight!==o[e]}));var t}))}))},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return wa(this,void 0,void 0,(function(){var e,n,r,a;return xa(this,(function(i){switch(i.label){case 0:return Da()||Wa()?(e=Object.keys(oi),[4,si((a=[]).concat.apply(a,e.map((function(e){return oi[e]}))))]):[2,void 0];case 1:return n=i.sent(),t&&function(e){for(var t="DOM blockers debug:\n```",n=0,r=Object.keys(oi);n<r.length;n++){var a=r[n];t+="\n"+a+":";for(var i=0,o=oi[a];i<o.length;i++){var s=o[i];t+="\n "+s+" "+(e[s]?"🚫":"➡️")}}console.log(t+"\n```")}(n),(r=e.filter((function(e){var t=oi[e];return Ma(t.map((function(e){return n[e]})))>.6*t.length}))).sort(),[2,r]}}))}))},fontPreferences:function(){return function(e,t){return void 0===t&&(t=4e3),Ga((function(e,n){var r=n.document,a=r.body,i=a.style;i.width=t+"px",i.webkitTextSizeAdjust=i.textSizeAdjust="none",za()?a.style.zoom=""+1/n.devicePixelRatio:Da()&&(a.style.zoom="reset");var o=r.createElement("div");return o.textContent=Sa(Array(t/20<<0)).map((function(){return"word"})).join(" "),a.appendChild(o),function(e,t){for(var n={},r={},a=0,i=Object.keys(gi);a<i.length;a++){var o=i[a],s=gi[o],l=s[0],u=void 0===l?{}:l,c=s[1],d=void 0===c?"mmMwWLliI0fiflO&1":c,p=e.createElement("span");p.textContent=d,p.style.whiteSpace="nowrap";for(var f=0,h=Object.keys(u);f<h.length;f++){var m=h[f],g=u[m];void 0!==g&&(p.style[m]=g)}n[o]=p,t.appendChild(e.createElement("br")),t.appendChild(p)}for(var y=0,v=Object.keys(gi);y<v.length;y++)r[o=v[y]]=n[o].getBoundingClientRect().width;return r}(r,a)}),'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}()},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Da()&&!Na()&&!function(){var e=window;return Ma(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;var a=n.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,r.connect(a),a.connect(n.destination),r.start(0);var i=function(e){var t=function(){};return[new Promise((function(n,r){var a=!1,i=0,o=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var s=function(){setTimeout((function(){return r(Va("timeout"))}),Math.min(500,o+5e3-Date.now()))},l=function(){try{switch(e.startRendering(),e.state){case"running":o=Date.now(),a&&s();break;case"suspended":document.hidden||i++,a&&i>=3?r(Va("suspended")):setTimeout(l,500)}}catch(e){r(e)}};l(),t=function(){a||(a=!0,o>0&&s())}})),t]}(n),o=i[0],s=i[1],l=o.then((function(e){return function(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(4500))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return l.catch((function(){})),function(){return s(),l}},screenFrame:function(){var e=this,t=function(){var e=this;return function(){if(void 0===Za){var e=function(){var t=ai();ii(t)?Za=setTimeout(e,2500):(Xa=t,Za=void 0)};e()}}(),function(){return wa(e,void 0,void 0,(function(){var e;return xa(this,(function(t){switch(t.label){case 0:return ii(e=ai())?Xa?[2,Sa(Xa)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,Ua()]:[3,2]:[3,2];case 1:t.sent(),e=ai(),t.label=2;case 2:return ii(e)||(Xa=e),[2,e]}var n}))}))}}();return function(){return wa(e,void 0,void 0,(function(){var e,n;return xa(this,(function(r){switch(r.label){case 0:return[4,t()];case 1:return e=r.sent(),[2,[(n=function(e){return null===e?null:Oa(e,10)})(e[0]),n(e[1]),n(e[2]),n(e[3])]]}}))}))}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,n=[],r=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==r&&n.push([r]),Array.isArray(t.languages))za()&&Ma([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||n.push(t.languages);else if("string"==typeof t.languages){var a=t.languages;a&&n.push(a.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Ra(La(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Ra(Pa(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return Ra(Pa(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var r,a=(r=(new Date).getFullYear(),-Math.max(La(new Date(r,0,1).getTimezoneOffset()),La(new Date(r,6,1).getTimezoneOffset())));return"UTC"+(a>=0?"+":"")+Math.abs(a)},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(_a()||(e=window,t=navigator,Ma(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!_a())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Da()&&!Na()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Ma(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var a=[],i=0;i<r.length;++i){var o=r[i];a.push({type:o.type,suffixes:o.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:a})}}return t}},canvas:function(){var e=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),t=e[0],n=e[1];return function(e,t){return!(!t||!e.toDataURL)}(t,n)?{winding:ei(n),geometry:ni(t,n),text:ti(t,n)}:{winding:!1,geometry:"",text:""}},touchSupport:function(){var e,t=navigator,n=0;void 0!==t.maxTouchPoints?n=Pa(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(n=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:n,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],a=window[r];a&&"object"==typeof a&&e.push(r)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: "+n+")").matches)return n}},invertedColors:function(){return!!ui("inverted")||!ui("none")&&void 0},forcedColors:function(){return!!ci("active")||!ci("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: "+e+")").matches)return e;throw new Error("Too high value")}},contrast:function(){return di("no-preference")?0:di("high")||di("more")?1:di("low")||di("less")?-1:di("forced")?10:void 0},reducedMotion:function(){return!!pi("reduce")||!pi("no-preference")&&void 0},hdr:function(){return!!fi("high")||!fi("standard")&&void 0},math:function(){var e,t=hi.acos||mi,n=hi.acosh||mi,r=hi.asin||mi,a=hi.asinh||mi,i=hi.atanh||mi,o=hi.atan||mi,s=hi.sin||mi,l=hi.sinh||mi,u=hi.cos||mi,c=hi.cosh||mi,d=hi.tan||mi,p=hi.tanh||mi,f=hi.exp||mi,h=hi.expm1||mi,m=hi.log1p||mi;return{acos:t(.12312423423423424),acosh:n(1e308),acoshPf:(e=1e154,hi.log(e+hi.sqrt(e*e-1))),asin:r(.12312423423423424),asinh:a(1),asinhPf:hi.log(1+hi.sqrt(2)),atanh:i(.5),atanhPf:hi.log(3)/2,atan:o(.5),sin:s(-1e300),sinh:l(1),sinhPf:hi.exp(1)-1/hi.exp(1)/2,cos:u(10.000000000123),cosh:c(1),coshPf:(hi.exp(1)+1/hi.exp(1))/2,tan:d(-1e300),tanh:p(1),tanhPf:(hi.exp(2)-1)/(hi.exp(2)+1),exp:f(1),expm1:h(1),expm1Pf:hi.exp(1)-1,log1p:m(10),log1pPf:hi.log(11),powPI:hi.pow(hi.PI,-100)}}};function vi(e){var t=function(e){if(Wa())return.4;if(Da())return Na()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}(e),n=function(e){return Oa(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,""+n)}}function bi(e){return JSON.stringify(e,(function(e,t){return t instanceof Error?ba({name:(n=t).name,message:n.message,stack:null===(r=n.stack)||void 0===r?void 0:r.split("\n")},n):t;var n,r}),2)}function wi(e){return function(e,t){t=t||0;var n,r=(e=e||"").length%16,a=e.length-r,i=[0,t],o=[0,t],s=[0,0],l=[0,0],u=[2277735313,289559509],c=[1291169091,658871167];for(n=0;n<a;n+=16)s=[255&e.charCodeAt(n+4)|(255&e.charCodeAt(n+5))<<8|(255&e.charCodeAt(n+6))<<16|(255&e.charCodeAt(n+7))<<24,255&e.charCodeAt(n)|(255&e.charCodeAt(n+1))<<8|(255&e.charCodeAt(n+2))<<16|(255&e.charCodeAt(n+3))<<24],l=[255&e.charCodeAt(n+12)|(255&e.charCodeAt(n+13))<<8|(255&e.charCodeAt(n+14))<<16|(255&e.charCodeAt(n+15))<<24,255&e.charCodeAt(n+8)|(255&e.charCodeAt(n+9))<<8|(255&e.charCodeAt(n+10))<<16|(255&e.charCodeAt(n+11))<<24],s=Ia(s=Ca(s,u),31),i=Ta(i=Ia(i=Fa(i,s=Ca(s,c)),27),o),i=Ta(Ca(i,[0,5]),[0,1390208809]),l=Ia(l=Ca(l,c),33),o=Ta(o=Ia(o=Fa(o,l=Ca(l,u)),31),i),o=Ta(Ca(o,[0,5]),[0,944331445]);switch(s=[0,0],l=[0,0],r){case 15:l=Fa(l,Ha([0,e.charCodeAt(n+14)],48));case 14:l=Fa(l,Ha([0,e.charCodeAt(n+13)],40));case 13:l=Fa(l,Ha([0,e.charCodeAt(n+12)],32));case 12:l=Fa(l,Ha([0,e.charCodeAt(n+11)],24));case 11:l=Fa(l,Ha([0,e.charCodeAt(n+10)],16));case 10:l=Fa(l,Ha([0,e.charCodeAt(n+9)],8));case 9:l=Ca(l=Fa(l,[0,e.charCodeAt(n+8)]),c),o=Fa(o,l=Ca(l=Ia(l,33),u));case 8:s=Fa(s,Ha([0,e.charCodeAt(n+7)],56));case 7:s=Fa(s,Ha([0,e.charCodeAt(n+6)],48));case 6:s=Fa(s,Ha([0,e.charCodeAt(n+5)],40));case 5:s=Fa(s,Ha([0,e.charCodeAt(n+4)],32));case 4:s=Fa(s,Ha([0,e.charCodeAt(n+3)],24));case 3:s=Fa(s,Ha([0,e.charCodeAt(n+2)],16));case 2:s=Fa(s,Ha([0,e.charCodeAt(n+1)],8));case 1:s=Ca(s=Fa(s,[0,e.charCodeAt(n)]),u),i=Fa(i,s=Ca(s=Ia(s,31),c))}return i=Ta(i=Fa(i,[0,e.length]),o=Fa(o,[0,e.length])),o=Ta(o,i),i=Ta(i=ja(i),o=ja(o)),o=Ta(o,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var a=r[n],i=e[a],o=i.error?"error":JSON.stringify(i.value);t+=(t?"|":"")+a.replace(/([:|\\])/g,"\\$1")+":"+o}return t}(e))}function xi(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise((function(e){return n.call(window,(function(){return e()}),{timeout:t})})):Aa(Math.min(e,t))}(e,2*e)}function ki(e,t){var n=Date.now();return{get:function(r){return wa(this,void 0,void 0,(function(){var a,i,o;return xa(this,(function(s){switch(s.label){case 0:return a=Date.now(),[4,e()];case 1:return i=s.sent(),o=function(e){var t;return{get visitorId(){return void 0===t&&(t=wi(this.components)),t},set visitorId(e){t=e},confidence:vi(e),components:e,version:"3.3.3"}}(i),(t||(null==r?void 0:r.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: "+o.version+"\nuserAgent: "+navigator.userAgent+"\ntimeBetweenLoadAndGet: "+(a-n)+"\nvisitorId: "+o.visitorId+"\ncomponents: "+bi(i)+"\n```"),[2,o]}}))}))}}}var Si={load:function(e){var t=void 0===e?{}:e,n=t.delayFallback,r=t.debug,a=t.monitoring,i=void 0===a||a;return wa(this,void 0,void 0,(function(){return xa(this,(function(e){switch(e.label){case 0:return i&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v3.3.3/npm-monitoring",!0),e.send()}catch(e){console.error(e)}}(),[4,xi(n)];case 1:return e.sent(),[2,ki(Ba(yi,{debug:r},[]),r)]}}))}))},hashComponents:wi,componentsToDebugString:bi};function Ai(){return Ei.apply(this,arguments)}function Ei(){return(Ei=va(ga.mark((function e(){var t,n;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Si.load({monitoring:!1});case 3:return t=e.sent,e.next=6,t.get();case 6:return n=e.sent,e.abrupt("return",n.visitorId);case 10:return e.prev=10,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return","");case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function $i(){return Ti.apply(this,arguments)}function Ti(){return(Ti=va(ga.mark((function e(){return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){window.requestIdleCallback?requestIdleCallback(va(ga.mark((function t(){var n;return ga.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ai();case 2:n=t.sent,e(n);case 4:case"end":return t.stop()}}),t)})))):setTimeout(va(ga.mark((function t(){var n;return ga.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ai();case 2:n=t.sent,e(n);case 4:case"end":return t.stop()}}),t)}))),500)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ci=function(e){var t=e.env,n=e.kountAccountId,r=e.kountSessionId,a=function(e){return"production"===e}(t)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(a,"/collect/sdk"));i.searchParams.append("m",n),r&&i.searchParams.append("m",r);var o=document.createElement("script");return o.setAttribute("class","kaxsdc"),o.setAttribute("data-event","load"),o.setAttribute("type","text/javascript"),o.setAttribute("src",i.href),document.body.append(o),o};function Ii(e){return Hi.apply(this,arguments)}function Hi(){return(Hi=va(ga.mark((function e(t){var n,r,a;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.env,r=t.kountAccountId,a=t.kountSessionId,e.abrupt("return",new Promise((function(e,t){var i=Ci({env:n,kountAccountId:r,kountSessionId:a});i.onload=function(){var t=new ka.ClientSDK;t.setupCallback({"collect-begin":function(t){var n=t.MercSessId;e(n)}}),t.autoLoadEvents()},i.onerror=function(){t(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fi(e){return ji.apply(this,arguments)}function ji(){return(ji=va(ga.mark((function e(t){var n,r,a,i,o,s,l,u,c,d,p,f,h,m,g,y,v,b,w,x;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.env,r=void 0===n?null:n,a=t.screen,i=t.navigator,o=t.kountAccountId,s=void 0===o?null:o,l=t.kountSessionId,u=void 0===l?null:l,c=t.getFingerprint,d=t.getFraudSessionId,f=(p=a||{}).colorDepth,h=p.height,m=p.width,y=(g=i||{}).javaEnabled,v=g.language,e.prev=3,e.next=6,c();case 6:if(b=e.sent,!s){e.next=11;break}return e.next=10,d({env:r,kountAccountId:s,kountSessionId:u});case 10:w=e.sent;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),console.error(e.t0);case 16:return x={riskMetadata:{fingerprint:b||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:f||null,isJavaEnabled:y?y.call(i):null,language:v||null,screenHeight:h||null,screenWidth:m||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},e.abrupt("return",x);case 18:case"end":return e.stop()}}),e,null,[[3,13]])})))).apply(this,arguments)}function Pi(){return Li.apply(this,arguments)}function Li(){return(Li=va(ga.mark((function e(){var t,n,r,a,i,o,s,l=arguments;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},n=t.env,r=void 0===n?null:n,a=t.kountAccountId,i=void 0===a?null:a,o=t.kountSessionId,s=void 0===o?null:o,e.abrupt("return",Fi({env:r,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:s,getFingerprint:$i,getFraudSessionId:Ii}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}class Ri extends et{}class Mi extends et{}class Oi extends et{get logo(){return this.landscapeLogo||this.portraitLogo}}class qi{constructor({name:e="",expirationTime:t="",displayName:n="",country:r="",merchantName:a="",merchantOrigin:i="",paypalMerchantId:o="",billingAgreementToken:s="",linkToken:l=""}={}){this.name=e,this.expirationTime=t,this.displayName=n,this.country=r,this.merchantName=a,this.merchantOrigin=i,this.paypalMerchantId=o,this.billingAgreementToken=s,this.linkToken=l}}class Bi{constructor({index:e=null,method:t="",feature:n=null,brands:r=[],filters:a=[],metadata:i=null}={}){this.index=e,this.method=t,this.feature=n?new qi(n):null,this.brands=r,this.filters=a,this.metadata=i?new Oi(i):null}}async function _i({state:e,riskMetadata:t=null}){return da({state:e},(async()=>{var n,r,a,i,o;if(!t){const{riskMetadata:e}=await Pi();t=e}const s={riskMetadata:t};let l=(null===(n=e.options)||void 0===n?void 0:n.websiteId)||null;var u,c;l||(null!==(u=e.data.transaction)&&void 0!==u&&u.websiteId?l=e.data.transaction.websiteId:null!==(c=e.data.invoice)&&void 0!==c&&c.websiteId&&(l=e.data.invoice.websiteId));if(s.websiteId=l,null!==(r=e.options)&&void 0!==r&&r.items&&(s.items=e.options.items),null!==(a=e.data)&&void 0!==a&&a.amountAndCurrency){const t=e.data.amountAndCurrency;s.amount=t.amount,s.currency=t.currency}null!==(i=e.data)&&void 0!==i&&null!==(o=i.account)&&void 0!==o&&o.address&&(s.billingAddress=e.data.account.address);const[{fields:d},{items:p}]=await Promise.all([e.storefront.purchase.readyToPay({data:s}),e.storefront.rebilly.paymentMethods.getAll()]),f=p.map((({fields:e})=>e));return Object.values(d).filter((e=>!("paypal"===e.method&&!e.feature))).filter((e=>!("ach"===e.method&&e.feature))).map(((e,t)=>{const n=f.find((t=>t.apiName===e.method));return new Bi({index:t,metadata:n,...e})}))}))}class zi extends et{}async function Di({data:e=null,state:t=null}){return da({state:t},(async()=>{t.storefront.setSessionToken(t.options.jwt);const{fields:n}=await t.storefront.invoices.get(e);return new zi(n)}))}class Ni extends et{constructor({invoiceIds:e=[],...t}){super(t),this.invoiceIds=e||[]}get invoiceId(){return this.invoiceIds[0]||null}get hasInvoice(){return!!this.invoiceId}}async function Ui({data:e=null,state:t=null}){return da({state:t},(async()=>{t.storefront.setSessionToken(t.options.jwt);const{fields:n}=await t.storefront.transactions.get(e);return new Ni(n)}))}class Wi{constructor({firstName:e=null,lastName:t=null,organization:n=null,address:r=null,address2:a=null,city:i=null,region:o=null,country:s=null,postalCode:l=null,emails:u=[],phoneNumbers:c=[]}={}){var d,p;this.firstName=e,this.lastName=t,this.organization=n,this.address=r,this.address2=a,this.city=i,this.region=o,this.country=s,this.postalCode=l,this.email=(null===(d=u.find((e=>e.primary)))||void 0===d?void 0:d.value)||null,this.phoneNumber=(null===(p=c.find((e=>e.primary)))||void 0===p?void 0:p.value)||null}}class Vi extends et{constructor({primaryAddress:e=null,...t}={}){super(t),this.address=new Wi(e)}}async function Gi({state:e=null}){return da({state:e},(async()=>{e.storefront.setSessionToken(e.options.jwt);const{fields:t}=await e.storefront.account.get();return new Vi(t)}))}async function Ki({state:e}){return da({state:e},(async()=>{const{items:t}=await e.storefront.paymentInstruments.getAll();return t.map((({fields:e})=>e))}))}class Ji{constructor({state:e={},...t}={}){var n;Object.entries({...e.data||{},...t}).forEach((([e,t])=>{this[e]=t})),this.money=(null===(n=e.options)||void 0===n?void 0:n.money)||null}get amountAndCurrency(){let e,t;return this.previewPurchase?(e=this.previewPurchase.currency,t=this.previewPurchase.total):this.invoice?(e=this.invoice.currency,t=this.invoice.amount):this.transaction?(e=this.transaction.currency,t=this.transaction.amount):this.money&&(e=this.money.currency,t=this.money.amount),{amount:t,currency:e}}get isPayment(){return this.invoice||this.transaction||this.money}get isPurchase(){return this.previewPurchase}get summaryItems(){const{discountsAmount:e=null,shippingAmount:t=null,subtotalAmount:n=null,taxAmount:r=null}=this.previewPurchase||this.invoice||{};return{discountsAmount:e,shippingAmount:t,subtotalAmount:n,taxAmount:r}}get summaryLineItems(){let e=[];return this.invoice?({items:e=[]}=this.invoice):({lineItems:e=[]}=this.previewPurchase||{}),e}get isShippingRequired(){return(this.products||[]).some((e=>e.requiresShipping))}toPostmatesModel(){return{...this,amountAndCurrency:this.amountAndCurrency,isPayment:this.isPayment,isPurchase:this.isPurchase,summaryItems:this.summaryItems,summaryLineItems:this.summaryLineItems,isShippingRequired:this.isShippingRequired}}}async function Xi({state:e=null,riskMetadata:t=null,summaryPayload:n=null,fetchInvoice:r=Di,fetchTransaction:a=Ui,fetchAccount:i=Gi,fetchInstruments:o=Ki}){try{var s,l,u,c,d,p;let g=null,y=null,v=null;null!==(s=e.options)&&void 0!==s&&s.transactionId&&(g=await a({data:{id:e.options.transactionId},state:e}),e.data.transaction=g);let b=null;var f,h,m;if(null!==(l=e.options)&&void 0!==l&&l.invoiceId||null!==(u=e.data)&&void 0!==u&&null!==(c=u.transaction)&&void 0!==c&&c.hasInvoice)b=await r({data:{id:(null===(f=e.options)||void 0===f?void 0:f.invoiceId)||(null===(h=e.data)||void 0===h||null===(m=h.transaction)||void 0===m?void 0:m.invoiceId)},state:e}),e.data.invoice=b;if(!t){const{riskMetadata:e}=await Pi();t=e}null!==(d=e.options)&&void 0!==d&&d.jwt&&([y,v]=await Promise.all([i({state:e}),o({state:e})])),e.data=new Ji({state:e,invoice:b,transaction:g,riskMetadata:t,account:y,availableInstruments:v});const[w,x]=await Promise.all([(null===(p=e.data)||void 0===p?void 0:p.readyToPay)||_i({riskMetadata:t,state:e}),e.options.items?fa({data:n,state:e}):null]);let k=null,S=null;try{k=await async function({state:e={},data:t={}}){return da({state:e},(async()=>{const n=t.lineItems||e.data.summaryLineItems,r={filter:""};if(n.length&&(r.filter=`id:${n.map((e=>e.planId)).join(",")}`),r.filter.length){const{items:t}=await e.storefront.plans.getAll(r);return t.map((({fields:e})=>new Ri(e)))}return[]}))}({state:e}),e.data.plans=k}catch(e){k=[]}try{S=await async function({state:e}){return da({state:e},(async()=>{var t;let n=[];e.data.plans&&(n=e.data.plans),null!==(t=e.data.invoice)&&void 0!==t&&t.items&&(n=e.data.invoice.items);const r={filter:""};if(n.length&&(r.filter=`id:${n.map((e=>e.productId)).join(",")}`),r.filter.length){const{items:t}=await e.storefront.products.getAll(r);return t.map((({fields:e})=>new Mi(e)))}return[]}))}({state:e})}catch(e){S=[]}return new Ji({state:e,readyToPay:w,previewPurchase:x,plans:k,products:S,invoice:b,transaction:g,riskMetadata:t})}catch(e){}return new Ji({})}async function Zi({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{}),state:i=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;i.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),i.loader.addDOMElement({section:"modal",el:p}),i.loader.startLoading({section:"modal",id:e});const f={options:i.options,...n},h=await new Qe({state:i,name:e,url:t,model:f,classListArray:r,container:p}),m=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),a(...e),h.destroy()}),300)};return h.bindEventListeners({close:m,loader:i.loader}),l||d.addEventListener("click",m),h}async function Yi({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};r?a.paymentInstrumentId=n:a.token=n,e.options.invoiceId&&(a.invoiceId=e.options.invoiceId),e.options.transactionId&&(a.transactionId=e.options.transactionId),e.options.money&&(a.websiteId=e.options.websiteId,a.amount=e.options.money.amount,a.currency=e.options.money.currency);let{fields:i}=await async function({data:e,state:t}){return da({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:a});return i={transaction:i,token:i.token||e.options.jwt},e.data.invoice&&(i.invoice=e.data.invoice),i}async function Qi({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return da({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function eo({state:e,payload:t}){try{var n,r;let a;return a=e.data.isPayment?await Yi({state:e,payload:t}):await Qi({state:e,payload:t}),null!==(n=a.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=a.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new Ji({state:e,...t}),Zi({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{Ue.purchaseCompleted.dispatch(e)}})}({state:e,fields:a}):Ue.purchaseCompleted.dispatch(a),a}catch(e){return Ge(e),e}}async function to({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:a}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};a?i.paymentInstrumentId=r:i.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return da({state:t},(async()=>{var n,r;const{fields:a}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(a.token||t.options.jwt);const i={id:a.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(i.data={...i.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(i.data.redirectUrl=`${i.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(i);return{instrument:a,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...i}});if(e.data=new Ji({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Zi({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{Ue.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ue.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return Ge(e),e}}function no({state:e,id:t}){const{Rebilly:n}=window,r=document.querySelector(`.rebilly-instruments-${t}-method`);function a(){if(!r.children.length){const r={"google-pay":"googlePay","pay-pal-billing-agreement":"paypal","apple-pay":"applePay"};r[t]?(n[r[t]].mount(`.rebilly-instruments-${t}-method`),"apple-pay"===t&&function(){const t=document.querySelector("#rebilly-apple-pay-button"),{applePayDisplayOptions:{buttonHeight:n}}=e.options.digitalWallet.applePay;t.style.margin="0px",t.style.width="100%",t.style.height=n,t.style.cursor="pointer"}()):console.warn(`method '${t}' is not supported`)}}null==n||n.on("ready",(()=>{a()})),null==n||n.on("error",(e=>{console.error(e)}))}var ro=y((function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",i="[object Function]",o="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[a]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[o]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof g&&g&&g.Object===Object&&g,d="object"==typeof self&&self&&self.Object===Object&&self,p=c||d||Function("return this")(),f=t&&!t.nodeType&&t,h=f&&e&&!e.nodeType&&e,m=h&&h.exports===f,y=m&&c.process,v=function(){try{var e=h&&h.require&&h.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=v&&v.isTypedArray;function w(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var x,k,S,A=Array.prototype,E=Function.prototype,$=Object.prototype,T=p["__core-js_shared__"],C=E.toString,I=$.hasOwnProperty,H=(x=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",F=$.toString,j=C.call(Object),P=RegExp("^"+C.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?p.Buffer:void 0,R=p.Symbol,M=p.Uint8Array,O=L?L.allocUnsafe:void 0,q=(k=Object.getPrototypeOf,S=Object,function(e){return k(S(e))}),B=Object.create,_=$.propertyIsEnumerable,z=A.splice,D=R?R.toStringTag:void 0,N=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),U=L?L.isBuffer:void 0,W=Math.max,V=Date.now,G=me(p,"Map"),K=me(Object,"create"),J=function(){function e(){}return function(t){if(!Te(t))return{};if(B)return B(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(e){var t=this.__data__=new Z(e);this.size=t.size}function ee(e,t){var n=ke(e),r=!n&&xe(e),a=!n&&!r&&Ae(e),i=!n&&!r&&!a&&Ie(e),o=n||r||a||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var u in e)!t&&!I.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ge(u,l))||s.push(u);return s}function te(e,t,n){(void 0!==n&&!we(e[t],n)||void 0===n&&!(t in e))&&ae(e,t,n)}function ne(e,t,n){var r=e[t];I.call(e,t)&&we(r,n)&&(void 0!==n||t in e)||ae(e,t,n)}function re(e,t){for(var n=e.length;n--;)if(we(e[n][0],t))return n;return-1}function ae(e,t,n){"__proto__"==t&&N?N(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(K){var r=t[e];return r===n?void 0:r}return I.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:I.call(t,e)},X.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=K&&void 0===t?n:t,this},Z.prototype.clear=function(){this.__data__=[],this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=re(t,e);return!(n<0)&&(n==t.length-1?t.pop():z.call(t,n,1),--this.size,!0)},Z.prototype.get=function(e){var t=this.__data__,n=re(t,e);return n<0?void 0:t[n][1]},Z.prototype.has=function(e){return re(this.__data__,e)>-1},Z.prototype.set=function(e,t){var n=this.__data__,r=re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(G||Z),string:new X}},Y.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return he(this,e).get(e)},Y.prototype.has=function(e){return he(this,e).has(e)},Y.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Q.prototype.clear=function(){this.__data__=new Z,this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Q.prototype.get=function(e){return this.__data__.get(e)},Q.prototype.has=function(e){return this.__data__.has(e)},Q.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Z){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Y(r)}return n.set(e,t),this.size=n.size,this};var ie,oe=function(e,t,n){for(var r=-1,a=Object(e),i=n(e),o=i.length;o--;){var s=i[ie?o:++r];if(!1===t(a[s],s,a))break}return e};function se(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=I.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var a=F.call(e);r&&(t?e[D]=n:delete e[D]);return a}(e):function(e){return F.call(e)}(e)}function le(e){return Ce(e)&&se(e)==a}function ue(e){return!(!Te(e)||function(e){return!!H&&H in e}(e))&&(Ee(e)?P:s).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Te(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&I.call(e,r))&&n.push(r);return n}function de(e,t,n,r,a){e!==t&&oe(t,(function(i,s){if(a||(a=new Q),Te(i))!function(e,t,n,r,a,i,s){var l=ve(e,n),u=ve(t,n),c=s.get(u);if(c)return void te(e,n,c);var d=i?i(l,u,n+"",e,t,s):void 0,p=void 0===d;if(p){var f=ke(u),h=!f&&Ae(u),m=!f&&!h&&Ie(u);d=u,f||h||m?ke(l)?d=l:Ce(w=l)&&Se(w)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(l):h?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=O?O(n):new e.constructor(n);return e.copy(r),r}(u,!0)):m?(p=!1,g=u,y=!0?(v=g.buffer,b=new v.constructor(v.byteLength),new M(b).set(new M(v)),b):g.buffer,d=new g.constructor(y,g.byteOffset,g.length)):d=[]:function(e){if(!Ce(e)||se(e)!=o)return!1;var t=q(e);if(null===t)return!0;var n=I.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==j}(u)||xe(u)?(d=l,xe(l)?d=function(e){return function(e,t,n,r){var a=!n;n||(n={});var i=-1,o=t.length;for(;++i<o;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?ae(n,s,l):ne(n,s,l)}return n}(e,He(e))}(l):Te(l)&&!Ee(l)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:J(q(e))}(u))):p=!1}var g,y,v,b;var w;p&&(s.set(u,d),a(d,u,r,i,s),s.delete(u));te(e,n,d)}(e,t,s,n,de,r,a);else{var l=r?r(ve(e,s),i,s+"",e,t,a):void 0;void 0===l&&(l=i),te(e,s,l)}}),He)}function pe(e,t){return be(function(e,t,n){return t=W(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=W(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(o),w(e,this,s)}}(e,t,Pe),e+"")}var fe=N?function(e,t){return N(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Pe;function he(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function ve(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=V(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function we(e,t){return e===t||e!=e&&t!=t}var xe=le(function(){return arguments}())?le:function(e){return Ce(e)&&I.call(e,"callee")&&!_.call(e,"callee")},ke=Array.isArray;function Se(e){return null!=e&&$e(e.length)&&!Ee(e)}var Ae=U||function(){return!1};function Ee(e){if(!Te(e))return!1;var t=se(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function $e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Ie=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&$e(e.length)&&!!u[se(e)]};function He(e){return Se(e)?ee(e,!0):ce(e)}var Fe,je=(Fe=function(e,t,n){de(e,t,n)},pe((function(e,t){var n=-1,r=t.length,a=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(a=Fe.length>3&&"function"==typeof a?(r--,a):void 0,i&&function(e,t,n){if(!Te(n))return!1;var r=typeof t;return!!("number"==r?Se(n)&&ge(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var o=t[n];o&&Fe(e,o,n,a)}return e})));function Pe(e){return e}e.exports=je}));const ao=e=>{var t,n;return{METHOD_ID:ze((null===(t=e.feature)||void 0===t?void 0:t.name)||e.method),METHOD_TYPE:le((null===(n=e.feature)||void 0===n?void 0:n.name)||e.method).replace("-","")}};async function io({state:e,methods:t,container:n}){const r=t.map((e=>{const{METHOD_ID:t}=ao(e);return t})),{Rebilly:a}=window;null!=a&&a.initialized||await(null==a?void 0:a.initialize(function({state:e,methodIds:t}={}){const{options:n,data:r}=e,a={style:n.themeFramepay,locale:(null==n?void 0:n.locale)||"auto",organizationId:n.organizationId,websiteId:n.websiteId,methods:r.readyToPay};var i,o;return t.includes("pay-pal-billing-agreement")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},r.amountAndCurrency),a.paypal=n.paymentInstruments.paypal),t.includes("google-pay")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},null===(i=n.digitalWallet.googlePay)||void 0===i?void 0:i.transactionData),a.googlePay=n.digitalWallet.googlePay.googlePayDisplayOptions),t.includes("apple-pay")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},null===(o=n.digitalWallet.applePay)||void 0===o?void 0:o.transactionData),a.applePay=n.digitalWallet.applePay.applePayDisplayOptions),n.publishableKey&&(a.publishableKey=n.publishableKey),n.jwt&&(a.jwt=n.jwt,a.sandbox="sandbox"===n.apiMode),a}({state:e,methodIds:r}))),r.forEach((t=>{("apple-pay"!==t||window.ApplePaySession)&&(n.innerHTML+=`\n <div class="rebilly-instruments-${t}-method"></div>\n `,no({state:e,id:t}))}));const i="sandbox"===e.options.apiMode?"https://forms-sandbox.secure-payments.app/approval-url?close=true":"https://forms.secure-payments.app/approval-url?close=true";null==a||a.on("token-ready",(t=>{var n,r,a;const o={websiteId:e.options.websiteId,billingAddress:t.billingAddress,redirectUrl:i,_raw:t};if(null!==(n=e.data)&&void 0!==n&&n.isShippingRequired&&(t.shippingAddress?o.deliveryAddress=t.shippingAddress:o.deliveryAddress=o.billingAddress),Array.isArray(null===(r=o.billingAddress)||void 0===r?void 0:r.emails)){const e=o.billingAddress.emails.find((e=>"main"===e.label));null!=e&&e.value&&(o.billingAddress.email=e.value)}if(Array.isArray(null===(a=o.deliveryAddress)||void 0===a?void 0:a.emails)){const e=o.deliveryAddress.emails.find((e=>"main"===e.label));null!=e&&e.value&&(o.deliveryAddress.email=e.value)}Ue.instrumentReady.dispatch(o)}))}async function oo({state:e}){const{EXPRESS_METHODS:t,METHODS:n}=c({state:e}),r=e.form.querySelector(".rebilly-instruments-method-selector");var a;r?(r.style.visibility="visible",r.style.height="auto"):e.form.innerHTML+=`\n<div class="rebilly-instruments-content">\n <div id="rebilly-instruments-error"></div>\n <div data-rebilly-instruments="express-method" class="rebilly-instruments-method-selector ${(a=e.options.paymentInstruments.compactExpressInstruments&&t.length)?"has-express-compact":""}">\n <div class="rebilly-instruments-express-methods ${a?"is-compact":""}">\n <span data-rebilly-i18n="form.expressCheckout" class="rebilly-instruments-express-methods-label">Express checkout</span>\n <div class="rebilly-instruments-express-methods-container"></div>\n </div>\n <div data-rebilly-instruments="divider" class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label" data-rebilly-i18n="form.or">Or</span>\n </div>\n </div>\n <div class="rebilly-instruments-methods"></div>\n</div>\n`;const i=document.querySelector(".rebilly-instruments-methods"),o=document.querySelector(".rebilly-instruments-express-methods-container");if(t.length?r||(e.options.digitalWallet=function({state:e,EXPRESS_METHODS:t}){var n;const r={},{paymentInstruments:a}=e.options,i={countryCode:e.options.countryCode,label:e.options.websiteId};if(null!==(n=e.data)&&void 0!==n&&n.amountAndCurrency){const{amount:t,currency:n}=e.data.amountAndCurrency;i.amount=t,i.currency=n}return t.forEach((e=>{var t,n;const{METHOD_TYPE:o}=ao(e);var s,l;"Google Pay"===(null===(t=e.feature)||void 0===t?void 0:t.name)&&(r[o]={transactionData:i,merchantConfig:{merchantName:e.feature.merchantName,merchantOrigin:e.feature.merchantOrigin},googlePayDisplayOptions:a.googlePay.displayOptions}),"Apple Pay"===(null===(n=e.feature)||void 0===n?void 0:n.name)&&(r[o]={transactionData:i,merchantConfig:{merchantName:null===(s=a.applePay)||void 0===s||null===(l=s.merchantConfig)||void 0===l?void 0:l.merchantName,merchantOrigin:window.location.hostname},applePayDisplayOptions:a.applePay.displayOptions})})),r}({state:e,EXPRESS_METHODS:t}),io({state:e,methods:t,container:o})):(o.style.display="none",document.querySelectorAll('[data-rebilly-instruments="divider"]').forEach((e=>{e.style.display="none"}))),n.length){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r="rebilly-instruments-form",a=await new Ye({name:r,url:`${n}`,container:i,model:t});a.bindEventListeners({loader:e.loader}),a.component.on(`${r}-confirm-purchase`,(t=>{eo({state:e,payload:t})})),a.component.on(`${r}-confirm-setup`,(t=>{to({state:e,payload:t})})),a.component.on("choose-another-method",(()=>{document.querySelectorAll('[data-rebilly-instruments="express-method"]').forEach((e=>{e.style.height="auto"})),a.component.call("route",{name:"method-switch"}),e.data.isPurchase&&ha({state:e}),a.component.call("update",t)})),e.iframeComponents.form=a}else i.style.display="none",document.querySelectorAll('[data-rebilly-instruments="divider"]').forEach((e=>{e.style.display="none"}))}function so({element:e="div",attributes:t={},content:n=null,target:r="body",insertMethod:a="append"}={}){const i=document.createElement(e);Object.entries(t).forEach((([e,t])=>{i.setAttribute(e,t)})),n&&(i.innerHTML=n),document[r][a](i)}var lo=({element:e="",options:t={}})=>{if("form"!==e&&"summary"!==e)throw new Error('element must be "form" or "summary"');return function({prop:e,propName:t="Mounting",isRequired:n=!0}={}){let r;if(void 0===e)throw new Error('processPropertyDOMElement: Missing argument "prop"');if("string"==typeof(a=e)&&a.match(/([.#][_a-z]+[_a-z0-9-:\\]*)/gi))r=document.querySelector(e);else{if(!d(e))throw new Error(`Please provide a valid CSS class, id or DOM element for "${t}" property`);r=e}var a;if(!r&&n)throw new Error(`Could not find DOM element with CSS class or id "${e}" to mount ${t}`);return r}({prop:t[e]?t[e]:"summary"===e?".rebilly-instruments-summary":".rebilly-instruments",propName:e,isRequired:["form"].includes(e)})},uo=({options:{publishableKey:e,orgnizationId:t,apiMode:n,_dev:r}})=>{const a={orgnizationId:t,mode:n||"live"};return e&&(a.publishableKey=e),r&&(a.liveUrl=r.liveUrl||"https://api.rebilly.com",a.sandboxUrl=r.sandboxUrl||"https://api-sandbox.rebilly.com"),((e={})=>new pa(e))(a)};function co(e){this.message=e}co.prototype=new Error,co.prototype.name="InvalidCharacterError";var po="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new co("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,a=0,i=0,o="";r=t.charAt(i++);~r&&(n=a%4?64*n+r:r,a++%4)?o+=String.fromCharCode(255&n>>(-2*a&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function fo(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(po(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return po(t)}}function ho(e){this.message=e}ho.prototype=new Error,ho.prototype.name="InvalidTokenError";const mo={countryCode:"US",locale:"auto",theme:{labels:"stacked"},paymentInstruments:{address:{name:"default",region:"default",hide:[],show:[],require:[]},compactExpressInstruments:!1,googlePay:{displayOptions:{buttonColor:"black",buttonType:"short",buttonHeight:"44px"}},applePay:{displayOptions:{buttonColor:"black",buttonType:"plain",buttonHeight:"44px"}},paymentCard:{popup:!1},paypal:{buttonHeight:44}},transactionType:"purchase",features:{autoConfirmation:!0,autoResult:!0}};var go=({options:e={}}={})=>{!function(e){const t=[e.jwt,e.items,e.invoiceId,e.money,e.transactionId].filter((e=>e));if(0===t.length)throw new Error("Must provide purchase data");if(t.length>1){if(e.jwt&&(e.invoiceId||e.transactionId))return;throw new Error("Must provide only one purchase data type")}}(e);const t={paymentMethodsUrl:e._dev?e._dev.paymentMethodsUrl||"https://forms.local.rebilly.dev:3000":"https://forms.secure-payments.app"},n=ro({...mo},{apiMode:e.apiMode,i18n:e.i18n,theme:e.theme,css:e.css,locale:e.locale,countryCode:e.countryCode,features:e.features,paymentInstruments:e.paymentInstruments,transactionType:e.transactionType,_computed:t});if(e.publishableKey)Object.entries({organizationId:e.organizationId,publishableKey:e.publishableKey,websiteId:e.websiteId}).forEach((([e,t])=>{n[e]=t}));else if(e.jwt){n.jwt=e.jwt;const{merchant:t,claims:{transactionId:r,invoiceId:a}}=function(e,t){if("string"!=typeof e)throw new ho("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(fo(e.split(".")[n]))}catch(e){throw new ho("Invalid token specified: "+e.message)}}(n.jwt);n.organizationId=t,r&&(n.transactionId=r),a&&(n.invoiceId=a)}return["items","money","invoiceId","transactionId","jwt","_dev"].forEach((t=>{e[t]&&(n[t]=e[t])})),n};async function yo(e={}){const{_dev:t}=e.options||{},n={script:(null==t?void 0:t.framePayScriptLink)||"https://framepay.rebilly.com/rebilly.js",style:(null==t?void 0:t.framePayStyleLink)||"https://framepay.rebilly.com/rebilly.css"};return new Promise((e=>{const t=document.createElement("link");t.setAttribute("href",n.style),t.setAttribute("rel","stylesheet"),document.head.prepend(t);const r=document.createElement("script");r.setAttribute("src",n.script),r.onload=()=>e(),document.head.append(r)}))}var vo=y((function(e,t){e.exports=function(){var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},t=new RegExp("[^#a-f\\d]","gi"),n=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),r=new RegExp(/^#([a-f0-9]{3,4}|[a-f0-9]{4}(?:[a-f0-9]{2}){1,2})\b$/,"i"),a="-?\\d*(?:\\.\\d+)",i="("+a+"?)",o="("+a+"?%)",s=("^\n hsla?\\(\n \\s*(-?\\d*(?:\\.\\d+)?(?:deg|rad|turn)?)\\s*,\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),l=new RegExp(s),u=("^\n hsla?\\(\n \\s*(-?\\d*(?:\\.\\d+)?(?:deg|rad|turn)?)\\s*\n \\s+"+o+"\n \\s+"+o+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),c=new RegExp(u),d=("^\n rgba?\\(\n \\s*"+i+"\\s*,\n \\s*"+i+"\\s*,\n \\s*"+i+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),p=new RegExp(d),f=("^\n rgba?\\(\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),h=new RegExp(f),m=("^\n rgba?\\(\n \\s*"+i+"\n \\s+"+i+"\n \\s+"+i+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n$\n").replace(/\n|\s/g,""),g=new RegExp(m),y=("^\n rgba?\\(\n \\s*"+o+"\n \\s+"+o+"\n \\s+"+o+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n$\n").replace(/\n|\s/g,""),v=new RegExp(y),b=new RegExp(/^transparent$/,"i"),w=function(e,t,n){return Math.min(Math.max(t,e),n)},x=function(e){var t=e;return"number"!=typeof t&&(t=t.endsWith("%")?255*parseFloat(t)/100:parseFloat(t)),w(Math.round(t),0,255)},k=function(e){return w(parseFloat(e),0,100)};function S(e){var t=e;return"number"!=typeof t&&(t=t.endsWith("%")?parseFloat(t)/100:parseFloat(t)),w(t,0,1)}function A(e){var r=function(e,r){if(void 0===r&&(r={}),"string"!=typeof e||t.test(e)||!n.test(e))throw new TypeError("Expected a valid hex string");var a=1;8===(e=e.replace(/^#/,"")).length&&(a=parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(a=parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var i=parseInt(e,16),o=i>>16,s=i>>8&255,l=255&i;return"array"===r.format?[o,s,l,a]:{red:o,green:s,blue:l,alpha:a}}(e,{format:"array"});return E([null,r[0],r[1],r[2],r[3]])}function E(e){var t=e[1],n=e[2],r=e[3],a=e[4];return void 0===a&&(a=1),{type:"rgb",values:[t,n,r].map(x),alpha:S(null===a?1:a)}
|
|
46
|
+
*/function Wr(e,t){switch(Nr(e)){case"object":return function(e,t){if(zr(e)){var n={};return Ur(e,(function(e,n){this[n]=Wr(e,t)}),n),n}return t?t(e):e}(e,t);case"array":return function(e,t){var n=e.length,r=[],a=-1;for(;++a<n;)r[a]=Wr(e[a],t);return r}(e,t);default:return Dr(e)}}var Vr=Wr;class Gr{constructor({id:e=null,created:t=null}={}){this.id=e||((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})(),this.created=t||(new Date).getTime(),this.cancelSource=yr.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,vr(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class Kr{constructor(){if(Kr.instance)return Kr.instance;this.requests={},Kr.instance=this}getAll(){return Object.values(this.requests)}getById(e){return this.requests[e]}deleteById(e){this.requests[e]&&delete this.requests[e]}save(){const e=new Gr;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var Jr=new Kr;class Xr{}Mt(Xr,"cancelById",((e,t)=>{try{Jr.getById(e).cancel(t),Jr.deleteById(e)}catch(e){}})),Mt(Xr,"cancelAll",(e=>Jr.getAll().forEach((t=>{t.cancel(e),Jr.deleteById(t.id)}))));var Zr=(...e)=>Xr.cancelAll(...e);const Yr={request:"request",response:"response"},Qr=e=>{if(!Object.values(Yr).includes(e))throw new Error(`There is no such interceptor type as "${e}"`);return!0};function ea({options:e}){const t=yr.create({baseURL:n(),timeout:e.requestTimeout,headers:r()});function n(){let t=e.isSandbox?e.apiEndpoints.sandbox:e.apiEndpoints.live;return e.apiVersion&&(t=`${t}/${e.apiVersion}`),e.organizationId&&(t=`${t}/organizations/${e.organizationId}`),`${t}`}function r(){const t={"REB-API-CONSUMER":"RebillySDK/JS-SDK 47.5.0"};return e.apiKey&&(t["REB-APIKEY"]=e.apiKey),t}function a(){return Vr(t.defaults.headers)}function i(e,{thenDelegate:n,catchDelegate:r=(()=>{})}){return Qr(e)&&t.interceptors[Yr[e]].use(n,r)}function o(e,n){return Qr(e)&&t.interceptors[Yr[e]].eject(n)}function s({request:e,isCollection:t,config:n}){const r=u(n),{id:a,cancelToken:i}=Jr.save();r.cancelToken=i;const o=async function(){try{return function({response:e,isCollection:t,config:n}){if(t)return new xr(e,n);return new br(e,n)}({response:await e(r),isCollection:t,config:r})}catch(e){return l({error:e,config:r})}finally{Jr.deleteById(a)}}();return o.cancel=e=>Xr.cancelById(a,e),o}function l({error:e}){if(yr.isCancel(e))throw new Ar.RebillyCanceledError(e);if(e.response)switch(Number(e.response.status)){case 401:throw new Ar.RebillyForbiddenError(e);case 404:throw new Ar.RebillyNotFoundError(e);case 405:throw new Ar.RebillyMethodNotAllowedError(e);case 409:throw new Ar.RebillyConflictError(e);case 422:throw new Ar.RebillyValidationError(e);default:throw new Ar.RebillyRequestError(e)}if("ECONNABORTED"===e.code)throw new Ar.RebillyTimeoutError(e);throw new Ar.RebillyRequestError(e)}function u(e={}){const t=function(e){return void 0!==e.params&&(e.params=Object.keys(e.params).filter((t=>null!==e.params[t]&&""!==e.params[t])).reduce(((t,n)=>(t[n]=e.params[n],t)),{})),e}(e);return Rt({},t)}function c(e,n={}){return s({request:n=>t.get(e,n),config:{params:n}})}function d(e,n,r={}){let i={};return!1===r.authenticate&&(i={headers:a()},delete i.headers.common["REB-APIKEY"],delete i.headers.common.Authorization),r.params&&(i.params=Rt({},r.params)),s({request:r=>t.post(e,n,r),config:i})}function p(e,n,r={}){return s({request:r=>t.put(e,n,r),config:{params:r}})}return{getInstance:function(){return t},addRequestInterceptor:function({thenDelegate:e,catchDelegate:t=(()=>{})}){return i(Yr.request,{thenDelegate:e,catchDelegate:t})},removeRequestInterceptor:function(e){o(Yr.request,e)},addResponseInterceptor:function({thenDelegate:e,catchDelegate:t=(()=>{})}){return i(Yr.response,{thenDelegate:e,catchDelegate:t})},removeResponseInterceptor:function(e){o(Yr.response,e)},setTimeout:function(n){e.requestTimeout=Number(n),t.defaults.timeout=e.requestTimeout},setProxyAgent:function({host:e,port:n,auth:r}){t.defaults.proxy={host:e,port:n,auth:r}},setSessionToken:function(n=e.jwt){const r=a();e.apiKey=null,e.jwt=n,delete r.common["REB-APIKEY"],r.common.Authorization=`Bearer ${n}`,t.defaults.headers=r},setPublishableKey:function(n=e.publishableKey){const r=a();e.publishableKey=n,r.common.Authorization=`${n}`,t.defaults.headers=r},setEndpoints:function({live:r=null,sandbox:a=null}){r&&(e.apiEndpoints.live=r),a&&(e.apiEndpoints.sandbox=a),t.defaults.baseURL=n()},get:c,getAll:function(e,n){return s({request:n=>t.get(e,n),config:{params:n},isCollection:!0})},post:d,put:p,patch:function(e,n){return s({request:r=>t.patch(e,n,r),config:{}})},delete:function(e){return s({request:n=>t.delete(e,n),config:{}})},deleteAll:function(e,n){return s({request:n=>t.delete(e,n),config:{data:Rt({},n)}})},create:async function(e,t,n,r={}){if(""===t)return d(e,n,{params:r});try{if(200===(await c(e)).response.status)throw new Ar.RebillyConflictError({message:"Member already exists. Please use a different ID."})}catch(t){if("RebillyNotFoundError"===t.name)return p(e,n,r);throw t}},download:async function(e,n){const r=u(n);try{const n=await t.get(e,r);return new kr(n,r)}catch(e){return l({error:e,config:r})}}}}const ta={Accept:"text/csv"},na={Accept:"application/pdf"};class ra{constructor({apiHandler:e}){this.account=function({apiHandler:e}){return{activate:({token:t})=>e.post(`activation/${t}`,{authenticate:!1}),forgotPassword:({data:t})=>e.post("forgot-password",t,{authenticate:!1}),logout:()=>e.post("logout"),signIn:({data:t})=>e.post("signin",t,{authenticate:!1}),signUp:({data:t})=>e.post("signup",t,{authenticate:!1})}}({apiHandler:e}),this.aml=function({apiHandler:e}){return{getAll({firstName:t,lastName:n,dob:r=null,country:a=null}){const i={firstName:t,lastName:n,dob:r,country:a};return e.getAll("aml",i)}}}({apiHandler:e}),this.apiKeys=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null}={}){const a={limit:t,offset:n,sort:r};return e.getAll("api-keys",a)},create:({id:t="",data:n})=>e.create(`api-keys/${t}`,t,n),get:({id:t})=>e.get(`api-keys/${t}`),update:({id:t,data:n})=>e.put(`api-keys/${t}`,n),delete:({id:t})=>e.delete(`api-keys/${t}`)}}({apiHandler:e}),this.applicationInstances=function({apiHandler:e}){return{get:({applicationId:t})=>e.get(`application-instances/${t}`),upsert:({applicationId:t,data:n})=>e.put(`application-instances/${t}`,n),delete:({applicationId:t})=>e.delete(`application-instances/${t}`)}}({apiHandler:e}),this.applications=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("applications",l)},create:({data:t})=>e.post("applications",t),get:({id:t})=>e.get(`applications/${t}`),getInstances:({id:t})=>e.getAll(`applications/${t}/instances`),getInstance:({id:t,organizationId:n})=>e.get(`applications/${t}/instances/${n}`)}}({apiHandler:e}),this.balanceTransactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("balance-transactions",r)},get:({id:t})=>e.get(`balance-transactions/${t}`)}}({apiHandler:e}),this.billingPortals=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("billing-portals",o)},create:({id:t="",data:n})=>e.create(`billing-portals/${t}`,t,n),get:({id:t})=>e.get(`billing-portals/${t}`),update:({id:t,data:n})=>e.put(`billing-portals/${t}`,n),delete:({id:t})=>e.delete(`billing-portals/${t}`)}}({apiHandler:e}),this.blocklists=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("blocklists",o)},create:({id:t="",data:n})=>e.create(`blocklists/${t}`,t,n),get:({id:t})=>e.get(`blocklists/${t}`),delete:({id:t})=>e.delete(`blocklists/${t}`)}}({apiHandler:e}),this.broadcastMessages=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null}={}){const i={limit:t,offset:n,sort:r,filter:a};return e.getAll("broadcast-messages",i)},create:({data:t})=>e.post("broadcast-messages",t),get:({id:t})=>e.get(`broadcast-messages/${t}`),delete:({id:t})=>e.delete(`broadcast-messages/${t}`),update:({id:t,data:n})=>e.patch(`broadcast-messages/${t}`,n)}}({apiHandler:e}),this.checkoutForms=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("checkout-forms",o)},create:({id:t="",data:n})=>e.create(`checkout-forms/${t}`,t,n),get:({id:t})=>e.get(`checkout-forms/${t}`),update:({id:t,data:n})=>e.put(`checkout-forms/${t}`,n),delete:({id:t})=>e.delete(`checkout-forms/${t}`)}}({apiHandler:e}),this.coupons=function({apiHandler:e}){return{getAllRedemptions({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("coupons-redemptions",o)},redeem:({data:t})=>e.post("coupons-redemptions",t),getRedemption:({id:t})=>e.get(`coupons-redemptions/${t}`),cancelRedemption:({id:t})=>e.post(`coupons-redemptions/${t}/cancel`),getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("coupons",o)},create:({id:t="",data:n})=>e.create(`coupons/${t}`,t,n),get:({id:t})=>e.get(`coupons/${t}`),update:({id:t,data:n})=>e.put(`coupons/${t}`,n),setExpiration:({id:t,data:n})=>e.post(`coupons/${t}/expiration`,n)}}({apiHandler:e}),this.credentialHashes=function({apiHandler:e}){return{createAWSSESCredential:({data:t})=>e.post("credential-hashes/aws-ses",t),getAWSSESCredential:({hash:t})=>e.get(`credential-hashes/aws-ses/${t}`),updateAWSSESCredential:({hash:t,data:n})=>e.patch(`credential-hashes/aws-ses/${t}`,n),createEmailCredential:({data:t})=>e.post("credential-hashes/emails",t),getEmailCredential:({hash:t})=>e.get(`credential-hashes/emails/${t}`),patchEmailCredential:({hash:t,data:n})=>e.patch(`credential-hashes/emails/${t}`,n),createMailgunCredential:({data:t})=>e.post("credential-hashes/mailgun",t),getMailgunCredential:({hash:t})=>e.get(`credential-hashes/mailgun/${t}`),patchMailgunCredential:({hash:t,data:n})=>e.patch(`credential-hashes/mailgun/${t}`,n),getAllOAuth2Credentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/oauth2",o)},createOAuth2Credential:({data:t})=>e.post("credential-hashes/oauth2",t),getOAuth2Credential:({hash:t})=>e.get(`credential-hashes/oauth2/${t}`),updateOAuth2Credential:({hash:t,data:n})=>e.patch(`credential-hashes/oauth2/${t}`,n),getOAuth2CredentialItems({hash:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,fields:o=null,sort:s=null}){const l={limit:n,offset:r,filter:a,q:i,fields:o,sort:s};return e.getAll(`credential-hashes/oauth2/${t}/items`,l)},getAllPlaidCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/plaid",o)},createPlaidCredential:({data:t})=>e.post("credential-hashes/plaid",t),getPlaidCredential:({hash:t})=>e.get(`credential-hashes/plaid/${t}`),updatePlaidCredential:({hash:t,data:n})=>e.patch(`credential-hashes/plaid/${t}`,n),createPostmarkCredential:({data:t})=>e.post("credential-hashes/postmark",t),getPostmarkCredential:({hash:t})=>e.get(`credential-hashes/postmark/${t}`),patchPostmarkCredential:({hash:t,data:n})=>e.patch(`credential-hashes/postmark/${t}`,n),createSendGridCredential:({data:t})=>e.post("credential-hashes/sendgrid",t),getSendGridCredential:({hash:t})=>e.get(`credential-hashes/sendgrid/${t}`),patchSendGridCredential:({hash:t,data:n})=>e.patch(`credential-hashes/sendgrid/${t}`,n),createWebhookCredential:({data:t})=>e.post("credential-hashes/webhooks",t),getWebhookCredential:({hash:t})=>e.get(`credential-hashes/webhooks/${t}`),patchWebhookCredential:({hash:t,data:n})=>e.patch(`credential-hashes/webhooks/${t}`,n),getAllExperianCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/experian",o)},createExperianCredential:({data:t})=>e.post("credential-hashes/experian",t),getExperianCredential:({hash:t})=>e.get(`credential-hashes/experian/${t}`),updateExperianCredential:({hash:t,data:n})=>e.patch(`credential-hashes/experian/${t}`,n),getAllTaxJarCredentials({filter:t=null,limit:n=null,offset:r=null,sort:a=null,q:i=null}={}){const o={filter:t,limit:n,offset:r,sort:a,q:i};return e.getAll("credential-hashes/taxjar",o)},createTaxJarCredential:({data:t})=>e.post("credential-hashes/taxjar",t),getTaxJarCredential:({hash:t})=>e.get(`credential-hashes/taxjar/${t}`),updateTaxJarCredential:({hash:t,data:n})=>e.patch(`credential-hashes/taxjar/${t}`,n)}}({apiHandler:e}),this.customDomains=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("custom-domains",o)},create:({data:t})=>e.post("custom-domains",t),get:({domain:t})=>e.get(`custom-domains/${t}`),delete:({domain:t})=>e.delete(`custom-domains/${t}`)}}({apiHandler:e}),this.customFields=function({apiHandler:e}){return{getAll({resource:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.getAll(`custom-fields/${t}`,a)},get:({resource:t,name:n})=>e.get(`custom-fields/${t}/${n}`),create:({resource:t,name:n,data:r})=>e.put(`custom-fields/${t}/${n}`,r),update:({resource:t,name:n,data:r})=>e.put(`custom-fields/${t}/${n}`,r)}}({apiHandler:e}),this.customerAuthentication=function({apiHandler:e}){return{getAuthOptions:()=>e.get("authentication-options"),updateAuthOptions:({data:t})=>e.put("authentication-options",t),getAllAuthTokens({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("authentication-tokens",r)},login:({data:t})=>e.post("authentication-tokens",t),verify:({token:t})=>e.get(`authentication-tokens/${t}`),logout:({token:t})=>e.delete(`authentication-tokens/${t}`),exchangeToken:({token:t,data:n})=>e.post(`authentication-tokens/${t}/exchange`,n),getAllCredentials({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("credentials",r)},createCredential:({id:t="",data:n})=>e.create(`credentials/${t}`,t,n),getCredential:({id:t})=>e.get(`credentials/${t}`),updateCredential:({id:t,data:n})=>e.put(`credentials/${t}`,n),deleteCredential:({id:t})=>e.delete(`credentials/${t}`),getAllResetPasswordTokens({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("password-tokens",r)},createResetPasswordToken:({data:t})=>e.post("password-tokens",t),getResetPasswordToken:({id:t})=>e.get(`password-tokens/${t}`),deleteResetPasswordToken:({id:t})=>e.delete(`password-tokens/${t}`)}}({apiHandler:e}),this.customers=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("customers",l)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`customers/${t}`,t,n,a)},get({id:t,expand:n=null,fields:r=null}){const a={expand:n,fields:r};return e.get(`customers/${t}`,a)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`customers/${t}`,n,a)},merge:({id:t,targetCustomerId:n})=>e.delete(`customers/${t}?targetCustomerId=${n}`),getAml:({id:t})=>e.getAll(`customers/${t}/aml`),getLeadSource:({id:t})=>e.get(`customers/${t}/lead-source`),createLeadSource:({id:t,data:n})=>e.put(`customers/${t}/lead-source`,n),updateLeadSource:({id:t,data:n})=>e.put(`customers/${t}/lead-source`,n),deleteLeadSource:({id:t})=>e.delete(`customers/${t}/lead-source`),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`customers/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`customers/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`customers/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`customers/${t}/timeline/${n}`),getAllUpcomingInvoices({id:t,expand:n=null}){const r={expand:n};return e.getAll(`customers/${t}/upcoming-invoices`,r)},getCustomerEddScore:({id:t})=>e.get(`customers/${t}/edd-score`),patchCustomerEddScore:({id:t,data:n})=>e.patch(`customers/${t}/edd-score`,n),getEddTimelineCollection({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`customers/${t}/edd-timeline`,s)},createEddTimelineComment:({id:t,data:n})=>e.post(`customers/${t}/edd-timeline`,n),GetEddSearchResults:({id:t})=>e.get(`customers/${t}/edd-search-results`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("customers",s)}}}({apiHandler:e}),this.digitalWallets=function({apiHandler:e}){return{create:({data:t})=>e.post("digital-wallets/onboarding/apple-pay",t),validate:({data:t})=>e.post("digital-wallets/validation",t)}}({apiHandler:e}),this.disputes=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("disputes",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`disputes/${t}`,t,n,a)},get:({id:t})=>e.get(`disputes/${t}`),update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`disputes/${t}`,n,a)},downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("disputes",s)}}}({apiHandler:e}),this.emailDeliverySettings=function({apiHandler:e}){return{verify:({token:t})=>e.put(`email-delivery-setting-verifications/${t}`),getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null}={}){const o={limit:t,offset:n,filter:r,sort:a,q:i};return e.getAll("email-delivery-settings",o)},create:({data:t})=>e.post("email-delivery-settings",t),get:({id:t})=>e.get(`email-delivery-settings/${t}`),delete:({id:t})=>e.delete(`email-delivery-settings/${t}`),update:({id:t,data:n})=>e.patch(`email-delivery-settings/${t}`,n),resendVerification:({id:t})=>e.post(`email-delivery-settings/${t}/resend-email-verification`)}}({apiHandler:e}),this.emailMessages=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,q:r=null,sort:a=null,filter:i=null}={}){const o={limit:t,offset:n,q:r,sort:a,filter:i};return e.getAll("email-messages",o)},create:({data:t})=>e.post("email-messages",t),get:({id:t})=>e.get(`email-messages/${t}`),delete:({id:t})=>e.delete(`email-messages/${t}`),send:({id:t,data:n={status:"outbox"}})=>e.patch(`email-messages/${t}`,n)}}({apiHandler:e}),this.emailNotifications=function({apiHandler:e}){return{getAll:()=>e.getAll("email-notifications")}}({apiHandler:e}),this.events=function({apiHandler:e}){return{getAll:()=>e.getAll("events"),get:({eventType:t})=>e.get(`events/${t}`),getRules:({eventType:t})=>e.get(`events/${t}/rules`),createRules:({eventType:t,data:n})=>e.put(`events/${t}/rules`,n),updateRules:({eventType:t,data:n})=>e.put(`events/${t}/rules`,n),getAllTimelineMessages({eventType:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`events/${t}/timeline`,s)},createTimelineComment:({eventType:t,data:n})=>e.post(`events/${t}/timeline`,n),getTimelineMessage:({eventType:t,messageId:n})=>e.get(`events/${t}/timeline/${n}`),deleteTimelineMessage:({eventType:t,messageId:n})=>e.delete(`events/${t}/timeline/${n}`),getRulesHistory({eventType:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,sort:o=null,fields:s=null,expand:l=null}){const u={limit:n,offset:r,filter:a,q:i,sort:o,fields:s,expand:l};return e.getAll(`events/${t}/rules/history`,u)},getRulesVersionNumber({eventType:t,version:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/history/${n}`,i)},getRulesVersionDetail({eventType:t,version:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/versions/${n}`,i)},getAllDraftRulesets({eventType:t,limit:n=null,offset:r=null,filter:a=null,q:i=null,sort:o=null,fields:s=null,expand:l=null}){const u={limit:n,offset:r,filter:a,q:i,sort:o,fields:s,expand:l};return e.getAll(`events/${t}/rules/drafts`,u)},createDraftRuleset:({eventType:t,data:n})=>e.post(`events/${t}/rules/drafts`,n),getDraftRuleset({eventType:t,id:n,fields:r=null,expand:a=null}){const i={fields:r,expand:a};return e.get(`events/${t}/rules/drafts/${n}`,i)},updateDraftRuleset:({eventType:t,id:n,data:r})=>e.put(`events/${t}/rules/drafts/${n}`,r),deleteDraftRuleset:({eventType:t,id:n})=>e.delete(`events/${t}/rules/drafts/${n}`)}}({apiHandler:e}),this.fees=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("fees",r)},create:({id:t="",data:n})=>e.create(`fees/${t}`,t,n),get:({id:t})=>e.get(`fees/${t}`),upsert:({id:t,data:n})=>e.put(`fees/${t}`,n),patch:({id:t,data:n})=>e.patch(`fees/${t}`,n)}}({apiHandler:e}),this.files=function({apiHandler:e}){return{getAllAttachments({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("attachments",l)},attach({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`attachments/${t}`,t,n,a)},getAttachment:({id:t})=>e.get(`attachments/${t}`),updateAttachment({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`attachments/${t}`,n,a)},detach:({id:t})=>e.delete(`attachments/${t}`),getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,expand:i=null,fields:o=null,sort:s=null}={}){const l={limit:t,offset:n,filter:r,q:a,expand:i,fields:o,sort:s};return e.getAll("files",l)},upload:({fileObject:t})=>e.post("files",t),get:({id:t})=>e.get(`files/${t}`),update:({id:t,data:n})=>e.put(`files/${t}`,n),delete:({id:t})=>e.delete(`files/${t}`),download:({id:t})=>e.download(`files/${t}/download`,{responseType:"arraybuffer"}),detachAndDelete({id:t}){const n={filter:`fileId:${t}`};let r=[];const a=(async()=>{const a=this.getAllAttachments(n);r.push(a);const i=(await a).items.map((e=>this.detach({id:e.fields.id})));r=[...r,i],await Promise.all(i);const o=e.delete(`files/${t}`);return r.push(o),o})();return a.cancel=()=>{r.forEach((e=>e.cancel()))},a},uploadAndUpdate({fileObject:e,data:t={description:"",tags:[""]}}){const n=[],r=(async()=>{const r=this.upload({fileObject:e});n.push(r),await r;const a={name:r.name,extension:r.extension,description:t.description,tags:t.tags,url:""},i=this.update({id:r.fields.id,data:a});return n.push(i),i})();return r.cancel=()=>{n.forEach((e=>e.cancel()))},r}}}({apiHandler:e}),this.gatewayAccounts=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null,fields:o=null}={}){const s={limit:t,offset:n,sort:r,filter:a,q:i,fields:o};return e.getAll("gateway-accounts",s)},create:({id:t="",data:n})=>e.create(`gateway-accounts/${t}`,t,n),get:({id:t})=>e.get(`gateway-accounts/${t}`),update:({id:t,data:n})=>e.patch(`gateway-accounts/${t}`,n),delete:({id:t})=>e.delete(`gateway-accounts/${t}`),close:({id:t})=>e.post(`gateway-accounts/${t}/close`),disable:({id:t})=>e.post(`gateway-accounts/${t}/disable`),getAllDowntimeSchedules({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null}){const o={limit:n,offset:r,filter:a,sort:i};return e.getAll(`gateway-accounts/${t}/downtime-schedules`,o)},createDowntimeSchedule:({id:t,data:n})=>e.post(`gateway-accounts/${t}/downtime-schedules`,n),getDowntimeSchedule:({id:t,downtimeId:n})=>e.get(`gateway-accounts/${t}/downtime-schedules/${n}`),updateDowntimeSchedule:({id:t,downtimeId:n,data:r})=>e.put(`gateway-accounts/${t}/downtime-schedules/${n}`,r),deleteDowntimeSchedule:({id:t,downtimeId:n})=>e.delete(`gateway-accounts/${t}/downtime-schedules/${n}`),enable:({id:t})=>e.post(`gateway-accounts/${t}/enable`),getAllVolumeLimits:({id:t})=>e.getAll(`gateway-accounts/${t}/limits`),getVolumeLimit:({id:t,limitId:n})=>e.get(`gateway-accounts/${t}/limits/${n}`),updateVolumeLimit:({id:t,limitId:n,data:r})=>e.put(`gateway-accounts/${t}/limits/${n}`,r),deleteVolumeLimit:({id:t,limitId:n})=>e.delete(`gateway-accounts/${t}/limits/${n}`),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`gateway-accounts/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`gateway-accounts/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`gateway-accounts/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`gateway-accounts/${t}/timeline/${n}`),checkCredentials:({id:t})=>e.post(`gateway-accounts/${t}/check-credentials`),getFinancialSettings:({id:t})=>e.get(`gateway-accounts/${t}/financial-settings`),setFinancialSettings:({id:t,data:n})=>e.put(`gateway-accounts/${t}/financial-settings`,n)}}({apiHandler:e}),this.integrations=function({apiHandler:e}){return{getAll:()=>e.getAll("integrations"),get:({label:t})=>e.get(`integrations/${t}`)}}({apiHandler:e}),this.invoices=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("invoices",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`invoices/${t}`,t,n,a)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`invoices/${t}`,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`invoices/${t}`,n,a)},getAllInvoiceItems({id:t,limit:n=null,offset:r=null,expand:a=null}){const i={limit:n,offset:r,expand:a};return e.getAll(`invoices/${t}/items`,i)},createInvoiceItem:({id:t,data:n})=>e.post(`invoices/${t}/items`,n),getInvoiceItem:({id:t,itemId:n})=>e.get(`invoices/${t}/items/${n}`),updateInvoiceItem:({id:t,itemId:n,data:r})=>e.put(`invoices/${t}/items/${n}`,r),deleteInvoiceItem:({id:t,itemId:n})=>e.delete(`invoices/${t}/items/${n}`),issue:({id:t,data:n})=>e.post(`invoices/${t}/issue`,n),abandon:({id:t})=>e.post(`invoices/${t}/abandon`),void:({id:t})=>e.post(`invoices/${t}/void`),recalculate:({id:t})=>e.post(`invoices/${t}/recalculate`),reissue:({id:t,data:n})=>e.post(`invoices/${t}/reissue`,n),getAllTransactionAllocations({id:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.getAll(`invoices/${t}/transaction-allocations`,a)},applyTransaction:({id:t,data:n})=>e.post(`invoices/${t}/transaction`,n),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`invoices/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`invoices/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`invoices/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`invoices/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("invoices",s)},downloadPDF({id:t}){const n={headers:na,responseType:"arraybuffer"};return e.download(`invoices/${t}`,n)}}}({apiHandler:e}),this.kycDocuments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("kyc-documents",i)},create:({id:t="",data:n})=>e.create(`kyc-documents/${t}`,t,n),get:({id:t})=>e.get(`kyc-documents/${t}`),update:({id:t,data:n})=>e.put(`kyc-documents/${t}`,n),accept:({id:t})=>e.post(`kyc-documents/${t}/acceptance`),matches:({id:t,data:n})=>e.post(`kyc-documents/${t}/matches`,n),reject:({id:t,data:n})=>e.post(`kyc-documents/${t}/rejection`,n),review:({id:t})=>e.post(`kyc-documents/${t}/review`),startReview:({id:t})=>e.post(`kyc-documents/${t}/start-review`),stopReview:({id:t})=>e.post(`kyc-documents/${t}/stop-review`)}}({apiHandler:e}),this.kycRequests=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("kyc-requests",i)},create:({data:t})=>e.post("kyc-requests",t),get:({id:t})=>e.get(`kyc-requests/${t}`),delete:({id:t})=>e.delete(`kyc-requests/${t}`),update:({id:t,data:n})=>e.patch(`kyc-requests/${t}`,n)}}({apiHandler:e}),this.kycSettings=function({apiHandler:e}){return{updateKycSettings:({data:t})=>e.put("kyc-settings",t)}}({apiHandler:e}),this.lists=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,fields:i=null,q:o=null}={}){const s={limit:t,offset:n,filter:r,sort:a,fields:i,q:o};return e.getAll("lists",s)},create:({id:t="",data:n})=>e.create(`lists/${t}`,t,n),getLatestVersion:({id:t})=>e.get(`lists/${t}`),update:({id:t,data:n})=>e.put(`lists/${t}`,n),delete:({id:t})=>e.delete(`lists/${t}`),getByVersion:({id:t,version:n})=>e.get(`lists/${t}/${n}`)}}({apiHandler:e}),this.memberships=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("memberships",i)},get:({organizationId:t,userId:n})=>e.get(`memberships/${t}/${n}`),update:({organizationId:t,userId:n,data:r})=>e.put(`memberships/${t}/${n}`,r),delete:({organizationId:t,userId:n})=>e.delete(`memberships/${t}/${n}`)}}({apiHandler:e}),this.organizations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null}={}){const i={limit:t,offset:n,filter:r,q:a};return e.getAll("organizations",i)},create:({data:t})=>e.post("organizations",t),get:({id:t})=>e.get(`organizations/${t}`),update:({id:t,data:n})=>e.patch(`organizations/${t}`,n)}}({apiHandler:e}),this.paymentCardsBankNames=function({apiHandler:e}){return{getAll({limit:t=null,q:n=null}={}){const r={limit:t,q:n};return e.getAll("payment-cards-bank-names",r)}}}({apiHandler:e}),this.paymentInstruments=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("payment-instruments",s)},create:({data:t})=>e.post("payment-instruments",t),get:({id:t})=>e.get(`payment-instruments/${t}`),update:({id:t,data:n})=>e.patch(`payment-instruments/${t}`,n),deactivate:({id:t})=>e.post(`payment-instruments/${t}/deactivation`)}}({apiHandler:e}),this.paymentMethods=function({apiHandler:e}){return{getAll:()=>e.getAll("payment-methods"),get:({apiName:t})=>e.get(`payment-methods/${t}`)}}({apiHandler:e}),this.paymentTokens=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("tokens",r)},create:({data:t})=>e.post("tokens",t),get:({token:t})=>e.get(`tokens/${t}`)}}({apiHandler:e}),this.payouts=function({apiHandler:e}){return{create:({data:t})=>e.post("payouts",t)}}({apiHandler:e}),this.plans=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("plans",o)},create:({id:t="",data:n})=>e.create(`plans/${t}`,t,n),get:({id:t})=>e.get(`plans/${t}`),update:({id:t,data:n})=>e.put(`plans/${t}`,n),delete:({id:t})=>e.delete(`plans/${t}`)}}({apiHandler:e}),this.previews=function({apiHandler:e}){return{sendEmailRuleAction:({data:t})=>e.post("previews/rule-actions/send-email",t),triggerWebhookRuleAction:({data:t})=>e.post("previews/rule-actions/trigger-webhook",t),webhook:({data:t})=>e.post("previews/webhooks",t),order:({data:t})=>e.post("previews/orders",t)}}({apiHandler:e}),this.products=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("products",o)},create:({id:t="",data:n})=>e.create(`products/${t}`,t,n),get:({id:t})=>e.get(`products/${t}`),update:({id:t,data:n})=>e.put(`products/${t}`,n),delete:({id:t})=>e.delete(`products/${t}`)}}({apiHandler:e}),this.profile=function({apiHandler:e}){return{startPermissionsEmulation:({data:t})=>e.post("permissions-emulation",t),stopPermissionsEmulation:()=>e.delete("permissions-emulation"),get:()=>e.get("profile"),update:({data:t})=>e.put("profile",t),getMfa:()=>e.get("profile/mfa"),updateMfa:()=>e.post("profile/mfa"),deleteMfa:()=>e.delete("profile/mfa"),updatePassword:({data:t})=>e.post("profile/password",t),resetTotp:()=>e.post("profile/totp-reset")}}({apiHandler:e}),this.purchase=function({apiHandler:e}){return{readyToPay:({data:t})=>e.post("ready-to-pay",t)}}({apiHandler:e}),this.roles=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null,expand:o=null}={}){const s={limit:t,offset:n,filter:r,sort:a,q:i,expand:o};return e.getAll("roles",s)},create:({id:t="",data:n})=>e.create(`roles/${t}`,t,n),get({id:t,expand:n=null}){const r={expand:n};return e.get(`roles/${t}`,r)},update:({id:t,data:n})=>e.put(`roles/${t}`,n),delete:({id:t})=>e.delete(`roles/${t}`)}}({apiHandler:e}),this.search=function({apiHandler:e}){return{get({sort:t=null,limit:n=null,offset:r=null,q:a=null}){const i={sort:t,limit:n,offset:r,q:a};return e.get("search",i)}}}({apiHandler:e}),this.segments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("grid-segments",o)},create:({id:t="",data:n})=>e.create(`grid-segments/${t}`,t,n),get:({id:t})=>e.get(`grid-segments/${t}`),update:({id:t,data:n})=>e.put(`grid-segments/${t}`,n),delete:({id:t})=>e.delete(`grid-segments/${t}`)}}({apiHandler:e}),this.sendThroughAttribution=function({apiHandler:e}){return{getAll:({eventType:t})=>e.getAll(`send-through-attribution/${t}`)}}({apiHandler:e}),this.shippingRates=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null,q:i=null}={}){const o={limit:t,offset:n,filter:r,sort:a,q:i};return e.getAll("shipping-rates",o)},create:({id:t="",data:n})=>e.create(`shipping-rates/${t}`,t,n),get:({id:t})=>e.get(`shipping-rates/${t}`),update:({id:t,data:n})=>e.put(`shipping-rates/${t}`,n),delete:({id:t})=>e.delete(`shipping-rates/${t}`)}}({apiHandler:e}),this.status=function({apiHandler:e}){return{get:()=>e.get("status")}}({apiHandler:e}),this.subscriptionCancellations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-cancellations",i)},create:({id:t="",data:n})=>e.create(`subscription-cancellations/${t}`,t,n),get:({id:t})=>e.get(`subscription-cancellations/${t}`),delete:({id:t})=>e.delete(`subscription-cancellations/${t}`),patch:({id:t,data:n})=>e.patch(`subscription-cancellations/${t}`,n)}}({apiHandler:e}),this.subscriptionPauses=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-pauses",i)},pause:({id:t="",data:n})=>e.create(`subscription-pauses/${t}`,t,n),get:({id:t})=>e.get(`subscription-pauses/${t}`),update:({id:t,data:n})=>e.put(`subscription-pauses/${t}`,n),delete:({id:t})=>e.delete(`subscription-pauses/${t}`)}}({apiHandler:e}),this.subscriptionReactivations=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,sort:a=null}={}){const i={limit:t,offset:n,filter:r,sort:a};return e.getAll("subscription-reactivations",i)},reactivate:({data:t})=>e.post("subscription-reactivations",t),get:({id:t})=>e.get(`subscription-reactivations/${t}`)}}({apiHandler:e}),this.subscriptions=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null,expand:o=null}={}){const s={filter:t,sort:n,limit:r,offset:a,q:i,expand:o};return e.getAll("subscriptions",s)},create({id:t="",data:n,expand:r=null}){const a={expand:r};return e.create(`subscriptions/${t}`,t,n,a)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`subscriptions/${t}`,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`subscriptions/${t}`,n,a)},delete:({id:t})=>e.delete(`subscriptions/${t}`),void:({id:t})=>e.post(`subscriptions/${t}/void`),changeItems:({id:t,data:n})=>e.post(`subscriptions/${t}/change-items`,n),createInterimInvoice:({id:t,data:n})=>e.post(`subscriptions/${t}/interim-invoice`,n),getAllUpcomingInvoices({id:t,expand:n=null}){const r={expand:n};return e.getAll(`subscriptions/${t}/upcoming-invoices`,r)},issueUpcomingInvoice:({id:t,invoiceId:n,data:r})=>e.post(`subscriptions/${t}/upcoming-invoices/${n}/issue`,r),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null,sort:i=null,q:o=null}){const s={limit:n,offset:r,filter:a,sort:i,q:o};return e.getAll(`subscriptions/${t}/timeline`,s)},createTimelineComment:({id:t,data:n})=>e.post(`subscriptions/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`subscriptions/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`subscriptions/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("subscriptions",s)}}}({apiHandler:e}),this.tags=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("tags",o)},create:({data:t})=>e.post("tags",t),get:({tag:t})=>e.get(`tags/${t}`),delete:({tag:t})=>e.delete(`tags/${t}`),update:({tag:t,data:n})=>e.patch(`tags/${t}`,n),tagCustomers:({tag:t,data:n})=>e.post(`tags/${t}/customers`,n),untagCustomers:({tag:t,data:n})=>e.delete(`tags/${t}/customers`,n),tagCustomer:({tag:t,customerId:n})=>e.post(`tags/${t}/customers/${n}`),untagCustomer:({tag:t,customerId:n})=>e.delete(`tags/${t}/customers/${n}`),tagKycDocuments:({tag:t,data:n})=>e.post(`tags/${t}/kyc-documents`,n),untagKycDocuments:({tag:t,data:n})=>e.delete(`tags/${t}/kyc-documents`,n),tagKycDocument:({tag:t,kycDocumentId:n})=>e.post(`tags/${t}/kyc-documents/${n}`),untagKycDocument:({tag:t,kycDocumentId:n})=>e.delete(`tags/${t}/kyc-documents/${n}`)}}({apiHandler:e}),this.tracking=function({apiHandler:e}){return{getAllApiLogs({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/api",o)},getApiLog:({id:t})=>e.get(`tracking/api/${t}`),getAllListsChangesHistory({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("tracking/webhooks",o)},getWebhookTrackingLog:({id:t})=>e.get(`tracking/webhooks/${t}`),resendWebhook:({id:t})=>e.post(`tracking/webhooks/${t}/resend`),downloadApiLogsCSV({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={params:{limit:t,offset:n,sort:r,filter:a,q:i},headers:ta};return e.download("tracking/api",o)}}}({apiHandler:e}),this.transactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null,expand:o=null}={}){const s={limit:t,offset:n,filter:r,q:a,sort:i,expand:o};return e.getAll("transactions",s)},create({data:t,expand:n=null}){const r={expand:n};return e.post("transactions",t,r)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`transactions/${t}`,r)},patch:({id:t,data:n})=>e.patch(`transactions/${t}`,n),query:({id:t})=>e.post(`transactions/${t}/query`),update:({id:t,data:n})=>e.post(`transactions/${t}/update`,n),refund:({id:t,data:n})=>e.post(`transactions/${t}/refund`,n),getAllTimelineMessages({id:t,limit:n=null,offset:r=null,filter:a=null}){const i={limit:n,offset:r,filter:a};return e.getAll(`transactions/${t}/timeline`,i)},createTimelineComment:({id:t,data:n})=>e.post(`transactions/${t}/timeline`,n),getTimelineMessage:({id:t,messageId:n})=>e.get(`transactions/${t}/timeline/${n}`),deleteTimelineMessage:({id:t,messageId:n})=>e.delete(`transactions/${t}/timeline/${n}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("transactions",s)}}}({apiHandler:e}),this.users=function({apiHandler:e}){return{getResetPasswordToken:({token:t})=>e.get(`reset-password/${t}`),resetPassword:({token:t,data:n})=>e.post(`reset-password/${t}`,n),getAll({limit:t=null,offset:n=null,sort:r=null,filter:a=null,q:i=null}={}){const o={limit:t,offset:n,sort:r,filter:a,q:i};return e.getAll("users",o)},create:({id:t="",data:n})=>e.create(`users/${t}`,t,n),get:({id:t})=>e.get(`users/${t}`),update:({id:t,data:n})=>e.put(`users/${t}`,n),getMfa:({id:t})=>e.get(`users/${t}/mfa`),updatePassword:({id:t,data:n})=>e.post(`users/${t}/password`,n),resetTotp:({id:t})=>e.post(`users/${t}/totp-reset`)}}({apiHandler:e}),this.webhooks=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null}={}){const a={limit:t,offset:n,filter:r};return e.getAll("webhooks",a)},create:({id:t="",data:n})=>e.create(`webhooks/${t}`,t,n),get:({id:t})=>e.get(`webhooks/${t}`),update:({id:t,data:n})=>e.put(`webhooks/${t}`,n)}}({apiHandler:e}),this.websites=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,q:r=null,filter:a=null,sort:i=null}={}){const o={limit:t,offset:n,q:r,filter:a,sort:i};return e.getAll("websites",o)},create:({id:t="",data:n})=>e.create(`websites/${t}`,t,n),get:({id:t})=>e.get(`websites/${t}`),update:({id:t,data:n})=>e.put(`websites/${t}`,n),delete:({id:t})=>e.delete(`websites/${t}`),downloadCSV({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null}={}){const s={params:{limit:t,offset:n,sort:r,expand:a,filter:i,q:o},headers:ta};return e.download("websites",s)}}}({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}const aa={CustomersResource:function({apiHandler:e}){return{getCustomerLifetimeSummaryMetrics({customerId:t=""}={}){const n={customerId:t};return e.get(`customers/${t}/summary-metrics`,n)}}},DataExportsResource:function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,sort:r=null,expand:a=null,filter:i=null,q:o=null,criteria:s=null}={}){const l={limit:t,offset:n,sort:r,expand:a,filter:i,q:o,criteria:s};return e.getAll("data-exports",l)},get({id:t,expand:n=null}){const r={expand:n};return e.get(`data-exports/${t}`,r)},queue({data:t,expand:n=null}){const r={expand:n};return e.post("data-exports",t,r)},update({id:t,data:n,expand:r=null}){const a={expand:r};return e.put(`data-exports/${t}`,n,a)},delete:({id:t})=>e.delete(`data-exports/${t}`)}},HistogramsResource:function({apiHandler:e}){return{getTransactionHistogramReport({periodStart:t="",periodEnd:n="",aggregationField:r="",aggregationPeriod:a="",metric:i="",filter:o=null,tz:s=null}={}){const l={periodStart:t,periodEnd:n,aggregationField:r,aggregationPeriod:a,metric:i,filter:o,tz:s};return e.get("histograms/transactions",l)}}},ReportsResource:function({apiHandler:e}){return{getApiLogSummary({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,tz:o=null}={}){const s={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,tz:o};return e.get("reports/api-log-summary",s)},getCumulativeSubscriptions({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/cumulative-subscriptions",u)},getDashboardMetrics({periodStart:t=null,periodEnd:n=null,tz:r=null,metrics:a=null,segments:i={}}={}){const o={periodStart:t,periodEnd:n,tz:r,segments:i,metrics:a};return e.getAll("reports/dashboard",o)},getDccMarkup({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,tz:s=null}={}){const l={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,tz:s};return e.get("reports/dcc-markup",l)},getDisputes({aggregationField:t,periodMonth:n,limit:r=null,offset:a=null,filter:i=null,tz:o=null}={}){const s={aggregationField:t,periodMonth:n,limit:r,offset:a,filter:i,tz:o};return e.get("reports/disputes",s)},getEventsTriggeredSummary({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/events-triggered",o)},getFutureRenewals({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/future-renewals",o)},getKycAcceptanceSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-acceptance-summary",r)},getKycRejectionSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-rejection-summary",r)},getKycRequestSummary({periodStart:t,periodEnd:n}={}){const r={periodStart:t,periodEnd:n};return e.get("reports/kyc-request-summary",r)},getMonthlyRecurringRevenue({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/monthly-recurring-revenue",o)},getRulesMatchedSummary({eventType:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,tz:o=null}={}){const s={periodStart:n,periodEnd:r,limit:a,offset:i,tz:o};return e.get(`reports/events-triggered/${t}/rules`,s)},getRenewalSales({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/renewal-sales",o)},getRetentionPercentage({aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeSwitchedSubscriptions:i=null,limit:o=null,offset:s=null,filter:l=null,criteria:u=null,tz:c=null}={}){const d={aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeSwitchedSubscriptions:i,limit:o,offset:s,filter:l,criteria:u,tz:c};return e.get("reports/retention-percentage",d)},getRetentionValue({aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeRefunds:i=null,includeDisputes:o=null,limit:s=null,offset:l=null,sort:u=null,filter:c=null,criteria:d=null,tz:p=null}={}){const f={aggregationField:t,aggregationPeriod:n,periodStart:r,periodEnd:a,includeRefunds:i,includeDisputes:o,limit:s,offset:l,sort:u,filter:c,criteria:d,tz:p};return e.get("reports/retention-value",f)},getRevenueWaterfall({currency:t,issuedFrom:n,issuedTo:r,recognizedTo:a,limit:i=null,offset:o=null,tz:s=null}){const l={currency:t,issuedFrom:n,issuedTo:r,recognizedTo:a,limit:i,offset:o,tz:s};return e.get("reports/revenue-waterfall",l)},getSubscriptionCancellation({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/subscription-cancellation",u)},getSubscriptionRenewalList({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.getAll("reports/subscription-renewal-list",o)},getSubscriptionRenewal({periodStart:t,periodEnd:n,limit:r=null,offset:a=null,tz:i=null}={}){const o={periodStart:t,periodEnd:n,limit:r,offset:a,tz:i};return e.get("reports/subscription-renewal",o)},getTimeSeriesTransaction({periodStart:t,periodEnd:n,type:r,subaggregate:a,limit:i=null,offset:o=null}={}){const s={periodStart:t,periodEnd:n,type:r,subaggregate:a,limit:i,offset:o};return e.get("reports/time-series-transaction",s)},getTransactionsTimeDispute({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/transactions-time-dispute",u)},getTransactions({aggregationField:t,periodStart:n,periodEnd:r,limit:a=null,offset:i=null,filter:o=null,criteria:s=null,tz:l=null}={}){const u={aggregationField:t,periodStart:n,periodEnd:r,limit:a,offset:i,filter:o,criteria:s,tz:l};return e.get("reports/transactions",u)}}},SubscriptionsResource:function({apiHandler:e}){return{getSubscriptionSummaryMetrics({subscriptionId:t=""}={}){const n={subscriptionId:t};return e.get(`subscriptions/${t}/summary-metrics`,n)}}},TimelinesResource:function({apiHandler:e}){return{getActivityFeed({eventTypes:t=null,limit:n=1e3,offset:r=0}){const a={eventTypes:t,limit:n,offset:r};return e.getAll("activity-feed",a)},getTransaction({id:t="",eventTypes:n=null,limit:r=1e3,offset:a=0}){const i={eventTypes:n,limit:r,offset:a};return e.getAll(`transactions/${t}/timeline`,i)},getCustomer({id:t="",eventTypes:n=null,limit:r=1e3,offset:a=0}){const i={eventTypes:n,limit:r,offset:a};return e.getAll(`customers/${t}/timeline`,i)}}},LocationResource:function({apiHandler:e}){return{query:()=>e.get("location")}}};class ia{constructor({apiHandler:e}){this.customers=aa.CustomersResource({apiHandler:e}),this.dataExports=aa.DataExportsResource({apiHandler:e}),this.histograms=aa.HistogramsResource({apiHandler:e}),this.reports=aa.ReportsResource({apiHandler:e}),this.subscriptions=aa.SubscriptionsResource({apiHandler:e}),this.timelines=aa.TimelinesResource({apiHandler:e}),this.location=aa.LocationResource({apiHandler:e}),this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken}}class oa{constructor({apiHandler:e}){this.account=function({apiHandler:e}){return{get:()=>e.get("account"),update:({data:t})=>e.patch("account",t),requestPasswordReset:({data:t})=>e.post("account/forgot-password",t),changePassword:({data:t})=>e.patch("account/password",t),resendEmailVerification:({data:t})=>e.post("account/resend-verification",t),confirmPasswordReset:({token:t,data:n})=>e.post(`account/reset-password/${t}`,n),verifyEmail:({token:t})=>e.post(`account/verification/${t}`),register:({data:t})=>e.post("register",t)}}({apiHandler:e}),this.authorization=function({apiHandler:e}){return{login:({data:t})=>e.post("login",t),logout:()=>e.post("logout")}}({apiHandler:e}),this.billingPortals=function({apiHandler:e}){return{get:({slug:t})=>e.get(`billing-portals/${t}`)}}({apiHandler:e}),this.checkoutForms=function({apiHandler:e}){return{get:({id:t})=>e.get(`checkout-forms/${t}`)}}({apiHandler:e}),this.invoices=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("invoices",o)},get:({id:t})=>e.get(`invoices/${t}`),downloadPDF({id:t}){const n={headers:na,responseType:"arraybuffer"};return e.download(`invoices/${t}`,n)}}}({apiHandler:e}),this.kycDocuments=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null}={}){const r={limit:t,offset:n};return e.getAll("kyc-documents",r)},create:({data:t})=>e.post("kyc-documents",t),get:({id:t})=>e.get(`kyc-documents/${t}`),update:({id:t,data:n})=>e.patch(`kyc-documents/${t}`,n)}}({apiHandler:e}),this.kycRequests=function({apiHandler:e}){return{get:({id:t})=>e.get(`kyc-requests/${t}`)}}({apiHandler:e}),this.orders=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("orders",o)},get:({id:t})=>e.get(`orders/${t}`),update:({id:t,data:n})=>e.patch(`orders/${t}`,n),cancel:({id:t,data:n})=>e.post(`orders/${t}/cancellation`,n)}}({apiHandler:e}),this.paymentInstruments=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("payment-instruments",o)},create:({data:t})=>e.post("payment-instruments",t),get({id:t,limit:n=null,offset:r=null}){const a={limit:n,offset:r};return e.get(`payment-instruments/${t}`,a)},update:({id:t,data:n})=>e.patch(`payment-instruments/${t}`,n),deactivate:({id:t})=>e.post(`payment-instruments/${t}/deactivation`),getSetupTransaction:({id:t})=>e.get(`payment-instruments/${t}/setup`),setup:({id:t,data:n})=>e.post(`payment-instruments/${t}/setup`,n)}}({apiHandler:e}),this.plans=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("plans",o)},get:({id:t})=>e.get(`plans/${t}`)}}({apiHandler:e}),this.products=function({apiHandler:e}){return{getAll({filter:t=null,sort:n=null,limit:r=null,offset:a=null,q:i=null}={}){const o={filter:t,sort:n,limit:r,offset:a,q:i};return e.getAll("products",o)},get:({id:t})=>e.get(`products/${t}`)}}({apiHandler:e}),this.purchase=function({apiHandler:e}){return{payment:({data:t})=>e.post("payment",t),purchase:({data:t})=>e.post("purchase",t),preview:({data:t})=>e.post("preview-purchase",t),readyToPay:({data:t})=>e.post("ready-to-pay",t)}}({apiHandler:e}),this.transactions=function({apiHandler:e}){return{getAll({limit:t=null,offset:n=null,filter:r=null,q:a=null,sort:i=null}={}){const o={limit:t,offset:n,filter:r,q:a,sort:i};return e.getAll("transactions",o)},get:({id:t})=>e.get(`transactions/${t}`),update:({id:t,data:n})=>e.patch(`transactions/${t}`,n)}}({apiHandler:e}),this.websites=function({apiHandler:e}){return{get:({id:t})=>e.get(`websites/${t}`)}}({apiHandler:e}),this.checkoutForm=this.checkoutForms,this.billingPortal=this.billingPortals,this.addRequestInterceptor=e.addRequestInterceptor,this.removeRequestInterceptor=e.removeRequestInterceptor,this.addResponseInterceptor=e.addResponseInterceptor,this.removeResponseInterceptor=e.removeResponseInterceptor,this.setTimeout=e.setTimeout,this.setProxyAgent=e.setProxyAgent,this.setSessionToken=e.setSessionToken,this.setPublishableKey=e.setPublishableKey,this.setEndpoints=e.setEndpoints,this.getCancellationToken=e.getCancellationToken,this.generateSignature=e.generateSignature}}const sa={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"};function la({apiKey:e=null,sandbox:t=!1,timeout:n=6e3,organizationId:r=null,urls:a=sa}={}){if(!a.live||!a.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof a.live||"string"!=typeof a.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");return function({apiHandler:e}){return new ra({apiHandler:e})}({apiHandler:ea({options:{apiEndpoints:a,apiKey:e,apiVersion:"",isSandbox:t,requestTimeout:n,jwt:null,organizationId:r}})})}function ua({apiKey:e=null,sandbox:t=!1,timeout:n=6e3,organizationId:r=null,urls:a=sa}={}){if(!a.live||!a.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof a.live||"string"!=typeof a.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");return function({apiHandler:e}){return new ia({apiHandler:e})}({apiHandler:ea({options:{apiEndpoints:a,apiKey:e,apiVersion:"experimental",isSandbox:t,requestTimeout:n,jwt:null,organizationId:r}})})}function ca({publishableKey:e=null,jwt:t=null,sandbox:n=!1,timeout:r=6e3,organizationId:a=null,urls:i=sa}={}){if(!i.live||!i.sandbox)throw new Error("RebillyAPI urls config must include a key for both `live` and `sandbox`");if("string"!=typeof i.live||"string"!=typeof i.sandbox)throw new Error("RebillyAPI urls config `live` and `sandbox` must be strings");const o={apiEndpoints:i,publishableKey:e,jwt:t,apiVersion:"storefront",isSandbox:n,requestTimeout:r,organizationId:a},s=ea({options:o});return s.setSessionToken(o.jwt),function({apiHandler:e}){return new oa({apiHandler:e})}({apiHandler:s})}async function da({state:e}={},t){try{return function({state:e}){if(!e.storefront)throw new Error("Could not access rebilly-js-sdk instance");if(!e.options)throw new Error("Could not use Rebilly Instruments mount options to fetch Rebilly data")}({state:e}),await t()}catch(e){throw Ge(e),e}}class pa{constructor({publishableKey:e=null,jwt:t=null,organizationId:n=null,mode:r="live",timeout:a=1e4,liveUrl:i=null,sandboxUrl:o=null}={}){const s={live:i||"https://api.rebilly.com",sandbox:o||"https://api-sandbox.rebilly.com"},l={organizationId:n,sandbox:"sandbox"===r,timeout:Number.isNaN(parseInt(a,10))?1e4:parseInt(a,10),urls:s},u=ca(l),c="function"==typeof la.default?la.default(l):la(l),d=ua(l);return u.setSessionToken(e||t),c.setSessionToken(e||t),d.setSessionToken(e||t),this.api=u,this.api.rebilly=c,this.api.rebilly.experimental=d,this.api}}async function fa({data:e=null,state:t=null}={}){return da({state:t},(async()=>{var n,r,a;const i={data:{websiteId:(null===(n=t.options)||void 0===n?void 0:n.websiteId)||null}};null!==(r=t.options)&&void 0!==r&&r.items&&(i.data.items=t.options.items),null!==(a=t.data)&&void 0!==a&&a.amountAndCurrency&&(i.data={...i.data,...t.data.amountAndCurrency}),null!=e&&e.billingAddress&&(i.data.billingAddress=e.billingAddress),null!=e&&e.deliveryAddress&&(i.data.deliveryAddress=e.deliveryAddress);const{fields:o}=await t.storefront.purchase.preview(i);return t.data.previewPurchase=o,new at(o)}))}async function ha({state:e,instrument:t}){await fa({data:t,state:e});const n={data:e.data.toPostmatesModel(),options:e.options};e.iframeComponents.summary.component.call("update",n),e.iframeComponents.form.component.call("update",n)}var ma,ga=(function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",o=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof g?t:g,i=Object.create(a.prototype),o=new C(r||[]);return i._invoke=function(e,t,n){var r=d;return function(a,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===a)throw i;return H()}for(n.method=a,n.arg=i;;){var o=n.delegate;if(o){var s=E(o,n);if(s){if(s===m)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var l=c(e,t,n);if("normal"===l.type){if(r=n.done?h:p,l.arg===m)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=h,n.method="throw",n.arg=l.arg)}}}(e,n,o),i}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",m={};function g(){}function y(){}function v(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(I([])));x&&x!==n&&r.call(x,i)&&(b=x);var k=v.prototype=g.prototype=Object.create(b);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function A(e,t){function n(a,i,o,s){var l=c(e[a],e,i);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,o,s)}),(function(e){n("throw",e,o,s)})):t.resolve(d).then((function(e){u.value=e,o(u)}),(function(e){return n("throw",e,o,s)}))}s(l.arg)}var a;this._invoke=function(e,r){function i(){return new t((function(t,a){n(e,r,t,a)}))}return a=a?a.then(i,i):i()}}function E(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,E(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=c(r,e.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,m;var i=a.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function $(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach($,this),this.reset(!0)}function I(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function n(){for(;++a<e.length;)if(r.call(e,a))return n.value=e[a],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:H}}function H(){return{value:t,done:!0}}return y.prototype=k.constructor=v,v.constructor=y,y.displayName=l(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},e.awrap=function(e){return{__await:e}},S(A.prototype),A.prototype[o]=function(){return this},e.AsyncIterator=A,e.async=function(t,n,r,a,i){void 0===i&&(i=Promise);var o=new A(u(t,n,r,a),i);return e.isGeneratorFunction(n)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},S(k),l(k,s,"Generator"),k[i]=function(){return this},k.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=I,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function a(r,a){return s.type="throw",s.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var l=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(l&&u){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(l){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var i=a;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),T(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;T(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}(ma={path:undefined,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&ma.path)}},ma.exports),ma.exports);function ya(e,t,n,r,a,i,o){try{var s=e[i](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}var va=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(e){ya(i,r,a,o,s,"next",e)}function s(e){ya(i,r,a,o,s,"throw",e)}o(void 0)}))}},ba=function(){return(ba=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function wa(e,t,n,r){return new(n||(n=Promise))((function(a,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((r=r.apply(e,t||[])).next())}))}function xa(e,t){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&i[0]?r.return:i[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,i[1])).done)return a;switch(r=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,r=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!((a=(a=o.trys).length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){o.label=i[1];break}if(6===i[0]&&o.label<a[1]){o.label=a[1],a=i;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(i);break}a[2]&&o.ops.pop(),o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e],r=0}finally{n=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function Sa(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),a=0;for(t=0;t<n;t++)for(var i=arguments[t],o=0,s=i.length;o<s;o++,a++)r[a]=i[o];return r}function Aa(e,t){return new Promise((function(n){return setTimeout(n,e,t)}))}function Ea(e,t){try{var n=e();(r=n)&&"function"==typeof r.then?n.then((function(e){return t(!0,e)}),(function(e){return t(!1,e)})):t(!0,n)}catch(e){t(!1,e)}var r}function $a(e,t,n){return void 0===n&&(n=16),wa(this,void 0,void 0,(function(){var r,a,i;return xa(this,(function(o){switch(o.label){case 0:r=Date.now(),a=0,o.label=1;case 1:return a<e.length?(t(e[a],a),(i=Date.now())>=r+n?(r=i,[4,Aa(0)]):[3,3]):[3,4];case 2:o.sent(),o.label=3;case 3:return++a,[3,1];case 4:return[2]}}))}))}function Ta(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Ca(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function Ia(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function Ha(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function Fa(e,t){return[e[0]^t[0],e[1]^t[1]]}function ja(e){return e=Fa(e,[0,e[0]>>>1]),e=Fa(e=Ca(e,[4283543511,3981806797]),[0,e[0]>>>1]),Fa(e=Ca(e,[3301882366,444984403]),[0,e[0]>>>1])}function Pa(e){return parseInt(e)}function La(e){return parseFloat(e)}function Ra(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ma(e){return e.reduce((function(e,t){return e+(t?1:0)}),0)}function Oa(e,t){if(void 0===t&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function qa(e){return e&&"object"==typeof e&&"message"in e?e:{message:e}}function Ba(e,t,n){var r=Object.keys(e).filter((function(e){return!function(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}(n,e)})),a=Array(r.length);return $a(r,(function(n,r){a[r]=function(e,t){var n=function(e){return"function"!=typeof e},r=new Promise((function(r){var a=Date.now();Ea(e.bind(null,t),(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=Date.now()-a;if(!e[0])return r((function(){return{error:qa(e[1]),duration:i}}));var o=e[1];if(n(o))return r((function(){return{value:o,duration:i}}));r((function(){return new Promise((function(e){var t=Date.now();Ea(o,(function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var a=i+Date.now()-t;if(!n[0])return e({error:qa(n[1]),duration:a});e({value:n[1],duration:a})}))}))}))}))}));return function(){return r.then((function(e){return e()}))}}(e[n],t)})),function(){return wa(this,void 0,void 0,(function(){var e,t,n,i,o,s;return xa(this,(function(l){switch(l.label){case 0:for(e={},t=0,n=r;t<n.length;t++)i=n[t],e[i]=void 0;o=Array(r.length),s=function(){var t;return xa(this,(function(n){switch(n.label){case 0:return t=!0,[4,$a(r,(function(n,r){o[r]||(a[r]?o[r]=a[r]().then((function(t){return e[n]=t})):t=!1)}))];case 1:return n.sent(),t?[2,"break"]:[4,Aa(1)];case 2:return n.sent(),[2]}}))},l.label=1;case 1:return[5,s()];case 2:if("break"===l.sent())return[3,4];l.label=3;case 3:return[3,1];case 4:return[4,Promise.all(o)];case 5:return l.sent(),[2,e]}}))}))}}function _a(){var e=window,t=navigator;return Ma(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function za(){var e=window,t=navigator;return Ma(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===t.vendor.indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Da(){var e=window,t=navigator;return Ma(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===t.vendor.indexOf("Apple"),"getStorageUpdates"in t,"WebKitMediaKeys"in e])>=4}function Na(){var e=window;return Ma(["safari"in e,!("DeviceMotionEvent"in e),!("ongestureend"in e),!("standalone"in navigator)])>=3}function Ua(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Wa(){var e=za(),t=function(){var e,t,n=window;return Ma(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}();if(!e&&!t)return!1;var n=window;return Ma(["onorientationchange"in n,"orientation"in n,e&&!("SharedWorker"in n),t&&/android/i.test(navigator.appVersion)])>=2}function Va(e){var t=new Error(e);return t.name=e,t}function Ga(e,t,n){var r,a,i;return void 0===n&&(n=50),wa(this,void 0,void 0,(function(){var o,s;return xa(this,(function(l){switch(l.label){case 0:o=document,l.label=1;case 1:return o.body?[3,3]:[4,Aa(n)];case 2:return l.sent(),[3,1];case 3:s=o.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise((function(e,n){var r=!1,a=function(){r=!0,e()};s.onload=a,s.onerror=function(e){r=!0,n(e)};var i=s.style;i.setProperty("display","block","important"),i.position="absolute",i.top="0",i.left="0",i.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",o.body.appendChild(s);var l=function(){var e,t;r||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?a():setTimeout(l,10))};l()}))];case 5:l.sent(),l.label=6;case 6:return(null===(a=null===(r=s.contentWindow)||void 0===r?void 0:r.document)||void 0===a?void 0:a.body)?[3,8]:[4,Aa(n)];case 7:return l.sent(),[3,6];case 8:return[4,e(s,s.contentWindow)];case 9:return[2,l.sent()];case 10:return null===(i=s.parentNode)||void 0===i||i.removeChild(s),[7];case 11:return[2]}}))}))}function Ka(e){for(var t=function(e){for(var t,n,r="Unexpected syntax '"+e+"'",a=/^\s*([a-z-]*)(.*)$/i.exec(e),i=a[1]||void 0,o={},s=/([.:#][\w-]+|\[.+?\])/gi,l=function(e,t){o[e]=o[e]||[],o[e].push(t)};;){var u=s.exec(a[2]);if(!u)break;var c=u[0];switch(c[0]){case".":l("class",c.slice(1));break;case"#":l("id",c.slice(1));break;case"[":var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(c);if(!d)throw new Error(r);l(d[1],null!==(n=null!==(t=d[4])&&void 0!==t?t:d[5])&&void 0!==n?n:"");break;default:throw new Error(r)}}return[i,o]}(e),n=t[0],r=t[1],a=document.createElement(null!=n?n:"div"),i=0,o=Object.keys(r);i<o.length;i++){var s=o[i],l=r[s].join(" ");"style"===s?Ja(a.style,l):a.setAttribute(s,l)}return a}function Ja(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var a=r[n],i=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(a);if(i){var o=i[1],s=i[2],l=i[4];e.setProperty(o,s,l||"")}}}var Xa,Za,Ya=["monospace","sans-serif","serif"],Qa=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function ei(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function ti(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly "+String.fromCharCode(55357,56835);return t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45),ri(e)}function ni(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var a=r[n],i=a[0],o=a[1],s=a[2];t.fillStyle=i,t.beginPath(),t.arc(o,s,40,0,2*Math.PI,!0),t.closePath(),t.fill()}return t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd"),ri(e)}function ri(e){return e.toDataURL()}function ai(){var e=screen;return[Ra(La(e.availTop),null),Ra(La(e.width)-La(e.availWidth)-Ra(La(e.availLeft),0),null),Ra(La(e.height)-La(e.availHeight)-Ra(La(e.availTop),0),null),Ra(La(e.availLeft),null)]}function ii(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}var oi={abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'a[title="7naga poker" i]','[title="ALIENBOLA" i]'],abpvn:["#quangcaomb",".iosAdsiosAds-layout",".quangcao",'[href^="https://r88.vn/"]','[href^="https://zbet.vn/"]'],adBlockFinland:[".mainostila",".sponsorit",".ylamainos",'a[href*="/clickthrgh.asp?"]','a[href^="https://app.readpeak.com/ads"]'],adBlockPersian:["#navbar_notice_50",'a[href^="http://g1.v.fwmrm.net/ad/"]',".kadr",'TABLE[width="140px"]',"#divAgahi"],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect"],adGuardAnnoyances:['amp-embed[type="zen"]',".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil"],adGuardBase:["#ad-after","#ad-p3",".BetterJsPopOverlay","#ad_300X250","#bannerfloat22"],adGuardChinese:['a[href*=".ttz5.cn"]','a[href*=".yabovip2027.com/"]',".tm3all2h4b",".cc5278_banner_ad"],adGuardFrench:[".zonepub",'[class*="_adLeaderboard"]','[id^="block-xiti_oas-"]','a[href^="http://ptapjmp.com/"]','a[href^="https://go.alvexo.com/"]'],adGuardGerman:[".banneritemwerbung_head_1",".boxstartwerbung",".werbung3",'a[href^="http://www.eis.de/index.phtml?refid="]','a[href^="https://www.tipico.com/?affiliateId="]'],adGuardJapanese:["#kauli_yad_1","#ad-giftext","#adsSPRBlock",'a[href^="http://ad2.trafficgate.net/"]','a[href^="http://www.rssad.jp/"]'],adGuardMobile:["amp-auto-ads","#mgid_iframe",".amp_ad",'amp-embed[type="24smi"]',"#mgid_iframe1"],adGuardRussian:['a[href^="https://ya-distrib.ru/r/"]','a[href^="https://ad.letmeads.com/"]',".reclama",'div[id^="smi2adblock"]','div[id^="AdFox_banner_"]'],adGuardSocial:['a[href^="//www.stumbleupon.com/submit?url="]','a[href^="//telegram.me/share/url?"]',".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",'[href^="http://ads.glispa.com/"]'],adGuardTrackingProtection:['amp-embed[type="taboola"]',"#qoo-counter",'a[href^="http://click.hotlog.ru/"]','a[href^="http://hitcounter.ru/top/stat.php"]','a[href^="http://top.mail.ru/jump"]'],adGuardTurkish:["#backkapat","#reklami",'a[href^="http://adserv.ontek.com.tr/"]','a[href^="http://izlenzi.com/campaign/"]','a[href^="http://www.installads.net/"]'],bulgarian:["td#freenet_table_ads","#adbody","#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:["#AD_banner_bottom","#Ads_google_02","#N-ad-article-rightRail-1","#ad-fullbanner2","#ad-zone-2"],easyListChina:['a[href*=".wensixuetang.com/"]','A[href*="/hth107.com/"]','.appguide-wrap[onclick*="bcebos.com"]',".frontpageAdvM","#taotaole"],easyListCookie:["#adtoniq-msg-bar","#CoockiesPage","#CookieModal_cookiemodal","#DO_CC_PANEL","#ShowCookie"],easyListCzechSlovak:["#onlajny-stickers","#reklamni-box",".reklama-megaboard",".sklik",'[id^="sklikReklama"]'],easyListDutch:["#advertentie","#vipAdmarktBannerBlock",".adstekst",'a[href^="https://xltube.nl/click/"]',"#semilo-lrectangle"],easyListGermany:['a[href^="http://www.hw-area.com/?dp="]','a[href^="https://ads.sunmaker.com/tracking.php?"]',".werbung-skyscraper2",".bannergroup_werbung",".ads_rechts"],easyListItaly:[".box_adv_annunci",".sb-box-pubbliredazionale",'a[href^="http://affiliazioniads.snai.it/"]','a[href^="https://adserver.html.it/"]','a[href^="https://affiliazioniads.snai.it/"]'],easyListLithuania:[".reklamos_tarpas",".reklamos_nuorodos",'img[alt="Reklaminis skydelis"]','img[alt="Dedikuoti.lt serveriai"]','img[alt="Hostingas Serveriai.lt"]'],estonian:['A[href*="http://pay4results24.eu"]'],fanboyAnnoyances:["#feedback-tab","#taboola-below-article",".feedburnerFeedBlock",".widget-feedburner-counter",'[title="Subscribe to our blog"]'],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:[".td-tags-and-social-wrapper-box",".twitterContainer",".youtube-social",'a[title^="Like us on Facebook"]','img[alt^="Share on Digg"]'],frellwitSwedish:['a[href*="casinopro.se"][target="_blank"]','a[href*="doktor-se.onelink.me"]',"article.category-samarbete","div.holidAds","ul.adsmodern"],greekAdBlock:['A[href*="adman.otenet.gr/click?"]','A[href*="http://axiabanners.exodus.gr/"]','A[href*="http://interactive.forthnet.gr/click?"]',"DIV.agores300","TABLE.advright"],hungarian:['A[href*="ad.eval.hu"]','A[href*="ad.netmedia.hu"]','A[href*="daserver.ultraweb.hu"]',"#cemp_doboz",".optimonk-iframe-container"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container",".cookie-msg-info-container","#cookies-policy-sticky"],icelandicAbp:['A[href^="/framework/resources/forms/ads.aspx"]'],latvian:['a[href="http://www.salidzini.lv/"][style="display: block; width: 120px; height: 40px; overflow: hidden; position: relative;"]','a[href="http://www.salidzini.lv/"][style="display: block; width: 88px; height: 31px; overflow: hidden; position: relative;"]'],listKr:['a[href*="//kingtoon.slnk.kr"]','a[href*="//playdsb.com/kr"]',"div.logly-lift-adz",'div[data-widget_id="ml6EJ074"]',"ins.daum_ddn_area"],listeAr:[".geminiLB1Ad",".right-and-left-sponsers",'a[href*=".aflam.info"]','a[href*="booraq.org"]','a[href*="dubizzle.com/ar/?utm_source="]'],listeFr:['a[href^="http://promo.vador.com/"]',"#adcontainer_recherche",'a[href*="weborama.fr/fcgi-bin/"]',".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",'[href^="https://aff.sendhub.pl/"]','a[href^="http://advmanager.techfun.pl/redirect/"]','a[href^="http://www.trizer.pl/?utm_source"]',"div#skapiec_ad"],ro:['a[href^="//afftrk.altex.ro/Counter/Click"]','a[href^="/magazin/"]','a[href^="https://blackfridaysales.ro/trk/shop/"]','a[href^="https://event.2performant.com/events/click"]','a[href^="https://l.profitshare.ro/"]'],ruAd:['a[href*="//febrare.ru/"]','a[href*="//utimg.ru/"]','a[href*="://chikidiki.ru"]',"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]","#ads-google-middle_rectangle-group",".ads300s",".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",".ctpl-fullbanner",".zergnet-recommend",".yt.btn-link.btn-md.btn"]};function si(e){var t;return wa(this,void 0,void 0,(function(){var n,r,a,i,o,s,l;return xa(this,(function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),a=new Array(e.length),i={},li(r),l=0;l<e.length;++l)o=Ka(e[l]),li(s=n.createElement("div")),s.appendChild(o),r.appendChild(s),a[l]=o;u.label=1;case 1:return n.body?[3,3]:[4,Aa(50)];case 2:return u.sent(),[3,1];case 3:n.body.appendChild(r);try{for(l=0;l<e.length;++l)a[l].offsetParent||(i[e[l]]=!0)}finally{null===(t=r.parentNode)||void 0===t||t.removeChild(r)}return[2,i]}}))}))}function li(e){e.style.setProperty("display","block","important")}function ui(e){return matchMedia("(inverted-colors: "+e+")").matches}function ci(e){return matchMedia("(forced-colors: "+e+")").matches}function di(e){return matchMedia("(prefers-contrast: "+e+")").matches}function pi(e){return matchMedia("(prefers-reduced-motion: "+e+")").matches}function fi(e){return matchMedia("(dynamic-range: "+e+")").matches}var hi=Math,mi=function(){return 0},gi={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]},yi={fonts:function(){return Ga((function(e,t){var n=t.document,r=n.body;r.style.fontSize="48px";var a=n.createElement("div"),i={},o={},s=function(e){var t=n.createElement("span"),r=t.style;return r.position="absolute",r.top="0",r.left="0",r.fontFamily=e,t.textContent="mmMwWLliI0O&1",a.appendChild(t),t},l=Ya.map(s),u=function(){for(var e={},t=function(t){e[t]=Ya.map((function(e){return function(e,t){return s("'"+e+"',"+t)}(t,e)}))},n=0,r=Qa;n<r.length;n++)t(r[n]);return e}();r.appendChild(a);for(var c=0;c<Ya.length;c++)i[Ya[c]]=l[c].offsetWidth,o[Ya[c]]=l[c].offsetHeight;return Qa.filter((function(e){return t=u[e],Ya.some((function(e,n){return t[n].offsetWidth!==i[e]||t[n].offsetHeight!==o[e]}));var t}))}))},domBlockers:function(e){var t=(void 0===e?{}:e).debug;return wa(this,void 0,void 0,(function(){var e,n,r,a;return xa(this,(function(i){switch(i.label){case 0:return Da()||Wa()?(e=Object.keys(oi),[4,si((a=[]).concat.apply(a,e.map((function(e){return oi[e]}))))]):[2,void 0];case 1:return n=i.sent(),t&&function(e){for(var t="DOM blockers debug:\n```",n=0,r=Object.keys(oi);n<r.length;n++){var a=r[n];t+="\n"+a+":";for(var i=0,o=oi[a];i<o.length;i++){var s=o[i];t+="\n "+s+" "+(e[s]?"🚫":"➡️")}}console.log(t+"\n```")}(n),(r=e.filter((function(e){var t=oi[e];return Ma(t.map((function(e){return n[e]})))>.6*t.length}))).sort(),[2,r]}}))}))},fontPreferences:function(){return function(e,t){return void 0===t&&(t=4e3),Ga((function(e,n){var r=n.document,a=r.body,i=a.style;i.width=t+"px",i.webkitTextSizeAdjust=i.textSizeAdjust="none",za()?a.style.zoom=""+1/n.devicePixelRatio:Da()&&(a.style.zoom="reset");var o=r.createElement("div");return o.textContent=Sa(Array(t/20<<0)).map((function(){return"word"})).join(" "),a.appendChild(o),function(e,t){for(var n={},r={},a=0,i=Object.keys(gi);a<i.length;a++){var o=i[a],s=gi[o],l=s[0],u=void 0===l?{}:l,c=s[1],d=void 0===c?"mmMwWLliI0fiflO&1":c,p=e.createElement("span");p.textContent=d,p.style.whiteSpace="nowrap";for(var f=0,h=Object.keys(u);f<h.length;f++){var m=h[f],g=u[m];void 0!==g&&(p.style[m]=g)}n[o]=p,t.appendChild(e.createElement("br")),t.appendChild(p)}for(var y=0,v=Object.keys(gi);y<v.length;y++)r[o=v[y]]=n[o].getBoundingClientRect().width;return r}(r,a)}),'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}()},audio:function(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Da()&&!Na()&&!function(){var e=window;return Ma(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;var n=new t(1,5e3,44100),r=n.createOscillator();r.type="triangle",r.frequency.value=1e4;var a=n.createDynamicsCompressor();a.threshold.value=-50,a.knee.value=40,a.ratio.value=12,a.attack.value=0,a.release.value=.25,r.connect(a),a.connect(n.destination),r.start(0);var i=function(e){var t=function(){};return[new Promise((function(n,r){var a=!1,i=0,o=0;e.oncomplete=function(e){return n(e.renderedBuffer)};var s=function(){setTimeout((function(){return r(Va("timeout"))}),Math.min(500,o+5e3-Date.now()))},l=function(){try{switch(e.startRendering(),e.state){case"running":o=Date.now(),a&&s();break;case"suspended":document.hidden||i++,a&&i>=3?r(Va("suspended")):setTimeout(l,500)}}catch(e){r(e)}};l(),t=function(){a||(a=!0,o>0&&s())}})),t]}(n),o=i[0],s=i[1],l=o.then((function(e){return function(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(4500))}),(function(e){if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return l.catch((function(){})),function(){return s(),l}},screenFrame:function(){var e=this,t=function(){var e=this;return function(){if(void 0===Za){var e=function(){var t=ai();ii(t)?Za=setTimeout(e,2500):(Xa=t,Za=void 0)};e()}}(),function(){return wa(e,void 0,void 0,(function(){var e;return xa(this,(function(t){switch(t.label){case 0:return ii(e=ai())?Xa?[2,Sa(Xa)]:(n=document).fullscreenElement||n.msFullscreenElement||n.mozFullScreenElement||n.webkitFullscreenElement?[4,Ua()]:[3,2]:[3,2];case 1:t.sent(),e=ai(),t.label=2;case 2:return ii(e)||(Xa=e),[2,e]}var n}))}))}}();return function(){return wa(e,void 0,void 0,(function(){var e,n;return xa(this,(function(r){switch(r.label){case 0:return[4,t()];case 1:return e=r.sent(),[2,[(n=function(e){return null===e?null:Oa(e,10)})(e[0]),n(e[1]),n(e[2]),n(e[3])]]}}))}))}},osCpu:function(){return navigator.oscpu},languages:function(){var e,t=navigator,n=[],r=t.language||t.userLanguage||t.browserLanguage||t.systemLanguage;if(void 0!==r&&n.push([r]),Array.isArray(t.languages))za()&&Ma([!("MediaSettingsRange"in(e=window)),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3||n.push(t.languages);else if("string"==typeof t.languages){var a=t.languages;a&&n.push(a.split(","))}return n},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Ra(La(navigator.deviceMemory),void 0)},screenResolution:function(){var e=screen,t=function(e){return Ra(Pa(e),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n},hardwareConcurrency:function(){return Ra(Pa(navigator.hardwareConcurrency),void 0)},timezone:function(){var e,t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){var n=(new t).resolvedOptions().timeZone;if(n)return n}var r,a=(r=(new Date).getFullYear(),-Math.max(La(new Date(r,0,1).getTimezoneOffset()),La(new Date(r,6,1).getTimezoneOffset())));return"UTC"+(a>=0?"+":"")+Math.abs(a)},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){var e,t;if(!(_a()||(e=window,t=navigator,Ma(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!_a())))try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){var e=navigator.platform;return"MacIntel"===e&&Da()&&!Na()?function(){if("iPad"===navigator.platform)return!0;var e=screen,t=e.width/e.height;return Ma(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var a=[],i=0;i<r.length;++i){var o=r[i];a.push({type:o.type,suffixes:o.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:a})}}return t}},canvas:function(){var e=function(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}(),t=e[0],n=e[1];return function(e,t){return!(!t||!e.toDataURL)}(t,n)?{winding:ei(n),geometry:ni(t,n),text:ti(t,n)}:{winding:!1,geometry:"",text:""}},touchSupport:function(){var e,t=navigator,n=0;void 0!==t.maxTouchPoints?n=Pa(t.maxTouchPoints):void 0!==t.msMaxTouchPoints&&(n=t.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){e=!1}return{maxTouchPoints:n,touchEvent:e,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],a=window[r];a&&"object"==typeof a&&e.push(r)}return e.sort()},cookiesEnabled:function(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(e){return!1}},colorGamut:function(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: "+n+")").matches)return n}},invertedColors:function(){return!!ui("inverted")||!ui("none")&&void 0},forcedColors:function(){return!!ci("active")||!ci("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=100;++e)if(matchMedia("(max-monochrome: "+e+")").matches)return e;throw new Error("Too high value")}},contrast:function(){return di("no-preference")?0:di("high")||di("more")?1:di("low")||di("less")?-1:di("forced")?10:void 0},reducedMotion:function(){return!!pi("reduce")||!pi("no-preference")&&void 0},hdr:function(){return!!fi("high")||!fi("standard")&&void 0},math:function(){var e,t=hi.acos||mi,n=hi.acosh||mi,r=hi.asin||mi,a=hi.asinh||mi,i=hi.atanh||mi,o=hi.atan||mi,s=hi.sin||mi,l=hi.sinh||mi,u=hi.cos||mi,c=hi.cosh||mi,d=hi.tan||mi,p=hi.tanh||mi,f=hi.exp||mi,h=hi.expm1||mi,m=hi.log1p||mi;return{acos:t(.12312423423423424),acosh:n(1e308),acoshPf:(e=1e154,hi.log(e+hi.sqrt(e*e-1))),asin:r(.12312423423423424),asinh:a(1),asinhPf:hi.log(1+hi.sqrt(2)),atanh:i(.5),atanhPf:hi.log(3)/2,atan:o(.5),sin:s(-1e300),sinh:l(1),sinhPf:hi.exp(1)-1/hi.exp(1)/2,cos:u(10.000000000123),cosh:c(1),coshPf:(hi.exp(1)+1/hi.exp(1))/2,tan:d(-1e300),tanh:p(1),tanhPf:(hi.exp(2)-1)/(hi.exp(2)+1),exp:f(1),expm1:h(1),expm1Pf:hi.exp(1)-1,log1p:m(10),log1pPf:hi.log(11),powPI:hi.pow(hi.PI,-100)}}};function vi(e){var t=function(e){if(Wa())return.4;if(Da())return Na()?.5:.3;var t=e.platform.value||"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}(e),n=function(e){return Oa(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fpjs.dev/pro".replace(/\$/g,""+n)}}function bi(e){return JSON.stringify(e,(function(e,t){return t instanceof Error?ba({name:(n=t).name,message:n.message,stack:null===(r=n.stack)||void 0===r?void 0:r.split("\n")},n):t;var n,r}),2)}function wi(e){return function(e,t){t=t||0;var n,r=(e=e||"").length%16,a=e.length-r,i=[0,t],o=[0,t],s=[0,0],l=[0,0],u=[2277735313,289559509],c=[1291169091,658871167];for(n=0;n<a;n+=16)s=[255&e.charCodeAt(n+4)|(255&e.charCodeAt(n+5))<<8|(255&e.charCodeAt(n+6))<<16|(255&e.charCodeAt(n+7))<<24,255&e.charCodeAt(n)|(255&e.charCodeAt(n+1))<<8|(255&e.charCodeAt(n+2))<<16|(255&e.charCodeAt(n+3))<<24],l=[255&e.charCodeAt(n+12)|(255&e.charCodeAt(n+13))<<8|(255&e.charCodeAt(n+14))<<16|(255&e.charCodeAt(n+15))<<24,255&e.charCodeAt(n+8)|(255&e.charCodeAt(n+9))<<8|(255&e.charCodeAt(n+10))<<16|(255&e.charCodeAt(n+11))<<24],s=Ia(s=Ca(s,u),31),i=Ta(i=Ia(i=Fa(i,s=Ca(s,c)),27),o),i=Ta(Ca(i,[0,5]),[0,1390208809]),l=Ia(l=Ca(l,c),33),o=Ta(o=Ia(o=Fa(o,l=Ca(l,u)),31),i),o=Ta(Ca(o,[0,5]),[0,944331445]);switch(s=[0,0],l=[0,0],r){case 15:l=Fa(l,Ha([0,e.charCodeAt(n+14)],48));case 14:l=Fa(l,Ha([0,e.charCodeAt(n+13)],40));case 13:l=Fa(l,Ha([0,e.charCodeAt(n+12)],32));case 12:l=Fa(l,Ha([0,e.charCodeAt(n+11)],24));case 11:l=Fa(l,Ha([0,e.charCodeAt(n+10)],16));case 10:l=Fa(l,Ha([0,e.charCodeAt(n+9)],8));case 9:l=Ca(l=Fa(l,[0,e.charCodeAt(n+8)]),c),o=Fa(o,l=Ca(l=Ia(l,33),u));case 8:s=Fa(s,Ha([0,e.charCodeAt(n+7)],56));case 7:s=Fa(s,Ha([0,e.charCodeAt(n+6)],48));case 6:s=Fa(s,Ha([0,e.charCodeAt(n+5)],40));case 5:s=Fa(s,Ha([0,e.charCodeAt(n+4)],32));case 4:s=Fa(s,Ha([0,e.charCodeAt(n+3)],24));case 3:s=Fa(s,Ha([0,e.charCodeAt(n+2)],16));case 2:s=Fa(s,Ha([0,e.charCodeAt(n+1)],8));case 1:s=Ca(s=Fa(s,[0,e.charCodeAt(n)]),u),i=Fa(i,s=Ca(s=Ia(s,31),c))}return i=Ta(i=Fa(i,[0,e.length]),o=Fa(o,[0,e.length])),o=Ta(o,i),i=Ta(i=ja(i),o=ja(o)),o=Ta(o,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}(function(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var a=r[n],i=e[a],o=i.error?"error":JSON.stringify(i.value);t+=(t?"|":"")+a.replace(/([:|\\])/g,"\\$1")+":"+o}return t}(e))}function xi(e){return void 0===e&&(e=50),function(e,t){void 0===t&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise((function(e){return n.call(window,(function(){return e()}),{timeout:t})})):Aa(Math.min(e,t))}(e,2*e)}function ki(e,t){var n=Date.now();return{get:function(r){return wa(this,void 0,void 0,(function(){var a,i,o;return xa(this,(function(s){switch(s.label){case 0:return a=Date.now(),[4,e()];case 1:return i=s.sent(),o=function(e){var t;return{get visitorId(){return void 0===t&&(t=wi(this.components)),t},set visitorId(e){t=e},confidence:vi(e),components:e,version:"3.3.3"}}(i),(t||(null==r?void 0:r.debug))&&console.log("Copy the text below to get the debug data:\n\n```\nversion: "+o.version+"\nuserAgent: "+navigator.userAgent+"\ntimeBetweenLoadAndGet: "+(a-n)+"\nvisitorId: "+o.visitorId+"\ncomponents: "+bi(i)+"\n```"),[2,o]}}))}))}}}var Si={load:function(e){var t=void 0===e?{}:e,n=t.delayFallback,r=t.debug,a=t.monitoring,i=void 0===a||a;return wa(this,void 0,void 0,(function(){return xa(this,(function(e){switch(e.label){case 0:return i&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v3.3.3/npm-monitoring",!0),e.send()}catch(e){console.error(e)}}(),[4,xi(n)];case 1:return e.sent(),[2,ki(Ba(yi,{debug:r},[]),r)]}}))}))},hashComponents:wi,componentsToDebugString:bi};function Ai(){return Ei.apply(this,arguments)}function Ei(){return(Ei=va(ga.mark((function e(){var t,n;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Si.load({monitoring:!1});case 3:return t=e.sent,e.next=6,t.get();case 6:return n=e.sent,e.abrupt("return",n.visitorId);case 10:return e.prev=10,e.t0=e.catch(0),console.log(e.t0),e.abrupt("return","");case 14:case"end":return e.stop()}}),e,null,[[0,10]])})))).apply(this,arguments)}function $i(){return Ti.apply(this,arguments)}function Ti(){return(Ti=va(ga.mark((function e(){return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){window.requestIdleCallback?requestIdleCallback(va(ga.mark((function t(){var n;return ga.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ai();case 2:n=t.sent,e(n);case 4:case"end":return t.stop()}}),t)})))):setTimeout(va(ga.mark((function t(){var n;return ga.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Ai();case 2:n=t.sent,e(n);case 4:case"end":return t.stop()}}),t)}))),500)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ci=function(e){var t=e.env,n=e.kountAccountId,r=e.kountSessionId,a=function(e){return"production"===e}(t)?"https://ssl.kaptcha.com":"https://tst.kaptcha.com",i=new URL("".concat(a,"/collect/sdk"));i.searchParams.append("m",n),r&&i.searchParams.append("m",r);var o=document.createElement("script");return o.setAttribute("class","kaxsdc"),o.setAttribute("data-event","load"),o.setAttribute("type","text/javascript"),o.setAttribute("src",i.href),document.body.append(o),o};function Ii(e){return Hi.apply(this,arguments)}function Hi(){return(Hi=va(ga.mark((function e(t){var n,r,a;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.env,r=t.kountAccountId,a=t.kountSessionId,e.abrupt("return",new Promise((function(e,t){var i=Ci({env:n,kountAccountId:r,kountSessionId:a});i.onload=function(){var t=new ka.ClientSDK;t.setupCallback({"collect-begin":function(t){var n=t.MercSessId;e(n)}}),t.autoLoadEvents()},i.onerror=function(){t(new Error("Error attempting to mount Kount script"))}})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Fi(e){return ji.apply(this,arguments)}function ji(){return(ji=va(ga.mark((function e(t){var n,r,a,i,o,s,l,u,c,d,p,f,h,m,g,y,v,b,w,x;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.env,r=void 0===n?null:n,a=t.screen,i=t.navigator,o=t.kountAccountId,s=void 0===o?null:o,l=t.kountSessionId,u=void 0===l?null:l,c=t.getFingerprint,d=t.getFraudSessionId,f=(p=a||{}).colorDepth,h=p.height,m=p.width,y=(g=i||{}).javaEnabled,v=g.language,e.prev=3,e.next=6,c();case 6:if(b=e.sent,!s){e.next=11;break}return e.next=10,d({env:r,kountAccountId:s,kountSessionId:u});case 10:w=e.sent;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(3),console.error(e.t0);case 16:return x={riskMetadata:{fingerprint:b||null,extraData:{kountFraudSessionId:w||null},browserData:{colorDepth:f||null,isJavaEnabled:y?y.call(i):null,language:v||null,screenHeight:h||null,screenWidth:m||null,timeZoneOffset:(new Date).getTimezoneOffset()}}},e.abrupt("return",x);case 18:case"end":return e.stop()}}),e,null,[[3,13]])})))).apply(this,arguments)}function Pi(){return Li.apply(this,arguments)}function Li(){return(Li=va(ga.mark((function e(){var t,n,r,a,i,o,s,l=arguments;return ga.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=l.length>0&&void 0!==l[0]?l[0]:{},n=t.env,r=void 0===n?null:n,a=t.kountAccountId,i=void 0===a?null:a,o=t.kountSessionId,s=void 0===o?null:o,e.abrupt("return",Fi({env:r,screen:screen,navigator:navigator,kountAccountId:i,kountSessionId:s,getFingerprint:$i,getFraudSessionId:Ii}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}class Ri extends et{}class Mi extends et{}class Oi extends et{get logo(){return this.landscapeLogo||this.portraitLogo}}class qi{constructor({name:e="",expirationTime:t="",displayName:n="",country:r="",merchantName:a="",merchantOrigin:i="",paypalMerchantId:o="",billingAgreementToken:s="",linkToken:l=""}={}){this.name=e,this.expirationTime=t,this.displayName=n,this.country=r,this.merchantName=a,this.merchantOrigin=i,this.paypalMerchantId=o,this.billingAgreementToken=s,this.linkToken=l}}class Bi{constructor({index:e=null,method:t="",feature:n=null,brands:r=[],filters:a=[],metadata:i=null}={}){this.index=e,this.method=t,this.feature=n?new qi(n):null,this.brands=r,this.filters=a,this.metadata=i?new Oi(i):null}}async function _i({state:e,riskMetadata:t=null}){return da({state:e},(async()=>{var n,r,a,i,o;if(!t){const{riskMetadata:e}=await Pi();t=e}const s={riskMetadata:t};let l=(null===(n=e.options)||void 0===n?void 0:n.websiteId)||null;var u,c;l||(null!==(u=e.data.transaction)&&void 0!==u&&u.websiteId?l=e.data.transaction.websiteId:null!==(c=e.data.invoice)&&void 0!==c&&c.websiteId&&(l=e.data.invoice.websiteId));if(s.websiteId=l,null!==(r=e.options)&&void 0!==r&&r.items&&(s.items=e.options.items),null!==(a=e.data)&&void 0!==a&&a.amountAndCurrency){const t=e.data.amountAndCurrency;s.amount=t.amount,s.currency=t.currency}null!==(i=e.data)&&void 0!==i&&null!==(o=i.account)&&void 0!==o&&o.address&&(s.billingAddress=e.data.account.address);const[{fields:d},{items:p}]=await Promise.all([e.storefront.purchase.readyToPay({data:s}),e.storefront.rebilly.paymentMethods.getAll()]),f=p.map((({fields:e})=>e));return Object.values(d).filter((e=>!("paypal"===e.method&&!e.feature))).filter((e=>!("ach"===e.method&&e.feature))).map(((e,t)=>{const n=f.find((t=>t.apiName===e.method));return new Bi({index:t,metadata:n,...e})}))}))}class zi extends et{}async function Di({data:e=null,state:t=null}){return da({state:t},(async()=>{t.storefront.setSessionToken(t.options.jwt);const{fields:n}=await t.storefront.invoices.get(e);return new zi(n)}))}class Ni extends et{constructor({invoiceIds:e=[],...t}){super(t),this.invoiceIds=e||[]}get invoiceId(){return this.invoiceIds[0]||null}get hasInvoice(){return!!this.invoiceId}}async function Ui({data:e=null,state:t=null}){return da({state:t},(async()=>{t.storefront.setSessionToken(t.options.jwt);const{fields:n}=await t.storefront.transactions.get(e);return new Ni(n)}))}class Wi{constructor({firstName:e=null,lastName:t=null,organization:n=null,address:r=null,address2:a=null,city:i=null,region:o=null,country:s=null,postalCode:l=null,emails:u=[],phoneNumbers:c=[]}={}){var d,p;this.firstName=e,this.lastName=t,this.organization=n,this.address=r,this.address2=a,this.city=i,this.region=o,this.country=s,this.postalCode=l,this.email=(null===(d=u.find((e=>e.primary)))||void 0===d?void 0:d.value)||null,this.phoneNumber=(null===(p=c.find((e=>e.primary)))||void 0===p?void 0:p.value)||null}}class Vi extends et{constructor({primaryAddress:e={},...t}={}){super(t),this.address=new Wi({...e})}}async function Gi({state:e=null}){return da({state:e},(async()=>{e.storefront.setSessionToken(e.options.jwt);const{fields:t}=await e.storefront.account.get();return new Vi(t)}))}async function Ki({state:e}){return da({state:e},(async()=>{const{items:t}=await e.storefront.paymentInstruments.getAll();return t.map((({fields:e})=>e))}))}class Ji{constructor({state:e={},...t}={}){var n;Object.entries({...e.data||{},...t}).forEach((([e,t])=>{this[e]=t})),this.money=(null===(n=e.options)||void 0===n?void 0:n.money)||null}get amountAndCurrency(){let e,t;return this.previewPurchase?(e=this.previewPurchase.currency,t=this.previewPurchase.total):this.invoice?(e=this.invoice.currency,t=this.invoice.amount):this.transaction?(e=this.transaction.currency,t=this.transaction.amount):this.money&&(e=this.money.currency,t=this.money.amount),{amount:t,currency:e}}get isPayment(){return this.invoice||this.transaction||this.money}get isPurchase(){return this.previewPurchase}get summaryItems(){const{discountsAmount:e=null,shippingAmount:t=null,subtotalAmount:n=null,taxAmount:r=null}=this.previewPurchase||this.invoice||{};return{discountsAmount:e,shippingAmount:t,subtotalAmount:n,taxAmount:r}}get summaryLineItems(){let e=[];return this.invoice?({items:e=[]}=this.invoice):({lineItems:e=[]}=this.previewPurchase||{}),e}get isShippingRequired(){return(this.products||[]).some((e=>e.requiresShipping))}toPostmatesModel(){return{...this,amountAndCurrency:this.amountAndCurrency,isPayment:this.isPayment,isPurchase:this.isPurchase,summaryItems:this.summaryItems,summaryLineItems:this.summaryLineItems,isShippingRequired:this.isShippingRequired}}}async function Xi({state:e=null,riskMetadata:t=null,summaryPayload:n=null,fetchInvoice:r=Di,fetchTransaction:a=Ui,fetchAccount:i=Gi,fetchInstruments:o=Ki}){try{var s,l,u,c,d,p;let g=null,y=null,v=null;null!==(s=e.options)&&void 0!==s&&s.transactionId&&(g=await a({data:{id:e.options.transactionId},state:e}),e.data.transaction=g);let b=null;var f,h,m;if(null!==(l=e.options)&&void 0!==l&&l.invoiceId||null!==(u=e.data)&&void 0!==u&&null!==(c=u.transaction)&&void 0!==c&&c.hasInvoice)b=await r({data:{id:(null===(f=e.options)||void 0===f?void 0:f.invoiceId)||(null===(h=e.data)||void 0===h||null===(m=h.transaction)||void 0===m?void 0:m.invoiceId)},state:e}),e.data.invoice=b;if(!t){const{riskMetadata:e}=await Pi();t=e}null!==(d=e.options)&&void 0!==d&&d.jwt&&([y,v]=await Promise.all([i({state:e}),o({state:e})])),e.data=new Ji({state:e,invoice:b,transaction:g,riskMetadata:t,account:y,availableInstruments:v});const[w,x]=await Promise.all([(null===(p=e.data)||void 0===p?void 0:p.readyToPay)||_i({riskMetadata:t,state:e}),e.options.items?fa({data:n,state:e}):null]);let k=null,S=null;try{k=await async function({state:e={},data:t={}}){return da({state:e},(async()=>{const n=t.lineItems||e.data.summaryLineItems,r={filter:""};if(n.length&&(r.filter=`id:${n.map((e=>e.planId)).join(",")}`),r.filter.length){const{items:t}=await e.storefront.plans.getAll(r);return t.map((({fields:e})=>new Ri(e)))}return[]}))}({state:e}),e.data.plans=k}catch(e){k=[]}try{S=await async function({state:e}){return da({state:e},(async()=>{var t;let n=[];e.data.plans&&(n=e.data.plans),null!==(t=e.data.invoice)&&void 0!==t&&t.items&&(n=e.data.invoice.items);const r={filter:""};if(n.length&&(r.filter=`id:${n.map((e=>e.productId)).join(",")}`),r.filter.length){const{items:t}=await e.storefront.products.getAll(r);return t.map((({fields:e})=>new Mi(e)))}return[]}))}({state:e})}catch(e){S=[]}return new Ji({state:e,readyToPay:w,previewPurchase:x,plans:k,products:S,invoice:b,transaction:g,riskMetadata:t})}catch(e){}return new Ji({})}async function Zi({name:e="",url:t="",model:n={},classListArray:r=[],close:a=(()=>{}),state:i=null}={}){var o;const s=null==n||null===(o=n.method)||void 0===o?void 0:o.method,l="rebilly-instruments-approval-url"===e;i.form.insertAdjacentHTML("beforeend",((e,t)=>`\n <div class="rebilly-instruments-modal-overlay">\n <div class="rebilly-instruments-modal-container ${t?`rebilly-instruments-${t}`:""} ${e?"is-redirect":""}">\n ${e?"":'\n <svg class="rebilly-instruments-modal-close" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">\n <path d="m15 13.5858 7.2929-7.293c.3905-.3904 1.0237-.3904 1.4142 0 .3905.3906.3905 1.0238 0 1.4143L16.4142 15l7.293 7.2929c.3904.3905.3904 1.0237 0 1.4142-.3906.3905-1.0238.3905-1.4143 0L15 16.4142l-7.2929 7.293c-.3905.3904-1.0237.3904-1.4142 0-.3905-.3906-.3905-1.0238 0-1.4143L13.5858 15l-7.293-7.2929c-.3904-.3905-.3904-1.0237 0-1.4142.3906-.3905 1.0238-.3905 1.4143 0L15 13.5858Z" fill-rule="nonzero"/>\n </svg>\n '}\n <div class="rebilly-instruments-modal-content"></div>\n </div>\n </div>\n`)(l,s));const u=document.querySelector(".rebilly-instruments-modal-overlay"),c=document.querySelector(".rebilly-instruments-modal-container"),d=document.querySelector(".rebilly-instruments-modal-close"),p=document.querySelector(".rebilly-instruments-modal-content");document.body.style.overflow="hidden",setTimeout((()=>{u.classList.add("is-visible"),c.classList.add("is-visible")}),240),i.loader.addDOMElement({section:"modal",el:p}),i.loader.startLoading({section:"modal",id:e});const f={options:i.options,...n},h=await new Qe({state:i,name:e,url:t,model:f,classListArray:r,container:p}),m=(...e)=>{c.classList.remove("is-visible"),u.classList.remove("is-visible"),setTimeout((()=>{document.body.style.overflow="auto",u.children.forEach((e=>e.remove())),u.remove(),a(...e),h.destroy()}),300)};return h.bindEventListeners({close:m,loader:i.loader}),l||d.addEventListener("click",m),h}async function Yi({state:e,payload:t}){const{_raw:{id:n},isExistingInstrument:r}=t;delete t.isExistingInstrument,delete t._raw;const a={...t};r?a.paymentInstrumentId=n:a.token=n,e.options.invoiceId&&(a.invoiceId=e.options.invoiceId),e.options.transactionId&&(a.transactionId=e.options.transactionId),e.options.money&&(a.websiteId=e.options.websiteId,a.amount=e.options.money.amount,a.currency=e.options.money.currency);let{fields:i}=await async function({data:e,state:t}){return da({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.payment({data:e}))))}({state:e,data:a});return i={transaction:i,token:i.token||e.options.jwt},e.data.invoice&&(i.invoice=e.data.invoice),i}async function Qi({state:e,payload:t}){const{fields:n}=await async function({data:e,state:t}){return da({state:t},(async()=>(e._raw&&delete e._raw,t.storefront.purchase.purchase({data:e}))))}({state:e,data:{websiteId:e.options.websiteId,items:e.options.items,paymentInstruction:{token:t._raw.id},...t}});return n}async function eo({state:e,payload:t}){try{var n,r;let a;return a=e.data.isPayment?await Yi({state:e,payload:t}):await Qi({state:e,payload:t}),null!==(n=a.transaction)&&void 0!==n&&n.approvalUrl&&"unknown"===(null===(r=a.transaction)||void 0===r?void 0:r.result)?function({state:e,fields:t}){const{paymentMethodsUrl:n}=e.options._computed,r={};e.data.isPayment?r.payment=t:r.purchase=t,e.data=new Ji({state:e,...t}),Zi({state:e,name:"rebilly-instruments-approval-url",url:`${n}/approval-url`,model:r,close:e=>{Ue.purchaseCompleted.dispatch(e)}})}({state:e,fields:a}):Ue.purchaseCompleted.dispatch(a),a}catch(e){return Ge(e),e}}async function to({state:e,payload:t}){try{var n;const{_raw:{id:r},isExistingInstrument:a}=t;delete t.isExistingInstrument,delete t._raw;const i={...t};a?i.paymentInstrumentId=r:i.token=r;const{instrument:o,transaction:s}=await async function({data:e,state:t}){return da({state:t},(async()=>{var n,r;const{fields:a}=await t.storefront.paymentInstruments.create({data:e});t.storefront.setSessionToken(a.token||t.options.jwt);const i={id:a.id,data:{websiteId:t.options.websiteId,...e}};t.data.amountAndCurrency&&(i.data={...i.data,...t.data.amountAndCurrency}),null!==(n=t.data)&&void 0!==n&&null!==(r=n.transaction)&&void 0!==r&&r.redirectUrl&&(i.data.redirectUrl=`${i.data.redirectUrl}&originalRedirectUrl=${t.data.transaction.redirectUrl}`);const{fields:o}=await t.storefront.paymentInstruments.setup(i);return{instrument:a,transaction:o}}))}({state:e,data:{websiteId:null===(n=e.options)||void 0===n?void 0:n.websiteId,...i}});if(e.data=new Ji({state:e,instrument:o,transaction:s}),s.approvalUrl&&"unknown"===s.result){const{paymentMethodsUrl:t}=e.options._computed;Zi({state:e,name:"rebilly-instruments-approval-url",url:`${t}/approval-url`,model:{setup:{transaction:s}},close:({transaction:e=s})=>{Ue.setupCompleted.dispatch({instrument:o,transaction:e})}})}else Ue.setupCompleted.dispatch({instrument:o,transaction:s});return{instrument:o,transaction:s}}catch(e){return Ge(e),e}}function no({state:e,id:t}){const{Rebilly:n}=window,r=document.querySelector(`.rebilly-instruments-${t}-method`);function a(){if(!r.children.length){const r={"google-pay":"googlePay","pay-pal-billing-agreement":"paypal","apple-pay":"applePay"};r[t]?(n[r[t]].mount(`.rebilly-instruments-${t}-method`),"apple-pay"===t&&function(){const t=document.querySelector("#rebilly-apple-pay-button"),{applePayDisplayOptions:{buttonHeight:n}}=e.options.digitalWallet.applePay;t.style.margin="0px",t.style.width="100%",t.style.height=n,t.style.cursor="pointer"}()):console.warn(`method '${t}' is not supported`)}}null==n||n.on("ready",(()=>{a()})),null==n||n.on("error",(e=>{console.error(e)}))}var ro=y((function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,a="[object Arguments]",i="[object Function]",o="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[a]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[i]=u["[object Map]"]=u["[object Number]"]=u[o]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c="object"==typeof g&&g&&g.Object===Object&&g,d="object"==typeof self&&self&&self.Object===Object&&self,p=c||d||Function("return this")(),f=t&&!t.nodeType&&t,h=f&&e&&!e.nodeType&&e,m=h&&h.exports===f,y=m&&c.process,v=function(){try{var e=h&&h.require&&h.require("util").types;return e||y&&y.binding&&y.binding("util")}catch(e){}}(),b=v&&v.isTypedArray;function w(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var x,k,S,A=Array.prototype,E=Function.prototype,$=Object.prototype,T=p["__core-js_shared__"],C=E.toString,I=$.hasOwnProperty,H=(x=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",F=$.toString,j=C.call(Object),P=RegExp("^"+C.call(I).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?p.Buffer:void 0,R=p.Symbol,M=p.Uint8Array,O=L?L.allocUnsafe:void 0,q=(k=Object.getPrototypeOf,S=Object,function(e){return k(S(e))}),B=Object.create,_=$.propertyIsEnumerable,z=A.splice,D=R?R.toStringTag:void 0,N=function(){try{var e=me(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),U=L?L.isBuffer:void 0,W=Math.max,V=Date.now,G=me(p,"Map"),K=me(Object,"create"),J=function(){function e(){}return function(t){if(!Te(t))return{};if(B)return B(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Q(e){var t=this.__data__=new Z(e);this.size=t.size}function ee(e,t){var n=ke(e),r=!n&&xe(e),a=!n&&!r&&Ae(e),i=!n&&!r&&!a&&Ie(e),o=n||r||a||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=s.length;for(var u in e)!t&&!I.call(e,u)||o&&("length"==u||a&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ge(u,l))||s.push(u);return s}function te(e,t,n){(void 0!==n&&!we(e[t],n)||void 0===n&&!(t in e))&&ae(e,t,n)}function ne(e,t,n){var r=e[t];I.call(e,t)&&we(r,n)&&(void 0!==n||t in e)||ae(e,t,n)}function re(e,t){for(var n=e.length;n--;)if(we(e[n][0],t))return n;return-1}function ae(e,t,n){"__proto__"==t&&N?N(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=K?K(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(K){var r=t[e];return r===n?void 0:r}return I.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return K?void 0!==t[e]:I.call(t,e)},X.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=K&&void 0===t?n:t,this},Z.prototype.clear=function(){this.__data__=[],this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=re(t,e);return!(n<0)&&(n==t.length-1?t.pop():z.call(t,n,1),--this.size,!0)},Z.prototype.get=function(e){var t=this.__data__,n=re(t,e);return n<0?void 0:t[n][1]},Z.prototype.has=function(e){return re(this.__data__,e)>-1},Z.prototype.set=function(e,t){var n=this.__data__,r=re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Y.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(G||Z),string:new X}},Y.prototype.delete=function(e){var t=he(this,e).delete(e);return this.size-=t?1:0,t},Y.prototype.get=function(e){return he(this,e).get(e)},Y.prototype.has=function(e){return he(this,e).has(e)},Y.prototype.set=function(e,t){var n=he(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Q.prototype.clear=function(){this.__data__=new Z,this.size=0},Q.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Q.prototype.get=function(e){return this.__data__.get(e)},Q.prototype.has=function(e){return this.__data__.has(e)},Q.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Z){var r=n.__data__;if(!G||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Y(r)}return n.set(e,t),this.size=n.size,this};var ie,oe=function(e,t,n){for(var r=-1,a=Object(e),i=n(e),o=i.length;o--;){var s=i[ie?o:++r];if(!1===t(a[s],s,a))break}return e};function se(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=I.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var a=F.call(e);r&&(t?e[D]=n:delete e[D]);return a}(e):function(e){return F.call(e)}(e)}function le(e){return Ce(e)&&se(e)==a}function ue(e){return!(!Te(e)||function(e){return!!H&&H in e}(e))&&(Ee(e)?P:s).test(function(e){if(null!=e){try{return C.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ce(e){if(!Te(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ye(e),n=[];for(var r in e)("constructor"!=r||!t&&I.call(e,r))&&n.push(r);return n}function de(e,t,n,r,a){e!==t&&oe(t,(function(i,s){if(a||(a=new Q),Te(i))!function(e,t,n,r,a,i,s){var l=ve(e,n),u=ve(t,n),c=s.get(u);if(c)return void te(e,n,c);var d=i?i(l,u,n+"",e,t,s):void 0,p=void 0===d;if(p){var f=ke(u),h=!f&&Ae(u),m=!f&&!h&&Ie(u);d=u,f||h||m?ke(l)?d=l:Ce(w=l)&&Se(w)?d=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(l):h?(p=!1,d=function(e,t){if(t)return e.slice();var n=e.length,r=O?O(n):new e.constructor(n);return e.copy(r),r}(u,!0)):m?(p=!1,g=u,y=!0?(v=g.buffer,b=new v.constructor(v.byteLength),new M(b).set(new M(v)),b):g.buffer,d=new g.constructor(y,g.byteOffset,g.length)):d=[]:function(e){if(!Ce(e)||se(e)!=o)return!1;var t=q(e);if(null===t)return!0;var n=I.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&C.call(n)==j}(u)||xe(u)?(d=l,xe(l)?d=function(e){return function(e,t,n,r){var a=!n;n||(n={});var i=-1,o=t.length;for(;++i<o;){var s=t[i],l=r?r(n[s],e[s],s,n,e):void 0;void 0===l&&(l=e[s]),a?ae(n,s,l):ne(n,s,l)}return n}(e,He(e))}(l):Te(l)&&!Ee(l)||(d=function(e){return"function"!=typeof e.constructor||ye(e)?{}:J(q(e))}(u))):p=!1}var g,y,v,b;var w;p&&(s.set(u,d),a(d,u,r,i,s),s.delete(u));te(e,n,d)}(e,t,s,n,de,r,a);else{var l=r?r(ve(e,s),i,s+"",e,t,a):void 0;void 0===l&&(l=i),te(e,s,l)}}),He)}function pe(e,t){return be(function(e,t,n){return t=W(void 0===t?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=W(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var s=Array(t+1);++a<t;)s[a]=r[a];return s[t]=n(o),w(e,this,s)}}(e,t,Pe),e+"")}var fe=N?function(e,t){return N(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Pe;function he(e,t){var n,r,a=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?a["string"==typeof t?"string":"hash"]:a.map}function me(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ue(n)?n:void 0}function ge(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function ye(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||$)}function ve(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var be=function(e){var t=0,n=0;return function(){var r=V(),a=16-(r-n);if(n=r,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(fe);function we(e,t){return e===t||e!=e&&t!=t}var xe=le(function(){return arguments}())?le:function(e){return Ce(e)&&I.call(e,"callee")&&!_.call(e,"callee")},ke=Array.isArray;function Se(e){return null!=e&&$e(e.length)&&!Ee(e)}var Ae=U||function(){return!1};function Ee(e){if(!Te(e))return!1;var t=se(e);return t==i||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function $e(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function Te(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ce(e){return null!=e&&"object"==typeof e}var Ie=b?function(e){return function(t){return e(t)}}(b):function(e){return Ce(e)&&$e(e.length)&&!!u[se(e)]};function He(e){return Se(e)?ee(e,!0):ce(e)}var Fe,je=(Fe=function(e,t,n){de(e,t,n)},pe((function(e,t){var n=-1,r=t.length,a=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(a=Fe.length>3&&"function"==typeof a?(r--,a):void 0,i&&function(e,t,n){if(!Te(n))return!1;var r=typeof t;return!!("number"==r?Se(n)&&ge(t,n.length):"string"==r&&t in n)&&we(n[t],e)}(t[0],t[1],i)&&(a=r<3?void 0:a,r=1),e=Object(e);++n<r;){var o=t[n];o&&Fe(e,o,n,a)}return e})));function Pe(e){return e}e.exports=je}));const ao=e=>{var t,n;return{METHOD_ID:ze((null===(t=e.feature)||void 0===t?void 0:t.name)||e.method),METHOD_TYPE:le((null===(n=e.feature)||void 0===n?void 0:n.name)||e.method).replace("-","")}};async function io({state:e,methods:t,container:n}){const r=t.map((e=>{const{METHOD_ID:t}=ao(e);return t})),{Rebilly:a}=window;null!=a&&a.initialized||await(null==a?void 0:a.initialize(function({state:e,methodIds:t}={}){const{options:n,data:r}=e,a={style:n.themeFramepay,locale:(null==n?void 0:n.locale)||"auto",organizationId:n.organizationId,websiteId:n.websiteId,methods:r.readyToPay};var i,o;return t.includes("pay-pal-billing-agreement")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},r.amountAndCurrency),a.paypal=n.paymentInstruments.paypal),t.includes("google-pay")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},null===(i=n.digitalWallet.googlePay)||void 0===i?void 0:i.transactionData),a.googlePay=n.digitalWallet.googlePay.googlePayDisplayOptions),t.includes("apple-pay")&&(a.transactionData=ro("object"==typeof a.transactionData?a.transactionData:{},null===(o=n.digitalWallet.applePay)||void 0===o?void 0:o.transactionData),a.applePay=n.digitalWallet.applePay.applePayDisplayOptions),n.publishableKey&&(a.publishableKey=n.publishableKey),n.jwt&&(a.jwt=n.jwt,a.sandbox="sandbox"===n.apiMode),a}({state:e,methodIds:r}))),r.forEach((t=>{("apple-pay"!==t||window.ApplePaySession)&&(n.innerHTML+=`\n <div class="rebilly-instruments-${t}-method"></div>\n `,no({state:e,id:t}))}));const i="sandbox"===e.options.apiMode?"https://forms-sandbox.secure-payments.app/approval-url?close=true":"https://forms.secure-payments.app/approval-url?close=true";null==a||a.on("token-ready",(t=>{var n,r,a;const o={websiteId:e.options.websiteId,billingAddress:t.billingAddress,redirectUrl:i,_raw:t};if(null!==(n=e.data)&&void 0!==n&&n.isShippingRequired&&(t.shippingAddress?o.deliveryAddress=t.shippingAddress:o.deliveryAddress=o.billingAddress),Array.isArray(null===(r=o.billingAddress)||void 0===r?void 0:r.emails)){const e=o.billingAddress.emails.find((e=>"main"===e.label));null!=e&&e.value&&(o.billingAddress.email=e.value)}if(Array.isArray(null===(a=o.deliveryAddress)||void 0===a?void 0:a.emails)){const e=o.deliveryAddress.emails.find((e=>"main"===e.label));null!=e&&e.value&&(o.deliveryAddress.email=e.value)}Ue.instrumentReady.dispatch(o)}))}async function oo({state:e}){const{EXPRESS_METHODS:t,METHODS:n}=c({state:e}),r=e.form.querySelector(".rebilly-instruments-method-selector");var a;r?(r.style.visibility="visible",r.style.height="auto"):e.form.innerHTML+=`\n<div class="rebilly-instruments-content">\n <div id="rebilly-instruments-error"></div>\n <div data-rebilly-instruments="express-method" class="rebilly-instruments-method-selector ${(a=e.options.paymentInstruments.compactExpressInstruments&&t.length)?"has-express-compact":""}">\n <div class="rebilly-instruments-express-methods ${a?"is-compact":""}">\n <span data-rebilly-i18n="form.expressCheckout" class="rebilly-instruments-express-methods-label">Express checkout</span>\n <div class="rebilly-instruments-express-methods-container"></div>\n </div>\n <div data-rebilly-instruments="divider" class="rebilly-instruments-divider">\n <span class="rebilly-instruments-divider-label" data-rebilly-i18n="form.or">Or</span>\n </div>\n </div>\n <div class="rebilly-instruments-methods"></div>\n</div>\n`;const i=document.querySelector(".rebilly-instruments-methods"),o=document.querySelector(".rebilly-instruments-express-methods-container");if(t.length?r||(e.options.digitalWallet=function({state:e,EXPRESS_METHODS:t}){var n;const r={},{paymentInstruments:a}=e.options,i={countryCode:e.options.countryCode,label:e.options.websiteId};if(null!==(n=e.data)&&void 0!==n&&n.amountAndCurrency){const{amount:t,currency:n}=e.data.amountAndCurrency;i.amount=t,i.currency=n}return t.forEach((e=>{var t,n;const{METHOD_TYPE:o}=ao(e);var s,l;"Google Pay"===(null===(t=e.feature)||void 0===t?void 0:t.name)&&(r[o]={transactionData:i,merchantConfig:{merchantName:e.feature.merchantName,merchantOrigin:e.feature.merchantOrigin},googlePayDisplayOptions:a.googlePay.displayOptions}),"Apple Pay"===(null===(n=e.feature)||void 0===n?void 0:n.name)&&(r[o]={transactionData:i,merchantConfig:{merchantName:null===(s=a.applePay)||void 0===s||null===(l=s.merchantConfig)||void 0===l?void 0:l.merchantName,merchantOrigin:window.location.hostname},applePayDisplayOptions:a.applePay.displayOptions})})),r}({state:e,EXPRESS_METHODS:t}),io({state:e,methods:t,container:o})):(o.style.display="none",document.querySelectorAll('[data-rebilly-instruments="divider"]').forEach((e=>{e.style.display="none"}))),n.length){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r="rebilly-instruments-form",a=await new Ye({name:r,url:`${n}`,container:i,model:t});a.bindEventListeners({loader:e.loader}),a.component.on(`${r}-confirm-purchase`,(t=>{eo({state:e,payload:t})})),a.component.on(`${r}-confirm-setup`,(t=>{to({state:e,payload:t})})),a.component.on("choose-another-method",(()=>{document.querySelectorAll('[data-rebilly-instruments="express-method"]').forEach((e=>{e.style.height="auto"})),a.component.call("route",{name:"method-switch"}),e.data.isPurchase&&ha({state:e}),a.component.call("update",t)})),e.iframeComponents.form=a}else i.style.display="none",document.querySelectorAll('[data-rebilly-instruments="divider"]').forEach((e=>{e.style.display="none"}))}function so({element:e="div",attributes:t={},content:n=null,target:r="body",insertMethod:a="append"}={}){const i=document.createElement(e);Object.entries(t).forEach((([e,t])=>{i.setAttribute(e,t)})),n&&(i.innerHTML=n),document[r][a](i)}var lo=({element:e="",options:t={}})=>{if("form"!==e&&"summary"!==e)throw new Error('element must be "form" or "summary"');return function({prop:e,propName:t="Mounting",isRequired:n=!0}={}){let r;if(void 0===e)throw new Error('processPropertyDOMElement: Missing argument "prop"');if("string"==typeof(a=e)&&a.match(/([.#][_a-z]+[_a-z0-9-:\\]*)/gi))r=document.querySelector(e);else{if(!d(e))throw new Error(`Please provide a valid CSS class, id or DOM element for "${t}" property`);r=e}var a;if(!r&&n)throw new Error(`Could not find DOM element with CSS class or id "${e}" to mount ${t}`);return r}({prop:t[e]?t[e]:"summary"===e?".rebilly-instruments-summary":".rebilly-instruments",propName:e,isRequired:["form"].includes(e)})},uo=({options:{publishableKey:e,orgnizationId:t,apiMode:n,_dev:r}})=>{const a={orgnizationId:t,mode:n||"live"};return e&&(a.publishableKey=e),r&&(a.liveUrl=r.liveUrl||"https://api.rebilly.com",a.sandboxUrl=r.sandboxUrl||"https://api-sandbox.rebilly.com"),((e={})=>new pa(e))(a)};function co(e){this.message=e}co.prototype=new Error,co.prototype.name="InvalidCharacterError";var po="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new co("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,a=0,i=0,o="";r=t.charAt(i++);~r&&(n=a%4?64*n+r:r,a++%4)?o+=String.fromCharCode(255&n>>(-2*a&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function fo(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(po(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return po(t)}}function ho(e){this.message=e}ho.prototype=new Error,ho.prototype.name="InvalidTokenError";const mo={countryCode:"US",locale:"auto",theme:{labels:"stacked"},paymentInstruments:{address:{name:"default",region:"default",hide:[],show:[],require:[]},compactExpressInstruments:!1,googlePay:{displayOptions:{buttonColor:"black",buttonType:"short",buttonHeight:"44px"}},applePay:{displayOptions:{buttonColor:"black",buttonType:"plain",buttonHeight:"44px"}},paymentCard:{popup:!1},paypal:{buttonHeight:44}},transactionType:"purchase",features:{autoConfirmation:!0,autoResult:!0}};var go=({options:e={}}={})=>{!function(e){const t=[e.jwt,e.items,e.invoiceId,e.money,e.transactionId].filter((e=>e));if(0===t.length)throw new Error("Must provide purchase data");if(t.length>1){if(e.jwt&&(e.invoiceId||e.transactionId))return;throw new Error("Must provide only one purchase data type")}}(e);const t={paymentMethodsUrl:e._dev?e._dev.paymentMethodsUrl||"https://forms.local.rebilly.dev:3000":"https://forms.secure-payments.app"},n=ro({...mo},{apiMode:e.apiMode,i18n:e.i18n,theme:e.theme,css:e.css,locale:e.locale,countryCode:e.countryCode,features:e.features,paymentInstruments:e.paymentInstruments,transactionType:e.transactionType,_computed:t});if(e.publishableKey)Object.entries({organizationId:e.organizationId,publishableKey:e.publishableKey,websiteId:e.websiteId}).forEach((([e,t])=>{n[e]=t}));else if(e.jwt){n.jwt=e.jwt;const{merchant:t,claims:{transactionId:r,invoiceId:a}}=function(e,t){if("string"!=typeof e)throw new ho("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(fo(e.split(".")[n]))}catch(e){throw new ho("Invalid token specified: "+e.message)}}(n.jwt);n.organizationId=t,r&&(n.transactionId=r),a&&(n.invoiceId=a)}return["items","money","invoiceId","transactionId","jwt","_dev"].forEach((t=>{e[t]&&(n[t]=e[t])})),n};async function yo(e={}){const{_dev:t}=e.options||{},n={script:(null==t?void 0:t.framePayScriptLink)||"https://framepay.rebilly.com/rebilly.js",style:(null==t?void 0:t.framePayStyleLink)||"https://framepay.rebilly.com/rebilly.css"};return new Promise((e=>{const t=document.createElement("link");t.setAttribute("href",n.style),t.setAttribute("rel","stylesheet"),document.head.prepend(t);const r=document.createElement("script");r.setAttribute("src",n.script),r.onload=()=>e(),document.head.append(r)}))}var vo=y((function(e,t){e.exports=function(){var e={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},t=new RegExp("[^#a-f\\d]","gi"),n=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i"),r=new RegExp(/^#([a-f0-9]{3,4}|[a-f0-9]{4}(?:[a-f0-9]{2}){1,2})\b$/,"i"),a="-?\\d*(?:\\.\\d+)",i="("+a+"?)",o="("+a+"?%)",s=("^\n hsla?\\(\n \\s*(-?\\d*(?:\\.\\d+)?(?:deg|rad|turn)?)\\s*,\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),l=new RegExp(s),u=("^\n hsla?\\(\n \\s*(-?\\d*(?:\\.\\d+)?(?:deg|rad|turn)?)\\s*\n \\s+"+o+"\n \\s+"+o+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),c=new RegExp(u),d=("^\n rgba?\\(\n \\s*"+i+"\\s*,\n \\s*"+i+"\\s*,\n \\s*"+i+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),p=new RegExp(d),f=("^\n rgba?\\(\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*,\n \\s*"+o+"\\s*\n (?:,\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n $\n").replace(/\n|\s/g,""),h=new RegExp(f),m=("^\n rgba?\\(\n \\s*"+i+"\n \\s+"+i+"\n \\s+"+i+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n$\n").replace(/\n|\s/g,""),g=new RegExp(m),y=("^\n rgba?\\(\n \\s*"+o+"\n \\s+"+o+"\n \\s+"+o+"\n \\s*(?:\\s*\\/\\s*(-?\\d*(?:\\.\\d+)?%?)\\s*)?\n \\)\n$\n").replace(/\n|\s/g,""),v=new RegExp(y),b=new RegExp(/^transparent$/,"i"),w=function(e,t,n){return Math.min(Math.max(t,e),n)},x=function(e){var t=e;return"number"!=typeof t&&(t=t.endsWith("%")?255*parseFloat(t)/100:parseFloat(t)),w(Math.round(t),0,255)},k=function(e){return w(parseFloat(e),0,100)};function S(e){var t=e;return"number"!=typeof t&&(t=t.endsWith("%")?parseFloat(t)/100:parseFloat(t)),w(t,0,1)}function A(e){var r=function(e,r){if(void 0===r&&(r={}),"string"!=typeof e||t.test(e)||!n.test(e))throw new TypeError("Expected a valid hex string");var a=1;8===(e=e.replace(/^#/,"")).length&&(a=parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),4===e.length&&(a=parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),3===e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var i=parseInt(e,16),o=i>>16,s=i>>8&255,l=255&i;return"array"===r.format?[o,s,l,a]:{red:o,green:s,blue:l,alpha:a}}(e,{format:"array"});return E([null,r[0],r[1],r[2],r[3]])}function E(e){var t=e[1],n=e[2],r=e[3],a=e[4];return void 0===a&&(a=1),{type:"rgb",values:[t,n,r].map(x),alpha:S(null===a?1:a)}
|
|
47
47
|
/**
|
|
48
48
|
* parse-css-color
|
|
49
49
|
* @version v0.1.2
|
|
@@ -62,4 +62,4 @@ function j(e){var t=$(e);return null===t?null:("hsl"===t.type&&(t.values=T(t.val
|
|
|
62
62
|
* @version v2.0.0
|
|
63
63
|
* @link http://noeldelgado.github.io/values.js/
|
|
64
64
|
* @license MIT
|
|
65
|
-
*/var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var i=$(a);if(!i)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+i.type.toUpperCase()](i.values.concat([i.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],i=e[3];return t=[T([n,r,a]).map(Math.round),i],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),bo=vo;const wo=e=>new bo(e);function xo(e,t=1){if(null===e)return e;const n=wo(e);return n.alpha=t,n.rgbString()}const ko=e=>xo(e,.5),So=(e,t)=>{if(null===e)return e;return wo(e).shade(t).hexString()};class Ao{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Eo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>ko(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?xo(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?So(e.buttonColorBackground,20):So(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new Ao(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${So(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new Ao(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?ko(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new Ao(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?ko(e.inputErrorColorText):ko(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var $o=new Proxy(Eo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class To{constructor(e={}){this.overrides=e,this.theme=$o}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!To.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function Co(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Io=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new To(e).build())}\n `;return t})(e||{});return so({element:"style",attributes:{type:"text/css"},content:Co(n),target:"head"}),t&&so({element:"style",attributes:{type:"text/css"},content:Co(t),target:"head"}),n};const Ho=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function Fo(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const jo=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Po({eventName:e,callback:t}){if(!We.includes(e))throw new Error(`${e} is not a supported event`);const n=le(e);Ue[n].addEventListener(t)}async function Lo({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form&&(n.iframeComponents.form.destroy(),n.iframeComponents.form=null),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const a=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:i}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new Ye({name:"rebilly-instruments-result",url:`${i}/result`,container:a,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form=s}({payload:t,state:n});break;case"confirmation":!async function({payload:e,state:t}){var n,r;e.billingAddress&&t.summary&&t.data.isPurchase&&ha({state:t,instrument:e});const a=t.iframeComponents.form,i={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e};null==a||null===(n=a.component)||void 0===n||n.call("route",{name:"confirmation"}),null==a||null===(r=a.component)||void 0===r||r.call("update",i),document.querySelectorAll('[data-rebilly-instruments="express-method"]').forEach((e=>{e.style.overflow="hidden",e.style.height="0px"}))}({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Ro=({state:e={}})=>{e.options.features.autoConfirmation&&Po({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?to({state:e,payload:t}):eo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Lo({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Po({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Lo({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function Mo({state:e,setupFramepay:t=yo,...n}={}){try{var r,a,i;e.data={},e.options={},e.form=lo({element:"form",options:n}),e.summary=lo({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary&&(e.summary.style.maxWidth="750px"),e.options=go({options:n}),e.storefront=uo({options:n}),e.mainStyleVars=Io({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=Fo(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...jo(n,"input"),":hover":jo(n,"inputHover"),":focus":jo(n,"inputFocus"),"::placeholder":jo(n,"inputPlaceholder"),"::selection":jo(n,"inputSelection")},invalid:{...jo(n,"inputError"),":hover":jo(n,"inputErrorHover"),":focus":jo(n,"inputErrorFocus"),"::placeholder":jo(n,"inputErrorPlaceholder"),"::selection":jo(n,"inputErrorSelection")},buttons:{base:{...jo(n,"buttonSecondary"),":hover":jo(n,"buttonSecondaryHover"),":focus":jo(n,"buttonSecondaryActive")},active:{...jo(n,"button"),":hover":jo(n,"buttonHover"),":focus":jo(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-form"}),e.data=await Xi({state:e}),Ue.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Ho})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(a=e.data.invoice)&&void 0!==a&&a.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(i=e.data.transaction)||void 0===i?void 0:i.type)&&(e.options.transactionType="setup"),e.form&&oo({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new Ye({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary=r}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw Ge(e),e}Ro({state:e})}async function Oo({state:e}){var t;await(t=1e3,new Promise((e=>setTimeout(e,t)))),Object.values(e.iframeComponents).forEach((e=>null==e?void 0:e.destroy())),De.removeAll(document),e.iframeComponents={summary:null,form:null},e.hasMounted=!1,e.summary&&(e.summary.textContent=""),e.form.textContent="",Zr(),e.loader.clearAll()}function qo({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var Bo={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},_o={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class zo{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=ro({},{...Bo,..._o},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class Do{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new h,this.translate=new zo,this.iframeComponents={summary:null,form:null},this.hasMounted=!1}}var No=new class{constructor(){this.state=new Do}async mount(e){await Mo({state:this.state,...e})}async destroy(){await Oo({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...qo({newOptions:t})},r=ro({...n},t);await Oo({state:e}),Mo({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await eo({state:this.state,payload:e})}async setup(e){await to({state:this.state,payload:e})}async show(e,t){await Lo({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.15.0-beta.0"}on(e,t){Po({state:this.state,eventName:e,callback:t})}};export{No as default};
|
|
65
|
+
*/var L=function(e,t){return null===e||isNaN(e)||"string"==typeof e?t:e},R=function(e,t,n){var r;void 0===e&&(e="#000"),void 0===t&&(t="base"),void 0===n&&(n=0),r=[[0,0,0],1,t,n],this.rgb=r[0],this.alpha=r[1],this.type=r[2],this.weight=r[3];var a=null===e?"#000":e;if("string"!=typeof a)throw new TypeError("Input should be a string: "+a);var i=$(a);if(!i)throw new Error("Unable to parse color from string: "+a);return this["_setFrom"+i.type.toUpperCase()](i.values.concat([i.alpha]))},M={hex:{configurable:!0}};return M.hex.get=function(){return this.hexString().replace(/^#/,"")},R.prototype.setColor=function(e){var t=$(e);return t?this["_setFrom"+t.type.toUpperCase()](t.values.concat([t.alpha])):null},R.prototype.tint=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#fff",this.rgbString(),t).rgba+")","tint",t)},R.prototype.shade=function(e,t){return void 0===t&&(t=L(e,50)),new R("rgb("+P("#000",this.rgbString(),t).rgba+")","shade",t)},R.prototype.tints=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.tint((r+1)*t)}))},R.prototype.shades=function(e,t){var n=this;return void 0===t&&(t=L(e,10)),Array.from({length:100/t},(function(e,r){return n.shade((r+1)*t)}))},R.prototype.all=function(e){return void 0===e&&(e=10),this.tints(e).reverse().concat([Object.assign(this)],this.shades(e))},R.prototype.hexString=function(){return H(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha]))},R.prototype.rgbString=function(){var e=(this.alpha>=1?this.rgb:this.rgb.concat([this.alpha])).join(", ");return(this.alpha>=1?"rgb":"rgba")+"("+e+")"},R.prototype.getBrightness=function(){return Math.round(this.rgb.reduce((function(e,t){return e+t}))/765*100)},R.prototype._setFromRGB=function(e){var t;return t=[[e[0],e[1],e[2]],e[3]],this.rgb=t[0],this.alpha=t[1],this},R.prototype._setFromHSL=function(e){var t,n=e[0],r=e[1],a=e[2],i=e[3];return t=[T([n,r,a]).map(Math.round),i],this.rgb=t[0],this.alpha=t[1],this},Object.defineProperties(R.prototype,M),R.VERSION="v2.0.0",R}()})),bo=vo;const wo=e=>new bo(e);function xo(e,t=1){if(null===e)return e;const n=wo(e);return n.alpha=t,n.rgbString()}const ko=e=>xo(e,.5),So=(e,t)=>{if(null===e)return e;return wo(e).shade(t).hexString()};class Ao{allStyles=["none","hidden","dotted","dashed","solid","double","groove","ridge","inset","outset","initial","inherit"];constructor(e){this.str=e||"";const t=this.allStyles.find((e=>this.str.includes(e))),n=this.str.split(t).map((e=>e.trim()));this.border=[n[0],t,n[1]]}get stylePosition(){let e=0;return 3===this.border.length?e=1:2===this.border.length&&(e=this.allStyles.includes(this.border[0])?0:1),e}updateColor(e){return this.border[this.stylePosition+1]=e,this}get value(){return this.border.join(" ")}}const Eo={colorPrimary:{fallback:{type:"static",value:"#0044D4"}},colorBackground:{fallback:{type:"static",value:"#FFFFFF"}},colorText:{fallback:{type:"static",value:"#0D2B3E"}},colorMutedText:{fallback:{type:"func",value:e=>ko(e.colorText)}},colorMutedBorder:{fallback:{type:"func",value:e=>e.colorTextProvided?xo(e.colorText,.25):"#DCE3EA"}},colorDanger:{fallback:{type:"static",value:"#CD5C5C"}},fontFamily:{fallback:{type:"static",value:"Avenir, Helvetica, Arial, sans-serif"}},fontSizeBase:{fallback:{type:"static",value:"16px"}},fontWeightBase:{fallback:{type:"static",value:"500"}},fontLineHeightBase:{fallback:{type:"func",value:e=>`calc(${e.fontSizeBase} * 1.5)`}},fontSmooth:{fallback:{type:"static",value:"auto"}},borderRadius:{fallback:{type:"static",value:"6px"}},headingFontFamily:{fallback:{type:"variable",value:"fontFamily"}},headingFontWeight:{fallback:{type:"static",value:"600"}},headingColorText:{fallback:{type:"variable",value:"colorText"}},buttonColorBackground:{fallback:{type:"variable",value:"colorPrimary"}},buttonColorText:{fallback:{type:"static",value:"#FFFFFF"}},buttonFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonBorder:{fallback:{type:"static",value:"1px solid transparent"}},buttonBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonBoxShadow:{fallback:{type:"static",value:"none"}},buttonSecondaryColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryColorText:{fallback:{type:"variable",value:"colorPrimary"}},buttonSecondaryFontFamily:{fallback:{type:"variable",value:"fontFamily"}},buttonSecondaryFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},buttonSecondaryFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},buttonSecondaryFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},buttonSecondaryBorder:{fallback:{type:"func",value:e=>`1px solid ${e.colorPrimary}`}},buttonSecondaryBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},buttonSecondaryBoxShadow:{fallback:{type:"static",value:"none"}},buttonHoverColorBackground:{fallback:{type:"func",value:e=>e.buttonColorBackgroundProvided?So(e.buttonColorBackground,20):So(e.colorPrimary,20)}},buttonHoverColorText:{fallback:{type:"variable",value:"buttonColorText"}},buttonHoverFontFamily:{fallback:{type:"variable",value:"buttonFontFamily"}},buttonHoverFontSize:{fallback:{type:"variable",value:"buttonFontSize"}},buttonHoverFontLineHeight:{fallback:{type:"variable",value:"buttonFontLineHeight"}},buttonHoverFontWeight:{fallback:{type:"variable",value:"buttonFontWeight"}},buttonHoverBorder:{fallback:{type:"func",value:e=>{if(e.buttonBorderProvided)return e.buttonBorder;return new Ao(e.buttonBorder).updateColor(e.buttonHoverColorBackground).value}}},buttonHoverBorderRadius:{fallback:{type:"variable",value:"buttonBorderRadius"}},buttonHoverBoxShadow:{fallback:{type:"variable",value:"buttonBoxShadow"}},buttonSecondaryHoverColorBackground:{fallback:{type:"variable",value:"colorBackground"}},buttonSecondaryHoverColorText:{fallback:{type:"variable",value:"buttonSecondaryColorText"}},buttonSecondaryHoverFontFamily:{fallback:{type:"variable",value:"buttonSecondaryFontFamily"}},buttonSecondaryHoverFontSize:{fallback:{type:"variable",value:"buttonSecondaryFontSize"}},buttonSecondaryHoverFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryFontLineHeight"}},buttonSecondaryHoverFontWeight:{fallback:{type:"variable",value:"buttonSecondaryFontWeight"}},buttonSecondaryHoverBorder:{fallback:{type:"variable",value:"buttonSecondaryBorder"}},buttonSecondaryHoverBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryBorderRadius"}},buttonSecondaryHoverBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryBoxShadow"}},buttonActiveColorBackground:{fallback:{type:"variable",value:"buttonHoverColorBackground"}},buttonActiveColorText:{fallback:{type:"variable",value:"buttonHoverColorText"}},buttonActiveFontFamily:{fallback:{type:"variable",value:"buttonHoverFontFamily"}},buttonActiveFontSize:{fallback:{type:"variable",value:"buttonHoverFontSize"}},buttonActiveFontLineHeight:{fallback:{type:"variable",value:"buttonHoverFontLineHeight"}},buttonActiveFontWeight:{fallback:{type:"variable",value:"buttonHoverFontWeight"}},buttonActiveBorder:{fallback:{type:"variable",value:"buttonHoverBorder"}},buttonActiveBorderRadius:{fallback:{type:"variable",value:"buttonHoverBorderRadius"}},buttonActiveBoxShadow:{fallback:{type:"variable",value:"buttonHoverBoxShadow"}},buttonSecondaryActiveColorBackground:{fallback:{type:"variable",value:"buttonSecondaryHoverColorBackground"}},buttonSecondaryActiveColorText:{fallback:{type:"variable",value:"buttonSecondaryHoverColorText"}},buttonSecondaryActiveFontFamily:{fallback:{type:"variable",value:"buttonSecondaryHoverFontFamily"}},buttonSecondaryActiveFontSize:{fallback:{type:"variable",value:"buttonSecondaryHoverFontSize"}},buttonSecondaryActiveFontLineHeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontLineHeight"}},buttonSecondaryActiveFontWeight:{fallback:{type:"variable",value:"buttonSecondaryHoverFontWeight"}},buttonSecondaryActiveBorder:{fallback:{type:"variable",value:"buttonSecondaryHoverBorder"}},buttonSecondaryActiveBorderRadius:{fallback:{type:"variable",value:"buttonSecondaryHoverBorderRadius"}},buttonSecondaryActiveBoxShadow:{fallback:{type:"variable",value:"buttonSecondaryHoverBoxShadow"}},inputColorBackground:{fallback:{type:"static",value:"transparent"}},inputColorText:{fallback:{type:"variable",value:"colorText"}},inputFontFamily:{fallback:{type:"variable",value:"fontFamily"}},inputFontSize:{fallback:{type:"variable",value:"fontSizeBase"}},inputFontLineHeight:{fallback:{type:"variable",value:"fontLineHeightBase"}},inputFontWeight:{fallback:{type:"variable",value:"fontWeightBase"}},inputBorder:{fallback:{type:"func",value:e=>`1px solid ${So(e.colorMutedBorder,4)}`}},inputBorderRadius:{fallback:{type:"variable",value:"borderRadius"}},inputBoxShadow:{fallback:{type:"static",value:"none"}},inputHoverColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputHoverColorText:{fallback:{type:"variable",value:"inputColorText"}},inputHoverFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputHoverFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputHoverFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputHoverFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputHoverBorder:{fallback:{type:"variable",value:"inputBorder"}},inputHoverBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputHoverBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputFocusColorBackground:{fallback:{type:"variable",value:"inputHoverColorBackground"}},inputFocusColorText:{fallback:{type:"variable",value:"inputHoverColorText"}},inputFocusFontFamily:{fallback:{type:"variable",value:"inputHoverFontFamily"}},inputFocusFontSize:{fallback:{type:"variable",value:"inputHoverFontSize"}},inputFocusFontLineHeight:{fallback:{type:"variable",value:"inputHoverFontLineHeight"}},inputFocusFontWeight:{fallback:{type:"variable",value:"inputHoverFontWeight"}},inputFocusBorder:{fallback:{type:"func",value:e=>{if(e.inputHoverBorderProvided)return e.inputHoverBorder;return new Ao(e.inputBorder).updateColor(e.colorPrimary).value}}},inputFocusBorderRadius:{fallback:{type:"variable",value:"inputHoverBorderRadius"}},inputFocusBoxShadow:{fallback:{type:"func",value:e=>`0 0 0 1px ${e.colorPrimary}`}},inputPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputColorTextProvided?ko(e.inputColorText):e.colorMutedText}},inputPlaceholderFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputPlaceholderFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputPlaceholderFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputSelectionColorText:{fallback:{type:"static",value:"initial"}},inputSelectionColorBackground:{fallback:{type:"static",value:"highlight"}},inputErrorColorBackground:{fallback:{type:"variable",value:"inputColorBackground"}},inputErrorColorText:{fallback:{type:"variable",value:"colorDanger"}},inputErrorFontFamily:{fallback:{type:"variable",value:"inputFontFamily"}},inputErrorFontSize:{fallback:{type:"variable",value:"inputFontSize"}},inputErrorFontLineHeight:{fallback:{type:"variable",value:"inputFontLineHeight"}},inputErrorFontWeight:{fallback:{type:"variable",value:"inputFontWeight"}},inputErrorBorder:{fallback:{type:"func",value:e=>{if(e.inputBorderProvided){return new Ao(e.inputBorder).updateColor(e.colorDanger).value}return`1px solid ${e.colorDanger}`}}},inputErrorBorderRadius:{fallback:{type:"variable",value:"inputBorderRadius"}},inputErrorBoxShadow:{fallback:{type:"variable",value:"inputBoxShadow"}},inputErrorHoverColorBackground:{fallback:{type:"variable",value:"inputErrorColorBackground"}},inputErrorHoverColorText:{fallback:{type:"variable",value:"inputErrorColorText"}},inputErrorHoverFontFamily:{fallback:{type:"variable",value:"inputErrorFontFamily"}},inputErrorHoverFontSize:{fallback:{type:"variable",value:"inputErrorFontSize"}},inputErrorHoverFontLineHeight:{fallback:{type:"variable",value:"inputErrorFontLineHeight"}},inputErrorHoverFontWeight:{fallback:{type:"variable",value:"inputErrorFontWeight"}},inputErrorHoverBorder:{fallback:{type:"variable",value:"inputErrorBorder"}},inputErrorHoverBorderRadius:{fallback:{type:"variable",value:"inputErrorBorderRadius"}},inputErrorHoverBoxShadow:{fallback:{type:"variable",value:"inputErrorBoxShadow"}},inputErrorFocusColorBackground:{fallback:{type:"variable",value:"inputErrorHoverColorBackground"}},inputErrorFocusColorText:{fallback:{type:"variable",value:"inputErrorHoverColorText"}},inputErrorFocusFontFamily:{fallback:{type:"variable",value:"inputErrorHoverFontFamily"}},inputErrorFocusFontSize:{fallback:{type:"variable",value:"inputErrorHoverFontSize"}},inputErrorFocusFontLineHeight:{fallback:{type:"variable",value:"inputErrorHoverFontLineHeight"}},inputErrorFocusFontWeight:{fallback:{type:"variable",value:"inputErrorHoverFontWeight"}},inputErrorFocusBorder:{fallback:{type:"variable",value:"inputErrorHoverBorder"}},inputErrorFocusBorderRadius:{fallback:{type:"variable",value:"inputErrorHoverBorderRadius"}},inputErrorFocusBoxShadow:{fallback:{type:"variable",value:"inputErrorHoverBoxShadow"}},inputErrorPlaceholderColorText:{fallback:{type:"func",value:e=>e.inputErrorColorTextProvided?ko(e.inputErrorColorText):ko(e.colorDanger)}},inputErrorPlaceholderFontFamily:{fallback:{type:"variable",value:"inputPlaceholderFontFamily"}},inputErrorPlaceholderFontSize:{fallback:{type:"variable",value:"inputPlaceholderFontSize"}},inputErrorPlaceholderFontLineHeight:{fallback:{type:"variable",value:"inputPlaceholderFontLineHeight"}},inputErrorPlaceholderFontWeight:{fallback:{type:"variable",value:"inputPlaceholderFontWeight"}},inputErrorSelectionColorText:{fallback:{type:"variable",value:"inputSelectionColorText"}},inputErrorSelectionColorBackground:{fallback:{type:"variable",value:"inputSelectionColorBackground"}},labels:{fallback:{type:"static",value:"floating"}}};var $o=new Proxy(Eo,{get(e,t,n){if(t in e){if(e[t].value)return e[t].value;const{type:r,value:a}=e[t].fallback;if("static"===r)return a;if("variable"===r)return`var(--rebilly-${a})`;if("func"===r)return a(n)}if(t.endsWith("Provided")){const n=t.replace("Provided","");if(n in e)return e[n].isProvided}},set:(e,t,n)=>{if(!(t in e)||!n)throw new Error(`Invalid theme option provided: ${t}`);return e[t].value=n,e[t].isProvided=!0,!0}});class To{constructor(e={}){this.overrides=e,this.theme=$o}static nonCssProperties=["labels"];overrideTheme(){Object.keys(this.overrides).forEach((e=>{this.theme[e]=this.overrides[e]}))}get cssVars(){return Object.keys(this.theme).filter((e=>!To.nonCssProperties.includes(e))).map(((e,t)=>`${t?" ":""}--rebilly-${e}: ${this.theme[e]};`)).join("\n")}build(){return this.overrideTheme(),{cssVars:this.cssVars}}}function Co(e){let t=e;return t=t.replace(/\/\*(?:(?!\*\/)[\s\S])*\*\/|[\r\n\t]+/g,""),t=t.replace(/\s{2,}/g," "),t=t.replace(/\s([{:}])\s/g,"$1"),t=t.replace(/([;,])\s/g,"$1"),t=t.replace(/\s!/g,"!"),t}var Io=({options:{theme:e={},css:t}}={})=>{const n=(e=>{const t=`\n ${(e=>`\n/* Instruments 'global' variables\n------------------------------------------------------------ */\n:root {\n ${e.cssVars}\n\n --rebilly-fontWeight400: 400;\n --rebilly-fontWeight500: 500;\n --rebilly-fontWeight600: 600;\n --rebilly-fontScaleFactor: 1.5;\n --rebilly-fontScaleFactorS: 0.875;\n --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));\n --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);\n\n --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));\n --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-fontMarginTopL: 0;\n --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);\n\n --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);\n --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);\n --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);\n --rebilly-spacingM: var(--rebilly-fontLineHeightBase);\n --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);\n --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);\n\n --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);\n\n --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);\n --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));\n}\n\n/* Views. Method Selector\n------------------------------------------------------------ */\n.rebilly-instruments-method-selector.has-express-compact {\n padding-top: var(--rebilly-spacingS);\n}\n\n/* Express Methods\n------------------------------------------------------------ */\n@-webkit-keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n@keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n}\n\n.rebilly-instruments-express-methods { padding: 2px; }\n\n.rebilly-instruments-express-methods.is-compact {\n border: 1px solid var(--rebilly-colorMutedBorder);\n padding: var(--rebilly-spacingS);\n padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));\n padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));\n border-radius: var(--rebilly-borderRadius);\n position: relative;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-iframe {\n display: block;\n margin-bottom: 0;\n height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {\n border-radius: 6px;\n margin-bottom: var(--rebilly-spacingS);\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n height: 44px;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n -webkit-box-flex: 1;\n -ms-flex: 1 1 0px;\n flex: 1 1 0px;\n max-width: 260px;\n margin: 0 var(--rebilly-spacingXs);\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {\n margin-left: 0;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin-right: 0;\n}\n\n.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {\n display: none;\n}\n\n.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {\n position: absolute;\n font-family: var(--rebilly-fontFamily);\n top: 0; left: 50%;\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n color: var(--rebilly-colorText);\n padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);\n line-height: 1;\n background: var(--rebilly-colorBackground);\n display: inline-block;\n font-weight: var(--rebilly-fontWeightBase);\n min-height: auto;\n margin: 0;\n white-space: nowrap;\n}\n\n@media (max-width: 600px) {\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n }\n\n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {\n max-width: 100%;\n margin: 0 0 var(--rebilly-spacingS);\n }\n \n .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {\n margin: 0;\n }\n}\n\n/* Components. Divider\n------------------------------------------------------------ */\n.rebilly-instruments-divider {\n line-height: var(--rebilly-fontLineHeightBase);\n padding: var(--rebilly-spacingM) 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n font-family: var(--rebilly-fontFamily);\n}\n\n.rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }\n.rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }\n\n.rebilly-instruments-divider::before {\n background: var(--rebilly-colorMutedBorder);\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n}\n\n.rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: var(--rebilly-colorMutedText);\n font-weight: var(--rebilly-fontWeightBase);\n padding: 0 var(--rebilly-spacingM);\n line-height: var(--rebilly-fontLineHeightS);\n background-color: var(--rebilly-colorBackground);\n font-size: var(--rebilly-fontSizeS);\n position: relative;\n display: inline-block;\n}\n\n/* Vendor, Postmate\n------------------------------------------------------------ */\n.rebilly-instruments-iframe {\n border: none;\n width: 100%;\n height: 0;\n padding: 0;\n}\n\n.rebilly-instruments-iframe-overlay {\n top: -2px;\n left: -2px;\n width: calc(100vw + 2px);\n height: 100vh;\n min-height: calc(100vh + 4px);\n position: fixed;\n z-index: 99999999999999;\n}\n\n/* Views. Modal\n------------------------------------------------------------ */\n.rebilly-instruments-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n overflow-x: hidden;\n overflow-y: auto;\n z-index: 1055;\n padding: 30px;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: 0;\n -webkit-transition: all 0.12s ease-in-out;\n transition: all 0.12s ease-in-out;\n background-color: rgba(0,0,0,0.7);\n opacity: 0\n}\n\n.rebilly-instruments-modal-overlay.is-visible {\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container {\n -webkit-transition: all .24s ease-in-out;\n transition: all .24s ease-in-out;\n position: relative;\n max-width: 750px;\n background: var(--rebilly-colorBackground);\n margin: 50px auto 20px;\n -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);\n border-radius: 4px;\n -webkit-transform: translateY(-50px);\n transform: translateY(-50px);\n opacity: 0;\n}\n\n.rebilly-instruments-modal-container.is-visible {\n -webkit-transform: translateY(0);\n transform: translateY(0);\n opacity: 1;\n}\n\n.rebilly-instruments-modal-container.is-redirect {\n max-width: 60vw;\n width: auto;\n}\n\n.rebilly-instruments-modal-content {\n -webkit-transition: all .15s;\n transition: all .15s;\n padding: 20px;\n overflow: hidden;\n background-color: var(--rebilly-colorBackground);\n text-align: center;\n border-radius: 4px;\n}\n\n.rebilly-instruments-modal-content .rebilly-instruments-iframe {\n -webkit-transition: all .15s;\n transition: all .15s;\n height: auto;\n min-height: 360px;\n}\n\n.rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {\n padding: 0;\n}\n\n.rebilly-instruments-modal-close {\n position: absolute;\n width: 30px;\n height: 30px;\n top: -40px;\n right: 0;\n fill: #FFF;\n cursor: pointer;\n}\n\n.rebilly-instruments-modal-close:hover{\n color: #000;\n}\n\n@media screen and (max-width: 480px) {\n .rebilly-instruments-modal-container.is-redirect {\n max-width: 96vw;\n margin: 20px auto 20px;\n }\n}\n\n/* Components. Loader\n------------------------------------------------------------ */\n.rebilly-instruments-loader {\n text-align: left;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background-color: var(--rebilly-colorBackground);\n z-index: 1000;\n -webkit-transition: all 200ms;\n transition: all 200ms;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader.is-active {\n display: block;\n}\n\n/* Type */\n.rebilly-instruments-loader p {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n\n.rebilly-instruments-loader small {\n color: var(--rebilly-colorText);\n display: inline-block;\n margin: 0;\n font-size: var(--rebilly-fontSizeS);\n line-height: 1;\n}\n\n/* Summary */\n.rebilly-instruments-summary-loader-total p.total {\n font-family: var(--rebilly-fontFamily);\n font-size: var(--rebilly-fontSizeL);\n font-weight: var(--rebilly-headingFontWeight);\n}\n\n/* Methods */\n.rebilly-instruments-methods-loader-card-icon {\n width: 32px;\n height: 22px;\n margin-left: var(--rebilly-spacing2xs);\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }\n\n/* Spinner */\n.rebilly-instruments-loader-spinner {\n top: 50%;\n left: 50%;\n position: absolute;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid transparent;\n border-top: 2px solid var(--rebilly-colorPrimary);\n border-radius: 50%;\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);\n -webkit-animation: spin 0.5s ease infinite;\n animation: spin 0.5s ease infinite;\n}\n\n@-webkit-keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n@keyframes spin {\n 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }\n 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }\n}\n\n/* Utils */\n.rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }\n.rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }\n.rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }\n.rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }\n\n.is-el-loading {\n position: relative;\n color: transparent!important;\n}\n\n.is-el-loading::before {\n position: absolute;\n content: '';\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);\n background-size: 200% 100%;\n -webkit-animation: 1.5s rebillyExpressShine linear infinite;\n animation: 1.5s rebillyExpressShine linear infinite;\n border-radius: var(--rebilly-borderRadius);\n}\n\n.rebilly-instruments-loader-form-el {\n width: 100%;\n min-height: var(--rebilly-spacingFormElementMinHeight);\n}\n\n.rebilly-instruments-loader-form-label {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n margin-bottom: var(--rebilly-spacing2xs);\n}\n\n.rebilly-instruments-loader-form-el.is-button {\n margin-top: var(--rebilly-spacingL);\n text-align: center;\n font-size: var(--rebilly-buttonFontSize);\n font-family: var(--rebilly-buttonFontFamily);\n line-height: var(--rebilly-buttonFontLineHeight);\n padding: var(--rebilly-spacingS);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n background: var(--rebilly-buttonColorBackground);\n color: transparent;\n border-radius: var(--rebilly-buttonBorderRadius);\n font-weight: var(--rebilly-buttonFontWeight);\n border: var(--rebilly-buttonBorder);\n -webkit-box-shadow: var(--rebilly-buttonBoxShadow);\n box-shadow: var(--rebilly-buttonBoxShadow);\n outline: none;\n cursor: not-allowed;\n opacity: 0.6; \n}\n\n.rebilly-instruments-methods-loader-card-icon.is-el-loading::before {\n border-radius: calc(var(--rebilly-borderRadius) / 2);\n}\n\n/* Error\n------------------------------------------------------------ */\n.rebilly-instruments-error-card {\n border: 1px solid var(--rebilly-colorDanger);\n border-radius: var(--rebilly-borderRadius);\n text-align: left;\n padding: var(--rebilly-spacingS);\n margin-bottom: var(--rebilly-spacingL);\n}\n\n.rebilly-instruments-error-card-header {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-pack: justify;\n -ms-flex-pack: justify;\n justify-content: space-between;\n width: 100%;\n -webkit-box-align: start;\n -ms-flex-align: start;\n align-items: flex-start;\n}\n\n.rebilly-instruments-error-card-title {\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n font-family: var(--rebilly-headingFontFamily);\n margin: 0 0 var(--rebilly-spacingS);\n color: var(--rebilly-colorDanger);\n}\n\n.rebilly-instruments-error-card-close-button {\n cursor: pointer;\n background: transparent;\n border: none;\n padding: 0;\n}\n\n.rebilly-instruments-error-card-close-button svg {\n width: var(--rebilly-fontLineHeightBase);\n height: var(--rebilly-fontLineHeightBase);\n fill: var(--rebilly-colorText);\n}\n\n.rebilly-instruments-error-card-details {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n.rebilly-instruments-error-card-details li,\n.rebilly-instruments-error-card-message {\n color: var(--rebilly-colorText);\n margin: 0;\n font-weight: var(--rebilly-fontWeightBase);\n font-size: var(--rebilly-fontSizeBase);\n line-height: var(--rebilly-fontLineHeightBase);\n}\n`)(new To(e).build())}\n `;return t})(e||{});return so({element:"style",attributes:{type:"text/css"},content:Co(n),target:"head"}),t&&so({element:"style",attributes:{type:"text/css"},content:Co(t),target:"head"}),n};const Ho=({state:e})=>{e.translate.init(e.options.locale,e.options.i18n),e.translate.translateItems()};function Fo(e){const t={};return function(e){const t={};function n(e){const r=e.match(/var\((.+?)\)/g);if(r){let a=e;return r.forEach((n=>{const r=n.match(/\((.*)\)/i)[1];a=e.replace(n,t[r])})),n(a)}return e}return[...e.matchAll(/(--rebilly.*(?=:))[:\s](.*(?=;))/g)].forEach((e=>{t[e[1]]=e[2].trim()})),Object.entries(t).map((([e,t])=>[e,n(t)]))}(e).forEach((([e,n])=>{t[e]=n})),t}const jo=(e,t="")=>({color:e[`--rebilly-${t}ColorText`],fontFamily:e[`--rebilly-${t}FontFamily`],fontSize:e[`--rebilly-${t}FontSize`],fontWeight:e[`--rebilly-${t}FontWeight`],lineHeight:e[`--rebilly-${t}FontLineHeight`],background:e[`--rebilly-${t}ColorBackground`],boxShadow:e[`--rebilly-${t}BoxShadow`]});function Po({eventName:e,callback:t}){if(!We.includes(e))throw new Error(`${e} is not a supported event`);const n=le(e);Ue[n].addEventListener(t)}async function Lo({componentName:e,payload:t,state:n}){switch(e){case"result":n.iframeComponents.form&&(n.iframeComponents.form.destroy(),n.iframeComponents.form=null),async function({payload:e,state:t}){var n,r;n=t.form,r='<div class="rebilly-instruments-result"></div>',n.querySelector(".rebilly-instruments-content").innerHTML=r,t.loader.startLoading({id:"rebilly-instruments-result"}),t.loader.stopLoading({id:"express-purchase"});const a=document.querySelector(".rebilly-instruments-result"),{paymentMethodsUrl:i}=t.options._computed,o={options:t.options,mainStyleVars:t.mainStyleVars,[t.options.transactionType]:e},s=await new Ye({name:"rebilly-instruments-result",url:`${i}/result`,container:a,model:o});s.bindEventListeners({loader:t.loader}),t.iframeComponents.form=s}({payload:t,state:n});break;case"confirmation":!async function({payload:e,state:t}){var n,r;e.billingAddress&&t.summary&&t.data.isPurchase&&ha({state:t,instrument:e});const a=t.iframeComponents.form,i={options:t.options,data:t.data.toPostmatesModel(),mainStyleVars:t.mainStyleVars,instrument:e};null==a||null===(n=a.component)||void 0===n||n.call("route",{name:"confirmation"}),null==a||null===(r=a.component)||void 0===r||r.call("update",i),document.querySelectorAll('[data-rebilly-instruments="express-method"]').forEach((e=>{e.style.overflow="hidden",e.style.height="0px"}))}({payload:t,state:n});break;default:throw new Error(`'${e}' not a supported component`)}}var Ro=({state:e={}})=>{e.options.features.autoConfirmation&&Po({eventName:"instrument-ready",callback:t=>{var n;if("paypal"===(null===(n=t._raw)||void 0===n?void 0:n.method)&&!e.data.isShippingRequired)return"setup"===e.options.transactionType?to({state:e,payload:t}):eo({state:e,payload:t}),void e.loader.startLoading({state:e,id:"express-purchase",message:"form.loaderMessages.processingPayment"});Lo({componentName:"confirmation",payload:t,state:e})}}),e.options.features.autoResult&&Po({eventName:"setup"===e.options.transactionType?"setup-completed":"purchase-completed",callback:t=>{!function({state:e,payload:t}){Lo({componentName:"result",payload:t,state:e})}({state:e,payload:t})}})};async function Mo({state:e,setupFramepay:t=yo,...n}={}){try{var r,a,i;e.data={},e.options={},e.form=lo({element:"form",options:n}),e.summary=lo({element:"summary",options:n}),e.form.style.maxWidth="750px",e.summary&&(e.summary.style.maxWidth="750px"),e.options=go({options:n}),e.storefront=uo({options:n}),e.mainStyleVars=Io({options:n}),e.options.themeFramepay=(({state:e,options:t={}})=>{const n=Fo(`\n ${e.mainStyleVars}\n ${t.css||""}\n `);return{base:{...jo(n,"input"),":hover":jo(n,"inputHover"),":focus":jo(n,"inputFocus"),"::placeholder":jo(n,"inputPlaceholder"),"::selection":jo(n,"inputSelection")},invalid:{...jo(n,"inputError"),":hover":jo(n,"inputErrorHover"),":focus":jo(n,"inputErrorFocus"),"::placeholder":jo(n,"inputErrorPlaceholder"),"::selection":jo(n,"inputErrorSelection")},buttons:{base:{...jo(n,"buttonSecondary"),":hover":jo(n,"buttonSecondaryHover"),":focus":jo(n,"buttonSecondaryActive")},active:{...jo(n,"button"),":hover":jo(n,"buttonHover"),":focus":jo(n,"buttonActive")}}}})({state:e,options:n}),e.loader.addDOMElement({el:e.form}),e.loader.addDOMElement({section:"summary",el:e.summary}),e.loader.startLoading({state:e,section:"summary",id:"rebilly-instruments-summary"}),e.loader.startLoading({state:e,id:"rebilly-instruments-form"}),e.data=await Xi({state:e}),Ue.dataReady.dispatch(e.data),e.i18n=(({state:e={}})=>{var t,n;if("auto"===e.options.locale&&null!==(t=e.data.riskMetadata)&&void 0!==t&&null!==(n=t.browserData)&&void 0!==n&&n.language){const{browserData:{language:t}}=e.data.riskMetadata;e.options.locale=t}return e.translate.init(e.options.locale,e.options.i18n),Ho})({state:e}),await t(e),!e.options.websiteId&&null!==(r=e.data.transaction)&&void 0!==r&&r.websiteId?e.options.websiteId=e.data.transaction.websiteId:!e.options.websiteId&&null!==(a=e.data.invoice)&&void 0!==a&&a.websiteId&&(e.options.websiteId=e.data.invoice.websiteId),e.data.transaction&&"setup"===(null===(i=e.data.transaction)||void 0===i?void 0:i.type)&&(e.options.transactionType="setup"),e.form&&oo({state:e}),e.summary&&async function({state:e}){const t={options:e.options,data:e.data.toPostmatesModel(),mainStyleVars:e.mainStyleVars},{paymentMethodsUrl:n}=e.options._computed,r=await new Ye({name:"rebilly-instruments-summary",url:`${n}/summary`,container:e.summary,model:t});r.bindEventListeners({loader:e.loader}),e.iframeComponents.summary=r}({state:e}),e.i18n({state:e}),e.hasMounted=!0}catch(e){throw Ge(e),e}Ro({state:e})}async function Oo({state:e}){var t;await(t=1e3,new Promise((e=>setTimeout(e,t)))),Object.values(e.iframeComponents).forEach((e=>null==e?void 0:e.destroy())),De.removeAll(document),e.iframeComponents={summary:null,form:null},e.hasMounted=!1,e.summary&&(e.summary.textContent=""),e.form.textContent="",Zr(),e.loader.clearAll()}function qo({newOptions:e}){let t={};return t=Object.keys(e).some((e=>["items","money","invoiceId","transactionId"].includes(e)))?{items:null,money:null,invoiceId:null,transactionId:null}:t,t}var Bo={en:{summary:{subTotal:"Sub Total",discounts:"Discounts",taxes:"Taxes",shipping:"Shipping",total:"Total"},form:{expressCheckout:"Express checkout",or:"Or",popupOverlayText:"Click here to show popup window",andMore:"and more",error:{noPaymentMethods:"No payment methods available for this transaction, please contact support."},loaderMessages:{processingPayment:"Processing payment instrument."}},paymentMethods:{"payment-card":"Payment card",ach:"Bank account"}}},_o={es:{summary:{subTotal:"Sub Total",discounts:"Descuentos",taxes:"Impuestos",shipping:"Envío",total:"Total"},form:{expressCheckout:"Chequeo rápido",or:"O pague con",andMore:"y más",popupOverlayText:"Haga clic aquí para mostrar la ventana emergente",error:{noPaymentMethods:"No hay métodos de pago disponibles para esta transacción, por favor, póngase en contacto con el servicio de asistencia."}},paymentMethods:{"payment-card":"Tarjeta de crédito",ach:"Cuenta bancaria"}}};class zo{constructor(){this.locale="",this.items=[],this.languages={}}init(e,t){this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale=this.getLocale(e),this.languages=ro({},{...Bo,..._o},t)}translateItems(){return this.items=document.querySelectorAll("[data-rebilly-i18n]"),this.locale in this.languages&&this.items.forEach((e=>{const t=this.getTranslation(this.languages[this.locale],e.dataset.rebillyI18n);t&&(e.innerHTML=t)}))}updateTranslationsToNewLocale(e){this.locale=e,this.translateItems()}getLocale(e=this.locale){return!e.includes("-")||e in this.languages?e:(e=e.replace(/[-._]\w+$/gi,""),this.getLocale(e))}translateItem(e){const t=this.getLocale();return this.getTranslation(this.languages[t],e.dataset.rebillyI18n)}getTranslation(e=this.locale,t){return t.split(".").reduce(((e,t)=>null==e?void 0:e[t]),e)}}class Do{constructor(){this.options=null,this.data={},this.mountingPoints=null,this.storefront=null,this.form=null,this.summary=null,this.loader=new h,this.translate=new zo,this.iframeComponents={summary:null,form:null},this.hasMounted=!1}}var No=new class{constructor(){this.state=new Do}async mount(e){await Mo({state:this.state,...e})}async destroy(){await Oo({state:this.state})}async update(e){await async function({state:e,newOptions:t={}}){if(!e.hasMounted)throw Error("Update method cannot be called before mounting instruments");const n={...e.options,...qo({newOptions:t})},r=ro({...n},t);await Oo({state:e}),Mo({state:e,form:e.form,summary:e.summary,...r})}({state:this.state,newOptions:e})}async purchase(e){await eo({state:this.state,payload:e})}async setup(e){await to({state:this.state,payload:e})}async show(e,t){await Lo({state:this.state,componentName:e,payload:t})}get version(){return"RebillyInstruments Ver.3.15.1-beta.0"}on(e,t){Po({state:this.state,eventName:e,callback:t})}};export{No as default};
|