flowcore-fn 9.5.3 → 10.1.2

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
@@ -3901,12 +3901,13 @@ function WorkFlowTransition() {
3901
3901
 
3902
3902
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
3903
3903
  var import_react27 = __toESM(require("react"));
3904
- var import_sweetalert29 = __toESM(require("sweetalert2"));
3904
+ var import_sweetalert210 = __toESM(require("sweetalert2"));
3905
3905
  init_ApiEndpointsProvider();
3906
3906
  init_ApiServicepackage();
3907
3907
 
3908
3908
  // src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
3909
3909
  var import_react22 = __toESM(require("react"));
3910
+ var import_sweetalert29 = __toESM(require("sweetalert2"));
3910
3911
  init_ApiEndpointsProvider();
3911
3912
  init_ApiServicepackage();
3912
3913
  var import_jsx_runtime22 = require("react/jsx-runtime");
@@ -3915,37 +3916,74 @@ function AddUserHierarchyNodeMappingModal({
3915
3916
  onClose,
3916
3917
  onSave
3917
3918
  }) {
3918
- const [formData, setFormData] = (0, import_react22.useState)({ mappingId: "", externalUserId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
3919
+ const [formData, setFormData] = (0, import_react22.useState)({ mappingId: "", externalUserId: "", workflowStepId: "", hierarchyNodeId: "", roleCode: "", isPrimary: "", effectiveFrom: "", effectiveTo: "" });
3919
3920
  const [isSubmitting, setIsSubmitting] = (0, import_react22.useState)(false);
3920
3921
  const [hierarchyNodes, setHierarchyNodes] = (0, import_react22.useState)([]);
3922
+ const [workflowSteps, setWorkflowSteps] = (0, import_react22.useState)([]);
3921
3923
  const [isLoadingHierarchyNodes, setIsLoadingHierarchyNodes] = (0, import_react22.useState)(false);
3924
+ const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = (0, import_react22.useState)(false);
3922
3925
  const [hierarchyNodesError, setHierarchyNodesError] = (0, import_react22.useState)("");
3926
+ const [workflowStepsError, setWorkflowStepsError] = (0, import_react22.useState)("");
3923
3927
  (0, import_react22.useEffect)(() => {
3924
3928
  if (!isOpen) return;
3925
- const loadHierarchyNodes = async () => {
3926
- var _a, _b, _c, _d, _e, _f, _g;
3929
+ const loadData = async () => {
3930
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
3931
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
3932
+ const hierarchyEndpoint = (_b = flowCore == null ? void 0 : flowCore.hierarchyNode) == null ? void 0 : _b.getList;
3933
+ const workflowStepEndpoint = ((_c = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _d.getList) || ((_e = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _e.getList);
3927
3934
  setIsLoadingHierarchyNodes(true);
3935
+ setIsLoadingWorkflowSteps(true);
3928
3936
  setHierarchyNodesError("");
3937
+ setWorkflowStepsError("");
3929
3938
  try {
3930
- const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c.getList;
3931
- if (!endpoint) throw new Error("Hierarchy node list endpoint is not configured.");
3932
- const result = await getApiService().get(endpoint);
3933
- const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
3934
- setHierarchyNodes(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
3939
+ const [hierarchyResult, workflowStepResult] = await Promise.all([
3940
+ hierarchyEndpoint ? getApiService().get(hierarchyEndpoint) : Promise.resolve(null),
3941
+ workflowStepEndpoint ? getApiService().get(workflowStepEndpoint) : Promise.resolve(null)
3942
+ ]);
3943
+ const hierarchyValue = ((_f = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _f.data) || ((_g = hierarchyResult == null ? void 0 : hierarchyResult.data) == null ? void 0 : _g.result) || (hierarchyResult == null ? void 0 : hierarchyResult.data) || hierarchyResult;
3944
+ const workflowStepValue = ((_h = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _h.data) || ((_i = workflowStepResult == null ? void 0 : workflowStepResult.data) == null ? void 0 : _i.result) || (workflowStepResult == null ? void 0 : workflowStepResult.data) || workflowStepResult;
3945
+ setHierarchyNodes(Array.isArray(hierarchyValue) ? hierarchyValue : (hierarchyValue == null ? void 0 : hierarchyValue.items) || (hierarchyValue == null ? void 0 : hierarchyValue.records) || []);
3946
+ setWorkflowSteps(Array.isArray(workflowStepValue) ? workflowStepValue : (workflowStepValue == null ? void 0 : workflowStepValue.items) || (workflowStepValue == null ? void 0 : workflowStepValue.records) || []);
3935
3947
  } catch (error) {
3936
3948
  setHierarchyNodes([]);
3937
- setHierarchyNodesError(((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.");
3949
+ setWorkflowSteps([]);
3950
+ setHierarchyNodesError(((_k = (_j = error == null ? void 0 : error.response) == null ? void 0 : _j.data) == null ? void 0 : _k.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.");
3951
+ setWorkflowStepsError(((_m = (_l = error == null ? void 0 : error.response) == null ? void 0 : _l.data) == null ? void 0 : _m.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
3938
3952
  } finally {
3939
3953
  setIsLoadingHierarchyNodes(false);
3954
+ setIsLoadingWorkflowSteps(false);
3940
3955
  }
3941
3956
  };
3942
- loadHierarchyNodes();
3957
+ loadData();
3943
3958
  }, [isOpen]);
3959
+ const toApiDateTime = (value) => {
3960
+ if (!value) return null;
3961
+ if (typeof value === "string" && value.includes("T")) {
3962
+ const parsed = new Date(value);
3963
+ return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
3964
+ }
3965
+ const [year, month, day] = value.split("-").map(Number);
3966
+ if (!year || !month || !day) return null;
3967
+ return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0)).toISOString();
3968
+ };
3944
3969
  const handleChange = (event) => setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [event.target.name]: event.target.value }));
3945
3970
  const handleSave = async () => {
3946
3971
  if (!onSave) return;
3972
+ if (!formData.workflowStepId) {
3973
+ await import_sweetalert29.default.fire("Required field", "Please select a workflow step.", "warning");
3974
+ return;
3975
+ }
3947
3976
  setIsSubmitting(true);
3948
- const success = await onSave({ externalUserId: Number(formData.externalUserId), hierarchyNodeId: Number(formData.hierarchyNodeId), roleCode: formData.roleCode, isPrimary: formData.isPrimary === "true", effectiveFrom: formData.effectiveFrom, effectiveTo: formData.effectiveTo || null, createdBy: "System" });
3977
+ const success = await onSave({
3978
+ externalUserId: Number(formData.externalUserId),
3979
+ workflowStepId: Number(formData.workflowStepId),
3980
+ hierarchyNodeId: Number(formData.hierarchyNodeId),
3981
+ roleCode: formData.roleCode,
3982
+ isPrimary: formData.isPrimary === "true",
3983
+ effectiveFrom: toApiDateTime(formData.effectiveFrom),
3984
+ effectiveTo: toApiDateTime(formData.effectiveTo),
3985
+ createdBy: "System"
3986
+ });
3949
3987
  setIsSubmitting(false);
3950
3988
  if (success) onClose();
3951
3989
  };
@@ -3987,6 +4025,25 @@ function AddUserHierarchyNodeMappingModal({
3987
4025
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "fc:text-[10px] fc:text-slate-400 fc:mt-1", children: "Enter the consumer user ID" })
3988
4026
  ] })
3989
4027
  ] }),
4028
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
4029
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
4030
+ "Workflow Step ",
4031
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "fc:text-red-500", children: "*" })
4032
+ ] }),
4033
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("select", { name: "workflowStepId", value: formData.workflowStepId, onChange: handleChange, disabled: isLoadingWorkflowSteps, className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 disabled:fc:fc:bg-slate-100 disabled:fc:fc:cursor-not-allowed focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
4034
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
4035
+ workflowSteps.map((step) => {
4036
+ var _a, _b, _c, _d, _e, _f;
4037
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
4038
+ const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
4039
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("option", { value: id, children: [
4040
+ id,
4041
+ name ? ` - ${name}` : ""
4042
+ ] }, id);
4043
+ })
4044
+ ] }),
4045
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: `fc:text-[10px] fc:mt-1 ${workflowStepsError ? "fc:text-red-500" : "fc:text-slate-400"}`, children: workflowStepsError || "Select the workflow step for this mapping" })
4046
+ ] }),
3990
4047
  /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
