flowcore-fn 10.3.9 → 10.4.1

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/pkg-index.js CHANGED
@@ -9517,21 +9517,21 @@ function Popup({ isOpen, onClose, onSave }) {
9517
9517
  }
9518
9518
  };
9519
9519
  const permissionCards = [
9520
- { icon: "\u{1F441}\uFE0F", title: "Can View", desc: "Read logs & details", field: "canView" },
9521
- { icon: "\u2713", title: "Can Approve", desc: "Pass states & approve", field: "canApprove" },
9522
- { icon: "\u{1F4DD}", title: "Can Edit", desc: "Modify properties", field: "canEdit" },
9523
- { icon: "\u2715", title: "Can Reject", desc: "Cancel / reject tasks", field: "canReject" },
9524
- { icon: "\u27A1\uFE0F", title: "Can Forward", desc: "Forward to next step", field: "canForward" },
9525
- { icon: "\u23E9", title: "Can Free Forward", desc: "Forward freely to any step", field: "canFreeForward" },
9526
- { icon: "\u21A9\uFE0F", title: "Can Return", desc: "Return to previous step", field: "canReturn" },
9527
- { icon: "\u{1F464}", title: "Can Return To Applicant", desc: "Send back to applicant", field: "canReturnToApplicant" },
9528
- { icon: "\u{1F465}", title: "Can Delegate", desc: "Reassign or delegate task", field: "canDelegate" },
9529
- { icon: "\u23F8\uFE0F", title: "Can Hold", desc: "Put execution on hold", field: "canHold" }
9520
+ { title: "Can View", field: "canView", labelField: "viewLabel" },
9521
+ { title: "Can Approve", field: "canApprove", labelField: "approveLabel" },
9522
+ { title: "Can Edit", field: "canEdit", labelField: "editLabel" },
9523
+ { title: "Can Reject", field: "canReject", labelField: "rejectLabel" },
9524
+ { title: "Can Forward", field: "canForward", labelField: "forwardLabel" },
9525
+ { title: "Can Free Forward", field: "canFreeForward", labelField: "freeForwardLabel" },
9526
+ { title: "Can Return", field: "canReturn", labelField: "returnLabel" },
9527
+ { title: "Can Return To Applicant", field: "canReturnToApplicant", labelField: "returnToApplicantLabel" },
9528
+ { title: "Can Delegate", field: "canDelegate", labelField: "delegateLabel" },
9529
+ { title: "Can Hold", field: "canHold", labelField: "holdLabel" }
9530
9530
  ];
9531
9531
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
9532
9532
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
9533
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:relative fc:w-full fc:max-w-4xl fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:flex fc:flex-col fc:z-10 fc:max-h-[92vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:duration-200", children: [
9534
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
9533
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:relative fc:w-full fc:max-w-6xl fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:flex fc:flex-col fc:z-10 fc:max-h-[96vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:duration-200", children: [
9534
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-6 fc:py-4 fc:border-b fc:border-slate-100", children: [
9535
9535
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
9536
9536
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fc:w-12 fc:h-12 fc:bg-blue-50 fc:text-blue-600 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:shadow-sm fc:text-xl", children: "\u{1F511}" }),
9537
9537
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
@@ -9541,10 +9541,10 @@ function Popup({ isOpen, onClose, onSave }) {
9541
9541
  ] }),
9542
9542
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { onClick: onClose, className: "fc:text-slate-400 hover:fc:fc:text-slate-600 hover:fc:fc:bg-slate-100 fc:p-2 fc:rounded-full fc:transition-all fc:text-sm fc:font-semibold", children: "\u2715" })
9543
9543
  ] }),
9544
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { onSubmit: handleSubmit, className: "fc:flex fc:flex-col fc:flex-1 fc:overflow-hidden", children: [
9545
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:p-8 fc:space-y-8 fc:overflow-y-auto fc:max-h-[calc(92vh-170px)] fc:bg-slate-50/30", children: [
9546
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9547
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9544
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("form", { onSubmit: handleSubmit, className: "fc:flex fc:min-h-0 fc:flex-1 fc:flex-col fc:overflow-hidden", children: [
9545
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:min-h-0 fc:flex-1 fc:space-y-4 fc:overflow-y-auto fc:bg-slate-50/30 fc:p-4 md:fc:p-5", children: [
9546
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9547
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
9548
9548
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u{1F4CB}" }),
9549
9549
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Step Information" })
9550
9550
  ] }),
@@ -9577,56 +9577,57 @@ function Popup({ isOpen, onClose, onSave }) {
9577
9577
  errors.workflowStepId && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1", children: errors.workflowStepId })
9578
9578
  ] })
9579
9579
  ] }),
9580
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9580
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9581
9581
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9582
9582
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u2699\uFE0F" }),
9583
9583
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Set Initial Matrix Access Rules" })
9584
9584
  ] }),
