@tinkerlandai/longplay-sdk 0.10.42 → 0.10.43

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/{chunk-2EVGXJ4R.js → chunk-22LQSRYH.js} +1 -1
  3. package/dist/{chunk-AC53CUJE.js → chunk-2PVQUPBN.js} +1 -1
  4. package/dist/chunk-3XMBILUJ.js +1 -0
  5. package/dist/{chunk-67SIVUOS.js → chunk-7X65GNKZ.js} +1 -1
  6. package/dist/chunk-DPVYEOD6.js +1 -0
  7. package/dist/{chunk-KEF6HIFK.js → chunk-FMSHIKMI.js} +1 -1
  8. package/dist/chunk-IT5DIE6G.js +1 -0
  9. package/dist/{chunk-LUGZNBIW.js → chunk-PG5UESZB.js} +1 -1
  10. package/dist/{chunk-QHWR5UHD.js → chunk-Q23JDNYJ.js} +1 -1
  11. package/dist/{chunk-SVLEVNHP.js → chunk-RMRZSF5C.js} +1 -1
  12. package/dist/chunk-SSRQGIGB.js +1 -0
  13. package/dist/{chunk-ZICZN6WO.js → chunk-T43HTIQX.js} +1 -1
  14. package/dist/{chunk-O6CUNETH.js → chunk-X4UTTXOU.js} +1 -1
  15. package/dist/{chunk-ABXCDVC7.js → chunk-XZEZFWFD.js} +1 -1
  16. package/dist/chunk-YVAQLTHJ.js +1 -0
  17. package/dist/{content-KSIF5AXD.js → content-FZOT5NDI.js} +1 -1
  18. package/dist/funnel-host-purchase-6GV67OIA.js +1 -0
  19. package/dist/{funnel-paywall-prerender-DAAQUEEZ.js → funnel-paywall-prerender-OA3QN2VI.js} +1 -1
  20. package/dist/funnel-runtime-host-NU36AKUF.js +1 -0
  21. package/dist/index.js +1 -1
  22. package/dist/native-shell.js +1 -1
  23. package/dist/openrouter.js +1 -1
  24. package/dist/page.js +1 -1
  25. package/dist/{paywall-PZ4BBEFG.js → paywall-GLXO4HN7.js} +1 -1
  26. package/dist/{paywall-content-5IWLT7YD.js → paywall-content-IF2LKXDF.js} +1 -1
  27. package/dist/{paywall-session-K7GPR3UF.js → paywall-session-YDG3FDOP.js} +1 -1
  28. package/dist/react-native.js +1 -1
  29. package/dist/server.js +1 -1
  30. package/dist/visual.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/chunk-3WTVQ6OV.js +0 -1
  33. package/dist/chunk-ANXDWUPK.js +0 -1
  34. package/dist/chunk-JWTA2OCB.js +0 -1
  35. package/dist/chunk-OXXPMJRJ.js +0 -1
  36. package/dist/funnel-host-purchase-YNC4LQJS.js +0 -1
  37. package/dist/funnel-runtime-host-WPU42YVT.js +0 -1