3991
4048
  /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
3992
4049
  "Hierarchy Node ID ",
@@ -4083,6 +4140,8 @@ var import_react26 = __toESM(require("react"));
4083
4140
 
4084
4141
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
4085
4142
  var import_react24 = __toESM(require("react"));
4143
+ init_ApiEndpointsProvider();
4144
+ init_ApiServicepackage();
4086
4145
  var import_jsx_runtime24 = require("react/jsx-runtime");
4087
4146
  function EditUserHierarchyNodeMappingModal({
4088
4147
  isOpen,
@@ -4091,15 +4150,47 @@ function EditUserHierarchyNodeMappingModal({
4091
4150
  onSave
4092
4151
  }) {
4093
4152
  const [formData, setFormData] = (0, import_react24.useState)({
4153
+ workflowStepId: "",
4094
4154
  hierarchyNodeId: "",
4095
4155
  roleCode: "",
4096
4156
  isPrimary: "",
4097
4157
  effectiveFrom: "",
4098
4158
  effectiveTo: ""
4099
4159
  });
4160
+ const [workflowSteps, setWorkflowSteps] = (0, import_react24.useState)([]);
4161
+ const [isLoadingWorkflowSteps, setIsLoadingWorkflowSteps] = (0, import_react24.useState)(false);
4162
+ const [workflowStepsError, setWorkflowStepsError] = (0, import_react24.useState)("");
4100
4163
  (0, import_react24.useEffect)(() => {
4164
+ if (!isOpen) return;
4165
+ const loadWorkflowSteps = async () => {
4166
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4167
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
4168
+ const workflowStepEndpoint = ((_b = flowCore == null ? void 0 : flowCore.workflowStep) == null ? void 0 : _b.getList) || ((_c = flowCore == null ? void 0 : flowCore.WorkFlowStep) == null ? void 0 : _c.getList) || ((_d = flowCore == null ? void 0 : flowCore.workFlowStep) == null ? void 0 : _d.getList);
4169
+ if (!workflowStepEndpoint) {
4170
+ setWorkflowSteps([]);
4171
+ setWorkflowStepsError("Workflow step list endpoint is not configured.");
4172
+ return;
4173
+ }
4174
+ setIsLoadingWorkflowSteps(true);
4175
+ setWorkflowStepsError("");
4176
+ try {
4177
+ const result = await getApiService().get(workflowStepEndpoint);
4178
+ const value = ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.data) || ((_f = result == null ? void 0 : result.data) == null ? void 0 : _f.result) || (result == null ? void 0 : result.data) || result;
4179
+ setWorkflowSteps(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
4180
+ } catch (error) {
4181
+ setWorkflowSteps([]);
4182
+ setWorkflowStepsError(((_h = (_g = error == null ? void 0 : error.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || (error == null ? void 0 : error.message) || "Unable to load workflow steps.");
4183
+ } finally {
4184
+ setIsLoadingWorkflowSteps(false);
4185
+ }
4186
+ };
4187
+ loadWorkflowSteps();
4188
+ }, [isOpen]);
4189
+ (0, import_react24.useEffect)(() => {
4190
+ var _a, _b;
4101
4191
  if (selectedMapping) {
4102
4192
  setFormData({
4193
+ workflowStepId: (_b = (_a = selectedMapping.workflowStepId) != null ? _a : selectedMapping.WorkflowStepId) != null ? _b : "",
4103
4194
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
4104
4195
  roleCode: selectedMapping.roleCode || "",
4105
4196
  isPrimary: selectedMapping.isPrimary === true || selectedMapping.isPrimary === 1 || selectedMapping.isPrimary === "1" || selectedMapping.isPrimary === "Yes" ? "true" : "false",
@@ -4115,18 +4206,33 @@ function EditUserHierarchyNodeMappingModal({
4115
4206
  [name]: value
4116
4207
  }));
4117
4208
  };
4209
+ const toApiDateTime = (value) => {
4210
+ if (!value) return null;
4211
+ if (typeof value === "string" && value.includes("T")) {
4212
+ const parsed = new Date(value);
4213
+ return Number.isNaN(parsed.getTime()) ? null : parsed.toISOString();
4214
+ }
4215
+ const [year, month, day] = value.split("-").map(Number);
4216
+ if (!year || !month || !day) return null;
4217
+ return new Date(Date.UTC(year, month - 1, day, 0, 0, 0, 0)).toISOString();
4218
+ };
4118
4219
  const handleSubmit = async (event) => {
4119
4220
  var _a, _b, _c;
4120
4221
  event.preventDefault();
4222
+ if (!formData.workflowStepId) {
4223
+ alert("Please select a workflow step.");
4224
+ return;
4225
+ }
4121
4226
  if (onSave) {
4122
4227
  const success = await onSave({
4123
4228
  mappingId: Number((_a = selectedMapping.mappingId) != null ? _a : selectedMapping.id),
4124
4229
  externalUserId: Number(selectedMapping.externalUserId),
4230
+ workflowStepId: Number(formData.workflowStepId),
4125
4231
  hierarchyNodeId: Number(formData.hierarchyNodeId),
4126
4232
  roleCode: formData.roleCode,
4127
4233
  isPrimary: formData.isPrimary === "true",
4128
- effectiveFrom: formData.effectiveFrom,
4129
- effectiveTo: formData.effectiveTo || null,
4234
+ effectiveFrom: toApiDateTime(formData.effectiveFrom),
4235
+ effectiveTo: toApiDateTime(formData.effectiveTo),
4130
4236
  isActive: (_c = (_b = selectedMapping.isActive) != null ? _b : selectedMapping.status) != null ? _c : true,
4131
4237
  updatedBy: selectedMapping.updatedBy || selectedMapping.createdBy || "System"
4132
4238
  });
@@ -4188,6 +4294,32 @@ function EditUserHierarchyNodeMappingModal({
4188
4294
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Edit Mapping" })
4189
4295
  ] }),
4190
4296
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "fc:grid fc:grid-cols-1 fc:gap-5 fc:md:grid-cols-2", children: [
4297
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
4298
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Workflow Step" }),
4299
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4300
+ "select",
4301
+ {
4302
+ name: "workflowStepId",
4303
+ value: formData.workflowStepId,
4304
+ onChange: handleChange,
4305
+ disabled: isLoadingWorkflowSteps,
4306
+ className: "fc:w-full fc:rounded-xl fc:border fc:border-slate-200 fc:bg-white fc:p-2.5 fc:text-xs fc:text-slate-700 fc:focus:border-indigo-500 fc:focus:outline-none fc:focus:ring-2 fc:focus:ring-indigo-500/10 disabled:fc:bg-slate-100 disabled:fc:cursor-not-allowed",
4307
+ children: [
4308
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: isLoadingWorkflowSteps ? "Loading workflow steps..." : "Select workflow step" }),
4309
+ workflowSteps.map((step) => {
4310
+ var _a, _b, _c, _d, _e, _f;
4311
+ const id = (_b = (_a = step.workflowStepId) != null ? _a : step.WorkflowStepId) != null ? _b : step.id;
4312
+ const name = (_f = (_e = (_d = (_c = step.stepName) != null ? _c : step.StepName) != null ? _d : step.name) != null ? _e : step.workflowStepName) != null ? _f : step.WorkflowStepName;
4313
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: id, children: [
4314
+ id,
4315
+ name ? ` - ${name}` : ""
4316
+ ] }, id);
4317
+ })
4318
+ ]
4319
+ }
4320
+ ),
4321
+ workflowStepsError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "fc:mt-1 fc:text-[10px] fc:text-red-500", children: workflowStepsError }) : null
4322
+ ] }),
4191
4323
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
4192
4324
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("label", { className: "mb-1.5 block text-xs font-bold text-slate-700", children: "Hierarchy Node ID" }),
4193
4325
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
@@ -4505,7 +4637,7 @@ function User_hierarchy_mapping_main() {
4505
4637
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
4506
4638
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
4507
4639
  } catch (error) {
4508
- await import_sweetalert29.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load Workflow Step Hierarchy Mappings.", "error");
4640
+ await import_sweetalert210.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load Workflow Step Hierarchy Mappings.", "error");
4509
4641
  }
4510
4642
  })();