9585
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionCards.map(({ icon, title, desc, field }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:justify-between fc:p-4 fc:bg-slate-50/50 fc:border fc:border-slate-100 fc:rounded-2xl", children: [
9586
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2.5", children: [
9587
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fc:w-8 fc:h-8 fc:rounded-lg fc:bg-blue-50 fc:text-blue-600 fc:flex fc:items-center fc:justify-center fc:text-xs", children: icon }),
9588
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
9589
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "fc:text-xs fc:font-bold fc:text-slate-700", children: title }),
9590
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "fc:text-[9px] fc:text-slate-400", children: desc })
9591
- ] })
9592
- ] }),
9593
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9594
- "button",
9595
- {
9596
- type: "button",
9597
- onClick: () => handleChange(field, !formData[field]),
9598
- className: `fc:relative fc:inline-flex fc:h-5.5 fc:w-10 fc:shrink-0 fc:cursor-pointer fc:rounded-full fc:border-2 fc:border-transparent fc:transition-colors fc:duration-200 fc:ease-in-out fc:outline-none ${formData[field] ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
9599
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9600
- "span",
9601
- {
9602
- className: `fc:pointer-events-none fc:inline-block fc:h-4.5 fc:w-4.5 fc:transform fc:rounded-full fc:bg-white fc:shadow fc:ring-0 fc:transition fc:duration-200 fc:ease-in-out ${formData[field] ? "fc:translate-x-4.5" : "fc:translate-x-0"}`
9603
- }
9604
- )
9605
- }
9606
- )
9607
- ] }, field)) })
9608
- ] }),
9609
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9610
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9611
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u{1F3F7}\uFE0F" }),
9612
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Action Labels" })
9613
- ] }),
9614
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionLabelFields.map(({ field, label, fallback }) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { children: [
9615
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: label }),
9616
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9617
- "input",
9618
- {
9619
- type: "text",
9620
- value: formData[field],
9621
- onChange: (event) => handleChange(field, event.target.value),
9622
- placeholder: fallback,
9623
- className: "fc:w-full fc:px-3 fc:py-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:text-slate-700 fc:bg-white focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500"
9624
- }
9625
- )
9626
- ] }, field)) })
9585
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9586
+ "div",
9587
+ {
9588
+ className: "fc:grid fc:gap-3",
9589
+ style: { gridTemplateColumns: "repeat(auto-fit, minmax(max(200px, calc((100% - 36px) / 4)), 1fr))" },
9590
+ children: permissionCards.map(({ title, field, labelField }) => {
9591
+ var _a, _b;
9592
+ const actionLabel = permissionLabelFields.find((item) => item.field === labelField);
9593
+ return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:min-w-0 fc:flex-col fc:gap-2 fc:rounded-xl fc:border fc:border-slate-100 fc:bg-slate-50/50 fc:p-3", children: [
9594
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "fc:text-[11px] fc:font-extrabold fc:text-slate-700", children: title }),
9595
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2", children: [
9596
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9597
+ "input",
9598
+ {
9599
+ type: "text",
9600
+ "aria-label": (_a = actionLabel == null ? void 0 : actionLabel.label) != null ? _a : `${title} label`,
9601
+ value: (_b = formData[labelField]) != null ? _b : "",
9602
+ placeholder: actionLabel == null ? void 0 : actionLabel.fallback,
9603
+ onChange: (event) => handleChange(labelField, event.target.value),
9604
+ className: "fc:min-w-0 fc:flex-1 fc:rounded-lg fc:border fc:border-slate-200 fc:bg-white fc:px-2 fc:py-1.5 fc:text-[11px] fc:text-slate-700 focus:fc:border-indigo-500 focus:fc:outline-none"
9605
+ }
9606
+ ),
9607
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9608
+ "button",
9609
+ {
9610
+ type: "button",
9611
+ "aria-label": `${title}: ${formData[field] ? "enabled" : "disabled"}`,
9612
+ "aria-pressed": Boolean(formData[field]),
9613
+ onClick: () => handleChange(field, !formData[field]),
9614
+ className: `fc:relative fc:inline-flex fc:h-5.5 fc:w-10 fc:shrink-0 fc:cursor-pointer fc:rounded-full fc:border-2 fc:border-transparent fc:transition-colors fc:duration-200 fc:ease-in-out fc:outline-none ${formData[field] ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
9615
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
9616
+ "span",
9617
+ {
9618
+ className: `fc:pointer-events-none fc:inline-block fc:h-4.5 fc:w-4.5 fc:transform fc:rounded-full fc:bg-white fc:shadow fc:ring-0 fc:transition fc:duration-200 fc:ease-in-out ${formData[field] ? "fc:translate-x-4.5" : "fc:translate-x-0"}`
9619
+ }
9620
+ )
9621
+ }
9622
+ )
9623
+ ] })
9624
+ ] }, field);
9625
+ })
9626
+ }
9627
+ )
9627
9628
  ] }),
9628
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9629
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9629
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-3", children: [
9630
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
9630
9631
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "\u{1F518}" }),
9631
9632
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { children: "Status" })
9632
9633
  ] }),
@@ -9650,7 +9651,7 @@ function Popup({ isOpen, onClose, onSave }) {
9650
9651
  )) })
9651
9652
  ] })
9652
9653
  ] }),
9653
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:p-5 fc:bg-white fc:border-t fc:border-slate-100 fc:flex fc:items-center fc:justify-end fc:gap-3 fc:px-8", children: [
9654
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-3 fc:border-t fc:border-slate-100 fc:bg-white fc:px-6 fc:py-3", children: [
9654
9655
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
9655
9656
  "button",
