your-ai-workflow-firebase-os 2.0.2 → 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-B2YBRXcx.js → AddressField-9Sqn8TvC.js} +3 -3
- package/dist/{AddressField-BBv8NGX8.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-D3wWs-M8.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-Dsg2ntq3.js → TimeZoneField-DkI1Bkcz.js} +3191 -5322
- 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-BWG3y-15.cjs → bake-n2wyFw0B.cjs} +1 -1
- package/dist/{bake-BtYOG1Du.js → bake-naZeMu98.js} +1 -1
- 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/email-BfnZnMwD.cjs +1 -0
- package/dist/email-Ddj8Dlu6.js +58 -0
- package/dist/{fileBytes-BdwaFKRy.cjs → fileBytes-BJPaiX9Y.cjs} +1 -1
- package/dist/{fileBytes-DuW2K-H_.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/paymentProducts.d.ts +8 -0
- package/dist/lib/payments.d.ts +11 -1
- 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 -0
- 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 +8200 -32421
- package/package.json +1 -1
- package/src/index.css +122 -2
- package/dist/ContactPopup-IwBm-eqz.cjs +0 -12
- package/dist/PhoneInputField-CVamkTJg.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-BkUiTtIb.js → dist-DUPvBnOA.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/{lucide-react-ehRy1vqS.js → lucide-react-CA7GD7Nv.js} +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-u73U7-6s.js → pdf-DRXcPGkr.js} +0 -0
- /package/dist/{pdf-B24jYmSf.cjs → pdf-jLjjhvjp.cjs} +0 -0
- /package/dist/{pdf.worker.min-BPOWx2_9.js → pdf.worker.min-CfKZezeM.js} +0 -0
- /package/dist/{pdf.worker.min-BvhEiZFe.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 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);const e=require(`./TimeZoneField-qs7NPR30.cjs`);require(`./aiModels-DIP9fn8T.cjs`);let t=require(`react`),n=require(`firebase/firestore`);function r(){a()}var i=new Map;function a(){i.clear()}var o={email:{collection:`sys_configs`,doc:`email`},payments:{collection:`sys_payments`,doc:`_settings`},ai:{collection:`sys_configs`,doc:`ai`},chat:{collection:`sys_configs`,doc:`chat`}},s={email:!0,payments:!0,ai:!0,chat:!1},c=(e,t=!0)=>typeof e?.enabled==`boolean`?e.enabled:t;function l(i){let{collection:a,doc:l}=o[i],u=s[i],[d,f]=(0,t.useState)({loading:!0,on:u});return(0,t.useEffect)(()=>(0,n.onSnapshot)((0,n.doc)(e.ka,a,l),e=>f({loading:!1,on:c(e.exists()?e.data():null,u)}),()=>f({loading:!1,on:u})),[a,l,u]),{loading:d.loading,on:d.on,set:async t=>{let o=d.on;f({loading:!1,on:t});try{return await(0,n.setDoc)((0,n.doc)(e.ka,a,l),{enabled:t},{merge:!0}),i===`payments`&&e.li(),i===`ai`&&r(),null}catch{return f({loading:!1,on:o}),`The switch could not be saved. Check that you are signed in as an admin.`}}}}var u=`The server could not be reached.`;function d(n,r,i=0){let[a,o]=(0,t.useState)(null),[s,c]=(0,t.useState)(``),l=(0,t.useRef)(!0);(0,t.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]);let d=(0,t.useRef)(r);(0,t.useEffect)(()=>{d.current=r},[r]);let f=(0,t.useCallback)(async()=>{try{let t=await(await fetch(n)).json();if(n===m.payments&&e.si(t),!l.current)return;o(d.current(t)),c(``)}catch{l.current&&c(u)}},[n]);return(0,t.useEffect)(()=>{if(f(),!i)return;let e=setInterval(f,i);return()=>clearInterval(e)},[f,i]),{status:a,error:s,reread:f}}var f=e=>({configured:!!e?.configured,mode:e?.mode===`live`||e?.mode===`test`?e.mode:null,webhookConfigured:!!e?.webhookConfigured}),p=e=>({configured:!!e?.configured,from:e?.from??null,adminCount:Number(e?.adminCount)||0}),m={email:`/api/email/status`,payments:`/api/payments/status`,ai:`/api/ai/status`},h=(e=0)=>d(m.payments,f,e),g=(e=0)=>d(m.email,p,e),_=e=>!!e?.configured;function v(e){let t=d(m[e],_),n=l(e);return{loading:t.status===null&&!t.error||n.loading,configured:t.status===!0,on:n.on}}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ka as e, li as t, si as n } from "./TimeZoneField-DkI1Bkcz.js";
|
|
2
|
+
import "./aiModels-DnDhNGup.js";
|
|
3
|
+
import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
|
|
4
|
+
import { doc as s, onSnapshot as c, setDoc as l } from "firebase/firestore";
|
|
5
|
+
function u() {
|
|
6
|
+
f();
|
|
7
|
+
}
|
|
8
|
+
var d = /* @__PURE__ */ new Map();
|
|
9
|
+
function f() {
|
|
10
|
+
d.clear();
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/lib/serviceSwitches.ts
|
|
14
|
+
var p = {
|
|
15
|
+
email: {
|
|
16
|
+
collection: "sys_configs",
|
|
17
|
+
doc: "email"
|
|
18
|
+
},
|
|
19
|
+
payments: {
|
|
20
|
+
collection: "sys_payments",
|
|
21
|
+
doc: "_settings"
|
|
22
|
+
},
|
|
23
|
+
ai: {
|
|
24
|
+
collection: "sys_configs",
|
|
25
|
+
doc: "ai"
|
|
26
|
+
},
|
|
27
|
+
chat: {
|
|
28
|
+
collection: "sys_configs",
|
|
29
|
+
doc: "chat"
|
|
30
|
+
}
|
|
31
|
+
}, m = {
|
|
32
|
+
email: !0,
|
|
33
|
+
payments: !0,
|
|
34
|
+
ai: !0,
|
|
35
|
+
chat: !1
|
|
36
|
+
}, h = (e, t = !0) => typeof e?.enabled == "boolean" ? e.enabled : t;
|
|
37
|
+
function g(n) {
|
|
38
|
+
let { collection: r, doc: a } = p[n], d = m[n], [f, g] = o({
|
|
39
|
+
loading: !0,
|
|
40
|
+
on: d
|
|
41
|
+
});
|
|
42
|
+
return i(() => c(s(e, r, a), (e) => g({
|
|
43
|
+
loading: !1,
|
|
44
|
+
on: h(e.exists() ? e.data() : null, d)
|
|
45
|
+
}), () => g({
|
|
46
|
+
loading: !1,
|
|
47
|
+
on: d
|
|
48
|
+
})), [
|
|
49
|
+
r,
|
|
50
|
+
a,
|
|
51
|
+
d
|
|
52
|
+
]), {
|
|
53
|
+
loading: f.loading,
|
|
54
|
+
on: f.on,
|
|
55
|
+
set: async (i) => {
|
|
56
|
+
let o = f.on;
|
|
57
|
+
g({
|
|
58
|
+
loading: !1,
|
|
59
|
+
on: i
|
|
60
|
+
});
|
|
61
|
+
try {
|
|
62
|
+
return await l(s(e, r, a), { enabled: i }, { merge: !0 }), n === "payments" && t(), n === "ai" && u(), null;
|
|
63
|
+
} catch {
|
|
64
|
+
return g({
|
|
65
|
+
loading: !1,
|
|
66
|
+
on: o
|
|
67
|
+
}), "The switch could not be saved. Check that you are signed in as an admin.";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/lib/serviceStatus.ts
|
|
74
|
+
var _ = "The server could not be reached.";
|
|
75
|
+
function v(e, t, s = 0) {
|
|
76
|
+
let [c, l] = o(null), [u, d] = o(""), f = a(!0);
|
|
77
|
+
i(() => (f.current = !0, () => {
|
|
78
|
+
f.current = !1;
|
|
79
|
+
}), []);
|
|
80
|
+
let p = a(t);
|
|
81
|
+
i(() => {
|
|
82
|
+
p.current = t;
|
|
83
|
+
}, [t]);
|
|
84
|
+
let m = r(async () => {
|
|
85
|
+
try {
|
|
86
|
+
let t = await (await fetch(e)).json();
|
|
87
|
+
if (e === x.payments && n(t), !f.current) return;
|
|
88
|
+
l(p.current(t)), d("");
|
|
89
|
+
} catch {
|
|
90
|
+
f.current && d(_);
|
|
91
|
+
}
|
|
92
|
+
}, [e]);
|
|
93
|
+
return i(() => {
|
|
94
|
+
if (m(), !s) return;
|
|
95
|
+
let e = setInterval(m, s);
|
|
96
|
+
return () => clearInterval(e);
|
|
97
|
+
}, [m, s]), {
|
|
98
|
+
status: c,
|
|
99
|
+
error: u,
|
|
100
|
+
reread: m
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
var y = (e) => ({
|
|
104
|
+
configured: !!e?.configured,
|
|
105
|
+
mode: e?.mode === "live" || e?.mode === "test" ? e.mode : null,
|
|
106
|
+
webhookConfigured: !!e?.webhookConfigured
|
|
107
|
+
}), b = (e) => ({
|
|
108
|
+
configured: !!e?.configured,
|
|
109
|
+
from: e?.from ?? null,
|
|
110
|
+
adminCount: Number(e?.adminCount) || 0
|
|
111
|
+
}), x = {
|
|
112
|
+
email: "/api/email/status",
|
|
113
|
+
payments: "/api/payments/status",
|
|
114
|
+
ai: "/api/ai/status"
|
|
115
|
+
}, S = (e = 0) => v(x.payments, y, e), C = (e = 0) => v(x.email, b, e), w = (e) => !!e?.configured;
|
|
116
|
+
function T(e) {
|
|
117
|
+
let t = v(x[e], w), n = g(e);
|
|
118
|
+
return {
|
|
119
|
+
loading: t.status === null && !t.error || n.loading,
|
|
120
|
+
configured: t.status === !0,
|
|
121
|
+
on: n.on
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
export { g as a, p as i, T as n, S as r, C as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./verifiedAccount-DScyKk96.cjs`);var t=[`inbox`,`users`,`transactions`],n=e=>t.includes(e),r={collection:`sys_configs`,doc:`tab_access`},i=t=>[`admin`,...e.c(t).filter(e=>e!==`admin`&&e!==`user`)];function a(e,t){return i(e&&typeof e==`object`?e[t]:void 0)}function o(n){return!n||typeof n!=`object`?[]:t.filter(t=>e.c(n[t]).includes(`user`))}var s=e=>e.some(e=>e!==`admin`);function c(e){return i(e)}function l(t,n){let r=e.b(t);if(r===`admin`)return!0;if(r===`internal`)return n.includes(`internal`);let i=e.d(t);return!!i&&n.includes(i)}function u(e,t,n,r=Date.now()){if(!e||e.inactive===!0)return!1;let i=Number(e.planUntil||0);return l(i&&r>=i?`user`:e.role,a(t,n))}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return r}});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { b as e, c as t, d as n } from "./verifiedAccount-DRbRFJ6H.js";
|
|
2
|
+
//#region src/lib/tabAudience.ts
|
|
3
|
+
var r = [
|
|
4
|
+
"inbox",
|
|
5
|
+
"users",
|
|
6
|
+
"transactions"
|
|
7
|
+
], i = (e) => r.includes(e), a = {
|
|
8
|
+
collection: "sys_configs",
|
|
9
|
+
doc: "tab_access"
|
|
10
|
+
}, o = (e) => ["admin", ...t(e).filter((e) => e !== "admin" && e !== "user")];
|
|
11
|
+
function s(e, t) {
|
|
12
|
+
return o(e && typeof e == "object" ? e[t] : void 0);
|
|
13
|
+
}
|
|
14
|
+
function c(e) {
|
|
15
|
+
return !e || typeof e != "object" ? [] : r.filter((n) => t(e[n]).includes("user"));
|
|
16
|
+
}
|
|
17
|
+
var l = (e) => e.some((e) => e !== "admin");
|
|
18
|
+
function u(e) {
|
|
19
|
+
return o(e);
|
|
20
|
+
}
|
|
21
|
+
function d(t, r) {
|
|
22
|
+
let i = e(t);
|
|
23
|
+
if (i === "admin") return !0;
|
|
24
|
+
if (i === "internal") return r.includes("internal");
|
|
25
|
+
let a = n(t);
|
|
26
|
+
return !!a && r.includes(a);
|
|
27
|
+
}
|
|
28
|
+
function f(e, t, n, r = Date.now()) {
|
|
29
|
+
if (!e || e.inactive === !0) return !1;
|
|
30
|
+
let i = Number(e.planUntil || 0);
|
|
31
|
+
return d(i && r >= i ? "user" : e.role, s(t, n));
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { f as a, u as c, d as i, c as l, o as n, s as o, i as r, l as s, a as t };
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import { t as e } from "./forms-Bvx9HTM6.js";
|
|
2
|
+
import { l as t } from "./address-C2bHNxJU.js";
|
|
3
|
+
//#region src/lib/transactions.ts
|
|
4
|
+
function n(t) {
|
|
5
|
+
return ((typeof window < "u" ? window.__FBOS_FORMS__ : null) || {})[t] || e[t] || null;
|
|
6
|
+
}
|
|
7
|
+
var r = (e) => typeof e == "string" && n(e)?.transaction === !0, i = (e) => !!e && (e.transaction === !0 || r(e.formId)), a = ["user_submissions", "user_requests"], o = new Set([
|
|
8
|
+
"id",
|
|
9
|
+
"collection",
|
|
10
|
+
"source",
|
|
11
|
+
"uid",
|
|
12
|
+
"formId",
|
|
13
|
+
"submittedAt",
|
|
14
|
+
"submitterName",
|
|
15
|
+
"submitterEmail",
|
|
16
|
+
"submitterAvatar",
|
|
17
|
+
"transaction",
|
|
18
|
+
"isArchived",
|
|
19
|
+
"avatarUrl",
|
|
20
|
+
"name",
|
|
21
|
+
"full_name",
|
|
22
|
+
"email",
|
|
23
|
+
"contactEmail"
|
|
24
|
+
]), s = (e) => Object.entries(e).filter(([n, r]) => !o.has(n) && !t(n, e) && r !== "" && r != null);
|
|
25
|
+
function c(e, t) {
|
|
26
|
+
if (!e) return null;
|
|
27
|
+
for (let n of Object.values(e)) {
|
|
28
|
+
let e = t.find((e) => e.id === n);
|
|
29
|
+
if (e) return e;
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
var l = (e) => {
|
|
34
|
+
let t = e.submittedAt;
|
|
35
|
+
if (!t) return 0;
|
|
36
|
+
if (typeof t.toMillis == "function") return t.toMillis();
|
|
37
|
+
if (typeof t.toDate == "function") return t.toDate().getTime();
|
|
38
|
+
let n = new Date(t).getTime();
|
|
39
|
+
return Number.isNaN(n) ? 0 : n;
|
|
40
|
+
}, u = (e) => String(e.submitterName || e.name || e.full_name || "").trim(), d = (e) => String(e.contactEmail || e.email || e.submitterEmail || "").trim();
|
|
41
|
+
function f(e) {
|
|
42
|
+
for (let [t, n] of s(e)) {
|
|
43
|
+
if (!y(t) || x(t)) continue;
|
|
44
|
+
let e = z(n);
|
|
45
|
+
if (e.length) return e.length === 1 ? e[0] : `${e[0]} + ${e.length - 1} more`;
|
|
46
|
+
}
|
|
47
|
+
return e.formId ? `${g(String(e.formId))} form` : "Form entry";
|
|
48
|
+
}
|
|
49
|
+
function p(e, t) {
|
|
50
|
+
let n = /* @__PURE__ */ new Set(), r = e.map((e) => {
|
|
51
|
+
let r = c(e.collected, t);
|
|
52
|
+
r && n.add(r.id);
|
|
53
|
+
let i = Object.entries(e.collected || {}).filter(([, e]) => !r || e !== r.id), a = r ? s(r) : [], o = new Set(a.map(([e]) => e)), l = [...a, ...i.filter(([e]) => !o.has(e))];
|
|
54
|
+
return {
|
|
55
|
+
key: `${e.kind}:${e.id}`,
|
|
56
|
+
kind: e.kind,
|
|
57
|
+
at: (e.created || 0) * 1e3,
|
|
58
|
+
name: String(e.name || r && u(r) || "").trim(),
|
|
59
|
+
email: String(e.email || r && d(r) || "").trim(),
|
|
60
|
+
what: String(e.productName || e.description || (e.kind === "subscription" ? "Subscription" : "One-off payment")),
|
|
61
|
+
page: e.page || null,
|
|
62
|
+
order: e,
|
|
63
|
+
entry: r,
|
|
64
|
+
collected: l
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
for (let e of t) n.has(e.id) || r.push({
|
|
68
|
+
key: `entry:${e.id}`,
|
|
69
|
+
kind: "entry",
|
|
70
|
+
at: l(e),
|
|
71
|
+
name: u(e),
|
|
72
|
+
email: d(e),
|
|
73
|
+
what: f(e),
|
|
74
|
+
page: null,
|
|
75
|
+
order: null,
|
|
76
|
+
entry: e,
|
|
77
|
+
collected: s(e)
|
|
78
|
+
});
|
|
79
|
+
return r.sort((e, t) => t.at - e.at);
|
|
80
|
+
}
|
|
81
|
+
function m(e, t) {
|
|
82
|
+
if (e == null) return "—";
|
|
83
|
+
try {
|
|
84
|
+
return new Intl.NumberFormat(void 0, {
|
|
85
|
+
style: "currency",
|
|
86
|
+
currency: (t || "usd").toUpperCase()
|
|
87
|
+
}).format(e);
|
|
88
|
+
} catch {
|
|
89
|
+
return `${e} ${(t || "").toUpperCase()}`.trim();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function h(e) {
|
|
93
|
+
let t = e.order;
|
|
94
|
+
if (!t) return {
|
|
95
|
+
label: "No payment",
|
|
96
|
+
in: !1
|
|
97
|
+
};
|
|
98
|
+
if (t.kind === "subscription") {
|
|
99
|
+
if (t.active) return {
|
|
100
|
+
label: "Active",
|
|
101
|
+
in: !0
|
|
102
|
+
};
|
|
103
|
+
let e = String(t.status || "");
|
|
104
|
+
return {
|
|
105
|
+
label: !e || e === "canceled" ? "Cancelled" : g(e),
|
|
106
|
+
in: !1
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
return t.fullyRefunded ? {
|
|
110
|
+
label: "Refunded",
|
|
111
|
+
in: !1
|
|
112
|
+
} : (t.amountRefunded || 0) > 0 ? {
|
|
113
|
+
label: "Partly refunded",
|
|
114
|
+
in: !0
|
|
115
|
+
} : t.paid ? {
|
|
116
|
+
label: "Paid",
|
|
117
|
+
in: !0
|
|
118
|
+
} : {
|
|
119
|
+
label: "Not paid",
|
|
120
|
+
in: !1
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var g = (e) => String(e).replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").replace(/\s+/g, " ").trim().toLowerCase().replace(/^\w/, (e) => e.toUpperCase()), _ = new Set(/* @__PURE__ */ "items.item.basket.cart.order.orderitems.orderlines.lines.lineitems.products.product.purchases.purchase.bought.total.subtotal.grandtotal.amount.delivery.deliveryfee.shipping.shippingfee.shippingcost.postage.discount.discountcode.code.promo.promocode.coupon.voucher.tax.vat.currency.quantity.qty.plan.seats.tickets.tier.hours.duration.sessions.nights.guests.people.size.options.variant".split(".")), v = (e) => String(e).toLowerCase().replace(/[^a-z0-9]/g, ""), y = (e) => _.has(v(e)), b = new Set([
|
|
124
|
+
"total",
|
|
125
|
+
"subtotal",
|
|
126
|
+
"grandtotal",
|
|
127
|
+
"amount",
|
|
128
|
+
"price",
|
|
129
|
+
"delivery",
|
|
130
|
+
"deliveryfee",
|
|
131
|
+
"shipping",
|
|
132
|
+
"shippingfee",
|
|
133
|
+
"shippingcost",
|
|
134
|
+
"postage",
|
|
135
|
+
"discount",
|
|
136
|
+
"tax",
|
|
137
|
+
"vat",
|
|
138
|
+
"deposit",
|
|
139
|
+
"balance",
|
|
140
|
+
"fee"
|
|
141
|
+
]), x = (e) => b.has(v(e));
|
|
142
|
+
function S(e, t, n) {
|
|
143
|
+
if (x(e) && n) {
|
|
144
|
+
let e = typeof t == "number" ? t : typeof t == "string" && /^-?\d+(\.\d+)?$/.test(t.trim()) ? Number(t) : null;
|
|
145
|
+
if (e !== null) return [m(e, n)];
|
|
146
|
+
}
|
|
147
|
+
return z(t, n);
|
|
148
|
+
}
|
|
149
|
+
function C(e) {
|
|
150
|
+
let t = [], n = [];
|
|
151
|
+
for (let r of e) (y(r[0]) ? t : n).push(r);
|
|
152
|
+
return {
|
|
153
|
+
bought: t,
|
|
154
|
+
told: n
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function w(e) {
|
|
158
|
+
if (typeof e != "string") return e;
|
|
159
|
+
let t = e.trim();
|
|
160
|
+
if (!/^[[{]/.test(t)) return e;
|
|
161
|
+
try {
|
|
162
|
+
return JSON.parse(t);
|
|
163
|
+
} catch {
|
|
164
|
+
return e;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
var T = (e, t) => {
|
|
168
|
+
for (let n of t) {
|
|
169
|
+
let t = e[n];
|
|
170
|
+
if (t != null && t !== "") return t;
|
|
171
|
+
}
|
|
172
|
+
}, E = [
|
|
173
|
+
"name",
|
|
174
|
+
"productName",
|
|
175
|
+
"product",
|
|
176
|
+
"title",
|
|
177
|
+
"item",
|
|
178
|
+
"label",
|
|
179
|
+
"plan",
|
|
180
|
+
"description"
|
|
181
|
+
], D = [
|
|
182
|
+
"variant",
|
|
183
|
+
"variantName",
|
|
184
|
+
"option",
|
|
185
|
+
"options",
|
|
186
|
+
"choice",
|
|
187
|
+
"choices",
|
|
188
|
+
"size",
|
|
189
|
+
"colour",
|
|
190
|
+
"color",
|
|
191
|
+
"style",
|
|
192
|
+
"flavour",
|
|
193
|
+
"flavor"
|
|
194
|
+
], O = [
|
|
195
|
+
"quantity",
|
|
196
|
+
"qty",
|
|
197
|
+
"count",
|
|
198
|
+
"units"
|
|
199
|
+
], k = [
|
|
200
|
+
"total",
|
|
201
|
+
"lineTotal",
|
|
202
|
+
"subtotal",
|
|
203
|
+
"price",
|
|
204
|
+
"unitPrice",
|
|
205
|
+
"amount"
|
|
206
|
+
], A = /(^|_|[a-z])(id|ids|image|images|img|photo|photos|picture|pictures|thumbnail|thumbnails|url|src|sku|slug)$/i, j = [
|
|
207
|
+
"picture",
|
|
208
|
+
"pictures",
|
|
209
|
+
"photo",
|
|
210
|
+
"photos",
|
|
211
|
+
"image",
|
|
212
|
+
"images",
|
|
213
|
+
"img",
|
|
214
|
+
"thumbnail",
|
|
215
|
+
"cover"
|
|
216
|
+
], M = (e) => j.includes(v(e)) || /(^|_|[a-z])(image|images|img|photo|photos|picture|pictures|thumbnail|thumbnails)$/i.test(String(e)), N = (e) => {
|
|
217
|
+
let t = T(e, j), n = Array.isArray(t) ? t.find((e) => typeof e == "string" && e.trim()) : t, r = typeof n == "string" ? n.trim() : "";
|
|
218
|
+
return /^https?:\/\//i.test(r) ? r : "";
|
|
219
|
+
}, P = (e, t) => typeof e == "number" && t ? m(e, t) : typeof e == "string" && t && /^\d+(\.\d+)?$/.test(e.trim()) ? m(Number(e), t) : F(e), F = (e) => e == null ? "" : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.map(F).filter(Boolean).join(", ") : typeof e == "object" ? typeof e.toDate == "function" ? e.toDate().toLocaleString() : Object.values(e).map(F).filter(Boolean).join(", ") : String(e), I = (e, t) => {
|
|
220
|
+
let n = F(T(e, E)), r = D.map((t) => e[t]).filter((e) => e != null && e !== "").map(F).filter(Boolean), i = T(e, O), a = T(e, k), o = new Set([
|
|
221
|
+
...E,
|
|
222
|
+
...D,
|
|
223
|
+
...O,
|
|
224
|
+
...k,
|
|
225
|
+
...j
|
|
226
|
+
]), s = Object.entries(e).filter(([e, t]) => !o.has(e) && !A.test(e) && t !== "" && t != null).map(([e, t]) => `${g(e)}: ${F(t)}`), c = i !== void 0 && n ? `${F(i)} × ${n}` : n || (i === void 0 ? "" : `${F(i)} ×`);
|
|
227
|
+
return r.length && (c += `${c ? " — " : ""}${r.join(", ")}`), {
|
|
228
|
+
head: c,
|
|
229
|
+
price: a === void 0 ? "" : P(a, t),
|
|
230
|
+
rest: s,
|
|
231
|
+
picture: N(e)
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
function L(e, t) {
|
|
235
|
+
let { head: n, price: r, rest: i } = I(e, t);
|
|
236
|
+
return [
|
|
237
|
+
n,
|
|
238
|
+
r,
|
|
239
|
+
...i
|
|
240
|
+
].filter(Boolean).join(" · ");
|
|
241
|
+
}
|
|
242
|
+
function R(e, t) {
|
|
243
|
+
let { head: n, price: r, rest: i, picture: a } = I(e, t);
|
|
244
|
+
return {
|
|
245
|
+
words: [n, ...i].filter(Boolean).join(" · "),
|
|
246
|
+
price: r,
|
|
247
|
+
picture: a
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
function z(e, t) {
|
|
251
|
+
let n = w(e);
|
|
252
|
+
if (Array.isArray(n)) return n.map((e) => e && typeof e == "object" && !Array.isArray(e) ? L(e, t) : F(e)).filter(Boolean);
|
|
253
|
+
if (n && typeof n == "object" && typeof n.toDate != "function") {
|
|
254
|
+
let e = n;
|
|
255
|
+
return E.some((t) => e[t] !== void 0) || O.some((t) => e[t] !== void 0) ? [L(e, t)].filter(Boolean) : Object.entries(e).filter(([, e]) => e !== "" && e != null).map(([e, t]) => `${g(e)}: ${F(t)}`);
|
|
256
|
+
}
|
|
257
|
+
if (typeof n == "string") {
|
|
258
|
+
let e = n.split(/\s*;\s*|\r?\n/).map((e) => e.trim()).filter(Boolean);
|
|
259
|
+
return e.length ? e : [];
|
|
260
|
+
}
|
|
261
|
+
let r = F(n);
|
|
262
|
+
return r ? [r] : [];
|
|
263
|
+
}
|
|
264
|
+
var B = new Set([
|
|
265
|
+
"items",
|
|
266
|
+
"item",
|
|
267
|
+
"basket",
|
|
268
|
+
"cart",
|
|
269
|
+
"order",
|
|
270
|
+
"orderitems",
|
|
271
|
+
"orderlines",
|
|
272
|
+
"lines",
|
|
273
|
+
"lineitems",
|
|
274
|
+
"products",
|
|
275
|
+
"product",
|
|
276
|
+
"purchases",
|
|
277
|
+
"purchase",
|
|
278
|
+
"bought"
|
|
279
|
+
]), V = new Set(["total", "grandtotal"]), H = (e, t) => {
|
|
280
|
+
let n = e.match(/^(.*\S)\s+[—–·-]\s+((?:[£$€]\s?)?\d[\d,]*(?:\.\d+)?)$/);
|
|
281
|
+
if (!n) return {
|
|
282
|
+
left: e,
|
|
283
|
+
right: ""
|
|
284
|
+
};
|
|
285
|
+
let r = /^\d[\d,]*(?:\.\d+)?$/.test(n[2]) ? n[2].replace(/,/g, "") : n[2];
|
|
286
|
+
return {
|
|
287
|
+
left: n[1],
|
|
288
|
+
right: P(r, t)
|
|
289
|
+
};
|
|
290
|
+
}, U = (e, t) => {
|
|
291
|
+
let n = w(e);
|
|
292
|
+
return (Array.isArray(n) ? n : [n]).flatMap((e) => {
|
|
293
|
+
if (e && typeof e == "object" && !Array.isArray(e) && typeof e.toDate != "function") {
|
|
294
|
+
let n = e;
|
|
295
|
+
if (E.some((e) => n[e] !== void 0) || O.some((e) => n[e] !== void 0)) {
|
|
296
|
+
let { words: e, price: r, picture: i } = R(n, t);
|
|
297
|
+
return e || r ? [{
|
|
298
|
+
left: e,
|
|
299
|
+
right: r,
|
|
300
|
+
kind: "item",
|
|
301
|
+
...i ? { picture: i } : {}
|
|
302
|
+
}] : [];
|
|
303
|
+
}
|
|
304
|
+
return Object.entries(n).filter(([, e]) => e !== "" && e != null).map(([e, t]) => ({
|
|
305
|
+
left: `${g(e)}: ${F(t)}`,
|
|
306
|
+
right: "",
|
|
307
|
+
kind: "item"
|
|
308
|
+
}));
|
|
309
|
+
}
|
|
310
|
+
return z(e, t).map((e) => ({
|
|
311
|
+
...H(e, t),
|
|
312
|
+
kind: "item"
|
|
313
|
+
}));
|
|
314
|
+
});
|
|
315
|
+
};
|
|
316
|
+
function W(e, t) {
|
|
317
|
+
let n = [], r = [], i = [];
|
|
318
|
+
for (let [a, o] of e) if (x(a)) {
|
|
319
|
+
let [e = ""] = S(a, o, t);
|
|
320
|
+
if (!e) continue;
|
|
321
|
+
let n = V.has(v(a));
|
|
322
|
+
(n ? i : r).push({
|
|
323
|
+
left: g(a),
|
|
324
|
+
right: e,
|
|
325
|
+
kind: n ? "total" : "extra"
|
|
326
|
+
});
|
|
327
|
+
} else if (B.has(v(a))) n.push(...U(o, t));
|
|
328
|
+
else {
|
|
329
|
+
let e = z(o, t).join(", ");
|
|
330
|
+
e && r.push({
|
|
331
|
+
left: g(a),
|
|
332
|
+
right: e,
|
|
333
|
+
kind: "extra"
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
return [
|
|
337
|
+
...n,
|
|
338
|
+
...r,
|
|
339
|
+
...i
|
|
340
|
+
];
|
|
341
|
+
}
|
|
342
|
+
//#endregion
|
|
343
|
+
export { i as a, w as c, C as d, p as f, M as i, W as l, S as n, R as o, m as r, g as s, a as t, h as u };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./forms-CmNeTETW.cjs`),t=require(`./address-Bsb8COq2.cjs`);function n(t){return((typeof window<`u`?window.__FBOS_FORMS__:null)||{})[t]||e.t[t]||null}var r=e=>typeof e==`string`&&n(e)?.transaction===!0,i=e=>!!e&&(e.transaction===!0||r(e.formId)),a=[`user_submissions`,`user_requests`],o=new Set([`id`,`collection`,`source`,`uid`,`formId`,`submittedAt`,`submitterName`,`submitterEmail`,`submitterAvatar`,`transaction`,`isArchived`,`avatarUrl`,`name`,`full_name`,`email`,`contactEmail`]),s=e=>Object.entries(e).filter(([n,r])=>!o.has(n)&&!t.l(n,e)&&r!==``&&r!=null);function c(e,t){if(!e)return null;for(let n of Object.values(e)){let e=t.find(e=>e.id===n);if(e)return e}return null}var l=e=>{let t=e.submittedAt;if(!t)return 0;if(typeof t.toMillis==`function`)return t.toMillis();if(typeof t.toDate==`function`)return t.toDate().getTime();let n=new Date(t).getTime();return Number.isNaN(n)?0:n},u=e=>String(e.submitterName||e.name||e.full_name||``).trim(),d=e=>String(e.contactEmail||e.email||e.submitterEmail||``).trim();function f(e){for(let[t,n]of s(e)){if(!y(t)||x(t))continue;let e=z(n);if(e.length)return e.length===1?e[0]:`${e[0]} + ${e.length-1} more`}return e.formId?`${g(String(e.formId))} form`:`Form entry`}function p(e,t){let n=new Set,r=e.map(e=>{let r=c(e.collected,t);r&&n.add(r.id);let i=Object.entries(e.collected||{}).filter(([,e])=>!r||e!==r.id),a=r?s(r):[],o=new Set(a.map(([e])=>e)),l=[...a,...i.filter(([e])=>!o.has(e))];return{key:`${e.kind}:${e.id}`,kind:e.kind,at:(e.created||0)*1e3,name:String(e.name||r&&u(r)||``).trim(),email:String(e.email||r&&d(r)||``).trim(),what:String(e.productName||e.description||(e.kind===`subscription`?`Subscription`:`One-off payment`)),page:e.page||null,order:e,entry:r,collected:l}});for(let e of t)n.has(e.id)||r.push({key:`entry:${e.id}`,kind:`entry`,at:l(e),name:u(e),email:d(e),what:f(e),page:null,order:null,entry:e,collected:s(e)});return r.sort((e,t)=>t.at-e.at)}function m(e,t){if(e==null)return`—`;try{return new Intl.NumberFormat(void 0,{style:`currency`,currency:(t||`usd`).toUpperCase()}).format(e)}catch{return`${e} ${(t||``).toUpperCase()}`.trim()}}function h(e){let t=e.order;if(!t)return{label:`No payment`,in:!1};if(t.kind===`subscription`){if(t.active)return{label:`Active`,in:!0};let e=String(t.status||``);return{label:!e||e===`canceled`?`Cancelled`:g(e),in:!1}}return t.fullyRefunded?{label:`Refunded`,in:!1}:(t.amountRefunded||0)>0?{label:`Partly refunded`,in:!0}:t.paid?{label:`Paid`,in:!0}:{label:`Not paid`,in:!1}}var g=e=>String(e).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).replace(/\s+/g,` `).trim().toLowerCase().replace(/^\w/,e=>e.toUpperCase()),_=new Set(`items.item.basket.cart.order.orderitems.orderlines.lines.lineitems.products.product.purchases.purchase.bought.total.subtotal.grandtotal.amount.delivery.deliveryfee.shipping.shippingfee.shippingcost.postage.discount.discountcode.code.promo.promocode.coupon.voucher.tax.vat.currency.quantity.qty.plan.seats.tickets.tier.hours.duration.sessions.nights.guests.people.size.options.variant`.split(`.`)),v=e=>String(e).toLowerCase().replace(/[^a-z0-9]/g,``),y=e=>_.has(v(e)),b=new Set([`total`,`subtotal`,`grandtotal`,`amount`,`price`,`delivery`,`deliveryfee`,`shipping`,`shippingfee`,`shippingcost`,`postage`,`discount`,`tax`,`vat`,`deposit`,`balance`,`fee`]),x=e=>b.has(v(e));function S(e,t,n){if(x(e)&&n){let e=typeof t==`number`?t:typeof t==`string`&&/^-?\d+(\.\d+)?$/.test(t.trim())?Number(t):null;if(e!==null)return[m(e,n)]}return z(t,n)}function C(e){let t=[],n=[];for(let r of e)(y(r[0])?t:n).push(r);return{bought:t,told:n}}function w(e){if(typeof e!=`string`)return e;let t=e.trim();if(!/^[[{]/.test(t))return e;try{return JSON.parse(t)}catch{return e}}var T=(e,t)=>{for(let n of t){let t=e[n];if(t!=null&&t!==``)return t}},E=[`name`,`productName`,`product`,`title`,`item`,`label`,`plan`,`description`],D=[`variant`,`variantName`,`option`,`options`,`choice`,`choices`,`size`,`colour`,`color`,`style`,`flavour`,`flavor`],O=[`quantity`,`qty`,`count`,`units`],k=[`total`,`lineTotal`,`subtotal`,`price`,`unitPrice`,`amount`],A=/(^|_|[a-z])(id|ids|image|images|img|photo|photos|picture|pictures|thumbnail|thumbnails|url|src|sku|slug)$/i,j=[`picture`,`pictures`,`photo`,`photos`,`image`,`images`,`img`,`thumbnail`,`cover`],M=e=>j.includes(v(e))||/(^|_|[a-z])(image|images|img|photo|photos|picture|pictures|thumbnail|thumbnails)$/i.test(String(e)),N=e=>{let t=T(e,j),n=Array.isArray(t)?t.find(e=>typeof e==`string`&&e.trim()):t,r=typeof n==`string`?n.trim():``;return/^https?:\/\//i.test(r)?r:``},P=(e,t)=>typeof e==`number`&&t?m(e,t):typeof e==`string`&&t&&/^\d+(\.\d+)?$/.test(e.trim())?m(Number(e),t):F(e),F=e=>e==null?``:typeof e==`boolean`?e?`Yes`:`No`:Array.isArray(e)?e.map(F).filter(Boolean).join(`, `):typeof e==`object`?typeof e.toDate==`function`?e.toDate().toLocaleString():Object.values(e).map(F).filter(Boolean).join(`, `):String(e),I=(e,t)=>{let n=F(T(e,E)),r=D.map(t=>e[t]).filter(e=>e!=null&&e!==``).map(F).filter(Boolean),i=T(e,O),a=T(e,k),o=new Set([...E,...D,...O,...k,...j]),s=Object.entries(e).filter(([e,t])=>!o.has(e)&&!A.test(e)&&t!==``&&t!=null).map(([e,t])=>`${g(e)}: ${F(t)}`),c=i!==void 0&&n?`${F(i)} × ${n}`:n||(i===void 0?``:`${F(i)} ×`);return r.length&&(c+=`${c?` — `:``}${r.join(`, `)}`),{head:c,price:a===void 0?``:P(a,t),rest:s,picture:N(e)}};function L(e,t){let{head:n,price:r,rest:i}=I(e,t);return[n,r,...i].filter(Boolean).join(` · `)}function R(e,t){let{head:n,price:r,rest:i,picture:a}=I(e,t);return{words:[n,...i].filter(Boolean).join(` · `),price:r,picture:a}}function z(e,t){let n=w(e);if(Array.isArray(n))return n.map(e=>e&&typeof e==`object`&&!Array.isArray(e)?L(e,t):F(e)).filter(Boolean);if(n&&typeof n==`object`&&typeof n.toDate!=`function`){let e=n;return E.some(t=>e[t]!==void 0)||O.some(t=>e[t]!==void 0)?[L(e,t)].filter(Boolean):Object.entries(e).filter(([,e])=>e!==``&&e!=null).map(([e,t])=>`${g(e)}: ${F(t)}`)}if(typeof n==`string`){let e=n.split(/\s*;\s*|\r?\n/).map(e=>e.trim()).filter(Boolean);return e.length?e:[]}let r=F(n);return r?[r]:[]}var B=new Set([`items`,`item`,`basket`,`cart`,`order`,`orderitems`,`orderlines`,`lines`,`lineitems`,`products`,`product`,`purchases`,`purchase`,`bought`]),V=new Set([`total`,`grandtotal`]),H=(e,t)=>{let n=e.match(/^(.*\S)\s+[—–·-]\s+((?:[£$€]\s?)?\d[\d,]*(?:\.\d+)?)$/);if(!n)return{left:e,right:``};let r=/^\d[\d,]*(?:\.\d+)?$/.test(n[2])?n[2].replace(/,/g,``):n[2];return{left:n[1],right:P(r,t)}},U=(e,t)=>{let n=w(e);return(Array.isArray(n)?n:[n]).flatMap(e=>{if(e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.toDate!=`function`){let n=e;if(E.some(e=>n[e]!==void 0)||O.some(e=>n[e]!==void 0)){let{words:e,price:r,picture:i}=R(n,t);return e||r?[{left:e,right:r,kind:`item`,...i?{picture:i}:{}}]:[]}return Object.entries(n).filter(([,e])=>e!==``&&e!=null).map(([e,t])=>({left:`${g(e)}: ${F(t)}`,right:``,kind:`item`}))}return z(e,t).map(e=>({...H(e,t),kind:`item`}))})};function W(e,t){let n=[],r=[],i=[];for(let[a,o]of e)if(x(a)){let[e=``]=S(a,o,t);if(!e)continue;let n=V.has(v(a));(n?i:r).push({left:g(a),right:e,kind:n?`total`:`extra`})}else if(B.has(v(a)))n.push(...U(o,t));else{let e=z(o,t).join(`, `);e&&r.push({left:g(a),right:e,kind:`extra`})}return[...n,...r,...i]}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return h}});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/lib/useIsPhone.ts
|
|
3
|
+
var n = "(max-width: 767px)", r = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(n).matches;
|
|
4
|
+
function i() {
|
|
5
|
+
let [i, a] = t(r);
|
|
6
|
+
return e(() => {
|
|
7
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
8
|
+
let e = window.matchMedia(n), t = () => a(e.matches);
|
|
9
|
+
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
10
|
+
}, []), i;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { i as n, r as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk-CiTBaPhY.cjs`);let e=require(`react`);var t=`(max-width: 767px)`,n=()=>typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(t).matches;function r(){let[r,i]=(0,e.useState)(n);return(0,e.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let e=window.matchMedia(t),n=()=>i(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),r}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|