tokentracker-cli 1.5.9 → 1.5.10

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 (111) hide show
  1. package/dashboard/dist/assets/{AchievementBadge-DxevOMMv.js → AchievementBadge-C1sNmjy1.js} +1 -1
  2. package/dashboard/dist/assets/{AchievementsPage-wQh6dPiW.js → AchievementsPage-CEes3r9C.js} +2 -2
  3. package/dashboard/dist/assets/{AchievementsSection-vYIgdSyO.js → AchievementsSection-DUNbD6b3.js} +1 -1
  4. package/dashboard/dist/assets/{BadgeDetailModal-isUD2b76.js → BadgeDetailModal-Qmr7VqYE.js} +1 -1
  5. package/dashboard/dist/assets/{BotAnimated-DRT695hH.js → BotAnimated-jsDF2HFl.js} +1 -1
  6. package/dashboard/dist/assets/{Card-CtiqYzpy.js → Card-B_lOewQz.js} +1 -1
  7. package/dashboard/dist/assets/CloudCheckoutPage-C_JuBsD4.js +1 -0
  8. package/dashboard/dist/assets/{CloudPage-Ca9vK72O.js → CloudPage-CzME2Zwr.js} +2 -2
  9. package/dashboard/dist/assets/{CommandPalette-DFNVDGDw.js → CommandPalette-C9-pZkuM.js} +1 -1
  10. package/dashboard/dist/assets/{CommunityStatsModal-CBhB1FCI.js → CommunityStatsModal-CykqgS9V.js} +1 -1
  11. package/dashboard/dist/assets/{ConfirmModal-BpxbxobQ.js → ConfirmModal-fM615n-k.js} +1 -1
  12. package/dashboard/dist/assets/{Controls-alGdX7nF.js → Controls-BUgYy1q2.js} +1 -1
  13. package/dashboard/dist/assets/{DashboardPage-BzcooUrM.js → DashboardPage-TMedKsgf.js} +1 -1
  14. package/dashboard/dist/assets/{DateRangePopover-CV7k3TK2.js → DateRangePopover-ChqqPFBz.js} +1 -1
  15. package/dashboard/dist/assets/DevicePage-BVM0mnCp.js +1 -0
  16. package/dashboard/dist/assets/{DialogClose-D5qE4Ncq.js → DialogClose-BSYpqJ7I.js} +1 -1
  17. package/dashboard/dist/assets/DialogDescription-C-V5YErj.js +1 -0
  18. package/dashboard/dist/assets/{DialogTitle-DD0PN4lA.js → DialogTitle-Ck0801ZS.js} +1 -1
  19. package/dashboard/dist/assets/{ElectricLogo-BkeGognF.js → ElectricLogo-Duu4aJps.js} +1 -1
  20. package/dashboard/dist/assets/{FadeIn-WKLfxTCh.js → FadeIn-C0nDQZXG.js} +1 -1
  21. package/dashboard/dist/assets/{HeaderGithubStar-CAe4FRv5.js → HeaderGithubStar-9_Cou9eQ.js} +1 -1
  22. package/dashboard/dist/assets/{HoverTooltip-By_5OH4b.js → HoverTooltip-Dko6Ml2q.js} +1 -1
  23. package/dashboard/dist/assets/{IpCheckPage-CsLsYWer.js → IpCheckPage-CAy4LTD9.js} +1 -1
  24. package/dashboard/dist/assets/{LandingPage-Dz7Kwfno.js → LandingPage-De_k34Bm.js} +2 -2
  25. package/dashboard/dist/assets/{LeaderboardPage-Bwk5cUdL.js → LeaderboardPage-upmKCiU2.js} +2 -2
  26. package/dashboard/dist/assets/{LeaderboardProBadge-DuuM_Qd4.js → LeaderboardProBadge-Bp_4HRGy.js} +1 -1
  27. package/dashboard/dist/assets/{LeaderboardProfileModal-dLdTP76d.js → LeaderboardProfileModal-CfeTu2mg.js} +3 -3
  28. package/dashboard/dist/assets/{LeaderboardProfilePage-BC8q5Yiz.js → LeaderboardProfilePage-dwGCnqt1.js} +1 -1
  29. package/dashboard/dist/assets/{LimitsPage-B_joQM6T.js → LimitsPage-FxEd8pgt.js} +1 -1
  30. package/dashboard/dist/assets/{LocalOnlyNotice-Df1TymDu.js → LocalOnlyNotice-DITDSNOI.js} +1 -1
  31. package/dashboard/dist/assets/{LoginCard-CSadewRf.js → LoginCard-B0Y5nGs3.js} +1 -1
  32. package/dashboard/dist/assets/{LoginModal-xa_R4jkx.js → LoginModal-C7UJchsM.js} +1 -1
  33. package/dashboard/dist/assets/{LoginPage-DQKRFd-i.js → LoginPage-CuSeHCfR.js} +1 -1
  34. package/dashboard/dist/assets/{PetPage-DXjUI-Fm.js → PetPage-DmKwqkVp.js} +2 -2
  35. package/dashboard/dist/assets/{PopoverPopup-C9nxf0YB.js → PopoverPopup-CUOqufwL.js} +1 -1
  36. package/dashboard/dist/assets/{ProviderIcon-COeK1iE9.js → ProviderIcon-RNmBCqqB.js} +1 -1
  37. package/dashboard/dist/assets/{ResetPasswordPage-yFhu0KjP.js → ResetPasswordPage-DzWUR5w4.js} +1 -1
  38. package/dashboard/dist/assets/{Select-WAuTo5wB.js → Select-8FQRH1NU.js} +1 -1
  39. package/dashboard/dist/assets/{SelectItemText-Ft1My1rn.js → SelectItemText-Dxwcx_oH.js} +1 -1
  40. package/dashboard/dist/assets/{SelfHostPage-BxF88Cud.js → SelfHostPage-B7-Tn3dF.js} +1 -1
  41. package/dashboard/dist/assets/{ServiceStatusPage-Bwphp1_T.js → ServiceStatusPage-BsfvaKsB.js} +1 -1
  42. package/dashboard/dist/assets/{SessionsPage-BDZoT8S9.js → SessionsPage-DW87f0ht.js} +1 -1
  43. package/dashboard/dist/assets/{SettingsPage-BpQqI7sS.js → SettingsPage-DGgUxidi.js} +3 -3
  44. package/dashboard/dist/assets/{SkillsPage-DPS8DP98.js → SkillsPage-BVLlMuY6.js} +1 -1
  45. package/dashboard/dist/assets/{TokenGalaxy-Bqdu32RZ.js → TokenGalaxy-CO6GVguL.js} +1 -1
  46. package/dashboard/dist/assets/{TooltipPopup-CpC_9aso.js → TooltipPopup-Bevc5eEL.js} +1 -1
  47. package/dashboard/dist/assets/{TrendMonitor-DVWB1_L7.js → TrendMonitor-2BCVwA7W.js} +1 -1
  48. package/dashboard/dist/assets/{WidgetsPage-BQSjbWew.js → WidgetsPage-BP2OAK7_.js} +1 -1
  49. package/dashboard/dist/assets/{WrappedPage-DLQyBtR9.js → WrappedPage-DHaMc2cB.js} +1 -1
  50. package/dashboard/dist/assets/{__vite-browser-external-DtVR8sgH.js → __vite-browser-external-BBQzCxHU.js} +2 -2
  51. package/dashboard/dist/assets/{agent-logos-BcEyTuIb.js → agent-logos-CJnyo7vh.js} +1 -1
  52. package/dashboard/dist/assets/{arrow-left-C8aE6WcJ.js → arrow-left-Cc3forJV.js} +1 -1
  53. package/dashboard/dist/assets/{arrow-right-Dt4QZ45w.js → arrow-right-CmzbBPo3.js} +1 -1
  54. package/dashboard/dist/assets/{arrow-up-right-DR4MOP3X.js → arrow-up-right-D91fA8Iw.js} +1 -1
  55. package/dashboard/dist/assets/{calendar-days-DHwLFNka.js → calendar-days-CUz-Kohj.js} +1 -1
  56. package/dashboard/dist/assets/{check-D57wJVNi.js → check-SYGeJ9ML.js} +1 -1
  57. package/dashboard/dist/assets/{chevron-down-1Am_McS5.js → chevron-down-CNtNmxJK.js} +1 -1
  58. package/dashboard/dist/assets/{cloud-checkout-D1uji-1j.js → cloud-checkout-At2YeP3_.js} +1 -1
  59. package/dashboard/dist/assets/{composite-CWdL18RN.js → composite-C01XLAWQ.js} +1 -1
  60. package/dashboard/dist/assets/{copy-Bv-Of2CY.js → copy-UBZcDOSY.js} +1 -1
  61. package/dashboard/dist/assets/{download-C6CZhQJ_.js → download-BSroeXtu.js} +1 -1
  62. package/dashboard/dist/assets/{external-link-DluFPan_.js → external-link-wc6SpmRT.js} +1 -1
  63. package/dashboard/dist/assets/{flame-Q-O2BjcZ.js → flame-Cwq8Msm_.js} +1 -1
  64. package/dashboard/dist/assets/{format-tokens-D6xfDQk6.js → format-tokens-BuH-wp-o.js} +1 -1
  65. package/dashboard/dist/assets/{gift-CjyNlhMb.js → gift-DmQ-nWNf.js} +1 -1
  66. package/dashboard/dist/assets/{icons-C7bLOnL0.js → icons-DceEefzQ.js} +1 -1
  67. package/dashboard/dist/assets/{index-dN_XEOTc.js → index-8CXny7rg.js} +1 -1
  68. package/dashboard/dist/assets/{index-CxtJQkWU.js → index-CNJKLAOc.js} +1 -1
  69. package/dashboard/dist/assets/{index-C0c77eg0.js → index-CuYxRxFQ.js} +1 -1
  70. package/dashboard/dist/assets/{index-CuFScIzn.js → index-b-RBn81T.js} +1 -1
  71. package/dashboard/dist/assets/{info-DVIccqnI.js → info-BzwD8qDF.js} +1 -1
  72. package/dashboard/dist/assets/{link-2-C70V-255.js → link-2-0X79vqnY.js} +1 -1
  73. package/dashboard/dist/assets/{loader-circle-B-Rab-PT.js → loader-circle-Dto5GLrC.js} +1 -1
  74. package/dashboard/dist/assets/{local-usage-transfer-qvjPuuZr.js → local-usage-transfer-DLixSavG.js} +1 -1
  75. package/dashboard/dist/assets/{modifiers.esm-BHs-2K1Y.js → modifiers.esm-CL6p6jBJ.js} +1 -1
  76. package/dashboard/dist/assets/{monitor-smartphone-CgrOD78L.js → monitor-smartphone-Bnaw35Qv.js} +1 -1
  77. package/dashboard/dist/assets/{play-Ip40EFaD.js → play-xmEUnE2_.js} +1 -1
  78. package/dashboard/dist/assets/{plus-CbCC4SC4.js → plus-67TZHqQi.js} +1 -1
  79. package/dashboard/dist/assets/{provider-display-CZGQ6_EQ.js → provider-display-jd8V87bA.js} +1 -1
  80. package/dashboard/dist/assets/{react-CgvoKjQY.js → react-B68xm5mg.js} +1 -1
  81. package/dashboard/dist/assets/{safePolygon-BxArCd9t.js → safePolygon-DiBm4xSb.js} +1 -1
  82. package/dashboard/dist/assets/{search-Cc1m7nId.js → search-DFZoQllp.js} +1 -1
  83. package/dashboard/dist/assets/{server-B9RX1Vuc.js → server-MOh3NKXh.js} +1 -1
  84. package/dashboard/dist/assets/{shield-check-DFuUPXVr.js → shield-check-CqZ0Vz1G.js} +1 -1
  85. package/dashboard/dist/assets/{skills-api-NyM68NUT.js → skills-api-CvOFtmbw.js} +1 -1
  86. package/dashboard/dist/assets/{sortable.esm-CYnTi7kq.js → sortable.esm-WjS3aHfu.js} +1 -1
  87. package/dashboard/dist/assets/{store-DDaZ-mNZ.js → store-AWGUrRH9.js} +1 -1
  88. package/dashboard/dist/assets/{terminal-RKmu3r3J.js → terminal-C6wQj1wD.js} +1 -1
  89. package/dashboard/dist/assets/{trash-V0PYmC5p.js → trash-pcTDGbRp.js} +1 -1
  90. package/dashboard/dist/assets/{use-community-stats-48odwOSW.js → use-community-stats-DmweXTA6.js} +1 -1
  91. package/dashboard/dist/assets/{use-latest-request-guard-CwOWDCBH.js → use-latest-request-guard-tDJgPNLH.js} +1 -1
  92. package/dashboard/dist/assets/{use-limits-display-prefs-Lo9XLIUG.js → use-limits-display-prefs-C2cSKBpC.js} +1 -1
  93. package/dashboard/dist/assets/{use-native-settings-BjPp_hnp.js → use-native-settings-CwhfcBmO.js} +1 -1
  94. package/dashboard/dist/assets/{use-ordered-list-DdTbfk26.js → use-ordered-list-BP0VcBim.js} +1 -1
  95. package/dashboard/dist/assets/use-reduced-motion-C_uu1NvN.js +1 -0
  96. package/dashboard/dist/assets/{use-transform-CmzDZQtp.js → use-transform-BSah0zOz.js} +1 -1
  97. package/dashboard/dist/assets/{use-usage-limits-DT684bcx.js → use-usage-limits-BENTyA06.js} +1 -1
  98. package/dashboard/dist/assets/{useCurrency-CNQ1UMsM.js → useCurrency-BPBG40V4.js} +1 -1
  99. package/dashboard/dist/assets/{usePositioner-KdfYUR_c.js → usePositioner-f0OVujvk.js} +1 -1
  100. package/dashboard/dist/assets/{useTokenFormat-CregnoYF.js → useTokenFormat-DPbt6lUi.js} +1 -1
  101. package/dashboard/dist/assets/{zap-CMv1W1Qs.js → zap-DLgyM5GN.js} +1 -1
  102. package/dashboard/dist/index.html +1 -1
  103. package/dashboard/dist/ip-check.html +1 -1
  104. package/dashboard/dist/leaderboard.html +1 -1
  105. package/dashboard/dist/share.html +1 -1
  106. package/package.json +1 -1
  107. package/src/lib/pricing/seed-snapshot.json +1 -1
  108. package/dashboard/dist/assets/CloudCheckoutPage-BjtTYFRB.js +0 -1
  109. package/dashboard/dist/assets/DevicePage-BK3-XhwI.js +0 -1
  110. package/dashboard/dist/assets/DialogDescription-bgtuNhON.js +0 -1
  111. package/dashboard/dist/assets/use-reduced-motion-C58neEWc.js +0 -1
