your-ai-workflow-firebase-os 1.2.50 → 1.2.51
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/{ContactPopup-BGPbJTFR.js → ContactPopup-BurbGShS.js} +103 -28
- package/dist/{ContactPopup-B7q6Uk_F.cjs → ContactPopup-BzlpoeoW.cjs} +1 -1
- package/dist/{PhoneInputField-OdtJcL6V.js → PhoneInputField-DZFhNM2v.js} +1 -1
- package/dist/renderer.cjs.js +1 -1
- package/dist/renderer.es.js +1 -1
- package/dist/vite.cjs.js +7 -7
- package/dist/vite.es.js +84 -63
- package/dist/your-ai-workflow-firebase-os.cjs.js +18 -17
- package/dist/your-ai-workflow-firebase-os.css +1 -1
- package/dist/your-ai-workflow-firebase-os.es.js +4718 -4625
- package/package.json +1 -1
- package/scripts/postinstall.js +50 -9
- package/src/index.css +20 -14
|
@@ -45703,32 +45703,107 @@ function RW({ value: e, options: t, onChange: n, label: r, disabled: i, variant:
|
|
|
45703
45703
|
]
|
|
45704
45704
|
});
|
|
45705
45705
|
}
|
|
45706
|
+
var zW = /^image\/(jpe?g|png|webp)$/i, BW = [
|
|
45707
|
+
.82,
|
|
45708
|
+
.65,
|
|
45709
|
+
.5
|
|
45710
|
+
], VW = () => {
|
|
45711
|
+
try {
|
|
45712
|
+
let e = document.createElement("canvas");
|
|
45713
|
+
return e.width = 1, e.height = 1, e.toDataURL("image/webp").startsWith("data:image/webp");
|
|
45714
|
+
} catch {
|
|
45715
|
+
return !1;
|
|
45716
|
+
}
|
|
45717
|
+
}, HW = async (e) => {
|
|
45718
|
+
if (typeof createImageBitmap == "function") {
|
|
45719
|
+
let t = await createImageBitmap(e);
|
|
45720
|
+
return {
|
|
45721
|
+
source: t,
|
|
45722
|
+
width: t.width,
|
|
45723
|
+
height: t.height,
|
|
45724
|
+
done: () => t.close?.()
|
|
45725
|
+
};
|
|
45726
|
+
}
|
|
45727
|
+
let t = URL.createObjectURL(e);
|
|
45728
|
+
try {
|
|
45729
|
+
let e = await new Promise((e, n) => {
|
|
45730
|
+
let r = new Image();
|
|
45731
|
+
r.onload = () => e(r), r.onerror = () => n(/* @__PURE__ */ Error("That picture could not be read.")), r.src = t;
|
|
45732
|
+
});
|
|
45733
|
+
return {
|
|
45734
|
+
source: e,
|
|
45735
|
+
width: e.naturalWidth,
|
|
45736
|
+
height: e.naturalHeight,
|
|
45737
|
+
done: () => URL.revokeObjectURL(t)
|
|
45738
|
+
};
|
|
45739
|
+
} catch (e) {
|
|
45740
|
+
throw URL.revokeObjectURL(t), e;
|
|
45741
|
+
}
|
|
45742
|
+
}, UW = (e, t, n) => new Promise((r) => {
|
|
45743
|
+
if (typeof e.toBlob != "function") {
|
|
45744
|
+
r(null);
|
|
45745
|
+
return;
|
|
45746
|
+
}
|
|
45747
|
+
e.toBlob((e) => r(e), t, n);
|
|
45748
|
+
}), WW = (e, t) => {
|
|
45749
|
+
let n = t === "image/webp" ? "webp" : t === "image/png" ? "png" : "jpg";
|
|
45750
|
+
return `${(e || "image").replace(/\.[^.]+$/, "") || "image"}.${n}`;
|
|
45751
|
+
};
|
|
45752
|
+
async function GW(e, t = {}) {
|
|
45753
|
+
let n = t.maxSide ?? 1600, r = t.targetBytes ?? 921600;
|
|
45754
|
+
if (!e || !zW.test(e.type || "") || e.size <= 153600 || typeof document > "u") return e;
|
|
45755
|
+
try {
|
|
45756
|
+
let { source: t, width: i, height: a, done: o } = await HW(e);
|
|
45757
|
+
try {
|
|
45758
|
+
if (!i || !a) return e;
|
|
45759
|
+
let o = Math.min(1, n / Math.max(i, a)), s = document.createElement("canvas");
|
|
45760
|
+
s.width = Math.max(1, Math.round(i * o)), s.height = Math.max(1, Math.round(a * o));
|
|
45761
|
+
let c = s.getContext("2d");
|
|
45762
|
+
if (!c) return e;
|
|
45763
|
+
c.drawImage(t, 0, 0, s.width, s.height);
|
|
45764
|
+
let l = /png$/i.test(e.type), u = VW() ? "image/webp" : l ? "image/png" : "image/jpeg", d = null;
|
|
45765
|
+
for (let e of BW) {
|
|
45766
|
+
let t = await UW(s, u, e);
|
|
45767
|
+
if (!t || (d = t, t.size <= r) || u === "image/png") break;
|
|
45768
|
+
}
|
|
45769
|
+
return !d || d.size >= e.size ? e : new File([d], WW(e.name, u), {
|
|
45770
|
+
type: u,
|
|
45771
|
+
lastModified: Date.now()
|
|
45772
|
+
});
|
|
45773
|
+
} finally {
|
|
45774
|
+
o();
|
|
45775
|
+
}
|
|
45776
|
+
} catch {
|
|
45777
|
+
return e;
|
|
45778
|
+
}
|
|
45779
|
+
}
|
|
45706
45780
|
//#endregion
|
|
45707
45781
|
//#region src/lib/assetUpload.ts
|
|
45708
|
-
var
|
|
45709
|
-
async function
|
|
45782
|
+
var KW = "pub_files", qW = (e) => `${Date.now()}_${(e || "file").replace(/[^a-zA-Z0-9.-]/g, "_")}`;
|
|
45783
|
+
async function JW(e, t) {
|
|
45710
45784
|
if (!t) throw Error("Sign in again before uploading.");
|
|
45711
|
-
let n = `${
|
|
45712
|
-
await se(
|
|
45713
|
-
let
|
|
45714
|
-
return await y(b(Ce,
|
|
45715
|
-
fileName:
|
|
45716
|
-
fileType:
|
|
45717
|
-
fileSize:
|
|
45718
|
-
downloadURL:
|
|
45719
|
-
storagePath:
|
|
45785
|
+
let n = await GW(e), r = `${KW}/${qW(n.name)}`, i = k(we, r);
|
|
45786
|
+
await se(i, n, { customMetadata: { ownerId: t.uid } });
|
|
45787
|
+
let a = await ae(i);
|
|
45788
|
+
return await y(b(Ce, KW), {
|
|
45789
|
+
fileName: n.name,
|
|
45790
|
+
fileType: n.type || "unknown",
|
|
45791
|
+
fileSize: n.size,
|
|
45792
|
+
downloadURL: a,
|
|
45793
|
+
storagePath: r,
|
|
45720
45794
|
uid: t.uid,
|
|
45721
45795
|
uploaderEmail: t.email || "",
|
|
45722
45796
|
createdAt: ee()
|
|
45723
|
-
}),
|
|
45797
|
+
}), a;
|
|
45724
45798
|
}
|
|
45725
|
-
var
|
|
45726
|
-
async function
|
|
45727
|
-
|
|
45728
|
-
|
|
45729
|
-
|
|
45799
|
+
var YW = "pub_form_uploads";
|
|
45800
|
+
async function XW(e, t) {
|
|
45801
|
+
let n = await GW(e);
|
|
45802
|
+
if (n.size >= 10485760) throw Error("That file is over 10 MB. Try a smaller one.");
|
|
45803
|
+
let r = Math.random().toString(36).slice(2, 8), i = k(we, `${YW}/${Date.now()}_${r}_${(n.name || "file").replace(/[^a-zA-Z0-9.-]/g, "_")}`);
|
|
45804
|
+
return await se(i, n, t ? { customMetadata: { ownerId: t.uid } } : void 0), ae(i);
|
|
45730
45805
|
}
|
|
45731
|
-
function
|
|
45806
|
+
function ZW(e) {
|
|
45732
45807
|
try {
|
|
45733
45808
|
let t = new URL(e);
|
|
45734
45809
|
return (decodeURIComponent(t.pathname.split("/o/")[1] || t.pathname).split("/").pop() || "").replace(/^\d+_[a-z0-9]+_/, "") || t.hostname || "Attached file";
|
|
@@ -45736,15 +45811,15 @@ function WW(e) {
|
|
|
45736
45811
|
return "Attached file";
|
|
45737
45812
|
}
|
|
45738
45813
|
}
|
|
45739
|
-
var
|
|
45740
|
-
function
|
|
45814
|
+
var QW = (e) => e?.code === "storage/unauthorized" ? "You do not have permission to upload here." : e?.message || "That upload did not work. Try again.", $W = t.lazy(() => import("./PhoneInputField-DZFhNM2v.js").then((e) => e.n)), eG = /^[^\s@,;]+@[^\s@,;.]+(\.[^\s@,;.]+)*\.[a-z]{2,}$/i;
|
|
45815
|
+
function tG({ field: e, value: t, error: n, onChange: r }) {
|
|
45741
45816
|
let [i, a] = v(!1), [o, s] = v(""), c = _(null), l = async (e) => {
|
|
45742
45817
|
if (!(!e || i)) {
|
|
45743
45818
|
a(!0), s("");
|
|
45744
45819
|
try {
|
|
45745
|
-
r(await
|
|
45820
|
+
r(await XW(e, Se.currentUser));
|
|
45746
45821
|
} catch (e) {
|
|
45747
|
-
s(e?.code === "storage/unauthorized" ? "That kind of file is not accepted. Try a PDF, a document or a picture." :
|
|
45822
|
+
s(e?.code === "storage/unauthorized" ? "That kind of file is not accepted. Try a PDF, a document or a picture." : QW(e));
|
|
45748
45823
|
}
|
|
45749
45824
|
a(!1), c.current && (c.current.value = "");
|
|
45750
45825
|
}
|
|
@@ -45763,7 +45838,7 @@ function JW({ field: e, value: t, error: n, onChange: r }) {
|
|
|
45763
45838
|
i ? /* @__PURE__ */ A(I, { className: "w-4 h-4 animate-spin text-accent shrink-0" }) : /* @__PURE__ */ A(jx, { className: `w-4 h-4 shrink-0 ${t ? "text-accent" : "text-foreground/40"}` }),
|
|
45764
45839
|
/* @__PURE__ */ A("span", {
|
|
45765
45840
|
className: `flex-1 min-w-0 truncate text-[15px] ${t ? "text-foreground" : "text-foreground/40"}`,
|
|
45766
|
-
children: i ? "Uploading..." : t ?
|
|
45841
|
+
children: i ? "Uploading..." : t ? ZW(t) : e.placeholder || "Attach a file"
|
|
45767
45842
|
}),
|
|
45768
45843
|
!i && /* @__PURE__ */ j("span", {
|
|
45769
45844
|
className: "inline-flex items-center gap-1.5 text-[12.5px] font-bold text-foreground/60 shrink-0",
|
|
@@ -45799,7 +45874,7 @@ function JW({ field: e, value: t, error: n, onChange: r }) {
|
|
|
45799
45874
|
]
|
|
45800
45875
|
});
|
|
45801
45876
|
}
|
|
45802
|
-
function
|
|
45877
|
+
function nG({ onClose: e, formId: t, formConfig: n, isInline: r }) {
|
|
45803
45878
|
let [i, o] = v({}), [s, c] = v("idle"), [l, u] = v(""), [d, p] = v({}), m = _(null), [h, g] = v(n || null), [C, w] = v(!n), T = M(), E = Pe(), D = (e) => {
|
|
45804
45879
|
let t = (typeof window < "u" ? window.__FBOS_FORMS__ : null) || {};
|
|
45805
45880
|
return E?.defaultConfigs?.[e] || E?.defaultConfigs?.[`${e}Form`] || t[e] || (e === "contact" ? _e : e === "support" ? ye : null);
|
|
@@ -45873,7 +45948,7 @@ function YW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
|
|
|
45873
45948
|
let a = (h?.fields || []).filter((e) => e.type === "email"), s = {}, l = {};
|
|
45874
45949
|
if (a.forEach((e) => {
|
|
45875
45950
|
let t = String(i[e.name] ?? "").trim();
|
|
45876
|
-
t && (l[e.name] = t,
|
|
45951
|
+
t && (l[e.name] = t, eG.test(t) || (s[e.name] = "That does not look like an email address — check for a typo, e.g. jane@example.com"));
|
|
45877
45952
|
}), (h?.fields || []).filter((e) => e.type === "file" && e.required && !i[e.name]).forEach((e) => {
|
|
45878
45953
|
s[e.name] = "Please attach a file before sending.";
|
|
45879
45954
|
}), Object.keys(s).length > 0) {
|
|
@@ -46009,7 +46084,7 @@ function YW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
|
|
|
46009
46084
|
}).map((e, t) => {
|
|
46010
46085
|
if (e.type === "tel") return /* @__PURE__ */ A(a, {
|
|
46011
46086
|
fallback: /* @__PURE__ */ A("div", { className: "h-12 w-full glass-panel animate-pulse rounded-xl" }),
|
|
46012
|
-
children: /* @__PURE__ */ A(
|
|
46087
|
+
children: /* @__PURE__ */ A($W, {
|
|
46013
46088
|
field: e,
|
|
46014
46089
|
value: i[e.name] || "",
|
|
46015
46090
|
onChange: (t) => o({
|
|
@@ -46018,7 +46093,7 @@ function YW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
|
|
|
46018
46093
|
})
|
|
46019
46094
|
})
|
|
46020
46095
|
}, t);
|
|
46021
|
-
if (e.type === "file") return /* @__PURE__ */ A(
|
|
46096
|
+
if (e.type === "file") return /* @__PURE__ */ A(tG, {
|
|
46022
46097
|
field: e,
|
|
46023
46098
|
value: i[e.name] || "",
|
|
46024
46099
|
error: d[e.name],
|
|
@@ -46240,4 +46315,4 @@ function YW({ onClose: e, formId: t, formConfig: n, isInline: r }) {
|
|
|
46240
46315
|
}), document.body);
|
|
46241
46316
|
}
|
|
46242
46317
|
//#endregion
|
|
46243
|
-
export {
|
|
46318
|
+
export { Eg as $, oT as A, wn as At, Jy as B, Se as Bt, SA as C, as as Ct, TO as D, Yr as Dt, Rk as E, $a as Et, pC as F, Ut as Ft, I as G, ye as Gt, uv as H, Ee as Ht, TS as I, Re as It, n_ as J, ge as Jt, x_ as K, ve as Kt, Vx as L, ze as Lt, Hw as M, gn as Mt, zw as N, fn as Nt, cO as O, Ln as Ot, KC as P, qt as Pt, Dg as Q, jx as R, Ne as Rt, HA as S, ls as St, zk as T, no as Tt, X_ as U, we as Ut, Bv as V, Ce as Vt, Y_ as W, be as Wt, Zg as X, $g as Y, pe as Yt, Xg as Z, nM as _, nc as _t, JW as a, Mf as at, aj as b, ds as bt, IW as c, Md as ct, uU as d, xu as dt, hg as et, cU as f, Jl as ft, vM as g, sc as gt, yM as h, Yc as ht, QW as i, Vf as it, Zw as j, bn as jt, _T as k, An as kt, PW as l, bd as lt, uV as m, hl as mt, YW as n, gh as nt, GW as o, $d as ot, oU as p, xl as pt, y_ as q, _e as qt, ZW as r, Bm as rt, RW as s, Nd as st, nG as t, fg as tt, MW as u, ed as ut, eM as v, Ps as vt, sA as w, Qo as wt, WA as x, us as xt, bj as y, ws as yt, cx as z, Pe as zt };
|