9656
9657
  {
@@ -10433,12 +10434,12 @@ function FormFieldMain() {
10433
10434
  /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
10434
10435
  CommonHeader,
10435
10436
  {
10436
- title: "Update Permission",
10437
+ title: "Applicant Form Fields",
10437
10438
  breadcrumbs: [
10438
10439
  { label: "Dashboard", href: "/dashboard" },
10439
10440
  { label: "Masters", href: "/masters" },
10440
10441
  { label: "Permissions", href: "/permissions" },
10441
- { label: "Update Permission", href: "/form-field" }
10442
+ { label: "Applicant Form Fields", href: "/form-field" }
10442
10443
  ],
10443
10444
  buttonText: "Add Form Field",
10444
10445
  onButtonClick: openCreate
@@ -18800,7 +18801,9 @@ function AddStatusModal({
18800
18801
  isOpen,
18801
18802
  onClose,
18802
18803
  onSave,
18803
- modules = []
18804
+ modules = [],
18805
+ actionCodes = [],
18806
+ isLoadingActionCodes = false
18804
18807
  }) {
18805
18808
  const [formData, setFormData] = (0, import_react94.useState)(INITIAL_FORM4);
18806
18809
  const [errors, setErrors] = (0, import_react94.useState)({});
@@ -18848,9 +18851,6 @@ function AddStatusModal({
18848
18851
  if (!formData.moduleId) {
18849
18852
  errs.moduleId = "Module is required.";
18850
18853
  }
18851
- if (!formData.statusName.trim()) {
18852
- errs.statusName = "Status Name is required.";
18853
- }
18854
18854
  if (!formData.statusCode.trim()) {
18855
18855
  errs.statusCode = "Status Code is required.";
18856
18856
  }
@@ -18863,7 +18863,7 @@ function AddStatusModal({
18863
18863
  if (!validate()) return;
18864
18864
  const payload = {
18865
18865
  moduleId: Number(formData.moduleId),
18866
- statusName: formData.statusName.trim(),
18866
+ statusName: formData.statusCode.trim().toUpperCase(),
18867
18867
  statusCode: formData.statusCode.trim().toUpperCase(),
18868
18868
  description: formData.description.trim(),
18869
18869
  createdBy: "System"
@@ -18963,15 +18963,21 @@ function AddStatusModal({
18963
18963
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "fc:text-red-500", children: "*" })
18964
18964
  ] }),
18965
18965
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "fc:relative", children: [
18966
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
18967
- "input",
18966
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
18967
+ "select",
18968
18968
  {
18969
- type: "text",
18970
18969
  name: "statusCode",
18971
18970
  value: formData.statusCode,
18972
18971
  onChange: handleChange,
18973
- placeholder: "e.g. ST_01, COMPLETED",
18974
- className: `${inputCls(errors.statusCode)} uppercase`
18972
+ disabled: isLoadingActionCodes,
18973
+ className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
18974
+ children: [
18975
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
18976
+ actionCodes.map((action) => {
18977
+ var _a;
18978
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
18979
+ })
18980
+ ]
18975
18981
  }
18976
18982
  ),
18977
18983
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
@@ -18979,27 +18985,6 @@ function AddStatusModal({
18979
18985
  errors.statusCode && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
18980
18986
  ] })
18981
18987
  ] }),
18982
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { children: [
18983
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
18984
- "Status Name ",
18985
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("span", { className: "fc:text-red-500", children: "*" })
18986
- ] }),
18987
- /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "fc:relative", children: [
18988
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
18989
- "input",
18990
- {
18991
- type: "text",
18992
- name: "statusName",
18993
- value: formData.statusName,
18994
- onChange: handleChange,
18995
- placeholder: "Enter status name (e.g. In Progress, Completed)",
18996
- className: inputCls(errors.statusName)
18997
- }
18998
- ),
18999
- /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
19000
- ] }),
19001
- errors.statusName && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
19002
- ] }),
19003
18988
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { children: [
19004
18989
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
19005
18990
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "fc:relative", children: [
@@ -19075,6 +19060,8 @@ function EditStatusModal({
19075
19060
  onSave,
19076
19061
  selectedData,
19077
19062
  modules = [],
19063
+ actionCodes = [],
19064
+ isLoadingActionCodes = false,
19078
19065
  isFetchingById = false
19079
19066
  }) {
19080
19067
  const [formData, setFormData] = (0, import_react95.useState)(() => getInitialFormData3(selectedData));
@@ -19131,9 +19118,6 @@ function EditStatusModal({
19131
19118
  if (!formData.moduleId) {
19132
19119
  errs.moduleId = "Module is required.";
19133
19120
  }
19134
- if (!String(formData.statusName).trim()) {
19135
- errs.statusName = "Status Name is required.";
19136
- }
19137
19121
  if (!String(formData.statusCode).trim()) {
19138
19122
  errs.statusCode = "Status Code is required.";
19139
19123
  }
@@ -19147,7 +19131,7 @@ function EditStatusModal({
19147
19131
  const payload = {
19148
19132
  statusId: Number(formData.statusId) || 0,
19149
19133
  moduleId: Number(formData.moduleId) || 0,
19150
- statusName: String(formData.statusName).trim(),
19134
+ statusName: String(formData.statusCode).trim().toUpperCase(),
19151
19135
  statusCode: String(formData.statusCode).trim().toUpperCase(),
19152
19136
  description: String(formData.description).trim(),
19153
19137
  isActive: Boolean(formData.isActive),
@@ -19253,15 +19237,22 @@ function EditStatusModal({
19253
19237
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "fc:text-red-500", children: "*" })
19254
19238
  ] }),
19255
19239
  /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "fc:relative", children: [
19256
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19257
- "input",
19240
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
19241
+ "select",
19258
19242
  {
19259
- type: "text",
19260
19243
  name: "statusCode",
19261
19244
  value: formData.statusCode,
19262
19245
  onChange: handleChange,
19263
- placeholder: "e.g. ST_01, COMPLETED",
19264
- className: `${inputCls(errors.statusCode)} uppercase`
19246
+ disabled: true,
19247
+ className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
19248
+ children: [
19249
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
19250
+ formData.statusCode && !actionCodes.some((action) => action.name.toUpperCase() === String(formData.statusCode).toUpperCase()) && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("option", { value: formData.statusCode, children: formData.statusCode }),
19251
+ actionCodes.map((action) => {
19252
+ var _a;
19253
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
19254
+ })
19255
+ ]
19265
19256
  }
19266
19257
  ),
19267
19258
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
@@ -19269,45 +19260,7 @@ function EditStatusModal({
19269
19260
  errors.statusCode && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
19270
19261
  ] })
19271
19262
  ] }),
19272
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-3.5", children: [
19273
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
19274
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
19275
- "Status Name ",
19276
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { className: "fc:text-red-500", children: "*" })
19277
- ] }),
19278
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "fc:relative", children: [
19279
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19280
- "input",
19281
- {
19282
- type: "text",
19283
- name: "statusName",
19284
- value: formData.statusName,
19285
- onChange: handleChange,
19286
- placeholder: "Enter status name",
19287
- className: inputCls(errors.statusName)
19288
- }
19289
- ),
19290
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
19291
- ] }),
19292
- errors.statusName && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
19293
- ] }),
19294
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
19295
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Status ID" }),
19296
- /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "fc:relative", children: [
19297
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
19298
- "input",
19299
- {
19300
- type: "text",
19301
- name: "statusId",
19302
- value: formData.statusId,
19303
- disabled: true,
19304
- className: "fc:w-full fc:py-2.5 fc:px-3 fc:pl-9 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-slate-100 fc:text-slate-500 fc:cursor-not-allowed"
19305
- }
19306
- ),
19307
- /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14" }) })
19308
- ] })
19309
- ] })
19310
- ] }),
19263
+ /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-3.5" }),
19311
19264
  /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { children: [
19312
19265
  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
19313
19266
  /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { className: "fc:relative", children: [
@@ -19421,7 +19374,8 @@ var DEFAULT_ENDPOINTS2 = {
19421
19374
  update: "/api/flowcore/Status/Update",
19422
19375
  getList: "/api/flowcore/Status/GetList",
19423
19376
  getById: "/api/flowcore/Status/GetById",
19424
- moduleList: "/api/flowcore/Module/GetList"
19377
+ moduleList: "/api/flowcore/Module/GetList",
19378
+ actionCodeList: "/api/flowcore/WorkflowExecution/GetActionCodeList"
19425
19379
  };
19426
19380
  function StatusMain() {
19427
19381
  const tableRef = (0, import_react96.useRef)(null);
@@ -19429,6 +19383,9 @@ function StatusMain() {
19429
19383
  const [isLoading, setIsLoading] = (0, import_react96.useState)(false);
19430
19384
  const [apiData, setApiData] = (0, import_react96.useState)([]);
19431
19385
  const [modules, setModules] = (0, import_react96.useState)([]);
19386
+ const [actionCodes, setActionCodes] = (0, import_react96.useState)([]);
19387
+ const [isLoadingActionCodes, setIsLoadingActionCodes] = (0, import_react96.useState)(false);
19388
+ const [hasLoadedActionCodes, setHasLoadedActionCodes] = (0, import_react96.useState)(false);
19432
19389
  const [selectedModuleId, setSelectedModuleId] = (0, import_react96.useState)("");
19433
19390
  const [pageSize, setPageSize] = (0, import_react96.useState)(5);
19434
19391
  const [searchQuery, setSearchQuery] = (0, import_react96.useState)("");
@@ -19466,9 +19423,50 @@ function StatusMain() {
19466
19423
  return DEFAULT_ENDPOINTS2.moduleList;
19467
19424
  }
19468
19425
  };
19426
+ const getActionCodeListEndpoint = () => {
19427
+ var _a, _b;
19428
+ try {
19429
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
19430
+ return ((_b = flowCore == null ? void 0 : flowCore.inbox) == null ? void 0 : _b.GetPermisiionLabelWithCodeAll) || DEFAULT_ENDPOINTS2.actionCodeList;
19431
+ } catch (e) {
19432
+ return DEFAULT_ENDPOINTS2.actionCodeList;
19433
+ }
19434
+ };
19469
19435
  const handleRefresh = () => {
19470
19436
  setRefreshKey((prev) => prev + 1);
19471
19437
  };
19438
+ const handleOpenAdd = async () => {
19439
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
19440
+ setIsAddOpen(true);
19441
+ if (hasLoadedActionCodes || isLoadingActionCodes) return;
19442
+ try {
19443
+ setIsLoadingActionCodes(true);
19444
+ let endpoint3 = getActionCodeListEndpoint();
19445
+ if (typeof endpoint3 === "function") endpoint3 = endpoint3();
19446
+ const response = await getApiService().get(endpoint3);
19447
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
19448
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
19449
+ setActionCodes(rows.filter((item) => {
19450
+ var _a2;
19451
+ return (_a2 = item == null ? void 0 : item.name) != null ? _a2 : item == null ? void 0 : item.Name;
19452
+ }).map((item) => {
19453
+ var _a2, _b2;
19454
+ return {
19455
+ value: (_a2 = item.value) != null ? _a2 : item.Value,
19456
+ name: String((_b2 = item.name) != null ? _b2 : item.Name)
19457
+ };
19458
+ }));
19459
+ setHasLoadedActionCodes(true);
19460
+ } catch (error) {
19461
+ await import_sweetalert229.default.fire(
19462
+ "Error",
19463
+ ((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load action codes.",
19464
+ "error"
19465
+ );
19466
+ } finally {
19467
+ setIsLoadingActionCodes(false);
19468
+ }
19469
+ };
19472
19470
  (0, import_react96.useEffect)(() => {
19473
19471
  let isMounted = true;
19474
19472
  (async () => {
@@ -19683,7 +19681,7 @@ function StatusMain() {
19683
19681
  { label: "Status", href: "/status" }
19684
19682
  ],
19685
19683
  buttonText: "Add Status",
19686
- onButtonClick: () => setIsAddOpen(true)
19684
+ onButtonClick: handleOpenAdd
19687
19685
  }
19688
19686
  ),
19689
19687
  /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("div", { className: "fc:bg-white fc:rounded-3xl fc:shadow-sm fc:border fc:border-slate-100 fc:p-6 fc:flex fc:flex-col fc:gap-6", children: [
@@ -19816,7 +19814,9 @@ function StatusMain() {
19816
19814
  isOpen: isAddOpen,
19817
19815
  onClose: () => setIsAddOpen(false),
19818
19816
  onSave: handleCreate,
19819
- modules
19817
+ modules,
19818
+ actionCodes,
19819
+ isLoadingActionCodes
19820
19820
  }
19821
19821
  ),
19822
19822
  /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
@@ -19829,6 +19829,8 @@ function StatusMain() {
19829
19829
  },
19830
19830
  selectedData: selectedItem,
19831
19831
  modules,
19832
+ actionCodes,
19833
+ isLoadingActionCodes,
19832
19834
  onSave: handleUpdate
19833
19835
  }
19834
19836
  )
@@ -21342,141 +21344,305 @@ var import_react118 = require("@remixicon/react");
21342
21344
  // src/components/inbox/DynamicFormDisplay.jsx
21343
21345
  var import_react115 = __toESM(require("react"));
21344
21346
  var import_react116 = require("@remixicon/react");
21345
- var import_jsx_runtime106 = require("react/jsx-runtime");
21346
- var STATIC_FORM_JSON = {
21347
- formId: "election-petition",
21348
- formName: "Election Petition Application",
21349
- schemaVersion: "1.0",
21350
- layout: { columns: 2, collapsibleSections: true, defaultExpanded: true },
21351
- sections: [
21352
- {
21353
- id: "basic-information",
21354
- title: "Basic Information",
21355
- type: "section",
21356
- fields: [
21357
- { id: "applicant-name", label: "Applicant Name", type: "text", value: "Mohit Sharma", colSpan: 1 },
21358
- { id: "mobile-number", label: "Mobile Number", type: "tel", value: "9876543210", colSpan: 1 },
21359
- { id: "email-address", label: "Email Address", type: "email", value: "mohit.sharma@example.com", colSpan: 1 },
21360
- { id: "address", label: "Address", type: "text", value: "Sector 22, Chandigarh, 160022", colSpan: 1 }
21361
- ]
21362
- },
21363
- {
21364
- id: "petition-details",
21365
- title: "Petition Details",
21366
- type: "section",
21367
- fields: [
21368
- { id: "category", label: "Category", type: "text", value: "General", colSpan: 1 },
21369
- { id: "payment-challan-number", label: "Payment Challan Number", type: "text", value: "CHN2026001234", colSpan: 1 },
21370
- { id: "deposit-date", label: "Deposit Date", type: "date", value: "2026-09-28", displayValue: "28 Sep 2026", colSpan: 1 },
21371
- { id: "election-type", label: "Election Type", type: "text", value: "Municipal Election", colSpan: 1 },
21372
- { id: "ward-number", label: "Ward Number", type: "number", value: 22, colSpan: 1 },
21373
- { id: "description", label: "Description", type: "textarea", value: "Election petition for ward no. 22", colSpan: 2 },
21374
- { id: "declaration-accepted", label: "Applicant Declaration Accepted", type: "boolean", value: true, displayValue: "Yes", colSpan: 2 }
21375
- ]
21376
- },
21377
- {
21378
- id: "beneficiaries",
21379
- title: "Beneficiaries",
21380
- type: "table",
21381
- columns: [
21382
- { id: "col-1", key: "name", label: "Name", type: "text" },
21383
- { id: "col-2", key: "gender", label: "Gender", type: "text" },
21384
- { id: "col-3", key: "date-of-birth", label: "Date of Birth", type: "date" },
21385
- { id: "col-4", key: "is-active", label: "Is Active", type: "boolean" }
21386
- ],
21387
- rows: [
21388
- { id: "row-1", values: ["Ramesh Kumar", "Male", "1985-01-12", true] },
21389
- { id: "row-2", values: ["Priya Devi", "Female", "1990-03-04", true] },
21390
- { id: "row-3", values: ["Amit Singh", "Male", "1988-08-21", false] }
21391
- ]
21392
- },
21393
- {
21394
- id: "attachments",
21395
- title: "Applicant Attachments",
21396
- type: "attachments",
21397
- files: [
21398
- { id: "file-1", label: "Fee Challan File", fileName: "fee_challan_1234.pdf", contentType: "application/pdf", sizeBytes: 250880, downloadUrl: "/api/applications/TASK-31/files/file-1" },
21399
- { id: "file-2", label: "Supporting Document", fileName: "petition_document.pdf", contentType: "application/pdf", sizeBytes: 1258291, downloadUrl: "/api/applications/TASK-31/files/file-2" }
21400
- ]
21401
- },
21402
- {
21403
- id: "additional-information",
21404
- title: "Additional Information",
21405
- type: "section",
21406
- fields: [
21407
- { id: "additional-comments", label: "Additional Comments", type: "textarea", value: "Please find the attached documents for election petition.", colSpan: 2 }
21408
- ]
21409
- }
21410
- ]
21347
+ init_ApiServicepackage();
21348
+
21349
+ // src/components/inbox/reviewHelpers.js
21350
+ init_ApiEndpointsProvider();
21351
+ var getAvailableActions2 = (response) => {
21352
+ var _a, _b, _c, _d, _e, _f, _g;
21353
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21354
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21355
+ return rows.map((action) => {
21356
+ var _a2, _b2, _c2, _d2, _e2, _f2;
21357
+ return {
21358
+ label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
21359
+ actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
21360
+ };
21361
+ }).filter((action) => action.label && action.actionCode);
21411
21362
  };
21412
- var formatSize = (bytes) => {
21413
- if (bytes >= 1048576) return `${(bytes / 1048576).toFixed(1)} MB`;
21414
- if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;
21415
- return `${bytes} B`;
21363
+ var getWorkflowStepsStatusEndpoint = () => {
21364
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
21365
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21366
+ const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
21367
+ if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
21368
+ return endpoint3;
21416
21369
  };
21417
- var FieldCard = ({ field }) => {
21418
- var _a;
21419
- const label = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[11px] fc:font-bold fc:text-slate-500 fc:block", children: field.label });
21420
- const span = field.colSpan === 2 ? "fc:col-span-2" : "";
21421
- if (field.type === "boolean") {
21422
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21423
- label,
21424
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:mt-1", children: [
21425
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("input", { type: "checkbox", checked: field.value === true, readOnly: true, className: "fc:h-4 fc:w-4 fc:accent-emerald-600" }),
21426
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900", children: field.displayValue || (field.value ? "Yes" : "No") })
21427
- ] })
21428
- ] });
21429
- }
21430
- if (field.type === "textarea") {
21431
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21432
- label,
21433
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-semibold fc:text-slate-900 fc:mt-1 fc:block fc:whitespace-pre-wrap", children: field.value || "-" })
21434
- ] });
21370
+ var getWorkflowSteps = (response) => {
21371
+ var _a, _b, _c, _d, _e, _f, _g;
21372
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21373
+ const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
21374
+ return Array.isArray(steps) ? [...steps].sort((first, second) => {
21375
+ var _a2, _b2, _c2, _d2;
21376
+ return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
21377
+ }) : [];
21378
+ };
21379
+ var getFileHistoryEndpoint = () => {
21380
+ var _a, _b, _c, _d, _e;
21381
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21382
+ const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
21383
+ const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
21384
+ if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
21385
+ return endpoint3;
21386
+ };
21387
+ var getDocumentHistoryEndpoint = () => {
21388
+ var _a, _b, _c, _d, _e;
21389
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21390
+ const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
21391
+ const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
21392
+ if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
21393
+ return endpoint3;
21394
+ };
21395
+ var getApplicantFormPreviewEndpoint = () => {
21396
+ var _a, _b;
21397
+ const endpoint3 = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.applicantFormPreview;
21398
+ if (!endpoint3) throw new Error("Applicant form preview endpoint is not configured.");
21399
+ return endpoint3;
21400
+ };
21401
+ var getConfigValue = (source, key) => {
21402
+ if (!source || typeof source !== "object") return void 0;
21403
+ const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
21404
+ return matchingKey ? source[matchingKey] : void 0;
21405
+ };
21406
+ var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
21407
+ if (!source || typeof source !== "object" || visited.has(source)) return null;
21408
+ visited.add(source);
21409
+ const entries = Object.entries(source);
21410
+ const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
21411
+ if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
21412
+ for (const [candidate, value] of entries) {
21413
+ const result = findConfigEntry(value, key, [...path, candidate], visited);
21414
+ if (result) return result;
21435
21415
  }
21436
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21437
- label,
21438
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900 fc:mt-1 fc:block", children: field.type === "date" ? field.displayValue || field.value : (_a = field.value) != null ? _a : "-" })
21439
- ] });
21416
+ return null;
21440
21417
  };
