@universe-platform/ui 0.1.0-beta.57 → 0.1.0-beta.59
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/globals.css +3 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +1217 -1070
- package/dist/index.mjs +1114 -967
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1488,11 +1488,14 @@ function DrivePickerCell({
|
|
|
1488
1488
|
cellContextId,
|
|
1489
1489
|
orgId: activeOrgId
|
|
1490
1490
|
});
|
|
1491
|
-
if ((actionResult == null ? void 0 : actionResult.success) === false || (actionResult == null ? void 0 : actionResult.error)) {
|
|
1492
|
-
throw new Error(actionResult.error || `Upload failed for ${file.name}`);
|
|
1491
|
+
if (!actionResult || (actionResult == null ? void 0 : actionResult.success) === false || (actionResult == null ? void 0 : actionResult.error)) {
|
|
1492
|
+
throw new Error((actionResult == null ? void 0 : actionResult.error) || formError || `Upload failed for ${file.name}`);
|
|
1493
1493
|
}
|
|
1494
1494
|
const data = (actionResult == null ? void 0 : actionResult.data) || actionResult;
|
|
1495
|
-
const fileId = (data == null ? void 0 : data.fileId) || (data == null ? void 0 : data.id)
|
|
1495
|
+
const fileId = (data == null ? void 0 : data.fileId) || (data == null ? void 0 : data.id);
|
|
1496
|
+
if (!fileId) {
|
|
1497
|
+
throw new Error(formError || `Upload failed for ${file.name}`);
|
|
1498
|
+
}
|
|
1496
1499
|
const fileName = (data == null ? void 0 : data.fileName) || (data == null ? void 0 : data.name) || file.name;
|
|
1497
1500
|
const fileUrl = (data == null ? void 0 : data.fileUrl) || (data == null ? void 0 : data.url) || (data == null ? void 0 : data.link) || "";
|
|
1498
1501
|
const url = (data == null ? void 0 : data.url) || (data == null ? void 0 : data.fileUrl) || (data == null ? void 0 : data.link) || fileUrl;
|
|
@@ -6264,7 +6267,9 @@ function TableBlockClient({
|
|
|
6264
6267
|
onRowToggle,
|
|
6265
6268
|
rowStatusMap,
|
|
6266
6269
|
editModelUrl,
|
|
6267
|
-
hideRelationButtons
|
|
6270
|
+
hideRelationButtons,
|
|
6271
|
+
rowExtraHeader,
|
|
6272
|
+
renderRowExtra
|
|
6268
6273
|
}) {
|
|
6269
6274
|
const { showError, addToast } = useToast();
|
|
6270
6275
|
const [isExporting, setIsExporting] = useState15(false);
|
|
@@ -6555,8 +6560,8 @@ function TableBlockClient({
|
|
|
6555
6560
|
const q = fVal.toLowerCase().trim();
|
|
6556
6561
|
if (!q) continue;
|
|
6557
6562
|
if (q === "true" || q === "false") {
|
|
6558
|
-
const
|
|
6559
|
-
if (
|
|
6563
|
+
const isTrue2 = cellVal === true || cellVal === "true" || cellVal === 1;
|
|
6564
|
+
if (isTrue2 !== (q === "true")) return false;
|
|
6560
6565
|
continue;
|
|
6561
6566
|
}
|
|
6562
6567
|
const relIds = normalizeRelationValue(cellVal);
|
|
@@ -6681,8 +6686,8 @@ function TableBlockClient({
|
|
|
6681
6686
|
const q = fVal.toLowerCase().trim();
|
|
6682
6687
|
if (!q) continue;
|
|
6683
6688
|
if (q === "true" || q === "false") {
|
|
6684
|
-
const
|
|
6685
|
-
if (
|
|
6689
|
+
const isTrue2 = cellVal === true || cellVal === "true" || cellVal === 1;
|
|
6690
|
+
if (isTrue2 !== (q === "true")) return false;
|
|
6686
6691
|
continue;
|
|
6687
6692
|
}
|
|
6688
6693
|
const relIds = normalizeRelationValue(cellVal);
|
|
@@ -8001,6 +8006,7 @@ function TableBlockClient({
|
|
|
8001
8006
|
return ((_a = c.type) == null ? void 0 : _a.toUpperCase()) === "SUB_TABLE";
|
|
8002
8007
|
}) && /* @__PURE__ */ jsx16("div", { className: "w-5 h-5 shrink-0" })
|
|
8003
8008
|
] }) }),
|
|
8009
|
+
renderRowExtra && /* @__PURE__ */ jsx16("th", { className: "border-b border-l border-slate-200 p-1.5 text-right align-middle bg-white h-12 min-h-[48px] text-xs font-bold text-slate-600 whitespace-nowrap", children: rowExtraHeader }),
|
|
8004
8010
|
filteredColumns.map((col) => {
|
|
8005
8011
|
var _a, _b;
|
|
8006
8012
|
const isSearching = activeSearchCol === col.name;
|
|
@@ -8174,7 +8180,8 @@ function TableBlockClient({
|
|
|
8174
8180
|
executeAction,
|
|
8175
8181
|
emitEvent,
|
|
8176
8182
|
readOnly: effectiveReadOnly || !effectivePermissions.canUpdate,
|
|
8177
|
-
permissions: effectivePermissions
|
|
8183
|
+
permissions: effectivePermissions,
|
|
8184
|
+
renderRowExtra
|
|
8178
8185
|
},
|
|
8179
8186
|
row.id
|
|
8180
8187
|
);
|
|
@@ -8361,7 +8368,8 @@ var TableRow = React13.memo(function TableRow2({
|
|
|
8361
8368
|
executeAction,
|
|
8362
8369
|
emitEvent,
|
|
8363
8370
|
readOnly,
|
|
8364
|
-
permissions
|
|
8371
|
+
permissions,
|
|
8372
|
+
renderRowExtra
|
|
8365
8373
|
}) {
|
|
8366
8374
|
const lockedCopyTargets = getRelationCopyLockedTargets(schema == null ? void 0 : schema.columns);
|
|
8367
8375
|
return /* @__PURE__ */ jsxs13(React13.Fragment, { children: [
|
|
@@ -8433,6 +8441,7 @@ var TableRow = React13.memo(function TableRow2({
|
|
|
8433
8441
|
}
|
|
8434
8442
|
)
|
|
8435
8443
|
] }) }),
|
|
8444
|
+
renderRowExtra && /* @__PURE__ */ jsx16("td", { className: "border-b border-l border-slate-200 px-2 py-1.5 align-middle bg-white group-hover:bg-transparent", children: renderRowExtra(row) }),
|
|
8436
8445
|
filteredColumns.map((col) => {
|
|
8437
8446
|
var _a;
|
|
8438
8447
|
const colType = ((_a = col.type) == null ? void 0 : _a.toUpperCase()) || "DEFAULT";
|
|
@@ -8513,14 +8522,152 @@ var TableRow = React13.memo(function TableRow2({
|
|
|
8513
8522
|
] });
|
|
8514
8523
|
});
|
|
8515
8524
|
|
|
8525
|
+
// src/components/TableBlock/formTracking/FormTrackingTableBlock.tsx
|
|
8526
|
+
import { useCallback as useCallback13, useState as useState16 } from "react";
|
|
8527
|
+
|
|
8528
|
+
// src/components/TableBlock/formTracking/formTracking.types.ts
|
|
8529
|
+
function getFormTrackingConfig(settings) {
|
|
8530
|
+
const ft = settings == null ? void 0 : settings.formTracking;
|
|
8531
|
+
if (!ft || ft.enabled !== true || !Array.isArray(ft.steps)) return null;
|
|
8532
|
+
const steps = ft.steps.filter(
|
|
8533
|
+
(s) => s && typeof s.formId === "string" && s.formId && typeof s.returnedColumn === "string" && s.returnedColumn
|
|
8534
|
+
);
|
|
8535
|
+
if (steps.length === 0) return null;
|
|
8536
|
+
return { enabled: true, steps };
|
|
8537
|
+
}
|
|
8538
|
+
var isTrue = (v) => v === true || v === "true" || v === 1;
|
|
8539
|
+
function getFormStepState(data, step, sentOverride) {
|
|
8540
|
+
if (isTrue(data == null ? void 0 : data[step.returnedColumn])) return "returned";
|
|
8541
|
+
const sent = sentOverride !== void 0 ? sentOverride : step.sentColumn ? isTrue(data == null ? void 0 : data[step.sentColumn]) : false;
|
|
8542
|
+
return sent ? "sent" : "none";
|
|
8543
|
+
}
|
|
8544
|
+
|
|
8545
|
+
// src/components/TableBlock/formTracking/FormTrackingTableBlock.tsx
|
|
8546
|
+
import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
8547
|
+
var PILL_STYLE = {
|
|
8548
|
+
none: "bg-slate-100 text-slate-500 border-slate-200",
|
|
8549
|
+
sent: "bg-amber-50 text-amber-700 border-amber-200",
|
|
8550
|
+
returned: "bg-emerald-50 text-emerald-700 border-emerald-200"
|
|
8551
|
+
};
|
|
8552
|
+
var PILL_ICON = { none: "\u25EF", sent: "\u2709", returned: "\u2713" };
|
|
8553
|
+
function stateText(step, state) {
|
|
8554
|
+
if (step.kind === "create") return state === "returned" ? "\u05DE\u05D5\u05DC\u05D0" : "\u05DC\u05D0 \u05DE\u05D5\u05DC\u05D0";
|
|
8555
|
+
return state === "returned" ? "\u05D4\u05D5\u05D7\u05D6\u05E8" : state === "sent" ? "\u05E0\u05E9\u05DC\u05D7" : "\u05DC\u05D0 \u05E0\u05E9\u05DC\u05D7";
|
|
8556
|
+
}
|
|
8557
|
+
function FormTrackingTableBlock(props) {
|
|
8558
|
+
const { settings, executeAction, readOnly } = props;
|
|
8559
|
+
const config = getFormTrackingConfig(settings);
|
|
8560
|
+
const { addToast, showError } = useToast();
|
|
8561
|
+
const tableId = (settings == null ? void 0 : settings.tableMetaId) || (settings == null ? void 0 : settings.tableId) || (settings == null ? void 0 : settings.id);
|
|
8562
|
+
const [sentOverrides, setSentOverrides] = useState16({});
|
|
8563
|
+
const [busyKey, setBusyKey] = useState16(null);
|
|
8564
|
+
const copyLink = useCallback13(
|
|
8565
|
+
async (rowId, step) => {
|
|
8566
|
+
if (!executeAction || !tableId) return;
|
|
8567
|
+
setBusyKey(`${rowId}|${step.formId}|link`);
|
|
8568
|
+
try {
|
|
8569
|
+
const res = await executeAction("FORM_TRACKING_GET_LINK", {
|
|
8570
|
+
tableId,
|
|
8571
|
+
recordId: rowId,
|
|
8572
|
+
formId: step.formId
|
|
8573
|
+
});
|
|
8574
|
+
const url = res == null ? void 0 : res.url;
|
|
8575
|
+
if (!url) throw new Error((res == null ? void 0 : res.error) || "\u05D9\u05E6\u05D9\u05E8\u05EA \u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05E0\u05DB\u05E9\u05DC\u05D4");
|
|
8576
|
+
try {
|
|
8577
|
+
await navigator.clipboard.writeText(url);
|
|
8578
|
+
addToast({ type: "success", message: `\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${step.label}" \u05D4\u05D5\u05E2\u05EA\u05E7` });
|
|
8579
|
+
} catch (e) {
|
|
8580
|
+
window.prompt(`\u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC"${step.label}" - \u05D4\u05E2\u05EA\u05E7 \u05D9\u05D3\u05E0\u05D9\u05EA:`, url);
|
|
8581
|
+
}
|
|
8582
|
+
} catch (e) {
|
|
8583
|
+
showError((e == null ? void 0 : e.message) || "\u05D9\u05E6\u05D9\u05E8\u05EA \u05D4\u05E7\u05D9\u05E9\u05D5\u05E8 \u05E0\u05DB\u05E9\u05DC\u05D4");
|
|
8584
|
+
} finally {
|
|
8585
|
+
setBusyKey(null);
|
|
8586
|
+
}
|
|
8587
|
+
},
|
|
8588
|
+
[executeAction, tableId, addToast, showError]
|
|
8589
|
+
);
|
|
8590
|
+
const setSent = useCallback13(
|
|
8591
|
+
async (rowId, step, value) => {
|
|
8592
|
+
if (!executeAction || !tableId || !step.sentColumn) return;
|
|
8593
|
+
setBusyKey(`${rowId}|${step.formId}|sent`);
|
|
8594
|
+
try {
|
|
8595
|
+
await executeAction("FORM_TRACKING_SET_SENT", {
|
|
8596
|
+
tableId,
|
|
8597
|
+
recordId: rowId,
|
|
8598
|
+
formId: step.formId,
|
|
8599
|
+
value
|
|
8600
|
+
});
|
|
8601
|
+
setSentOverrides((prev) => __spreadProps(__spreadValues({}, prev), { [`${rowId}|${step.sentColumn}`]: value }));
|
|
8602
|
+
} catch (e) {
|
|
8603
|
+
showError((e == null ? void 0 : e.message) || "\u05E2\u05D3\u05DB\u05D5\u05DF \u05D4\u05E1\u05D8\u05D8\u05D5\u05E1 \u05E0\u05DB\u05E9\u05DC");
|
|
8604
|
+
} finally {
|
|
8605
|
+
setBusyKey(null);
|
|
8606
|
+
}
|
|
8607
|
+
},
|
|
8608
|
+
[executeAction, tableId, showError]
|
|
8609
|
+
);
|
|
8610
|
+
const renderRowExtra = useCallback13(
|
|
8611
|
+
(row) => {
|
|
8612
|
+
var _a;
|
|
8613
|
+
if (!config) return null;
|
|
8614
|
+
const rowId = String((_a = row == null ? void 0 : row.id) != null ? _a : "");
|
|
8615
|
+
return /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap items-center gap-x-3 gap-y-1.5 py-0.5", children: config.steps.map((step) => {
|
|
8616
|
+
const override = step.sentColumn ? sentOverrides[`${rowId}|${step.sentColumn}`] : void 0;
|
|
8617
|
+
const state = getFormStepState(row == null ? void 0 : row.data, step, override);
|
|
8618
|
+
const isUpdateStep = step.kind === "update" && !!step.sentColumn && !readOnly;
|
|
8619
|
+
const showCopyLink = isUpdateStep;
|
|
8620
|
+
const showSentToggle = isUpdateStep && state !== "returned";
|
|
8621
|
+
return /* @__PURE__ */ jsxs14("div", { className: "inline-flex items-center gap-1.5", children: [
|
|
8622
|
+
/* @__PURE__ */ jsxs14(
|
|
8623
|
+
"span",
|
|
8624
|
+
{
|
|
8625
|
+
className: `inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] font-semibold whitespace-nowrap ${PILL_STYLE[state]}`,
|
|
8626
|
+
title: `${step.label}: ${stateText(step, state)}`,
|
|
8627
|
+
children: [
|
|
8628
|
+
/* @__PURE__ */ jsx17("span", { children: PILL_ICON[state] }),
|
|
8629
|
+
/* @__PURE__ */ jsx17("span", { children: step.label })
|
|
8630
|
+
]
|
|
8631
|
+
}
|
|
8632
|
+
),
|
|
8633
|
+
showCopyLink && /* @__PURE__ */ jsx17(
|
|
8634
|
+
"button",
|
|
8635
|
+
{
|
|
8636
|
+
type: "button",
|
|
8637
|
+
disabled: busyKey !== null,
|
|
8638
|
+
onClick: () => copyLink(rowId, step),
|
|
8639
|
+
className: "text-[11px] font-semibold text-brand hover:underline disabled:opacity-40 cursor-pointer whitespace-nowrap",
|
|
8640
|
+
children: "\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D9\u05E9\u05D5\u05E8"
|
|
8641
|
+
}
|
|
8642
|
+
),
|
|
8643
|
+
showSentToggle && /* @__PURE__ */ jsx17(
|
|
8644
|
+
"button",
|
|
8645
|
+
{
|
|
8646
|
+
type: "button",
|
|
8647
|
+
disabled: busyKey !== null,
|
|
8648
|
+
onClick: () => setSent(rowId, step, state !== "sent"),
|
|
8649
|
+
className: "text-[11px] font-semibold text-slate-500 hover:text-slate-800 hover:underline disabled:opacity-40 cursor-pointer whitespace-nowrap",
|
|
8650
|
+
children: state === "sent" ? "\u05D1\u05D8\u05DC \u05E1\u05D9\u05DE\u05D5\u05DF" : "\u05E1\u05DE\u05DF \u05DB\u05E0\u05E9\u05DC\u05D7"
|
|
8651
|
+
}
|
|
8652
|
+
)
|
|
8653
|
+
] }, step.formId);
|
|
8654
|
+
}) });
|
|
8655
|
+
},
|
|
8656
|
+
[config, sentOverrides, busyKey, readOnly, copyLink, setSent]
|
|
8657
|
+
);
|
|
8658
|
+
if (!config) return /* @__PURE__ */ jsx17(TableBlockClient, __spreadValues({}, props));
|
|
8659
|
+
return /* @__PURE__ */ jsx17(TableBlockClient, __spreadProps(__spreadValues({}, props), { rowExtraHeader: "\u05D4\u05EA\u05E7\u05D3\u05DE\u05D5\u05EA \u05D8\u05E4\u05E1\u05D9\u05DD", renderRowExtra }));
|
|
8660
|
+
}
|
|
8661
|
+
|
|
8516
8662
|
// src/components/TableBlock/TableBlock.tsx
|
|
8517
|
-
import { jsx as
|
|
8663
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
8518
8664
|
function TableBlock(props) {
|
|
8519
|
-
return /* @__PURE__ */
|
|
8665
|
+
if (getFormTrackingConfig(props.settings)) return /* @__PURE__ */ jsx18(FormTrackingTableBlock, __spreadValues({}, props));
|
|
8666
|
+
return /* @__PURE__ */ jsx18(TableBlockClient, __spreadValues({}, props));
|
|
8520
8667
|
}
|
|
8521
8668
|
|
|
8522
8669
|
// src/components/PlacementBlock/PlacementBlock.tsx
|
|
8523
|
-
import { useState as
|
|
8670
|
+
import { useState as useState17, useEffect as useEffect14, useRef as useRef14, useCallback as useCallback14, useMemo as useMemo9 } from "react";
|
|
8524
8671
|
import { AgGridReact } from "ag-grid-react";
|
|
8525
8672
|
import {
|
|
8526
8673
|
ModuleRegistry,
|
|
@@ -8529,7 +8676,7 @@ import {
|
|
|
8529
8676
|
import { Filter as Filter2 } from "lucide-react";
|
|
8530
8677
|
|
|
8531
8678
|
// src/components/PlacementBlock/PlacementSettings.tsx
|
|
8532
|
-
import
|
|
8679
|
+
import React15 from "react";
|
|
8533
8680
|
|
|
8534
8681
|
// src/components/PlacementBlock/placementColumns.ts
|
|
8535
8682
|
var RELATION_SEP = "::";
|
|
@@ -8626,7 +8773,7 @@ function readColumnValue(data, ref) {
|
|
|
8626
8773
|
}
|
|
8627
8774
|
|
|
8628
8775
|
// src/components/PlacementBlock/PlacementSettings.tsx
|
|
8629
|
-
import { Fragment as Fragment3, jsx as
|
|
8776
|
+
import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
8630
8777
|
var DEFAULT_PLACEMENT_STATUS_COLORS = [
|
|
8631
8778
|
{ id: "1", hex: "#10b981", label: "\u05DE\u05EA\u05D0\u05D9\u05DD / \u05D0\u05D5\u05E9\u05E8" },
|
|
8632
8779
|
{ id: "2", hex: "#f59e0b", label: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05E8\u05D0\u05D9\u05D5\u05DF" },
|
|
@@ -8638,20 +8785,20 @@ function resolveDefaultStatusId(list, wanted) {
|
|
|
8638
8785
|
if (list.some((s) => s.id === "3")) return "3";
|
|
8639
8786
|
return (_b = (_a = list[0]) == null ? void 0 : _a.id) != null ? _b : "";
|
|
8640
8787
|
}
|
|
8641
|
-
var SummaryRow = ({ label, value, hint }) => /* @__PURE__ */
|
|
8642
|
-
/* @__PURE__ */
|
|
8643
|
-
/* @__PURE__ */
|
|
8788
|
+
var SummaryRow = ({ label, value, hint }) => /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-2 text-sm", children: [
|
|
8789
|
+
/* @__PURE__ */ jsx19("span", { className: value ? "text-emerald-600" : "text-slate-300", children: value ? "\u2713" : "\u25CB" }),
|
|
8790
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-slate-500 shrink-0", children: [
|
|
8644
8791
|
label,
|
|
8645
8792
|
":"
|
|
8646
8793
|
] }),
|
|
8647
|
-
value ? /* @__PURE__ */
|
|
8794
|
+
value ? /* @__PURE__ */ jsxs15("span", { className: "font-semibold text-slate-800 break-words", children: [
|
|
8648
8795
|
value,
|
|
8649
|
-
hint && /* @__PURE__ */
|
|
8650
|
-
] }) : /* @__PURE__ */
|
|
8796
|
+
hint && /* @__PURE__ */ jsx19("span", { className: "mr-2 text-[11px] font-normal text-indigo-600", children: hint })
|
|
8797
|
+
] }) : /* @__PURE__ */ jsx19("span", { className: "text-slate-400", children: "\u05D8\u05E8\u05DD \u05E0\u05D1\u05D7\u05E8" })
|
|
8651
8798
|
] });
|
|
8652
8799
|
var PlacementStatusEditor = ({ config, onChange }) => {
|
|
8653
8800
|
var _a;
|
|
8654
|
-
const radioName = `placement-default-status-${
|
|
8801
|
+
const radioName = `placement-default-status-${React15.useId()}`;
|
|
8655
8802
|
const statuses = ((_a = config.statusColors) == null ? void 0 : _a.length) ? config.statusColors : DEFAULT_PLACEMENT_STATUS_COLORS;
|
|
8656
8803
|
const defaultStatusId = resolveDefaultStatusId(statuses, config.defaultReturnStatusId);
|
|
8657
8804
|
const setStatuses = (next, defId = defaultStatusId) => {
|
|
@@ -8673,11 +8820,11 @@ var PlacementStatusEditor = ({ config, onChange }) => {
|
|
|
8673
8820
|
[next[index], next[j]] = [next[j], next[index]];
|
|
8674
8821
|
setStatuses(next);
|
|
8675
8822
|
};
|
|
8676
|
-
return /* @__PURE__ */
|
|
8677
|
-
/* @__PURE__ */
|
|
8678
|
-
/* @__PURE__ */
|
|
8679
|
-
/* @__PURE__ */
|
|
8680
|
-
/* @__PURE__ */
|
|
8823
|
+
return /* @__PURE__ */ jsxs15("div", { className: "p-4 border border-emerald-200 bg-emerald-50/50 rounded space-y-3", children: [
|
|
8824
|
+
/* @__PURE__ */ jsx19("h4", { className: "font-semibold text-emerald-900", children: "\u05E9\u05DC\u05D1 3: \u05E1\u05D8\u05D8\u05D5\u05E1\u05D9\u05DD (\u05D4\u05E2\u05D9\u05D2\u05D5\u05DC\u05D9\u05DD \u05D4\u05E6\u05D1\u05E2\u05D5\u05E0\u05D9\u05D9\u05DD)" }),
|
|
8825
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-slate-500", children: "\u05DC\u05D7\u05D9\u05E6\u05D4 \u05E2\u05DC \u05E2\u05D9\u05D2\u05D5\u05DC \u05D1\u05E8\u05DB\u05D9\u05D1 \u05DE\u05D7\u05DC\u05D9\u05E4\u05D4 \u05D1\u05D9\u05DF \u05D4\u05E1\u05D8\u05D8\u05D5\u05E1\u05D9\u05DD \u05DC\u05E4\u05D9 \u05D4\u05E1\u05D3\u05E8 \u05E9\u05DB\u05D0\u05DF. \u05D4\u05D8\u05E7\u05E1\u05D8 \u05DE\u05D5\u05E4\u05D9\u05E2 \u05D1\u05D1\u05D5\u05E2\u05D4 \u05DB\u05E9\u05D4\u05E2\u05DB\u05D1\u05E8 \u05E2\u05D5\u05DE\u05D3 \u05DE\u05E2\u05DC \u05D4\u05E2\u05D9\u05D2\u05D5\u05DC." }),
|
|
8826
|
+
/* @__PURE__ */ jsx19("div", { className: "space-y-2", children: statuses.map((st, i) => /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2 bg-white border rounded p-2", children: [
|
|
8827
|
+
/* @__PURE__ */ jsx19(
|
|
8681
8828
|
"input",
|
|
8682
8829
|
{
|
|
8683
8830
|
type: "color",
|
|
@@ -8687,7 +8834,7 @@ var PlacementStatusEditor = ({ config, onChange }) => {
|
|
|
8687
8834
|
"aria-label": "\u05E6\u05D1\u05E2"
|
|
8688
8835
|
}
|
|
8689
8836
|
),
|
|
8690
|
-
/* @__PURE__ */
|
|
8837
|
+
/* @__PURE__ */ jsx19(
|
|
8691
8838
|
"input",
|
|
8692
8839
|
{
|
|
8693
8840
|
type: "text",
|
|
@@ -8697,8 +8844,8 @@ var PlacementStatusEditor = ({ config, onChange }) => {
|
|
|
8697
8844
|
className: "flex-1 min-w-0 border p-2 rounded text-sm"
|
|
8698
8845
|
}
|
|
8699
8846
|
),
|
|
8700
|
-
/* @__PURE__ */
|
|
8701
|
-
/* @__PURE__ */
|
|
8847
|
+
/* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-xs text-slate-600 shrink-0 cursor-pointer", title: "\u05D4\u05E1\u05D8\u05D8\u05D5\u05E1 \u05D4\u05D4\u05EA\u05D7\u05DC\u05EA\u05D9, \u05D5\u05D2\u05DD \u05D6\u05D4 \u05E9\u05D0\u05DC\u05D9\u05D5 \u05D7\u05D5\u05D6\u05E8 \u05DE\u05D5\u05E2\u05DE\u05D3 \u05E9\u05DE\u05D5\u05D7\u05D6\u05E8 \u05DC\u05E8\u05E9\u05D9\u05DE\u05EA \u05D4\u05DE\u05E7\u05D5\u05E8", children: [
|
|
8848
|
+
/* @__PURE__ */ jsx19(
|
|
8702
8849
|
"input",
|
|
8703
8850
|
{
|
|
8704
8851
|
type: "radio",
|
|
@@ -8709,13 +8856,13 @@ var PlacementStatusEditor = ({ config, onChange }) => {
|
|
|
8709
8856
|
),
|
|
8710
8857
|
"\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC"
|
|
8711
8858
|
] }),
|
|
8712
|
-
/* @__PURE__ */
|
|
8713
|
-
/* @__PURE__ */
|
|
8714
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => moveStatus(i, -1), disabled: i === 0, className: "px-2 py-1 border rounded text-xs disabled:opacity-30", "aria-label": "\u05D4\u05D6\u05D6 \u05DC\u05DE\u05E2\u05DC\u05D4", children: "\u25B2" }),
|
|
8860
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => moveStatus(i, 1), disabled: i === statuses.length - 1, className: "px-2 py-1 border rounded text-xs disabled:opacity-30", "aria-label": "\u05D4\u05D6\u05D6 \u05DC\u05DE\u05D8\u05D4", children: "\u25BC" }),
|
|
8861
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => removeStatus(st.id), disabled: statuses.length <= 1, className: "px-2 py-1 border border-rose-300 text-rose-600 rounded text-xs disabled:opacity-30", "aria-label": "\u05DE\u05D7\u05E7 \u05E1\u05D8\u05D8\u05D5\u05E1", children: "\u2715" })
|
|
8715
8862
|
] }, st.id)) }),
|
|
8716
|
-
/* @__PURE__ */
|
|
8717
|
-
/* @__PURE__ */
|
|
8718
|
-
/* @__PURE__ */
|
|
8863
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-3", children: [
|
|
8864
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: addStatus, className: "px-3 py-1.5 rounded text-sm font-medium bg-emerald-600 text-white hover:bg-emerald-700", children: "+ \u05D4\u05D5\u05E1\u05E3 \u05E1\u05D8\u05D8\u05D5\u05E1" }),
|
|
8865
|
+
/* @__PURE__ */ jsx19("button", { type: "button", onClick: () => setStatuses(DEFAULT_PLACEMENT_STATUS_COLORS, "3"), className: "text-xs text-slate-500 underline", children: "\u05D0\u05E4\u05E1 \u05DC\u05D1\u05E8\u05D9\u05E8\u05EA \u05D4\u05DE\u05D7\u05D3\u05DC" })
|
|
8719
8866
|
] })
|
|
8720
8867
|
] });
|
|
8721
8868
|
};
|
|
@@ -8751,15 +8898,15 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8751
8898
|
return cols.filter((c) => c.id === config[currentKey] || !used.includes(c.id));
|
|
8752
8899
|
};
|
|
8753
8900
|
const selectClass = "w-full border p-2 rounded bg-white text-sm";
|
|
8754
|
-
return /* @__PURE__ */
|
|
8755
|
-
/* @__PURE__ */
|
|
8756
|
-
/* @__PURE__ */
|
|
8757
|
-
/* @__PURE__ */
|
|
8758
|
-
/* @__PURE__ */
|
|
8759
|
-
/* @__PURE__ */
|
|
8760
|
-
/* @__PURE__ */
|
|
8761
|
-
/* @__PURE__ */
|
|
8762
|
-
/* @__PURE__ */
|
|
8901
|
+
return /* @__PURE__ */ jsxs15("div", { className: "p-4 border rounded shadow-sm bg-gray-50 space-y-6", dir: "rtl", children: [
|
|
8902
|
+
/* @__PURE__ */ jsx19("h3", { className: "text-lg font-bold", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E8\u05DB\u05D9\u05D1 \u05E9\u05D9\u05D1\u05D5\u05E5" }),
|
|
8903
|
+
/* @__PURE__ */ jsxs15("div", { className: "p-4 border border-indigo-200 bg-indigo-50/60 rounded space-y-2", "aria-live": "polite", children: [
|
|
8904
|
+
/* @__PURE__ */ jsx19("h4", { className: "font-semibold text-indigo-900 text-sm", children: "\u05D4\u05D1\u05D7\u05D9\u05E8\u05D5\u05EA \u05E9\u05E0\u05E2\u05E9\u05D5 \u05E2\u05D3 \u05DB\u05D4" }),
|
|
8905
|
+
/* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-1.5", children: [
|
|
8906
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
|
|
8907
|
+
/* @__PURE__ */ jsx19("div", { className: "text-xs font-bold text-slate-500", children: "\u05DE\u05E7\u05D5\u05E8" }),
|
|
8908
|
+
/* @__PURE__ */ jsx19(SummaryRow, { label: "\u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8", value: sourceTable == null ? void 0 : sourceTable.name }),
|
|
8909
|
+
/* @__PURE__ */ jsx19(
|
|
8763
8910
|
SummaryRow,
|
|
8764
8911
|
{
|
|
8765
8912
|
label: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05DE\u05D9\u05D3\u05E2",
|
|
@@ -8768,10 +8915,10 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8768
8915
|
}
|
|
8769
8916
|
)
|
|
8770
8917
|
] }),
|
|
8771
|
-
/* @__PURE__ */
|
|
8772
|
-
/* @__PURE__ */
|
|
8773
|
-
/* @__PURE__ */
|
|
8774
|
-
/* @__PURE__ */
|
|
8918
|
+
/* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
|
|
8919
|
+
/* @__PURE__ */ jsx19("div", { className: "text-xs font-bold text-slate-500", children: "\u05D9\u05E2\u05D3" }),
|
|
8920
|
+
/* @__PURE__ */ jsx19(SummaryRow, { label: "\u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3", value: targetTable == null ? void 0 : targetTable.name }),
|
|
8921
|
+
/* @__PURE__ */ jsx19(
|
|
8775
8922
|
SummaryRow,
|
|
8776
8923
|
{
|
|
8777
8924
|
label: "\u05E1\u05D9\u05E0\u05D5\u05DF 1",
|
|
@@ -8779,7 +8926,7 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8779
8926
|
hint: relatedHint(config.targetFilterField1Id, targetTextColumns)
|
|
8780
8927
|
}
|
|
8781
8928
|
),
|
|
8782
|
-
/* @__PURE__ */
|
|
8929
|
+
/* @__PURE__ */ jsx19(
|
|
8783
8930
|
SummaryRow,
|
|
8784
8931
|
{
|
|
8785
8932
|
label: "\u05E1\u05D9\u05E0\u05D5\u05DF 2",
|
|
@@ -8787,7 +8934,7 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8787
8934
|
hint: relatedHint(config.targetFilterField2Id, targetTextColumns)
|
|
8788
8935
|
}
|
|
8789
8936
|
),
|
|
8790
|
-
/* @__PURE__ */
|
|
8937
|
+
/* @__PURE__ */ jsx19(
|
|
8791
8938
|
SummaryRow,
|
|
8792
8939
|
{
|
|
8793
8940
|
label: "\u05D1\u05D7\u05D9\u05E8\u05EA \u05E8\u05E9\u05D5\u05DE\u05D4",
|
|
@@ -8795,31 +8942,31 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8795
8942
|
hint: relatedHint(config.targetSelectorFieldId, targetTextColumns)
|
|
8796
8943
|
}
|
|
8797
8944
|
),
|
|
8798
|
-
/* @__PURE__ */
|
|
8945
|
+
/* @__PURE__ */ jsx19(SummaryRow, { label: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E9\u05D9\u05D1\u05D5\u05E5", value: config.targetAssignmentFieldId })
|
|
8799
8946
|
] })
|
|
8800
8947
|
] })
|
|
8801
8948
|
] }),
|
|
8802
|
-
/* @__PURE__ */
|
|
8803
|
-
/* @__PURE__ */
|
|
8804
|
-
/* @__PURE__ */
|
|
8805
|
-
/* @__PURE__ */
|
|
8806
|
-
/* @__PURE__ */
|
|
8807
|
-
/* @__PURE__ */
|
|
8949
|
+
/* @__PURE__ */ jsxs15("div", { className: "p-4 border border-slate-200 bg-white rounded space-y-3", children: [
|
|
8950
|
+
/* @__PURE__ */ jsx19("h4", { className: "font-semibold text-slate-800", children: "\u05E9\u05DC\u05D1 1: \u05D8\u05D1\u05DC\u05EA \u05D4\u05DE\u05E7\u05D5\u05E8" }),
|
|
8951
|
+
/* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
8952
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
8953
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 (\u05DC\u05DE\u05E9\u05DC: \u05DE\u05D3\u05E8\u05D9\u05DB\u05D9\u05DD):" }),
|
|
8954
|
+
/* @__PURE__ */ jsxs15(
|
|
8808
8955
|
"select",
|
|
8809
8956
|
{
|
|
8810
8957
|
className: selectClass,
|
|
8811
8958
|
value: config.sourceTableId || "",
|
|
8812
8959
|
onChange: (e) => handleSourceTableChange(e.target.value),
|
|
8813
8960
|
children: [
|
|
8814
|
-
/* @__PURE__ */
|
|
8815
|
-
tables == null ? void 0 : tables.map((t) => /* @__PURE__ */
|
|
8961
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 --" }),
|
|
8962
|
+
tables == null ? void 0 : tables.map((t) => /* @__PURE__ */ jsx19("option", { value: t.id, children: t.name }, t.id))
|
|
8816
8963
|
]
|
|
8817
8964
|
}
|
|
8818
8965
|
)
|
|
8819
8966
|
] }),
|
|
8820
|
-
/* @__PURE__ */
|
|
8821
|
-
/* @__PURE__ */
|
|
8822
|
-
/* @__PURE__ */
|
|
8967
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
8968
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05D4 \u05DC\u05E7\u05D7\u05EA \u05DE\u05DE\u05E0\u05D4 \u05DE\u05D9\u05D3\u05E2 (\u05DC\u05DE\u05E9\u05DC: \u05E9\u05DD \u05DE\u05D3\u05E8\u05D9\u05DA):" }),
|
|
8969
|
+
/* @__PURE__ */ jsxs15(
|
|
8823
8970
|
"select",
|
|
8824
8971
|
{
|
|
8825
8972
|
className: selectClass,
|
|
@@ -8827,103 +8974,103 @@ var PlacementSettings = ({ config, onChange, tables }) => {
|
|
|
8827
8974
|
value: config.sourceDisplayFieldId || "",
|
|
8828
8975
|
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { sourceDisplayFieldId: e.target.value })),
|
|
8829
8976
|
children: [
|
|
8830
|
-
/* @__PURE__ */
|
|
8831
|
-
sourceColumns.map((f) => /* @__PURE__ */
|
|
8977
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05EA \u05DE\u05E7\u05D5\u05E8 --" }),
|
|
8978
|
+
sourceColumns.map((f) => /* @__PURE__ */ jsx19("option", { value: f.id, children: f.name }, f.id))
|
|
8832
8979
|
]
|
|
8833
8980
|
}
|
|
8834
8981
|
)
|
|
8835
8982
|
] })
|
|
8836
8983
|
] })
|
|
8837
8984
|
] }),
|
|
8838
|
-
/* @__PURE__ */
|
|
8839
|
-
/* @__PURE__ */
|
|
8840
|
-
/* @__PURE__ */
|
|
8841
|
-
/* @__PURE__ */
|
|
8842
|
-
/* @__PURE__ */
|
|
8985
|
+
/* @__PURE__ */ jsxs15("div", { className: "p-4 border border-blue-200 bg-blue-50 rounded space-y-3", children: [
|
|
8986
|
+
/* @__PURE__ */ jsx19("h4", { className: "font-semibold text-blue-900", children: "\u05E9\u05DC\u05D1 2: \u05D8\u05D1\u05DC\u05EA \u05D4\u05D9\u05E2\u05D3" }),
|
|
8987
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
8988
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3:" }),
|
|
8989
|
+
/* @__PURE__ */ jsxs15(
|
|
8843
8990
|
"select",
|
|
8844
8991
|
{
|
|
8845
8992
|
className: selectClass,
|
|
8846
8993
|
value: config.targetTableId || "",
|
|
8847
8994
|
onChange: (e) => handleTargetTableChange(e.target.value),
|
|
8848
8995
|
children: [
|
|
8849
|
-
/* @__PURE__ */
|
|
8850
|
-
tables == null ? void 0 : tables.map((t) => /* @__PURE__ */
|
|
8996
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3 --" }),
|
|
8997
|
+
tables == null ? void 0 : tables.map((t) => /* @__PURE__ */ jsx19("option", { value: t.id, children: t.name }, t.id))
|
|
8851
8998
|
]
|
|
8852
8999
|
}
|
|
8853
9000
|
)
|
|
8854
9001
|
] }),
|
|
8855
|
-
config.targetTableId && /* @__PURE__ */
|
|
8856
|
-
/* @__PURE__ */
|
|
8857
|
-
/* @__PURE__ */
|
|
8858
|
-
/* @__PURE__ */
|
|
8859
|
-
/* @__PURE__ */
|
|
9002
|
+
config.targetTableId && /* @__PURE__ */ jsxs15(Fragment3, { children: [
|
|
9003
|
+
/* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-3 gap-4", children: [
|
|
9004
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
9005
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E1\u05D9\u05E0\u05D5\u05DF 1:" }),
|
|
9006
|
+
/* @__PURE__ */ jsxs15(
|
|
8860
9007
|
"select",
|
|
8861
9008
|
{
|
|
8862
9009
|
className: selectClass,
|
|
8863
9010
|
value: config.targetFilterField1Id || "",
|
|
8864
9011
|
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetFilterField1Id: e.target.value })),
|
|
8865
9012
|
children: [
|
|
8866
|
-
/* @__PURE__ */
|
|
8867
|
-
optionsFor(targetTextColumns, "targetFilterField1Id").map((f) => /* @__PURE__ */
|
|
9013
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
|
|
9014
|
+
optionsFor(targetTextColumns, "targetFilterField1Id").map((f) => /* @__PURE__ */ jsx19("option", { value: f.id, children: f.name }, f.id))
|
|
8868
9015
|
]
|
|
8869
9016
|
}
|
|
8870
9017
|
)
|
|
8871
9018
|
] }),
|
|
8872
|
-
/* @__PURE__ */
|
|
8873
|
-
/* @__PURE__ */
|
|
8874
|
-
/* @__PURE__ */
|
|
9019
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
9020
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E1\u05D9\u05E0\u05D5\u05DF 2:" }),
|
|
9021
|
+
/* @__PURE__ */ jsxs15(
|
|
8875
9022
|
"select",
|
|
8876
9023
|
{
|
|
8877
9024
|
className: selectClass,
|
|
8878
9025
|
value: config.targetFilterField2Id || "",
|
|
8879
9026
|
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetFilterField2Id: e.target.value })),
|
|
8880
9027
|
children: [
|
|
8881
|
-
/* @__PURE__ */
|
|
8882
|
-
optionsFor(targetTextColumns, "targetFilterField2Id").map((f) => /* @__PURE__ */
|
|
9028
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
|
|
9029
|
+
optionsFor(targetTextColumns, "targetFilterField2Id").map((f) => /* @__PURE__ */ jsx19("option", { value: f.id, children: f.name }, f.id))
|
|
8883
9030
|
]
|
|
8884
9031
|
}
|
|
8885
9032
|
)
|
|
8886
9033
|
] }),
|
|
8887
|
-
/* @__PURE__ */
|
|
8888
|
-
/* @__PURE__ */
|
|
8889
|
-
/* @__PURE__ */
|
|
9034
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
9035
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D1\u05D7\u05D9\u05E8\u05EA \u05D4\u05E8\u05E9\u05D5\u05DE\u05D4:" }),
|
|
9036
|
+
/* @__PURE__ */ jsxs15(
|
|
8890
9037
|
"select",
|
|
8891
9038
|
{
|
|
8892
9039
|
className: selectClass,
|
|
8893
9040
|
value: config.targetSelectorFieldId || "",
|
|
8894
9041
|
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetSelectorFieldId: e.target.value })),
|
|
8895
9042
|
children: [
|
|
8896
|
-
/* @__PURE__ */
|
|
8897
|
-
optionsFor(targetTextColumns, "targetSelectorFieldId").map((f) => /* @__PURE__ */
|
|
9043
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
|
|
9044
|
+
optionsFor(targetTextColumns, "targetSelectorFieldId").map((f) => /* @__PURE__ */ jsx19("option", { value: f.id, children: f.name }, f.id))
|
|
8898
9045
|
]
|
|
8899
9046
|
}
|
|
8900
9047
|
)
|
|
8901
9048
|
] })
|
|
8902
9049
|
] }),
|
|
8903
|
-
/* @__PURE__ */
|
|
8904
|
-
/* @__PURE__ */
|
|
8905
|
-
/* @__PURE__ */
|
|
9050
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
9051
|
+
/* @__PURE__ */ jsx19("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05D4 \u05D1\u05D8\u05D1\u05DC\u05EA \u05D4\u05D9\u05E2\u05D3 \u05D0\u05DC\u05D9\u05D4 \u05D9\u05D9\u05DB\u05E0\u05E1 \u05D4\u05DE\u05D9\u05D3\u05E2 \u05DE\u05D4\u05DE\u05E7\u05D5\u05E8:" }),
|
|
9052
|
+
/* @__PURE__ */ jsxs15(
|
|
8906
9053
|
"select",
|
|
8907
9054
|
{
|
|
8908
9055
|
className: selectClass,
|
|
8909
9056
|
value: config.targetAssignmentFieldId || "",
|
|
8910
9057
|
onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetAssignmentFieldId: e.target.value })),
|
|
8911
9058
|
children: [
|
|
8912
|
-
/* @__PURE__ */
|
|
8913
|
-
optionsFor(targetColumns, "targetAssignmentFieldId").map((f) => /* @__PURE__ */
|
|
9059
|
+
/* @__PURE__ */ jsx19("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3 --" }),
|
|
9060
|
+
optionsFor(targetColumns, "targetAssignmentFieldId").map((f) => /* @__PURE__ */ jsx19("option", { value: f.id, children: f.name }, f.id))
|
|
8914
9061
|
]
|
|
8915
9062
|
}
|
|
8916
9063
|
)
|
|
8917
9064
|
] })
|
|
8918
9065
|
] })
|
|
8919
9066
|
] }),
|
|
8920
|
-
/* @__PURE__ */
|
|
9067
|
+
/* @__PURE__ */ jsx19(PlacementStatusEditor, { config, onChange })
|
|
8921
9068
|
] });
|
|
8922
9069
|
};
|
|
8923
9070
|
|
|
8924
9071
|
// src/components/PlacementBlock/PlacementRelationButtons.tsx
|
|
8925
9072
|
import { useMemo as useMemo8 } from "react";
|
|
8926
|
-
import { jsx as
|
|
9073
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
8927
9074
|
var GROUP_COLORS = [
|
|
8928
9075
|
{ title: "bg-blue-600 text-white", active: "bg-blue-600 border-blue-600 text-white hover:bg-blue-700", count: "text-blue-700" },
|
|
8929
9076
|
{ title: "bg-violet-600 text-white", active: "bg-violet-600 border-violet-600 text-white hover:bg-violet-700", count: "text-violet-700" },
|
|
@@ -8973,20 +9120,20 @@ var PlacementRelationButtons = ({
|
|
|
8973
9120
|
});
|
|
8974
9121
|
}, [columnNames, rows, filters, relationOptions]);
|
|
8975
9122
|
if (!columnNames || columnNames.length === 0) return null;
|
|
8976
|
-
return /* @__PURE__ */
|
|
9123
|
+
return /* @__PURE__ */ jsx20(
|
|
8977
9124
|
"div",
|
|
8978
9125
|
{
|
|
8979
9126
|
className: `border-t border-slate-100 pt-3 ${className}`,
|
|
8980
9127
|
"data-testid": "placement-relation-buttons",
|
|
8981
|
-
children: groups.every((g) => g.options.length === 0) ? /* @__PURE__ */
|
|
9128
|
+
children: groups.every((g) => g.options.length === 0) ? /* @__PURE__ */ jsx20("div", { className: "py-2 text-xs text-slate-400", children: "\u05D0\u05D9\u05DF \u05E2\u05E8\u05DB\u05D9\u05DD \u05DC\u05D4\u05E6\u05D2\u05D4 \u05D1\u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5" }) : (
|
|
8982
9129
|
// כל עמודה במתחם נפרד: בשורה הראשונה הכותרת (תגית צבעונית), ומהשורה שמתחת הכפתורים
|
|
8983
|
-
/* @__PURE__ */
|
|
9130
|
+
/* @__PURE__ */ jsx20("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-2.5", children: groups.map((group, gi) => {
|
|
8984
9131
|
if (group.options.length === 0) return null;
|
|
8985
9132
|
const color = GROUP_COLORS[gi % GROUP_COLORS.length];
|
|
8986
|
-
return /* @__PURE__ */
|
|
8987
|
-
/* @__PURE__ */
|
|
8988
|
-
/* @__PURE__ */
|
|
8989
|
-
group.activeId && /* @__PURE__ */
|
|
9133
|
+
return /* @__PURE__ */ jsxs16("div", { className: "bg-white border border-slate-200 rounded-xl p-3 flex flex-col gap-2.5 shadow-2xs", children: [
|
|
9134
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between gap-2 pb-2 border-b border-slate-100", children: [
|
|
9135
|
+
/* @__PURE__ */ jsx20("span", { className: `px-2.5 py-0.5 rounded-md text-xs font-bold truncate ${color.title}`, title: group.title, children: group.title }),
|
|
9136
|
+
group.activeId && /* @__PURE__ */ jsx20(
|
|
8990
9137
|
"button",
|
|
8991
9138
|
{
|
|
8992
9139
|
type: "button",
|
|
@@ -8996,11 +9143,11 @@ var PlacementRelationButtons = ({
|
|
|
8996
9143
|
}
|
|
8997
9144
|
)
|
|
8998
9145
|
] }),
|
|
8999
|
-
/* @__PURE__ */
|
|
9146
|
+
/* @__PURE__ */ jsx20("div", { className: "flex flex-wrap items-end gap-x-2 gap-y-2.5", children: group.options.map((opt) => {
|
|
9000
9147
|
const active = group.activeId === opt.id;
|
|
9001
|
-
return /* @__PURE__ */
|
|
9002
|
-
/* @__PURE__ */
|
|
9003
|
-
/* @__PURE__ */
|
|
9148
|
+
return /* @__PURE__ */ jsxs16("div", { className: "flex flex-col items-center gap-0.5", children: [
|
|
9149
|
+
/* @__PURE__ */ jsx20("span", { className: `text-[11px] font-bold leading-none ${active ? color.count : "text-slate-500"}`, children: opt.count }),
|
|
9150
|
+
/* @__PURE__ */ jsx20(
|
|
9004
9151
|
"button",
|
|
9005
9152
|
{
|
|
9006
9153
|
type: "button",
|
|
@@ -9058,7 +9205,7 @@ function computePlacementDefaultFilters(args) {
|
|
|
9058
9205
|
}
|
|
9059
9206
|
|
|
9060
9207
|
// src/components/PlacementBlock/PlacementBlock.tsx
|
|
9061
|
-
import { jsx as
|
|
9208
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
9062
9209
|
ModuleRegistry.registerModules([AllCommunityModule]);
|
|
9063
9210
|
var FETCH_LIMIT = 1e3;
|
|
9064
9211
|
function normalizeRows(records) {
|
|
@@ -9095,7 +9242,7 @@ var ColorDotRenderer = (props) => {
|
|
|
9095
9242
|
const { statuses, defaultStatusId } = props;
|
|
9096
9243
|
const status = statuses.find((c) => c.id === item.statusId) || statuses.find((c) => c.id === defaultStatusId) || statuses[0];
|
|
9097
9244
|
if (!status) return null;
|
|
9098
|
-
return /* @__PURE__ */
|
|
9245
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx21(
|
|
9099
9246
|
"button",
|
|
9100
9247
|
{
|
|
9101
9248
|
type: "button",
|
|
@@ -9109,7 +9256,7 @@ var ColorDotRenderer = (props) => {
|
|
|
9109
9256
|
};
|
|
9110
9257
|
var CheckCellRenderer = (props) => {
|
|
9111
9258
|
if (!props.data) return null;
|
|
9112
|
-
return /* @__PURE__ */
|
|
9259
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx21(
|
|
9113
9260
|
"input",
|
|
9114
9261
|
{
|
|
9115
9262
|
type: "checkbox",
|
|
@@ -9120,7 +9267,7 @@ var CheckCellRenderer = (props) => {
|
|
|
9120
9267
|
}
|
|
9121
9268
|
) });
|
|
9122
9269
|
};
|
|
9123
|
-
var CheckHeader = (props) => /* @__PURE__ */
|
|
9270
|
+
var CheckHeader = (props) => /* @__PURE__ */ jsx21("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx21(
|
|
9124
9271
|
"input",
|
|
9125
9272
|
{
|
|
9126
9273
|
type: "checkbox",
|
|
@@ -9135,8 +9282,8 @@ var CheckHeader = (props) => /* @__PURE__ */ jsx20("div", { className: "flex ite
|
|
|
9135
9282
|
) });
|
|
9136
9283
|
var RelationFilterHeader = (props) => {
|
|
9137
9284
|
const btnRef = useRef14(null);
|
|
9138
|
-
return /* @__PURE__ */
|
|
9139
|
-
/* @__PURE__ */
|
|
9285
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-col items-center justify-center w-full min-w-0 leading-tight select-none", title: props.displayName, children: [
|
|
9286
|
+
/* @__PURE__ */ jsx21(
|
|
9140
9287
|
"button",
|
|
9141
9288
|
{
|
|
9142
9289
|
ref: btnRef,
|
|
@@ -9152,10 +9299,10 @@ var RelationFilterHeader = (props) => {
|
|
|
9152
9299
|
className: `p-0.5 rounded transition-colors cursor-pointer mb-0.5 shrink-0 ${props.active ? "text-blue-600 bg-blue-100 hover:bg-blue-200" : "text-slate-400 hover:text-slate-600 hover:bg-slate-200/60"}`,
|
|
9153
9300
|
title: props.active ? "\u05E1\u05D9\u05E0\u05D5\u05DF \u05E4\u05E2\u05D9\u05DC - \u05DC\u05D7\u05E5 \u05DC\u05E9\u05D9\u05E0\u05D5\u05D9" : "\u05E1\u05D9\u05E0\u05D5\u05DF \u05DC\u05E4\u05D9 \u05E2\u05DE\u05D5\u05D3\u05D4",
|
|
9154
9301
|
"aria-label": `\u05E1\u05D9\u05E0\u05D5\u05DF \u05DC\u05E4\u05D9 ${props.displayName}`,
|
|
9155
|
-
children: /* @__PURE__ */
|
|
9302
|
+
children: /* @__PURE__ */ jsx21(Filter2, { className: "w-3 h-3" })
|
|
9156
9303
|
}
|
|
9157
9304
|
),
|
|
9158
|
-
/* @__PURE__ */
|
|
9305
|
+
/* @__PURE__ */ jsx21("span", { className: "truncate w-full text-center", children: props.displayName })
|
|
9159
9306
|
] });
|
|
9160
9307
|
};
|
|
9161
9308
|
var PlacementBlock = (props) => {
|
|
@@ -9186,27 +9333,27 @@ var PlacementBlock = (props) => {
|
|
|
9186
9333
|
executeActionRef.current = executeAction;
|
|
9187
9334
|
const legacyRef = useRef14({ fetchSourceData, fetchTargetData, updateAssignment });
|
|
9188
9335
|
legacyRef.current = { fetchSourceData, fetchTargetData, updateAssignment };
|
|
9189
|
-
const [sourceRows, setSourceRows] =
|
|
9190
|
-
const [sourceColumns, setSourceColumns] =
|
|
9191
|
-
const [sourceRelOptions, setSourceRelOptions] =
|
|
9192
|
-
const [sourceRelFilters, setSourceRelFilters] =
|
|
9193
|
-
const [targetRows, setTargetRows] =
|
|
9194
|
-
const [targetColumns, setTargetColumns] =
|
|
9195
|
-
const [targetRelOptions, setTargetRelOptions] =
|
|
9196
|
-
const [selectedTargetId, setSelectedTargetId] =
|
|
9197
|
-
const [candidateIds, setCandidateIds] =
|
|
9198
|
-
const [checkedIds, setCheckedIds] =
|
|
9199
|
-
const [isSaving, setIsSaving] =
|
|
9200
|
-
const [sourceSearch, setSourceSearch] =
|
|
9201
|
-
const [candidateSearch, setCandidateSearch] =
|
|
9202
|
-
const [statusMap, setStatusMap] =
|
|
9203
|
-
const [isLoading, setIsLoading] =
|
|
9204
|
-
const [loadError, setLoadError] =
|
|
9205
|
-
const [saveError, setSaveError] =
|
|
9206
|
-
const [colFilters, setColFilters] =
|
|
9207
|
-
const [filterPopover, setFilterPopover] =
|
|
9208
|
-
const [targetFilters, setTargetFilters] =
|
|
9209
|
-
const loadTable =
|
|
9336
|
+
const [sourceRows, setSourceRows] = useState17([]);
|
|
9337
|
+
const [sourceColumns, setSourceColumns] = useState17([]);
|
|
9338
|
+
const [sourceRelOptions, setSourceRelOptions] = useState17({});
|
|
9339
|
+
const [sourceRelFilters, setSourceRelFilters] = useState17({});
|
|
9340
|
+
const [targetRows, setTargetRows] = useState17([]);
|
|
9341
|
+
const [targetColumns, setTargetColumns] = useState17([]);
|
|
9342
|
+
const [targetRelOptions, setTargetRelOptions] = useState17({});
|
|
9343
|
+
const [selectedTargetId, setSelectedTargetId] = useState17("");
|
|
9344
|
+
const [candidateIds, setCandidateIds] = useState17([]);
|
|
9345
|
+
const [checkedIds, setCheckedIds] = useState17([]);
|
|
9346
|
+
const [isSaving, setIsSaving] = useState17(false);
|
|
9347
|
+
const [sourceSearch, setSourceSearch] = useState17("");
|
|
9348
|
+
const [candidateSearch, setCandidateSearch] = useState17("");
|
|
9349
|
+
const [statusMap, setStatusMap] = useState17({});
|
|
9350
|
+
const [isLoading, setIsLoading] = useState17(false);
|
|
9351
|
+
const [loadError, setLoadError] = useState17(null);
|
|
9352
|
+
const [saveError, setSaveError] = useState17(null);
|
|
9353
|
+
const [colFilters, setColFilters] = useState17({ source: {}, cand: {} });
|
|
9354
|
+
const [filterPopover, setFilterPopover] = useState17(null);
|
|
9355
|
+
const [targetFilters, setTargetFilters] = useState17({});
|
|
9356
|
+
const loadTable = useCallback14(async (tableId, kind) => {
|
|
9210
9357
|
const exec = executeActionRef.current;
|
|
9211
9358
|
if (exec) {
|
|
9212
9359
|
const res = await exec("FETCH_TABLE_DATA", { tableId, tableMetaId: tableId, limit: FETCH_LIMIT, skip: 0 });
|
|
@@ -9247,7 +9394,7 @@ var PlacementBlock = (props) => {
|
|
|
9247
9394
|
cancelled = true;
|
|
9248
9395
|
};
|
|
9249
9396
|
}, [sourceTableId, targetTableId, loadTable]);
|
|
9250
|
-
const displayValue =
|
|
9397
|
+
const displayValue = useCallback14((col, val) => {
|
|
9251
9398
|
var _a2, _b2, _c, _d, _e;
|
|
9252
9399
|
let text2 = cellText(val);
|
|
9253
9400
|
if (text2 && /^[a-fA-F0-9]{24}$/.test(text2)) {
|
|
@@ -9280,7 +9427,7 @@ var PlacementBlock = (props) => {
|
|
|
9280
9427
|
});
|
|
9281
9428
|
return maps;
|
|
9282
9429
|
}, [sourceRelOptions]);
|
|
9283
|
-
const relationLabelsOf =
|
|
9430
|
+
const relationLabelsOf = useCallback14((row, colName) => {
|
|
9284
9431
|
var _a2;
|
|
9285
9432
|
const map = relationLabelMaps[colName];
|
|
9286
9433
|
const ids = normalizeRelationValue((_a2 = row.data) == null ? void 0 : _a2[colName]);
|
|
@@ -9289,7 +9436,7 @@ var PlacementBlock = (props) => {
|
|
|
9289
9436
|
const txt = cellText(readColumnValue(row.data, colName));
|
|
9290
9437
|
return txt && !/^[a-fA-F0-9]{24}$/.test(txt) ? txt.split(", ").filter(Boolean) : [];
|
|
9291
9438
|
}, [relationLabelMaps]);
|
|
9292
|
-
const rowPassesColFilters =
|
|
9439
|
+
const rowPassesColFilters = useCallback14((row, filters) => {
|
|
9293
9440
|
return Object.entries(filters).every(([colName, f]) => {
|
|
9294
9441
|
if (!f) return true;
|
|
9295
9442
|
const labels = relationLabelsOf(row, colName);
|
|
@@ -9298,7 +9445,7 @@ var PlacementBlock = (props) => {
|
|
|
9298
9445
|
return true;
|
|
9299
9446
|
});
|
|
9300
9447
|
}, [relationLabelsOf]);
|
|
9301
|
-
const setColFilter =
|
|
9448
|
+
const setColFilter = useCallback14((grid, colName, payload) => {
|
|
9302
9449
|
setColFilters((prev) => {
|
|
9303
9450
|
const next = __spreadValues({}, prev[grid]);
|
|
9304
9451
|
if (payload === void 0) delete next[colName];
|
|
@@ -9306,10 +9453,10 @@ var PlacementBlock = (props) => {
|
|
|
9306
9453
|
return __spreadProps(__spreadValues({}, prev), { [grid]: next });
|
|
9307
9454
|
});
|
|
9308
9455
|
}, []);
|
|
9309
|
-
const openColFilter =
|
|
9456
|
+
const openColFilter = useCallback14((grid, colName, rect) => {
|
|
9310
9457
|
setFilterPopover((cur) => cur && cur.grid === grid && cur.colName === colName ? null : { grid, colName, rect });
|
|
9311
9458
|
}, []);
|
|
9312
|
-
const closeColFilter =
|
|
9459
|
+
const closeColFilter = useCallback14(() => setFilterPopover(null), []);
|
|
9313
9460
|
const filterColumns = useMemo9(() => {
|
|
9314
9461
|
const definedFilters = (config == null ? void 0 : config.filterFields) || [];
|
|
9315
9462
|
const legacyFilters = [config == null ? void 0 : config.targetFilterField1Id, config == null ? void 0 : config.targetFilterField2Id].filter(Boolean);
|
|
@@ -9383,7 +9530,7 @@ var PlacementBlock = (props) => {
|
|
|
9383
9530
|
const assignmentColumn = useMemo9(() => targetColumns.find((c) => c.name === assignmentField), [targetColumns, assignmentField]);
|
|
9384
9531
|
const isRelationField = ((_b = assignmentColumn == null ? void 0 : assignmentColumn.type) == null ? void 0 : _b.toUpperCase()) === "RELATION";
|
|
9385
9532
|
const assignmentLabel = (assignmentColumn == null ? void 0 : assignmentColumn.label) || (assignmentColumn == null ? void 0 : assignmentColumn.name) || assignmentField || "";
|
|
9386
|
-
const nameOf =
|
|
9533
|
+
const nameOf = useCallback14((row) => cellText(readColumnValue(row.data, displayField)) || "\u05DC\u05DC\u05D0 \u05E9\u05DD", [displayField]);
|
|
9387
9534
|
const assignedIds = useMemo9(() => {
|
|
9388
9535
|
var _a2;
|
|
9389
9536
|
const target = targetRows.find((r) => r.id === selectedTargetId);
|
|
@@ -9404,7 +9551,7 @@ var PlacementBlock = (props) => {
|
|
|
9404
9551
|
setCandidateIds(assignedIdsRef.current);
|
|
9405
9552
|
setCheckedIds(assignedIdsRef.current);
|
|
9406
9553
|
}, [selectedTargetId, sourceRows]);
|
|
9407
|
-
const toGridRow =
|
|
9554
|
+
const toGridRow = useCallback14((r, checked = false) => __spreadProps(__spreadValues({}, r.data), { id: r.id, __label: nameOf(r), __checked: checked, statusId: statusMap[r.id] || defaultStatusId }), [nameOf, statusMap, defaultStatusId]);
|
|
9408
9555
|
const candidateRows = useMemo9(() => candidateIds.map((id) => sourceRows.find((r) => r.id === id)).filter((r) => !!r), [candidateIds, sourceRows]);
|
|
9409
9556
|
const candidateGridData = useMemo9(() => {
|
|
9410
9557
|
const checked = new Set(checkedIds);
|
|
@@ -9419,7 +9566,7 @@ var PlacementBlock = (props) => {
|
|
|
9419
9566
|
return wanted.filter((name) => sourceColumns.some((c) => (c == null ? void 0 : c.name) === name && String(c == null ? void 0 : c.type).toUpperCase() === "RELATION"));
|
|
9420
9567
|
}, [config, sourceColumns]);
|
|
9421
9568
|
const hasRelationButtons = relationButtonColumns.length > 0;
|
|
9422
|
-
const handleRelationFilterChange =
|
|
9569
|
+
const handleRelationFilterChange = useCallback14((colName, id) => {
|
|
9423
9570
|
setSourceRelFilters((prev) => __spreadProps(__spreadValues({}, prev), { [colName]: id }));
|
|
9424
9571
|
}, []);
|
|
9425
9572
|
const availableGridData = useMemo9(() => {
|
|
@@ -9427,7 +9574,7 @@ var PlacementBlock = (props) => {
|
|
|
9427
9574
|
const byButtons = active.length === 0 ? availableRows : availableRows.filter((r) => active.every(([name, v]) => rowMatchesRelationFilter(r, name, v)));
|
|
9428
9575
|
return byButtons.filter((r) => rowPassesColFilters(r, colFilters.source)).map((r) => toGridRow(r));
|
|
9429
9576
|
}, [availableRows, sourceRelFilters, relationButtonColumns, toGridRow, rowPassesColFilters, colFilters.source]);
|
|
9430
|
-
const persistAssignment =
|
|
9577
|
+
const persistAssignment = useCallback14(async (nextIds) => {
|
|
9431
9578
|
const exec = executeActionRef.current;
|
|
9432
9579
|
if (exec && targetTableId && assignmentField && selectedTargetId) {
|
|
9433
9580
|
const value = isRelationField ? nextIds : nextIds.map((id) => sourceRows.find((r) => r.id === id)).filter((r) => !!r).map(nameOf).join(", ");
|
|
@@ -9439,10 +9586,10 @@ var PlacementBlock = (props) => {
|
|
|
9439
9586
|
for (const id of nextIds.filter((i) => !assignedIds.includes(i))) await legacyRef.current.updateAssignment(selectedTargetId, id);
|
|
9440
9587
|
}
|
|
9441
9588
|
}, [targetTableId, assignmentField, selectedTargetId, isRelationField, sourceRows, nameOf, assignedIds]);
|
|
9442
|
-
const moveToCandidates =
|
|
9589
|
+
const moveToCandidates = useCallback14((id) => {
|
|
9443
9590
|
setCandidateIds((prev) => prev.includes(id) ? prev : [...prev, id]);
|
|
9444
9591
|
}, []);
|
|
9445
|
-
const moveToSource =
|
|
9592
|
+
const moveToSource = useCallback14((id) => {
|
|
9446
9593
|
setCandidateIds((prev) => prev.filter((x) => x !== id));
|
|
9447
9594
|
setCheckedIds((prev) => prev.filter((x) => x !== id));
|
|
9448
9595
|
setStatusMap((prev) => __spreadProps(__spreadValues({}, prev), { [id]: defaultStatusId }));
|
|
@@ -9451,21 +9598,21 @@ var PlacementBlock = (props) => {
|
|
|
9451
9598
|
moveToCandidatesRef.current = moveToCandidates;
|
|
9452
9599
|
const moveToSourceRef = useRef14(moveToSource);
|
|
9453
9600
|
moveToSourceRef.current = moveToSource;
|
|
9454
|
-
const toggleChecked =
|
|
9601
|
+
const toggleChecked = useCallback14((id) => {
|
|
9455
9602
|
setCheckedIds((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]);
|
|
9456
9603
|
}, []);
|
|
9457
9604
|
const allChecked = candidateIds.length > 0 && candidateIds.every((id) => checkedIds.includes(id));
|
|
9458
9605
|
const someChecked = candidateIds.some((id) => checkedIds.includes(id));
|
|
9459
|
-
const toggleAll =
|
|
9606
|
+
const toggleAll = useCallback14(() => {
|
|
9460
9607
|
setCheckedIds(allChecked ? [] : [...candidateIds]);
|
|
9461
9608
|
}, [allChecked, candidateIds]);
|
|
9462
|
-
const returnAll =
|
|
9609
|
+
const returnAll = useCallback14(() => {
|
|
9463
9610
|
setCandidateIds([]);
|
|
9464
9611
|
setCheckedIds([]);
|
|
9465
9612
|
}, []);
|
|
9466
9613
|
const checkedCandidates = useMemo9(() => candidateIds.filter((id) => checkedIds.includes(id)), [candidateIds, checkedIds]);
|
|
9467
9614
|
const isDirty = checkedCandidates.length !== assignedIds.length || checkedCandidates.some((id) => !assignedIds.includes(id));
|
|
9468
|
-
const submitAssignment =
|
|
9615
|
+
const submitAssignment = useCallback14(async () => {
|
|
9469
9616
|
if (!selectedTargetId) {
|
|
9470
9617
|
alert("\u05D0\u05E0\u05D0 \u05D1\u05D7\u05E8 \u05E7\u05D5\u05D3\u05DD \u05E8\u05E9\u05D5\u05DE\u05EA \u05D9\u05E2\u05D3 \u05DC\u05E4\u05E0\u05D9 \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5");
|
|
9471
9618
|
return;
|
|
@@ -9481,14 +9628,14 @@ var PlacementBlock = (props) => {
|
|
|
9481
9628
|
setIsSaving(false);
|
|
9482
9629
|
}
|
|
9483
9630
|
}, [selectedTargetId, persistAssignment, checkedCandidates]);
|
|
9484
|
-
const cycleStatus =
|
|
9631
|
+
const cycleStatus = useCallback14((recordId) => {
|
|
9485
9632
|
setStatusMap((prev) => {
|
|
9486
9633
|
const current = prev[recordId] || defaultStatusId;
|
|
9487
9634
|
const idx = statuses.findIndex((c) => c.id === current);
|
|
9488
9635
|
return __spreadProps(__spreadValues({}, prev), { [recordId]: statuses[(idx + 1) % statuses.length].id });
|
|
9489
9636
|
});
|
|
9490
9637
|
}, [statuses, defaultStatusId]);
|
|
9491
|
-
const cancelAssignment =
|
|
9638
|
+
const cancelAssignment = useCallback14(async () => {
|
|
9492
9639
|
if (!selectedTargetId || assignedIds.length === 0) return;
|
|
9493
9640
|
if (!window.confirm(`\u05DC\u05D1\u05D8\u05DC \u05D0\u05EA \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5 \u05D5\u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05EA \u05D4\u05E0\u05EA\u05D5\u05DF \u05DE\u05E9\u05D3\u05D4 "${assignmentLabel}"?`)) return;
|
|
9494
9641
|
const removed = new Set(assignedIds);
|
|
@@ -9504,7 +9651,7 @@ var PlacementBlock = (props) => {
|
|
|
9504
9651
|
setIsSaving(false);
|
|
9505
9652
|
}
|
|
9506
9653
|
}, [selectedTargetId, assignedIds, assignmentLabel, persistAssignment]);
|
|
9507
|
-
const makeColDefs =
|
|
9654
|
+
const makeColDefs = useCallback14((columns, fallbackName, grid, withCheckbox = false) => {
|
|
9508
9655
|
const gridFilters = colFilters[grid];
|
|
9509
9656
|
const defs = [];
|
|
9510
9657
|
if (withCheckbox) {
|
|
@@ -9556,10 +9703,10 @@ var PlacementBlock = (props) => {
|
|
|
9556
9703
|
var _a2;
|
|
9557
9704
|
return (_a2 = d.colId) != null ? _a2 : d.field;
|
|
9558
9705
|
}).filter(Boolean);
|
|
9559
|
-
const expandColumns =
|
|
9706
|
+
const expandColumns = useCallback14((api) => {
|
|
9560
9707
|
api == null ? void 0 : api.sizeColumnsToFit();
|
|
9561
9708
|
}, []);
|
|
9562
|
-
const shrinkColumns =
|
|
9709
|
+
const shrinkColumns = useCallback14((api, defs) => {
|
|
9563
9710
|
api == null ? void 0 : api.autoSizeColumns(scrollableColIds(defs));
|
|
9564
9711
|
}, []);
|
|
9565
9712
|
const popoverOptions = useMemo9(() => {
|
|
@@ -9573,11 +9720,11 @@ var PlacementBlock = (props) => {
|
|
|
9573
9720
|
() => filterPopover ? sourceColumns.find((c) => c.name === filterPopover.colName) : void 0,
|
|
9574
9721
|
[filterPopover, sourceColumns]
|
|
9575
9722
|
);
|
|
9576
|
-
const getRowId =
|
|
9723
|
+
const getRowId = useCallback14((p) => p.data.id, []);
|
|
9577
9724
|
const sourceContainerRef = useRef14(null);
|
|
9578
9725
|
const assignedContainerRef = useRef14(null);
|
|
9579
|
-
const [sourceApi, setSourceApi] =
|
|
9580
|
-
const [assignedApi, setAssignedApi] =
|
|
9726
|
+
const [sourceApi, setSourceApi] = useState17(null);
|
|
9727
|
+
const [assignedApi, setAssignedApi] = useState17(null);
|
|
9581
9728
|
useEffect14(() => {
|
|
9582
9729
|
if (!sourceApi || !assignedApi) return;
|
|
9583
9730
|
const toAssigned = { getContainer: () => assignedContainerRef.current, onDragStop: (p) => {
|
|
@@ -9610,52 +9757,52 @@ var PlacementBlock = (props) => {
|
|
|
9610
9757
|
[assignedIds, sourceRows, nameOf]
|
|
9611
9758
|
);
|
|
9612
9759
|
const activeTarget = targetRows.find((r) => r.id === selectedTargetId);
|
|
9613
|
-
const targetLabel =
|
|
9760
|
+
const targetLabel = useCallback14((r) => {
|
|
9614
9761
|
const col = targetColumns.find((c) => c.name === selectorField || c.id === selectorField);
|
|
9615
9762
|
return displayValue(col || { name: selectorField }, readColumnValue(r.data, selectorField)) || "\u05DC\u05DC\u05D0 \u05E9\u05DD";
|
|
9616
9763
|
}, [selectorField, targetColumns, displayValue]);
|
|
9617
9764
|
const previewColumns = useMemo9(() => targetColumns.filter((c) => isUserColumn(c) && c.name !== assignmentField && !["id", "_id", "id_", "statusId"].includes(c.name)), [targetColumns, assignmentField]);
|
|
9618
9765
|
if (!config || !sourceTableId || !targetTableId) {
|
|
9619
|
-
return /* @__PURE__ */
|
|
9766
|
+
return /* @__PURE__ */ jsx21("div", { className: "p-4 text-xs text-slate-500 border border-dashed border-slate-300 rounded-xl", dir: "rtl", children: "\u05E8\u05DB\u05D9\u05D1 \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5 \u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8 (\u05D7\u05E1\u05E8\u05D5\u05EA \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 / \u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3)." });
|
|
9620
9767
|
}
|
|
9621
9768
|
const selectClass = "w-full p-2 border border-slate-300 rounded-lg text-xs font-medium text-slate-700 bg-slate-50 outline-none focus:border-brand";
|
|
9622
9769
|
const labelClass = "block text-[11px] font-semibold text-slate-500 mb-1";
|
|
9623
|
-
return /* @__PURE__ */
|
|
9624
|
-
(loadError || saveError) && /* @__PURE__ */
|
|
9625
|
-
/* @__PURE__ */
|
|
9626
|
-
/* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9628
|
-
/* @__PURE__ */
|
|
9770
|
+
return /* @__PURE__ */ jsxs17("div", { className: `w-full flex flex-col gap-4 p-4 bg-slate-50 min-h-[850px] rounded-xl border border-slate-200 ${className}`, dir: "rtl", children: [
|
|
9771
|
+
(loadError || saveError) && /* @__PURE__ */ jsx21("div", { className: "p-3 text-xs rounded-lg bg-rose-50 border border-rose-200 text-rose-700", children: loadError || saveError }),
|
|
9772
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-col lg:flex-row gap-4", children: [
|
|
9773
|
+
/* @__PURE__ */ jsxs17("div", { className: "w-full lg:w-1/2 bg-teal-50/40 p-4 rounded-xl border border-teal-100 shadow-xs flex flex-col", children: [
|
|
9774
|
+
/* @__PURE__ */ jsxs17("h4", { className: "font-bold text-teal-900 border-b border-teal-200 pb-2 mb-3 text-base flex items-center gap-2", children: [
|
|
9775
|
+
/* @__PURE__ */ jsx21("span", { children: "\u{1F4CC}" }),
|
|
9629
9776
|
" \u05E4\u05E8\u05D8\u05D9 \u05D4\u05D9\u05E2\u05D3 \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5"
|
|
9630
9777
|
] }),
|
|
9631
|
-
activeTarget ? /* @__PURE__ */
|
|
9632
|
-
/* @__PURE__ */
|
|
9778
|
+
activeTarget ? /* @__PURE__ */ jsxs17("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 content-start text-base text-slate-700 flex-1", children: [
|
|
9779
|
+
/* @__PURE__ */ jsx21("div", { className: "col-span-full font-bold text-slate-900 text-lg mb-1", children: targetLabel(activeTarget) }),
|
|
9633
9780
|
previewColumns.map((col) => ({ col, text: displayValue(col, readColumnValue(activeTarget.data, col.name)) })).filter(({ col, text: text2 }) => {
|
|
9634
9781
|
var _a2;
|
|
9635
9782
|
return text2 && (col.type === "RELATION" || typeof ((_a2 = activeTarget.data) == null ? void 0 : _a2[col.name]) !== "object");
|
|
9636
|
-
}).map(({ col, text: text2 }) => /* @__PURE__ */
|
|
9637
|
-
/* @__PURE__ */
|
|
9783
|
+
}).map(({ col, text: text2 }) => /* @__PURE__ */ jsxs17("div", { className: `flex gap-2 items-start ${(col.label || col.name) === "\u05E4\u05E8\u05D8\u05D9\u05DD \u05E0\u05D5\u05E1\u05E4\u05D9\u05DD" ? "sm:col-span-2" : ""}`, children: [
|
|
9784
|
+
/* @__PURE__ */ jsxs17("span", { className: "font-semibold shrink-0", children: [
|
|
9638
9785
|
col.label || col.name,
|
|
9639
9786
|
":"
|
|
9640
9787
|
] }),
|
|
9641
|
-
/* @__PURE__ */
|
|
9788
|
+
/* @__PURE__ */ jsx21("span", { className: "break-words", children: text2 })
|
|
9642
9789
|
] }, col.name)),
|
|
9643
|
-
assignmentField && assignedText && /* @__PURE__ */
|
|
9644
|
-
/* @__PURE__ */
|
|
9790
|
+
assignmentField && assignedText && /* @__PURE__ */ jsxs17("div", { className: "flex gap-2 items-start", children: [
|
|
9791
|
+
/* @__PURE__ */ jsxs17("span", { className: "font-semibold shrink-0", children: [
|
|
9645
9792
|
assignmentLabel,
|
|
9646
9793
|
":"
|
|
9647
9794
|
] }),
|
|
9648
|
-
/* @__PURE__ */
|
|
9795
|
+
/* @__PURE__ */ jsx21("span", { className: "break-words", title: assignedText, children: assignedText })
|
|
9649
9796
|
] }),
|
|
9650
|
-
/* @__PURE__ */
|
|
9797
|
+
/* @__PURE__ */ jsxs17("div", { className: "col-span-full self-end mt-1 pt-1.5 border-t border-teal-200/60 text-teal-800 font-bold text-xs leading-none whitespace-nowrap overflow-hidden text-ellipsis", children: [
|
|
9651
9798
|
"\u05DE\u05E9\u05D5\u05D1\u05E6\u05D9\u05DD \u05DB\u05E8\u05D2\u05E2: ",
|
|
9652
9799
|
assignedIds.length
|
|
9653
9800
|
] })
|
|
9654
|
-
] }) : /* @__PURE__ */
|
|
9801
|
+
] }) : /* @__PURE__ */ jsx21("div", { className: "text-slate-500 text-xs text-center py-6", children: isLoading ? "\u05D8\u05D5\u05E2\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD..." : "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05E8\u05E9\u05D5\u05DE\u05EA \u05D9\u05E2\u05D3." })
|
|
9655
9802
|
] }),
|
|
9656
|
-
/* @__PURE__ */
|
|
9657
|
-
/* @__PURE__ */
|
|
9658
|
-
/* @__PURE__ */
|
|
9803
|
+
/* @__PURE__ */ jsx21("div", { className: "w-full lg:w-1/2 bg-white p-4 rounded-xl border border-slate-200 shadow-xs flex flex-col", children: /* @__PURE__ */ jsxs17("div", { children: [
|
|
9804
|
+
/* @__PURE__ */ jsx21("h4", { className: "font-bold text-slate-800 mb-3 text-sm", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05D4\u05D9\u05E2\u05D3" }),
|
|
9805
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-col sm:flex-row gap-3", children: [
|
|
9659
9806
|
filterColumns.map((col, index) => {
|
|
9660
9807
|
const previousColumns = filterColumns.slice(0, index);
|
|
9661
9808
|
const validRowsForThisFilter = targetRows.filter((r) => {
|
|
@@ -9668,9 +9815,9 @@ var PlacementBlock = (props) => {
|
|
|
9668
9815
|
const uniqueValues = Array.from(new Set(
|
|
9669
9816
|
validRowsForThisFilter.map((r) => displayValue(col, readColumnValue(r.data, col.name)))
|
|
9670
9817
|
)).filter(Boolean).sort((a, b) => a.localeCompare(b, "he"));
|
|
9671
|
-
return /* @__PURE__ */
|
|
9672
|
-
/* @__PURE__ */
|
|
9673
|
-
/* @__PURE__ */
|
|
9818
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex-1 basis-0 min-w-0", children: [
|
|
9819
|
+
/* @__PURE__ */ jsx21("label", { className: labelClass, children: col.label || columnRefLabel(col.name) }),
|
|
9820
|
+
/* @__PURE__ */ jsxs17(
|
|
9674
9821
|
"select",
|
|
9675
9822
|
{
|
|
9676
9823
|
className: selectClass,
|
|
@@ -9686,26 +9833,26 @@ var PlacementBlock = (props) => {
|
|
|
9686
9833
|
});
|
|
9687
9834
|
},
|
|
9688
9835
|
children: [
|
|
9689
|
-
/* @__PURE__ */
|
|
9690
|
-
uniqueValues.map((v) => /* @__PURE__ */
|
|
9836
|
+
/* @__PURE__ */ jsx21("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
|
|
9837
|
+
uniqueValues.map((v) => /* @__PURE__ */ jsx21("option", { value: v, children: v }, v))
|
|
9691
9838
|
]
|
|
9692
9839
|
}
|
|
9693
9840
|
)
|
|
9694
9841
|
] }, col.name);
|
|
9695
9842
|
}),
|
|
9696
|
-
/* @__PURE__ */
|
|
9697
|
-
/* @__PURE__ */
|
|
9698
|
-
/* @__PURE__ */
|
|
9699
|
-
/* @__PURE__ */
|
|
9843
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex-1 basis-0 min-w-0", children: [
|
|
9844
|
+
/* @__PURE__ */ jsx21("label", { className: labelClass, children: selectorLabel }),
|
|
9845
|
+
/* @__PURE__ */ jsxs17("select", { className: selectClass, value: selectedTargetId, onChange: (e) => setSelectedTargetId(e.target.value), children: [
|
|
9846
|
+
/* @__PURE__ */ jsxs17("option", { value: "", children: [
|
|
9700
9847
|
"-- \u05D1\u05D7\u05E8 \u05DE\u05EA\u05D5\u05DA ",
|
|
9701
9848
|
filteredTargetRows.length,
|
|
9702
9849
|
" \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA --"
|
|
9703
9850
|
] }),
|
|
9704
|
-
filteredTargetRows.map((r) => /* @__PURE__ */
|
|
9851
|
+
filteredTargetRows.map((r) => /* @__PURE__ */ jsx21("option", { value: r.id, children: targetLabel(r) }, r.id))
|
|
9705
9852
|
] })
|
|
9706
9853
|
] })
|
|
9707
9854
|
] }),
|
|
9708
|
-
hasRelationButtons && /* @__PURE__ */
|
|
9855
|
+
hasRelationButtons && /* @__PURE__ */ jsx21(
|
|
9709
9856
|
PlacementRelationButtons,
|
|
9710
9857
|
{
|
|
9711
9858
|
className: "mt-4 pb-24",
|
|
@@ -9718,50 +9865,50 @@ var PlacementBlock = (props) => {
|
|
|
9718
9865
|
)
|
|
9719
9866
|
] }) })
|
|
9720
9867
|
] }),
|
|
9721
|
-
/* @__PURE__ */
|
|
9722
|
-
/* @__PURE__ */
|
|
9723
|
-
/* @__PURE__ */
|
|
9724
|
-
/* @__PURE__ */
|
|
9725
|
-
/* @__PURE__ */
|
|
9868
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-col lg:flex-row w-full gap-4 h-[550px]", children: [
|
|
9869
|
+
/* @__PURE__ */ jsxs17("div", { className: `w-full ${hasRelationButtons ? "lg:flex-1 lg:min-w-0" : "lg:w-1/2"} flex flex-col border border-slate-200 rounded-xl shadow-xs bg-white overflow-hidden`, children: [
|
|
9870
|
+
/* @__PURE__ */ jsxs17("div", { className: "bg-slate-100 p-3 border-b border-slate-200 flex flex-col gap-2", children: [
|
|
9871
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex justify-between items-center font-bold text-slate-800 text-sm", children: [
|
|
9872
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
9726
9873
|
"\u05E8\u05E9\u05D9\u05DE\u05EA \u05DE\u05E7\u05D5\u05E8 (",
|
|
9727
9874
|
availableGridData.length,
|
|
9728
9875
|
")"
|
|
9729
9876
|
] }),
|
|
9730
|
-
/* @__PURE__ */
|
|
9731
|
-
/* @__PURE__ */
|
|
9732
|
-
/* @__PURE__ */
|
|
9733
|
-
/* @__PURE__ */
|
|
9877
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
9878
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: () => shrinkColumns(sourceApi, sourceColDefs), title: "\u05E6\u05DE\u05E6\u05DD \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05DC\u05E4\u05D9 \u05D4\u05EA\u05D5\u05DB\u05DF", className: "px-2 py-0.5 rounded-md text-[11px] font-medium bg-white border border-slate-200 text-slate-600 hover:bg-slate-50 cursor-pointer", children: "\u2192\u2190 \u05E6\u05DE\u05E6\u05DD" }),
|
|
9879
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: () => expandColumns(sourceApi), title: "\u05D4\u05E8\u05D7\u05D1 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05DC\u05E8\u05D5\u05D7\u05D1 \u05D4\u05D8\u05D1\u05DC\u05D4", className: "px-2 py-0.5 rounded-md text-[11px] font-medium bg-white border border-slate-200 text-slate-600 hover:bg-slate-50 cursor-pointer", children: "\u2190\u2192 \u05D4\u05E8\u05D7\u05D1" }),
|
|
9880
|
+
/* @__PURE__ */ jsx21("span", { className: "text-[11px] font-normal text-slate-500 bg-white px-2 py-0.5 rounded-full shadow-sm border border-slate-200", children: "\u05D2\u05E8\u05D5\u05E8 \u05E9\u05DE\u05D0\u05DC\u05D4 \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5 \u2190" })
|
|
9734
9881
|
] })
|
|
9735
9882
|
] }),
|
|
9736
|
-
/* @__PURE__ */
|
|
9883
|
+
/* @__PURE__ */ jsx21("input", { type: "search", value: sourceSearch, onChange: (e) => setSourceSearch(e.target.value), placeholder: "\u05E1\u05D9\u05E0\u05D5\u05DF...", className: "w-full p-2 border border-slate-300 rounded-lg text-xs bg-white outline-none focus:border-brand" })
|
|
9737
9884
|
] }),
|
|
9738
|
-
/* @__PURE__ */
|
|
9885
|
+
/* @__PURE__ */ jsx21("div", { ref: sourceContainerRef, className: "ag-theme-quartz flex-1 w-full h-full", children: /* @__PURE__ */ jsx21(AgGridReact, { rowData: availableGridData, columnDefs: sourceColDefs, defaultColDef, headerHeight: 56, getRowId, enableRtl: true, rowDragManaged: false, quickFilterText: sourceSearch, onGridReady: (e) => setSourceApi(e.api), loading: isLoading }) })
|
|
9739
9886
|
] }),
|
|
9740
|
-
/* @__PURE__ */
|
|
9741
|
-
/* @__PURE__ */
|
|
9742
|
-
/* @__PURE__ */
|
|
9743
|
-
/* @__PURE__ */
|
|
9744
|
-
/* @__PURE__ */
|
|
9887
|
+
/* @__PURE__ */ jsxs17("div", { className: `w-full ${hasRelationButtons ? "lg:flex-1 lg:min-w-0" : "lg:w-1/2"} flex flex-col border border-blue-200 rounded-xl shadow-xs bg-white overflow-hidden ring-1 ring-blue-100`, children: [
|
|
9888
|
+
/* @__PURE__ */ jsxs17("div", { className: "bg-blue-50/80 p-3 border-b border-blue-100 flex flex-col gap-2", children: [
|
|
9889
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap justify-between items-center gap-2", children: [
|
|
9890
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2 font-bold text-blue-900 text-sm", children: [
|
|
9891
|
+
/* @__PURE__ */ jsxs17("span", { children: [
|
|
9745
9892
|
"\u05DE\u05D5\u05E2\u05DE\u05D3\u05D9\u05DD \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5 (",
|
|
9746
9893
|
candidateGridData.length,
|
|
9747
9894
|
")"
|
|
9748
9895
|
] }),
|
|
9749
|
-
/* @__PURE__ */
|
|
9750
|
-
/* @__PURE__ */
|
|
9751
|
-
/* @__PURE__ */
|
|
9896
|
+
/* @__PURE__ */ jsx21("span", { className: "text-[11px] font-normal text-blue-700 bg-white px-2 py-0.5 rounded-full shadow-sm border border-blue-100", children: "\u2192 \u05D2\u05E8\u05D5\u05E8 \u05D9\u05DE\u05D9\u05E0\u05D4 \u05DC\u05D4\u05D7\u05D6\u05E8\u05D4" }),
|
|
9897
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: () => shrinkColumns(assignedApi, candidateColDefs), title: "\u05E6\u05DE\u05E6\u05DD \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05DC\u05E4\u05D9 \u05D4\u05EA\u05D5\u05DB\u05DF", className: "px-2 py-0.5 rounded-md text-[11px] font-medium bg-white border border-blue-100 text-slate-600 hover:bg-blue-50 cursor-pointer", children: "\u2192\u2190 \u05E6\u05DE\u05E6\u05DD" }),
|
|
9898
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: () => expandColumns(assignedApi), title: "\u05D4\u05E8\u05D7\u05D1 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05DC\u05E8\u05D5\u05D7\u05D1 \u05D4\u05D8\u05D1\u05DC\u05D4", className: "px-2 py-0.5 rounded-md text-[11px] font-medium bg-white border border-blue-100 text-slate-600 hover:bg-blue-50 cursor-pointer", children: "\u2190\u2192 \u05D4\u05E8\u05D7\u05D1" })
|
|
9752
9899
|
] }),
|
|
9753
|
-
/* @__PURE__ */
|
|
9754
|
-
/* @__PURE__ */
|
|
9755
|
-
/* @__PURE__ */
|
|
9756
|
-
/* @__PURE__ */
|
|
9900
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
|
|
9901
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: returnAll, disabled: candidateIds.length === 0, className: "px-3 py-1.5 rounded-lg text-xs font-bold bg-amber-400 hover:bg-amber-500 text-slate-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "\u21BA \u05D4\u05D7\u05D6\u05E8 \u05D4\u05DB\u05DC" }),
|
|
9902
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: submitAssignment, disabled: !selectedTargetId || !isDirty || isSaving, className: "px-4 py-1.5 rounded-lg text-xs font-bold bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: isSaving ? "\u05E9\u05D5\u05DE\u05E8..." : "\u05E9\u05D1\u05E5" }),
|
|
9903
|
+
/* @__PURE__ */ jsx21("button", { type: "button", onClick: cancelAssignment, disabled: !selectedTargetId || assignedIds.length === 0 || isSaving, className: "px-3 py-1.5 rounded-lg text-xs font-bold bg-white hover:bg-rose-50 text-rose-600 border border-rose-300 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "\u05D1\u05D9\u05D8\u05D5\u05DC \u05E9\u05D9\u05D1\u05D5\u05E5" })
|
|
9757
9904
|
] })
|
|
9758
9905
|
] }),
|
|
9759
|
-
/* @__PURE__ */
|
|
9906
|
+
/* @__PURE__ */ jsx21("input", { type: "search", value: candidateSearch, onChange: (e) => setCandidateSearch(e.target.value), placeholder: "\u05E1\u05D9\u05E0\u05D5\u05DF...", className: "w-full p-2 border border-slate-300 rounded-lg text-xs bg-white outline-none focus:border-brand" })
|
|
9760
9907
|
] }),
|
|
9761
|
-
/* @__PURE__ */
|
|
9908
|
+
/* @__PURE__ */ jsx21("div", { ref: assignedContainerRef, className: "ag-theme-quartz flex-1 w-full h-full", children: /* @__PURE__ */ jsx21(AgGridReact, { rowData: candidateGridData, columnDefs: candidateColDefs, defaultColDef, headerHeight: 56, getRowId, enableRtl: true, rowDragManaged: false, quickFilterText: candidateSearch, onGridReady: (e) => setAssignedApi(e.api), loading: isLoading }) })
|
|
9762
9909
|
] })
|
|
9763
9910
|
] }),
|
|
9764
|
-
filterPopover && popoverColumn && /* @__PURE__ */
|
|
9911
|
+
filterPopover && popoverColumn && /* @__PURE__ */ jsx21(
|
|
9765
9912
|
RelationFilterPopover,
|
|
9766
9913
|
{
|
|
9767
9914
|
isOpen: true,
|
|
@@ -9777,11 +9924,11 @@ var PlacementBlock = (props) => {
|
|
|
9777
9924
|
};
|
|
9778
9925
|
|
|
9779
9926
|
// src/components/WhatsAppComponent/WhatsAppComponent.tsx
|
|
9780
|
-
import
|
|
9927
|
+
import React21 from "react";
|
|
9781
9928
|
import { CheckCircle2 as CheckCircle24, AlertCircle as AlertCircle5, X as X12, Loader2 as Loader28, Phone as Phone4, Send as Send3, Image as ImageIcon3, FileText as FileText4, Video as Video3 } from "lucide-react";
|
|
9782
9929
|
|
|
9783
9930
|
// src/components/WhatsAppComponent/CreateTemplateModal.tsx
|
|
9784
|
-
import { useState as
|
|
9931
|
+
import { useState as useState18, useEffect as useEffect15, useRef as useRef15, useMemo as useMemo10 } from "react";
|
|
9785
9932
|
import {
|
|
9786
9933
|
X as X9,
|
|
9787
9934
|
Plus,
|
|
@@ -9924,7 +10071,7 @@ function readFileAsBase64(file) {
|
|
|
9924
10071
|
}
|
|
9925
10072
|
|
|
9926
10073
|
// src/components/WhatsAppComponent/CreateTemplateModal.tsx
|
|
9927
|
-
import { Fragment as Fragment4, jsx as
|
|
10074
|
+
import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
9928
10075
|
function CreateTemplateModal({
|
|
9929
10076
|
isOpen,
|
|
9930
10077
|
onClose,
|
|
@@ -9934,25 +10081,25 @@ function CreateTemplateModal({
|
|
|
9934
10081
|
executeAction,
|
|
9935
10082
|
orgId
|
|
9936
10083
|
}) {
|
|
9937
|
-
const [templateName, setTemplateName] =
|
|
9938
|
-
const [language, setLanguage] =
|
|
9939
|
-
const [category, setCategory] =
|
|
9940
|
-
const [bodyText, setBodyText] =
|
|
9941
|
-
const [variableSamples, setVariableSamples] =
|
|
9942
|
-
const [hasFileHeader, setHasFileHeader] =
|
|
9943
|
-
const [selectedFile, setSelectedFile] =
|
|
9944
|
-
const [fileBase64, setFileBase64] =
|
|
9945
|
-
const [buttons, setButtons] =
|
|
9946
|
-
const [isAddButtonOpen, setIsAddButtonOpen] =
|
|
10084
|
+
const [templateName, setTemplateName] = useState18("");
|
|
10085
|
+
const [language, setLanguage] = useState18("he");
|
|
10086
|
+
const [category, setCategory] = useState18("MARKETING");
|
|
10087
|
+
const [bodyText, setBodyText] = useState18("");
|
|
10088
|
+
const [variableSamples, setVariableSamples] = useState18({});
|
|
10089
|
+
const [hasFileHeader, setHasFileHeader] = useState18(false);
|
|
10090
|
+
const [selectedFile, setSelectedFile] = useState18(null);
|
|
10091
|
+
const [fileBase64, setFileBase64] = useState18("");
|
|
10092
|
+
const [buttons, setButtons] = useState18([]);
|
|
10093
|
+
const [isAddButtonOpen, setIsAddButtonOpen] = useState18(false);
|
|
9947
10094
|
const addButtonDropdownRef = useRef15(null);
|
|
9948
|
-
const [isSubmitting, setIsSubmitting] =
|
|
9949
|
-
const [submittingStep, setSubmittingStep] =
|
|
9950
|
-
const [submitError, setSubmitError] =
|
|
9951
|
-
const [fileError, setFileError] =
|
|
10095
|
+
const [isSubmitting, setIsSubmitting] = useState18(false);
|
|
10096
|
+
const [submittingStep, setSubmittingStep] = useState18("");
|
|
10097
|
+
const [submitError, setSubmitError] = useState18(null);
|
|
10098
|
+
const [fileError, setFileError] = useState18(null);
|
|
9952
10099
|
const textareaRef = useRef15(null);
|
|
9953
10100
|
const fileInputRef = useRef15(null);
|
|
9954
10101
|
const emojiPickerRef = useRef15(null);
|
|
9955
|
-
const [isEmojiPickerOpen, setIsEmojiPickerOpen] =
|
|
10102
|
+
const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState18(false);
|
|
9956
10103
|
useEffect15(() => {
|
|
9957
10104
|
function handleClickOutside(event) {
|
|
9958
10105
|
if (emojiPickerRef.current && !emojiPickerRef.current.contains(event.target)) {
|
|
@@ -10276,12 +10423,12 @@ function CreateTemplateModal({
|
|
|
10276
10423
|
}
|
|
10277
10424
|
};
|
|
10278
10425
|
if (!isOpen) return null;
|
|
10279
|
-
return /* @__PURE__ */
|
|
10426
|
+
return /* @__PURE__ */ jsx22(
|
|
10280
10427
|
"div",
|
|
10281
10428
|
{
|
|
10282
10429
|
className: "fixed inset-0 bg-slate-900/60 backdrop-blur-xs z-50 flex items-center justify-center p-4 overflow-y-auto animate-in fade-in duration-200",
|
|
10283
10430
|
dir: "rtl",
|
|
10284
|
-
children: /* @__PURE__ */
|
|
10431
|
+
children: /* @__PURE__ */ jsxs18(
|
|
10285
10432
|
"div",
|
|
10286
10433
|
{
|
|
10287
10434
|
className: "bg-white rounded-2xl border border-slate-200 shadow-2xl w-full max-w-2xl max-h-[92vh] flex flex-col overflow-hidden animate-in zoom-in-95 duration-150",
|
|
@@ -10289,43 +10436,43 @@ function CreateTemplateModal({
|
|
|
10289
10436
|
"aria-modal": "true",
|
|
10290
10437
|
"aria-labelledby": "modal-title",
|
|
10291
10438
|
children: [
|
|
10292
|
-
/* @__PURE__ */
|
|
10293
|
-
/* @__PURE__ */
|
|
10294
|
-
/* @__PURE__ */
|
|
10295
|
-
/* @__PURE__ */
|
|
10296
|
-
/* @__PURE__ */
|
|
10297
|
-
/* @__PURE__ */
|
|
10439
|
+
/* @__PURE__ */ jsxs18("div", { className: "px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
|
|
10440
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2.5", children: [
|
|
10441
|
+
/* @__PURE__ */ jsx22("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx22(Plus, { className: "w-4 h-4" }) }),
|
|
10442
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10443
|
+
/* @__PURE__ */ jsx22("h3", { id: "modal-title", className: "text-sm font-bold text-slate-900", children: "\u05D9\u05E6\u05D9\u05E8\u05EA \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4" }),
|
|
10444
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs text-slate-500", children: "\u05D4\u05D2\u05D3\u05E8\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta Cloud API" })
|
|
10298
10445
|
] })
|
|
10299
10446
|
] }),
|
|
10300
|
-
/* @__PURE__ */
|
|
10447
|
+
/* @__PURE__ */ jsx22(
|
|
10301
10448
|
"button",
|
|
10302
10449
|
{
|
|
10303
10450
|
type: "button",
|
|
10304
10451
|
onClick: onClose,
|
|
10305
10452
|
className: "p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-200/60 rounded-lg transition-colors cursor-pointer",
|
|
10306
10453
|
"aria-label": "\u05E1\u05D2\u05D5\u05E8",
|
|
10307
|
-
children: /* @__PURE__ */
|
|
10454
|
+
children: /* @__PURE__ */ jsx22(X9, { className: "w-5 h-5" })
|
|
10308
10455
|
}
|
|
10309
10456
|
)
|
|
10310
10457
|
] }),
|
|
10311
|
-
/* @__PURE__ */
|
|
10312
|
-
/* @__PURE__ */
|
|
10313
|
-
submitError && /* @__PURE__ */
|
|
10314
|
-
/* @__PURE__ */
|
|
10315
|
-
/* @__PURE__ */
|
|
10458
|
+
/* @__PURE__ */ jsxs18("form", { onSubmit: handleSubmit, className: "flex flex-col overflow-hidden flex-1", children: [
|
|
10459
|
+
/* @__PURE__ */ jsxs18("div", { className: "p-6 overflow-y-auto space-y-5 flex-1", children: [
|
|
10460
|
+
submitError && /* @__PURE__ */ jsxs18("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-800 flex items-center gap-2", children: [
|
|
10461
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
|
|
10462
|
+
/* @__PURE__ */ jsx22("span", { children: submitError })
|
|
10316
10463
|
] }),
|
|
10317
|
-
/* @__PURE__ */
|
|
10318
|
-
/* @__PURE__ */
|
|
10319
|
-
/* @__PURE__ */
|
|
10464
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
|
|
10465
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
|
|
10466
|
+
/* @__PURE__ */ jsxs18("label", { className: "block text-xs font-bold text-slate-800", children: [
|
|
10320
10467
|
"\u05E9\u05DD \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4 ",
|
|
10321
|
-
/* @__PURE__ */
|
|
10468
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10322
10469
|
] }),
|
|
10323
|
-
templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */
|
|
10324
|
-
/* @__PURE__ */
|
|
10470
|
+
templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */ jsxs18("span", { className: "text-[11px] text-emerald-600 font-semibold flex items-center gap-1", children: [
|
|
10471
|
+
/* @__PURE__ */ jsx22(CheckCircle22, { className: "w-3.5 h-3.5" }),
|
|
10325
10472
|
" \u05E9\u05DD \u05EA\u05E7\u05D9\u05DF"
|
|
10326
10473
|
] })
|
|
10327
10474
|
] }),
|
|
10328
|
-
/* @__PURE__ */
|
|
10475
|
+
/* @__PURE__ */ jsx22(
|
|
10329
10476
|
"input",
|
|
10330
10477
|
{
|
|
10331
10478
|
type: "text",
|
|
@@ -10337,47 +10484,47 @@ function CreateTemplateModal({
|
|
|
10337
10484
|
required: true
|
|
10338
10485
|
}
|
|
10339
10486
|
),
|
|
10340
|
-
/* @__PURE__ */
|
|
10341
|
-
!isNameEmpty && isNameDuplicate && /* @__PURE__ */
|
|
10342
|
-
/* @__PURE__ */
|
|
10487
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400 mt-1", children: "\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05E7\u05D8\u05E0\u05D5\u05EA \u05D1\u05D0\u05E0\u05D2\u05DC\u05D9\u05EA, \u05DE\u05E1\u05E4\u05E8\u05D9\u05DD \u05D5\u05E7\u05D5\u05D5\u05D9\u05DD \u05EA\u05D7\u05EA\u05D5\u05E0\u05D9\u05DD \u05D1\u05DC\u05D1\u05D3." }),
|
|
10488
|
+
!isNameEmpty && isNameDuplicate && /* @__PURE__ */ jsxs18("p", { className: "text-[11px] text-rose-600 font-semibold flex items-center gap-1 mt-1", children: [
|
|
10489
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "w-3.5 h-3.5 shrink-0" }),
|
|
10343
10490
|
"\u05E9\u05DD \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA \u05DB\u05D1\u05E8 \u05E7\u05D9\u05D9\u05DD \u05D1\u05D7\u05E9\u05D1\u05D5\u05DF \u05E2\u05D1\u05D5\u05E8 \u05E9\u05E4\u05D4 \u05D6\u05D5 (",
|
|
10344
10491
|
language,
|
|
10345
10492
|
"). \u05D0\u05E0\u05D0 \u05D1\u05D7\u05E8 \u05E9\u05DD \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05D0\u05D5 \u05E9\u05E4\u05D4 \u05D0\u05D7\u05E8\u05EA."
|
|
10346
10493
|
] })
|
|
10347
10494
|
] }),
|
|
10348
|
-
/* @__PURE__ */
|
|
10349
|
-
/* @__PURE__ */
|
|
10350
|
-
/* @__PURE__ */
|
|
10351
|
-
/* @__PURE__ */
|
|
10495
|
+
/* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
10496
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
|
|
10497
|
+
/* @__PURE__ */ jsx22("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E9\u05E4\u05D4" }),
|
|
10498
|
+
/* @__PURE__ */ jsx22(
|
|
10352
10499
|
"select",
|
|
10353
10500
|
{
|
|
10354
10501
|
value: language,
|
|
10355
10502
|
onChange: (e) => setLanguage(e.target.value),
|
|
10356
10503
|
className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
|
|
10357
|
-
children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */
|
|
10504
|
+
children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */ jsx22("option", { value: opt.value, children: opt.label }, opt.value))
|
|
10358
10505
|
}
|
|
10359
10506
|
)
|
|
10360
10507
|
] }),
|
|
10361
|
-
/* @__PURE__ */
|
|
10362
|
-
/* @__PURE__ */
|
|
10363
|
-
/* @__PURE__ */
|
|
10508
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
|
|
10509
|
+
/* @__PURE__ */ jsx22("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4" }),
|
|
10510
|
+
/* @__PURE__ */ jsx22(
|
|
10364
10511
|
"select",
|
|
10365
10512
|
{
|
|
10366
10513
|
value: category,
|
|
10367
10514
|
onChange: (e) => setCategory(e.target.value),
|
|
10368
10515
|
className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
|
|
10369
|
-
children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */
|
|
10516
|
+
children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */ jsx22("option", { value: opt.value, children: opt.label }, opt.value))
|
|
10370
10517
|
}
|
|
10371
10518
|
)
|
|
10372
10519
|
] })
|
|
10373
10520
|
] }),
|
|
10374
|
-
/* @__PURE__ */
|
|
10375
|
-
/* @__PURE__ */
|
|
10521
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
|
|
10522
|
+
/* @__PURE__ */ jsxs18("label", { className: "block text-xs font-bold text-slate-800", children: [
|
|
10376
10523
|
"\u05EA\u05D5\u05DB\u05DF \u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 ",
|
|
10377
|
-
/* @__PURE__ */
|
|
10524
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10378
10525
|
] }),
|
|
10379
|
-
/* @__PURE__ */
|
|
10380
|
-
/* @__PURE__ */
|
|
10526
|
+
/* @__PURE__ */ jsxs18("div", { className: "border border-slate-200 focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500 rounded-xl overflow-visible bg-white transition-all shadow-xs relative", children: [
|
|
10527
|
+
/* @__PURE__ */ jsx22(
|
|
10381
10528
|
"textarea",
|
|
10382
10529
|
{
|
|
10383
10530
|
ref: textareaRef,
|
|
@@ -10392,14 +10539,14 @@ function CreateTemplateModal({
|
|
|
10392
10539
|
required: true
|
|
10393
10540
|
}
|
|
10394
10541
|
),
|
|
10395
|
-
/* @__PURE__ */
|
|
10542
|
+
/* @__PURE__ */ jsxs18(
|
|
10396
10543
|
"div",
|
|
10397
10544
|
{
|
|
10398
10545
|
className: "bg-slate-50/90 border-t border-slate-100 px-3 py-1.5 flex items-center justify-between gap-2 select-none relative",
|
|
10399
10546
|
dir: language === "en_US" ? "ltr" : "rtl",
|
|
10400
10547
|
children: [
|
|
10401
|
-
/* @__PURE__ */
|
|
10402
|
-
/* @__PURE__ */
|
|
10548
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1", children: [
|
|
10549
|
+
/* @__PURE__ */ jsx22(
|
|
10403
10550
|
"button",
|
|
10404
10551
|
{
|
|
10405
10552
|
type: "button",
|
|
@@ -10407,10 +10554,10 @@ function CreateTemplateModal({
|
|
|
10407
10554
|
onClick: () => handleApplyFormatting("*"),
|
|
10408
10555
|
title: "\u05DE\u05D5\u05D3\u05D2\u05E9 (Bold) *\u05D8\u05E7\u05E1\u05D8*",
|
|
10409
10556
|
className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center font-bold text-xs transition-colors cursor-pointer",
|
|
10410
|
-
children: /* @__PURE__ */
|
|
10557
|
+
children: /* @__PURE__ */ jsx22(Bold, { className: "w-3.5 h-3.5" })
|
|
10411
10558
|
}
|
|
10412
10559
|
),
|
|
10413
|
-
/* @__PURE__ */
|
|
10560
|
+
/* @__PURE__ */ jsx22(
|
|
10414
10561
|
"button",
|
|
10415
10562
|
{
|
|
10416
10563
|
type: "button",
|
|
@@ -10418,10 +10565,10 @@ function CreateTemplateModal({
|
|
|
10418
10565
|
onClick: () => handleApplyFormatting("_"),
|
|
10419
10566
|
title: "\u05E0\u05D8\u05D5\u05D9 (Italic) _\u05D8\u05E7\u05E1\u05D8_",
|
|
10420
10567
|
className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center italic text-xs transition-colors cursor-pointer",
|
|
10421
|
-
children: /* @__PURE__ */
|
|
10568
|
+
children: /* @__PURE__ */ jsx22(Italic, { className: "w-3.5 h-3.5" })
|
|
10422
10569
|
}
|
|
10423
10570
|
),
|
|
10424
|
-
/* @__PURE__ */
|
|
10571
|
+
/* @__PURE__ */ jsx22(
|
|
10425
10572
|
"button",
|
|
10426
10573
|
{
|
|
10427
10574
|
type: "button",
|
|
@@ -10429,12 +10576,12 @@ function CreateTemplateModal({
|
|
|
10429
10576
|
onClick: () => handleApplyFormatting("~"),
|
|
10430
10577
|
title: "\u05E7\u05D5 \u05D7\u05D5\u05E6\u05D4 (Strikethrough) ~\u05D8\u05E7\u05E1\u05D8~",
|
|
10431
10578
|
className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center text-xs transition-colors cursor-pointer",
|
|
10432
|
-
children: /* @__PURE__ */
|
|
10579
|
+
children: /* @__PURE__ */ jsx22(Strikethrough, { className: "w-3.5 h-3.5" })
|
|
10433
10580
|
}
|
|
10434
10581
|
),
|
|
10435
|
-
/* @__PURE__ */
|
|
10436
|
-
/* @__PURE__ */
|
|
10437
|
-
/* @__PURE__ */
|
|
10582
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
|
|
10583
|
+
/* @__PURE__ */ jsxs18("div", { className: "relative inline-block", ref: emojiPickerRef, children: [
|
|
10584
|
+
/* @__PURE__ */ jsx22(
|
|
10438
10585
|
"button",
|
|
10439
10586
|
{
|
|
10440
10587
|
type: "button",
|
|
@@ -10442,16 +10589,16 @@ function CreateTemplateModal({
|
|
|
10442
10589
|
onClick: () => setIsEmojiPickerOpen(!isEmojiPickerOpen),
|
|
10443
10590
|
title: "\u05D4\u05D5\u05E1\u05E3 \u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9 (Emoji)",
|
|
10444
10591
|
className: `w-7 h-7 rounded-lg flex items-center justify-center transition-colors cursor-pointer ${isEmojiPickerOpen ? "bg-emerald-100 text-emerald-700" : "text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80"}`,
|
|
10445
|
-
children: /* @__PURE__ */
|
|
10592
|
+
children: /* @__PURE__ */ jsx22(Smile, { className: "w-4 h-4" })
|
|
10446
10593
|
}
|
|
10447
10594
|
),
|
|
10448
|
-
isEmojiPickerOpen && /* @__PURE__ */
|
|
10595
|
+
isEmojiPickerOpen && /* @__PURE__ */ jsx22(
|
|
10449
10596
|
"div",
|
|
10450
10597
|
{
|
|
10451
10598
|
className: `absolute bottom-full mb-2 ${language === "en_US" ? "left-0" : "right-0"} z-50 shadow-2xl rounded-2xl overflow-hidden border border-slate-200 animate-in fade-in zoom-in-95 duration-100`,
|
|
10452
10599
|
dir: "ltr",
|
|
10453
10600
|
onMouseDown: (e) => e.stopPropagation(),
|
|
10454
|
-
children: /* @__PURE__ */
|
|
10601
|
+
children: /* @__PURE__ */ jsx22(
|
|
10455
10602
|
EmojiPicker,
|
|
10456
10603
|
{
|
|
10457
10604
|
onEmojiClick: (emojiData) => {
|
|
@@ -10468,8 +10615,8 @@ function CreateTemplateModal({
|
|
|
10468
10615
|
}
|
|
10469
10616
|
)
|
|
10470
10617
|
] }),
|
|
10471
|
-
/* @__PURE__ */
|
|
10472
|
-
/* @__PURE__ */
|
|
10618
|
+
/* @__PURE__ */ jsx22("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
|
|
10619
|
+
/* @__PURE__ */ jsxs18(
|
|
10473
10620
|
"button",
|
|
10474
10621
|
{
|
|
10475
10622
|
type: "button",
|
|
@@ -10479,28 +10626,28 @@ function CreateTemplateModal({
|
|
|
10479
10626
|
"aria-label": language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4",
|
|
10480
10627
|
className: "h-7 px-2 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center gap-1 text-xs font-medium transition-colors cursor-pointer",
|
|
10481
10628
|
children: [
|
|
10482
|
-
/* @__PURE__ */
|
|
10483
|
-
/* @__PURE__ */
|
|
10629
|
+
/* @__PURE__ */ jsx22(Plus, { className: "w-3.5 h-3.5" }),
|
|
10630
|
+
/* @__PURE__ */ jsx22("span", { children: language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4" })
|
|
10484
10631
|
]
|
|
10485
10632
|
}
|
|
10486
10633
|
)
|
|
10487
10634
|
] }),
|
|
10488
|
-
/* @__PURE__ */
|
|
10635
|
+
/* @__PURE__ */ jsxs18(
|
|
10489
10636
|
"div",
|
|
10490
10637
|
{
|
|
10491
10638
|
className: "flex items-center gap-1 font-mono text-[11px]",
|
|
10492
10639
|
dir: "ltr",
|
|
10493
10640
|
title: "\u05DE\u05D2\u05D1\u05DC\u05EA \u05EA\u05D5\u05D5\u05D9\u05DD (1024 \u05EA\u05D5\u05D5\u05D9\u05DD \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8)",
|
|
10494
10641
|
children: [
|
|
10495
|
-
/* @__PURE__ */
|
|
10642
|
+
/* @__PURE__ */ jsx22(
|
|
10496
10643
|
"span",
|
|
10497
10644
|
{
|
|
10498
10645
|
className: `font-semibold transition-colors ${bodyText.length >= 1024 ? "text-rose-600" : bodyText.length >= 950 ? "text-amber-600" : "text-slate-500"}`,
|
|
10499
10646
|
children: bodyText.length
|
|
10500
10647
|
}
|
|
10501
10648
|
),
|
|
10502
|
-
/* @__PURE__ */
|
|
10503
|
-
/* @__PURE__ */
|
|
10649
|
+
/* @__PURE__ */ jsx22("span", { className: "text-slate-300", children: "/" }),
|
|
10650
|
+
/* @__PURE__ */ jsx22("span", { className: "text-slate-400", children: "1024" })
|
|
10504
10651
|
]
|
|
10505
10652
|
}
|
|
10506
10653
|
)
|
|
@@ -10508,30 +10655,30 @@ function CreateTemplateModal({
|
|
|
10508
10655
|
}
|
|
10509
10656
|
)
|
|
10510
10657
|
] }),
|
|
10511
|
-
/* @__PURE__ */
|
|
10512
|
-
/* @__PURE__ */
|
|
10658
|
+
/* @__PURE__ */ jsx22("div", { className: "flex flex-wrap items-center justify-between text-[11px] text-slate-400 px-1 gap-2", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3", children: [
|
|
10659
|
+
/* @__PURE__ */ jsxs18("span", { children: [
|
|
10513
10660
|
ratioInfo.staticWordsCount,
|
|
10514
10661
|
" \u05DE\u05D9\u05DC\u05D9\u05DD"
|
|
10515
10662
|
] }),
|
|
10516
|
-
/* @__PURE__ */
|
|
10663
|
+
/* @__PURE__ */ jsxs18("span", { children: [
|
|
10517
10664
|
ratioInfo.variableCount,
|
|
10518
10665
|
" \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
|
|
10519
10666
|
] })
|
|
10520
10667
|
] }) }),
|
|
10521
|
-
uniqueVariables.length > 0 && /* @__PURE__ */
|
|
10522
|
-
/* @__PURE__ */
|
|
10523
|
-
/* @__PURE__ */
|
|
10524
|
-
/* @__PURE__ */
|
|
10668
|
+
uniqueVariables.length > 0 && /* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
|
|
10669
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 text-xs font-bold text-slate-800", children: [
|
|
10670
|
+
/* @__PURE__ */ jsx22(Info2, { className: "w-4 h-4 text-emerald-600" }),
|
|
10671
|
+
/* @__PURE__ */ jsx22("span", { children: "\u05E2\u05E8\u05DB\u05D9\u05DD \u05DC\u05D3\u05D5\u05D2\u05DE\u05D4 \u05DC\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD (\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta)" })
|
|
10525
10672
|
] }),
|
|
10526
|
-
/* @__PURE__ */
|
|
10527
|
-
/* @__PURE__ */
|
|
10528
|
-
/* @__PURE__ */
|
|
10673
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[11px] text-slate-500 leading-relaxed", children: "Meta \u05D3\u05D5\u05E8\u05E9\u05EA \u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 \u05DB\u05DC \u05DE\u05E9\u05EA\u05E0\u05D4 \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05DB\u05D3\u05D9 \u05DC\u05D5\u05D5\u05D3\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF." }),
|
|
10674
|
+
/* @__PURE__ */ jsx22("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1", children: uniqueVariables.map((idx) => /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
10675
|
+
/* @__PURE__ */ jsxs18("label", { className: "block text-[11px] font-semibold text-slate-700 font-mono", children: [
|
|
10529
10676
|
"\u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 ",
|
|
10530
10677
|
`{{${idx}}}`,
|
|
10531
10678
|
" ",
|
|
10532
|
-
/* @__PURE__ */
|
|
10679
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10533
10680
|
] }),
|
|
10534
|
-
/* @__PURE__ */
|
|
10681
|
+
/* @__PURE__ */ jsx22(
|
|
10535
10682
|
"input",
|
|
10536
10683
|
{
|
|
10537
10684
|
type: "text",
|
|
@@ -10546,21 +10693,21 @@ function CreateTemplateModal({
|
|
|
10546
10693
|
)
|
|
10547
10694
|
] }, idx)) })
|
|
10548
10695
|
] }),
|
|
10549
|
-
bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */
|
|
10550
|
-
/* @__PURE__ */
|
|
10551
|
-
/* @__PURE__ */
|
|
10552
|
-
/* @__PURE__ */
|
|
10696
|
+
bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */ jsxs18("div", { className: "p-3.5 bg-amber-50 border border-amber-200 rounded-xl space-y-1.5 text-xs text-amber-900", children: [
|
|
10697
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 font-bold", children: [
|
|
10698
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-amber-600 shrink-0" }),
|
|
10699
|
+
/* @__PURE__ */ jsx22("span", { children: "\u05D3\u05E8\u05D9\u05E9\u05D5\u05EA \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA Meta \u05DC\u05D7\u05E1\u05D9\u05DE\u05EA \u05E9\u05D2\u05D9\u05D0\u05D5\u05EA:" })
|
|
10553
10700
|
] }),
|
|
10554
|
-
/* @__PURE__ */
|
|
10701
|
+
/* @__PURE__ */ jsx22("ul", { className: "list-disc list-inside space-y-1 text-[11px] pr-2 leading-relaxed", children: validationResult.errors.map((err, i) => /* @__PURE__ */ jsx22("li", { children: err }, i)) })
|
|
10555
10702
|
] })
|
|
10556
10703
|
] }),
|
|
10557
|
-
/* @__PURE__ */
|
|
10558
|
-
/* @__PURE__ */
|
|
10559
|
-
/* @__PURE__ */
|
|
10560
|
-
/* @__PURE__ */
|
|
10561
|
-
/* @__PURE__ */
|
|
10704
|
+
/* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
|
|
10705
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
|
|
10706
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
10707
|
+
/* @__PURE__ */ jsx22(Paperclip, { className: "w-4 h-4 text-slate-600" }),
|
|
10708
|
+
/* @__PURE__ */ jsx22("label", { htmlFor: "modalHeaderFileCheckbox", className: "text-xs font-bold text-slate-800 cursor-pointer", children: "\u05E7\u05D5\u05D1\u05E5 \u05DB\u05D5\u05EA\u05E8\u05EA \u05DE\u05E6\u05D5\u05E8\u05E3 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" })
|
|
10562
10709
|
] }),
|
|
10563
|
-
/* @__PURE__ */
|
|
10710
|
+
/* @__PURE__ */ jsx22(
|
|
10564
10711
|
"input",
|
|
10565
10712
|
{
|
|
10566
10713
|
type: "checkbox",
|
|
@@ -10576,12 +10723,12 @@ function CreateTemplateModal({
|
|
|
10576
10723
|
}
|
|
10577
10724
|
)
|
|
10578
10725
|
] }),
|
|
10579
|
-
hasFileHeader && /* @__PURE__ */
|
|
10580
|
-
fileError && /* @__PURE__ */
|
|
10581
|
-
/* @__PURE__ */
|
|
10582
|
-
/* @__PURE__ */
|
|
10726
|
+
hasFileHeader && /* @__PURE__ */ jsxs18("div", { className: "space-y-3 pt-1", children: [
|
|
10727
|
+
fileError && /* @__PURE__ */ jsxs18("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl flex items-center gap-2 text-xs text-rose-700 font-semibold animate-in fade-in duration-150", children: [
|
|
10728
|
+
/* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
|
|
10729
|
+
/* @__PURE__ */ jsx22("span", { children: fileError })
|
|
10583
10730
|
] }),
|
|
10584
|
-
/* @__PURE__ */
|
|
10731
|
+
/* @__PURE__ */ jsx22(
|
|
10585
10732
|
"input",
|
|
10586
10733
|
{
|
|
10587
10734
|
ref: fileInputRef,
|
|
@@ -10591,7 +10738,7 @@ function CreateTemplateModal({
|
|
|
10591
10738
|
className: "hidden"
|
|
10592
10739
|
}
|
|
10593
10740
|
),
|
|
10594
|
-
!selectedFile && /* @__PURE__ */
|
|
10741
|
+
!selectedFile && /* @__PURE__ */ jsxs18(
|
|
10595
10742
|
"button",
|
|
10596
10743
|
{
|
|
10597
10744
|
type: "button",
|
|
@@ -10601,49 +10748,49 @@ function CreateTemplateModal({
|
|
|
10601
10748
|
},
|
|
10602
10749
|
className: "w-full p-4 border-2 border-dashed border-slate-300 hover:border-emerald-500 rounded-xl flex flex-col items-center justify-center gap-2 bg-white hover:bg-emerald-50/30 transition-all cursor-pointer",
|
|
10603
10750
|
children: [
|
|
10604
|
-
/* @__PURE__ */
|
|
10605
|
-
/* @__PURE__ */
|
|
10606
|
-
/* @__PURE__ */
|
|
10607
|
-
/* @__PURE__ */
|
|
10751
|
+
/* @__PURE__ */ jsx22("div", { className: "w-9 h-9 rounded-full bg-slate-100 text-slate-500 flex items-center justify-center", children: /* @__PURE__ */ jsx22(Upload2, { className: "w-4 h-4" }) }),
|
|
10752
|
+
/* @__PURE__ */ jsxs18("div", { className: "text-center", children: [
|
|
10753
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs font-bold text-emerald-700 block", children: "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D7\u05D9\u05E8\u05EA \u05E7\u05D5\u05D1\u05E5" }),
|
|
10754
|
+
/* @__PURE__ */ jsx22("span", { className: "text-[10px] text-slate-400", children: "PDF, JPG, PNG, MP4 \u05E2\u05D3 5MB" })
|
|
10608
10755
|
] })
|
|
10609
10756
|
]
|
|
10610
10757
|
}
|
|
10611
10758
|
),
|
|
10612
|
-
selectedFile && /* @__PURE__ */
|
|
10613
|
-
/* @__PURE__ */
|
|
10614
|
-
/* @__PURE__ */
|
|
10615
|
-
/* @__PURE__ */
|
|
10616
|
-
/* @__PURE__ */
|
|
10617
|
-
/* @__PURE__ */
|
|
10759
|
+
selectedFile && /* @__PURE__ */ jsxs18("div", { className: "p-3 bg-white border border-emerald-200 rounded-xl flex items-center justify-between gap-3 shadow-2xs", children: [
|
|
10760
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2.5 overflow-hidden", children: [
|
|
10761
|
+
/* @__PURE__ */ jsx22("div", { className: "w-8 h-8 rounded-lg bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0", children: selectedFile.type.includes("pdf") || selectedFile.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx22(FileText2, { className: "w-4 h-4" }) : selectedFile.type.includes("video") || selectedFile.name.toLowerCase().match(/\.(mp4|mov|avi|webm)$/) ? /* @__PURE__ */ jsx22(Video, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx22(ImageIcon, { className: "w-4 h-4" }) }),
|
|
10762
|
+
/* @__PURE__ */ jsxs18("div", { className: "overflow-hidden", children: [
|
|
10763
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs font-bold text-slate-800 truncate", title: selectedFile.name, children: /* @__PURE__ */ jsx22("span", { dir: "ltr", className: "inline-block truncate max-w-full", children: selectedFile.name }) }),
|
|
10764
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400", children: /* @__PURE__ */ jsxs18("span", { dir: "ltr", className: "inline-block", children: [
|
|
10618
10765
|
formatFileSize(selectedFile.size),
|
|
10619
10766
|
selectedFile.type ? ` \u2022 ${selectedFile.type}` : ""
|
|
10620
10767
|
] }) })
|
|
10621
10768
|
] })
|
|
10622
10769
|
] }),
|
|
10623
|
-
/* @__PURE__ */
|
|
10770
|
+
/* @__PURE__ */ jsx22(
|
|
10624
10771
|
"button",
|
|
10625
10772
|
{
|
|
10626
10773
|
type: "button",
|
|
10627
10774
|
onClick: handleRemoveFile,
|
|
10628
10775
|
className: "p-1 text-slate-400 hover:text-rose-600 rounded-md transition-colors cursor-pointer",
|
|
10629
10776
|
title: "\u05D4\u05E1\u05E8 \u05E7\u05D5\u05D1\u05E5",
|
|
10630
|
-
children: /* @__PURE__ */
|
|
10777
|
+
children: /* @__PURE__ */ jsx22(Trash22, { className: "w-4 h-4" })
|
|
10631
10778
|
}
|
|
10632
10779
|
)
|
|
10633
10780
|
] })
|
|
10634
10781
|
] })
|
|
10635
10782
|
] }),
|
|
10636
|
-
/* @__PURE__ */
|
|
10637
|
-
/* @__PURE__ */
|
|
10638
|
-
/* @__PURE__ */
|
|
10639
|
-
/* @__PURE__ */
|
|
10640
|
-
/* @__PURE__ */
|
|
10641
|
-
/* @__PURE__ */
|
|
10642
|
-
/* @__PURE__ */
|
|
10783
|
+
/* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5", children: [
|
|
10784
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
|
|
10785
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
10786
|
+
/* @__PURE__ */ jsx22(MousePointerClick, { className: "w-4 h-4 text-slate-600" }),
|
|
10787
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10788
|
+
/* @__PURE__ */ jsx22("span", { className: "text-xs font-bold text-slate-800 block", children: "\u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD \u05D0\u05D9\u05E0\u05D8\u05E8\u05D0\u05E7\u05D8\u05D9\u05D1\u05D9\u05D9\u05DD (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" }),
|
|
10789
|
+
/* @__PURE__ */ jsx22("span", { className: "text-[10px] text-slate-400 block", children: "\u05D4\u05D5\u05E1\u05E4\u05EA \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9 \u05E7\u05E8\u05D9\u05D0\u05D4 \u05DC\u05E4\u05E2\u05D5\u05DC\u05D4 (CTA) \u05D5\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 (\u05E2\u05D3 10 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD)" })
|
|
10643
10790
|
] })
|
|
10644
10791
|
] }),
|
|
10645
|
-
/* @__PURE__ */
|
|
10646
|
-
/* @__PURE__ */
|
|
10792
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
10793
|
+
/* @__PURE__ */ jsxs18(
|
|
10647
10794
|
"span",
|
|
10648
10795
|
{
|
|
10649
10796
|
className: `text-[10px] font-mono px-2 py-0.5 rounded-full border ${buttons.length >= 10 ? "bg-amber-50 text-amber-700 border-amber-200 font-bold" : "bg-white text-slate-500 border-slate-200"}`,
|
|
@@ -10653,8 +10800,8 @@ function CreateTemplateModal({
|
|
|
10653
10800
|
]
|
|
10654
10801
|
}
|
|
10655
10802
|
),
|
|
10656
|
-
/* @__PURE__ */
|
|
10657
|
-
/* @__PURE__ */
|
|
10803
|
+
/* @__PURE__ */ jsxs18("div", { className: "relative", ref: addButtonDropdownRef, children: [
|
|
10804
|
+
/* @__PURE__ */ jsxs18(
|
|
10658
10805
|
"button",
|
|
10659
10806
|
{
|
|
10660
10807
|
type: "button",
|
|
@@ -10663,9 +10810,9 @@ function CreateTemplateModal({
|
|
|
10663
10810
|
className: `inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold rounded-xl border transition-all ${buttons.length >= 10 ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60" : "bg-white text-emerald-700 border-emerald-200 hover:bg-emerald-50/80 active:scale-[0.98] shadow-2xs cursor-pointer"}`,
|
|
10664
10811
|
title: buttons.length >= 10 ? "\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05D4\u05DE\u05E8\u05D1\u05D9\u05EA \u05E9\u05DC 10 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD" : "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8 \u05D7\u05D3\u05E9",
|
|
10665
10812
|
children: [
|
|
10666
|
-
/* @__PURE__ */
|
|
10667
|
-
/* @__PURE__ */
|
|
10668
|
-
/* @__PURE__ */
|
|
10813
|
+
/* @__PURE__ */ jsx22(Plus, { className: "w-3.5 h-3.5" }),
|
|
10814
|
+
/* @__PURE__ */ jsx22("span", { children: "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" }),
|
|
10815
|
+
/* @__PURE__ */ jsx22(
|
|
10669
10816
|
ChevronDown3,
|
|
10670
10817
|
{
|
|
10671
10818
|
className: `w-3.5 h-3.5 transition-transform ${isAddButtonOpen ? "rotate-180" : ""}`
|
|
@@ -10674,63 +10821,63 @@ function CreateTemplateModal({
|
|
|
10674
10821
|
]
|
|
10675
10822
|
}
|
|
10676
10823
|
),
|
|
10677
|
-
isAddButtonOpen && /* @__PURE__ */
|
|
10678
|
-
/* @__PURE__ */
|
|
10824
|
+
isAddButtonOpen && /* @__PURE__ */ jsxs18("div", { className: "absolute top-full left-0 mt-1.5 w-64 bg-white border border-slate-200 rounded-xl shadow-xl z-30 p-1.5 space-y-1 animate-in fade-in-50 zoom-in-95 duration-100 divide-y divide-slate-100", children: [
|
|
10825
|
+
/* @__PURE__ */ jsxs18(
|
|
10679
10826
|
"button",
|
|
10680
10827
|
{
|
|
10681
10828
|
type: "button",
|
|
10682
10829
|
onClick: () => handleAddButton("QUICK_REPLY"),
|
|
10683
10830
|
className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group",
|
|
10684
10831
|
children: [
|
|
10685
|
-
/* @__PURE__ */
|
|
10686
|
-
/* @__PURE__ */
|
|
10687
|
-
/* @__PURE__ */
|
|
10688
|
-
/* @__PURE__ */
|
|
10832
|
+
/* @__PURE__ */ jsx22("div", { className: "w-7 h-7 rounded-md bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-emerald-100", children: /* @__PURE__ */ jsx22(MessageSquare, { className: "w-3.5 h-3.5" }) }),
|
|
10833
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10834
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" }),
|
|
10835
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05DE\u05E2\u05E0\u05D4 \u05DE\u05D4\u05D9\u05E8 \u05D1\u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05D7\u05EA" })
|
|
10689
10836
|
] })
|
|
10690
10837
|
]
|
|
10691
10838
|
}
|
|
10692
10839
|
),
|
|
10693
|
-
/* @__PURE__ */
|
|
10840
|
+
/* @__PURE__ */ jsxs18(
|
|
10694
10841
|
"button",
|
|
10695
10842
|
{
|
|
10696
10843
|
type: "button",
|
|
10697
10844
|
onClick: () => handleAddButton("URL"),
|
|
10698
10845
|
className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
|
|
10699
10846
|
children: [
|
|
10700
|
-
/* @__PURE__ */
|
|
10701
|
-
/* @__PURE__ */
|
|
10702
|
-
/* @__PURE__ */
|
|
10703
|
-
/* @__PURE__ */
|
|
10847
|
+
/* @__PURE__ */ jsx22("div", { className: "w-7 h-7 rounded-md bg-sky-50 text-sky-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-sky-100", children: /* @__PURE__ */ jsx22(ExternalLink3, { className: "w-3.5 h-3.5" }) }),
|
|
10848
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10849
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" }),
|
|
10850
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05E7\u05D9\u05E9\u05D5\u05E8 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8 \u05E1\u05D8\u05D8\u05D9" })
|
|
10704
10851
|
] })
|
|
10705
10852
|
]
|
|
10706
10853
|
}
|
|
10707
10854
|
),
|
|
10708
|
-
/* @__PURE__ */
|
|
10855
|
+
/* @__PURE__ */ jsxs18(
|
|
10709
10856
|
"button",
|
|
10710
10857
|
{
|
|
10711
10858
|
type: "button",
|
|
10712
10859
|
onClick: () => handleAddButton("PHONE_NUMBER"),
|
|
10713
10860
|
className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
|
|
10714
10861
|
children: [
|
|
10715
|
-
/* @__PURE__ */
|
|
10716
|
-
/* @__PURE__ */
|
|
10717
|
-
/* @__PURE__ */
|
|
10718
|
-
/* @__PURE__ */
|
|
10862
|
+
/* @__PURE__ */ jsx22("div", { className: "w-7 h-7 rounded-md bg-violet-50 text-violet-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-violet-100", children: /* @__PURE__ */ jsx22(Phone, { className: "w-3.5 h-3.5" }) }),
|
|
10863
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10864
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" }),
|
|
10865
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D7\u05D9\u05D5\u05D2 \u05D9\u05E9\u05D9\u05E8 \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF" })
|
|
10719
10866
|
] })
|
|
10720
10867
|
]
|
|
10721
10868
|
}
|
|
10722
10869
|
),
|
|
10723
|
-
/* @__PURE__ */
|
|
10870
|
+
/* @__PURE__ */ jsxs18(
|
|
10724
10871
|
"button",
|
|
10725
10872
|
{
|
|
10726
10873
|
type: "button",
|
|
10727
10874
|
onClick: () => handleAddButton("COPY_CODE"),
|
|
10728
10875
|
className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
|
|
10729
10876
|
children: [
|
|
10730
|
-
/* @__PURE__ */
|
|
10731
|
-
/* @__PURE__ */
|
|
10732
|
-
/* @__PURE__ */
|
|
10733
|
-
/* @__PURE__ */
|
|
10877
|
+
/* @__PURE__ */ jsx22("div", { className: "w-7 h-7 rounded-md bg-amber-50 text-amber-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-amber-100", children: /* @__PURE__ */ jsx22(Copy3, { className: "w-3.5 h-3.5" }) }),
|
|
10878
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
10879
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" }),
|
|
10880
|
+
/* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3 \u05E7\u05D5\u05E4\u05D5\u05DF \u05DC\u05DC\u05D5\u05D7" })
|
|
10734
10881
|
] })
|
|
10735
10882
|
]
|
|
10736
10883
|
}
|
|
@@ -10739,55 +10886,55 @@ function CreateTemplateModal({
|
|
|
10739
10886
|
] })
|
|
10740
10887
|
] })
|
|
10741
10888
|
] }),
|
|
10742
|
-
buttons.length === 0 && /* @__PURE__ */
|
|
10743
|
-
buttons.length > 0 && /* @__PURE__ */
|
|
10889
|
+
buttons.length === 0 && /* @__PURE__ */ jsx22("div", { className: "p-3 text-center border border-dashed border-slate-200 rounded-lg text-slate-400 text-xs bg-white/60", children: '\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" \u05DB\u05D3\u05D9 \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8 \u05E8\u05D0\u05E9\u05D5\u05DF \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA.' }),
|
|
10890
|
+
buttons.length > 0 && /* @__PURE__ */ jsx22("div", { className: "space-y-2.5", children: buttons.map((btn, index) => {
|
|
10744
10891
|
const btnNum = index + 1;
|
|
10745
|
-
return /* @__PURE__ */
|
|
10892
|
+
return /* @__PURE__ */ jsxs18(
|
|
10746
10893
|
"div",
|
|
10747
10894
|
{
|
|
10748
10895
|
className: "p-3 bg-white border border-slate-200 rounded-xl space-y-2.5 shadow-2xs transition-all hover:border-slate-300",
|
|
10749
10896
|
children: [
|
|
10750
|
-
/* @__PURE__ */
|
|
10751
|
-
/* @__PURE__ */
|
|
10752
|
-
/* @__PURE__ */
|
|
10897
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
|
|
10898
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
10899
|
+
/* @__PURE__ */ jsxs18("span", { className: "text-[11px] font-bold text-slate-400 font-mono", children: [
|
|
10753
10900
|
"#",
|
|
10754
10901
|
btnNum
|
|
10755
10902
|
] }),
|
|
10756
|
-
btn.type === "QUICK_REPLY" && /* @__PURE__ */
|
|
10757
|
-
/* @__PURE__ */
|
|
10758
|
-
/* @__PURE__ */
|
|
10903
|
+
btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-700 border border-emerald-200 text-[10px] font-semibold", children: [
|
|
10904
|
+
/* @__PURE__ */ jsx22(MessageSquare, { className: "w-3 h-3" }),
|
|
10905
|
+
/* @__PURE__ */ jsx22("span", { children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" })
|
|
10759
10906
|
] }),
|
|
10760
|
-
btn.type === "URL" && /* @__PURE__ */
|
|
10761
|
-
/* @__PURE__ */
|
|
10762
|
-
/* @__PURE__ */
|
|
10907
|
+
btn.type === "URL" && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-sky-50 text-sky-700 border border-sky-200 text-[10px] font-semibold", children: [
|
|
10908
|
+
/* @__PURE__ */ jsx22(ExternalLink3, { className: "w-3 h-3" }),
|
|
10909
|
+
/* @__PURE__ */ jsx22("span", { children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" })
|
|
10763
10910
|
] }),
|
|
10764
|
-
btn.type === "PHONE_NUMBER" && /* @__PURE__ */
|
|
10765
|
-
/* @__PURE__ */
|
|
10766
|
-
/* @__PURE__ */
|
|
10911
|
+
btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-violet-50 text-violet-700 border border-violet-200 text-[10px] font-semibold", children: [
|
|
10912
|
+
/* @__PURE__ */ jsx22(Phone, { className: "w-3 h-3" }),
|
|
10913
|
+
/* @__PURE__ */ jsx22("span", { children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" })
|
|
10767
10914
|
] }),
|
|
10768
|
-
btn.type === "COPY_CODE" && /* @__PURE__ */
|
|
10769
|
-
/* @__PURE__ */
|
|
10770
|
-
/* @__PURE__ */
|
|
10915
|
+
btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-amber-50 text-amber-700 border border-amber-200 text-[10px] font-semibold", children: [
|
|
10916
|
+
/* @__PURE__ */ jsx22(Copy3, { className: "w-3 h-3" }),
|
|
10917
|
+
/* @__PURE__ */ jsx22("span", { children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" })
|
|
10771
10918
|
] })
|
|
10772
10919
|
] }),
|
|
10773
|
-
/* @__PURE__ */
|
|
10920
|
+
/* @__PURE__ */ jsx22(
|
|
10774
10921
|
"button",
|
|
10775
10922
|
{
|
|
10776
10923
|
type: "button",
|
|
10777
10924
|
onClick: () => handleRemoveButton(index),
|
|
10778
10925
|
className: "p-1 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-lg transition-colors cursor-pointer",
|
|
10779
10926
|
title: "\u05D4\u05E1\u05E8 \u05DB\u05E4\u05EA\u05D5\u05E8",
|
|
10780
|
-
children: /* @__PURE__ */
|
|
10927
|
+
children: /* @__PURE__ */ jsx22(Trash22, { className: "w-3.5 h-3.5" })
|
|
10781
10928
|
}
|
|
10782
10929
|
)
|
|
10783
10930
|
] }),
|
|
10784
|
-
btn.type === "QUICK_REPLY" && /* @__PURE__ */
|
|
10785
|
-
/* @__PURE__ */
|
|
10786
|
-
/* @__PURE__ */
|
|
10931
|
+
btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
10932
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
10933
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10787
10934
|
"\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
|
|
10788
|
-
/* @__PURE__ */
|
|
10935
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10789
10936
|
] }),
|
|
10790
|
-
/* @__PURE__ */
|
|
10937
|
+
/* @__PURE__ */ jsxs18(
|
|
10791
10938
|
"span",
|
|
10792
10939
|
{
|
|
10793
10940
|
className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
|
|
@@ -10798,7 +10945,7 @@ function CreateTemplateModal({
|
|
|
10798
10945
|
}
|
|
10799
10946
|
)
|
|
10800
10947
|
] }),
|
|
10801
|
-
/* @__PURE__ */
|
|
10948
|
+
/* @__PURE__ */ jsx22(
|
|
10802
10949
|
"input",
|
|
10803
10950
|
{
|
|
10804
10951
|
type: "text",
|
|
@@ -10810,14 +10957,14 @@ function CreateTemplateModal({
|
|
|
10810
10957
|
}
|
|
10811
10958
|
)
|
|
10812
10959
|
] }),
|
|
10813
|
-
btn.type === "URL" && /* @__PURE__ */
|
|
10814
|
-
/* @__PURE__ */
|
|
10815
|
-
/* @__PURE__ */
|
|
10816
|
-
/* @__PURE__ */
|
|
10960
|
+
btn.type === "URL" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
|
|
10961
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
10962
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
10963
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10817
10964
|
"\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
|
|
10818
|
-
/* @__PURE__ */
|
|
10965
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10819
10966
|
] }),
|
|
10820
|
-
/* @__PURE__ */
|
|
10967
|
+
/* @__PURE__ */ jsxs18(
|
|
10821
10968
|
"span",
|
|
10822
10969
|
{
|
|
10823
10970
|
className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
|
|
@@ -10828,7 +10975,7 @@ function CreateTemplateModal({
|
|
|
10828
10975
|
}
|
|
10829
10976
|
)
|
|
10830
10977
|
] }),
|
|
10831
|
-
/* @__PURE__ */
|
|
10978
|
+
/* @__PURE__ */ jsx22(
|
|
10832
10979
|
"input",
|
|
10833
10980
|
{
|
|
10834
10981
|
type: "text",
|
|
@@ -10840,18 +10987,18 @@ function CreateTemplateModal({
|
|
|
10840
10987
|
}
|
|
10841
10988
|
)
|
|
10842
10989
|
] }),
|
|
10843
|
-
/* @__PURE__ */
|
|
10844
|
-
/* @__PURE__ */
|
|
10845
|
-
/* @__PURE__ */
|
|
10990
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
10991
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
10992
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10846
10993
|
"\u05DB\u05EA\u05D5\u05D1\u05EA URL \u05E1\u05D8\u05D8\u05D9\u05EA ",
|
|
10847
|
-
/* @__PURE__ */
|
|
10994
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10848
10995
|
] }),
|
|
10849
|
-
/* @__PURE__ */
|
|
10996
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
|
|
10850
10997
|
(btn.url || "").length,
|
|
10851
10998
|
"/2000"
|
|
10852
10999
|
] })
|
|
10853
11000
|
] }),
|
|
10854
|
-
/* @__PURE__ */
|
|
11001
|
+
/* @__PURE__ */ jsx22(
|
|
10855
11002
|
"input",
|
|
10856
11003
|
{
|
|
10857
11004
|
type: "url",
|
|
@@ -10865,14 +11012,14 @@ function CreateTemplateModal({
|
|
|
10865
11012
|
)
|
|
10866
11013
|
] })
|
|
10867
11014
|
] }),
|
|
10868
|
-
btn.type === "PHONE_NUMBER" && /* @__PURE__ */
|
|
10869
|
-
/* @__PURE__ */
|
|
10870
|
-
/* @__PURE__ */
|
|
10871
|
-
/* @__PURE__ */
|
|
11015
|
+
btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
|
|
11016
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
11017
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
11018
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10872
11019
|
"\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
|
|
10873
|
-
/* @__PURE__ */
|
|
11020
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10874
11021
|
] }),
|
|
10875
|
-
/* @__PURE__ */
|
|
11022
|
+
/* @__PURE__ */ jsxs18(
|
|
10876
11023
|
"span",
|
|
10877
11024
|
{
|
|
10878
11025
|
className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
|
|
@@ -10883,7 +11030,7 @@ function CreateTemplateModal({
|
|
|
10883
11030
|
}
|
|
10884
11031
|
)
|
|
10885
11032
|
] }),
|
|
10886
|
-
/* @__PURE__ */
|
|
11033
|
+
/* @__PURE__ */ jsx22(
|
|
10887
11034
|
"input",
|
|
10888
11035
|
{
|
|
10889
11036
|
type: "text",
|
|
@@ -10895,18 +11042,18 @@ function CreateTemplateModal({
|
|
|
10895
11042
|
}
|
|
10896
11043
|
)
|
|
10897
11044
|
] }),
|
|
10898
|
-
/* @__PURE__ */
|
|
10899
|
-
/* @__PURE__ */
|
|
10900
|
-
/* @__PURE__ */
|
|
11045
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
11046
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
11047
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10901
11048
|
"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF (\u05E4\u05D5\u05E8\u05DE\u05D8: +[\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA][\u05DE\u05E1\u05E4\u05E8]) ",
|
|
10902
|
-
/* @__PURE__ */
|
|
11049
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10903
11050
|
] }),
|
|
10904
|
-
/* @__PURE__ */
|
|
11051
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
|
|
10905
11052
|
(btn.phone_number || "").length,
|
|
10906
11053
|
"/20"
|
|
10907
11054
|
] })
|
|
10908
11055
|
] }),
|
|
10909
|
-
/* @__PURE__ */
|
|
11056
|
+
/* @__PURE__ */ jsx22(
|
|
10910
11057
|
"input",
|
|
10911
11058
|
{
|
|
10912
11059
|
type: "tel",
|
|
@@ -10920,14 +11067,14 @@ function CreateTemplateModal({
|
|
|
10920
11067
|
)
|
|
10921
11068
|
] })
|
|
10922
11069
|
] }),
|
|
10923
|
-
btn.type === "COPY_CODE" && /* @__PURE__ */
|
|
10924
|
-
/* @__PURE__ */
|
|
10925
|
-
/* @__PURE__ */
|
|
10926
|
-
/* @__PURE__ */
|
|
11070
|
+
btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
|
|
11071
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
11072
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
11073
|
+
/* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
|
|
10927
11074
|
"\u05E7\u05D5\u05D3 \u05D4\u05E6\u05E2\u05D4 / \u05E7\u05D5\u05E4\u05D5\u05DF ",
|
|
10928
|
-
/* @__PURE__ */
|
|
11075
|
+
/* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
|
|
10929
11076
|
] }),
|
|
10930
|
-
/* @__PURE__ */
|
|
11077
|
+
/* @__PURE__ */ jsxs18(
|
|
10931
11078
|
"span",
|
|
10932
11079
|
{
|
|
10933
11080
|
className: `font-mono text-[10px] ${(btn.example || "").length >= 15 ? "text-amber-600 font-bold" : "text-slate-400"}`,
|
|
@@ -10938,7 +11085,7 @@ function CreateTemplateModal({
|
|
|
10938
11085
|
}
|
|
10939
11086
|
)
|
|
10940
11087
|
] }),
|
|
10941
|
-
/* @__PURE__ */
|
|
11088
|
+
/* @__PURE__ */ jsx22(
|
|
10942
11089
|
"input",
|
|
10943
11090
|
{
|
|
10944
11091
|
type: "text",
|
|
@@ -10951,15 +11098,15 @@ function CreateTemplateModal({
|
|
|
10951
11098
|
}
|
|
10952
11099
|
)
|
|
10953
11100
|
] }),
|
|
10954
|
-
/* @__PURE__ */
|
|
10955
|
-
/* @__PURE__ */
|
|
10956
|
-
/* @__PURE__ */
|
|
10957
|
-
/* @__PURE__ */
|
|
11101
|
+
/* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
|
|
11102
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
|
|
11103
|
+
/* @__PURE__ */ jsx22("label", { className: "font-semibold text-slate-700", children: "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 (\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC: \u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3)" }),
|
|
11104
|
+
/* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
|
|
10958
11105
|
(btn.text || "").length,
|
|
10959
11106
|
"/25"
|
|
10960
11107
|
] })
|
|
10961
11108
|
] }),
|
|
10962
|
-
/* @__PURE__ */
|
|
11109
|
+
/* @__PURE__ */ jsx22(
|
|
10963
11110
|
"input",
|
|
10964
11111
|
{
|
|
10965
11112
|
type: "text",
|
|
@@ -10979,8 +11126,8 @@ function CreateTemplateModal({
|
|
|
10979
11126
|
}) })
|
|
10980
11127
|
] })
|
|
10981
11128
|
] }),
|
|
10982
|
-
/* @__PURE__ */
|
|
10983
|
-
/* @__PURE__ */
|
|
11129
|
+
/* @__PURE__ */ jsxs18("div", { className: "px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-slate-50/50", children: [
|
|
11130
|
+
/* @__PURE__ */ jsx22(
|
|
10984
11131
|
"button",
|
|
10985
11132
|
{
|
|
10986
11133
|
type: "button",
|
|
@@ -10990,19 +11137,19 @@ function CreateTemplateModal({
|
|
|
10990
11137
|
children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
|
|
10991
11138
|
}
|
|
10992
11139
|
),
|
|
10993
|
-
/* @__PURE__ */
|
|
11140
|
+
/* @__PURE__ */ jsx22(
|
|
10994
11141
|
"button",
|
|
10995
11142
|
{
|
|
10996
11143
|
type: "submit",
|
|
10997
11144
|
disabled: !canSubmit,
|
|
10998
11145
|
className: `inline-flex items-center gap-2 px-5 py-2 text-xs font-semibold text-white rounded-xl shadow-xs transition-all cursor-pointer active:scale-[0.98] ${canSubmit ? "bg-emerald-600 hover:bg-emerald-700" : "bg-slate-300 text-slate-500 cursor-not-allowed opacity-60"}`,
|
|
10999
11146
|
title: !canSubmit ? fileError || validationResult.errors[0] || "\u05D9\u05E9 \u05DC\u05D4\u05E9\u05DC\u05D9\u05DD \u05D0\u05EA \u05DB\u05DC \u05E9\u05D3\u05D5\u05EA \u05D4\u05D7\u05D5\u05D1\u05D4 \u05D1\u05D0\u05D5\u05E4\u05DF \u05EA\u05E7\u05D9\u05DF" : "\u05E9\u05DC\u05D7 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta",
|
|
11000
|
-
children: isSubmitting ? /* @__PURE__ */
|
|
11001
|
-
/* @__PURE__ */
|
|
11002
|
-
/* @__PURE__ */
|
|
11003
|
-
] }) : /* @__PURE__ */
|
|
11004
|
-
/* @__PURE__ */
|
|
11005
|
-
/* @__PURE__ */
|
|
11147
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
11148
|
+
/* @__PURE__ */ jsx22(Loader24, { className: "w-4 h-4 animate-spin" }),
|
|
11149
|
+
/* @__PURE__ */ jsx22("span", { children: submittingStep || "\u05D9\u05D5\u05E6\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA..." })
|
|
11150
|
+
] }) : /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
11151
|
+
/* @__PURE__ */ jsx22(CheckCircle22, { className: "w-4 h-4" }),
|
|
11152
|
+
/* @__PURE__ */ jsx22("span", { children: "\u05E9\u05DC\u05D7 \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4" })
|
|
11006
11153
|
] })
|
|
11007
11154
|
}
|
|
11008
11155
|
)
|
|
@@ -11016,7 +11163,7 @@ function CreateTemplateModal({
|
|
|
11016
11163
|
}
|
|
11017
11164
|
|
|
11018
11165
|
// src/components/WhatsAppComponent/hooks/useWhatsAppState.ts
|
|
11019
|
-
import { useState as
|
|
11166
|
+
import { useState as useState19, useEffect as useEffect16, useRef as useRef16, useMemo as useMemo11, useCallback as useCallback15 } from "react";
|
|
11020
11167
|
|
|
11021
11168
|
// src/components/WhatsAppComponent/utils/recipientEngine.ts
|
|
11022
11169
|
var STORAGE_KEY_TEST_PHONE = "whatsapp_test_phone";
|
|
@@ -11210,9 +11357,9 @@ function prepareRecipients(params) {
|
|
|
11210
11357
|
const subData = (item == null ? void 0 : item._resolvedData) || ((item == null ? void 0 : item.data) && typeof item.data === "object" ? item.data : item) || {};
|
|
11211
11358
|
const cellVal = subData[subtableFilterColumn];
|
|
11212
11359
|
if (filterType === "BOOLEAN" || filterVal === "true" || filterVal === "false") {
|
|
11213
|
-
const
|
|
11360
|
+
const isTrue2 = cellValueIsTrue(cellVal);
|
|
11214
11361
|
const target = filterVal === "true";
|
|
11215
|
-
return
|
|
11362
|
+
return isTrue2 === target;
|
|
11216
11363
|
}
|
|
11217
11364
|
const relIds = normalizeRelationValue(cellVal);
|
|
11218
11365
|
if (relIds.length > 0) {
|
|
@@ -11314,9 +11461,9 @@ function matchesColumnFilter(cellValue, filterVal, colName, relationOptions, col
|
|
|
11314
11461
|
const q = filterVal.toLowerCase().trim();
|
|
11315
11462
|
if (!q) return true;
|
|
11316
11463
|
if (q === "true" || q === "false" || q === "\u05DB\u05DF" || q === "\u05DC\u05D0") {
|
|
11317
|
-
const
|
|
11464
|
+
const isTrue2 = cellValue === true || cellValue === "true" || cellValue === 1;
|
|
11318
11465
|
const targetBool = q === "true" || q === "\u05DB\u05DF";
|
|
11319
|
-
return
|
|
11466
|
+
return isTrue2 === targetBool;
|
|
11320
11467
|
}
|
|
11321
11468
|
const relIds = normalizeRelationValue(cellValue);
|
|
11322
11469
|
if (relIds.length > 0) {
|
|
@@ -11551,12 +11698,12 @@ function formatVariableValue(value, columnType, templateLanguage, options) {
|
|
|
11551
11698
|
}
|
|
11552
11699
|
}
|
|
11553
11700
|
function formatBoolean(value, templateLanguage) {
|
|
11554
|
-
const
|
|
11701
|
+
const isTrue2 = value === true || value === "true" || value === 1 || value === "1";
|
|
11555
11702
|
const isHebrew = templateLanguage === "he" || templateLanguage.startsWith("he_") || templateLanguage.startsWith("he-");
|
|
11556
11703
|
if (isHebrew) {
|
|
11557
|
-
return
|
|
11704
|
+
return isTrue2 ? "\u05DB\u05DF" : "\u05DC\u05D0";
|
|
11558
11705
|
}
|
|
11559
|
-
return
|
|
11706
|
+
return isTrue2 ? "Yes" : "No";
|
|
11560
11707
|
}
|
|
11561
11708
|
function formatDate(value) {
|
|
11562
11709
|
if (!value) return "";
|
|
@@ -12321,29 +12468,29 @@ function useWhatsAppState(props) {
|
|
|
12321
12468
|
data: injectedData
|
|
12322
12469
|
} = props;
|
|
12323
12470
|
const orgId = props.orgId || props.organizationId || (settings == null ? void 0 : settings.orgId) || (settings == null ? void 0 : settings.organizationId) || (injectedData == null ? void 0 : injectedData.orgId) || (injectedData == null ? void 0 : injectedData.organizationId);
|
|
12324
|
-
const [tableColumns2, setTableColumns] =
|
|
12471
|
+
const [tableColumns2, setTableColumns] = useState19(() => {
|
|
12325
12472
|
return Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
|
|
12326
12473
|
});
|
|
12327
|
-
const [rawRecords, setRawRecords] =
|
|
12474
|
+
const [rawRecords, setRawRecords] = useState19(() => {
|
|
12328
12475
|
if (Array.isArray(injectedData)) return injectedData;
|
|
12329
12476
|
if (Array.isArray(injectedData == null ? void 0 : injectedData.records)) return injectedData.records;
|
|
12330
12477
|
return [];
|
|
12331
12478
|
});
|
|
12332
|
-
const [relationOptions, setRelationOptions] =
|
|
12479
|
+
const [relationOptions, setRelationOptions] = useState19(() => {
|
|
12333
12480
|
return (injectedData == null ? void 0 : injectedData.relationOptions) || {};
|
|
12334
12481
|
});
|
|
12335
|
-
const [isLoadingTableData, setIsLoadingTableData] =
|
|
12336
|
-
const [activeSubtableScans, setActiveSubtableScans] =
|
|
12337
|
-
const [tableError, setTableError] =
|
|
12338
|
-
const [filters, setFilters] =
|
|
12339
|
-
const [selectedRowIds, setSelectedRowIds] =
|
|
12340
|
-
const [autoSelectCount, setAutoSelectCount] =
|
|
12482
|
+
const [isLoadingTableData, setIsLoadingTableData] = useState19(() => Boolean(settings == null ? void 0 : settings.tableMetaId));
|
|
12483
|
+
const [activeSubtableScans, setActiveSubtableScans] = useState19(0);
|
|
12484
|
+
const [tableError, setTableError] = useState19(null);
|
|
12485
|
+
const [filters, setFilters] = useState19({});
|
|
12486
|
+
const [selectedRowIds, setSelectedRowIds] = useState19([]);
|
|
12487
|
+
const [autoSelectCount, setAutoSelectCount] = useState19(null);
|
|
12341
12488
|
const isAutoSelectingRef = useRef16(false);
|
|
12342
12489
|
const isManualOverrideRef = useRef16(false);
|
|
12343
12490
|
const prevAutoSelectCountRef = useRef16(null);
|
|
12344
12491
|
const fetchedTableIdsRef = useRef16(/* @__PURE__ */ new Set());
|
|
12345
12492
|
const fullyFetchedRelationKeysRef = useRef16(/* @__PURE__ */ new Set());
|
|
12346
|
-
const loadTableData =
|
|
12493
|
+
const loadTableData = useCallback15(async () => {
|
|
12347
12494
|
var _a2;
|
|
12348
12495
|
const tableId = (settings == null ? void 0 : settings.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableId);
|
|
12349
12496
|
if (!tableId || !executeAction) return;
|
|
@@ -12421,7 +12568,7 @@ function useWhatsAppState(props) {
|
|
|
12421
12568
|
return type === "RELATION" || type === "BOOLEAN";
|
|
12422
12569
|
});
|
|
12423
12570
|
}, [tableColumns2]);
|
|
12424
|
-
const [referencedTableSchemas, setReferencedTableSchemas] =
|
|
12571
|
+
const [referencedTableSchemas, setReferencedTableSchemas] = useState19({});
|
|
12425
12572
|
const subtableCols = useMemo11(() => {
|
|
12426
12573
|
return (tableColumns2 || []).filter((col) => {
|
|
12427
12574
|
var _a2;
|
|
@@ -12482,10 +12629,10 @@ function useWhatsAppState(props) {
|
|
|
12482
12629
|
const phoneColumns = useMemo11(() => {
|
|
12483
12630
|
return targetPhoneOptions.map((opt) => ({ name: opt.label, id: opt.id, type: "PHONE" }));
|
|
12484
12631
|
}, [targetPhoneOptions]);
|
|
12485
|
-
const [phoneColumnId, setPhoneColumnId] =
|
|
12486
|
-
const [subtableFilterColumn, setSubtableFilterColumn] =
|
|
12487
|
-
const [subtableFilterValue, setSubtableFilterValue] =
|
|
12488
|
-
const [subtableSendLimit, setSubtableSendLimit] =
|
|
12632
|
+
const [phoneColumnId, setPhoneColumnId] = useState19("");
|
|
12633
|
+
const [subtableFilterColumn, setSubtableFilterColumn] = useState19("");
|
|
12634
|
+
const [subtableFilterValue, setSubtableFilterValue] = useState19("");
|
|
12635
|
+
const [subtableSendLimit, setSubtableSendLimit] = useState19(
|
|
12489
12636
|
(settings == null ? void 0 : settings.subtableSendLimit) || "PRIMARY"
|
|
12490
12637
|
);
|
|
12491
12638
|
useEffect16(() => {
|
|
@@ -12528,10 +12675,10 @@ function useWhatsAppState(props) {
|
|
|
12528
12675
|
const selectedSubtableFilterCol = useMemo11(() => {
|
|
12529
12676
|
return subtableFilterableColumns.find((c) => c.name === subtableFilterColumn);
|
|
12530
12677
|
}, [subtableFilterableColumns, subtableFilterColumn]);
|
|
12531
|
-
const [enablePostSendAction, setEnablePostSendAction] =
|
|
12532
|
-
const [postSendActionColumn, setPostSendActionColumn] =
|
|
12533
|
-
const [postSendActionValue, setPostSendActionValue] =
|
|
12534
|
-
const [postSendActionTargetType, setPostSendActionTargetType] =
|
|
12678
|
+
const [enablePostSendAction, setEnablePostSendAction] = useState19(false);
|
|
12679
|
+
const [postSendActionColumn, setPostSendActionColumn] = useState19("");
|
|
12680
|
+
const [postSendActionValue, setPostSendActionValue] = useState19("");
|
|
12681
|
+
const [postSendActionTargetType, setPostSendActionTargetType] = useState19("MAIN");
|
|
12535
12682
|
const postSendActionTargetOptions = useMemo11(() => {
|
|
12536
12683
|
var _a2, _b2, _c;
|
|
12537
12684
|
const options = [];
|
|
@@ -12583,8 +12730,8 @@ function useWhatsAppState(props) {
|
|
|
12583
12730
|
);
|
|
12584
12731
|
}, [postSendActionTargetOptions, postSendActionColumn]);
|
|
12585
12732
|
const selectedPostSendCol = selectedPostSendOption;
|
|
12586
|
-
const [isTestPromptOpen, setIsTestPromptOpen] =
|
|
12587
|
-
const [testPhoneNumber, setTestPhoneNumber] =
|
|
12733
|
+
const [isTestPromptOpen, setIsTestPromptOpen] = useState19(false);
|
|
12734
|
+
const [testPhoneNumber, setTestPhoneNumber] = useState19(() => {
|
|
12588
12735
|
if (typeof window !== "undefined") {
|
|
12589
12736
|
try {
|
|
12590
12737
|
return localStorage.getItem(STORAGE_KEY_TEST_PHONE) || "";
|
|
@@ -12594,10 +12741,10 @@ function useWhatsAppState(props) {
|
|
|
12594
12741
|
}
|
|
12595
12742
|
return "";
|
|
12596
12743
|
});
|
|
12597
|
-
const [testFeedback, setTestFeedback] =
|
|
12598
|
-
const [isSendingTest, setIsSendingTest] =
|
|
12599
|
-
const [isSendingBroadcast, setIsSendingBroadcast] =
|
|
12600
|
-
const [broadcastProgress, setBroadcastProgress] =
|
|
12744
|
+
const [testFeedback, setTestFeedback] = useState19(null);
|
|
12745
|
+
const [isSendingTest, setIsSendingTest] = useState19(false);
|
|
12746
|
+
const [isSendingBroadcast, setIsSendingBroadcast] = useState19(false);
|
|
12747
|
+
const [broadcastProgress, setBroadcastProgress] = useState19({
|
|
12601
12748
|
current: 0,
|
|
12602
12749
|
total: 0,
|
|
12603
12750
|
successful: 0,
|
|
@@ -12605,12 +12752,12 @@ function useWhatsAppState(props) {
|
|
|
12605
12752
|
skipped: 0,
|
|
12606
12753
|
percent: 0
|
|
12607
12754
|
});
|
|
12608
|
-
const [broadcastSummary, setBroadcastSummary] =
|
|
12609
|
-
const [rowStatusMap, setRowStatusMap] =
|
|
12610
|
-
const clearBroadcastSummary =
|
|
12755
|
+
const [broadcastSummary, setBroadcastSummary] = useState19(null);
|
|
12756
|
+
const [rowStatusMap, setRowStatusMap] = useState19({});
|
|
12757
|
+
const clearBroadcastSummary = useCallback15(() => {
|
|
12611
12758
|
setBroadcastSummary(null);
|
|
12612
12759
|
}, []);
|
|
12613
|
-
const handleTestPhoneChange =
|
|
12760
|
+
const handleTestPhoneChange = useCallback15((val) => {
|
|
12614
12761
|
setTestPhoneNumber(val);
|
|
12615
12762
|
if (typeof window !== "undefined") {
|
|
12616
12763
|
try {
|
|
@@ -12620,7 +12767,7 @@ function useWhatsAppState(props) {
|
|
|
12620
12767
|
}
|
|
12621
12768
|
}
|
|
12622
12769
|
}, []);
|
|
12623
|
-
const getRelationOptionsForCol =
|
|
12770
|
+
const getRelationOptionsForCol = useCallback15(
|
|
12624
12771
|
(colName, parentColName) => {
|
|
12625
12772
|
var _a2, _b2, _c, _d;
|
|
12626
12773
|
if (parentColName) {
|
|
@@ -12877,9 +13024,9 @@ function useWhatsAppState(props) {
|
|
|
12877
13024
|
const colType = (_a2 = colDef.type) == null ? void 0 : _a2.toUpperCase();
|
|
12878
13025
|
const cellValue = rowData[colName];
|
|
12879
13026
|
if (colType === "BOOLEAN") {
|
|
12880
|
-
const
|
|
13027
|
+
const isTrue2 = cellValue === true || cellValue === "true" || cellValue === 1;
|
|
12881
13028
|
const targetBool = filterVal === "true";
|
|
12882
|
-
if (
|
|
13029
|
+
if (isTrue2 !== targetBool) {
|
|
12883
13030
|
return false;
|
|
12884
13031
|
}
|
|
12885
13032
|
} else if (colType === "RELATION") {
|
|
@@ -12911,7 +13058,7 @@ function useWhatsAppState(props) {
|
|
|
12911
13058
|
isManualOverrideRef.current = false;
|
|
12912
13059
|
prevAutoSelectCountRef.current = autoSelectCount;
|
|
12913
13060
|
}, [autoSelectCount, filteredData]);
|
|
12914
|
-
const embeddedTableExecuteAction =
|
|
13061
|
+
const embeddedTableExecuteAction = useCallback15(async (actionType, payload) => {
|
|
12915
13062
|
if (actionType === "FETCH_TABLE_DATA") {
|
|
12916
13063
|
const colFilters = (payload == null ? void 0 : payload.columnFilters) || (payload == null ? void 0 : payload.filters);
|
|
12917
13064
|
const searchQuery = payload == null ? void 0 : payload.search;
|
|
@@ -12957,7 +13104,7 @@ function useWhatsAppState(props) {
|
|
|
12957
13104
|
const activeFiltersCount = useMemo11(() => {
|
|
12958
13105
|
return Object.values(filters).filter((v) => v !== "").length;
|
|
12959
13106
|
}, [filters]);
|
|
12960
|
-
const handleSelectionChange =
|
|
13107
|
+
const handleSelectionChange = useCallback15((selectedIds) => {
|
|
12961
13108
|
setSelectedRowIds((prev) => {
|
|
12962
13109
|
if (prev.length === selectedIds.length && prev.every((id, idx) => id === selectedIds[idx])) {
|
|
12963
13110
|
return prev;
|
|
@@ -12971,13 +13118,13 @@ function useWhatsAppState(props) {
|
|
|
12971
13118
|
return selectedIds;
|
|
12972
13119
|
});
|
|
12973
13120
|
}, [autoSelectCount]);
|
|
12974
|
-
const handleRowToggle =
|
|
13121
|
+
const handleRowToggle = useCallback15((rowId, checked) => {
|
|
12975
13122
|
if (autoSelectCount !== null && autoSelectCount > 0) {
|
|
12976
13123
|
isManualOverrideRef.current = true;
|
|
12977
13124
|
setAutoSelectCount(null);
|
|
12978
13125
|
}
|
|
12979
13126
|
}, [autoSelectCount]);
|
|
12980
|
-
const toggleRowSelection =
|
|
13127
|
+
const toggleRowSelection = useCallback15((rowId, checked) => {
|
|
12981
13128
|
if (autoSelectCount !== null && autoSelectCount > 0) {
|
|
12982
13129
|
isManualOverrideRef.current = true;
|
|
12983
13130
|
setAutoSelectCount(null);
|
|
@@ -12993,15 +13140,15 @@ function useWhatsAppState(props) {
|
|
|
12993
13140
|
return prev;
|
|
12994
13141
|
});
|
|
12995
13142
|
}, [autoSelectCount]);
|
|
12996
|
-
const [templates, setTemplates] =
|
|
12997
|
-
const [selectedTemplateId, setSelectedTemplateId] =
|
|
12998
|
-
const [isLoading, setIsLoading] =
|
|
12999
|
-
const [fetchError, setFetchError] =
|
|
13000
|
-
const [isModalOpen, setIsModalOpen] =
|
|
13001
|
-
const [isDropdownOpen, setIsDropdownOpen] =
|
|
13002
|
-
const [isDeleting, setIsDeleting] =
|
|
13003
|
-
const [feedback, setFeedback] =
|
|
13004
|
-
const loadTemplates =
|
|
13143
|
+
const [templates, setTemplates] = useState19([]);
|
|
13144
|
+
const [selectedTemplateId, setSelectedTemplateId] = useState19(null);
|
|
13145
|
+
const [isLoading, setIsLoading] = useState19(true);
|
|
13146
|
+
const [fetchError, setFetchError] = useState19(null);
|
|
13147
|
+
const [isModalOpen, setIsModalOpen] = useState19(false);
|
|
13148
|
+
const [isDropdownOpen, setIsDropdownOpen] = useState19(false);
|
|
13149
|
+
const [isDeleting, setIsDeleting] = useState19(false);
|
|
13150
|
+
const [feedback, setFeedback] = useState19(null);
|
|
13151
|
+
const loadTemplates = useCallback15(async () => {
|
|
13005
13152
|
var _a2, _b2;
|
|
13006
13153
|
if (!executeAction) {
|
|
13007
13154
|
setIsLoading(false);
|
|
@@ -13078,7 +13225,7 @@ function useWhatsAppState(props) {
|
|
|
13078
13225
|
}
|
|
13079
13226
|
) || null;
|
|
13080
13227
|
}, [selectedTemplate]);
|
|
13081
|
-
const [headerMediaUrl, setHeaderMediaUrl] =
|
|
13228
|
+
const [headerMediaUrl, setHeaderMediaUrl] = useState19("");
|
|
13082
13229
|
useEffect16(() => {
|
|
13083
13230
|
if (!templateHeaderComp) {
|
|
13084
13231
|
setHeaderMediaUrl("");
|
|
@@ -13096,7 +13243,7 @@ function useWhatsAppState(props) {
|
|
|
13096
13243
|
setHeaderMediaUrl("");
|
|
13097
13244
|
}
|
|
13098
13245
|
}, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
|
|
13099
|
-
const handleHeaderMediaUrlChange =
|
|
13246
|
+
const handleHeaderMediaUrlChange = useCallback15(
|
|
13100
13247
|
(newUrl) => {
|
|
13101
13248
|
setHeaderMediaUrl(newUrl);
|
|
13102
13249
|
if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
|
|
@@ -13115,7 +13262,7 @@ function useWhatsAppState(props) {
|
|
|
13115
13262
|
},
|
|
13116
13263
|
[selectedTemplate == null ? void 0 : selectedTemplate.name]
|
|
13117
13264
|
);
|
|
13118
|
-
const handleResetHeaderMediaUrl =
|
|
13265
|
+
const handleResetHeaderMediaUrl = useCallback15(() => {
|
|
13119
13266
|
if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
|
|
13120
13267
|
try {
|
|
13121
13268
|
localStorage.removeItem(`whatsapp_template_media_${selectedTemplate.name}`);
|
|
@@ -13129,8 +13276,8 @@ function useWhatsAppState(props) {
|
|
|
13129
13276
|
);
|
|
13130
13277
|
setHeaderMediaUrl(defaultUrl || "");
|
|
13131
13278
|
}, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
|
|
13132
|
-
const [isUploadingMedia, setIsUploadingMedia] =
|
|
13133
|
-
const handleFileUpload =
|
|
13279
|
+
const [isUploadingMedia, setIsUploadingMedia] = useState19(false);
|
|
13280
|
+
const handleFileUpload = useCallback15(
|
|
13134
13281
|
async (file, templateName) => {
|
|
13135
13282
|
const tplName = templateName || (selectedTemplate == null ? void 0 : selectedTemplate.name) || "";
|
|
13136
13283
|
if (!file) return;
|
|
@@ -13174,7 +13321,7 @@ function useWhatsAppState(props) {
|
|
|
13174
13321
|
const templateVariables = useMemo11(() => {
|
|
13175
13322
|
return extractTemplateVariables(selectedTemplate);
|
|
13176
13323
|
}, [selectedTemplate]);
|
|
13177
|
-
const [variableMapping, setVariableMapping] =
|
|
13324
|
+
const [variableMapping, setVariableMapping] = useState19({});
|
|
13178
13325
|
useEffect16(() => {
|
|
13179
13326
|
setVariableMapping({});
|
|
13180
13327
|
}, [selectedTemplateId]);
|
|
@@ -13387,7 +13534,7 @@ function useWhatsAppState(props) {
|
|
|
13387
13534
|
setIsSendingTest(false);
|
|
13388
13535
|
}
|
|
13389
13536
|
};
|
|
13390
|
-
const handleSendMessages =
|
|
13537
|
+
const handleSendMessages = useCallback15(async () => {
|
|
13391
13538
|
var _a2, _b2;
|
|
13392
13539
|
if (isSendDisabled || isSendingBroadcast) return;
|
|
13393
13540
|
const recipients = preparedRecipients;
|
|
@@ -13710,7 +13857,7 @@ import {
|
|
|
13710
13857
|
CheckCircle2 as CheckCircle23,
|
|
13711
13858
|
AlertCircle as AlertCircle3
|
|
13712
13859
|
} from "lucide-react";
|
|
13713
|
-
import { Fragment as Fragment5, jsx as
|
|
13860
|
+
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
13714
13861
|
function TemplateSelectionBlock({
|
|
13715
13862
|
selectedTemplate,
|
|
13716
13863
|
selectedTemplateId,
|
|
@@ -13737,15 +13884,15 @@ function TemplateSelectionBlock({
|
|
|
13737
13884
|
handleFileUpload
|
|
13738
13885
|
}) {
|
|
13739
13886
|
const fileInputRef = useRef17(null);
|
|
13740
|
-
return /* @__PURE__ */
|
|
13741
|
-
/* @__PURE__ */
|
|
13742
|
-
/* @__PURE__ */
|
|
13743
|
-
/* @__PURE__ */
|
|
13744
|
-
/* @__PURE__ */
|
|
13745
|
-
/* @__PURE__ */
|
|
13887
|
+
return /* @__PURE__ */ jsxs19("div", { className: "col-span-12 lg:col-span-5 min-h-[26rem] h-full flex flex-col bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 relative", children: [
|
|
13888
|
+
/* @__PURE__ */ jsxs19("div", { className: "space-y-1.5 shrink-0", children: [
|
|
13889
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between pb-1.5 border-b border-slate-200/70 shrink-0 gap-2", children: [
|
|
13890
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 min-w-0", children: [
|
|
13891
|
+
/* @__PURE__ */ jsx23(FileText3, { className: "w-4 h-4 text-emerald-600 shrink-0" }),
|
|
13892
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 truncate", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05D5\u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4" })
|
|
13746
13893
|
] }),
|
|
13747
|
-
/* @__PURE__ */
|
|
13748
|
-
/* @__PURE__ */
|
|
13894
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
13895
|
+
/* @__PURE__ */ jsxs19(
|
|
13749
13896
|
"button",
|
|
13750
13897
|
{
|
|
13751
13898
|
type: "button",
|
|
@@ -13754,12 +13901,12 @@ function TemplateSelectionBlock({
|
|
|
13754
13901
|
className: `h-7 px-2 text-[11px] font-semibold rounded-lg border transition-all flex items-center gap-1 ${selectedTemplate && !isDeleting ? "bg-white text-rose-600 hover:bg-rose-50 border-rose-200 active:scale-[0.98] shadow-2xs cursor-pointer" : "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60"}`,
|
|
13755
13902
|
title: !selectedTemplate ? "\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DB\u05D3\u05D9 \u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05D5\u05EA\u05D4" : `\u05DE\u05D7\u05E7 \u05D0\u05EA \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA "${selectedTemplate.name}"`,
|
|
13756
13903
|
children: [
|
|
13757
|
-
isDeleting ? /* @__PURE__ */
|
|
13758
|
-
/* @__PURE__ */
|
|
13904
|
+
isDeleting ? /* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 animate-spin text-rose-500" }) : /* @__PURE__ */ jsx23(Trash23, { className: "w-3.5 h-3.5 text-rose-500" }),
|
|
13905
|
+
/* @__PURE__ */ jsx23("span", { children: "\u05DE\u05D7\u05D9\u05E7\u05D4" })
|
|
13759
13906
|
]
|
|
13760
13907
|
}
|
|
13761
13908
|
),
|
|
13762
|
-
/* @__PURE__ */
|
|
13909
|
+
/* @__PURE__ */ jsxs19(
|
|
13763
13910
|
"button",
|
|
13764
13911
|
{
|
|
13765
13912
|
type: "button",
|
|
@@ -13767,40 +13914,40 @@ function TemplateSelectionBlock({
|
|
|
13767
13914
|
className: "h-7 px-2.5 text-[11px] font-semibold text-white bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] rounded-lg shadow-2xs transition-all flex items-center gap-1 cursor-pointer",
|
|
13768
13915
|
title: "\u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4",
|
|
13769
13916
|
children: [
|
|
13770
|
-
/* @__PURE__ */
|
|
13771
|
-
/* @__PURE__ */
|
|
13917
|
+
/* @__PURE__ */ jsx23(Plus2, { className: "w-3.5 h-3.5" }),
|
|
13918
|
+
/* @__PURE__ */ jsx23("span", { children: "\u05D7\u05D3\u05E9" })
|
|
13772
13919
|
]
|
|
13773
13920
|
}
|
|
13774
13921
|
)
|
|
13775
13922
|
] })
|
|
13776
13923
|
] }),
|
|
13777
|
-
/* @__PURE__ */
|
|
13778
|
-
/* @__PURE__ */
|
|
13924
|
+
/* @__PURE__ */ jsxs19("div", { className: "relative", children: [
|
|
13925
|
+
/* @__PURE__ */ jsxs19(
|
|
13779
13926
|
"button",
|
|
13780
13927
|
{
|
|
13781
13928
|
type: "button",
|
|
13782
13929
|
onClick: () => setIsDropdownOpen((prev) => !prev),
|
|
13783
13930
|
className: "w-full h-8.5 px-3 bg-white hover:bg-slate-100/70 border border-slate-200 rounded-xl text-right flex items-center justify-between transition-colors cursor-pointer text-xs",
|
|
13784
13931
|
children: [
|
|
13785
|
-
selectedTemplate ? /* @__PURE__ */
|
|
13786
|
-
/* @__PURE__ */
|
|
13932
|
+
selectedTemplate ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
13933
|
+
/* @__PURE__ */ jsx23(
|
|
13787
13934
|
"span",
|
|
13788
13935
|
{
|
|
13789
13936
|
className: `w-2 h-2 rounded-full shrink-0 ${getStatusConfig(selectedTemplate.status).dotColor}`
|
|
13790
13937
|
}
|
|
13791
13938
|
),
|
|
13792
|
-
/* @__PURE__ */
|
|
13793
|
-
/* @__PURE__ */
|
|
13939
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs font-semibold text-slate-900 truncate", children: selectedTemplate.name }),
|
|
13940
|
+
/* @__PURE__ */ jsxs19("span", { className: "text-[10px] text-slate-400 shrink-0", children: [
|
|
13794
13941
|
"(",
|
|
13795
13942
|
selectedTemplate.category,
|
|
13796
13943
|
" \u2022 ",
|
|
13797
13944
|
selectedTemplate.language,
|
|
13798
13945
|
")"
|
|
13799
13946
|
] })
|
|
13800
|
-
] }) : /* @__PURE__ */
|
|
13801
|
-
/* @__PURE__ */
|
|
13802
|
-
isLoadingTemplates && /* @__PURE__ */
|
|
13803
|
-
/* @__PURE__ */
|
|
13947
|
+
] }) : /* @__PURE__ */ jsx23("span", { className: "text-xs text-slate-400", children: "\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05E7\u05D9\u05D9\u05DE\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4..." }),
|
|
13948
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 shrink-0 mr-1", children: [
|
|
13949
|
+
isLoadingTemplates && /* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 text-emerald-600 animate-spin" }),
|
|
13950
|
+
/* @__PURE__ */ jsx23(
|
|
13804
13951
|
ChevronDown4,
|
|
13805
13952
|
{
|
|
13806
13953
|
className: `w-3.5 h-3.5 text-slate-400 transition-transform ${isDropdownOpen ? "rotate-180" : ""}`
|
|
@@ -13810,21 +13957,21 @@ function TemplateSelectionBlock({
|
|
|
13810
13957
|
]
|
|
13811
13958
|
}
|
|
13812
13959
|
),
|
|
13813
|
-
isDropdownOpen && /* @__PURE__ */
|
|
13814
|
-
/* @__PURE__ */
|
|
13960
|
+
isDropdownOpen && /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
13961
|
+
/* @__PURE__ */ jsx23(
|
|
13815
13962
|
"div",
|
|
13816
13963
|
{
|
|
13817
13964
|
className: "fixed inset-0 z-40",
|
|
13818
13965
|
onClick: () => setIsDropdownOpen(false)
|
|
13819
13966
|
}
|
|
13820
13967
|
),
|
|
13821
|
-
/* @__PURE__ */
|
|
13822
|
-
templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */
|
|
13968
|
+
/* @__PURE__ */ jsxs19("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-slate-200 rounded-xl shadow-xl z-50 max-h-52 overflow-y-auto divide-y divide-slate-100 animate-in fade-in-50 zoom-in-95 duration-100", children: [
|
|
13969
|
+
templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */ jsx23("div", { className: "p-3 text-center text-xs text-slate-400", children: '\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4".' }),
|
|
13823
13970
|
templates.map((tpl) => {
|
|
13824
13971
|
const statusConfig = getStatusConfig(tpl.status);
|
|
13825
13972
|
const isSelected = tpl.id === selectedTemplateId;
|
|
13826
13973
|
const canSelect = statusConfig.isSelectable;
|
|
13827
|
-
return /* @__PURE__ */
|
|
13974
|
+
return /* @__PURE__ */ jsxs19(
|
|
13828
13975
|
"div",
|
|
13829
13976
|
{
|
|
13830
13977
|
onClick: () => {
|
|
@@ -13837,29 +13984,29 @@ function TemplateSelectionBlock({
|
|
|
13837
13984
|
className: `p-2.5 flex items-center justify-between gap-2.5 transition-colors ${canSelect ? "hover:bg-slate-50 cursor-pointer" : "opacity-60 bg-slate-50/60 cursor-not-allowed"} ${isSelected ? "bg-emerald-50/50" : ""}`,
|
|
13838
13985
|
title: !canSelect ? `\u05E1\u05D8\u05D8\u05D5\u05E1 \u05EA\u05D1\u05E0\u05D9\u05EA: ${tpl.status}. \u05E8\u05E7 \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA \u05D1\u05DE\u05E6\u05D1 \u05DE\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5 \u05E4\u05E2\u05D9\u05DC \u05E0\u05D9\u05EA\u05E0\u05D5\u05EA \u05DC\u05D1\u05D7\u05D9\u05E8\u05D4.` : void 0,
|
|
13839
13986
|
children: [
|
|
13840
|
-
/* @__PURE__ */
|
|
13841
|
-
/* @__PURE__ */
|
|
13987
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 overflow-hidden", children: [
|
|
13988
|
+
/* @__PURE__ */ jsx23(
|
|
13842
13989
|
"span",
|
|
13843
13990
|
{
|
|
13844
13991
|
className: `w-2 h-2 rounded-full shrink-0 ${statusConfig.dotColor}`
|
|
13845
13992
|
}
|
|
13846
13993
|
),
|
|
13847
|
-
/* @__PURE__ */
|
|
13848
|
-
/* @__PURE__ */
|
|
13994
|
+
/* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
|
|
13995
|
+
/* @__PURE__ */ jsx23(
|
|
13849
13996
|
"p",
|
|
13850
13997
|
{
|
|
13851
13998
|
className: `text-xs font-semibold truncate ${isSelected ? "text-emerald-700" : canSelect ? "text-slate-800" : "text-slate-500"}`,
|
|
13852
13999
|
children: tpl.name
|
|
13853
14000
|
}
|
|
13854
14001
|
),
|
|
13855
|
-
/* @__PURE__ */
|
|
14002
|
+
/* @__PURE__ */ jsxs19("p", { className: "text-[10px] text-slate-400", children: [
|
|
13856
14003
|
tpl.category,
|
|
13857
14004
|
" \u2022 ",
|
|
13858
14005
|
tpl.language
|
|
13859
14006
|
] })
|
|
13860
14007
|
] })
|
|
13861
14008
|
] }),
|
|
13862
|
-
/* @__PURE__ */
|
|
14009
|
+
/* @__PURE__ */ jsx23(
|
|
13863
14010
|
"span",
|
|
13864
14011
|
{
|
|
13865
14012
|
className: `text-[9px] font-semibold px-2 py-0.5 rounded-full border shrink-0 ${statusConfig.badgeBg} ${statusConfig.badgeText}`,
|
|
@@ -13875,18 +14022,18 @@ function TemplateSelectionBlock({
|
|
|
13875
14022
|
] })
|
|
13876
14023
|
] })
|
|
13877
14024
|
] }),
|
|
13878
|
-
/* @__PURE__ */
|
|
13879
|
-
/* @__PURE__ */
|
|
13880
|
-
/* @__PURE__ */
|
|
13881
|
-
selectedTemplate && /* @__PURE__ */
|
|
14025
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex-1 min-h-0 flex flex-col gap-2", children: [
|
|
14026
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-600 shrink-0", children: [
|
|
14027
|
+
/* @__PURE__ */ jsx23("span", { children: "\u05EA\u05E6\u05D5\u05D2\u05EA \u05D4\u05D5\u05D3\u05E2\u05D4" }),
|
|
14028
|
+
selectedTemplate && /* @__PURE__ */ jsxs19("span", { className: "text-[10px] text-slate-400", children: [
|
|
13882
14029
|
"(",
|
|
13883
14030
|
templateBodyText.length,
|
|
13884
14031
|
" \u05EA\u05D5\u05D5\u05D9\u05DD)"
|
|
13885
14032
|
] })
|
|
13886
14033
|
] }),
|
|
13887
|
-
selectedTemplate ? /* @__PURE__ */
|
|
13888
|
-
/* @__PURE__ */
|
|
13889
|
-
/* @__PURE__ */
|
|
14034
|
+
selectedTemplate ? /* @__PURE__ */ jsx23("div", { className: "flex-1 min-h-0 overflow-y-auto bg-white border border-slate-200 rounded-lg p-3 text-sm text-slate-700 leading-relaxed font-sans whitespace-pre-wrap select-all shadow-2xs", children: templateBodyText || "(\u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E8\u05D9\u05E7)" }) : /* @__PURE__ */ jsxs19("div", { className: "flex-1 min-h-0 py-3 bg-white border border-dashed border-slate-200 rounded-lg text-center text-sm text-slate-400 flex flex-col items-center justify-center gap-0.5", children: [
|
|
14035
|
+
/* @__PURE__ */ jsx23("span", { children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" }),
|
|
14036
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs text-slate-400", children: '\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05D0\u05D5 \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D7\u05D3\u05E9"' })
|
|
13890
14037
|
] }),
|
|
13891
14038
|
selectedTemplate && (() => {
|
|
13892
14039
|
var _a;
|
|
@@ -13895,19 +14042,19 @@ function TemplateSelectionBlock({
|
|
|
13895
14042
|
);
|
|
13896
14043
|
const tplButtons = (buttonsComp == null ? void 0 : buttonsComp.buttons) || [];
|
|
13897
14044
|
if (!tplButtons || tplButtons.length === 0) return null;
|
|
13898
|
-
return /* @__PURE__ */
|
|
14045
|
+
return /* @__PURE__ */ jsx23("div", { className: "flex flex-wrap gap-1.5 shrink-0 pt-0.5", children: tplButtons.map((btn, idx) => {
|
|
13899
14046
|
const btnType = (btn.type || "").toUpperCase();
|
|
13900
14047
|
const btnText = btn.text || (btnType === "COPY_CODE" ? `\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3: ${btn.example}` : "\u05DB\u05E4\u05EA\u05D5\u05E8");
|
|
13901
|
-
return /* @__PURE__ */
|
|
14048
|
+
return /* @__PURE__ */ jsxs19(
|
|
13902
14049
|
"div",
|
|
13903
14050
|
{
|
|
13904
14051
|
className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white border border-slate-200/90 text-slate-700 text-xs font-semibold shadow-2xs select-none",
|
|
13905
14052
|
children: [
|
|
13906
|
-
btnType === "QUICK_REPLY" && /* @__PURE__ */
|
|
13907
|
-
btnType === "URL" && /* @__PURE__ */
|
|
13908
|
-
btnType === "PHONE_NUMBER" && /* @__PURE__ */
|
|
13909
|
-
btnType === "COPY_CODE" && /* @__PURE__ */
|
|
13910
|
-
/* @__PURE__ */
|
|
14053
|
+
btnType === "QUICK_REPLY" && /* @__PURE__ */ jsx23(MessageSquare2, { className: "w-3 h-3 text-emerald-600" }),
|
|
14054
|
+
btnType === "URL" && /* @__PURE__ */ jsx23(ExternalLink4, { className: "w-3 h-3 text-sky-600" }),
|
|
14055
|
+
btnType === "PHONE_NUMBER" && /* @__PURE__ */ jsx23(Phone2, { className: "w-3 h-3 text-violet-600" }),
|
|
14056
|
+
btnType === "COPY_CODE" && /* @__PURE__ */ jsx23(Copy4, { className: "w-3 h-3 text-amber-600" }),
|
|
14057
|
+
/* @__PURE__ */ jsx23("span", { className: "truncate max-w-[180px]", children: btnText })
|
|
13911
14058
|
]
|
|
13912
14059
|
},
|
|
13913
14060
|
idx
|
|
@@ -13922,9 +14069,9 @@ function TemplateSelectionBlock({
|
|
|
13922
14069
|
const docFilename = resolveDocumentFilename(templateHeaderComp, headerMediaUrl);
|
|
13923
14070
|
const hasValidMedia = Boolean(headerMediaUrl && headerMediaUrl.trim() && headerMediaUrl.startsWith("http"));
|
|
13924
14071
|
const uploadButtonLabel = headerFormat === "DOCUMENT" ? "\u05D4\u05E2\u05DC\u05D4 \u05DE\u05E1\u05DE\u05DA" : headerFormat === "IMAGE" ? "\u05D4\u05E2\u05DC\u05D4 \u05EA\u05DE\u05D5\u05E0\u05D4" : "\u05D4\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5";
|
|
13925
|
-
return /* @__PURE__ */
|
|
13926
|
-
/* @__PURE__ */
|
|
13927
|
-
/* @__PURE__ */
|
|
14072
|
+
return /* @__PURE__ */ jsxs19("div", { className: "p-2.5 bg-slate-50 border border-slate-200/90 rounded-xl flex items-center justify-between gap-3 shrink-0 shadow-2xs", children: [
|
|
14073
|
+
/* @__PURE__ */ jsx23("div", { className: "flex items-center gap-2.5 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
14074
|
+
/* @__PURE__ */ jsx23("div", { className: "w-8 h-8 rounded-lg overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: hasValidMedia ? /* @__PURE__ */ jsx23(
|
|
13928
14075
|
"img",
|
|
13929
14076
|
{
|
|
13930
14077
|
src: headerMediaUrl,
|
|
@@ -13934,33 +14081,33 @@ function TemplateSelectionBlock({
|
|
|
13934
14081
|
e.currentTarget.style.display = "none";
|
|
13935
14082
|
}
|
|
13936
14083
|
}
|
|
13937
|
-
) : /* @__PURE__ */
|
|
13938
|
-
/* @__PURE__ */
|
|
13939
|
-
/* @__PURE__ */
|
|
13940
|
-
/* @__PURE__ */
|
|
14084
|
+
) : /* @__PURE__ */ jsx23(ImageIcon2, { className: "w-4 h-4 text-amber-600" }) }),
|
|
14085
|
+
/* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
|
|
14086
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" }),
|
|
14087
|
+
/* @__PURE__ */ jsx23("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4" })
|
|
13941
14088
|
] })
|
|
13942
|
-
] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */
|
|
13943
|
-
/* @__PURE__ */
|
|
13944
|
-
/* @__PURE__ */
|
|
13945
|
-
/* @__PURE__ */
|
|
13946
|
-
/* @__PURE__ */
|
|
14089
|
+
] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
14090
|
+
/* @__PURE__ */ jsx23("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-rose-50 text-rose-600 border-rose-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx23(FileText3, { className: "w-4 h-4" }) }),
|
|
14091
|
+
/* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
|
|
14092
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
|
|
14093
|
+
/* @__PURE__ */ jsx23("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: hasValidMedia ? docFilename : void 0, children: hasValidMedia ? docFilename : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05DE\u05E1\u05DE\u05DA" })
|
|
13947
14094
|
] })
|
|
13948
|
-
] }) : /* @__PURE__ */
|
|
13949
|
-
/* @__PURE__ */
|
|
13950
|
-
/* @__PURE__ */
|
|
13951
|
-
/* @__PURE__ */
|
|
13952
|
-
/* @__PURE__ */
|
|
14095
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
14096
|
+
/* @__PURE__ */ jsx23("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-indigo-50 text-indigo-600 border-indigo-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx23(Video2, { className: "w-4 h-4" }) }),
|
|
14097
|
+
/* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
|
|
14098
|
+
/* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" }),
|
|
14099
|
+
/* @__PURE__ */ jsx23("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5" })
|
|
13953
14100
|
] })
|
|
13954
14101
|
] }) }),
|
|
13955
|
-
/* @__PURE__ */
|
|
13956
|
-
hasValidMedia ? /* @__PURE__ */
|
|
13957
|
-
/* @__PURE__ */
|
|
14102
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
14103
|
+
hasValidMedia ? /* @__PURE__ */ jsxs19("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-emerald-800 px-2 py-0.5 bg-emerald-50 border border-emerald-200 rounded-lg", children: [
|
|
14104
|
+
/* @__PURE__ */ jsx23(CheckCircle23, { className: "w-3 h-3 text-emerald-600" }),
|
|
13958
14105
|
"\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF"
|
|
13959
|
-
] }) : /* @__PURE__ */
|
|
13960
|
-
/* @__PURE__ */
|
|
14106
|
+
] }) : /* @__PURE__ */ jsxs19("span", { className: "inline-flex items-center gap-1 text-[10px] font-semibold text-amber-800 px-2 py-0.5 bg-amber-50 border border-amber-200 rounded-lg", children: [
|
|
14107
|
+
/* @__PURE__ */ jsx23(AlertCircle3, { className: "w-3 h-3 text-amber-600 shrink-0" }),
|
|
13961
14108
|
"\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5"
|
|
13962
14109
|
] }),
|
|
13963
|
-
hasValidMedia && /* @__PURE__ */
|
|
14110
|
+
hasValidMedia && /* @__PURE__ */ jsx23(
|
|
13964
14111
|
"a",
|
|
13965
14112
|
{
|
|
13966
14113
|
href: headerMediaUrl,
|
|
@@ -13968,10 +14115,10 @@ function TemplateSelectionBlock({
|
|
|
13968
14115
|
rel: "noopener noreferrer",
|
|
13969
14116
|
title: "\u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4 \u05E9\u05DC \u05D4\u05E7\u05D5\u05D1\u05E5",
|
|
13970
14117
|
className: "p-1 text-slate-400 hover:text-emerald-700 hover:bg-slate-200/60 rounded-md transition-colors",
|
|
13971
|
-
children: /* @__PURE__ */
|
|
14118
|
+
children: /* @__PURE__ */ jsx23(ExternalLink4, { className: "w-3.5 h-3.5" })
|
|
13972
14119
|
}
|
|
13973
14120
|
),
|
|
13974
|
-
/* @__PURE__ */
|
|
14121
|
+
/* @__PURE__ */ jsx23(
|
|
13975
14122
|
"input",
|
|
13976
14123
|
{
|
|
13977
14124
|
ref: fileInputRef,
|
|
@@ -13989,7 +14136,7 @@ function TemplateSelectionBlock({
|
|
|
13989
14136
|
disabled: isUploadingMedia
|
|
13990
14137
|
}
|
|
13991
14138
|
),
|
|
13992
|
-
/* @__PURE__ */
|
|
14139
|
+
/* @__PURE__ */ jsx23(
|
|
13993
14140
|
"button",
|
|
13994
14141
|
{
|
|
13995
14142
|
type: "button",
|
|
@@ -14000,39 +14147,39 @@ function TemplateSelectionBlock({
|
|
|
14000
14147
|
},
|
|
14001
14148
|
className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-lg transition-colors border shadow-2xs ${isUploadingMedia ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed" : hasValidMedia ? "bg-white text-slate-700 hover:bg-slate-50 border-slate-200 hover:border-slate-300" : "bg-emerald-600 text-white hover:bg-emerald-700 border-emerald-600"}`,
|
|
14002
14149
|
title: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DE\u05D3\u05D9\u05D4 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5" : `${uploadButtonLabel} \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5`,
|
|
14003
|
-
children: isUploadingMedia ? /* @__PURE__ */
|
|
14004
|
-
/* @__PURE__ */
|
|
14005
|
-
/* @__PURE__ */
|
|
14006
|
-
] }) : /* @__PURE__ */
|
|
14007
|
-
/* @__PURE__ */
|
|
14008
|
-
/* @__PURE__ */
|
|
14150
|
+
children: isUploadingMedia ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
14151
|
+
/* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 animate-spin" }),
|
|
14152
|
+
/* @__PURE__ */ jsx23("span", { children: "\u05DE\u05E2\u05DC\u05D4..." })
|
|
14153
|
+
] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
14154
|
+
/* @__PURE__ */ jsx23(Upload3, { className: "w-3.5 h-3.5" }),
|
|
14155
|
+
/* @__PURE__ */ jsx23("span", { children: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5" : uploadButtonLabel })
|
|
14009
14156
|
] })
|
|
14010
14157
|
}
|
|
14011
14158
|
)
|
|
14012
14159
|
] })
|
|
14013
14160
|
] });
|
|
14014
14161
|
})(),
|
|
14015
|
-
selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */
|
|
14016
|
-
/* @__PURE__ */
|
|
14017
|
-
/* @__PURE__ */
|
|
14018
|
-
/* @__PURE__ */
|
|
14162
|
+
selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */ jsxs19("div", { className: "shrink-0 flex flex-col gap-1.5 pt-2 border-t border-slate-200/80 pb-0", children: [
|
|
14163
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between shrink-0", children: [
|
|
14164
|
+
/* @__PURE__ */ jsx23("span", { className: "text-[11px] font-bold text-slate-700", children: "\u05DE\u05D9\u05E4\u05D5\u05D9 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD" }),
|
|
14165
|
+
/* @__PURE__ */ jsxs19("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-200", children: [
|
|
14019
14166
|
templateVariables.length,
|
|
14020
14167
|
" \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
|
|
14021
14168
|
] })
|
|
14022
14169
|
] }),
|
|
14023
|
-
/* @__PURE__ */
|
|
14170
|
+
/* @__PURE__ */ jsx23("div", { className: "max-h-48 overflow-y-auto space-y-1.5 pr-0.5", children: templateVariables.map((varKey) => {
|
|
14024
14171
|
var _a;
|
|
14025
14172
|
const mapping = variableMapping[varKey] || { type: "column", value: "" };
|
|
14026
14173
|
const isStatic = mapping.type === "static";
|
|
14027
14174
|
const selectedColVal = textableColumnOptions.some((o) => o.id === mapping.value) ? mapping.value : ((_a = textableColumnOptions.find((o) => o.columnName === mapping.value)) == null ? void 0 : _a.id) || mapping.value || "";
|
|
14028
|
-
return /* @__PURE__ */
|
|
14175
|
+
return /* @__PURE__ */ jsxs19(
|
|
14029
14176
|
"div",
|
|
14030
14177
|
{
|
|
14031
14178
|
className: "flex items-center gap-1.5 p-1 bg-white border border-slate-200 rounded-xl text-xs shrink-0",
|
|
14032
14179
|
children: [
|
|
14033
|
-
/* @__PURE__ */
|
|
14034
|
-
/* @__PURE__ */
|
|
14035
|
-
/* @__PURE__ */
|
|
14180
|
+
/* @__PURE__ */ jsx23("span", { className: "px-2 py-0.5 bg-emerald-50 text-emerald-800 font-mono font-bold text-[11px] rounded-lg border border-emerald-200/80 shrink-0", children: `{{${varKey}}}` }),
|
|
14181
|
+
/* @__PURE__ */ jsxs19("div", { className: "inline-flex items-center p-0.5 bg-slate-100 rounded-lg border border-slate-200/80 shrink-0 text-[10px] font-medium", children: [
|
|
14182
|
+
/* @__PURE__ */ jsx23(
|
|
14036
14183
|
"button",
|
|
14037
14184
|
{
|
|
14038
14185
|
type: "button",
|
|
@@ -14041,7 +14188,7 @@ function TemplateSelectionBlock({
|
|
|
14041
14188
|
children: "\u05E2\u05DE\u05D5\u05D3\u05D4"
|
|
14042
14189
|
}
|
|
14043
14190
|
),
|
|
14044
|
-
/* @__PURE__ */
|
|
14191
|
+
/* @__PURE__ */ jsx23(
|
|
14045
14192
|
"button",
|
|
14046
14193
|
{
|
|
14047
14194
|
type: "button",
|
|
@@ -14051,7 +14198,7 @@ function TemplateSelectionBlock({
|
|
|
14051
14198
|
}
|
|
14052
14199
|
)
|
|
14053
14200
|
] }),
|
|
14054
|
-
isStatic ? /* @__PURE__ */
|
|
14201
|
+
isStatic ? /* @__PURE__ */ jsx23(
|
|
14055
14202
|
"input",
|
|
14056
14203
|
{
|
|
14057
14204
|
type: "text",
|
|
@@ -14060,20 +14207,20 @@ function TemplateSelectionBlock({
|
|
|
14060
14207
|
placeholder: "\u05D4\u05D6\u05DF \u05E2\u05E8\u05DA \u05E7\u05D1\u05D5\u05E2 (\u05D7\u05D5\u05D1\u05D4)...",
|
|
14061
14208
|
className: `flex-1 min-w-0 h-7 px-2 text-[11px] rounded-lg border bg-white text-slate-800 placeholder:text-slate-400 focus:outline-none transition-colors ${!mapping.value || mapping.value.trim() === "" ? "border-amber-300 focus:border-amber-500 focus:ring-1 focus:ring-amber-500/20" : "border-slate-200 focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500/20"}`
|
|
14062
14209
|
}
|
|
14063
|
-
) : /* @__PURE__ */
|
|
14064
|
-
/* @__PURE__ */
|
|
14210
|
+
) : /* @__PURE__ */ jsxs19("div", { className: "relative flex-1 min-w-0", children: [
|
|
14211
|
+
/* @__PURE__ */ jsxs19(
|
|
14065
14212
|
"select",
|
|
14066
14213
|
{
|
|
14067
14214
|
value: selectedColVal,
|
|
14068
14215
|
onChange: (e) => handleVariableValueChange(varKey, e.target.value),
|
|
14069
14216
|
className: "w-full h-7 pr-2.5 pl-6 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500/20 cursor-pointer truncate appearance-none",
|
|
14070
14217
|
children: [
|
|
14071
|
-
/* @__PURE__ */
|
|
14072
|
-
textableColumnOptions.map((opt) => /* @__PURE__ */
|
|
14218
|
+
/* @__PURE__ */ jsx23("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
|
|
14219
|
+
textableColumnOptions.map((opt) => /* @__PURE__ */ jsx23("option", { value: opt.id, children: opt.label }, opt.id))
|
|
14073
14220
|
]
|
|
14074
14221
|
}
|
|
14075
14222
|
),
|
|
14076
|
-
/* @__PURE__ */
|
|
14223
|
+
/* @__PURE__ */ jsx23(ChevronDown4, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14077
14224
|
] })
|
|
14078
14225
|
]
|
|
14079
14226
|
},
|
|
@@ -14093,7 +14240,7 @@ import {
|
|
|
14093
14240
|
CheckSquare,
|
|
14094
14241
|
RefreshCw
|
|
14095
14242
|
} from "lucide-react";
|
|
14096
|
-
import { Fragment as Fragment6, jsx as
|
|
14243
|
+
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
14097
14244
|
function DynamicFiltersBlock({
|
|
14098
14245
|
filterableColumns,
|
|
14099
14246
|
filters,
|
|
@@ -14108,31 +14255,31 @@ function DynamicFiltersBlock({
|
|
|
14108
14255
|
loadTableData,
|
|
14109
14256
|
isLoadingTableData
|
|
14110
14257
|
}) {
|
|
14111
|
-
return /* @__PURE__ */
|
|
14112
|
-
/* @__PURE__ */
|
|
14113
|
-
/* @__PURE__ */
|
|
14114
|
-
/* @__PURE__ */
|
|
14115
|
-
/* @__PURE__ */
|
|
14116
|
-
/* @__PURE__ */
|
|
14117
|
-
activeFiltersCount > 0 && /* @__PURE__ */
|
|
14258
|
+
return /* @__PURE__ */ jsxs20("div", { className: "col-span-12 lg:col-span-3 min-h-[26rem] h-full flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
|
|
14259
|
+
/* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
|
|
14260
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: [
|
|
14261
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
|
|
14262
|
+
/* @__PURE__ */ jsx24(Filter3, { className: "w-4 h-4 text-emerald-600" }),
|
|
14263
|
+
/* @__PURE__ */ jsx24("span", { className: "text-xs font-bold text-slate-800", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05D3\u05D9\u05E0\u05DE\u05D9" }),
|
|
14264
|
+
activeFiltersCount > 0 && /* @__PURE__ */ jsx24("span", { className: "text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-100 text-emerald-800 border border-emerald-200", children: activeFiltersCount })
|
|
14118
14265
|
] }),
|
|
14119
|
-
activeFiltersCount > 0 && /* @__PURE__ */
|
|
14266
|
+
activeFiltersCount > 0 && /* @__PURE__ */ jsxs20(
|
|
14120
14267
|
"button",
|
|
14121
14268
|
{
|
|
14122
14269
|
type: "button",
|
|
14123
14270
|
onClick: handleClearFilters,
|
|
14124
14271
|
className: "text-[11px] text-rose-600 hover:text-rose-700 font-semibold hover:underline flex items-center gap-1 cursor-pointer",
|
|
14125
14272
|
children: [
|
|
14126
|
-
/* @__PURE__ */
|
|
14127
|
-
/* @__PURE__ */
|
|
14273
|
+
/* @__PURE__ */ jsx24(X10, { className: "w-3 h-3" }),
|
|
14274
|
+
/* @__PURE__ */ jsx24("span", { children: "\u05E0\u05E7\u05D4" })
|
|
14128
14275
|
]
|
|
14129
14276
|
}
|
|
14130
14277
|
)
|
|
14131
14278
|
] }),
|
|
14132
|
-
/* @__PURE__ */
|
|
14133
|
-
/* @__PURE__ */
|
|
14134
|
-
/* @__PURE__ */
|
|
14135
|
-
] }) : /* @__PURE__ */
|
|
14279
|
+
/* @__PURE__ */ jsx24("div", { className: "py-1", children: filterableColumns.length === 0 ? /* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center justify-center text-center p-4 text-xs text-slate-400 gap-1", children: [
|
|
14280
|
+
/* @__PURE__ */ jsx24("span", { children: "\u05D0\u05D9\u05DF \u05E9\u05D3\u05D5\u05EA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D6\u05D5" }),
|
|
14281
|
+
/* @__PURE__ */ jsx24("span", { className: "text-[10px] text-slate-400", children: "\u05E9\u05D3\u05D5\u05EA \u05DE\u05E1\u05D5\u05D2 \u05E7\u05E9\u05E8 \u05D5\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05D1\u05DC\u05D1\u05D3" })
|
|
14282
|
+
] }) : /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2", children: filterableColumns.map((col) => {
|
|
14136
14283
|
var _a, _b, _c;
|
|
14137
14284
|
const colType = (_a = col.type) == null ? void 0 : _a.toUpperCase();
|
|
14138
14285
|
const isBoolean = colType === "BOOLEAN";
|
|
@@ -14140,9 +14287,9 @@ function DynamicFiltersBlock({
|
|
|
14140
14287
|
const isActive = Boolean(currentValue);
|
|
14141
14288
|
const refTableId = ((_b = col == null ? void 0 : col.config) == null ? void 0 : _b.referencedTableId) || (col == null ? void 0 : col.referencedTableId);
|
|
14142
14289
|
const options = ((_c = getRelationOptionsForCol ? getRelationOptionsForCol(col.name) : []) == null ? void 0 : _c.length) > 0 ? getRelationOptionsForCol(col.name) : relationOptions[col.name] && relationOptions[col.name].length > 0 ? relationOptions[col.name] : refTableId && relationOptions[refTableId] && relationOptions[refTableId].length > 0 ? relationOptions[refTableId] : col.id && relationOptions[col.id] && relationOptions[col.id].length > 0 ? relationOptions[col.id] : [];
|
|
14143
|
-
return /* @__PURE__ */
|
|
14144
|
-
/* @__PURE__ */
|
|
14145
|
-
/* @__PURE__ */
|
|
14290
|
+
return /* @__PURE__ */ jsxs20("div", { className: "space-y-1", children: [
|
|
14291
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between", children: [
|
|
14292
|
+
/* @__PURE__ */ jsx24(
|
|
14146
14293
|
"label",
|
|
14147
14294
|
{
|
|
14148
14295
|
className: "text-[11px] font-semibold text-slate-700 truncate max-w-[130px]",
|
|
@@ -14150,49 +14297,49 @@ function DynamicFiltersBlock({
|
|
|
14150
14297
|
children: col.name
|
|
14151
14298
|
}
|
|
14152
14299
|
),
|
|
14153
|
-
/* @__PURE__ */
|
|
14300
|
+
/* @__PURE__ */ jsx24("span", { className: "text-[9px] text-slate-400 font-mono", children: isBoolean ? "\u05DB\u05DF/\u05DC\u05D0" : "\u05E7\u05E9\u05E8" })
|
|
14154
14301
|
] }),
|
|
14155
|
-
/* @__PURE__ */
|
|
14156
|
-
/* @__PURE__ */
|
|
14302
|
+
/* @__PURE__ */ jsxs20("div", { className: "relative", children: [
|
|
14303
|
+
/* @__PURE__ */ jsxs20(
|
|
14157
14304
|
"select",
|
|
14158
14305
|
{
|
|
14159
14306
|
value: currentValue,
|
|
14160
14307
|
onChange: (e) => handleFilterChange(col.name, e.target.value),
|
|
14161
14308
|
className: `w-full h-8 px-2 pr-2.5 pl-6 text-[11px] rounded-lg border transition-all appearance-none bg-white cursor-pointer truncate ${isActive ? "border-emerald-500 bg-emerald-50/20 text-emerald-900 font-medium ring-1 ring-emerald-500/20" : "border-slate-200 text-slate-700 hover:border-slate-300 focus:border-emerald-500"}`,
|
|
14162
14309
|
children: [
|
|
14163
|
-
/* @__PURE__ */
|
|
14164
|
-
isBoolean ? /* @__PURE__ */
|
|
14165
|
-
/* @__PURE__ */
|
|
14166
|
-
/* @__PURE__ */
|
|
14167
|
-
] }) : options.map((opt) => /* @__PURE__ */
|
|
14310
|
+
/* @__PURE__ */ jsx24("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
|
|
14311
|
+
isBoolean ? /* @__PURE__ */ jsxs20(Fragment6, { children: [
|
|
14312
|
+
/* @__PURE__ */ jsx24("option", { value: "true", children: "\u05DB\u05DF" }),
|
|
14313
|
+
/* @__PURE__ */ jsx24("option", { value: "false", children: "\u05DC\u05D0" })
|
|
14314
|
+
] }) : options.map((opt) => /* @__PURE__ */ jsx24("option", { value: opt.id || opt._id, children: getRelationOptionLabel(opt, col, relationOptions) }, opt.id || opt._id))
|
|
14168
14315
|
]
|
|
14169
14316
|
}
|
|
14170
14317
|
),
|
|
14171
|
-
/* @__PURE__ */
|
|
14318
|
+
/* @__PURE__ */ jsx24(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14172
14319
|
] })
|
|
14173
14320
|
] }, col.name);
|
|
14174
14321
|
}) }) })
|
|
14175
14322
|
] }),
|
|
14176
|
-
/* @__PURE__ */
|
|
14177
|
-
/* @__PURE__ */
|
|
14323
|
+
/* @__PURE__ */ jsxs20("div", { className: "pt-2.5 mt-2 border-t border-slate-200/80 flex items-center justify-between gap-1.5 shrink-0", children: [
|
|
14324
|
+
/* @__PURE__ */ jsxs20(
|
|
14178
14325
|
"div",
|
|
14179
14326
|
{
|
|
14180
14327
|
className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-lg text-[11px] font-semibold border transition-all ${selectedRowIds.length > 0 ? "bg-emerald-50 text-emerald-800 border-emerald-200 shadow-2xs" : "bg-white text-slate-600 border-slate-200"}`,
|
|
14181
14328
|
children: [
|
|
14182
|
-
/* @__PURE__ */
|
|
14329
|
+
/* @__PURE__ */ jsx24(
|
|
14183
14330
|
CheckSquare,
|
|
14184
14331
|
{
|
|
14185
14332
|
className: `w-3 h-3 ${selectedRowIds.length > 0 ? "text-emerald-600" : "text-slate-400"}`
|
|
14186
14333
|
}
|
|
14187
14334
|
),
|
|
14188
|
-
/* @__PURE__ */
|
|
14335
|
+
/* @__PURE__ */ jsxs20("span", { children: [
|
|
14189
14336
|
"\u05E0\u05D1\u05D7\u05E8\u05D5 ",
|
|
14190
14337
|
selectedRowIds.length
|
|
14191
14338
|
] })
|
|
14192
14339
|
]
|
|
14193
14340
|
}
|
|
14194
14341
|
),
|
|
14195
|
-
/* @__PURE__ */
|
|
14342
|
+
/* @__PURE__ */ jsx24(
|
|
14196
14343
|
"button",
|
|
14197
14344
|
{
|
|
14198
14345
|
type: "button",
|
|
@@ -14200,7 +14347,7 @@ function DynamicFiltersBlock({
|
|
|
14200
14347
|
disabled: isLoadingTableData,
|
|
14201
14348
|
className: "p-1.5 text-slate-500 hover:text-slate-800 bg-white hover:bg-slate-100 border border-slate-200 rounded-lg transition-colors cursor-pointer disabled:opacity-50 shrink-0",
|
|
14202
14349
|
title: "\u05E8\u05E2\u05E0\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9 \u05D8\u05D1\u05DC\u05D4",
|
|
14203
|
-
children: /* @__PURE__ */
|
|
14350
|
+
children: /* @__PURE__ */ jsx24(
|
|
14204
14351
|
RefreshCw,
|
|
14205
14352
|
{
|
|
14206
14353
|
className: `w-3.5 h-3.5 ${isLoadingTableData ? "animate-spin text-emerald-600" : ""}`
|
|
@@ -14223,7 +14370,7 @@ import {
|
|
|
14223
14370
|
X as X11,
|
|
14224
14371
|
CheckSquare as CheckSquare2
|
|
14225
14372
|
} from "lucide-react";
|
|
14226
|
-
import { Fragment as Fragment7, jsx as
|
|
14373
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
14227
14374
|
function SettingsAndActionsBlock({
|
|
14228
14375
|
isScanningPhoneColumns,
|
|
14229
14376
|
targetPhoneOptions,
|
|
@@ -14266,29 +14413,29 @@ function SettingsAndActionsBlock({
|
|
|
14266
14413
|
clearBroadcastSummary
|
|
14267
14414
|
}) {
|
|
14268
14415
|
var _a;
|
|
14269
|
-
return /* @__PURE__ */
|
|
14270
|
-
/* @__PURE__ */
|
|
14271
|
-
/* @__PURE__ */
|
|
14272
|
-
/* @__PURE__ */
|
|
14273
|
-
/* @__PURE__ */
|
|
14416
|
+
return /* @__PURE__ */ jsxs21("div", { className: "col-span-12 lg:col-span-4 min-h-[26rem] flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
|
|
14417
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
14418
|
+
/* @__PURE__ */ jsx25("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
|
|
14419
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm", children: "\u2699\uFE0F" }),
|
|
14420
|
+
/* @__PURE__ */ jsx25("span", { className: "text-xs font-bold text-slate-800", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D5\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA" })
|
|
14274
14421
|
] }) }),
|
|
14275
|
-
/* @__PURE__ */
|
|
14276
|
-
isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */
|
|
14277
|
-
/* @__PURE__ */
|
|
14278
|
-
/* @__PURE__ */
|
|
14279
|
-
] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */
|
|
14280
|
-
/* @__PURE__ */
|
|
14281
|
-
/* @__PURE__ */
|
|
14282
|
-
] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */
|
|
14283
|
-
/* @__PURE__ */
|
|
14284
|
-
/* @__PURE__ */
|
|
14285
|
-
/* @__PURE__ */
|
|
14286
|
-
/* @__PURE__ */
|
|
14422
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-2.5 py-1", children: [
|
|
14423
|
+
isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs21("div", { className: "p-2.5 bg-slate-100/80 border border-slate-200 rounded-xl text-slate-500 text-xs flex items-center gap-2 shadow-2xs animate-pulse", children: [
|
|
14424
|
+
/* @__PURE__ */ jsx25(Loader26, { className: "w-4 h-4 animate-spin text-emerald-600 shrink-0" }),
|
|
14425
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium text-[11px] text-slate-600", children: "\u05E1\u05D5\u05E8\u05E7 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D5\u05D1\u05D8\u05D1\u05DC\u05D0\u05D5\u05EA \u05DE\u05E7\u05D5\u05E9\u05E8\u05D5\u05EA..." })
|
|
14426
|
+
] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs21("div", { className: "p-2.5 bg-amber-50 border border-amber-200 rounded-xl text-amber-900 text-xs flex items-center gap-2 shadow-2xs", children: [
|
|
14427
|
+
/* @__PURE__ */ jsx25(AlertCircle4, { className: "w-4 h-4 text-amber-600 shrink-0" }),
|
|
14428
|
+
/* @__PURE__ */ jsx25("span", { className: "font-semibold text-[11px]", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D4 \u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4" })
|
|
14429
|
+
] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14430
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14431
|
+
/* @__PURE__ */ jsxs21("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
|
|
14432
|
+
/* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3 text-slate-400" }),
|
|
14433
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
|
|
14287
14434
|
] }),
|
|
14288
|
-
/* @__PURE__ */
|
|
14435
|
+
/* @__PURE__ */ jsx25("span", { className: "text-[9px] font-medium text-slate-500 bg-slate-100 px-1.5 py-0.5 rounded border border-slate-200", children: "\u05D6\u05D5\u05D4\u05EA\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA" })
|
|
14289
14436
|
] }),
|
|
14290
|
-
/* @__PURE__ */
|
|
14291
|
-
/* @__PURE__ */
|
|
14437
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14438
|
+
/* @__PURE__ */ jsx25(
|
|
14292
14439
|
"input",
|
|
14293
14440
|
{
|
|
14294
14441
|
type: "text",
|
|
@@ -14298,52 +14445,52 @@ function SettingsAndActionsBlock({
|
|
|
14298
14445
|
className: "w-full h-8 px-2.5 pl-7 text-[11px] rounded-lg border border-slate-200 bg-slate-100 text-slate-600 cursor-not-allowed font-medium select-none"
|
|
14299
14446
|
}
|
|
14300
14447
|
),
|
|
14301
|
-
/* @__PURE__ */
|
|
14448
|
+
/* @__PURE__ */ jsx25(Phone3, { className: "w-3.5 h-3.5 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14302
14449
|
] })
|
|
14303
|
-
] }) : /* @__PURE__ */
|
|
14304
|
-
/* @__PURE__ */
|
|
14305
|
-
/* @__PURE__ */
|
|
14306
|
-
/* @__PURE__ */
|
|
14307
|
-
/* @__PURE__ */
|
|
14450
|
+
] }) : /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14451
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14452
|
+
/* @__PURE__ */ jsxs21("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
|
|
14453
|
+
/* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3 text-slate-400" }),
|
|
14454
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
|
|
14308
14455
|
] }),
|
|
14309
|
-
/* @__PURE__ */
|
|
14456
|
+
/* @__PURE__ */ jsx25("span", { className: "text-[9px] text-slate-400", children: "\u05D7\u05D5\u05D1\u05D4" })
|
|
14310
14457
|
] }),
|
|
14311
|
-
/* @__PURE__ */
|
|
14312
|
-
/* @__PURE__ */
|
|
14458
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14459
|
+
/* @__PURE__ */ jsx25(
|
|
14313
14460
|
"select",
|
|
14314
14461
|
{
|
|
14315
14462
|
value: phoneColumnId,
|
|
14316
14463
|
onChange: (e) => setPhoneColumnId(e.target.value),
|
|
14317
14464
|
className: "w-full h-8 px-2.5 pr-2.5 pl-6 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer",
|
|
14318
|
-
children: targetPhoneOptions.map((opt) => /* @__PURE__ */
|
|
14465
|
+
children: targetPhoneOptions.map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: opt.label }, opt.id))
|
|
14319
14466
|
}
|
|
14320
14467
|
),
|
|
14321
|
-
/* @__PURE__ */
|
|
14468
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14322
14469
|
] })
|
|
14323
14470
|
] }),
|
|
14324
|
-
/* @__PURE__ */
|
|
14325
|
-
/* @__PURE__ */
|
|
14326
|
-
/* @__PURE__ */
|
|
14471
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14472
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14473
|
+
/* @__PURE__ */ jsxs21(
|
|
14327
14474
|
"label",
|
|
14328
14475
|
{
|
|
14329
14476
|
htmlFor: "whatsapp-auto-select-records",
|
|
14330
14477
|
className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1 cursor-pointer",
|
|
14331
14478
|
children: [
|
|
14332
|
-
/* @__PURE__ */
|
|
14333
|
-
/* @__PURE__ */
|
|
14479
|
+
/* @__PURE__ */ jsx25(CheckSquare2, { className: "w-3 h-3 text-slate-400" }),
|
|
14480
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05D1\u05D7\u05E8 \u05E8\u05E9\u05D5\u05DE\u05D4 (\u05DB\u05DE\u05D5\u05EA \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05E8\u05D1\u05D9\u05EA)" })
|
|
14334
14481
|
]
|
|
14335
14482
|
}
|
|
14336
14483
|
),
|
|
14337
|
-
autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */
|
|
14338
|
-
/* @__PURE__ */
|
|
14339
|
-
/* @__PURE__ */
|
|
14340
|
-
/* @__PURE__ */
|
|
14484
|
+
autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 animate-in fade-in duration-150", children: [
|
|
14485
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-200/80 px-1.5 py-0.5 rounded-full flex items-center gap-1", children: [
|
|
14486
|
+
/* @__PURE__ */ jsx25("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }),
|
|
14487
|
+
/* @__PURE__ */ jsxs21("span", { children: [
|
|
14341
14488
|
"\u05E0\u05D1\u05D7\u05E8\u05D5 ",
|
|
14342
14489
|
selectedRowIdsCount,
|
|
14343
14490
|
" \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA"
|
|
14344
14491
|
] })
|
|
14345
14492
|
] }),
|
|
14346
|
-
/* @__PURE__ */
|
|
14493
|
+
/* @__PURE__ */ jsxs21(
|
|
14347
14494
|
"button",
|
|
14348
14495
|
{
|
|
14349
14496
|
type: "button",
|
|
@@ -14352,14 +14499,14 @@ function SettingsAndActionsBlock({
|
|
|
14352
14499
|
title: "\u05E0\u05E7\u05D4 \u05D1\u05D7\u05D9\u05E8\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",
|
|
14353
14500
|
"aria-label": "Clear auto select count",
|
|
14354
14501
|
children: [
|
|
14355
|
-
/* @__PURE__ */
|
|
14356
|
-
/* @__PURE__ */
|
|
14502
|
+
/* @__PURE__ */ jsx25(X11, { className: "w-3 h-3" }),
|
|
14503
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E0\u05E7\u05D4" })
|
|
14357
14504
|
]
|
|
14358
14505
|
}
|
|
14359
14506
|
)
|
|
14360
14507
|
] })
|
|
14361
14508
|
] }),
|
|
14362
|
-
/* @__PURE__ */
|
|
14509
|
+
/* @__PURE__ */ jsx25("div", { className: "relative", children: /* @__PURE__ */ jsx25(
|
|
14363
14510
|
"input",
|
|
14364
14511
|
{
|
|
14365
14512
|
id: "whatsapp-auto-select-records",
|
|
@@ -14387,19 +14534,19 @@ function SettingsAndActionsBlock({
|
|
|
14387
14534
|
}
|
|
14388
14535
|
) })
|
|
14389
14536
|
] }),
|
|
14390
|
-
(selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */
|
|
14391
|
-
/* @__PURE__ */
|
|
14392
|
-
/* @__PURE__ */
|
|
14393
|
-
/* @__PURE__ */
|
|
14537
|
+
(selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */ jsxs21("div", { className: "p-2.5 bg-emerald-50/60 border border-emerald-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: [
|
|
14538
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 pb-1 border-b border-emerald-200/60", children: [
|
|
14539
|
+
/* @__PURE__ */ jsx25(Users, { className: "w-3.5 h-3.5 text-emerald-700" }),
|
|
14540
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-[10.5px] font-bold text-emerald-900 truncate", children: [
|
|
14394
14541
|
"\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05EA\u05EA-\u05D8\u05D1\u05DC\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8\u05EA (",
|
|
14395
14542
|
selectedPhoneOption.parentColumnName,
|
|
14396
14543
|
")"
|
|
14397
14544
|
] })
|
|
14398
14545
|
] }),
|
|
14399
|
-
/* @__PURE__ */
|
|
14400
|
-
/* @__PURE__ */
|
|
14401
|
-
/* @__PURE__ */
|
|
14402
|
-
/* @__PURE__ */
|
|
14546
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14547
|
+
/* @__PURE__ */ jsx25("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E1\u05E0\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD (\u05D1\u05EA\u05EA-\u05D4\u05D8\u05D1\u05DC\u05D4) \u05DC\u05E4\u05D9 \u05E2\u05DE\u05D5\u05D3\u05D4:" }) }),
|
|
14548
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14549
|
+
/* @__PURE__ */ jsxs21(
|
|
14403
14550
|
"select",
|
|
14404
14551
|
{
|
|
14405
14552
|
value: subtableFilterColumn,
|
|
@@ -14409,10 +14556,10 @@ function SettingsAndActionsBlock({
|
|
|
14409
14556
|
},
|
|
14410
14557
|
className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
|
|
14411
14558
|
children: [
|
|
14412
|
-
/* @__PURE__ */
|
|
14559
|
+
/* @__PURE__ */ jsx25("option", { value: "", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5 (\u05DC\u05DC\u05D0 \u05E1\u05D9\u05E0\u05D5\u05DF \u05E0\u05D5\u05E1\u05E3)" }),
|
|
14413
14560
|
subtableFilterableColumns.map((col) => {
|
|
14414
14561
|
var _a2;
|
|
14415
|
-
return /* @__PURE__ */
|
|
14562
|
+
return /* @__PURE__ */ jsxs21("option", { value: col.name, children: [
|
|
14416
14563
|
col.name,
|
|
14417
14564
|
" (",
|
|
14418
14565
|
((_a2 = col.type) == null ? void 0 : _a2.toUpperCase()) === "BOOLEAN" ? "\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9" : "\u05E7\u05E9\u05E8",
|
|
@@ -14422,30 +14569,30 @@ function SettingsAndActionsBlock({
|
|
|
14422
14569
|
]
|
|
14423
14570
|
}
|
|
14424
14571
|
),
|
|
14425
|
-
/* @__PURE__ */
|
|
14572
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14426
14573
|
] })
|
|
14427
14574
|
] }),
|
|
14428
|
-
selectedSubtableFilterCol && /* @__PURE__ */
|
|
14429
|
-
/* @__PURE__ */
|
|
14430
|
-
/* @__PURE__ */
|
|
14431
|
-
!subtableFilterValue && /* @__PURE__ */
|
|
14575
|
+
selectedSubtableFilterCol && /* @__PURE__ */ jsxs21("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
|
|
14576
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14577
|
+
/* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E9\u05D4\u05E2\u05E8\u05DA \u05E9\u05DC\u05D4\u05DD \u05E9\u05D5\u05D5\u05D4 \u05DC:" }),
|
|
14578
|
+
!subtableFilterValue && /* @__PURE__ */ jsx25("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." })
|
|
14432
14579
|
] }),
|
|
14433
|
-
/* @__PURE__ */
|
|
14434
|
-
/* @__PURE__ */
|
|
14580
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14581
|
+
/* @__PURE__ */ jsxs21(
|
|
14435
14582
|
"select",
|
|
14436
14583
|
{
|
|
14437
14584
|
value: subtableFilterValue,
|
|
14438
14585
|
onChange: (e) => setSubtableFilterValue(e.target.value),
|
|
14439
14586
|
className: `w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border appearance-none cursor-pointer truncate transition-colors ${!subtableFilterValue ? "border-amber-400 bg-amber-50/30 text-slate-700 focus:border-amber-500 focus:ring-1 focus:ring-amber-500" : "border-slate-200 bg-white text-slate-700 focus:border-emerald-500"}`,
|
|
14440
14587
|
children: [
|
|
14441
|
-
/* @__PURE__ */
|
|
14442
|
-
((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */
|
|
14443
|
-
/* @__PURE__ */
|
|
14444
|
-
/* @__PURE__ */
|
|
14588
|
+
/* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF..." }),
|
|
14589
|
+
((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
14590
|
+
/* @__PURE__ */ jsx25("option", { value: "true", children: "\u05DB\u05DF (true)" }),
|
|
14591
|
+
/* @__PURE__ */ jsx25("option", { value: "false", children: "\u05DC\u05D0 (false)" })
|
|
14445
14592
|
] }) : getRelationOptionsForCol(
|
|
14446
14593
|
selectedSubtableFilterCol.name,
|
|
14447
14594
|
selectedPhoneOption.parentColumnName
|
|
14448
|
-
).map((opt) => /* @__PURE__ */
|
|
14595
|
+
).map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: getRelationOptionLabel(
|
|
14449
14596
|
opt,
|
|
14450
14597
|
selectedSubtableFilterCol,
|
|
14451
14598
|
relationOptions
|
|
@@ -14453,32 +14600,32 @@ function SettingsAndActionsBlock({
|
|
|
14453
14600
|
]
|
|
14454
14601
|
}
|
|
14455
14602
|
),
|
|
14456
|
-
/* @__PURE__ */
|
|
14603
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14457
14604
|
] })
|
|
14458
14605
|
] }),
|
|
14459
|
-
/* @__PURE__ */
|
|
14460
|
-
/* @__PURE__ */
|
|
14461
|
-
/* @__PURE__ */
|
|
14462
|
-
/* @__PURE__ */
|
|
14606
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14607
|
+
/* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05DE\u05D2\u05D1\u05DC\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05DB\u05DC \u05E9\u05D5\u05E8\u05D4 \u05E8\u05D0\u05E9\u05D9\u05EA:" }),
|
|
14608
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14609
|
+
/* @__PURE__ */ jsxs21(
|
|
14463
14610
|
"select",
|
|
14464
14611
|
{
|
|
14465
14612
|
value: subtableSendLimit,
|
|
14466
14613
|
onChange: (e) => setSubtableSendLimit(e.target.value),
|
|
14467
14614
|
className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
|
|
14468
14615
|
children: [
|
|
14469
|
-
/* @__PURE__ */
|
|
14470
|
-
/* @__PURE__ */
|
|
14471
|
-
/* @__PURE__ */
|
|
14616
|
+
/* @__PURE__ */ jsx25("option", { value: "PRIMARY", children: "\u05DC\u05E0\u05E6\u05D9\u05D2 \u05E8\u05D0\u05E9\u05D9 \u05D1\u05DC\u05D1\u05D3" }),
|
|
14617
|
+
/* @__PURE__ */ jsx25("option", { value: "FIRST", children: "\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05D3 \u05D1\u05DC\u05D1\u05D3" }),
|
|
14618
|
+
/* @__PURE__ */ jsx25("option", { value: "ALL", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD" })
|
|
14472
14619
|
]
|
|
14473
14620
|
}
|
|
14474
14621
|
),
|
|
14475
|
-
/* @__PURE__ */
|
|
14622
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14476
14623
|
] })
|
|
14477
14624
|
] })
|
|
14478
14625
|
] }),
|
|
14479
|
-
/* @__PURE__ */
|
|
14480
|
-
/* @__PURE__ */
|
|
14481
|
-
/* @__PURE__ */
|
|
14626
|
+
/* @__PURE__ */ jsxs21("div", { className: "pt-2 border-t border-slate-200/70 space-y-2", children: [
|
|
14627
|
+
/* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
|
|
14628
|
+
/* @__PURE__ */ jsx25(
|
|
14482
14629
|
"input",
|
|
14483
14630
|
{
|
|
14484
14631
|
type: "checkbox",
|
|
@@ -14495,13 +14642,13 @@ function SettingsAndActionsBlock({
|
|
|
14495
14642
|
className: "w-3.5 h-3.5 rounded border-slate-300 text-emerald-600 focus:ring-emerald-500 cursor-pointer"
|
|
14496
14643
|
}
|
|
14497
14644
|
),
|
|
14498
|
-
/* @__PURE__ */
|
|
14645
|
+
/* @__PURE__ */ jsx25("span", { className: "text-[11px] font-semibold text-slate-800", children: "\u05E2\u05D3\u05DB\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05DC\u05D0\u05D7\u05E8 \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DE\u05D5\u05E6\u05DC\u05D7\u05EA" })
|
|
14499
14646
|
] }),
|
|
14500
|
-
enablePostSendAction && /* @__PURE__ */
|
|
14501
|
-
/* @__PURE__ */
|
|
14502
|
-
/* @__PURE__ */
|
|
14503
|
-
/* @__PURE__ */
|
|
14504
|
-
selectedPostSendOption && /* @__PURE__ */
|
|
14647
|
+
enablePostSendAction && /* @__PURE__ */ jsx25("div", { className: "p-2 bg-slate-100/70 border border-slate-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: postSendActionTargetOptions.length === 0 ? /* @__PURE__ */ jsx25("div", { className: "text-[10px] text-slate-400 text-center py-1", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05E7\u05E9\u05E8 \u05D0\u05D5 \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
14648
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
14649
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14650
|
+
/* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
|
|
14651
|
+
selectedPostSendOption && /* @__PURE__ */ jsx25(
|
|
14505
14652
|
"span",
|
|
14506
14653
|
{
|
|
14507
14654
|
className: `text-[9px] font-medium px-1.5 py-0.5 rounded border ${selectedPostSendOption.targetType === "SUBTABLE" ? "bg-emerald-50 text-emerald-700 border-emerald-200" : "bg-slate-100 text-slate-600 border-slate-200"}`,
|
|
@@ -14509,8 +14656,8 @@ function SettingsAndActionsBlock({
|
|
|
14509
14656
|
}
|
|
14510
14657
|
)
|
|
14511
14658
|
] }),
|
|
14512
|
-
/* @__PURE__ */
|
|
14513
|
-
/* @__PURE__ */
|
|
14659
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14660
|
+
/* @__PURE__ */ jsxs21(
|
|
14514
14661
|
"select",
|
|
14515
14662
|
{
|
|
14516
14663
|
value: postSendActionColumn,
|
|
@@ -14523,35 +14670,35 @@ function SettingsAndActionsBlock({
|
|
|
14523
14670
|
},
|
|
14524
14671
|
className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
|
|
14525
14672
|
children: [
|
|
14526
|
-
/* @__PURE__ */
|
|
14527
|
-
postSendActionTargetOptions.map((opt) => /* @__PURE__ */
|
|
14673
|
+
/* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
|
|
14674
|
+
postSendActionTargetOptions.map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: opt.label }, opt.id))
|
|
14528
14675
|
]
|
|
14529
14676
|
}
|
|
14530
14677
|
),
|
|
14531
|
-
/* @__PURE__ */
|
|
14678
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14532
14679
|
] })
|
|
14533
14680
|
] }),
|
|
14534
|
-
selectedPostSendOption && /* @__PURE__ */
|
|
14535
|
-
/* @__PURE__ */
|
|
14536
|
-
/* @__PURE__ */
|
|
14537
|
-
!postSendActionValue && /* @__PURE__ */
|
|
14681
|
+
selectedPostSendOption && /* @__PURE__ */ jsxs21("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
|
|
14682
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14683
|
+
/* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05E8\u05DA \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
|
|
14684
|
+
!postSendActionValue && /* @__PURE__ */ jsx25("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05E2\u05E8\u05DA" })
|
|
14538
14685
|
] }),
|
|
14539
|
-
/* @__PURE__ */
|
|
14540
|
-
/* @__PURE__ */
|
|
14686
|
+
/* @__PURE__ */ jsxs21("div", { className: "relative", children: [
|
|
14687
|
+
/* @__PURE__ */ jsxs21(
|
|
14541
14688
|
"select",
|
|
14542
14689
|
{
|
|
14543
14690
|
value: postSendActionValue,
|
|
14544
14691
|
onChange: (e) => setPostSendActionValue(e.target.value),
|
|
14545
14692
|
className: `w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border appearance-none cursor-pointer truncate transition-colors ${!postSendActionValue ? "border-amber-400 bg-amber-50/30 text-slate-700 focus:border-amber-500 focus:ring-1 focus:ring-amber-500" : "border-slate-200 bg-white text-slate-700 focus:border-emerald-500"}`,
|
|
14546
14693
|
children: [
|
|
14547
|
-
/* @__PURE__ */
|
|
14548
|
-
selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */
|
|
14549
|
-
/* @__PURE__ */
|
|
14550
|
-
/* @__PURE__ */
|
|
14694
|
+
/* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." }),
|
|
14695
|
+
selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
14696
|
+
/* @__PURE__ */ jsx25("option", { value: "true", children: "\u05DB\u05DF (Yes)" }),
|
|
14697
|
+
/* @__PURE__ */ jsx25("option", { value: "false", children: "\u05DC\u05D0 (No)" })
|
|
14551
14698
|
] }) : getRelationOptionsForCol(
|
|
14552
14699
|
selectedPostSendOption.columnName,
|
|
14553
14700
|
selectedPostSendOption.parentColumnName
|
|
14554
|
-
).map((opt) => /* @__PURE__ */
|
|
14701
|
+
).map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: getRelationOptionLabel(
|
|
14555
14702
|
opt,
|
|
14556
14703
|
selectedPostSendOption,
|
|
14557
14704
|
relationOptions
|
|
@@ -14559,15 +14706,15 @@ function SettingsAndActionsBlock({
|
|
|
14559
14706
|
]
|
|
14560
14707
|
}
|
|
14561
14708
|
),
|
|
14562
|
-
/* @__PURE__ */
|
|
14709
|
+
/* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
14563
14710
|
] })
|
|
14564
14711
|
] })
|
|
14565
14712
|
] }) })
|
|
14566
14713
|
] })
|
|
14567
14714
|
] })
|
|
14568
14715
|
] }),
|
|
14569
|
-
/* @__PURE__ */
|
|
14570
|
-
/* @__PURE__ */
|
|
14716
|
+
/* @__PURE__ */ jsxs21("div", { className: "mt-auto pt-2.5 border-t border-slate-200/80 space-y-2 shrink-0", children: [
|
|
14717
|
+
/* @__PURE__ */ jsxs21(
|
|
14571
14718
|
"button",
|
|
14572
14719
|
{
|
|
14573
14720
|
type: "button",
|
|
@@ -14576,23 +14723,23 @@ function SettingsAndActionsBlock({
|
|
|
14576
14723
|
className: `w-full h-8 px-3 text-xs font-semibold rounded-xl border transition-all flex items-center justify-center gap-1.5 ${isTestDisabled || isSendingBroadcast ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60" : "bg-white hover:bg-slate-50 text-slate-700 border-slate-200 active:scale-[0.98] cursor-pointer shadow-2xs"}`,
|
|
14577
14724
|
title: testButtonTitle,
|
|
14578
14725
|
children: [
|
|
14579
|
-
/* @__PURE__ */
|
|
14580
|
-
/* @__PURE__ */
|
|
14726
|
+
/* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3" }),
|
|
14727
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E9\u05DC\u05D7 \u05D8\u05E1\u05D8" })
|
|
14581
14728
|
]
|
|
14582
14729
|
}
|
|
14583
14730
|
),
|
|
14584
|
-
isSendingBroadcast ? /* @__PURE__ */
|
|
14731
|
+
isSendingBroadcast ? /* @__PURE__ */ jsxs21(
|
|
14585
14732
|
"div",
|
|
14586
14733
|
{
|
|
14587
14734
|
className: "w-full bg-white border border-emerald-200 rounded-xl p-2.5 shadow-xs space-y-2 animate-in fade-in duration-200",
|
|
14588
14735
|
"data-testid": "live-broadcast-progress",
|
|
14589
14736
|
children: [
|
|
14590
|
-
/* @__PURE__ */
|
|
14591
|
-
/* @__PURE__ */
|
|
14592
|
-
/* @__PURE__ */
|
|
14593
|
-
/* @__PURE__ */
|
|
14737
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-700", children: [
|
|
14738
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 text-emerald-800 font-bold", children: [
|
|
14739
|
+
/* @__PURE__ */ jsx25(Loader26, { className: "w-3.5 h-3.5 animate-spin text-emerald-600 shrink-0" }),
|
|
14740
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E9\u05D5\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05EA\u05E4\u05D5\u05E6\u05D4..." })
|
|
14594
14741
|
] }),
|
|
14595
|
-
/* @__PURE__ */
|
|
14742
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-emerald-700 font-bold", children: [
|
|
14596
14743
|
(broadcastProgress == null ? void 0 : broadcastProgress.percent) || 0,
|
|
14597
14744
|
"% (",
|
|
14598
14745
|
(broadcastProgress == null ? void 0 : broadcastProgress.current) || 0,
|
|
@@ -14601,7 +14748,7 @@ function SettingsAndActionsBlock({
|
|
|
14601
14748
|
")"
|
|
14602
14749
|
] })
|
|
14603
14750
|
] }),
|
|
14604
|
-
/* @__PURE__ */
|
|
14751
|
+
/* @__PURE__ */ jsx25("div", { className: "w-full h-2.5 bg-slate-100 rounded-full overflow-hidden border border-slate-200", children: /* @__PURE__ */ jsx25(
|
|
14605
14752
|
"div",
|
|
14606
14753
|
{
|
|
14607
14754
|
className: "h-full bg-emerald-500 rounded-full transition-all duration-300 ease-out",
|
|
@@ -14610,18 +14757,18 @@ function SettingsAndActionsBlock({
|
|
|
14610
14757
|
}
|
|
14611
14758
|
}
|
|
14612
14759
|
) }),
|
|
14613
|
-
/* @__PURE__ */
|
|
14614
|
-
/* @__PURE__ */
|
|
14615
|
-
/* @__PURE__ */
|
|
14616
|
-
/* @__PURE__ */
|
|
14760
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-around pt-1 text-[11px] font-medium border-t border-slate-100", children: [
|
|
14761
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-emerald-700 flex items-center gap-1", title: "\u05E0\u05E9\u05DC\u05D7\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4", children: [
|
|
14762
|
+
/* @__PURE__ */ jsx25("span", { children: "\u2705" }),
|
|
14763
|
+
/* @__PURE__ */ jsx25("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.successful) || 0 })
|
|
14617
14764
|
] }),
|
|
14618
|
-
/* @__PURE__ */
|
|
14619
|
-
/* @__PURE__ */
|
|
14620
|
-
/* @__PURE__ */
|
|
14765
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-rose-600 flex items-center gap-1", title: "\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4", children: [
|
|
14766
|
+
/* @__PURE__ */ jsx25("span", { children: "\u274C" }),
|
|
14767
|
+
/* @__PURE__ */ jsx25("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.failed) || 0 })
|
|
14621
14768
|
] }),
|
|
14622
|
-
/* @__PURE__ */
|
|
14623
|
-
/* @__PURE__ */
|
|
14624
|
-
/* @__PURE__ */
|
|
14769
|
+
/* @__PURE__ */ jsxs21("span", { className: "text-amber-700 flex items-center gap-1", title: "\u05E9\u05D5\u05E8\u05D5\u05EA \u05E9\u05D3\u05D5\u05DC\u05D2\u05D5 \u05DC\u05DC\u05D0 \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF", children: [
|
|
14770
|
+
/* @__PURE__ */ jsx25("span", { children: "\u26A0\uFE0F" }),
|
|
14771
|
+
/* @__PURE__ */ jsxs21("span", { className: "font-bold", children: [
|
|
14625
14772
|
(broadcastProgress == null ? void 0 : broadcastProgress.skipped) || 0,
|
|
14626
14773
|
" \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
|
|
14627
14774
|
] })
|
|
@@ -14629,8 +14776,8 @@ function SettingsAndActionsBlock({
|
|
|
14629
14776
|
] })
|
|
14630
14777
|
]
|
|
14631
14778
|
}
|
|
14632
|
-
) : /* @__PURE__ */
|
|
14633
|
-
/* @__PURE__ */
|
|
14779
|
+
) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
14780
|
+
/* @__PURE__ */ jsxs21(
|
|
14634
14781
|
"button",
|
|
14635
14782
|
{
|
|
14636
14783
|
type: "button",
|
|
@@ -14639,56 +14786,56 @@ function SettingsAndActionsBlock({
|
|
|
14639
14786
|
className: `w-full h-9 px-3 text-xs font-bold rounded-xl shadow-xs transition-all flex items-center justify-center gap-2 ${isSendDisabled ? "bg-emerald-600/40 text-white/70 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] text-white cursor-pointer"}`,
|
|
14640
14787
|
title: sendButtonTitle,
|
|
14641
14788
|
children: [
|
|
14642
|
-
/* @__PURE__ */
|
|
14643
|
-
/* @__PURE__ */
|
|
14789
|
+
/* @__PURE__ */ jsx25(Send, { className: "w-3.5 h-3.5" }),
|
|
14790
|
+
/* @__PURE__ */ jsx25("span", { children: finalRecipientCount > 0 ? `\u05E9\u05DC\u05D7 \u05DC-${finalRecipientCount} \u05E0\u05DE\u05E2\u05E0\u05D9\u05DD` : "\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" })
|
|
14644
14791
|
]
|
|
14645
14792
|
}
|
|
14646
14793
|
),
|
|
14647
|
-
validMainRowsCount > 0 && /* @__PURE__ */
|
|
14794
|
+
validMainRowsCount > 0 && /* @__PURE__ */ jsxs21("div", { className: "text-center text-[10.5px] text-slate-500 font-medium pt-0.5", children: [
|
|
14648
14795
|
"\u05DE\u05EA\u05D5\u05DA ",
|
|
14649
14796
|
validMainRowsCount,
|
|
14650
14797
|
" \u05E9\u05D5\u05E8\u05D5\u05EA \u05E8\u05D0\u05E9\u05D9\u05D5\u05EA"
|
|
14651
14798
|
] }),
|
|
14652
|
-
broadcastSummary && /* @__PURE__ */
|
|
14799
|
+
broadcastSummary && /* @__PURE__ */ jsxs21(
|
|
14653
14800
|
"div",
|
|
14654
14801
|
{
|
|
14655
14802
|
className: "w-full bg-slate-50/90 border border-slate-200/90 rounded-xl p-2.5 shadow-2xs space-y-2 animate-in fade-in duration-200",
|
|
14656
14803
|
"data-testid": "broadcast-summary-card",
|
|
14657
14804
|
children: [
|
|
14658
|
-
/* @__PURE__ */
|
|
14659
|
-
/* @__PURE__ */
|
|
14660
|
-
/* @__PURE__ */
|
|
14661
|
-
/* @__PURE__ */
|
|
14805
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
14806
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 text-[11px] font-bold text-slate-700", children: [
|
|
14807
|
+
/* @__PURE__ */ jsx25("span", { className: "text-xs", children: "\u{1F4CA}" }),
|
|
14808
|
+
/* @__PURE__ */ jsx25("span", { children: "\u05E1\u05D9\u05DB\u05D5\u05DD \u05E9\u05D9\u05D3\u05D5\u05E8 \u05D0\u05D7\u05E8\u05D5\u05DF" })
|
|
14662
14809
|
] }),
|
|
14663
|
-
clearBroadcastSummary && /* @__PURE__ */
|
|
14810
|
+
clearBroadcastSummary && /* @__PURE__ */ jsx25(
|
|
14664
14811
|
"button",
|
|
14665
14812
|
{
|
|
14666
14813
|
type: "button",
|
|
14667
14814
|
onClick: clearBroadcastSummary,
|
|
14668
14815
|
className: "text-slate-400 hover:text-slate-600 p-0.5 rounded-md hover:bg-slate-200/60 transition-colors cursor-pointer",
|
|
14669
14816
|
title: "\u05E1\u05D2\u05D5\u05E8 \u05E1\u05D9\u05DB\u05D5\u05DD",
|
|
14670
|
-
children: /* @__PURE__ */
|
|
14817
|
+
children: /* @__PURE__ */ jsx25(X11, { className: "w-3.5 h-3.5" })
|
|
14671
14818
|
}
|
|
14672
14819
|
)
|
|
14673
14820
|
] }),
|
|
14674
|
-
/* @__PURE__ */
|
|
14675
|
-
/* @__PURE__ */
|
|
14676
|
-
/* @__PURE__ */
|
|
14677
|
-
/* @__PURE__ */
|
|
14821
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-1.5 pt-0.5", children: [
|
|
14822
|
+
/* @__PURE__ */ jsxs21("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/80", children: [
|
|
14823
|
+
/* @__PURE__ */ jsx25("span", { children: "\u2705" }),
|
|
14824
|
+
/* @__PURE__ */ jsxs21("span", { children: [
|
|
14678
14825
|
broadcastSummary.successful,
|
|
14679
14826
|
" \u05E0\u05E9\u05DC\u05D7\u05D5"
|
|
14680
14827
|
] })
|
|
14681
14828
|
] }),
|
|
14682
|
-
broadcastSummary.failed > 0 && /* @__PURE__ */
|
|
14683
|
-
/* @__PURE__ */
|
|
14684
|
-
/* @__PURE__ */
|
|
14829
|
+
broadcastSummary.failed > 0 && /* @__PURE__ */ jsxs21("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-rose-50 text-rose-700 border border-rose-200/80", children: [
|
|
14830
|
+
/* @__PURE__ */ jsx25("span", { children: "\u274C" }),
|
|
14831
|
+
/* @__PURE__ */ jsxs21("span", { children: [
|
|
14685
14832
|
broadcastSummary.failed,
|
|
14686
14833
|
" \u05E0\u05DB\u05E9\u05DC\u05D5"
|
|
14687
14834
|
] })
|
|
14688
14835
|
] }),
|
|
14689
|
-
broadcastSummary.skipped > 0 && /* @__PURE__ */
|
|
14690
|
-
/* @__PURE__ */
|
|
14691
|
-
/* @__PURE__ */
|
|
14836
|
+
broadcastSummary.skipped > 0 && /* @__PURE__ */ jsxs21("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-amber-50 text-amber-700 border border-amber-200/80", children: [
|
|
14837
|
+
/* @__PURE__ */ jsx25("span", { children: "\u26A0\uFE0F" }),
|
|
14838
|
+
/* @__PURE__ */ jsxs21("span", { children: [
|
|
14692
14839
|
broadcastSummary.skipped,
|
|
14693
14840
|
" \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
|
|
14694
14841
|
] })
|
|
@@ -14703,19 +14850,19 @@ function SettingsAndActionsBlock({
|
|
|
14703
14850
|
}
|
|
14704
14851
|
|
|
14705
14852
|
// src/components/WhatsAppComponent/inbox/useInboxState.ts
|
|
14706
|
-
import { useState as
|
|
14853
|
+
import { useState as useState20, useEffect as useEffect17, useCallback as useCallback16, useRef as useRef18 } from "react";
|
|
14707
14854
|
function useInboxState(orgId, actions) {
|
|
14708
|
-
const [conversations, setConversations] =
|
|
14709
|
-
const [activeConversationId, setActiveConversationId] =
|
|
14710
|
-
const [messages, setMessages] =
|
|
14711
|
-
const [isLoading, setIsLoading] =
|
|
14712
|
-
const [isSending, setIsSending] =
|
|
14713
|
-
const [error, setError] =
|
|
14855
|
+
const [conversations, setConversations] = useState20([]);
|
|
14856
|
+
const [activeConversationId, setActiveConversationId] = useState20(null);
|
|
14857
|
+
const [messages, setMessages] = useState20([]);
|
|
14858
|
+
const [isLoading, setIsLoading] = useState20(false);
|
|
14859
|
+
const [isSending, setIsSending] = useState20(false);
|
|
14860
|
+
const [error, setError] = useState20(null);
|
|
14714
14861
|
const actionsRef = useRef18(actions);
|
|
14715
14862
|
useEffect17(() => {
|
|
14716
14863
|
actionsRef.current = actions;
|
|
14717
14864
|
});
|
|
14718
|
-
const fetchConversations =
|
|
14865
|
+
const fetchConversations = useCallback16(async () => {
|
|
14719
14866
|
if (!orgId) return;
|
|
14720
14867
|
const res = await actionsRef.current.getConversations(orgId);
|
|
14721
14868
|
if (res.success && res.data) {
|
|
@@ -14724,7 +14871,7 @@ function useInboxState(orgId, actions) {
|
|
|
14724
14871
|
setError(res.error);
|
|
14725
14872
|
}
|
|
14726
14873
|
}, [orgId]);
|
|
14727
|
-
const fetchMessages =
|
|
14874
|
+
const fetchMessages = useCallback16(async (conversationId, silent = false) => {
|
|
14728
14875
|
if (!silent) setIsLoading(true);
|
|
14729
14876
|
const res = await actionsRef.current.getMessages(conversationId);
|
|
14730
14877
|
if (res.success && res.data) {
|
|
@@ -14786,14 +14933,14 @@ function useInboxState(orgId, actions) {
|
|
|
14786
14933
|
|
|
14787
14934
|
// src/components/WhatsAppComponent/inbox/ConversationList.tsx
|
|
14788
14935
|
import { Search as Search4, User } from "lucide-react";
|
|
14789
|
-
import { jsx as
|
|
14936
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
14790
14937
|
function ConversationList({ conversations, activeId, onSelect }) {
|
|
14791
|
-
return /* @__PURE__ */
|
|
14792
|
-
/* @__PURE__ */
|
|
14793
|
-
/* @__PURE__ */
|
|
14794
|
-
/* @__PURE__ */
|
|
14795
|
-
/* @__PURE__ */
|
|
14796
|
-
/* @__PURE__ */
|
|
14938
|
+
return /* @__PURE__ */ jsxs22("div", { className: "w-80 border-l border-slate-200 bg-white flex flex-col h-full shrink-0", children: [
|
|
14939
|
+
/* @__PURE__ */ jsxs22("div", { className: "p-4 border-b border-slate-100 bg-slate-50", children: [
|
|
14940
|
+
/* @__PURE__ */ jsx26("h2", { className: "text-lg font-bold text-slate-800 mb-3", children: "\u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05DB\u05E0\u05E1\u05D5\u05EA" }),
|
|
14941
|
+
/* @__PURE__ */ jsxs22("div", { className: "relative", children: [
|
|
14942
|
+
/* @__PURE__ */ jsx26(Search4, { className: "w-4 h-4 absolute right-3 top-1/2 -translate-y-1/2 text-slate-400" }),
|
|
14943
|
+
/* @__PURE__ */ jsx26(
|
|
14797
14944
|
"input",
|
|
14798
14945
|
{
|
|
14799
14946
|
type: "text",
|
|
@@ -14803,27 +14950,27 @@ function ConversationList({ conversations, activeId, onSelect }) {
|
|
|
14803
14950
|
)
|
|
14804
14951
|
] })
|
|
14805
14952
|
] }),
|
|
14806
|
-
/* @__PURE__ */
|
|
14953
|
+
/* @__PURE__ */ jsx26("div", { className: "flex-1 overflow-y-auto", children: (() => {
|
|
14807
14954
|
const sortedConversations = [...conversations].sort(
|
|
14808
14955
|
(a, b) => new Date(b.lastMessageAt).getTime() - new Date(a.lastMessageAt).getTime()
|
|
14809
14956
|
);
|
|
14810
|
-
return sortedConversations.length === 0 ? /* @__PURE__ */
|
|
14957
|
+
return sortedConversations.length === 0 ? /* @__PURE__ */ jsx26("div", { className: "p-6 text-center text-sm text-slate-400", children: "\u05D0\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E4\u05E2\u05D9\u05DC\u05D5\u05EA" }) : sortedConversations.map((conv) => {
|
|
14811
14958
|
var _a, _b;
|
|
14812
|
-
return /* @__PURE__ */
|
|
14959
|
+
return /* @__PURE__ */ jsxs22(
|
|
14813
14960
|
"button",
|
|
14814
14961
|
{
|
|
14815
14962
|
onClick: () => onSelect(conv.id),
|
|
14816
14963
|
className: `w-full text-right p-4 border-b border-slate-100 transition-colors hover:bg-slate-50 flex items-start gap-3 ${activeId === conv.id ? "bg-emerald-50/50 border-r-4 border-r-emerald-500" : "border-r-4 border-r-transparent"}`,
|
|
14817
14964
|
children: [
|
|
14818
|
-
/* @__PURE__ */
|
|
14819
|
-
/* @__PURE__ */
|
|
14820
|
-
/* @__PURE__ */
|
|
14821
|
-
/* @__PURE__ */
|
|
14822
|
-
/* @__PURE__ */
|
|
14965
|
+
/* @__PURE__ */ jsx26("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx26(User, { className: "w-5 h-5 text-slate-500" }) }),
|
|
14966
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex-1 overflow-hidden", children: [
|
|
14967
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex justify-between items-center mb-1", children: [
|
|
14968
|
+
/* @__PURE__ */ jsx26("span", { className: "font-semibold text-slate-800 text-sm truncate", children: conv.contactName || conv.contactPhone }),
|
|
14969
|
+
/* @__PURE__ */ jsx26("span", { className: "text-[10px] text-slate-400", children: new Date(conv.lastMessageAt).toLocaleTimeString("he-IL", { hour: "2-digit", minute: "2-digit" }) })
|
|
14823
14970
|
] }),
|
|
14824
|
-
/* @__PURE__ */
|
|
14825
|
-
/* @__PURE__ */
|
|
14826
|
-
conv.unreadCount > 0 && /* @__PURE__ */
|
|
14971
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex justify-between items-center", children: [
|
|
14972
|
+
/* @__PURE__ */ jsx26("p", { className: "text-xs text-slate-500 truncate w-4/5", children: ((_b = (_a = conv.messages) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) || "\u05D0\u05D9\u05DF \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" }),
|
|
14973
|
+
conv.unreadCount > 0 && /* @__PURE__ */ jsx26("span", { className: "bg-emerald-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full min-w-[20px] text-center", children: conv.unreadCount })
|
|
14827
14974
|
] })
|
|
14828
14975
|
] })
|
|
14829
14976
|
]
|
|
@@ -14836,11 +14983,11 @@ function ConversationList({ conversations, activeId, onSelect }) {
|
|
|
14836
14983
|
}
|
|
14837
14984
|
|
|
14838
14985
|
// src/components/WhatsAppComponent/inbox/ChatWindow.tsx
|
|
14839
|
-
import { useState as
|
|
14986
|
+
import { useState as useState21, useRef as useRef19, useEffect as useEffect18 } from "react";
|
|
14840
14987
|
import { Send as Send2, User as User2, Loader2 as Loader27 } from "lucide-react";
|
|
14841
|
-
import { jsx as
|
|
14988
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
14842
14989
|
function ChatWindow({ activeConversation, messages, isLoading, isSending, onSendMessage }) {
|
|
14843
|
-
const [inputText, setInputText] =
|
|
14990
|
+
const [inputText, setInputText] = useState21("");
|
|
14844
14991
|
const messagesTopRef = useRef19(null);
|
|
14845
14992
|
const scrollToTop = () => {
|
|
14846
14993
|
var _a;
|
|
@@ -14856,34 +15003,34 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
|
|
|
14856
15003
|
setInputText("");
|
|
14857
15004
|
};
|
|
14858
15005
|
if (!activeConversation) {
|
|
14859
|
-
return /* @__PURE__ */
|
|
14860
|
-
/* @__PURE__ */
|
|
14861
|
-
/* @__PURE__ */
|
|
15006
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex-1 bg-slate-50 flex items-center justify-center flex-col gap-4 text-slate-400", children: [
|
|
15007
|
+
/* @__PURE__ */ jsx27("div", { className: "w-16 h-16 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx27("svg", { className: "w-8 h-8 text-slate-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }),
|
|
15008
|
+
/* @__PURE__ */ jsx27("p", { children: "\u05D1\u05D7\u05E8 \u05E9\u05D9\u05D7\u05D4 \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC" })
|
|
14862
15009
|
] });
|
|
14863
15010
|
}
|
|
14864
|
-
return /* @__PURE__ */
|
|
14865
|
-
/* @__PURE__ */
|
|
14866
|
-
/* @__PURE__ */
|
|
14867
|
-
/* @__PURE__ */
|
|
14868
|
-
/* @__PURE__ */
|
|
14869
|
-
/* @__PURE__ */
|
|
15011
|
+
return /* @__PURE__ */ jsxs23("div", { className: "flex-1 flex flex-col bg-[#efeae2] h-full relative", children: [
|
|
15012
|
+
/* @__PURE__ */ jsxs23("div", { className: "h-16 bg-white border-b border-slate-200 px-6 flex items-center gap-3 shrink-0 z-10 shadow-sm", children: [
|
|
15013
|
+
/* @__PURE__ */ jsx27("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx27(User2, { className: "w-5 h-5 text-slate-500" }) }),
|
|
15014
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
15015
|
+
/* @__PURE__ */ jsx27("h3", { className: "font-bold text-slate-800", children: activeConversation.contactName || activeConversation.contactPhone }),
|
|
15016
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs text-slate-500", dir: "ltr", children: activeConversation.contactPhone })
|
|
14870
15017
|
] })
|
|
14871
15018
|
] }),
|
|
14872
|
-
/* @__PURE__ */
|
|
14873
|
-
/* @__PURE__ */
|
|
14874
|
-
isLoading ? /* @__PURE__ */
|
|
15019
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex-1 overflow-y-auto p-6 space-y-4", children: [
|
|
15020
|
+
/* @__PURE__ */ jsx27("div", { ref: messagesTopRef }),
|
|
15021
|
+
isLoading ? /* @__PURE__ */ jsx27("div", { className: "flex justify-center py-10", children: /* @__PURE__ */ jsx27(Loader27, { className: "w-6 h-6 animate-spin text-emerald-600" }) }) : messages.map((msg, idx) => {
|
|
14875
15022
|
const isOutbound = msg.direction === "OUTBOUND";
|
|
14876
|
-
return /* @__PURE__ */
|
|
14877
|
-
/* @__PURE__ */
|
|
14878
|
-
/* @__PURE__ */
|
|
15023
|
+
return /* @__PURE__ */ jsx27("div", { className: `flex ${isOutbound ? "justify-start" : "justify-end"}`, children: /* @__PURE__ */ jsxs23("div", { className: `max-w-[70%] rounded-2xl px-4 py-2 shadow-sm relative ${isOutbound ? "bg-[#d9fdd3] text-slate-900 rounded-tr-none" : "bg-white text-slate-900 rounded-tl-none"}`, children: [
|
|
15024
|
+
/* @__PURE__ */ jsx27("p", { className: "text-sm whitespace-pre-wrap", children: msg.content }),
|
|
15025
|
+
/* @__PURE__ */ jsxs23("div", { className: "text-[11px] text-slate-600 mt-1 text-left flex items-center justify-end gap-1", children: [
|
|
14879
15026
|
new Date(msg.createdAt).toLocaleString("he-IL", { day: "2-digit", month: "2-digit", year: "numeric", hour: "2-digit", minute: "2-digit" }),
|
|
14880
|
-
isOutbound && /* @__PURE__ */
|
|
15027
|
+
isOutbound && /* @__PURE__ */ jsx27("span", { className: msg.status === "READ" || msg.status === "DELIVERED" ? "text-blue-500" : "text-slate-500", children: msg.status === "READ" ? "\u2713\u2713" : msg.status === "DELIVERED" ? "\u2713\u2713" : "\u2713" })
|
|
14881
15028
|
] })
|
|
14882
15029
|
] }) }, msg.id || idx);
|
|
14883
15030
|
})
|
|
14884
15031
|
] }),
|
|
14885
|
-
/* @__PURE__ */
|
|
14886
|
-
/* @__PURE__ */
|
|
15032
|
+
/* @__PURE__ */ jsx27("div", { className: "bg-slate-50 p-4 border-t border-slate-200 shrink-0", children: /* @__PURE__ */ jsxs23("form", { onSubmit: handleSend, className: "flex items-end gap-2 max-w-4xl mx-auto", children: [
|
|
15033
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1 bg-white border border-slate-300 rounded-2xl overflow-hidden focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500", children: /* @__PURE__ */ jsx27(
|
|
14887
15034
|
"textarea",
|
|
14888
15035
|
{
|
|
14889
15036
|
rows: 1,
|
|
@@ -14899,13 +15046,13 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
|
|
|
14899
15046
|
className: "w-full max-h-32 min-h-[44px] p-3 text-sm bg-transparent outline-none resize-none"
|
|
14900
15047
|
}
|
|
14901
15048
|
) }),
|
|
14902
|
-
/* @__PURE__ */
|
|
15049
|
+
/* @__PURE__ */ jsx27(
|
|
14903
15050
|
"button",
|
|
14904
15051
|
{
|
|
14905
15052
|
type: "submit",
|
|
14906
15053
|
disabled: !inputText.trim() || isSending,
|
|
14907
15054
|
className: `w-11 h-11 rounded-full flex items-center justify-center shrink-0 transition-colors ${!inputText.trim() || isSending ? "bg-slate-200 text-slate-400" : "bg-emerald-600 hover:bg-emerald-700 text-white shadow-md"}`,
|
|
14908
|
-
children: isSending ? /* @__PURE__ */
|
|
15055
|
+
children: isSending ? /* @__PURE__ */ jsx27(Loader27, { className: "w-5 h-5 animate-spin" }) : /* @__PURE__ */ jsx27(Send2, { className: "w-5 h-5 -ml-1" })
|
|
14909
15056
|
}
|
|
14910
15057
|
)
|
|
14911
15058
|
] }) })
|
|
@@ -14913,7 +15060,7 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
|
|
|
14913
15060
|
}
|
|
14914
15061
|
|
|
14915
15062
|
// src/components/WhatsAppComponent/inbox/WhatsAppInbox.tsx
|
|
14916
|
-
import { jsx as
|
|
15063
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
14917
15064
|
function WhatsAppInbox({
|
|
14918
15065
|
orgId,
|
|
14919
15066
|
getConversationsAction,
|
|
@@ -14934,8 +15081,8 @@ function WhatsAppInbox({
|
|
|
14934
15081
|
sendMessage: sendInboxMessageAction
|
|
14935
15082
|
});
|
|
14936
15083
|
const activeConversation = conversations.find((c) => c.id === activeConversationId);
|
|
14937
|
-
return /* @__PURE__ */
|
|
14938
|
-
/* @__PURE__ */
|
|
15084
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex h-[calc(100vh-140px)] min-h-[600px] w-full border border-slate-200 rounded-2xl overflow-hidden bg-white shadow-xs", dir: "rtl", children: [
|
|
15085
|
+
/* @__PURE__ */ jsx28(
|
|
14939
15086
|
ConversationList,
|
|
14940
15087
|
{
|
|
14941
15088
|
conversations,
|
|
@@ -14943,7 +15090,7 @@ function WhatsAppInbox({
|
|
|
14943
15090
|
onSelect: handleSelectConversation
|
|
14944
15091
|
}
|
|
14945
15092
|
),
|
|
14946
|
-
/* @__PURE__ */
|
|
15093
|
+
/* @__PURE__ */ jsx28(
|
|
14947
15094
|
ChatWindow,
|
|
14948
15095
|
{
|
|
14949
15096
|
activeConversation,
|
|
@@ -14957,21 +15104,21 @@ function WhatsAppInbox({
|
|
|
14957
15104
|
}
|
|
14958
15105
|
|
|
14959
15106
|
// src/components/WhatsAppComponent/WhatsAppComponent.tsx
|
|
14960
|
-
import { Fragment as Fragment8, jsx as
|
|
15107
|
+
import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
14961
15108
|
function WhatsAppComponent(props) {
|
|
14962
15109
|
var _a;
|
|
14963
15110
|
const { className = "", settings, orgId, componentId, executeAction } = props;
|
|
14964
15111
|
const state = useWhatsAppState(props);
|
|
14965
|
-
const [activeTab, setActiveTab] =
|
|
14966
|
-
return /* @__PURE__ */
|
|
15112
|
+
const [activeTab, setActiveTab] = React21.useState("broadcast");
|
|
15113
|
+
return /* @__PURE__ */ jsxs25(
|
|
14967
15114
|
"div",
|
|
14968
15115
|
{
|
|
14969
15116
|
className: `w-full flex flex-col bg-white border border-slate-200 rounded-2xl shadow-xs overflow-hidden ${className}`,
|
|
14970
15117
|
"data-testid": "whatsapp-component",
|
|
14971
15118
|
dir: "rtl",
|
|
14972
15119
|
children: [
|
|
14973
|
-
/* @__PURE__ */
|
|
14974
|
-
/* @__PURE__ */
|
|
15120
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex border-b border-slate-200 bg-slate-50 px-6 pt-3 gap-4 shrink-0", children: [
|
|
15121
|
+
/* @__PURE__ */ jsx29(
|
|
14975
15122
|
"button",
|
|
14976
15123
|
{
|
|
14977
15124
|
type: "button",
|
|
@@ -14980,7 +15127,7 @@ function WhatsAppComponent(props) {
|
|
|
14980
15127
|
children: "\u{1F4E4} \u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D5\u05EA\u05E4\u05D5\u05E6\u05D4"
|
|
14981
15128
|
}
|
|
14982
15129
|
),
|
|
14983
|
-
/* @__PURE__ */
|
|
15130
|
+
/* @__PURE__ */ jsx29(
|
|
14984
15131
|
"button",
|
|
14985
15132
|
{
|
|
14986
15133
|
type: "button",
|
|
@@ -14990,7 +15137,7 @@ function WhatsAppComponent(props) {
|
|
|
14990
15137
|
}
|
|
14991
15138
|
)
|
|
14992
15139
|
] }),
|
|
14993
|
-
activeTab === "inbox" ? /* @__PURE__ */
|
|
15140
|
+
activeTab === "inbox" ? /* @__PURE__ */ jsx29("div", { className: "p-4 flex-1", children: /* @__PURE__ */ jsx29(
|
|
14994
15141
|
WhatsAppInbox,
|
|
14995
15142
|
{
|
|
14996
15143
|
orgId: orgId || props.organizationId || "",
|
|
@@ -15029,37 +15176,37 @@ function WhatsAppComponent(props) {
|
|
|
15029
15176
|
}
|
|
15030
15177
|
}
|
|
15031
15178
|
}
|
|
15032
|
-
) }) : /* @__PURE__ */
|
|
15033
|
-
state.feedback && /* @__PURE__ */
|
|
15179
|
+
) }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15180
|
+
state.feedback && /* @__PURE__ */ jsxs25(
|
|
15034
15181
|
"div",
|
|
15035
15182
|
{
|
|
15036
15183
|
className: `px-6 py-3 border-b text-xs flex items-center justify-between gap-3 ${state.feedback.type === "success" ? "bg-emerald-50 border-emerald-200 text-emerald-800" : "bg-rose-50 border-rose-200 text-rose-800"}`,
|
|
15037
15184
|
children: [
|
|
15038
|
-
/* @__PURE__ */
|
|
15039
|
-
state.feedback.type === "success" ? /* @__PURE__ */
|
|
15040
|
-
/* @__PURE__ */
|
|
15185
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
15186
|
+
state.feedback.type === "success" ? /* @__PURE__ */ jsx29(CheckCircle24, { className: "w-4 h-4 text-emerald-600 shrink-0" }) : /* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-600 shrink-0" }),
|
|
15187
|
+
/* @__PURE__ */ jsx29("span", { children: state.feedback.message })
|
|
15041
15188
|
] }),
|
|
15042
|
-
/* @__PURE__ */
|
|
15189
|
+
/* @__PURE__ */ jsx29(
|
|
15043
15190
|
"button",
|
|
15044
15191
|
{
|
|
15045
15192
|
type: "button",
|
|
15046
15193
|
onClick: () => state.setFeedback(null),
|
|
15047
15194
|
className: "text-slate-400 hover:text-slate-700 cursor-pointer",
|
|
15048
|
-
children: /* @__PURE__ */
|
|
15195
|
+
children: /* @__PURE__ */ jsx29(X12, { className: "w-4 h-4" })
|
|
15049
15196
|
}
|
|
15050
15197
|
)
|
|
15051
15198
|
]
|
|
15052
15199
|
}
|
|
15053
15200
|
),
|
|
15054
|
-
state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */
|
|
15055
|
-
/* @__PURE__ */
|
|
15056
|
-
/* @__PURE__ */
|
|
15057
|
-
/* @__PURE__ */
|
|
15201
|
+
state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */ jsxs25("div", { className: "px-6 py-3 bg-amber-50 border-b border-amber-200 text-xs text-amber-900 flex items-center justify-between", children: [
|
|
15202
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
15203
|
+
/* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-amber-600 shrink-0" }),
|
|
15204
|
+
/* @__PURE__ */ jsxs25("span", { children: [
|
|
15058
15205
|
"\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA \u05DE-Meta: ",
|
|
15059
15206
|
state.fetchError
|
|
15060
15207
|
] })
|
|
15061
15208
|
] }),
|
|
15062
|
-
/* @__PURE__ */
|
|
15209
|
+
/* @__PURE__ */ jsx29(
|
|
15063
15210
|
"button",
|
|
15064
15211
|
{
|
|
15065
15212
|
type: "button",
|
|
@@ -15069,9 +15216,9 @@ function WhatsAppComponent(props) {
|
|
|
15069
15216
|
}
|
|
15070
15217
|
)
|
|
15071
15218
|
] }),
|
|
15072
|
-
/* @__PURE__ */
|
|
15073
|
-
/* @__PURE__ */
|
|
15074
|
-
/* @__PURE__ */
|
|
15219
|
+
/* @__PURE__ */ jsxs25("div", { className: "p-4 flex flex-col gap-4", children: [
|
|
15220
|
+
/* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-4 shrink-0 items-stretch", children: [
|
|
15221
|
+
/* @__PURE__ */ jsx29(
|
|
15075
15222
|
TemplateSelectionBlock,
|
|
15076
15223
|
{
|
|
15077
15224
|
selectedTemplate: state.selectedTemplate,
|
|
@@ -15099,7 +15246,7 @@ function WhatsAppComponent(props) {
|
|
|
15099
15246
|
handleFileUpload: state.handleFileUpload
|
|
15100
15247
|
}
|
|
15101
15248
|
),
|
|
15102
|
-
/* @__PURE__ */
|
|
15249
|
+
/* @__PURE__ */ jsx29(
|
|
15103
15250
|
DynamicFiltersBlock,
|
|
15104
15251
|
{
|
|
15105
15252
|
filterableColumns: state.filterableColumns,
|
|
@@ -15116,7 +15263,7 @@ function WhatsAppComponent(props) {
|
|
|
15116
15263
|
isLoadingTableData: state.isLoadingTableData
|
|
15117
15264
|
}
|
|
15118
15265
|
),
|
|
15119
|
-
/* @__PURE__ */
|
|
15266
|
+
/* @__PURE__ */ jsx29(
|
|
15120
15267
|
SettingsAndActionsBlock,
|
|
15121
15268
|
{
|
|
15122
15269
|
isScanningPhoneColumns: state.isScanningPhoneColumns,
|
|
@@ -15162,13 +15309,13 @@ function WhatsAppComponent(props) {
|
|
|
15162
15309
|
}
|
|
15163
15310
|
)
|
|
15164
15311
|
] }),
|
|
15165
|
-
/* @__PURE__ */
|
|
15166
|
-
/* @__PURE__ */
|
|
15167
|
-
/* @__PURE__ */
|
|
15168
|
-
] }) : state.tableError ? /* @__PURE__ */
|
|
15169
|
-
/* @__PURE__ */
|
|
15170
|
-
/* @__PURE__ */
|
|
15171
|
-
] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */
|
|
15312
|
+
/* @__PURE__ */ jsx29("div", { className: "w-full h-[calc(100vh-420px)] min-h-[320px] overflow-hidden border border-slate-200 rounded-2xl shadow-xs bg-white flex flex-col", children: state.isLoadingTableData && state.rawRecords.length === 0 ? /* @__PURE__ */ jsxs25("div", { className: "flex-1 flex flex-col items-center justify-center p-12 text-center text-xs text-slate-400 gap-2", children: [
|
|
15313
|
+
/* @__PURE__ */ jsx29(Loader28, { className: "w-6 h-6 animate-spin text-emerald-600" }),
|
|
15314
|
+
/* @__PURE__ */ jsx29("span", { children: "\u05D8\u05D5\u05E2\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05D4\u05D8\u05D1\u05DC\u05D4..." })
|
|
15315
|
+
] }) : state.tableError ? /* @__PURE__ */ jsxs25("div", { className: "flex-1 flex items-center justify-center p-6 text-center text-xs text-rose-600 bg-rose-50 gap-2", children: [
|
|
15316
|
+
/* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
|
|
15317
|
+
/* @__PURE__ */ jsx29("span", { children: state.tableError })
|
|
15318
|
+
] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */ jsx29("div", { className: "flex-1 flex items-center justify-center p-10 text-center text-xs text-slate-400", children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 \u05E2\u05D1\u05D5\u05E8 \u05E8\u05DB\u05D9\u05D1 WhatsApp \u05D6\u05D4" }) : /* @__PURE__ */ jsx29(
|
|
15172
15319
|
TableBlockClient,
|
|
15173
15320
|
{
|
|
15174
15321
|
settings: {
|
|
@@ -15190,7 +15337,7 @@ function WhatsAppComponent(props) {
|
|
|
15190
15337
|
}
|
|
15191
15338
|
) })
|
|
15192
15339
|
] }),
|
|
15193
|
-
/* @__PURE__ */
|
|
15340
|
+
/* @__PURE__ */ jsx29(
|
|
15194
15341
|
CreateTemplateModal,
|
|
15195
15342
|
{
|
|
15196
15343
|
isOpen: state.isModalOpen,
|
|
@@ -15204,7 +15351,7 @@ function WhatsAppComponent(props) {
|
|
|
15204
15351
|
orgId: state.orgId || orgId
|
|
15205
15352
|
}
|
|
15206
15353
|
),
|
|
15207
|
-
state.isTestPromptOpen && /* @__PURE__ */
|
|
15354
|
+
state.isTestPromptOpen && /* @__PURE__ */ jsx29(
|
|
15208
15355
|
"div",
|
|
15209
15356
|
{
|
|
15210
15357
|
className: "fixed inset-0 bg-slate-900/60 backdrop-blur-xs z-50 flex items-center justify-center p-4 overflow-y-auto animate-in fade-in duration-150",
|
|
@@ -15213,7 +15360,7 @@ function WhatsAppComponent(props) {
|
|
|
15213
15360
|
state.setIsTestPromptOpen(false);
|
|
15214
15361
|
state.setTestFeedback(null);
|
|
15215
15362
|
},
|
|
15216
|
-
children: /* @__PURE__ */
|
|
15363
|
+
children: /* @__PURE__ */ jsxs25(
|
|
15217
15364
|
"div",
|
|
15218
15365
|
{
|
|
15219
15366
|
className: "bg-white rounded-2xl border border-slate-200 shadow-2xl w-full max-w-md flex flex-col overflow-hidden animate-in zoom-in-95 duration-150",
|
|
@@ -15222,15 +15369,15 @@ function WhatsAppComponent(props) {
|
|
|
15222
15369
|
"aria-labelledby": "test-modal-title",
|
|
15223
15370
|
onClick: (e) => e.stopPropagation(),
|
|
15224
15371
|
children: [
|
|
15225
|
-
/* @__PURE__ */
|
|
15226
|
-
/* @__PURE__ */
|
|
15227
|
-
/* @__PURE__ */
|
|
15228
|
-
/* @__PURE__ */
|
|
15229
|
-
/* @__PURE__ */
|
|
15230
|
-
/* @__PURE__ */
|
|
15372
|
+
/* @__PURE__ */ jsxs25("div", { className: "px-5 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
|
|
15373
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2.5", children: [
|
|
15374
|
+
/* @__PURE__ */ jsx29("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx29(Phone4, { className: "w-4 h-4" }) }),
|
|
15375
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
15376
|
+
/* @__PURE__ */ jsx29("h3", { id: "test-modal-title", className: "text-sm font-bold text-slate-900", children: "\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05D5\u05D3\u05E2\u05EA \u05D1\u05D3\u05D9\u05E7\u05D4 (\u05D8\u05E1\u05D8)" }),
|
|
15377
|
+
/* @__PURE__ */ jsx29("p", { className: "text-[11px] text-slate-500", children: "\u05D1\u05D3\u05D9\u05E7\u05EA \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D5\u05DC \u05E0\u05DE\u05E2\u05DF \u05D1\u05D5\u05D3\u05D3 \u05DC\u05E4\u05E0\u05D9 \u05E9\u05D9\u05D3\u05D5\u05E8 \u05E8\u05D7\u05D1" })
|
|
15231
15378
|
] })
|
|
15232
15379
|
] }),
|
|
15233
|
-
/* @__PURE__ */
|
|
15380
|
+
/* @__PURE__ */ jsx29(
|
|
15234
15381
|
"button",
|
|
15235
15382
|
{
|
|
15236
15383
|
type: "button",
|
|
@@ -15242,25 +15389,25 @@ function WhatsAppComponent(props) {
|
|
|
15242
15389
|
},
|
|
15243
15390
|
className: `w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${state.isSendingTest ? "text-slate-300 cursor-not-allowed" : "text-slate-400 hover:text-slate-700 hover:bg-slate-200/50 cursor-pointer"}`,
|
|
15244
15391
|
title: "\u05E1\u05D2\u05D5\u05E8",
|
|
15245
|
-
children: /* @__PURE__ */
|
|
15392
|
+
children: /* @__PURE__ */ jsx29(X12, { className: "w-4 h-4" })
|
|
15246
15393
|
}
|
|
15247
15394
|
)
|
|
15248
15395
|
] }),
|
|
15249
|
-
/* @__PURE__ */
|
|
15250
|
-
/* @__PURE__ */
|
|
15251
|
-
/* @__PURE__ */
|
|
15252
|
-
/* @__PURE__ */
|
|
15396
|
+
/* @__PURE__ */ jsxs25("div", { className: "p-5 space-y-4", children: [
|
|
15397
|
+
/* @__PURE__ */ jsxs25("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
|
|
15398
|
+
/* @__PURE__ */ jsx29("span", { className: "text-slate-500 font-medium", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05E0\u05D1\u05D7\u05E8\u05EA:" }),
|
|
15399
|
+
/* @__PURE__ */ jsx29("span", { className: "font-bold text-slate-800 font-mono", children: ((_a = state.selectedTemplate) == null ? void 0 : _a.name) || "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" })
|
|
15253
15400
|
] }),
|
|
15254
|
-
state.selectedPhoneOption && /* @__PURE__ */
|
|
15255
|
-
/* @__PURE__ */
|
|
15256
|
-
/* @__PURE__ */
|
|
15401
|
+
state.selectedPhoneOption && /* @__PURE__ */ jsxs25("div", { className: "p-2 bg-emerald-50/50 border border-emerald-200/60 rounded-xl flex items-center justify-between text-[11px]", children: [
|
|
15402
|
+
/* @__PURE__ */ jsx29("span", { className: "text-emerald-800 font-medium", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3:" }),
|
|
15403
|
+
/* @__PURE__ */ jsx29("span", { className: "font-bold text-emerald-950 font-mono", children: state.selectedPhoneOption.label })
|
|
15257
15404
|
] }),
|
|
15258
15405
|
state.templateHeaderComp && (() => {
|
|
15259
15406
|
const headerFormat = (state.templateHeaderComp.format || "").toUpperCase();
|
|
15260
15407
|
const docFilename = resolveDocumentFilename(state.templateHeaderComp, state.headerMediaUrl);
|
|
15261
|
-
return /* @__PURE__ */
|
|
15262
|
-
/* @__PURE__ */
|
|
15263
|
-
/* @__PURE__ */
|
|
15408
|
+
return /* @__PURE__ */ jsxs25("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
|
|
15409
|
+
/* @__PURE__ */ jsx29("div", { className: "flex items-center gap-2 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15410
|
+
/* @__PURE__ */ jsx29("div", { className: "w-7 h-7 rounded-md overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx29(
|
|
15264
15411
|
"img",
|
|
15265
15412
|
{
|
|
15266
15413
|
src: state.headerMediaUrl,
|
|
@@ -15270,28 +15417,28 @@ function WhatsAppComponent(props) {
|
|
|
15270
15417
|
e.currentTarget.style.display = "none";
|
|
15271
15418
|
}
|
|
15272
15419
|
}
|
|
15273
|
-
) : /* @__PURE__ */
|
|
15274
|
-
/* @__PURE__ */
|
|
15275
|
-
] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */
|
|
15276
|
-
/* @__PURE__ */
|
|
15277
|
-
/* @__PURE__ */
|
|
15278
|
-
/* @__PURE__ */
|
|
15279
|
-
/* @__PURE__ */
|
|
15420
|
+
) : /* @__PURE__ */ jsx29(ImageIcon3, { className: "w-3.5 h-3.5 text-emerald-600" }) }),
|
|
15421
|
+
/* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" })
|
|
15422
|
+
] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15423
|
+
/* @__PURE__ */ jsx29("div", { className: "w-7 h-7 rounded-md bg-rose-50 text-rose-600 border border-rose-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx29(FileText4, { className: "w-3.5 h-3.5" }) }),
|
|
15424
|
+
/* @__PURE__ */ jsxs25("div", { className: "overflow-hidden", children: [
|
|
15425
|
+
/* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
|
|
15426
|
+
/* @__PURE__ */ jsx29("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: docFilename, children: docFilename })
|
|
15280
15427
|
] })
|
|
15281
|
-
] }) : /* @__PURE__ */
|
|
15282
|
-
/* @__PURE__ */
|
|
15283
|
-
/* @__PURE__ */
|
|
15428
|
+
] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15429
|
+
/* @__PURE__ */ jsx29("div", { className: "w-7 h-7 rounded-md bg-indigo-50 text-indigo-600 border border-indigo-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx29(Video3, { className: "w-3.5 h-3.5" }) }),
|
|
15430
|
+
/* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" })
|
|
15284
15431
|
] }) }),
|
|
15285
|
-
state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */
|
|
15432
|
+
state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx29("span", { className: "text-[10px] text-emerald-700 bg-emerald-50 border border-emerald-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF" }) : /* @__PURE__ */ jsx29("span", { className: "text-[10px] text-amber-700 bg-amber-50 border border-amber-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5" })
|
|
15286
15433
|
] });
|
|
15287
15434
|
})(),
|
|
15288
|
-
/* @__PURE__ */
|
|
15289
|
-
/* @__PURE__ */
|
|
15435
|
+
/* @__PURE__ */ jsxs25("div", { className: "space-y-1.5", children: [
|
|
15436
|
+
/* @__PURE__ */ jsxs25("label", { className: "text-xs font-semibold text-slate-700 block", children: [
|
|
15290
15437
|
"\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05DC\u05D8\u05E1\u05D8 ",
|
|
15291
|
-
/* @__PURE__ */
|
|
15438
|
+
/* @__PURE__ */ jsx29("span", { className: "text-rose-500", children: "*" })
|
|
15292
15439
|
] }),
|
|
15293
|
-
/* @__PURE__ */
|
|
15294
|
-
/* @__PURE__ */
|
|
15440
|
+
/* @__PURE__ */ jsxs25("div", { className: "relative", children: [
|
|
15441
|
+
/* @__PURE__ */ jsx29(
|
|
15295
15442
|
"input",
|
|
15296
15443
|
{
|
|
15297
15444
|
type: "tel",
|
|
@@ -15313,17 +15460,17 @@ function WhatsAppComponent(props) {
|
|
|
15313
15460
|
className: "w-full h-10 px-3 pr-3 pl-8 text-sm rounded-xl border border-slate-200 bg-white text-slate-900 placeholder:text-slate-400 focus:outline-hidden focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500 transition-all font-mono disabled:opacity-60 disabled:cursor-not-allowed"
|
|
15314
15461
|
}
|
|
15315
15462
|
),
|
|
15316
|
-
/* @__PURE__ */
|
|
15463
|
+
/* @__PURE__ */ jsx29(Phone4, { className: "w-4 h-4 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
|
|
15317
15464
|
] }),
|
|
15318
|
-
/* @__PURE__ */
|
|
15465
|
+
/* @__PURE__ */ jsx29("p", { className: "text-[11px] text-slate-500 leading-normal", children: "\u05D4\u05D5\u05D3\u05E2\u05EA \u05D4\u05D1\u05D3\u05D9\u05E7\u05D4 \u05EA\u05D9\u05E9\u05DC\u05D7 \u05D9\u05E9\u05D9\u05E8\u05D5\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D6\u05D4 \u05DC\u05E6\u05D5\u05E8\u05DA \u05D5\u05D9\u05D3\u05D5\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05D4\u05E2\u05D9\u05E6\u05D5\u05D1." })
|
|
15319
15466
|
] }),
|
|
15320
|
-
state.testFeedback && /* @__PURE__ */
|
|
15321
|
-
/* @__PURE__ */
|
|
15322
|
-
/* @__PURE__ */
|
|
15467
|
+
state.testFeedback && /* @__PURE__ */ jsxs25("div", { className: "p-2.5 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-700 flex items-center gap-2", children: [
|
|
15468
|
+
/* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
|
|
15469
|
+
/* @__PURE__ */ jsx29("span", { children: state.testFeedback })
|
|
15323
15470
|
] })
|
|
15324
15471
|
] }),
|
|
15325
|
-
/* @__PURE__ */
|
|
15326
|
-
/* @__PURE__ */
|
|
15472
|
+
/* @__PURE__ */ jsxs25("div", { className: "px-5 py-3.5 bg-slate-50/70 border-t border-slate-100 flex items-center justify-end gap-2", children: [
|
|
15473
|
+
/* @__PURE__ */ jsx29(
|
|
15327
15474
|
"button",
|
|
15328
15475
|
{
|
|
15329
15476
|
type: "button",
|
|
@@ -15337,7 +15484,7 @@ function WhatsAppComponent(props) {
|
|
|
15337
15484
|
children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
|
|
15338
15485
|
}
|
|
15339
15486
|
),
|
|
15340
|
-
/* @__PURE__ */
|
|
15487
|
+
/* @__PURE__ */ jsx29(
|
|
15341
15488
|
"button",
|
|
15342
15489
|
{
|
|
15343
15490
|
type: "button",
|
|
@@ -15345,12 +15492,12 @@ function WhatsAppComponent(props) {
|
|
|
15345
15492
|
onClick: state.handleSendTest,
|
|
15346
15493
|
title: state.testButtonTitle,
|
|
15347
15494
|
className: `px-4 py-2 text-xs font-bold rounded-xl transition-all flex items-center gap-1.5 ${!state.testPhoneNumber.trim() || state.isSendingTest || state.isTestDisabled ? "bg-emerald-600/40 text-white/70 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] text-white shadow-xs cursor-pointer"}`,
|
|
15348
|
-
children: state.isSendingTest ? /* @__PURE__ */
|
|
15349
|
-
/* @__PURE__ */
|
|
15350
|
-
/* @__PURE__ */
|
|
15351
|
-
] }) : /* @__PURE__ */
|
|
15352
|
-
/* @__PURE__ */
|
|
15353
|
-
/* @__PURE__ */
|
|
15495
|
+
children: state.isSendingTest ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15496
|
+
/* @__PURE__ */ jsx29(Loader28, { className: "w-3.5 h-3.5 animate-spin" }),
|
|
15497
|
+
/* @__PURE__ */ jsx29("span", { children: "\u05E9\u05D5\u05DC\u05D7..." })
|
|
15498
|
+
] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
|
|
15499
|
+
/* @__PURE__ */ jsx29(Send3, { className: "w-3.5 h-3.5" }),
|
|
15500
|
+
/* @__PURE__ */ jsx29("span", { children: "\u05E9\u05DC\u05D7 \u05E2\u05DB\u05E9\u05D9\u05D5" })
|
|
15354
15501
|
] })
|
|
15355
15502
|
}
|
|
15356
15503
|
)
|
|
@@ -15367,12 +15514,12 @@ function WhatsAppComponent(props) {
|
|
|
15367
15514
|
}
|
|
15368
15515
|
|
|
15369
15516
|
// src/components/FormBlock/FormBlock.tsx
|
|
15370
|
-
import { useState as
|
|
15517
|
+
import { useState as useState22, useEffect as useEffect19 } from "react";
|
|
15371
15518
|
import { Loader2 as Loader29, CheckCircle2 as CheckCircle25 } from "lucide-react";
|
|
15372
|
-
import { jsx as
|
|
15519
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
15373
15520
|
|
|
15374
15521
|
// src/components/FormBlock/StyledFormBlock.tsx
|
|
15375
|
-
import { useState as
|
|
15522
|
+
import { useState as useState23, useEffect as useEffect20, useId, useRef as useRef20 } from "react";
|
|
15376
15523
|
import { Loader2 as Loader210, CheckCircle2 as CheckCircle26 } from "lucide-react";
|
|
15377
15524
|
|
|
15378
15525
|
// src/components/FormBlock/formDesign.ts
|
|
@@ -15614,7 +15761,7 @@ function applyFieldOrder(cols, design) {
|
|
|
15614
15761
|
}
|
|
15615
15762
|
|
|
15616
15763
|
// src/components/FormBlock/StyledFormBlock.tsx
|
|
15617
|
-
import { jsx as
|
|
15764
|
+
import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
15618
15765
|
var SYSTEM_FIELDS = ["_id", "id", "createdAt", "updatedAt", "orgId", "tableId"];
|
|
15619
15766
|
function StyledFormBlock({
|
|
15620
15767
|
settings: schema,
|
|
@@ -15634,22 +15781,22 @@ function StyledFormBlock({
|
|
|
15634
15781
|
const design = schema == null ? void 0 : schema.design;
|
|
15635
15782
|
const d = resolveFormDesign(design);
|
|
15636
15783
|
const t = d.tokens;
|
|
15637
|
-
const [formData, setFormData] =
|
|
15638
|
-
const [isSubmitting, setIsSubmitting] =
|
|
15639
|
-
const [isSubmitted, setIsSubmitted] =
|
|
15640
|
-
const [formError, setFormError] =
|
|
15641
|
-
const [missingNames, setMissingNames] =
|
|
15784
|
+
const [formData, setFormData] = useState23(initialValues || {});
|
|
15785
|
+
const [isSubmitting, setIsSubmitting] = useState23(false);
|
|
15786
|
+
const [isSubmitted, setIsSubmitted] = useState23(false);
|
|
15787
|
+
const [formError, setFormError] = useState23(null);
|
|
15788
|
+
const [missingNames, setMissingNames] = useState23([]);
|
|
15642
15789
|
const errorRef = useRef20(null);
|
|
15643
|
-
const [columns, setColumns] =
|
|
15644
|
-
const [isLoadingSchema, setIsLoadingSchema] =
|
|
15645
|
-
const [dragName, setDragName] =
|
|
15646
|
-
const [drop, setDrop] =
|
|
15647
|
-
const [resizing, setResizing] =
|
|
15790
|
+
const [columns, setColumns] = useState23((schema == null ? void 0 : schema.columns) || []);
|
|
15791
|
+
const [isLoadingSchema, setIsLoadingSchema] = useState23(false);
|
|
15792
|
+
const [dragName, setDragName] = useState23(null);
|
|
15793
|
+
const [drop, setDrop] = useState23(null);
|
|
15794
|
+
const [resizing, setResizing] = useState23(null);
|
|
15648
15795
|
const resizeRef = useRef20(null);
|
|
15649
15796
|
const gridRef = useRef20(null);
|
|
15650
15797
|
const relationDictRef = useRef20({});
|
|
15651
15798
|
const relationRequestedRef = useRef20(/* @__PURE__ */ new Set());
|
|
15652
|
-
const [, bumpRelationLabels] =
|
|
15799
|
+
const [, bumpRelationLabels] = useState23(0);
|
|
15653
15800
|
const targetTableId = (schema == null ? void 0 : schema.tableMetaId) || (schema == null ? void 0 : schema.tableId) || (schema == null ? void 0 : schema.id);
|
|
15654
15801
|
useEffect20(() => {
|
|
15655
15802
|
let isMounted = true;
|
|
@@ -15983,30 +16130,30 @@ function StyledFormBlock({
|
|
|
15983
16130
|
}
|
|
15984
16131
|
`;
|
|
15985
16132
|
if (isLoadingSchema) {
|
|
15986
|
-
return /* @__PURE__ */
|
|
15987
|
-
/* @__PURE__ */
|
|
15988
|
-
/* @__PURE__ */
|
|
16133
|
+
return /* @__PURE__ */ jsxs27("div", { className: "p-8 flex items-center justify-center gap-2 text-slate-500", dir: "rtl", children: [
|
|
16134
|
+
/* @__PURE__ */ jsx31(Loader210, { className: "w-5 h-5 animate-spin", style: { color: d.primary } }),
|
|
16135
|
+
/* @__PURE__ */ jsx31("span", { className: "text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D3\u05D5\u05EA \u05D8\u05D5\u05E4\u05E1..." })
|
|
15989
16136
|
] });
|
|
15990
16137
|
}
|
|
15991
16138
|
if (!formColumns || formColumns.length === 0) {
|
|
15992
|
-
return /* @__PURE__ */
|
|
16139
|
+
return /* @__PURE__ */ jsx31("div", { className: "p-4 text-center text-slate-500", children: "\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05E9\u05D3\u05D5\u05EA \u05DC\u05D8\u05D5\u05E4\u05E1 \u05D6\u05D4." });
|
|
15993
16140
|
}
|
|
15994
16141
|
const logoJustify = d.logoAlign === "center" ? "center" : d.logoAlign === "end" ? "flex-end" : "flex-start";
|
|
15995
|
-
const headerBlock = (schema == null ? void 0 : schema.title) || d.subtitle || d.logoUrl ? /* @__PURE__ */
|
|
16142
|
+
const headerBlock = (schema == null ? void 0 : schema.title) || d.subtitle || d.logoUrl ? /* @__PURE__ */ jsxs27(
|
|
15996
16143
|
"div",
|
|
15997
16144
|
{
|
|
15998
16145
|
style: t.headerBand ? { background: d.primary, color: "#ffffff", padding: `${t.padding * 0.8}px ${t.padding}px` } : { marginBottom: t.gap + 4 },
|
|
15999
16146
|
children: [
|
|
16000
|
-
d.logoUrl && /* @__PURE__ */
|
|
16001
|
-
(schema == null ? void 0 : schema.title) && /* @__PURE__ */
|
|
16002
|
-
d.subtitle && /* @__PURE__ */
|
|
16147
|
+
d.logoUrl && /* @__PURE__ */ jsx31("div", { style: { display: "flex", justifyContent: logoJustify, marginBottom: (schema == null ? void 0 : schema.title) || d.subtitle ? 12 : 0 }, children: /* @__PURE__ */ jsx31("img", { src: d.logoUrl, alt: "", style: { height: d.logoHeight, maxWidth: "100%", objectFit: "contain", display: "block" } }) }),
|
|
16148
|
+
(schema == null ? void 0 : schema.title) && /* @__PURE__ */ jsx31("h2", { style: __spreadValues({ fontSize: t.titleSize, fontWeight: 800, margin: 0 }, d.titleColor ? { color: d.titleColor } : {}), children: schema.title }),
|
|
16149
|
+
d.subtitle && /* @__PURE__ */ jsx31("p", { style: { fontSize: 14, margin: "6px 0 0", color: t.headerBand ? "rgba(255,255,255,0.9)" : muted }, children: d.subtitle })
|
|
16003
16150
|
]
|
|
16004
16151
|
}
|
|
16005
16152
|
) : null;
|
|
16006
16153
|
if (isSubmitted) {
|
|
16007
16154
|
const customMessage = (schema == null ? void 0 : schema.successMessage) || "\u05EA\u05D5\u05D3\u05D4 \u05E8\u05D1\u05D4! \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05D4\u05EA\u05E7\u05D1\u05DC\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4.";
|
|
16008
|
-
return /* @__PURE__ */
|
|
16009
|
-
/* @__PURE__ */
|
|
16155
|
+
return /* @__PURE__ */ jsxs27("div", { id: componentId, dir: "rtl", className, style: __spreadProps(__spreadValues({}, cardStyle), { padding: t.padding || 24, textAlign: "center" }), children: [
|
|
16156
|
+
/* @__PURE__ */ jsx31(
|
|
16010
16157
|
"div",
|
|
16011
16158
|
{
|
|
16012
16159
|
style: {
|
|
@@ -16020,12 +16167,12 @@ function StyledFormBlock({
|
|
|
16020
16167
|
background: t.invertText ? "rgba(255,255,255,0.2)" : "#ecfdf5",
|
|
16021
16168
|
color: t.invertText ? "#ffffff" : "#059669"
|
|
16022
16169
|
},
|
|
16023
|
-
children: /* @__PURE__ */
|
|
16170
|
+
children: /* @__PURE__ */ jsx31(CheckCircle26, { className: "w-8 h-8" })
|
|
16024
16171
|
}
|
|
16025
16172
|
),
|
|
16026
|
-
/* @__PURE__ */
|
|
16027
|
-
/* @__PURE__ */
|
|
16028
|
-
submitMode !== "update" && /* @__PURE__ */
|
|
16173
|
+
/* @__PURE__ */ jsx31("h3", { style: { fontSize: 24, fontWeight: 800, margin: "0 0 8px" }, children: "\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4" }),
|
|
16174
|
+
/* @__PURE__ */ jsx31("p", { style: { fontSize: 16, color: muted, maxWidth: 420, margin: "0 auto", whiteSpace: "pre-wrap" }, children: customMessage }),
|
|
16175
|
+
submitMode !== "update" && /* @__PURE__ */ jsx31(
|
|
16029
16176
|
"button",
|
|
16030
16177
|
{
|
|
16031
16178
|
type: "button",
|
|
@@ -16037,11 +16184,11 @@ function StyledFormBlock({
|
|
|
16037
16184
|
] });
|
|
16038
16185
|
}
|
|
16039
16186
|
const justify = d.buttonAlign === "center" ? "center" : d.buttonAlign === "end" ? "flex-end" : d.buttonAlign === "full" ? "stretch" : "flex-start";
|
|
16040
|
-
return /* @__PURE__ */
|
|
16041
|
-
/* @__PURE__ */
|
|
16187
|
+
return /* @__PURE__ */ jsxs27("div", { id: componentId, dir: "rtl", className: `${uid} ${className}`, style: cardStyle, children: [
|
|
16188
|
+
/* @__PURE__ */ jsx31("style", { children: css }),
|
|
16042
16189
|
headerBlock,
|
|
16043
|
-
/* @__PURE__ */
|
|
16044
|
-
/* @__PURE__ */
|
|
16190
|
+
/* @__PURE__ */ jsx31("div", { style: t.headerBand ? { padding: t.padding } : void 0, children: /* @__PURE__ */ jsxs27("form", { onSubmit: handleSubmit, children: [
|
|
16191
|
+
/* @__PURE__ */ jsx31("div", { className: "fdz-grid", ref: gridRef, children: (() => {
|
|
16045
16192
|
const spanOf = (col) => {
|
|
16046
16193
|
var _a;
|
|
16047
16194
|
if (resizing && resizing.name === col.name) return resizing.span;
|
|
@@ -16059,7 +16206,7 @@ function StyledFormBlock({
|
|
|
16059
16206
|
const fieldHeight = resizing && resizing.name === col.name ? resizing.height : (_e = (_d = design == null ? void 0 : design.fields) == null ? void 0 : _d[col.name]) == null ? void 0 : _e.height;
|
|
16060
16207
|
const useTextarea = !!fieldHeight && fieldHeight > 56 && InputComponent === FORM_INPUTS.DEFAULT;
|
|
16061
16208
|
const boxStyle = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, isBoolean ? booleanBoxStyle : inputBoxStyle), fieldHeight && !isBoolean ? __spreadValues({ minHeight: fieldHeight }, useTextarea ? { height: fieldHeight } : {}) : {}), canReorder ? { pointerEvents: "none" } : {}), missingNames.includes(col.name) ? t.inputStyle === "underline" ? { borderBottom: "2px solid #f43f5e" } : { border: "1px solid #f43f5e", boxShadow: "0 0 0 3px rgba(244,63,94,0.15)" } : {}), locked ? { background: t.inputStyle === "underline" ? "transparent" : "#f1f5f9", opacity: 0.85, cursor: "not-allowed" } : {});
|
|
16062
|
-
return /* @__PURE__ */
|
|
16209
|
+
return /* @__PURE__ */ jsxs27(
|
|
16063
16210
|
"div",
|
|
16064
16211
|
{
|
|
16065
16212
|
"data-fdz-field": col.name,
|
|
@@ -16083,13 +16230,13 @@ function StyledFormBlock({
|
|
|
16083
16230
|
borderRadius: 6
|
|
16084
16231
|
} : {}),
|
|
16085
16232
|
children: [
|
|
16086
|
-
/* @__PURE__ */
|
|
16233
|
+
/* @__PURE__ */ jsxs27("label", { style: { fontSize: t.labelSize, fontWeight: 600, color: d.text }, children: [
|
|
16087
16234
|
col.name,
|
|
16088
16235
|
" ",
|
|
16089
|
-
isFieldRequired(col, design) && !locked && /* @__PURE__ */
|
|
16090
|
-
locked && /* @__PURE__ */
|
|
16236
|
+
isFieldRequired(col, design) && !locked && /* @__PURE__ */ jsx31("span", { style: { color: t.invertText ? "#fecdd3" : "#f43f5e" }, children: "*" }),
|
|
16237
|
+
locked && /* @__PURE__ */ jsx31("span", { style: { fontSize: 11, fontWeight: 400, opacity: 0.7 }, children: "(\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D9\u05DB\u05D4)" })
|
|
16091
16238
|
] }),
|
|
16092
|
-
/* @__PURE__ */
|
|
16239
|
+
/* @__PURE__ */ jsx31("div", { "data-fdz-box": true, style: boxStyle, children: useTextarea ? /* @__PURE__ */ jsx31(
|
|
16093
16240
|
"textarea",
|
|
16094
16241
|
{
|
|
16095
16242
|
value: shownValue,
|
|
@@ -16109,7 +16256,7 @@ function StyledFormBlock({
|
|
|
16109
16256
|
boxSizing: "border-box"
|
|
16110
16257
|
}
|
|
16111
16258
|
}
|
|
16112
|
-
) : /* @__PURE__ */
|
|
16259
|
+
) : /* @__PURE__ */ jsx31(
|
|
16113
16260
|
InputComponent,
|
|
16114
16261
|
{
|
|
16115
16262
|
column: col,
|
|
@@ -16117,10 +16264,10 @@ function StyledFormBlock({
|
|
|
16117
16264
|
value: shownValue,
|
|
16118
16265
|
onChange: (val) => handleFieldChange(col.name, val),
|
|
16119
16266
|
readOnly: previewMode || locked,
|
|
16120
|
-
context: { executeAction: previewMode ? void 0 : executeAction, tableId: targetTableId, relationDictionaryRef: relationDictRef }
|
|
16267
|
+
context: { executeAction: previewMode ? void 0 : executeAction, tableId: targetTableId, relationDictionaryRef: relationDictRef, orgId: schema == null ? void 0 : schema.orgId }
|
|
16121
16268
|
}
|
|
16122
16269
|
) }),
|
|
16123
|
-
canReorder && dragName && drop && drop.name === col.name && /* @__PURE__ */
|
|
16270
|
+
canReorder && dragName && drop && drop.name === col.name && /* @__PURE__ */ jsx31(
|
|
16124
16271
|
"div",
|
|
16125
16272
|
{
|
|
16126
16273
|
style: __spreadValues({
|
|
@@ -16135,7 +16282,7 @@ function StyledFormBlock({
|
|
|
16135
16282
|
}, drop.side === "before" ? { insetInlineStart: -(t.gap / 2) - 2 } : { insetInlineEnd: -(t.gap / 2) - 2 })
|
|
16136
16283
|
}
|
|
16137
16284
|
),
|
|
16138
|
-
onFieldResize && !isBoolean && /* @__PURE__ */
|
|
16285
|
+
onFieldResize && !isBoolean && /* @__PURE__ */ jsx31(
|
|
16139
16286
|
"div",
|
|
16140
16287
|
{
|
|
16141
16288
|
onMouseDown: (e) => e.stopPropagation(),
|
|
@@ -16165,7 +16312,7 @@ function StyledFormBlock({
|
|
|
16165
16312
|
};
|
|
16166
16313
|
return formColumns.map((col) => renderField(col));
|
|
16167
16314
|
})() }),
|
|
16168
|
-
formError && /* @__PURE__ */
|
|
16315
|
+
formError && /* @__PURE__ */ jsx31(
|
|
16169
16316
|
"div",
|
|
16170
16317
|
{
|
|
16171
16318
|
ref: errorRef,
|
|
@@ -16184,7 +16331,7 @@ function StyledFormBlock({
|
|
|
16184
16331
|
children: formError
|
|
16185
16332
|
}
|
|
16186
16333
|
),
|
|
16187
|
-
/* @__PURE__ */
|
|
16334
|
+
/* @__PURE__ */ jsx31(
|
|
16188
16335
|
"div",
|
|
16189
16336
|
{
|
|
16190
16337
|
style: {
|
|
@@ -16194,7 +16341,7 @@ function StyledFormBlock({
|
|
|
16194
16341
|
display: "flex",
|
|
16195
16342
|
justifyContent: justify
|
|
16196
16343
|
},
|
|
16197
|
-
children: /* @__PURE__ */
|
|
16344
|
+
children: /* @__PURE__ */ jsxs27(
|
|
16198
16345
|
"button",
|
|
16199
16346
|
{
|
|
16200
16347
|
type: "submit",
|
|
@@ -16217,8 +16364,8 @@ function StyledFormBlock({
|
|
|
16217
16364
|
opacity: isSubmitting ? 0.5 : 1
|
|
16218
16365
|
},
|
|
16219
16366
|
children: [
|
|
16220
|
-
isSubmitting && /* @__PURE__ */
|
|
16221
|
-
/* @__PURE__ */
|
|
16367
|
+
isSubmitting && /* @__PURE__ */ jsx31(Loader210, { className: "w-4 h-4 animate-spin" }),
|
|
16368
|
+
/* @__PURE__ */ jsx31("span", { children: isSubmitting ? "\u05E9\u05D5\u05DE\u05E8..." : d.buttonText })
|
|
16222
16369
|
]
|
|
16223
16370
|
}
|
|
16224
16371
|
)
|
|
@@ -16229,8 +16376,8 @@ function StyledFormBlock({
|
|
|
16229
16376
|
}
|
|
16230
16377
|
|
|
16231
16378
|
// src/themes/ThemeScope.tsx
|
|
16232
|
-
import * as
|
|
16233
|
-
import { jsx as
|
|
16379
|
+
import * as React24 from "react";
|
|
16380
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
16234
16381
|
var UNIVERSE_THEME_IDS = ["classic", "clean", "ocean", "warm"];
|
|
16235
16382
|
function resolveUniverseTheme(value) {
|
|
16236
16383
|
return typeof value === "string" && UNIVERSE_THEME_IDS.includes(value) ? value : "classic";
|
|
@@ -16240,7 +16387,7 @@ function withThemeScope(Component) {
|
|
|
16240
16387
|
var _a, _b, _c;
|
|
16241
16388
|
const p = props;
|
|
16242
16389
|
const theme = resolveUniverseTheme((_c = (_a = p.settings) == null ? void 0 : _a.theme) != null ? _c : (_b = p.config) == null ? void 0 : _b.theme);
|
|
16243
|
-
return /* @__PURE__ */
|
|
16390
|
+
return /* @__PURE__ */ jsx32("div", { "data-theme": theme, style: { display: "contents" }, children: React24.createElement(Component, props) });
|
|
16244
16391
|
}
|
|
16245
16392
|
ThemeScoped.displayName = `ThemeScoped(${Component.displayName || Component.name || "Component"})`;
|
|
16246
16393
|
return ThemeScoped;
|