your-ai-workflow-firebase-os 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AccessNotice-BZ5Gt1nP.js +40 -0
- package/dist/AccessNotice-CN7kc70o.cjs +1 -0
- package/dist/{AddressField-R-HvndkG.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BkzFOo2t.cjs → AddressField-B7wtV8yA.cjs} +1 -1
- package/dist/Assets-DBMwZ3bN.cjs +1 -0
- package/dist/Assets-DT-NU_WO.js +296 -0
- package/dist/Attachments-Bl9_dfsu.js +46 -0
- package/dist/Attachments-UVK9SRXf.cjs +1 -0
- package/dist/Billing-0RIHayHy.cjs +1 -0
- package/dist/Billing-FNE2r3_d.js +379 -0
- package/dist/BookingCalendar-BP5kiv3d.cjs +1 -0
- package/dist/BookingCalendar-DZ2fEFja.js +309 -0
- package/dist/Button-4lzOE31p.js +48 -0
- package/dist/Button-5DlB2MCi.cjs +1 -0
- package/dist/CalendarView-BimoXy_k.cjs +1 -0
- package/dist/CalendarView-D-ykjpvI.js +664 -0
- package/dist/ConfirmModal-Di9GR-vV.cjs +1 -0
- package/dist/ConfirmModal-gKQEpd4d.js +113 -0
- package/dist/ContactPopup-BXnHrRwl.js +1114 -0
- package/dist/ContactPopup-lxmRMoIa.cjs +1 -0
- package/dist/CopyLink-BpEQWmfI.cjs +1 -0
- package/dist/CopyLink-CBAVfcm1.js +43 -0
- package/dist/DashboardNav-CXa_ci-_.cjs +1 -0
- package/dist/DashboardNav-Dmn7PVSp.js +886 -0
- package/dist/EmailAdmin-CjN_rvxT.js +318 -0
- package/dist/EmailAdmin-lAEBdY1s.cjs +1 -0
- package/dist/EventCard-46EquygT.cjs +1 -0
- package/dist/EventCard-B6xD-mk3.js +97 -0
- package/dist/FileViewerPopup-CX-J75TM.js +1283 -0
- package/dist/FileViewerPopup-D8-MmIoS.cjs +3 -0
- package/dist/FormNote-BivRNA3J.js +50 -0
- package/dist/FormNote-BtdTGpml.cjs +1 -0
- package/dist/FormsAdmin-B5PBCG2W.js +812 -0
- package/dist/FormsAdmin-BQCULvi5.cjs +1 -0
- package/dist/Inbox-BPk2ZkE5.js +779 -0
- package/dist/Inbox-DNrcBx0o.cjs +3 -0
- package/dist/Loader-Bu89fsbB.cjs +1 -0
- package/dist/Loader-D4gwgBOq.js +32 -0
- package/dist/ManagePlanButton-B0dwqZBd.cjs +1 -0
- package/dist/ManagePlanButton-BSrOHYze.js +29 -0
- package/dist/MyBookings-6qr0GgzO.cjs +1 -0
- package/dist/MyBookings-BQjGM2LQ.js +113 -0
- package/dist/PageTitle-CZhgmmDT.cjs +3 -0
- package/dist/PageTitle-D93YCiN8.js +1606 -0
- package/dist/PagesAdmin-BcHIcqM5.cjs +34 -0
- package/dist/PagesAdmin-D69P9nRb.js +5802 -0
- package/dist/PagesAdmin-DNwZOKjA.cjs +1 -0
- package/dist/PagesAdmin-HUITEcHx.js +3 -0
- package/dist/PaymentsAdmin-C2iCI9qC.js +1291 -0
- package/dist/PaymentsAdmin-CoXi2vCm.cjs +2 -0
- package/dist/{PhoneInputField-B3P_vUDW.cjs → PhoneInputField-BEwYZMB7.cjs} +1 -1
- package/dist/{PhoneInputField-BlYHb5e0.js → PhoneInputField-BG0L2djE.js} +2 -2
- package/dist/PhoneInputField-DfOtCIH_.js +2 -0
- package/dist/{PhoneInputField-CdNTvWXQ.cjs → PhoneInputField-jhWvto8C.cjs} +1 -1
- package/dist/Popup-DHYGFl2-.cjs +1 -0
- package/dist/Popup-xROLytgr.js +142 -0
- package/dist/ProviderMark-BBfaM5Yl.js +52 -0
- package/dist/ProviderMark-xLkUN3Fx.cjs +1 -0
- package/dist/PublishApp-Bm-6r3Td.js +595 -0
- package/dist/PublishApp-D4XJUkJa.cjs +2 -0
- package/dist/Said-CoC15awL.js +94 -0
- package/dist/Said-IqCNofdh.cjs +1 -0
- package/dist/ScheduleAdmin-BKfQkrR8.js +1853 -0
- package/dist/ScheduleAdmin-DwK36GAZ.cjs +1 -0
- package/dist/SchedulePicker--urIH2Eb.js +112 -0
- package/dist/SchedulePicker-nmqzUnUH.cjs +1 -0
- package/dist/Setup-CHLgd-ag.js +849 -0
- package/dist/Setup-CaDranTm.cjs +1374 -0
- package/dist/SetupPayments-CVIwh1eQ.js +411 -0
- package/dist/SetupPayments-HNXWA25X.cjs +1 -0
- package/dist/SignInAdmin-C94-A-0w.cjs +4 -0
- package/dist/SignInAdmin-Yxgv_8U4.js +766 -0
- package/dist/SupportBar-CDT0HwdP.cjs +1 -0
- package/dist/SupportBar-CN_JGC-9.js +117 -0
- package/dist/SystemTabContent-L3vGGF3P.cjs +1 -0
- package/dist/SystemTabContent-QdxxLILE.js +35 -0
- package/dist/TemplateDrive-DV8zNjYe.cjs +1 -0
- package/dist/TemplateDrive-NJY_AAvV.js +1197 -0
- package/dist/ThemeAdmin-BzFjJkLg.js +269 -0
- package/dist/ThemeAdmin-DVnPNxe7.cjs +1 -0
- package/dist/ThemeAdmin-DY7Vc4Sj.cjs +3 -0
- package/dist/ThemeAdmin-DnC-D2N3.js +2 -0
- package/dist/{ContactPopup-9J_YeJrb.js → TimeZoneField-DkI1Bkcz.js} +3382 -5513
- package/dist/TimeZoneField-qs7NPR30.cjs +12 -0
- package/dist/TransactionsAdmin-BsZ-oQWi.js +582 -0
- package/dist/TransactionsAdmin-CTSTiPld.cjs +1 -0
- package/dist/Trouble-9es_AI4F.cjs +1 -0
- package/dist/Trouble-oWt9fMsm.js +164 -0
- package/dist/Users-CTitWXyd.cjs +1 -0
- package/dist/Users-DJjQTWJF.js +1207 -0
- package/dist/aiModels-DIP9fn8T.cjs +1 -0
- package/dist/{aiModels-BHlEfuRJ.js → aiModels-DnDhNGup.js} +29 -61
- package/dist/arrivalRoads-BJ-35vkk.js +228 -0
- package/dist/arrivalRoads-qoU-B4jt.cjs +4 -0
- package/dist/{bake-D0gLVNTL.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-OErV2MLy.js → bake-naZeMu98.js} +14 -14
- package/dist/bookingPages-C7a3srPG.js +102 -0
- package/dist/bookingPages-DvbFbD9X.cjs +1 -0
- package/dist/components/CustomSelect.d.ts +7 -1
- package/dist/components/RegistrationFields.d.ts +6 -1
- package/dist/components/Reveal.d.ts +12 -0
- package/dist/components/ScrollToTop.d.ts +4 -0
- package/dist/contentFallback-C9MZjdq7.cjs +1 -0
- package/dist/contentFallback-CEDY0Pwp.js +96 -0
- package/dist/contentKey-Bwry4lDa.js +13 -0
- package/dist/contentKey-DJGYYnAE.cjs +1 -0
- package/dist/{dist-_zWHDDrc.js → dist-DUPvBnOA.js} +1 -1
- package/dist/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-B0qxHYQL.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-uhq3pGCS.js → fileBytes-bjgvCfWu.js} +2 -2
- package/dist/forms-Bvx9HTM6.js +75 -0
- package/dist/forms-CmNeTETW.cjs +1 -0
- package/dist/lib/ThemeContext.d.ts +0 -14
- package/dist/lib/bareImgWatch.d.ts +6 -1
- package/dist/lib/localEdits.d.ts +2 -0
- package/dist/lib/pageDesignLines.d.ts +1 -1
- package/dist/lib/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- package/dist/lib/people.d.ts +9 -0
- package/dist/lib/recordsKey.d.ts +24 -0
- package/dist/{lucide-react-DiyP8FA_.js → lucide-react-CA7GD7Nv.js} +8 -8
- package/dist/notices-B7iIrIEg.js +29 -0
- package/dist/notices-upMg8UVh.cjs +1 -0
- package/dist/openOnArrival-Buwqb86D.cjs +1 -0
- package/dist/openOnArrival-S2K6v-lB.js +35 -0
- package/dist/pageFiles--Ih60ITP.js +45 -0
- package/dist/pageFiles-UtBmlOcD.cjs +1 -0
- package/dist/pages/PagesAdmin.d.ts +69 -7
- package/dist/{pdf-DLuvpvHg.js → pdf-DRXcPGkr.js} +1 -1
- package/dist/{pdf.worker.min-C0gkd2Ec.js → pdf.worker.min-CfKZezeM.js} +1 -1
- package/dist/people-2jZE_pdI.js +102 -0
- package/dist/people-BpVvIr9-.cjs +1 -0
- package/dist/personName-CFw3pxuu.js +18 -0
- package/dist/personName-CbzN_i57.cjs +1 -0
- package/dist/publishSteps-C1cDFzzB.js +88 -0
- package/dist/publishSteps-SSm8afDw.cjs +1 -0
- package/dist/recordLock-DHVvI9bP.js +61 -0
- package/dist/recordLock-DWeIxiwh.cjs +1 -0
- package/dist/recordsKey-B7QrxdeU.cjs +1 -0
- package/dist/recordsKey-D5-wC0Aw.js +141 -0
- package/dist/registrationFields-CLeR2lQJ.js +181 -0
- package/dist/registrationFields-v4pOoRdn.cjs +1 -0
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/roles-D6VaHWfV.js +147 -0
- package/dist/roles-DQUFFBQe.cjs +1 -0
- package/dist/scheduleData-ATN8w5hI.js +727 -0
- package/dist/scheduleData-Cltj0ABZ.cjs +1 -0
- package/dist/server.cjs.js +6 -6
- package/dist/server.es.js +716 -715
- package/dist/serviceStatus-TQyZO_Y_.cjs +1 -0
- package/dist/serviceStatus-vS8AI7SZ.js +125 -0
- package/dist/tabAudience-BqpN6dsR.cjs +1 -0
- package/dist/tabAudience-CRyMvv0v.js +34 -0
- package/dist/transactions-BqMQDRx3.js +343 -0
- package/dist/transactions-CufFrdAM.cjs +1 -0
- package/dist/useIsPhone-BVGx_X3e.js +13 -0
- package/dist/useIsPhone-o63tNneA.cjs +1 -0
- package/dist/{validate-DzSJWuyL.js → validate-CmC_tLK-.js} +433 -351
- package/dist/validate-DZMwqSrb.cjs +103 -0
- package/dist/vite/validate.d.ts +14 -0
- package/dist/vite.cjs.js +1 -1
- package/dist/vite.es.js +1 -1
- package/dist/your-ai-workflow-firebase-os.cjs.js +15 -1431
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +11695 -35911
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-DF8qQCoY.cjs +0 -12
- package/dist/PhoneInputField-Btx07xvM.js +0 -2
- package/dist/aiModels-BIhoTNH0.cjs +0 -1
- package/dist/validate-e48WXJdP.cjs +0 -103
- /package/dist/{address-DI1YaCI4.cjs → address-Bsb8COq2.cjs} +0 -0
- /package/dist/{address-Ca1h_UZX.js → address-C2bHNxJU.js} +0 -0
- /package/dist/{dist-BLGlDv1e.cjs → dist-E4jTFPs7.cjs} +0 -0
- /package/dist/{lucide-react-BYniZ3lQ.cjs → lucide-react-BwV6L6Is.cjs} +0 -0
- /package/dist/{mediaKind-dk396a03.cjs → mediaKind-D0MWyv6b.cjs} +0 -0
- /package/dist/{mediaKind-De2Cx_kB.js → mediaKind-DmKMsjeY.js} +0 -0
- /package/dist/{pdf-CC5g01eC.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-pI_P-OCl.cjs → pdf.worker.min-bLgNWd7w.cjs} +0 -0
- /package/dist/{verifiedAccount-C1iCxopN.js → verifiedAccount-DRbRFJ6H.js} +0 -0
- /package/dist/{verifiedAccount-D3OeaOBo.cjs → verifiedAccount-DScyKk96.cjs} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PageTitle-CZhgmmDT.cjs`),t=require(`./TimeZoneField-qs7NPR30.cjs`),n=require(`./DashboardNav-CXa_ci-_.cjs`),r=require(`./verifiedAccount-DScyKk96.cjs`),i=require(`./lucide-react-BwV6L6Is.cjs`),a=require(`./roles-DQUFFBQe.cjs`),o=require(`./transactions-CufFrdAM.cjs`),s=require(`./ConfirmModal-Di9GR-vV.cjs`),c=require(`./recordsKey-B7QrxdeU.cjs`),l=require(`./Said-IqCNofdh.cjs`),u=require(`./Setup-CaDranTm.cjs`),d=require(`./SupportBar-CDT0HwdP.cjs`),f=require(`./serviceStatus-TQyZO_Y_.cjs`),p=require(`./SetupPayments-HNXWA25X.cjs`),m=require(`./PagesAdmin-BcHIcqM5.cjs`),h=require(`./CopyLink-BpEQWmfI.cjs`),g=require(`./publishSteps-SSm8afDw.cjs`);let _=require(`react`),v=require(`react/jsx-runtime`),y=require(`firebase/firestore`),b=require(`react-router-dom`);function x({product:e,live:n,open:r,onToggle:a,onChange:o,forPage:s,onAddToPage:c}){let l=t=>o({...e,...t});if(!t.Zi(e,n))return(0,v.jsx)(`div`,{className:`rounded-2xl border border-[var(--panel-border)] opacity-50`,"aria-disabled":`true`,children:(0,v.jsxs)(`div`,{className:`w-full flex items-center justify-between gap-3 px-4 py-3`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/60 truncate`,children:t.$i(e)}),(0,v.jsx)(t.v,{state:`off`,label:`Finish it above first`})]})});let u=t.Xi(e),d=e.kind===`subscription`;return(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]`,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:a,"aria-expanded":r,className:`w-full flex items-center justify-between gap-3 px-4 py-3 text-left cursor-pointer`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/75 truncate`,children:t.$i(e)}),(0,v.jsxs)(`span`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,v.jsx)(t.v,{state:u?`off`:`saved`,label:u?`Question left`:`Ready for pages`}),(0,v.jsx)(i.on,{className:`w-3.5 h-3.5 text-foreground/40 shrink-0 transition-transform ${r?`rotate-180`:``}`})]})]}),r&&(0,v.jsxs)(`div`,{className:`px-4 pb-4 pt-4 border-t border-[var(--panel-border)]/60 flex flex-col gap-4`,children:[(0,v.jsx)(t.b,{label:`How will this payment work?`,hint:d?`Start to finish, in your own words — what someone does, pays, and gets. Worth saying if you care: what they tell you before paying (never their email — Stripe asks for that), what each plan unlocks, and what happens the moment they subscribe. Whatever you skip, your assistant decides.`:`Start to finish, in your own words — what someone does, pays, and gets. Worth saying if you care: what they tell you before paying (never their email — Stripe asks for that) and what happens after they pay. Whatever you skip, your assistant decides.`,value:e.how,onChange:e=>l({how:e}),placeholder:d?`People pick a plan and pay, and their member area unlocks the same minute — Basic gets the videos, Pro gets the videos and a monthly call.`:`People pick a time, tell me their phone number and what they need, pay, and the booking is theirs — it appears under Bookings with the session they chose.`}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-2xl border border-[var(--panel-border)]/60 px-4 py-3.5`,children:[(0,v.jsx)(t.C,{label:`Email the buyer a confirmation`,hint:`Needs email set up on this screen.`,hintWideOnly:!0,enabled:e.emailReceipt,onChange:e=>l({emailReceipt:e})}),(0,v.jsx)(t.C,{label:`Email me when someone buys`,hint:`Needs email set up on this screen.`,hintWideOnly:!0,enabled:e.notifyOwner,onChange:e=>l({notifyOwner:e})})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pt-1`,children:[u?(0,v.jsx)(`span`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:u}):s?(0,v.jsx)(`span`,{className:`text-[11.5px] font-semibold text-emerald-500`,children:`Ready to add to pages — add it to ${s.title} and go back.`}):(0,v.jsxs)(`span`,{className:`text-[11.5px] font-semibold text-emerald-500`,children:[`Ready to add to pages — open a page on the`,` `,(0,v.jsx)(b.Link,{to:`/pages`,className:`font-bold hover:underline`,children:`Pages screen`}),` and add it under Payments.`]}),!u&&s&&c?(0,v.jsx)(t.o,{icon:e.pageIds.includes(s.id)?i.bn:i.G,onClick:()=>c(e.id),children:e.pageIds.includes(s.id)?`Back to ${s.title}`:`Add to ${s.title}`}):(0,v.jsx)(`span`,{})]})]})]})}function S({products:e,live:n,openId:r,onToggle:i,onChange:a,forPage:o,onAddToPage:s}){return e===null?(0,v.jsx)(`p`,{className:t.s,children:`Loading your payments…`}):e.length===0?(0,v.jsx)(`p`,{className:`${t.s} px-1`,children:`Nothing here yet. Describe what you sell in the card above — each payment you add appears here with one question: how it works, start to finish.`}):(0,v.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map(e=>(0,v.jsx)(x,{product:e,live:n,open:r===e.id,onToggle:()=>i(e.id),onChange:a,forPage:o,onAddToPage:s},e.id))})}var C=e=>m.Vn(`pay-${t.Ji(e)}`)||`pay-${e.id}`,w=e=>{let n=t.Ui(e).map(e=>e.amount.trim()).filter(Boolean).join(` + `);return`${t.Ji(e)}${n?` — ${n}`:``}`};function T(e,n,r){return[m.cn(n,r),`This page is the page of my payment link for ${t.Ji(e)} — everyone I send ${n.path} to lands here and pays here.`,...t.Qi(e,n.path)].join(`
|
|
2
|
+
`)}function E({product:n,open:r,onToggle:a,onChange:o,onRemove:c,onCustomise:l}){let[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1),[m,g]=(0,_.useState)(``),[y,b]=(0,_.useState)(``),x=n.customPath.trim(),S=x?x.startsWith(`/`)?x:`/${x}`:t.rn(n.id);return(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 pr-3`,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:a,"aria-expanded":r,className:`flex-1 min-w-0 flex items-center justify-between gap-3 px-4 py-3 text-left cursor-pointer`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/75 truncate`,children:w(n)}),(0,v.jsxs)(`span`,{className:`flex items-center gap-2.5 shrink-0`,children:[(0,v.jsx)(t.v,{state:x?`saved`:`off`,label:x?`Your own page`:`Ready-made page`}),(0,v.jsx)(i.on,{className:`w-3.5 h-3.5 text-foreground/40 shrink-0 transition-transform ${r?`rotate-180`:``}`})]})]}),(0,v.jsx)(t.o,{icon:i.C,tone:`danger`,compact:!0,title:`Remove the link to ${t.Ji(n)}`,onClick:()=>d(!0),children:`Remove`})]}),(0,v.jsx)(s.t,{isOpen:u,title:`Remove the link to ${t.Ji(n)}?`,message:`Its link stops working, and it leaves What you sell and every schedule it was attached to.`,confirmText:`Yes, remove it`,cancelText:`Keep it`,onCancel:()=>d(!1),onConfirm:()=>{d(!1),c()}}),r&&(0,v.jsxs)(`div`,{className:`px-4 pb-4 pt-4 border-t border-[var(--panel-border)]/60 flex flex-col gap-4`,children:[(0,v.jsx)(t.i,{label:`The link`,hint:`Send it to anyone. The page wears your theme and your app's name.`,children:(0,v.jsx)(h.t,{title:t.Ji(n),path:S})}),(0,v.jsx)(t.x,{label:`What is it called?`,value:t.Ui(n)[0]?.name||``,onChange:e=>o({...n,items:[{...t.Ui(n)[0]||{amount:``},name:e},...t.Ui(n).slice(1)]}),placeholder:`A one-hour session`}),(0,v.jsx)(t.b,{label:`A line or two about it`,hint:`Optional — what the buyer gets. Shown on the page.`,value:n.description,onChange:e=>o({...n,description:e}),placeholder:`One hour together on whatever you are stuck on.`}),(0,v.jsx)(t.x,{label:`The price`,value:t.Ui(n)[0]?.amount||``,onChange:e=>o({...n,items:[{...t.Ui(n)[0]||{name:``},amount:e},...t.Ui(n).slice(1)]}),placeholder:`25`,error:t.Ui(n)[0]?.amount.trim()&&t.qi(t.Ui(n)[0].amount)===null?`Just a number, like 25.`:void 0}),!x&&!f&&!m&&(0,v.jsx)(t.o,{icon:i.u,onClick:()=>p(!0),children:`Customise this page`}),(f||m)&&(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 px-4 py-3.5 flex flex-col gap-4`,children:[(0,v.jsx)(t.b,{label:`What would you like on the page?`,hint:`Describe the page in your own words — what it says, what it shows, how it feels. Your assistant builds it; whatever you skip, it decides.`,value:n.customNote,onChange:e=>o({...n,customNote:e}),placeholder:`A warm page about the session: who it is for, what we cover, two testimonials, then the Pay button.`,rows:3}),y&&(0,v.jsx)(`span`,{className:`text-[11.5px] font-semibold text-red-500 leading-snug px-1`,children:y}),m?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(e.o,{title:`Ask your assistant`,description:`The page exists on the Pages screen now. Paste this into your assistant's chat; once it has built the page, tick the switch below and the link goes there.`,prompt:m}),(0,v.jsx)(t.C,{label:`The page is built — send people there`,hint:`Until this is on, the link opens the ready-made page.`,enabled:!!n.customPath.trim(),onChange:e=>o({...n,customPath:e?`/${C(n)}`:``})})]}):(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(t.o,{icon:i.u,disabled:!n.customNote.trim(),onClick:async()=>{b(``);let e=await l();if(typeof e==`string`){b(e);return}g(e.prompt)},children:`Make the page`}),(0,v.jsx)(t.o,{onClick:()=>{p(!1),b(``)},children:`Never mind`})]})]}),x&&!m&&(0,v.jsx)(t.C,{label:`The page is built — send people there`,hint:`The link opens ${S}. Change the page from its row on the Pages screen. Turn this off to go back to the ready-made page.`,enabled:!0,onChange:e=>o({...n,customPath:e?n.customPath:``})})]})]})}function D({products:e,onChange:n,onRemove:r}){let[a,o]=(0,_.useState)(null),s=e.filter(e=>e.kind===`once`),c=()=>{let e={...t.Ii(`p_${Date.now().toString(36)}`),kind:`once`,items:[{name:``,amount:``}]};n(e),o(e.id)},l=async e=>{let n=C(e),r=`Pay — ${t.Ji(e)}`,i={name:r,address:n,type:`public`,about:e.customNote.trim()};try{await m.Jt(i)}catch(e){return console.error(`Could not make the page`,e),`The page could not be made — make sure you are signed in as an admin and try again.`}let{config:a}=m.Bn(i),o={title:r,path:`/${n}`};return{path:o.path,prompt:T(e,o,a)}};return(0,v.jsx)(t.h,{icon:i.vt,title:`Payment links`,description:`Every one-time payment has a page of its own you can send to anyone — a name, a line about it, a price.`,actions:({open:e})=>(0,v.jsx)(t.o,{icon:i.G,title:`Add a payment link`,onClick:()=>{e(),c()},children:`Add a payment link`}),children:(0,v.jsx)(`div`,{className:`flex flex-col gap-3`,children:s.length===0?(0,v.jsx)(`p`,{className:`${t.s} px-1`,children:`No payment link yet. Add one here — it appears under What you sell too — or describe a one-time payment there and its link shows up here.`}):s.map(e=>(0,v.jsx)(E,{product:e,open:a===e.id,onToggle:()=>o(a===e.id?null:e.id),onChange:n,onRemove:()=>r(e.id),onCustomise:()=>l(e)},e.id))})})}var O=e=>/^price_[A-Za-z0-9]+$/.test(e.trim()),k=`__new_role__`;function A({plan:e,index:n,roles:o,onChange:s,onRemove:c}){let l=t=>s({...e,...t}),u=e.name.trim(),d=u?o.find(e=>e.id===r.O(u)||e.name.trim().toLowerCase()===u.toLowerCase()):void 0,f=u&&!d?a.o(u,o):``,p=!!u&&!d&&!f,h=()=>{if(d){l({roleId:d.id});return}p&&(l({roleId:r.O(u)}),a.n(u).catch(e=>console.error(`Could not make the role`,e)))},g=[...o.map(e=>({value:e.id,label:e.name})),...e.roleId&&!o.some(t=>t.id===e.roleId)?[{value:e.roleId,label:u&&r.O(u)===e.roleId?u:t.ha(e.roleId,o)}]:[],...p?[{value:k,label:`New role: ${u}`}]:[]];return(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 px-4 py-3.5 flex flex-col gap-4`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsxs)(`span`,{className:`text-[11px] font-bold uppercase tracking-widest text-foreground/40`,children:[`Plan `,n+1]}),(0,v.jsx)(t.o,{icon:i.C,tone:`danger`,compact:!0,title:`Remove this plan`,onClick:c,children:`Remove plan`})]}),(0,v.jsx)(t.x,{label:`What is this plan called?`,value:e.name,onChange:e=>l({name:e}),onBlur:()=>{e.roleId||h()},placeholder:`Premium`}),(0,v.jsx)(t._,{label:`Who they become`,hint:!e.roleId&&f?f:`Paying makes them this role; when the plan ends they are a member again.`,value:e.roleId||``,onChange:e=>e===k?h():l({roleId:e}),options:g,placeholder:u?`Choose a role`:`Name the plan first`,allowEmpty:!e.roleId}),(0,v.jsx)(t.x,{label:`One line about it`,hint:`Optional — what a buyer gets on this plan.`,value:e.description,onChange:e=>l({description:e}),placeholder:`Up to 3 projects and email support`}),[[`monthly`,`Billed monthly`,`a month`],[`yearly`,`Billed yearly`,`a year`]].map(([r,i,a])=>(0,v.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-medium text-foreground/80 ml-1`,children:i}),(0,v.jsx)(t.S,{enabled:e[r].on,onChange:t=>l({[r]:{...e[r],on:t}}),label:`${i} — plan ${n+1}`})]}),e[r].on&&(0,v.jsx)(t.x,{label:`The price ${a}`,hint:`Just the number — 25 charges 25 ${a} in your Stripe account's currency.`,value:e[r].amount,onChange:t=>l({[r]:{...e[r],amount:t}}),placeholder:r===`monthly`?`25`:`250`,error:m.Zr(e[r].amount)})]},r))]})}function j({product:e,plan:n,index:r,live:i,onChange:a}){let o=i?`livePriceId`:`priceId`,s=(e,t)=>({...e,[o]:t}),c=(!n.monthly.on||O(n.monthly[o]))&&(!n.yearly.on||O(n.yearly[o])),l=e=>a({...n,...e}),u=e=>e.trim()&&!O(e)?`A price id starts with price_ — copy it from the price you just made.`:void 0;return(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]/60 px-4 py-3.5 flex flex-col gap-3`,children:[(0,v.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-bold text-foreground truncate`,children:n.name.trim()||`Plan ${r+1}`}),(0,v.jsx)(t.v,{state:c?`saved`:`off`,label:c?`Done`:i?`Waiting for its live ids`:`Waiting for its ids`})]}),(0,v.jsx)(`ol`,{className:`space-y-1.5 list-decimal list-inside text-[12.5px] font-medium text-foreground/60 leading-relaxed`,children:t.ra(e,n,i).map((e,t)=>(0,v.jsx)(`li`,{children:e},t))}),n.monthly.on&&(0,v.jsx)(t.x,{label:i?`Paste the live monthly price id`:`Paste the monthly price id`,value:n.monthly[o],onChange:e=>l({monthly:s(n.monthly,e)}),placeholder:`price_…`,error:u(n.monthly[o])}),n.yearly.on&&(0,v.jsx)(t.x,{label:i?`Paste the live yearly price id`:`Paste the yearly price id`,value:n.yearly[o],onChange:e=>l({yearly:s(n.yearly,e)}),placeholder:`price_…`,error:u(n.yearly[o])}),i&&(0,v.jsx)(`p`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:`Your test ids are kept — switch back to test mode on this screen and they are exactly where you left them.`})]})}function M({product:e,open:n,live:r,roles:a,onToggle:o,onChange:c,onRemove:l,onProceed:u}){let d=t=>c({...e,...t}),f=(t,n)=>d({plans:e.plans.map((e,r)=>r===t?n:e)}),p=t.Zi(e,r),h=t.Yi(e,r),[g,y]=(0,_.useState)(!1),b=t.Ji(e);return(0,v.jsxs)(`div`,{className:`rounded-2xl border border-[var(--panel-border)]`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2 pr-3`,children:[(0,v.jsxs)(`button`,{type:`button`,onClick:o,"aria-expanded":n,className:`flex-1 min-w-0 flex items-center justify-between gap-3 px-4 py-3 text-left cursor-pointer`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-semibold text-foreground/75 truncate`,children:t.$i(e)}),(0,v.jsxs)(`span`,{className:`flex items-center gap-2.5 shrink-0`,children:[e.kind&&(0,v.jsx)(t.v,{state:p?`saved`:`off`,label:p?`Ready`:`In progress`}),(0,v.jsx)(i.on,{className:`w-3.5 h-3.5 text-foreground/40 shrink-0 transition-transform ${n?`rotate-180`:``}`})]})]}),(0,v.jsx)(t.o,{icon:i.C,tone:`danger`,compact:!0,title:`Remove ${b}`,onClick:()=>y(!0),children:`Remove`})]}),(0,v.jsx)(s.t,{isOpen:g,title:`Remove ${b}?`,message:`Its answer under How your payments work goes with it, and the pages it is on stop carrying it.`,confirmText:`Yes, remove it`,cancelText:`Keep it`,onCancel:()=>y(!1),onConfirm:()=>{y(!1),l()}}),n&&(0,v.jsxs)(`div`,{className:`px-4 pb-4 pt-4 border-t border-[var(--panel-border)]/60 flex flex-col gap-4`,children:[(0,v.jsx)(t._,{label:`How is it paid?`,value:e.kind,onChange:n=>d({kind:n===`once`||n===`subscription`?n:``,plans:n===`subscription`&&!e.plans.length?[t.Fi()]:e.plans,items:n===`once`&&!e.items.length?[t.Pi()]:e.items}),options:[{value:`once`,label:`Once — one payment`},{value:`subscription`,label:`A subscription that renews`}],placeholder:`Choose one`}),e.kind===`once`&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(t.i,{label:`What are you selling?`,hint:`Each thing with its price — just the number: 25 charges 25 in your Stripe account's currency. Nothing to make in Stripe for a one-off.`,children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[e.items.map((t,n)=>(0,v.jsx)(m.Xr,{item:t,index:n,onChange:t=>d({items:e.items.map((e,r)=>r===n?t:e)}),onRemove:()=>d({items:e.items.filter((e,t)=>t!==n)}),removable:e.items.length>1},n)),(0,v.jsx)(t.o,{icon:i.G,className:`self-start`,onClick:()=>d({items:[...e.items,t.Pi()]}),children:`Add another`})]})}),e.items.length>1&&(0,v.jsx)(t.x,{label:`What do you call this group?`,hint:`Optional — one word for the lot, the way you would say it: Calls, The shop.`,value:e.name,onChange:e=>d({name:e}),placeholder:`Calls`})]}),e.kind===`subscription`&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(t.x,{label:`What is the subscription called?`,value:e.name,onChange:e=>d({name:e}),placeholder:`Membership`}),(0,v.jsx)(t.b,{label:`One line about it`,hint:`Optional — your assistant uses it on the page.`,value:e.description,onChange:e=>d({description:e}),placeholder:`Everything in the studio, every month.`}),(0,v.jsx)(t.i,{label:`Its plans`,hint:`Each plan can be billed monthly, yearly, or both.`,children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[e.plans.map((t,n)=>(0,v.jsx)(A,{plan:t,index:n,roles:a,onChange:e=>f(n,e),onRemove:()=>d({plans:e.plans.filter((e,t)=>t!==n)})},n)),(0,v.jsx)(t.o,{icon:i.G,className:`self-start`,onClick:()=>d({plans:[...e.plans,t.Fi()]}),children:`Add a plan`})]})}),t.Ki(e)&&(0,v.jsx)(t.i,{label:r?`Now make it in Stripe — live mode`:`Now make it in Stripe`,hint:r?`Live mode is a fresh Stripe catalogue: make each plan again with Test mode OFF, and paste the live ids it produces.`:`Five minutes in your Stripe dashboard. Each plan below says exactly what to do and takes the id it produces.`,children:(0,v.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.plans.map((t,n)=>(0,v.jsx)(j,{product:e,plan:t,index:n,live:r,onChange:e=>f(n,e)},n))})})]}),(0,v.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pt-1`,children:[e.kind&&!p?(0,v.jsx)(`span`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:h}):e.kind?(0,v.jsx)(`span`,{className:`text-[11.5px] font-semibold text-emerald-500`,children:`Ready — press Proceed to say how it works.`}):(0,v.jsx)(`span`,{}),p?(0,v.jsx)(t.o,{icon:i.yn,onClick:u,children:`Proceed`}):(0,v.jsx)(`span`,{})]})]})]})}function N(){let[e,n]=(0,_.useState)(null),[r,o]=(0,_.useState)(!1),[s,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),[p,m]=(0,_.useState)(``),h=(0,_.useRef)(new Map),g=(0,_.useRef)(null),x=(0,_.useRef)(null),C=c.u(),w=(0,b.useNavigate)(),[T,E]=(0,b.useSearchParams)(),[O]=(0,_.useState)(()=>T.get(`page`)||``),k=O?(C||[]).find(e=>e.id===O):void 0,A=(0,_.useRef)({done:!1,open:T.get(`open`)||``,wantsNew:T.get(`new`)===`subscription`}),j=a.l();t.Si(`${r}:${(e||[]).reduce((e,t)=>e+(t.plans||[]).filter(e=>e.roleId).length,0)}`);let N=e=>{let n=h.current.get(e.id);n&&clearTimeout(n),h.current.set(e.id,setTimeout(async()=>{h.current.delete(e.id);try{let{id:n,...r}=e;await(0,y.setDoc)((0,y.doc)(t.ka,t.Ei,n),r)}catch(e){console.error(`Could not save the product`,e),l.n(t.Ta(e,`That change to what you sell could not be saved.`))}},600))};(0,_.useEffect)(()=>{let e=(e,r)=>{let i=A.current;if(i.done||!i.open&&!i.wantsNew)return;i.done=!0;let a=i.open?e.find(e=>e.id===i.open):void 0;if(a)u(a.id);else if(i.wantsNew){let i=e.find(e=>e.kind===`subscription`&&!e.name.trim()&&!t.Zi(e,r));if(i)u(i.id);else{let r={...t.Ii(`p_${Date.now().toString(36)}`),kind:`subscription`,plans:[t.Fi()]};n([...e,r]),u(r.id),N(r)}}setTimeout(()=>g.current?.scrollIntoView?.({behavior:`smooth`,block:`start`}),0),E(e=>{let t=new URLSearchParams(e);return t.delete(`new`),t.delete(`open`),t},{replace:!0})},r=t.ya(t.Ei,()=>(0,y.collection)(t.ka,t.Ei),r=>{let i=!!r.docs.find(e=>e.id===t.Di)?.data()?.liveMode;if(o(i),t.na(i),h.current.size)return;let a=[];r.forEach(e=>{e.id!==`_settings`&&a.push(t.ea(e.id,e.data()))}),a.sort((e,t)=>(e.createdAt||0)-(t.createdAt||0)),n(a),e(a,i)},()=>n([]));return()=>r()},[]);let P=e=>{n(t=>{let n=t||[];return n.some(t=>t.id===e.id)?n.map(t=>t.id===e.id?e:t):[...n,e]}),N(e)},F=()=>{let e=t.Ii(`p_${Date.now().toString(36)}`);n(t=>[...t||[],e]),u(e.id),N(e)},I=async r=>{let i=h.current.get(r);i&&(clearTimeout(i),h.current.delete(r));let a=(e||[]).find(e=>e.id===r);m(``),n(e=>(e||[]).filter(e=>e.id!==r)),s===r&&u(null),d===r&&f(null);try{await(0,y.deleteDoc)((0,y.doc)(t.ka,t.Ei,r))}catch(e){console.error(`Could not remove the product`,e),a&&n(e=>{let t=e||[];return t.some(e=>e.id===r)?t:[...t,a].sort((e,t)=>(e.createdAt||0)-(t.createdAt||0))}),m(`It could not be removed — make sure you are signed in as an admin and try again.`)}},L=e=>{u(null),f(e),x.current?.scrollIntoView({behavior:`smooth`,block:`start`})};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`div`,{ref:g,children:(0,v.jsx)(t.h,{icon:i.A,title:`What you sell`,description:`Things paid for once, each with a price; or a subscription with plans and their Stripe ids.`,children:(0,v.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[O&&(0,v.jsx)(`p`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug px-1`,children:`Making a payment for ${k?.title||`your page`}. Fill it in, press Proceed, say how it works — then add it to the page.`}),e===null?(0,v.jsx)(`p`,{className:t.s,children:`Loading what you sell…`}):(0,v.jsxs)(v.Fragment,{children:[e.length===0&&(0,v.jsx)(`p`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug px-1`,children:`Nothing here yet. Describe what you sell once — things paid for once need nothing from Stripe, and a subscription walks you through Stripe step by step — then say how it works in the section below, and add it to a page from the Pages screen.`}),e.map(e=>(0,v.jsx)(M,{product:e,open:s===e.id,live:r,roles:j,onToggle:()=>u(s===e.id?null:e.id),onChange:P,onRemove:()=>I(e.id),onProceed:()=>L(e.id)},e.id)),!!p&&(0,v.jsx)(`p`,{className:`text-[12px] font-semibold text-red-500 px-1`,children:p}),(0,v.jsx)(t.o,{icon:i.G,className:`self-start`,onClick:F,children:`Add something you sell`})]})]})})}),(0,v.jsx)(`div`,{ref:x,children:(0,v.jsx)(t.h,{icon:i.c,title:`How your payments work`,description:`One answer per payment: what someone does, pays, and gets. Then add it to any page from its Payments section on the Pages screen.`,children:(0,v.jsx)(S,{products:e,live:r,openId:d,onToggle:e=>f(d===e?null:e),onChange:P,forPage:k?{id:k.id,title:k.title}:void 0,onAddToPage:e=>{O&&w(t.Mi(O,e))}})})}),(0,v.jsx)(D,{products:e||[],onChange:P,onRemove:I})]})}function P(e,t){return!e&&t!==`live`?{state:`off`,label:`In test mode`}:t===`live`?{state:`saved`,label:`Live`}:{state:`saving`,label:`Waiting for the live key`}}var F=[`checkout.session.completed`,`checkout.session.async_payment_succeeded`],I=`text-[12.5px] font-medium text-foreground/70 leading-relaxed`,L=`mt-1.5 space-y-1 list-disc list-inside marker:text-foreground/30`,R=`my-2 glass-panel border border-[var(--panel-border)] rounded-2xl overflow-hidden bg-background`;function z(){let[n,r]=(0,_.useState)(null),[a,o]=(0,_.useState)([]),{status:s}=f.r(5e3),c=s?.mode??null,l=s?.webhookConfigured??!1,[d]=u.a(),p=d===`local`,{record:m}=g.l(),h=t.hi(g.s(m)),x=m.done.includes(`authorised`)&&!!h;(0,_.useEffect)(()=>t.ya(t.Ei,()=>(0,y.collection)(t.ka,t.Ei),e=>{r(!!e.docs.find(e=>e.id===t.Di)?.data()?.liveMode);let n=[];e.forEach(e=>{e.id!==`_settings`&&n.push(t.ea(e.id,e.data()))}),n.sort((e,t)=>(e.createdAt||0)-(t.createdAt||0)),o(n)},()=>r(!1)),[]);let S=async e=>{r(e);try{await(0,y.setDoc)((0,y.doc)(t.ka,t.Ei,t.Di),{liveMode:e},{merge:!0})}catch(e){console.error(`Could not save the go-live switch`,e)}},C=!!n,w=P(C,c),T=a.filter(e=>t.Zi(e,!1)),E=T.filter(e=>!t.Zi(e,!0)),D=T.length>0&&E.length===0,O=T.some(e=>e.kind===`subscription`);return(0,v.jsx)(t.y,{icon:i.R,title:`Go live`,description:C?`Real cards, real money — the steps below finish the switch.`:`Practice is free — flip this only when a test payment has gone all the way through.`,chip:w,enabled:n===null?null:C,onChange:S,children:C&&(0,v.jsxs)(v.Fragment,{children:[(0,v.jsxs)(`ol`,{className:`space-y-3.5 list-decimal list-inside ${I}`,children:[(0,v.jsxs)(`li`,{children:[(0,v.jsx)(`strong`,{children:`Your live secret key.`}),` In Stripe, click your account name in the top left corner and choose your `,(0,v.jsx)(`strong`,{children:`live`}),` account — not the sandbox.`,(0,v.jsxs)(`ul`,{className:L,children:[(0,v.jsxs)(`li`,{children:[`Open the dark strip along the bottom that says `,(0,v.jsx)(`strong`,{children:`Developers`}),`, and scroll down to the `,(0,v.jsx)(`strong`,{children:`API keys`}),` section.`]}),(0,v.jsxs)(`li`,{children:[`Click `,(0,v.jsx)(`strong`,{children:`Manage API keys`}),`. Under `,(0,v.jsx)(`strong`,{children:`Standard keys`}),`, click `,(0,v.jsx)(`strong`,{children:`+ Create secret key`}),`.`]}),(0,v.jsxs)(`li`,{children:[`Where it asks `,(0,v.jsx)(`em`,{children:`How will you be using this key?`}),`, choose`,` `,(0,v.jsx)(`strong`,{children:`Powering an integration you built`}),`, then`,` `,(0,v.jsx)(`strong`,{children:`Create secret key`}),`.`]}),(0,v.jsxs)(`li`,{children:[`Stripe asks you to confirm it is you: click `,(0,v.jsx)(`strong`,{children:`Send verification`}),` `,`and verify the request with the code it sends.`]}),(0,v.jsxs)(`li`,{children:[`Give the key a name — `,(0,v.jsx)(`span`,{className:`text-accent`,children:`my ai project app key`}),` `,`— and copy it. `,(0,v.jsx)(`strong`,{children:`Stripe will not show it to you again.`})]}),p?(0,v.jsxs)(`li`,{children:[`Open your `,(0,v.jsx)(`strong`,{children:`.env`}),` file and paste it over the sk_test_… value of `,(0,v.jsx)(`strong`,{children:`STRIPE_SECRET_KEY`}),` — replace it, do not add a second line. Start the app again, and the chip at the top of this card turns to `,(0,v.jsx)(`strong`,{children:`Live`}),` on its own.`]}):(0,v.jsxs)(`li`,{children:[`Click the `,(0,v.jsx)(t.n,{}),` icon in the top right corner of your app in Google AI Studio and find the `,(0,v.jsx)(`strong`,{children:`Secrets`}),` tab. Paste the new key over the value of `,(0,v.jsx)(`strong`,{children:`STRIPE_SECRET_KEY`}),` — replace the sk_test_… one, do not add a second. Click `,(0,v.jsx)(`strong`,{children:`Apply`}),` and refresh this page: the chip at the top of this card turns to `,(0,v.jsx)(`strong`,{children:`Live`}),` on its own.`]})]})]}),O&&(0,v.jsxs)(`li`,{children:[(0,v.jsx)(`strong`,{children:`Your live price ids.`}),` A subscription's prices are made fresh in live mode, so the ids under `,(0,v.jsx)(`strong`,{children:`What you sell`}),` change. Create each plan's price in your live Stripe account and paste its id there. Your test ids are kept and come straight back if you switch off again.`]}),(0,v.jsxs)(`li`,{children:[(0,v.jsx)(`strong`,{children:`The webhook.`}),` `,x?`What keeps receipts and your sale alerts sending when a buyer pays and never comes back to your app.`:`Stripe has to be able to reach your app from the outside, so this one waits until your app is published.`,` `,(0,v.jsx)(`span`,{className:`inline-block align-middle ml-0.5`,children:(0,v.jsx)(t.v,{state:l?`saved`:`off`,label:l?`Connected`:`Not yet`})}),x?(0,v.jsxs)(`ul`,{className:L,children:[(0,v.jsxs)(`li`,{children:[`Still in your `,(0,v.jsx)(`strong`,{children:`live`}),` Stripe account, open the`,` `,(0,v.jsx)(`strong`,{children:`Developers`}),` strip at the bottom again and, in its top menu, click `,(0,v.jsx)(`strong`,{children:`Webhooks`}),`. Click `,(0,v.jsx)(`strong`,{children:`Add destination`}),`.`]}),(0,v.jsxs)(`li`,{children:[`Leave every setting as it is. Under `,(0,v.jsx)(`strong`,{children:`Events`}),`, use the`,` `,(0,v.jsx)(`em`,{children:`Find event by name or description…`}),` search bar to find these two, and click the checkmark on each:`,(0,v.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-1`,children:F.map(e=>(0,v.jsx)(u.t,{code:e,label:e,compact:!0},e))}),`The first is an ordinary card payment. The second is a bank transfer landing hours later, when nobody is watching — without it those sales send no email at all.`]}),(0,v.jsxs)(`li`,{children:[`Click `,(0,v.jsx)(`strong`,{children:`Continue`}),` and keep it as a`,` `,(0,v.jsx)(`strong`,{children:`Webhook endpoint`}),`. Give the destination a name —`,` `,(0,v.jsx)(`span`,{className:`text-accent`,children:`my ai project receipts`}),`.`]}),(0,v.jsxs)(`li`,{children:[`As the `,(0,v.jsx)(`strong`,{children:`Endpoint URL`}),`, paste exactly this — your published address with the webhook route on the end:`,(0,v.jsx)(`div`,{className:`my-2`,children:(0,v.jsx)(u.t,{code:h,label:`Copy your webhook address`,compact:!0})})]}),(0,v.jsxs)(`li`,{children:[`Create the destination. On the right, under Webhooks, you will find its`,` `,(0,v.jsx)(`strong`,{children:`signing secret`}),` — it starts with `,(0,v.jsx)(`strong`,{children:`whsec_`}),`. Copy it.`]}),(0,v.jsxs)(`li`,{children:[p?(0,v.jsxs)(v.Fragment,{children:[`Add the line below to your `,(0,v.jsx)(`strong`,{children:`.env`}),` file with the whsec_… secret as its value, and start the app again. You are all set — the chip beside this step turns green.`]}):(0,v.jsxs)(v.Fragment,{children:[`Click the `,(0,v.jsx)(t.n,{}),` icon in the top right corner of your app in Google AI Studio, scroll the menu along the top to `,(0,v.jsx)(`strong`,{children:`Secrets`}),` `,`and click `,(0,v.jsx)(`strong`,{children:`+ Add secret`}),`. Copy the name below into`,` `,(0,v.jsx)(`strong`,{children:`Secret name`}),` and paste the whsec_… secret as its value. Click `,(0,v.jsx)(`strong`,{children:`Apply`}),` and refresh this page. You are all set — the chip beside this step turns green.`]}),(0,v.jsx)(`div`,{className:R,children:(0,v.jsx)(u.n,{name:`STRIPE_WEBHOOK_SECRET`,hint:`the whsec_… signing secret from the destination you just made`})})]})]}):(0,v.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2.5`,children:[(0,v.jsxs)(t.g,{children:[`Your app has no public address yet, and the preview address in this browser is not one Stripe can reach — it changes every session.`,` `,m.done.length===0?`Publish your app first`:`Finish publishing your app first`,`: this step opens on its own once step 3 of Publish App,`,` `,(0,v.jsx)(`strong`,{children:`Add your domains and email sender`}),`, is ticked. Everything above works in the meantime.`]}),(0,v.jsxs)(b.Link,{to:`/publish`,className:`inline-flex items-center gap-1.5 w-fit h-9 px-4 rounded-[var(--btn-radius,0.75rem)] text-[12.5px] font-bold border border-accent/40 bg-accent/10 text-accent hover:bg-accent/15 transition-all active:scale-[0.98] cursor-pointer`,children:[`Take me to Publish App`,(0,v.jsx)(i.yn,{className:`w-3.5 h-3.5`})]})]})]})]}),(0,v.jsxs)(`p`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:[`One more switch lives in Stripe, not here: switching plans (monthly ↔ yearly, Basic ↔ Pro) appears in Stripe’s customer portal — where your buyers manage their own subscriptions — only if you allow it:`,` `,(0,v.jsx)(`a`,{href:`https://dashboard.stripe.com/settings/billing/portal`,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent font-bold hover:underline`,children:`Stripe Settings → Billing → Customer portal`}),` `,`→ let customers switch plans.`]}),T.length>0&&!D&&(0,v.jsxs)(`p`,{className:`text-[11px] sm:text-[11.5px] text-foreground/40 font-medium leading-snug`,children:[`Your subscriptions under What you sell now ask for `,(0,v.jsx)(`strong`,{children:`live`}),` price ids — `,E.length===T.length?`each one`:`${E.length} of ${T.length}`,` is still waiting. Your test ids are kept and come back if you switch back. Once the live ids are in, the message for your assistant appears right here.`]}),D&&(0,v.jsx)(e.o,{title:`Tell your assistant about the switch`,prompt:t.Ri(T)})]})})}var B=e=>e?{description:`Every Pay button on your pages works. Switch it off to pause all of it at once.`,chip:{state:`saved`,label:`On`}}:{description:`No Pay button shows and nothing can be bought. Your pages keep their settings.`,chip:{state:`off`,label:`Off`}};function V(){let{user:r}=t.dr(),{status:a,error:s,reread:c}=f.r(),[l,u]=(0,_.useState)(!1),[m,h]=(0,_.useState)(!1),[g,y]=(0,_.useState)(null),[b,x]=(0,_.useState)(``),[S,C]=(0,_.useState)(``),w=f.a(`payments`),[T,E]=(0,_.useState)(``),D=B(w.on),O=(0,_.useCallback)(async e=>{let t=r?await r.getIdToken():``,n=await fetch(e,{headers:t?{Authorization:`Bearer ${t}`}:void 0}),i=await n.json().catch(()=>({}));if(!n.ok||i?.success===!1)throw Error(i?.error||`The server could not answer.`);return i},[r]),k=()=>{u(!1),c().then(()=>h(!0))};(0,_.useEffect)(()=>{if(!a?.configured||!r)return;let e=!1;return O(`/api/payments/products`).then(t=>{e||y(t.products||[])}).catch(t=>{e||x(t.message)}),()=>{e=!0}},[a?.configured,r,O]);let A=e=>{navigator.clipboard?.writeText(e),C(e),setTimeout(()=>C(``),2e3)},j=(g||[]).flatMap(e=>e.prices),M=a?.mode===`live`?`https://dashboard.stripe.com/products`:`https://dashboard.stripe.com/test/products`,P=!!(a&&!a.configured);return(0,v.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 pt-2 md:p-8 md:pt-4 z-10 flex flex-col min-h-screen`,children:[(0,v.jsxs)(t.sr.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6`,children:[(0,v.jsx)(e.t,{children:`Payments`}),(0,v.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,v.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/payments`]})]}),(0,v.jsxs)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:[(0,v.jsx)(n.t,{}),(0,v.jsx)(`div`,{className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-4 sm:p-5 md:p-8 shadow-2xl relative bg-background flex flex-col fbos-tab-fill min-h-[600px]`,children:!a&&!s?(0,v.jsx)(`div`,{className:`flex items-center justify-center flex-1 text-foreground/40 py-16`,children:(0,v.jsx)(i.ht,{className:`w-6 h-6 animate-spin text-accent`})}):P?(0,v.jsx)(p.ConnectCard,{icon:i.qt,title:`Connect Stripe`,description:`This app is not taking payments yet.`,stepsDescription:`Three steps — about five minutes, with pretend money until you say otherwise.`,button:`Set up payments`,secret:`STRIPE_SECRET_KEY`,open:l,onOpen:()=>u(!0),confirmed:m,steps:(0,v.jsx)(p.StripeSetupSteps,{onConfirm:k}),children:(0,v.jsx)(t.g,{children:`Payments run through Stripe, and connecting it is one pasted key — no code, no terminal. Once it is in, this screen fills itself: what you sell, and every payment as it happens.`})}):(0,v.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[a?.mode===`live`&&(0,v.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-red-500/25 bg-red-500/[0.06] px-4 py-3`,children:[(0,v.jsx)(i.S,{className:`w-4 h-4 text-red-500 shrink-0`}),(0,v.jsx)(`p`,{className:`text-[12.5px] font-semibold text-red-500 leading-snug`,children:`Live mode — real cards are being charged. Every payment on this screen is real money.`})]}),(0,v.jsx)(t.y,{icon:i.W,title:`Take payments`,description:D.description,chip:D.chip,enabled:w.loading?null:w.on,onChange:async e=>E(await w.set(e)||``),children:T?(0,v.jsx)(t.g,{tone:`error`,children:T}):null}),(0,v.jsx)(t.h,{icon:i.K,title:`Connection`,description:`Which Stripe account this app is running on.`,defaultOpen:!a?.configured,actions:s?(0,v.jsx)(t.v,{state:`error`,label:`Unreachable`}):(0,v.jsx)(t.v,{state:`saved`,label:a?.mode===`live`?`Live mode connected`:`Test mode connected`}),children:s?(0,v.jsx)(t.g,{tone:`error`,children:s}):(0,v.jsx)(t.g,{children:a?.mode===`live`?`Connected with a live key. Payments made anywhere on your site are real money.`:`Test mode connected. Your Pay buttons work end to end, but only test cards are accepted and no real money moves. When you are ready for real payments, use Go live below.`})}),(0,v.jsx)(z,{}),(0,v.jsx)(N,{}),(0,v.jsx)(t.h,{icon:i.T,title:`In your Stripe account`,description:`The products and prices Stripe has right now — where price ids come from.`,defaultOpen:!1,children:b?(0,v.jsx)(t.g,{tone:`error`,children:b}):g===null?(0,v.jsx)(`div`,{className:`flex items-center justify-center py-6 text-foreground/40`,children:(0,v.jsx)(i.ht,{className:`w-5 h-5 animate-spin text-accent`})}):j.length===0?(0,v.jsxs)(t.g,{children:[`Nothing needs to exist here for one-off payments — a Pay button can name its own amount. Only a subscription needs a price made in Stripe first:`,` `,(0,v.jsx)(`a`,{href:M,target:`_blank`,rel:`noreferrer`,className:`text-accent font-bold hover:underline`,children:`create one in your Stripe dashboard`}),` `,`and it appears here with its id ready to copy.`]}):(0,v.jsx)(`div`,{className:`flex flex-col gap-2.5`,children:j.map(e=>(0,v.jsxs)(`div`,{className:`flex items-center gap-3 px-3.5 py-2.5 ${t.r}`,children:[(0,v.jsx)(`span`,{className:`text-[13px] font-bold text-foreground truncate min-w-0 flex-1`,children:e.productName||`Unnamed product`}),(0,v.jsxs)(`span`,{className:`text-[12.5px] font-semibold text-foreground/60 whitespace-nowrap shrink-0`,children:[o.r(e.amount,e.currency),e.interval?` / ${e.interval}`:``]}),(0,v.jsx)(t.o,{compact:!0,icon:S===e.id?i.sn:i.Jt,title:`Copy the price id for ${e.productName||`this price`}`,onClick:()=>A(e.id),children:S===e.id?`Copied`:`Copy price id`})]},e.id))})})]})})]}),(0,v.jsx)(d.t,{})]})}exports.PaymentsAdmin=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PhoneInputField-
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./PhoneInputField-jhWvto8C.cjs`);exports.default=e.t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { on as e } from "./lucide-react-
|
|
2
|
-
import { i as t, r as n, t as r } from "./dist-
|
|
1
|
+
import { on as e } from "./lucide-react-CA7GD7Nv.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./dist-DUPvBnOA.js";
|
|
3
3
|
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
4
4
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/PhoneInputField.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./lucide-react-
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./lucide-react-BwV6L6Is.cjs`),t=require(`./dist-E4jTFPs7.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`);var i=[`us`,`gb`,`ca`,`au`,`nz`,`ie`,`ae`,`sg`],a=[...t.t.filter(e=>i.includes(e[1])),...t.t.filter(e=>!i.includes(e[1]))];function o({field:i,value:o,onChange:s}){let c=String(i.placeholder||``).trim(),{inputValue:l,country:u,setCountry:d,handlePhoneValueChange:f,inputRef:p}=t.r({defaultCountry:`us`,value:o,countries:a,forceDialCode:!0,onChange:e=>s(e.phone)}),[m,h]=(0,n.useState)(!1),[g,_]=(0,n.useState)(``),v=(0,n.useRef)(null),y=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!m)return;_(``),y.current?.focus();function e(e){v.current?.contains(e.target)||h(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[m]);let b=g.trim().toLowerCase(),x=b?a.filter(e=>{let t=String(e[0]).toLowerCase(),n=String(e[2]);return t.includes(b)||n.startsWith(b.replace(/^\+/,``))}):a;return(0,r.jsxs)(`div`,{className:`flex flex-col w-full relative z-[99999]`,children:[(0,r.jsx)(`label`,{className:`text-[13px] font-medium text-foreground/70 select-none mb-2`,children:i.label}),(0,r.jsxs)(`div`,{ref:v,className:`w-full flex items-center rounded-xl text-[15px] text-foreground transition-all duration-300 focus-within:border-accent glow-focus glass-panel overflow-visible relative h-12`,children:[(0,r.jsxs)(`div`,{className:`relative h-full shrink-0`,children:[(0,r.jsxs)(`button`,{type:`button`,onClick:()=>h(e=>!e),"aria-haspopup":`listbox`,"aria-expanded":m,"aria-label":`Country code`,className:`!bg-transparent !border-0 border-r !border-[var(--panel-border)]/50 !outline-none !shadow-none !px-3 hover:!bg-foreground/5 transition-colors h-full !rounded-xl !rounded-r-none flex items-center justify-center gap-1.5 shrink-0`,children:[(0,r.jsx)(t.i,{iso2:u.iso2,size:`20px`}),(0,r.jsx)(e.on,{className:`w-3.5 h-3.5 text-foreground/50 transition-transform duration-300 ${m?`rotate-180`:``}`})]}),m&&(0,r.jsxs)(`div`,{role:`listbox`,"aria-label":`Country`,className:`absolute z-[999999] top-[calc(100%+8px)] left-0 w-64 glass-popover overflow-hidden`,style:{borderRadius:`var(--input-radius, 0.75rem)`},children:[(0,r.jsx)(`input`,{ref:y,value:g,onChange:e=>_(e.target.value),onKeyDown:e=>{if(e.key===`Escape`){h(!1);return}e.key===`Enter`&&x[0]&&(d(x[0][1],{focusOnInput:!0}),h(!1))},className:`absolute w-px h-px opacity-0 pointer-events-none`,"aria-hidden":`true`,tabIndex:-1}),(0,r.jsxs)(`div`,{className:`max-h-60 overflow-y-auto no-scrollbar p-1`,children:[x.length===0&&(0,r.jsx)(`div`,{className:`px-3 py-2.5 text-[13px] text-foreground/40`,children:`No match`}),x.map(e=>(0,r.jsxs)(`div`,{role:`option`,"aria-selected":e[1]===u.iso2,onClick:()=>{d(e[1],{focusOnInput:!0}),h(!1)},className:`flex items-center gap-2.5 px-3 py-2.5 transition-colors font-medium text-[13px] cursor-pointer ${e[1]===u.iso2?`bg-accent/10 text-accent font-bold`:`text-foreground/80 hover:bg-foreground/5 hover:text-foreground`}`,style:{borderRadius:`calc(var(--input-radius, 0.75rem) - 0.25rem)`},children:[(0,r.jsx)(t.i,{iso2:e[1],size:`18px`}),(0,r.jsx)(`span`,{className:`truncate flex-1`,children:e[0]}),(0,r.jsxs)(`span`,{className:`text-foreground/40 text-[12px]`,children:[`+`,e[2]]})]},e[1]))]})]})]}),(0,r.jsx)(`input`,{ref:p,value:l,onChange:f,onPaste:e=>{if(!e.clipboardData.getData(`text`).includes(`+`))return;let t=e.currentTarget;t.setSelectionRange(0,t.value.length)},type:`tel`,placeholder:c||void 0,className:`flex-1 w-full !bg-transparent !border-none !outline-none !shadow-none px-3 text-[15px] text-foreground m-0 p-0 h-full tracking-[0.5px] no-glow`})]}),c&&!String(o||``).trim()&&(0,r.jsxs)(`span`,{className:`text-[12px] font-medium text-foreground/40 mt-1.5 ml-1`,children:[`e.g. `,c]})]})}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return o}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`),t=require(`./lucide-react-BwV6L6Is.cjs`);let n=require(`react`),r=require(`react/jsx-runtime`),i=require(`react-dom`);var a={sm:`sm:max-w-md`,md:`sm:max-w-xl`,lg:`sm:max-w-3xl`,xl:`sm:max-w-5xl`},o=[],s=``;function c(){return o.length}var l=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`;function u({open:c,onClose:u,title:d,sub:f,size:p=`md`,side:m=`center`,footer:h,busy:g=!1,className:_,children:v}){let y=(0,n.useRef)(null),b=(0,n.useId)(),x=(0,n.useRef)(u),S=(0,n.useRef)(g);if((0,n.useEffect)(()=>{x.current=u,S.current=g}),(0,n.useEffect)(()=>{if(!c)return;let e=Symbol(`popup`);o.length||(s=document.body.style.overflow,document.body.style.overflow=`hidden`),o.push(e);let t=document.activeElement,n=window.setTimeout(()=>{y.current&&!y.current.contains(document.activeElement)&&y.current.focus()},0),r=t=>{if(o[o.length-1]!==e)return;if(t.key===`Escape`&&!t.defaultPrevented){S.current||x.current();return}if(t.key!==`Tab`||!y.current)return;let n=Array.from(y.current.querySelectorAll(l)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(!n.length){t.preventDefault();return}let r=n[0],i=n[n.length-1],a=document.activeElement;t.shiftKey&&(a===r||a===y.current)?(t.preventDefault(),i.focus()):!t.shiftKey&&a===i&&(t.preventDefault(),r.focus())};return window.addEventListener(`keydown`,r),()=>{window.clearTimeout(n),window.removeEventListener(`keydown`,r);let i=o.indexOf(e);i>-1&&o.splice(i,1),o.length||(document.body.style.overflow=s),t&&document.contains(t)&&t.focus({preventScroll:!0})}},[c]),typeof document>`u`)return null;let C=m===`right`;return(0,i.createPortal)((0,r.jsx)(e.cr,{children:c&&(0,r.jsxs)(`div`,{className:e.ir(`fixed inset-0 z-[9990] flex`,C?`justify-end`:`items-end sm:items-center justify-center sm:p-6`),children:[(0,r.jsx)(e.sr.div,{"data-popup-backdrop":``,onClick:()=>{g||u()},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:`absolute inset-0 bg-background/80 backdrop-blur-xl cursor-pointer`}),(0,r.jsxs)(e.sr.div,{ref:y,role:`dialog`,"aria-modal":`true`,"aria-labelledby":d?b:void 0,tabIndex:-1,initial:C?{opacity:0,x:32}:{opacity:0,y:24,scale:.98},animate:C?{opacity:1,x:0}:{opacity:1,y:0,scale:1},exit:C?{opacity:0,x:32}:{opacity:0,y:24,scale:.98},transition:{duration:.25,ease:[.16,1,.3,1]},className:e.ir(`relative z-10 w-full flex flex-col glass-popover border border-[var(--panel-border)] shadow-2xl outline-none`,C?`h-full sm:max-w-md rounded-l-3xl`:e.ir(`max-h-[92dvh] rounded-t-3xl sm:rounded-3xl`,a[p])),children:[(0,r.jsxs)(`div`,{className:`flex items-start justify-between gap-4 px-5 sm:px-7 pt-5 sm:pt-6 pb-3 shrink-0`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[d?(0,r.jsx)(`h2`,{id:b,className:`text-lg sm:text-xl font-bold tracking-tight text-foreground break-words`,children:d}):null,f?(0,r.jsx)(`p`,{className:`text-[13px] text-foreground/60 font-medium leading-relaxed mt-1`,children:f}):null]}),(0,r.jsx)(`button`,{type:`button`,"aria-label":`Close`,onClick:()=>{g||u()},disabled:g,className:`shrink-0 -mr-2 -mt-1 w-10 h-10 inline-flex items-center justify-center rounded-full text-foreground/50 hover:text-foreground hover:bg-foreground/5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default`,children:(0,r.jsx)(t.o,{className:`w-5 h-5`})})]}),(0,r.jsx)(`div`,{className:e.ir(`flex-1 min-h-0 overflow-y-auto overscroll-contain px-5 sm:px-7 pb-6`,_),children:(0,r.jsx)(e.ar.Provider,{value:!0,children:v})}),h?(0,r.jsx)(`div`,{className:`shrink-0 px-5 sm:px-7 py-4 border-t border-[var(--panel-border)]`,children:h}):null]})]})}),document.body)}u.displayName=`Popup`,Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ar as e, cr as t, ir as n, sr as r } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import { o as i } from "./lucide-react-CA7GD7Nv.js";
|
|
3
|
+
import { useEffect as a, useId as o, useRef as s } from "react";
|
|
4
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { createPortal as u } from "react-dom";
|
|
6
|
+
//#region src/components/Popup.tsx
|
|
7
|
+
var d = {
|
|
8
|
+
sm: "sm:max-w-md",
|
|
9
|
+
md: "sm:max-w-xl",
|
|
10
|
+
lg: "sm:max-w-3xl",
|
|
11
|
+
xl: "sm:max-w-5xl"
|
|
12
|
+
}, f = [], p = "";
|
|
13
|
+
function m() {
|
|
14
|
+
return f.length;
|
|
15
|
+
}
|
|
16
|
+
var h = "a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
17
|
+
function g({ open: m, onClose: g, title: _, sub: v, size: y = "md", side: b = "center", footer: x, busy: S = !1, className: C, children: w }) {
|
|
18
|
+
let T = s(null), E = o(), D = s(g), O = s(S);
|
|
19
|
+
if (a(() => {
|
|
20
|
+
D.current = g, O.current = S;
|
|
21
|
+
}), a(() => {
|
|
22
|
+
if (!m) return;
|
|
23
|
+
let e = Symbol("popup");
|
|
24
|
+
f.length || (p = document.body.style.overflow, document.body.style.overflow = "hidden"), f.push(e);
|
|
25
|
+
let t = document.activeElement, n = window.setTimeout(() => {
|
|
26
|
+
T.current && !T.current.contains(document.activeElement) && T.current.focus();
|
|
27
|
+
}, 0), r = (t) => {
|
|
28
|
+
if (f[f.length - 1] !== e) return;
|
|
29
|
+
if (t.key === "Escape" && !t.defaultPrevented) {
|
|
30
|
+
O.current || D.current();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (t.key !== "Tab" || !T.current) return;
|
|
34
|
+
let n = Array.from(T.current.querySelectorAll(h)).filter((e) => e.offsetParent !== null || e === document.activeElement);
|
|
35
|
+
if (!n.length) {
|
|
36
|
+
t.preventDefault();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
let r = n[0], i = n[n.length - 1], a = document.activeElement;
|
|
40
|
+
t.shiftKey && (a === r || a === T.current) ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
|
|
41
|
+
};
|
|
42
|
+
return window.addEventListener("keydown", r), () => {
|
|
43
|
+
window.clearTimeout(n), window.removeEventListener("keydown", r);
|
|
44
|
+
let i = f.indexOf(e);
|
|
45
|
+
i > -1 && f.splice(i, 1), f.length || (document.body.style.overflow = p), t && document.contains(t) && t.focus({ preventScroll: !0 });
|
|
46
|
+
};
|
|
47
|
+
}, [m]), typeof document > "u") return null;
|
|
48
|
+
let k = b === "right";
|
|
49
|
+
return u(/* @__PURE__ */ c(t, { children: m && /* @__PURE__ */ l("div", {
|
|
50
|
+
className: n("fixed inset-0 z-[9990] flex", k ? "justify-end" : "items-end sm:items-center justify-center sm:p-6"),
|
|
51
|
+
children: [/* @__PURE__ */ c(r.div, {
|
|
52
|
+
"data-popup-backdrop": "",
|
|
53
|
+
onClick: () => {
|
|
54
|
+
S || g();
|
|
55
|
+
},
|
|
56
|
+
initial: { opacity: 0 },
|
|
57
|
+
animate: { opacity: 1 },
|
|
58
|
+
exit: { opacity: 0 },
|
|
59
|
+
transition: { duration: .2 },
|
|
60
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-xl cursor-pointer"
|
|
61
|
+
}), /* @__PURE__ */ l(r.div, {
|
|
62
|
+
ref: T,
|
|
63
|
+
role: "dialog",
|
|
64
|
+
"aria-modal": "true",
|
|
65
|
+
"aria-labelledby": _ ? E : void 0,
|
|
66
|
+
tabIndex: -1,
|
|
67
|
+
initial: k ? {
|
|
68
|
+
opacity: 0,
|
|
69
|
+
x: 32
|
|
70
|
+
} : {
|
|
71
|
+
opacity: 0,
|
|
72
|
+
y: 24,
|
|
73
|
+
scale: .98
|
|
74
|
+
},
|
|
75
|
+
animate: k ? {
|
|
76
|
+
opacity: 1,
|
|
77
|
+
x: 0
|
|
78
|
+
} : {
|
|
79
|
+
opacity: 1,
|
|
80
|
+
y: 0,
|
|
81
|
+
scale: 1
|
|
82
|
+
},
|
|
83
|
+
exit: k ? {
|
|
84
|
+
opacity: 0,
|
|
85
|
+
x: 32
|
|
86
|
+
} : {
|
|
87
|
+
opacity: 0,
|
|
88
|
+
y: 24,
|
|
89
|
+
scale: .98
|
|
90
|
+
},
|
|
91
|
+
transition: {
|
|
92
|
+
duration: .25,
|
|
93
|
+
ease: [
|
|
94
|
+
.16,
|
|
95
|
+
1,
|
|
96
|
+
.3,
|
|
97
|
+
1
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
className: n("relative z-10 w-full flex flex-col glass-popover border border-[var(--panel-border)] shadow-2xl outline-none", k ? "h-full sm:max-w-md rounded-l-3xl" : n("max-h-[92dvh] rounded-t-3xl sm:rounded-3xl", d[y])),
|
|
101
|
+
children: [
|
|
102
|
+
/* @__PURE__ */ l("div", {
|
|
103
|
+
className: "flex items-start justify-between gap-4 px-5 sm:px-7 pt-5 sm:pt-6 pb-3 shrink-0",
|
|
104
|
+
children: [/* @__PURE__ */ l("div", {
|
|
105
|
+
className: "min-w-0",
|
|
106
|
+
children: [_ ? /* @__PURE__ */ c("h2", {
|
|
107
|
+
id: E,
|
|
108
|
+
className: "text-lg sm:text-xl font-bold tracking-tight text-foreground break-words",
|
|
109
|
+
children: _
|
|
110
|
+
}) : null, v ? /* @__PURE__ */ c("p", {
|
|
111
|
+
className: "text-[13px] text-foreground/60 font-medium leading-relaxed mt-1",
|
|
112
|
+
children: v
|
|
113
|
+
}) : null]
|
|
114
|
+
}), /* @__PURE__ */ c("button", {
|
|
115
|
+
type: "button",
|
|
116
|
+
"aria-label": "Close",
|
|
117
|
+
onClick: () => {
|
|
118
|
+
S || g();
|
|
119
|
+
},
|
|
120
|
+
disabled: S,
|
|
121
|
+
className: "shrink-0 -mr-2 -mt-1 w-10 h-10 inline-flex items-center justify-center rounded-full text-foreground/50 hover:text-foreground hover:bg-foreground/5 transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default",
|
|
122
|
+
children: /* @__PURE__ */ c(i, { className: "w-5 h-5" })
|
|
123
|
+
})]
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ c("div", {
|
|
126
|
+
className: n("flex-1 min-h-0 overflow-y-auto overscroll-contain px-5 sm:px-7 pb-6", C),
|
|
127
|
+
children: /* @__PURE__ */ c(e.Provider, {
|
|
128
|
+
value: !0,
|
|
129
|
+
children: w
|
|
130
|
+
})
|
|
131
|
+
}),
|
|
132
|
+
x ? /* @__PURE__ */ c("div", {
|
|
133
|
+
className: "shrink-0 px-5 sm:px-7 py-4 border-t border-[var(--panel-border)]",
|
|
134
|
+
children: x
|
|
135
|
+
}) : null
|
|
136
|
+
]
|
|
137
|
+
})]
|
|
138
|
+
}) }), document.body);
|
|
139
|
+
}
|
|
140
|
+
g.displayName = "Popup";
|
|
141
|
+
//#endregion
|
|
142
|
+
export { m as n, g as t };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Y as e, dt as t, j as n, lt as r } from "./lucide-react-CA7GD7Nv.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
var o = {
|
|
5
|
+
password: r,
|
|
6
|
+
emailLink: t,
|
|
7
|
+
google: ({ className: e }) => /* @__PURE__ */ a("svg", {
|
|
8
|
+
className: e,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
"aria-hidden": "true",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ i("path", {
|
|
13
|
+
fill: "#4285F4",
|
|
14
|
+
d: "M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ i("path", {
|
|
17
|
+
fill: "#34A853",
|
|
18
|
+
d: "M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ i("path", {
|
|
21
|
+
fill: "#FBBC05",
|
|
22
|
+
d: "M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ i("path", {
|
|
25
|
+
fill: "#EA4335",
|
|
26
|
+
d: "M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
}),
|
|
30
|
+
phone: e,
|
|
31
|
+
github: ({ className: e }) => /* @__PURE__ */ i("svg", {
|
|
32
|
+
className: e,
|
|
33
|
+
viewBox: "0.6 0.6 22.8 22.8",
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: /* @__PURE__ */ i("path", {
|
|
36
|
+
fill: "currentColor",
|
|
37
|
+
d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
twitter: ({ className: e }) => /* @__PURE__ */ i("svg", {
|
|
41
|
+
className: e,
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: /* @__PURE__ */ i("path", {
|
|
45
|
+
fill: "currentColor",
|
|
46
|
+
d: "M18.9 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932zm-1.29 19.49h2.039L6.486 3.24H4.298z"
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
sms2fa: n
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { o as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./chunk-CiTBaPhY.cjs`),t=require(`./lucide-react-BwV6L6Is.cjs`);let n=require(`react`);n=e.a(n,1);let r=require(`react/jsx-runtime`);var i={password:t.lt,emailLink:t.dt,google:({className:e})=>(0,r.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,r.jsx)(`path`,{fill:`#4285F4`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z`}),(0,r.jsx)(`path`,{fill:`#34A853`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z`}),(0,r.jsx)(`path`,{fill:`#FBBC05`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,r.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]}),phone:t.Y,github:({className:e})=>(0,r.jsx)(`svg`,{className:e,viewBox:`0.6 0.6 22.8 22.8`,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{fill:`currentColor`,d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`})}),twitter:({className:e})=>(0,r.jsx)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,r.jsx)(`path`,{fill:`currentColor`,d:`M18.9 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932zm-1.29 19.49h2.039L6.486 3.24H4.298z`})}),sms2fa:t.j};Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return i}});
|