21441
- var TableSection = ({ section }) => {
21442
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:overflow-x-auto fc:rounded-xl fc:border fc:border-slate-200/80 fc-custom-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("table", { className: "fc:min-w-full", children: [
21443
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tr", { children: section.columns.map((col) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
21444
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tbody", { className: "fc:divide-y fc:divide-slate-100", children: section.rows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tr", { className: "hover:fc:bg-slate-50/50", children: section.columns.map((col, index) => {
21445
- const val = row.values[index];
21446
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("td", { className: "fc:px-3 fc:py-2 fc:text-xs fc:text-slate-700 fc:whitespace-nowrap", children: col.type === "boolean" ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: `fc:inline-flex fc:items-center fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[10px] fc:font-bold ${val ? "fc:bg-emerald-50 fc:text-emerald-600 fc:border fc:border-emerald-200" : "fc:bg-red-50 fc:text-red-500 fc:border fc:border-red-200"}`, children: val ? "Active" : "Inactive" }) : val !== null && val !== void 0 ? String(val) : "-" }, col.id);
21447
- }) }, row.id)) })
21448
- ] }) });
21418
+ var getStepDocumentsEndpoint = () => {
21419
+ var _a, _b, _c;
21420
+ const suppliedEndpoints = getApiEndpoints();
21421
+ const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
21422
+ const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
21423
+ const inbox = getConfigValue(flowCore, "inbox");
21424
+ const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
21425
+ const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
21426
+ const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
21427
+ if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
21428
+ const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
21429
+ const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
21430
+ throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
21431
+ }
21432
+ if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
21433
+ throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
21434
+ }
21435
+ return endpoint3.value;
21449
21436
  };
