PageSourceSearch

https://armm-shield.netlify.app/assets/SyncfusionFileUploader-2vn5OJHG.js

js armm-shield.netlify.app collected 2026-10-03 10:29:53 UTC 28,414 bytes, 604 lines download raw bytes

1import { aw as ie, a7 as se, aE as W, aF as le } from "./runtime-UCdpVvNx.js";
2import { b1 as oe, b2 as re, b3 as de, b as T, G as _, k as Q, E as V, j as b, B as f, S as g, d as D, D as N, F as ce, y as w, t as K, n as ue, al as fe, C as B, H as Ae } from "./task-spreadsheet-D5k0iGrQ.js";
3import { r as me, a0 as P, a9 as M, aa as pe, __tla as __tla_0 } from "./main-B1e8Vwqe.js";
4import { s as E, __tla as __tla_1 } from "./merge-Bfi6EpMN.js";
5import { s as $, a as he, i as we, g as be } from "./staged-attachment-uploads-DRinP1Ax.js";
6import { U as ge } from "./vendor__syncfusion_ej2_inputs-hTEX-N5T.js";
7let ht, Y, wt, pt, lt, dt, rt, mt, ft, $e, At, Ee, ct, ut, ot;
8let __tla = Promise.all([
9    (()=>{
10        try {
11            return __tla_0;
12        } catch  {}
13    })(),
14    (()=>{
15        try {
16            return __tla_1;
17        } catch  {}
18    })()
19]).then(async ()=>{
20    let F;
21    Y = {
22        Add: "fa-solid fa-plus",
23        Edit: "fa-solid fa-pen",
24        Delete: "fa-regular fa-trash-can",
25        Copy: "fa-solid fa-clone",
26        Details: "fa-solid fa-list",
27        ExcelExport: "fa-solid fa-file-excel",
28        Clear: "fa-solid fa-filter-circle-xmark",
29        Import: "fa-solid fa-file-import",
30        Download: "fa-solid fa-download",
31        FileZip: "fa-solid fa-file-zipper",
32        Print: "fa-solid fa-print",
33        Reject: "fa-solid fa-xmark",
34        Schedule: "fa-regular fa-calendar-days",
35        Spin: "fa-solid fa-spinner fa-spin",
36        DataReport: "fa-regular fa-newspaper",
37        Unlock: "fa-solid fa-unlock",
38        Play: "fa-solid fa-play",
39        Stop: "fa-solid fa-stop",
40        DoubleCheck: "fa-solid fa-check-double"
41    };
42    F = new Set([
43        "string",
44        "number",
45        "boolean"
46    ]);
47    function q(e, t, a, n, i, r = "") {
48        const l = e, d = t, c = new Set([
49            ...Object.keys(l),
50            ...Object.keys(d)
51        ]);
52        for (const u of c){
53            if (u === "auditTrail" || u === "version" || u === "id" || u === "detailsRichText" || u === "userPermissions") continue;
54            const s = l[u], o = d[u], m = r ? `${r}.${u}` : u;
55            if (!(s === void 0 && o === void 0)) {
56                if (Array.isArray(s) && Array.isArray(o) && s.every((h)=>F.has(typeof h)) && o.every((h)=>F.has(typeof h))) {
57                    JSON.stringify(s) !== JSON.stringify(o) && n.push({
58                        id: crypto.randomUUID(),
59                        entityId: i,
60                        modifiedAt: new Date().toISOString(),
61                        modifiedBy: a,
62                        field: m,
63                        oldValue: E(s),
64                        newValue: E(o)
65                    });
66                    continue;
67                }
68                if (F.has(typeof s) && F.has(typeof o)) {
69                    s !== o && n.push({
70                        id: crypto.randomUUID(),
71                        entityId: i,
72                        modifiedAt: new Date().toISOString(),
73                        modifiedBy: a,
74                        field: m,
75                        oldValue: E(s),
76                        newValue: E(o)
77                    });
78                    continue;
79                }
80                s && o && typeof s == "object" && typeof o == "object" && !Array.isArray(s) && !Array.isArray(o) ? q(s, o, a, n, i, m) : s !== o && n.push({
81                    id: crypto.randomUUID(),
82                    entityId: i,
83                    modifiedAt: new Date().toISOString(),
84                    modifiedBy: a,
85                    field: m,
86                    oldValue: E(s),
87                    newValue: E(o)
88                });
89            }
90        }
91    }
92    function ve(e, t, a) {
93        const n = [];
94        return q(e, t, a, n, e.id), n;
95    }
96    function ye(e, t, a) {
97        try {
98            const n = ve(e, t, a ?? "system");
99            return n.length === 0 ? {
100                ...e,
101                ...t
102            } : {
103                ...e,
104                ...t,
105                version: se(),
106                auditTrail: ie(E([
107                    ...e.auditTrail || [],
108                    ...n
109                ]))
110            };
111        } catch (n) {
112            throw console.error("Error applying audit trail", n), n;
113        }
114    }
115    let Se, x, xe, De, Z, Ce, Ue, ke;
116    lt = ({ email: e, parentId: t, file: a, userId: n, workflow: i })=>{
117        const r = new W;
118        return {
119            id: oe(),
120            parentId: t,
121            fileName: a.name,
122            createdAt: new Date().toISOString(),
123            sizeInKb: parseFloat((a.size / 1024).toFixed(2)),
124            sizeInBytes: Math.max(0, Math.round(a.size)),
125            email: e,
126            userId: n,
127            mimeType: a.name.split(".").pop() ?? "unknown",
128            version: r.next(),
129            ...i
130        };
131    };
132    Se = ({ existing: e, email: t, file: a, userId: n, workflow: i })=>{
133        const r = new W;
134        r.receive(e.version);
135        const l = {
136            ...i?.purpose ? {
137                purpose: i.purpose
138            } : {},
139            ...i?.deliverableType ? {
140                deliverableType: i.deliverableType
141            } : {},
142            ...i?.reviewStatus ? {
143                reviewStatus: i.reviewStatus
144            } : {}
145        };
146        return {
147            ...e,
148            fileName: a.name,
149            createdAt: new Date().toISOString(),
150            sizeInKb: parseFloat((a.size / 1024).toFixed(2)),
151            sizeInBytes: Math.max(0, Math.round(a.size)),
152            email: t,
153            userId: n,
154            mimeType: a.name.split(".").pop() ?? "unknown",
155            version: r.next(),
156            ...l,
157            ...(i?.purpose ?? e.purpose) === "DELIVERABLE" ? {
158                reviewStatus: "PENDING"
159            } : {}
160        };
161    };
162    x = (e)=>e.trim().toLowerCase();
163    xe = new Set([
164        "application/pdf",
165        "application/x-pdf"
166    ]);
167    Ee = (e)=>{
168        const t = e.name.slice(e.name.lastIndexOf(".")).toLowerCase(), a = e.type?.toLowerCase();
169        return t === ".jpg" || t === ".jpeg" ? !a || a === "image/jpeg" : t === ".png" ? !a || a === "image/png" : t === ".webp" ? !a || a === "image/webp" : !1;
170    };
171    De = (e)=>{
172        if (/\.pdf$/i.test(e.name.trim())) return !0;
173        if (typeof e.type != "string") return !1;
174        const t = e.type.split(";", 1)[0].trim().toLowerCase();
175        return xe.has(t);
176    };
177    ot = (e)=>{
178        if (!De(e.file) && !(e.allowPhotos && Ee(e.file))) return e.allowPhotos ? "Please select a PDF, JPEG, PNG, or WebP file." : "Please upload a PDF file.";
179        const t = e.existingAttachments.find((i)=>x(i.fileName) === x(e.file.name)), a = t ? e.existingAttachments.filter((i)=>i.id !== t.id) : e.existingAttachments, n = re({
180            existingAttachments: a,
181            incomingFiles: [
182                ...(e.stagedUploads ?? []).map((i)=>({
183                        name: i.fileName,
184                        size: i.fileSizeBytes ?? 0
185                    })),
186                {
187                    name: e.file.name,
188                    size: e.file.size
189                }
190            ],
191            limits: e.limits
192        });
193        return n.ok ? (e.stagedUploads ?? []).some((i)=>x(i.fileName) === x(e.file.name)) ? "A file with this name is already staged for upload." : null : de(n, e.limits);
194    };
195    Z = (e, t)=>e.find((a)=>a.id === t.id);
196    Ce = (e, t)=>e.find((a)=>x(a.fileName) === x(t));
197    Ue = (e, t)=>{
198        if (e.find((n)=>n.id !== t.id && x(n.fileName) === x(t.fileName))) throw new Error("A file with this name is already attached.");
199    };
200    rt = async (e)=>{
201        const t = Z(e.task.attachments, e.attachment), a = t ?? Ce(e.task.attachments, e.attachment.fileName) ?? (e.attachment.purpose === "DELIVERABLE" ? me(e.task) : void 0), n = a && (a.id !== e.attachment.id || a.version !== e.attachment.version) ? Se({
202            existing: a,
203            email: e.currentUser.email,
204            file: {
205                name: e.file.name,
206                size: e.file.size
207            },
208            userId: e.currentUser.id,
209            workflow: {
210                purpose: e.attachment.purpose,
211                deliverableType: e.attachment.deliverableType,
212                reviewStatus: e.attachment.reviewStatus
213            }
214        }) : e.attachment;
215        if (await P.uploadFile(e.file, n, "task"), !t || n.version !== t.version) try {
216            await e.upsertTaskAttachmentMetadata({
217                kind: "upsertTaskAttachmentMetadata",
218                taskId: e.task.id,
219                attachment: n,
220                baseTask: e.task
221            });
222        } catch (i) {
223            throw await P.cleanupUploadedFile(n, "task").catch(()=>{}), i;
224        }
225        await M({
226            storageBytes: t && n.version === t.version ? 0 : e.file.size,
227            bandwidthBytes: e.file.size
228        });
229    };
230    dt = async (e)=>{
231        const t = !!Z(e.foundWork.attachments, e.attachment);
232        Ue(e.foundWork.attachments, e.attachment), await P.uploadFile(e.file, e.attachment, "foundwork");
233        let a = e.foundWork;
234        if (!t) {
235            const n = {
236                ...e.foundWork,
237                attachments: [
238                    ...e.foundWork.attachments,
239                    e.attachment
240                ]
241            }, i = ye(e.foundWork, n, e.email);
242            a = await e.updateFoundWork({
243                kind: "updateFoundWork",
244                foundWork: i
245            }) ?? i, e.onAfterPersist?.(a);
246        }
247        return await M({
248            storageBytes: t ? 0 : e.file.size,
249            bandwidthBytes: e.file.size
250        }), a;
251    };
252    ke = (e)=>{
253        const t = le.safeParse(e);
254        return t.success && t.data.code === "BlobNotFound";
255    };
256    $e = (e)=>{
257        if (ke(e)) return !0;
258        if (typeof e != "object" || e === null || !("details" in e)) return !1;
259        const t = e.details;
260        return typeof t == "object" && t !== null && "errorCode" in t && t.errorCode === "BlobNotFound";
261    };
262    ct = async (e, t)=>{
263        try {
264            await P.deleteFile(e, t);
265        } catch (a) {
266            if ($e(a)) return;
267            throw a;
268        }
269    };
270    function J() {
271        const [e, t] = T(navigator.onLine), a = ()=>t(!0), n = ()=>t(!1);
272        return _(()=>{
273            window.addEventListener("online", a), window.addEventListener("offline", n);
274        }), Q(()=>{
275            window.removeEventListener("online", a), window.removeEventListener("offline", n);
276        }), e;
277    }
278    let O, H;
279    ut = (e)=>{
280        const t = J(), [a, n] = T([]), [i, r] = T([]), l = async ()=>{
281            const s = e.parentId();
282            if (!s) {
283                n([]);
284                return;
285            }
286            n(await $.listForParent(e.kind, s));
287        }, d = (s, o)=>{
288            r((m)=>o ? m.includes(s) ? m : [
289                    ...m,
290                    s
291                ] : m.filter((p)=>p !== s));
292        }, c = async (s)=>{
293            d(s, !0);
294            try {
295                await $.upload(s, async ({ file: o, record: m })=>{
296                    await e.uploadAttachment({
297                        file: o,
298                        attachment: m.attachment
299                    });
300                });
301            } finally{
302                d(s, !1), await l();
303            }
304        }, u = async (s)=>{
305            try {
306                const o = await he({
307                    kind: e.kind,
308                    attachment: s.attachment,
309                    file: s.file,
310                    isOnline: t(),
311                    uploadOnStage: e.uploadOnStage,
312                    uploadWhileOnline: e.uploadAttachment,
313                    service: $
314                });
315                return await l(), o;
316            } catch (o) {
317                throw we(o) ? new Error(be(t())) : o;
318            }
319        };
320        return _(()=>{
321            l();
322            const s = $.subscribe(()=>{
323                l();
324            });
325            Q(s);
326        }), V(()=>{
327            e.parentId(), l();
328        }), V(()=>{
329            if (e.resumeWhileOnline !== !1 && t()) for (const s of a())s.status === "pending" && c(s.id).catch(()=>{});
330        }), {
331            isOnline: t,
332            uploads: a,
333            retryingUploadIds: i,
334            retry: c,
335            stage: u,
336            refresh: l
337        };
338    };
339    O = (e)=>e.trim().toLowerCase();
340    H = (e, t)=>e === t.userId || !!t.email && O(e) === O(t.email);
341    ft = ({ attachment: e, parent: t, project: a, actor: n })=>{
342        const i = !!t && a?.id === t.projectId && H(a.owner, n), r = H(e.userId, n) || !!n.email && O(e.email) === O(n.email);
343        return i || r;
344    };
345    At = (e, t)=>e < t;
346    mt = async ({ attachment: e, kind: t, downloadFile: a })=>{
347        await a(e, t);
348        const n = e.sizeInBytes ?? e.sizeInKb * 1024;
349        await M({
350            storageBytes: 0,
351            bandwidthBytes: n
352        });
353    };
354    var Fe = w('<div class="mb-4 space-y-3"><div class=space-y-2>'), Ie = w("<div role=status aria-live=polite><i aria-hidden=true></i><div class=flex-1><div class=font-semibold></div><div class=text-sm>"), Ne = w('<span class="badge badge-outline font-semibold">'), Pe = w('<button type=button class="btn btn-sm btn-outline">'), Oe = w('<div class="rounded-lg border border-base-300 bg-base-100 px-4 py-3 shadow-sm"><div class="flex items-start justify-between gap-3"><div><div class="font-semibold break-all"></div><div class="text-sm text-base-content/70">');
355    let Le, Be, R, Re, Te;
356    Le = "Staged attachment file not found.";
357    Be = (e)=>e ? e === Le ? "This staged file is no longer available on this device. Select it again before retrying the upload." : e.includes("QuotaExceededError") || e.includes("Attachment persistence is unavailable") || e.includes("storage policy") ? "Local attachment storage is unavailable in this browser session. Reattach the file and upload it again while online." : e : "Upload failed. Try again.";
358    R = (e, t)=>`${e} ${t} upload${e === 1 ? "" : "s"}`;
359    Re = (e)=>e.failedUploads > 0 ? {
360            tone: "warning",
361            title: "Retry attachment uploads",
362            message: "Some staged attachments could not be sent. Try again after confirming the connection and the task is still available.",
363            countLabel: R(e.failedUploads, "failed")
364        } : e.pendingUploads > 0 ? e.isOnline ? {
365            tone: "info",
366            title: "Resuming staged uploads",
367            message: "Queued attachment uploads are resuming now. You can keep working while the files finish in the background.",
368            countLabel: R(e.pendingUploads, "staged")
369        } : {
370            tone: "warning",
371            title: "Connection lost",
372            message: "Your selected attachment uploads are stored locally and will resume automatically when the connection returns.",
373            countLabel: R(e.pendingUploads, "staged")
374        } : null;
375    Te = (e)=>e.upload.status === "failed" ? Be(e.upload.lastError) : e.isOnline ? "Waiting for upload confirmation." : "Stored locally until the connection returns.";
376    pt = (e)=>{
377        const t = ()=>e.uploads.filter((r)=>r.status === "failed"), a = ()=>e.uploads.filter((r)=>r.status !== "failed"), n = ()=>Re({
378                isOnline: e.isOnline,
379                pendingUploads: a().length,
380                failedUploads: t().length
381            }), i = (r)=>(e.retryingUploadIds ?? []).includes(r);
382        return b(g, {
383            get when () {
384                return e.uploads.length > 0;
385            },
386            get children () {
387                var r = Fe(), l = r.firstChild;
388                return f(r, b(g, {
389                    get when () {
390                        return n();
391                    },
392                    children: (d)=>(()=>{
393                            var c = Ie(), u = c.firstChild, s = u.nextSibling, o = s.firstChild, m = o.nextSibling;
394                            return f(o, ()=>d().title), f(m, ()=>d().message), f(c, b(g, {
395                                get when () {
396                                    return d().countLabel;
397                                },
398                                children: (p)=>(()=>{
399                                        var h = Ne();
400                                        return f(h, p), h;
401                                    })()
402                            }), null), D((p)=>{
403                                var h = `alert shadow-sm ${d().tone === "warning" ? "alert-warning" : "alert-info"}`, U = `fa-solid ${d().tone === "warning" ? "fa-wifi" : "fa-rotate"}`;
404                                return h !== p.e && N(c, p.e = h), U !== p.t && N(u, p.t = U), p;
405                            }, {
406                                e: void 0,
407                                t: void 0
408                            }), c;
409                        })()
410                }), l), f(l, b(ce, {
411                    get each () {
412                        return e.uploads;
413                    },
414                    children: (d)=>(()=>{
415                            var c = Oe(), u = c.firstChild, s = u.firstChild, o = s.firstChild, m = o.nextSibling;
416                            return f(o, ()=>d.fileName), f(m, ()=>Te({
417                                    upload: d,
418                                    isOnline: e.isOnline
419                                })), f(u, b(g, {
420                                get when () {
421                                    return d.status === "failed";
422                                },
423                                get children () {
424                                    var p = Pe();
425                                    return p.$$click = ()=>e.onRetry(d.id), f(p, ()=>i(d.id) ? "Retrying..." : "Retry"), D(()=>p.disabled = i(d.id)), p;
426                                }
427                            }), null), c;
428                        })()
429                })), r;
430            }
431        });
432    };
433    K([
434        "click"
435    ]);
436    const _e = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAYCAYAAAAPtVbGAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFfSURBVEhLY/wPBAw0BkxQmqZg+FhCME7WrFrJcO7cGSgPE7CwsDAEBAYzGBmbQEWwAJAl+EBlecn/X79+4cQgeRA+e+Y0VAcmoEpwBQSFMKxZDfTxWew+ptgSA0Mjhg3r1oDZG9avBdPoACNObKemMlx5cRfKwwTa4koM+9OnQ3mooL62iqGtoxvKg4HtmD7BZwEIXH15D8oiHuAMrgqneIaH1ZsZ+Dl4GC4VL2do98qGykCA5al2FIwPsEBpDDD92FqGKEMPhi3J/WCLOvYthMpAwHGzSiiLMMDpk48/vjAsO7+DQUdCmWH68TVgPjIQa3JHwfgATktArs+0DAHHEYgG8ZHBq7qdKBgfwBsnINeDUhuIRo8TyQAjFIwPYCRhwVonKAs3wOVyopMwKA7wAVA+IRmAfIIPECq7kDFILTaAM06oCSgu6pGBkZEJQ0hYOJSHAKN1PEmADpYwMAAARPI9qpAXNewAAAAASUVORK5CYII=", Qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAYCAYAAAD+vg1LAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIuSURBVEhL1VVNaxNRFL2pHw1Cx7RJBYVo/QfdShXdWKki+AP8AS67E0RRUVy39Q8kgSR77aKu
436LGi3Gug20NiiiOlH0o3NZGau595508ybjpBFu+gJZ867d+bed/Lm5SXDAJ0ARoweO05f49Q1rtfrJOkgCIwyNKAAY0ZONDuapbn7c1TI501VAtI4iWq1yr7vH9ITegPWajVuNptcKpe53W6bKhupSyFOBT7U94W+EhOQ53l6z3EcujkzQx+XlzVO4qxRC5hQ9dPKimocd2fvqVYqFdVz50dVjyA0bqNUKusSuG6fe64LQnsuHxj+Pegp+57HC4tLpsqG9fK+ZiboIlQSEQXDxF1cZ3kvTABW43U0voodGC8MKZ9kzuYWrjd4F6MQ1suLHsrxNo2DY6sfEDhU4B2aFHY26ML8E33mMuIrYAHPSHwE4jhCA+12Ka/jzvRt9lub3H30WOPfNMHbyOl4alp1C7lN8Ae4hto4Uh0LsnA2cq1IvdU1jSXvNtYp6O7Tmami5ibhNrfwztQlfJsJFN91AULHe3ce8p/cdXUq+AXdgXsP30KcCsRpC9xA3RcsYBwpjsOZXTgNOvKuQ1xqNWjs1VPqzD87zEXPR3Ec1q74hl1RpIwpGIZhU+FPXG/9b7t9zoyTk2gsSI8HTkX3wQexxqm/vMWl9+z2+0Px9Zu3pspG6rGJxpgQx6Melzg2MWaM48dm/P7LF89N5QCpjY8DJ/YPctoaE/0DhUl9LLjYQxoAAAAASUVORK5CYII=", Me = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAVCAYAAACt4nWrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFvSURBVEhLY/wPBAw0AkxQmiaApobjDZY1q1YynDt3BsrDDkJCwxmMjE2gPDQAMhwXqCwv+f/r1y+cGCQPwmfPnIbqQAUUB0tAUAjDmtVAH57F9CFFhhsYGjFsWLcGzAZZgA5Qwtyl8hTD1UdfoDxMoCXLzbCj2QjKQwX1tVUMbR3dUB4EoLgcn8EgcO3xVyiLOIARLE2xqgwTMzQZrDQFGZ4vdQLTID5IHAbcV39BwbgAhuHHrn9g0JbnBWIeMN9KS4BBVoQTLA4DO0N5UDAugGH41YefGbTleICGCjLsOPsG7HJLTQGwOAwYNt1EwbgAC5SGg8evfzA8efODwcNYhCG45TzD2hpDMB8kDgPn69ShLPwAa1K88vALw6dvf4BB8R5sMIiPDOQSDqNgXAAlKUpG74OycINHC2yhLFRAMCmCwhofAKVzkgDI5bgAobIFGYPUogOsYU4tQHGRCwNGRiYMIWHhUB4EDNVqjoEBAF1GPI6TC6GNAAAAAElFTkSuQmCC", I = {
437        excel: _e,
438        pdf: Qe,
439        png: pe,
440        word: Me
441    };
442    var Ge = w('<span class="badge badge-sm badge-ghost">OFFLINE'), ze = w('<button type=button class="btn btn-sm btn-ghost">Preview'), je = w('<button type=button class="btn btn-sm btn-outline"><i class="fa-solid fa-file-pdf"aria-hidden=true></i>Review'), Ve = w('<button type=button class="btn btn-sm btn-primary">Set as report'), Ye = w('<button type=button class="btn btn-sm btn-ghost btn-square text-error"title=Delete><i aria-hidden=true>'), He = w('<div class="ml-auto flex flex-wrap items-center justify-end gap-1.5"><button type=button class="btn btn-sm btn-ghost btn-square"title=Download><i aria-hidden=true>'), We = w('<article class="group rounded-xl border border-base-300 bg-base-100 px-3.5 py-3 transition-shadow hover:shadow-sm"><div class="flex flex-wrap items-center gap-3"><div class="grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-base-200/70"><img alt aria-hidden=true class="h-6 w-6 object-contain"></div><div class="min-w-[12rem] flex-1"><div class="flex flex-wrap items-center gap-2"><div class="min-w-0 truncate text-sm font-semibold text-base-content"></div></div><div class="mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs text-base-content/55"><span></span><span aria-hidden=true>•</span><span> KB</span><span aria-hidden=true>•</span><span class="max-w-full truncate">'), Ke = w('<span class="badge badge-sm border-0 font-semibold">');
443    let qe, Ze;
444    qe = (e)=>{
445        switch(e.mimeType){
446            case "pdf":
447                return I.pdf;
448            case "docx":
449            case "doc":
450                return I.word;
451            case "xlsx":
452            case "xls":
453            case "csv":
454                return I.excel;
455            default:
456                return I.png;
457        }
458    };
459    Ze = (e)=>new Date(e).toISOString().slice(0, 10);
460    ht = ({ attachment: e, canDelete: t, deleteAttachment: a, downloadAttachment: n, onView: i, onReview: r, onSubmitForReview: l, workflowStatus: d })=>{
461        const c = J();
462        return (()=>{
463            var u = We(), s = u.firstChild, o = s.firstChild, m = o.firstChild, p = o.nextSibling, h = p.firstChild, U = h.firstChild, X = h.nextSibling, G = X.firstChild, ee = G.nextSibling, L = ee.nextSibling, te = L.firstChild, ae = L.nextSibling, ne = ae.nextSibling;
464            return f(U, ()=>e.fileName), f(h, b(g, {
465                get when () {
466                    return d?.();
467                },
468                children: (v)=>(()=>{
469                        var y = Ke();
470                        return f(y, (()=>{
471                            var C = ue(()=>v() === "ACCEPTED");
472                            return ()=>C() ? "APPROVED" : v().replace("_", " ");
473                        })()), D((C)=>fe(y, {
474                                "bg-warning/15 text-warning-content": v() === "PENDING",
475                                "bg-error/10 text-error": v() === "CHANGES_REQUESTED",
476                                "bg-success/15 text-success": v() === "ACCEPTED"
477                            }, C)), y;
478                    })()
479            }), null), f(h, b(g, {
480                get when () {
481                    return !c();
482                },
483                get children () {
484                    return Ge();
485                }
486            }), null), f(G, ()=>
486Ze(e.createdAt)), f(L, ()=>e.sizeInKb, te), f(ne, ()=>e.email), f(s, b(g, {
487                get when () {
488                    return c();
489                },
490                get children () {
491                    var v = He(), y = v.firstChild, C = y.firstChild;
492                    return f(v, b(g, {
493                        get when () {
494                            return (i || r || l) && /\.pdf$/i.test(e.fileName);
495                        },
496                        get children () {
497                            return [
498                                b(g, {
499                                    when: i,
500                                    get children () {
501                                        var A = ze();
502                                        return A.$$click = ()=>i?.(e), A;
503                                    }
504                                }),
505                                b(g, {
506                                    when: r,
507                                    get children () {
508                                        var A = je();
509                                        return A.$$click = ()=>r?.(e), A;
510                                    }
511                                }),
512                                b(g, {
513                                    when: l,
514                                    get children () {
515                                        var A = Ve();
516                                        return A.$$click = ()=>l?.(e), A;
517                                    }
518                                })
519                            ];
520                        }
521                    }), y), y.$$click = ()=>n(e), f(v, b(g, {
522                        when: t,
523                        get children () {
524                            var A = Ye(), k = A.firstChild;
525                            return A.$$click = ()=>a(e), D((S)=>{
526                                var z = `Delete ${e.fileName}`, j = Y.Reject;
527                                return z !== S.e && B(A, "aria-label", S.e = z), j !== S.t && N(k, S.t = j), S;
528                            }, {
529                                e: void 0,
530                                t: void 0
531                            }), A;
532                        }
533                    }), null), D((A)=>{
534                        var k = `Download ${e.fileName}`, S = Y.Download;
535                        return k !== A.e && B(y, "aria-label", A.e = k), S !== A.t && N(C, A.t = S), A;
536                    }, {
537                        e: void 0,
538                        t: void 0
539                    }), v;
540                }
541            }), null), D(()=>B(m, "src", qe(e))), u;
542        })();
543    };
544    K([
545        "click"
546    ]);
547    var Je = w("<div class=w-full><input>");
548    let Xe;
549    Xe = "Please select a file to upload.";
550    wt = (e)=>{
551        let t = null, a = null;
552        const n = ()=>e.isReady?.() ?? !0, i = (l)=>e.onValidate(l), r = async ()=>{
553            if (!n()) return;
554            if (!t || t.filesData.length === 0) {
555                alert(Xe);
556                return;
557            }
558            const l = t.filesData[0];
559            if (!l) return;
560            const d = i(l);
561            if (d) {
562                t.clearAll(), alert(d);
563                return;
564            }
565            l.rawFile instanceof File && (await e.onAccept({
566                name: l.name,
567                size: l.size,
568                type: l.type,
569                rawFile: l.rawFile
570            }), t.clearAll());
571        };
572        return _(()=>{
573            a && (t = new ge({
574                multiple: !1,
575                autoUpload: !1,
576                selected: (l)=>{
577                    if (!n()) return;
578                    const d = l.filesData[0];
579                    if (!d) return;
580                    const c = i(d);
581                    c && (l.cancel = !0, t?.clearAll(), alert(c));
582                },
583                maxFileSize: e.maxFileSize,
584                allowedExtensions: e.allowedExtensions,
585                ...e.browseLabel ? {
586                    buttons: {
587                        browse: e.browseLabel,
588                        clear: "Clear",
589                        upload: "Upload"
590                    }
591                } : {},
592                beforeUpload: ()=>{
593                    r();
594                }
595            }), t.appendTo(a));
596        }), Q(()=>{
597            t?.destroy(), t = null;
598        }), (()=>{
599            var l = Je(), d = l.firstChild;
600            return Ae((c)=>a = c, d), l;
601        })();
602    };
603});
604export { ht as D, Y as I, wt as S, pt as a, lt as b, dt as c, rt as d, mt as e, ft as f, $e as g, At as h, Ee as i, ct as j, ut as u, ot as v, __tla };

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