@realtek/core-theme 0.0.217 → 0.0.219

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-lib/index.js CHANGED
@@ -2473,7 +2473,7 @@ function pc() {
2473
2473
  }
2474
2474
  function mc(e = "") {
2475
2475
  let t = String(e ?? "").trim();
2476
- return t === "myJobs" || t === "allJobs" ? t : "";
2476
+ return t === "myJobs" || t === "allJobs" || t === "fulfilled" ? t : "";
2477
2477
  }
2478
2478
  function hc(e) {
2479
2479
  let t = String(we(e) ?? "").trim().toLowerCase();
@@ -9649,17 +9649,37 @@ function ph({ value: e }) {
9649
9649
  });
9650
9650
  }
9651
9651
  function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r }) {
9652
- let [i, a] = R([]), [o, s] = R(!!e), [c, l] = R(""), [u, d] = R(!1), [f, p] = R(""), [m, h] = R(!1), [g, _] = R([]);
9652
+ let [i, s] = R([]), [c, l] = R(!!e), [u, d] = R(""), [f, p] = R(!1), [m, h] = R(""), [g, _] = R(!1), [v, y] = R([]);
9653
9653
  I(() => {
9654
9654
  if (!e || !t) {
9655
- _([]);
9655
+ y([]);
9656
9656
  return;
9657
9657
  }
9658
9658
  let n = !1;
9659
9659
  return At(e, t).then((e) => {
9660
- n || _(Array.isArray(e) ? e : e?.data ?? []);
9660
+ n || y(Array.isArray(e) ? e : e?.data ?? []);
9661
9661
  }).catch(() => {
9662
- n || _([]);
9662
+ n || y([]);
9663
+ }), () => {
9664
+ n = !0;
9665
+ };
9666
+ }, [
9667
+ e,
9668
+ t,
9669
+ n
9670
+ ]);
9671
+ let [b, x] = R(null), [S, C] = R({});
9672
+ I(() => {
9673
+ if (!e || !t) {
9674
+ x(null);
9675
+ return;
9676
+ }
9677
+ let n = !1;
9678
+ return a(o, `/module/list?module=${encodeURIComponent(e)}&id=${encodeURIComponent(t)}`).then((e) => {
9679
+ let t = e?.data?.data ?? e?.data ?? [];
9680
+ n || x(Array.isArray(t) ? t[0] : null);
9681
+ }).catch(() => {
9682
+ n || x(null);
9663
9683
  }), () => {
9664
9684
  n = !0;
9665
9685
  };
@@ -9668,21 +9688,32 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9668
9688
  t,
9669
9689
  n
9670
9690
  ]), I(() => {
9691
+ let e = !1;
9692
+ return a(o, "/module/list?module=users").then((t) => {
9693
+ let n = t?.data?.data ?? t?.data ?? [], r = {};
9694
+ (Array.isArray(n) ? n : []).forEach((e) => {
9695
+ let t = e.legacyUserId ?? e.userId ?? e.id, n = [e.firstName, e.lastName].filter(Boolean).join(" ") || e.name || e.userName || e.email;
9696
+ t != null && n && (r[String(t)] = n);
9697
+ }), e || C(r);
9698
+ }).catch(() => {}), () => {
9699
+ e = !0;
9700
+ };
9701
+ }, []), I(() => {
9671
9702
  if (!e) return;
9672
9703
  let n = !1;
9673
9704
  async function r() {
9674
9705
  try {
9675
- s(!0), l("");
9706
+ l(!0), d("");
9676
9707
  let [r] = await Promise.all([Fc({
9677
9708
  module: e,
9678
9709
  id: t,
9679
9710
  view: "detail"
9680
9711
  }), wn()]);
9681
- n || a(Array.isArray(r) ? r : []);
9712
+ n || s(Array.isArray(r) ? r : []);
9682
9713
  } catch (t) {
9683
- console.error(`Failed to fetch ${e} detail fields:`, t), n || l(t?.message || "Failed to fetch detail fields");
9714
+ console.error(`Failed to fetch ${e} detail fields:`, t), n || d(t?.message || "Failed to fetch detail fields");
9684
9715
  } finally {
9685
- n || s(!1);
9716
+ n || l(!1);
9686
9717
  }
9687
9718
  }
9688
9719
  return r(), () => {
@@ -9693,37 +9724,89 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9693
9724
  t,
9694
9725
  n
9695
9726
  ]);
9696
- let v = L(() => dh(i), [i]), y = e === "job", b = L(() => y ? uh(i) : null, [y, i]), x = () => {
9697
- d(!1), p("");
9698
- }, S = async () => {
9699
- if (!f.trim()) {
9727
+ let w = L(() => dh(i), [i]), T = {
9728
+ proposedRate: "Proposed Rate",
9729
+ candidateBudget: "Candidate Rate"
9730
+ }, D = (e) => {
9731
+ let t = Object.entries(e || {}), n = t.find(([e, t]) => /(rate|budget|amount)/i.test(e) && !/(currency|symbol|unit|type)/i.test(e) && (typeof t == "number" || typeof t == "string" && t.trim() !== "" && !Number.isNaN(Number(t)))), r = t.find(([e]) => /currencysymbol/i.test(e))?.[1] || t.find(([e]) => /currency/i.test(e))?.[1] || t.find(([e]) => /symbol/i.test(e))?.[1] || "", i = t.find(([e]) => /unit/i.test(e))?.[1] || "", a = e?.timestamp?.$date ?? e?.timestamp ?? e?.updatedAt?.$date ?? e?.updatedAt ?? e?.changedAt?.$date ?? e?.changedAt, o = e?.updatedBy ?? e?.changedBy, s = n ? Number(n[1]) : null, c = {
9732
+ USD: "$",
9733
+ INR: "₹",
9734
+ GBP: "£",
9735
+ EUR: "€",
9736
+ CAD: "C$",
9737
+ AUD: "A$"
9738
+ }, l = String(r ?? "").trim(), u = c[l.toUpperCase()] || (l && !/^[A-Za-z]{2,}$/.test(l) ? l : "$"), d = {
9739
+ hr: "Hourly",
9740
+ hour: "Hourly",
9741
+ hourly: "Hourly",
9742
+ daily: "Daily",
9743
+ day: "Daily",
9744
+ weekly: "Weekly",
9745
+ week: "Weekly",
9746
+ monthly: "Monthly",
9747
+ month: "Monthly",
9748
+ yearly: "Yearly",
9749
+ year: "Yearly",
9750
+ annually: "Yearly"
9751
+ }, f = String(i ?? "").trim(), p = d[f.toLowerCase()] || (f ? f.charAt(0).toUpperCase() + f.slice(1) : "");
9752
+ return {
9753
+ amount: s != null && !Number.isNaN(s) ? `${u}${s.toLocaleString(void 0, { maximumFractionDigits: 2 })}` : "—",
9754
+ unit: p,
9755
+ when: a && La(a).isValid() ? La(a).format(`${Mt().dateFormat} · h:mm A`) : "",
9756
+ by: o == null ? "" : S[String(o)] || `User #${o}`
9757
+ };
9758
+ }, O = L(() => {
9759
+ if (!b) return [];
9760
+ let e = /* @__PURE__ */ new Set();
9761
+ i.forEach((t) => {
9762
+ ch(t.appendHistory) && [t.historyField, ...t.historyFields || []].filter(Boolean).forEach((t) => e.add(t));
9763
+ });
9764
+ let t = [];
9765
+ return e.forEach((e) => {
9766
+ let n = b[e];
9767
+ if (!Array.isArray(n) || n.length === 0) return;
9768
+ let r = n.filter((e) => e && (e.timestamp || e.updatedAt || e.changedAt));
9769
+ r.length !== 0 && t.push({
9770
+ key: e,
9771
+ label: T[e] || e,
9772
+ entries: [...r].reverse().map(D)
9773
+ });
9774
+ }), t;
9775
+ }, [
9776
+ b,
9777
+ i,
9778
+ S
9779
+ ]), k = e === "job", A = L(() => k ? uh(i) : null, [k, i]), j = () => {
9780
+ p(!1), h("");
9781
+ }, M = async () => {
9782
+ if (!m.trim()) {
9700
9783
  J.warning("Please enter a job description");
9701
9784
  return;
9702
9785
  }
9703
- h(!0);
9786
+ _(!0);
9704
9787
  try {
9705
- await _m(t, f.trim()), d(!1), p(""), s(!0);
9788
+ await _m(t, m.trim()), p(!1), h(""), l(!0);
9706
9789
  let n = await Fc({
9707
9790
  module: e,
9708
9791
  id: t,
9709
9792
  view: "detail"
9710
9793
  });
9711
- a(Array.isArray(n) ? n : []), J.success("Description updated and parsed successfully"), r?.();
9794
+ s(Array.isArray(n) ? n : []), J.success("Description updated and parsed successfully"), r?.();
9712
9795
  } catch {
9713
9796
  J.error("Failed to update description");
9714
9797
  } finally {
9715
- h(!1), s(!1);
9798
+ _(!1), l(!1);
9716
9799
  }
9717
- }, C = (e) => {
9800
+ }, ee = (e) => {
9718
9801
  let t = Number(e.detailCol);
9719
9802
  if (Number.isFinite(t) && t > 0) return Math.max(1, Math.min(3, Math.round(t / 8)));
9720
9803
  let n = typeof e.value == "string" ? e.value : "";
9721
9804
  return e.renderType === "document" || e.type === "text-editor" || n.length > 120 ? 3 : /\s(?:·|-|–|\/)\s/.test(n) && n.length >= 16 ? 2 : 1;
9722
- }, w = (e) => e.renderType === "document" || e.type === "text-editor" ? !0 : (typeof e.value == "string" ? e.value : "").length > 60, T = (e, t = "") => {
9723
- let n = e.label ?? e.field, r = w(e), i = typeof e.value == "string" ? e.value : void 0;
9805
+ }, N = (e) => e.renderType === "document" || e.type === "text-editor" ? !0 : (typeof e.value == "string" ? e.value : "").length > 60, te = (e, t = "") => {
9806
+ let n = e.label ?? e.field, r = N(e), i = typeof e.value == "string" ? e.value : void 0;
9724
9807
  return /* @__PURE__ */ X("div", {
9725
9808
  className: `v1-detail-cell${r ? " v1-detail-cell--wrap" : ""}`,
9726
- style: { "--v1-cell-span": C(e) },
9809
+ style: { "--v1-cell-span": ee(e) },
9727
9810
  children: /* @__PURE__ */ Z("div", {
9728
9811
  className: "v1-detail-field",
9729
9812
  title: !r && i ? `${n}: ${i}` : void 0,
@@ -9735,16 +9818,16 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9735
9818
  }), /* @__PURE__ */ X(ah, { field: e })]
9736
9819
  })
9737
9820
  }, `${e.field}${t}`);
9738
- }, D = /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/, O = (e, t) => {
9821
+ }, ne = /^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}|$)/, re = (e, t) => {
9739
9822
  if (t == null || typeof t == "object") return "";
9740
9823
  let n = String(t).trim();
9741
9824
  if (!n) return "";
9742
- if (e?.type === "date" || e?.renderType === "date" || D.test(n)) {
9825
+ if (e?.type === "date" || e?.renderType === "date" || ne.test(n)) {
9743
9826
  let t = La(n);
9744
9827
  if (t.isValid()) return t.format(e?.renderOptions?.dateFormat || Mt().dateFormat);
9745
9828
  }
9746
9829
  return (e?.formatter === "phone" || e?.type === "phone") && E(n) || n;
9747
- }, k = (e, t) => {
9830
+ }, ie = (e, t) => {
9748
9831
  let n = String(e?.label ?? "").trim();
9749
9832
  if (!n) return "";
9750
9833
  let r = String(t ?? "").toLowerCase().split(/[\s/]+/).filter(Boolean), i = n.split(/\s+/), a = 0;
@@ -9754,18 +9837,18 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9754
9837
  a += 1;
9755
9838
  }
9756
9839
  return i.slice(a).join(" ").trim();
9757
- }, A = (e, t, n, r) => {
9840
+ }, ae = (e, t, n, r) => {
9758
9841
  let i = e.map((e) => ({
9759
9842
  field: e,
9760
9843
  cell: n(e)
9761
- })), a = i.filter(({ cell: e }) => ee(e)).map(({ cell: e }) => ({
9844
+ })), a = i.filter(({ cell: e }) => P(e)).map(({ cell: e }) => ({
9762
9845
  ...e,
9763
9846
  renderType: "document"
9764
- })).filter((e) => Me(e.value).length > 0), o = typeof t.combineLabel == "string" && t.combineLabel.trim() ? t.combineLabel : t.label ?? t.field, s = i.filter(({ cell: e }) => !ee(e)).map(({ field: e, cell: t }) => ({
9847
+ })).filter((e) => Me(e.value).length > 0), o = typeof t.combineLabel == "string" && t.combineLabel.trim() ? t.combineLabel : t.label ?? t.field, s = i.filter(({ cell: e }) => !P(e)).map(({ field: e, cell: t }) => ({
9765
9848
  key: e.field,
9766
- label: k(e, o),
9767
- text: O(e, t.value)
9768
- })).filter((e) => e.text !== ""), c = s.map((e) => `${e.label ? `${e.label} ` : ""}${e.text}`).join(" · "), l = C({
9849
+ label: ie(e, o),
9850
+ text: re(e, t.value)
9851
+ })).filter((e) => e.text !== ""), c = s.map((e) => `${e.label ? `${e.label} ` : ""}${e.text}`).join(" · "), l = ee({
9769
9852
  detailCol: t.detailCol,
9770
9853
  value: c
9771
9854
  });