21450
- var AttachmentsSection = ({ section }) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:space-y-3", children: section.files.map((file) => /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:justify-between fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80", children: [
21451
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
21452
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:w-9 fc:h-9 fc:rounded-lg fc:bg-red-100 fc:flex fc:items-center fc:justify-center fc:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_react116.RiFileTextLine, { size: 18, className: "fc:text-red-500" }) }),
21453
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { children: [
21454
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-800", children: file.label }),
21455
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("span", { className: "fc:block fc:text-[11px] fc:text-slate-500", children: [
21456
- file.fileName,
21457
- " (",
21458
- formatSize(file.sizeBytes),
21459
- ")"
21460
- ] })
21461
- ] })
21462
- ] }),
21463
- /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("a", { href: file.downloadUrl, download: true, className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:text-xs fc:font-semibold fc:text-blue-600 hover:fc:text-blue-700 fc:shrink-0", children: [
21464
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_react116.RiDownload2Line, { size: 15 }),
21465
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { children: "Download" })
21466
- ] })
21467
- ] }, file.id)) });
21468
- function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21469
- const [activeTab, setActiveTab] = (0, import_react115.useState)(STATIC_FORM_JSON.sections[0].id);
21470
- const [expandedSections, setExpandedSections] = (0, import_react115.useState)(() => {
21471
- const map = {};
21472
- STATIC_FORM_JSON.sections.forEach((s) => {
21473
- map[s.id] = true;
21437
+ var getUploadDocumentEndpoint = () => {
21438
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21439
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21440
+ const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
21441
+ const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
21442
+ if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
21443
+ return endpoint3;
21444
+ };
21445
+ var getConfiguredDocuments = (response) => {
21446
+ var _a, _b, _c, _d, _e, _f, _g;
21447
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21448
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21449
+ return rows.map((document2) => {
21450
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
21451
+ return __spreadProps(__spreadValues({}, document2), {
21452
+ documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
21453
+ documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
21454
+ allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
21455
+ maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
21456
+ isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
21457
+ isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
21474
21458
  });
21475
- return map;
21459
+ }).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
21460
+ };
21461
+ var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
21462
+ var getFileHistoryMovements = (response) => {
21463
+ var _a, _b, _c, _d, _e, _f, _g;
21464
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21465
+ const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
21466
+ return Array.isArray(movements) ? movements : [];
21467
+ };
21468
+ var formatMovementDate = (value) => {
21469
+ if (!value) return "-";
21470
+ const date = new Date(value);
21471
+ return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
21472
+ day: "2-digit",
21473
+ month: "short",
21474
+ year: "numeric",
21475
+ hour: "2-digit",
21476
+ minute: "2-digit"
21476
21477
  });
21478
+ };
21479
+ var mapFileHistoryMovement = (movement, index) => {
21480
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
21481
+ const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
21482
+ const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
21483
+ const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
21484
+ const isResubmit = normalizedAction.includes("RESUBMIT");
21485
+ const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
21486
+ const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
21487
+ const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
21488
+ const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
21489
+ const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
21490
+ const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
21491
+ const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
21492
+ return {
21493
+ id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
21494
+ type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
21495
+ date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
21496
+ userName,
21497
+ userRole: applicantActor ? "Applicant" : "Official",
21498
+ status,
21499
+ stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
21500
+ stepName: stepName || null,
21501
+ remarks: comments,
21502
+ isAlert: isReturn,
21503
+ isCurrent: false,
21504
+ title: status,
21505
+ by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
21506
+ };
21507
+ };
21508
+ var DEFAULT_ACTIONS = [
21509
+ { label: "Approve kro", actionCode: "APPROVE" },
21510
+ { label: "Reject", actionCode: "REJECT" },
21511
+ { label: "Forward", actionCode: "FORWARD" },
21512
+ { label: "Free Forward", actionCode: "FREE_FORWARD" },
21513
+ { label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
21514
+ ];
21515
+
21516
+ // src/components/inbox/DynamicFormDisplay.jsx
21517
+ var import_jsx_runtime106 = require("react/jsx-runtime");
21518
+ var formatSize = (bytes) => {
21519
+ const size = Number(bytes);
21520
+ if (!Number.isFinite(size)) return "";
21521
+ if (size >= 1048576) return `${(size / 1048576).toFixed(1)} MB`;
21522
+ if (size >= 1024) return `${Math.round(size / 1024)} KB`;
21523
+ return `${size} B`;
21524
+ };
21525
+ var FieldCard = ({ field }) => {
21526
+ var _a;
21527
+ const label = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[11px] fc:font-bold fc:text-slate-500 fc:block", children: field.label });
21528
+ const span = field.colSpan === 2 ? "fc:col-span-2" : "";
21529
+ if (field.type === "boolean") {
21530
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21531
+ label,
21532
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:mt-1", children: [
21533
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("input", { type: "checkbox", checked: field.value === true, readOnly: true, className: "fc:h-4 fc:w-4 fc:accent-emerald-600" }),
21534
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900", children: field.displayValue || (field.value ? "Yes" : "No") })
21535
+ ] })
21536
+ ] });
21537
+ }
21538
+ if (field.type === "textarea") {
21539
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21540
+ label,
21541
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-semibold fc:text-slate-900 fc:mt-1 fc:block fc:whitespace-pre-wrap", children: field.value || "-" })
21542
+ ] });
21543
+ }
21544
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21545
+ label,
21546
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900 fc:mt-1 fc:block", children: field.type === "date" ? field.displayValue || field.value : (_a = field.value) != null ? _a : "-" })
21547
+ ] });
21548
+ };
21549
+ var TableSection = ({ section }) => {
21550
+ var _a, _b;
21551
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:overflow-x-auto fc:rounded-xl fc:border fc:border-slate-200/80 fc-custom-scrollbar", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("table", { className: "fc:min-w-full", children: [
21552
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tr", { children: ((_a = section.columns) != null ? _a : []).map((col) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
21553
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tbody", { className: "fc:divide-y fc:divide-slate-100", children: ((_b = section.rows) != null ? _b : []).map((row) => {
21554
+ var _a2;
21555
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("tr", { className: "hover:fc:bg-slate-50/50", children: ((_a2 = section.columns) != null ? _a2 : []).map((col, index) => {
21556
+ var _a3;
21557
+ const val = (_a3 = row.values) == null ? void 0 : _a3[index];
21558
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("td", { className: "fc:px-3 fc:py-2 fc:text-xs fc:text-slate-700 fc:whitespace-nowrap", children: col.type === "boolean" ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: `fc:inline-flex fc:items-center fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[10px] fc:font-bold ${val ? "fc:bg-emerald-50 fc:text-emerald-600 fc:border fc:border-emerald-200" : "fc:bg-red-50 fc:text-red-500 fc:border fc:border-red-200"}`, children: val ? "Active" : "Inactive" }) : col.key === "profilePath" && val ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("a", { href: String(val), target: "_blank", rel: "noreferrer", className: "fc:text-blue-600 hover:fc:underline", children: "View profile" }) : val !== null && val !== void 0 ? String(val) : "-" }, col.id);
21559
+ }) }, row.id);
21560
+ }) })
21561
+ ] }) });
21562
+ };
21563
+ var AttachmentsSection = ({ section }) => {
21564
+ var _a;
21565
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:space-y-3", children: ((_a = section.files) != null ? _a : []).map((file) => {
21566
+ const size = formatSize(file.sizeBytes);
21567
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:justify-between fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80", children: [
21568
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-3 fc:min-w-0", children: [
21569
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:w-9 fc:h-9 fc:rounded-lg fc:bg-red-100 fc:flex fc:items-center fc:justify-center fc:shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_react116.RiFileTextLine, { size: 18, className: "fc:text-red-500" }) }),
21570
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:min-w-0", children: [
21571
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-800", children: file.label }),
21572
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("span", { className: "fc:block fc:text-[11px] fc:text-slate-500 fc:break-all", children: [
21573
+ file.fileName,
21574
+ size ? ` (${size})` : ""
21575
+ ] })
21576
+ ] })
21577
+ ] }),
21578
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("a", { href: file.downloadUrl, download: true, className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:text-xs fc:font-semibold fc:text-blue-600 hover:fc:text-blue-700 fc:shrink-0 fc:ml-3", children: [
21579
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_react116.RiDownload2Line, { size: 15 }),
21580
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { children: "Download" })
21581
+ ] })
21582
+ ] }, file.id);
21583
+ }) });
21584
+ };
21585
+ function DynamicFormDisplay({ fileNo, maximized = false, onToggleMaximize }) {
21586
+ const [displayData, setDisplayData] = (0, import_react115.useState)(null);
21587
+ const [activeTab, setActiveTab] = (0, import_react115.useState)("");
21588
+ const [expandedSections, setExpandedSections] = (0, import_react115.useState)({});
21589
+ const [isLoading, setIsLoading] = (0, import_react115.useState)(false);
21590
+ const [loadError, setLoadError] = (0, import_react115.useState)("");
21591
+ (0, import_react115.useEffect)(() => {
21592
+ if (!fileNo) {
21593
+ setDisplayData(null);
21594
+ setActiveTab("");
21595
+ setIsLoading(false);
21596
+ setLoadError("File number is unavailable.");
21597
+ return void 0;
21598
+ }
21599
+ let isCurrent = true;
21600
+ const loadPreview = async () => {
21601
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21602
+ setIsLoading(true);
21603
+ setLoadError("");
21604
+ setDisplayData(null);
21605
+ setActiveTab("");
21606
+ try {
21607
+ const endpoint3 = getApplicantFormPreviewEndpoint();
21608
+ const url = typeof endpoint3 === "function" ? endpoint3() : String(endpoint3);
21609
+ const response = await getApiService().post(url, { fileNo });
21610
+ const preview = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21611
+ if (!Array.isArray(preview == null ? void 0 : preview.sections)) {
21612
+ throw new Error("The applicant form preview response is invalid.");
21613
+ }
21614
+ if (isCurrent) {
21615
+ setDisplayData(preview);
21616
+ setActiveTab((_g = (_f = preview.sections[0]) == null ? void 0 : _f.id) != null ? _g : "");
21617
+ setExpandedSections(Object.fromEntries(
21618
+ preview.sections.map((section) => {
21619
+ var _a2;
21620
+ return [section.id, ((_a2 = preview.layout) == null ? void 0 : _a2.defaultExpanded) !== false];
21621
+ })
21622
+ ));
21623
+ }
21624
+ } catch (error) {
21625
+ if (isCurrent) {
21626
+ setLoadError(((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load applicant form preview.");
21627
+ }
21628
+ } finally {
21629
+ if (isCurrent) setIsLoading(false);
21630
+ }
21631
+ };
21632
+ loadPreview();
21633
+ return () => {
21634
+ isCurrent = false;
21635
+ };
21636
+ }, [fileNo]);
21477
21637
  const toggleSection = (id) => setExpandedSections((prev) => __spreadProps(__spreadValues({}, prev), { [id]: !prev[id] }));
21478
- const displayData = STATIC_FORM_JSON;
21479
21638
  const isMax = !!maximized;
21639
+ if (isLoading) {
21640
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { role: "status", className: "fc:rounded-2xl fc:border fc:border-slate-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-slate-500", children: "Loading applicant form preview..." });
21641
+ }
21642
+ if (loadError) {
21643
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { role: "alert", className: "fc:rounded-2xl fc:border fc:border-rose-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-rose-600", children: loadError });
21644
+ }
21645
+ if (!displayData) return null;
21480
21646
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: `fc:bg-white fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:overflow-hidden ${isMax ? "fc:w-full" : ""}`, children: [
21481
21647
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:justify-between fc:px-5 fc:py-4 fc:border-b fc:border-slate-100", children: [
21482
21648
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
@@ -21505,7 +21671,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21505
21671
  )
21506
21672
  ] }),