4511
4643
  }, [refreshkey]);
@@ -4528,11 +4660,11 @@ function User_hierarchy_mapping_main() {
4528
4660
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.WorkflowStepUserMapping) == null ? void 0 : _c[isEdit ? "update" : "create"];
4529
4661
  if (!endpoint) throw new Error(`Workflow Step Hierarchy Mapping ${isEdit ? "update" : "create"} endpoint is not configured.`);
4530
4662
  await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
4531
- await import_sweetalert29.default.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
4663
+ await import_sweetalert210.default.fire("Success", `Workflow Step Hierarchy Mapping ${isEdit ? "updated" : "created"} successfully.`, "success");
4532
4664
  handleRefresh();
4533
4665
  return true;
4534
4666
  } catch (error) {
4535
- await import_sweetalert29.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} Workflow Step Hierarchy Mapping.`, "error");
4667
+ await import_sweetalert210.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} Workflow Step Hierarchy Mapping.`, "error");
4536
4668
  return false;
4537
4669
  }
4538
4670
  };
@@ -4574,7 +4706,7 @@ function User_hierarchy_mapping_main() {
4574
4706
 
4575
4707
  // src/components/user-hierarchy-node-mapping/Workflow_Step_Hierarchy_Mapping.jsx
4576
4708
  var import_react28 = __toESM(require("react"));
4577
- var import_sweetalert210 = __toESM(require("sweetalert2"));
4709
+ var import_sweetalert211 = __toESM(require("sweetalert2"));
4578
4710
  init_ApiEndpointsProvider();
4579
4711
  init_ApiServicepackage();
4580
4712
  var import_jsx_runtime28 = require("react/jsx-runtime");
@@ -4648,7 +4780,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4648
4780
  hierarchyNodeResult ? getRows(hierarchyNodeResult) : []
4649
4781
  );
