From c2ffecbd33ea64ac4f189b4efc75488ce9b4923a Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Wed, 23 Sep 2026 11:31:23 +0200 Subject: [PATCH] a11y and rtl: named controls, keyboard access, and layouts that mirror - The view switcher keeps its labels for screen readers on phones, where only the icons show; its group has a name of its own. - Modal close icons are buttons, row menus say which task or project they act on, colour swatches are named and report which one is chosen, and the week arrows, status selects and unbilled checkboxes have names. - A task card opens from its title button as well as by click, so the board works from a keyboard; status changes stay in the task form. - Layout classes are logical (ms-, pe-, text-end, border-e, end-5), so a right-to-left host language mirrors the module with the rest of the app. - eslint-plugin-vuejs-accessibility runs in pnpm run lint with the host's rules, at zero warnings. Nothing here needs a newer host: the labels ride on props every supported host accepts, and older hosts ignore the ones they do not know. --- AGENTS.md | 10 +- dist/init.js | 3269 +++++++++-------- dist/style.css | 2 +- eslint.config.js | 39 + package.json | 1 + pnpm-lock.yaml | 25 + resources/js/components/AllTimeTable.vue | 8 +- resources/js/components/BulkActionBar.vue | 3 +- .../js/components/InvoiceNumberModal.vue | 11 +- resources/js/components/ProjectFormModal.vue | 15 +- resources/js/components/QuickStartOverlay.vue | 5 +- resources/js/components/StartTimerModal.vue | 11 +- resources/js/components/StopTimerModal.vue | 11 +- resources/js/components/TaskCard.vue | 12 +- resources/js/components/TaskFormModal.vue | 13 +- resources/js/components/TaskList.vue | 19 +- resources/js/components/TaskStatusEditor.vue | 7 +- resources/js/components/TimeEntryModal.vue | 11 +- resources/js/components/TimeLogGrid.vue | 30 +- resources/js/components/TimerChip.vue | 2 +- resources/js/components/ViewSwitcher.vue | 6 +- resources/js/components/WeekTimesheet.vue | 6 +- resources/js/messages.ts | 17 + resources/js/messages/tasks.ts | 1 + resources/js/pages/ProjectsIndexPage.vue | 15 +- resources/js/pages/ReportsPage.vue | 12 +- resources/js/pages/TaskPage.vue | 3 +- resources/js/pages/UnbilledTimePage.vue | 21 +- resources/js/pages/project/ProjectTimeTab.vue | 8 +- resources/js/pages/tasks/TasksBoardView.vue | 4 +- resources/js/support/colours.ts | 24 + 31 files changed, 1942 insertions(+), 1679 deletions(-) create mode 100644 resources/js/support/colours.ts diff --git a/AGENTS.md b/AGENTS.md index 28d266e..79303e0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -19,7 +19,9 @@ the InvoiceShelf 3.x `AGENTS.md` before making changes. `drop*`, `rename*`, `raw`, or `statement` calls in `up()`. - Run `composer run lint`, `composer run test`, `pnpm run build`, and package validation before release. -- `composer.json` pins `invoiceshelf/modules` 3.4.0 to an unreleased SDK commit through an inline - `package` repository, because `registerAbility`, `registerPage` and the `CompanyDataReader` - member and invoice readers are not tagged yet. Replace the whole `repositories` block with the - plain `vcs` entry once the SDK tags 3.4.0; the `^3.4.0` constraint already matches. +- `composer.json` takes `invoiceshelf/modules` `^3.4` from the SDK's GitHub repository through a + plain `vcs` entry. +- The module must run on every host its `module.json` compatibility range admits, so it uses only + Base* components and props that exist on the oldest of them. Name icon-only controls with + `aria-label`, and write layout classes in their logical form (`ms-`, `pe-`, `start-`, + `text-end`) so right-to-left languages mirror; `pnpm run lint` checks accessibility. diff --git a/dist/init.js b/dist/init.js index 1a2d1c9..94dc99e 100644 --- a/dist/init.js +++ b/dist/init.js @@ -3,6 +3,23 @@ const { Fragment: e, Teleport: t, computed: n, createBlock: r, createCommentVNod var j = { en: { tasks_projects: { general: { home: "Home", + close: "Close", + actions_for: "Actions for {name}", + select_named: "Select {name}", + colours: { + light_grey: "Light grey", + grey: "Grey", + blue: "Blue", + teal: "Teal", + green: "Green", + yellow: "Yellow", + amber: "Amber", + orange: "Orange", + red: "Red", + purple: "Purple", + violet: "Violet", + custom: "Custom colour" + }, filter: "Filter", search: "Search", actions: "Actions", @@ -104,7 +121,7 @@ function B() { } //#endregion //#region resources/js/components/InvoiceNumberModal.vue?vue&type=script&setup=true&lang.ts -var te = { class: "flex w-full items-center justify-between" }, ne = { class: "space-y-5 px-6 py-6" }, re = { class: "text-sm text-muted" }, ie = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, ae = /* @__PURE__ */ l({ +var te = { class: "flex w-full items-center justify-between" }, ne = ["aria-label"], re = { class: "space-y-5 px-6 py-6" }, ie = { class: "text-sm text-muted" }, ae = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, oe = /* @__PURE__ */ l({ __name: "InvoiceNumberModal", setup(e) { let t = B(), i = b(""), a = n(() => M.prompt !== null), l = n(() => i.value.trim() !== ""); @@ -123,12 +140,16 @@ var te = { class: "flex w-full items-center justify-between" }, ne = { class: "s show: a.value, onClose: d }, { - header: D(() => [o("div", te, [o("span", null, C(w(t)("tasks_projects.billing.number.title")), 1), c(f, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", te, [o("span", null, C(w(t)("tasks_projects.billing.number.title")), 1), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(t)("tasks_projects.general.close"), onClick: d - })])]), - default: D(() => [o("form", { onSubmit: A(u, ["prevent"]) }, [o("div", ne, [o("p", re, C(w(t)("tasks_projects.billing.number.description")), 1), c(m, { + }, [c(f, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, ne)])]), + default: D(() => [o("form", { onSubmit: A(u, ["prevent"]) }, [o("div", re, [o("p", ie, C(w(t)("tasks_projects.billing.number.description")), 1), c(m, { label: w(t)("tasks_projects.billing.number.label"), required: "" }, { @@ -140,7 +161,7 @@ var te = { class: "flex w-full items-center justify-between" }, ne = { class: "s autocomplete: "off" }, null, 8, ["modelValue"])]), _: 1 - }, 8, ["label"])]), o("div", ie, [c(h, { + }, 8, ["label"])]), o("div", ae, [c(h, { type: "button", variant: "primary-outline", onClick: d @@ -159,7 +180,7 @@ var te = { class: "flex w-full items-center justify-between" }, ne = { class: "s }, 8, ["show"]); }; } -}), oe = { en: { tasks_projects: { billing: { +}), se = { en: { tasks_projects: { billing: { title: "Unbilled time", subtitle: "Time that has not reached an invoice yet, by customer.", back: "Back to customers", @@ -229,12 +250,12 @@ var te = { class: "flex w-full items-center justify-between" }, ne = { class: "s load_failed: "Unable to load the unbilled time.", none_selected: "Select at least one entry." } -} } } }, se = "/api/v1/tasks-projects", ce = { - customers: `${se}/billing/customers`, - unbilled: `${se}/billing/unbilled`, - prepare: `${se}/billing/prepare`, - confirm: `${se}/billing/confirm` -}, le = { +} } } }, ce = "/api/v1/tasks-projects", le = { + customers: `${ce}/billing/customers`, + unbilled: `${ce}/billing/unbilled`, + prepare: `${ce}/billing/prepare`, + confirm: `${ce}/billing/confirm` +}, ue = { bootstrap: "/api/v1/bootstrap", customer: (e) => `/api/v1/customers/${e}`, invoices: "/api/v1/invoices", @@ -242,56 +263,56 @@ var te = { class: "flex w-full items-center justify-between" }, ne = { class: "s nextNumber: "/api/v1/next-number", exchangeRate: (e) => `/api/v1/currencies/${e}/exchange-rate` }; -async function ue(e, t = {}) { - let { data: n } = await e.get(ce.customers, { params: t }); +async function de(e, t = {}) { + let { data: n } = await e.get(le.customers, { params: t }); return n.data ?? []; } -async function de(e, t, n = {}) { - let { data: r } = await e.get(ce.unbilled, { params: { +async function fe(e, t, n = {}) { + let { data: r } = await e.get(le.unbilled, { params: { customer_id: t, ...n } }); return r.data; } -async function fe(e, t) { - let { data: n } = await e.post(ce.prepare, pe(t)); +async function pe(e, t) { + let { data: n } = await e.post(le.prepare, me(t)); return n.data; } -function pe(e) { +function me(e) { let t = "taskIds" in e ? { task_ids: e.taskIds } : "projectId" in e ? { project_id: e.projectId } : { entry_ids: e.entryIds }; return e.grouping !== void 0 && (t.grouping = e.grouping), t; } -async function me(e, t, n) { - let { data: r } = await e.post(ce.confirm, { +async function he(e, t, n) { + let { data: r } = await e.post(le.confirm, { invoice_id: t, items: n }); return r?.stamped ?? 0; } -async function he(e, t) { - let { data: n } = await e.get(le.customer(t)); +async function ge(e, t) { + let { data: n } = await e.get(ue.customer(t)); return n?.data ?? null; } -async function ge(e, t) { - let { data: n } = await e.post(le.invoices, t); +async function _e(e, t) { + let { data: n } = await e.post(ue.invoices, t); return n.data; } -async function _e(e) { - let { data: t } = await e.get(le.invoiceTemplates); +async function ve(e) { + let { data: t } = await e.get(ue.invoiceTemplates); return t?.invoiceTemplates ?? []; } -async function ve(e, t) { +async function ye(e, t) { let n = { key: "invoice" }; t !== void 0 && (n.userId = t); - let { data: r } = await e.get(le.nextNumber, { params: n }); + let { data: r } = await e.get(ue.nextNumber, { params: n }); return r?.success && typeof r.nextNumber == "string" ? r.nextNumber : null; } -async function ye(e, t) { - let { data: n } = await e.get(le.exchangeRate(t)), r = Array.isArray(n?.exchangeRate) ? n.exchangeRate[0] : n?.exchangeRate, i = Number(r); +async function be(e, t) { + let { data: n } = await e.get(ue.exchangeRate(t)), r = Array.isArray(n?.exchangeRate) ? n.exchangeRate[0] : n?.exchangeRate, i = Number(r); return Number.isFinite(i) && i > 0 ? i : null; } -async function be(e) { - let { data: t } = await e.get(le.bootstrap), n = t?.current_company_settings ?? {}, r = t?.current_user_settings ?? {}, i = Number(n.invoice_due_date_days), a = r.default_invoice_template; +async function xe(e) { + let { data: t } = await e.get(ue.bootstrap), n = t?.current_company_settings ?? {}, r = t?.current_user_settings ?? {}, i = Number(n.invoice_due_date_days), a = r.default_invoice_template; return { currency: t?.current_company_currency ?? null, dueDateDays: Number.isFinite(i) && i >= 0 ? i : 0, @@ -302,185 +323,185 @@ async function be(e) { } //#endregion //#region resources/js/api/time.ts -var xe = "/api/v1/tasks-projects", Se = { - timeEntries: `${xe}/time-entries`, - timeEntry: (e) => `${xe}/time-entries/${e}`, - timer: `${xe}/timer`, - timerStart: `${xe}/timer/start`, - timerStop: `${xe}/timer/stop`, - taskStatuses: `${xe}/task-statuses`, - taskStatus: (e) => `${xe}/task-statuses/${e}`, - reorderTaskStatuses: `${xe}/task-statuses/reorder`, - tasks: `${xe}/tasks`, - task: (e) => `${xe}/tasks/${e}`, - members: `${xe}/members`, - settings: `${xe}/settings` -}, Ce = { bootstrap: "/api/v1/bootstrap" }, we = 100, Te = 5, Ee = 10; -async function De(e, t) { - let { data: n } = await e.get(Se.timeEntries, { params: t }); +var Se = "/api/v1/tasks-projects", Ce = { + timeEntries: `${Se}/time-entries`, + timeEntry: (e) => `${Se}/time-entries/${e}`, + timer: `${Se}/timer`, + timerStart: `${Se}/timer/start`, + timerStop: `${Se}/timer/stop`, + taskStatuses: `${Se}/task-statuses`, + taskStatus: (e) => `${Se}/task-statuses/${e}`, + reorderTaskStatuses: `${Se}/task-statuses/reorder`, + tasks: `${Se}/tasks`, + task: (e) => `${Se}/tasks/${e}`, + members: `${Se}/members`, + settings: `${Se}/settings` +}, we = { bootstrap: "/api/v1/bootstrap" }, Te = 100, Ee = 5, De = 10; +async function Oe(e, t) { + let { data: n } = await e.get(Ce.timeEntries, { params: t }); return n; } -async function Oe(e, t) { +async function ke(e, t) { let n = []; - for (let r = 1; r <= Te; r += 1) { - let i = await De(e, { + for (let r = 1; r <= Ee; r += 1) { + let i = await Oe(e, { ...t, page: r, - limit: we + limit: Te }); if (n.push(...i.data ?? []), !i.meta || r >= i.meta.last_page) break; } return n; } -async function ke(e, t) { - let { data: n } = await e.post(Se.timeEntries, t); +async function Ae(e, t) { + let { data: n } = await e.post(Ce.timeEntries, t); return n.data; } -async function Ae(e, t, n) { - let { data: r } = await e.put(Se.timeEntry(t), n); +async function je(e, t, n) { + let { data: r } = await e.put(Ce.timeEntry(t), n); return r.data; } -async function je(e, t) { - await e.delete(Se.timeEntry(t)); +async function Me(e, t) { + await e.delete(Ce.timeEntry(t)); } -async function Me(e) { - let { data: t } = await e.get(Se.timer); +async function Ne(e) { + let { data: t } = await e.get(Ce.timer); return t?.data ?? null; } -async function Ne(e, t) { - let { data: n } = await e.post(Se.timerStart, t); +async function Pe(e, t) { + let { data: n } = await e.post(Ce.timerStart, t); return n.data; } -async function Pe(e, t = {}) { - let { data: n } = await e.post(Se.timerStop, t); +async function Fe(e, t = {}) { + let { data: n } = await e.post(Ce.timerStop, t); return n.data; } -async function Fe(e) { - await e.delete(Se.timer); -} async function Ie(e) { - let { data: t } = await e.get(Se.taskStatuses); + await e.delete(Ce.timer); +} +async function Le(e) { + let { data: t } = await e.get(Ce.taskStatuses); return t.data ?? []; } -async function Le(e, t) { - let { data: n } = await e.post(Se.taskStatuses, t); +async function Re(e, t) { + let { data: n } = await e.post(Ce.taskStatuses, t); return n.data; } -async function Re(e, t, n) { - let { data: r } = await e.put(Se.taskStatus(t), n); +async function ze(e, t, n) { + let { data: r } = await e.put(Ce.taskStatus(t), n); return r.data; } -async function ze(e, t) { - await e.delete(Se.taskStatus(t)); -} async function Be(e, t) { - let { data: n } = await e.post(Se.reorderTaskStatuses, { ids: t }); + await e.delete(Ce.taskStatus(t)); +} +async function Ve(e, t) { + let { data: n } = await e.post(Ce.reorderTaskStatuses, { ids: t }); return n.data ?? []; } -async function Ve(e, t, n = {}) { - let r = { limit: n.limit ?? Ee }; +async function He(e, t, n = {}) { + let r = { limit: n.limit ?? De }; t.trim() !== "" && (r.search = t.trim()), typeof n.projectId == "number" && (r.project_id = n.projectId), n.invoiced !== void 0 && (r.invoiced = n.invoiced); - let { data: i } = await e.get(Se.tasks, { params: r }); + let { data: i } = await e.get(Ce.tasks, { params: r }); return i.data ?? []; } -async function He(e, t) { - let { data: n } = await e.get(Se.task(t)); +async function Ue(e, t) { + let { data: n } = await e.get(Ce.task(t)); return n.data; } -async function Ue(e) { - let { data: t } = await e.get(Se.settings); +async function We(e) { + let { data: t } = await e.get(Ce.settings); return t.data; } -async function We(e) { - let { data: t } = await e.get(Ce.bootstrap), n = t?.current_user?.id; +async function Ge(e) { + let { data: t } = await e.get(we.bootstrap), n = t?.current_user?.id; return typeof n == "number" ? n : null; } //#endregion //#region resources/js/stores/tasks.ts -var Ge = y({}), Ke = /* @__PURE__ */ new Set(), qe = 5, Je = { +var Ke = y({}), qe = /* @__PURE__ */ new Set(), Je = 5, Ye = { logged_minutes: 0, billable_minutes: 0, unbilled_minutes: 0, unbilled_amount: 0, invoiced: "none", running: [] -}, Ye = b(0), Xe = y({}); -function Ze(e) { - return e === null ? "" : Ge[e] ?? `#${e}`; -} +}, Xe = b(0), Ze = y({}); function Qe(e) { - e && typeof e.id == "number" && typeof e.name == "string" && (Ge[e.id] = e.name); + return e === null ? "" : Ke[e] ?? `#${e}`; +} +function $e(e) { + e && typeof e.id == "number" && typeof e.name == "string" && (Ke[e.id] = e.name); } -async function $e(e, t) { - let n = [...new Set(t)].filter((e) => typeof e == "number" && Ge[e] === void 0 && !Ke.has(e)); - for (let e of n) Ke.add(e); - for (let t = 0; t < n.length; t += qe) await Promise.all(n.slice(t, t + qe).map(async (t) => { +async function et(e, t) { + let n = [...new Set(t)].filter((e) => typeof e == "number" && Ke[e] === void 0 && !qe.has(e)); + for (let e of n) qe.add(e); + for (let t = 0; t < n.length; t += Je) await Promise.all(n.slice(t, t + Je).map(async (t) => { try { - Qe(await He(e, t)); + $e(await Ue(e, t)); } catch {} finally { - Ke.delete(t); + qe.delete(t); } })); } -var et = Ye; +var tt = Xe; function V() { - Ye.value += 1; + Xe.value += 1; } -function tt(e, t) { - Xe[e] = { - ...Xe[e] ?? {}, +function nt(e, t) { + Ze[e] = { + ...Ze[e] ?? {}, ...t }; } -function nt(e) { - if (!e || typeof e.id != "number") return Je; - let t = e.time ?? Je; +function rt(e) { + if (!e || typeof e.id != "number") return Ye; + let t = e.time ?? Ye; return { - ...Je, + ...Ye, ...t, running: Array.isArray(t.running) ? t.running : [], - ...Xe[e.id] ?? {} + ...Ze[e.id] ?? {} }; } -function rt() { - for (let e of Object.keys(Ge)) delete Ge[Number(e)]; - for (let e of Object.keys(Xe)) delete Xe[Number(e)]; - Ke.clear(); +function it() { + for (let e of Object.keys(Ke)) delete Ke[Number(e)]; + for (let e of Object.keys(Ze)) delete Ze[Number(e)]; + qe.clear(); } //#endregion //#region resources/js/support/errors.ts -function it(e) { +function at(e) { if (typeof e != "object" || !e) return null; let t = e.response; return typeof t?.data != "object" || t.data === null ? null : t.data; } function H(e, t) { - let n = it(e)?.message; + let n = at(e)?.message; return typeof n == "string" && n !== "" ? n : t; } -function at(e) { - let t = it(e)?.errors, n = {}; +function ot(e) { + let t = at(e)?.errors, n = {}; if (typeof t != "object" || !t) return n; for (let [e, r] of Object.entries(t)) Array.isArray(r) && typeof r[0] == "string" && (n[e] = r[0]); return n; } //#endregion //#region resources/js/support/format.ts -function ot(e) { +function st(e) { return e === null ? "" : String(e / 100); } -function st(e) { +function ct(e) { let t = Number(e); return e.trim() === "" || Number.isNaN(t) ? null : Math.round(t * 100); } -function ct(e) { +function lt(e) { return e === null ? "" : String(e / 60); } -function lt(e) { +function ut(e) { let t = Number(e); return e.trim() === "" || Number.isNaN(t) ? null : Math.round(t * 60); } -function ut(e) { +function dt(e) { if (!e) return ""; let [t, n, r] = e.slice(0, 10).split("-").map(Number); return !t || !n || !r ? e : new Date(Date.UTC(t, n - 1, r)).toLocaleDateString(void 0, { @@ -490,62 +511,62 @@ function ut(e) { timeZone: "UTC" }); } -function dt(e) { +function ft(e) { if (typeof e == "string") return e.slice(0, 10); let t = String(e.getMonth() + 1).padStart(2, "0"), n = String(e.getDate()).padStart(2, "0"); return `${e.getFullYear()}-${t}-${n}`; } -function ft(e) { +function pt(e) { let t = Math.max(0, Math.round(e ?? 0)), n = Math.floor(t / 60), r = t % 60; return n === 0 ? `${r}m` : r === 0 ? `${n}h` : `${n}h ${r}m`; } -function pt(e) { +function mt(e) { let t = e.trim().split(/\s+/).filter(Boolean); return t.length === 0 ? "?" : (t[0].charAt(0) + (t.length > 1 ? t[t.length - 1].charAt(0) : "")).toUpperCase(); } -function mt(e) { +function ht(e) { if (!e) return !1; let t = /* @__PURE__ */ new Date(), n = `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`; return e.slice(0, 10) < n; } //#endregion //#region resources/js/support/http.ts -function ht(e) { +function gt(e) { if (typeof e != "object" || !e) return null; let t = e.response?.status; return typeof t == "number" ? t : null; } -function gt(e) { +function _t(e) { if (typeof e != "object" || !e) return null; let t = e.response?.data; if (typeof t != "object" || !t) return null; let n = t.error; return typeof n == "string" && n !== "" ? n : null; } -function _t(e) { - return ht(e) === 409; -} function vt(e) { - return ht(e) === 403; + return gt(e) === 409; +} +function yt(e) { + return gt(e) === 403; } //#endregion //#region resources/js/support/invoicing.ts -var yt = "/admin/invoices"; -async function bt(e, t) { +var bt = "/admin/invoices"; +async function xt(e, t) { let { notify: n, t: r } = e; if (M.pending !== null) return n("warning", r("tasks_projects.billing.pending_stamp")), !1; if (!N()) return !1; try { - return await Ct(e, t); + return await wt(e, t); } finally { P(); } } -async function xt(e, t, n) { +async function St(e, t, n) { let r = M.pending; if (r === null || !N()) return !1; try { - let i = await me(e, r.invoiceId, r.items); + let i = await he(e, r.invoiceId, r.items); return I(), V(), t("success", n("tasks_projects.billing.stamped", { count: i })), !0; } catch (e) { return t("error", H(e, n("tasks_projects.billing.stamp_failed"))), !1; @@ -553,44 +574,44 @@ async function xt(e, t, n) { P(); } } -function St(e) { - return `${yt}/${e}/view`; +function Ct(e) { + return `${bt}/${e}/view`; } -async function Ct(e, t) { +async function wt(e, t) { let { client: n, notify: r, t: i } = e, a; try { - a = await fe(n, t); + a = await pe(n, t); } catch (t) { - return wt(e, t), !1; + return Tt(e, t), !1; } if (!Array.isArray(a.items) || a.items.length === 0) return r("warning", i("tasks_projects.billing.nothing_to_invoice")), !1; let [o, s, c] = await Promise.all([ - be(n).catch(() => null), - _e(n).catch(() => []), - he(n, a.customer_id).catch(() => null) - ]), l = c?.currency_id ?? c?.currency?.id ?? a.currency_id, u = o?.currency?.id ?? null, d = u !== null && l !== null && l !== u, f = await Et(e, o, a.customer_id); + xe(n).catch(() => null), + ve(n).catch(() => []), + ge(n, a.customer_id).catch(() => null) + ]), l = c?.currency_id ?? c?.currency?.id ?? a.currency_id, u = o?.currency?.id ?? null, d = u !== null && l !== null && l !== u, f = await Dt(e, o, a.customer_id); if (f === null) return !1; let p = null; - d && l !== null && (p = await ye(n, l).catch(() => null), p === null && r("warning", i("tasks_projects.billing.rate_failed"))); - let m = Ot(a, { + d && l !== null && (p = await be(n, l).catch(() => null), p === null && r("warning", i("tasks_projects.billing.rate_failed"))); + let m = kt(a, { invoiceNumber: f, currencyId: l, exchangeRate: p, - dueDate: Dt(a.invoice_date, o), + dueDate: Ot(a.invoice_date, o), templateName: o?.defaultTemplate ?? s[0]?.name ?? "" }), h; try { - h = await ge(n, m); + h = await _e(n, m); } catch (e) { return r("error", H(e, i("tasks_projects.billing.create_failed"))), !1; } - let g = await kt(e, h, a); - return V(), g ? (r("success", i("tasks_projects.billing.created", { number: h.invoice_number })), await jt(e.router, h.id), !0) : !1; + let g = await At(e, h, a); + return V(), g ? (r("success", i("tasks_projects.billing.created", { number: h.invoice_number })), await Mt(e.router, h.id), !0) : !1; } -function wt(e, t) { - let { notify: n, t: r } = e, i = gt(t); +function Tt(e, t) { + let { notify: n, t: r } = e, i = _t(t); if (i === "mixed_billing_selection") { - let e = Tt(t); + let e = Et(t); n("error", e > 1 ? r("tasks_projects.billing.mixed_customers", { count: e }) : H(t, r("tasks_projects.billing.mixed_selection"))); return; } @@ -598,29 +619,29 @@ function wt(e, t) { n("warning", r("tasks_projects.billing.nothing_to_invoice")); return; } - if (ht(t) === 403) { + if (gt(t) === 403) { L(), n("error", r("tasks_projects.billing.forbidden")); return; } n("error", H(t, r("tasks_projects.billing.prepare_failed"))); } -function Tt(e) { +function Et(e) { if (typeof e != "object" || !e) return 0; let t = e.response?.data; if (typeof t != "object" || !t) return 0; let n = t.customer_ids; return Array.isArray(n) ? n.length : 0; } -async function Et(e, t, n) { - let r = await ve(e.client, n).catch(() => null); +async function Dt(e, t, n) { + let r = await ye(e.client, n).catch(() => null); return t?.autoGenerateNumber !== !1 && r !== null ? r : R(r ?? ""); } -function Dt(e, t) { +function Ot(e, t) { if (t === null || !t.setDueDateAutomatically) return null; let n = /* @__PURE__ */ new Date(`${e}T00:00:00`); - return Number.isNaN(n.getTime()) ? null : (n.setDate(n.getDate() + t.dueDateDays), dt(n)); + return Number.isNaN(n.getTime()) ? null : (n.setDate(n.getDate() + t.dueDateDays), ft(n)); } -function Ot(e, t) { +function kt(e, t) { return { invoice_date: e.invoice_date, due_date: t.dueDate, @@ -641,11 +662,11 @@ function Ot(e, t) { taxes: [] }; } -async function kt(e, t, n) { - let { client: r, notify: i, t: a } = e, o = At(t, n); - if (o.length === 0) return i("error", a("tasks_projects.billing.stamp_unmatched", { number: t.invoice_number })), await jt(e.router, t.id), !1; +async function At(e, t, n) { + let { client: r, notify: i, t: a } = e, o = jt(t, n); + if (o.length === 0) return i("error", a("tasks_projects.billing.stamp_unmatched", { number: t.invoice_number })), await Mt(e.router, t.id), !1; try { - return await me(r, t.id, o), !0; + return await he(r, t.id, o), !0; } catch (e) { return F({ invoiceId: t.id, @@ -654,7 +675,7 @@ async function kt(e, t, n) { }), i("error", H(e, a("tasks_projects.billing.stamp_failed_notice", { number: t.invoice_number }))), !1; } } -function At(e, t) { +function jt(e, t) { let n = Array.isArray(e.items) ? e.items : [], r = Array.isArray(t.groups) ? t.groups : [], i = []; return r.forEach((e, t) => { let r = n[t]; @@ -664,10 +685,10 @@ function At(e, t) { }); }), i; } -async function jt(e, t) { - await Mt(e, `${yt}/${t}/edit`) || await Mt(e, St(t)); -} async function Mt(e, t) { + await Nt(e, `${bt}/${t}/edit`) || await Nt(e, Ct(t)); +} +async function Nt(e, t) { try { return !await e.push(t); } catch { @@ -676,11 +697,11 @@ async function Mt(e, t) { } //#endregion //#region resources/js/components/InvoiceRetryBanner.vue?vue&type=script&setup=true&lang.ts -var Nt = { +var Pt = { key: 0, class: "mt-4 rounded-xl border border-status-yellow bg-surface p-5", role: "alert" -}, Pt = { class: "text-sm font-semibold text-heading" }, Ft = { class: "mt-1 text-sm text-muted" }, It = { class: "mt-4 flex flex-wrap items-center gap-3" }, Lt = /* @__PURE__ */ l({ +}, Ft = { class: "text-sm font-semibold text-heading" }, It = { class: "mt-1 text-sm text-muted" }, Lt = { class: "mt-4 flex flex-wrap items-center gap-3" }, Rt = /* @__PURE__ */ l({ __name: "InvoiceRetryBanner", props: { client: { type: [Function, Object] }, @@ -692,7 +713,7 @@ var Nt = { if (!l.value) { l.value = !0; try { - await xt(t.client, t.notify, r); + await St(t.client, t.notify, r); } finally { l.value = !1; } @@ -703,10 +724,10 @@ var Nt = { } return (e, t) => { let n = S("BaseButton"), p = S("router-link"); - return u.value ? (v(), a("div", Nt, [ - o("p", Pt, C(w(r)("tasks_projects.billing.retry.title")), 1), - o("p", Ft, C(w(r)("tasks_projects.billing.retry.description", { number: u.value.invoiceNumber })), 1), - o("div", It, [ + return u.value ? (v(), a("div", Pt, [ + o("p", Ft, C(w(r)("tasks_projects.billing.retry.title")), 1), + o("p", It, C(w(r)("tasks_projects.billing.retry.description", { number: u.value.invoiceNumber })), 1), + o("div", Lt, [ c(n, { variant: "primary", loading: l.value, @@ -716,7 +737,7 @@ var Nt = { default: D(() => [s(C(w(r)("tasks_projects.billing.retry.action")), 1)]), _: 1 }, 8, ["loading", "disabled"]), - c(p, { to: w(St)(u.value.invoiceId) }, { + c(p, { to: w(Ct)(u.value.invoiceId) }, { default: D(() => [c(n, { variant: "white" }, { default: D(() => [s(C(w(r)("tasks_projects.billing.retry.open_invoice")), 1)]), _: 1 @@ -732,15 +753,15 @@ var Nt = { ])) : i("", !0); }; } -}), Rt = "/api/v1/tasks-projects", zt = { - projects: `${Rt}/projects`, - project: (e) => `${Rt}/projects/${e}`, - archiveProject: (e) => `${Rt}/projects/${e}/archive`, - unarchiveProject: (e) => `${Rt}/projects/${e}/unarchive`, - members: `${Rt}/members`, - settings: `${Rt}/settings` -}, Bt = { customers: "/api/v1/customers" }; -function Vt(e, t) { +}), zt = "/api/v1/tasks-projects", Bt = { + projects: `${zt}/projects`, + project: (e) => `${zt}/projects/${e}`, + archiveProject: (e) => `${zt}/projects/${e}/archive`, + unarchiveProject: (e) => `${zt}/projects/${e}/unarchive`, + members: `${zt}/members`, + settings: `${zt}/settings` +}, Vt = { customers: "/api/v1/customers" }; +function Ht(e, t) { if (e === void 0 || e.order === "") return {}; let n = t[e.fieldName]; return n === void 0 ? {} : { @@ -748,60 +769,60 @@ function Vt(e, t) { sort_order: e.order }; } -async function Ht(e, t) { - let { data: n } = await e.get(zt.projects, { params: t }); +async function Ut(e, t) { + let { data: n } = await e.get(Bt.projects, { params: t }); return n; } -async function Ut(e, t) { - let { data: n } = await e.post(zt.projects, t); +async function Wt(e, t) { + let { data: n } = await e.post(Bt.projects, t); return n.data; } -async function Wt(e, t, n) { - let { data: r } = await e.put(zt.project(t), n); +async function Gt(e, t, n) { + let { data: r } = await e.put(Bt.project(t), n); return r.data; } -async function Gt(e, t) { - let { data: n } = await e.post(zt.archiveProject(t)); - return n.data; -} async function Kt(e, t) { - let { data: n } = await e.post(zt.unarchiveProject(t)); + let { data: n } = await e.post(Bt.archiveProject(t)); return n.data; } async function qt(e, t) { - await e.delete(zt.project(t)); + let { data: n } = await e.post(Bt.unarchiveProject(t)); + return n.data; +} +async function Jt(e, t) { + await e.delete(Bt.project(t)); } -async function Jt(e) { - let { data: t } = await e.get(zt.members); +async function Yt(e) { + let { data: t } = await e.get(Bt.members); return t.data; } -async function Yt(e, t = 100) { - let { data: n } = await e.get(Bt.customers, { params: { limit: t } }); +async function Xt(e, t = 100) { + let { data: n } = await e.get(Vt.customers, { params: { limit: t } }); return n.data; } -var Xt = y({}), Zt = !1, Qt = null; -function $t(e) { - return e === null ? "" : Xt[e] ?? `#${e}`; +var Zt = y({}), Qt = !1, $t = null; +function en(e) { + return e === null ? "" : Zt[e] ?? `#${e}`; } -async function en(e) { - Zt || (Qt ??= nn(e), await Qt); +async function tn(e) { + Qt || ($t ??= rn(e), await $t); } -function tn() { - for (let e of Object.keys(Xt)) delete Xt[Number(e)]; - Zt = !1, Qt = null; +function nn() { + for (let e of Object.keys(Zt)) delete Zt[Number(e)]; + Qt = !1, $t = null; } -async function nn(e) { +async function rn(e) { try { - for (let t of await Yt(e, 200)) { + for (let t of await Xt(e, 200)) { let e = t?.id; - typeof e == "number" && (Xt[e] = rn(t)); + typeof e == "number" && (Zt[e] = an(t)); } - Zt = !0; + Qt = !0; } catch {} finally { - Qt = null; + $t = null; } } -function rn(e) { +function an(e) { let t = typeof e.display_name == "string" ? e.display_name.trim() : ""; if (t !== "") return t; let n = typeof e.name == "string" ? e.name.trim() : ""; @@ -809,18 +830,18 @@ function rn(e) { } //#endregion //#region resources/js/support/page.ts -var U = "tasks-projects", an = `/admin/modules/${U}`, W = { - tasks: an, - board: `${an}/board`, - week: `${an}/week`, - task: (e) => `${an}/tasks/${e}`, - projects: `${an}/projects`, - project: (e) => `${an}/projects/${e}`, - reports: `${an}/reports`, - billing: `${an}/billing`, +var U = "tasks-projects", on = `/admin/modules/${U}`, W = { + tasks: on, + board: `${on}/board`, + week: `${on}/week`, + task: (e) => `${on}/tasks/${e}`, + projects: `${on}/projects`, + project: (e) => `${on}/projects/${e}`, + reports: `${on}/reports`, + billing: `${on}/billing`, settings: "/admin/settings/modules", customer: (e) => `/admin/customers/${e}/view` -}, on = { +}, sn = { tasks: `extension.page.${U}.tasks`, list: `extension.page.${U}.tasks.list`, board: `extension.page.${U}.tasks.board`, @@ -829,7 +850,7 @@ var U = "tasks-projects", an = `/admin/modules/${U}`, W = { projects: `extension.page.${U}.projects`, project: `extension.page.${U}.project` }; -function sn(e, t) { +function cn(e, t) { return l({ setup: (n, { attrs: r }) => () => d(t, { ...r, client: e.client, @@ -841,22 +862,26 @@ function sn(e, t) { } //#endregion //#region resources/js/pages/UnbilledTimePage.vue?vue&type=script&setup=true&lang.ts -var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap items-center justify-end gap-3" }, un = { class: "mt-4 flex flex-wrap items-end gap-4" }, dn = { +var ln = { class: "mt-2 text-sm text-muted" }, un = { class: "flex flex-wrap items-center justify-end gap-3" }, dn = { class: "mt-4 flex flex-wrap items-end gap-4" }, fn = { key: 0, class: "flex justify-center py-16" -}, fn = { +}, pn = { key: 1, class: "mt-6" -}, pn = { class: "text-base font-semibold text-heading" }, mn = { class: "mt-1 text-sm text-muted" }, hn = { +}, mn = { class: "text-base font-semibold text-heading" }, hn = { class: "mt-1 text-sm text-muted" }, gn = { key: 0, class: "mt-5 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3" -}, gn = ["onClick"], _n = { class: "text-sm font-semibold text-heading" }, vn = { class: "mt-1 text-xs text-muted" }, yn = { class: "mt-3 text-xl font-semibold text-heading" }, bn = { +}, _n = ["onClick"], vn = { class: "text-sm font-semibold text-heading" }, yn = { class: "mt-1 text-xs text-muted" }, bn = { class: "mt-3 text-xl font-semibold text-heading" }, xn = { key: 2, class: "mt-6" -}, xn = { class: "flex flex-wrap items-end justify-between gap-4" }, Sn = { class: "text-base font-semibold text-heading" }, Cn = { class: "mt-1 text-sm text-muted" }, wn = { +}, Sn = { class: "flex flex-wrap items-end justify-between gap-4" }, Cn = { class: "text-base font-semibold text-heading" }, wn = { class: "mt-1 text-sm text-muted" }, Tn = { key: 0, class: "flex justify-center py-16" -}, Tn = { class: "mt-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-line-default bg-surface-secondary px-4 py-3" }, En = { class: "flex cursor-pointer items-center gap-2 text-sm font-medium text-heading" }, Dn = ["checked"], On = { class: "text-sm text-muted" }, kn = { class: "flex flex-wrap items-center justify-between gap-3 bg-surface-secondary px-4 py-3" }, An = { class: "flex cursor-pointer items-center gap-2 text-sm font-semibold text-heading" }, jn = ["checked", "onChange"], Mn = { class: "text-sm text-muted" }, Nn = { class: "overflow-x-auto" }, Pn = { class: "w-full table-auto" }, Fn = { class: "bg-surface text-xs tracking-wider text-muted uppercase" }, In = { class: "px-4 py-2 text-left font-medium" }, Ln = { class: "px-4 py-2 text-left font-medium" }, Rn = { class: "px-4 py-2 text-left font-medium" }, zn = { class: "px-4 py-2 text-left font-medium" }, Bn = { class: "px-4 py-2 text-right font-medium" }, Vn = { class: "px-4 py-2 text-right font-medium" }, Hn = { class: "divide-y divide-line-default bg-surface text-sm" }, Un = { class: "pl-4" }, Wn = ["checked", "onChange"], Gn = { class: "px-4 py-2 whitespace-nowrap text-muted" }, Kn = { class: "px-4 py-2" }, qn = { class: "block text-xs text-subtle" }, Jn = { class: "px-4 py-2 text-muted" }, Yn = { class: "px-4 py-2 text-muted" }, Xn = { class: "px-4 py-2 text-right whitespace-nowrap text-muted" }, Zn = { class: "px-4 py-2 text-right whitespace-nowrap text-heading" }, Qn = { class: "mt-5 flex flex-wrap items-center justify-between gap-4" }, $n = { class: "text-sm font-medium text-heading" }, er = { class: "flex items-center gap-3" }, tr = /* @__PURE__ */ l({ +}, En = { class: "mt-4 flex flex-wrap items-center justify-between gap-3 rounded-lg border border-line-default bg-surface-secondary px-4 py-3" }, Dn = { class: "flex cursor-pointer items-center gap-2 text-sm font-medium text-heading" }, On = ["checked"], kn = { class: "text-sm text-muted" }, An = { class: "flex flex-wrap items-center justify-between gap-3 bg-surface-secondary px-4 py-3" }, jn = { class: "flex cursor-pointer items-center gap-2 text-sm font-semibold text-heading" }, Mn = ["checked", "onChange"], Nn = { class: "text-sm text-muted" }, Pn = { class: "overflow-x-auto" }, Fn = { class: "w-full table-auto" }, In = { class: "bg-surface text-xs tracking-wider text-muted uppercase" }, Ln = { class: "px-4 py-2 text-start font-medium" }, Rn = { class: "px-4 py-2 text-start font-medium" }, zn = { class: "px-4 py-2 text-start font-medium" }, Bn = { class: "px-4 py-2 text-start font-medium" }, Vn = { class: "px-4 py-2 text-end font-medium" }, Hn = { class: "px-4 py-2 text-end font-medium" }, Un = { class: "divide-y divide-line-default bg-surface text-sm" }, Wn = { class: "ps-4" }, Gn = [ + "aria-label", + "checked", + "onChange" +], Kn = { class: "px-4 py-2 whitespace-nowrap text-muted" }, qn = { class: "px-4 py-2" }, Jn = { class: "block text-xs text-subtle" }, Yn = { class: "px-4 py-2 text-muted" }, Xn = { class: "px-4 py-2 text-muted" }, Zn = { class: "px-4 py-2 text-end whitespace-nowrap text-muted" }, Qn = { class: "px-4 py-2 text-end whitespace-nowrap text-heading" }, $n = { class: "mt-5 flex flex-wrap items-center justify-between gap-4" }, er = { class: "text-sm font-medium text-heading" }, tr = { class: "flex items-center gap-3" }, nr = /* @__PURE__ */ l({ __name: "UnbilledTimePage", props: { client: { type: [Function, Object] }, @@ -890,34 +915,34 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite }); E(() => [h.from, h.to], () => void ie()), g(() => void re()); async function re() { - f.value = !0, await Promise.all([ae(), en(l.client)]), f.value = !1; + f.value = !0, await Promise.all([ae(), tn(l.client)]), f.value = !1; } async function ie() { - await ae(), _.value !== null && await fe(_.value); + await ae(), _.value !== null && await ue(_.value); } async function ae() { try { - m.value = await ue(l.client, ne.value); + m.value = await de(l.client, ne.value); } catch (e) { m.value = [], l.notify("error", H(e, d("tasks_projects.billing.customer.load_failed"))); } } function oe(e) { - return $t(e); + return en(e); } function se() { h.from = "", h.to = ""; } function ce(e) { - h.from = e ? dt(e) : ""; + h.from = e ? ft(e) : ""; } function le(e) { - h.to = e ? dt(e) : ""; + h.to = e ? ft(e) : ""; } - async function fe(e) { + async function ue(e) { _.value = e, O.value = !0, T.value = null, A.value = []; try { - T.value = await de(l.client, e.customer_id, ne.value), A.value = F.value.map((e) => e.id); + T.value = await fe(l.client, e.customer_id, ne.value), A.value = F.value.map((e) => e.id); } catch (e) { l.notify("error", H(e, d("tasks_projects.billing.entries.load_failed"))); } finally { @@ -955,7 +980,7 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite l.notify("warning", d("tasks_projects.billing.entries.none_selected")); return; } - await bt({ + await xt({ client: l.client, router: l.router, notify: l.notify, @@ -970,7 +995,7 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite return v(), r(re, null, { default: D(() => [ c(E, { title: w(d)("tasks_projects.billing.title") }, { - actions: D(() => [o("div", ln, [c(T, { to: w(W).reports }, { + actions: D(() => [o("div", un, [c(T, { to: w(W).reports }, { default: D(() => [c(b, { variant: "white" }, { left: D((e) => [c(y, { name: "ChartBarIcon", @@ -1008,14 +1033,14 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite }, null, 8, ["title"]) ]), _: 1 - }), o("p", cn, C(w(d)("tasks_projects.billing.subtitle")), 1)]), + }), o("p", ln, C(w(d)("tasks_projects.billing.subtitle")), 1)]), _: 1 }, 8, ["title"]), - c(Lt, { + c(Rt, { client: t.client, notify: t.notify }, null, 8, ["client", "notify"]), - o("div", un, [ + o("div", dn, [ c(M, { label: w(d)("tasks_projects.billing.customer.from"), class: "w-full sm:w-48" @@ -1045,19 +1070,19 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite _: 1 })) : i("", !0) ]), - f.value ? (v(), a("div", dn, [c(F, { class: "h-8 w-8 text-primary-500" })])) : _.value === null ? (v(), a("section", fn, [ - o("h2", pn, C(w(d)("tasks_projects.billing.customer.title")), 1), - o("p", mn, C(w(d)("tasks_projects.billing.customer.description")), 1), - m.value.length > 0 ? (v(), a("div", hn, [(v(!0), a(e, null, x(m.value, (e) => (v(), a("button", { + f.value ? (v(), a("div", fn, [c(F, { class: "h-8 w-8 text-primary-500" })])) : _.value === null ? (v(), a("section", pn, [ + o("h2", mn, C(w(d)("tasks_projects.billing.customer.title")), 1), + o("p", hn, C(w(d)("tasks_projects.billing.customer.description")), 1), + m.value.length > 0 ? (v(), a("div", gn, [(v(!0), a(e, null, x(m.value, (e) => (v(), a("button", { key: `${e.customer_id}-${e.currency_id ?? "none"}`, type: "button", - class: "rounded-xl border border-line-default bg-surface p-5 text-left transition hover:border-primary-500", - onClick: (t) => fe(e) + class: "rounded-xl border border-line-default bg-surface p-5 text-start transition hover:border-primary-500", + onClick: (t) => ue(e) }, [ - o("p", _n, C(oe(e.customer_id)), 1), - o("p", vn, C(w(d)("tasks_projects.billing.customer.entries", { count: e.entries })) + " · " + C(w(ft)(e.minutes)), 1), - o("p", yn, [c(I, { amount: e.amount }, null, 8, ["amount"])]) - ], 8, gn))), 128))])) : (v(), r(B, { + o("p", vn, C(oe(e.customer_id)), 1), + o("p", yn, C(w(d)("tasks_projects.billing.customer.entries", { count: e.entries })) + " · " + C(w(pt)(e.minutes)), 1), + o("p", bn, [c(I, { amount: e.amount }, null, 8, ["amount"])]) + ], 8, _n))), 128))])) : (v(), r(B, { key: 1, title: w(d)("tasks_projects.billing.customer.empty_title"), description: w(d)("tasks_projects.billing.customer.empty_description") @@ -1068,7 +1093,7 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite })]), _: 1 }, 8, ["title", "description"])) - ])) : (v(), a("section", bn, [o("div", xn, [o("div", null, [o("h2", Sn, C(w(d)("tasks_projects.billing.entries.title")), 1), o("p", Cn, C(oe(_.value.customer_id)), 1)]), c(M, { + ])) : (v(), a("section", xn, [o("div", Sn, [o("div", null, [o("h2", Cn, C(w(d)("tasks_projects.billing.entries.title")), 1), o("p", wn, C(oe(_.value.customer_id)), 1)]), c(M, { label: w(d)("tasks_projects.billing.entries.grouping"), class: "w-full sm:w-56" }, { @@ -1079,53 +1104,54 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite "label-key": "label" }, null, 8, ["modelValue", "options"])]), _: 1 - }, 8, ["label"])]), O.value ? (v(), a("div", wn, [c(F, { class: "h-8 w-8 text-primary-500" })])) : R.value > 0 ? (v(), a(e, { key: 1 }, [ - o("div", Tn, [o("label", En, [o("input", { + }, 8, ["label"])]), O.value ? (v(), a("div", Tn, [c(F, { class: "h-8 w-8 text-primary-500" })])) : R.value > 0 ? (v(), a(e, { key: 1 }, [ + o("div", En, [o("label", Dn, [o("input", { type: "checkbox", class: "h-4 w-4 cursor-pointer rounded border-line-strong", checked: z.value, onChange: ge - }, null, 40, Dn), s(" " + C(w(d)("tasks_projects.billing.entries.select_all")), 1)]), o("p", On, C(w(d)("tasks_projects.billing.entries.selected", { + }, null, 40, On), s(" " + C(w(d)("tasks_projects.billing.entries.select_all")), 1)]), o("p", kn, C(w(d)("tasks_projects.billing.entries.selected", { count: A.value.length, total: R.value })), 1)]), (v(!0), a(e, null, x(L.value, (t) => (v(), a("div", { key: `${t.label}-${t.key ?? "none"}-${t.currency_id ?? "none"}`, class: "mt-4 overflow-hidden rounded-xl border border-line-default" - }, [o("div", kn, [o("label", An, [o("input", { + }, [o("div", An, [o("label", jn, [o("input", { type: "checkbox", class: "h-4 w-4 cursor-pointer rounded border-line-strong", checked: _e(t), onChange: (e) => ve(t) - }, null, 40, jn), s(" " + C(t.label), 1)]), o("p", Mn, [s(C(w(ft)(t.minutes)) + " · ", 1), c(I, { amount: t.amount }, null, 8, ["amount"])])]), o("div", Nn, [o("table", Pn, [o("thead", Fn, [o("tr", null, [ + }, null, 40, Mn), s(" " + C(t.label), 1)]), o("p", Nn, [s(C(w(pt)(t.minutes)) + " · ", 1), c(I, { amount: t.amount }, null, 8, ["amount"])])]), o("div", Pn, [o("table", Fn, [o("thead", In, [o("tr", null, [ l[1] ||= o("th", { class: "w-10" }, null, -1), - o("th", In, C(w(d)("tasks_projects.billing.entries.columns.date")), 1), - o("th", Ln, C(w(d)("tasks_projects.billing.entries.columns.task")), 1), - o("th", Rn, C(w(d)("tasks_projects.billing.entries.columns.project")), 1), - o("th", zn, C(w(d)("tasks_projects.billing.entries.columns.member")), 1), - o("th", Bn, C(w(d)("tasks_projects.billing.entries.columns.duration")), 1), - o("th", Vn, C(w(d)("tasks_projects.billing.entries.columns.amount")), 1) - ])]), o("tbody", Hn, [(v(!0), a(e, null, x(ye(t), (e) => (v(), a("tr", { key: e.id }, [ - o("td", Un, [o("input", { + o("th", Ln, C(w(d)("tasks_projects.billing.entries.columns.date")), 1), + o("th", Rn, C(w(d)("tasks_projects.billing.entries.columns.task")), 1), + o("th", zn, C(w(d)("tasks_projects.billing.entries.columns.project")), 1), + o("th", Bn, C(w(d)("tasks_projects.billing.entries.columns.member")), 1), + o("th", Vn, C(w(d)("tasks_projects.billing.entries.columns.duration")), 1), + o("th", Hn, C(w(d)("tasks_projects.billing.entries.columns.amount")), 1) + ])]), o("tbody", Un, [(v(!0), a(e, null, x(ye(t), (e) => (v(), a("tr", { key: e.id }, [ + o("td", Wn, [o("input", { type: "checkbox", class: "h-4 w-4 cursor-pointer rounded border-line-strong", + "aria-label": w(d)("tasks_projects.general.select_named", { name: e.description || w(dt)(e.date) }), checked: me(e.id), onChange: (t) => he(e.id) - }, null, 40, Wn)]), - o("td", Gn, C(w(ut)(e.date)), 1), - o("td", Kn, [c(T, { + }, null, 40, Gn)]), + o("td", Kn, C(w(dt)(e.date)), 1), + o("td", qn, [c(T, { class: "text-heading hover:text-primary-500", to: w(W).task(e.task_id) }, { default: D(() => [s(C(e.task_name), 1)]), _: 2 - }, 1032, ["to"]), o("span", qn, C(e.description || w(d)("tasks_projects.billing.entries.no_description")), 1)]), - o("td", Jn, C(e.project_name ?? "-"), 1), - o("td", Yn, C(e.user_name), 1), - o("td", Xn, C(w(ft)(e.minutes)), 1), - o("td", Zn, [c(I, { amount: e.amount }, null, 8, ["amount"])]) + }, 1032, ["to"]), o("span", Jn, C(e.description || w(d)("tasks_projects.billing.entries.no_description")), 1)]), + o("td", Yn, C(e.project_name ?? "-"), 1), + o("td", Xn, C(e.user_name), 1), + o("td", Zn, C(w(pt)(e.minutes)), 1), + o("td", Qn, [c(I, { amount: e.amount }, null, 8, ["amount"])]) ]))), 128))])])])]))), 128)), - o("div", Qn, [o("p", $n, [s(C(w(d)("tasks_projects.billing.entries.selected_total", { hours: w(ft)(ee.value) })) + " · ", 1), c(I, { amount: te.value }, null, 8, ["amount"])]), o("div", er, [c(b, { + o("div", $n, [o("p", er, [s(C(w(d)("tasks_projects.billing.entries.selected_total", { hours: w(pt)(ee.value) })) + " · ", 1), c(I, { amount: te.value }, null, 8, ["amount"])]), o("div", tr, [c(b, { variant: "primary-outline", disabled: j.value, onClick: pe @@ -1172,26 +1198,26 @@ var cn = { class: "mt-2 text-sm text-muted" }, ln = { class: "flex flex-wrap ite }); //#endregion //#region resources/js/registrations/billing.ts -function nr(e) { - e.addMessages(oe), e.registerPage({ +function rr(e) { + e.addMessages(se), e.registerPage({ id: "billing", module: U, path: "billing", - component: sn(e, tr), + component: cn(e, nr), meta: { ability: `${U}:invoice-tasks`, title: "tasks_projects.billing.title" } }), e.registerCompanyLayoutOverlay({ id: `${U}.invoice-number`, - component: l({ setup: () => () => d(ae) }) + component: l({ setup: () => () => d(oe) }) }), e.on("company:changing", () => { ee(); }); } //#endregion //#region resources/js/messages/projects.ts -var rr = { en: { tasks_projects: { project: { +var ir = { en: { tasks_projects: { project: { load_failed: "Unable to load the project.", customer: "Customer", identifier: "Identifier", @@ -1251,94 +1277,119 @@ var rr = { en: { tasks_projects: { project: { attach_failed: "Unable to add the member.", detach_failed: "Unable to remove the member." } -} } } }, ir = { - board: `${Rt}/board`, - tasks: `${Rt}/tasks`, - task: (e) => `${Rt}/tasks/${e}`, - moveTask: (e) => `${Rt}/tasks/${e}/move`, - startTask: (e) => `${Rt}/tasks/${e}/start`, - stopTask: (e) => `${Rt}/tasks/${e}/stop`, - taskTimeLog: (e) => `${Rt}/tasks/${e}/time-log`, - bulkTasks: `${Rt}/tasks/bulk`, - taskStatuses: `${Rt}/task-statuses`, - timeEntries: `${Rt}/time-entries`, - projectMembers: (e) => `${Rt}/projects/${e}/members`, - projectMember: (e, t) => `${Rt}/projects/${e}/members/${t}` +} } } }, ar = { + board: `${zt}/board`, + tasks: `${zt}/tasks`, + task: (e) => `${zt}/tasks/${e}`, + moveTask: (e) => `${zt}/tasks/${e}/move`, + startTask: (e) => `${zt}/tasks/${e}/start`, + stopTask: (e) => `${zt}/tasks/${e}/stop`, + taskTimeLog: (e) => `${zt}/tasks/${e}/time-log`, + bulkTasks: `${zt}/tasks/bulk`, + taskStatuses: `${zt}/task-statuses`, + timeEntries: `${zt}/time-entries`, + projectMembers: (e) => `${zt}/projects/${e}/members`, + projectMember: (e, t) => `${zt}/projects/${e}/members/${t}` }; -async function ar(e, t) { - let { data: n } = await e.get(ir.board, { params: t }); +async function or(e, t) { + let { data: n } = await e.get(ar.board, { params: t }); return n.data; } -async function or(e) { - let { data: t } = await e.get(ir.taskStatuses); +async function sr(e) { + let { data: t } = await e.get(ar.taskStatuses); return t.data; } -async function sr(e, t) { - let { data: n } = await e.get(ir.tasks, { params: t }); +async function cr(e, t) { + let { data: n } = await e.get(ar.tasks, { params: t }); return n; } -async function cr(e, t) { - let { data: n } = await e.post(ir.tasks, t); +async function lr(e, t) { + let { data: n } = await e.post(ar.tasks, t); return n.data; } -async function lr(e, t, n) { - let { data: r } = await e.put(ir.task(t), n); +async function ur(e, t, n) { + let { data: r } = await e.put(ar.task(t), n); return r.data; } -async function ur(e, t) { - await e.delete(ir.task(t)); -} async function dr(e, t) { - let { data: n } = await e.get(ir.task(t)); + await e.delete(ar.task(t)); +} +async function fr(e, t) { + let { data: n } = await e.get(ar.task(t)); return n.data; } -async function fr(e, t, n = null, r) { +async function pr(e, t, n = null, r) { let i = {}; n !== null && (i.description = n), r !== void 0 && (i.billable = r); - let { data: a } = await e.post(ir.startTask(t), i); + let { data: a } = await e.post(ar.startTask(t), i); return a.data; } -async function pr(e, t, n = {}) { - let { data: r } = await e.post(ir.stopTask(t), n); +async function mr(e, t, n = {}) { + let { data: r } = await e.post(ar.stopTask(t), n); return r.data; } -async function mr(e, t) { - let { data: n } = await e.get(ir.taskTimeLog(t)); +async function hr(e, t) { + let { data: n } = await e.get(ar.taskTimeLog(t)); return n.data ?? []; } -async function hr(e, t) { - let { data: n } = await e.post(ir.bulkTasks, t); +async function gr(e, t) { + let { data: n } = await e.post(ar.bulkTasks, t); return { updated: n?.updated ?? [], failed: n?.failed ?? [] }; } -async function gr(e, t, n) { - let { data: r } = await e.post(ir.moveTask(t), n); +async function _r(e, t, n) { + let { data: r } = await e.post(ar.moveTask(t), n); return r.data; } -async function _r(e, t) { - let { data: n } = await e.get(zt.project(t)); +async function vr(e, t) { + let { data: n } = await e.get(Bt.project(t)); return n.data; } -async function vr(e, t) { - let { data: n } = await e.get(ir.projectMembers(t)); +async function yr(e, t) { + let { data: n } = await e.get(ar.projectMembers(t)); return n.data; } -async function yr(e, t, n) { - let { data: r } = await e.post(ir.projectMembers(t), n); +async function br(e, t, n) { + let { data: r } = await e.post(ar.projectMembers(t), n); return r.data; } -async function br(e, t, n) { - await e.delete(ir.projectMember(t, n)); +async function xr(e, t, n) { + await e.delete(ar.projectMember(t, n)); } -async function xr(e, t) { - let { data: n } = await e.get(ir.timeEntries, { params: t }); +async function Sr(e, t) { + let { data: n } = await e.get(ar.timeEntries, { params: t }); return n; } //#endregion +//#region resources/js/support/colours.ts +var Cr = { + "#94a3b8": "light_grey", + "#64748b": "grey", + "#2563eb": "blue", + "#3b82f6": "blue", + "#0891b2": "teal", + "#059669": "green", + "#22c55e": "green", + "#ca8a04": "yellow", + "#f59e0b": "amber", + "#ea580c": "orange", + "#dc2626": "red", + "#ef4444": "red", + "#a855f7": "purple", + "#7c3aed": "violet" +}; +function wr(e) { + return `tasks_projects.general.colours.${Cr[e.toLowerCase()] ?? "custom"}`; +} +//#endregion //#region resources/js/components/ProjectFormModal.vue?vue&type=script&setup=true&lang.ts -var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "space-y-5 px-6 py-6" }, wr = { class: "flex flex-wrap items-center gap-2" }, Tr = ["aria-label", "onClick"], Er = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, Dr = /* @__PURE__ */ l({ +var Tr = { class: "flex w-full items-center justify-between" }, Er = ["aria-label"], Dr = { class: "space-y-5 px-6 py-6" }, Or = { class: "flex flex-wrap items-center gap-2" }, kr = [ + "aria-label", + "aria-pressed", + "onClick" +], Ar = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, jr = /* @__PURE__ */ l({ __name: "ProjectFormModal", props: { show: { type: Boolean }, @@ -1371,7 +1422,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, { immediate: !0 }); function N() { let e = l.project; - h.name = e?.name ?? "", h.identifier = e?.identifier ?? "", h.description = e?.description ?? "", h.colour = e?.colour ?? "", h.defaultRate = ot(e?.default_rate ?? null), h.budgetHours = ct(e?.budget_minutes ?? null), h.dueDate = e?.due_date ?? "", O.value = {}, g.value = P(e?.customer_id ?? null); + h.name = e?.name ?? "", h.identifier = e?.identifier ?? "", h.description = e?.description ?? "", h.colour = e?.colour ?? "", h.defaultRate = st(e?.default_rate ?? null), h.budgetHours = lt(e?.budget_minutes ?? null), h.dueDate = e?.due_date ?? "", O.value = {}, g.value = P(e?.customer_id ?? null); } function P(e) { return e === null ? null : _.value.find((t) => t.id === e) ?? null; @@ -1381,7 +1432,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s } async function I() { if (!T.value) try { - let e = await Yt(l.client); + let e = await Xt(l.client); _.value = e.map((e) => ({ id: e.id, label: F(e) @@ -1397,13 +1448,13 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s identifier: h.identifier.trim() || null, description: h.description.trim() || null, colour: h.colour || null, - default_rate: st(h.defaultRate), - budget_minutes: lt(h.budgetHours), + default_rate: ct(h.defaultRate), + budget_minutes: ut(h.budgetHours), due_date: h.dueDate || null }; } function R(e) { - h.dueDate = e ? dt(e) : ""; + h.dueDate = e ? ft(e) : ""; } async function z() { if (!k.value) { @@ -1413,10 +1464,10 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s } k.value = !0, O.value = {}; try { - let e = l.project, t = e ? await Wt(l.client, e.id, L()) : await Ut(l.client, L()); + let e = l.project, t = e ? await Gt(l.client, e.id, L()) : await Wt(l.client, L()); u("saved", t); } catch (e) { - O.value = at(e), l.notify("error", H(e, f("tasks_projects.projects.save_failed"))); + O.value = ot(e), l.notify("error", H(e, f("tasks_projects.projects.save_failed"))); } finally { k.value = !1; } @@ -1428,12 +1479,16 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s show: t.show, onClose: i[9] ||= (e) => u("close") }, { - header: D(() => [o("div", Sr, [o("span", null, C(M.value), 1), c(l, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", Tr, [o("span", null, C(M.value), 1), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(f)("tasks_projects.general.close"), onClick: i[0] ||= (e) => u("close") - })])]), - default: D(() => [o("form", { onSubmit: A(z, ["prevent"]) }, [o("div", Cr, [ + }, [c(l, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, Er)])]), + default: D(() => [o("form", { onSubmit: A(z, ["prevent"]) }, [o("div", Dr, [ c(N, null, { default: D(() => [ c(b, { @@ -1539,14 +1594,15 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s label: w(f)("tasks_projects.projects.fields.colour"), error: O.value.colour }, { - default: D(() => [o("div", wr, [(v(), a(e, null, x(d, (e) => o("button", { + default: D(() => [o("div", Or, [(v(), a(e, null, x(d, (e) => o("button", { key: e, type: "button", class: p(["h-7 w-7 rounded-full border-2 transition", h.colour === e ? "border-heading" : "border-line-default"]), style: m({ backgroundColor: e }), - "aria-label": e, + "aria-label": w(f)(w(wr)(e)), + "aria-pressed": h.colour === e, onClick: (t) => h.colour = h.colour === e ? "" : e - }, null, 14, Tr)), 64)), o("button", { + }, null, 14, kr)), 64)), o("button", { type: "button", class: "rounded-md border border-line-default px-2 py-1 text-xs text-muted hover:bg-hover", onClick: i[6] ||= (e) => h.colour = "" @@ -1565,7 +1621,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, null, 8, ["modelValue", "invalid"])]), _: 1 }, 8, ["label", "error"]) - ]), o("div", Er, [c(F, { + ]), o("div", Ar, [c(F, { type: "button", variant: "primary-outline", onClick: i[8] ||= (e) => u("close") @@ -1585,23 +1641,23 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, 8, ["show"]); }; } -}), Or = { +}), Mr = { key: 0, class: "mt-2 flex flex-wrap items-center gap-3 text-sm text-muted" -}, kr = { +}, Nr = { key: 0, class: "rounded-sm bg-surface-tertiary px-2 py-0.5 text-body" -}, Ar = { key: 1 }, jr = { class: "text-body" }, Mr = { +}, Pr = { key: 1 }, Fr = { class: "text-body" }, Ir = { key: 2, class: "text-subtle" -}, Nr = { key: 3 }, Pr = { class: "text-body" }, Fr = { class: "flex items-center justify-end space-x-5" }, Ir = { class: "mt-6 flex overflow-x-auto border-b border-line-default" }, Lr = [ +}, Lr = { key: 3 }, Rr = { class: "text-body" }, zr = { class: "flex items-center justify-end space-x-5" }, Br = { class: "mt-6 flex overflow-x-auto border-b border-line-default" }, Vr = [ "href", "aria-current", "onClick" -], Rr = { +], Hr = { key: 0, class: "flex justify-center py-16" -}, zr = /* @__PURE__ */ l({ +}, Ur = /* @__PURE__ */ l({ __name: "ProjectDetailPage", props: { id: {}, @@ -1610,7 +1666,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s router: {} }, setup(t) { - let l = t, u = on.project, d = B(), f = l.router, m = b(null), h = b(!0), _ = b(!1), y = b(!1), T = n(() => Number(l.id)), O = n(() => [ + let l = t, u = sn.project, d = B(), f = l.router, m = b(null), h = b(!0), _ = b(!1), y = b(!1), T = n(() => Number(l.id)), O = n(() => [ { id: "overview", label: d("tasks_projects.project.tabs.overview"), @@ -1634,7 +1690,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s ]), k = n(() => String(l.router.currentRoute.value.name ?? "")), A = n(() => m.value?.name ?? d("tasks_projects.projects.title")), j = n(() => ({ path: W.board, query: { project: String(T.value) } - })), N = n(() => $t(m.value?.customer_id ?? null)), P = n(() => M.busy), F = n(() => M.allowed && m.value !== null && m.value.customer_id !== null && (m.value.totals?.unbilled_amount ?? 0) > 0); + })), N = n(() => en(m.value?.customer_id ?? null)), P = n(() => M.busy), F = n(() => M.allowed && m.value !== null && m.value.customer_id !== null && (m.value.totals?.unbilled_amount ?? 0) > 0); E(T, () => { L(); }), E(k, (e) => I(e)), g(() => { @@ -1649,7 +1705,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s async function L() { h.value = !0; try { - m.value = await _r(l.client, T.value), typeof m.value?.customer_id == "number" && await en(l.client); + m.value = await vr(l.client, T.value), typeof m.value?.customer_id == "number" && await tn(l.client); } catch (e) { l.notify("error", H(e, d("tasks_projects.project.load_failed"))); } finally { @@ -1670,7 +1726,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s } async function te() { let e = m.value; - e !== null && F.value && !P.value && (await bt({ + e !== null && F.value && !P.value && (await xt({ client: l.client, router: f, notify: l.notify, @@ -1682,7 +1738,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s if (!(e === null || _.value)) { _.value = !0; try { - e.status === "ARCHIVED" ? (await Kt(l.client, e.id), l.notify("success", d("tasks_projects.projects.unarchived", { name: e.name }))) : (await Gt(l.client, e.id), l.notify("success", d("tasks_projects.projects.archived", { name: e.name }))), await L(); + e.status === "ARCHIVED" ? (await qt(l.client, e.id), l.notify("success", d("tasks_projects.projects.unarchived", { name: e.name }))) : (await Kt(l.client, e.id), l.notify("success", d("tasks_projects.projects.archived", { name: e.name }))), await L(); } catch (e) { l.notify("error", H(e, d("tasks_projects.projects.save_failed"))); } finally { @@ -1701,7 +1757,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s return v(), r(B, null, { default: D(() => [ c(k, { title: A.value }, { - actions: D(() => [o("div", Fr, [ + actions: D(() => [o("div", zr, [ c(E, { to: j.value }, { default: D(() => [c(T, { variant: "white" }, { left: D((e) => [c(b, { @@ -1768,22 +1824,22 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, null, 8, ["title"]) ]), _: 1 - }), m.value ? (v(), a("div", Or, [ + }), m.value ? (v(), a("div", Mr, [ c(g, { class: p(["rounded-full", re(m.value.status)]) }, { default: D(() => [s(C(ie(m.value.status)), 1)]), _: 1 }, 8, ["class"]), - m.value.identifier ? (v(), a("span", kr, C(m.value.identifier), 1)) : i("", !0), - m.value.customer_id ? (v(), a("span", Ar, [s(C(w(d)("tasks_projects.project.customer")) + ": ", 1), o("span", jr, C(N.value), 1)])) : (v(), a("span", Mr, C(w(d)("tasks_projects.projects.internal")), 1)), - m.value.due_date ? (v(), a("span", Nr, [s(C(w(d)("tasks_projects.project.due_date")) + ": ", 1), o("span", Pr, C(w(ut)(m.value.due_date)), 1)])) : i("", !0) + m.value.identifier ? (v(), a("span", Nr, C(m.value.identifier), 1)) : i("", !0), + m.value.customer_id ? (v(), a("span", Pr, [s(C(w(d)("tasks_projects.project.customer")) + ": ", 1), o("span", Fr, C(N.value), 1)])) : (v(), a("span", Ir, C(w(d)("tasks_projects.projects.internal")), 1)), + m.value.due_date ? (v(), a("span", Lr, [s(C(w(d)("tasks_projects.project.due_date")) + ": ", 1), o("span", Rr, C(w(dt)(m.value.due_date)), 1)])) : i("", !0) ])) : i("", !0)]), _: 1 }, 8, ["title"]), - c(Lt, { + c(Rt, { client: t.client, notify: t.notify }, null, 8, ["client", "notify"]), - o("nav", Ir, [(v(!0), a(e, null, x(O.value, (e) => (v(), r(E, { + o("nav", Br, [(v(!0), a(e, null, x(O.value, (e) => (v(), r(E, { key: e.id, to: R(e), custom: "" @@ -1793,15 +1849,15 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s "aria-current": z(e) ? "page" : void 0, class: p(["relative -mb-px flex items-center border-b-2 px-5 py-2.5 text-sm leading-5 font-medium whitespace-nowrap transition-colors focus:outline-hidden", z(e) ? "border-primary-400 text-heading" : "border-transparent text-muted hover:border-line-strong hover:text-body"]), onClick: n - }, C(e.label), 11, Lr)]), + }, C(e.label), 11, Vr)]), _: 2 }, 1032, ["to"]))), 128))]), - h.value && m.value === null ? (v(), a("div", Rr, [c(M, { class: "h-8 w-8 text-primary-500" })])) : (v(), r(I, { + h.value && m.value === null ? (v(), a("div", Hr, [c(M, { class: "h-8 w-8 text-primary-500" })])) : (v(), r(I, { key: 1, project: m.value, onRefresh: L }, null, 8, ["project"])), - c(Dr, { + c(jr, { show: y.value, client: t.client, notify: t.notify, @@ -1819,19 +1875,19 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }); }; } -}), Br = { class: "flex items-center justify-end space-x-5" }, Vr = { class: "relative table-container" }, Hr = { class: "flex items-center" }, Ur = { +}), Wr = { class: "flex items-center justify-end space-x-5" }, Gr = { class: "relative table-container" }, Kr = { class: "flex items-center" }, qr = { key: 0, class: "block text-xs font-normal text-muted" -}, Wr = { key: 0 }, Gr = { +}, Jr = { key: 0 }, Yr = { key: 1, class: "text-subtle" -}, Kr = { +}, Xr = { key: 1, class: "text-subtle" -}, qr = { key: 0 }, Jr = { +}, Zr = { key: 0 }, Qr = { key: 1, class: "text-subtle" -}, Yr = 10, Xr = 350, Zr = /* @__PURE__ */ l({ +}, $r = 10, ei = 350, ti = /* @__PURE__ */ l({ __name: "ProjectsIndexPage", props: { client: { type: [Function, Object] }, @@ -1901,22 +1957,22 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s key: "actions", label: u("tasks_projects.general.actions"), sortable: !1, - tdClass: "text-right text-sm font-medium" + tdClass: "text-end text-sm font-medium" } ]), F = n(() => j.search.trim() !== "" || j.status !== "ACTIVE"), I = n(() => !g.value && _.value === 0 && !F.value), L; E(() => j.search, () => { - clearTimeout(L), L = setTimeout(() => z(), Xr); + clearTimeout(L), L = setTimeout(() => z(), ei); }), E(() => j.status, () => z()), h(() => clearTimeout(L)); async function R({ page: e, sort: n }) { let r = { page: e, - limit: Yr, - ...Vt(n, l) + limit: $r, + ...Ht(n, l) }; j.status !== "ALL" && (r.status = j.status), j.search.trim() !== "" && (r.search = j.search.trim()), g.value = !0; try { - let e = await Ht(t.client, r); - return _.value = e.meta.total, e.data.some((e) => e.customer_id !== null) && en(t.client), { + let e = await Ut(t.client, r); + return _.value = e.meta.total, e.data.some((e) => e.customer_id !== null) && tn(t.client), { data: e.data, pagination: { totalPages: e.meta.last_page, @@ -1932,7 +1988,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s totalPages: 1, currentPage: 1, totalCount: 0, - limit: Yr + limit: $r } }; } finally { @@ -1961,7 +2017,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s async function ae(e) { A.value = e.id; try { - e.status === "ARCHIVED" ? (await Kt(t.client, e.id), t.notify("success", u("tasks_projects.projects.unarchived", { name: e.name }))) : (await Gt(t.client, e.id), t.notify("success", u("tasks_projects.projects.archived", { name: e.name }))), z(!0); + e.status === "ARCHIVED" ? (await qt(t.client, e.id), t.notify("success", u("tasks_projects.projects.unarchived", { name: e.name }))) : (await Kt(t.client, e.id), t.notify("success", u("tasks_projects.projects.archived", { name: e.name }))), z(!0); } catch (e) { t.notify("error", H(e, u("tasks_projects.projects.save_failed"))); } finally { @@ -1972,7 +2028,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s if (window.confirm(u("tasks_projects.projects.delete_confirm", { name: e.name }))) { A.value = e.id; try { - await qt(t.client, e.id), t.notify("success", u("tasks_projects.projects.deleted", { name: e.name })), z(!0); + await Jt(t.client, e.id), t.notify("success", u("tasks_projects.projects.deleted", { name: e.name })), z(!0); } catch (e) { t.notify("error", H(e, u("tasks_projects.projects.delete_failed"))); } finally { @@ -1991,7 +2047,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s return v(), r(me, null, { default: D(() => [ c(b, { title: w(u)("tasks_projects.projects.title") }, { - actions: D(() => [o("div", Br, [ + actions: D(() => [o("div", Wr, [ c(y, { to: w(W).tasks }, { default: D(() => [c(_, { variant: "white" }, { left: D((e) => [c(g, { @@ -2119,15 +2175,15 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s })]), _: 1 }, 8, ["title", "description"]), [[T, I.value]]), - O(o("div", Vr, [c(pe, { + O(o("div", Gr, [c(pe, { ref_key: "tableRef", ref: d, data: R, columns: P.value, class: "mt-3" }, { - "cell-name": D(({ row: e }) => [o("div", Hr, [o("span", { - class: p(["mr-3 inline-block h-2.5 w-2.5 shrink-0 rounded-full", e.data.colour ? "" : "bg-line-default"]), + "cell-name": D(({ row: e }) => [o("div", Kr, [o("span", { + class: p(["me-3 inline-block h-2.5 w-2.5 shrink-0 rounded-full", e.data.colour ? "" : "bg-line-default"]), style: m(e.data.colour ? { backgroundColor: e.data.colour } : void 0) }, null, 6), o("span", null, [c(y, { class: "hover:text-primary-500", @@ -2135,18 +2191,21 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, { default: D(() => [s(C(e.data.name), 1)]), _: 2 - }, 1032, ["to"]), e.data.identifier ? (v(), a("span", Ur, C(e.data.identifier), 1)) : i("", !0)])])]), + }, 1032, ["to"]), e.data.identifier ? (v(), a("span", qr, C(e.data.identifier), 1)) : i("", !0)])])]), "cell-status": D(({ row: e }) => [c(le, { class: p(["rounded-full", se(e.data.status)]) }, { default: D(() => [s(C(ce(e.data.status)), 1)]), _: 2 }, 1032, ["class"])]), - "cell-customer": D(({ row: e }) => [e.data.customer_id ? (v(), a("span", Wr, C(w($t)(e.data.customer_id)), 1)) : (v(), a("span", Gr, C(w(u)("tasks_projects.projects.internal")), 1))]), - "cell-default_rate": D(({ row: e }) => [e.data.default_rate === null ? (v(), a("span", Kr, "-")) : (v(), r(ue, { + "cell-customer": D(({ row: e }) => [e.data.customer_id ? (v(), a("span", Jr, C(w(en)(e.data.customer_id)), 1)) : (v(), a("span", Yr, C(w(u)("tasks_projects.projects.internal")), 1))]), + "cell-default_rate": D(({ row: e }) => [e.data.default_rate === null ? (v(), a("span", Xr, "-")) : (v(), r(ue, { key: 0, amount: e.data.default_rate }, null, 8, ["amount"]))]), - "cell-due_date": D(({ row: e }) => [e.data.due_date ? (v(), a("span", qr, C(w(ut)(e.data.due_date)), 1)) : (v(), a("span", Jr, "-"))]), - "cell-actions": D(({ row: e }) => [c(fe, { "content-loading": A.value === e.data.id }, { + "cell-due_date": D(({ row: e }) => [e.data.due_date ? (v(), a("span", Zr, C(w(dt)(e.data.due_date)), 1)) : (v(), a("span", Qr, "-"))]), + "cell-actions": D(({ row: e }) => [c(fe, { + "content-loading": A.value === e.data.id, + label: w(u)("tasks_projects.general.actions_for", { name: e.data.name }) + }, { activator: D(() => [c(g, { name: "EllipsisHorizontalIcon", class: "h-5 text-muted" @@ -2155,30 +2214,30 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s c(de, { onClick: (t) => re(e.data) }, { default: D(() => [c(g, { name: "PencilIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(u)("tasks_projects.general.edit")), 1)]), _: 1 }, 8, ["onClick"]), c(de, { onClick: (t) => ae(e.data) }, { default: D(() => [c(g, { name: e.data.status === "ARCHIVED" ? "ArrowPathIcon" : "ArchiveBoxIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }, null, 8, ["name"]), s(" " + C(e.data.status === "ARCHIVED" ? w(u)("tasks_projects.projects.unarchive") : w(u)("tasks_projects.projects.archive")), 1)]), _: 2 }, 1032, ["onClick"]), c(de, { onClick: (t) => oe(e.data) }, { default: D(() => [c(g, { name: "TrashIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(u)("tasks_projects.general.delete")), 1)]), _: 1 }, 8, ["onClick"]) ]), _: 2 - }, 1032, ["content-loading"])]), + }, 1032, ["content-loading", "label"])]), _: 1 }, 8, ["columns"])], 512), [[T, !I.value]]), - c(Dr, { + c(jr, { show: x.value, client: e.client, notify: e.notify, @@ -2196,22 +2255,22 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }); }; } -}), Qr = { class: "py-4" }, $r = { class: "rounded-xl border border-line-default bg-surface p-5" }, ei = { class: "flex flex-col gap-4 lg:flex-row lg:items-end" }, ti = { +}), ni = { class: "py-4" }, ri = { class: "rounded-xl border border-line-default bg-surface p-5" }, ii = { class: "flex flex-col gap-4 lg:flex-row lg:items-end" }, ai = { key: 0, class: "mt-3 text-xs text-subtle" -}, ni = { class: "mt-4 overflow-hidden rounded-xl border border-line-default bg-surface" }, ri = { +}, oi = { class: "mt-4 overflow-hidden rounded-xl border border-line-default bg-surface" }, si = { key: 0, class: "flex justify-center py-10" -}, ii = { +}, ci = { key: 1, class: "px-5 py-8 text-center text-sm text-muted" -}, ai = { +}, li = { key: 2, class: "divide-y divide-line-light" -}, oi = { class: "text-sm font-medium text-heading" }, si = { class: "text-xs text-muted" }, ci = { +}, ui = { class: "text-sm font-medium text-heading" }, di = { class: "text-xs text-muted" }, fi = { key: 1, class: "text-subtle" -}, li = /* @__PURE__ */ l({ +}, pi = /* @__PURE__ */ l({ __name: "ProjectMembersTab", props: { id: {}, @@ -2230,12 +2289,12 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s async function A() { m.value = !0; try { - f.value = await Jt(l.client); + f.value = await Yt(l.client); } catch (e) { l.notify("error", H(e, u("tasks_projects.tasks.members_failed"))); } try { - d.value = await vr(l.client, O.value); + d.value = await yr(l.client, O.value); } catch (e) { l.notify("error", H(e, u("tasks_projects.project.members.load_failed"))); } finally { @@ -2250,12 +2309,12 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s if (!(e === null || h.value)) { h.value = !0, E.value = {}; try { - await yr(l.client, O.value, { + await br(l.client, O.value, { user_id: e.id, - rate: st(T.value) + rate: ct(T.value) }), l.notify("success", u("tasks_projects.project.members.attached", { name: e.label })), y.value = null, T.value = "", await A(); } catch (e) { - E.value = at(e), l.notify("error", H(e, u("tasks_projects.project.members.attach_failed"))); + E.value = ot(e), l.notify("error", H(e, u("tasks_projects.project.members.attach_failed"))); } finally { h.value = !1; } @@ -2266,7 +2325,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s if (window.confirm(u("tasks_projects.project.members.detach_confirm", { name: t }))) { _.value = e.user_id; try { - await br(l.client, O.value, e.user_id), l.notify("success", u("tasks_projects.project.members.detached", { name: t })), await A(); + await xr(l.client, O.value, e.user_id), l.notify("success", u("tasks_projects.project.members.detached", { name: t })), await A(); } catch (e) { l.notify("error", H(e, u("tasks_projects.project.members.detach_failed"))); } finally { @@ -2276,7 +2335,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s } return (t, n) => { let l = S("BaseSelectInput"), f = S("BaseInputGroup"), g = S("BaseInput"), b = S("BaseIcon"), O = S("BaseButton"), A = S("BaseSpinner"), P = S("BaseFormatMoney"); - return v(), a("div", Qr, [o("div", $r, [o("div", ei, [ + return v(), a("div", ni, [o("div", ri, [o("div", ii, [ c(f, { label: w(u)("tasks_projects.project.members.member"), error: E.value.user_id, @@ -2328,10 +2387,10 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s default: D(() => [s(" " + C(w(u)("tasks_projects.project.members.attach")), 1)]), _: 1 }, 8, ["loading", "disabled"]) - ]), k.value.length === 0 && !m.value ? (v(), a("p", ti, C(w(u)("tasks_projects.project.members.all_attached")), 1)) : i("", !0)]), o("div", ni, [m.value ? (v(), a("div", ri, [c(A, { class: "h-6 w-6 text-primary-500" })])) : d.value.length === 0 ? (v(), a("p", ii, C(w(u)("tasks_projects.project.members.empty")), 1)) : (v(), a("ul", ai, [(v(!0), a(e, null, x(d.value, (e) => (v(), a("li", { + ]), k.value.length === 0 && !m.value ? (v(), a("p", ai, C(w(u)("tasks_projects.project.members.all_attached")), 1)) : i("", !0)]), o("div", oi, [m.value ? (v(), a("div", si, [c(A, { class: "h-6 w-6 text-primary-500" })])) : d.value.length === 0 ? (v(), a("p", ci, C(w(u)("tasks_projects.project.members.empty")), 1)) : (v(), a("ul", li, [(v(!0), a(e, null, x(d.value, (e) => (v(), a("li", { key: e.id, class: "flex items-center justify-between px-5 py-4" - }, [o("div", null, [o("p", oi, C(j(e.user_id)), 1), o("p", si, [s(C(w(u)("tasks_projects.project.members.rate")) + ": ", 1), e.rate === null ? (v(), a("span", ci, C(w(u)("tasks_projects.tasks.none")), 1)) : (v(), r(P, { + }, [o("div", null, [o("p", ui, C(j(e.user_id)), 1), o("p", di, [s(C(w(u)("tasks_projects.project.members.rate")) + ": ", 1), e.rate === null ? (v(), a("span", fi, C(w(u)("tasks_projects.tasks.none")), 1)) : (v(), r(P, { key: 0, amount: e.rate }, null, 8, ["amount"]))])]), c(O, { @@ -2350,25 +2409,25 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s ])]))), 128))]))])]); }; } -}), ui = { +}), mi = { key: 0, class: "py-6" -}, di = { class: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4" }, fi = { class: "rounded-xl border border-line-default bg-surface p-5" }, pi = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, mi = { class: "mt-2 text-2xl font-semibold text-heading" }, hi = { class: "mt-1 text-xs text-muted" }, gi = { class: "rounded-xl border border-line-default bg-surface p-5" }, _i = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, vi = { class: "mt-2 text-2xl font-semibold text-heading" }, yi = { class: "mt-1 text-xs text-muted" }, bi = { class: "rounded-xl border border-line-default bg-surface p-5" }, xi = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Si = { class: "mt-2 text-2xl font-semibold text-heading" }, Ci = { class: "rounded-xl border border-line-default bg-surface p-5" }, wi = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ti = { class: "mt-2 text-2xl font-semibold text-heading" }, Ei = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, Di = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Oi = { class: "mt-2 text-sm text-body" }, ki = { class: "mt-3 h-2 w-full overflow-hidden rounded-full bg-surface-tertiary" }, Ai = { +}, hi = { class: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4" }, gi = { class: "rounded-xl border border-line-default bg-surface p-5" }, _i = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, vi = { class: "mt-2 text-2xl font-semibold text-heading" }, yi = { class: "mt-1 text-xs text-muted" }, bi = { class: "rounded-xl border border-line-default bg-surface p-5" }, xi = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Si = { class: "mt-2 text-2xl font-semibold text-heading" }, Ci = { class: "mt-1 text-xs text-muted" }, wi = { class: "rounded-xl border border-line-default bg-surface p-5" }, Ti = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ei = { class: "mt-2 text-2xl font-semibold text-heading" }, Di = { class: "rounded-xl border border-line-default bg-surface p-5" }, Oi = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, ki = { class: "mt-2 text-2xl font-semibold text-heading" }, Ai = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, ji = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Mi = { class: "mt-2 text-sm text-body" }, Ni = { class: "mt-3 h-2 w-full overflow-hidden rounded-full bg-surface-tertiary" }, Pi = { key: 0, class: "mt-2 text-xs font-medium text-status-red" -}, ji = { +}, Fi = { key: 1, class: "mt-2 text-sm text-subtle" -}, Mi = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, Ni = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Pi = { +}, Ii = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, Li = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ri = { key: 0, class: "mt-2 text-sm whitespace-pre-line text-body" -}, Fi = { +}, zi = { key: 1, class: "mt-2 text-sm text-subtle" -}, Ii = { +}, Bi = { key: 1, class: "flex justify-center py-16" -}, Li = /* @__PURE__ */ l({ +}, Vi = /* @__PURE__ */ l({ __name: "ProjectOverviewTab", props: { client: { type: [Function, Object] }, @@ -2387,7 +2446,7 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }); async function T() { let e = u.project; - e !== null && y.value && !b.value && (await bt({ + e !== null && y.value && !b.value && (await xt({ client: u.client, router: u.router, notify: u.notify, @@ -2396,22 +2455,22 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s } return (n, l) => { let u = S("BaseFormatMoney"), d = S("BaseIcon"), E = S("BaseButton"), O = S("BaseSpinner"); - return t.project && h.value ? (v(), a("div", ui, [ - o("div", di, [ - o("div", fi, [ - o("p", pi, C(w(f)("tasks_projects.project.overview.tasks")), 1), - o("p", mi, C(h.value.tasks.total), 1), - o("p", hi, C(w(f)("tasks_projects.project.overview.open_tasks", { count: h.value.tasks.open })) + " · " + C(w(f)("tasks_projects.project.overview.closed_tasks", { count: h.value.tasks.closed })), 1) - ]), + return t.project && h.value ? (v(), a("div", mi, [ + o("div", hi, [ o("div", gi, [ - o("p", _i, C(w(f)("tasks_projects.project.overview.logged")), 1), - o("p", vi, C(w(ft)(h.value.logged_minutes)), 1), - o("p", yi, C(w(f)("tasks_projects.project.overview.billable")) + ": " + C(w(ft)(h.value.billable_minutes)), 1) + o("p", _i, C(w(f)("tasks_projects.project.overview.tasks")), 1), + o("p", vi, C(h.value.tasks.total), 1), + o("p", yi, C(w(f)("tasks_projects.project.overview.open_tasks", { count: h.value.tasks.open })) + " · " + C(w(f)("tasks_projects.project.overview.closed_tasks", { count: h.value.tasks.closed })), 1) + ]), + o("div", bi, [ + o("p", xi, C(w(f)("tasks_projects.project.overview.logged")), 1), + o("p", Si, C(w(pt)(h.value.logged_minutes)), 1), + o("p", Ci, C(w(f)("tasks_projects.project.overview.billable")) + ": " + C(w(pt)(h.value.billable_minutes)), 1) ]), - o("div", bi, [o("p", xi, C(w(f)("tasks_projects.project.overview.billable_amount")), 1), o("p", Si, [c(u, { amount: h.value.billable_amount }, null, 8, ["amount"])])]), - o("div", Ci, [ - o("p", wi, C(w(f)("tasks_projects.project.overview.unbilled_amount")), 1), - o("p", Ti, [c(u, { amount: h.value.unbilled_amount }, null, 8, ["amount"])]), + o("div", wi, [o("p", Ti, C(w(f)("tasks_projects.project.overview.billable_amount")), 1), o("p", Ei, [c(u, { amount: h.value.billable_amount }, null, 8, ["amount"])])]), + o("div", Di, [ + o("p", Oi, C(w(f)("tasks_projects.project.overview.unbilled_amount")), 1), + o("p", ki, [c(u, { amount: h.value.unbilled_amount }, null, 8, ["amount"])]), y.value ? (v(), r(E, { key: 0, class: "mt-2", @@ -2431,39 +2490,39 @@ var Sr = { class: "flex w-full items-center justify-between" }, Cr = { class: "s }, 8, ["loading", "disabled"])) : i("", !0) ]) ]), - o("div", Ei, [o("p", Di, C(w(f)("tasks_projects.project.overview.budget")), 1), g.value ? (v(), a(e, { key: 0 }, [ - o("p", Oi, C(w(f)("tasks_projects.project.overview.budget_used", { - used: w(ft)(h.value.logged_minutes), - total: w(ft)(g.value) + o("div", Ai, [o("p", ji, C(w(f)("tasks_projects.project.overview.budget")), 1), g.value ? (v(), a(e, { key: 0 }, [ + o("p", Mi, C(w(f)("tasks_projects.project.overview.budget_used", { + used: w(pt)(h.value.logged_minutes), + total: w(pt)(g.value) })), 1), - o("div", ki, [o("div", { + o("div", Ni, [o("div", { class: p(["h-2 rounded-full", x.value > 0 ? "bg-status-red" : "bg-primary-500"]), style: m({ width: `${_.value}%` }) }, null, 6)]), - x.value > 0 ? (v(), a("p", Ai, C(w(f)("tasks_projects.project.overview.budget_over", { amount: w(ft)(x.value) })), 1)) : i("", !0) - ], 64)) : (v(), a("p", ji, C(w(f)("tasks_projects.project.overview.no_budget")), 1))]), - o("div", Mi, [o("p", Ni, C(w(f)("tasks_projects.project.overview.description")), 1), t.project.description ? (v(), a("p", Pi, C(t.project.description), 1)) : (v(), a("p", Fi, C(w(f)("tasks_projects.project.overview.no_description")), 1))]) - ])) : (v(), a("div", Ii, [c(O, { class: "h-8 w-8 text-primary-500" })])); + x.value > 0 ? (v(), a("p", Pi, C(w(f)("tasks_projects.project.overview.budget_over", { amount: w(pt)(x.value) })), 1)) : i("", !0) + ], 64)) : (v(), a("p", Fi, C(w(f)("tasks_projects.project.overview.no_budget")), 1))]), + o("div", Ii, [o("p", Li, C(w(f)("tasks_projects.project.overview.description")), 1), t.project.description ? (v(), a("p", Ri, C(t.project.description), 1)) : (v(), a("p", zi, C(w(f)("tasks_projects.project.overview.no_description")), 1))]) + ])) : (v(), a("div", Bi, [c(O, { class: "h-8 w-8 text-primary-500" })])); }; } -}), Ri = { +}), Hi = { project: "", user: "", status: "", search: "" }; -function zi(e) { +function Ui(e) { return e === "uninvoiced" || e === "invoiced"; } -function Bi(e) { +function Wi(e) { return { - project: Ji(e.project), - user: Ji(e.user), - status: Yi(e.status), - search: qi(e.search).slice(0, 200) + project: Qi(e.project), + user: Qi(e.user), + status: $i(e.status), + search: Zi(e.search).slice(0, 200) }; } -function Vi(e) { +function Gi(e) { let t = {}; for (let n of [ "project", @@ -2473,10 +2532,10 @@ function Vi(e) { ]) e[n] !== "" && (t[n] = e[n]); return t; } -function Hi(e) { +function Ki(e) { return e.project !== "" || e.user !== "" || e.status !== "" || e.search !== ""; } -function Ui(e) { +function qi(e) { return [ e.project, e.user, @@ -2484,42 +2543,42 @@ function Ui(e) { e.search ].join("|"); } -function Wi(e, t) { +function Ji(e, t) { return e.project === t.project && e.user === t.user && e.status === t.status && e.search === t.search; } -function Gi(e, t = {}) { - let n = {}, r = t.projectId ?? Ki(e.project); +function Yi(e, t = {}) { + let n = {}, r = t.projectId ?? Xi(e.project); r !== null && (n.project_id = r); - let i = Ki(e.user); - if (i !== null && (n.assignee_id = i), zi(e.status)) n.invoiced = +(e.status === "invoiced"); + let i = Xi(e.user); + if (i !== null && (n.assignee_id = i), Ui(e.status)) n.invoiced = +(e.status === "invoiced"); else { - let t = Ki(e.status); + let t = Xi(e.status); t !== null && (n.task_status_id = t); } return e.search !== "" && (n.search = e.search), n; } -function Ki(e) { +function Xi(e) { let t = Number(e); return e !== "" && Number.isInteger(t) && t > 0 ? t : null; } -function qi(e) { +function Zi(e) { let t = Array.isArray(e) ? e[0] : e; return typeof t == "string" ? t.trim() : ""; } -function Ji(e) { - let t = qi(e); - return Ki(t) === null ? "" : t; +function Qi(e) { + let t = Zi(e); + return Xi(t) === null ? "" : t; } -function Yi(e) { - let t = qi(e); - return zi(t) ? t : Ji(e); +function $i(e) { + let t = Zi(e); + return Ui(t) ? t : Qi(e); } //#endregion //#region resources/js/components/TaskFilters.vue?vue&type=script&setup=true&lang.ts -var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { +var ea = { class: "mt-4 flex flex-wrap items-end gap-3" }, ta = { key: 0, class: "min-w-44 flex-1" -}, Qi = { class: "mb-1 block text-xs font-medium text-muted" }, $i = { class: "min-w-44 flex-1" }, ea = { class: "mb-1 block text-xs font-medium text-muted" }, ta = { class: "min-w-44 flex-1" }, na = { class: "mb-1 block text-xs font-medium text-muted" }, ra = { class: "min-w-44 flex-1" }, ia = { class: "mb-1 block text-xs font-medium text-muted" }, aa = 350, oa = /* @__PURE__ */ l({ +}, na = { class: "mb-1 block text-xs font-medium text-muted" }, ra = { class: "min-w-44 flex-1" }, ia = { class: "mb-1 block text-xs font-medium text-muted" }, aa = { class: "min-w-44 flex-1" }, oa = { class: "mb-1 block text-xs font-medium text-muted" }, sa = { class: "min-w-44 flex-1" }, ca = { class: "mb-1 block text-xs font-medium text-muted" }, la = 350, ua = /* @__PURE__ */ l({ __name: "TaskFilters", props: { modelValue: {}, @@ -2571,11 +2630,11 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }), y = n({ get: () => T(m.value, r.modelValue.status), set: (e) => D({ status: e?.id ?? "" }) - }), x = n(() => Hi(r.modelValue)); + }), x = n(() => Ki(r.modelValue)); E(() => r.modelValue.search, (e) => { e !== u.value && (u.value = e); }), E(u, (e) => { - clearTimeout(d), d = setTimeout(() => D({ search: e.trim() }), aa); + clearTimeout(d), d = setTimeout(() => D({ search: e.trim() }), la); }), h(() => clearTimeout(d)); function T(e, t) { return e.find((e) => e.id === t) ?? e[0]; @@ -2587,30 +2646,30 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }); } function O() { - u.value = "", s("update:modelValue", { ...Ri }); + u.value = "", s("update:modelValue", { ...Hi }); } return (t, n) => { let r = S("BaseSelectInput"), s = S("BaseInput"); - return v(), a("div", Xi, [ - e.lockProject ? i("", !0) : (v(), a("label", Zi, [o("span", Qi, C(w(l)("tasks_projects.tasks.filters.project")), 1), c(r, { + return v(), a("div", ea, [ + e.lockProject ? i("", !0) : (v(), a("label", ta, [o("span", na, C(w(l)("tasks_projects.tasks.filters.project")), 1), c(r, { modelValue: g.value, "onUpdate:modelValue": n[0] ||= (e) => g.value = e, options: f.value, "label-key": "label" }, null, 8, ["modelValue", "options"])])), - o("label", $i, [o("span", ea, C(w(l)("tasks_projects.tasks.filters.member")), 1), c(r, { + o("label", ra, [o("span", ia, C(w(l)("tasks_projects.tasks.filters.member")), 1), c(r, { modelValue: _.value, "onUpdate:modelValue": n[1] ||= (e) => _.value = e, options: p.value, "label-key": "label" }, null, 8, ["modelValue", "options"])]), - o("label", ta, [o("span", na, C(w(l)("tasks_projects.tasks.filters.status")), 1), c(r, { + o("label", aa, [o("span", oa, C(w(l)("tasks_projects.tasks.filters.status")), 1), c(r, { modelValue: y.value, "onUpdate:modelValue": n[2] ||= (e) => y.value = e, options: m.value, "label-key": "label" }, null, 8, ["modelValue", "options"])]), - o("label", ra, [o("span", ia, C(w(l)("tasks_projects.tasks.filters.search")), 1), c(s, { + o("label", sa, [o("span", ca, C(w(l)("tasks_projects.tasks.filters.search")), 1), c(s, { modelValue: u.value, "onUpdate:modelValue": n[3] ||= (e) => u.value = e, type: "text", @@ -2627,10 +2686,10 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { ]); }; } -}), sa = { +}), da = { key: 0, class: "mt-3 flex flex-wrap items-center gap-3 rounded-lg border border-primary-200 bg-primary-50 px-4 py-2.5" -}, ca = { class: "text-sm font-medium text-primary-700" }, la = { class: "min-w-48" }, ua = /* @__PURE__ */ l({ +}, fa = { class: "text-sm font-medium text-primary-700" }, pa = { class: "min-w-48" }, ma = /* @__PURE__ */ l({ __name: "BulkActionBar", props: { count: {}, @@ -2661,20 +2720,22 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { e !== null && (u("status", e.id), f.value = null); }), (t, n) => { let l = S("BaseSelectInput"), h = S("BaseIcon"), g = S("BaseButton"); - return e.count > 0 ? (v(), a("div", sa, [ - o("span", ca, C(w(d)("tasks_projects.tasks.bulk.selected", { count: e.count })), 1), - o("div", la, [c(l, { + return e.count > 0 ? (v(), a("div", da, [ + o("span", fa, C(w(d)("tasks_projects.tasks.bulk.selected", { count: e.count })), 1), + o("div", pa, [c(l, { modelValue: f.value, "onUpdate:modelValue": n[0] ||= (e) => f.value = e, options: m.value, disabled: e.busy, placeholder: w(d)("tasks_projects.tasks.bulk.change_status"), + "aria-label": w(d)("tasks_projects.tasks.bulk.change_status"), "label-key": "label" }, null, 8, [ "modelValue", "options", "disabled", - "placeholder" + "placeholder", + "aria-label" ])]), c(g, { variant: "primary-outline", @@ -2707,7 +2768,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }, 8, ["loading", "disabled"])) : i("", !0), o("button", { type: "button", - class: "ml-auto text-sm font-medium text-primary-600 hover:underline", + class: "ms-auto text-sm font-medium text-primary-600 hover:underline", onClick: n[3] ||= (e) => u("select-page") }, C(w(d)("tasks_projects.tasks.bulk.select_page")), 1), o("button", { @@ -2718,7 +2779,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { ])) : i("", !0); }; } -}), da = /* @__PURE__ */ l({ +}), ha = /* @__PURE__ */ l({ __name: "InvoicedBadge", props: { state: { default: "none" } }, setup(e) { @@ -2734,15 +2795,15 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }, 8, ["class"])) : i("", !0); }; } -}), fa = [ +}), ga = [ "LOW", "NORMAL", "HIGH", "URGENT" -], pa = { class: "flex w-full items-center justify-between" }, ma = { +], _a = { class: "flex w-full items-center justify-between" }, va = { key: 0, - class: "ml-2 text-sm font-normal text-muted" -}, ha = { class: "space-y-5 px-6 py-6" }, ga = { class: "flex items-center justify-between border-t border-line-default px-6 py-4" }, _a = { key: 1 }, va = { class: "flex space-x-3" }, ya = /* @__PURE__ */ l({ + class: "ms-2 text-sm font-normal text-muted" +}, ya = ["aria-label"], ba = { class: "space-y-5 px-6 py-6" }, xa = { class: "flex items-center justify-between border-t border-line-default px-6 py-4" }, Sa = { key: 1 }, Ca = { class: "flex space-x-3" }, wa = /* @__PURE__ */ l({ __name: "TaskFormModal", props: { show: { type: Boolean }, @@ -2780,7 +2841,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }))), I = n(() => l.members.map((e) => ({ id: e.id, label: e.name - }))), L = n(() => fa.map((e, t) => ({ + }))), L = n(() => ga.map((e, t) => ({ id: t, label: d(`tasks_projects.tasks.priority.${e.toLowerCase()}`) }))); @@ -2792,17 +2853,17 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { } function z() { let e = l.task; - f.name = e?.name ?? "", f.description = e?.description ?? "", f.estimateHours = ct(e?.estimated_minutes ?? null), f.rate = ot(e?.rate ?? null), f.dueDate = e?.due_date ?? "", f.billable = e?.billable ?? !0; + f.name = e?.name ?? "", f.description = e?.description ?? "", f.estimateHours = lt(e?.estimated_minutes ?? null), f.rate = st(e?.rate ?? null), f.dueDate = e?.due_date ?? "", f.billable = e?.billable ?? !0; let t = l.statuses.find((e) => e.is_default) ?? l.statuses[0], n = e?.task_status_id ?? l.defaults?.task_status_id ?? t?.id ?? null; - p.value = R(F.value, n), m.value = e?.project_id ?? l.defaults?.project_id ?? null, h.value = R(I.value, e?.assignee_id ?? null), g.value = e?.priority ? L.value[fa.indexOf(e.priority)] ?? null : null, _.value = e?.customer_id ?? null, x.value = {}, k.value = !1, _.value !== null && en(l.client); + p.value = R(F.value, n), m.value = e?.project_id ?? l.defaults?.project_id ?? null, h.value = R(I.value, e?.assignee_id ?? null), g.value = e?.priority ? L.value[ga.indexOf(e.priority)] ?? null : null, _.value = e?.customer_id ?? null, x.value = {}, k.value = !1, _.value !== null && tn(l.client); } function ee(e) { - f.dueDate = e ? dt(e) : ""; + f.dueDate = e ? ft(e) : ""; } function te() { let e = p.value?.id ?? null; if (e === null) return null; - let t = g.value === null ? null : fa[g.value.id]; + let t = g.value === null ? null : ga[g.value.id]; return { name: f.name.trim(), task_status_id: e, @@ -2812,9 +2873,9 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { assignee_id: h.value?.id ?? null, priority: t, due_date: f.dueDate || null, - estimated_minutes: lt(f.estimateHours), + estimated_minutes: ut(f.estimateHours), billable: f.billable, - rate: st(f.rate) + rate: ct(f.rate) }; } async function ne() { @@ -2830,23 +2891,23 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { } T.value = !0, x.value = {}; try { - let t = l.task, n = t ? await lr(l.client, t.id, e) : await cr(l.client, e); + let t = l.task, n = t ? await ur(l.client, t.id, e) : await lr(l.client, e); u("saved", n); } catch (e) { - x.value = at(e), l.notify("error", re(e, "save_failed")); + x.value = ot(e), l.notify("error", re(e, "save_failed")); } finally { T.value = !1; } } function re(e, t) { - return gt(e) === "task_locked" ? d("tasks_projects.tasks.locked") : H(e, d(`tasks_projects.tasks.${t}`)); + return _t(e) === "task_locked" ? d("tasks_projects.tasks.locked") : H(e, d(`tasks_projects.tasks.${t}`)); } async function ie() { let e = l.task; if (!(e === null || O.value) && window.confirm(d("tasks_projects.tasks.delete_confirm", { name: e.name }))) { O.value = !0; try { - await ur(l.client, e.id), u("deleted", e); + await dr(l.client, e.id), u("deleted", e); } catch (e) { l.notify("error", re(e, "delete_failed")); } finally { @@ -2860,12 +2921,16 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { show: e.show, onClose: n[12] ||= (e) => u("close") }, { - header: D(() => [o("div", pa, [o("span", null, [s(C(P.value) + " ", 1), e.task ? (v(), a("span", ma, "#" + C(e.task.number), 1)) : i("", !0)]), c(l, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", _a, [o("span", null, [s(C(P.value) + " ", 1), e.task ? (v(), a("span", va, "#" + C(e.task.number), 1)) : i("", !0)]), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(d)("tasks_projects.general.close"), onClick: n[0] ||= (e) => u("close") - })])]), - default: D(() => [o("form", { onSubmit: A(ne, ["prevent"]) }, [o("div", ha, [ + }, [c(l, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, ya)])]), + default: D(() => [o("form", { onSubmit: A(ne, ["prevent"]) }, [o("div", ba, [ c(y, { label: w(d)("tasks_projects.tasks.fields.name"), error: x.value.name, @@ -2910,7 +2975,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { "help-text": w(d)("tasks_projects.tasks.fields.customer_help") }, { default: D(() => [c(m, { - "model-value": w($t)(_.value), + "model-value": w(en)(_.value), type: "text", disabled: "" }, null, 8, ["model-value"])]), @@ -3044,7 +3109,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { name: k.value ? "ChevronUpIcon" : "ChevronDownIcon", class: "h-4 w-4" }, null, 8, ["name"]), s(" " + C(k.value ? w(d)("tasks_projects.tasks.fewer_fields") : w(d)("tasks_projects.tasks.all_fields")), 1)])) : i("", !0) - ]), o("div", ga, [N.value ? (v(), r(te, { + ]), o("div", xa, [N.value ? (v(), r(te, { key: 0, type: "button", variant: "danger", @@ -3054,7 +3119,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }, { default: D(() => [s(C(w(d)("tasks_projects.general.delete")), 1)]), _: 1 - }, 8, ["loading", "disabled"])) : (v(), a("span", _a)), o("div", va, [c(te, { + }, 8, ["loading", "disabled"])) : (v(), a("span", Sa)), o("div", Ca, [c(te, { type: "button", variant: "primary-outline", onClick: n[11] ||= (e) => u("close") @@ -3074,7 +3139,7 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }, 8, ["show"]); }; } -}), ba = { +}), Ta = { default_rate: 0, rounding_minutes: 1, rounding_direction: "nearest", @@ -3100,112 +3165,112 @@ var Xi = { class: "mt-4 flex flex-wrap items-end gap-3" }, Zi = { }, G = y({ adminMode: !1, userId: null, - settings: { ...ba }, + settings: { ...Ta }, companySession: 0, loading: !1 }); -async function xa(e) { +async function Ea(e) { if (G.adminMode) return; G.loading = !0; - let [t, n] = await Promise.all([We(e).catch(() => null), Ue(e).catch(() => null)]); - G.userId = t, G.settings = wa(n), G.loading = !1; + let [t, n] = await Promise.all([Ge(e).catch(() => null), We(e).catch(() => null)]); + G.userId = t, G.settings = ka(n), G.loading = !1; } -function Sa() { - G.userId = null, G.settings = { ...ba }, G.companySession += 1, G.loading = !1; +function Da() { + G.userId = null, G.settings = { ...Ta }, G.companySession += 1, G.loading = !1; } -function Ca(e) { +function Oa(e) { G.adminMode = e; } -function wa(e) { - if (typeof e != "object" || !e) return { ...ba }; - let t = Array.isArray(e.rounding_increments) ? e.rounding_increments.filter((e) => typeof e == "number") : ba.rounding_increments; +function ka(e) { + if (typeof e != "object" || !e) return { ...Ta }; + let t = Array.isArray(e.rounding_increments) ? e.rounding_increments.filter((e) => typeof e == "number") : Ta.rounding_increments; return { - default_rate: Ta(e.default_rate, ba.default_rate), - rounding_minutes: Ta(e.rounding_minutes, ba.rounding_minutes), - rounding_direction: Da(e.rounding_direction), - week_start: Oa(e.week_start), + default_rate: Aa(e.default_rate, Ta.default_rate), + rounding_minutes: Aa(e.rounding_minutes, Ta.rounding_minutes), + rounding_direction: Ma(e.rounding_direction), + week_start: Na(e.week_start), members_see_all_time: e.members_see_all_time === !0, - auto_start_tasks: Ea(e.auto_start_tasks, ba.auto_start_tasks), - lock_invoiced_tasks: Ea(e.lock_invoiced_tasks, ba.lock_invoiced_tasks), - hide_invoiced_on_board: Ea(e.hide_invoiced_on_board, ba.hide_invoiced_on_board), - invoice_project_heading: Ea(e.invoice_project_heading, ba.invoice_project_heading), - invoice_task_description: Ea(e.invoice_task_description, ba.invoice_task_description), - invoice_entry_dates: Ea(e.invoice_entry_dates, ba.invoice_entry_dates), - invoice_entry_times: Ea(e.invoice_entry_times, ba.invoice_entry_times), - invoice_entry_hours: Ea(e.invoice_entry_hours, ba.invoice_entry_hours), - invoice_entry_descriptions: Ea(e.invoice_entry_descriptions, ba.invoice_entry_descriptions), - rounding_increments: t.length > 0 ? t : ba.rounding_increments + auto_start_tasks: ja(e.auto_start_tasks, Ta.auto_start_tasks), + lock_invoiced_tasks: ja(e.lock_invoiced_tasks, Ta.lock_invoiced_tasks), + hide_invoiced_on_board: ja(e.hide_invoiced_on_board, Ta.hide_invoiced_on_board), + invoice_project_heading: ja(e.invoice_project_heading, Ta.invoice_project_heading), + invoice_task_description: ja(e.invoice_task_description, Ta.invoice_task_description), + invoice_entry_dates: ja(e.invoice_entry_dates, Ta.invoice_entry_dates), + invoice_entry_times: ja(e.invoice_entry_times, Ta.invoice_entry_times), + invoice_entry_hours: ja(e.invoice_entry_hours, Ta.invoice_entry_hours), + invoice_entry_descriptions: ja(e.invoice_entry_descriptions, Ta.invoice_entry_descriptions), + rounding_increments: t.length > 0 ? t : Ta.rounding_increments }; } -function Ta(e, t) { +function Aa(e, t) { return typeof e == "number" && Number.isFinite(e) ? e : t; } -function Ea(e, t) { +function ja(e, t) { return typeof e == "boolean" ? e : t; } -function Da(e) { - return e === "up" || e === "down" || e === "nearest" ? e : ba.rounding_direction; +function Ma(e) { + return e === "up" || e === "down" || e === "nearest" ? e : Ta.rounding_direction; } -function Oa(e) { - return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= 6 ? e : ba.week_start; +function Na(e) { + return typeof e == "number" && Number.isInteger(e) && e >= 0 && e <= 6 ? e : Ta.week_start; } //#endregion //#region resources/js/support/time.ts -var ka = 60, Aa = 60, ja = 7; -function Ma(e) { - let t = Number.isFinite(e) && e > 0 ? Math.floor(e) : 0, n = Math.floor(t / 3600), r = Math.floor(t % 3600 / Aa), i = t % Aa; - return `${n}:${Xa(r)}:${Xa(i)}`; +var Pa = 60, Fa = 60, Ia = 7; +function La(e) { + let t = Number.isFinite(e) && e > 0 ? Math.floor(e) : 0, n = Math.floor(t / 3600), r = Math.floor(t % 3600 / Fa), i = t % Fa; + return `${n}:${to(r)}:${to(i)}`; } -function Na(e) { +function Ra(e) { let t = e !== null && Number.isFinite(e) && e > 0 ? Math.round(e) : 0; - return `${Math.floor(t / ka)}:${Xa(t % ka)}`; + return `${Math.floor(t / Pa)}:${to(t % Pa)}`; } -function Pa(e) { +function za(e) { let t = e.trim(); if (t === "") return null; let n = /^(\d+):([0-5]?\d)$/.exec(t); - if (n) return Number(n[1]) * ka + Number(n[2]); + if (n) return Number(n[1]) * Pa + Number(n[2]); if (!/^\d+([.,]\d+)?$/.test(t)) return null; let r = Number(t.replace(",", ".")); - return Number.isNaN(r) ? null : Math.round(r * ka); + return Number.isNaN(r) ? null : Math.round(r * Pa); } -function Fa(e, t, n = "nearest") { +function Ba(e, t, n = "nearest") { let r = Number.isFinite(t) && t >= 1 ? Math.floor(t) : 1, i = Number.isFinite(e) ? Math.floor(e) : 0; return i <= 0 ? 0 : n === "up" ? Math.ceil(i / r) * r : n === "down" ? Math.floor(i / r) * r : i < r ? r : Math.round(i / r) * r; } -function Ia(e) { - let t = qa(e); - return t === null ? "" : Ua(t); +function Va(e) { + let t = Qa(e); + return t === null ? "" : Ja(t); } -function La(e) { - let t = qa(e); - return t === null ? "" : `${Xa(t.getHours())}:${Xa(t.getMinutes())}`; +function Ha(e) { + let t = Qa(e); + return t === null ? "" : `${to(t.getHours())}:${to(t.getMinutes())}`; } -function Ra(e, t = "09:00") { - let n = Ja(e), r = /^(\d{1,2}):([0-5]\d)$/.exec(t.trim()); +function Ua(e, t = "09:00") { + let n = $a(e), r = /^(\d{1,2}):([0-5]\d)$/.exec(t.trim()); if (n === null || r === null) return null; let i = Number(r[1]); return i > 23 ? null : (n.setHours(i, Number(r[2]), 0, 0), n.toISOString()); } -function za(e, t) { +function Wa(e, t) { let n = new Date(e); - return n.setTime(n.getTime() + t * Aa * 1e3), n.toISOString(); + return n.setTime(n.getTime() + t * Fa * 1e3), n.toISOString(); } -function Ba(e, t) { - let n = Number.isInteger(t) && t >= 0 && t <= 6 ? t : 1, r = Ya(e), i = (r.getDay() - n + ja) % ja; +function Ga(e, t) { + let n = Number.isInteger(t) && t >= 0 && t <= 6 ? t : 1, r = eo(e), i = (r.getDay() - n + Ia) % Ia; return r.setDate(r.getDate() - i), r; } -function Va(e) { - return Array.from({ length: ja }, (t, n) => Ha(e, n)); +function Ka(e) { + return Array.from({ length: Ia }, (t, n) => qa(e, n)); } -function Ha(e, t) { - let n = Ya(e); +function qa(e, t) { + let n = eo(e); return n.setDate(n.getDate() + t), n; } -function Ua(e) { - return `${e.getFullYear()}-${Xa(e.getMonth() + 1)}-${Xa(e.getDate())}`; +function Ja(e) { + return `${e.getFullYear()}-${to(e.getMonth() + 1)}-${to(e.getDate())}`; } -function Wa(e) { +function Ya(e) { return { weekday: e.toLocaleDateString(void 0, { weekday: "short" }), day: e.toLocaleDateString(void 0, { @@ -3214,29 +3279,29 @@ function Wa(e) { }) }; } -function Ga(e) { - return Ua(e) === Ua(/* @__PURE__ */ new Date()); +function Xa(e) { + return Ja(e) === Ja(/* @__PURE__ */ new Date()); } -function Ka(e, t) { - let n = qa(e); +function Za(e, t) { + let n = Qa(e); return n === null ? 0 : Math.max(0, Math.floor((t - n.getTime()) / 1e3)); } -function qa(e) { +function Qa(e) { if (!e) return null; let t = new Date(e); return Number.isNaN(t.getTime()) ? null : t; } -function Ja(e) { +function $a(e) { let t = /^(\d{4})-(\d{2})-(\d{2})/.exec(e.trim()); if (t === null) return null; let n = new Date(Number(t[1]), Number(t[2]) - 1, Number(t[3]), 0, 0, 0, 0); return Number.isNaN(n.getTime()) ? null : n; } -function Ya(e) { +function eo(e) { let t = new Date(e.getTime()); return t.setHours(0, 0, 0, 0), t; } -function Xa(e) { +function to(e) { return String(e).padStart(2, "0"); } //#endregion @@ -3246,46 +3311,46 @@ var K = y({ busy: !1, stopPrompt: null, startPrompt: null -}), Za = y({ now: Date.now() }), Qa, $a = 0; -function eo() { - Za.now = Date.now(); +}), no = y({ now: Date.now() }), ro, io = 0; +function ao() { + no.now = Date.now(); } -function to() { - $a += 1, Qa === void 0 && (eo(), Qa = setInterval(eo, 1e3)); +function oo() { + io += 1, ro === void 0 && (ao(), ro = setInterval(ao, 1e3)); } -function no() { - $a = Math.max(0, $a - 1), $a === 0 && Qa !== void 0 && (clearInterval(Qa), Qa = void 0); +function so() { + io = Math.max(0, io - 1), io === 0 && ro !== void 0 && (clearInterval(ro), ro = void 0); } -function ro() { - return to(), _(no, !0), n(() => Za.now); +function co() { + return oo(), _(so, !0), n(() => no.now); } -var io = !1; -function ao(e, t) { +var lo = !1; +function uo(e, t) { if (K.running = e && typeof e.id == "number" ? e : null, K.running === null) { - io && (io = !1, no()); + lo && (lo = !1, so()); return; } - io || (io = !0, to()), t && typeof K.running.task_id == "number" && $e(t, [K.running.task_id]); + lo || (lo = !0, oo()), t && typeof K.running.task_id == "number" && et(t, [K.running.task_id]); } -function oo(e, t, n) { +function fo(e, t, n) { e?.notify("error", H(t, e.t(n))); } -function so(e) { - tt(e.task_id, { running: [{ +function po(e) { + nt(e.task_id, { running: [{ entry_id: e.id, user_id: e.user_id, started_at: e.started_at }] }); } -async function co(e, t, n) { +async function mo(e, t, n) { try { - let n = await cr(e, { + let n = await lr(e, { name: t.name, project_id: t.projectId }); - return Qe(n), V(), typeof n.id == "number" ? n.id : null; + return $e(n), V(), typeof n.id == "number" ? n.id : null; } catch (e) { - return oo(n, e, "tasks_projects.tasks.save_failed"), null; + return fo(n, e, "tasks_projects.tasks.save_failed"), null; } } var q = { @@ -3297,7 +3362,7 @@ var q = { return typeof e == "number" ? e : null; }, get elapsedSeconds() { - return K.running === null ? 0 : Ka(K.running.started_at, Za.now); + return K.running === null ? 0 : Za(K.running.started_at, no.now); }, get busy() { return K.busy; @@ -3313,22 +3378,22 @@ var q = { }, async refresh(e) { try { - ao(await Me(e), e); + uo(await Ne(e), e); } catch { - ao(null); + uo(null); } }, async start(e, t, n = null, r) { if (K.busy) return null; K.busy = !0; try { - let r = await Ne(e, { + let r = await Pe(e, { task_id: t, description: n }); - return ao(r, e), so(r), V(), r; + return uo(r, e), po(r), V(), r; } catch (t) { - return _t(t) ? (r?.notify("warning", r.t("tasks_projects.timer.already_running")), await this.refresh(e)) : oo(r, t, "tasks_projects.timer.start_failed"), null; + return vt(t) ? (r?.notify("warning", r.t("tasks_projects.timer.already_running")), await this.refresh(e)) : fo(r, t, "tasks_projects.timer.start_failed"), null; } finally { K.busy = !1; } @@ -3337,10 +3402,10 @@ var q = { if (K.busy) return null; K.busy = !0; try { - let r = await fr(e, t, n, i); - return ao(r, e), so(r), V(), r; + let r = await pr(e, t, n, i); + return uo(r, e), po(r), V(), r; } catch (t) { - return gt(t) === "timer_already_running" ? (r?.notify("warning", r.t("tasks_projects.timer.already_running")), await this.refresh(e)) : oo(r, t, "tasks_projects.timer.start_failed"), null; + return _t(t) === "timer_already_running" ? (r?.notify("warning", r.t("tasks_projects.timer.already_running")), await this.refresh(e)) : fo(r, t, "tasks_projects.timer.start_failed"), null; } finally { K.busy = !1; } @@ -3350,10 +3415,10 @@ var q = { let r = K.running.task_id; K.busy = !0; try { - let t = await Pe(e, n); - return ao(null), tt(r, { running: [] }), V(), t; + let t = await Fe(e, n); + return uo(null), nt(r, { running: [] }), V(), t; } catch (n) { - return oo(t, n, "tasks_projects.timer.stop_failed"), await this.refresh(e), null; + return fo(t, n, "tasks_projects.timer.stop_failed"), await this.refresh(e), null; } finally { K.busy = !1; } @@ -3362,10 +3427,10 @@ var q = { if (K.busy) return null; K.busy = !0; try { - let n = await pr(e, t, r); - return ao(null), tt(t, { running: [] }), V(), n; + let n = await mr(e, t, r); + return uo(null), nt(t, { running: [] }), V(), n; } catch (t) { - return gt(t) === "timer_mismatch" ? n?.notify("warning", n.t("tasks_projects.timer.mismatch")) : oo(n, t, "tasks_projects.timer.stop_failed"), await this.refresh(e), null; + return _t(t) === "timer_mismatch" ? n?.notify("warning", n.t("tasks_projects.timer.mismatch")) : fo(n, t, "tasks_projects.timer.stop_failed"), await this.refresh(e), null; } finally { K.busy = !1; } @@ -3401,7 +3466,7 @@ var q = { if (r === null) return null; let i = n.taskId; if (typeof i == "number" && r.task_id !== i) return t?.notify("warning", t.t("tasks_projects.timer.mismatch")), await this.refresh(e), null; - let a = Ze(r.task_id), o = await this.askStop(); + let a = Qe(r.task_id), o = await this.askStop(); if (o === null) return null; if (o.action === "discard") return await this.discard(e, t) && t?.notify("success", t.t("tasks_projects.timer.discarded")), null; let s = { @@ -3410,41 +3475,41 @@ var q = { }, c = typeof i == "number" ? await this.stopOnTask(e, i, t, s) : await this.stop(e, t, s); return c !== null && t?.notify("success", t.t("tasks_projects.timer.stopped", { name: a, - duration: Na(c.duration_minutes) + duration: Ra(c.duration_minutes) })), c; }, async startWithPrompt(e, t, n = {}) { let r = await this.askStart(n); if (r === null) return null; - let i = "taskId" in r ? r.taskId : await co(e, r.create, t); + let i = "taskId" in r ? r.taskId : await mo(e, r.create, t); if (i === null) return null; let a = await this.startOnTask(e, i, r.description, t, r.billable); - return a !== null && t?.notify("success", t.t("tasks_projects.timer.started", { name: Ze(i) })), a; + return a !== null && t?.notify("success", t.t("tasks_projects.timer.started", { name: Qe(i) })), a; }, async discard(e, t) { if (K.busy || K.running === null) return !1; let n = K.running.task_id; K.busy = !0; try { - return await Fe(e), ao(null), tt(n, { running: [] }), V(), !0; + return await Ie(e), uo(null), nt(n, { running: [] }), V(), !0; } catch (n) { - return oo(t, n, "tasks_projects.timer.discard_failed"), await this.refresh(e), !1; + return fo(t, n, "tasks_projects.timer.discard_failed"), await this.refresh(e), !1; } finally { K.busy = !1; } }, reset() { - this.answerStop(null), this.answerStart(null), K.busy = !1, ao(null); + this.answerStop(null), this.answerStart(null), K.busy = !1, uo(null); } -}, lo = { class: "flex items-center gap-1.5" }, uo = [ +}, ho = { class: "flex items-center gap-1.5" }, go = [ "disabled", "title", "aria-label" -], fo = ["title", "aria-label"], po = ["disabled", "title"], mo = [ +], _o = ["title", "aria-label"], vo = ["disabled", "title"], yo = [ "disabled", "title", "aria-label" -], ho = ["title"], go = /* @__PURE__ */ l({ +], bo = ["title"], xo = /* @__PURE__ */ l({ __name: "TaskRunControl", props: { client: {}, @@ -3454,19 +3519,19 @@ var q = { size: { default: "sm" } }, setup(t) { - let r = t, i = B(), l = ro(), u = n(() => ({ + let r = t, i = B(), l = co(), u = n(() => ({ notify: r.notify, t: i - })), d = n(() => q.isRunningOn(r.task.id)), f = n(() => q.runningTaskId !== null && !d.value), m = n(() => Ze(q.runningTaskId)), h = n(() => nt(r.task).running.filter((e) => e.user_id !== G.userId && e.entry_id !== q.running?.id)), g = n(() => Ma(q.elapsedSeconds)), _ = n(() => r.size === "md" ? "h-5 w-5" : "h-4 w-4"), y = n(() => r.size === "md" ? "p-2" : "p-1.5"); + })), d = n(() => q.isRunningOn(r.task.id)), f = n(() => q.runningTaskId !== null && !d.value), m = n(() => Qe(q.runningTaskId)), h = n(() => rt(r.task).running.filter((e) => e.user_id !== G.userId && e.entry_id !== q.running?.id)), g = n(() => La(q.elapsedSeconds)), _ = n(() => r.size === "md" ? "h-5 w-5" : "h-4 w-4"), y = n(() => r.size === "md" ? "p-2" : "p-1.5"); function b(e) { return r.members.find((t) => t.id === e)?.name ?? `#${e}`; } function T(e) { let t = r.members.find((t) => t.id === e); - return t ? pt(t.name) : "?"; + return t ? mt(t.name) : "?"; } function E(e) { - return Ma(Ka(e.started_at, l.value)); + return La(Za(e.started_at, l.value)); } function D(e) { return i("tasks_projects.timer.running_by", { @@ -3485,7 +3550,7 @@ var q = { } return (n, r) => { let l = S("BaseIcon"); - return v(), a("div", lo, [d.value ? (v(), a(e, { key: 0 }, [o("button", { + return v(), a("div", ho, [d.value ? (v(), a(e, { key: 0 }, [o("button", { type: "button", class: p(["rounded-md text-status-red hover:bg-hover disabled:opacity-50", y.value]), disabled: w(q).busy, @@ -3495,7 +3560,7 @@ var q = { }, [c(l, { name: "StopIcon", class: p(_.value) - }, null, 8, ["class"])], 10, uo), o("span", { class: p(["font-medium tabular-nums text-primary-500", t.size === "md" ? "text-base" : "text-xs"]) }, C(g.value), 3)], 64)) : f.value ? (v(), a(e, { key: 1 }, [o("button", { + }, null, 8, ["class"])], 10, go), o("span", { class: p(["font-medium tabular-nums text-primary-500", t.size === "md" ? "text-base" : "text-xs"]) }, C(g.value), 3)], 64)) : f.value ? (v(), a(e, { key: 1 }, [o("button", { type: "button", class: p(["cursor-not-allowed rounded-md text-subtle", y.value]), disabled: "", @@ -3504,13 +3569,13 @@ var q = { }, [c(l, { name: "PlayIcon", class: p(_.value) - }, null, 8, ["class"])], 10, fo), o("button", { + }, null, 8, ["class"])], 10, _o), o("button", { type: "button", class: "rounded-md px-1.5 py-0.5 text-[11px] font-medium text-primary-500 hover:bg-hover disabled:opacity-50", disabled: w(q).busy, title: w(i)("tasks_projects.timer.stop_and_start"), onClick: A(j, ["stop"]) - }, C(w(i)("tasks_projects.timer.stop_and_start")), 9, po)], 64)) : (v(), a("button", { + }, C(w(i)("tasks_projects.timer.stop_and_start")), 9, vo)], 64)) : (v(), a("button", { key: 2, type: "button", class: p(["rounded-md text-primary-500 hover:bg-hover disabled:opacity-50", y.value]), @@ -3521,20 +3586,20 @@ var q = { }, [c(l, { name: "PlayIcon", class: p(_.value) - }, null, 8, ["class"])], 10, mo)), (v(!0), a(e, null, x(h.value, (e) => (v(), a("span", { + }, null, 8, ["class"])], 10, yo)), (v(!0), a(e, null, x(h.value, (e) => (v(), a("span", { key: e.entry_id, class: "flex items-center gap-1 rounded-full bg-surface-tertiary px-1.5 py-0.5 text-[11px] text-muted", title: D(e) }, [c(l, { name: "ClockIcon", class: "h-3.5 w-3.5 text-primary-500" - }), s(" " + C(T(e.user_id)), 1)], 8, ho))), 128))]); + }), s(" " + C(T(e.user_id)), 1)], 8, bo))), 128))]); }; } -}), _o = { class: "relative table-container" }, vo = { class: "inline-flex items-center whitespace-nowrap" }, yo = { class: "tabular-nums" }, bo = { +}), So = { class: "relative table-container" }, Co = { class: "inline-flex items-center whitespace-nowrap" }, wo = { class: "tabular-nums" }, To = { key: 1, class: "text-subtle" -}, xo = ["title"], So = 10, Co = "whitespace-nowrap px-3 py-3 text-left text-xs font-medium text-muted uppercase tracking-wider", wo = "px-3 py-4 text-sm text-muted whitespace-nowrap", To = /* @__PURE__ */ l({ +}, Eo = ["title"], Do = 10, Oo = "whitespace-nowrap px-3 py-3 text-start text-xs font-medium text-muted uppercase tracking-wider", ko = "px-3 py-4 text-sm text-muted whitespace-nowrap", Ao = /* @__PURE__ */ l({ __name: "TaskList", props: { client: {}, @@ -3610,31 +3675,31 @@ var q = { key: "actions", label: g("tasks_projects.general.actions"), sortable: !1, - tdClass: "text-right text-sm font-medium" + tdClass: "text-end text-sm font-medium" } ].map((e) => ({ - defaultThClass: Co, - defaultTdClass: wo, + defaultThClass: Oo, + defaultTdClass: ko, ...e }))); - E(() => Ui(d.filters), () => ie()), E(() => d.projectId, () => ie()), E(et, () => ie(!0)); + E(() => qi(d.filters), () => ie()), E(() => d.projectId, () => ie()), E(tt, () => ie(!0)); async function re({ page: e, sort: t }) { - let n = Vt(t, h), r = { + let n = Ht(t, h), r = { page: e, - limit: So, - ...Gi(d.filters, { projectId: d.projectId }), + limit: Do, + ...Yi(d.filters, { projectId: d.projectId }), ...n }; y.value = !0; try { - let e = await sr(d.client, r), t = e.data ?? [], n = e.meta; + let e = await cr(d.client, r), t = e.data ?? [], n = e.meta; return x.value = n?.total ?? t.length, k.value = t, A.value = A.value.filter((e) => t.some((t) => t.id === e)), { data: t, pagination: { totalPages: n?.last_page ?? 1, currentPage: n?.current_page ?? 1, totalCount: n?.total ?? t.length, - limit: n?.per_page ?? So + limit: n?.per_page ?? Do } }; } catch (e) { @@ -3644,7 +3709,7 @@ var q = { totalPages: 1, currentPage: 1, totalCount: 0, - limit: So + limit: Do } }; } finally { @@ -3686,13 +3751,13 @@ var q = { return e.assignee_id === null ? g("tasks_projects.tasks.unassigned") : d.members.find((t) => t.id === e.assignee_id)?.name ?? `#${e.assignee_id}`; } function he(e) { - return Na(nt(e).logged_minutes); + return Ra(rt(e).logged_minutes); } function ge(e) { - return nt(e).invoiced === "uninvoiced"; + return rt(e).invoiced === "uninvoiced"; } function _e(e) { - return nt(e).invoiced === "invoiced" ? g("tasks_projects.tasks.already_invoiced") : g("tasks_projects.tasks.nothing_to_invoice"); + return rt(e).invoiced === "invoiced" ? g("tasks_projects.tasks.already_invoiced") : g("tasks_projects.tasks.nothing_to_invoice"); } let ve = n(() => ({ client: d.client, @@ -3704,20 +3769,20 @@ var q = { if (!R.value) { I.value = e.id; try { - await bt(ve.value, { taskIds: [e.id] }); + await xt(ve.value, { taskIds: [e.id] }); } finally { I.value = null; } } } async function be() { - R.value || A.value.length === 0 || await bt(ve.value, { taskIds: [...A.value] }) && ce(); + R.value || A.value.length === 0 || await xt(ve.value, { taskIds: [...A.value] }) && ce(); } async function xe(e) { if (window.confirm(g("tasks_projects.tasks.delete_confirm", { name: e.name }))) { I.value = e.id; try { - await ur(d.client, e.id), d.notify("success", g("tasks_projects.tasks.deleted", { name: e.name })), V(), f("changed"); + await dr(d.client, e.id), d.notify("success", g("tasks_projects.tasks.deleted", { name: e.name })), V(), f("changed"); } catch (e) { d.notify("error", H(e, g("tasks_projects.tasks.delete_failed"))); } finally { @@ -3743,7 +3808,7 @@ var q = { if (!(j.value || e.ids.length === 0)) { j.value = !0; try { - let n = await hr(d.client, e); + let n = await gr(d.client, e); n.failed.length > 0 ? d.notify("warning", g("tasks_projects.tasks.bulk.partial", { count: n.updated.length, failed: n.failed.length, @@ -3762,7 +3827,7 @@ var q = { }), (n, l) => { let u = S("BaseIcon"), d = S("BaseButton"), f = S("BaseEmptyPlaceholder"), h = S("BaseCheckbox"), y = S("router-link"), b = S("BaseFormatMoney"), x = S("BaseDropdownItem"), E = S("BaseDropdown"), k = S("BaseTable"); return v(), a("div", null, [ - c(ua, { + c(ma, { count: A.value.length, statuses: t.statuses, busy: j.value, @@ -3801,7 +3866,7 @@ var q = { })]), _: 1 }, 8, ["title", "description"]), [[T, te.value]]), - O(o("div", _o, [c(k, { + O(o("div", So, [c(k, { ref_key: "tableRef", ref: _, data: re, @@ -3826,20 +3891,20 @@ var q = { _: 2 }, 1032, ["to"]), e.data.due_date ? (v(), a("span", { key: 0, - class: p(["mt-0.5 block text-xs font-normal", w(mt)(e.data.due_date) && !e.data.closed_at ? "font-medium text-status-red" : "text-muted"]) - }, C(w(g)("tasks_projects.tasks.columns.due_date")) + ": " + C(w(ut)(e.data.due_date)), 3)) : i("", !0)]), - "cell-status": D(({ row: e }) => [o("span", vo, [o("span", { - class: p(["mr-2 inline-block h-2.5 w-2.5 shrink-0 rounded-full", pe(e.data)?.colour ? "" : "bg-line-default"]), + class: p(["mt-0.5 block text-xs font-normal", w(ht)(e.data.due_date) && !e.data.closed_at ? "font-medium text-status-red" : "text-muted"]) + }, C(w(g)("tasks_projects.tasks.columns.due_date")) + ": " + C(w(dt)(e.data.due_date)), 3)) : i("", !0)]), + "cell-status": D(({ row: e }) => [o("span", Co, [o("span", { + class: p(["me-2 inline-block h-2.5 w-2.5 shrink-0 rounded-full", pe(e.data)?.colour ? "" : "bg-line-default"]), style: m(pe(e.data)?.colour ? { backgroundColor: pe(e.data)?.colour } : void 0) }, null, 6), s(" " + C(pe(e.data)?.name ?? "-"), 1)])]), "cell-assignee": D(({ row: e }) => [o("span", { class: p(e.data.assignee_id === null ? "text-subtle" : "") }, C(me(e.data)), 3)]), - "cell-logged": D(({ row: e }) => [o("span", yo, C(he(e.data)), 1)]), - "cell-unbilled": D(({ row: e }) => [w(nt)(e.data).unbilled_amount > 0 ? (v(), r(b, { + "cell-logged": D(({ row: e }) => [o("span", wo, C(he(e.data)), 1)]), + "cell-unbilled": D(({ row: e }) => [w(rt)(e.data).unbilled_amount > 0 ? (v(), r(b, { key: 0, - amount: w(nt)(e.data).unbilled_amount - }, null, 8, ["amount"])) : (v(), a("span", bo, "-"))]), - "cell-invoiced": D(({ row: e }) => [c(da, { state: w(nt)(e.data).invoiced }, null, 8, ["state"])]), - "cell-timer": D(({ row: e }) => [c(go, { + amount: w(rt)(e.data).unbilled_amount + }, null, 8, ["amount"])) : (v(), a("span", To, "-"))]), + "cell-invoiced": D(({ row: e }) => [c(ha, { state: w(rt)(e.data).invoiced }, null, 8, ["state"])]), + "cell-timer": D(({ row: e }) => [c(xo, { client: t.client, notify: t.notify, task: e.data, @@ -3850,7 +3915,10 @@ var q = { "task", "members" ])]), - "cell-actions": D(({ row: t }) => [c(E, { "content-loading": I.value === t.data.id }, { + "cell-actions": D(({ row: t }) => [c(E, { + "content-loading": I.value === t.data.id, + label: w(g)("tasks_projects.general.actions_for", { name: t.data.name }) + }, { activator: D(() => [c(u, { name: "EllipsisHorizontalIcon", class: "h-5 text-muted" @@ -3859,7 +3927,7 @@ var q = { c(x, { onClick: (e) => ue(t.data) }, { default: D(() => [c(u, { name: "PencilIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(g)("tasks_projects.general.edit")), 1)]), _: 1 }, 8, ["onClick"]), @@ -3869,7 +3937,7 @@ var q = { }, { default: D(() => [c(u, { name: "BanknotesIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(g)("tasks_projects.tasks.invoice_task")), 1)]), _: 1 }, 8, ["onClick"])) : (v(), a("div", { @@ -3878,21 +3946,21 @@ var q = { title: R.value ? w(g)("tasks_projects.billing.busy") : _e(t.data) }, [c(u, { name: "BanknotesIcon", - class: "mr-3 h-5 w-5 text-subtle" - }), s(" " + C(w(g)("tasks_projects.tasks.invoice_task")), 1)], 8, xo))], 64)) : i("", !0), + class: "me-3 h-5 w-5 text-subtle" + }), s(" " + C(w(g)("tasks_projects.tasks.invoice_task")), 1)], 8, Eo))], 64)) : i("", !0), c(x, { onClick: (e) => xe(t.data) }, { default: D(() => [c(u, { name: "TrashIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(g)("tasks_projects.general.delete")), 1)]), _: 1 }, 8, ["onClick"]) ]), _: 2 - }, 1032, ["content-loading"])]), + }, 1032, ["content-loading", "label"])]), _: 1 }, 8, ["columns"])], 512), [[T, !te.value]]), - c(ya, { + c(wa, { show: N.value, client: t.client, notify: t.notify, @@ -3921,7 +3989,7 @@ var q = { ]); }; } -}), Eo = { class: "py-4" }, Do = { class: "flex flex-wrap items-end justify-between gap-3" }, Oo = /* @__PURE__ */ l({ +}), jo = { class: "py-4" }, Mo = { class: "flex flex-wrap items-end justify-between gap-3" }, No = /* @__PURE__ */ l({ __name: "ProjectTasksTab", props: { id: {}, @@ -3932,16 +4000,16 @@ var q = { }, emits: ["refresh"], setup(e, { emit: t }) { - let r = e, i = t, l = B(), u = b(null), d = b([]), f = b([]), m = b({ ...Ri }), h = n(() => r.project?.id ?? Number(r.id)), _ = n(() => r.project === null ? [] : [r.project]); + let r = e, i = t, l = B(), u = b(null), d = b([]), f = b([]), m = b({ ...Hi }), h = n(() => r.project?.id ?? Number(r.id)), _ = n(() => r.project === null ? [] : [r.project]); g(() => void y()); async function y() { try { - d.value = await or(r.client); + d.value = await sr(r.client); } catch (e) { r.notify("error", H(e, l("tasks_projects.task_statuses.load_failed"))); } try { - f.value = await Jt(r.client); + f.value = await Yt(r.client); } catch { f.value = []; } @@ -3951,7 +4019,7 @@ var q = { } return (t, n) => { let r = S("BaseIcon"), i = S("BaseButton"); - return v(), a("div", Eo, [o("div", Do, [c(oa, { + return v(), a("div", jo, [o("div", Mo, [c(ua, { modelValue: m.value, "onUpdate:modelValue": n[0] ||= (e) => m.value = e, class: "flex-1", @@ -3974,7 +4042,7 @@ var q = { }, null, 8, ["class"])]), default: D(() => [s(" " + C(w(l)("tasks_projects.tasks.new_task")), 1)]), _: 1 - })]), c(To, { + })]), c(Ao, { ref_key: "listRef", ref: u, client: e.client, @@ -3998,13 +4066,13 @@ var q = { ])]); }; } -}), ko = { class: "flex w-full items-center justify-between" }, Ao = { class: "space-y-5 px-6 py-6" }, jo = { +}), Po = { class: "flex w-full items-center justify-between" }, Fo = ["aria-label"], Io = { class: "space-y-5 px-6 py-6" }, Lo = { key: 0, class: "rounded-md bg-alert-warning-bg px-3 py-2 text-sm text-alert-warning-text" -}, Mo = { class: "inline-flex overflow-hidden rounded-md border border-line-default" }, No = ["disabled", "onClick"], Po = { +}, Ro = { class: "inline-flex overflow-hidden rounded-md border border-line-default" }, zo = ["disabled", "onClick"], Bo = { key: 1, class: "text-sm text-muted" -}, Fo = { class: "flex items-center justify-between border-t border-line-default px-6 py-4" }, Io = { key: 1 }, Lo = { class: "flex space-x-3" }, Ro = "09:00", zo = /* @__PURE__ */ l({ +}, Vo = { class: "flex items-center justify-between border-t border-line-default px-6 py-4" }, Ho = { key: 1 }, Uo = { class: "flex space-x-3" }, Wo = "09:00", Go = /* @__PURE__ */ l({ __name: "TimeEntryModal", props: { show: { type: Boolean }, @@ -4025,7 +4093,7 @@ var q = { date: "", mode: "duration", duration: "", - start: Ro, + start: Wo, end: "", description: "", billable: !0 @@ -4035,7 +4103,7 @@ var q = { }, { immediate: !0 }); function N() { let e = u.entry; - _.value = {}, g.value = e === null ? u.defaultTask ?? null : null, h.date = e ? Ia(e.started_at) : u.defaultDate ?? Ua(/* @__PURE__ */ new Date()), h.duration = e ? Na(e.duration_minutes) : "", h.start = e?.started_at ? La(e.started_at) : Ro, h.end = e?.ended_at ? La(e.ended_at) : "", h.description = e?.description ?? "", h.billable = e ? e.billable : g.value?.billable ?? !0, h.mode = e !== null && P(e) ? "range" : "duration", h.date === "" && (h.date = u.defaultDate ?? Ua(/* @__PURE__ */ new Date())), e !== null && F(e.task_id); + _.value = {}, g.value = e === null ? u.defaultTask ?? null : null, h.date = e ? Va(e.started_at) : u.defaultDate ?? Ja(/* @__PURE__ */ new Date()), h.duration = e ? Ra(e.duration_minutes) : "", h.start = e?.started_at ? Ha(e.started_at) : Wo, h.end = e?.ended_at ? Ha(e.ended_at) : "", h.description = e?.description ?? "", h.billable = e ? e.billable : g.value?.billable ?? !0, h.mode = e !== null && P(e) ? "range" : "duration", h.date === "" && (h.date = u.defaultDate ?? Ja(/* @__PURE__ */ new Date())), e !== null && F(e.task_id); } function P(e) { if (!e.started_at || !e.ended_at) return !1; @@ -4044,20 +4112,20 @@ var q = { } async function F(e) { try { - let t = await He(u.client, e); - g.value = t, Qe(t); + let t = await Ue(u.client, e); + g.value = t, $e(t); } catch {} } async function I(e) { try { - let t = await Ve(u.client, e ?? ""); - return t.forEach(Qe), t; + let t = await He(u.client, e ?? ""); + return t.forEach($e), t; } catch (e) { return u.notify("error", H(e, m("tasks_projects.time.tasks_failed"))), []; } } function L(e) { - h.date = e ? dt(e) : ""; + h.date = e ? ft(e) : ""; } function R(e) { g.value = e, e !== null && u.entry === null && (h.billable = e.billable !== !1); @@ -4065,11 +4133,11 @@ var q = { function z() { let e = {}, t = g.value; (t === null || typeof t.id != "number") && (e.task_id = m("tasks_projects.time.task_required")), h.date === "" && (e.date = m("tasks_projects.time.date_required")); - let n = Ra(h.date, h.mode === "range" ? h.start : Ro); + let n = Ua(h.date, h.mode === "range" ? h.start : Wo); n === null && (e.started_at = m("tasks_projects.time.range_invalid")); - let r = h.mode === "duration" ? Pa(h.duration) : null; + let r = h.mode === "duration" ? za(h.duration) : null; h.mode === "duration" && r === null && (e.duration_minutes = m("tasks_projects.time.duration_invalid")); - let i = h.mode === "range" ? Ra(h.date, h.end) : null; + let i = h.mode === "range" ? Ua(h.date, h.end) : null; if (h.mode === "range" && (i === null || n === null || i <= n) && (e.ended_at = m("tasks_projects.time.range_invalid")), _.value = e, Object.keys(e).length > 0 || t === null || n === null) return null; let a = { task_id: t.id, @@ -4077,7 +4145,7 @@ var q = { description: h.description.trim() || null, billable: h.billable }; - return h.mode === "duration" && r !== null ? (a.duration_minutes = r, a.ended_at = za(n, r)) : a.ended_at = i, a; + return h.mode === "duration" && r !== null ? (a.duration_minutes = r, a.ended_at = Wa(n, r)) : a.ended_at = i, a; } async function ee() { if (T.value || j.value) return; @@ -4085,10 +4153,10 @@ var q = { if (e !== null) { T.value = !0; try { - let t = u.entry, n = t ? await Ae(u.client, t.id, e) : await ke(u.client, e); + let t = u.entry, n = t ? await je(u.client, t.id, e) : await Ae(u.client, e); d("saved", n); } catch (e) { - _.value = at(e), u.notify("error", H(e, m("tasks_projects.time.save_failed"))); + _.value = ot(e), u.notify("error", H(e, m("tasks_projects.time.save_failed"))); } finally { T.value = !1; } @@ -4099,7 +4167,7 @@ var q = { if (!(e === null || O.value || j.value) && window.confirm(m("tasks_projects.time.delete_confirm"))) { O.value = !0; try { - await je(u.client, e.id), d("deleted", e); + await Me(u.client, e.id), d("deleted", e); } catch (e) { u.notify("error", H(e, m("tasks_projects.time.delete_failed"))); } finally { @@ -4113,13 +4181,17 @@ var q = { show: t.show, onClose: l[8] ||= (e) => d("close") }, { - header: D(() => [o("div", ko, [o("span", null, C(M.value), 1), c(u, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", Po, [o("span", null, C(M.value), 1), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(m)("tasks_projects.general.close"), onClick: l[0] ||= (e) => d("close") - })])]), - default: D(() => [o("form", { onSubmit: A(ee, ["prevent"]) }, [o("div", Ao, [ - j.value ? (v(), a("p", jo, C(w(m)("tasks_projects.time.stamped_notice")), 1)) : i("", !0), + }, [c(u, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, Fo)])]), + default: D(() => [o("form", { onSubmit: A(ee, ["prevent"]) }, [o("div", Io, [ + j.value ? (v(), a("p", Lo, C(w(m)("tasks_projects.time.stamped_notice")), 1)) : i("", !0), c(E, { label: w(m)("tasks_projects.time.fields.task"), error: _.value.task_id, @@ -4175,13 +4247,13 @@ var q = { ])]), _: 1 }, 8, ["label", "error"]), c(E, { label: w(m)("tasks_projects.time.fields.mode") }, { - default: D(() => [o("div", Mo, [(v(), a(e, null, x(f, (e) => o("button", { + default: D(() => [o("div", Ro, [(v(), a(e, null, x(f, (e) => o("button", { key: e, type: "button", class: p(["px-3 py-2 text-sm", h.mode === e ? "bg-primary-500 text-white" : "bg-surface text-body hover:bg-hover"]), disabled: j.value, onClick: (t) => h.mode = e - }, C(w(m)(`tasks_projects.time.mode.${e}`)), 11, No)), 64))])]), + }, C(w(m)(`tasks_projects.time.mode.${e}`)), 11, zo)), 64))])]), _: 1 }, 8, ["label"])]), _: 1 @@ -4270,7 +4342,7 @@ var q = { label: w(m)("tasks_projects.time.fields.billable"), error: _.value.billable }, { - default: D(() => [j.value ? (v(), a("span", Po, C(h.billable ? w(m)("tasks_projects.time.billable") : w(m)("tasks_projects.time.non_billable")), 1)) : (v(), r(z, { + default: D(() => [j.value ? (v(), a("span", Bo, C(h.billable ? w(m)("tasks_projects.time.billable") : w(m)("tasks_projects.time.non_billable")), 1)) : (v(), r(z, { key: 0, modelValue: h.billable, "onUpdate:modelValue": l[6] ||= (e) => h.billable = e, @@ -4278,7 +4350,7 @@ var q = { }, null, 8, ["modelValue"]))]), _: 1 }, 8, ["label", "error"]) - ]), o("div", Fo, [k.value && !j.value ? (v(), r(B, { + ]), o("div", Vo, [k.value && !j.value ? (v(), r(B, { key: 0, type: "button", variant: "danger", @@ -4289,7 +4361,7 @@ var q = { }, { default: D(() => [s(C(w(m)("tasks_projects.general.delete")), 1)]), _: 1 - }, 8, ["loading", "disabled"])) : (v(), a("span", Io)), o("div", Lo, [c(B, { + }, 8, ["loading", "disabled"])) : (v(), a("span", Ho)), o("div", Uo, [c(B, { type: "button", variant: "primary-outline", onClick: l[7] ||= (e) => d("close") @@ -4310,16 +4382,16 @@ var q = { }, 8, ["show"]); }; } -}), Bo = { class: "py-4" }, Vo = { class: "flex justify-end" }, Ho = { class: "relative mt-3 table-container" }, Uo = { class: "font-medium text-heading" }, Wo = { +}), Ko = { class: "py-4" }, qo = { class: "flex justify-end" }, Jo = { class: "relative mt-3 table-container" }, Yo = { class: "font-medium text-heading" }, Xo = { key: 0, class: "block text-xs text-muted" -}, Go = { +}, Zo = { key: 1, class: "text-subtle" -}, Ko = { +}, Qo = { key: 0, class: "text-xs text-primary-500" -}, qo = 15, Jo = 100, Yo = /* @__PURE__ */ l({ +}, $o = 15, es = 100, ts = /* @__PURE__ */ l({ __name: "ProjectTimeTab", props: { id: {}, @@ -4329,7 +4401,7 @@ var q = { }, emits: ["refresh"], setup(e, { emit: t }) { - let l = e, u = t, d = B(), f = ro(), m = b(null), h = b([]), _ = b([]), y = b(!1), x = b(null), T = n(() => l.project?.id ?? Number(l.id)), O = n(() => [ + let l = e, u = t, d = B(), f = co(), m = b(null), h = b([]), _ = b([]), y = b(!1), x = b(null), T = n(() => l.project?.id ?? Number(l.id)), O = n(() => [ { key: "started_at", label: d("tasks_projects.project.time.columns.date"), @@ -4365,22 +4437,22 @@ var q = { key: "actions", label: d("tasks_projects.general.actions"), sortable: !1, - tdClass: "text-right text-sm font-medium" + tdClass: "text-end text-sm font-medium" } ]); g(() => { k(); - }), E(et, () => m.value?.refresh(!0)); + }), E(tt, () => m.value?.refresh(!0)); async function k() { try { - h.value = await Jt(l.client); + h.value = await Yt(l.client); } catch (e) { l.notify("error", H(e, d("tasks_projects.tasks.members_failed"))); } try { - let e = await sr(l.client, { + let e = await cr(l.client, { project_id: T.value, - limit: Jo + limit: es }); _.value = e.data ?? []; } catch (e) { @@ -4390,18 +4462,18 @@ var q = { async function A({ page: e }) { let t = { page: e, - limit: qo, + limit: $o, project_id: T.value }; try { - let e = await xr(l.client, t); + let e = await Sr(l.client, t); return { data: e.data ?? [], pagination: { totalPages: e.meta?.last_page ?? 1, currentPage: e.meta?.current_page ?? 1, totalCount: e.meta?.total ?? 0, - limit: e.meta?.per_page ?? qo + limit: e.meta?.per_page ?? $o } }; } catch (e) { @@ -4411,7 +4483,7 @@ var q = { totalPages: 1, currentPage: 1, totalCount: 0, - limit: qo + limit: $o } }; } @@ -4423,7 +4495,7 @@ var q = { return _.value.find((t) => t.id === e)?.name ?? `#${e}`; } function N(e) { - return e.is_running ? Ma(Ka(e.started_at, f.value)) : ft(e.duration_minutes); + return e.is_running ? La(Za(e.started_at, f.value)) : pt(e.duration_minutes); } function P() { x.value = null, y.value = !0; @@ -4440,15 +4512,15 @@ var q = { } async function R(e) { if (window.confirm(d("tasks_projects.time.delete_confirm"))) try { - await je(l.client, e.id), l.notify("success", d("tasks_projects.time.deleted")), m.value?.refresh(!0), V(), u("refresh"); + await Me(l.client, e.id), l.notify("success", d("tasks_projects.time.deleted")), m.value?.refresh(!0), V(), u("refresh"); } catch (e) { l.notify("error", H(e, d("tasks_projects.time.delete_failed"))); } } return (t, n) => { let l = S("BaseIcon"), u = S("BaseButton"), f = S("BaseFormatMoney"), h = S("BaseDropdownItem"), g = S("BaseDropdown"), _ = S("BaseTable"); - return v(), a("div", Bo, [ - o("div", Vo, [c(u, { + return v(), a("div", Ko, [ + o("div", qo, [c(u, { variant: "primary", onClick: P }, { @@ -4459,23 +4531,26 @@ var q = { default: D(() => [s(" " + C(w(d)("tasks_projects.project.time.add_entry")), 1)]), _: 1 })]), - o("div", Ho, [c(_, { + o("div", Jo, [c(_, { ref_key: "tableRef", ref: m, data: A, columns: O.value }, { - "cell-started_at": D(({ row: e }) => [s(C(e.data.started_at ? w(ut)(e.data.started_at) : "-"), 1)]), + "cell-started_at": D(({ row: e }) => [s(C(e.data.started_at ? w(dt)(e.data.started_at) : "-"), 1)]), "cell-user": D(({ row: e }) => [s(C(j(e.data.user_id)), 1)]), - "cell-task": D(({ row: e }) => [o("span", Uo, C(M(e.data.task_id)), 1), e.data.description ? (v(), a("span", Wo, C(e.data.description), 1)) : i("", !0)]), + "cell-task": D(({ row: e }) => [o("span", Yo, C(M(e.data.task_id)), 1), e.data.description ? (v(), a("span", Xo, C(e.data.description), 1)) : i("", !0)]), "cell-duration_minutes": D(({ row: e }) => [o("span", { class: p(["tabular-nums", e.data.is_running ? "font-medium text-primary-500" : ""]) }, C(N(e.data)), 3)]), "cell-billable": D(({ row: e }) => [e.data.billable ? (v(), r(l, { key: 0, name: "CheckCircleIcon", class: "h-5 w-5 text-status-green" - })) : (v(), a("span", Go, "-"))]), + })) : (v(), a("span", Zo, "-"))]), "cell-amount": D(({ row: e }) => [c(f, { amount: e.data.amount }, null, 8, ["amount"])]), - "cell-actions": D(({ row: e }) => [e.data.is_running ? (v(), a("span", Ko, C(w(d)("tasks_projects.project.time.running")), 1)) : (v(), r(g, { key: 1 }, { + "cell-actions": D(({ row: e }) => [e.data.is_running ? (v(), a("span", Qo, C(w(d)("tasks_projects.project.time.running")), 1)) : (v(), r(g, { + key: 1, + label: w(d)("tasks_projects.general.actions") + }, { activator: D(() => [c(l, { name: "EllipsisHorizontalIcon", class: "h-5 text-muted" @@ -4483,7 +4558,7 @@ var q = { default: D(() => [c(h, { onClick: (t) => F(e.data) }, { default: D(() => [c(l, { name: "PencilIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(d)("tasks_projects.general.edit")), 1)]), _: 1 }, 8, ["onClick"]), e.data.invoice_id === null ? (v(), r(h, { @@ -4492,15 +4567,15 @@ var q = { }, { default: D(() => [c(l, { name: "TrashIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(d)("tasks_projects.general.delete")), 1)]), _: 1 }, 8, ["onClick"])) : i("", !0)]), _: 2 - }, 1024))]), + }, 1032, ["label"]))]), _: 1 }, 8, ["columns"])]), - c(zo, { + c(Go, { show: y.value, client: e.client, notify: e.notify, @@ -4517,65 +4592,65 @@ var q = { ]); }; } -}), Xo = { +}), ns = { viewProject: `${U}:view-project`, editProject: `${U}:edit-project`, viewTask: `${U}:view-task`, viewOwnTime: `${U}:view-own-time` }; -function Zo(e) { - e.addMessages(rr), e.registerPage({ +function rs(e) { + e.addMessages(ir), e.registerPage({ id: "projects", module: U, path: "projects", - component: sn(e, Zr), + component: cn(e, ti), meta: { - ability: Xo.viewProject, + ability: ns.viewProject, title: "tasks_projects.projects.title" } }), e.registerPage({ id: "project", module: U, path: "projects/:id", - component: sn(e, zr), + component: cn(e, Ur), meta: { - ability: Xo.viewProject, + ability: ns.viewProject, title: "tasks_projects.projects.title" }, children: [ { id: "overview", path: "", - component: sn(e, Li), + component: cn(e, Vi), meta: { - ability: Xo.viewProject, + ability: ns.viewProject, title: "tasks_projects.project.tabs.overview" } }, { id: "tasks", path: "tasks", - component: sn(e, Oo), + component: cn(e, No), meta: { - ability: Xo.viewTask, + ability: ns.viewTask, title: "tasks_projects.project.tabs.tasks" } }, { id: "time", path: "time", - component: sn(e, Yo), + component: cn(e, ts), meta: { - ability: Xo.viewOwnTime, + ability: ns.viewOwnTime, title: "tasks_projects.project.tabs.time" } }, { id: "members", path: "members", - component: sn(e, li), + component: cn(e, pi), meta: { - ability: Xo.editProject, + ability: ns.editProject, title: "tasks_projects.project.tabs.members" } } @@ -4584,7 +4659,7 @@ function Zo(e) { } //#endregion //#region resources/js/messages/reports.ts -var Qo = { en: { tasks_projects: { reports: { +var is = { en: { tasks_projects: { reports: { title: "Reports", load_failed: "Unable to load the report.", empty_title: "Nothing logged in this range", @@ -4629,68 +4704,68 @@ var Qo = { en: { tasks_projects: { reports: { amount: "Amount", unbilled: "Unbilled" } -} } } }, $o = { summary: `${Rt}/reports/summary` }; -async function es(e, t) { - let { data: n } = await e.get($o.summary, { params: t }); - return ts(n?.data, t); +} } } }, as = { summary: `${zt}/reports/summary` }; +async function os(e, t) { + let { data: n } = await e.get(as.summary, { params: t }); + return ss(n?.data, t); } -function ts(e, t) { - let n = is(e) ? e : {}; +function ss(e, t) { + let n = us(e) ? e : {}; return { - from: ss(n.from, t.from ?? ""), - to: ss(n.to, t.to ?? ""), - totals: rs(n.totals).map(ns), - by_project: rs(n.by_project).map((e) => ({ - ...ns(e), - project_id: os(e.project_id), - label: ss(e.label, "") + from: ps(n.from, t.from ?? ""), + to: ps(n.to, t.to ?? ""), + totals: ls(n.totals).map(cs), + by_project: ls(n.by_project).map((e) => ({ + ...cs(e), + project_id: fs(e.project_id), + label: ps(e.label, "") })), - by_member: rs(n.by_member).map((e) => ({ - ...ns(e), - user_id: os(e.user_id), - label: ss(e.label, "") + by_member: ls(n.by_member).map((e) => ({ + ...cs(e), + user_id: fs(e.user_id), + label: ps(e.label, "") })), - by_customer: rs(n.by_customer).map((e) => ({ - ...ns(e), - customer_id: os(e.customer_id) + by_customer: ls(n.by_customer).map((e) => ({ + ...cs(e), + customer_id: fs(e.customer_id) })), - by_billable: rs(n.by_billable).map((e) => ({ - ...ns(e), + by_billable: ls(n.by_billable).map((e) => ({ + ...cs(e), billable: e.billable === !0 })) }; } -function ns(e) { +function cs(e) { return { - currency_id: os(e.currency_id), - minutes: as(e.minutes), - amount: as(e.amount), - billable_minutes: as(e.billable_minutes), - billable_amount: as(e.billable_amount), - unbilled_amount: as(e.unbilled_amount) + currency_id: fs(e.currency_id), + minutes: ds(e.minutes), + amount: ds(e.amount), + billable_minutes: ds(e.billable_minutes), + billable_amount: ds(e.billable_amount), + unbilled_amount: ds(e.unbilled_amount) }; } -function rs(e) { - return Array.isArray(e) ? e.filter(is) : []; +function ls(e) { + return Array.isArray(e) ? e.filter(us) : []; } -function is(e) { +function us(e) { return typeof e == "object" && !!e; } -function as(e) { +function ds(e) { return typeof e == "number" && Number.isFinite(e) ? e : 0; } -function os(e) { +function fs(e) { return typeof e == "number" && Number.isFinite(e) ? e : null; } -function ss(e, t) { +function ps(e, t) { return typeof e == "string" && e.trim() !== "" ? e : t; } //#endregion //#region resources/js/components/ReportBreakdownTable.vue?vue&type=script&setup=true&lang.ts -var cs = { class: "mt-6" }, ls = { class: "text-sm font-semibold tracking-wider text-muted uppercase" }, us = { class: "relative table-container" }, ds = { +var ms = { class: "mt-6" }, hs = { class: "text-sm font-semibold tracking-wider text-muted uppercase" }, gs = { class: "relative table-container" }, _s = { key: 0, class: "text-subtle" -}, fs = { key: 1 }, ps = /* @__PURE__ */ l({ +}, vs = { key: 1 }, ys = /* @__PURE__ */ l({ __name: "ReportBreakdownTable", props: { title: {}, @@ -4733,62 +4808,62 @@ var cs = { class: "mt-6" }, ls = { class: "text-sm font-semibold tracking-wider ]), u = n(() => t.showCurrency ? "currency" : "plain"); return (t, n) => { let i = S("BaseFormatMoney"), d = S("BaseTable"); - return v(), a("section", cs, [o("h3", ls, C(e.title), 1), o("div", us, [(v(), r(d, { + return v(), a("section", ms, [o("h3", hs, C(e.title), 1), o("div", gs, [(v(), r(d, { key: u.value, data: e.rows, columns: l.value, class: "mt-2" }, { - "cell-currency_id": D(({ row: e }) => [e.data.currency_id === null ? (v(), a("span", ds, "-")) : (v(), a("span", fs, "#" + C(e.data.currency_id), 1))]), - "cell-minutes": D(({ row: e }) => [s(C(w(Na)(e.data.minutes)), 1)]), - "cell-billable_minutes": D(({ row: e }) => [s(C(w(Na)(e.data.billable_minutes)), 1)]), + "cell-currency_id": D(({ row: e }) => [e.data.currency_id === null ? (v(), a("span", _s, "-")) : (v(), a("span", vs, "#" + C(e.data.currency_id), 1))]), + "cell-minutes": D(({ row: e }) => [s(C(w(Ra)(e.data.minutes)), 1)]), + "cell-billable_minutes": D(({ row: e }) => [s(C(w(Ra)(e.data.billable_minutes)), 1)]), "cell-amount": D(({ row: e }) => [c(i, { amount: e.data.amount }, null, 8, ["amount"])]), "cell-unbilled_amount": D(({ row: e }) => [c(i, { amount: e.data.unbilled_amount }, null, 8, ["amount"])]), _: 1 }, 8, ["data", "columns"]))])]); }; } -}), ms = 3; -function hs(e, t, n = /* @__PURE__ */ new Date()) { +}), bs = 3; +function xs(e, t, n = /* @__PURE__ */ new Date()) { let r = n.getFullYear(), i = n.getMonth(); switch (e) { case "THIS_WEEK": { - let e = Ba(n, t); - return _s(e, Ha(e, 6)); + let e = Ga(n, t); + return Cs(e, qa(e, 6)); } - case "LAST_MONTH": return _s(new Date(r, i - 1, 1), new Date(r, i, 0)); + case "LAST_MONTH": return Cs(new Date(r, i - 1, 1), new Date(r, i, 0)); case "THIS_QUARTER": { - let e = Math.floor(i / ms) * ms; - return _s(new Date(r, e, 1), new Date(r, e + ms, 0)); + let e = Math.floor(i / bs) * bs; + return Cs(new Date(r, e, 1), new Date(r, e + bs, 0)); } - case "THIS_YEAR": return _s(new Date(r, 0, 1), new Date(r, 12, 0)); - default: return _s(new Date(r, i, 1), new Date(r, i + 1, 0)); + case "THIS_YEAR": return Cs(new Date(r, 0, 1), new Date(r, 12, 0)); + default: return Cs(new Date(r, i, 1), new Date(r, i + 1, 0)); } } -function gs(e, t) { +function Ss(e, t) { return t <= 0 ? 0 : Math.min(100, Math.max(0, Math.round(e / t * 100))); } -function _s(e, t) { +function Cs(e, t) { return { - from: Ua(e), - to: Ua(t) + from: Ja(e), + to: Ja(t) }; } //#endregion //#region resources/js/pages/ReportsPage.vue?vue&type=script&setup=true&lang.ts -var vs = { +var ws = { key: 0, class: "mt-2 text-sm text-muted" -}, ys = { class: "flex items-center justify-end space-x-5" }, bs = { class: "mt-4 flex flex-wrap gap-2" }, xs = ["onClick"], Ss = { +}, Ts = { class: "flex items-center justify-end space-x-5" }, Es = { class: "mt-4 flex flex-wrap gap-2" }, Ds = ["onClick"], Os = { key: 0, class: "flex justify-center py-16" -}, Cs = { +}, ks = { key: 0, class: "text-xs font-medium tracking-wider text-muted uppercase" -}, ws = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ts = { class: "mt-1 text-2xl font-semibold text-heading" }, Es = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ds = { class: "mt-1 text-2xl font-semibold text-heading" }, Os = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, ks = { class: "mt-1 text-2xl font-semibold text-heading" }, As = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, js = { class: "mt-1 text-2xl font-semibold text-heading" }, Ms = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, Ns = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ps = { class: "mt-3 flex h-2 w-full overflow-hidden rounded-full bg-surface-tertiary" }, Fs = { class: "mt-3 flex flex-wrap gap-6 text-sm" }, Is = { class: "inline-flex items-center text-body" }, Ls = { class: "ml-1 font-medium text-heading" }, Rs = { class: "ml-1 text-muted" }, zs = { class: "inline-flex items-center text-body" }, Bs = { class: "ml-1 font-medium text-heading" }, Vs = { class: "ml-1 text-muted" }, Hs = { +}, As = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, js = { class: "mt-1 text-2xl font-semibold text-heading" }, Ms = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ns = { class: "mt-1 text-2xl font-semibold text-heading" }, Ps = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Fs = { class: "mt-1 text-2xl font-semibold text-heading" }, Is = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ls = { class: "mt-1 text-2xl font-semibold text-heading" }, Rs = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, zs = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Bs = { class: "mt-3 flex h-2 w-full overflow-hidden rounded-full bg-surface-tertiary" }, Vs = { class: "mt-3 flex flex-wrap gap-6 text-sm" }, Hs = { class: "inline-flex items-center text-body" }, Us = { class: "ms-1 font-medium text-heading" }, Ws = { class: "ms-1 text-muted" }, Gs = { class: "inline-flex items-center text-body" }, Ks = { class: "ms-1 font-medium text-heading" }, qs = { class: "ms-1 text-muted" }, Js = { key: 1, class: "mt-2 text-sm text-subtle" -}, Us = "THIS_MONTH", Ws = /* @__PURE__ */ l({ +}, Ys = "THIS_MONTH", Xs = /* @__PURE__ */ l({ __name: "ReportsPage", props: { client: { type: [Function, Object] }, @@ -4796,7 +4871,7 @@ var vs = { router: {} }, setup(t) { - let l = t, u = B(), d = b(null), f = b([]), h = b(!0), _ = b(Us), y = b(""), T = b(""), E = n(() => [ + let l = t, u = B(), d = b(null), f = b([]), h = b(!0), _ = b(Ys), y = b(""), T = b(""), E = n(() => [ { id: "THIS_WEEK", label: u("tasks_projects.reports.range.this_week") @@ -4832,29 +4907,29 @@ var vs = { }))), N = n(() => (d.value?.by_customer ?? []).map((e) => ({ ...e, id: `${e.customer_id ?? "none"}-${e.currency_id ?? "base"}`, - label: e.customer_id === null ? u("tasks_projects.reports.tables.no_customer") : $t(e.customer_id) - }))), P = n(() => ae(!0)), F = n(() => ae(!1)), I = n(() => P.value + F.value), L = n(() => gs(P.value, I.value)); + label: e.customer_id === null ? u("tasks_projects.reports.tables.no_customer") : en(e.customer_id) + }))), P = n(() => ae(!0)), F = n(() => ae(!1)), I = n(() => P.value + F.value), L = n(() => Ss(P.value, I.value)); g(() => { - R(Us), re(); + R(Ys), re(); }); function R(e) { if (_.value = e, e !== "CUSTOM") { - let t = hs(e, G.settings.week_start); + let t = xs(e, G.settings.week_start); y.value = t.from, T.value = t.to; } te(); } function z(e) { - y.value = e ? dt(e) : "", _.value = "CUSTOM", te(); + y.value = e ? ft(e) : "", _.value = "CUSTOM", te(); } function ee(e) { - T.value = e ? dt(e) : "", _.value = "CUSTOM", te(); + T.value = e ? ft(e) : "", _.value = "CUSTOM", te(); } async function te() { h.value = !0; try { - let e = await es(l.client, ne()); - d.value = e, e.by_customer.some((e) => e.customer_id !== null) && en(l.client); + let e = await os(l.client, ne()); + d.value = e, e.by_customer.some((e) => e.customer_id !== null) && tn(l.client); } catch (e) { d.value = null, l.notify("error", H(e, u("tasks_projects.reports.load_failed"))); } finally { @@ -4867,7 +4942,7 @@ var vs = { } async function re() { try { - f.value = await Jt(l.client); + f.value = await Yt(l.client); } catch {} } function ie(e) { @@ -4884,14 +4959,14 @@ var vs = { return _.value === e.id ? "border-primary-500 bg-primary-50 text-primary-500" : "border-line-default bg-surface text-muted hover:text-heading"; } function ce() { - R(Us); + R(Ys); } return (t, n) => { let l = S("BaseBreadcrumbItem"), f = S("BaseBreadcrumb"), g = S("BaseIcon"), _ = S("BaseButton"), b = S("router-link"), B = S("BasePageHeader"), te = S("BaseDatePicker"), ne = S("BaseInputGroup"), re = S("BaseFilterWrapper"), ie = S("BaseSpinner"), ae = S("BaseEmptyPlaceholder"), le = S("BaseFormatMoney"), ue = S("BasePage"); return v(), r(ue, null, { default: D(() => [ c(B, { title: w(u)("tasks_projects.reports.title") }, { - actions: D(() => [o("div", ys, [ + actions: D(() => [o("div", Ts, [ c(b, { to: w(W).tasks }, { default: D(() => [c(_, { variant: "white" }, { left: D((e) => [c(g, { @@ -4943,15 +5018,15 @@ var vs = { }, null, 8, ["title"]) ]), _: 1 - }), d.value ? (v(), a("p", vs, C(w(ut)(d.value.from)) + " – " + C(w(ut)(d.value.to)), 1)) : i("", !0)]), + }), d.value ? (v(), a("p", ws, C(w(dt)(d.value.from)) + " – " + C(w(dt)(d.value.to)), 1)) : i("", !0)]), _: 1 }, 8, ["title"]), - o("div", bs, [(v(!0), a(e, null, x(E.value, (e) => (v(), a("button", { + o("div", Es, [(v(!0), a(e, null, x(E.value, (e) => (v(), a("button", { key: e.id, type: "button", class: p(["rounded-md border px-3 py-1.5 text-sm font-medium", se(e)]), onClick: (t) => R(e.id) - }, C(e.label), 11, xs))), 128))]), + }, C(e.label), 11, Ds))), 128))]), c(re, { show: !0, "row-on-xl": "", @@ -4979,31 +5054,31 @@ var vs = { }, 8, ["label"])]), _: 1 }), - h.value && d.value === null ? (v(), a("div", Ss, [c(ie, { class: "h-8 w-8 text-primary-500" })])) : A.value ? (v(), a(e, { key: 2 }, [ + h.value && d.value === null ? (v(), a("div", Os, [c(ie, { class: "h-8 w-8 text-primary-500" })])) : A.value ? (v(), a(e, { key: 2 }, [ (v(!0), a(e, null, x(O.value, (e) => (v(), a("div", { key: e.currency_id ?? "base", class: "mt-4 rounded-xl border border-line-default bg-surface p-5" - }, [k.value ? (v(), a("p", Cs, C(oe(e.currency_id)), 1)) : i("", !0), o("div", { class: p(["grid grid-cols-2 gap-4 sm:grid-cols-4", k.value ? "mt-3" : ""]) }, [ - o("div", null, [o("p", ws, C(w(u)("tasks_projects.reports.summary.logged")), 1), o("p", Ts, C(w(Na)(e.minutes)), 1)]), - o("div", null, [o("p", Es, C(w(u)("tasks_projects.reports.summary.billable")), 1), o("p", Ds, C(w(Na)(e.billable_minutes)), 1)]), - o("div", null, [o("p", Os, C(w(u)("tasks_projects.reports.summary.amount")), 1), o("p", ks, [c(le, { amount: e.amount }, null, 8, ["amount"])])]), - o("div", null, [o("p", As, C(w(u)("tasks_projects.reports.summary.unbilled")), 1), o("p", js, [c(le, { amount: e.unbilled_amount }, null, 8, ["amount"])])]) + }, [k.value ? (v(), a("p", ks, C(oe(e.currency_id)), 1)) : i("", !0), o("div", { class: p(["grid grid-cols-2 gap-4 sm:grid-cols-4", k.value ? "mt-3" : ""]) }, [ + o("div", null, [o("p", As, C(w(u)("tasks_projects.reports.summary.logged")), 1), o("p", js, C(w(Ra)(e.minutes)), 1)]), + o("div", null, [o("p", Ms, C(w(u)("tasks_projects.reports.summary.billable")), 1), o("p", Ns, C(w(Ra)(e.billable_minutes)), 1)]), + o("div", null, [o("p", Ps, C(w(u)("tasks_projects.reports.summary.amount")), 1), o("p", Fs, [c(le, { amount: e.amount }, null, 8, ["amount"])])]), + o("div", null, [o("p", Is, C(w(u)("tasks_projects.reports.summary.unbilled")), 1), o("p", Ls, [c(le, { amount: e.unbilled_amount }, null, 8, ["amount"])])]) ], 2)]))), 128)), - o("section", Ms, [o("p", Ns, C(w(u)("tasks_projects.reports.split.title")), 1), I.value > 0 ? (v(), a(e, { key: 0 }, [o("div", Ps, [o("div", { + o("section", Rs, [o("p", zs, C(w(u)("tasks_projects.reports.split.title")), 1), I.value > 0 ? (v(), a(e, { key: 0 }, [o("div", Bs, [o("div", { class: "h-2 bg-primary-500", style: m({ width: `${L.value}%` }) - }, null, 4)]), o("div", Fs, [o("span", Is, [ - n[0] ||= o("span", { class: "mr-2 inline-block h-2.5 w-2.5 rounded-full bg-primary-500" }, null, -1), + }, null, 4)]), o("div", Vs, [o("span", Hs, [ + n[0] ||= o("span", { class: "me-2 inline-block h-2.5 w-2.5 rounded-full bg-primary-500" }, null, -1), s(" " + C(w(u)("tasks_projects.reports.split.billable")) + ": ", 1), - o("span", Ls, C(w(Na)(P.value)), 1), - o("span", Rs, "(" + C(L.value) + "%)", 1) - ]), o("span", zs, [ - n[1] ||= o("span", { class: "mr-2 inline-block h-2.5 w-2.5 rounded-full bg-surface-tertiary" }, null, -1), + o("span", Us, C(w(Ra)(P.value)), 1), + o("span", Ws, "(" + C(L.value) + "%)", 1) + ]), o("span", Gs, [ + n[1] ||= o("span", { class: "me-2 inline-block h-2.5 w-2.5 rounded-full bg-surface-tertiary" }, null, -1), s(" " + C(w(u)("tasks_projects.reports.split.non_billable")) + ": ", 1), - o("span", Bs, C(w(Na)(F.value)), 1), - o("span", Vs, "(" + C(100 - L.value) + "%)", 1) - ])])], 64)) : (v(), a("p", Hs, C(w(u)("tasks_projects.reports.split.nothing")), 1))]), - c(ps, { + o("span", Ks, C(w(Ra)(F.value)), 1), + o("span", qs, "(" + C(100 - L.value) + "%)", 1) + ])])], 64)) : (v(), a("p", Js, C(w(u)("tasks_projects.reports.split.nothing")), 1))]), + c(ys, { title: w(u)("tasks_projects.reports.tables.by_project"), "label-heading": w(u)("tasks_projects.reports.tables.project"), rows: j.value, @@ -5014,7 +5089,7 @@ var vs = { "rows", "show-currency" ]), - c(ps, { + c(ys, { title: w(u)("tasks_projects.reports.tables.by_member"), "label-heading": w(u)("tasks_projects.reports.tables.member"), rows: M.value, @@ -5025,7 +5100,7 @@ var vs = { "rows", "show-currency" ]), - c(ps, { + c(ys, { title: w(u)("tasks_projects.reports.tables.by_customer"), "label-heading": w(u)("tasks_projects.reports.tables.customer"), rows: N.value, @@ -5052,24 +5127,24 @@ var vs = { }); }; } -}), Gs = "tasks-projects"; -function Ks(e) { - e.addMessages(Qo), e.registerPage({ +}), Zs = "tasks-projects"; +function Qs(e) { + e.addMessages(is), e.registerPage({ id: "reports", - module: Gs, + module: Zs, path: "reports", - component: sn(e, Ws), + component: cn(e, Xs), meta: { - ability: `${Gs}:view-own-time`, + ability: `${Zs}:view-own-time`, title: "tasks_projects.reports.title" } }), e.on("company:changing", () => { - tn(); + nn(); }); } //#endregion //#region resources/js/messages/tasks.ts -var qs = { en: { tasks_projects: { +var $s = { en: { tasks_projects: { board: { title: "Board", load_failed: "Unable to load the board.", @@ -5101,6 +5176,7 @@ var qs = { en: { tasks_projects: { nothing_to_invoice: "No unbilled billable time on this task.", locked: "This task is on an invoice and cannot be changed.", views: { + title: "View", list: "List", board: "Board", week: "Week" @@ -5219,19 +5295,19 @@ var qs = { en: { tasks_projects: { load_failed: "Unable to load the task statuses.", none: "No board columns yet." } -} } }, Js = { class: "mt-6 rounded-xl border border-line-default bg-surface" }, Ys = { class: "flex items-center justify-between border-b border-line-light px-5 py-3" }, Xs = { class: "text-sm font-semibold text-heading" }, Zs = ["title"], Qs = { class: "overflow-x-auto" }, $s = { class: "min-w-full text-sm" }, ec = { class: "bg-surface-secondary text-xs tracking-wide text-muted uppercase" }, tc = { class: "px-4 py-2 text-left font-medium" }, nc = { class: "px-4 py-2 text-left font-medium" }, rc = { class: "px-4 py-2 text-left font-medium" }, ic = { class: "px-4 py-2 text-left font-medium" }, ac = { class: "px-4 py-2 text-left font-medium" }, oc = { class: "px-4 py-2 text-left font-medium" }, sc = { class: "px-4 py-2 text-left font-medium" }, cc = { class: "px-4 py-2 text-left font-medium" }, lc = { class: "px-4 py-2 text-right font-medium" }, uc = ["onClick"], dc = { class: "px-4 py-2.5 whitespace-nowrap" }, fc = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, pc = { class: "px-4 py-2.5 whitespace-nowrap" }, mc = { +} } }, ec = { class: "mt-6 rounded-xl border border-line-default bg-surface" }, tc = { class: "flex items-center justify-between border-b border-line-light px-5 py-3" }, nc = { class: "text-sm font-semibold text-heading" }, rc = ["title"], ic = { class: "overflow-x-auto" }, ac = { class: "min-w-full text-sm" }, oc = { class: "bg-surface-secondary text-xs tracking-wide text-muted uppercase" }, sc = { class: "px-4 py-2 text-start font-medium" }, cc = { class: "px-4 py-2 text-start font-medium" }, lc = { class: "px-4 py-2 text-start font-medium" }, uc = { class: "px-4 py-2 text-start font-medium" }, dc = { class: "px-4 py-2 text-start font-medium" }, fc = { class: "px-4 py-2 text-start font-medium" }, pc = { class: "px-4 py-2 text-start font-medium" }, mc = { class: "px-4 py-2 text-start font-medium" }, hc = { class: "px-4 py-2 text-end font-medium" }, gc = ["onClick"], _c = { class: "px-4 py-2.5 whitespace-nowrap" }, vc = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, yc = { class: "px-4 py-2.5 whitespace-nowrap" }, bc = { key: 0, class: "text-primary-500" -}, hc = { key: 1 }, gc = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, _c = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, vc = { class: "max-w-64 truncate px-4 py-2.5" }, yc = { class: "px-4 py-2.5" }, bc = { +}, xc = { key: 1 }, Sc = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, Cc = { class: "px-4 py-2.5 whitespace-nowrap tabular-nums" }, wc = { class: "max-w-64 truncate px-4 py-2.5" }, Tc = { class: "px-4 py-2.5" }, Ec = { key: 1, class: "text-subtle" -}, xc = { class: "px-4 py-2.5 whitespace-nowrap" }, Sc = ["title"], Cc = { +}, Dc = { class: "px-4 py-2.5 whitespace-nowrap" }, Oc = ["title"], kc = { key: 3, class: "text-xs text-primary-500" -}, wc = { key: 0 }, Tc = { +}, Ac = { key: 0 }, jc = { colspan: "9", class: "px-4 py-8 text-center text-sm text-subtle" -}, Ec = /* @__PURE__ */ l({ +}, Mc = /* @__PURE__ */ l({ __name: "TimeLogGrid", props: { client: {}, @@ -5240,7 +5316,7 @@ var qs = { en: { tasks_projects: { members: { default: () => [] } }, setup(t) { - let l = t, u = B(), d = ro(), f = b([]), m = b(!1), h = b(!1), g = b(null), _ = n(() => ({ + let l = t, u = B(), d = co(), f = b([]), m = b(!1), h = b(!1), g = b(null), _ = n(() => ({ id: l.task.id, name: l.task.name, number: l.task.number, @@ -5256,11 +5332,11 @@ var qs = { en: { tasks_projects: { function k() { q.stopWithPrompt(l.client, T.value, { taskId: l.task.id }); } - E(() => l.task.id, () => void j(), { immediate: !0 }), E(et, () => void j()); + E(() => l.task.id, () => void j(), { immediate: !0 }), E(tt, () => void j()); async function j() { m.value = !0; try { - f.value = await mr(l.client, l.task.id); + f.value = await hr(l.client, l.task.id); } catch (e) { f.value = [], l.notify("error", H(e, u("tasks_projects.tasks.time_log.load_failed"))); } finally { @@ -5274,7 +5350,7 @@ var qs = { en: { tasks_projects: { return l.members.find((t) => t.id === e)?.name ?? `#${e}`; } function P(e) { - return e.is_running ? Ma(Ka(e.started_at, d.value)) : Na(e.duration_minutes); + return e.is_running ? La(Za(e.started_at, d.value)) : Ra(e.duration_minutes); } function F() { y.value || (g.value = null, h.value = !0); @@ -5295,17 +5371,17 @@ var qs = { en: { tasks_projects: { return; } if (window.confirm(u("tasks_projects.time.delete_confirm"))) try { - await je(l.client, e.id), l.notify("success", u("tasks_projects.time.deleted")), V(); + await Me(l.client, e.id), l.notify("success", u("tasks_projects.time.deleted")), V(); } catch (e) { l.notify("error", H(e, u("tasks_projects.time.delete_failed"))); } } return (n, l) => { let d = S("BaseSpinner"), b = S("BaseIcon"), T = S("BaseButton"), E = S("BaseDropdownItem"), j = S("BaseDropdown"); - return v(), a("section", Js, [ - o("header", Ys, [o("h2", Xs, [s(C(w(u)("tasks_projects.tasks.time_log.title")) + " ", 1), m.value ? (v(), r(d, { + return v(), a("section", ec, [ + o("header", tc, [o("h2", nc, [s(C(w(u)("tasks_projects.tasks.time_log.title")) + " ", 1), m.value ? (v(), r(d, { key: 0, - class: "ml-2 inline-block h-4 w-4 text-primary-500" + class: "ms-2 inline-block h-4 w-4 text-primary-500" })) : i("", !0)]), o("span", { title: y.value ? w(u)("tasks_projects.tasks.time_log.add_disabled") : void 0 }, [c(T, { variant: "primary-outline", size: "sm", @@ -5318,42 +5394,42 @@ var qs = { en: { tasks_projects: { }, null, 8, ["class"])]), default: D(() => [s(" " + C(w(u)("tasks_projects.tasks.time_log.add_item")), 1)]), _: 1 - }, 8, ["disabled"])], 8, Zs)]), - o("div", Qs, [o("table", $s, [o("thead", ec, [o("tr", null, [ - o("th", tc, C(w(u)("tasks_projects.tasks.time_log.columns.start_date")), 1), - o("th", nc, C(w(u)("tasks_projects.tasks.time_log.columns.start_time")), 1), - o("th", rc, C(w(u)("tasks_projects.tasks.time_log.columns.end_date")), 1), - o("th", ic, C(w(u)("tasks_projects.tasks.time_log.columns.end_time")), 1), - o("th", ac, C(w(u)("tasks_projects.tasks.time_log.columns.duration")), 1), - o("th", oc, C(w(u)("tasks_projects.tasks.time_log.columns.description")), 1), - o("th", sc, C(w(u)("tasks_projects.tasks.time_log.columns.billable")), 1), - o("th", cc, C(w(u)("tasks_projects.tasks.time_log.columns.member")), 1), - o("th", lc, C(w(u)("tasks_projects.general.actions")), 1) + }, 8, ["disabled"])], 8, rc)]), + o("div", ic, [o("table", ac, [o("thead", oc, [o("tr", null, [ + o("th", sc, C(w(u)("tasks_projects.tasks.time_log.columns.start_date")), 1), + o("th", cc, C(w(u)("tasks_projects.tasks.time_log.columns.start_time")), 1), + o("th", lc, C(w(u)("tasks_projects.tasks.time_log.columns.end_date")), 1), + o("th", uc, C(w(u)("tasks_projects.tasks.time_log.columns.end_time")), 1), + o("th", dc, C(w(u)("tasks_projects.tasks.time_log.columns.duration")), 1), + o("th", fc, C(w(u)("tasks_projects.tasks.time_log.columns.description")), 1), + o("th", pc, C(w(u)("tasks_projects.tasks.time_log.columns.billable")), 1), + o("th", mc, C(w(u)("tasks_projects.tasks.time_log.columns.member")), 1), + o("th", hc, C(w(u)("tasks_projects.general.actions")), 1) ])]), o("tbody", null, [(v(!0), a(e, null, x(f.value, (e) => (v(), a("tr", { key: e.id, class: p(["border-t border-line-light", e.is_running ? "bg-primary-50" : "cursor-pointer hover:bg-hover"]), onClick: (t) => I(e) }, [ - o("td", dc, C(w(ut)(w(Ia)(e.started_at)) || "-"), 1), - o("td", fc, C(w(La)(e.started_at) || "-"), 1), - o("td", pc, [e.is_running ? (v(), a("span", mc, C(w(u)("tasks_projects.tasks.time_log.running")), 1)) : (v(), a("span", hc, C(w(ut)(w(Ia)(e.ended_at)) || "-"), 1))]), - o("td", gc, C(e.is_running ? "-" : w(La)(e.ended_at) || "-"), 1), - o("td", _c, [o("span", { class: p(e.is_running ? "font-medium text-primary-500" : "") }, C(P(e)), 3)]), - o("td", vc, C(e.description || "-"), 1), - o("td", yc, [e.billable ? (v(), r(b, { + o("td", _c, C(w(dt)(w(Va)(e.started_at)) || "-"), 1), + o("td", vc, C(w(Ha)(e.started_at) || "-"), 1), + o("td", yc, [e.is_running ? (v(), a("span", bc, C(w(u)("tasks_projects.tasks.time_log.running")), 1)) : (v(), a("span", xc, C(w(dt)(w(Va)(e.ended_at)) || "-"), 1))]), + o("td", Sc, C(e.is_running ? "-" : w(Ha)(e.ended_at) || "-"), 1), + o("td", Cc, [o("span", { class: p(e.is_running ? "font-medium text-primary-500" : "") }, C(P(e)), 3)]), + o("td", wc, C(e.description || "-"), 1), + o("td", Tc, [e.billable ? (v(), r(b, { key: 0, name: "CheckCircleIcon", class: "h-5 w-5 text-status-green" - })) : (v(), a("span", bc, "-"))]), - o("td", xc, C(N(e.user_id)), 1), + })) : (v(), a("span", Ec, "-"))]), + o("td", Dc, C(N(e.user_id)), 1), o("td", { - class: "px-4 py-2.5 text-right whitespace-nowrap", + class: "px-4 py-2.5 text-end whitespace-nowrap", onClick: l[0] ||= A(() => {}, ["stop"]) }, [M(e) ? (v(), a("span", { key: 0, class: "text-xs text-muted", title: w(u)("tasks_projects.tasks.time_log.stamped_delete") - }, C(w(u)("tasks_projects.tasks.time_log.stamped")), 9, Sc)) : e.is_running ? O(e) ? (v(), r(T, { + }, C(w(u)("tasks_projects.tasks.time_log.stamped")), 9, Oc)) : e.is_running ? O(e) ? (v(), r(T, { key: 2, variant: "white", size: "sm", @@ -5366,7 +5442,10 @@ var qs = { en: { tasks_projects: { }, null, 8, ["class"])]), default: D(() => [s(" " + C(w(u)("tasks_projects.timer.stop")), 1)]), _: 1 - }, 8, ["disabled"])) : (v(), a("span", Cc, C(w(u)("tasks_projects.tasks.time_log.running")), 1)) : (v(), r(j, { key: 1 }, { + }, 8, ["disabled"])) : (v(), a("span", kc, C(w(u)("tasks_projects.tasks.time_log.running")), 1)) : (v(), r(j, { + key: 1, + label: w(u)("tasks_projects.general.actions") + }, { activator: D(() => [c(b, { name: "EllipsisHorizontalIcon", class: "h-5 text-muted" @@ -5374,20 +5453,20 @@ var qs = { en: { tasks_projects: { default: D(() => [c(E, { onClick: (t) => I(e) }, { default: D(() => [c(b, { name: "PencilIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(u)("tasks_projects.general.edit")), 1)]), _: 1 }, 8, ["onClick"]), c(E, { onClick: (t) => z(e) }, { default: D(() => [c(b, { name: "TrashIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(u)("tasks_projects.general.delete")), 1)]), _: 1 }, 8, ["onClick"])]), _: 2 - }, 1024))]) - ], 10, uc))), 128)), f.value.length === 0 && !m.value ? (v(), a("tr", wc, [o("td", Tc, C(w(u)("tasks_projects.tasks.time_log.empty")), 1)])) : i("", !0)])])]), - c(zo, { + }, 1032, ["label"]))]) + ], 10, gc))), 128)), f.value.length === 0 && !m.value ? (v(), a("tr", Ac, [o("td", jc, C(w(u)("tasks_projects.tasks.time_log.empty")), 1)])) : i("", !0)])])]), + c(Go, { show: h.value, client: t.client, notify: t.notify, @@ -5407,25 +5486,28 @@ var qs = { en: { tasks_projects: { ]); }; } -}), Dc = { +}), Nc = { key: 0, class: "mt-2 flex flex-wrap items-center gap-3 text-sm text-muted" -}, Oc = { class: "rounded-sm bg-surface-tertiary px-2 py-0.5 text-body" }, kc = { +}, Pc = { class: "rounded-sm bg-surface-tertiary px-2 py-0.5 text-body" }, Fc = { key: 1, class: "text-subtle" -}, Ac = { +}, Ic = { key: 0, class: "flex flex-wrap items-center justify-end gap-3" -}, jc = ["title"], Mc = { +}, Lc = ["title"], Rc = { key: 0, class: "flex justify-center py-16" -}, Nc = { class: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4" }, Pc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Fc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Ic = { class: "mt-2" }, Lc = { class: "mt-2 text-xs text-muted" }, Rc = { class: "text-body" }, zc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Bc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Vc = { class: "mt-2 text-2xl font-semibold text-heading" }, Hc = { class: "mt-1 text-xs text-muted" }, Uc = { class: "text-body" }, Wc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Gc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Kc = { class: "mt-2 text-2xl font-semibold text-heading" }, qc = { class: "mt-1 text-xs text-muted" }, Jc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Yc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Xc = { class: "mt-2 text-lg font-semibold text-heading" }, Zc = { class: "mt-1 text-xs text-muted" }, Qc = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, $c = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, el = { +}, zc = { class: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4" }, Bc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Vc = { + id: "task-status-label", + class: "text-xs font-medium tracking-wider text-muted uppercase" +}, Hc = { class: "mt-2" }, Uc = { class: "mt-2 text-xs text-muted" }, Wc = { class: "text-body" }, Gc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Kc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, qc = { class: "mt-2 text-2xl font-semibold text-heading" }, Jc = { class: "mt-1 text-xs text-muted" }, Yc = { class: "text-body" }, Xc = { class: "rounded-xl border border-line-default bg-surface p-5" }, Zc = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, Qc = { class: "mt-2 text-2xl font-semibold text-heading" }, $c = { class: "mt-1 text-xs text-muted" }, el = { class: "rounded-xl border border-line-default bg-surface p-5" }, tl = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, nl = { class: "mt-2 text-lg font-semibold text-heading" }, rl = { class: "mt-1 text-xs text-muted" }, il = { class: "mt-4 rounded-xl border border-line-default bg-surface p-5" }, al = { class: "text-xs font-medium tracking-wider text-muted uppercase" }, ol = { key: 0, class: "mt-2 text-sm whitespace-pre-line text-body" -}, tl = { +}, sl = { key: 1, class: "mt-2 text-sm text-subtle" -}, nl = 100, rl = /* @__PURE__ */ l({ +}, cl = 100, ll = /* @__PURE__ */ l({ __name: "TaskPage", props: { id: {}, @@ -5439,7 +5521,7 @@ var qs = { en: { tasks_projects: { NORMAL: "bg-primary-50 text-primary-500", HIGH: "bg-alert-warning-bg text-alert-warning-text", URGENT: "bg-alert-error-bg text-alert-error-text" - }, d = B(), f = l.router, m = b(null), h = b([]), _ = b([]), y = b([]), x = b(!0), T = b(!1), O = b(!1), k = b(!1), A = n(() => Number(l.id)), j = n(() => nt(m.value)), N = n(() => m.value?.name ?? d("tasks_projects.tasks.title")), P = n(() => h.value.map((e) => ({ + }, d = B(), f = l.router, m = b(null), h = b([]), _ = b([]), y = b([]), x = b(!0), T = b(!1), O = b(!1), k = b(!1), A = n(() => Number(l.id)), j = n(() => rt(m.value)), N = n(() => m.value?.name ?? d("tasks_projects.tasks.title")), P = n(() => h.value.map((e) => ({ id: e.id, label: e.name }))), F = n(() => y.value.map((e) => ({ @@ -5454,15 +5536,15 @@ var qs = { en: { tasks_projects: { e !== null && se(e); } }), z = n(() => M.busy), ee = n(() => j.value.invoiced === "uninvoiced"), te = n(() => j.value.invoiced === "invoiced" ? d("tasks_projects.tasks.already_invoiced") : d("tasks_projects.tasks.nothing_to_invoice")), ne = n(() => m.value?.priority ? d(`tasks_projects.tasks.priority.${m.value.priority.toLowerCase()}`) : null); - E(A, () => void re()), E(et, () => void re(!0)), g(() => { + E(A, () => void re()), E(tt, () => void re(!0)), g(() => { re(), ie(); }); async function re(e = !1) { if (!(!Number.isInteger(A.value) || A.value <= 0)) { x.value = !e; try { - let e = await dr(l.client, A.value); - m.value = e, Qe(e), e.customer_id !== null && en(l.client); + let e = await fr(l.client, A.value); + m.value = e, $e(e), e.customer_id !== null && tn(l.client); } catch (t) { e || l.notify("error", H(t, d("tasks_projects.tasks.detail.not_found"))); } finally { @@ -5472,18 +5554,18 @@ var qs = { en: { tasks_projects: { } async function ie() { try { - h.value = await or(l.client); + h.value = await sr(l.client); } catch (e) { l.notify("error", H(e, d("tasks_projects.task_statuses.load_failed"))); } try { - _.value = await Jt(l.client); + _.value = await Yt(l.client); } catch { _.value = []; } try { - let e = await Ht(l.client, { - limit: nl, + let e = await Ut(l.client, { + limit: cl, status: "ACTIVE", sort_by: "name" }); @@ -5509,7 +5591,7 @@ var qs = { en: { tasks_projects: { }; } function oe(e, t) { - return gt(e) === "task_locked" ? d("tasks_projects.tasks.locked") : H(e, d(t)); + return _t(e) === "task_locked" ? d("tasks_projects.tasks.locked") : H(e, d(t)); } async function se(e) { let t = m.value; @@ -5517,7 +5599,7 @@ var qs = { en: { tasks_projects: { let n = t.task_status_id; t.task_status_id = e.id, T.value = !0; try { - m.value = await lr(l.client, t.id, ae(t, { task_status_id: e.id })), l.notify("success", d("tasks_projects.tasks.detail.status_saved", { name: e.label })), V(); + m.value = await ur(l.client, t.id, ae(t, { task_status_id: e.id })), l.notify("success", d("tasks_projects.tasks.detail.status_saved", { name: e.label })), V(); } catch (e) { t.task_status_id = n, l.notify("error", oe(e, "tasks_projects.tasks.detail.status_failed")); } finally { @@ -5526,7 +5608,7 @@ var qs = { en: { tasks_projects: { } async function ce() { let e = m.value; - e !== null && ee.value && !z.value && await bt({ + e !== null && ee.value && !z.value && await xt({ client: l.client, router: f, notify: l.notify, @@ -5537,14 +5619,14 @@ var qs = { en: { tasks_projects: { f.push(W.tasks); } function ue(e) { - k.value = !1, m.value = e, Qe(e), l.notify("success", d("tasks_projects.tasks.updated", { name: e.name })), V(); + k.value = !1, m.value = e, $e(e), l.notify("success", d("tasks_projects.tasks.updated", { name: e.name })), V(); } async function de() { let e = m.value; if (!(e === null || O.value) && window.confirm(d("tasks_projects.tasks.delete_confirm", { name: e.name }))) { O.value = !0; try { - await ur(l.client, e.id), l.notify("success", d("tasks_projects.tasks.deleted", { name: e.name })), V(), le(); + await dr(l.client, e.id), l.notify("success", d("tasks_projects.tasks.deleted", { name: e.name })), V(), le(); } catch (e) { l.notify("error", oe(e, "tasks_projects.tasks.delete_failed")); } finally { @@ -5557,8 +5639,8 @@ var qs = { en: { tasks_projects: { return v(), r(ae, null, { default: D(() => [ c(A, { title: N.value }, { - actions: D(() => [m.value ? (v(), a("div", Ac, [ - c(go, { + actions: D(() => [m.value ? (v(), a("div", Ic, [ + c(xo, { client: t.client, notify: t.notify, task: m.value, @@ -5587,7 +5669,7 @@ var qs = { en: { tasks_projects: { }, null, 8, ["class"]))]), default: D(() => [s(" " + C(w(d)("tasks_projects.tasks.invoice_task")), 1)]), _: 1 - }, 8, ["loading", "disabled"])], 8, jc)) : i("", !0), + }, 8, ["loading", "disabled"])], 8, Lc)) : i("", !0), c(E, { variant: "primary-outline", loading: O.value, @@ -5626,8 +5708,8 @@ var qs = { en: { tasks_projects: { }, null, 8, ["title"]) ]), _: 1 - }), m.value ? (v(), a("div", Dc, [ - o("span", Oc, "#" + C(m.value.number), 1), + }), m.value ? (v(), a("div", Nc, [ + o("span", Pc, "#" + C(m.value.number), 1), m.value.project_id ? (v(), r(y, { key: 0, class: "hover:text-primary-500", @@ -5635,34 +5717,35 @@ var qs = { en: { tasks_projects: { }, { default: D(() => [s(C(I.value?.name ?? `#${m.value.project_id}`), 1)]), _: 1 - }, 8, ["to"])) : (v(), a("span", kc, C(w(d)("tasks_projects.tasks.no_project")), 1)), + }, 8, ["to"])) : (v(), a("span", Fc, C(w(d)("tasks_projects.tasks.no_project")), 1)), m.value.customer_id ? (v(), r(y, { key: 2, class: "hover:text-primary-500", to: w(W).customer(m.value.customer_id) }, { - default: D(() => [s(C(w($t)(m.value.customer_id)), 1)]), + default: D(() => [s(C(w(en)(m.value.customer_id)), 1)]), _: 1 }, 8, ["to"])) : i("", !0), ne.value && m.value.priority ? (v(), a("span", { key: 3, class: p(["rounded-full px-2 py-0.5 text-xs font-medium", u[m.value.priority]]) }, C(ne.value), 3)) : i("", !0), - c(da, { state: j.value.invoiced }, null, 8, ["state"]) + c(ha, { state: j.value.invoiced }, null, 8, ["state"]) ])) : i("", !0)]), _: 1 }, 8, ["title"]), - c(Lt, { + c(Rt, { client: t.client, notify: t.notify }, null, 8, ["client", "notify"]), - x.value && m.value === null ? (v(), a("div", Mc, [c(B, { class: "h-8 w-8 text-primary-500" })])) : m.value ? (v(), a(e, { key: 1 }, [ - o("div", Nc, [ - o("div", Pc, [ - o("p", Fc, C(w(d)("tasks_projects.tasks.detail.status")), 1), - o("div", Ic, [c(re, { + x.value && m.value === null ? (v(), a("div", Rc, [c(B, { class: "h-8 w-8 text-primary-500" })])) : m.value ? (v(), a(e, { key: 1 }, [ + o("div", zc, [ + o("div", Bc, [ + o("p", Vc, C(w(d)("tasks_projects.tasks.detail.status")), 1), + o("div", Hc, [c(re, { modelValue: R.value, "onUpdate:modelValue": l[1] ||= (e) => R.value = e, + "aria-labelledby": "task-status-label", options: P.value, disabled: T.value, "label-key": "label" @@ -5671,26 +5754,26 @@ var qs = { en: { tasks_projects: { "options", "disabled" ])]), - o("p", Lc, [s(C(w(d)("tasks_projects.tasks.detail.assignee")) + ": ", 1), o("span", Rc, C(L.value), 1)]) + o("p", Uc, [s(C(w(d)("tasks_projects.tasks.detail.assignee")) + ": ", 1), o("span", Wc, C(L.value), 1)]) ]), - o("div", zc, [ - o("p", Bc, C(w(d)("tasks_projects.tasks.detail.logged")), 1), - o("p", Vc, C(w(ft)(j.value.logged_minutes)), 1), - o("p", Hc, [s(C(w(d)("tasks_projects.tasks.detail.estimate")) + ": ", 1), o("span", Uc, C(m.value.estimated_minutes ? w(ft)(m.value.estimated_minutes) : w(d)("tasks_projects.tasks.detail.no_estimate")), 1)]) + o("div", Gc, [ + o("p", Kc, C(w(d)("tasks_projects.tasks.detail.logged")), 1), + o("p", qc, C(w(pt)(j.value.logged_minutes)), 1), + o("p", Jc, [s(C(w(d)("tasks_projects.tasks.detail.estimate")) + ": ", 1), o("span", Yc, C(m.value.estimated_minutes ? w(pt)(m.value.estimated_minutes) : w(d)("tasks_projects.tasks.detail.no_estimate")), 1)]) ]), - o("div", Wc, [ - o("p", Gc, C(w(d)("tasks_projects.tasks.detail.unbilled")), 1), - o("p", Kc, [c(ie, { amount: j.value.unbilled_amount }, null, 8, ["amount"])]), - o("p", qc, C(w(ft)(j.value.unbilled_minutes)), 1) + o("div", Xc, [ + o("p", Zc, C(w(d)("tasks_projects.tasks.detail.unbilled")), 1), + o("p", Qc, [c(ie, { amount: j.value.unbilled_amount }, null, 8, ["amount"])]), + o("p", $c, C(w(pt)(j.value.unbilled_minutes)), 1) ]), - o("div", Jc, [ - o("p", Yc, C(w(d)("tasks_projects.tasks.detail.due_date")), 1), - o("p", Xc, C(m.value.due_date ? w(ut)(m.value.due_date) : "-"), 1), - o("p", Zc, C(m.value.billable ? w(d)("tasks_projects.tasks.billable") : w(d)("tasks_projects.time.non_billable")), 1) + o("div", el, [ + o("p", tl, C(w(d)("tasks_projects.tasks.detail.due_date")), 1), + o("p", nl, C(m.value.due_date ? w(dt)(m.value.due_date) : "-"), 1), + o("p", rl, C(m.value.billable ? w(d)("tasks_projects.tasks.billable") : w(d)("tasks_projects.time.non_billable")), 1) ]) ]), - o("div", Qc, [o("p", $c, C(w(d)("tasks_projects.tasks.detail.description")), 1), m.value.description ? (v(), a("p", el, C(m.value.description), 1)) : (v(), a("p", tl, C(w(d)("tasks_projects.tasks.detail.no_description")), 1))]), - c(Ec, { + o("div", il, [o("p", al, C(w(d)("tasks_projects.tasks.detail.description")), 1), m.value.description ? (v(), a("p", ol, C(m.value.description), 1)) : (v(), a("p", sl, C(w(d)("tasks_projects.tasks.detail.no_description")), 1))]), + c(Mc, { client: t.client, notify: t.notify, task: m.value, @@ -5702,7 +5785,7 @@ var qs = { en: { tasks_projects: { "members" ]) ], 64)) : i("", !0), - m.value ? (v(), r(ya, { + m.value ? (v(), r(wa, { key: 2, show: k.value, client: t.client, @@ -5728,7 +5811,7 @@ var qs = { en: { tasks_projects: { }); }; } -}), il = ["aria-label"], al = ["aria-current", "onClick"], ol = { class: "max-sm:hidden" }, sl = /* @__PURE__ */ l({ +}), ul = ["aria-label"], dl = ["aria-current", "onClick"], fl = { class: "max-sm:sr-only" }, pl = /* @__PURE__ */ l({ __name: "ViewSwitcher", props: { active: {}, @@ -5739,25 +5822,25 @@ var qs = { en: { tasks_projects: { let i = t, s = r, l = B(), u = n(() => [ { id: "list", - name: on.list, + name: sn.list, label: l("tasks_projects.tasks.views.list"), icon: "ListBulletIcon" }, { id: "board", - name: on.board, + name: sn.board, label: l("tasks_projects.tasks.views.board"), icon: "ViewColumnsIcon" }, { id: "week", - name: on.week, + name: sn.week, label: l("tasks_projects.tasks.views.week"), icon: "CalendarDaysIcon" } ]); function d(e) { - return i.active === e.name || e.id === "list" && i.active === on.tasks; + return i.active === e.name || e.id === "list" && i.active === sn.tasks; } function f(e) { d(e) || s("select", { @@ -5769,20 +5852,20 @@ var qs = { en: { tasks_projects: { let r = S("BaseIcon"); return v(), a("nav", { class: "inline-flex overflow-hidden rounded-lg border border-line-default", - "aria-label": w(l)("tasks_projects.tasks.title") + "aria-label": w(l)("tasks_projects.tasks.views.title") }, [(v(!0), a(e, null, x(u.value, (e) => (v(), a("button", { key: e.id, type: "button", - class: p(["flex items-center gap-1.5 border-r border-line-default px-3 py-1.5 text-sm font-medium last:border-r-0", d(e) ? "bg-primary-50 text-primary-500" : "bg-surface text-muted hover:bg-hover hover:text-heading"]), + class: p(["flex items-center gap-1.5 border-e border-line-default px-3 py-1.5 text-sm font-medium last:border-e-0", d(e) ? "bg-primary-50 text-primary-500" : "bg-surface text-muted hover:bg-hover hover:text-heading"]), "aria-current": d(e) ? "page" : void 0, onClick: (t) => f(e) }, [c(r, { name: e.icon, class: "h-4 w-4" - }, null, 8, ["name"]), o("span", ol, C(e.label), 1)], 10, al))), 128))], 8, il); + }, null, 8, ["name"]), o("span", fl, C(e.label), 1)], 10, dl))), 128))], 8, ul); }; } -}), cl = { class: "flex flex-wrap items-center justify-end gap-3" }, ll = 100, ul = /* @__PURE__ */ l({ +}), ml = { class: "flex flex-wrap items-center justify-end gap-3" }, hl = 100, gl = /* @__PURE__ */ l({ __name: "TasksPage", props: { client: { type: [Function, Object] }, @@ -5790,7 +5873,7 @@ var qs = { en: { tasks_projects: { router: {} }, setup(e) { - let t = e, i = B(), a = t.router, l = b([]), u = b([]), d = b([]), f = b(!1), m = n(() => t.router.currentRoute.value), h = n(() => Bi(m.value.query)), _ = n(() => Vi(h.value)), y = n(() => String(m.value.name ?? "")), x = n(() => d.value.map((e) => ({ + let t = e, i = B(), a = t.router, l = b([]), u = b([]), d = b([]), f = b(!1), m = n(() => t.router.currentRoute.value), h = n(() => Wi(m.value.query)), _ = n(() => Gi(h.value)), y = n(() => String(m.value.name ?? "")), x = n(() => d.value.map((e) => ({ id: e.id, label: e.name }))); @@ -5798,25 +5881,25 @@ var qs = { en: { tasks_projects: { T(y.value), O(); }); function T(e) { - e === on.tasks && a.replace({ - name: on.list, + e === sn.tasks && a.replace({ + name: sn.list, query: _.value }); } async function O() { try { - l.value = await or(t.client); + l.value = await sr(t.client); } catch (e) { t.notify("error", H(e, i("tasks_projects.task_statuses.load_failed"))); } try { - u.value = await Jt(t.client); + u.value = await Yt(t.client); } catch (e) { t.notify("error", H(e, i("tasks_projects.tasks.members_failed"))); } try { - let e = await Ht(t.client, { - limit: ll, + let e = await Ut(t.client, { + limit: hl, status: "ACTIVE", sort_by: "name" }); @@ -5826,9 +5909,9 @@ var qs = { en: { tasks_projects: { } } function k(e) { - Wi(e, h.value) || a.replace({ - name: y.value === on.tasks ? on.list : y.value, - query: Vi(e) + Ji(e, h.value) || a.replace({ + name: y.value === sn.tasks ? sn.list : y.value, + query: Gi(e) }); } function A(e) { @@ -5842,8 +5925,8 @@ var qs = { en: { tasks_projects: { return v(), r(M, null, { default: D(() => [ c(E, { title: w(i)("tasks_projects.tasks.title") }, { - actions: D(() => [o("div", cl, [ - c(sl, { + actions: D(() => [o("div", ml, [ + c(pl, { active: y.value, query: _.value, onSelect: A @@ -5895,11 +5978,11 @@ var qs = { en: { tasks_projects: { })]), _: 1 }, 8, ["title"]), - c(Lt, { + c(Rt, { client: e.client, notify: e.notify }, null, 8, ["client", "notify"]), - c(oa, { + c(ua, { "model-value": h.value, projects: d.value, members: u.value, @@ -5922,7 +6005,7 @@ var qs = { en: { tasks_projects: { "members", "projects" ]), - c(ya, { + c(wa, { show: f.value, client: e.client, notify: e.notify, @@ -5951,24 +6034,24 @@ var qs = { en: { tasks_projects: { }); //#endregion //#region node_modules/.pnpm/sortablejs@1.15.7/node_modules/sortablejs/modular/sortable.esm.js -function dl(e, t, n) { - return (t = vl(t)) in e ? Object.defineProperty(e, t, { +function _l(e, t, n) { + return (t = wl(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e; } -function fl() { - return fl = Object.assign ? Object.assign.bind() : function(e) { +function vl() { + return vl = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t]; for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]); } return e; - }, fl.apply(null, arguments); + }, vl.apply(null, arguments); } -function pl(e, t) { +function yl(e, t) { var n = Object.keys(e); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(e); @@ -5978,27 +6061,27 @@ function pl(e, t) { } return n; } -function ml(e) { +function bl(e) { for (var t = 1; t < arguments.length; t++) { var n = arguments[t] == null ? {} : arguments[t]; - t % 2 ? pl(Object(n), !0).forEach(function(t) { - dl(e, t, n[t]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pl(Object(n)).forEach(function(t) { + t % 2 ? yl(Object(n), !0).forEach(function(t) { + _l(e, t, n[t]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : yl(Object(n)).forEach(function(t) { Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t)); }); } return e; } -function hl(e, t) { +function xl(e, t) { if (e == null) return {}; - var n, r, i = gl(e, t); + var n, r, i = Sl(e, t); if (Object.getOwnPropertySymbols) { var a = Object.getOwnPropertySymbols(e); for (r = 0; r < a.length; r++) n = a[r], t.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]); } return i; } -function gl(e, t) { +function Sl(e, t) { if (e == null) return {}; var n = {}; for (var r in e) if ({}.hasOwnProperty.call(e, r)) { @@ -6007,7 +6090,7 @@ function gl(e, t) { } return n; } -function _l(e, t) { +function Cl(e, t) { if (typeof e != "object" || !e) return e; var n = e[Symbol.toPrimitive]; if (n !== void 0) { @@ -6017,33 +6100,33 @@ function _l(e, t) { } return (t === "string" ? String : Number)(e); } -function vl(e) { - var t = _l(e, "string"); +function wl(e) { + var t = Cl(e, "string"); return typeof t == "symbol" ? t : t + ""; } -function yl(e) { +function Tl(e) { "@babel/helpers - typeof"; - return yl = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { + return Tl = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) { return typeof e; } : function(e) { return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e; - }, yl(e); + }, Tl(e); } -var bl = "1.15.7"; -function xl(e) { +var El = "1.15.7"; +function Dl(e) { if (typeof window < "u" && window.navigator) return !!/*@__PURE__*/ navigator.userAgent.match(e); } -var Sl = xl(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Cl = xl(/Edge/i), wl = xl(/firefox/i), Tl = xl(/safari/i) && !xl(/chrome/i) && !xl(/android/i), El = xl(/iP(ad|od|hone)/i), Dl = xl(/chrome/i) && xl(/android/i), Ol = { +var Ol = Dl(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), kl = Dl(/Edge/i), Al = Dl(/firefox/i), jl = Dl(/safari/i) && !Dl(/chrome/i) && !Dl(/android/i), Ml = Dl(/iP(ad|od|hone)/i), Nl = Dl(/chrome/i) && Dl(/android/i), Pl = { capture: !1, passive: !1 }; function J(e, t, n) { - e.addEventListener(t, n, !Sl && Ol); + e.addEventListener(t, n, !Ol && Pl); } function Y(e, t, n) { - e.removeEventListener(t, n, !Sl && Ol); + e.removeEventListener(t, n, !Ol && Pl); } -function kl(e, t) { +function Fl(e, t) { if (t) { if (t[0] === ">" && (t = t.substring(1)), e) try { if (e.matches) return e.matches(t); @@ -6055,22 +6138,22 @@ function kl(e, t) { return !1; } } -function Al(e) { +function Il(e) { return e.host && e !== document && e.host.nodeType && e.host !== e ? e.host : e.parentNode; } -function jl(e, t, n, r) { +function Ll(e, t, n, r) { if (e) { n ||= document; do { - if (t != null && (t[0] === ">" ? e.parentNode === n && kl(e, t) : kl(e, t)) || r && e === n) return e; + if (t != null && (t[0] === ">" ? e.parentNode === n && Fl(e, t) : Fl(e, t)) || r && e === n) return e; if (e === n) break; - } while (e = Al(e)); + } while (e = Il(e)); } return null; } -var Ml = /\s+/g; -function Nl(e, t, n) { - e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(Ml, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(Ml, " ")); +var Rl = /\s+/g; +function zl(e, t, n) { + e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(Rl, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(Rl, " ")); } function X(e, t, n) { var r = e && e.style; @@ -6079,7 +6162,7 @@ function X(e, t, n) { !(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px"); } } -function Pl(e, t) { +function Bl(e, t) { var n = ""; if (typeof e == "string") n = e; else do { @@ -6089,7 +6172,7 @@ function Pl(e, t) { var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix; return i && new i(n); } -function Fl(e, t, n) { +function Vl(e, t, n) { if (e) { var r = e.getElementsByTagName(t), i = 0, a = r.length; if (n) for (; i < a; i++) n(r[i], i); @@ -6097,13 +6180,13 @@ function Fl(e, t, n) { } return []; } -function Il() { +function Hl() { return document.scrollingElement || document.documentElement; } -function Ll(e, t, n, r, i) { +function Ul(e, t, n, r, i) { if (e.getBoundingClientRect || e === window) { var a, o, s, c, l, u, d; - if (e !== window && e.parentNode && e !== Il() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !Sl)) do + if (e !== window && e.parentNode && e !== Hl() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !Ol)) do if (i && i.getBoundingClientRect && (X(i, "transform") !== "none" || n && X(i, "position") !== "static")) { var f = i.getBoundingClientRect(); o -= f.top + parseInt(X(i, "border-top-width")), s -= f.left + parseInt(X(i, "border-left-width")), c = o + a.height, l = s + a.width; @@ -6111,7 +6194,7 @@ function Ll(e, t, n, r, i) { } while (i = i.parentNode); if (r && e !== window) { - var p = Pl(i || e), m = p && p.a, h = p && p.d; + var p = Bl(i || e), m = p && p.a, h = p && p.d; p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d); } return { @@ -6124,18 +6207,18 @@ function Ll(e, t, n, r, i) { }; } } -function Rl(e, t, n) { - for (var r = Wl(e, !0), i = Ll(e)[t]; r;) { - var a = Ll(r)[n], o = void 0; +function Wl(e, t, n) { + for (var r = Xl(e, !0), i = Ul(e)[t]; r;) { + var a = Ul(r)[n], o = void 0; if (o = n === "top" || n === "left" ? i >= a : i <= a, !o) return r; - if (r === Il()) break; - r = Wl(r, !1); + if (r === Hl()) break; + r = Xl(r, !1); } return !1; } -function zl(e, t, n, r) { +function Gl(e, t, n, r) { for (var i = 0, a = 0, o = e.children; a < o.length;) { - if (o[a].style.display !== "none" && o[a] !== $.ghost && (r || o[a] !== $.dragged) && jl(o[a], n.draggable, e, !1)) { + if (o[a].style.display !== "none" && o[a] !== $.ghost && (r || o[a] !== $.dragged) && Ll(o[a], n.draggable, e, !1)) { if (i === t) return o[a]; i++; } @@ -6143,84 +6226,84 @@ function zl(e, t, n, r) { } return null; } -function Bl(e, t) { - for (var n = e.lastElementChild; n && (n === $.ghost || X(n, "display") === "none" || t && !kl(n, t));) n = n.previousElementSibling; +function Kl(e, t) { + for (var n = e.lastElementChild; n && (n === $.ghost || X(n, "display") === "none" || t && !Fl(n, t));) n = n.previousElementSibling; return n || null; } -function Vl(e, t) { +function ql(e, t) { var n = 0; if (!e || !e.parentNode) return -1; - for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== $.clone && (!t || kl(e, t)) && n++; + for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== $.clone && (!t || Fl(e, t)) && n++; return n; } -function Hl(e) { - var t = 0, n = 0, r = Il(); +function Jl(e) { + var t = 0, n = 0, r = Hl(); if (e) do { - var i = Pl(e), a = i.a, o = i.d; + var i = Bl(e), a = i.a, o = i.d; t += e.scrollLeft * a, n += e.scrollTop * o; } while (e !== r && (e = e.parentNode)); return [t, n]; } -function Ul(e, t) { +function Yl(e, t) { for (var n in e) if (e.hasOwnProperty(n)) { for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n); } return -1; } -function Wl(e, t) { - if (!e || !e.getBoundingClientRect) return Il(); +function Xl(e, t) { + if (!e || !e.getBoundingClientRect) return Hl(); var n = e, r = !1; do if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) { var i = X(n); if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) { - if (!n.getBoundingClientRect || n === document.body) return Il(); + if (!n.getBoundingClientRect || n === document.body) return Hl(); if (r || t) return n; r = !0; } } while (n = n.parentNode); - return Il(); + return Hl(); } -function Gl(e, t) { +function Zl(e, t) { if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]); return e; } -function Kl(e, t) { +function Ql(e, t) { return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width); } -var ql; -function Jl(e, t) { +var $l; +function eu(e, t) { return function() { - if (!ql) { + if (!$l) { var n = arguments, r = this; - n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), ql = setTimeout(function() { - ql = void 0; + n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), $l = setTimeout(function() { + $l = void 0; }, t); } }; } -function Yl() { - clearTimeout(ql), ql = void 0; +function tu() { + clearTimeout($l), $l = void 0; } -function Xl(e, t, n) { +function nu(e, t, n) { e.scrollLeft += t, e.scrollTop += n; } -function Zl(e) { +function ru(e) { var t = window.Polymer, n = window.jQuery || window.Zepto; return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0); } -function Ql(e, t, n) { +function iu(e, t, n) { var r = {}; return Array.from(e.children).forEach(function(i) { - if (jl(i, t.draggable, e, !1) && !i.animated && i !== n) { - var a = Ll(i); + if (Ll(i, t.draggable, e, !1) && !i.animated && i !== n) { + var a = Ul(i); r.left = Math.min(r.left ?? Infinity, a.left), r.top = Math.min(r.top ?? Infinity, a.top), r.right = Math.max(r.right ?? -Infinity, a.right), r.bottom = Math.max(r.bottom ?? -Infinity, a.bottom); } }), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r; } -var $l = "Sortable" + (/* @__PURE__ */ new Date()).getTime(); -function eu() { +var au = "Sortable" + (/* @__PURE__ */ new Date()).getTime(); +function ou() { var e = [], t; return { captureAnimationState: function() { @@ -6228,11 +6311,11 @@ function eu() { if (X(t, "display") !== "none" && t !== $.ghost) { e.push({ target: t, - rect: Ll(t) + rect: Ul(t) }); - var n = ml({}, e[e.length - 1].rect); + var n = bl({}, e[e.length - 1].rect); if (t.thisAnimationDuration) { - var r = Pl(t, !0); + var r = Bl(t, !0); r && (n.top -= r.f, n.left -= r.e); } t.fromRect = n; @@ -6243,7 +6326,7 @@ function eu() { e.push(t); }, removeAnimationState: function(t) { - e.splice(Ul(e, { target: t }), 1); + e.splice(Yl(e, { target: t }), 1); }, animateAll: function(n) { var r = this; @@ -6253,8 +6336,8 @@ function eu() { } var i = !1, a = 0; e.forEach(function(e) { - var t = 0, n = e.target, o = n.fromRect, s = Ll(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Pl(n, !0); - d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Kl(c, s) && !Kl(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = nu(u, c, l, r.options)), Kl(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() { + var t = 0, n = e.target, o = n.fromRect, s = Ul(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Bl(n, !0); + d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Ql(c, s) && !Ql(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = cu(u, c, l, r.options)), Ql(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() { n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null; }, t), n.thisAnimationDuration = t); }), clearTimeout(t), i ? t = setTimeout(function() { @@ -6264,26 +6347,26 @@ function eu() { animate: function(e, t, n, r) { if (r) { X(e, "transition", ""), X(e, "transform", ""); - var i = Pl(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1); - e.animatingX = !!s, e.animatingY = !!c, X(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = tu(e), X(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), X(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() { + var i = Bl(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1); + e.animatingX = !!s, e.animatingY = !!c, X(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = su(e), X(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), X(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() { X(e, "transition", ""), X(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1; }, r); } } }; } -function tu(e) { +function su(e) { return e.offsetWidth; } -function nu(e, t, n, r) { +function cu(e, t, n, r) { return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation; } -var ru = [], iu = { initializeByDefault: !0 }, au = { +var lu = [], uu = { initializeByDefault: !0 }, du = { mount: function(e) { - for (var t in iu) iu.hasOwnProperty(t) && !(t in e) && (e[t] = iu[t]); - ru.forEach(function(t) { + for (var t in uu) uu.hasOwnProperty(t) && !(t in e) && (e[t] = uu[t]); + lu.forEach(function(t) { if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`; - }), ru.push(e); + }), lu.push(e); }, pluginEvent: function(e, t, n) { var r = this; @@ -6291,16 +6374,16 @@ var ru = [], iu = { initializeByDefault: !0 }, au = { r.eventCanceled = !0; }; var i = e + "Global"; - ru.forEach(function(r) { - t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](ml({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](ml({ sortable: t }, n))); + lu.forEach(function(r) { + t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](bl({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](bl({ sortable: t }, n))); }); }, initializePlugins: function(e, t, n, r) { - for (var i in ru.forEach(function(r) { + for (var i in lu.forEach(function(r) { var i = r.pluginName; if (e.options[i] || r.initializeByDefault) { var a = new r(e, t, e.options); - a.sortable = e, a.options = e.options, e[i] = a, fl(n, a.defaults); + a.sortable = e, a.options = e.options, e[i] = a, vl(n, a.defaults); } }), e.options) if (e.options.hasOwnProperty(i)) { var a = this.modifyOption(e, i, e.options[i]); @@ -6309,59 +6392,59 @@ var ru = [], iu = { initializeByDefault: !0 }, au = { }, getEventProperties: function(e, t) { var n = {}; - return ru.forEach(function(r) { - typeof r.eventProperties == "function" && fl(n, r.eventProperties.call(t[r.pluginName], e)); + return lu.forEach(function(r) { + typeof r.eventProperties == "function" && vl(n, r.eventProperties.call(t[r.pluginName], e)); }), n; }, modifyOption: function(e, t, n) { var r; - return ru.forEach(function(i) { + return lu.forEach(function(i) { e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n)); }), r; } }; -function ou(e) { +function fu(e) { var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties; - if (t ||= n && n[$l], t) { + if (t ||= n && n[au], t) { var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1); - window.CustomEvent && !Sl && !Cl ? h = new CustomEvent(r, { + window.CustomEvent && !Ol && !kl ? h = new CustomEvent(r, { bubbles: !0, cancelable: !0 }) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0; - var v = ml(ml({}, m), au.getEventProperties(r, t)); + var v = bl(bl({}, m), du.getEventProperties(r, t)); for (var y in v) h[y] = v[y]; n && n.dispatchEvent(h), g[_] && g[_].call(t, h); } } -var su = ["evt"], cu = function(e, t) { - var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = hl(n, su); - au.pluginEvent.bind($)(e, t, ml({ +var pu = ["evt"], mu = function(e, t) { + var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = xl(n, pu); + du.pluginEvent.bind($)(e, t, bl({ dragEl: Z, - parentEl: uu, + parentEl: gu, ghostEl: Q, - rootEl: du, - nextEl: fu, - lastDownEl: pu, - cloneEl: mu, - cloneHidden: hu, - dragStarted: ju, - putSortable: xu, + rootEl: _u, + nextEl: vu, + lastDownEl: yu, + cloneEl: bu, + cloneHidden: xu, + dragStarted: Lu, + putSortable: Du, activeSortable: $.active, originalEvent: r, - oldIndex: gu, - oldDraggableIndex: vu, - newIndex: _u, - newDraggableIndex: yu, - hideGhostForTarget: Xu, - unhideGhostForTarget: Zu, + oldIndex: Su, + oldDraggableIndex: wu, + newIndex: Cu, + newDraggableIndex: Tu, + hideGhostForTarget: nd, + unhideGhostForTarget: rd, cloneNowHidden: function() { - hu = !0; + xu = !0; }, cloneNowShown: function() { - hu = !1; + xu = !1; }, dispatchSortableEvent: function(e) { - lu({ + hu({ sortable: t, name: e, originalEvent: r @@ -6369,46 +6452,46 @@ var su = ["evt"], cu = function(e, t) { } }, i)); }; -function lu(e) { - ou(ml({ - putSortable: xu, - cloneEl: mu, +function hu(e) { + fu(bl({ + putSortable: Du, + cloneEl: bu, targetEl: Z, - rootEl: du, - oldIndex: gu, - oldDraggableIndex: vu, - newIndex: _u, - newDraggableIndex: yu + rootEl: _u, + oldIndex: Su, + oldDraggableIndex: wu, + newIndex: Cu, + newDraggableIndex: Tu }, e)); } -var Z, uu, Q, du, fu, pu, mu, hu, gu, _u, vu, yu, bu, xu, Su = !1, Cu = !1, wu = [], Tu, Eu, Du, Ou, ku, Au, ju, Mu, Nu, Pu = !1, Fu = !1, Iu, Lu, Ru = [], zu = !1, Bu = [], Vu = typeof document < "u", Hu = El, Uu = Cl || Sl ? "cssFloat" : "float", Wu = Vu && !Dl && !El && "draggable" in document.createElement("div"), Gu = function() { - if (Vu) { - if (Sl) return !1; +var Z, gu, Q, _u, vu, yu, bu, xu, Su, Cu, wu, Tu, Eu, Du, Ou = !1, ku = !1, Au = [], ju, Mu, Nu, Pu, Fu, Iu, Lu, Ru, zu, Bu = !1, Vu = !1, Hu, Uu, Wu = [], Gu = !1, Ku = [], qu = typeof document < "u", Ju = Ml, Yu = kl || Ol ? "cssFloat" : "float", Xu = qu && !Nl && !Ml && "draggable" in document.createElement("div"), Zu = function() { + if (qu) { + if (Ol) return !1; var e = document.createElement("x"); return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto"; } -}(), Ku = function(e, t) { - var n = X(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = zl(e, 0, t), a = zl(e, 1, t), o = i && X(i), s = a && X(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + Ll(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + Ll(a).width; +}(), Qu = function(e, t) { + var n = X(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = Gl(e, 0, t), a = Gl(e, 1, t), o = i && X(i), s = a && X(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + Ul(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + Ul(a).width; if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal"; if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal"; if (i && o.float && o.float !== "none") { var u = o.float === "left" ? "left" : "right"; return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal"; } - return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Uu] === "none" || a && n[Uu] === "none" && c + l > r) ? "vertical" : "horizontal"; -}, qu = function(e, t, n) { + return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Yu] === "none" || a && n[Yu] === "none" && c + l > r) ? "vertical" : "horizontal"; +}, $u = function(e, t, n) { var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height; return r === o || i === s || r + a / 2 === o + c / 2; -}, Ju = function(e, t) { +}, ed = function(e, t) { var n; - return wu.some(function(r) { - var i = r[$l].options.emptyInsertThreshold; - if (i && !Bl(r)) { - var a = Ll(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i; + return Au.some(function(r) { + var i = r[au].options.emptyInsertThreshold; + if (i && !Kl(r)) { + var a = Ul(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i; if (o && s) return n = r; } }), n; -}, Yu = function(e) { +}, td = function(e) { function t(e, n) { return function(r, i, a, o) { var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name; @@ -6421,31 +6504,31 @@ var Z, uu, Q, du, fu, pu, mu, hu, gu, _u, vu, yu, bu, xu, Su = !1, Cu = !1, wu = }; } var n = {}, r = e.group; - (!r || yl(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n; -}, Xu = function() { - !Gu && Q && X(Q, "display", "none"); -}, Zu = function() { - !Gu && Q && X(Q, "display", ""); + (!r || Tl(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n; +}, nd = function() { + !Zu && Q && X(Q, "display", "none"); +}, rd = function() { + !Zu && Q && X(Q, "display", ""); }; -Vu && !Dl && document.addEventListener("click", function(e) { - if (Cu) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Cu = !1, !1; +qu && !Nl && document.addEventListener("click", function(e) { + if (ku) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), ku = !1, !1; }, !0); -var Qu = function(e) { +var id = function(e) { if (Z) { e = e.touches ? e.touches[0] : e; - var t = Ju(e.clientX, e.clientY); + var t = ed(e.clientX, e.clientY); if (t) { var n = {}; for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]); - n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[$l]._onDragOver(n); + n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[au]._onDragOver(n); } } -}, $u = function(e) { - Z && Z.parentNode[$l]._isOutsideThisEl(e.target); +}, ad = function(e) { + Z && Z.parentNode[au]._isOutsideThisEl(e.target); }; function $(e, t) { if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`; - this.el = e, this.options = t = fl({}, t), e[$l] = this; + this.el = e, this.options = t = vl({}, t), e[au] = this; var n = { group: null, sort: !0, @@ -6458,7 +6541,7 @@ function $(e, t) { invertedSwapThreshold: null, removeCloneOnHide: !0, direction: function() { - return Ku(e, this.options); + return Qu(e, this.options); }, ghostClass: "sortable-ghost", chosenClass: "sortable-chosen", @@ -6485,17 +6568,17 @@ function $(e, t) { x: 0, y: 0 }, - supportPointer: $.supportPointer !== !1 && "PointerEvent" in window && (!Tl || El), + supportPointer: $.supportPointer !== !1 && "PointerEvent" in window && (!jl || Ml), emptyInsertThreshold: 5 }; - for (var r in au.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]); - for (var i in Yu(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this)); - this.nativeDraggable = !t.forceFallback && Wu, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? J(e, "pointerdown", this._onTapStart) : (J(e, "mousedown", this._onTapStart), J(e, "touchstart", this._onTapStart)), this.nativeDraggable && (J(e, "dragover", this), J(e, "dragenter", this)), wu.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), fl(this, eu()); + for (var r in du.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]); + for (var i in td(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this)); + this.nativeDraggable = !t.forceFallback && Xu, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? J(e, "pointerdown", this._onTapStart) : (J(e, "mousedown", this._onTapStart), J(e, "touchstart", this._onTapStart)), this.nativeDraggable && (J(e, "dragover", this), J(e, "dragenter", this)), Au.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), vl(this, ou()); } $.prototype = { constructor: $, _isOutsideThisEl: function(e) { - !this.el.contains(e) && e !== this.el && (Mu = null); + !this.el.contains(e) && e !== this.el && (Ru = null); }, _getDirection: function(e, t) { return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, Z) : this.options.direction; @@ -6503,57 +6586,57 @@ $.prototype = { _onTapStart: function(e) { if (e.cancelable) { var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter; - if (ld(n), !Z && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Tl && s && s.tagName.toUpperCase() === "SELECT") && (s = jl(s, r.draggable, n, !1), !(s && s.animated) && pu !== s)) { - if (gu = Vl(s), vu = Vl(s, r.draggable), typeof l == "function") { + if (hd(n), !Z && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && jl && s && s.tagName.toUpperCase() === "SELECT") && (s = Ll(s, r.draggable, n, !1), !(s && s.animated) && yu !== s)) { + if (Su = ql(s), wu = ql(s, r.draggable), typeof l == "function") { if (l.call(this, e, s, this)) { - lu({ + hu({ sortable: t, rootEl: c, name: "filter", targetEl: s, toEl: n, fromEl: n - }), cu("filter", t, { evt: e }), i && e.preventDefault(); + }), mu("filter", t, { evt: e }), i && e.preventDefault(); return; } } else if (l && (l = l.split(",").some(function(r) { - if (r = jl(c, r.trim(), n, !1), r) return lu({ + if (r = Ll(c, r.trim(), n, !1), r) return hu({ sortable: t, rootEl: r, name: "filter", targetEl: s, fromEl: n, toEl: n - }), cu("filter", t, { evt: e }), !0; + }), mu("filter", t, { evt: e }), !0; }), l)) { i && e.preventDefault(); return; } - (!r.handle || jl(c, r.handle, n, !1)) && this._prepareDragStart(e, o, s); + (!r.handle || Ll(c, r.handle, n, !1)) && this._prepareDragStart(e, o, s); } } }, _prepareDragStart: function(e, t, n) { var r = this, i = r.el, a = r.options, o = i.ownerDocument, s; if (n && !Z && n.parentNode === i) { - var c = Ll(n); - if (du = i, Z = n, uu = Z.parentNode, fu = Z.nextSibling, pu = n, bu = a.group, $.dragged = Z, Tu = { + var c = Ul(n); + if (_u = i, Z = n, gu = Z.parentNode, vu = Z.nextSibling, yu = n, Eu = a.group, $.dragged = Z, ju = { target: Z, clientX: (t || e).clientX, clientY: (t || e).clientY - }, ku = Tu.clientX - c.left, Au = Tu.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, Z.style["will-change"] = "all", s = function() { - if (cu("delayEnded", r, { evt: e }), $.eventCanceled) { + }, Fu = ju.clientX - c.left, Iu = ju.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, Z.style["will-change"] = "all", s = function() { + if (mu("delayEnded", r, { evt: e }), $.eventCanceled) { r._onDrop(); return; } - r._disableDelayedDragEvents(), !wl && r.nativeDraggable && (Z.draggable = !0), r._triggerDragStart(e, t), lu({ + r._disableDelayedDragEvents(), !Al && r.nativeDraggable && (Z.draggable = !0), r._triggerDragStart(e, t), hu({ sortable: r, name: "choose", originalEvent: e - }), Nl(Z, a.chosenClass, !0); + }), zl(Z, a.chosenClass, !0); }, a.ignore.split(",").forEach(function(e) { - Fl(Z, e.trim(), nd); - }), J(o, "dragover", Qu), J(o, "mousemove", Qu), J(o, "touchmove", Qu), a.supportPointer ? (J(o, "pointerup", r._onDrop), !this.nativeDraggable && J(o, "pointercancel", r._onDrop)) : (J(o, "mouseup", r._onDrop), J(o, "touchend", r._onDrop), J(o, "touchcancel", r._onDrop)), wl && this.nativeDraggable && (this.options.touchStartThreshold = 4, Z.draggable = !0), cu("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Cl || Sl))) { + Vl(Z, e.trim(), cd); + }), J(o, "dragover", id), J(o, "mousemove", id), J(o, "touchmove", id), a.supportPointer ? (J(o, "pointerup", r._onDrop), !this.nativeDraggable && J(o, "pointercancel", r._onDrop)) : (J(o, "mouseup", r._onDrop), J(o, "touchend", r._onDrop), J(o, "touchcancel", r._onDrop)), Al && this.nativeDraggable && (this.options.touchStartThreshold = 4, Z.draggable = !0), mu("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(kl || Ol))) { if ($.eventCanceled) { this._onDrop(); return; @@ -6567,25 +6650,25 @@ $.prototype = { Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag(); }, _disableDelayedDrag: function() { - Z && nd(Z), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents(); + Z && cd(Z), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents(); }, _disableDelayedDragEvents: function() { var e = this.el.ownerDocument; Y(e, "mouseup", this._disableDelayedDrag), Y(e, "touchend", this._disableDelayedDrag), Y(e, "touchcancel", this._disableDelayedDrag), Y(e, "pointerup", this._disableDelayedDrag), Y(e, "pointercancel", this._disableDelayedDrag), Y(e, "mousemove", this._delayedDragTouchMoveHandler), Y(e, "touchmove", this._delayedDragTouchMoveHandler), Y(e, "pointermove", this._delayedDragTouchMoveHandler); }, _triggerDragStart: function(e, t) { - t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? J(document, "pointermove", this._onTouchMove) : t ? J(document, "touchmove", this._onTouchMove) : J(document, "mousemove", this._onTouchMove) : (J(Z, "dragend", this), J(du, "dragstart", this._onDragStart)); + t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? J(document, "pointermove", this._onTouchMove) : t ? J(document, "touchmove", this._onTouchMove) : J(document, "mousemove", this._onTouchMove) : (J(Z, "dragend", this), J(_u, "dragstart", this._onDragStart)); try { - document.selection ? ud(function() { + document.selection ? gd(function() { document.selection.empty(); }) : window.getSelection().removeAllRanges(); } catch {} }, _dragStarted: function(e, t) { - if (Su = !1, du && Z) { - cu("dragStarted", this, { evt: t }), this.nativeDraggable && J(document, "dragover", $u); + if (Ou = !1, _u && Z) { + mu("dragStarted", this, { evt: t }), this.nativeDraggable && J(document, "dragover", ad); var n = this.options; - !e && Nl(Z, n.dragClass, !1), Nl(Z, n.ghostClass, !0), $.active = this, e && this._appendGhost(), lu({ + !e && zl(Z, n.dragClass, !1), zl(Z, n.ghostClass, !0), $.active = this, e && this._appendGhost(), hu({ sortable: this, name: "start", originalEvent: t @@ -6593,33 +6676,33 @@ $.prototype = { } else this._nulling(); }, _emulateDragOver: function() { - if (Eu) { - this._lastX = Eu.clientX, this._lastY = Eu.clientY, Xu(); - for (var e = document.elementFromPoint(Eu.clientX, Eu.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Eu.clientX, Eu.clientY), e !== t);) t = e; - if (Z.parentNode[$l]._isOutsideThisEl(e), t) do { - if (t[$l]) { + if (Mu) { + this._lastX = Mu.clientX, this._lastY = Mu.clientY, nd(); + for (var e = document.elementFromPoint(Mu.clientX, Mu.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(Mu.clientX, Mu.clientY), e !== t);) t = e; + if (Z.parentNode[au]._isOutsideThisEl(e), t) do { + if (t[au]) { var n = void 0; - if (n = t[$l]._onDragOver({ - clientX: Eu.clientX, - clientY: Eu.clientY, + if (n = t[au]._onDragOver({ + clientX: Mu.clientX, + clientY: Mu.clientY, target: e, rootEl: t }), n && !this.options.dragoverBubble) break; } e = t; - } while (t = Al(t)); - Zu(); + } while (t = Il(t)); + rd(); } }, _onTouchMove: function(e) { - if (Tu) { - var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = Q && Pl(Q, !0), o = Q && a && a.a, s = Q && a && a.d, c = Hu && Lu && Hl(Lu), l = (i.clientX - Tu.clientX + r.x) / (o || 1) + (c ? c[0] - Ru[0] : 0) / (o || 1), u = (i.clientY - Tu.clientY + r.y) / (s || 1) + (c ? c[1] - Ru[1] : 0) / (s || 1); - if (!$.active && !Su) { + if (ju) { + var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = Q && Bl(Q, !0), o = Q && a && a.a, s = Q && a && a.d, c = Ju && Uu && Jl(Uu), l = (i.clientX - ju.clientX + r.x) / (o || 1) + (c ? c[0] - Wu[0] : 0) / (o || 1), u = (i.clientY - ju.clientY + r.y) / (s || 1) + (c ? c[1] - Wu[1] : 0) / (s || 1); + if (!$.active && !Ou) { if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return; this._onDragStart(e, !0); } if (Q) { - a ? (a.e += l - (Du || 0), a.f += u - (Ou || 0)) : a = { + a ? (a.e += l - (Nu || 0), a.f += u - (Pu || 0)) : a = { a: 1, b: 0, c: 0, @@ -6628,39 +6711,39 @@ $.prototype = { f: u }; var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`; - X(Q, "webkitTransform", d), X(Q, "mozTransform", d), X(Q, "msTransform", d), X(Q, "transform", d), Du = l, Ou = u, Eu = i; + X(Q, "webkitTransform", d), X(Q, "mozTransform", d), X(Q, "msTransform", d), X(Q, "transform", d), Nu = l, Pu = u, Mu = i; } e.cancelable && e.preventDefault(); } }, _appendGhost: function() { if (!Q) { - var e = this.options.fallbackOnBody ? document.body : du, t = Ll(Z, !0, Hu, !0, e), n = this.options; - if (Hu) { - for (Lu = e; X(Lu, "position") === "static" && X(Lu, "transform") === "none" && Lu !== document;) Lu = Lu.parentNode; - Lu !== document.body && Lu !== document.documentElement ? (Lu === document && (Lu = Il()), t.top += Lu.scrollTop, t.left += Lu.scrollLeft) : Lu = Il(), Ru = Hl(Lu); + var e = this.options.fallbackOnBody ? document.body : _u, t = Ul(Z, !0, Ju, !0, e), n = this.options; + if (Ju) { + for (Uu = e; X(Uu, "position") === "static" && X(Uu, "transform") === "none" && Uu !== document;) Uu = Uu.parentNode; + Uu !== document.body && Uu !== document.documentElement ? (Uu === document && (Uu = Hl()), t.top += Uu.scrollTop, t.left += Uu.scrollLeft) : Uu = Hl(), Wu = Jl(Uu); } - Q = Z.cloneNode(!0), Nl(Q, n.ghostClass, !1), Nl(Q, n.fallbackClass, !0), Nl(Q, n.dragClass, !0), X(Q, "transition", ""), X(Q, "transform", ""), X(Q, "box-sizing", "border-box"), X(Q, "margin", 0), X(Q, "top", t.top), X(Q, "left", t.left), X(Q, "width", t.width), X(Q, "height", t.height), X(Q, "opacity", "0.8"), X(Q, "position", Hu ? "absolute" : "fixed"), X(Q, "zIndex", "100000"), X(Q, "pointerEvents", "none"), $.ghost = Q, e.appendChild(Q), X(Q, "transform-origin", ku / parseInt(Q.style.width) * 100 + "% " + Au / parseInt(Q.style.height) * 100 + "%"); + Q = Z.cloneNode(!0), zl(Q, n.ghostClass, !1), zl(Q, n.fallbackClass, !0), zl(Q, n.dragClass, !0), X(Q, "transition", ""), X(Q, "transform", ""), X(Q, "box-sizing", "border-box"), X(Q, "margin", 0), X(Q, "top", t.top), X(Q, "left", t.left), X(Q, "width", t.width), X(Q, "height", t.height), X(Q, "opacity", "0.8"), X(Q, "position", Ju ? "absolute" : "fixed"), X(Q, "zIndex", "100000"), X(Q, "pointerEvents", "none"), $.ghost = Q, e.appendChild(Q), X(Q, "transform-origin", Fu / parseInt(Q.style.width) * 100 + "% " + Iu / parseInt(Q.style.height) * 100 + "%"); } }, _onDragStart: function(e, t) { var n = this, r = e.dataTransfer, i = n.options; - if (cu("dragStart", this, { evt: e }), $.eventCanceled) { + if (mu("dragStart", this, { evt: e }), $.eventCanceled) { this._onDrop(); return; } - cu("setupClone", this), $.eventCanceled || (mu = Zl(Z), mu.removeAttribute("id"), mu.draggable = !1, mu.style["will-change"] = "", this._hideClone(), Nl(mu, this.options.chosenClass, !1), $.clone = mu), n.cloneId = ud(function() { - cu("clone", n), !$.eventCanceled && (n.options.removeCloneOnHide || du.insertBefore(mu, Z), n._hideClone(), lu({ + mu("setupClone", this), $.eventCanceled || (bu = ru(Z), bu.removeAttribute("id"), bu.draggable = !1, bu.style["will-change"] = "", this._hideClone(), zl(bu, this.options.chosenClass, !1), $.clone = bu), n.cloneId = gd(function() { + mu("clone", n), !$.eventCanceled && (n.options.removeCloneOnHide || _u.insertBefore(bu, Z), n._hideClone(), hu({ sortable: n, name: "clone" })); - }), !t && Nl(Z, i.dragClass, !0), t ? (Cu = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (Y(document, "mouseup", n._onDrop), Y(document, "touchend", n._onDrop), Y(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, Z)), J(document, "drop", n), X(Z, "transform", "translateZ(0)")), Su = !0, n._dragStartId = ud(n._dragStarted.bind(n, t, e)), J(document, "selectstart", n), ju = !0, window.getSelection().removeAllRanges(), Tl && X(document.body, "user-select", "none"); + }), !t && zl(Z, i.dragClass, !0), t ? (ku = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (Y(document, "mouseup", n._onDrop), Y(document, "touchend", n._onDrop), Y(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, Z)), J(document, "drop", n), X(Z, "transform", "translateZ(0)")), Ou = !0, n._dragStartId = gd(n._dragStarted.bind(n, t, e)), J(document, "selectstart", n), Lu = !0, window.getSelection().removeAllRanges(), jl && X(document.body, "user-select", "none"); }, _onDragOver: function(e) { - var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = $.active, l = bu === s, u = o.sort, d = xu || c, f, p = this, m = !1; - if (zu) return; + var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = $.active, l = Eu === s, u = o.sort, d = Du || c, f, p = this, m = !1; + if (Gu) return; function h(o, s) { - cu(o, p, ml({ + mu(o, p, bl({ evt: e, isOwner: l, axis: f ? "vertical" : "horizontal", @@ -6672,7 +6755,7 @@ $.prototype = { target: n, completed: _, onMove: function(n, i) { - return td(du, t, Z, r, n, Ll(n), e, i); + return sd(_u, t, Z, r, n, Ul(n), e, i); }, changed: v }, s)); @@ -6681,50 +6764,50 @@ $.prototype = { h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState(); } function _(r) { - return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (Nl(Z, xu ? xu.options.ghostClass : c.options.ghostClass, !1), Nl(Z, o.ghostClass, !0)), xu !== p && p !== $.active ? xu = p : p === $.active && xu && (xu = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() { + return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (zl(Z, Du ? Du.options.ghostClass : c.options.ghostClass, !1), zl(Z, o.ghostClass, !0)), Du !== p && p !== $.active ? Du = p : p === $.active && Du && (Du = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() { h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null; - }), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === Z && !Z.animated || n === t && !n.animated) && (Mu = null), !o.dragoverBubble && !e.rootEl && n !== document && (Z.parentNode[$l]._isOutsideThisEl(e.target), !r && Qu(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0; + }), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === Z && !Z.animated || n === t && !n.animated) && (Ru = null), !o.dragoverBubble && !e.rootEl && n !== document && (Z.parentNode[au]._isOutsideThisEl(e.target), !r && id(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0; } function v() { - _u = Vl(Z), yu = Vl(Z, o.draggable), lu({ + Cu = ql(Z), Tu = ql(Z, o.draggable), hu({ sortable: p, name: "change", toEl: t, - newIndex: _u, - newDraggableIndex: yu, + newIndex: Cu, + newDraggableIndex: Tu, originalEvent: e }); } - if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = jl(n, o.draggable, t, !0), h("dragOver"), $.eventCanceled) return m; + if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = Ll(n, o.draggable, t, !0), h("dragOver"), $.eventCanceled) return m; if (Z.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1); - if (Cu = !1, c && !o.disabled && (l ? u || (a = uu !== du) : xu === this || (this.lastPutMode = bu.checkPull(this, c, Z, e)) && s.checkPut(this, c, Z, e))) { - if (f = this._getDirection(e, n) === "vertical", r = Ll(Z), h("dragOverValid"), $.eventCanceled) return m; - if (a) return uu = du, g(), this._hideClone(), h("revert"), $.eventCanceled || (fu ? du.insertBefore(Z, fu) : du.appendChild(Z)), _(!0); - var y = Bl(t, o.draggable); - if (!y || ad(e, f, this) && !y.animated) { + if (ku = !1, c && !o.disabled && (l ? u || (a = gu !== _u) : Du === this || (this.lastPutMode = Eu.checkPull(this, c, Z, e)) && s.checkPut(this, c, Z, e))) { + if (f = this._getDirection(e, n) === "vertical", r = Ul(Z), h("dragOverValid"), $.eventCanceled) return m; + if (a) return gu = _u, g(), this._hideClone(), h("revert"), $.eventCanceled || (vu ? _u.insertBefore(Z, vu) : _u.appendChild(Z)), _(!0); + var y = Kl(t, o.draggable); + if (!y || dd(e, f, this) && !y.animated) { if (y === Z) return _(!1); - if (y && t === e.target && (n = y), n && (i = Ll(n)), td(du, t, Z, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(Z, y.nextSibling) : t.appendChild(Z), uu = t, v(), _(!0); - } else if (y && id(e, f, this)) { - var b = zl(t, 0, o, !0); + if (y && t === e.target && (n = y), n && (i = Ul(n)), sd(_u, t, Z, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(Z, y.nextSibling) : t.appendChild(Z), gu = t, v(), _(!0); + } else if (y && ud(e, f, this)) { + var b = Gl(t, 0, o, !0); if (b === Z) return _(!1); - if (n = b, i = Ll(n), td(du, t, Z, r, n, i, e, !1) !== !1) return g(), t.insertBefore(Z, b), uu = t, v(), _(!0); + if (n = b, i = Ul(n), sd(_u, t, Z, r, n, i, e, !1) !== !1) return g(), t.insertBefore(Z, b), gu = t, v(), _(!0); } else if (n.parentNode === t) { - i = Ll(n); - var x = 0, S, C = Z.parentNode !== t, w = !qu(Z.animated && Z.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = Rl(n, "top", "top") || Rl(Z, "top", "top"), D = E ? E.scrollTop : void 0; - Mu !== n && (S = i[T], Pu = !1, Fu = !w && o.invertSwap || C), x = od(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Fu, Mu === n); + i = Ul(n); + var x = 0, S, C = Z.parentNode !== t, w = !$u(Z.animated && Z.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = Wl(n, "top", "top") || Wl(Z, "top", "top"), D = E ? E.scrollTop : void 0; + Ru !== n && (S = i[T], Bu = !1, Vu = !w && o.invertSwap || C), x = fd(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Vu, Ru === n); var O; if (x !== 0) { - var k = Vl(Z); + var k = ql(Z); do - k -= x, O = uu.children[k]; + k -= x, O = gu.children[k]; while (O && (X(O, "display") === "none" || O === Q)); } if (x === 0 || O === n) return _(!1); - Mu = n, Nu = x; + Ru = n, zu = x; var A = n.nextElementSibling, j = !1; j = x === 1; - var M = td(du, t, Z, r, n, i, e, j); - if (M !== !1) return (M === 1 || M === -1) && (j = M === 1), zu = !0, setTimeout(rd, 30), g(), j && !A ? t.appendChild(Z) : n.parentNode.insertBefore(Z, j ? A : n), E && Xl(E, 0, D - E.scrollTop), uu = Z.parentNode, S !== void 0 && !Fu && (Iu = Math.abs(S - Ll(n)[T])), v(), _(!0); + var M = sd(_u, t, Z, r, n, i, e, j); + if (M !== !1) return (M === 1 || M === -1) && (j = M === 1), Gu = !0, setTimeout(ld, 30), g(), j && !A ? t.appendChild(Z) : n.parentNode.insertBefore(Z, j ? A : n), E && nu(E, 0, D - E.scrollTop), gu = Z.parentNode, S !== void 0 && !Vu && (Hu = Math.abs(S - Ul(n)[T])), v(), _(!0); } if (t.contains(Z)) return _(!1); } @@ -6732,7 +6815,7 @@ $.prototype = { }, _ignoreWhileAnimating: null, _offMoveEvents: function() { - Y(document, "mousemove", this._onTouchMove), Y(document, "touchmove", this._onTouchMove), Y(document, "pointermove", this._onTouchMove), Y(document, "dragover", Qu), Y(document, "mousemove", Qu), Y(document, "touchmove", Qu); + Y(document, "mousemove", this._onTouchMove), Y(document, "touchmove", this._onTouchMove), Y(document, "pointermove", this._onTouchMove), Y(document, "dragover", id), Y(document, "mousemove", id), Y(document, "touchmove", id); }, _offUpEvents: function() { var e = this.el.ownerDocument; @@ -6740,62 +6823,62 @@ $.prototype = { }, _onDrop: function(e) { var t = this.el, n = this.options; - if (_u = Vl(Z), yu = Vl(Z, n.draggable), cu("drop", this, { evt: e }), uu = Z && Z.parentNode, _u = Vl(Z), yu = Vl(Z, n.draggable), $.eventCanceled) { + if (Cu = ql(Z), Tu = ql(Z, n.draggable), mu("drop", this, { evt: e }), gu = Z && Z.parentNode, Cu = ql(Z), Tu = ql(Z, n.draggable), $.eventCanceled) { this._nulling(); return; } - Su = !1, Fu = !1, Pu = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), dd(this.cloneId), dd(this._dragStartId), this.nativeDraggable && (Y(document, "drop", this), Y(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Tl && X(document.body, "user-select", ""), X(Z, "transform", ""), e && (ju && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), Q && Q.parentNode && Q.parentNode.removeChild(Q), (du === uu || xu && xu.lastPutMode !== "clone") && mu && mu.parentNode && mu.parentNode.removeChild(mu), Z && (this.nativeDraggable && Y(Z, "dragend", this), nd(Z), Z.style["will-change"] = "", ju && !Su && Nl(Z, xu ? xu.options.ghostClass : this.options.ghostClass, !1), Nl(Z, this.options.chosenClass, !1), lu({ + Ou = !1, Vu = !1, Bu = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), _d(this.cloneId), _d(this._dragStartId), this.nativeDraggable && (Y(document, "drop", this), Y(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), jl && X(document.body, "user-select", ""), X(Z, "transform", ""), e && (Lu && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), Q && Q.parentNode && Q.parentNode.removeChild(Q), (_u === gu || Du && Du.lastPutMode !== "clone") && bu && bu.parentNode && bu.parentNode.removeChild(bu), Z && (this.nativeDraggable && Y(Z, "dragend", this), cd(Z), Z.style["will-change"] = "", Lu && !Ou && zl(Z, Du ? Du.options.ghostClass : this.options.ghostClass, !1), zl(Z, this.options.chosenClass, !1), hu({ sortable: this, name: "unchoose", - toEl: uu, + toEl: gu, newIndex: null, newDraggableIndex: null, originalEvent: e - }), du === uu ? _u !== gu && _u >= 0 && (lu({ + }), _u === gu ? Cu !== Su && Cu >= 0 && (hu({ sortable: this, name: "update", - toEl: uu, + toEl: gu, originalEvent: e - }), lu({ + }), hu({ sortable: this, name: "sort", - toEl: uu, + toEl: gu, originalEvent: e - })) : (_u >= 0 && (lu({ - rootEl: uu, + })) : (Cu >= 0 && (hu({ + rootEl: gu, name: "add", - toEl: uu, - fromEl: du, + toEl: gu, + fromEl: _u, originalEvent: e - }), lu({ + }), hu({ sortable: this, name: "remove", - toEl: uu, + toEl: gu, originalEvent: e - }), lu({ - rootEl: uu, + }), hu({ + rootEl: gu, name: "sort", - toEl: uu, - fromEl: du, + toEl: gu, + fromEl: _u, originalEvent: e - }), lu({ + }), hu({ sortable: this, name: "sort", - toEl: uu, + toEl: gu, originalEvent: e - })), xu && xu.save()), $.active && ((_u == null || _u === -1) && (_u = gu, yu = vu), lu({ + })), Du && Du.save()), $.active && ((Cu == null || Cu === -1) && (Cu = Su, Tu = wu), hu({ sortable: this, name: "end", - toEl: uu, + toEl: gu, originalEvent: e }), this.save()))), this._nulling(); }, _nulling: function() { - cu("nulling", this), du = Z = uu = Q = fu = mu = pu = hu = Tu = Eu = ju = _u = yu = gu = vu = Mu = Nu = xu = bu = $.dragged = $.ghost = $.clone = $.active = null; + mu("nulling", this), _u = Z = gu = Q = vu = bu = yu = xu = ju = Mu = Lu = Cu = Tu = Su = wu = Ru = zu = Du = Eu = $.dragged = $.ghost = $.clone = $.active = null; var e = this.el; - Bu.forEach(function(t) { + Ku.forEach(function(t) { e.contains(t) && (t.checked = !0); - }), Bu.length = Du = Ou = 0; + }), Ku.length = Nu = Pu = 0; }, handleEvent: function(e) { switch (e.type) { @@ -6805,20 +6888,20 @@ $.prototype = { break; case "dragenter": case "dragover": - Z && (this._onDragOver(e), ed(e)); + Z && (this._onDragOver(e), od(e)); break; case "selectstart": e.preventDefault(); } }, toArray: function() { - for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], jl(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || cd(t)); + for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], Ll(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || md(t)); return e; }, sort: function(e, t) { var n = {}, r = this.el; this.toArray().forEach(function(e, t) { var i = r.children[t]; - jl(i, this.options.draggable, r, !1) && (n[e] = i); + Ll(i, this.options.draggable, r, !1) && (n[e] = i); }, this), t && this.captureAnimationState(), e.forEach(function(e) { n[e] && (r.removeChild(n[e]), r.appendChild(n[e])); }), t && this.animateAll(); @@ -6828,25 +6911,25 @@ $.prototype = { e && e.set && e.set(this); }, closest: function(e, t) { - return jl(e, t || this.options.draggable, this.el, !1); + return Ll(e, t || this.options.draggable, this.el, !1); }, option: function(e, t) { var n = this.options; if (t === void 0) return n[e]; - var r = au.modifyOption(this, e, t); - n[e] = r === void 0 ? t : r, e === "group" && Yu(n); + var r = du.modifyOption(this, e, t); + n[e] = r === void 0 ? t : r, e === "group" && td(n); }, destroy: function() { - cu("destroy", this); + mu("destroy", this); var e = this.el; - e[$l] = null, Y(e, "mousedown", this._onTapStart), Y(e, "touchstart", this._onTapStart), Y(e, "pointerdown", this._onTapStart), this.nativeDraggable && (Y(e, "dragover", this), Y(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) { + e[au] = null, Y(e, "mousedown", this._onTapStart), Y(e, "touchstart", this._onTapStart), Y(e, "pointerdown", this._onTapStart), this.nativeDraggable && (Y(e, "dragover", this), Y(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) { e.removeAttribute("draggable"); - }), this._onDrop(), this._disableDelayedDragEvents(), wu.splice(wu.indexOf(this.el), 1), this.el = e = null; + }), this._onDrop(), this._disableDelayedDragEvents(), Au.splice(Au.indexOf(this.el), 1), this.el = e = null; }, _hideClone: function() { - if (!hu) { - if (cu("hideClone", this), $.eventCanceled) return; - X(mu, "display", "none"), this.options.removeCloneOnHide && mu.parentNode && mu.parentNode.removeChild(mu), hu = !0; + if (!xu) { + if (mu("hideClone", this), $.eventCanceled) return; + X(bu, "display", "none"), this.options.removeCloneOnHide && bu.parentNode && bu.parentNode.removeChild(bu), xu = !0; } }, _showClone: function(e) { @@ -6854,100 +6937,100 @@ $.prototype = { this._hideClone(); return; } - if (hu) { - if (cu("showClone", this), $.eventCanceled) return; - Z.parentNode == du && !this.options.group.revertClone ? du.insertBefore(mu, Z) : fu ? du.insertBefore(mu, fu) : du.appendChild(mu), this.options.group.revertClone && this.animate(Z, mu), X(mu, "display", ""), hu = !1; + if (xu) { + if (mu("showClone", this), $.eventCanceled) return; + Z.parentNode == _u && !this.options.group.revertClone ? _u.insertBefore(bu, Z) : vu ? _u.insertBefore(bu, vu) : _u.appendChild(bu), this.options.group.revertClone && this.animate(Z, bu), X(bu, "display", ""), xu = !1; } } }; -function ed(e) { +function od(e) { e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault(); } -function td(e, t, n, r, i, a, o, s) { - var c, l = e[$l], u = l.options.onMove, d; - return window.CustomEvent && !Sl && !Cl ? c = new CustomEvent("move", { +function sd(e, t, n, r, i, a, o, s) { + var c, l = e[au], u = l.options.onMove, d; + return window.CustomEvent && !Ol && !kl ? c = new CustomEvent("move", { bubbles: !0, cancelable: !0 - }) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || Ll(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d; + }) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || Ul(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d; } -function nd(e) { +function cd(e) { e.draggable = !1; } -function rd() { - zu = !1; +function ld() { + Gu = !1; } -function id(e, t, n) { - var r = Ll(zl(n.el, 0, n.options, !0)), i = Ql(n.el, n.options, Q), a = 10; +function ud(e, t, n) { + var r = Ul(Gl(n.el, 0, n.options, !0)), i = iu(n.el, n.options, Q), a = 10; return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left; } -function ad(e, t, n) { - var r = Ll(Bl(n.el, n.options.draggable)), i = Ql(n.el, n.options, Q), a = 10; +function dd(e, t, n) { + var r = Ul(Kl(n.el, n.options.draggable)), i = iu(n.el, n.options, Q), a = 10; return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top; } -function od(e, t, n, r, i, a, o, s) { +function fd(e, t, n, r, i, a, o, s) { var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1; if (!o) { - if (s && Iu < l * i) { - if (!Pu && (Nu === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (Pu = !0), Pu) f = !0; - else if (Nu === 1 ? c < u + Iu : c > d - Iu) return -Nu; - } else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return sd(t); + if (s && Hu < l * i) { + if (!Bu && (zu === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (Bu = !0), Bu) f = !0; + else if (zu === 1 ? c < u + Hu : c > d - Hu) return -zu; + } else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return pd(t); } return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0; } -function sd(e) { - return Vl(Z) < Vl(e) ? 1 : -1; +function pd(e) { + return ql(Z) < ql(e) ? 1 : -1; } -function cd(e) { +function md(e) { for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n); return r.toString(36); } -function ld(e) { - Bu.length = 0; +function hd(e) { + Ku.length = 0; for (var t = e.getElementsByTagName("input"), n = t.length; n--;) { var r = t[n]; - r.checked && Bu.push(r); + r.checked && Ku.push(r); } } -function ud(e) { +function gd(e) { return setTimeout(e, 0); } -function dd(e) { +function _d(e) { return clearTimeout(e); } -Vu && J(document, "touchmove", function(e) { - ($.active || Su) && e.cancelable && e.preventDefault(); +qu && J(document, "touchmove", function(e) { + ($.active || Ou) && e.cancelable && e.preventDefault(); }), $.utils = { on: J, off: Y, css: X, - find: Fl, + find: Vl, is: function(e, t) { - return !!jl(e, t, e, !1); + return !!Ll(e, t, e, !1); }, - extend: Gl, - throttle: Jl, - closest: jl, - toggleClass: Nl, - clone: Zl, - index: Vl, - nextTick: ud, - cancelNextTick: dd, - detectDirection: Ku, - getChild: zl, - expando: $l + extend: Zl, + throttle: eu, + closest: Ll, + toggleClass: zl, + clone: ru, + index: ql, + nextTick: gd, + cancelNextTick: _d, + detectDirection: Qu, + getChild: Gl, + expando: au }, $.get = function(e) { - return e[$l]; + return e[au]; }, $.mount = function() { var e = [...arguments]; e[0].constructor === Array && (e = e[0]), e.forEach(function(e) { if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`; - e.utils && ($.utils = ml(ml({}, $.utils), e.utils)), au.mount(e); + e.utils && ($.utils = bl(bl({}, $.utils), e.utils)), du.mount(e); }); }, $.create = function(e, t) { return new $(e, t); -}, $.version = bl; -var fd = [], pd, md, hd = !1, gd, _d, vd, yd; -function bd() { +}, $.version = El; +var vd = [], yd, bd, xd = !1, Sd, Cd, wd, Td; +function Ed() { function e() { for (var e in this.defaults = { scroll: !0, @@ -6967,63 +7050,63 @@ function bd() { !this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t); }, drop: function() { - this.sortable.nativeDraggable ? Y(document, "dragover", this._handleAutoScroll) : (Y(document, "pointermove", this._handleFallbackAutoScroll), Y(document, "touchmove", this._handleFallbackAutoScroll), Y(document, "mousemove", this._handleFallbackAutoScroll)), Sd(), xd(), Yl(); + this.sortable.nativeDraggable ? Y(document, "dragover", this._handleAutoScroll) : (Y(document, "pointermove", this._handleFallbackAutoScroll), Y(document, "touchmove", this._handleFallbackAutoScroll), Y(document, "mousemove", this._handleFallbackAutoScroll)), Od(), Dd(), tu(); }, nulling: function() { - vd = md = pd = hd = yd = gd = _d = null, fd.length = 0; + wd = bd = yd = xd = Td = Sd = Cd = null, vd.length = 0; }, _handleFallbackAutoScroll: function(e) { this._handleAutoScroll(e, !0); }, _handleAutoScroll: function(e, t) { var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i); - if (vd = e, t || this.options.forceAutoScrollFallback || Cl || Sl || Tl) { - Cd(e, this.options, a, t); - var o = Wl(a, !0); - hd && (!yd || r !== gd || i !== _d) && (yd && Sd(), yd = setInterval(function() { - var a = Wl(document.elementFromPoint(r, i), !0); - a !== o && (o = a, xd()), Cd(e, n.options, a, t); - }, 10), gd = r, _d = i); + if (wd = e, t || this.options.forceAutoScrollFallback || kl || Ol || jl) { + kd(e, this.options, a, t); + var o = Xl(a, !0); + xd && (!Td || r !== Sd || i !== Cd) && (Td && Od(), Td = setInterval(function() { + var a = Xl(document.elementFromPoint(r, i), !0); + a !== o && (o = a, Dd()), kd(e, n.options, a, t); + }, 10), Sd = r, Cd = i); } else { - if (!this.options.bubbleScroll || Wl(a, !0) === Il()) { - xd(); + if (!this.options.bubbleScroll || Xl(a, !0) === Hl()) { + Dd(); return; } - Cd(e, this.options, Wl(a, !1), !1); + kd(e, this.options, Xl(a, !1), !1); } } - }, fl(e, { + }, vl(e, { pluginName: "scroll", initializeByDefault: !0 }); } -function xd() { - fd.forEach(function(e) { +function Dd() { + vd.forEach(function(e) { clearInterval(e.pid); - }), fd = []; + }), vd = []; } -function Sd() { - clearInterval(yd); +function Od() { + clearInterval(Td); } -var Cd = Jl(function(e, t, n, r) { +var kd = eu(function(e, t, n, r) { if (t.scroll) { - var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = Il(), l = !1, u; - md !== n && (md = n, xd(), pd = t.scroll, u = t.scrollFn, pd === !0 && (pd = Wl(n, !0))); - var d = 0, f = pd; + var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = Hl(), l = !1, u; + bd !== n && (bd = n, Dd(), yd = t.scroll, u = t.scrollFn, yd === !0 && (yd = Xl(n, !0))); + var d = 0, f = yd; do { - var p = f, m = Ll(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = X(p), E = p.scrollLeft, D = p.scrollTop; + var p = f, m = Ul(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = X(p), E = p.scrollLeft, D = p.scrollTop; p === c ? (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll")); var O = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), k = S && (Math.abs(g - a) <= o && D + b < w) - (Math.abs(h - a) <= o && !!D); - if (!fd[d]) for (var A = 0; A <= d; A++) fd[A] || (fd[A] = {}); - (fd[d].vx != O || fd[d].vy != k || fd[d].el !== p) && (fd[d].el = p, fd[d].vx = O, fd[d].vy = k, clearInterval(fd[d].pid), (O != 0 || k != 0) && (l = !0, fd[d].pid = setInterval(function() { - r && this.layer === 0 && $.active._onTouchMove(vd); - var t = fd[this.layer].vy ? fd[this.layer].vy * s : 0, n = fd[this.layer].vx ? fd[this.layer].vx * s : 0; - (typeof u != "function" || u.call($.dragged.parentNode[$l], n, t, e, vd, fd[this.layer].el) === "continue") && Xl(fd[this.layer].el, n, t); + if (!vd[d]) for (var A = 0; A <= d; A++) vd[A] || (vd[A] = {}); + (vd[d].vx != O || vd[d].vy != k || vd[d].el !== p) && (vd[d].el = p, vd[d].vx = O, vd[d].vy = k, clearInterval(vd[d].pid), (O != 0 || k != 0) && (l = !0, vd[d].pid = setInterval(function() { + r && this.layer === 0 && $.active._onTouchMove(wd); + var t = vd[this.layer].vy ? vd[this.layer].vy * s : 0, n = vd[this.layer].vx ? vd[this.layer].vx * s : 0; + (typeof u != "function" || u.call($.dragged.parentNode[au], n, t, e, wd, vd[this.layer].el) === "continue") && nu(vd[this.layer].el, n, t); }.bind({ layer: d }), 24))), d++; - } while (t.bubbleScroll && f !== c && (f = Wl(f, !1))); - hd = l; + } while (t.bubbleScroll && f !== c && (f = Xl(f, !1))); + xd = l; } -}, 30), wd = function(e) { +}, 30), Ad = function(e) { var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget; if (t) { var c = n || i; @@ -7035,8 +7118,8 @@ var Cd = Jl(function(e, t, n, r) { })); } }; -function Td() {} -Td.prototype = { +function jd() {} +jd.prototype = { startIndex: null, dragStart: function(e) { var t = e.oldDraggableIndex; @@ -7045,28 +7128,28 @@ Td.prototype = { onSpill: function(e) { var t = e.dragEl, n = e.putSortable; this.sortable.captureAnimationState(), n && n.captureAnimationState(); - var r = zl(this.sortable.el, this.startIndex, this.options); + var r = Gl(this.sortable.el, this.startIndex, this.options); r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll(); }, - drop: wd -}, fl(Td, { pluginName: "revertOnSpill" }); -function Ed() {} -Ed.prototype = { + drop: Ad +}, vl(jd, { pluginName: "revertOnSpill" }); +function Md() {} +Md.prototype = { onSpill: function(e) { var t = e.dragEl, n = e.putSortable || this.sortable; n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll(); }, - drop: wd -}, fl(Ed, { pluginName: "removeOnSpill" }), $.mount(new bd()), $.mount(Ed, Td); + drop: Ad +}, vl(Md, { pluginName: "removeOnSpill" }), $.mount(new Ed()), $.mount(Md, jd); //#endregion //#region resources/js/components/TaskCard.vue?vue&type=script&setup=true&lang.ts -var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "text-sm font-medium text-heading" }, kd = { class: "mt-2 flex flex-wrap items-center gap-2 text-xs text-muted" }, Ad = ["title"], jd = { class: "mt-3 flex items-center justify-between gap-2" }, Md = { +var Nd = { class: "flex items-start justify-between gap-2" }, Pd = { class: "text-sm font-medium text-heading" }, Fd = { class: "mt-2 flex flex-wrap items-center gap-2 text-xs text-muted" }, Id = ["title"], Ld = { class: "mt-3 flex items-center justify-between gap-2" }, Rd = { key: 0, class: "text-xs tabular-nums text-muted" -}, Nd = { class: "mt-2 flex items-center justify-between" }, Pd = { +}, zd = { class: "mt-2 flex items-center justify-between" }, Bd = { key: 1, class: "text-xs text-subtle" -}, Fd = ["title"], Id = /* @__PURE__ */ l({ +}, Vd = ["title"], Hd = /* @__PURE__ */ l({ __name: "TaskCard", props: { client: {}, @@ -7082,66 +7165,70 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex NORMAL: "bg-primary-50 text-primary-500", HIGH: "bg-alert-warning-bg text-alert-warning-text", URGENT: "bg-alert-error-bg text-alert-error-text" - }, u = B(), d = n(() => nt(r.task)), f = n(() => r.projects.find((e) => e.id === r.task.project_id)), m = n(() => r.task.project_id === null ? null : f.value?.identifier || f.value?.name || null), h = n(() => [f.value?.name, $t(r.task.customer_id)].filter(Boolean).join(" · ")), g = n(() => r.members.find((e) => e.id === r.task.assignee_id)), _ = n(() => r.task.assignee_id === null ? null : g.value ? pt(g.value.name) : `#${r.task.assignee_id}`), y = n(() => g.value?.name ?? (r.task.assignee_id === null ? u("tasks_projects.tasks.unassigned") : `#${r.task.assignee_id}`)), b = n(() => Na(d.value.logged_minutes)); + }, u = B(), d = n(() => rt(r.task)), f = n(() => r.projects.find((e) => e.id === r.task.project_id)), m = n(() => r.task.project_id === null ? null : f.value?.identifier || f.value?.name || null), h = n(() => [f.value?.name, en(r.task.customer_id)].filter(Boolean).join(" · ")), g = n(() => r.members.find((e) => e.id === r.task.assignee_id)), _ = n(() => r.task.assignee_id === null ? null : g.value ? mt(g.value.name) : `#${r.task.assignee_id}`), y = n(() => g.value?.name ?? (r.task.assignee_id === null ? u("tasks_projects.tasks.unassigned") : `#${r.task.assignee_id}`)), b = n(() => Ra(d.value.logged_minutes)); function x(e) { return u(`tasks_projects.tasks.priority.${e.toLowerCase()}`); } return (t, n) => (v(), a("article", { class: "cursor-pointer rounded-lg border border-line-default bg-surface p-3 shadow-sm hover:bg-hover", - onClick: n[1] ||= (t) => s("open", e.task) + onClick: n[2] ||= (t) => s("open", e.task) }, [ - o("div", Dd, [o("p", Od, C(e.task.name), 1), e.task.priority ? (v(), a("span", { + o("div", Nd, [o("p", Pd, [o("button", { + type: "button", + class: "rounded-sm text-start focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + onClick: n[0] ||= A((t) => s("open", e.task), ["stop"]) + }, C(e.task.name), 1)]), e.task.priority ? (v(), a("span", { key: 0, class: p(["shrink-0 rounded-full px-2 py-0.5 text-[11px] font-medium", l[e.task.priority]]) }, C(x(e.task.priority)), 3)) : i("", !0)]), - o("div", kd, [ + o("div", Fd, [ o("span", null, "#" + C(e.task.number), 1), m.value ? (v(), a("span", { key: 0, class: "rounded-sm bg-surface-tertiary px-1.5 py-0.5 text-[11px] text-body", title: h.value - }, C(m.value), 9, Ad)) : i("", !0), - c(da, { state: d.value.invoiced }, null, 8, ["state"]) + }, C(m.value), 9, Id)) : i("", !0), + c(ha, { state: d.value.invoiced }, null, 8, ["state"]) ]), - o("div", jd, [c(go, { + o("div", Ld, [c(xo, { client: e.client, notify: e.notify, task: e.task, members: e.members, - onClick: n[0] ||= A(() => {}, ["stop"]) + onClick: n[1] ||= A(() => {}, ["stop"]) }, null, 8, [ "client", "notify", "task", "members" - ]), d.value.logged_minutes > 0 ? (v(), a("span", Md, C(b.value), 1)) : i("", !0)]), - o("div", Nd, [e.task.due_date ? (v(), a("span", { + ]), d.value.logged_minutes > 0 ? (v(), a("span", Rd, C(b.value), 1)) : i("", !0)]), + o("div", zd, [e.task.due_date ? (v(), a("span", { key: 0, - class: p(["text-xs", w(mt)(e.task.due_date) && !e.task.closed_at ? "font-medium text-status-red" : "text-muted"]) - }, C(w(ut)(e.task.due_date)), 3)) : (v(), a("span", Pd, "-")), _.value ? (v(), a("span", { + class: p(["text-xs", w(ht)(e.task.due_date) && !e.task.closed_at ? "font-medium text-status-red" : "text-muted"]) + }, C(w(dt)(e.task.due_date)), 3)) : (v(), a("span", Bd, "-")), _.value ? (v(), a("span", { key: 2, class: "flex h-6 w-6 items-center justify-center rounded-full bg-primary-50 text-[11px] font-semibold text-primary-500", title: y.value - }, C(_.value), 9, Fd)) : i("", !0)]) + }, C(_.value), 9, Vd)) : i("", !0)]) ])); } -}), Ld = { class: "mt-4" }, Rd = { +}), Ud = { class: "mt-4" }, Wd = { key: 0, class: "mb-3 text-xs text-subtle" -}, zd = { +}, Gd = { key: 1, class: "flex justify-center py-16" -}, Bd = { +}, Kd = { key: 3, class: "flex items-start gap-4 overflow-x-auto pb-4" -}, Vd = { class: "flex items-center justify-between border-b border-line-light px-3 py-2.5" }, Hd = { class: "flex items-center" }, Ud = { class: "text-sm font-semibold text-heading" }, Wd = { class: "ml-2 text-xs text-muted" }, Gd = [ +}, qd = { class: "flex items-center justify-between border-b border-line-light px-3 py-2.5" }, Jd = { class: "flex items-center" }, Yd = { class: "text-sm font-semibold text-heading" }, Xd = { class: "ms-2 text-xs text-muted" }, Zd = [ "aria-label", "title", "onClick" -], Kd = ["data-status-id"], qd = { +], Qd = ["data-status-id"], $d = { key: 0, class: "px-3 pt-2 text-xs text-subtle" -}, Jd = { class: "px-3 pt-2 pb-3" }, Yd = ["onClick"], Xd = /* @__PURE__ */ l({ +}, ef = { class: "px-3 pt-2 pb-3" }, tf = ["onClick"], nf = /* @__PURE__ */ l({ __name: "TasksBoardView", props: { client: { type: [Function, Object] }, @@ -7158,19 +7245,19 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }))), j = n(() => !f.value && d.value.length === 0), M = n(() => G.settings.hide_invoiced_on_board); function N(e) { return (e.tasks ?? []).filter((e) => { - let t = nt(e).invoiced; - return M.value && t === "invoiced" ? !1 : zi(l.filters.status) ? l.filters.status === "invoiced" ? t === "invoiced" : t !== "invoiced" : !0; + let t = rt(e).invoiced; + return M.value && t === "invoiced" ? !1 : Ui(l.filters.status) ? l.filters.status === "invoiced" ? t === "invoiced" : t !== "invoiced" : !0; }); } - E(() => `${l.filters.project}|${l.filters.user}`, () => void P(), { immediate: !0 }), E(et, () => void P()), h(() => { + E(() => `${l.filters.project}|${l.filters.user}`, () => void P(), { immediate: !0 }), E(tt, () => void P()), h(() => { for (let e of T.values()) e.destroy(); T.clear(), O.clear(); }); async function P() { - let e = {}, t = Ki(l.filters.project), n = Ki(l.filters.user); + let e = {}, t = Xi(l.filters.project), n = Xi(l.filters.user); t !== null && (e.project_id = t), n !== null && (e.assignee_id = n), f.value = !0; try { - d.value = await ar(l.client, e), d.value.some((e) => e.tasks.some((e) => e.customer_id !== null)) && en(l.client); + d.value = await or(l.client, e), d.value.some((e) => e.tasks.some((e) => e.customer_id !== null)) && tn(l.client); } catch (e) { l.notify("error", H(e, u("tasks_projects.board.load_failed"))); } finally { @@ -7216,7 +7303,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex let f = N(o), p = f[i - 1] ?? null, m = f[i] ?? null, h = p === null ? 0 : o.tasks.findIndex((e) => e.id === p.id) + 1; o.tasks.splice(h, 0, s); try { - let e = await gr(l.client, s.id, { + let e = await _r(l.client, s.id, { task_status_id: n, before_id: p?.id ?? null, after_id: m?.id ?? null @@ -7233,7 +7320,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex let t = e ?? l.statuses.find((e) => e.is_default) ?? l.statuses[0]; _.value = null, y.value = { task_status_id: t?.id ?? null, - project_id: Ki(l.filters.project) + project_id: Xi(l.filters.project) }, g.value = !0; } function ee(e) { @@ -7248,9 +7335,9 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex } return s({ openCreate: () => z(null) }), (n, s) => { let l = S("BaseSpinner"), h = S("BaseIcon"), b = S("BaseEmptyPlaceholder"); - return v(), a("section", Ld, [ - M.value ? (v(), a("p", Rd, C(w(u)("tasks_projects.board.hidden_invoiced")), 1)) : i("", !0), - f.value && d.value.length === 0 ? (v(), a("div", zd, [c(l, { class: "h-8 w-8 text-primary-500" })])) : j.value ? (v(), r(b, { + return v(), a("section", Ud, [ + M.value ? (v(), a("p", Wd, C(w(u)("tasks_projects.board.hidden_invoiced")), 1)) : i("", !0), + f.value && d.value.length === 0 ? (v(), a("div", Gd, [c(l, { class: "h-8 w-8 text-primary-500" })])) : j.value ? (v(), r(b, { key: 2, title: w(u)("tasks_projects.task_statuses.none"), description: w(u)("tasks_projects.tasks.empty_description") @@ -7260,17 +7347,17 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex class: "mt-5 mb-4 h-16 w-16 text-subtle" })]), _: 1 - }, 8, ["title", "description"])) : (v(), a("div", Bd, [(v(!0), a(e, null, x(d.value, (n) => (v(), a("section", { + }, 8, ["title", "description"])) : (v(), a("div", Kd, [(v(!0), a(e, null, x(d.value, (n) => (v(), a("section", { key: n.status.id, class: "w-64 shrink-0 rounded-xl border border-line-default bg-surface-secondary" }, [ - o("header", Vd, [o("div", Hd, [ + o("header", qd, [o("div", Jd, [ o("span", { - class: p(["mr-2 inline-block h-2.5 w-2.5 shrink-0 rounded-full", n.status.colour ? "" : "bg-line-default"]), + class: p(["me-2 inline-block h-2.5 w-2.5 shrink-0 rounded-full", n.status.colour ? "" : "bg-line-default"]), style: m(n.status.colour ? { backgroundColor: n.status.colour } : void 0) }, null, 6), - o("h3", Ud, C(n.status.name), 1), - o("span", Wd, C(N(n).length), 1) + o("h3", Yd, C(n.status.name), 1), + o("span", Xd, C(N(n).length), 1) ]), o("button", { type: "button", class: "rounded-md p-1 text-subtle hover:bg-hover hover:text-body", @@ -7280,13 +7367,13 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }, [c(h, { name: "PlusIcon", class: "h-4 w-4" - })], 8, Gd)]), + })], 8, Zd)]), o("div", { ref_for: !0, ref: (e) => F(n.status.id, e), "data-status-id": n.status.id, class: "min-h-20 space-y-2 px-3 pt-3" - }, [(v(!0), a(e, null, x(N(n), (e) => (v(), r(Id, { + }, [(v(!0), a(e, null, x(N(n), (e) => (v(), r(Hd, { key: e.id, "data-task-id": e.id, client: t.client, @@ -7302,15 +7389,15 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex "task", "projects", "members" - ]))), 128))], 8, Kd), - N(n).length === 0 ? (v(), a("p", qd, C(w(u)("tasks_projects.board.empty_column")), 1)) : i("", !0), - o("div", Jd, [o("button", { + ]))), 128))], 8, Qd), + N(n).length === 0 ? (v(), a("p", $d, C(w(u)("tasks_projects.board.empty_column")), 1)) : i("", !0), + o("div", ef, [o("button", { type: "button", class: "w-full rounded-md border border-dashed border-line-default py-1.5 text-xs text-muted hover:bg-hover hover:text-body", onClick: (e) => z(n.status) - }, " + " + C(w(u)("tasks_projects.tasks.new_task")), 9, Yd)]) + }, " + " + C(w(u)("tasks_projects.tasks.new_task")), 9, tf)]) ]))), 128))])), - c(ya, { + c(wa, { show: g.value, client: t.client, notify: t.notify, @@ -7337,7 +7424,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex ]); }; } -}), Zd = /* @__PURE__ */ l({ +}), rf = /* @__PURE__ */ l({ __name: "TasksListView", props: { client: { type: [Function, Object] }, @@ -7350,7 +7437,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }, setup(e, { expose: t }) { let n = b(null); - return t({ openCreate: () => n.value?.openCreate() }), (t, i) => (v(), r(To, { + return t({ openCreate: () => n.value?.openCreate() }), (t, i) => (v(), r(Ao, { ref_key: "listRef", ref: n, client: e.client, @@ -7370,10 +7457,10 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex "projects" ])); } -}), Qd = { class: "relative table-container" }, $d = { class: "block max-w-64 truncate" }, ef = { class: "tabular-nums" }, tf = { +}), af = { class: "relative table-container" }, of = { class: "block max-w-64 truncate" }, sf = { class: "tabular-nums" }, cf = { key: 1, class: "text-subtle" -}, nf = /* @__PURE__ */ l({ +}, lf = /* @__PURE__ */ l({ __name: "AllTimeTable", props: { client: { type: [Function, Object] }, @@ -7448,7 +7535,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex key: "actions", label: d("tasks_projects.general.actions"), sortable: !1, - tdClass: "text-right text-sm font-medium" + tdClass: "text-end text-sm font-medium" } ]); E(m, () => T()), E([() => l.memberId, () => l.projectId], () => T()), E(() => l.reloadToken, () => T(!0)); @@ -7462,10 +7549,10 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex m.from = "", m.to = "", m.billing = "ALL"; } function k(e) { - m.from = e ? dt(e) : ""; + m.from = e ? ft(e) : ""; } function A(e) { - m.to = e ? dt(e) : ""; + m.to = e ? ft(e) : ""; } function j(e) { let t = l.members.find((t) => t.id === e); @@ -7478,8 +7565,8 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }; l.memberId !== null && (t.user_id = l.memberId), l.projectId !== null && (t.project_id = l.projectId), m.from !== "" && (t.from = m.from), m.to !== "" && (t.to = m.to), m.billing !== "ALL" && (t.billed = m.billing === "BILLED"); try { - let e = await De(l.client, t), n = e.data ?? []; - return $e(l.client, n.map((e) => e.task_id).filter((e) => typeof e == "number")), { + let e = await Oe(l.client, t), n = e.data ?? []; + return et(l.client, n.map((e) => e.task_id).filter((e) => typeof e == "number")), { data: n, pagination: N(e.meta, n.length) }; @@ -7542,18 +7629,18 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }, 8, ["label"]) ]), _: 1 - }), o("div", Qd, [c(F, { + }), o("div", af, [c(F, { ref_key: "tableRef", ref: f, data: M, columns: _.value, class: "mt-3" }, { - "cell-date": D(({ row: e }) => [s(C(w(ut)(w(Ia)(e.data.started_at))), 1)]), + "cell-date": D(({ row: e }) => [s(C(w(dt)(w(Va)(e.data.started_at))), 1)]), "cell-member": D(({ row: e }) => [s(C(j(e.data.user_id)), 1)]), - "cell-task": D(({ row: e }) => [s(C(w(Ze)(e.data.task_id)), 1)]), - "cell-description": D(({ row: e }) => [o("span", $d, C(e.data.description || "-"), 1)]), - "cell-duration": D(({ row: e }) => [o("span", ef, C(w(Na)(e.data.duration_minutes)), 1)]), + "cell-task": D(({ row: e }) => [s(C(w(Qe)(e.data.task_id)), 1)]), + "cell-description": D(({ row: e }) => [o("span", of, C(e.data.description || "-"), 1)]), + "cell-duration": D(({ row: e }) => [o("span", sf, C(w(Ra)(e.data.duration_minutes)), 1)]), "cell-billable": D(({ row: e }) => [c(x, { class: p(["rounded-full", e.data.billable ? "bg-primary-50! text-primary-500!" : "bg-surface-tertiary! text-muted!"]) }, { default: D(() => [s(C(e.data.billable ? w(d)("tasks_projects.time.billable") : w(d)("tasks_projects.time.non_billable")), 1)]), _: 2 @@ -7561,53 +7648,53 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex "cell-amount": D(({ row: e }) => [e.data.billable ? (v(), r(T, { key: 0, amount: e.data.amount - }, null, 8, ["amount"])) : (v(), a("span", tf, "-"))]), - "cell-actions": D(({ row: e }) => [c(P, null, { + }, null, 8, ["amount"])) : (v(), a("span", cf, "-"))]), + "cell-actions": D(({ row: t }) => [c(P, { label: e.$t("tasks_projects.general.actions") }, { activator: D(() => [c(E, { name: "EllipsisHorizontalIcon", class: "h-5 text-muted" })]), - default: D(() => [c(N, { onClick: (t) => u("edit", e.data) }, { + default: D(() => [c(N, { onClick: (e) => u("edit", t.data) }, { default: D(() => [c(E, { name: "PencilIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(d)("tasks_projects.general.edit")), 1)]), _: 1 - }, 8, ["onClick"]), e.data.invoice_id === null ? (v(), r(N, { + }, 8, ["onClick"]), t.data.invoice_id === null ? (v(), r(N, { key: 0, - onClick: (t) => u("delete", e.data) + onClick: (e) => u("delete", t.data) }, { default: D(() => [c(E, { name: "TrashIcon", - class: "mr-3 h-5 w-5 text-subtle group-hover:text-muted" + class: "me-3 h-5 w-5 text-subtle group-hover:text-muted" }), s(" " + C(w(d)("tasks_projects.general.delete")), 1)]), _: 1 }, 8, ["onClick"])) : i("", !0)]), _: 2 - }, 1024)]), + }, 1032, ["label"])]), _: 1 }, 8, ["columns"])])]); }; } -}), rf = { class: "mt-4 flex flex-wrap items-center justify-between gap-3" }, af = { class: "flex items-center gap-2" }, of = { class: "ml-1 text-sm text-muted" }, sf = { class: "flex items-center gap-2 text-sm" }, cf = { class: "text-muted" }, lf = { class: "text-lg font-semibold tabular-nums text-heading" }, uf = { +}), uf = { class: "mt-4 flex flex-wrap items-center justify-between gap-3" }, df = { class: "flex items-center gap-2" }, ff = { class: "ms-1 text-sm text-muted" }, pf = { class: "flex items-center gap-2 text-sm" }, mf = { class: "text-muted" }, hf = { class: "text-lg font-semibold tabular-nums text-heading" }, gf = { key: 0, class: "mt-6 text-sm text-muted" -}, df = { +}, _f = { key: 1, class: "mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-7" -}, ff = { class: "flex items-baseline justify-between" }, pf = { class: "text-xs font-semibold tracking-wide text-heading uppercase" }, mf = { class: "text-xs text-muted" }, hf = { class: "text-sm font-medium tabular-nums text-heading" }, gf = { class: "mt-3 flex-1 space-y-2" }, _f = ["onClick"], vf = { class: "flex items-center justify-between gap-2" }, yf = { class: "truncate text-xs font-medium text-heading" }, bf = { class: "shrink-0 text-xs tabular-nums text-muted" }, xf = { +}, vf = { class: "flex items-baseline justify-between" }, yf = { class: "text-xs font-semibold tracking-wide text-heading uppercase" }, bf = { class: "text-xs text-muted" }, xf = { class: "text-sm font-medium tabular-nums text-heading" }, Sf = { class: "mt-3 flex-1 space-y-2" }, Cf = ["onClick"], wf = { class: "flex items-center justify-between gap-2" }, Tf = { class: "truncate text-xs font-medium text-heading" }, Ef = { class: "shrink-0 text-xs tabular-nums text-muted" }, Df = { key: 0, class: "mt-1 block truncate text-xs text-muted" -}, Sf = { class: "mt-1 flex items-center gap-1" }, Cf = { class: "text-[11px] text-subtle" }, wf = { +}, Of = { class: "mt-1 flex items-center gap-1" }, kf = { class: "text-[11px] text-subtle" }, Af = { key: 0, class: "text-[11px] text-subtle" -}, Tf = { +}, jf = { key: 0, class: "py-2 text-xs text-subtle" -}, Ef = ["onClick"], Df = { +}, Mf = ["onClick"], Nf = { key: 2, class: "mt-4 text-center text-sm text-subtle" -}, Of = /* @__PURE__ */ l({ +}, Pf = /* @__PURE__ */ l({ __name: "WeekTimesheet", props: { client: { type: [Function, Object] }, @@ -7619,22 +7706,22 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }, emits: ["add", "edit"], setup(t, { emit: l }) { - let u = t, d = l, f = B(), m = b(Ba(/* @__PURE__ */ new Date(), u.weekStart)), h = b([]), g = b(!1), _ = n(() => Va(m.value)), y = n(() => { + let u = t, d = l, f = B(), m = b(Ga(/* @__PURE__ */ new Date(), u.weekStart)), h = b([]), g = b(!1), _ = n(() => Ka(m.value)), y = n(() => { let e = _.value[0], t = _.value[_.value.length - 1]; - return `${Wa(e).day} - ${Wa(t).day}`; + return `${Ya(e).day} - ${Ya(t).day}`; }), T = n(() => _.value.map((e) => { - let t = Ua(e), n = h.value.filter((e) => Ia(e.started_at) === t), r = Wa(e); + let t = Ja(e), n = h.value.filter((e) => Va(e.started_at) === t), r = Ya(e); return { key: t, weekday: r.weekday, day: r.day, - today: Ga(e), + today: Xa(e), entries: n, minutes: A(n) }; })), O = n(() => A(h.value)), k = n(() => !g.value && h.value.length === 0); E(() => u.weekStart, (e) => { - m.value = Ba(m.value, e); + m.value = Ga(m.value, e); }), E([ m, () => u.userId, @@ -7653,12 +7740,12 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex try { let e = { user_id: u.userId, - from: Ua(_.value[0]), - to: Ua(_.value[_.value.length - 1]) + from: Ja(_.value[0]), + to: Ja(_.value[_.value.length - 1]) }; u.projectId && (e.project_id = u.projectId); - let t = await Oe(u.client, e); - h.value = t, $e(u.client, t.map((e) => e.task_id).filter((e) => typeof e == "number")); + let t = await ke(u.client, e); + h.value = t, et(u.client, t.map((e) => e.task_id).filter((e) => typeof e == "number")); } catch (e) { h.value = [], u.notify("error", H(e, f("tasks_projects.time.load_failed"))); } finally { @@ -7666,19 +7753,20 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex } } function M(e) { - m.value = Ha(m.value, e * 7); + m.value = qa(m.value, e * 7); } function N() { - m.value = Ba(/* @__PURE__ */ new Date(), u.weekStart); + m.value = Ga(/* @__PURE__ */ new Date(), u.weekStart); } return (n, l) => { let u = S("BaseIcon"), m = S("BaseButton"), h = S("BaseSpinner"); return v(), a("section", null, [ - o("header", rf, [o("div", af, [ + o("header", uf, [o("div", df, [ c(m, { variant: "white", size: "sm", title: w(f)("tasks_projects.time.previous_week"), + "aria-label": w(f)("tasks_projects.time.previous_week"), onClick: l[0] ||= (e) => M(-1) }, { default: D(() => [c(u, { @@ -7686,7 +7774,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex class: "h-4 w-4" })]), _: 1 - }, 8, ["title"]), + }, 8, ["title", "aria-label"]), c(m, { variant: "white", size: "sm", @@ -7699,6 +7787,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex variant: "white", size: "sm", title: w(f)("tasks_projects.time.next_week"), + "aria-label": w(f)("tasks_projects.time.next_week"), onClick: l[1] ||= (e) => M(1) }, { default: D(() => [c(u, { @@ -7706,34 +7795,34 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex class: "h-4 w-4" })]), _: 1 - }, 8, ["title"]), - o("span", of, C(y.value), 1) - ]), o("div", sf, [ - o("span", cf, C(w(f)("tasks_projects.time.week_total")), 1), - o("span", lf, C(w(Na)(O.value)), 1), + }, 8, ["title", "aria-label"]), + o("span", ff, C(y.value), 1) + ]), o("div", pf, [ + o("span", mf, C(w(f)("tasks_projects.time.week_total")), 1), + o("span", hf, C(w(Ra)(O.value)), 1), g.value ? (v(), r(h, { key: 0, class: "h-4 w-4 text-primary-500" })) : i("", !0) ])]), - t.userId === null ? (v(), a("p", uf, C(w(f)("tasks_projects.time.unknown_user")), 1)) : (v(), a("div", df, [(v(!0), a(e, null, x(T.value, (t) => (v(), a("article", { + t.userId === null ? (v(), a("p", gf, C(w(f)("tasks_projects.time.unknown_user")), 1)) : (v(), a("div", _f, [(v(!0), a(e, null, x(T.value, (t) => (v(), a("article", { key: t.key, class: p(["flex min-h-40 flex-col rounded-xl border bg-surface p-3", t.today ? "border-primary-400" : "border-line-default"]) }, [ - o("header", ff, [o("div", null, [o("p", pf, C(t.weekday), 1), o("p", mf, C(t.day), 1)]), o("span", hf, C(w(Na)(t.minutes)), 1)]), - o("ul", gf, [(v(!0), a(e, null, x(t.entries, (e) => (v(), a("li", { key: e.id }, [o("button", { + o("header", vf, [o("div", null, [o("p", yf, C(t.weekday), 1), o("p", bf, C(t.day), 1)]), o("span", xf, C(w(Ra)(t.minutes)), 1)]), + o("ul", Sf, [(v(!0), a(e, null, x(t.entries, (e) => (v(), a("li", { key: e.id }, [o("button", { type: "button", - class: "w-full rounded-md border border-line-light px-2 py-2 text-left hover:bg-hover", + class: "w-full rounded-md border border-line-light px-2 py-2 text-start hover:bg-hover", onClick: (t) => d("edit", e) }, [ - o("span", vf, [o("span", yf, C(w(Ze)(e.task_id)), 1), o("span", bf, C(w(Na)(e.duration_minutes)), 1)]), - e.description ? (v(), a("span", xf, C(e.description), 1)) : i("", !0), - o("span", Sf, [ + o("span", wf, [o("span", Tf, C(w(Qe)(e.task_id)), 1), o("span", Ef, C(w(Ra)(e.duration_minutes)), 1)]), + e.description ? (v(), a("span", Df, C(e.description), 1)) : i("", !0), + o("span", Of, [ o("span", { class: p(["inline-block h-1.5 w-1.5 rounded-full", e.billable ? "bg-status-green" : "bg-line-strong"]) }, null, 2), - o("span", Cf, C(e.billable ? w(f)("tasks_projects.time.billable") : w(f)("tasks_projects.time.non_billable")), 1), - e.invoice_id === null ? i("", !0) : (v(), a("span", wf, " - " + C(w(f)("tasks_projects.time.billed")), 1)) + o("span", kf, C(e.billable ? w(f)("tasks_projects.time.billable") : w(f)("tasks_projects.time.non_billable")), 1), + e.invoice_id === null ? i("", !0) : (v(), a("span", Af, " - " + C(w(f)("tasks_projects.time.billed")), 1)) ]) - ], 8, _f)]))), 128)), t.entries.length === 0 ? (v(), a("li", Tf, C(w(f)("tasks_projects.time.no_entries")), 1)) : i("", !0)]), + ], 8, Cf)]))), 128)), t.entries.length === 0 ? (v(), a("li", jf, C(w(f)("tasks_projects.time.no_entries")), 1)) : i("", !0)]), o("button", { type: "button", class: "mt-2 flex items-center justify-center gap-1 rounded-md border border-dashed border-line-default py-1.5 text-xs text-muted hover:bg-hover hover:text-heading", @@ -7741,16 +7830,16 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex }, [c(u, { name: "PlusIcon", class: "h-4 w-4" - }), s(" " + C(w(f)("tasks_projects.time.add_entry")), 1)], 8, Ef) + }), s(" " + C(w(f)("tasks_projects.time.add_entry")), 1)], 8, Mf) ], 2))), 128))])), - k.value && t.userId !== null ? (v(), a("p", Df, C(w(f)("tasks_projects.time.empty_description")), 1)) : i("", !0) + k.value && t.userId !== null ? (v(), a("p", Nf, C(w(f)("tasks_projects.time.empty_description")), 1)) : i("", !0) ]); }; } -}), kf = { +}), Ff = { key: 0, class: "mt-4 flex gap-6 border-b border-line-default" -}, Af = 5, jf = /* @__PURE__ */ l({ +}, If = 5, Lf = /* @__PURE__ */ l({ __name: "TasksWeekView", props: { client: { type: [Function, Object] }, @@ -7761,22 +7850,22 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex projects: {} }, setup(e) { - let t = e, s = B(), l = b("MINE"), u = b(!1), d = b(!1), f = b(null), m = b(Ua(/* @__PURE__ */ new Date())), h = b(0), _ = n(() => G.settings.week_start), y = n(() => Ki(t.filters.project)), x = n(() => Ki(t.filters.user) ?? G.userId); - g(() => void S()), E(et, () => { + let t = e, s = B(), l = b("MINE"), u = b(!1), d = b(!1), f = b(null), m = b(Ja(/* @__PURE__ */ new Date())), h = b(0), _ = n(() => G.settings.week_start), y = n(() => Xi(t.filters.project)), x = n(() => Xi(t.filters.user) ?? G.userId); + g(() => void S()), E(tt, () => { h.value += 1; }); async function S() { - G.userId === null && await xa(t.client), u.value = G.settings.members_see_all_time || await T(); + G.userId === null && await Ea(t.client), u.value = G.settings.members_see_all_time || await T(); } async function T() { try { - return ((await De(t.client, { limit: Af })).data ?? []).some((e) => e.user_id !== G.userId); + return ((await Oe(t.client, { limit: If })).data ?? []).some((e) => e.user_id !== G.userId); } catch { return !1; } } function D(e) { - f.value = null, m.value = e ?? Ua(/* @__PURE__ */ new Date()), d.value = !0; + f.value = null, m.value = e ?? Ja(/* @__PURE__ */ new Date()), d.value = !0; } function O(e) { f.value = e, d.value = !0; @@ -7790,7 +7879,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex } async function j(e) { if (window.confirm(s("tasks_projects.time.delete_confirm"))) try { - await je(t.client, e.id), t.notify("success", s("tasks_projects.time.deleted")), h.value += 1, V(); + await Me(t.client, e.id), t.notify("success", s("tasks_projects.time.deleted")), h.value += 1, V(); } catch (e) { t.notify("error", H(e, s("tasks_projects.time.delete_failed"))); } @@ -7799,7 +7888,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex return l.value === e ? "border-primary-500 text-primary-500" : "border-transparent text-muted hover:border-line-strong hover:text-heading"; } return (t, n) => (v(), a("section", null, [ - u.value ? (v(), a("nav", kf, [o("button", { + u.value ? (v(), a("nav", Ff, [o("button", { type: "button", class: p(["-mb-px border-b-2 px-1 pb-3 text-sm font-medium", M("MINE")]), onClick: n[0] ||= (e) => l.value = "MINE" @@ -7808,7 +7897,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex class: p(["-mb-px border-b-2 px-1 pb-3 text-sm font-medium", M("ALL")]), onClick: n[1] ||= (e) => l.value = "ALL" }, C(w(s)("tasks_projects.time.all_time")), 3)])) : i("", !0), - l.value === "MINE" ? (v(), r(Of, { + l.value === "MINE" ? (v(), r(Pf, { key: 1, client: e.client, notify: e.notify, @@ -7825,12 +7914,12 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex "project-id", "week-start", "reload-token" - ])) : (v(), r(nf, { + ])) : (v(), r(lf, { key: 2, client: e.client, notify: e.notify, members: e.members, - "member-id": w(Ki)(e.filters.user), + "member-id": w(Xi)(e.filters.user), "project-id": y.value, "reload-token": h.value, onEdit: O, @@ -7843,7 +7932,7 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex "project-id", "reload-token" ])), - c(zo, { + c(Go, { show: d.value, client: e.client, notify: e.notify, @@ -7861,45 +7950,45 @@ var Dd = { class: "flex items-start justify-between gap-2" }, Od = { class: "tex ]) ])); } -}), Mf = { +}), Rf = { viewTask: `${U}:view-task`, viewOwnTime: `${U}:view-own-time` }; -function Nf(e) { - e.addMessages(qs), e.registerPage({ +function zf(e) { + e.addMessages($s), e.registerPage({ id: "tasks", module: U, path: "", - component: sn(e, ul), + component: cn(e, gl), meta: { - ability: Mf.viewTask, + ability: Rf.viewTask, title: "tasks_projects.tasks.title" }, children: [ { id: "list", path: "", - component: sn(e, Zd), + component: cn(e, rf), meta: { - ability: Mf.viewTask, + ability: Rf.viewTask, title: "tasks_projects.tasks.views.list" } }, { id: "board", path: "board", - component: sn(e, Xd), + component: cn(e, nf), meta: { - ability: Mf.viewTask, + ability: Rf.viewTask, title: "tasks_projects.board.title" } }, { id: "week", path: "week", - component: sn(e, jf), + component: cn(e, Lf), meta: { - ability: Mf.viewOwnTime, + ability: Rf.viewOwnTime, title: "tasks_projects.time.title" } } @@ -7908,36 +7997,36 @@ function Nf(e) { id: "task", module: U, path: "tasks/:id", - component: sn(e, rl), + component: cn(e, ll), meta: { - ability: Mf.viewTask, + ability: Rf.viewTask, title: "tasks_projects.tasks.title" } }), e.registerPage({ id: "time", module: U, path: "time", - component: Pf(e), + component: Bf(e), meta: { - ability: Mf.viewOwnTime, + ability: Rf.viewOwnTime, title: "tasks_projects.time.title" } }); } -function Pf(e) { +function Bf(e) { return l({ setup: () => (g(() => { e.router.replace(W.week); }), () => null) }); } //#endregion //#region resources/js/components/QuickStartOverlay.vue?vue&type=script&setup=true&lang.ts -var Ff = ["aria-label"], If = { class: "flex items-center justify-between border-b border-line-default px-4 py-3" }, Lf = { class: "text-sm font-semibold text-heading" }, Rf = ["aria-label"], zf = { class: "space-y-4 px-4 py-4" }, Bf = { class: "truncate text-sm font-medium text-heading" }, Vf = { class: "mt-1 text-2xl font-semibold tabular-nums text-primary-500" }, Hf = { +var Vf = ["aria-label"], Hf = { class: "flex items-center justify-between border-b border-line-default px-4 py-3" }, Uf = { class: "text-sm font-semibold text-heading" }, Wf = ["aria-label"], Gf = { class: "space-y-4 px-4 py-4" }, Kf = { class: "truncate text-sm font-medium text-heading" }, qf = { class: "mt-1 text-2xl font-semibold tabular-nums text-primary-500" }, Jf = { key: 0, class: "mt-1 text-xs text-muted" -}, Uf = { class: "flex items-center justify-between" }, Wf = ["title", "aria-label"], Gf = { +}, Yf = { class: "flex items-center justify-between" }, Xf = ["title", "aria-label"], Zf = { key: 0, class: "tabular-nums" -}, Kf = "[aria-label=\"Open AI Assistant\"]", qf = "/admin/settings", Jf = /* @__PURE__ */ l({ +}, Qf = "[aria-label=\"Open AI Assistant\"]", $f = "/admin/settings", ep = /* @__PURE__ */ l({ __name: "QuickStartOverlay", props: { client: { type: [Function, Object] }, @@ -7950,9 +8039,9 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border let u = e, d = l, f = B(), m = b(!1), _ = b(window.location.pathname), y = b(!1), x, T = n(() => ({ notify: u.notify, t: f - })), O = n(() => Ze(q.running?.task_id ?? null)), A = n(() => Ma(q.elapsedSeconds)), j = n(() => q.stopPrompt !== null || q.startPrompt !== null), M = n(() => j.value || _.value.startsWith(qf)), N = n(() => y.value ? "bottom-24" : "bottom-5"); + })), O = n(() => Qe(q.running?.task_id ?? null)), A = n(() => La(q.elapsedSeconds)), j = n(() => q.stopPrompt !== null || q.startPrompt !== null), M = n(() => j.value || _.value.startsWith($f)), N = n(() => y.value ? "bottom-24" : "bottom-5"); function P() { - y.value = Array.from(document.querySelectorAll(Kf)).some((e) => window.getComputedStyle(e).position === "fixed"); + y.value = Array.from(document.querySelectorAll(Qf)).some((e) => window.getComputedStyle(e).position === "fixed"); } E(() => u.enabled, (e) => { e || F(); @@ -7985,13 +8074,13 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border let u = S("BaseIcon"), d = S("BaseButton"); return v(), r(t, { to: "body" }, [e.enabled && !M.value ? (v(), a("div", { key: 0, - class: p(["fixed right-5 z-40 flex flex-col items-end gap-3", N.value]) + class: p(["fixed end-5 z-40 flex flex-col items-end gap-3", N.value]) }, [m.value && w(q).running !== null ? (v(), a("section", { key: 0, class: "w-80 max-w-[calc(100vw-3rem)] rounded-xl border border-line-default bg-surface shadow-2xl", "aria-label": w(f)("tasks_projects.timer.panel_title"), onKeydown: k(F, ["esc"]) - }, [o("header", If, [o("h2", Lf, C(w(f)("tasks_projects.timer.running")), 1), o("button", { + }, [o("header", Hf, [o("h2", Uf, C(w(f)("tasks_projects.timer.running")), 1), o("button", { type: "button", class: "rounded p-1 text-subtle hover:bg-hover hover:text-heading", "aria-label": w(f)("tasks_projects.timer.close"), @@ -7999,11 +8088,11 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(u, { name: "XMarkIcon", class: "h-5 w-5" - })], 8, Rf)]), o("div", zf, [o("div", null, [ - o("p", Bf, C(O.value), 1), - o("p", Vf, C(A.value), 1), - w(q).running.description ? (v(), a("p", Hf, C(w(q).running.description), 1)) : i("", !0) - ]), o("div", Uf, [o("button", { + })], 8, Wf)]), o("div", Gf, [o("div", null, [ + o("p", Kf, C(O.value), 1), + o("p", qf, C(A.value), 1), + w(q).running.description ? (v(), a("p", Jf, C(w(q).running.description), 1)) : i("", !0) + ]), o("div", Yf, [o("button", { type: "button", class: "text-xs text-primary-500 hover:underline", onClick: R @@ -8018,7 +8107,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, null, 8, ["class"])]), default: D(() => [s(" " + C(w(f)("tasks_projects.timer.stop")), 1)]), _: 1 - }, 8, ["disabled"])])])], 40, Ff)) : i("", !0), o("button", { + }, 8, ["disabled"])])])], 40, Vf)) : i("", !0), o("button", { type: "button", class: p(["flex items-center justify-center gap-2 rounded-full bg-btn-primary text-sm font-medium text-white shadow-lg hover:bg-btn-primary-hover", w(q).running === null ? "h-14 w-14 p-0" : "h-14 px-5"]), title: w(f)("tasks_projects.timer.quick_start"), @@ -8027,29 +8116,29 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(u, { name: w(q).running === null ? "ClockIcon" : "StopIcon", class: "h-5 w-5 text-white" - }, null, 8, ["name"]), w(q).running === null ? i("", !0) : (v(), a("span", Gf, C(A.value), 1))], 10, Wf)], 2)) : i("", !0)]); + }, null, 8, ["name"]), w(q).running === null ? i("", !0) : (v(), a("span", Zf, C(A.value), 1))], 10, Xf)], 2)) : i("", !0)]); }; } -}), Yf = { class: "flex w-full items-center justify-between" }, Xf = { class: "space-y-5 px-6 py-6" }, Zf = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, Qf = 0, $f = -1, ep = 100, tp = 10, np = /* @__PURE__ */ l({ +}), tp = { class: "flex w-full items-center justify-between" }, np = ["aria-label"], rp = { class: "space-y-5 px-6 py-6" }, ip = { class: "flex justify-end space-x-3 border-t border-line-default px-6 py-4" }, ap = 0, op = -1, sp = 100, cp = 10, lp = /* @__PURE__ */ l({ __name: "StartTimerModal", props: { client: { type: [Function, Object] }, notify: { type: Function } }, setup(e) { - let t = e, i = B(), a = b([]), l = b(Qf), u = b(null), d = b(""), m = b(!0), h = n(() => q.startPrompt !== null), g = n(() => [{ - id: Qf, + let t = e, i = B(), a = b([]), l = b(ap), u = b(null), d = b(""), m = b(!0), h = n(() => q.startPrompt !== null), g = n(() => [{ + id: ap, label: i("tasks_projects.timer.any_project") }, ...a.value]), _ = n(() => g.value.find((e) => e.id === l.value) ?? null); E(() => q.startPrompt, (e) => { - e !== null && (l.value = typeof e.projectId == "number" ? e.projectId : Qf, u.value = null, d.value = "", m.value = !0, y(), typeof e.taskId == "number" && x(e.taskId)); + e !== null && (l.value = typeof e.projectId == "number" ? e.projectId : ap, u.value = null, d.value = "", m.value = !0, y(), typeof e.taskId == "number" && x(e.taskId)); }), E(l, () => { u.value = null; }); async function y() { try { - let e = await Ht(t.client, { - limit: ep, + let e = await Ut(t.client, { + limit: sp, status: "ACTIVE", sort_by: "name" }); @@ -8063,8 +8152,8 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border } async function x(e) { try { - let n = await He(t.client, e); - Qe(n), typeof n.project_id == "number" && (l.value = n.project_id), await f(), j(T(n)); + let n = await Ue(t.client, e); + $e(n), typeof n.project_id == "number" && (l.value = n.project_id), await f(), j(T(n)); } catch {} } function T(e) { @@ -8078,15 +8167,15 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border async function O(e) { let n = (e ?? "").trim(); try { - let e = await Ve(t.client, n, { - projectId: l.value === Qf ? null : l.value, + let e = await He(t.client, n, { + projectId: l.value === ap ? null : l.value, invoiced: 0, - limit: tp + limit: cp }); - e.forEach(Qe); + e.forEach($e); let r = e.map(T); return r.length === 0 && n !== "" && r.push({ - id: $f, + id: op, label: i("tasks_projects.timer.create_and_start", { name: n }), name: n, billable: !0 @@ -8096,7 +8185,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border } } function k(e) { - l.value = e?.id ?? Qf; + l.value = e?.id ?? ap; } function j(e) { u.value = e, m.value = e === null || e.billable; @@ -8104,8 +8193,8 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border function M() { let e = u.value; if (e === null) return; - let t = d.value.trim() || null, n = l.value === Qf ? null : l.value; - q.answerStart(e.id === $f ? { + let t = d.value.trim() || null, n = l.value === ap ? null : l.value; + q.answerStart(e.id === op ? { create: { name: e.name, projectId: n @@ -8127,12 +8216,16 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border show: h.value, onClose: N }, { - header: D(() => [o("div", Yf, [o("span", null, C(w(i)("tasks_projects.timer.start_title")), 1), c(n, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", tp, [o("span", null, C(w(i)("tasks_projects.timer.start_title")), 1), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(i)("tasks_projects.general.close"), onClick: N - })])]), - default: D(() => [o("form", { onSubmit: A(M, ["prevent"]) }, [o("div", Xf, [ + }, [c(n, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, np)])]), + default: D(() => [o("form", { onSubmit: A(M, ["prevent"]) }, [o("div", rp, [ c(f, { label: w(i)("tasks_projects.time.filters.project") }, { default: D(() => [c(a, { "model-value": _.value, @@ -8192,7 +8285,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, null, 8, ["modelValue"])]), _: 1 }, 8, ["label"]) - ]), o("div", Zf, [c(x, { + ]), o("div", ip, [c(x, { type: "button", variant: "primary-outline", onClick: N @@ -8216,16 +8309,16 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, 8, ["show"]); }; } -}), rp = { class: "flex w-full items-center justify-between" }, ip = { class: "space-y-5 px-6 py-6" }, ap = { class: "truncate text-sm font-medium text-heading" }, op = { class: "mt-1 text-3xl font-semibold tabular-nums text-primary-500" }, sp = { class: "mt-1 text-xs text-muted" }, cp = { class: "border-t border-line-default px-6 py-4" }, lp = { +}), up = { class: "flex w-full items-center justify-between" }, dp = ["aria-label"], fp = { class: "space-y-5 px-6 py-6" }, pp = { class: "truncate text-sm font-medium text-heading" }, mp = { class: "mt-1 text-3xl font-semibold tabular-nums text-primary-500" }, hp = { class: "mt-1 text-xs text-muted" }, gp = { class: "border-t border-line-default px-6 py-4" }, _p = { key: 0, class: "flex flex-wrap items-center justify-between gap-3" -}, up = { class: "text-sm text-body" }, dp = { class: "flex space-x-3" }, fp = { +}, vp = { class: "text-sm text-body" }, yp = { class: "flex space-x-3" }, bp = { key: 1, class: "flex items-center justify-between" -}, pp = { class: "flex space-x-3" }, mp = /* @__PURE__ */ l({ +}, xp = { class: "flex space-x-3" }, Sp = /* @__PURE__ */ l({ __name: "StopTimerModal", setup(e) { - let t = B(), i = b(""), l = b(!0), u = b(!1), d = n(() => q.stopPrompt !== null), f = n(() => Ze(q.stopPrompt?.entry.task_id ?? null)), m = n(() => Ma(q.elapsedSeconds)), h = n(() => G.settings.rounding_minutes), g = n(() => Na(Fa(Math.round(q.elapsedSeconds / 60), h.value, G.settings.rounding_direction))), _ = n(() => h.value > 1 ? t("tasks_projects.timer.saved_as", { + let t = B(), i = b(""), l = b(!0), u = b(!1), d = n(() => q.stopPrompt !== null), f = n(() => Qe(q.stopPrompt?.entry.task_id ?? null)), m = n(() => La(q.elapsedSeconds)), h = n(() => G.settings.rounding_minutes), g = n(() => Ra(Ba(Math.round(q.elapsedSeconds / 60), h.value, G.settings.rounding_direction))), _ = n(() => h.value > 1 ? t("tasks_projects.timer.saved_as", { duration: g.value, increment: h.value }) : t("tasks_projects.timer.saved_as_exact", { duration: g.value })); @@ -8251,16 +8344,20 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border show: d.value, onClose: T }, { - header: D(() => [o("div", rp, [o("span", null, C(w(t)("tasks_projects.timer.stop_title")), 1), c(h, { - name: "XMarkIcon", - class: "h-6 w-6 cursor-pointer text-subtle hover:text-body", + header: D(() => [o("div", up, [o("span", null, C(w(t)("tasks_projects.timer.stop_title")), 1), o("button", { + type: "button", + class: "-m-1.5 rounded-lg p-1.5 text-subtle hover:text-body focus:outline-hidden focus-visible:ring-2 focus-visible:ring-primary-500", + "aria-label": w(t)("tasks_projects.general.close"), onClick: T - })])]), - default: D(() => [o("form", { onSubmit: A(y, ["prevent"]) }, [o("div", ip, [ + }, [c(h, { + name: "XMarkIcon", + class: "h-6 w-6" + })], 8, dp)])]), + default: D(() => [o("form", { onSubmit: A(y, ["prevent"]) }, [o("div", fp, [ o("div", null, [ - o("p", ap, C(f.value), 1), - o("p", op, C(m.value), 1), - o("p", sp, C(_.value), 1) + o("p", pp, C(f.value), 1), + o("p", mp, C(m.value), 1), + o("p", hp, C(_.value), 1) ]), c(b, { label: w(t)("tasks_projects.time.fields.description") }, { default: D(() => [c(g, { @@ -8278,7 +8375,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, null, 8, ["modelValue"])]), _: 1 }, 8, ["label"]) - ]), o("div", cp, [u.value ? (v(), a("div", lp, [o("p", up, C(w(t)("tasks_projects.timer.discard_ask", { duration: m.value })), 1), o("div", dp, [c(O, { + ]), o("div", gp, [u.value ? (v(), a("div", _p, [o("p", vp, C(w(t)("tasks_projects.timer.discard_ask", { duration: m.value })), 1), o("div", yp, [c(O, { type: "button", variant: "primary-outline", onClick: n[2] ||= (e) => u.value = !1 @@ -8293,7 +8390,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, { default: D(() => [s(C(w(t)("tasks_projects.timer.discard")), 1)]), _: 1 - }, 8, ["disabled"])])])) : (v(), a("div", fp, [c(O, { + }, 8, ["disabled"])])])) : (v(), a("div", bp, [c(O, { type: "button", variant: "white", disabled: w(q).busy, @@ -8301,7 +8398,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, { default: D(() => [s(C(w(t)("tasks_projects.timer.discard")), 1)]), _: 1 - }, 8, ["disabled"]), o("div", pp, [c(O, { + }, 8, ["disabled"]), o("div", xp, [c(O, { type: "button", variant: "primary-outline", onClick: T @@ -8325,14 +8422,14 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, 8, ["show"]); }; } -}), hp = { +}), Cp = { key: 0, - class: "relative float-left m-0 ml-2" -}, gp = ["title"], _p = ["aria-label", "title"], vp = { class: "font-medium tabular-nums" }, yp = [ + class: "relative float-start m-0 ms-2" +}, wp = ["title"], Tp = ["aria-label", "title"], Ep = { class: "font-medium tabular-nums" }, Dp = [ "disabled", "title", "aria-label" -], bp = /* @__PURE__ */ l({ +], Op = /* @__PURE__ */ l({ __name: "TimerChip", props: { client: { type: [Function, Object] }, @@ -8340,7 +8437,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, emits: ["open"], setup(e, { emit: t }) { - let r = e, s = t, l = B(), u = n(() => Ze(q.running?.task_id ?? null)), d = n(() => Ma(q.elapsedSeconds)); + let r = e, s = t, l = B(), u = n(() => Qe(q.running?.task_id ?? null)), d = n(() => La(q.elapsedSeconds)); function f() { q.stopWithPrompt(r.client, { notify: r.notify, @@ -8349,7 +8446,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border } return (e, t) => { let n = S("BaseIcon"); - return w(q).running === null ? i("", !0) : (v(), a("li", hp, [o("div", { + return w(q).running === null ? i("", !0) : (v(), a("li", Cp, [o("div", { class: "flex h-8 items-center gap-2 rounded-lg bg-white/20 px-2 text-sm text-white md:h-9 md:px-3", title: w(l)("tasks_projects.timer.running") }, [ @@ -8360,8 +8457,8 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border "aria-label": w(l)("tasks_projects.timer.open_task"), title: w(l)("tasks_projects.timer.open_task"), onClick: t[0] ||= (e) => s("open") - }, C(u.value), 9, _p), - o("span", vp, C(d.value), 1), + }, C(u.value), 9, Tp), + o("span", Ep, C(d.value), 1), o("button", { type: "button", class: "rounded p-1 hover:bg-white/20 disabled:opacity-50", @@ -8372,11 +8469,11 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(n, { name: "StopIcon", class: "h-4 w-4 text-white" - })], 8, yp) - ], 8, gp)])); + })], 8, Dp) + ], 8, wp)])); }; } -}), xp = { en: { tasks_projects: { +}), kp = { en: { tasks_projects: { time: { title: "Time", my_time: "My time", @@ -8549,47 +8646,55 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border reorder_failed: "Unable to save the new order.", forbidden: "Your role does not allow managing the board columns." } -} } }, Sp = { +} } }, Ap = { key: 0, class: "text-sm text-muted" -}, Cp = { key: 1 }, wp = { +}, jp = { key: 1 }, Mp = { key: 0, class: "flex items-center gap-2 text-sm text-muted" -}, Tp = { +}, Np = { key: 1, class: "text-sm text-muted" -}, Ep = { +}, Pp = { key: 2, class: "divide-y divide-line-light" -}, Dp = { +}, Fp = { key: 0, class: "space-y-3" -}, Op = { class: "flex flex-wrap items-center gap-2" }, kp = ["aria-label", "onClick"], Ap = { class: "flex flex-wrap items-center gap-6" }, jp = { class: "flex items-center gap-2 text-sm text-body" }, Mp = { class: "flex items-center gap-2 text-sm text-body" }, Np = { class: "flex gap-3" }, Pp = { +}, Ip = { class: "flex flex-wrap items-center gap-2" }, Lp = [ + "aria-label", + "aria-pressed", + "onClick" +], Rp = { class: "flex flex-wrap items-center gap-6" }, zp = { class: "flex items-center gap-2 text-sm text-body" }, Bp = { class: "flex items-center gap-2 text-sm text-body" }, Vp = { class: "flex gap-3" }, Hp = { key: 1, class: "flex items-center gap-3" -}, Fp = { class: "min-w-0 flex-1 truncate text-sm font-medium text-heading" }, Ip = { class: "flex items-center gap-1" }, Lp = [ +}, Up = { class: "min-w-0 flex-1 truncate text-sm font-medium text-heading" }, Wp = { class: "flex items-center gap-1" }, Gp = [ "disabled", "title", "aria-label", "onClick" -], Rp = [ +], Kp = [ "disabled", "title", "aria-label", "onClick" -], zp = [ +], qp = [ "title", "aria-label", "onClick" -], Bp = [ +], Jp = [ "disabled", "title", "aria-label", "onClick" -], Vp = { +], Yp = { key: 3, class: "mt-4 space-y-3 rounded-lg border border-line-default p-3" -}, Hp = { class: "flex flex-wrap items-center gap-2" }, Up = ["aria-label", "onClick"], Wp = { class: "flex flex-wrap items-center gap-6" }, Gp = { class: "flex items-center gap-2 text-sm text-body" }, Kp = { class: "flex items-center gap-2 text-sm text-body" }, qp = { class: "flex gap-3" }, Jp = /* @__PURE__ */ l({ +}, Xp = { class: "flex flex-wrap items-center gap-2" }, Zp = [ + "aria-label", + "aria-pressed", + "onClick" +], Qp = { class: "flex flex-wrap items-center gap-6" }, $p = { class: "flex items-center gap-2 text-sm text-body" }, em = { class: "flex items-center gap-2 text-sm text-body" }, tm = { class: "flex gap-3" }, nm = /* @__PURE__ */ l({ __name: "TaskStatusEditor", props: { client: { type: [Function, Object] }, @@ -8615,9 +8720,9 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border async function j() { h.value = !0; try { - f.value = await Ie(l.client), _.value = !1; + f.value = await Le(l.client), _.value = !1; } catch (e) { - f.value = [], _.value = vt(e), _.value || l.notify("error", H(e, d("tasks_projects.settings.load_failed"))); + f.value = [], _.value = yt(e), _.value || l.notify("error", H(e, d("tasks_projects.settings.load_failed"))); } finally { h.value = !1; } @@ -8648,7 +8753,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border let e = E.value, t = k.name.trim(); T.value = !0; try { - e === null ? (await Le(l.client, F()), l.notify("success", d("tasks_projects.settings.status_created", { name: t }))) : (await Re(l.client, e, F()), l.notify("success", d("tasks_projects.settings.status_updated", { name: t }))), P(), await j(); + e === null ? (await Re(l.client, F()), l.notify("success", d("tasks_projects.settings.status_created", { name: t }))) : (await ze(l.client, e, F()), l.notify("success", d("tasks_projects.settings.status_updated", { name: t }))), P(), await j(); } catch (e) { l.notify("error", H(e, d("tasks_projects.settings.save_failed"))); } finally { @@ -8659,7 +8764,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border if (!T.value && window.confirm(d("tasks_projects.settings.status_delete_confirm", { name: e.name }))) { T.value = !0; try { - await ze(l.client, e.id), l.notify("success", d("tasks_projects.settings.status_deleted", { name: e.name })), P(), await j(); + await Be(l.client, e.id), l.notify("success", d("tasks_projects.settings.status_deleted", { name: e.name })), P(), await j(); } catch (e) { l.notify("error", H(e, d("tasks_projects.settings.delete_failed"))); } finally { @@ -8673,7 +8778,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border let r = [...f.value]; r.splice(n, 0, ...r.splice(e, 1)), f.value = r, T.value = !0; try { - f.value = await Be(l.client, r.map((e) => e.id)), l.notify("success", d("tasks_projects.settings.status_reordered")); + f.value = await Ve(l.client, r.map((e) => e.id)), l.notify("success", d("tasks_projects.settings.status_reordered")); } catch (e) { l.notify("error", H(e, d("tasks_projects.settings.reorder_failed"))), await j(); } finally { @@ -8682,10 +8787,10 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border } return (t, n) => { let l = S("BaseSpinner"), g = S("BaseInput"), y = S("BaseInputGroup"), b = S("BaseSwitch"), j = S("BaseButton"), F = S("BaseBadge"), z = S("BaseIcon"); - return v(), a("div", null, [_.value ? (v(), a("p", Sp, C(w(d)("tasks_projects.settings.forbidden")), 1)) : (v(), a("div", Cp, [h.value ? (v(), a("div", wp, [c(l, { class: "h-4 w-4 text-primary-500" })])) : A.value ? (v(), a("p", Tp, C(w(d)("tasks_projects.settings.no_statuses")), 1)) : (v(), a("ul", Ep, [(v(!0), a(e, null, x(f.value, (t, l) => (v(), a("li", { + return v(), a("div", null, [_.value ? (v(), a("p", Ap, C(w(d)("tasks_projects.settings.forbidden")), 1)) : (v(), a("div", jp, [h.value ? (v(), a("div", Mp, [c(l, { class: "h-4 w-4 text-primary-500" })])) : A.value ? (v(), a("p", Np, C(w(d)("tasks_projects.settings.no_statuses")), 1)) : (v(), a("ul", Pp, [(v(!0), a(e, null, x(f.value, (t, l) => (v(), a("li", { key: t.id, class: "py-3" - }, [E.value === t.id ? (v(), a("div", Dp, [ + }, [E.value === t.id ? (v(), a("div", Fp, [ c(y, { label: w(d)("tasks_projects.settings.status_name"), required: "" @@ -8699,30 +8804,31 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border _: 1 }, 8, ["label"]), c(y, { label: w(d)("tasks_projects.settings.colour") }, { - default: D(() => [o("div", Op, [(v(), a(e, null, x(u, (e) => o("button", { + default: D(() => [o("div", Ip, [(v(), a(e, null, x(u, (e) => o("button", { key: e, type: "button", class: p(["h-7 w-7 rounded-full border-2 transition", k.colour === e ? "border-heading" : "border-line-default"]), style: m({ backgroundColor: e }), - "aria-label": e, + "aria-label": w(d)(w(wr)(e)), + "aria-pressed": k.colour === e, onClick: (t) => k.colour = e - }, null, 14, kp)), 64)), o("button", { + }, null, 14, Lp)), 64)), o("button", { type: "button", class: "rounded-md border border-line-default px-2 py-1 text-xs text-muted hover:bg-hover", onClick: n[1] ||= (e) => k.colour = "" }, C(w(d)("tasks_projects.settings.colour_none")), 1)])]), _: 1 }, 8, ["label"]), - o("div", Ap, [o("label", jp, [c(b, { + o("div", Rp, [o("label", zp, [c(b, { modelValue: k.is_default, "onUpdate:modelValue": n[2] ||= (e) => k.is_default = e, class: "flex" - }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_default")), 1)]), o("label", Mp, [c(b, { + }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_default")), 1)]), o("label", Bp, [c(b, { modelValue: k.is_closed, "onUpdate:modelValue": n[3] ||= (e) => k.is_closed = e, class: "flex" }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_closed")), 1)])]), - o("div", Np, [c(j, { + o("div", Vp, [c(j, { variant: "primary", size: "sm", disabled: T.value, @@ -8738,12 +8844,12 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border default: D(() => [s(C(w(d)("tasks_projects.general.cancel")), 1)]), _: 1 })]) - ])) : (v(), a("div", Pp, [ + ])) : (v(), a("div", Hp, [ o("span", { class: p(["inline-block h-3 w-3 shrink-0 rounded-full", t.colour ? "" : "bg-line-default"]), style: m(t.colour ? { backgroundColor: t.colour } : void 0) }, null, 6), - o("span", Fp, C(t.name), 1), + o("span", Up, C(t.name), 1), t.is_default ? (v(), r(F, { key: 0, class: "rounded-full bg-primary-50! text-primary-500!" @@ -8758,7 +8864,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border default: D(() => [s(C(w(d)("tasks_projects.settings.is_closed")), 1)]), _: 1 })) : i("", !0), - o("div", Ip, [ + o("div", Wp, [ o("button", { type: "button", class: "rounded p-1 text-subtle hover:bg-hover hover:text-heading disabled:opacity-40", @@ -8769,7 +8875,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(z, { name: "ChevronUpIcon", class: "h-4 w-4" - })], 8, Lp), + })], 8, Gp), o("button", { type: "button", class: "rounded p-1 text-subtle hover:bg-hover hover:text-heading disabled:opacity-40", @@ -8780,7 +8886,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(z, { name: "ChevronDownIcon", class: "h-4 w-4" - })], 8, Rp), + })], 8, Kp), o("button", { type: "button", class: "rounded p-1 text-subtle hover:bg-hover hover:text-heading", @@ -8790,7 +8896,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(z, { name: "PencilIcon", class: "h-4 w-4" - })], 8, zp), + })], 8, qp), o("button", { type: "button", class: "rounded p-1 text-subtle hover:bg-hover hover:text-alert-error-text", @@ -8801,9 +8907,9 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }, [c(z, { name: "TrashIcon", class: "h-4 w-4" - })], 8, Bp) + })], 8, Jp) ]) - ]))]))), 128))])), O.value ? (v(), a("div", Vp, [ + ]))]))), 128))])), O.value ? (v(), a("div", Yp, [ c(y, { label: w(d)("tasks_projects.settings.status_name"), required: "" @@ -8817,26 +8923,27 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border _: 1 }, 8, ["label"]), c(y, { label: w(d)("tasks_projects.settings.colour") }, { - default: D(() => [o("div", Hp, [(v(), a(e, null, x(u, (e) => o("button", { + default: D(() => [o("div", Xp, [(v(), a(e, null, x(u, (e) => o("button", { key: e, type: "button", class: p(["h-7 w-7 rounded-full border-2 transition", k.colour === e ? "border-heading" : "border-line-default"]), style: m({ backgroundColor: e }), - "aria-label": e, + "aria-label": w(d)(w(wr)(e)), + "aria-pressed": k.colour === e, onClick: (t) => k.colour = e - }, null, 14, Up)), 64))])]), + }, null, 14, Zp)), 64))])]), _: 1 }, 8, ["label"]), - o("div", Wp, [o("label", Gp, [c(b, { + o("div", Qp, [o("label", $p, [c(b, { modelValue: k.is_default, "onUpdate:modelValue": n[5] ||= (e) => k.is_default = e, class: "flex" - }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_default")), 1)]), o("label", Kp, [c(b, { + }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_default")), 1)]), o("label", em, [c(b, { modelValue: k.is_closed, "onUpdate:modelValue": n[6] ||= (e) => k.is_closed = e, class: "flex" }, null, 8, ["modelValue"]), s(" " + C(w(d)("tasks_projects.settings.is_closed")), 1)])]), - o("div", qp, [c(j, { + o("div", tm, [c(j, { variant: "primary", size: "sm", disabled: T.value, @@ -8868,7 +8975,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }))]))]); }; } -}), Yp = { class: "space-y-6" }, Xp = { class: "divide-y divide-line-light" }, Zp = { class: "text-sm text-muted" }, Qp = { class: "text-sm font-medium text-heading" }, $p = { class: "divide-y divide-line-light" }, em = { class: "text-sm text-muted" }, tm = { class: "text-sm font-medium text-heading" }, nm = { class: "divide-y divide-line-light" }, rm = { class: "text-sm text-muted" }, im = { class: "text-sm font-medium text-heading" }, am = /* @__PURE__ */ l({ +}), rm = { class: "space-y-6" }, im = { class: "divide-y divide-line-light" }, am = { class: "text-sm text-muted" }, om = { class: "text-sm font-medium text-heading" }, sm = { class: "divide-y divide-line-light" }, cm = { class: "text-sm text-muted" }, lm = { class: "text-sm font-medium text-heading" }, um = { class: "divide-y divide-line-light" }, dm = { class: "text-sm text-muted" }, fm = { class: "text-sm font-medium text-heading" }, pm = /* @__PURE__ */ l({ __name: "TimeSettingsPage", props: { client: { type: [Function, Object] }, @@ -8884,7 +8991,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border { key: "default_rate", label: r("tasks_projects.settings.default_rate"), - value: ot(i.value.default_rate) + value: st(i.value.default_rate) }, { key: "week_start", @@ -8936,7 +9043,7 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }))); return (n, i) => { let l = S("BaseIcon"), m = S("BaseButton"), h = S("router-link"), g = S("BaseSettingCard"); - return v(), a("div", Yp, [ + return v(), a("div", rm, [ c(g, { title: w(r)("tasks_projects.settings.general_title"), description: w(r)("tasks_projects.settings.general_description") @@ -8955,37 +9062,37 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border })]), _: 1 }, 8, ["to"])]), - default: D(() => [o("dl", Xp, [(v(!0), a(e, null, x(u.value, (e) => (v(), a("div", { + default: D(() => [o("dl", im, [(v(!0), a(e, null, x(u.value, (e) => (v(), a("div", { key: e.key, class: "flex justify-between gap-4 py-2.5" - }, [o("dt", Zp, C(e.label), 1), o("dd", Qp, C(e.value), 1)]))), 128))])]), + }, [o("dt", am, C(e.label), 1), o("dd", om, C(e.value), 1)]))), 128))])]), _: 1 }, 8, ["title", "description"]), c(g, { title: w(r)("tasks_projects.settings.behaviour_title"), description: w(r)("tasks_projects.settings.behaviour_description") }, { - default: D(() => [o("dl", $p, [(v(!0), a(e, null, x(d.value, (e) => (v(), a("div", { + default: D(() => [o("dl", sm, [(v(!0), a(e, null, x(d.value, (e) => (v(), a("div", { key: e.key, class: "flex justify-between gap-4 py-2.5" - }, [o("dt", em, C(e.label), 1), o("dd", tm, C(e.value), 1)]))), 128))])]), + }, [o("dt", cm, C(e.label), 1), o("dd", lm, C(e.value), 1)]))), 128))])]), _: 1 }, 8, ["title", "description"]), c(g, { title: w(r)("tasks_projects.settings.invoice_title"), description: w(r)("tasks_projects.settings.invoice_description") }, { - default: D(() => [o("dl", nm, [(v(!0), a(e, null, x(f.value, (e) => (v(), a("div", { + default: D(() => [o("dl", um, [(v(!0), a(e, null, x(f.value, (e) => (v(), a("div", { key: e.key, class: "flex justify-between gap-4 py-2.5" - }, [o("dt", rm, C(e.label), 1), o("dd", im, C(e.value), 1)]))), 128))])]), + }, [o("dt", dm, C(e.label), 1), o("dd", fm, C(e.value), 1)]))), 128))])]), _: 1 }, 8, ["title", "description"]), c(g, { title: w(r)("tasks_projects.settings.statuses_title"), description: w(r)("tasks_projects.settings.statuses_description") }, { - default: D(() => [c(Jp, { + default: D(() => [c(nm, { client: t.client, notify: t.notify }, null, 8, ["client", "notify"])]), @@ -8997,8 +9104,8 @@ var Ff = ["aria-label"], If = { class: "flex items-center justify-between border }); //#endregion //#region resources/js/registrations/time.ts -function om(e) { - e.addMessages(xp); +function mm(e) { + e.addMessages(kp); let t = (t, n) => { e.notify(t, n); }, n = () => { @@ -9009,14 +9116,14 @@ function om(e) { id: `${U}.timer-chip`, priority: 30, visible: () => q.running !== null, - component: l({ setup: () => () => d(bp, { + component: l({ setup: () => () => d(Op, { client: e.client, notify: t, onOpen: n }) }) }), e.registerCompanyLayoutOverlay({ id: `${U}.quick-start`, - component: l({ setup: () => () => d(Jf, { + component: l({ setup: () => () => d(ep, { key: G.companySession, client: e.client, notify: t, @@ -9026,10 +9133,10 @@ function om(e) { }) }) }), e.registerCompanyLayoutOverlay({ id: `${U}.stop-timer`, - component: l({ setup: () => () => d(mp, { key: G.companySession }) }) + component: l({ setup: () => () => d(Sp, { key: G.companySession }) }) }), e.registerCompanyLayoutOverlay({ id: `${U}.start-timer`, - component: l({ setup: () => () => d(np, { + component: l({ setup: () => () => d(lp, { key: G.companySession, client: e.client, notify: t @@ -9040,28 +9147,28 @@ function om(e) { icon: "ClockIcon", path: U, priority: 70, - component: sn(e, am) + component: cn(e, pm) }), e.on("bootstrap:completed", ({ adminMode: t }) => { - sm(e, t); + hm(e, t); }), e.on("company:changing", () => { - cm(); + gm(); }), e.on("company:changed", ({ companyId: t }) => { - sm(e, t === null); + hm(e, t === null); }); } -async function sm(e, t) { - if (Ca(t), t) { - cm(); +async function hm(e, t) { + if (Oa(t), t) { + gm(); return; } - await xa(e.client), await q.refresh(e.client); + await Ea(e.client), await q.refresh(e.client); } -function cm() { - q.reset(), rt(), Sa(); +function gm() { + q.reset(), it(), Da(); } //#endregion //#region resources/js/init.ts window.InvoiceShelf.booting((e, t, n) => { - n.addMessages(j), Nf(n), Zo(n), om(n), nr(n), Ks(n); + n.addMessages(j), zf(n), rs(n), mm(n), rr(n), Qs(n); }); //#endregion diff --git a/dist/style.css b/dist/style.css index ee1c7ee..c5ffbb0 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1,3 +1,3 @@ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */ -@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.right-5{right:calc(var(--spacing,.25rem) * 5)}.bottom-5{bottom:calc(var(--spacing,.25rem) * 5)}.bottom-24{bottom:calc(var(--spacing,.25rem) * 24)}.z-40{z-index:40}.float-left{float:left}.m-0{margin:0}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:var(--spacing,.25rem)}.mt-2{margin-top:calc(var(--spacing,.25rem) * 2)}.mt-3{margin-top:calc(var(--spacing,.25rem) * 3)}.mt-4{margin-top:calc(var(--spacing,.25rem) * 4)}.mt-5{margin-top:calc(var(--spacing,.25rem) * 5)}.mt-6{margin-top:calc(var(--spacing,.25rem) * 6)}.mr-2{margin-right:calc(var(--spacing,.25rem) * 2)}.mr-3{margin-right:calc(var(--spacing,.25rem) * 3)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:var(--spacing,.25rem)}.mb-3{margin-bottom:calc(var(--spacing,.25rem) * 3)}.mb-4{margin-bottom:calc(var(--spacing,.25rem) * 4)}.ml-1{margin-left:var(--spacing,.25rem)}.ml-2{margin-left:calc(var(--spacing,.25rem) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing,.25rem) * 1.5)}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-2\.5{height:calc(var(--spacing,.25rem) * 2.5)}.h-3{height:calc(var(--spacing,.25rem) * 3)}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-6{height:calc(var(--spacing,.25rem) * 6)}.h-7{height:calc(var(--spacing,.25rem) * 7)}.h-8{height:calc(var(--spacing,.25rem) * 8)}.h-14{height:calc(var(--spacing,.25rem) * 14)}.h-16{height:calc(var(--spacing,.25rem) * 16)}.min-h-20{min-height:calc(var(--spacing,.25rem) * 20)}.min-h-40{min-height:calc(var(--spacing,.25rem) * 40)}.w-1\.5{width:calc(var(--spacing,.25rem) * 1.5)}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-2\.5{width:calc(var(--spacing,.25rem) * 2.5)}.w-3{width:calc(var(--spacing,.25rem) * 3)}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-4{width:calc(var(--spacing,.25rem) * 4)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-6{width:calc(var(--spacing,.25rem) * 6)}.w-7{width:calc(var(--spacing,.25rem) * 7)}.w-8{width:calc(var(--spacing,.25rem) * 8)}.w-10{width:calc(var(--spacing,.25rem) * 10)}.w-14{width:calc(var(--spacing,.25rem) * 14)}.w-16{width:calc(var(--spacing,.25rem) * 16)}.w-64{width:calc(var(--spacing,.25rem) * 64)}.w-80{width:calc(var(--spacing,.25rem) * 80)}.w-full{width:100%}.max-w-32{max-width:calc(var(--spacing,.25rem) * 32)}.max-w-64{max-width:calc(var(--spacing,.25rem) * 64)}.max-w-\[calc\(100vw-3rem\)\]{max-width:calc(100vw - 3rem)}.min-w-0{min-width:0}.min-w-44{min-width:calc(var(--spacing,.25rem) * 44)}.min-w-48{min-width:calc(var(--spacing,.25rem) * 48)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-auto{table-layout:auto}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing,.25rem)}.gap-1\.5{gap:calc(var(--spacing,.25rem) * 1.5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.gap-4{gap:calc(var(--spacing,.25rem) * 4)}.gap-6{gap:calc(var(--spacing,.25rem) * 6)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing,.25rem) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing,.25rem) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing,.25rem) * 5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing,.25rem) * 5) * calc(1 - var(--tw-space-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line-default>:not(:last-child)){border-color:var(--color-line-default)}:where(.divide-line-light>:not(:last-child)){border-color:var(--color-line-light)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg,.5rem)}.rounded-md{border-radius:var(--radius-md,.375rem)}.rounded-sm{border-radius:var(--radius-sm,.25rem)}.rounded-xl{border-radius:var(--radius-xl,.75rem)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-heading{border-color:var(--color-heading)}.border-line-default{border-color:var(--color-line-default)}.border-line-light{border-color:var(--color-line-light)}.border-line-strong{border-color:var(--color-line-strong)}.border-primary-200{border-color:var(--color-primary-200)}.border-primary-400{border-color:var(--color-primary-400)}.border-primary-500{border-color:var(--color-primary-500)}.border-status-yellow{border-color:var(--color-status-yellow)}.border-transparent{border-color:#0000}.bg-alert-error-bg{background-color:var(--color-alert-error-bg)}.bg-alert-success-bg\!{background-color:var(--color-alert-success-bg)!important}.bg-alert-warning-bg{background-color:var(--color-alert-warning-bg)}.bg-alert-warning-bg\!{background-color:var(--color-alert-warning-bg)!important}.bg-btn-primary{background-color:var(--color-btn-primary)}.bg-line-default{background-color:var(--color-line-default)}.bg-line-strong{background-color:var(--color-line-strong)}.bg-primary-50{background-color:var(--color-primary-50)}.bg-primary-50\!{background-color:var(--color-primary-50)!important}.bg-primary-500{background-color:var(--color-primary-500)}.bg-status-green{background-color:var(--color-status-green)}.bg-status-red{background-color:var(--color-status-red)}.bg-surface{background-color:var(--color-surface)}.bg-surface-secondary{background-color:var(--color-surface-secondary)}.bg-surface-tertiary{background-color:var(--color-surface-tertiary)}.bg-surface-tertiary\!{background-color:var(--color-surface-tertiary)!important}.bg-white{background-color:var(--color-white,#fff)}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white,#fff) 20%, transparent)}}.p-0{padding:0}.p-1{padding:var(--spacing,.25rem)}.p-1\.5{padding:calc(var(--spacing,.25rem) * 1.5)}.p-2{padding:calc(var(--spacing,.25rem) * 2)}.p-3{padding:calc(var(--spacing,.25rem) * 3)}.p-5{padding:calc(var(--spacing,.25rem) * 5)}.px-1{padding-inline:var(--spacing,.25rem)}.px-1\.5{padding-inline:calc(var(--spacing,.25rem) * 1.5)}.px-2{padding-inline:calc(var(--spacing,.25rem) * 2)}.px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}.px-4{padding-inline:calc(var(--spacing,.25rem) * 4)}.px-5{padding-inline:calc(var(--spacing,.25rem) * 5)}.px-6{padding-inline:calc(var(--spacing,.25rem) * 6)}.py-0\.5{padding-block:calc(var(--spacing,.25rem) * .5)}.py-1{padding-block:var(--spacing,.25rem)}.py-1\.5{padding-block:calc(var(--spacing,.25rem) * 1.5)}.py-2{padding-block:calc(var(--spacing,.25rem) * 2)}.py-2\.5{padding-block:calc(var(--spacing,.25rem) * 2.5)}.py-3{padding-block:calc(var(--spacing,.25rem) * 3)}.py-4{padding-block:calc(var(--spacing,.25rem) * 4)}.py-6{padding-block:calc(var(--spacing,.25rem) * 6)}.py-8{padding-block:calc(var(--spacing,.25rem) * 8)}.py-10{padding-block:calc(var(--spacing,.25rem) * 10)}.py-16{padding-block:calc(var(--spacing,.25rem) * 16)}.pt-2{padding-top:calc(var(--spacing,.25rem) * 2)}.pt-3{padding-top:calc(var(--spacing,.25rem) * 3)}.pb-2{padding-bottom:calc(var(--spacing,.25rem) * 2)}.pb-3{padding-bottom:calc(var(--spacing,.25rem) * 3)}.pb-4{padding-bottom:calc(var(--spacing,.25rem) * 4)}.pl-4{padding-left:calc(var(--spacing,.25rem) * 4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.text-2xl{font-size:var(--text-2xl,1.5rem);line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))}.text-3xl{font-size:var(--text-3xl,1.875rem);line-height:var(--tw-leading,var(--text-3xl--line-height,calc(2.25 / 1.875)))}.text-base{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.text-lg{font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)))}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xl{font-size:var(--text-xl,1.25rem);line-height:var(--tw-leading,var(--text-xl--line-height,calc(1.75 / 1.25)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5)}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.font-normal{--tw-font-weight:var(--font-weight-normal,400);font-weight:var(--font-weight-normal,400)}.font-semibold{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.tracking-wide{--tw-tracking:var(--tracking-wide,.025em);letter-spacing:var(--tracking-wide,.025em)}.tracking-wider{--tw-tracking:var(--tracking-wider,.05em);letter-spacing:var(--tracking-wider,.05em)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-alert-error-text{color:var(--color-alert-error-text)}.text-alert-success-text\!{color:var(--color-alert-success-text)!important}.text-alert-warning-text{color:var(--color-alert-warning-text)}.text-alert-warning-text\!{color:var(--color-alert-warning-text)!important}.text-body{color:var(--color-body)}.text-heading{color:var(--color-heading)}.text-muted{color:var(--color-muted)}.text-muted\!{color:var(--color-muted)!important}.text-primary-500{color:var(--color-primary-500)}.text-primary-500\!{color:var(--color-primary-500)!important}.text-primary-600{color:var(--color-primary-600)}.text-primary-700{color:var(--color-primary-700)}.text-status-green{color:var(--color-status-green)}.text-status-red{color:var(--color-status-red)}.text-subtle{color:var(--color-subtle)}.text-white{color:var(--color-white,#fff)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-40{opacity:.4}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}@media (hover:hover){.group-hover\:text-muted:is(:where(.group):hover *){color:var(--color-muted)}}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}@media (hover:hover){.hover\:border-line-strong:hover{border-color:var(--color-line-strong)}.hover\:border-primary-500:hover{border-color:var(--color-primary-500)}.hover\:bg-btn-primary-hover:hover{background-color:var(--color-btn-primary-hover)}.hover\:bg-hover:hover{background-color:var(--color-hover)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white,#fff) 20%, transparent)}}.hover\:text-alert-error-text:hover{color:var(--color-alert-error-text)}.hover\:text-body:hover{color:var(--color-body)}.hover\:text-heading:hover{color:var(--color-heading)}.hover\:text-primary-500:hover{color:var(--color-primary-500)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media not all and (width>=40rem){.max-sm\:hidden{display:none}}@media (width>=40rem){.sm\:w-48{width:calc(var(--spacing,.25rem) * 48)}.sm\:w-56{width:calc(var(--spacing,.25rem) * 56)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width>=48rem){.md\:h-9{height:calc(var(--spacing,.25rem) * 9)}.md\:px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}}@media (width>=64rem){.lg\:mb-1{margin-bottom:var(--spacing,.25rem)}.lg\:block{display:block}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-end{align-items:flex-end}}@media (width>=80rem){.xl\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}} +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer utilities{.visible{visibility:visible}.fixed{position:fixed}.relative{position:relative}.end-5{inset-inline-end:calc(var(--spacing,.25rem) * 5)}.bottom-5{bottom:calc(var(--spacing,.25rem) * 5)}.bottom-24{bottom:calc(var(--spacing,.25rem) * 24)}.z-40{z-index:40}.float-start{float:inline-start}.-m-1\.5{margin:calc(var(--spacing,.25rem) * -1.5)}.m-0{margin:0}.ms-1{margin-inline-start:var(--spacing,.25rem)}.ms-2{margin-inline-start:calc(var(--spacing,.25rem) * 2)}.ms-auto{margin-inline-start:auto}.me-2{margin-inline-end:calc(var(--spacing,.25rem) * 2)}.me-3{margin-inline-end:calc(var(--spacing,.25rem) * 3)}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:var(--spacing,.25rem)}.mt-2{margin-top:calc(var(--spacing,.25rem) * 2)}.mt-3{margin-top:calc(var(--spacing,.25rem) * 3)}.mt-4{margin-top:calc(var(--spacing,.25rem) * 4)}.mt-5{margin-top:calc(var(--spacing,.25rem) * 5)}.mt-6{margin-top:calc(var(--spacing,.25rem) * 6)}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:var(--spacing,.25rem)}.mb-3{margin-bottom:calc(var(--spacing,.25rem) * 3)}.mb-4{margin-bottom:calc(var(--spacing,.25rem) * 4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing,.25rem) * 1.5)}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-2\.5{height:calc(var(--spacing,.25rem) * 2.5)}.h-3{height:calc(var(--spacing,.25rem) * 3)}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-6{height:calc(var(--spacing,.25rem) * 6)}.h-7{height:calc(var(--spacing,.25rem) * 7)}.h-8{height:calc(var(--spacing,.25rem) * 8)}.h-14{height:calc(var(--spacing,.25rem) * 14)}.h-16{height:calc(var(--spacing,.25rem) * 16)}.min-h-20{min-height:calc(var(--spacing,.25rem) * 20)}.min-h-40{min-height:calc(var(--spacing,.25rem) * 40)}.w-1\.5{width:calc(var(--spacing,.25rem) * 1.5)}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-2\.5{width:calc(var(--spacing,.25rem) * 2.5)}.w-3{width:calc(var(--spacing,.25rem) * 3)}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-4{width:calc(var(--spacing,.25rem) * 4)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-6{width:calc(var(--spacing,.25rem) * 6)}.w-7{width:calc(var(--spacing,.25rem) * 7)}.w-8{width:calc(var(--spacing,.25rem) * 8)}.w-10{width:calc(var(--spacing,.25rem) * 10)}.w-14{width:calc(var(--spacing,.25rem) * 14)}.w-16{width:calc(var(--spacing,.25rem) * 16)}.w-64{width:calc(var(--spacing,.25rem) * 64)}.w-80{width:calc(var(--spacing,.25rem) * 80)}.w-full{width:100%}.max-w-32{max-width:calc(var(--spacing,.25rem) * 32)}.max-w-64{max-width:calc(var(--spacing,.25rem) * 64)}.max-w-\[calc\(100vw-3rem\)\]{max-width:calc(100vw - 3rem)}.min-w-0{min-width:0}.min-w-44{min-width:calc(var(--spacing,.25rem) * 44)}.min-w-48{min-width:calc(var(--spacing,.25rem) * 48)}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.table-auto{table-layout:auto}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing,.25rem)}.gap-1\.5{gap:calc(var(--spacing,.25rem) * 1.5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.gap-4{gap:calc(var(--spacing,.25rem) * 4)}.gap-6{gap:calc(var(--spacing,.25rem) * 6)}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing,.25rem) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing,.25rem) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing,.25rem) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing,.25rem) * 3) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-5>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing,.25rem) * 5) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing,.25rem) * 5) * calc(1 - var(--tw-space-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-line-default>:not(:last-child)){border-color:var(--color-line-default)}:where(.divide-line-light>:not(:last-child)){border-color:var(--color-line-light)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg,.5rem)}.rounded-md{border-radius:var(--radius-md,.375rem)}.rounded-sm{border-radius:var(--radius-sm,.25rem)}.rounded-xl{border-radius:var(--radius-xl,.75rem)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-heading{border-color:var(--color-heading)}.border-line-default{border-color:var(--color-line-default)}.border-line-light{border-color:var(--color-line-light)}.border-line-strong{border-color:var(--color-line-strong)}.border-primary-200{border-color:var(--color-primary-200)}.border-primary-400{border-color:var(--color-primary-400)}.border-primary-500{border-color:var(--color-primary-500)}.border-status-yellow{border-color:var(--color-status-yellow)}.border-transparent{border-color:#0000}.bg-alert-error-bg{background-color:var(--color-alert-error-bg)}.bg-alert-success-bg\!{background-color:var(--color-alert-success-bg)!important}.bg-alert-warning-bg{background-color:var(--color-alert-warning-bg)}.bg-alert-warning-bg\!{background-color:var(--color-alert-warning-bg)!important}.bg-btn-primary{background-color:var(--color-btn-primary)}.bg-line-default{background-color:var(--color-line-default)}.bg-line-strong{background-color:var(--color-line-strong)}.bg-primary-50{background-color:var(--color-primary-50)}.bg-primary-50\!{background-color:var(--color-primary-50)!important}.bg-primary-500{background-color:var(--color-primary-500)}.bg-status-green{background-color:var(--color-status-green)}.bg-status-red{background-color:var(--color-status-red)}.bg-surface{background-color:var(--color-surface)}.bg-surface-secondary{background-color:var(--color-surface-secondary)}.bg-surface-tertiary{background-color:var(--color-surface-tertiary)}.bg-surface-tertiary\!{background-color:var(--color-surface-tertiary)!important}.bg-white{background-color:var(--color-white,#fff)}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white,#fff) 20%, transparent)}}.p-0{padding:0}.p-1{padding:var(--spacing,.25rem)}.p-1\.5{padding:calc(var(--spacing,.25rem) * 1.5)}.p-2{padding:calc(var(--spacing,.25rem) * 2)}.p-3{padding:calc(var(--spacing,.25rem) * 3)}.p-5{padding:calc(var(--spacing,.25rem) * 5)}.px-1{padding-inline:var(--spacing,.25rem)}.px-1\.5{padding-inline:calc(var(--spacing,.25rem) * 1.5)}.px-2{padding-inline:calc(var(--spacing,.25rem) * 2)}.px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}.px-4{padding-inline:calc(var(--spacing,.25rem) * 4)}.px-5{padding-inline:calc(var(--spacing,.25rem) * 5)}.px-6{padding-inline:calc(var(--spacing,.25rem) * 6)}.py-0\.5{padding-block:calc(var(--spacing,.25rem) * .5)}.py-1{padding-block:var(--spacing,.25rem)}.py-1\.5{padding-block:calc(var(--spacing,.25rem) * 1.5)}.py-2{padding-block:calc(var(--spacing,.25rem) * 2)}.py-2\.5{padding-block:calc(var(--spacing,.25rem) * 2.5)}.py-3{padding-block:calc(var(--spacing,.25rem) * 3)}.py-4{padding-block:calc(var(--spacing,.25rem) * 4)}.py-6{padding-block:calc(var(--spacing,.25rem) * 6)}.py-8{padding-block:calc(var(--spacing,.25rem) * 8)}.py-10{padding-block:calc(var(--spacing,.25rem) * 10)}.py-16{padding-block:calc(var(--spacing,.25rem) * 16)}.ps-4{padding-inline-start:calc(var(--spacing,.25rem) * 4)}.pt-2{padding-top:calc(var(--spacing,.25rem) * 2)}.pt-3{padding-top:calc(var(--spacing,.25rem) * 3)}.pb-2{padding-bottom:calc(var(--spacing,.25rem) * 2)}.pb-3{padding-bottom:calc(var(--spacing,.25rem) * 3)}.pb-4{padding-bottom:calc(var(--spacing,.25rem) * 4)}.text-center{text-align:center}.text-end{text-align:end}.text-start{text-align:start}.text-2xl{font-size:var(--text-2xl,1.5rem);line-height:var(--tw-leading,var(--text-2xl--line-height,calc(2 / 1.5)))}.text-3xl{font-size:var(--text-3xl,1.875rem);line-height:var(--tw-leading,var(--text-3xl--line-height,calc(2.25 / 1.875)))}.text-base{font-size:var(--text-base,1rem);line-height:var(--tw-leading,var(--text-base--line-height,calc(1.5 / 1)))}.text-lg{font-size:var(--text-lg,1.125rem);line-height:var(--tw-leading,var(--text-lg--line-height,calc(1.75 / 1.125)))}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xl{font-size:var(--text-xl,1.25rem);line-height:var(--tw-leading,var(--text-xl--line-height,calc(1.75 / 1.25)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.text-\[11px\]{font-size:11px}.leading-5{--tw-leading:calc(var(--spacing,.25rem) * 5);line-height:calc(var(--spacing,.25rem) * 5)}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.font-normal{--tw-font-weight:var(--font-weight-normal,400);font-weight:var(--font-weight-normal,400)}.font-semibold{--tw-font-weight:var(--font-weight-semibold,600);font-weight:var(--font-weight-semibold,600)}.tracking-wide{--tw-tracking:var(--tracking-wide,.025em);letter-spacing:var(--tracking-wide,.025em)}.tracking-wider{--tw-tracking:var(--tracking-wider,.05em);letter-spacing:var(--tracking-wider,.05em)}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.text-alert-error-text{color:var(--color-alert-error-text)}.text-alert-success-text\!{color:var(--color-alert-success-text)!important}.text-alert-warning-text{color:var(--color-alert-warning-text)}.text-alert-warning-text\!{color:var(--color-alert-warning-text)!important}.text-body{color:var(--color-body)}.text-heading{color:var(--color-heading)}.text-muted{color:var(--color-muted)}.text-muted\!{color:var(--color-muted)!important}.text-primary-500{color:var(--color-primary-500)}.text-primary-500\!{color:var(--color-primary-500)!important}.text-primary-600{color:var(--color-primary-600)}.text-primary-700{color:var(--color-primary-700)}.text-status-green{color:var(--color-status-green)}.text-status-red{color:var(--color-status-red)}.text-subtle{color:var(--color-subtle)}.text-white{color:var(--color-white,#fff)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-40{opacity:.4}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}@media (hover:hover){.group-hover\:text-muted:is(:where(.group):hover *){color:var(--color-muted)}}.last\:border-e-0:last-child{border-inline-end-style:var(--tw-border-style);border-inline-end-width:0}@media (hover:hover){.hover\:border-line-strong:hover{border-color:var(--color-line-strong)}.hover\:border-primary-500:hover{border-color:var(--color-primary-500)}.hover\:bg-btn-primary-hover:hover{background-color:var(--color-btn-primary-hover)}.hover\:bg-hover:hover{background-color:var(--color-hover)}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab, var(--color-white,#fff) 20%, transparent)}}.hover\:text-alert-error-text:hover{color:var(--color-alert-error-text)}.hover\:text-body:hover{color:var(--color-body)}.hover\:text-heading:hover{color:var(--color-heading)}.hover\:text-primary-500:hover{color:var(--color-primary-500)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-primary-500:focus-visible{--tw-ring-color:var(--color-primary-500)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media not all and (width>=40rem){.max-sm\:sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}}@media (width>=40rem){.sm\:w-48{width:calc(var(--spacing,.25rem) * 48)}.sm\:w-56{width:calc(var(--spacing,.25rem) * 56)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width>=48rem){.md\:h-9{height:calc(var(--spacing,.25rem) * 9)}.md\:px-3{padding-inline:calc(var(--spacing,.25rem) * 3)}}@media (width>=64rem){.lg\:mb-1{margin-bottom:var(--spacing,.25rem)}.lg\:block{display:block}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-end{align-items:flex-end}}@media (width>=80rem){.xl\:grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}}}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}} /*$vite$:1*/ \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index 42fb2b5..6cf9c07 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,6 +1,19 @@ import pluginVue from 'eslint-plugin-vue' +import pluginVueA11y from 'eslint-plugin-vuejs-accessibility' import tseslint from 'typescript-eslint' +// The host's form controls, so a