@tinkerlandai/longplay-sdk 0.10.52 → 0.10.54

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 (112) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/{ai-usage-gcDQqLb2.d.ts → ai-usage-DBcYB8ix.d.ts} +1 -1
  3. package/dist/{api-D0Qu0isy.d.ts → api-1Tplv-7M.d.ts} +1 -1
  4. package/dist/check-response-MJHH5FWT.js +1 -0
  5. package/dist/{chunk-USM6HOXG.js → chunk-36VNAOG6.js} +1 -1
  6. package/dist/chunk-66TY4EFN.js +1 -0
  7. package/dist/{chunk-PGZZKX5K.js → chunk-6HKQILBV.js} +1 -1
  8. package/dist/{chunk-I643NVMZ.js → chunk-73UFNVEP.js} +1 -1
  9. package/dist/{chunk-UCDQJB53.js → chunk-ADTZEBQF.js} +1 -1
  10. package/dist/chunk-AEQUKR4O.js +1 -0
  11. package/dist/{chunk-5YQZEJBM.js → chunk-ANJPFGFN.js} +1 -1
  12. package/dist/{chunk-XI2NNZBS.js → chunk-BKBWGPNR.js} +1 -1
  13. package/dist/{chunk-7UXQJJFZ.js → chunk-BX2MSRA4.js} +1 -1
  14. package/dist/chunk-C4NXQMSO.js +1 -0
  15. package/dist/{chunk-K644WUOE.js → chunk-CAE4KIZN.js} +1 -1
  16. package/dist/{chunk-3TV3CVNP.js → chunk-CJUODAOF.js} +1 -1
  17. package/dist/{chunk-4CRUNNTC.js → chunk-DXLBEXC6.js} +1 -1
  18. package/dist/{chunk-CJUVMNDB.js → chunk-EACC667P.js} +1 -1
  19. package/dist/{chunk-TSBXPDUQ.js → chunk-GGZG56GR.js} +1 -1
  20. package/dist/{chunk-VPT5MFDG.js → chunk-HMJTABQ5.js} +2 -2
  21. package/dist/{chunk-EDV6ZNPQ.js → chunk-IN32NWRI.js} +1 -1
  22. package/dist/{chunk-2MDJ3JE5.js → chunk-J4RM5GQP.js} +1 -1
  23. package/dist/chunk-JCI5PGY3.js +1 -0
  24. package/dist/{chunk-AFZB2AYU.js → chunk-JJIP6BZL.js} +1 -1
  25. package/dist/{chunk-KXSZTBAG.js → chunk-JXWZS4UM.js} +1 -1
  26. package/dist/{chunk-FAMPOY6L.js → chunk-L64BS65O.js} +1 -1
  27. package/dist/{chunk-VGEH7B6S.js → chunk-LBDLWHBY.js} +1 -1
  28. package/dist/{chunk-AN7CPDBU.js → chunk-LFMAFY3P.js} +1 -1
  29. package/dist/{chunk-3LWZFXLN.js → chunk-LOBZ45T3.js} +1 -1
  30. package/dist/{chunk-CBOIDISB.js → chunk-M4P6TGBU.js} +1 -1
  31. package/dist/chunk-MRL7XUBV.js +1 -0
  32. package/dist/{chunk-XO6GV6O7.js → chunk-MZRDAMFQ.js} +1 -1
  33. package/dist/{chunk-KVIGHX2B.js → chunk-NL7AXMUA.js} +1 -1
  34. package/dist/{chunk-YJRO7NXN.js → chunk-NNJVMJUG.js} +1 -1
  35. package/dist/chunk-OJDO7546.js +1 -0
  36. package/dist/{chunk-RUMGXXVJ.js → chunk-OV46DXRX.js} +1 -1
  37. package/dist/{chunk-LDLS2VL2.js → chunk-OZK47BUU.js} +1 -1
  38. package/dist/{chunk-W3V7DTPC.js → chunk-PB34FLPJ.js} +1 -1
  39. package/dist/{chunk-DJYLJBU2.js → chunk-PPXVRQAG.js} +1 -1
  40. package/dist/{chunk-7Q25R5GL.js → chunk-PVMGYRGE.js} +1 -1
  41. package/dist/chunk-QAGK2SLZ.js +1 -0
  42. package/dist/{chunk-POX2ELNS.js → chunk-QGKROSRD.js} +1 -1
  43. package/dist/{chunk-FKC7TJWM.js → chunk-R2L227PQ.js} +1 -1
  44. package/dist/{chunk-YGOXUDDF.js → chunk-R4BYUK7S.js} +1 -1
  45. package/dist/{chunk-ZVLZLBDA.js → chunk-RJT764B2.js} +1 -1
  46. package/dist/{chunk-BBA64POP.js → chunk-RRZZUIFM.js} +1 -1
  47. package/dist/{chunk-OEUA65JK.js → chunk-S2MSRPR2.js} +1 -1
  48. package/dist/{chunk-PZZLYHKR.js → chunk-SK5JZ7HA.js} +2 -2
  49. package/dist/{chunk-7LHRBNSH.js → chunk-TS26DZNO.js} +1 -1
  50. package/dist/{chunk-NVHRWZIZ.js → chunk-UEKKQHUZ.js} +1 -1
  51. package/dist/{chunk-BYHBBZIO.js → chunk-WE55LJEN.js} +1 -1
  52. package/dist/{chunk-S4YBFFFY.js → chunk-XHZH3E4G.js} +1 -1
  53. package/dist/{chunk-JRHJO4BR.js → chunk-YMRWDMIL.js} +1 -1
  54. package/dist/chunk-ZEU56NVY.js +1 -0
  55. package/dist/{chunk-S6MXUFVF.js → chunk-ZQY7OYHM.js} +1 -1
  56. package/dist/{configuration-sync-DObsuVof.d.ts → configuration-sync-DeWWW5za.d.ts} +1 -1
  57. package/dist/{content-2EEYM7U7.js → content-A4SPKH7N.js} +1 -1
  58. package/dist/funnel-host-purchase-V2TIWGCQ.js +1 -0
  59. package/dist/funnel-host-recovery-paywall-DWKTPDLY.js +1 -0
  60. package/dist/{funnel-local-client-DzRzPX4x.d.ts → funnel-local-client-Fxsyl7rh.d.ts} +26 -26
  61. package/dist/funnel-paywall-prerender-DD7LQXDJ.js +1 -0
  62. package/dist/{funnel-process-client-DGRmy5KN.d.ts → funnel-process-client-D9saqPse.d.ts} +12 -12
  63. package/dist/funnel-route-prediction-ICGW4DPX.js +1 -0
  64. package/dist/funnel-route-source-64LTJZXN.js +1 -0
  65. package/dist/funnel-runtime-host-JG3OAYZ6.js +1 -0
  66. package/dist/index.d.ts +2353 -445
  67. package/dist/index.js +1 -1
  68. package/dist/merchant-bridge-contracts-DEDEIYNU.js +1 -0
  69. package/dist/native-shell.js +1 -1
  70. package/dist/openrouter.d.ts +3 -3
  71. package/dist/openrouter.js +1 -1
  72. package/dist/operation-contracts-RHJJI5NO.js +1 -0
  73. package/dist/page.d.ts +2 -2
  74. package/dist/page.js +1 -1
  75. package/dist/paywall-NM4HMYMK.js +1 -0
  76. package/dist/paywall-content-T2FGNRBR.js +1 -0
  77. package/dist/paywall-session-BAUWSWWR.js +1 -0
  78. package/dist/popup.d.ts +3 -3
  79. package/dist/popup.js +1 -1
  80. package/dist/{presentation-loading-BWUNotNa.d.ts → presentation-loading-sMyRJ21g.d.ts} +4 -2
  81. package/dist/react-native.d.ts +7 -7
  82. package/dist/react-native.js +1 -1
  83. package/dist/screen-renderer-CMFJVI36.js +1 -0
  84. package/dist/server.d.ts +7 -7
  85. package/dist/server.js +1 -1
  86. package/dist/{visual-dom-5LUN4AHO.js → visual-dom-MH3JDJHJ.js} +1 -1
  87. package/dist/visual.js +1 -1
  88. package/package.json +1 -1
  89. package/dist/check-response-AVQ7PY5I.js +0 -1
  90. package/dist/chunk-4OSW2Y67.js +0 -1
  91. package/dist/chunk-EJAF6OGO.js +0 -1
  92. package/dist/chunk-L66EXWTK.js +0 -1
  93. package/dist/chunk-QIY6PCYC.js +0 -1
  94. package/dist/chunk-ZNOVEJLM.js +0 -1
  95. package/dist/chunk-ZY4YDPSI.js +0 -1
  96. package/dist/funnel-host-purchase-UONTZRRJ.js +0 -1
  97. package/dist/funnel-paywall-prerender-AT4BXZIY.js +0 -1
  98. package/dist/funnel-route-prediction-Z3J2HSHI.js +0 -1
  99. package/dist/funnel-route-source-LFE6GSHU.js +0 -1
  100. package/dist/funnel-runtime-host-7ROIR7CU.js +0 -1
  101. package/dist/merchant-bridge-contracts-O6WIWC7T.js +0 -1
  102. package/dist/operation-contracts-H7NKQ373.js +0 -1
  103. package/dist/paywall-25MAYQ4B.js +0 -1
  104. package/dist/paywall-content-7KTEQLRN.js +0 -1
  105. package/dist/paywall-session-7HGW5IKN.js +0 -1
  106. package/dist/screen-renderer-XZWKIJWF.js +0 -1
  107. package/dist/{chunk-PY3AC5KD.js → chunk-5YBTU4KS.js} +0 -0
  108. package/dist/{chunk-CILM5XMH.js → chunk-DLRCJF6U.js} +0 -0
  109. package/dist/{chunk-VPT5MFDG.js.LEGAL.txt → chunk-HMJTABQ5.js.LEGAL.txt} +0 -0
  110. package/dist/{chunk-PZZLYHKR.js.LEGAL.txt → chunk-SK5JZ7HA.js.LEGAL.txt} +0 -0
  111. package/dist/{chunk-OJM6ORHE.js → chunk-VJIONC4S.js} +0 -0
  112. package/dist/{screen-CJepeiBT.d.ts → screen-D2bUmJ4M.d.ts} +1 -1