4650
4782
  } catch (error) {
4651
- await import_sweetalert210.default.fire(
4783
+ await import_sweetalert211.default.fire(
4652
4784
  "Error",
4653
4785
  ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to load workflow step hierarchy mappings.",
4654
4786
  "error"
@@ -4679,7 +4811,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4679
4811
  var _a, _b, _c, _d;
4680
4812
  event.preventDefault();
4681
4813
  if (!formData.workflowStepId || !formData.hierarchyNodeId)
4682
- return import_sweetalert210.default.fire(
4814
+ return import_sweetalert211.default.fire(
4683
4815
  "Required fields",
4684
4816
  "Please select a workflow step and hierarchy node.",
4685
4817
  "warning"
@@ -4700,7 +4832,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4700
4832
  updatedBy: "System"
4701
4833
  } : { createdBy: "System" });
4702
4834
  await getApiService()[editingMapping ? "put" : "post"](endpoint, payload);
4703
- await import_sweetalert210.default.fire(
4835
+ await import_sweetalert211.default.fire(
4704
4836
  "Success",
4705
4837
  `Workflow step hierarchy mapping ${editingMapping ? "updated" : "created"} successfully.`,
4706
4838
  "success"
@@ -4708,7 +4840,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4708
4840
  setIsModalOpen(false);
4709
4841
  setRefreshKey((previous) => previous + 1);
4710
4842
  } catch (error) {
4711
- await import_sweetalert210.default.fire(
4843
+ await import_sweetalert211.default.fire(
4712
4844
  "Error",
4713
4845
  ((_d = (_c = error == null ? void 0 : error.response) == null ? void 0 : _c.data) == null ? void 0 : _d.message) || (error == null ? void 0 : error.message) || "Unable to save workflow step hierarchy mapping.",
4714
4846
  "error"
@@ -4719,7 +4851,7 @@ function Workflow_Step_Hierarchy_Mapping() {
4719
4851
  };
4720
4852
  const handleDelete = async (mapping) => {
4721
4853
  var _a, _b, _c, _d, _e, _f;
4722
- const confirmation = await import_sweetalert210.default.fire({
4854
+ const confirmation = await import_sweetalert211.default.fire({
4723
4855
  title: "Delete mapping?",
4724
4856
  text: "This mapping will be marked inactive.",
4725
4857
  icon: "warning",
@@ -4745,14 +4877,14 @@ function Workflow_Step_Hierarchy_Mapping() {
4745
4877
  isActive: false,
4746
4878
  updatedBy: "System"
4747
4879
  });
4748
- await import_sweetalert210.default.fire(
4880
+ await import_sweetalert211.default.fire(
4749
4881
  "Deleted",
4750
4882
  "Workflow step hierarchy mapping has been deactivated.",
4751
4883
  "success"
4752
4884
  );
4753
4885
  setRefreshKey((previous) => previous + 1);
4754
4886
  } catch (error) {
4755
- await import_sweetalert210.default.fire(
4887
+ await import_sweetalert211.default.fire(
4756
4888
  "Error",
4757
4889
  ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to delete workflow step hierarchy mapping.",
4758
4890
  "error"
@@ -5055,7 +5187,7 @@ function Workflow_Step_Hierarchy_Mapping() {
5055
5187
 
5056
5188
  // src/components/document-configuration/DocumentConfigurationmain.jsx
5057
5189
  var import_react34 = __toESM(require("react"));
5058
- var import_sweetalert212 = __toESM(require("sweetalert2"));
5190
+ var import_sweetalert213 = __toESM(require("sweetalert2"));
5059
5191
  init_ApiEndpointsProvider();
5060
5192
  init_ApiServicepackage();
5061
5193
 
@@ -5078,7 +5210,7 @@ function SearchBar3({
5078
5210
 
5079
5211
  // src/components/document-configuration/DocumentConfigurationTable.jsx
5080
5212
  var import_react32 = __toESM(require("react"));
5081
- var import_sweetalert211 = __toESM(require("sweetalert2"));
5213
+ var import_sweetalert212 = __toESM(require("sweetalert2"));
5082
5214
 
5083
5215
  // src/components/document-configuration/Edit.jsx
5084
5216
  var import_react30 = __toESM(require("react"));
@@ -5580,7 +5712,7 @@ function DocumentConfigTable({
5580
5712
  setData(unwrapRows(result).map(toUiItem));
5581
5713
  } catch (error) {
5582
5714
  setData([]);
5583
- await import_sweetalert211.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to load document configurations.", "error");
5715
+ await import_sweetalert212.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to load document configurations.", "error");
5584
5716
  } finally {
5585
5717
  setIsLoading(false);
5586
5718
  }
@@ -5630,7 +5762,7 @@ function DocumentConfigTable({
5630
5762
  setSelectedItem(toUiItem(value != null ? value : item));
5631
5763
  setIsEditOpen(true);
5632
5764
  } catch (error) {
5633
- await import_sweetalert211.default.fire("Error", ((_j = (_i = error == null ? void 0 : error.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (error == null ? void 0 : error.message) || "Unable to load document configuration.", "error");
5765
+ await import_sweetalert212.default.fire("Error", ((_j = (_i = error == null ? void 0 : error.response) == null ? void 0 : _i.data) == null ? void 0 : _j.message) || (error == null ? void 0 : error.message) || "Unable to load document configuration.", "error");
5634
5766
  }
5635
5767
  };
5636
5768
  const handleDelete = (item) => {
@@ -5655,12 +5787,12 @@ function DocumentConfigTable({
5655
5787
  isActive: updatedData.status === "Active",
5656
5788
  updatedBy: "System"
5657
5789
  });
5658
- await import_sweetalert211.default.fire("Success", "Document configuration updated successfully.", "success");
5790
+ await import_sweetalert212.default.fire("Success", "Document configuration updated successfully.", "success");
5659
5791
  setIsEditOpen(false);
5660
5792
  await loadData();
5661
5793
  return true;
5662
5794
  } catch (error) {
5663
- await import_sweetalert211.default.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5795
+ await import_sweetalert212.default.fire("Error", ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to update document configuration.", "error");
5664
5796
  return false;
5665
5797
  }
5666
5798
  };
@@ -6058,12 +6190,12 @@ function DocumentConfigurationmain() {
6058
6190
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.documentConfiguration) == null ? void 0 : _c.create;
6059
6191
  if (!endpoint) throw new Error("Document Configuration create endpoint is not configured.");
6060
6192
  await getApiService().post(endpoint, payload);
6061
- await import_sweetalert212.default.fire("Success", "Document configuration created successfully.", "success");
6193
+ await import_sweetalert213.default.fire("Success", "Document configuration created successfully.", "success");
6062
6194
  setModalOpen(false);
6063
6195
  handleRefresh();
6064
6196
  return true;
6065
6197
  } catch (error) {
6066
- await import_sweetalert212.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create document configuration.", "error");
6198
+ await import_sweetalert213.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create document configuration.", "error");
6067
6199
  return false;
6068
6200
  }
6069
6201
  };
@@ -7122,7 +7254,7 @@ function MovementHistorymain() {
7122
7254
 
7123
7255
  // src/components/task-permission/TaskPermissionMain.jsx
7124
7256
  var import_react47 = __toESM(require("react"));
7125
- var import_sweetalert214 = __toESM(require("sweetalert2"));
7257
+ var import_sweetalert215 = __toESM(require("sweetalert2"));
7126
7258
 
7127
7259
  // src/components/task-permission/SearchBar.js
7128
7260
  var import_react43 = __toESM(require("react"));
@@ -7393,7 +7525,7 @@ function Table({
7393
7525
 
7394
7526
  // src/components/task-permission/Popup.js
7395
7527
  var import_react45 = __toESM(require("react"));
7396
- var import_sweetalert213 = __toESM(require("sweetalert2"));
7528
+ var import_sweetalert214 = __toESM(require("sweetalert2"));
7397
7529
  init_ApiEndpointsProvider();
7398
7530
  init_ApiServicepackage();
7399
7531
  var import_jsx_runtime45 = require("react/jsx-runtime");
@@ -7465,7 +7597,7 @@ function Popup({ isOpen, onClose, onSave }) {
7465
7597
  await (onSave == null ? void 0 : onSave());
7466
7598
  } catch (error) {
7467
7599
  const msg = ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create task permission.";
7468
- await import_sweetalert213.default.fire("Error", msg, "error");
7600
+ await import_sweetalert214.default.fire("Error", msg, "error");
7469
7601
  } finally {
7470
7602
  setIsSubmitting(false);
7471
7603
  }
@@ -7868,13 +8000,13 @@ function TaskPermissionMain() {
7868
8000
  handleRefresh();
7869
8001
  return true;
7870
8002
  } catch (error) {
7871
- await import_sweetalert214.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
8003
+ await import_sweetalert215.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to update task permission.", "error");
7872
8004
  return false;
7873
8005
  }
7874
8006
  };
7875
8007
  const handleDeleteApi = async (item) => {
7876
8008
  var _a;
7877
- const confirm = await import_sweetalert214.default.fire({
8009
+ const confirm = await import_sweetalert215.default.fire({
7878
8010
  title: "Delete Task Permission?",
7879
8011
  text: `Permission #${(_a = item.taskPermissionId) != null ? _a : item.TaskPermissionId} will be marked as inactive.`,
7880
8012
  icon: "warning",
@@ -7884,7 +8016,7 @@ function TaskPermissionMain() {
7884
8016
  });
7885
8017
  if (!confirm.isConfirmed) return;
7886
8018
  const ok = await handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
7887
- if (ok) await import_sweetalert214.default.fire("Deleted", "Task permission has been deactivated.", "success");
8019
+ if (ok) await import_sweetalert215.default.fire("Deleted", "Task permission has been deactivated.", "success");
7888
8020
  };
7889
8021
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fc:h-screen fc:overflow-hidden fc:bg-slate-50 fc:p-4 md:fc:fc:p-6", children: [
7890
8022
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "fc:w-full fc:space-y-5", children: [
@@ -7937,7 +8069,7 @@ function TaskPermissionMain() {
7937
8069
  isOpen: showModal,
7938
8070
  onClose: () => setShowModal(false),
7939
8071
  onSave: async () => {
7940
- await import_sweetalert214.default.fire("Success", "Task permission created successfully.", "success");
8072
+ await import_sweetalert215.default.fire("Success", "Task permission created successfully.", "success");
7941
8073
  handleRefresh();
7942
8074
  }
7943
8075
  }
@@ -7949,7 +8081,7 @@ function TaskPermissionMain() {
7949
8081
  onClose: () => setIsEditOpen(false),
7950
8082
  selectedData: selectedItem,
7951
8083
  onSave: async () => {
7952
- await import_sweetalert214.default.fire("Success", "Task permission updated successfully.", "success");
8084
+ await import_sweetalert215.default.fire("Success", "Task permission updated successfully.", "success");
7953
8085
  handleRefresh();
7954
8086
  },
7955
8087
  onUpdate: handleUpdateApi
@@ -10519,7 +10651,7 @@ function Comment_main() {
10519
10651
 
10520
10652
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
10521
10653
  var import_react71 = __toESM(require("react"));
10522
- var import_sweetalert215 = __toESM(require("sweetalert2"));
10654
+ var import_sweetalert216 = __toESM(require("sweetalert2"));
10523
10655
  init_ApiEndpointsProvider();
10524
10656
  init_ApiServicepackage();
10525
10657
 
@@ -11125,7 +11257,7 @@ function HierarchyNodeMain() {
11125
11257
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
11126
11258
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
11127
11259
  } catch (error) {
11128
- await import_sweetalert215.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
11260
+ await import_sweetalert216.default.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
11129
11261
  }
11130
11262
  })();
11131
11263
  }, [refreshKey]);
@@ -11138,11 +11270,11 @@ function HierarchyNodeMain() {
11138
11270
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.hierarchyNode) == null ? void 0 : _c[isEdit ? "update" : "create"];
11139
11271
  if (!endpoint) throw new Error(`Hierarchy node ${isEdit ? "update" : "create"} endpoint is not configured.`);
11140
11272
  await getApiService()[isEdit ? "put" : "post"](endpoint, payload);
11141
- await import_sweetalert215.default.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
11273
+ await import_sweetalert216.default.fire("Success", `Hierarchy node ${isEdit ? "updated" : "created"} successfully.`, "success");
11142
11274
  handleRefresh();
11143
11275
  return true;
11144
11276
  } catch (error) {
11145
- await import_sweetalert215.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
11277
+ await import_sweetalert216.default.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || `Unable to ${isEdit ? "update" : "create"} hierarchy node.`, "error");
11146
11278
  return false;
11147
11279
  }
11148
11280
  };