21507
21673
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:flex fc:items-center fc:gap-1 fc:px-5 fc:border-b fc:border-slate-200 fc:overflow-x-auto fc:pb-1 fc-custom-scrollbar", children: displayData.sections.map((section) => {
21508
- var _a;
21674
+ var _a, _b, _c, _d, _e;
21509
21675
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
21510
21676
  "button",
21511
21677
  {
@@ -21514,24 +21680,25 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21514
21680
  className: `fc:inline-flex fc:items-center fc:gap-1.5 fc:px-3 fc:py-2.5 fc:text-xs fc:font-semibold fc:whitespace-nowrap fc:border-b-2 fc:transition-colors ${activeTab === section.id ? "fc:border-blue-600 fc:text-blue-600" : "fc:border-transparent fc:text-slate-500 hover:fc:text-slate-800"}`,
21515
21681
  children: [
21516
21682
  section.title,
21517
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? section.rows.length : section.type === "attachments" ? section.files.length : ((_a = section.fields) == null ? void 0 : _a.length) || 0 })
21683
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? (_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0 : section.type === "attachments" ? (_d = (_c = section.files) == null ? void 0 : _c.length) != null ? _d : 0 : ((_e = section.fields) == null ? void 0 : _e.length) || 0 })
21518
21684
  ]