@@ -1 +0,0 @@
1
- import{c as R}from"./chunk-YJRO7NXN.js";import{a as A}from"./chunk-DSPLGTQI.js";var Y={sm:420,md:640,lg:900},W=767;function ge(e,n,i=()=>!0,c="Close"){let t=e.ownerDocument.defaultView,o=e.ownerDocument.createElement("button");o.type="button",o.setAttribute("aria-label",c),o.style.cssText="position:absolute;inset:0 48px auto;z-index:2;height:24px;border:0;padding:0;background:transparent;touch-action:none;cursor:grab";let d=e.ownerDocument.createElement("span");d.style.cssText="display:block;width:36px;height:4px;border-radius:4px;margin:8px auto 12px;background:currentColor;opacity:.22;pointer-events:none",o.append(d),e.prepend(o);let l,s=0,a=!1,u=()=>{o.hidden=e.dataset.presentation!=="sheet",o.setAttribute("aria-disabled",String(!i()))},x=r=>{u(),!(o.hidden||!i()||r.button!==0)&&(l={y:r.clientY,time:Date.now(),id:r.pointerId},s=0,a=!1,o.setPointerCapture?.(r.pointerId))},b=r=>{!l||r.pointerId!==l.id||(s=Math.max(0,r.clientY-l.y),e.style.transform=`translateY(${s}px)`)},E=r=>{if(!l||r.pointerId!==l.id)return;let g=Math.max(1,Date.now()-l.time),p=r.type!=="pointercancel"&&i()&&(s>120||s>40&&s/g>.5);a=s>6,l=void 0,o.releasePointerCapture?.(r.pointerId),e.style.transform="",p?n():s&&typeof e.animate=="function"&&!t?.matchMedia?.("(prefers-reduced-motion: reduce)").matches&&e.animate([{transform:`translateY(${s}px)`},{transform:"none"}],{duration:200,easing:"cubic-bezier(.2,.8,.2,1)"}),s=0},f=()=>{if(a){a=!1;return}!l&&s===0&&i()&&n()};o.addEventListener("pointerdown",x),o.addEventListener("pointermove",b),o.addEventListener("pointerup",E),o.addEventListener("pointercancel",E),o.addEventListener("click",f);let P=typeof MutationObserver=="function"?new MutationObserver(u):void 0;return P?.observe(e,{attributes:!0,attributeFilter:["data-presentation"]}),t?.addEventListener("resize",u),u(),()=>{P?.disconnect(),t?.removeEventListener("resize",u),o.remove(),e.style.transform=""}}function U(e,n,i=!1){return(e.type==="modal"||e.type==="sheet")&&e.mobile&&i&&n<=W?e.mobile:e.type}function G(e,n,i){let c=e.ownerDocument.defaultView,t=n.presentation,o;if((t.type==="modal"||t.type==="sheet")&&t.backdrop){let r=`lp-backdrop-${crypto.randomUUID()}`,g={none:"transparent",scrim:"#f2f2f2cc",dim:"#0006","strong-dim":"#000000bf",blur:"#0006"};e.dataset.indianaBackdrop=r,o=e.ownerDocument.createElement("style"),o.textContent=`dialog[data-indiana-backdrop="${r}"]::backdrop{background:${g[t.backdrop]};backdrop-filter:${t.backdrop==="blur"?"blur(16px)":"none"}}`,e.append(o)}let d=n.pages?.[0]?.root.style?.shape,l=d?.type==="pill"?"9999px":d?.type==="rect"?typeof d.radius=="number"?`${d.radius}px`:[d.radius.topLeft,d.radius.topRight,d.radius.bottomRight,d.radius.bottomLeft].map(r=>`${r}px`).join(" "):void 0,s=(t.type==="modal"||t.type==="sheet")&&(t.desktopWidth!==void 0||t.mobile!==void 0||t.type==="modal"&&t.position!==void 0),a=t.type,u,x,b=!1,E=r=>{b||!Number.isFinite(r)||r<0||(x=r,a!=="fullscreen"&&a!=="inline"&&(e.style.height=`min(${Math.max(r,40)}px, calc(100dvh - ${a==="sheet"?0:32}px))`))},f=()=>{if(!b&&(a=u??U(t,c?.innerWidth??1024,c?.matchMedia?.("(pointer: coarse)").matches===!0),e.dataset.presentation=a,!(!s||t.type!=="modal"&&t.type!=="sheet"))){if(e.style.boxSizing="border-box",e.style.padding="0",e.style.border="0",e.style.overflow="hidden",e.style.outline="none",e.tabIndex=-1,e.style.background=n.theme.background,e.style.color=n.theme.text,a==="fullscreen")e.style.width="100vw",e.style.height="100dvh",e.style.maxWidth="100vw",e.style.maxHeight="100dvh",e.style.margin="0",e.style.borderRadius="0";else{let r=t.mobile==="sheet"&&a==="sheet",g=t.desktopWidth,p=c?.innerWidth??1024;e.style.width=r?`${p}px`:g?`${Math.min(g.max,Math.max(p*g.viewport/100,g.min))}px`:`${R[t.size]}px`,e.style.maxWidth=`${Math.max(0,p-(a==="sheet"?0:32))}px`,e.style.maxHeight=a==="sheet"?"100dvh":"calc(100dvh - 32px)",e.style.margin=a==="sheet"?"auto auto 0":t.type==="modal"&&t.position==="top"?"16px auto auto":t.type==="modal"&&t.position==="bottom"?"auto auto 16px":"auto",e.style.borderRadius=l??(a==="sheet"?"16px 16px 0 0":"24px"),e.style.height="",x!==void 0&&E(x)}i?.(a)}},P=s?[c?.matchMedia?.(`(max-width: ${W}px)`),c?.matchMedia?.("(pointer: coarse)")].filter(r=>r!==void 0):[];if(s){c?.addEventListener("resize",f);for(let r of P)r.addEventListener?r.addEventListener("change",f):r.addListener?.(f)}return f(),{responsive:s,get type(){return a},latch(){b||u!==void 0||(f(),u=a)},setContentHeight:E,destroy(){if(!b){b=!0,o?.remove(),delete e.dataset.indianaBackdrop,c?.removeEventListener("resize",f);for(let r of P)r.removeEventListener?r.removeEventListener("change",f):r.removeListener?.(f)}}}}function we(e,n,i){let{presentation:c}=n,t="size"in c?`${Y[c.size]}px`:"100vw";return e.style.cssText=`padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;width:${t}`,G(e,n,i)}function Ee(e,n,i=!1){let c=e.ownerDocument.defaultView;if(typeof e.animate!="function"||c?.matchMedia?.("(prefers-reduced-motion: reduce)").matches)return;let t=i?{duration:300,easing:"cubic-bezier(0.23, 1, 0.32, 1)"}:{duration:240,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)"};e.animate(n==="sheet"?[{transform:"translateY(100%)"},{transform:"none"}]:n==="modal"?[{opacity:0,transform:i?"translateY(12px) scale(0.96)":"translateY(8px) scale(0.98)"},{opacity:1,transform:"none"}]:[{opacity:0},{opacity:1}],t);try{e.animate([{opacity:0},{opacity:1}],{...t,pseudoElement:"::backdrop"})}catch{}}function _(e,n){e.style.cssText=["position:absolute","z-index:1","top:calc(4px + env(safe-area-inset-top, 0px))","inset-inline-end:calc(4px + env(safe-area-inset-right, 0px))","width:44px","height:44px","padding:0","border:0","border-radius:50%","font:400 20px/1 system-ui,sans-serif","cursor:pointer","touch-action:manipulation"].join(";"),e.style.background=`radial-gradient(circle, ${n.background} 0 15px, color-mix(in srgb, ${n.text} 22%, ${n.background}) 15px 16px, transparent 16.5px)`,e.style.color=n.text}var $=new WeakMap;function Le(e,n){return $.set(e,n),()=>$.delete(e)}function F(e){let n=e.defaultView?.HTMLElement,i=e.activeElement;for(let t=0;t<16&&i?.shadowRoot?.activeElement;t++)i=i.shadowRoot.activeElement;let c=i?$.get(i)?.():void 0;return()=>{!i?.isConnected||!n||!(i instanceof n)||(i.focus({preventScroll:!0}),c?.())}}var Me=15e3;function Ce(e,n,i,c,t){let o=e.ownerDocument,d=new AbortController,l=!1,s=!1,a,u,x,b;function E(){clearTimeout(b),b=void 0,x?.(),x=void 0,a?.tagName==="DIALOG"&&a.close?.(),a?.remove(),a=void 0,u=void 0}function f(p,w){s||(s=!0,E(),(p==="dismissed"||p==="error")&&d.abort(w??new DOMException("Presentation cancelled","AbortError")),!(!l&&p!=="ready")&&A(n.onPresentationState,p==="error"?{surface:i,state:p,error:w}:{surface:i,state:p}))}let P=c,r=()=>{s||P()};return{setDismissHandler(p){P=p},get active(){return l&&!s},get cancelled(){return d.signal.aborted},getLoadingLayout(){return x?.getLayout?.()},retainPurchaseDialog(){return u?.()},start(p,w,y){if(l||s)return;l=!0;let k=()=>{if(!s&&n.loading!=="host"){let L=(w??o.documentElement.lang)||"en",T=p&&y?.presentation?.type!=="inline",S=y!==void 0,h=o.createElement(T?"dialog":"div");a=h,h.dataset.longplayLoading=i;let C=L.startsWith("zh"),z=S?C?"正在加载套餐":"Loading plans":C?"正在加载":"Loading",V=y?.screen.theme??{background:"Canvas",text:"CanvasText"};h.setAttribute("aria-label",z);let D=o.createElement("div");D.setAttribute("role","status");let M=o.createElement("div");M.setAttribute("aria-hidden","true"),S?(D.style.cssText="padding:calc(24px + env(safe-area-inset-top, 0px)) 24px 16px;padding-inline-end:68px;font:650 20px/1.3 system-ui,sans-serif;letter-spacing:-.015em",y||(D.style.paddingBlockEnd="24px")):D.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)",D.textContent=z;let v=o.createElement("button");v.type="button",v.textContent="×",v.setAttribute("aria-label",C?"取消加载":"Cancel loading"),_(v,V),S&&(v.style.borderRadius="50%",v.style.top="calc(15px + env(safe-area-inset-top, 0px))",v.style.insetInlineEnd="calc(15px + env(safe-area-inset-right, 0px))"),v.addEventListener("click",r);let O=m=>{m.preventDefault(),r()};h.addEventListener("cancel",O);let I=o.createElement("style");I.textContent="[data-longplay-loading] > button:focus-visible{outline:2px solid currentColor;outline-offset:-2px}",h.append(D,M,v,I),e.append(h);let H=()=>{if(!s&&T){let m=h,N=F(o);m.showModal?m.showModal():m.open=!0,v.focus({preventScroll:!0}),u=()=>{if(!m.open||!m.isConnected)return;let B=x;return x=void 0,a=void 0,u=void 0,delete m.dataset.longplayLoading,m.removeAttribute("aria-label"),m.style.padding="0",m.removeEventListener("cancel",O),D.remove(),M.remove(),v.remove(),I.remove(),{dialog:m,release(){B?.(),m.close?.(),m.remove(),N()}}}}};y&&t?(x=t(h,M,y,L),H()):S?(h.style.cssText=T?"padding:0;border:0;border-radius:24px;background:Canvas;color:CanvasText;width:min(420px,calc(100vw - 32px))":"position:relative;background:Canvas;color:CanvasText;width:100%",H()):(q(h,M,T,i),H())}};y!==void 0&&n.loading!=="host"?b=setTimeout(k,120):k(),A(n.onPresentationState,{surface:i,state:"loading",dismiss:r})},present(p){if(s)return;let w=!!a;E(),p(w),f("ready")},dismiss:r,finish:f,async wait(p,w){let y=d.signal,k,L,T=new Promise((S,h)=>{L=()=>h(y.reason),y.aborted?L():y.addEventListener("abort",L,{once:!0}),w!==void 0&&(k=setTimeout(()=>h(new Error("Presentation data timed out")),w))});try{let S=await Promise.race([T,p]);return y.throwIfAborted(),S}finally{y.removeEventListener("abort",L),clearTimeout(k)}}}}function q(e,n,i,c){e.style.cssText="position:relative;box-sizing:border-box;background:Canvas;color:CanvasText;padding:24px 48px 24px 24px;"+(i?"position:fixed;width:min(480px,calc(100% - 32px));border:0;border-radius:16px;max-height:calc(100dvh - 32px)":"width:100%"),n.style.cssText="display:grid;gap:12px";let t=c==="banner"?[["72%",12],["44%",10]]:[["46%",20],["84%",12],["65%",12],["100%",64]];for(let[o,d]of t){let l=e.ownerDocument.createElement("div");l.style.cssText=`width:${o};height:${d}px;background:currentColor;opacity:.11;border-radius:6px`,n.append(l)}}function j(e){let n={display:"block",position:"fixed",top:"0",left:"0",opacity:"0",pointerEvents:"none",zIndex:"-1"},i=Object.keys(n).map(o=>{let d=o,l=e.style[d];return e.style[d]=n[d],[d,l]}),c=e.inert??!1,t=e.getAttribute("aria-hidden");return e.inert=!0,e.setAttribute("aria-hidden","true"),()=>{for(let[o,d]of i)e.style[o]=d;e.inert=c,t===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t)}}function He(e,n){let i=e.style.width;e.style.width=`${n.getBoundingClientRect().width||n.ownerDocument.defaultView?.innerWidth||800}px`;let c=j(e);return()=>{c(),e.style.width=i}}export{ge as a,U as b,G as c,we as d,Ee as e,_ as f,Le as g,F as h,Me as i,Ce as j,j as k,He as l};
@@ -1 +0,0 @@
1
- import{b as Ae}from"./chunk-7Q25R5GL.js";import{a as B}from"./chunk-USM6HOXG.js";import{D as Q,F as Ue,c as Oe,e as H,j as _e,u as Fe,v as Ne,x as je,z as Te}from"./chunk-XO6GV6O7.js";import{a as Ee,b as Re,c as be}from"./chunk-K644WUOE.js";import{K as V}from"./chunk-7UXQJJFZ.js";import{a as re}from"./chunk-UCDQJB53.js";import{i as oe}from"./chunk-RUMGXXVJ.js";import{A as te,B as ve,C as ne,E as Ce}from"./chunk-TSBXPDUQ.js";import{x as me}from"./chunk-KVIGHX2B.js";import{b as ke}from"./chunk-7LHRBNSH.js";import{a as l}from"./chunk-BYHBBZIO.js";import{h as ee}from"./chunk-LDLS2VL2.js";import{b as qe}from"./chunk-VGEH7B6S.js";import{b as n}from"./chunk-PY3AC5KD.js";import{a as fe}from"./chunk-DSPLGTQI.js";var g=V.options,$e=n.discriminatedUnion("operation",[g[1].omit({customerToken:!0}),g[2].omit({customerToken:!0}),g[3].omit({customerToken:!0}),g[4].omit({customerToken:!0}),g[5].omit({customerToken:!0}),g[6].omit({customerToken:!0}),g[7].omit({customerToken:!0}),g[8].omit({customerToken:!0}),_e.omit({customerToken:!0})]),he=n.strictObject({receiptId:n.uuid(),operationId:n.uuid()}),it=n.discriminatedUnion("operation",[n.strictObject({operation:n.literal("find_purchase")}),n.strictObject({operation:n.literal("recover_start"),intent:n.enum(["lookup","resume","start"]),start:n.strictObject({requestId:g[0].shape.requestId,funnelId:g[0].shape.funnelId,locale:g[0].shape.locale,parameters:g[0].shape.parameters})}),n.strictObject({operation:n.literal("recover_run"),runId:n.uuid(),funnelId:n.uuid()}),n.strictObject({operation:n.literal("recover_purchase"),runId:n.uuid(),funnelId:n.uuid(),purchase:he,includePaywallVersion:n.literal(!0).optional()}),n.strictObject({operation:n.literal("terminate_checkout"),runId:n.uuid(),funnelId:n.uuid(),purchase:he}),n.strictObject({operation:n.literal("settle_command"),runId:n.uuid(),funnelId:n.uuid(),requestId:n.uuid(),command:n.discriminatedUnion("operation",[g[3].omit({customerToken:!0}),g[4].omit({customerToken:!0}),g[5].omit({customerToken:!0}),g[6].omit({customerToken:!0}),g[7].omit({customerToken:!0})]).optional()}).refine(a=>!a.command||a.requestId===a.command.requestId),n.strictObject({operation:n.literal("run_command"),runId:n.uuid(),funnelId:n.uuid(),command:$e})]),ae=n.strictObject({runId:n.uuid(),funnelId:n.uuid(),versionId:n.uuid(),startRequestId:n.uuid(),runExpiresAt:n.iso.datetime({offset:!0}),status:H.shape.run.shape.status}),U={scope:ee,customerId:n.uuid()},xe=n.discriminatedUnion("outcome",[n.strictObject({...U,outcome:n.literal("unknown"),target:n.null(),view:n.null(),access:n.null()}),n.strictObject({...U,outcome:n.literal("resolved"),target:ae,view:H.shape.run.nullable(),access:n.discriminatedUnion("type",[n.strictObject({type:n.literal("customer")}),n.strictObject({type:n.literal("operation_only"),cause:n.enum(["run_terminal","run_expired","run_revoked","issuer_unavailable"])})])})]).superRefine((a,d)=>{a.outcome==="resolved"&&(a.access.type==="customer"!=(a.view!==null)||a.view&&(a.view.id!==a.target.runId||a.view.source.id!==a.target.funnelId||a.view.source.versionId!==a.target.versionId||a.view.status!==a.target.status||a.view.runExpiresAt!==a.target.runExpiresAt||a.view.credentialExpiresAt!==null))&&d.addIssue({code:"custom",message:"Recovery view and original Run binding differ"})}),De=n.strictObject({...U,target:ae,view:H.shape.run.nullable(),settlement:n.strictObject({requestId:n.uuid(),state:n.enum(["pending","unknown","settled"]),acceptance:n.enum(["accepted","not_accepted","unknown"]),receiptPhase:n.enum(["accepted","processing","done"]).nullable(),basis:n.enum(["receipt","run_terminal","position_advanced","none"]),receiptId:n.uuid().nullable(),operationId:n.uuid().nullable()}),purchase:H.shape.purchase.unwrap().nullable()}).superRefine((a,d)=>{let f=a.settlement;(f.acceptance==="accepted"!=(f.receiptPhase!==null)||f.acceptance==="accepted"&&f.basis!=="receipt"||f.acceptance==="unknown"&&(f.state!=="unknown"||f.basis!=="none")||f.acceptance!=="accepted"&&(f.operationId!==null||f.receiptId!==null)||f.acceptance==="not_accepted"&&(f.state!=="settled"||!["run_terminal","position_advanced"].includes(f.basis))||a.purchase&&(a.purchase.receiptId!==f.receiptId||a.purchase.operation&&a.purchase.operation.operationId!==f.operationId||a.purchase.quote&&a.purchase.quote.operationId!==f.operationId)||a.view&&(a.view.id!==a.target.runId||a.view.source.id!==a.target.funnelId||a.view.source.versionId!==a.target.versionId||a.view.status!==a.target.status||a.view.runExpiresAt!==a.target.runExpiresAt||a.view.credentialExpiresAt!==null))&&d.addIssue({code:"custom",message:"Original command settlement binding differs"})}),Ve=n.strictObject({...U,target:ae,purchase:H.shape.purchase.unwrap(),paywallVersionId:n.uuid().optional()}).superRefine((a,d)=>{(!a.purchase.operation||typeof a.purchase.canReselect!="boolean"||a.purchase.quote&&a.purchase.quote.operationId!==a.purchase.operation.operationId)&&d.addIssue({code:"custom",message:"Original purchase proof is incomplete"})}),He=n.discriminatedUnion("outcome",[n.strictObject({...U,outcome:n.literal("none")}),n.strictObject({...U,outcome:n.literal("blocked")}),n.strictObject({...U,outcome:n.literal("found"),target:ae,start:n.strictObject({locale:g[0].shape.locale,parameters:g[0].shape.parameters}),purchase:he})]);var We=V.options[0].refine(a=>!a.customer&&!a.customerData),Xe=n.strictObject({receiptId:n.uuid(),operationId:n.uuid(),terminal:n.enum(["complete","native"]).nullable()}),Le=n.strictObject({schemaVersion:n.literal(1),baseUrl:n.url(),scope:ee,customerId:n.uuid(),sessionId:n.uuid(),start:We,allowed:n.array(n.enum(["merchant","record_only","indiana","native"])),run:n.strictObject({id:n.uuid(),versionId:n.uuid(),status:Oe.shape.status,revision:n.number().int().nonnegative(),runExpiresAt:n.iso.datetime({offset:!0}).optional()}).optional(),purchases:n.array(Xe).max(100),operationCommand:n.strictObject({operationId:n.uuid(),intent:n.literal("confirm")}).optional(),journal:n.strictObject({revision:n.number().int().nonnegative(),entry:Fe.nullable()})});function Ge(a){return je({...a,namespace:"purchases",identity:[a.scope.projectId,a.scope.environment,a.customerId]})}function Me(a){let d=new URL(a.baseUrl??qe).href,f=()=>new l("PURCHASE_STORAGE_INVALID","Purchase recovery storage is unavailable or invalid; native fallback is not authorized");async function v(){a.assertCurrent();try{let C=await a.storage.read();if(a.assertCurrent(),!Number.isSafeInteger(C.revision)||C.revision<0)throw f();let u=C.entry===null?null:Le.parse(C.entry);if(u&&(u.baseUrl!==d||u.customerId!==a.customerId||u.scope.projectId!==a.scope.projectId||u.scope.environment!==a.scope.environment))throw new l("SCOPE_MISMATCH","Purchase recovery belongs to another Customer or environment");if(u?.journal.entry&&(u.journal.entry.scope.projectId!==u.scope.projectId||u.journal.entry.scope.environment!==u.scope.environment||u.journal.entry.funnelId!==u.start.funnelId||u.journal.entry.runId!==u.run?.id||u.journal.entry.versionId!==u.run?.versionId)||u?.operationCommand&&!u.purchases.some(b=>b.operationId===u.operationCommand?.operationId))throw f();return{revision:C.revision,entry:u}}catch(C){throw C instanceof l?C:f()}}async function Y(C){for(let u=0;u<8;u++){let b=await v(),A=C(structuredClone(b.entry));if(JSON.stringify(A)===JSON.stringify(b.entry))return A;A&&Le.parse(A),a.assertCurrent();let E;try{E=await a.storage.write(b.revision,A)}catch{throw f()}if(a.assertCurrent(),E!==null){if(!Number.isSafeInteger(E)||E<=b.revision)throw f();return A}}throw new l("PURCHASE_STORAGE_CONFLICT","Another consumer changed this purchase; recover the original attempt")}return{read:v,update:Y,baseUrl:d}}var Ze=5*6e4;function et(a,d){let f=a.purchases.find(v=>v.type==="checkout");if(!a.actions.includes("continue_checkout")||f?.type!=="checkout"||d!==void 0&&f.operationId!==d)throw new l("PURCHASE_PENDING","No single resumable Checkout is confirmed");return f.checkoutUrl}function Nt(a){let d={...a,scope:{...a.scope},executionPolicy:structuredClone(a.executionPolicy)},f=d.session.snapshot();if(!f)throw new l("CUSTOMER_SESSION_REQUIRED","Purchase recovery requires a verified Customer session");let{customerId:v,sessionId:Y}=f,C=!1,u=null,b,A=null,E=!1,N,J,K,O={mode:"idle",status:"idle",actions:["start"],purchases:[]},P=new Map,Ie=new Map,T=new Map,ie=new AbortController,$=new Set,L=ke(d),W=Ae(L.request);function G(e){return{code:e instanceof l?e.code:"PURCHASE_RECOVERY_BLOCKED",message:e instanceof Error?e.message:"The original purchase requires server confirmation",...e instanceof l&&e.status!==void 0?{status:e.status}:{}}}function y(){if(C||d.session.snapshot()?.customerId!==v)throw new l("IDENTITY_CHANGED","The original purchase Customer changed")}let I=Me({...d,customerId:v,assertCurrent:y,storage:d.storage??Ge({baseUrl:d.baseUrl,scope:d.scope,customerId:v})}),ze=d.session.subscribeIdentity(we);function we(){C||(C=!0,clearTimeout(K),ie.abort(new l("IDENTITY_CHANGED","Purchase consumer was destroyed")),ze(),u?.reset(),u=null,A=null,L.dispose(),$.clear(),P.clear(),T.clear())}function S(e){y();let t=JSON.stringify(e)!==JSON.stringify(O);O=e,clearTimeout(K),(e.mode==="operation"||e.mode==="run"&&!e.actions.includes("close"))&&["waiting_result","fulfillment","recording"].includes(e.status)&&(K=setTimeout(()=>{D().catch(()=>{})},5e3)),t&&fe(d.onRecovery,structuredClone(e));for(let r of t?$:[]){if(C)break;fe(r,structuredClone(e))}return structuredClone(e)}function w(e){if(y(),!e||e.start.requestId!==b)throw new l("PURCHASE_STORAGE_CONFLICT","This purchase was superseded; the old consumer cannot dispatch")}function _(e){let t=[...e.purchases],r=e.journal.entry?.purchase;return r&&!t.some(o=>o.operationId===r.operationId)&&t.push({receiptId:r.receiptId,operationId:r.operationId,terminal:null}),t}function j(e){return e.run&&!["running","waiting"].includes(e.run.status)&&!e.journal.entry?.command&&!e.journal.entry?.closeCommand&&!e.operationCommand&&_(e).every(t=>t.terminal!==null)}function k(e,t){let r=e.journal.entry?.command??e.journal.entry?.closeCommand,o=_(e).map(h=>{let R=P.get(h.operationId);return h.terminal&&!R?{type:h.terminal,operationId:h.operationId}:re({quote:R?.quote??null,operation:R??null,requestId:r?.requestId??null,pending:!1,destroyed:!1,canReselect:T.get(h.operationId)===!0})}),s=o.filter(h=>!["complete","native"].includes(h.type)),i=s[0],c=s.length===1&&i?.operationId?P.get(i.operationId):void 0;if(c&&(i?.type==="checkout"||i?.type==="cancel"))try{Q({allowed:e.allowed.filter(h=>d.executionPolicy.allowed.includes(h))},c.quote)}catch(h){return{mode:t,status:"blocked",actions:["refresh",...t==="run"&&e.run&&["running","waiting"].includes(e.run.status)?["close"]:[]],purchases:o,error:G(h)}}let m;if(t==="operation"&&!r&&i?.type==="cancel"&&c?.quote&&!c.problem&&!c.confirmedAt)try{Q({allowed:e.allowed.filter(h=>d.executionPolicy.allowed.includes(h))},c.quote),Date.parse(c.quote.expiresAt)>Date.now()&&(m={operationId:c.operationId,quote:c.quote})}catch{}let p=o.length>0&&s.length===0,q=j(e)||t==="operation"&&p&&!r&&!e.operationCommand?"complete":i?.type==="checkout"?"checkout":i?.type==="fulfillment"?"fulfillment":i?.type==="recording"?"recording":r||e.operationCommand||i&&i.type!=="cancel"||t==="operation"&&!m?"waiting_result":"ready";return{mode:t,status:q,purchases:o,...m?{confirmation:structuredClone(m)}:{},actions:["refresh",...j(e)?["start"]:[],...t==="run"&&e.run&&["running","waiting"].includes(e.run.status)?["close"]:[],...e.operationCommand?["retry"]:m?["confirm"]:[],...s.length===1&&i?.type==="checkout"?["continue_checkout"]:[]]}}function se(e){let t=re({quote:e?.quote??null,operation:e??null,requestId:null,pending:!1,destroyed:!1,canReselect:e&&T.get(e.operationId)===!0});return t.type==="complete"||t.type==="native"?t.type:null}function ue(e){if(!e.operation)return;let t=te.parse({...e.operation,...e.operation.quote?{}:e.quote?{quote:e.quote}:{}});if(t.merchantExecution&&t.merchantExecution.customerId!==v)throw new l("SCOPE_MISMATCH","Purchase execution belongs to another Customer");let r=oe(P.get(t.operationId)??null,t);P.set(t.operationId,r),r===t&&T.set(t.operationId,e.canReselect===!0)}async function Qe(e){y();for(let r of[e.purchase,e.run.paywall])r&&ue(r);let t=await I.update(r=>{if(w(r),r.run&&(r.run.id!==e.run.id||r.run.versionId!==e.run.source.versionId))throw new l("SCOPE_MISMATCH","The original purchase Run changed");let o=_(r);for(let s of[e.purchase,e.run.paywall]){let i=s?.operation?.operationId??s?.quote?.operationId;if(!s||!i)continue;let c=o.find(p=>p.operationId===i);if(c&&c.receiptId!==s.receiptId)throw new l("INVALID_RESPONSE","The original purchase Receipt changed");let m=se(P.get(i));c?c.terminal??=m:o.push({receiptId:s.receiptId,operationId:i,terminal:m})}return{...r,purchases:o,run:r.run&&(r.run.revision>e.run.revision||!["running","waiting"].includes(r.run.status)&&["running","waiting"].includes(e.run.status))?r.run:{id:e.run.id,versionId:e.run.source.versionId,status:e.run.status,revision:e.run.revision,runExpiresAt:e.run.runExpiresAt}}});w(t),t.run&&!["running","waiting"].includes(t.run.status)&&_(t).some(r=>!r.terminal)&&(t=await x(t,!t.journal.entry?.command&&!t.journal.entry?.closeCommand,new Set([e.purchase?.operation?.operationId,e.run.paywall?.operation?.operationId].filter(r=>!!r)))),w(t),S(k(t,"run"))}function Be(){return{async read(){let{entry:e}=await I.read();return w(e),structuredClone(e.journal)},async write(e,t){let r=null;return await I.update(o=>{if(w(o),o.operationCommand&&t?.command&&t.command.operation!=="close")throw new l("PURCHASE_PENDING","Recover the original Operation command before dispatching a Run mutation");return r=null,o.journal.revision!==e?o:(r=e+1,{...o,journal:{revision:r,entry:t}})}),r}}}async function x(e,t=!1,r=new Set){w(e);let o=_(e);for(let i of o){if(i.terminal)continue;let c=r.has(i.operationId)?P.get(i.operationId):void 0;if(c??=await z(e,i),y(),c.operationId!==i.operationId)throw new l("INVALID_RESPONSE","Original Operation changed");if(c.merchantExecution&&c.merchantExecution.customerId!==v)throw new l("SCOPE_MISMATCH","Purchase execution belongs to another Customer");if(t&&!e.operationCommand&&re({quote:c.quote??null,operation:c,requestId:null,pending:!1,destroyed:!1}).type==="cancel"){let m=ne(c)?await W.update({operationId:i.operationId,intent:"cancel"}):await W.attach({operationId:i.operationId,intent:"cancel"});if(c=te.parse(m.operation),y(),c.operationId!==i.operationId)throw new l("INVALID_RESPONSE","Original cancellation Operation changed");c=await z(e,i)}P.set(i.operationId,oe(P.get(i.operationId)??null,c))}let s=await I.update(i=>{w(i);let c=i.operationCommand&&P.get(i.operationCommand.operationId);return{...i,...c&&(c.confirmedAt||c.merchantExecution||!Ce(c))?{operationCommand:void 0}:{},purchases:_(i).map(m=>({...m,terminal:m.terminal??se(P.get(m.operationId))}))}});return w(s),s}async function M(e){y();let t=await L.request("funnels",e);return y(),t}async function Ye(e){try{return await M(e)}catch(t){if(e.operation!=="recover_start"||e.intent!=="start"||!(t instanceof l)||t.status!==400||t.code!=="INVALID_REQUEST")throw t;return M({...e,intent:"resume"})}}async function Je(){let e=B(He,await M({operation:"find_purchase"}));if(e.customerId!==v||e.scope.projectId!==d.scope.projectId||e.scope.environment!==d.scope.environment)throw new l("SCOPE_MISMATCH","Recovery Customer or environment changed");if(e.outcome!=="found")return e.outcome;let{target:t,purchase:r}=e;return await I.update(o=>o&&!j(o)?o:{schemaVersion:1,baseUrl:I.baseUrl,scope:d.scope,customerId:v,sessionId:Y,start:{operation:"start",requestId:t.startRequestId,funnelId:t.funnelId,...e.start},allowed:[...d.executionPolicy.allowed],run:{id:t.runId,versionId:t.versionId,status:t.status,revision:0,runExpiresAt:t.runExpiresAt},purchases:[{...r,terminal:null}],journal:{revision:0,entry:null}}),"found"}let X;function ce(e){let t=X;if(t&&(!t.outcome||e&&t.outcome==="none"&&Date.now()-t.at<Ze))return t.job;let r={at:Date.now(),job:Je().then(o=>(r.outcome=o,r.at=Date.now(),o),o=>{throw X===r&&(X=void 0),o})};return X=r,r.job}async function z(e,t,r="recover_purchase",o=!1){let s=B(Ve,await M({operation:r,runId:e.run.id,funnelId:e.start.funnelId,purchase:{receiptId:t.receiptId,operationId:t.operationId},...o?{includePaywallVersion:!0}:{}}));if(le(e,s),s.purchase.receiptId!==t.receiptId||s.purchase.operation?.operationId!==t.operationId)throw new l("INVALID_RESPONSE","Original purchase reference changed");return ue(s.purchase),o&&s.paywallVersionId&&Ie.set(t.operationId,s.paywallVersionId),P.get(t.operationId)}async function ye(e){for(let t of[e.journal.entry?.command,e.journal.entry?.closeCommand]){if(!t)continue;let r=B(De,await M({operation:"settle_command",runId:e.run.id,funnelId:e.start.funnelId,requestId:t.requestId,...t.operation==="resume"?{}:{command:t}}));if(le(e,r),r.settlement.requestId!==t.requestId)throw new l("INVALID_RESPONSE","Original command settlement changed");r.purchase&&ue(r.purchase);let o=await I.update(s=>{w(s);let i=_(s),{receiptId:c,operationId:m}=r.settlement;if(c&&m){let q=i.find(h=>h.operationId===m);if(q&&q.receiptId!==c)throw new l("INVALID_RESPONSE","Original Receipt changed");q||i.push({receiptId:c,operationId:m,terminal:se(P.get(m))})}let p=r.settlement.state==="settled"?Ne(s.journal.entry,t.requestId):s.journal.entry;return{...s,purchases:i,journal:p===s.journal.entry?s.journal:{revision:s.journal.revision+1,entry:p}}});w(o),e=o}return e}function le(e,t){if(t.customerId!==v||t.scope.projectId!==d.scope.projectId||t.scope.environment!==d.scope.environment||t.target.funnelId!==e.start.funnelId||t.target.startRequestId!==e.start.requestId||e.run&&(t.target.runId!==e.run.id||t.target.versionId!==e.run.versionId))throw new l("SCOPE_MISMATCH","The original recovery binding changed")}async function de(e,t){if(w(e),e.run&&(e=await ye(e)),!_(e).length&&j(e))return S(k(e,"operation"));if(!_(e).length)return S({mode:"blocked",status:"blocked",actions:["refresh"],purchases:[],error:G(t)});E=!0;let r=await x(e);return S(k(r,"operation"))}async function Z(e,t=!1,r=!0){if(b=e.start.requestId,A=structuredClone({requestId:e.start.requestId,funnelId:e.start.funnelId,locale:e.start.locale,parameters:e.start.parameters}),!u){let o=e.run?{operation:"recover_run",runId:e.run.id,funnelId:e.start.funnelId}:{operation:"recover_start",intent:t?"start":"lookup",start:{requestId:e.start.requestId,funnelId:e.start.funnelId,locale:e.start.locale,parameters:e.start.parameters}},s;try{s=await Ye(o)}catch(p){if(!e.run&&p instanceof l&&(p.status===void 0||p.status>=500))return S({mode:"blocked",status:"blocked",actions:["refresh","retry"],purchases:O.purchases,error:G(p)});throw p}let i=B(xe,s);if(i.customerId!==v||i.scope.projectId!==d.scope.projectId||i.scope.environment!==d.scope.environment)throw new l("SCOPE_MISMATCH","Recovery Customer or environment changed");if(i.outcome==="unknown")return S({mode:"blocked",status:"blocked",actions:["refresh","retry"],purchases:O.purchases,error:{code:"RESULT_UNKNOWN",message:"The original Start outcome remains unknown; retry only its original input"}});le(e,i);let c=await I.update(p=>(w(p),{...p,run:{id:i.target.runId,versionId:i.target.versionId,status:i.target.status,revision:i.view?.revision??p.run?.revision??0,runExpiresAt:i.target.runExpiresAt}}));if(w(c),e=c,i.access.type==="operation_only")return de(e,new l("RUN_RECONCILIATION_REQUIRED","Only the original command and Operation can be recovered"));e=await ye(e);let m=i.view;if(m.locale!==e.start.locale||!Te(m.parameters,e.start.parameters))throw new l("INVALID_RESPONSE","The original Start input changed");u=Ue({...d,customerRun:{runId:i.target.runId,customerId:v,startRequestId:e.start.requestId},funnelId:e.start.funnelId,funnelExecutionPolicy:{allowed:e.allowed.filter(p=>d.executionPolicy.allowed.includes(p))},funnelCommandStorage:Be(),onAcceptedResponse:Qe},{scope:i.scope,run:m})}try{await u.get(),u.view?.pendingRequest?.requestId===e.start.requestId&&!u.pendingCommands?.length&&await u.resume(u.view.pendingRequest.requestId);for(let s of u.pendingCommands??[])s.operation!=="close"&&await u.settle?.(s.requestId);u.pendingCommands?.length&&await u.retry(),y();let o=(await I.read()).entry;return w(o),S(k(o,"run"))}catch(o){if(y(),r&&o instanceof l&&(o.status===401||o.status===409&&o.reason==="STATE_CHANGED")){u.reset(),u=null;let s=(await I.read()).entry;return w(s),Z(s,!1,!1)}throw o}}function F(e,t="read",r){if(y(),N)return t==="read"||t===J?N:N.then(()=>F(e,t,r),()=>F(e,t,r));clearTimeout(K);let o=e().catch(s=>{throw!C&&!r?.(s)&&S({mode:"blocked",status:"blocked",actions:["refresh"],purchases:O.purchases,error:G(s)}),s});return N=o,J=t,o.then(()=>{N===o&&(N=void 0,J=void 0)},()=>{N===o&&(N=void 0,J=void 0)}),o}function D(){return F(async()=>{let{entry:e}=await I.read();if(!e||j(e)){if(await ce(!1)==="blocked")return ge();({entry:e}=await I.read())}return e?(b&&e.start.requestId!==b&&(u?.reset(),u=null,P.clear(),T.clear(),E=!1),E&&b===e.start.requestId?de(e,O.error):Z(e)):S({mode:"idle",status:"idle",actions:["start"],purchases:[]})})}function ge(){return S({mode:"blocked",status:"blocked",actions:["refresh"],purchases:[],error:G(new l("PURCHASE_PENDING","Check the outstanding purchases before starting another"))})}async function Pe(){let e=await D();return e.mode==="operation"&&!e.actions.includes("confirm")&&!e.actions.includes("retry")?e:F(async()=>{let t=(await I.read()).entry;if(w(t),!E){if(!u?.view?.paywall?.quote)throw new l("PURCHASE_PENDING","Read the original quote before confirming");let p=u.view.paywall.operation;if(p?.confirmedAt||p?.merchantExecution||p&&!(ne(p)?["prepared","quoted"].includes(p.status):p.status==="pending"))return S(k(t,"run"));if(u.pendingCommands?.length)await u.retry();else{let h=u.view;await u.submit({operation:"submit",requestId:crypto.randomUUID(),nodeId:h.nodeId,visit:h.visit,revision:h.revision,input:{type:"paywall_confirm",operationId:h.paywall.quote.operationId,...h.paywall.quote.merchantTerms?{merchantConfirmation:me(h.paywall.quote.merchantTerms)}:{}}})}let q=(await I.read()).entry;return w(q),S(k(q,"run"))}let r=t.operationCommand?.operationId??O.confirmation?.operationId,o=r&&P.get(r);if(!r||!o||t.journal.entry?.command||t.journal.entry?.closeCommand)throw new l("PURCHASE_PENDING","The original Run command must be settled before Operation confirmation");Q({allowed:t.allowed.filter(p=>d.executionPolicy.allowed.includes(p))},o.quote),await I.update(p=>{if(w(p),p.journal.entry?.command||p.journal.entry?.closeCommand||p.operationCommand&&p.operationCommand.operationId!==r)throw new l("PURCHASE_PENDING","Another original command is pending");return{...p,operationCommand:{operationId:r,intent:"confirm"}}});let s={operationId:r,intent:"confirm",...o.quote?.merchantTerms?{merchantConfirmation:me(o.quote.merchantTerms)}:{}},i=ne(o)?await W.update(s):await W.attach(s),c=te.parse(i.operation);if(y(),i.operation.operationId!==r)throw new l("INVALID_RESPONSE","Original confirmation Operation changed");P.set(r,oe(o,c));let m=(await I.read()).entry;return w(m),S(k(await x(m,!1,new Set([r])),"operation"))},"confirm")}function Ke(e){let t=e?.quote;return t&&ve(t)&&t.timing==="immediate"&&t.execution.provider==="merchant"&&(e.confirmedAt||e.merchantExecution)?t:null}function pe(){if(O.mode!=="operation"||O.status==="blocked")return null;let e=O.purchases.filter(({type:r})=>r!=="complete"&&r!=="native"),t=e.length===1&&e[0]?.operationId;return t?Ke(P.get(t)):null}async function Se(){y();let{entry:e}=await I.read();return e?j(e)?"finished":"pending":"none"}return{get controller(){return u},get recovery(){return structuredClone(O)},get attempt(){return y(),structuredClone(A)},get identitySignal(){return ie.signal},get customerId(){return v},retained:Se,async findPurchase(){let e=await Se();if(e==="pending")return e;let t=await ce(!0);return y(),t==="none"?e:t},async readPaywall(e){y();let t=Ee(e),[r,{readPaywallContent:o},{validateResourceCheck:s}]=await Promise.all([Re(L.request,"resolvePaywall"),import("./paywall-content-7KTEQLRN.js"),import("./check-response-AVQ7PY5I.js")]);y();let i=r.request.parse({selector:t.paywallVersionId?{type:"version",versionId:t.paywallVersionId}:{type:"paywall",paywallId:t.paywallId},commerce:t.commerce,locale:t.locale}),c=await be(L.request,r,i);s(i,c.paywall.check,c.scope);let m=await o(d,c.paywall);if(y(),t.paywallVersionId?m.id!==t.paywallVersionId:m.paywallId!==t.paywallId)throw new l("INVALID_RESPONSE","The requested Paywall changed");return m},get canRestoreUpgradePaywall(){return pe()!==null},async recoverUpgradePaywall(){let e=pe();if(!e)return null;let{entry:t}=await I.read();if(!t?.run||pe()?.operationId!==e.operationId)return null;let r=_(t).filter(R=>!R.terminal),o=r[0];if(r.length!==1||o?.operationId!==e.operationId)return null;let s;Q({allowed:t.allowed.filter(R=>d.executionPolicy.allowed.includes(R))},e);try{s=await z(t,o,"recover_purchase",!0)}catch(R){if(R instanceof l&&R.status===400&&R.code==="INVALID_REQUEST")return null;throw R}let i=Ie.get(o.operationId),c=t.start.parameters?.commerce;if(!i||typeof c!="object"||!c||!("provider"in c)||typeof c.provider!="string"||!("currency"in c)||typeof c.currency!="string")return null;let m=t.start.locale??"en",p=await this.readPaywall({paywallVersionId:i,locale:m,commerce:{provider:c.provider,currency:c.currency,intent:"subscription_change"}});y();let q=!1,h=async()=>{throw new l("PURCHASE_PENDING","Only the original upgrade can be recovered")};return{signal:ie.signal,view:p,quote:e,locale:m,get operation(){return s??null},get canReselect(){return T.get(o.operationId)===!0},async refresh(){return p},preview:h,confirm:h,cancel:h,async read(){if(q)throw new DOMException("Upgrade view closed","AbortError");s=await z(t,o);let R=await x(t,!1,new Set([o.operationId]));return q||S(k(R,"operation")),structuredClone(s)},destroy(){q=!0}}},start(e){let t=V.parse({...structuredClone(e),operation:"start",requestId:e.requestId??crypto.randomUUID()});if(t.operation!=="start"||t.customer||t.customerData)throw new l("INVALID_REQUEST","A Customer-owned Funnel start is required");return F(async()=>{let r=(await I.read()).entry;if((!r||j(r))&&await ce(!0)==="blocked")return ge();let o=await I.update(s=>{if(s&&!j(s)){if(s.start.funnelId!==t.funnelId)throw new l("PURCHASE_PENDING","Recover the original Funnel before starting another purchase");return s}return{schemaVersion:1,baseUrl:I.baseUrl,scope:d.scope,customerId:v,sessionId:Y,start:t,allowed:[...d.executionPolicy.allowed],purchases:[],journal:{revision:0,entry:null}}});if(!o)throw new l("PURCHASE_STORAGE_INVALID","Original start was not retained");return b!==o.start.requestId&&(u?.reset(),u=null,P.clear(),T.clear(),E=!1),E?de(o,O.error):Z(o,!0)},`start:${t.funnelId}`)},refresh:D,confirm:Pe,retry:()=>E?Pe():F(async()=>{let{entry:e}=await I.read();return e?Z(e,!0):S({mode:"idle",status:"idle",actions:["start"],purchases:[]})},"retry"),async close(){return u?.view?F(async()=>{if(!u?.view)throw new l("PURCHASE_PENDING","Recover the original Run before closing");if(u.pendingCommands?.find(r=>r.operation==="close"))await u.retry();else if(["running","waiting"].includes(u.view.status)){let r=u.view;await u.submit({operation:"close",requestId:crypto.randomUUID(),nodeId:r.nodeId,visit:r.visit,revision:r.revision})}let t=(await I.read()).entry;return w(t),S(k(t,"run"))},"close"):D()},async continueCheckout(e,t){let r=t?await F(async()=>{let{entry:o}=await I.read();if(w(o),!o.run||!_(o).some(i=>i.operationId===t&&!i.terminal))throw new l("PURCHASE_PENDING","The original Checkout changed");let s=await x(o);return S(k(s,E?"operation":"run"))},`continue:${t}`,o=>o instanceof l&&o.code==="PURCHASE_PENDING"):await D();y(),await e(et(r,t))},async terminateCheckout(e){let t=await D();if(!t.purchases.find(o=>o.type==="checkout"&&o.operationId===e)||!t.actions.includes("continue_checkout"))throw new l("PURCHASE_PENDING","The original Checkout has changed");return F(async()=>{let{entry:o}=await I.read();w(o);let s=_(o).find(c=>c.operationId===e&&!c.terminal);if(!s||!o.run)throw new l("PURCHASE_PENDING","The original Checkout has changed");await z(o,s,"terminate_checkout");let i=await x(o,!1,new Set([e]));return S(k(i,E?"operation":"run"))},`terminate:${e}`,o=>o instanceof l&&["CAPABILITY_UNAVAILABLE","NOT_CONFIGURED"].includes(o.code))},subscribe(e){return $.add(e),()=>{$.delete(e)}},destroy:we}}export{Ge as a,et as b,Nt as c};
@@ -1 +0,0 @@
1
- import{b as ae}from"./chunk-EJAF6OGO.js";import{b as Q}from"./chunk-OEUA65JK.js";import"./chunk-AFZB2AYU.js";import"./chunk-YGOXUDDF.js";import{a as ne}from"./chunk-QIY6PCYC.js";import{a as K}from"./chunk-4CRUNNTC.js";import{b as ee}from"./chunk-ZY4YDPSI.js";import"./chunk-4OSW2Y67.js";import"./chunk-W32FI2A2.js";import{f as te,h as re,i as z,j as J}from"./chunk-ZNOVEJLM.js";import"./chunk-7Q25R5GL.js";import"./chunk-USM6HOXG.js";import"./chunk-XO6GV6O7.js";import"./chunk-I643NVMZ.js";import"./chunk-K644WUOE.js";import"./chunk-AN7CPDBU.js";import"./chunk-PGZZKX5K.js";import"./chunk-CJUVMNDB.js";import"./chunk-7UXQJJFZ.js";import"./chunk-3LWZFXLN.js";import"./chunk-2MDJ3JE5.js";import"./chunk-UCDQJB53.js";import"./chunk-RUMGXXVJ.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-7LHRBNSH.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import{a as T}from"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-SLUA7ABW.js";import"./chunk-FKC7TJWM.js";import"./chunk-3VUPVXAV.js";import"./chunk-VGEH7B6S.js";import"./chunk-PY3AC5KD.js";import{a as g}from"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";function ie(x,e){let s=x.ownerDocument,b=(e.locale??s.documentElement.lang).startsWith("zh"),G=re(s),m=e.retained?.dialog??s.createElement("dialog"),I=s.createElement("section"),w=s.createElement("h2"),h=s.createElement("p"),f=s.createElement("button"),C=s.createElement("button"),t=s.createElement("button");w.textContent=e.retained?.dialog.getAttribute("aria-label")||(b?"购买状态":e.retained?"Purchase status":"Your purchase"),w.style.cssText="margin:0;font-size:20px;line-height:1.3",m.setAttribute("aria-label",w.textContent),e.retained||(m.style.cssText="box-sizing:border-box;width:min(640px,calc(100% - 32px));max-height:calc(100dvh - 32px);border:0;border-radius:16px;background:Canvas;color:CanvasText;padding:0"),I.style.cssText="padding:24px 56px 24px 24px;font:14px/1.5 system-ui,sans-serif",f.textContent="×",f.setAttribute("aria-label",b?"关闭":"Close"),te(f,{background:"Canvas",text:"CanvasText"}),h.setAttribute("role","status"),t.textContent=b?"查询状态":"Check status";for(let u of[f,C,t])u.type="button";for(let u of[C,t])u.style.cssText="min-height:44px;padding:8px 14px;margin-inline-end:8px;border:1px solid ButtonBorder;border-radius:8px;font:inherit;cursor:pointer";I.append(w,f,h,C,t),m.append(I);let o=!1,p=!1,P=e.checking===!0,F=!1,v=e.initialState;function A(u){if(o)return;v=u;let i=v.actions.includes("continue_checkout"),_=e.allowConfirm&&v.actions.includes("confirm");C.hidden=P||!i&&!_,C.disabled=t.disabled=p||P,C.textContent=i?b?"继续付款":"Continue checkout":b?"确认购买":"Confirm purchase",h.textContent=P?b?"正在核对购买状态…":"Checking your purchase…":F||v.status==="blocked"?b?"暂时无法确认购买状态。请重试。":"We couldn’t check your purchase. Try again.":v.status==="complete"?b?"购买已处理。":"Your purchase has been processed.":i?b?"可以继续原订单付款。":"You can continue your original checkout.":b?"正在核对购买状态…":"Checking your purchase…"}async function R(u){if(!(o||p)){p=!0,F=!1,A(v);try{await u()}catch(i){o||(F=!0,g(e.onError,i))}finally{p=!1,A(e.client.recovery)}}}let N=()=>R(e.refresh),L=e.client.subscribe(A);function O(){return o?!1:(o=!0,e.signal.removeEventListener("abort",k),s.removeEventListener("visibilitychange",q),L(),m.removeEventListener("cancel",a),I.remove(),!0)}function U(){e.retained?e.retained.release():(m.remove(),G())}function k(){O()&&(U(),e.onDismiss())}function q(){s.visibilityState==="visible"&&N()}f.onclick=k;function a(u){u.preventDefault(),k()}m.addEventListener("cancel",a),t.onclick=()=>{N()},C.onclick=()=>{R(async()=>{v.actions.includes("continue_checkout")?await e.client.continueCheckout(u=>{if(e.signal.throwIfAborted(),!o)return e.onCheckoutUrl?e.onCheckoutUrl(u):s.defaultView?.location.assign(u)}):e.allowConfirm&&v.actions.includes("confirm")&&await e.client.confirm()})},e.signal.addEventListener("abort",k,{once:!0}),s.addEventListener("visibilitychange",q),A(v);function E(){o||e.signal.aborted||(e.retained||(x.append(m),m.showModal?m.showModal():m.open=!0),f.focus({preventScroll:!0}))}return e.loading?.active?e.loading.present(E):E(),{destroy:k,retainPurchaseDialog(){if(!(!m.open||!O()))return{dialog:m,release:U}},refresh:N,update(u){P=!1,A(u)},get recovery(){let u=v.purchases.filter(i=>!["native","complete"].includes(i.type));return structuredClone(u.length===1?u[0]:{type:"recover",operationId:null,requestId:null})},async prepareFallback(){return{type:"recover",operationId:null,requestId:null}},async review(){},async exitReview(){},get unappliedDrafts(){return new Map}}}var M=new WeakMap,V=new WeakMap,X=new WeakSet;function ye(x,e){let s=e.prepared,b=()=>{s&&!X.has(s)&&Q(s)?.release()},G=M.get(e.client);if(G)return b(),G;let m=t=>({...t,requestId:t.requestId??crypto.randomUUID()}),I=e.allowNewPurchase!==!1&&e.start instanceof Promise?e.start:void 0,w=e.allowNewPurchase===!1||!e.start||e.start instanceof Promise?void 0:m(e.start);w&&s?.state==="ready"&&s.matches(w)&&s.open();let h=s&&(w&&(s.state==="preparing"||["shown","closed"].includes(s.state)&&s.matches(w))||I&&["preparing","ready"].includes(s.state))?s:void 0;h?X.add(h):b();let f=h&&Q(h);f?.claim();let C=Promise.resolve().then(async()=>{let t=!1,o,p,P=0,F,v,A=!1,R=()=>{},N=()=>{},L,O=!1,U=!1,k,q=!1,a=e.signal?AbortSignal.any([e.signal,e.client.identitySignal]):e.client.identitySignal,E=()=>{M.get(e.client)===C&&M.delete(e.client),a.removeEventListener("abort",_),R(),N(),h&&X.delete(h),f?.release()};function u(){if(k)return k;let r=new Promise(d=>k=d);return V.set(e.client,r),r.then(()=>{V.get(e.client)===r&&V.delete(e.client)}),M.get(e.client)===C&&M.delete(e.client),k}let i=J(x,e,"funnel",()=>H(),K);function _(){H()}function H(r=!1){if(!t){if(t=!0,i.finish("dismissed"),o){o.destroy();return}if(r&&L){let d=u();q=!0,L.then(async l=>{l.mode==="run"&&l.status!=="blocked"&&e.client.controller&&e.client.attempt?.requestId===w?.requestId&&await e.client.close()}).catch(()=>{}).finally(()=>{d(),g(e.onDismiss,null)}),E();return}E(),g(e.onDismiss,null)}}let W={destroy:()=>H(),refresh:()=>o?.refresh()??F??Promise.resolve(),get recovery(){return o?.recovery??{type:"recover",operationId:null,requestId:null}},prepareFallback:()=>o?.prepareFallback()??Promise.resolve({type:"recover",operationId:null,requestId:null}),review:(...r)=>o?.review(...r)??Promise.resolve(),exitReview:(...r)=>o?.exitReview(...r)??Promise.resolve(),get unappliedDrafts(){return o?.unappliedDrafts??new Map}};a.addEventListener("abort",_,{once:!0}),f&&(N=f.onClose(()=>{O?t||u():H(!0)}));try{a.throwIfAborted();let r=e.client.controller?.view?.paywall?.resolution,d=r&&"document"in r?r.document:e.loadingDocument;i.start(!0,w?.locale??e.client.attempt?.locale??d?.screen.strings.defaultLocale,d??null);let l=I?i.wait(I.then(n=>n?m(n):null,()=>null),z):Promise.resolve(w??null);l.catch(()=>{}),h?.state==="shown"?(U=!0,i.present(()=>{})):h&&["preparing","ready"].includes(h.state)&&Promise.all([h.ready,l.catch(()=>null)]).then(([n,c])=>{if(n){if(t||!i.active||!c||!h.matches(c)||!f?.revealable)return f?.release();i.present(()=>{h.open()==="shown"?U=!0:f.release()})}});let y=V.get(e.client);if(y&&await i.wait(y),t)return null;if(a.throwIfAborted(),I){let n=await l;if(t)return null;if(a.throwIfAborted(),!n)return i.finish("skipped"),E(),null;w=n}L=w?e.client.start(w):e.client.refresh();let D=await i.wait(L,z);return t?null:(a.throwIfAborted(),await Y(D,i))}catch(r){if(q||k?.(),t)return null;throw i.finish("error",r),E(),g(e.onError,r),r}function B(r=!1){P++;let d=o;o=void 0,p=void 0,R(),R=()=>{};let l=r?d?.retainPurchaseDialog?.():void 0;return d?.destroy(),a.addEventListener("abort",_,{once:!0}),l}function Z(r,d,l=!1){if(t||a.aborted){d?.release();return}let y=++P;o=p=ie(x,{client:e.client,signal:a,loading:i,retained:d,checking:l,locale:e.client.attempt?.locale,onCheckoutUrl:e.onCheckoutUrl,onError:e.onError,refresh:$,initialState:r,allowConfirm:e.allowNewPurchase!==!1,onDismiss(){y===P&&(t=!0,E(),g(e.onDismiss,null))}})}function $(){if(F)return F;if(t||a.aborted)return Promise.resolve();if(!p){let l=B(!0)??f?.retainPurchaseDialog?.();l?Z(e.client.recovery,l,!0):(i=J(x,e,"funnel",()=>H(),K),i.start(!0,e.client.attempt?.locale))}let r=Promise.resolve().then(async()=>{try{let l=await e.client.refresh();!t&&!a.aborted&&await Y(l,i)}catch(l){!t&&!a.aborted&&(g(e.onError,l),await Y({...e.client.recovery,mode:"blocked",status:"blocked"},i))}});F=r;let d=()=>{F===r&&(F=void 0)};return r.then(d,d),r}async function Y(r,d){let l=e.client.controller;if(r.mode==="run"&&r.status!=="blocked"&&l)return p&&B(),se(l,d?.active?d:void 0);if(r.mode==="operation"){let y=await i.wait(e.client.recoverUpgradePaywall().then(D=>((t||a.aborted)&&D?.destroy(),D)),z);if(y){if(t||a.aborted)return y.destroy(),null;let D=p?.retainPurchaseDialog()??f?.retainPurchaseDialog?.()??i.retainPurchaseDialog();p&&B(),f?.release();let n=await ne(x,{signal:a,loading:"host",start:async()=>y,checkoutNavigation:"after_confirmation",allowNewPurchase:!1,resumeCheckout:S=>e.client.continueCheckout(j,S),onError:e.onError,onDismiss:()=>{t||H()}},{retainedDialog:D,present(S){i.active?i.present(S):S(!!D)},async dismiss(){H()}});if(!n.host||t||a.aborted)return n.host?.destroy(),D?.release(),E(),null;let c=n.host;return o={destroy(){c.destroy(),E(),g(e.onDismiss,null)},refresh:async()=>{await c.refresh()},get recovery(){return c.recovery},prepareFallback:()=>c.prepareFallback(),review:async()=>{},exitReview:async()=>{},unappliedDrafts:new Map},W}}return r.purchases.length||r.status==="blocked"&&O?(p?p.update(r):Z(r,f?.retainPurchaseDialog?.()??i.retainPurchaseDialog()),W):p?(H(),null):(i.finish("skipped"),E(),(U||O)&&(t=!0,g(e.onDismiss,null)),null)}function j(r){if(a.throwIfAborted(),t)throw new DOMException("Presentation dismissed","AbortError");return e.onCheckoutUrl?e.onCheckoutUrl(r):x.ownerDocument.defaultView?.location.assign(r)}async function se(r,d){a.removeEventListener("abort",_),O=!0;function l(){!t&&!a.aborted&&!A&&v&&e.client.recovery.status==="complete"&&(A=!0,g(e.onComplete,structuredClone(v)))}R(),R=e.client.subscribe(l);let y=++P,D=await ae(x,{...e,prepared:h,client:r,signal:a,checkoutNavigation:"after_confirmation",resumeCheckout:n=>e.client.continueCheckout(j,n),terminateCheckout:e.allowNewPurchase===!1?void 0:n=>e.client.terminateCheckout(n),async onCheckoutUrl(n){if(a.throwIfAborted(),t)throw new DOMException("Presentation dismissed","AbortError");let c=e.client.recovery;if((!c.actions.includes("continue_checkout")||!c.purchases.some(S=>S.type==="checkout"&&S.checkoutUrl===n))&&(c=await e.client.refresh(),a.throwIfAborted(),t))throw new DOMException("Presentation dismissed","AbortError");if(ee(c)!==n)throw new T("PURCHASE_PENDING","Checkout differs from the original recovery proof");return j(n)},async resolveOfferId(n){if(a.throwIfAborted(),t)throw new DOMException("Presentation dismissed","AbortError");let c=e.client.attempt;if(!c)throw new T("PURCHASE_PENDING","Read the original Start before selecting an offer");let S=await e.resolveOfferId?.(n,c);if(a.throwIfAborted(),t)throw new DOMException("Presentation dismissed","AbortError");if(e.client.attempt?.requestId!==c.requestId)throw new T("PURCHASE_STORAGE_CONFLICT","The original purchase changed while selecting an offer");return S},async resolveSubscriptionChange(n){a.throwIfAborted();let c=e.client.attempt;if(t||!c)throw new T("PURCHASE_PENDING","Read the original Start before selecting a membership");let S=await e.resolveSubscriptionChange?.(n);if(a.throwIfAborted(),t||e.client.attempt?.requestId!==c.requestId)throw new T("PURCHASE_STORAGE_CONFLICT","The original purchase changed while selecting a membership");return S},onPresentationState(n){y===P&&g(e.onPresentationState,n)},onComplete(n){y===P&&(v=n,l())},onError(n){y===P&&(g(e.onError,n),n instanceof T&&(n.status===401||n.status===409&&n.reason==="STATE_CHANGED"&&n.recovery==="recover_operation")&&!a.aborted&&$().catch(c=>g(e.onError,c)))},onDismiss(n){y===P&&(t=!0,E(),k?.(),g(e.onDismiss,n))}},d);return y!==P||t||a.aborted?(D.destroy(),t||a.aborted?null:W):(o=D,W)}});return M.set(e.client,C),C}export{ye as showFunnelPurchase};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-OEUA65JK.js";import"./chunk-AFZB2AYU.js";import"./chunk-YGOXUDDF.js";import"./chunk-3LWZFXLN.js";import"./chunk-2MDJ3JE5.js";import"./chunk-RUMGXXVJ.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-FAMPOY6L.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-PY3AC5KD.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as PRERENDER_MAX_AGE_MS,b as preparedInternals,c as prerenderFunnelPurchase};
@@ -1 +0,0 @@
1
- import{a,b,c}from"./chunk-AFZB2AYU.js";import"./chunk-YGOXUDDF.js";import"./chunk-3LWZFXLN.js";import"./chunk-2MDJ3JE5.js";import"./chunk-VILB5M4X.js";import"./chunk-YJRO7NXN.js";import"./chunk-PY3AC5KD.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as predictFunnelStart,c as predictedPaywallLoadingDocument,b as predictionRefusal};
@@ -1 +0,0 @@
1
- import{a as e,b as o,c as n}from"./chunk-YGOXUDDF.js";import"./chunk-3LWZFXLN.js";import"./chunk-2MDJ3JE5.js";import"./chunk-VILB5M4X.js";import"./chunk-YJRO7NXN.js";import"./chunk-PY3AC5KD.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{e as FUNNEL_ROUTE_LIMITS,o as funnelRouteSchema,n as projectFunnelRoute};
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-EJAF6OGO.js";import"./chunk-OEUA65JK.js";import"./chunk-AFZB2AYU.js";import"./chunk-YGOXUDDF.js";import"./chunk-4CRUNNTC.js";import"./chunk-4OSW2Y67.js";import"./chunk-W32FI2A2.js";import"./chunk-ZNOVEJLM.js";import"./chunk-I643NVMZ.js";import"./chunk-7UXQJJFZ.js";import"./chunk-3LWZFXLN.js";import"./chunk-2MDJ3JE5.js";import"./chunk-UCDQJB53.js";import"./chunk-RUMGXXVJ.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-7LHRBNSH.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-SLUA7ABW.js";import"./chunk-FKC7TJWM.js";import"./chunk-VGEH7B6S.js";import"./chunk-PY3AC5KD.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as showFunnelRun,b as showObservedFunnelRun};
@@ -1 +0,0 @@
1
- import{P as r,Q as m,j as e}from"./chunk-KVIGHX2B.js";import"./chunk-FAMPOY6L.js";import"./chunk-XI2NNZBS.js";import"./chunk-LDLS2VL2.js";import"./chunk-PY3AC5KD.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{m as merchantBridgeCommerceSchema,r as merchantBridgeOperationSchema,e as merchantOperationLookupSchema};
@@ -1 +0,0 @@
1
- import{e as o}from"./chunk-KXSZTBAG.js";import"./chunk-JRHJO4BR.js";import"./chunk-3TV3CVNP.js";import"./chunk-PGZZKX5K.js";import"./chunk-CJUVMNDB.js";import"./chunk-7UXQJJFZ.js";import"./chunk-2MDJ3JE5.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-5YQZEJBM.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-LDLS2VL2.js";import"./chunk-PY3AC5KD.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{o as apiOperations};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-QIY6PCYC.js";import"./chunk-4CRUNNTC.js";import"./chunk-W32FI2A2.js";import"./chunk-ZNOVEJLM.js";import"./chunk-UCDQJB53.js";import"./chunk-RUMGXXVJ.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-7LHRBNSH.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-VGEH7B6S.js";import"./chunk-PY3AC5KD.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as showPaywall};
@@ -1 +0,0 @@
1
- import{b as a}from"./chunk-AN7CPDBU.js";import"./chunk-PGZZKX5K.js";import"./chunk-CJUVMNDB.js";import"./chunk-7UXQJJFZ.js";import"./chunk-2MDJ3JE5.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-7LHRBNSH.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-3VUPVXAV.js";import"./chunk-VGEH7B6S.js";import"./chunk-PY3AC5KD.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as readPaywallContent};
@@ -1 +0,0 @@
1
- import{a}from"./chunk-S6MXUFVF.js";import"./chunk-KXSZTBAG.js";import"./chunk-JRHJO4BR.js";import"./chunk-K644WUOE.js";import"./chunk-3TV3CVNP.js";import"./chunk-S4YBFFFY.js";import"./chunk-AN7CPDBU.js";import"./chunk-PGZZKX5K.js";import"./chunk-CJUVMNDB.js";import"./chunk-7UXQJJFZ.js";import"./chunk-2MDJ3JE5.js";import"./chunk-UCDQJB53.js";import"./chunk-RUMGXXVJ.js";import"./chunk-CBOIDISB.js";import"./chunk-TSBXPDUQ.js";import"./chunk-KVIGHX2B.js";import"./chunk-VILB5M4X.js";import"./chunk-5YQZEJBM.js";import"./chunk-7LHRBNSH.js";import"./chunk-FAMPOY6L.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-3VUPVXAV.js";import"./chunk-VGEH7B6S.js";import"./chunk-PY3AC5KD.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{a as createPaywallSession};
@@ -1 +0,0 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-NVHRWZIZ.js";import"./chunk-ZNOVEJLM.js";import"./chunk-POX2ELNS.js";import"./chunk-BBA64POP.js";import"./chunk-ZVLZLBDA.js";import"./chunk-XI2NNZBS.js";import"./chunk-YJRO7NXN.js";import"./chunk-BYHBBZIO.js";import"./chunk-LDLS2VL2.js";import"./chunk-PY3AC5KD.js";import"./chunk-DSPLGTQI.js";import"./chunk-VPT5MFDG.js";import"./chunk-CILM5XMH.js";import"./chunk-WOT6VMZA.js";export{f as formatCustomerDecimal,b as hostedRendererScript,a as hostedRendererShell,d as inspectCustomHtml,i as mountScreenPreview,h as preparePopup,e as prepareScreen,c as sanitizeCustomHtml,g as showPopup};
File without changes
File without changes
File without changes
@@ -728,9 +728,9 @@ declare const customerDataNodeSchema: z.ZodObject<{
728
728
  data: z.ZodObject<{
729
729
  source: z.ZodEnum<{
730
730
  membership: "membership";
731
+ billing: "billing";
731
732
  credit_balance: "credit_balance";
732
733
  credit_transactions: "credit_transactions";
733
- billing: "billing";
734
734
  billing_controls: "billing_controls";
735
735
  customer_plans: "customer_plans";
736
736
  credit_packs: "credit_packs";