PageSourceSearch

https://www.pageon.ai/assets/pay-CJYHmt1_.js

js pageon.ai collected 2026-10-01 15:14:10 UTC 2,521 bytes, 1 lines download raw bytes

1import{r as I,b as E,ar as f,al as P,c as C,as as w,ap as S,aq as b,at as _,u as x,au as R,U as y,d as j,j as s,e as T,E as U,f as k,g as v,C as D,h as A,i as z,w as M,B as N,S as B}from"./index-DRVSzaL4.js";import{u as F}from"./use-require-auth-BuQLzsKz.js";import"./post-message-CTTUsnrr.js";function L(n){const{priceId:r,priceToken:o,source:i,annually:d}=n??{},[p,l]=I.useState(null),u=E(t=>{const{status:a,priceId:c,priceToken:m}=t??{},h="/payment/callback",e=new URL(window.location.origin);return e.protocol="https:",e.pathname=h,i&&e.searchParams.set("paySource",i),e.searchParams.set("payPeriod",d?"annually":"monthly"),c&&e.searchParams.set("priceId",c),m&&e.searchParams.set("priceToken",m),e.searchParams.set("payResult",a==="success"?"1":"0"),e.searchParams.set("from",encodeURIComponent(window.location.pathname)),e.toString()}),g=E(async()=>{try{if(!r&&!o)throw new Error(f.t("payment:errors.invalidProductInfo"));const t=P.IS_PROD?"prod":"demo",[a,{payments:c}]=await Promise.all([C.payment.getCustomerInfo(),w({env:t,enabledElements:["payments"]})]);if(!a?.data?.userCustomerId||!a?.data?.userCustomerClientSecret||!c)throw new Error(f.t("payment:errors.paymentInitFailed"));const m=u({status:"success",priceId:r,priceToken:o}),h=u({status:"fail",priceId:r,priceToken:o}),e=Date.now();c.redirectToCheckout({env:t,successUrl:m,failUrl:h,mode:"recurring",customer_id:a.data.userCustomerId,client_secret:a.data.userCustomerClientSecret,currency:"USD",logoUrl:"https://cdn.prod.website-files.com/669cb3732ce3e28db60a6a5b/68099fe14139882e79843636_header_logo.svg",recurringOptions:{next_triggered_by:"merchant",merchant_trigger_reason:"scheduled",currency:"USD"}}),S(b.AIRWALLEX_SUBSCRIBE_TIME,{time:Date.now()-e})}catch(t){_.error("Payment initialization failed:",t),l(t)}});return{onSubscribe:F(g,{autoFetchUser:!0}),error:p}}const W=()=>{const[n]=x(),{t:r}=R("payment"),o=n.get(y.PRICE_ID)||"",i=n.get(y.PRICE_TOKEN)||"",d=n.get(y.PRICE_PERIOD),{onSubscribe:p,error:l}=L({priceId:o,priceToken:i,annually:d==="annually"});j(()=>{p()});const u=E(()=>{window.close()});return s.jsx("div",{className:T("w-full min-h-svh flex items-center justify-center"),children:l?s.jsxs(U,{children:[s.jsxs(k,{children:[s.jsx(v,{variant:"default",children:s.jsx(D,{className:"size-12"})}),s.jsx(A,{children:r("errorTitle")}),s.jsx(z,{children:l?.message||r("defaultError")})]}),s.jsx(M,{children:s.jsx(N,{variant:"outline",size:"sm",onClick:u,children:r("close")})})]}):s.jsx(B,{className:"size-8"})})};export{W as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.