21519
21685
  },
21520
21686
  section.id
21521
21687
  );
21522
21688
  }) }),
21523
21689
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:p-5", children: displayData.sections.map((section) => {
21524
- var _a, _b;
21690
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21525
21691
  if (section.id !== activeTab) return null;
21526
21692
  if (section.type === "table") {
21527
21693
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { className: "fc:space-y-3", children: [
21528
- /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: "fc:flex fc:items-center fc:justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { children: [
21694
+ /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { children: [
21529
21695
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21530
21696
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21531
- section.rows.length,
21697
+ (_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0,
21532
21698
  " records"
21533
21699
  ] })
21534
- ] }) }),
21700
+ ] }),
21701
+ ((_c = section.fields) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: section.fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(FieldCard, { field }, field.id)) }),
21535
21702
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(TableSection, { section })
21536
21703
  ] }, section.id);
21537
21704
  }
@@ -21540,7 +21707,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21540
21707
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { children: [
21541
21708
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21542
21709
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21543
- section.files.length,
21710
+ (_e = (_d = section.files) == null ? void 0 : _d.length) != null ? _e : 0,
21544
21711
  " files"
21545
21712
  ] })
21546
21713
  ] }),
@@ -21552,11 +21719,11 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21552
21719
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("div", { children: [
21553
21720
  /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21554
21721
  /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21555
- ((_a = section.fields) == null ? void 0 : _a.length) || 0,
21722
+ ((_f = section.fields) == null ? void 0 : _f.length) || 0,
21556
21723
  " fields"
21557
21724
  ] })
21558
21725
  ] }),
21559
- displayData.layout.collapsibleSections && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
21726
+ ((_g = displayData.layout) == null ? void 0 : _g.collapsibleSections) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
21560
21727
  "button",
21561
21728
  {
21562
21729
  type: "button",
@@ -21566,7 +21733,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21566
21733
  }
21567
21734
  )
21568
21735
  ] }),
21569
- (!displayData.layout.collapsibleSections || expandedSections[section.id]) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (_b = section.fields) == null ? void 0 : _b.map((field) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(FieldCard, { field }, field.id)) })
21736
+ (!((_h = displayData.layout) == null ? void 0 : _h.collapsibleSections) || expandedSections[section.id]) && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (_i = section.fields) == null ? void 0 : _i.map((field) => /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(FieldCard, { field }, field.id)) })
21570
21737
  ] }, section.id);
21571
21738
  }) })
21572
21739
  ] });
@@ -21575,6 +21742,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21575
21742
  // src/components/inbox/FileDetailsTab.jsx
21576
21743
  var import_jsx_runtime107 = require("react/jsx-runtime");