@@ -1 +0,0 @@
1
- import{b as nn}from"./chunk-67SIVUOS.js";import{d as We,e as ce}from"./chunk-PBZSOTKZ.js";import{c as qe,d as je,e as K,l as Ze}from"./chunk-HLCDAU5A.js";import{A as Je,F as He,G as Qe,H as z,I as Ye,J as le,K as G,a as Me,c as Y,g as Z,h as Ge,i as Ue,m as $e}from"./chunk-DCZWNTG2.js";import{a as de,b as Xe}from"./chunk-CALDEF4M.js";import{a as j,b as _e,c as ke,e as De,h as Ve,i as Le,l as Be}from"./chunk-ASL7TJFU.js";import{b as tn}from"./chunk-B4AELNLE.js";import{A as ie,B as ae,z as oe}from"./chunk-KP4QI4RX.js";import{b as W}from"./chunk-LUGZNBIW.js";import{a as Q}from"./chunk-LSVTH3TS.js";import{m as Ke,n as ue,o as ze,p as se}from"./chunk-7MYS52FL.js";import{g as Ee,m as Ce,w as re}from"./chunk-MWICFZUF.js";import{b as Pe,d as L,e as Ae,f as Te}from"./chunk-3SXPCVIP.js";import{a as f}from"./chunk-TL67SYPH.js";import{h as V}from"./chunk-6XRXHFM6.js";import{b as en}from"./chunk-ZICZN6WO.js";import{b as n}from"./chunk-GPJF3T43.js";import{c as Ne,f as Oe}from"./chunk-C4NG6RVA.js";function rn(e){return Sn({...e,namespace:"commands",identity:[e.runToken]})}function Sn(e){let t,u,r=()=>new f("COMMAND_STORAGE_INVALID","Durable command storage is unavailable"),o=Promise.resolve().then(async()=>{if(t=e.storage??globalThis.localStorage,u=e.locks??globalThis.navigator?.locks,!t||!u||!globalThis.crypto?.subtle)throw r();let c=new TextEncoder().encode(JSON.stringify([new URL(e.baseUrl??en).href,...e.identity])),a=new Uint8Array(await crypto.subtle.digest("SHA-256",c));return`indiana.funnel.${e.namespace}.v1.`+Array.from(a,i=>i.toString(16).padStart(2,"0")).join("")});o.catch(()=>{});async function m(c){try{let a=await o;return await u.request(a,{mode:"exclusive"},()=>c(a))}catch(a){throw a instanceof f?a:r()}}function d(c){let a=t.getItem(c);if(a===null)return{revision:0,entry:null};if(a.length>1048576)throw r();let i=JSON.parse(a);if(!i||typeof i!="object"||!("revision"in i)||!("entry"in i)||!Number.isSafeInteger(i.revision)||Number(i.revision)<0)throw r();return{revision:Number(i.revision),entry:i.entry}}return{read:()=>m(d),write:(c,a)=>m(i=>{if(d(i).revision!==c)return null;if(!Number.isSafeInteger(c+1))throw r();let y=JSON.stringify({revision:c+1,entry:a});if(y.length>1048576)throw r();return t.setItem(i,y),c+1})}}var on=n.strictObject({type:n.literal("funnel"),id:n.uuid(),versionId:n.uuid()});var M=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),Rn=n.enum(["running","waiting","completed","closed","ineligible","failed"]),Fn=n.discriminatedUnion("type",[$e,n.strictObject({type:n.literal("wait"),receiptId:n.uuid(),kind:n.enum(["timer","event","operation"]),deadline:n.iso.datetime({offset:!0}).nullable(),eventName:M.optional()}),n.strictObject({type:n.literal("open_url"),receiptId:n.uuid(),url:He,openIn:Qe}),n.strictObject({type:n.literal("event"),receiptId:n.uuid(),event:M})]),En={id:M,presentation:Pe,outputs:n.array(M).max(250),inputs:se,values:n.record(n.string(),L).optional(),offeringKey:j.optional(),capabilities:Ee,customerData:Ce,dataCursors:n.record(M,Ke.nullable())},Cn=n.strictObject({...En,content:n.strictObject({type:n.literal("document"),document:re})}),pe=n.strictObject({id:n.uuid(),source:on,revision:n.number().int().nonnegative(),visit:n.number().int().nonnegative(),nodeId:M,nodeType:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),status:Rn,stopped:n.boolean(),canBack:n.boolean(),authenticated:n.boolean(),locale:n.string().min(1).max(35),answers:ue,parameters:ze,variables:n.record(n.string(),L),output:L.nullable(),screen:Cn.nullable(),paywall:n.strictObject({receiptId:n.uuid(),resolution:n.union([We,ce]),quote:oe.nullable(),operation:ie.nullable(),purchaseRequestId:n.uuid().nullable(),selectionGeneration:n.number().int().nonnegative().optional(),canReselect:n.boolean().optional()}).nullable(),instruction:Fn.nullable(),pendingRequest:n.strictObject({requestId:n.uuid(),authenticationRequired:n.boolean()}).nullable(),runExpiresAt:n.iso.datetime({offset:!0}),credentialExpiresAt:n.iso.datetime({offset:!0}).nullable()}),Pn=n.strictObject({scope:V,run:pe,settlement:n.strictObject({requestId:n.uuid(),state:n.enum(["pending","unknown","settled"]),operationId:n.uuid().nullable(),receiptId:n.uuid().nullable().optional()}).optional(),purchase:n.strictObject({receiptId:n.uuid(),quote:oe.nullable(),operation:ie.nullable(),canReselect:n.boolean().optional()}).optional(),review:n.strictObject({activeOperationId:n.uuid().nullable(),pages:n.array(n.strictObject({receiptId:n.uuid(),nodeId:M,visit:n.number().int().nonnegative()})).max(100),page:n.strictObject({receiptId:n.uuid(),nodeId:M,visit:n.number().int().nonnegative(),document:re,answers:ue,inputs:se,values:n.record(n.string(),L).optional()}).nullable(),coupons:n.array(n.strictObject({grantId:n.uuid(),status:n.enum(["issued","reserved","redeemed","expired","revoked","unknown"]),expiresAt:n.string().nullable()})).max(100),purchases:n.array(n.strictObject({receiptId:n.uuid(),operationId:n.uuid(),status:n.enum(["pending","complete","cancelled","failed","unknown"])})).max(100)}).optional(),runToken:n.string().regex(/^gg_fr_[A-Za-z0-9_-]{43}$/).optional(),customerId:n.uuid().optional()}),an=Pn.extend({run:pe.extend({paywall:pe.shape.paywall.unwrap().extend({resolution:ce}).nullable()})});var un="X-Indiana-Server-Key";var Nn=n.strictObject({selector:n.string().min(1).max(2048),action:n.enum(["set","append","remove"]),attribute:n.string().min(1).max(128).refine(e=>["html","class","style","position","href","src","alt","title","id","role","hidden"].includes(e)||/^(aria|data)-[a-z0-9_-]+$/.test(e)),value:n.string().max(5e4).optional(),parentSelector:n.string().max(2048).optional(),insertBeforeSelector:n.string().max(2048).optional()}),On=n.strictObject({variation:n.string().min(1).max(128),description:n.string().max(2e3).default(""),css:n.string().max(1e5).default(""),js:n.string().max(1e5).default(""),domMutations:n.array(Nn).max(200).default([]),iam:Ge.optional(),renderGuard:Z.optional()}),me=On.omit({variation:!0,description:!0,iam:!0}),An=qe.omit({variations:!0,active:!0}).extend({changeId:n.string().regex(/^[a-f0-9]{64}$/),variations:n.tuple([me,me]).rest(me).refine(e=>e.length<=20)}),sn=n.strictObject({trackExposures:n.boolean(),environmentId:n.uuid(),generation:n.string().regex(/^[a-f0-9]{64}$/),experiments:n.array(An).max(100),savedGroups:je});var $=n.string().regex(/^[a-f0-9]{64}$/),Ot=n.strictObject({iam:$,executionContracts:n.union([n.tuple([n.literal("funnel-run/1")]),n.tuple([n.literal("funnel-process/1")])]).default(["funnel-run/1"])}),Tn=n.strictObject({release:$,render:Z,button:n.strictObject({selector:n.string().min(1).max(512),elementKey:n.string().min(1).max(256),tag:n.enum(["button","a","input"])}).nullable()}),At=n.strictObject({scope:V.extend({environmentId:n.uuid()}),release:$,validatedAt:n.iso.datetime({offset:!0}),validUntil:n.iso.datetime({offset:!0}),entries:n.array(n.strictObject({id:n.uuid(),funnelId:n.uuid(),versionId:n.uuid(),event:n.enum(["screen_enter","button_click"]),delivery:Ue.optional(),target:Tn})).max(4e3)}),Tt=n.strictObject({operation:n.literal("entry_start"),funnelId:n.uuid(),versionId:n.uuid(),entryId:n.uuid(),release:$,requestId:n.uuid(),locale:n.string().min(1).max(35).default("en")}),_t=n.strictObject({scope:V,suppressed:n.literal(!0),reason:n.enum(["frequency","in_progress"]),retryAt:n.iso.datetime({offset:!0}).nullable()}),kt=n.strictObject({experimentId:n.uuid(),splitNodeId:n.string().min(1).max(128)}),_n=n.strictObject({experimentId:n.uuid(),experimentKey:n.string().min(1).max(128),variationKey:n.string().min(1).max(128),inExperiment:n.boolean(),generation:n.string().min(1).max(256)}),fe=n.strictObject({operation:n.literal("page_experiments"),release:$,usedReceiptIds:n.array(n.uuid()).max(20).default([]),customerToken:n.string().regex(Q).optional()}),ln=n.strictObject({scope:V,runId:n.uuid(),assignments:n.array(_n.extend({receiptId:n.uuid()})).max(100),payload:sn});var U=n.string().regex(/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/),dn=n.strictObject({entry:U,nodes:n.array(n.strictObject({id:U,type:n.enum(["entry","screen","condition","split","feature","action","external_page","wait","end","offering","coupon","coupons","output"]),outputs:n.record(n.string(),U),writes:n.record(j,j),resources:n.strictObject({screenId:U.optional(),paywallVersionId:n.uuid().optional(),couponId:n.uuid().optional(),couponIds:n.array(n.uuid()).max(20).optional(),experimentId:n.uuid().optional(),featureKey:n.string().optional(),offeringVersionId:n.uuid().optional()})})).min(1).max(500)}),cn={scope:V,funnelId:n.uuid(),versionId:n.uuid(),evaluationRevision:n.number().int().nonnegative(),expiresAt:n.iso.datetime({offset:!0}).nullable(),topology:dn},X=n.discriminatedUnion("evaluationMode",[n.strictObject({...cn,evaluationMode:n.literal("local"),growth:K,conditions:n.record(U,n.array(n.strictObject({condition:Te,port:n.string()})))}),n.strictObject({...cn,evaluationMode:n.literal("remote")})]),kn=X.options[0].extend({evaluation:n.strictObject({maxTransitions:n.number().int().min(1).max(1e4),variables:n.record(j,ke),outputSchema:_e,terminals:n.record(U,n.strictObject({outcome:n.enum(["completed","closed","ineligible","failed"]),output:Je.nullable()}))})});function Dn(e){return dn.parse({entry:e.graph.entry,nodes:e.graph.nodes.map(t=>{let u={},r={};switch(t.type){case"entry":case"feature":case"offering":case"coupon":case"coupons":u.next=t.next;break;case"screen":Object.assign(u,t.outputs),r.screenId=t.screenId;{let m=e.screens.find(d=>d.id===t.screenId);m?.type==="paywall"&&(r.paywallVersionId=m.paywallVersionId)}break;case"condition":t.cases.forEach((m,d)=>{u[`case:${d}`]=m.target}),u.default=t.default;break;case"split":Object.assign(u,t.routes),u.notParticipating=t.notParticipating,r.experimentId=t.experimentId;break;case"action":for(let m of["success","cancel","unavailable","failure"])u[m]=t[m];t.action.type==="claim_offer"&&t.action.coupon.source==="literal"&&t.action.coupon.value&&typeof t.action.coupon.value=="object"&&!Array.isArray(t.action.coupon.value)&&(r.couponId=n.uuid().parse(t.action.coupon.value.id));break;case"external_page":u.opened=t.opened,u.failed=t.failed;break;case"wait":t.wait.type==="duration"?u.elapsed=t.wait.elapsed:(u.received=t.wait.received,u.timeout=t.wait.timeout);break;case"end":case"output":break}t.type==="feature"&&(r.featureKey=t.featureKey),t.type==="offering"&&t.configuration.source==="feature"&&(r.featureKey=t.configuration.featureKey);let o=t.type==="output"?t.value:t.type==="end"?t.output:void 0;return o?.type==="feature"&&(r.featureKey=o.featureKey),t.type==="coupon"&&(r.couponId=t.couponId),t.type==="coupons"&&(r.couponIds=t.couponIds),t.type==="offering"&&t.configuration.source==="fixed"&&(r.offeringVersionId=t.configuration.versionId),{id:t.id,type:t.type,outputs:u,resources:r,writes:"writes"in t?t.writes??{}:{}}})})}function ge(e){let t=le.parse(e.document),u=e.evaluationMode==="local"?K.parse(e.payload):null;if(u&&(u.scope.projectId!==e.scope.projectId||u.scope.environment!==e.scope.environment))throw new Error("GB payload belongs to another App or environment");let r={scope:e.scope,funnelId:e.funnelId,versionId:e.versionId,evaluationRevision:e.evaluationRevision,evaluationMode:e.evaluationMode,expiresAt:u?.expiresAt??null,topology:Dn(t)};return X.parse(e.evaluationMode==="remote"?r:{...r,growth:Ze(t,u),conditions:Object.fromEntries(t.graph.nodes.filter(o=>o.type==="condition").map(o=>[o.id,o.cases.map((m,d)=>({condition:m.condition,port:`case:${d}`}))]))})}function Kt(e){let t=ge(e);if(t.evaluationMode!=="local")throw new Error("Remote Funnel cannot disclose local rules");let u=le.parse(e.document);return kn.parse({...t,evaluation:{maxTransitions:u.execution.maxTransitions,variables:u.variables,outputSchema:u.outputSchema,terminals:Object.fromEntries(u.graph.nodes.flatMap(r=>{let o=r.type==="end"?r.output:r.type==="output"?r.value:void 0;return r.type!=="end"&&r.type!=="output"?[]:o&&o.type!=="literal"&&o.type!=="feature"&&o.type!=="variable"?[]:[[r.id,{outcome:r.type==="end"?r.outcome:"completed",output:o??null}]]}))}})}var Ie=32,Vn=522240;function ve(e){if(["entry","condition","feature","split","offering","coupon","coupons"].includes(e.type))return!0;if(e.type!=="end"&&e.type!=="output")return!1;let t=e.type==="end"?e.output:e.value;return t?.type!=="bundle"&&t?.type!=="selection"}var Ln=n.strictObject({nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),revision:n.number().int().nonnegative()}),ye=n.record(n.string(),L),Mn=n.strictObject({id:n.uuid(),nodeId:n.string().min(1).max(64),visit:n.number().int().nonnegative(),input:n.strictObject({schemaVersion:z.shape.schemaVersion,kind:z.shape.kind,selector:z.shape.selector,contract:z.shape.contract}),context:ye,removed:n.array(n.string()).max(100),attributes:ye,removedAttributes:n.array(n.string()).max(100),result:Ye,offeringVersionId:n.uuid().nullable(),events:n.strictObject({entered:n.string().regex(/^[1-9][0-9]{0,18}$/),decision:n.string().regex(/^[1-9][0-9]{0,18}$/).nullable()})}),Yt=n.strictObject({schemaVersion:n.literal(1),mode:n.enum(["local","remote"]),versionId:n.uuid(),generation:n.number().int().positive(),base:Ln,context:ye,steps:n.array(Mn).min(1).max(Ie)}).refine(e=>Y(e)<=Vn,"Segment exceeds its byte budget");var qn=/^(parameters(?:\.|$)|answers(?:\.|$)|results(?:\.|$)|variables(?:\.|$)|funnelParticipantId$)/;function J(e){return Array.isArray(e)?e.some(J):!e||typeof e!="object"?!1:Object.entries(e).some(([t,u])=>t.startsWith("$")?["$and","$or","$nor","$not"].includes(t)&&J(u):!qn.test(t))}function pn(e,t,u,r){if(e.executionContract!=="funnel-process/1"||r)return null;if(["offering","coupon","coupons"].includes(t.type)||t.type==="action"&&t.action.type!=="event"||t.type==="screen"&&(t.offering||e.screens.some(c=>c.id===t.screenId&&c.type==="paywall")))return"customer_required";let o=t.type==="end"?t.output:t.type==="output"?t.value:void 0;if(o&&["bundle","selection","offering"].includes(o.type)||t.type==="condition"&&t.cases.some(c=>J(c.condition)))return"customer_required";let m=JSON.stringify([t,t.type==="screen"?e.screens.find(c=>c.id===t.screenId):null]);for(let[c,a]of Object.entries(e.variables))if(a.source.type==="attribute"&&a.source.key!=="funnelParticipantId"&&(m.includes(`variables.${c}`)||m.includes(JSON.stringify(c))))return"customer_required";if(t.type==="split"){let c=u.experiments?.[t.experimentId];if((c?.hashAttribute??"id")!=="funnelParticipantId"||J(c?.condition)||c?.parentConditions?.length)return"customer_experiment_required"}let d=t.type==="feature"?t.featureKey:o?.type==="feature"?o.featureKey:void 0;return d&&u.features?.[d]?.rules?.some(c=>(c.hashAttribute??"id")!=="funnelParticipantId"||J(c.condition)||c.parentConditions?.length)?"customer_experiment_required":null}var he=class extends Error{constructor(u,r){super(r);this.code=u;this.name="FunnelLocalCalculationError"}code},ee=(e,t)=>new he(e,t),jn=e=>({experiments:e.experiments,features:e.features});function we(e,t=ee){let u=new Map(e.topology.nodes.map(d=>[d.id,d])),r=Ne(e.growth.savedGroups),o=jn(e.growth);function m(d,c){if(!Object.hasOwn(e.growth.features,d))throw t("INVALID_RESPONSE","Required GB Feature is unavailable");return Oe(d,c).value}return{nodes:u,savedGroups:r,features:o.features,feature:m,evaluate(d,c){let a=u.get(d);if(!a)throw t("NOT_FOUND","Funnel node is unavailable");let i,g;if(a.type==="condition"){let v=e.conditions[a.id];if(!v)throw t("INVALID_RESPONSE","Local condition rules are unavailable");i=de({id:a.id,name:a.id,type:"condition",cases:v.map(h=>({condition:h.condition,target:a.outputs[h.port]})),default:a.outputs.default},c,o.experiments).port}else if(a.type==="feature"){if(!a.resources.featureKey)throw t("INVALID_RESPONSE","Feature reference is unavailable");g=m(a.resources.featureKey,c),i="next"}else if(a.type==="split"){if(!(a.resources.experimentId?e.growth.experiments[a.resources.experimentId]:void 0))throw t("INVALID_RESPONSE","Experiment reference is unavailable");let h=de({id:a.id,name:a.id,type:"split",experimentId:a.resources.experimentId,routes:a.outputs,notParticipating:a.outputs.notParticipating},c,o.experiments);g=h.value,i=h.port}else if(["offering","end","output"].includes(a.type)&&a.resources.featureKey)g=m(a.resources.featureKey,c),i=a.type==="offering"?"next":"value";else throw t("SERVER_REQUIRED","This node is driven by the authoritative Funnel runtime");let y=a.outputs[i]??(i==="value"?a.id:void 0);if(!y)throw t("INVALID_RESPONSE","Evaluated node exit is unavailable");return{nodeId:d,port:i,target:y,...g===void 0?{}:{value:g}}}}}function lr(e,t,u,r=ee){return be(e,r)(t,u)}function be(e,t){let u=X.parse(e);if(u.evaluationMode!=="local")throw t("EVALUATION_MODE","Remote nodes are evaluated by Grow");let r=u.expiresAt?Date.parse(u.expiresAt):null,o=()=>{if(r!==null&&r<=Date.now())throw t("CONFIGURATION_EXPIRED","Refresh local rules at the scheduled transition")};o();let m=we(u,t);return(d,c)=>(o(),Gn(m,d,c))}function Gn(e,t,u){let r=Ae.parse(u.attributes??{}),{saveStickyBucketAssignmentDoc:o,onFeatureUsage:m,onExperimentViewed:d}=u,c={attributes:r,...o?{saveStickyBucketAssignmentDoc:a=>o(structuredClone(a))}:{},...m?{onFeatureUsage:(a,i)=>m(a,structuredClone(i))}:{},...d?{onExperimentViewed:(a,i)=>d(structuredClone(a),structuredClone(i))}:{},features:e.features,savedGroups:e.savedGroups,...u.stickyBucketAssignmentDocs?{stickyBucketAssignmentDocs:structuredClone(u.stickyBucketAssignmentDocs)}:{}};return e.evaluate(t,c)}function cr(e,t,u,r=ee){return mn(be(e,r),t,u)}function mn(e,t,u){let r=[],o=[],m=[],d=e(t,{...u.attributes?{attributes:u.attributes}:{},stickyBucketAssignmentDocs:u.sticky,saveStickyBucketAssignmentDoc(c){let a=r.findIndex(y=>y.next.attributeName===c.attributeName&&y.next.attributeValue===c.attributeValue),i=c.attributeName+"||"+c.attributeValue,g={expected:u.sticky[i]??null,next:c};a<0?r.push(g):r[a]=g},onExperimentViewed(c,a){a.inExperiment&&a.hashUsed&&!a.passthrough&&o.push(L.parse({key:c.key,variationId:a.variationId,keyUsed:a.key,hashAttribute:a.hashAttribute,hashValue:a.hashValue}))},onFeatureUsage(c,a){m.push(L.parse({feature:c,value:a.value,source:a.source,...a.ruleId?{ruleId:a.ruleId}:{}}))}});return{port:d.port,...d.value===void 0?{}:{value:d.value},sticky:r,exposures:o,features:m}}function fn(e,t,u,r=ee){let o=u,m=new Map(t.graph.nodes.map(O=>[O.id,O])),d=structuredClone(u.variables),c=structuredClone(o.sticky),a=[],i=u.nodeId,g=u.visit,y=!1,v,h=O=>pn(t,O,e.evaluationMode==="local"?e.growth:{features:{},experiments:{}},o.attributes.funnelCustomerBound===!0),b=O=>(v??=be(e,r),mn(v,O,{attributes:Be({declarations:t.variables,attributes:o.attributes,parameters:u.parameters,answers:u.answers,results:d,savedGroups:{}}),sticky:c}));for(let O=0;O<Ie;O++){let s=m.get(i);if(!s||!ve(s)||h(s))break;if(g>=t.execution.maxTransitions&&(g>t.execution.maxTransitions||s.type!=="end"&&s.type!=="output")){if(!a.length)throw r("TRANSITION_LIMIT","Local Funnel transition budget exceeded");break}let p,x;if(["condition","feature","split"].includes(s.type)||s.type==="offering"&&s.configuration.source==="feature")p=b(s.id),s.type==="offering"&&(p.value={type:"offering_version",id:String(p.value)}),s.type==="condition"?x=p.port==="default"?s.default:s.cases[Number(p.port.slice(5))]?.target:s.type==="split"?x=p.port==="notParticipating"?s.notParticipating:s.routes[p.port]:(s.type==="feature"||s.type==="offering")&&(x=s.next);else if(p={port:"next",sticky:[],exposures:[],features:[]},(s.type==="entry"||s.type==="coupon"||s.type==="coupons")&&(x=s.next),s.type==="offering"&&s.configuration.source==="fixed"&&(p.value={type:"offering_version",id:s.configuration.versionId},x=s.next),s.type==="end"||s.type==="output"){let S=s.type==="end"?s.output:s.value;if(p=S?.type==="feature"?b(s.id):{...p,port:"value",value:S?.type==="literal"?S.value:S?.type==="variable"?Me({source:"variable",key:S.key,...S.path?{path:S.path}:{}},{declarations:t.variables,answers:u.answers,results:d,parameters:u.parameters,attributes:o.attributes,savedGroups:{}}):null},S&&(p.value===void 0||!De(t.outputSchema,p.value)))throw r("INVALID_RESPONSE","Local terminal violates its declared output")}let C=[...a,{nodeId:i,result:p}];if(Y({steps:C})>6e4){if(!a.length)throw r("INVALID_REQUEST","Local step exceeds its command budget");break}if(a.push({nodeId:i,result:p}),s.type==="feature"||s.type==="offering"||s.type==="coupon"||s.type==="coupons"){let S=s.type==="coupons"?s.couponIds.map(D=>({type:"reward",id:D})):s.type==="coupon"?{type:"reward",id:s.couponId}:p.value;if(S===void 0)throw r("INVALID_RESPONSE","Node output is missing");let _=Ve(s,{value:S});Le(t.variables,s,_),Object.assign(d,_)}for(let S of p.sticky)c[`${S.next.attributeName}||${S.next.attributeValue}`]=structuredClone(S.next);if(s.type==="end"||s.type==="output"){y=!0;break}if(!x)throw r("INVALID_RESPONSE","Local pure exit is unavailable");i=x,g++}let T=m.get(i);return{steps:a,...!y&&T&&(!ve(T)||h(T))?{boundary:{nodeId:i,visit:g}}:{}}}function gn(e,t){let u=an.safeParse(t);if(!u.success)throw new f("INVALID_RESPONSE","Funnel response contract changed");let r=u.data;if(e.scope&&(r.scope.projectId!==e.scope.projectId||r.scope.environment!==e.scope.environment))throw new f("SCOPE_MISMATCH","Funnel scope changed");return r}var xe=(e,t)=>new f(e,t);function Ir(e){return we(e,xe)}var Un=3,Bn=2e3;function Kn(e){return e instanceof TypeError||e instanceof f&&/^(?:CONFIGURATION_UNAVAILABLE|CONFIGURATION_HTTP_(?:429|5\d\d)|TEMPORARY_UNAVAILABLE)$/i.test(e.code)}async function zn(e){for(let t=1;;t++)try{return await e.refresh()}catch(u){if(t===Un||!Kn(u))throw u;await new Promise(r=>setTimeout(r,t*Bn))}}async function Se(e,t,{predict:u=!0}={}){let r=t.instruction;if(r?.type!=="evaluate_segment")throw new Error("Local segment instruction required");if(!e)throw new f("CONFIGURATION_UNAVAILABLE","Local execution requires public configuration");if(e.scope.environmentId!==r.environmentId)throw new f("SCOPE_MISMATCH","Evaluation environment changed");let o=null,m;if(u)try{let d=await e.funnel(t.source.id,t.source.versionId);m=d.manifest.generation,o=$n(e,t,d)}catch{o=null}return m??=e.snapshot?.generation??(await zn(e)).generation,{advance:{policyRevision:r.policyRevision,generation:m},prediction:o}}function $n(e,t,u){let r=t.instruction;if(r?.type!=="evaluate_segment"||!u.growth||u.control.evaluationMode!=="local"||u.control.evaluationRevision!==r.policyRevision)return null;let{analyticsConfig:o,remoteFeatures:m,...d}=u.growth,c=ge({scope:{projectId:e.scope.projectId,environment:e.scope.environment},funnelId:t.source.id,versionId:t.source.versionId,evaluationMode:"local",evaluationRevision:r.policyRevision,document:u.document,payload:K.parse(d)}),a=Jn(c,u.document,{...t,...r}),i=a.steps.at(-1),g=a.boundary??(i?.result.port==="value"?{nodeId:i.nodeId,visit:t.visit+a.steps.length-1}:null);return g?{runId:t.id,from:{nodeId:t.nodeId,visit:t.visit,revision:t.revision},nodeId:g.nodeId,visit:g.visit,terminal:!a.boundary}:null}function Jn(e,t,u){return fn(e,t,u,xe)}var yn=G.refine(e=>!["start","get","review"].includes(e.operation)&&!("customerToken"in e),"Persist only the original mutation, without credentials").transform(e=>{if(e.operation==="start"||e.operation==="get"||e.operation==="review")throw new f("COMMAND_STORAGE_INVALID","Stored mutation required");return e}),In=n.strictObject({schemaVersion:n.literal(1),scope:V,runId:n.uuid(),funnelId:n.uuid(),versionId:n.uuid(),processBindingIds:n.record(n.uuid(),n.uuid().nullable()).optional(),command:yn.optional(),closeCommand:yn.refine(e=>e.operation==="close").optional(),purchase:n.strictObject({receiptId:n.uuid(),operationId:n.uuid(),generation:n.number().int().nonnegative()}).optional(),closed:n.literal(!0).optional()}).refine(e=>!e.closeCommand||e.command&&e.command.operation!=="close"&&e.command.requestId!==e.closeCommand.requestId,"Close requires a separate request identity").refine(e=>e.command!==void 0||e.purchase!==void 0,"A recovery record requires an original obligation"),A=()=>new f("COMMAND_STORAGE_CONFLICT","Another host changed this Run's pending command"),ne=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function H(e,t){if(!e||!t)return e;if(e.processBindingIds&&Object.hasOwn(e.processBindingIds,t)){let u={...e.processBindingIds};delete u[t],e={...e,processBindingIds:u}}return e.command?.requestId===t?e.closeCommand?{...e,command:e.closeCommand,closeCommand:void 0}:e.purchase?{...e,command:void 0}:null:e.closeCommand?.requestId===t?{...e,closeCommand:void 0}:e}function vn(e){let t=0,u=null,r=a=>JSON.stringify([a.scope,a.runId,a.funnelId,a.versionId]),o=Promise.resolve();async function m(){let a=await e.read();if(!Number.isSafeInteger(a.revision)||a.revision<0)throw new f("COMMAND_STORAGE_INVALID","Invalid command storage revision");return{revision:a.revision,entry:a.entry===null?null:In.parse(a.entry)}}function d(a){let i=o.then(a);return o=i.catch(()=>{}),i}async function c(a){for(let i=0;i<4;i++){let g=await m();if(g.entry&&u!==null&&r(g.entry)!==u)throw A();let y=a(g.entry,g.revision);if(ne(g.entry,y)){t=g.revision;return}let v=await e.write(g.revision,y);if(v!==null){if(!Number.isSafeInteger(v)||v<=g.revision)throw A();t=v;return}}throw A()}return{bind(a){let i=JSON.stringify([a.scope,a.runId,a.funnelId,a.versionId]);if(u!==null&&u!==i)throw A();u=i},async load(){let a=await m();return t=a.revision,u=a.entry?r(a.entry):null,a.entry},retain(a){let i=In.parse(a),g=i.command;return!g||u!==null&&r(i)!==u?Promise.reject(A()):(u??=r(i),d(()=>c((y,v)=>{if(y&&!ne(r(y),r(i)))throw A();if(y&&i.processBindingIds){for(let[h,b]of Object.entries(i.processBindingIds))if(y.processBindingIds&&Object.hasOwn(y.processBindingIds,h)&&y.processBindingIds[h]!==b)throw A();y={...y,processBindingIds:{...y.processBindingIds,...i.processBindingIds}}}if(!y){if(v!==t&&g.operation!=="close")throw A();return i}if(!y.command)return{...y,command:g,...g.operation==="close"?{closed:!0}:{}};if(g.operation==="close"&&y.command.operation!=="close"){if(y.command.requestId===g.requestId||y.closeCommand&&!ne(y.closeCommand,g))throw A();return{...y,closeCommand:g,closed:!0}}if(!ne(y.command,g))throw A();return y})))},observePurchase(a,i,g,y){return d(()=>c((v,h)=>{if(!v&&h!==t||v&&r(v)!==r({...a,schemaVersion:1}))throw A();if(v?.purchase&&v.purchase.generation>i.generation)return H(v,y);if(v?.purchase&&v.purchase.generation===i.generation&&v.purchase.operationId!==i.operationId)throw A();return g?!v?.purchase||v.purchase.operationId!==i.operationId?H(v,y):H(v.command?{...v,purchase:void 0}:null,y):H({schemaVersion:1,...a,...v,purchase:i},y)}))},settle(a){return d(()=>c(i=>H(i,a)))}}}function Or(e,t){return t.type==="id"?e.customerId===t.value:e.externalUserId===t.value}function te(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((o,m)=>te(o,t[m]));if(!e||!t||typeof e!="object"||typeof t!="object")return!1;let u=Object.entries(e),r=Object.entries(t);return u.length===r.length&&u.every(([o,m])=>Object.hasOwn(t,o)&&te(m,Reflect.get(t,o)))}function hn(e,t){let u=t&&{...t},r=null,o=0,m=-1,d=0,c=new AbortController;function a(){d++,c.abort(new f("IDENTITY_CHANGED","Run identity changed")),c=new AbortController}let i=!1,g,y=0,v=new Set;return{get scope(){return u},bindScope(h){if(u&&(u.projectId!==h.projectId||u.environment!==h.environment))throw new f("SCOPE_MISMATCH","Run scope changed");u??={...h}},get view(){return r},get currentView(){return m===d?r:null},get viewAgeMs(){return r&&m===d?performance.now()-o:void 0},get generation(){return d},get signal(){return c.signal},get disposed(){return i},get customerToken(){return g},get readSequence(){return y},nextRead(){return++y},assertCurrent(h,b="Run identity changed during the request"){if(h!==d||i)throw new f("IDENTITY_CHANGED",b)},assertRun(h){if(r&&(h.id!==r.id||h.source.type!==r.source.type||h.source.id!==r.source.id||h.source.versionId!==r.source.versionId||h.locale!==r.locale||!te(h.parameters,r.parameters)))throw new f("INVALID_RESPONSE","Run version changed");if(e&&h.source.id!==e)throw new f("INVALID_RESPONSE","Run belongs to another Funnel")},publish(h,b,T,O,s){if(!(h.operation==="review"&&r&&r!==T&&b.run.revision<=r.revision)&&!(r&&b.run.revision===r.revision&&O!==void 0&&O<y)&&(h.operation==="review"&&!b.run.stopped&&["running","waiting"].includes(b.run.status)&&r&&m===d&&b.run.nodeId===r.nodeId&&b.run.visit===r.visit&&b.run.revision===r.revision&&(b.run.screen=r.screen,(r.paywall?.quote?.operationId===b.review?.activeOperationId||!r.paywall?.quote&&b.review?.activeOperationId===null)&&(b.run.paywall=r.paywall)),!(r?.paywall&&b.run.paywall&&r.paywall.receiptId===b.run.paywall.receiptId&&(b.run.paywall.selectionGeneration??0)<(r.paywall.selectionGeneration??0)))){if(!r||b.run.revision>=r.revision)r=b.run,o=performance.now(),m=d;else if(!s)return;if(r&&m===d)for(let p of v)try{p(structuredClone(r))}catch{}}},identify(h){if(i)throw new f("IDENTITY_CHANGED","Controller was reset");if(!Q.test(h))throw new f("INVALID_TOKEN","Customer credential required");a(),g=h},subscribe(h){return v.add(h),()=>v.delete(h)},reset(){i||(i=!0,a(),g=void 0,r=null,v.clear())}}}var Re=/^gg_sk_[A-Za-z0-9_-]{32,128}$/;function Lr(e,t,u="A server API key is required"){if(typeof window<"u")throw new f("SERVER_ONLY",t);if(!Re.test(e))throw new f("INVALID_TOKEN",u)}function Mr(e){let t=W(e);return t.identify(e.apiKey),t}function wn(e,t){if(!e)return;let u=t?.execution,r=u?.provider==="merchant"?"merchant":u?.provider==="stripe"?u.executor==="merchant"?"record_only":"indiana":t&&!ae(t)&&["apple","google"].includes(t.provider)?"native":t&&!ae(t)&&t.provider==="stripe"?"indiana":void 0;if(!r||!e.allowed.includes(r))throw new f("EXECUTION_POLICY_REFUSED","The original quote does not permit the declared purchase execution")}function q(e){let{customerToken:t,...u}=e;return u}var Hn=e=>!(e instanceof f&&e.code==="EXECUTION_POLICY_REFUSED")&&(!(e instanceof f)||e.status===void 0||e.status>=500||[401,425].includes(e.status)||e.recovery==="recover_operation");function bn({journal:e,state:t,call:u,processIdentity:r}){let o=null,m=null,d=!1,c={command:null,close:null},a=new Set,i,g=null,y=e?e.load().then(s=>{if(t.disposed)throw new f("IDENTITY_CHANGED","Controller was reset during command restoration");if(g=s,!s)return;if(r){if([s.command,s.closeCommand].some(x=>x&&!Object.hasOwn(s.processBindingIds??{},x.requestId)))throw new f("COMMAND_STORAGE_INVALID","The original process identity is missing");r.restore(s.processBindingIds??{})}if(t.scope&&(s.scope.projectId!==t.scope.projectId||s.scope.environment!==t.scope.environment))throw new f("SCOPE_MISMATCH","Pending command belongs to another scope");if(i=s.purchase,d=s.closed===!0,!s.command)return;let p=s.command;o=p.operation==="close"?null:p,m=p.operation==="close"?p:s.closeCommand?.operation==="close"?s.closeCommand:null,m&&(d=!0);for(let x of[o,m])x&&a.add(x.requestId)}):Promise.resolve();y.catch(()=>{});async function v(s){e&&await y;let p=t.generation;if(e){if(!t.view||!t.scope)throw new f("COMMAND_STORAGE_INVALID","Read the original scoped Run before persisting a mutation");await e.retain({schemaVersion:1,scope:t.scope,runId:t.view.id,funnelId:t.view.source.id,versionId:t.view.source.versionId,command:q(s),...r?{processBindingIds:{[s.requestId]:r.binding(s.requestId)}}:{}})}if(p!==t.generation||o!==s&&m!==s)throw new f("IDENTITY_CHANGED","Run changed before command dispatch");let x=a.has(s.requestId);a.add(s.requestId);try{return await u(s)}catch(C){let S=s.operation==="submit"&&s.input.type==="paywall_quote",_=!x&&!Hn(C),D=!1;if(S&&_&&p===t.generation&&o===s&&C instanceof f&&C.status!==void 0){let l=await T(s.requestId).catch(()=>{});D=l?.settlement?.state==="unknown"&&l.settlement.operationId===null}throw p===t.generation&&(o===s||m===s)&&_&&(!S||!(C instanceof f)||C.status===void 0||D)&&(e&&await e.settle(s.requestId),p===t.generation&&O(s)),C}}function h(s){let p=G.parse(s);if(p.operation==="start"||p.operation==="get"||p.operation==="review")throw new f("INVALID_REQUEST","Mutation required");if(d&&p.operation!=="close"){if(o?.requestId===p.requestId)return T(p.requestId);throw new f("COMMAND_PENDING","Close preserves the original recovery record; settle it by identity")}if(p.operation==="close"){if(o?.requestId===p.requestId)throw new f("INVALID_REQUEST","Close requires its own request identity");if(d=!0,m&&JSON.stringify(q(m))!==JSON.stringify(q(p)))throw new f("COMMAND_PENDING","Retry the original Close");return m??=p,c.close?c.close:b(m,"close")}if(o){if(JSON.stringify(q(o))!==JSON.stringify(q(p)))throw new f("COMMAND_PENDING","Retry the original command before sending another");if(c.command)return c.command}else o=p;return b(o,"command")}function b(s,p){let x=v(s);c[p]=x;let C=()=>{c[p]===x&&(c[p]=null)};return x.then(C,C),x}function T(s){return u({operation:"get",settlementRequestId:s})}function O(s){return!s||o!==s&&m!==s?!1:(o===s&&(o=null),m===s&&(m=null),a.delete(s.requestId),!o&&!m&&(g=null),!0)}return{ready:y,get pending(){return o},get closing(){return m},get closeRequested(){return d},get inFlight(){return c.command},get closeFlight(){return c.close},get purchase(){return i},assertBinding(s){if(g&&(s.run.id!==g.runId||s.run.source.id!==g.funnelId||s.run.source.versionId!==g.versionId))throw new f("SCOPE_MISMATCH","Stored command belongs to another Run or Version")},async observe(s,p,x,C){let S=s.operation==="get"?s.settlementRequestId:"requestId"in s&&s.operation!=="start"?s.requestId:void 0,_=S&&p.settlement?.state==="settled"&&p.run.pendingRequest?.requestId!==S&&(s.operation==="get"||!d||s.operation==="close"||!["running","waiting"].includes(p.run.status))?S:void 0,D=o?.requestId===_?o:m?.requestId===_?m:void 0;e?.bind({scope:p.scope,runId:p.run.id,funnelId:p.run.source.id,versionId:p.run.source.versionId});let l=p.run.paywall,I=l??p.purchase,P=I?.operation,E=p.settlement&&(!l||l.purchaseRequestId===p.settlement.requestId)&&(!i||i.operationId===p.settlement.operationId)?p.settlement:void 0,R=P?.operationId??I?.quote?.operationId??E?.operationId,F=I?.receiptId??E?.receiptId,w=l?.selectionGeneration??i?.generation??0;if(e&&R&&F&&s.operation!=="review"&&(!t.view||p.run.revision>=t.view.revision)&&(C===void 0||C>=t.readSequence)&&(!i||w>=i.generation)){let N={receiptId:F,operationId:R,generation:w},k=tn(P,I?.canReselect===!0);await e.observePurchase({scope:p.scope,runId:p.run.id,funnelId:p.run.source.id,versionId:p.run.source.versionId},N,k,_),t.assertCurrent(x),(!i||N.generation>=i.generation)&&(C===void 0||C>=t.readSequence)&&(k?i?.operationId===N.operationId&&(i=void 0):i=N)}else e&&_&&await e.settle(_);return t.assertCurrent(x),_?O(D):!1},stop(){d=!0},submit:h,settle:T,reset(){d=!0,o=null,m=null,i=void 0,g=null,c.close=null,a.clear(),c.command=null}}}function Qn(e){e={...e};let t=e.initialResponse;delete e.initialResponse;let u=e.funnelExecutionPolicy&&structuredClone(e.funnelExecutionPolicy);if(!e.customerRun&&(typeof e.runToken!="string"||!/^gg_fr_[A-Za-z0-9_-]{43}$/.test(e.runToken)))throw new f("INVALID_TOKEN","Run credential required");if(e.customerRun&&(!e.session||!e.scope||!e.funnelId||!e.funnelCommandStorage||e.serverKey))throw new f("INVALID_REQUEST","Customer recovery requires its scoped session and durable journal");if(e.serverKey&&(typeof window<"u"||!Re.test(e.serverKey)))throw new f("SERVER_ONLY","Run Server-Key proof belongs to the merchant backend");if(e.serverKey&&e.session)throw new f("INVALID_REQUEST","Choose Customer session or Server-Key proof for this Run");let r=W({...e,session:void 0,timeoutMs:e.timeoutMs??35e3}),o=hn(e.funnelId,e.scope??e.configuration?.scope),m=e.session?.subscribeIdentity(b),d=null,c=e.funnelCommandStorage??(!e.customerRun&&typeof window<"u"&&window.isSecureContext?rn(e):void 0),a=c&&vn(c),i=bn({journal:a,state:o,call:T,processIdentity:e.process}),g=0,y=new Map;function v(){g++,y.clear(),t=void 0}async function h(l){let I=l.operation==="resume"?i.pending?.operation==="resume"?null:i.pending:l;if(u&&l.operation==="resume"&&!I&&l.requestId!==e.customerRun?.startRequestId)throw new f("EXECUTION_POLICY_REFUSED","The original command is required to verify execution permission before resuming");if(I?.operation==="submit"&&I.input.type==="paywall_confirm"){let N=o.view?.paywall;wn(u,N?.quote?.operationId===I.input.operationId?N.quote:void 0)}if(e.process)return e.process.request(l);let P=o.generation;o.assertCurrent(P);let E=performance.now()+(e.timeoutMs??35e3),R=o.customerToken??("customerToken"in l?l.customerToken:void 0);if(e.session){let N=o.signal,k,B=()=>{},xn=new Promise((Yn,Fe)=>{B=()=>Fe(N.reason),N.addEventListener("abort",B,{once:!0}),k=setTimeout(()=>Fe(new f("TIMEOUT","The request timed out")),Math.max(1,E-performance.now()))});try{R=await Promise.race([Promise.resolve().then(()=>(o.assertCurrent(P),e.session.access())),xn])}finally{clearTimeout(k),N.removeEventListener("abort",B)}}o.assertCurrent(P);let F={...l,...R?{customerToken:R}:{}},w=l.operation==="page_experiments"?fe.parse(F):G.parse(F);if(e.customerRun){if(e.session?.snapshot()?.customerId!==e.customerRun.customerId||!R)throw new f("IDENTITY_CHANGED","Original recovery Customer changed");let N={...w};return"customerToken"in N&&delete N.customerToken,r.requestWithCredential("funnels",{operation:"run_command",runId:e.customerRun.runId,funnelId:e.funnelId,command:N},R,{timeoutMs:Math.max(1,E-performance.now())})}return r.requestWithCredential("funnels",w,e.runToken,{headers:e.serverKey&&!R?{[un]:e.serverKey}:void 0,timeoutMs:Math.max(1,E-performance.now())})}function b(){v(),m?.(),o.reset(),i.reset(),d=null,r.dispose()}async function T(l,I){let P=t;t=void 0;let E=o.generation,R=()=>o.assertCurrent(E);a&&await i.ready,R();let F=o.view,w=gn(e,P!==void 0&&l.operation==="get"&&!l.data&&!l.purchase&&!l.settlementRequestId?P:await h(l));if(l.operation==="review"&&!w.review)throw new f("INVALID_RESPONSE","Historical projection is missing");if(e.customerRun&&w.run.id!==e.customerRun.runId)throw new f("INVALID_RESPONSE","Original recovery Run changed");if(l.operation==="get"&&l.purchase&&w.purchase&&(w.purchase.receiptId!==l.purchase.receiptId||(w.purchase.operation?.operationId??w.purchase.quote?.operationId)!==l.purchase.operationId))throw new f("INVALID_RESPONSE","The requested original purchase changed");if(R(),w.runToken&&w.runToken!==e.runToken)throw new f("INVALID_RESPONSE","Run credential changed");let N=l.operation==="get"?l.settlementRequestId:"requestId"in l&&l.operation!=="start"?l.requestId:void 0;if(N&&w.settlement?.requestId!==N)throw new f("INVALID_RESPONSE","Exact command settlement is missing or belongs to another command");i.assertBinding(w),o.assertRun(w.run),o.bindScope(w.scope);let k=await i.observe(l,w,E,I);return(!o.view||w.run.revision>=o.view.revision)&&(I===void 0||I>=o.readSequence)&&(await e.onAcceptedResponse?.(w),R()),!w.run.stopped&&["running","waiting"].includes(w.run.status)&&l.operation==="get"&&l.settlementRequestId||(R(),["running","waiting"].includes(w.run.status)||i.stop(),o.publish(l,w,F,I,k)),w}function O(l){let I=o.generation;v();let P=l(),E=()=>{o.generation===I&&v()};return P.then(E,E),P}let s=l=>O(()=>i.submit(l)),p=null,x=new WeakMap;function C(l){let I=x.get(l);if(I)return I;let P=_(l);return x.set(l,P),P}let S=!1;async function _(l){let I=await l;if(I.run.instruction?.type!=="evaluate_segment")return I;if(p)return p;S=!0;let P=o.generation,E=(async()=>{for(let R=0;R<32&&I.run.instruction?.type==="evaluate_segment";R++){if(i.pending||i.closeRequested)return I;let F=I.run;if(I.run.instruction?.type==="evaluate_segment"){let{advance:N}=await Se(e.configuration,F,{predict:!1});if(P!==o.generation)throw new f("IDENTITY_CHANGED","Run identity changed during segment calculation");if(i.pending||i.closeRequested)return I;if(o.view&&(o.view.revision!==F.revision||o.view.visit!==F.visit||o.view.nodeId!==F.nodeId))return T({operation:"get"});let k=!0;Se(e.configuration,F).then(({prediction:B})=>{k&&P===o.generation&&!i.closeRequested&&o.view?.id===F.id&&!o.view.stopped&&o.view.nodeId===F.nodeId&&o.view.visit===F.visit&&o.view.revision===F.revision&&(d=B)}).catch(()=>{});try{I=await s({operation:"commit_segment",requestId:Xe(F.id,F.visit,`segment:${F.revision}`),nodeId:F.nodeId,visit:F.visit,revision:F.revision,...N})}finally{k=!1,d=null}}}return I})();p=E;try{return await E}finally{p===E&&(p=null)}}let D={get configuration(){return S?e.configuration:void 0},get configurationReady(){return!0},get view(){let l=o.currentView;return l?structuredClone(l):null},get viewAgeMs(){return o.viewAgeMs},get pendingCommand(){let l=i.closing??i.pending;return l?structuredClone(q(l)):null},get pendingCommands(){return[i.pending,i.closing].filter(l=>l!==null).map(l=>structuredClone(q(l)))},get pendingPurchase(){return i.purchase?structuredClone(i.purchase):null},get hasDurableJournal(){return a!==void 0},get prediction(){let l=o.view;return d&&l&&!l.stopped&&["running","waiting"].includes(l.status)&&l.id===d.runId&&l.nodeId===d.from.nodeId&&l.visit===d.from.visit&&l.revision===d.from.revision&&!i.closeRequested?structuredClone(d):null},settle:(...l)=>O(()=>i.settle(...l)),get webViewUrl(){return"bundled"},resolvePaywall(l){return nn(e,l)},async pageExperiments(l,I=[]){let P=o.generation;o.assertCurrent(P);let E=o.view?.id;if(!E)throw new f("INVALID_REQUEST","Read the Run before its page experiments");let R=ln.parse(await h(fe.parse({operation:"page_experiments",release:l,usedReceiptIds:I})));if(o.assertCurrent(P),R.runId!==E||R.scope.projectId!==o.scope?.projectId||R.scope.environment!==o.scope?.environment)throw new f("SCOPE_MISMATCH","Page experiment Run changed");return R},review(l){return T({operation:"review",...l?{receiptId:l}:{}},o.nextRead())},async get(l,I){let P=o.generation;l=l&&structuredClone(l),I=I&&{...I},a&&await i.ready,o.assertCurrent(P),I??=i.purchase&&{receiptId:i.purchase.receiptId,operationId:i.purchase.operationId};let E=JSON.stringify([o.generation,g,l??null,I??null]),R=y.get(E);if(R)return R.then(k=>structuredClone(k));let F=o.nextRead(),w=C(T({operation:"get",...l?{data:l}:{},...I?{purchase:I}:{}},F));y.set(E,w);let N=()=>{y.get(E)===w&&y.delete(E)};return w.then(N,N),w.then(k=>structuredClone(k))},resume(l=o.view?.pendingRequest?.requestId){return l?i.closeRequested?D.settle(l):i.pending?.requestId===l?C(s(i.pending)):C(s({operation:"resume",requestId:l})):Promise.reject(new f("INVALID_REQUEST","No interrupted command is available"))},submit(l){return C(s(l))},async retry(){if(i.closeFlight)return i.closeFlight;if(i.closing)return s(i.closing);if(i.closeRequested&&i.pending)return D.settle(i.pending.requestId);if(i.inFlight)return C(i.inFlight);if(!i.pending)throw new f("INVALID_REQUEST","No command is pending");let l=i.pending;if(l.operation==="submit"&&l.input.type==="paywall_quote"){let I=o.generation;if(await D.settle(l.requestId),o.assertCurrent(I),!i.pending)return D.get();if(i.pending!==l||i.closeRequested)throw new f("COMMAND_PENDING","The original quote is being recovered")}return C(s(l))},identify(l){let I=o.customerToken?void 0:t;v(),o.identify(l),t=I,d=null,r.reset()},get identitySignal(){return o.signal},subscribe:o.subscribe,reset:b};return D}function uo(e,t){return Qn({...e,runToken:"",initialResponse:t})}export{on as a,Fn as b,pe as c,Pn as d,an as e,Tn as f,At as g,Tt as h,_t as i,fe as j,ln as k,X as l,kn as m,Kt as n,lr as o,cr as p,gn as q,xe as r,Ir as s,Jn as t,In as u,H as v,rn as w,Sn as x,Or as y,te as z,Re as A,Lr as B,Mr as C,wn as D,Qn as E,uo as F};
@@ -1 +0,0 @@
1
- import{a as pe,b as ye}from"./chunk-CSLTAXC7.js";import{d as fe,e as $}from"./chunk-AQONMY2H.js";import{a as ue}from"./chunk-TL67SYPH.js";import{a as P}from"./chunk-DSPLGTQI.js";var Ce=5*6e4,Ee=15e3,me=new WeakMap;function Oe(i){return me.get(i)}var C=i=>Array.isArray(i)?i.map(C):i&&typeof i=="object"?Object.fromEntries(Object.keys(i).sort().map(n=>[n,C(i[n])])):i,R=(i,n)=>JSON.stringify(C(i))===JSON.stringify(C(n)),we=i=>JSON.stringify(C([i.funnelId,i.locale??null,i.parameters??{}])),ke=["onObservationChange","onPurchase","onCheckoutUrl","resumeCheckout","allowNewPurchase","checkoutNavigation","terminateCheckout","confirmOnHostedCheckout","resolveOfferId","resolveSubscriptionChange","onOpenUrl","onEvent","onAction","onComplete","onError"];function Fe(i,n){let z=e=>structuredClone({funnelId:e.funnelId,locale:e.locale,parameters:e.parameters}),y,Q="",Y=n.start instanceof Promise?void 0:z(n.start),D=e=>e?.parameters?.commerce,Z=Promise.resolve(n.start).then(e=>e?z(e):void 0),M=n.maxAgeMs??Ce,ee=new AbortController,p=AbortSignal.any([ee.signal,n.client.identitySignal,...n.signal?[n.signal]:[]]),q=()=>o("released","aborted"),t="preparing",ne,_,x=()=>{},V=0,h=null,m=null,g=null,d=null,b,L,ae=new Map,u=null,O=new Set,S=new Map,j,te=new Promise(e=>j=e),T,ge=new Promise(e=>T=e);function F(e,a){t!==e&&(t=e,ne=a,P(n.onState,e))}function he(){p.removeEventListener("abort",q),H(),m?.destroy(),m=null,h?.remove(),h=null,g=null}function o(e,a){["adopted","unavailable","released","closed"].includes(t)||(F(e,a),he(),j(!1),T(null))}let J=e=>`error:${e?.code??e?.name??"unknown"}`,U=i.ownerDocument.defaultView,E=!0,re=null,I=!1,be=e=>e.storageArea===U?.localStorage&&(e.key===null||e.key.startsWith("indiana.funnel.purchases.")),oe=e=>{be(e)&&N()},ve=n.client.subscribe(()=>N());function H(){E&&(E=!1,U?.removeEventListener("storage",oe),ve(),x())}let G=()=>E&&(t==="ready"||t==="preparing");function W(e){(t==="ready"||t==="preparing")&&o("unavailable",e)}function N(){if(t==="ready"&&Date.now()-V>=M)return H();I=!0,re??=(async()=>{for(;I&&y&&G();){I=!1;try{await n.client.retained()==="pending"&&W("purchase_pending")}catch(e){p.aborted?o("released","aborted"):W(J(e))}}})().finally(()=>{re=null,I&&y&&G()&&N()})}U?.addEventListener("storage",oe),p.addEventListener("abort",q,{once:!0});let le=n.client.findPurchase();le.catch(()=>{});let k;function K(e){let a=JSON.stringify(C(e)),r=ae.get(a);return r||(r=n.client.readPaywall({paywallVersionId:k?.paywallVersionId??n.paywallVersionId??d?.id,...k?.paywallVersionId||n.paywallVersionId||d?{}:{paywallId:k?.paywallId??n.paywallId},...e}),ae.set(a,r)),r}function B(e){let a=Object.values(e.capabilities.plans);return!(Object.values(e.document.buttons).some(s=>s.type==="checkout")&&a.length===0)&&!a.some(s=>!s.available)}function ie(e,a){if(d&&!$(e,d))return o("unavailable","paywall_changed"),!1;d=e,L=a;for(let r of S.keys())P(r,structuredClone(e));return!0}async function A(){let e=await ge;if(!e)throw new ue("PURCHASE_PENDING","The purchase did not start; open it again");return e}let Pe={get view(){return u?u.view:d},get signal(){return u?.signal??n.client.identitySignal},get quote(){return u?.quote??null},get operation(){return u?.operation??null},webViewUrl:"bundled",get canReselect(){return u?.canReselect},get recovery(){return u?.recovery},get pendingCancellation(){return u?.pendingCancellation},subscribe(e){return S.set(e,u?.subscribe?.(e)??(()=>{})),()=>{S.get(e)?.(),S.delete(e)}},refresh:async()=>u?u.refresh():structuredClone(d),preview:async e=>(await A()).preview(e),confirm:async()=>(await A()).confirm(),cancel:async()=>(await A()).cancel(),read:async()=>(await A()).read(),destroy(){u?.destroy()}},f={options:{},handoff:{}},se={loading:"host",focusAtReveal:!0,signal:n.client.identitySignal,start:async()=>Pe,canInteract:()=>f.options.canInteract?f.options.canInteract():!["unavailable","released","closed"].includes(t),async beforeAction(){let e=t!=="adopted",a=d?.capabilities,r=await A();if(e&&!R(r.view?.capabilities,a))throw new fe;await f.options.beforeAction?.()}};for(let e of ke)Object.defineProperty(se,e,{enumerable:!0,get:()=>f.options[e]});function X(){t!=="preparing"||!g||!m||!y||!R(L?.commerce,D(y))||L?.locale!==y.locale||(F("ready"),j(!0))}let Se={present(e){if(f.handoff.present)return f.handoff.present(e);t==="preparing"&&(g=e,V=Date.now(),X())},async dismiss(){if(f.handoff.dismiss)return f.handoff.dismiss();o("closed");for(let e of[...O])P(e)},quoteError(e){f.handoff.quoteError?f.handoff.quoteError(e):P(f.options.onError,e)}};async function Ie(){if(n.paywallVersionId||n.paywallId)return{paywallVersionId:n.paywallVersionId,paywallId:n.paywallId};let e=n.configuration;if(!e)return o("unavailable","paywall_missing"),null;let a=await Promise.resolve(n.start).catch(()=>null);if(!a||t!=="preparing")return null;let r=()=>pe(e,{funnelId:a.funnelId,customerId:n.client.customerId,parameters:a.parameters??{}});if(_=await r(),t!=="preparing")return null;let s=_;if(s.type!=="paywall")return o("unavailable",ye(s)??"route"),null;let l=!1;return x=e.subscribe(()=>{l||!G()||(l=!0,r().then(c=>{!(c.type==="unavailable"&&!["funnel_stopped","route_unavailable"].includes(c.reason))&&(c.type!=="paywall"||c.paywallVersionId!==s.paywallVersionId)&&W("route_changed")}).finally(()=>l=!1))}),E||x(),{paywallVersionId:s.paywallVersionId}}(async()=>{try{let[{showPaywall:e},a]=await Promise.all([import("./paywall-PZ4BBEFG.js"),Ie()]);if(p.throwIfAborted(),t!=="preparing"||!a)return;let r=n.commerce??D(Y),s=n.locale??Y?.locale;if(!r)return o("unavailable","commerce_missing");if(!s)return o("unavailable","locale_missing");k=a;let l={commerce:r,locale:s},c=await K(l);if(p.throwIfAborted(),t!=="preparing"||(!B(c)&&n.start instanceof Promise&&!b&&await Z,b&&!R(l,b)&&(l=b,c=await K(l)),p.throwIfAborted(),t!=="preparing"))return;if(!B(c))return o("unavailable","plan_unavailable");if(!ie(c,l))return;h=i.ownerDocument.createElement("div"),i.append(h);let v=setTimeout(()=>t==="preparing"&&o("unavailable","timeout"),Ee);te.then(()=>clearTimeout(v));let w=await e(h,se,Se);if(!w.host||p.aborted||t!=="preparing"){w.host?.destroy(),o(p.aborted?"released":"unavailable","error");return}m=w.host,X()}catch(e){o(p.aborted?"released":"unavailable",J(e))}})(),Z.then(async e=>{if(!e)return o("unavailable","gated");let a=e,r=D(a),s=n.commerce??r;if(!R(r&&{...r,intent:void 0},s&&{...s,intent:void 0})||n.locale!==void 0&&a.locale!==n.locale)return o("unavailable","start_mismatch");if(!r)return o("unavailable","commerce_missing");b={commerce:r,locale:a.locale};try{let l=await le,c=l==="pending"?"purchase_pending":l==="found"?"original_purchase":l==="blocked"?"purchase_blocked":void 0;if(c)return o("unavailable",c);if(t!=="preparing")return;if(E&&(I=!1,await n.client.retained()==="pending"))return o("unavailable","purchase_pending");if(k||n.paywallId||n.paywallVersionId||d){let v=await K(b);if(p.throwIfAborted(),t!=="preparing")return;if(d){if(!B(v))return o("unavailable","plan_unavailable");if(!ie(v,b))return}}}catch(l){return o(p.aborted?"released":"unavailable",J(l))}t==="preparing"&&(y=a,Q=we(a),X(),I&&N())},()=>o("unavailable","gated"));let ce={get state(){return t},get reason(){return ne},ready:te,get start(){return y},get prediction(){return _?structuredClone(_):void 0},matches:e=>!!y&&we(e)===Q,open(){if(t==="preparing")return"pending";if(t!=="ready"||!g)return!1;if(Date.now()-V>=M)return o("unavailable","expired"),!1;let e=g;return g=null,H(),F("shown"),e(),"shown"},destroy(){ee.abort()}};return me.set(ce,{onClose(e){return t==="closed"?(P(e),()=>{}):(O.add(e),()=>{O.delete(e)})},claim(){H()},async adopt(e,a){let r=e.paywall?.resolution,s=e.paywall&&!e.paywall.quote&&!e.paywall.operation&&!e.paywall.purchaseRequestId&&!(e.paywall.selectionGeneration??0);if(t!=="shown"||!m||!d||!r||!s||e.source.id!==y?.funnelId||e.locale!==y?.locale||!R(e.parameters??{},y?.parameters??{})||!["running","waiting"].includes(e.status)||!$(r,d))return null;let l;try{l=await a.start()}catch{return null}if(t!=="shown"||!m)return l.destroy(),null;u=l,f.options=a.options,f.handoff=a.handoff;for(let[w]of S)S.set(w,l.subscribe?.(w)??(()=>{})),l.view&&P(w,structuredClone(l.view));p.removeEventListener("abort",q),F("adopted"),T(l),O.clear();let c=m,v=h;return m=null,h=null,g=null,new Proxy(c,{get(w,de){return de==="destroy"?()=>{w.destroy(),v?.remove()}:Reflect.get(w,de,w)}})},get modal(){return d?.document.presentation.type!=="inline"},get revealable(){return t==="ready"&&!!g&&Date.now()-V<M},release(){o("released")}}),ce}export{Ce as a,Oe as b,Fe as c};
@@ -1 +0,0 @@
1
- import{o as n,r as t}from"./chunk-ANXDWUPK.js";function u(o,e,a){return n(o,e,a,t)}export{u as a};
@@ -1 +0,0 @@
1
- import{b as Q}from"./chunk-3WTVQ6OV.js";import{b as N}from"./chunk-JWTA2OCB.js";import"./chunk-CSLTAXC7.js";import"./chunk-DGZCD3AY.js";import{a as K}from"./chunk-HTXB2WVI.js";import{b as B}from"./chunk-ABXCDVC7.js";import"./chunk-KEF6HIFK.js";import"./chunk-W32FI2A2.js";import{i as R,j as J}from"./chunk-P6TNBX2S.js";import"./chunk-RJY5CUTB.js";import"./chunk-V65FSNYO.js";import"./chunk-ANXDWUPK.js";import"./chunk-NVF54BDR.js";import"./chunk-67SIVUOS.js";import"./chunk-PBZSOTKZ.js";import"./chunk-HLCDAU5A.js";import"./chunk-DCZWNTG2.js";import"./chunk-CALDEF4M.js";import"./chunk-ASL7TJFU.js";import"./chunk-B4AELNLE.js";import"./chunk-AQONMY2H.js";import"./chunk-RDUKCMST.js";import"./chunk-KP4QI4RX.js";import"./chunk-5TJISOWN.js";import"./chunk-VILB5M4X.js";import"./chunk-LUGZNBIW.js";import"./chunk-LSVTH3TS.js";import"./chunk-7MYS52FL.js";import"./chunk-MWICFZUF.js";import"./chunk-CWD36SJO.js";import"./chunk-5JRBCW6V.js";import"./chunk-3SXPCVIP.js";import{a as f}from"./chunk-TL67SYPH.js";import"./chunk-6XRXHFM6.js";import"./chunk-SLUA7ABW.js";import"./chunk-O6CUNETH.js";import"./chunk-3VUPVXAV.js";import"./chunk-ZICZN6WO.js";import"./chunk-GPJF3T43.js";import{a as u}from"./chunk-DSPLGTQI.js";import"./chunk-C4NG6RVA.js";import"./chunk-WPFTSHP2.js";import"./chunk-WOT6VMZA.js";var b=new WeakMap,C=new WeakMap,H=new WeakSet;function ie(E,e){let s=e.prepared,T=()=>{s&&!H.has(s)&&N(s)?.release()},U=b.get(e.client);if(U)return T(),U;let _=r=>({...r,requestId:r.requestId??crypto.randomUUID()}),p=e.allowNewPurchase!==!1&&e.start instanceof Promise?e.start:void 0,c=e.allowNewPurchase===!1||!e.start||e.start instanceof Promise?void 0:_(e.start);c&&s?.state==="ready"&&s.matches(c)&&s.open();let i=s&&(c&&(s.state==="preparing"||["shown","closed"].includes(s.state)&&s.matches(c))||p&&["preparing","ready"].includes(s.state))?s:void 0;i?H.add(i):T();let d=i&&N(i);d?.claim();let v=Promise.resolve().then(async()=>{let r=!1,y,A,L=!1,q=()=>{},M=()=>{},I,x=!1,O=!1,h,G=!1,n=e.signal?AbortSignal.any([e.signal,e.client.identitySignal]):e.client.identitySignal,m=()=>{b.get(e.client)===v&&b.delete(e.client),n.removeEventListener("abort",F),q(),M(),i&&H.delete(i),d?.release()};function V(){if(h)return h;let a=new Promise(w=>h=w);return C.set(e.client,a),a.then(()=>{C.get(e.client)===a&&C.delete(e.client)}),b.get(e.client)===v&&b.delete(e.client),h}let o=J(E,e,"funnel",()=>S(),K);function F(){S()}function S(a=!1){if(!r){if(r=!0,o.finish("dismissed"),y){y.destroy();return}if(a&&I){let w=V();G=!0,I.then(async P=>{P.mode==="run"&&P.status!=="blocked"&&e.client.controller&&e.client.attempt?.requestId===c?.requestId&&await e.client.close()}).catch(()=>{}).finally(()=>{w(),u(e.onDismiss,null)}),m();return}m(),u(e.onDismiss,null)}}n.addEventListener("abort",F,{once:!0}),d&&(M=d.onClose(()=>{x?r||V():S(!0)}));try{let k=function(){!r&&!n.aborted&&!L&&A&&e.client.recovery.status==="complete"&&(L=!0,u(e.onComplete,structuredClone(A)))},D=function(t){if(n.throwIfAborted(),r)throw new DOMException("Presentation dismissed","AbortError");return e.onCheckoutUrl?e.onCheckoutUrl(t):E.ownerDocument.defaultView?.location.assign(t)};var X=k,Y=D;n.throwIfAborted();let a=e.client.controller?.view?.paywall?.resolution,w=a&&"document"in a?a.document:e.loadingDocument;o.start(!0,c?.locale??e.client.attempt?.locale??w?.screen.strings.defaultLocale,w??null);let P=p?o.wait(p.then(t=>t?_(t):null,()=>null),R):Promise.resolve(c??null);P.catch(()=>{}),i?.state==="shown"?(O=!0,o.present(()=>{})):i&&["preparing","ready"].includes(i.state)&&Promise.all([i.ready,P.catch(()=>null)]).then(([t,l])=>{if(t){if(r||!o.active||!l||!i.matches(l)||!d?.revealable)return d?.release();o.present(()=>{i.open()==="shown"?O=!0:d.release()})}});let W=C.get(e.client);if(W&&await o.wait(W),r)return null;if(n.throwIfAborted(),p){let t=await P;if(r)return null;if(n.throwIfAborted(),!t)return o.finish("skipped"),m(),null;c=t}I=c?e.client.start(c):e.client.refresh();let j=await o.wait(I,R);if(r)return null;n.throwIfAborted();let z=e.client.controller;return j.mode!=="run"||j.status==="blocked"||!z?(o.finish("skipped"),m(),O&&u(e.onDismiss,null),null):(n.removeEventListener("abort",F),x=!0,q=e.client.subscribe(k),y=await Q(E,{...e,prepared:i,client:z,signal:n,checkoutNavigation:"after_confirmation",resumeCheckout:t=>e.client.continueCheckout(D,t),terminateCheckout:e.allowNewPurchase===!1?void 0:t=>e.client.terminateCheckout(t),async onCheckoutUrl(t){if(n.throwIfAborted(),r)throw new DOMException("Presentation dismissed","AbortError");let l=e.client.recovery;if((!l.actions.includes("continue_checkout")||!l.purchases.some(g=>g.type==="checkout"&&g.checkoutUrl===t))&&(l=await e.client.refresh(),n.throwIfAborted(),r))throw new DOMException("Presentation dismissed","AbortError");if(B(l)!==t)throw new f("PURCHASE_PENDING","Checkout differs from the original recovery proof");return D(t)},async resolveOfferId(t){if(n.throwIfAborted(),r)throw new DOMException("Presentation dismissed","AbortError");let l=e.client.attempt;if(!l)throw new f("PURCHASE_PENDING","Read the original Start before selecting an offer");let g=await e.resolveOfferId?.(t,l);if(n.throwIfAborted(),r)throw new DOMException("Presentation dismissed","AbortError");if(e.client.attempt?.requestId!==l.requestId)throw new f("PURCHASE_STORAGE_CONFLICT","The original purchase changed while selecting an offer");return g},async resolveSubscriptionChange(t){n.throwIfAborted();let l=e.client.attempt;if(r||!l)throw new f("PURCHASE_PENDING","Read the original Start before selecting a membership");let g=await e.resolveSubscriptionChange?.(t);if(n.throwIfAborted(),r||e.client.attempt?.requestId!==l.requestId)throw new f("PURCHASE_STORAGE_CONFLICT","The original purchase changed while selecting a membership");return g},onComplete(t){A=t,k()},onError(t){u(e.onError,t),t instanceof f&&t.status===401&&!n.aborted&&e.client.refresh().catch(l=>u(e.onError,l))},onDismiss(t){r=!0,m(),h?.(),u(e.onDismiss,t)}},o),r||n.aborted?(y.destroy(),null):y)}catch(a){if(G||h?.(),r)return null;throw o.finish("error",a),m(),u(e.onError,a),a}});return b.set(e.client,v),v}export{ie as showFunnelPurchase};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-3WTVQ6OV.js";import"./chunk-JWTA2OCB.js";import"./chunk-CSLTAXC7.js";import"./chunk-DGZCD3AY.js";import"./chunk-HTXB2WVI.js";import"./chunk-KEF6HIFK.js";import"./chunk-W32FI2A2.js";import"./chunk-P6TNBX2S.js";import"./chunk-DCZWNTG2.js";import"./chunk-CALDEF4M.js";import"./chunk-ASL7TJFU.js";import"./chunk-B4AELNLE.js";import"./chunk-AQONMY2H.js";import"./chunk-RDUKCMST.js";import"./chunk-KP4QI4RX.js";import"./chunk-5TJISOWN.js";import"./chunk-VILB5M4X.js";import"./chunk-LUGZNBIW.js";import"./chunk-LSVTH3TS.js";import"./chunk-7MYS52FL.js";import"./chunk-MWICFZUF.js";import"./chunk-CWD36SJO.js";import"./chunk-5JRBCW6V.js";import"./chunk-3SXPCVIP.js";import"./chunk-TL67SYPH.js";import"./chunk-6XRXHFM6.js";import"./chunk-SLUA7ABW.js";import"./chunk-O6CUNETH.js";import"./chunk-ZICZN6WO.js";import"./chunk-GPJF3T43.js";import"./chunk-DSPLGTQI.js";import"./chunk-C4NG6RVA.js";import"./chunk-WPFTSHP2.js";import"./chunk-WOT6VMZA.js";export{a as showFunnelRun,b as showObservedFunnelRun};