@@ -1 +0,0 @@
1
- import{o as nt,d as ct,u as it,r as o,e as ot,a0 as lt,a1 as dt,a2 as ut,a3 as mt,a4 as Te,c as t,t as ht,v as xt,p as ft,a5 as ee,a6 as Me,a7 as pt,j as e,B as x,a8 as je,L as w,a9 as E,aa as gt,ab as _t,ac as kt,ad as yt,ae as bt,af as vt,ag as wt}from"./__vite-browser-external-DtVR8sgH.js";import{c as fe,r as pe,C as Ne,a as jt,g as Nt,s as ze,o as $e,b as Ct}from"./cloud-checkout-D1uji-1j.js";import{d as It}from"./os-DMmhX9tk.js";import{C as St}from"./Card-CtiqYzpy.js";import{T as Lt}from"./Controls-alGdX7nF.js";import{CloudPlanView as Rt}from"./CloudPage-Ca9vK72O.js";import{L as Ue}from"./loader-circle-B-Rab-PT.js";import{S as Et}from"./shield-check-DFuUPXVr.js";import{E as Pt}from"./external-link-DluFPan_.js";import{A as Fe}from"./arrow-left-C8aE6WcJ.js";import"./arrow-right-Dt4QZ45w.js";import"./chevron-down-1Am_McS5.js";import"./server-B9RX1Vuc.js";import"./check-D57wJVNi.js";const He={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};He.node;const At=nt(He);function Kt(){const H=ct(),{openLoginModal:te}=it(),re=o.useRef(null),[P,A]=ot();o.useEffect(()=>{if(!P.has("_ptxn"))return;const a=new URLSearchParams(P);a.delete("_ptxn"),A(a,{replace:!0})},[P,A]);const{catalog:S,loading:_,error:j,refresh:Ce}=lt(),{account:f,auth:k,loading:G,error:U,refresh:q}=dt(),s=P.get("order")||"",L=P.get("intent")==="trial",Ge=P.get("sku"),u=`/billing/checkout?${P}`,[V,ae]=o.useState(null),[h,Ie]=o.useState(!1),[ge,_e]=o.useState(!!s),[Se,Q]=o.useState(null),[ke,Ve]=o.useState(null),[se,ye]=o.useState(null),[We,Le]=o.useState(!1),[X,Re]=o.useState(null),ne=o.useRef(null),ce=o.useRef(!1),Y=o.useRef(0),be=o.useRef(null),y=o.useRef(!0),r=k?.signedIn?k.user?.id:null,i=ut(),T=o.useRef(i);T.current=i;const Ee=o.useRef(s);Ee.current=s;const N=o.useRef(r);N.current=r;const ie=V?.ownerId===r&&V?.backend===i&&(s?V.order?.id?.toLowerCase()===s.toLowerCase():!V.verified&&V.createdFrom===u)?V:null,Pe=ke?.ownerId===r&&ke?.backend===i?ke:null,Je=se?.ownerId===r&&se?.backend===i&&se?.orderId===s?se.error:null,R=Se||Je,n=ie?.order,p=Pe||ie?.membership||f?.membership,B=S?.policy?.hosting_mode==="self_hosted"||p?.status==="self_hosted",M=n?.sku||Ge,m=S?.prices?.find(a=>a.sku===M),Ke=n?.currency||m?.currency,Qe=n?.amount_cents??m?.amount_cents,C=n?.billing_mode||m?.billing_mode,Xe=n?.term_months||m?.term_months,F=n?.provider||"waffo",l=Pe?"trial_success":h&&!n?"creating":fe(n,p),g=mt(S),I=!!S?.providers?.[F],b=!!(n?.retry_payment_conflict_at||[...f?.conflict_orders||[],...f?.pending_orders||[]].some(a=>a.retry_payment_conflict_at)),W=p?.has_gift===!0||p?.access_source==="gift"||f?.membership?.has_gift===!0||f?.gifts?.some(a=>["active","pending"].includes(a.state)),Ye=n?.provider==="waffo"&&n.payment_state==="unpaid"&&n.status!=="paid"&&["awaiting","expired","canceled"].includes(l)&&g&&I&&!b&&!W,z=k?.getAccessToken,v=pe(r),oe=f?.subscriptions?.some(a=>["active","trialing","past_due","paused"].includes(a.status)&&!a.cancel_at_period_end),le=p?.status==="active"||f?.payments?.some(a=>a.refunded_cents<a.amount_cents&&Date.parse(a.ends_at)>Date.now()),Ae=["fixed","recurring"].includes(m?.billing_mode)?S?.prices?.find(a=>a.currency===m.currency&&a.term_months===m.term_months&&a.billing_mode===(m.billing_mode==="recurring"?"fixed":"recurring")):null,qe=!!(r&&p&&!k?.loading&&!G&&!U&&l==="review"&&!L&&!s&&!n&&!h&&g&&I&&!_&&!j&&Ae&&!le&&!W&&!oe&&!b&&!v?.request_id&&!v?.order_id&&!f?.pending_orders?.length),Ze=()=>{if(!qe||ce.current)return;const a=pe(r);if(a?.request_id||a?.order_id)return;const c=new URLSearchParams(P);c.set("sku",Ae.sku),A(c,{replace:!0})},et=Te(u,r)||(X?.nextPath===u&&X?.ownerId===r&&X?.backend===i?X:null),de=t(L?"cloud.login.trial_context":"cloud.login.purchase_context");o.useEffect(()=>{if(r){re.current=null;return}k?.loading||_||B||re.current===u||(re.current=u,te({nextPath:u,subtitle:de,closePath:"/cloud"}))},[r,k?.loading,_,B,u,de,te]);const Be=S?.environment==="live"&&!L&&P.getAll("order").length===1&&Ne.test(s)&&["mac","windows"].includes(It())&&!(navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!ht()&&!xt()&&!ft()?`tokentracker://billing/return?order=${s.toLowerCase()}`:null;o.useEffect(()=>(y.current=!0,()=>{y.current=!1}),[]);const J=o.useCallback(async()=>{if(B||!s||!r||N.current!==r)return null;if(!Ne.test(s))return Q({code:"order_not_found"}),_e(!1),null;const a=++Y.current;try{const c=await ee("order",{auth:z,params:{id:s}});if(a!==Y.current||N.current!==r||T.current!==i)return null;ae({...c,ownerId:r,backend:i,verified:!0}),Q(null);const d=fe(c.order,c.membership);if(d==="success"&&ye(null),["success","refunded"].includes(d)){const $=`${r}:${s}:${d}`;be.current!==$&&(be.current=$,q())}if(["success","expired","canceled","refunded"].includes(fe(c.order,c.membership))){const $=pe(r),K=c.order.payment_state==="unpaid"&&c.order.status!=="paid"&&["expired","canceled"].includes(fe(c.order,c.membership))&&$?.retry_order_id===s&&$?.retry_request_id;$?.order_id===s&&!K&&jt(r)}return c}catch(c){return a===Y.current&&Q(c),null}finally{a===Y.current&&_e(!1)}},[s,r,z,B,q,i]);o.useEffect(()=>(ae(null),Q(null),be.current=null,_e(!!(s&&r)),J(),()=>{Y.current+=1}),[J,s,r]),o.useEffect(()=>{if(B||!s||!r||["success","canceled","expired","refunded"].includes(l))return;const a=()=>{document.visibilityState==="visible"&&J()},c=window.setInterval(a,5e3);return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{window.clearInterval(c),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[s,r,l,J,B]);const D=o.useCallback(async a=>{if(!ce.current){ce.current=!0,Ie(!0),Q(null),ye(null);try{await a()}catch(c){y.current&&N.current===r&&T.current===i&&ye({ownerId:r,backend:i,orderId:s,error:c})}finally{ce.current=!1,y.current&&Ie(!1)}}},[r,s,i]),ue=o.useCallback((a=!1)=>D(async()=>{const c=Nt(r,M,F),d=await ee("checkout",{auth:z,body:{sku:M,provider:F,request_id:c.request_id,mobile:window.matchMedia("(max-width: 640px)").matches}});T.current===i&&(ze(r,{...c,order_id:d.order.id}),!(!y.current||N.current!==r)&&(a===!0&&(ne.current={ownerId:r,backend:i,orderId:d.order.id,opened:!1}),ae({...d,ownerId:r,backend:i,createdFrom:u,order:{...m,provider:F,...d.order}}),A({order:d.order.id},{replace:!0})))}),[D,r,M,F,z,m,A,i,u]),me=o.useCallback((a=!1)=>D(async()=>{let c;try{c=await ee("trial",{auth:z,body:{}})}catch(d){if(a===!0&&(d.code||d.message)==="trial_unavailable"){y.current&&N.current===r&&T.current===i&&(await q(),y.current&&N.current===r&&T.current===i&&H("/cloud",{replace:!0}));return}throw d}!y.current||N.current!==r||T.current!==i||(Ve({...c.membership,ownerId:r,backend:i}),a===!0?(await q(),y.current&&N.current===r&&T.current===i&&H("/dashboard",{replace:!0})):q())}),[D,z,r,q,H,i]);o.useEffect(()=>{const a=Te(u,r);if(!a||!r||h||k?.loading||G||U||_||j||!p||B||!g)return;if(a.orderId){if(a.orderId!==s)return;const xe=Me(u,r);if(!xe)return;Re({...xe,ownerId:r}),b||(ne.current={ownerId:r,backend:i,orderId:s,opened:!1});return}if(s||!a.trial&&(!m||!I||!C))return;const c=Me(u,r);if(!c)return;if(Re({...c,ownerId:r}),a.trial){if(p.trial_available)me(!0);else{const xe=p.can_read_cloud||["active","trial","transition"].includes(p.status);H(xe?"/dashboard":"/cloud",{replace:!0})}return}if(W||oe||le&&C!=="fixed"||b){H("/settings?section=cloud",{replace:!0});return}const d=pe(r),$=f?.pending_orders?.[0],K=d?.order_id||$?.id;K&&Ne.test(K)?(ne.current={ownerId:r,backend:i,orderId:K,opened:!1},A({order:K},{replace:!0})):d?.request_id&&(d.sku!==M||d.provider!==F)?A({sku:d.sku},{replace:!0}):ue(!0)},[u,r,s,h,k?.loading,G,U,_,j,p,B,g,m,I,C,W,oe,le,b,f?.pending_orders,M,F,me,ue,H,A,i]),o.useEffect(()=>{const a=ne.current;!a||a.opened||a.ownerId!==r||a.backend!==i||a.orderId!==s||!ie?.verified||n?.id?.toLowerCase()!==s.toLowerCase()||!n?.checkout_url||l!=="awaiting"||h||!g||!I||b||(a.opened=!0,D(()=>$e(n.checkout_url,{sameTab:!0})))},[r,s,n?.id,n?.checkout_url,ie?.verified,X?.nextPath,l,h,g,I,b,D,i]);const De=()=>D(async()=>{await ee("reconcile",{auth:z,body:{id:s}}),!(!y.current||N.current!==r)&&(await J(),await q())}),tt=()=>D(async()=>{const a=Ct(r,n);Le(!0);try{const c=await ee("restart-checkout",{auth:z,body:{id:n.id,request_id:a.retry_request_id}});if(ze(r,{sku:n.sku,provider:n.provider,request_id:a.retry_request_id,order_id:c.order.id}),!y.current||N.current!==r||Ee.current!==n.id)return;ae({...c,ownerId:r,backend:i}),A({order:c.order.id},{replace:!0})}finally{y.current&&Le(!1)}}),rt=()=>D(async()=>{await $e(n.checkout_url)}),ve=S?.limits?.trial_days||7,we=wt(),Z=we&&!pt(),at=new Date(Date.now()+ve*864e5).toISOString(),he=L?t("cloud.checkout.starting_trial"):t("cloud.checkout.creating"),st={review:L?t("cloud.checkout.trial_title"):t("cloud.checkout.title"),creating:he,awaiting:t("cloud.checkout.awaiting"),activating:t("cloud.checkout.activating"),success:t("cloud.checkout.success"),canceled:t("cloud.checkout.canceled"),expired:n?.status==="paid"?t("cloud.checkout.term_ended"):t("cloud.checkout.expired"),refunded:t("cloud.checkout.refunded"),trial_success:t("cloud.checkout.trial_success")};let O=null;if(!r)O=e.jsx("div",{className:"space-y-5",children:e.jsx(x,{onClick:()=>te({nextPath:u,subtitle:de,closePath:"/cloud"}),className:"w-full",disabled:k?.loading,children:t("cloud.action.sign_in_continue")})});else if(ge||h&&!n)O=e.jsxs("p",{role:"status",className:"flex items-center gap-2 text-sm",children:[e.jsx(Ue,{className:"motion-safe:animate-spin",size:17,"aria-hidden":!0}),ge?t("cloud.checkout.loading"):he]});else if(l==="trial_success"||l==="success")O=e.jsxs("div",{className:"space-y-5",children:[e.jsx(At,{size:32,className:"text-oai-gray-700 dark:text-oai-gray-200","aria-hidden":!0}),e.jsx("p",{className:"text-sm leading-6",children:l==="trial_success"?t("cloud.trial.ends",{date:je(p.trial_ends_at)}):t("cloud.membership.expires",{date:je(p.expires_at)})}),Z||!we?e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t(we?"cloud.onboarding.local_next":"cloud.onboarding.web_next")}):null,e.jsx(x,{as:w,to:Z?"/settings?section=cloud":"/dashboard",className:"w-full no-underline",children:t(Z?"cloud.action.setup_sync":"cloud.action.open_dashboard")}),e.jsx(w,{to:Z?"/dashboard":"/settings?section=cloud",className:"flex min-h-10 items-center justify-center text-sm underline underline-offset-4",children:t(Z?"cloud.action.open_dashboard":"cloud.action.manage_membership")})]});else if(l==="review"&&!s&&W)O=e.jsxs("div",{className:"space-y-5",children:[e.jsx(E,{children:t("cloud.gift.error_active")}),e.jsx(x,{as:w,to:"/settings?section=cloud",variant:"secondary",className:"w-full no-underline",children:t("cloud.action.manage_membership")})]});else if(l==="review"&&!s&&L)O=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6",children:t("cloud.trial.disclosure",{days:ve,date:je(at)})}),e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.trial.expiry")}),f?.membership&&!f.membership.trial_available?e.jsxs("div",{className:"space-y-3",children:[e.jsx(E,{children:t("cloud.error.trial")}),m?null:e.jsx(x,{as:w,to:"/cloud",variant:"secondary",className:"w-full no-underline",children:t("cloud.action.view_plans")})]}):null,e.jsx(x,{onClick:me,disabled:h||!g||!f?.membership?.trial_available,className:"w-full",children:t("cloud.action.start_trial",{days:ve})}),m&&g&&I&&!h?e.jsx(x,{as:w,to:`/billing/checkout?sku=${encodeURIComponent(m.sku)}`,variant:"ghost",className:"mx-auto flex w-fit no-underline",children:t("cloud.plan.skip_trial")}):null]});else if(l==="review"&&!s&&m)O=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6",children:t("cloud.checkout.review")}),e.jsxs("p",{className:"inline-flex items-center gap-2 text-sm",children:[e.jsx(Et,{size:16,"aria-hidden":!0}),t("cloud.checkout.waffo")]}),C?e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:C==="fixed"?t("cloud.checkout.methods_fixed"):t("cloud.checkout.methods_recurring")}):null,C?e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:C==="fixed"?t("cloud.renewal.manual"):t("cloud.renewal.auto")}),qe?e.jsx(Lt,{checked:C==="recurring",onChange:Ze,ariaLabel:t("cloud.billing_mode.recurring")}):null]}):null,v?.order_id?e.jsx(x,{as:w,to:`/billing/checkout?order=${encodeURIComponent(v.order_id)}`,className:"w-full no-underline",children:t("cloud.action.resume_order")}):null,v?.request_id&&!v.order_id&&v.sku!==M?e.jsx(x,{as:w,to:`/billing/checkout?sku=${encodeURIComponent(v.sku)}`,className:"w-full no-underline",children:t("cloud.action.resume_purchase")}):null,!v?.order_id&&!(v?.request_id&&v.sku!==M)?e.jsx(x,{onClick:ue,disabled:h||!g||!I||!C||!!v?.order_id||b,className:"w-full",children:t("cloud.action.create_checkout",{amount:gt(Qe,Ke)})}):null]});else if(n){const a={creating:t("cloud.checkout.pending_creation"),awaiting:t("cloud.checkout.pending_payment"),activating:t("cloud.checkout.received"),expired:n?.status==="paid"?t("cloud.checkout.term_ended_detail"):t("cloud.checkout.expired_detail"),canceled:t("cloud.checkout.canceled_detail"),refunded:t("cloud.checkout.refunded_detail")};O=e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:a[l]}),l==="awaiting"&&n.checkout_url&&g&&I&&!b?e.jsxs(x,{onClick:rt,disabled:h,className:"w-full",children:[t("cloud.action.open_payment"),e.jsx(Pt,{size:15,className:"ml-2","aria-hidden":!0})]}):null,l!=="refunded"?e.jsxs(e.Fragment,{children:[e.jsx(x,{onClick:De,disabled:h,variant:"ghost",className:"mx-auto flex underline underline-offset-4",children:h?t("cloud.action.checking"):t("cloud.action.check_payment")}),e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.recovery_hint")})]}):null,Ye?e.jsxs("details",{open:l!=="awaiting",className:"border-t border-oai-gray-200 pt-4 dark:border-oai-gray-800",children:[e.jsx("summary",{className:"min-h-10 cursor-pointer text-sm font-medium leading-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:t("cloud.checkout.help_title")}),e.jsxs("div",{className:"space-y-3 pt-2",children:[e.jsx("p",{className:"text-xs leading-5 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.restart_detail")}),e.jsx(x,{onClick:tt,disabled:h,variant:l==="awaiting"?"secondary":"primary",className:"w-full",children:We?t("cloud.action.restarting_checkout"):t("cloud.action.restart_checkout")})]})]}):null,["canceled","expired"].includes(l)&&!b?e.jsx(w,{to:"/cloud",className:"flex min-h-10 items-center justify-center text-sm underline underline-offset-4",children:n.status==="paid"?t("cloud.action.renew"):t("cloud.action.choose_plan")}):null,l==="refunded"?e.jsx(x,{as:w,to:"/settings?section=cloud",className:"w-full no-underline",children:t("cloud.action.manage_membership")}):null,e.jsxs("details",{className:"border-t border-oai-gray-200 pt-4 dark:border-oai-gray-800",children:[e.jsxs("summary",{className:"min-h-10 cursor-pointer text-xs leading-10 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",children:[t("cloud.checkout.order_id")," · ",n.id.slice(0,8)]}),e.jsx("p",{className:"mb-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:_t(n.provider)}),e.jsx("p",{className:"text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.order_id")}),e.jsx("p",{className:"mt-1 break-all font-mono text-xs select-all",children:n.id}),n.status!=="paid"&&n.expires_at?e.jsx("p",{className:"mt-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.expires",{date:kt(n.expires_at)})}):null]})]})}else O=e.jsx(E,{children:s?t("cloud.error.order_not_found"):t("cloud.checkout.choose_plan")});const Oe=e.jsxs("div",{className:"space-y-3",children:[R?e.jsx(E,{error:R,onRetry:s?Se?J:De:void 0}):null,R&&["subscription_already_exists","fixed_term_still_active","checkout_request_conflict","pending_checkout_exists","gift_membership_active"].includes(R.code||R.message)?e.jsx(x,{as:w,to:"/settings?section=cloud",variant:"secondary",className:"no-underline",children:t("cloud.action.manage_membership")}):null,R&&["authentication_required","invalid_token","invalid_authentication"].includes(R.code||R.message)?e.jsx(x,{onClick:async()=>{await k?.signOut?.(),re.current=u,te({nextPath:u,subtitle:de,closePath:"/cloud"})},variant:"secondary",children:t("cloud.action.sign_in_continue")}):null,j?e.jsx(E,{error:j,onRetry:Ce}):null,U?e.jsx(E,{error:U,onRetry:q}):null,!j&&_?e.jsx(E,{children:t("cloud.catalog.loading")}):null,!j&&!_&&!g?e.jsx(E,{children:t("cloud.catalog.preview")}):null,!j&&!_&&g&&!L&&!R&&!I&&["review","creating","awaiting"].includes(l)?e.jsx(E,{children:t("cloud.catalog.provider_unavailable")}):null,!j&&!_&&g&&S?.environment==="sandbox"?e.jsx(E,{children:t("cloud.catalog.sandbox")}):null]});return B?e.jsx(yt,{}):!r&&!s?e.jsx(e.Fragment,{children:e.jsx(Rt,{catalogState:{catalog:S,loading:_,error:j,refresh:Ce},accountState:{account:f,auth:k,loading:G,error:U,refresh:q},selection:{termMonths:Xe,billingMode:C}})}):et&&r&&!s?e.jsx("div",{className:"tt-cloud-theme flex flex-1 flex-col font-oai text-oai-black dark:text-oai-white",children:e.jsxs("main",{className:"mx-auto w-full max-w-lg px-4 py-12 sm:px-6",children:[e.jsxs(w,{to:"/cloud",onClick:()=>bt(u),className:"mb-6 inline-flex min-h-10 items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx(Fe,{size:16,"aria-hidden":!0}),t("cloud.checkout.back")]}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:he}),h||k?.loading||_||G?e.jsxs("p",{role:"status",className:"mt-5 flex items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400",children:[e.jsx(Ue,{className:"motion-safe:animate-spin",size:17,"aria-hidden":!0}),he]}):null,e.jsx("div",{className:"mt-5",children:Oe}),R&&!h?e.jsx(x,{onClick:()=>L?me(!0):ue(!0),disabled:G||!!U||_||!!j||!g||(L?!p?.trial_available:!m||!I||b||W||le&&C!=="fixed"||oe),className:"mt-5 w-full",children:t("cloud.action.retry")}):null]})}):e.jsx("div",{className:"tt-cloud-theme flex flex-1 flex-col font-oai text-oai-black dark:text-oai-white",children:e.jsxs("main",{className:"mx-auto w-full max-w-xl px-4 py-8 sm:px-6 sm:py-12",children:[e.jsxs(w,{to:"/cloud",className:"mb-7 inline-flex min-h-10 items-center gap-2 text-sm text-oai-gray-500 dark:text-oai-gray-400 hover:text-oai-brand focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-oai-brand",children:[e.jsx(Fe,{size:16,"aria-hidden":!0}),t("cloud.checkout.back")]}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight","aria-live":"polite",children:ge?t("cloud.checkout.loading"):st[l]}),S?.environment==="sandbox"&&!L?e.jsx("p",{className:"mt-2 text-xs text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.price.draft")}):null,b?e.jsx("div",{className:"mt-5",children:e.jsx(vt,{})}):null,e.jsx("div",{className:"mt-7",children:e.jsxs(St,{bodyClassName:"sm:p-7",children:[O,Be?e.jsxs("div",{className:"mt-5 space-y-3 border-t border-oai-gray-200 pt-5 dark:border-oai-gray-800",children:[e.jsx("p",{className:"text-sm leading-6 text-oai-gray-500 dark:text-oai-gray-400",children:t("cloud.checkout.return_app_hint")}),e.jsx("a",{href:Be,className:"inline-flex min-h-10 items-center text-sm underline underline-offset-4",children:t("cloud.action.open_app")})]}):null]})}),e.jsx("div",{className:"mt-5",children:Oe})]})})}export{Kt as CloudCheckoutPage};
@@ -1 +0,0 @@
1
- import{a as b,r as l,j as r,c as e,f as v}from"./__vite-browser-external-DtVR8sgH.js";const f={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"1.5.9",VITE_INSFORGE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3OC0xMjM0LTU2NzgtOTBhYi1jZGVmMTIzNDU2NzgiLCJlbWFpbCI6ImFub25AaW5zZm9yZ2UuY29tIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODExNDU5NDd9.T0auta_IrVIh0uXW1bob5QSnzvsnJmN28r5XkSGEuQY",VITE_INSFORGE_BASE_URL:"https://srctyff5.us-east.insforge.app",VITE_SENTRY_DSN:"https://5f9fc9cc76a1d9320197c63a4cbef478@o4512274440781824.ingest.us.sentry.io/4512286762139648"};function x(){return v(),`${(f&&"https://srctyff5.us-east.insforge.app"||"https://srctyff5.us-east.insforge.app").replace(/\/$/,"")}/functions/tokentracker-device-flow-grant`}function p(s){return(s||"").toUpperCase().replace(/\s+/g,"").replace(/[^A-Z0-9-]/g,"")}function h(){const s=b(),[m,g]=l.useState(""),[i,a]=l.useState({kind:"idle",message:""});l.useEffect(()=>{try{const d=new URLSearchParams(window.location.search).get("user_code");d&&g(p(d))}catch{}},[]);async function u(c){if(c?.preventDefault?.(),!s?.signedIn){a({kind:"error",message:e("device.approval.error.sign_in")});return}const d=p(m);if(!/^[A-HJKMNP-Z2-9]{4}-[A-HJKMNP-Z2-9]{4}$/.test(d)){a({kind:"error",message:e("device.approval.error.invalid_code")});return}a({kind:"working",message:e("device.approval.action.approving")});try{const n=await s.getAccessToken?.();if(!n){a({kind:"error",message:e("device.approval.error.no_token")});return}const o=await fetch(x(),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({user_code:d})}),t=await o.json().catch(()=>({}));o.ok?a({kind:"success",message:t.status==="already_approved"?t.client_info?e("device.approval.success.already_client",{client:t.client_info}):e("device.approval.success.already"):t.client_info?e("device.approval.success.approved_client",{client:t.client_info}):e("device.approval.success.approved")}):o.status===404?a({kind:"error",message:e("device.approval.error.not_found")}):o.status===410?a({kind:"error",message:e("device.approval.error.expired")}):o.status===401?a({kind:"error",message:e("device.approval.error.session_expired")}):a({kind:"error",message:t?.error?e("device.approval.error.server_detail",{message:t.error}):e("device.approval.error.server",{status:o.status})})}catch(n){a({kind:"error",message:e("device.approval.error.network",{message:n?.message||n})})}}return r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white dark:bg-oai-gray-950 px-6 py-12",children:r.jsxs("div",{className:"w-full max-w-md rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 p-8",children:[r.jsx("h1",{className:"text-2xl font-semibold text-oai-gray-900 dark:text-white mb-2",children:e("device.approval.title")}),r.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-400 mb-6",children:e("device.approval.description")}),s?.signedIn?null:r.jsx("div",{className:"rounded-md border border-amber-200 bg-amber-50 dark:bg-amber-900/20 dark:border-amber-800 p-4 mb-4",children:r.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:e("device.approval.sign_in_banner")})}),r.jsxs("form",{onSubmit:u,className:"space-y-4",children:[r.jsxs("label",{className:"block",children:[r.jsx("span",{className:"block text-xs font-medium uppercase tracking-wide text-oai-gray-500 dark:text-oai-gray-400 mb-1",children:e("device.approval.code_label")}),r.jsx("input",{type:"text",value:m,onChange:c=>g(p(c.target.value)),placeholder:"XXXX-XXXX",spellCheck:!1,autoCapitalize:"characters",maxLength:9,className:"w-full font-mono text-xl tracking-widest text-center rounded-md border border-oai-gray-300 dark:border-oai-gray-700 bg-white dark:bg-oai-gray-900 text-oai-gray-900 dark:text-white px-4 py-3 focus:outline-none focus:ring-inset focus:ring-2 focus:ring-emerald-600"})]}),r.jsx("button",{type:"submit",disabled:i.kind==="working"||!s?.signedIn,className:"w-full rounded-md bg-emerald-600 hover:bg-emerald-500 disabled:bg-oai-gray-300 disabled:cursor-not-allowed text-white font-medium py-3 transition-colors",children:i.kind==="working"?e("device.approval.action.approving"):e("device.approval.action.approve")})]}),i.kind==="success"&&r.jsx("div",{className:"mt-4 rounded-md border border-emerald-200 bg-emerald-50 dark:bg-emerald-900/20 dark:border-emerald-800 p-4",children:r.jsx("p",{className:"text-sm text-emerald-700 dark:text-emerald-300",children:i.message})}),i.kind==="error"&&r.jsx("div",{className:"mt-4 rounded-md border border-red-200 bg-red-50 dark:bg-red-900/20 dark:border-red-800 p-4",children:r.jsx("p",{className:"text-sm text-red-700 dark:text-red-300",children:i.message})})]})})}export{h as default};
@@ -1 +0,0 @@
1
- import{r as n,J as a}from"./__vite-browser-external-DtVR8sgH.js";import{u as p}from"./DialogTitle-DD0PN4lA.js";import{u as c}from"./composite-CWdL18RN.js";const x=n.forwardRef(function(e,r){const{render:l,className:u,style:m,id:s,...t}=e,i=p(),o=c(s);return i.useSyncedValueWithCleanup("descriptionElementId",o),a("p",e,{ref:r,props:[{id:o},t]})});export{x as D};
@@ -1 +0,0 @@
1
- import{r as o}from"./__vite-browser-external-DtVR8sgH.js";import{h as r,i as t,p as s}from"./react-CgvoKjQY.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};