21577
21744
  function FileDetailsTab({
21745
+ fileNo,
21578
21746
  fileHistory,
21579
21747
  isLoadingFileHistory,
21580
21748
  fileHistoryError,
@@ -21601,6 +21769,7 @@ function FileDetailsTab({
21601
21769
  /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { style: { minWidth: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
21602
21770
  DynamicFormDisplay,
21603
21771
  {
21772
+ fileNo,
21604
21773
  maximized: isMaximized,
21605
21774
  onToggleMaximize: () => setIsMaximized(!isMaximized)
21606
21775
  }
@@ -21717,169 +21886,6 @@ function FileDetailsTab({
21717
21886
  // src/components/inbox/MovementDetailModal.jsx
21718
21887
  var import_react119 = __toESM(require("react"));
21719
21888
  var import_react120 = require("@remixicon/react");
21720
-
21721
- // src/components/inbox/reviewHelpers.js
21722
- init_ApiEndpointsProvider();
21723
- var getAvailableActions2 = (response) => {
21724
- var _a, _b, _c, _d, _e, _f, _g;
21725
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21726
- const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21727
- return rows.map((action) => {
21728
- var _a2, _b2, _c2, _d2, _e2, _f2;
21729
- return {
21730
- label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
21731
- actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
21732
- };
21733
- }).filter((action) => action.label && action.actionCode);
21734
- };
21735
- var getWorkflowStepsStatusEndpoint = () => {
21736
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
21737
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21738
- const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
21739
- if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
21740
- return endpoint3;
21741
- };
21742
- var getWorkflowSteps = (response) => {
21743
- var _a, _b, _c, _d, _e, _f, _g;
21744
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21745
- const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
21746
- return Array.isArray(steps) ? [...steps].sort((first, second) => {
21747
- var _a2, _b2, _c2, _d2;
21748
- return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
21749
- }) : [];
21750
- };
21751
- var getFileHistoryEndpoint = () => {
21752
- var _a, _b, _c, _d, _e;
21753
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21754
- const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
21755
- const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
21756
- if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
21757
- return endpoint3;
21758
- };
21759
- var getDocumentHistoryEndpoint = () => {
21760
- var _a, _b, _c, _d, _e;
21761
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21762
- const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
21763
- const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
21764
- if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
21765
- return endpoint3;
21766
- };
21767
- var getConfigValue = (source, key) => {
21768
- if (!source || typeof source !== "object") return void 0;
21769
- const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
21770
- return matchingKey ? source[matchingKey] : void 0;
21771
- };
21772
- var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
21773
- if (!source || typeof source !== "object" || visited.has(source)) return null;
21774
- visited.add(source);
21775
- const entries = Object.entries(source);
21776
- const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
21777
- if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
21778
- for (const [candidate, value] of entries) {
21779
- const result = findConfigEntry(value, key, [...path, candidate], visited);
21780
- if (result) return result;
21781
- }
21782
- return null;
21783
- };
21784
- var getStepDocumentsEndpoint = () => {
21785
- var _a, _b, _c;
21786
- const suppliedEndpoints = getApiEndpoints();
21787
- const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
21788
- const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
21789
- const inbox = getConfigValue(flowCore, "inbox");
21790
- const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
21791
- const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
21792
- const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
21793
- if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
21794
- const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
21795
- const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
21796
- throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
21797
- }
21798
- if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
21799
- throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
21800
- }
21801
- return endpoint3.value;
21802
- };
21803
- var getUploadDocumentEndpoint = () => {
21804
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21805
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21806
- const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
21807
- const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
21808
- if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
21809
- return endpoint3;
21810
- };
21811
- var getConfiguredDocuments = (response) => {
21812
- var _a, _b, _c, _d, _e, _f, _g;
21813
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21814
- const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21815
- return rows.map((document2) => {
21816
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
21817
- return __spreadProps(__spreadValues({}, document2), {
21818
- documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
21819
- documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
21820
- allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
21821
- maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
21822
- isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
21823
- isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
21824
- });
21825
- }).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
21826
- };
21827
- var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
21828
- var getFileHistoryMovements = (response) => {
21829
- var _a, _b, _c, _d, _e, _f, _g;
21830
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21831
- const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
21832
- return Array.isArray(movements) ? movements : [];
21833
- };
21834
- var formatMovementDate = (value) => {
21835
- if (!value) return "-";
21836
- const date = new Date(value);
21837
- return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
21838
- day: "2-digit",
21839
- month: "short",
21840
- year: "numeric",
21841
- hour: "2-digit",
21842
- minute: "2-digit"
21843
- });
21844
- };
21845
- var mapFileHistoryMovement = (movement, index) => {
21846
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
21847
- const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
21848
- const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
21849
- const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
21850
- const isResubmit = normalizedAction.includes("RESUBMIT");
21851
- const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
21852
- const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
21853
- const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
21854
- const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
21855
- const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
21856
- const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
21857
- const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
21858
- return {
21859
- id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
21860
- type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
21861
- date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
21862
- userName,
21863
- userRole: applicantActor ? "Applicant" : "Official",
21864
- status,
21865
- stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
21866
- stepName: stepName || null,
21867
- remarks: comments,
21868
- isAlert: isReturn,
21869
- isCurrent: false,
21870
- title: status,
21871
- by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
21872
- };
21873
- };
21874
- var DEFAULT_ACTIONS = [
21875
- { label: "Approve kro", actionCode: "APPROVE" },
21876
- { label: "Reject", actionCode: "REJECT" },
21877
- { label: "Forward", actionCode: "FORWARD" },
21878
- { label: "Free Forward", actionCode: "FREE_FORWARD" },
21879
- { label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
21880
- ];
21881
-
21882
- // src/components/inbox/MovementDetailModal.jsx
21883
21889
  var import_jsx_runtime108 = require("react/jsx-runtime");
21884
21890
  function MovementDetailModal({
21885
21891
  selectedHistoryItem,
@@ -22822,6 +22828,7 @@ function ReviewApplication({
22822
22828
  activeTab === "fileDetails" && /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
22823
22829
  FileDetailsTab,
22824
22830
  {
22831
+ fileNo,
22825
22832
  fileHistory,
22826
22833
  isLoadingFileHistory,
22827
22834
  fileHistoryError,
@@ -25467,7 +25474,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
25467
25474
  ];
25468
25475
  const masterPermissionItems = [
25469
25476
  { name: "Step Permission", component: "step_permission_main", icon: import_react138.RiUserSettingsLine, configKey: "isStepPermission" },
25470
- { name: "Update Permission", component: "FormFieldMain", icon: import_react138.RiFileList3Line, configKey: "isFormField" },
25477
+ { name: "Applicant Editable Fields", component: "FormFieldMain", icon: import_react138.RiFileList3Line, configKey: "isFormField" },
25471
25478
  { name: "Assignment Rule", component: "AssignmentRuleMain", icon: import_react138.RiFileShieldLine, configKey: "isAssignmentRule" }
25472
25479
  ];
25473
25480
  const masterHierarchyItems = [