@@ -9803,7 +9886,7 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9803
9886
  ]
9804
9887
  })
9805
9888
  }, `${t.field}-merged${r}`);
9806
- }, j = (e, t, n = "") => {
9889
+ }, oe = (e, t, n = "") => {
9807
9890
  let r = /* @__PURE__ */ new Set(), i = [];
9808
9891
  return e.forEach((a) => {
9809
9892
  let o = a.combineKey?.trim?.();
@@ -9813,15 +9896,15 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9813
9896
  let a = e.filter((e) => e.combineKey?.trim?.() === o);
9814
9897
  if (a.length > 1) {
9815
9898
  let e = a.find((e) => e.combineLabel) ?? a[0];
9816
- i.push(A(a, e, t, n));
9899
+ i.push(ae(a, e, t, n));
9817
9900
  return;
9818
9901
  }
9819
9902
  }
9820
- i.push(T(t(a), n));
9903
+ i.push(te(t(a), n));
9821
9904
  }), i;
9822
- }, M = L(() => {
9905
+ }, se = L(() => {
9823
9906
  let e = {};
9824
- for (let t of g) {
9907
+ for (let t of v) {
9825
9908
  let n = t.fieldName || t.field || "file";
9826
9909
  (e[n] ??= []).push({
9827
9910
  location: t.s3Key ?? t.location ?? t.uniqueName ?? "",
@@ -9830,25 +9913,25 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9830
9913
  });
9831
9914
  }
9832
9915
  return e;
9833
- }, [g]), ee = (e) => e.type === "file" || e.type === "document" || e.renderType === "document", N = (e) => M[e.field] || e.fileKey && M[e.fileKey] || null, te = (e) => String(e?.name || e?.location || "").trim().toLowerCase(), ne = (e) => {
9916
+ }, [v]), P = (e) => e.type === "file" || e.type === "document" || e.renderType === "document", ce = (e) => se[e.field] || e.fileKey && se[e.fileKey] || null, le = (e) => String(e?.name || e?.location || "").trim().toLowerCase(), ue = (e) => {
9834
9917
  let [t] = Me(e);
9835
- return !t || !t.location && !t.url ? null : te(t);
9836
- }, re = (e, t = []) => {
9918
+ return !t || !t.location && !t.url ? null : le(t);
9919
+ }, de = (e, t = []) => {
9837
9920
  let n = /* @__PURE__ */ new Set(), r = [], i = (e) => {
9838
9921
  if (e == null || e === "") return;
9839
- let t = ne(e);
9922
+ let t = ue(e);
9840
9923
  t !== null && (t && n.has(t) || (t && n.add(t), r.push(e)));
9841
9924
  };
9842
9925
  return t.forEach(i), (Array.isArray(e) ? e : [e]).forEach(i), r;
9843
- }, ie = (e) => Me(e).map(te).filter(Boolean), ae = (e) => {
9926
+ }, fe = (e) => Me(e).map(le).filter(Boolean), pe = (e) => {
9844
9927
  let t = (e.validations ?? []).find((e) => e?.type === "maxFiles");
9845
9928
  return t ? Math.max(1, Number(t.value ?? 1)) : ch(e.multiple) ? Math.max(1, Number(e.maxCount ?? 5)) : Math.max(1, Number(e.maxCount ?? 1));
9846
- }, oe = (e, t, n) => {
9847
- let r = ae(e);
9929
+ }, he = (e, t, n) => {
9930
+ let r = pe(e);
9848
9931
  if (t.length <= r) return t;
9849
- let [i] = ie(n);
9850
- return (i ? [...t].sort((e, t) => Number(ne(t) === i) - Number(ne(e) === i)) : t).slice(0, r);
9851
- }, se = (e, t) => {
9932
+ let [i] = fe(n);
9933
+ return (i ? [...t].sort((e, t) => Number(ue(t) === i) - Number(ue(e) === i)) : t).slice(0, r);
9934
+ }, ge = (e, t) => {
9852
9935
  if (e.type === "file" || e.type === "document") return {
9853
9936
  ...e,
9854
9937
  renderType: "document",
@@ -9859,19 +9942,19 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9859
9942
  ...e,
9860
9943
  value: n
9861
9944
  };
9862
- }, P = (e) => {
9863
- if (!ee(e)) return e;
9864
- let t = oe(e, re(e.value, N(e) ?? []), e.value);
9945
+ }, _e = (e) => {
9946
+ if (!P(e)) return e;
9947
+ let t = he(e, de(e.value, ce(e) ?? []), e.value);
9865
9948
  return t.length ? {
9866
9949
  ...e,
9867
9950
  renderType: "document",
9868
9951
  value: t
9869
9952
  } : e;
9870
- }, ce = (e, t, n) => {
9871
- let r = e.name ?? e.id ?? String(t), i = Array.isArray(e.rows) ? e.rows : [], a = new Set(i.flatMap((e) => ie(e))), o = [], s = /* @__PURE__ */ new Set();
9872
- return n.filter(ee).forEach((e) => {
9873
- (N(e) ?? []).forEach((e) => {
9874
- let t = te(e);
9953
+ }, ve = (e, t, n) => {
9954
+ let r = e.name ?? e.id ?? String(t), i = Array.isArray(e.rows) ? e.rows : [], a = new Set(i.flatMap((e) => fe(e))), o = [], s = /* @__PURE__ */ new Set();
9955
+ return n.filter(P).forEach((e) => {
9956
+ (ce(e) ?? []).forEach((e) => {
9957
+ let t = le(e);
9875
9958
  !t || a.has(t) || s.has(t) || (s.add(t), o.push(e));
9876
9959
  });
9877
9960
  }), /* @__PURE__ */ Z(tr, {
@@ -9896,13 +9979,13 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9896
9979
  ]
9897
9980
  }), /* @__PURE__ */ X("div", {
9898
9981
  className: "v1-detail-grid",
9899
- children: j(n, (e) => se(e, t), `-${r}`)
9982
+ children: oe(n, (e) => ge(e, t), `-${r}`)
9900
9983
  })]
9901
9984
  }, r)), o.length > 0 && /* @__PURE__ */ X("div", {
9902
9985
  className: "v1-detail-addrow-item",
9903
9986
  children: /* @__PURE__ */ X("div", {
9904
9987
  className: "v1-detail-grid",
9905
- children: T({
9988
+ children: te({
9906
9989
  field: `${r}-files`,
9907
9990
  label: "Uploaded Files",
9908
9991
  renderType: "document",
@@ -9912,44 +9995,97 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9912
9995
  })
9913
9996
  })]
9914
9997
  }, r);
9915
- };
9998
+ }, ye = (e, t) => {
9999
+ let n = e.name ?? e.id ?? String(t), r = A ? e.fields.filter((e) => e.field !== A.key) : e.fields;
10000
+ return r.length ? e.addRow ? ve(e, t, r) : /* @__PURE__ */ X(tr, {
10001
+ size: "small",
10002
+ className: "v1-card v1-detail-card",
10003
+ title: /* @__PURE__ */ X(fh, {
10004
+ icon: sh[t % sh.length],
10005
+ title: e.label ?? e.name ?? "Details"
10006
+ }),
10007
+ children: /* @__PURE__ */ X("div", {
10008
+ className: "v1-detail-grid",
10009
+ children: oe(r, _e)
10010
+ })
10011
+ }, n) : null;
10012
+ }, be = () => /* @__PURE__ */ X(tr, {
10013
+ size: "small",
10014
+ className: "v1-card v1-detail-card",
10015
+ title: /* @__PURE__ */ X(fh, {
10016
+ icon: /* @__PURE__ */ X(Di, {}),
10017
+ title: "Rate Details"
10018
+ }),
10019
+ children: O.map((e, t) => /* @__PURE__ */ Z("div", {
10020
+ className: `v1-rh-section${t > 0 ? " v1-rh-section--gap" : ""}`,
10021
+ children: [/* @__PURE__ */ X("div", {
10022
+ className: "v1-rh-section-title",
10023
+ children: e.label
10024
+ }), /* @__PURE__ */ X("div", {
10025
+ className: "v1-rate-history",
10026
+ children: e.entries.map((e, t) => /* @__PURE__ */ Z("div", {
10027
+ className: `v1-rh-item${t === 0 ? " v1-rh-latest" : ""}`,
10028
+ children: [
10029
+ /* @__PURE__ */ X("span", {
10030
+ className: "v1-rh-amount",
10031
+ children: e.amount
10032
+ }),
10033
+ e.unit && /* @__PURE__ */ Z("span", {
10034
+ className: "v1-rh-unit",
10035
+ children: ["/ ", e.unit]
10036
+ }),
10037
+ e.by && /* @__PURE__ */ Z("span", {
10038
+ className: "v1-rh-chip",
10039
+ children: [
10040
+ /* @__PURE__ */ X(wa, {}),
10041
+ " ",
10042
+ e.by
10043
+ ]
10044
+ }),
10045
+ e.when && /* @__PURE__ */ Z("span", {
10046
+ className: "v1-rh-chip",
10047
+ children: [
10048
+ /* @__PURE__ */ X(Xr, {}),
10049
+ " ",
10050
+ e.when
10051
+ ]
10052
+ }),
10053
+ t === 0 && /* @__PURE__ */ X("span", {
10054
+ className: "v1-rh-badge",
10055
+ children: "Latest"
10056
+ })
10057
+ ]
10058
+ }, t))
10059
+ })]
10060
+ }, e.key))
10061
+ }, "rate-details-history"), xe = (e) => /current_employer|employer_details/i.test(e.name || "") || (e.fields || []).some((e) => e.field === "employerId");
9916
10062
  return /* @__PURE__ */ X(Sr, {
9917
- spinning: o,
10063
+ spinning: c,
9918
10064
  tip: "Loading detail fields...",
9919
10065
  children: /* @__PURE__ */ Z("div", {
9920
10066
  className: "v1-detail-left",
9921
10067
  children: [
9922
- c && /* @__PURE__ */ X(Xn, {
10068
+ u && /* @__PURE__ */ X(Xn, {
9923
10069
  type: "error",
9924
10070
  showIcon: !0,
9925
10071
  message: "Unable to load detail fields",
9926
- description: c,
10072
+ description: u,
9927
10073
  className: "v1-detail-alert"
9928
10074
  }),
9929
- !o && !c && v.length === 0 && /* @__PURE__ */ X(cr, { description: "No detail fields are configured." }),
9930
- v.map((e, t) => {
9931
- let n = e.name ?? e.id ?? String(t), r = b ? e.fields.filter((e) => e.field !== b.key) : e.fields;
9932
- return r.length ? e.addRow ? ce(e, t, r) : /* @__PURE__ */ X(tr, {
9933
- size: "small",
9934
- className: "v1-card v1-detail-card",
9935
- title: /* @__PURE__ */ X(fh, {
9936
- icon: sh[t % sh.length],
9937
- title: e.label ?? e.name ?? "Details"
9938
- }),
9939
- children: /* @__PURE__ */ X("div", {
9940
- className: "v1-detail-grid",
9941
- children: j(r, P)
9942
- })
9943
- }, n) : null;
10075
+ !c && !u && w.length === 0 && /* @__PURE__ */ X(cr, { description: "No detail fields are configured." }),
10076
+ w.flatMap((e, t) => {
10077
+ let n = [ye(e, t)];
10078
+ return xe(e) && O.length > 0 && n.push(be()), n;
9944
10079
  }),
9945
- y && b?.value && /* @__PURE__ */ X(tr, {
10080
+ O.length > 0 && !w.some(xe) && be(),
10081
+ k && A?.value && /* @__PURE__ */ X(tr, {
9946
10082
  size: "small",
9947
10083
  className: "v1-card v1-detail-card",
9948
10084
  title: /* @__PURE__ */ X(fh, {
9949
10085
  icon: /* @__PURE__ */ X(wi, {}),
9950
10086
  title: "Description"
9951
10087
  }),
9952
- children: u ? /* @__PURE__ */ Z("div", {
10088
+ children: f ? /* @__PURE__ */ Z("div", {
9953
10089
  style: {
9954
10090
  display: "flex",
9955
10091
  flexDirection: "column",
@@ -9965,9 +10101,9 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9965
10101
  },
9966
10102
  children: /* @__PURE__ */ X(H.TextArea, {
9967
10103
  rows: 10,
9968
- value: f,
9969
- onChange: (e) => p(e.target.value),
9970
- placeholder: b.hidePlaceholder ? void 0 : b.placeholder,
10104
+ value: m,
10105
+ onChange: (e) => h(e.target.value),
10106
+ placeholder: A.hidePlaceholder ? void 0 : A.placeholder,
9971
10107
  style: {
9972
10108
  fontSize: 13,
9973
10109
  lineHeight: 1.65,
@@ -9985,16 +10121,16 @@ function mh({ moduleName: e, id: t, refreshKey: n = 0, onDescriptionSaved: r })
9985
10121
  children: [/* @__PURE__ */ X(bu, {
9986
10122
  variant: "primary",
9987
10123
  size: "small",
9988
- loading: m,
9989
- onClick: S,
10124
+ loading: g,
10125
+ onClick: M,
9990
10126
  children: "Save & Parse"
9991
10127
  }), /* @__PURE__ */ X(bu, {
9992
10128
  size: "small",
9993
- onClick: x,
10129
+ onClick: j,
9994
10130
  children: "Cancel"
9995
10131
  })]
9996
10132
  })]
9997
- }) : /* @__PURE__ */ X(ph, { value: b.value })
10133
+ }) : /* @__PURE__ */ X(ph, { value: A.value })
9998
10134
  })
9999
10135
  ]
10000
10136
  })
@@ -17134,6 +17270,32 @@ function cb({ type: e, record: t, lookups: n, identity: r, referralOptions: i, o
17134
17270
  ]
17135
17271
  })]
17136
17272
  }),
17273
+ ue && /* @__PURE__ */ Z("div", {
17274
+ className: `fa-margin-note ${pe}`,
17275
+ children: [/* @__PURE__ */ Z("span", {
17276
+ className: "fa-margin-note-pct",
17277
+ children: [fe.toFixed(1), "%"]
17278
+ }), /* @__PURE__ */ X("span", {
17279
+ className: "fa-margin-note-text",
17280
+ children: pe === "fa-bad" ? /* @__PURE__ */ Z(Y, { children: [
17281
+ "This submission is running at a ",
17282
+ /* @__PURE__ */ X("b", { children: "loss" }),
17283
+ ". Adjust the proposed or employer rate before approving."
17284
+ ] }) : pe === "fa-warn" ? /* @__PURE__ */ Z(Y, { children: [
17285
+ "Profit margin is ",
17286
+ /* @__PURE__ */ Z("b", { children: [
17287
+ "below the ",
17288
+ de,
17289
+ "% target"
17290
+ ] }),
17291
+ ". Consider a higher proposed rate before approving."
17292
+ ] }) : /* @__PURE__ */ Z(Y, { children: [
17293
+ "Healthy margin — at or above the ",
17294
+ de,
17295
+ "% target."
17296
+ ] })
17297
+ })]
17298
+ }),
17137
17299
  Ce?.requireReason && /* @__PURE__ */ Z("div", {
17138
17300
  className: "fa-reason",
17139
17301
  children: [