@commercelayer/app-elements 6.3.0 → 6.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{InputDateComponent-Y5UIbT0E.js → InputDateComponent-CJtRdbJv.js} +3 -3
- package/dist/{RuleEngineComponent-CDGtF4ug.js → RuleEngineComponent-DZ7eYNPc.js} +889 -801
- package/dist/{main-Zwf-ZNBk.js → main-DKRFxDxK.js} +8456 -8331
- package/dist/main.js +25 -25
- package/dist/{parseISO-DQvhbRdk.js → parseISO-Ctdvusm6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/ui/atoms/Icon/icons.d.ts +3 -0
- package/dist/ui/atoms/Text.d.ts +1 -1
- package/dist/ui/forms/InputSelect/overrides.d.ts +1 -1
- package/dist/ui/forms/RuleEngine/layout/ListItemContainer.d.ts +6 -0
- package/dist/ui/forms/RuleEngine/layout/OptionContainer.d.ts +4 -0
- package/dist/ui/forms/RuleEngine/layout/OptionRow.d.ts +6 -0
- package/dist/ui/forms/RuleEngine/schema.order_rules.d.ts +6 -0
- package/dist/ui/forms/RuleEngine/schema.price_rules.d.ts +12 -5
- package/dist/vendor.css +1 -1
- package/package.json +1 -1
|
@@ -1,174 +1,174 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import
|
|
2
|
+
import { t as F, B as _e, D as Te, E as Ne, I as we, N as Me, O as Ce, P as Se, Z, b as $e, d as ke, e as Ee, f as Ae, g as Ve, h as Re, i as Ie, j as Ze, k as De, l as G, n as Oe, o as qe, p as Pe, q as Le, r as ze, s as Fe, u as Ge, v as Ue, w as Je, x as We, y as Be, z as Ye, A as Xe, C as He, F as Qe, G as Ke, H as et, J as tt, K as at, L as st, M as nt, Q as rt, R as lt, S as it, T as ot, U as ct, V as ut, W as dt, X as mt, Y as pt, _ as ht, $ as ft, a0 as xt, a1 as gt, a2 as bt, a3 as yt, a4 as vt, a5 as jt, a6 as _t, a7 as Tt, a8 as Nt, a9 as U, aa as wt, ab as Mt, ac as Ct, ad as St, ae as $t, af as kt, ag as Et, ah as At, ai as Vt, aj as Rt, ak as It, al as Zt, am as Dt, an as Ot, ao as qt, ap as Pt, aq as Lt, ar as zt, as as Ft, at as Gt, au as Ut, av as Jt, aw as Wt, ax as Bt, ay as Yt, az as Xt, aA as Ht, aB as Qt, aC as Kt, aD as ea, aE as ta, aF as aa, aG as sa, aH as na, aI as ra, aJ as la, aK as ia, aL as oa, aM as ca, aN as ua, aO as da, aP as ma, aQ as pa, aR as ha, aS as fa, aT as xa, aU as t, aV as q, aW as J, aX as E, aY as ga, aZ as ba, a_ as ya, a$ as y, b0 as V, b1 as M, b2 as ne, b3 as b, b4 as v, b5 as w, b6 as N, b7 as R, b8 as T, b9 as re, ba as S, bb as le, bc as va, bd as ie, be as ja, bf as W, bg as B, bh as _a, bi as P, bj as oe, bk as Ta, bl as Na, bm as wa, bn as Ma, bo as Ca } from "./main-DKRFxDxK.js";
|
|
3
|
+
import Y, { useReducer as Sa, useCallback as k, useMemo as ce, createContext as $a, useContext as ka, useState as x, useEffect as _, useRef as ue } from "react";
|
|
4
4
|
import "react-hook-form";
|
|
5
5
|
import "wouter";
|
|
6
|
-
import { p as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
6
|
+
import { p as X } from "./parseISO-Ctdvusm6.js";
|
|
7
|
+
function H(e, a) {
|
|
8
|
+
const s = e.match(
|
|
9
9
|
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/
|
|
10
10
|
);
|
|
11
|
-
return
|
|
11
|
+
return s ? F(
|
|
12
12
|
Date.UTC(
|
|
13
|
-
+
|
|
14
|
-
+
|
|
15
|
-
+
|
|
16
|
-
+
|
|
17
|
-
+
|
|
18
|
-
+
|
|
19
|
-
+((
|
|
13
|
+
+s[1],
|
|
14
|
+
+s[2] - 1,
|
|
15
|
+
+s[3],
|
|
16
|
+
+s[4] - (+s[9] || 0) * (s[8] == "-" ? -1 : 1),
|
|
17
|
+
+s[5] - (+s[10] || 0) * (s[8] == "-" ? -1 : 1),
|
|
18
|
+
+s[6],
|
|
19
|
+
+((s[7] || "0") + "00").substring(0, 3)
|
|
20
20
|
),
|
|
21
21
|
a?.in
|
|
22
|
-
) :
|
|
22
|
+
) : F(NaN, a?.in);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
25
|
__proto__: null,
|
|
26
|
-
BRAND:
|
|
27
|
-
DIRTY:
|
|
28
|
-
EMPTY_PATH:
|
|
29
|
-
INVALID:
|
|
30
|
-
NEVER:
|
|
31
|
-
OK:
|
|
32
|
-
ParseStatus:
|
|
33
|
-
Schema:
|
|
34
|
-
ZodAny:
|
|
35
|
-
ZodArray:
|
|
36
|
-
ZodBigInt:
|
|
37
|
-
ZodBoolean:
|
|
38
|
-
ZodBranded:
|
|
39
|
-
ZodCatch:
|
|
40
|
-
ZodDate:
|
|
41
|
-
ZodDefault:
|
|
42
|
-
ZodDiscriminatedUnion:
|
|
43
|
-
ZodEffects:
|
|
44
|
-
ZodEnum:
|
|
45
|
-
ZodError:
|
|
26
|
+
BRAND: _e,
|
|
27
|
+
DIRTY: Te,
|
|
28
|
+
EMPTY_PATH: Ne,
|
|
29
|
+
INVALID: we,
|
|
30
|
+
NEVER: Me,
|
|
31
|
+
OK: Ce,
|
|
32
|
+
ParseStatus: Se,
|
|
33
|
+
Schema: Z,
|
|
34
|
+
ZodAny: $e,
|
|
35
|
+
ZodArray: ke,
|
|
36
|
+
ZodBigInt: Ee,
|
|
37
|
+
ZodBoolean: Ae,
|
|
38
|
+
ZodBranded: Ve,
|
|
39
|
+
ZodCatch: Re,
|
|
40
|
+
ZodDate: Ie,
|
|
41
|
+
ZodDefault: Ze,
|
|
42
|
+
ZodDiscriminatedUnion: De,
|
|
43
|
+
ZodEffects: G,
|
|
44
|
+
ZodEnum: Oe,
|
|
45
|
+
ZodError: qe,
|
|
46
46
|
get ZodFirstPartyTypeKind() {
|
|
47
|
-
return
|
|
47
|
+
return Pe;
|
|
48
48
|
},
|
|
49
|
-
ZodFunction:
|
|
50
|
-
ZodIntersection:
|
|
51
|
-
ZodIssueCode:
|
|
52
|
-
ZodLazy:
|
|
53
|
-
ZodLiteral:
|
|
54
|
-
ZodMap:
|
|
55
|
-
ZodNaN:
|
|
56
|
-
ZodNativeEnum:
|
|
57
|
-
ZodNever:
|
|
58
|
-
ZodNull:
|
|
59
|
-
ZodNullable:
|
|
60
|
-
ZodNumber:
|
|
61
|
-
ZodObject:
|
|
62
|
-
ZodOptional:
|
|
63
|
-
ZodParsedType:
|
|
64
|
-
ZodPipeline:
|
|
65
|
-
ZodPromise:
|
|
66
|
-
ZodReadonly:
|
|
67
|
-
ZodRecord:
|
|
68
|
-
ZodSchema:
|
|
69
|
-
ZodSet:
|
|
70
|
-
ZodString:
|
|
71
|
-
ZodSymbol:
|
|
72
|
-
ZodTransformer:
|
|
73
|
-
ZodTuple:
|
|
74
|
-
ZodType:
|
|
75
|
-
ZodUndefined:
|
|
76
|
-
ZodUnion:
|
|
77
|
-
ZodUnknown:
|
|
78
|
-
ZodVoid:
|
|
79
|
-
addIssueToContext:
|
|
80
|
-
any:
|
|
81
|
-
array:
|
|
82
|
-
bigint:
|
|
83
|
-
boolean:
|
|
84
|
-
coerce:
|
|
85
|
-
custom:
|
|
86
|
-
date:
|
|
87
|
-
datetimeRegex:
|
|
88
|
-
defaultErrorMap:
|
|
89
|
-
discriminatedUnion:
|
|
90
|
-
effect:
|
|
91
|
-
enum:
|
|
92
|
-
function:
|
|
93
|
-
getErrorMap:
|
|
94
|
-
getParsedType:
|
|
95
|
-
instanceof:
|
|
96
|
-
intersection:
|
|
97
|
-
isAborted:
|
|
98
|
-
isAsync:
|
|
99
|
-
isDirty:
|
|
100
|
-
isValid:
|
|
101
|
-
late:
|
|
102
|
-
lazy:
|
|
103
|
-
literal:
|
|
104
|
-
makeIssue:
|
|
105
|
-
map:
|
|
106
|
-
nan:
|
|
107
|
-
nativeEnum:
|
|
108
|
-
never:
|
|
109
|
-
null:
|
|
110
|
-
nullable:
|
|
111
|
-
number:
|
|
112
|
-
object:
|
|
49
|
+
ZodFunction: Le,
|
|
50
|
+
ZodIntersection: ze,
|
|
51
|
+
ZodIssueCode: Fe,
|
|
52
|
+
ZodLazy: Ge,
|
|
53
|
+
ZodLiteral: Ue,
|
|
54
|
+
ZodMap: Je,
|
|
55
|
+
ZodNaN: We,
|
|
56
|
+
ZodNativeEnum: Be,
|
|
57
|
+
ZodNever: Ye,
|
|
58
|
+
ZodNull: Xe,
|
|
59
|
+
ZodNullable: He,
|
|
60
|
+
ZodNumber: Qe,
|
|
61
|
+
ZodObject: Ke,
|
|
62
|
+
ZodOptional: et,
|
|
63
|
+
ZodParsedType: tt,
|
|
64
|
+
ZodPipeline: at,
|
|
65
|
+
ZodPromise: st,
|
|
66
|
+
ZodReadonly: nt,
|
|
67
|
+
ZodRecord: rt,
|
|
68
|
+
ZodSchema: Z,
|
|
69
|
+
ZodSet: lt,
|
|
70
|
+
ZodString: it,
|
|
71
|
+
ZodSymbol: ot,
|
|
72
|
+
ZodTransformer: G,
|
|
73
|
+
ZodTuple: ct,
|
|
74
|
+
ZodType: Z,
|
|
75
|
+
ZodUndefined: ut,
|
|
76
|
+
ZodUnion: dt,
|
|
77
|
+
ZodUnknown: mt,
|
|
78
|
+
ZodVoid: pt,
|
|
79
|
+
addIssueToContext: ht,
|
|
80
|
+
any: ft,
|
|
81
|
+
array: xt,
|
|
82
|
+
bigint: gt,
|
|
83
|
+
boolean: bt,
|
|
84
|
+
coerce: yt,
|
|
85
|
+
custom: vt,
|
|
86
|
+
date: jt,
|
|
87
|
+
datetimeRegex: _t,
|
|
88
|
+
defaultErrorMap: Tt,
|
|
89
|
+
discriminatedUnion: Nt,
|
|
90
|
+
effect: U,
|
|
91
|
+
enum: wt,
|
|
92
|
+
function: Mt,
|
|
93
|
+
getErrorMap: Ct,
|
|
94
|
+
getParsedType: St,
|
|
95
|
+
instanceof: $t,
|
|
96
|
+
intersection: kt,
|
|
97
|
+
isAborted: Et,
|
|
98
|
+
isAsync: At,
|
|
99
|
+
isDirty: Vt,
|
|
100
|
+
isValid: Rt,
|
|
101
|
+
late: It,
|
|
102
|
+
lazy: Zt,
|
|
103
|
+
literal: Dt,
|
|
104
|
+
makeIssue: Ot,
|
|
105
|
+
map: qt,
|
|
106
|
+
nan: Pt,
|
|
107
|
+
nativeEnum: Lt,
|
|
108
|
+
never: zt,
|
|
109
|
+
null: Ft,
|
|
110
|
+
nullable: Gt,
|
|
111
|
+
number: Ut,
|
|
112
|
+
object: Jt,
|
|
113
113
|
get objectUtil() {
|
|
114
|
-
return
|
|
114
|
+
return Wt;
|
|
115
115
|
},
|
|
116
|
-
oboolean:
|
|
117
|
-
onumber:
|
|
118
|
-
optional:
|
|
119
|
-
ostring:
|
|
120
|
-
pipeline:
|
|
121
|
-
preprocess:
|
|
122
|
-
promise:
|
|
123
|
-
quotelessJson:
|
|
124
|
-
record:
|
|
125
|
-
set:
|
|
126
|
-
setErrorMap:
|
|
127
|
-
strictObject:
|
|
128
|
-
string:
|
|
129
|
-
symbol:
|
|
130
|
-
transformer:
|
|
131
|
-
tuple:
|
|
132
|
-
undefined:
|
|
133
|
-
union:
|
|
134
|
-
unknown:
|
|
116
|
+
oboolean: Bt,
|
|
117
|
+
onumber: Yt,
|
|
118
|
+
optional: Xt,
|
|
119
|
+
ostring: Ht,
|
|
120
|
+
pipeline: Qt,
|
|
121
|
+
preprocess: Kt,
|
|
122
|
+
promise: ea,
|
|
123
|
+
quotelessJson: ta,
|
|
124
|
+
record: aa,
|
|
125
|
+
set: sa,
|
|
126
|
+
setErrorMap: na,
|
|
127
|
+
strictObject: ra,
|
|
128
|
+
string: la,
|
|
129
|
+
symbol: ia,
|
|
130
|
+
transformer: U,
|
|
131
|
+
tuple: oa,
|
|
132
|
+
undefined: ca,
|
|
133
|
+
union: ua,
|
|
134
|
+
unknown: da,
|
|
135
135
|
get util() {
|
|
136
|
-
return
|
|
136
|
+
return ma;
|
|
137
137
|
},
|
|
138
|
-
void:
|
|
138
|
+
void: pa
|
|
139
139
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
var Ea = 1, Aa = 4;
|
|
141
|
+
function Va(e) {
|
|
142
|
+
return ha(e, Ea | Aa);
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
return e == null ? e :
|
|
144
|
+
function D(e, a, s) {
|
|
145
|
+
return e == null ? e : fa(e, a, s);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
return e == null ? !0 :
|
|
147
|
+
function Q(e, a) {
|
|
148
|
+
return e == null ? !0 : xa(e, a);
|
|
149
149
|
}
|
|
150
|
-
const
|
|
150
|
+
const de = $a(
|
|
151
151
|
void 0
|
|
152
152
|
);
|
|
153
|
-
function
|
|
153
|
+
function Ra(e, a) {
|
|
154
154
|
switch (a.type) {
|
|
155
155
|
case "SET_PATH": {
|
|
156
|
-
const
|
|
156
|
+
const s = Va(e.value);
|
|
157
157
|
if (/actions\.\d\.[\w_]+$/.test(a.path)) {
|
|
158
|
-
const
|
|
159
|
-
|
|
158
|
+
const n = a.path.replace(/\.[\w_]+$/, "");
|
|
159
|
+
J(s, n)?.groups == null && D(s, `${n}.groups`, []);
|
|
160
160
|
}
|
|
161
161
|
if (a.value === null)
|
|
162
162
|
if (/\.\d+$/.test(a.path)) {
|
|
163
|
-
const
|
|
164
|
-
Array.isArray(
|
|
163
|
+
const n = a.path.replace(/\.\d+$/, ""), i = parseInt(a.path.match(/\d+$/)?.[0] ?? "0", 10), o = J(s, n);
|
|
164
|
+
Array.isArray(o) && (o.splice(i, 1), D(s, n, o), o.length === 0 && n.endsWith(".nested.conditions") && Q(s, n.replace(/\.conditions$/, "")));
|
|
165
165
|
} else
|
|
166
|
-
|
|
166
|
+
Q(s, a.path);
|
|
167
167
|
else
|
|
168
|
-
|
|
168
|
+
D(s, a.path, a.value);
|
|
169
169
|
return {
|
|
170
170
|
...e,
|
|
171
|
-
value:
|
|
171
|
+
value: s
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
174
|
case "SET_SELECTED_RULE_INDEX":
|
|
@@ -177,7 +177,7 @@ function Ea(e, a) {
|
|
|
177
177
|
selectedRuleIndex: a.index
|
|
178
178
|
};
|
|
179
179
|
case "SET_VALUE":
|
|
180
|
-
return
|
|
180
|
+
return q(e.value, a.value) ? e : (a.value.rules?.length ?? 0) === 0 ? {
|
|
181
181
|
selectedRuleIndex: 0,
|
|
182
182
|
value: {
|
|
183
183
|
rules: [
|
|
@@ -198,48 +198,48 @@ function Ea(e, a) {
|
|
|
198
198
|
return e;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
function
|
|
201
|
+
function Ia({
|
|
202
202
|
children: e,
|
|
203
203
|
initialValue: a
|
|
204
204
|
}) {
|
|
205
|
-
const [
|
|
205
|
+
const [s, n] = Sa(Ra, {
|
|
206
206
|
value: a.value,
|
|
207
207
|
selectedRuleIndex: 0
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
}, []),
|
|
211
|
-
|
|
212
|
-
|
|
208
|
+
}), i = k((r, u) => {
|
|
209
|
+
n({ type: "SET_PATH", path: r, value: u });
|
|
210
|
+
}, []), o = k((r) => {
|
|
211
|
+
n({ type: "SET_SELECTED_RULE_INDEX", index: r }), r < 0 && setTimeout(() => {
|
|
212
|
+
n({ type: "SET_SELECTED_RULE_INDEX", index: 0 });
|
|
213
213
|
}, 50);
|
|
214
|
-
}, []),
|
|
215
|
-
|
|
216
|
-
}, []),
|
|
214
|
+
}, []), c = k((r) => {
|
|
215
|
+
n({ type: "SET_VALUE", value: r });
|
|
216
|
+
}, []), l = ce(
|
|
217
217
|
() => ({
|
|
218
|
-
state:
|
|
219
|
-
setPath:
|
|
220
|
-
setSelectedRuleIndex:
|
|
221
|
-
setValue:
|
|
218
|
+
state: s,
|
|
219
|
+
setPath: i,
|
|
220
|
+
setSelectedRuleIndex: o,
|
|
221
|
+
setValue: c,
|
|
222
222
|
availableActionTypes: a.availableActionTypes,
|
|
223
223
|
schemaType: a.schemaType
|
|
224
224
|
}),
|
|
225
225
|
[
|
|
226
|
-
|
|
226
|
+
s,
|
|
227
|
+
i,
|
|
227
228
|
o,
|
|
228
229
|
c,
|
|
229
|
-
u,
|
|
230
230
|
a.availableActionTypes,
|
|
231
231
|
a.schemaType
|
|
232
232
|
]
|
|
233
233
|
);
|
|
234
|
-
return /* @__PURE__ */ t.jsx(
|
|
234
|
+
return /* @__PURE__ */ t.jsx(de.Provider, { value: l, children: e });
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
const e =
|
|
236
|
+
function f() {
|
|
237
|
+
const e = ka(de);
|
|
238
238
|
if (e === void 0)
|
|
239
239
|
throw new Error("useRuleEngine must be used within a RuleEngineProvider");
|
|
240
240
|
return e;
|
|
241
241
|
}
|
|
242
|
-
const
|
|
242
|
+
const me = [
|
|
243
243
|
{
|
|
244
244
|
/** Matches if field value equals provided value
|
|
245
245
|
* @field Integer, String, Datetime, Boolean
|
|
@@ -541,101 +541,156 @@ const ce = [
|
|
|
541
541
|
exactMatch: !0
|
|
542
542
|
}
|
|
543
543
|
];
|
|
544
|
-
function
|
|
544
|
+
function pe(e) {
|
|
545
545
|
if (typeof e == "string")
|
|
546
|
-
return
|
|
546
|
+
return E(H(e)) ? "datetime" : "string";
|
|
547
547
|
if (typeof e == "number")
|
|
548
548
|
return "integer";
|
|
549
549
|
if (typeof e == "boolean")
|
|
550
550
|
return "boolean";
|
|
551
551
|
if (Array.isArray(e)) {
|
|
552
552
|
if (typeof e[0] == "string")
|
|
553
|
-
return
|
|
553
|
+
return E(H(e[0])) ? "datetime" : "string";
|
|
554
554
|
if (typeof e[0] == "number")
|
|
555
555
|
return "integer";
|
|
556
556
|
}
|
|
557
557
|
return "string";
|
|
558
558
|
}
|
|
559
|
-
const
|
|
559
|
+
const he = {
|
|
560
560
|
market: "markets",
|
|
561
561
|
tag: "tags",
|
|
562
562
|
sku: "skus",
|
|
563
563
|
sku_list: "sku_lists"
|
|
564
564
|
};
|
|
565
|
-
function
|
|
566
|
-
return
|
|
565
|
+
function Za(e) {
|
|
566
|
+
return he[e];
|
|
567
567
|
}
|
|
568
|
-
function
|
|
569
|
-
const [a,
|
|
568
|
+
function L(e) {
|
|
569
|
+
const [a, s] = x(void 0);
|
|
570
570
|
return _(() => {
|
|
571
|
-
e?.field != null &&
|
|
572
|
-
const
|
|
573
|
-
(
|
|
571
|
+
e?.field != null && ga(e.field).then((n) => {
|
|
572
|
+
const i = me.find(
|
|
573
|
+
(o) => o.matcher === e.matcher
|
|
574
574
|
);
|
|
575
|
-
|
|
576
|
-
...
|
|
577
|
-
matcherInfos:
|
|
578
|
-
resourceSelectorAvailable:
|
|
575
|
+
s({
|
|
576
|
+
...n,
|
|
577
|
+
matcherInfos: i,
|
|
578
|
+
resourceSelectorAvailable: n?.resource?.id != null && Object.keys(he).includes(n.resource.id) && n.path.endsWith(".id") && i?.exactMatch === !0
|
|
579
579
|
});
|
|
580
|
-
}).catch((
|
|
581
|
-
console.error("Error fetching field info:",
|
|
580
|
+
}).catch((n) => {
|
|
581
|
+
console.error("Error fetching field info:", n);
|
|
582
582
|
});
|
|
583
583
|
}, [e?.field, e?.matcher]), { infos: a };
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
return e == null || e.length === 0 ? [] :
|
|
587
|
-
|
|
585
|
+
function fe(e) {
|
|
586
|
+
return e == null || e.length === 0 ? [] : ba(
|
|
587
|
+
ya(
|
|
588
588
|
e.flatMap((a) => [
|
|
589
589
|
a?.group,
|
|
590
|
-
...
|
|
590
|
+
...fe(a?.nested?.conditions)
|
|
591
591
|
])
|
|
592
592
|
)
|
|
593
593
|
);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function xe() {
|
|
596
596
|
const {
|
|
597
597
|
state: { selectedRuleIndex: e, value: a }
|
|
598
|
-
} =
|
|
599
|
-
return
|
|
598
|
+
} = f();
|
|
599
|
+
return fe(
|
|
600
600
|
a.rules?.[e]?.conditions
|
|
601
601
|
);
|
|
602
602
|
}
|
|
603
|
-
|
|
603
|
+
const Da = ({ children: e }) => /* @__PURE__ */ t.jsx("div", { className: "bg-white rounded-md p-4 shadow-xs flex flex-col gap-2", children: e }), ge = ({ children: e, dropdownItems: a, options: s }) => {
|
|
604
|
+
const [n, i] = x(!0);
|
|
605
|
+
return /* @__PURE__ */ t.jsx("div", { className: "bg-gray-50 rounded-md flex items-center", children: /* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between gap-2 grow p-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 grow", children: [
|
|
606
|
+
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
607
|
+
e,
|
|
608
|
+
/* @__PURE__ */ t.jsxs("div", { className: "border border-gray-200 rounded self-stretch flex", children: [
|
|
609
|
+
/* @__PURE__ */ t.jsx(
|
|
610
|
+
"button",
|
|
611
|
+
{
|
|
612
|
+
type: "button",
|
|
613
|
+
onClick: () => {
|
|
614
|
+
i((o) => !o);
|
|
615
|
+
},
|
|
616
|
+
className: "w-11 flex self-stretch justify-center items-center",
|
|
617
|
+
children: /* @__PURE__ */ t.jsx(
|
|
618
|
+
y,
|
|
619
|
+
{
|
|
620
|
+
name: n ? "caretUp" : "caretDown",
|
|
621
|
+
size: 16
|
|
622
|
+
}
|
|
623
|
+
)
|
|
624
|
+
}
|
|
625
|
+
),
|
|
626
|
+
a != null && /* @__PURE__ */ t.jsx(
|
|
627
|
+
V,
|
|
628
|
+
{
|
|
629
|
+
className: "flex self-stretch border-gray-100 border-l",
|
|
630
|
+
dropdownLabel: /* @__PURE__ */ t.jsx(
|
|
631
|
+
"button",
|
|
632
|
+
{
|
|
633
|
+
type: "button",
|
|
634
|
+
className: "w-11 flex self-stretch justify-center items-center",
|
|
635
|
+
children: /* @__PURE__ */ t.jsx(y, { name: "dotsThreeVertical", size: 16, weight: "bold" })
|
|
636
|
+
}
|
|
637
|
+
),
|
|
638
|
+
dropdownItems: a
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
] })
|
|
642
|
+
] }),
|
|
643
|
+
n && /* @__PURE__ */ t.jsx(Da, { children: s })
|
|
644
|
+
] }) }) });
|
|
645
|
+
}, $ = ({ children: e, label: a, className: s }) => /* @__PURE__ */ t.jsxs(
|
|
646
|
+
"div",
|
|
647
|
+
{
|
|
648
|
+
className: M(
|
|
649
|
+
"flex items-center gap-4 mt-2 first-of-type:mt-0",
|
|
650
|
+
s
|
|
651
|
+
),
|
|
652
|
+
children: [
|
|
653
|
+
/* @__PURE__ */ t.jsx("div", { className: "basis-[180px] shrink-0", children: a }),
|
|
654
|
+
/* @__PURE__ */ t.jsx("div", { className: "grow", children: e })
|
|
655
|
+
]
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
function Oa({
|
|
604
659
|
item: e,
|
|
605
660
|
pathPrefix: a
|
|
606
661
|
}) {
|
|
607
|
-
const { setPath:
|
|
662
|
+
const { setPath: s } = f();
|
|
608
663
|
if (e == null)
|
|
609
664
|
return null;
|
|
610
665
|
switch (e.type) {
|
|
611
666
|
case "buy_x_pay_y":
|
|
612
667
|
return /* @__PURE__ */ t.jsxs("div", { className: "w-36 flex items-center gap-0.5", children: [
|
|
613
668
|
/* @__PURE__ */ t.jsx(
|
|
614
|
-
|
|
669
|
+
b,
|
|
615
670
|
{
|
|
616
671
|
name: `${a}.value.x`,
|
|
617
672
|
type: "number",
|
|
618
673
|
suffix: "X",
|
|
619
674
|
defaultValue: e.value?.x,
|
|
620
|
-
onChange: (
|
|
621
|
-
|
|
675
|
+
onChange: (n) => {
|
|
676
|
+
s(
|
|
622
677
|
`${a}.value.x`,
|
|
623
|
-
parseInt(
|
|
678
|
+
parseInt(n.currentTarget.value, 10)
|
|
624
679
|
);
|
|
625
680
|
}
|
|
626
681
|
}
|
|
627
682
|
),
|
|
628
683
|
/* @__PURE__ */ t.jsx(
|
|
629
|
-
|
|
684
|
+
b,
|
|
630
685
|
{
|
|
631
686
|
name: `${a}.value.y`,
|
|
632
687
|
type: "number",
|
|
633
688
|
suffix: "Y",
|
|
634
689
|
defaultValue: e.value?.y,
|
|
635
|
-
onChange: (
|
|
636
|
-
|
|
690
|
+
onChange: (n) => {
|
|
691
|
+
s(
|
|
637
692
|
`${a}.value.y`,
|
|
638
|
-
parseInt(
|
|
693
|
+
parseInt(n.currentTarget.value, 10)
|
|
639
694
|
);
|
|
640
695
|
}
|
|
641
696
|
}
|
|
@@ -644,31 +699,31 @@ function Aa({
|
|
|
644
699
|
case "every_x_discount_y":
|
|
645
700
|
return /* @__PURE__ */ t.jsxs("div", { className: "w-36 flex items-center gap-0.5", children: [
|
|
646
701
|
/* @__PURE__ */ t.jsx(
|
|
647
|
-
|
|
702
|
+
b,
|
|
648
703
|
{
|
|
649
704
|
name: `${a}.value.x`,
|
|
650
705
|
type: "number",
|
|
651
706
|
suffix: "X",
|
|
652
707
|
defaultValue: e.value?.x,
|
|
653
|
-
onChange: (
|
|
654
|
-
|
|
708
|
+
onChange: (n) => {
|
|
709
|
+
s(
|
|
655
710
|
`${a}.value.x`,
|
|
656
|
-
parseInt(
|
|
711
|
+
parseInt(n.currentTarget.value, 10)
|
|
657
712
|
);
|
|
658
713
|
}
|
|
659
714
|
}
|
|
660
715
|
),
|
|
661
716
|
/* @__PURE__ */ t.jsx(
|
|
662
|
-
|
|
717
|
+
b,
|
|
663
718
|
{
|
|
664
719
|
name: `${a}.value.y`,
|
|
665
720
|
type: "number",
|
|
666
721
|
suffix: "Y",
|
|
667
722
|
defaultValue: e.value?.y,
|
|
668
|
-
onChange: (
|
|
669
|
-
|
|
723
|
+
onChange: (n) => {
|
|
724
|
+
s(
|
|
670
725
|
`${a}.value.y`,
|
|
671
|
-
parseInt(
|
|
726
|
+
parseInt(n.currentTarget.value, 10)
|
|
672
727
|
);
|
|
673
728
|
}
|
|
674
729
|
}
|
|
@@ -677,151 +732,148 @@ function Aa({
|
|
|
677
732
|
case "fixed_amount":
|
|
678
733
|
case "fixed_price":
|
|
679
734
|
return /* @__PURE__ */ t.jsx("div", { className: "w-36", children: /* @__PURE__ */ t.jsx(
|
|
680
|
-
|
|
735
|
+
b,
|
|
681
736
|
{
|
|
682
737
|
name: `${a}.value`,
|
|
683
738
|
type: "number",
|
|
684
739
|
defaultValue: e.value,
|
|
685
740
|
min: 0,
|
|
686
741
|
suffix: "cents",
|
|
687
|
-
onChange: (
|
|
688
|
-
|
|
742
|
+
onChange: (n) => {
|
|
743
|
+
s(
|
|
689
744
|
`${a}.value`,
|
|
690
|
-
parseInt(
|
|
745
|
+
parseInt(n.currentTarget.value, 10)
|
|
691
746
|
);
|
|
692
747
|
}
|
|
693
748
|
}
|
|
694
749
|
) });
|
|
695
750
|
case "percentage": {
|
|
696
|
-
const
|
|
751
|
+
const n = (e.value * 100).toFixed(2);
|
|
697
752
|
return /* @__PURE__ */ t.jsx("div", { className: "w-24", children: /* @__PURE__ */ t.jsx(
|
|
698
|
-
|
|
753
|
+
b,
|
|
699
754
|
{
|
|
700
755
|
name: `${a}.value`,
|
|
701
756
|
type: "number",
|
|
702
|
-
defaultValue:
|
|
757
|
+
defaultValue: n.endsWith(".00") ? n.slice(0, -3) : n,
|
|
703
758
|
min: 0,
|
|
704
759
|
max: 100,
|
|
705
760
|
suffix: "%",
|
|
706
|
-
onChange: (
|
|
707
|
-
|
|
761
|
+
onChange: (i) => {
|
|
762
|
+
s(
|
|
708
763
|
`${a}.value`,
|
|
709
|
-
parseFloat(
|
|
764
|
+
parseFloat(i.currentTarget.value) / 100
|
|
710
765
|
);
|
|
711
766
|
}
|
|
712
767
|
}
|
|
713
768
|
) });
|
|
714
769
|
}
|
|
715
770
|
default:
|
|
716
|
-
return
|
|
771
|
+
return ne();
|
|
717
772
|
}
|
|
718
773
|
}
|
|
719
|
-
function
|
|
774
|
+
function qa({
|
|
720
775
|
item: e,
|
|
721
776
|
index: a,
|
|
722
|
-
onDelete:
|
|
777
|
+
onDelete: s
|
|
723
778
|
}) {
|
|
724
779
|
const {
|
|
725
|
-
setPath:
|
|
726
|
-
schemaType:
|
|
727
|
-
state: { selectedRuleIndex:
|
|
728
|
-
availableActionTypes:
|
|
729
|
-
} =
|
|
780
|
+
setPath: n,
|
|
781
|
+
schemaType: i,
|
|
782
|
+
state: { selectedRuleIndex: o },
|
|
783
|
+
availableActionTypes: c
|
|
784
|
+
} = f(), l = xe(), r = {
|
|
730
785
|
percentage: "Percentage discount",
|
|
731
786
|
fixed_amount: "Fixed amount",
|
|
732
787
|
fixed_price: "Fixed price",
|
|
733
788
|
buy_x_pay_y: "Buy X, Pay Y",
|
|
734
789
|
every_x_discount_y: "Every X, Discount Y"
|
|
735
|
-
},
|
|
790
|
+
}, u = `rules.${o}.actions.${a}`;
|
|
736
791
|
return _(() => {
|
|
737
|
-
|
|
738
|
-
}, [
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
792
|
+
l.length === 0 && (e?.groups ?? []).length > 0 && n(`${u}.groups`, []);
|
|
793
|
+
}, [l]), /* @__PURE__ */ t.jsx("div", { className: "mb-4 last:mb-0", children: /* @__PURE__ */ t.jsxs(
|
|
794
|
+
ge,
|
|
795
|
+
{
|
|
796
|
+
dropdownItems: s != null ? /* @__PURE__ */ t.jsx(
|
|
797
|
+
T,
|
|
798
|
+
{
|
|
799
|
+
label: "Delete",
|
|
800
|
+
onClick: () => {
|
|
801
|
+
n(`${u}`, null), s();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
) : void 0,
|
|
805
|
+
options: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
806
|
+
/* @__PURE__ */ t.jsx(
|
|
807
|
+
$,
|
|
743
808
|
{
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
})),
|
|
753
|
-
onSelect: (d) => {
|
|
754
|
-
T(d) && s(`${i}.type`, d.value);
|
|
755
|
-
}
|
|
809
|
+
label: /* @__PURE__ */ t.jsx(N, { variant: "info", size: "small", children: "Apply to" }),
|
|
810
|
+
children: /* @__PURE__ */ t.jsx(
|
|
811
|
+
Pa,
|
|
812
|
+
{
|
|
813
|
+
value: e?.selector,
|
|
814
|
+
name: `${u}.selector`
|
|
815
|
+
}
|
|
816
|
+
)
|
|
756
817
|
}
|
|
757
|
-
)
|
|
758
|
-
/* @__PURE__ */ t.jsx(
|
|
759
|
-
|
|
760
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex-1", children: /* @__PURE__ */ t.jsx(
|
|
761
|
-
Za,
|
|
818
|
+
),
|
|
819
|
+
(l.length > 0 || (e?.groups ?? []).length > 0) && /* @__PURE__ */ t.jsx(
|
|
820
|
+
$,
|
|
762
821
|
{
|
|
763
|
-
|
|
764
|
-
|
|
822
|
+
label: /* @__PURE__ */ t.jsx(N, { variant: "info", size: "small", children: "Groups" }),
|
|
823
|
+
children: /* @__PURE__ */ t.jsx(
|
|
824
|
+
v,
|
|
825
|
+
{
|
|
826
|
+
name: `${u}.groups`,
|
|
827
|
+
isMulti: !0,
|
|
828
|
+
value: e?.groups?.map((d) => ({
|
|
829
|
+
label: l.includes(d) ? d : `⚠️ ${d}`,
|
|
830
|
+
value: d
|
|
831
|
+
})),
|
|
832
|
+
initialValues: l.map((d) => ({
|
|
833
|
+
value: d,
|
|
834
|
+
label: d
|
|
835
|
+
})),
|
|
836
|
+
onSelect: (d) => {
|
|
837
|
+
R(d) && (n(
|
|
838
|
+
`${u}.groups`,
|
|
839
|
+
d.map((h) => h.value)
|
|
840
|
+
), i === "order-rules" && d.length > 0 && n(`${u}.selector`, "order.line_items"));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
)
|
|
765
844
|
}
|
|
766
|
-
)
|
|
845
|
+
)
|
|
767
846
|
] }),
|
|
768
|
-
|
|
769
|
-
/* @__PURE__ */ t.jsx("div", { className: "text-black font-bold text-sm px-2", children: "GROUPS" }),
|
|
847
|
+
children: [
|
|
770
848
|
/* @__PURE__ */ t.jsx("div", { className: "flex-1", children: /* @__PURE__ */ t.jsx(
|
|
771
849
|
v,
|
|
772
850
|
{
|
|
773
|
-
name: `${
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
initialValues: r.map((d) => ({
|
|
851
|
+
name: `${u}.type`,
|
|
852
|
+
defaultValue: e != null ? {
|
|
853
|
+
label: r[e.type],
|
|
854
|
+
value: e.type
|
|
855
|
+
} : void 0,
|
|
856
|
+
initialValues: c.map((d) => ({
|
|
780
857
|
value: d,
|
|
781
|
-
label: d
|
|
858
|
+
label: r[d]
|
|
782
859
|
})),
|
|
783
860
|
onSelect: (d) => {
|
|
784
|
-
|
|
785
|
-
`${i}.groups`,
|
|
786
|
-
d.map((h) => h.value)
|
|
787
|
-
), o === "order-rules" && d.length > 0 && s(`${i}.selector`, "order.line_items"));
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
) })
|
|
791
|
-
] })
|
|
792
|
-
] }),
|
|
793
|
-
n != null && /* @__PURE__ */ t.jsx(
|
|
794
|
-
D,
|
|
795
|
-
{
|
|
796
|
-
className: "w-8 border-l border-gray-100 flex items-center justify-center self-stretch",
|
|
797
|
-
dropdownLabel: /* @__PURE__ */ t.jsx(
|
|
798
|
-
"button",
|
|
799
|
-
{
|
|
800
|
-
type: "button",
|
|
801
|
-
className: "flex items-center justify-center self-stretch grow",
|
|
802
|
-
children: /* @__PURE__ */ t.jsx(j, { name: "dotsThreeVertical", size: 16, weight: "bold" })
|
|
803
|
-
}
|
|
804
|
-
),
|
|
805
|
-
dropdownItems: /* @__PURE__ */ t.jsx(
|
|
806
|
-
M,
|
|
807
|
-
{
|
|
808
|
-
label: "Delete",
|
|
809
|
-
onClick: () => {
|
|
810
|
-
s(`${i}`, null), n();
|
|
861
|
+
w(d) && n(`${u}.type`, d.value);
|
|
811
862
|
}
|
|
812
863
|
}
|
|
813
|
-
)
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
864
|
+
) }),
|
|
865
|
+
/* @__PURE__ */ t.jsx(Oa, { item: e, pathPrefix: u })
|
|
866
|
+
]
|
|
867
|
+
}
|
|
868
|
+
) });
|
|
817
869
|
}
|
|
818
|
-
function
|
|
870
|
+
function Pa({
|
|
819
871
|
value: e,
|
|
820
872
|
name: a
|
|
821
873
|
}) {
|
|
822
|
-
const { setPath:
|
|
823
|
-
value:
|
|
824
|
-
label:
|
|
874
|
+
const { setPath: s, schemaType: n } = f(), { t: i } = re(), o = La[n].map((c) => ({
|
|
875
|
+
value: c,
|
|
876
|
+
label: i(`resource_paths.${c}`).replace(
|
|
825
877
|
"resource_paths.",
|
|
826
878
|
""
|
|
827
879
|
)
|
|
@@ -831,15 +883,15 @@ function Za({
|
|
|
831
883
|
{
|
|
832
884
|
name: a,
|
|
833
885
|
isSearchable: !1,
|
|
834
|
-
initialValues:
|
|
835
|
-
value:
|
|
836
|
-
onSelect: async (
|
|
837
|
-
|
|
886
|
+
initialValues: o,
|
|
887
|
+
value: o.find((c) => c.value === e),
|
|
888
|
+
onSelect: async (c) => {
|
|
889
|
+
w(c) && s(a, c.value);
|
|
838
890
|
}
|
|
839
891
|
}
|
|
840
892
|
);
|
|
841
893
|
}
|
|
842
|
-
const
|
|
894
|
+
const La = {
|
|
843
895
|
"order-rules": [
|
|
844
896
|
"order",
|
|
845
897
|
"order.line_items",
|
|
@@ -853,55 +905,55 @@ const Da = {
|
|
|
853
905
|
],
|
|
854
906
|
"price-rules": ["price"]
|
|
855
907
|
};
|
|
856
|
-
function
|
|
908
|
+
function za({
|
|
857
909
|
actions: e
|
|
858
910
|
}) {
|
|
859
|
-
const [a,
|
|
860
|
-
setPath:
|
|
861
|
-
state: { selectedRuleIndex:
|
|
862
|
-
} =
|
|
911
|
+
const [a, s] = x(0), {
|
|
912
|
+
setPath: n,
|
|
913
|
+
state: { selectedRuleIndex: i }
|
|
914
|
+
} = f();
|
|
863
915
|
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
864
|
-
/* @__PURE__ */ t.jsx("div", { children: e?.map((
|
|
865
|
-
|
|
916
|
+
/* @__PURE__ */ t.jsx("div", { children: e?.map((o, c, l) => /* @__PURE__ */ t.jsx(
|
|
917
|
+
qa,
|
|
866
918
|
{
|
|
867
|
-
item:
|
|
868
|
-
index:
|
|
869
|
-
onDelete:
|
|
870
|
-
|
|
919
|
+
item: o,
|
|
920
|
+
index: c,
|
|
921
|
+
onDelete: l.length > 1 ? () => {
|
|
922
|
+
s((r) => r + 1);
|
|
871
923
|
} : void 0
|
|
872
924
|
},
|
|
873
|
-
`${
|
|
925
|
+
`${i}-${c}-${a}`
|
|
874
926
|
)) }),
|
|
875
927
|
/* @__PURE__ */ t.jsx("div", { className: "mt-6", children: /* @__PURE__ */ t.jsxs(
|
|
876
|
-
|
|
928
|
+
S,
|
|
877
929
|
{
|
|
878
930
|
size: "small",
|
|
879
931
|
variant: "secondary",
|
|
880
932
|
alignItems: "center",
|
|
881
933
|
onClick: () => {
|
|
882
|
-
|
|
883
|
-
`rules.${
|
|
934
|
+
n(
|
|
935
|
+
`rules.${i}.actions.${e?.length ?? 0}`,
|
|
884
936
|
void 0
|
|
885
937
|
);
|
|
886
938
|
},
|
|
887
939
|
children: [
|
|
888
|
-
/* @__PURE__ */ t.jsx(
|
|
940
|
+
/* @__PURE__ */ t.jsx(y, { name: "plusCircle" }),
|
|
889
941
|
" Add action"
|
|
890
942
|
]
|
|
891
943
|
}
|
|
892
944
|
) })
|
|
893
945
|
] });
|
|
894
946
|
}
|
|
895
|
-
function
|
|
947
|
+
function Fa({
|
|
896
948
|
value: e,
|
|
897
949
|
name: a
|
|
898
950
|
}) {
|
|
899
|
-
const { setPath:
|
|
900
|
-
|
|
901
|
-
(
|
|
902
|
-
).map((
|
|
903
|
-
value:
|
|
904
|
-
label:
|
|
951
|
+
const { setPath: s, schemaType: n } = f(), { t: i } = re(), o = ue(null), c = n === "order-rules" ? "order" : n === "price-rules" ? "price" : void 0, l = le(
|
|
952
|
+
Ga.filter(
|
|
953
|
+
(r) => c != null && r.startsWith(c)
|
|
954
|
+
).map((r) => ({
|
|
955
|
+
value: r,
|
|
956
|
+
label: i(`resource_paths.${r}`).replace(
|
|
905
957
|
"resource_paths.",
|
|
906
958
|
""
|
|
907
959
|
)
|
|
@@ -911,36 +963,36 @@ function Pa({
|
|
|
911
963
|
return /* @__PURE__ */ t.jsx(
|
|
912
964
|
v,
|
|
913
965
|
{
|
|
914
|
-
ref:
|
|
966
|
+
ref: o,
|
|
915
967
|
name: a,
|
|
916
|
-
initialValues:
|
|
917
|
-
defaultValue: e != null ?
|
|
968
|
+
initialValues: l,
|
|
969
|
+
defaultValue: e != null ? l.find((r) => r.value === e) ?? {
|
|
918
970
|
value: e,
|
|
919
971
|
label: e
|
|
920
972
|
} : void 0,
|
|
921
973
|
asTextSearch: !0,
|
|
922
974
|
isCreatable: !0,
|
|
923
|
-
loadAsyncValues: async (
|
|
924
|
-
if (
|
|
975
|
+
loadAsyncValues: async (r) => {
|
|
976
|
+
if (c == null)
|
|
925
977
|
return [];
|
|
926
|
-
const
|
|
927
|
-
(m) => m.label.includes(
|
|
928
|
-
), d = (await
|
|
929
|
-
const
|
|
978
|
+
const u = l.filter(
|
|
979
|
+
(m) => m.label.includes(r)
|
|
980
|
+
), d = (await va([c], r)).filter((m) => m.value.startsWith(r)).map((m) => {
|
|
981
|
+
const p = m.type === "relationship" || m.value.endsWith(".metadata") ? `${m.value}.` : m.value;
|
|
930
982
|
return {
|
|
931
|
-
value:
|
|
932
|
-
label:
|
|
983
|
+
value: p,
|
|
984
|
+
label: p
|
|
933
985
|
};
|
|
934
|
-
}), h =
|
|
935
|
-
return [...
|
|
986
|
+
}), h = r.includes(".metadata") ? [{ label: r, value: r }] : [];
|
|
987
|
+
return [...u, ...d, ...h];
|
|
936
988
|
},
|
|
937
|
-
onSelect: async (
|
|
938
|
-
|
|
989
|
+
onSelect: async (r) => {
|
|
990
|
+
w(r) && (s(a, r.value), r.value.toString().endsWith(".") && o.current?.openMenu("first"));
|
|
939
991
|
}
|
|
940
992
|
}
|
|
941
993
|
);
|
|
942
994
|
}
|
|
943
|
-
const
|
|
995
|
+
const Ga = [
|
|
944
996
|
"order.billing_address.country_code",
|
|
945
997
|
"order.country_code",
|
|
946
998
|
"order.currency_code",
|
|
@@ -989,55 +1041,56 @@ const qa = [
|
|
|
989
1041
|
"price.processed_at",
|
|
990
1042
|
"price.amount_cents"
|
|
991
1043
|
];
|
|
992
|
-
function
|
|
1044
|
+
function Ua({
|
|
993
1045
|
item: e,
|
|
994
1046
|
pathPrefix: a
|
|
995
1047
|
}) {
|
|
996
|
-
const { setPath:
|
|
997
|
-
let
|
|
998
|
-
|
|
999
|
-
const
|
|
1048
|
+
const { setPath: s } = f(), { infos: n } = L(e);
|
|
1049
|
+
let i = n?.field?.type;
|
|
1050
|
+
i == null && (i = pe(e?.value));
|
|
1051
|
+
const o = n?.resource?.id, c = ["tag"], l = [
|
|
1000
1052
|
"matches",
|
|
1001
1053
|
"does_not_match",
|
|
1002
1054
|
"array_match"
|
|
1003
|
-
],
|
|
1055
|
+
], r = me.filter(({ fieldTypes: u, visible: d }) => d !== !1 && u.includes(i)).filter(({ matcher: u }) => o == null || o != null && !c.includes(o) || l.includes(u)).map(({ matcher: u, label: d }) => ({ value: u, label: d }));
|
|
1004
1056
|
return /* @__PURE__ */ t.jsx(
|
|
1005
1057
|
v,
|
|
1006
1058
|
{
|
|
1059
|
+
className: "min-w-[175px]",
|
|
1007
1060
|
name: `${a}.matcher`,
|
|
1008
|
-
value: e != null ?
|
|
1061
|
+
value: e != null ? r.find((u) => u.value === e.matcher) ?? {
|
|
1009
1062
|
label: e.matcher != null ? `⚠️ ${e.matcher}` : "",
|
|
1010
1063
|
value: e.matcher
|
|
1011
1064
|
} : void 0,
|
|
1012
|
-
initialValues:
|
|
1013
|
-
onSelect: (
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
) &&
|
|
1065
|
+
initialValues: r,
|
|
1066
|
+
onSelect: (u) => {
|
|
1067
|
+
w(u) && (s(`${a}.matcher`, u.value), ie.includes(
|
|
1068
|
+
u.value
|
|
1069
|
+
) && s(`${a}.value`, null));
|
|
1017
1070
|
}
|
|
1018
1071
|
}
|
|
1019
1072
|
);
|
|
1020
1073
|
}
|
|
1021
|
-
const
|
|
1022
|
-
const { sdkClient:
|
|
1023
|
-
|
|
1074
|
+
const be = ({ value: e, pathKey: a, infos: s }) => {
|
|
1075
|
+
const { sdkClient: n } = ja(), { setPath: i } = f(), o = s?.field?.name ?? "id", c = Za(s?.resource?.id), { data: l, isLoading: r } = W(
|
|
1076
|
+
c,
|
|
1024
1077
|
"list",
|
|
1025
|
-
|
|
1026
|
-
), { data:
|
|
1027
|
-
|
|
1078
|
+
s?.resource?.id == null ? null : [O({ value: "" })]
|
|
1079
|
+
), { data: u, isLoading: d } = W(
|
|
1080
|
+
c,
|
|
1028
1081
|
"list",
|
|
1029
|
-
|
|
1082
|
+
s?.resource?.id == null ? null : [
|
|
1030
1083
|
{
|
|
1031
|
-
...
|
|
1084
|
+
...O({ value: "" }),
|
|
1032
1085
|
filters: {
|
|
1033
1086
|
id_in: Array.isArray(e) ? e : [e]
|
|
1034
1087
|
}
|
|
1035
1088
|
}
|
|
1036
1089
|
]
|
|
1037
|
-
), h =
|
|
1038
|
-
function
|
|
1090
|
+
), h = le([...u ?? [], ...l ?? []], "id");
|
|
1091
|
+
function j(m) {
|
|
1039
1092
|
return {
|
|
1040
|
-
label: h?.find((
|
|
1093
|
+
label: h?.find((p) => p.id === m.toString())?.name ?? m.toString(),
|
|
1041
1094
|
value: m.toString()
|
|
1042
1095
|
};
|
|
1043
1096
|
}
|
|
@@ -1046,25 +1099,25 @@ const fe = ({ value: e, pathKey: a, infos: n }) => {
|
|
|
1046
1099
|
{
|
|
1047
1100
|
placeholder: "Search...",
|
|
1048
1101
|
isClearable: !1,
|
|
1049
|
-
isMulti:
|
|
1050
|
-
defaultValue: Array.isArray(e) ? e.map(
|
|
1051
|
-
menuFooterText:
|
|
1052
|
-
initialValues:
|
|
1102
|
+
isMulti: s?.matcherInfos?.isMulti,
|
|
1103
|
+
defaultValue: Array.isArray(e) ? e.map(j) : e != null ? j(e) : void 0,
|
|
1104
|
+
menuFooterText: l != null && l.meta.recordCount > 25 ? "Type to search for more options." : void 0,
|
|
1105
|
+
initialValues: K(h ?? [], o),
|
|
1053
1106
|
loadAsyncValues: async (m) => {
|
|
1054
|
-
const
|
|
1055
|
-
return
|
|
1107
|
+
const p = await n[c].list(O({ value: m }));
|
|
1108
|
+
return K(p, o);
|
|
1056
1109
|
},
|
|
1057
1110
|
onSelect: (m) => {
|
|
1058
|
-
|
|
1111
|
+
R(m) ? i(
|
|
1059
1112
|
a,
|
|
1060
|
-
m.map((
|
|
1061
|
-
) :
|
|
1113
|
+
m.map((p) => p.value).filter((p) => p != null)
|
|
1114
|
+
) : w(m) && i(a, m.value);
|
|
1062
1115
|
}
|
|
1063
1116
|
},
|
|
1064
|
-
`${
|
|
1117
|
+
`${s?.matcherInfos?.isMulti?.toString()}-${r}-${d}`
|
|
1065
1118
|
);
|
|
1066
1119
|
};
|
|
1067
|
-
function
|
|
1120
|
+
function O({ value: e }) {
|
|
1068
1121
|
return {
|
|
1069
1122
|
pageSize: 25,
|
|
1070
1123
|
sort: {
|
|
@@ -1075,240 +1128,332 @@ function I({ value: e }) {
|
|
|
1075
1128
|
}
|
|
1076
1129
|
};
|
|
1077
1130
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return e.map((
|
|
1080
|
-
label:
|
|
1131
|
+
function K(e, a) {
|
|
1132
|
+
return e.map((s) => ({
|
|
1133
|
+
label: s.name,
|
|
1081
1134
|
// @ts-expect-error TODO: fix this
|
|
1082
|
-
value:
|
|
1135
|
+
value: s[a]
|
|
1083
1136
|
}));
|
|
1084
1137
|
}
|
|
1085
|
-
const
|
|
1138
|
+
const C = {
|
|
1086
1139
|
in_and: {
|
|
1087
|
-
label: "
|
|
1140
|
+
label: "All of"
|
|
1088
1141
|
},
|
|
1089
1142
|
in_or: {
|
|
1090
|
-
label: "
|
|
1143
|
+
label: "At least one of"
|
|
1091
1144
|
},
|
|
1092
1145
|
not_in_and: {
|
|
1093
|
-
label: "
|
|
1146
|
+
label: "Not any of"
|
|
1094
1147
|
},
|
|
1095
1148
|
not_in_or: {
|
|
1096
|
-
label: "
|
|
1149
|
+
label: "Not at least one of"
|
|
1097
1150
|
}
|
|
1098
1151
|
};
|
|
1099
|
-
function
|
|
1152
|
+
function ee({
|
|
1100
1153
|
value: e,
|
|
1101
1154
|
pathPrefix: a,
|
|
1102
|
-
hasResourceSelector:
|
|
1103
|
-
infos:
|
|
1155
|
+
hasResourceSelector: s = !1,
|
|
1156
|
+
infos: n
|
|
1104
1157
|
}) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1158
|
+
const { setPath: i } = f(), o = Object.keys(
|
|
1159
|
+
C
|
|
1160
|
+
)[0], c = ce(() => typeof e == "object" && e !== null && !Array.isArray(e) ? e : {
|
|
1161
|
+
[o]: []
|
|
1162
|
+
}, [e]);
|
|
1163
|
+
_(() => {
|
|
1164
|
+
(typeof e != "object" || Array.isArray(e) || e === null) && i(a, {
|
|
1165
|
+
[o]: []
|
|
1166
|
+
});
|
|
1167
|
+
}, [e]);
|
|
1168
|
+
const l = Object.keys(C).filter(
|
|
1169
|
+
(r) => !(r in c)
|
|
1170
|
+
);
|
|
1171
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col", children: [
|
|
1172
|
+
Object.entries(c).map(([r, u], d) => /* @__PURE__ */ t.jsx(
|
|
1173
|
+
Ja,
|
|
1174
|
+
{
|
|
1175
|
+
infos: n,
|
|
1176
|
+
hasResourceSelector: s,
|
|
1177
|
+
pathPrefix: a,
|
|
1178
|
+
defaultValue: u,
|
|
1179
|
+
initialMatcher: r,
|
|
1180
|
+
remainingKeys: l
|
|
1181
|
+
},
|
|
1182
|
+
`${a}.${// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
1183
|
+
d}`
|
|
1184
|
+
)),
|
|
1185
|
+
l.length > 0 && /* @__PURE__ */ t.jsxs(B, { top: "4", children: [
|
|
1186
|
+
/* @__PURE__ */ t.jsx(
|
|
1187
|
+
V,
|
|
1188
|
+
{
|
|
1189
|
+
className: "inline-flex",
|
|
1190
|
+
menuPosition: "bottom-left",
|
|
1191
|
+
dropdownItems: [
|
|
1192
|
+
l.map((r) => /* @__PURE__ */ t.jsx(
|
|
1193
|
+
T,
|
|
1194
|
+
{
|
|
1195
|
+
onClick: () => {
|
|
1196
|
+
i(`${a}.${r}`, []);
|
|
1197
|
+
},
|
|
1198
|
+
label: C[r].label
|
|
1199
|
+
},
|
|
1200
|
+
r
|
|
1201
|
+
))
|
|
1202
|
+
],
|
|
1203
|
+
dropdownLabel: /* @__PURE__ */ t.jsx("button", { type: "button", children: /* @__PURE__ */ t.jsxs(N, { className: "flex gap-2 items-center", children: [
|
|
1204
|
+
/* @__PURE__ */ t.jsx(N, { weight: "bold", size: "small", children: "Add value" }),
|
|
1205
|
+
" ",
|
|
1206
|
+
/* @__PURE__ */ t.jsx(y, { name: "caretDown" })
|
|
1207
|
+
] }) })
|
|
1208
|
+
}
|
|
1209
|
+
),
|
|
1210
|
+
/* @__PURE__ */ t.jsx(B, { top: "6", bottom: "2", children: /* @__PURE__ */ t.jsx(_a, { variant: "dashed" }) })
|
|
1211
|
+
] })
|
|
1212
|
+
] }, l.join("-"));
|
|
1119
1213
|
}
|
|
1120
|
-
function
|
|
1214
|
+
function Ja({
|
|
1121
1215
|
initialMatcher: e,
|
|
1122
1216
|
defaultValue: a,
|
|
1123
|
-
pathPrefix:
|
|
1124
|
-
hasResourceSelector:
|
|
1125
|
-
infos:
|
|
1217
|
+
pathPrefix: s,
|
|
1218
|
+
hasResourceSelector: n,
|
|
1219
|
+
infos: i,
|
|
1220
|
+
remainingKeys: o
|
|
1126
1221
|
}) {
|
|
1127
|
-
const [c,
|
|
1128
|
-
return
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
initialValues: [],
|
|
1165
|
-
onSelect: (p) => {
|
|
1166
|
-
E(p) && d(
|
|
1167
|
-
p.map(
|
|
1168
|
-
(m) => typeof m.value == "boolean" ? m.value.toString() : m.value
|
|
1222
|
+
const [c, l] = x(a), { setPath: r } = f();
|
|
1223
|
+
return /* @__PURE__ */ t.jsx(
|
|
1224
|
+
$,
|
|
1225
|
+
{
|
|
1226
|
+
label: /* @__PURE__ */ t.jsx(
|
|
1227
|
+
V,
|
|
1228
|
+
{
|
|
1229
|
+
className: "inline-flex",
|
|
1230
|
+
menuPosition: "bottom-left",
|
|
1231
|
+
dropdownItems: [
|
|
1232
|
+
o.map((u) => /* @__PURE__ */ t.jsx(
|
|
1233
|
+
T,
|
|
1234
|
+
{
|
|
1235
|
+
onClick: () => {
|
|
1236
|
+
r(`${s}.${u}`, c), r(`${s}.${e}`, null);
|
|
1237
|
+
},
|
|
1238
|
+
label: C[u].label
|
|
1239
|
+
},
|
|
1240
|
+
u
|
|
1241
|
+
)),
|
|
1242
|
+
/* @__PURE__ */ t.jsx(
|
|
1243
|
+
P,
|
|
1244
|
+
{
|
|
1245
|
+
hidden: o.length === 0
|
|
1246
|
+
},
|
|
1247
|
+
"divider"
|
|
1248
|
+
),
|
|
1249
|
+
/* @__PURE__ */ t.jsx(
|
|
1250
|
+
T,
|
|
1251
|
+
{
|
|
1252
|
+
disabled: o.length === Object.keys(C).length - 1,
|
|
1253
|
+
onClick: () => {
|
|
1254
|
+
r(`${s}.${e}`, null);
|
|
1255
|
+
},
|
|
1256
|
+
label: "Remove"
|
|
1257
|
+
},
|
|
1258
|
+
"remove"
|
|
1169
1259
|
)
|
|
1170
|
-
|
|
1260
|
+
],
|
|
1261
|
+
dropdownLabel: /* @__PURE__ */ t.jsx("button", { type: "button", children: /* @__PURE__ */ t.jsxs(
|
|
1262
|
+
N,
|
|
1263
|
+
{
|
|
1264
|
+
variant: "info",
|
|
1265
|
+
size: "small",
|
|
1266
|
+
className: "flex gap-2 items-center",
|
|
1267
|
+
children: [
|
|
1268
|
+
C[e].label,
|
|
1269
|
+
" ",
|
|
1270
|
+
/* @__PURE__ */ t.jsx(y, { name: "caretDown" })
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
) })
|
|
1171
1274
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1275
|
+
),
|
|
1276
|
+
children: n ? /* @__PURE__ */ t.jsx(
|
|
1277
|
+
be,
|
|
1278
|
+
{
|
|
1279
|
+
infos: i,
|
|
1280
|
+
value: c,
|
|
1281
|
+
pathKey: `${s}.${e}`
|
|
1282
|
+
}
|
|
1283
|
+
) : /* @__PURE__ */ t.jsx(
|
|
1284
|
+
v,
|
|
1285
|
+
{
|
|
1286
|
+
isMulti: !0,
|
|
1287
|
+
isCreatable: !0,
|
|
1288
|
+
placeholder: "Enter value",
|
|
1289
|
+
defaultValue: (Array.isArray(c) ? c : []).map((u) => ({
|
|
1290
|
+
value: u,
|
|
1291
|
+
label: u.toString()
|
|
1292
|
+
})),
|
|
1293
|
+
initialValues: [],
|
|
1294
|
+
onSelect: (u) => {
|
|
1295
|
+
R(u) && l(
|
|
1296
|
+
u.map(
|
|
1297
|
+
(d) => typeof d.value == "boolean" ? d.value.toString() : d.value
|
|
1298
|
+
)
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
)
|
|
1303
|
+
}
|
|
1304
|
+
);
|
|
1175
1305
|
}
|
|
1176
|
-
function
|
|
1306
|
+
function Wa({
|
|
1177
1307
|
value: e,
|
|
1178
1308
|
onChange: a
|
|
1179
1309
|
}) {
|
|
1180
|
-
const [
|
|
1310
|
+
const [s, n] = x(
|
|
1181
1311
|
Array.isArray(e) && typeof e[0] == "number" ? e[0] : null
|
|
1182
|
-
), [
|
|
1312
|
+
), [i, o] = x(
|
|
1183
1313
|
Array.isArray(e) && typeof e[1] == "number" ? e[1] : null
|
|
1184
1314
|
);
|
|
1185
1315
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1186
1316
|
/* @__PURE__ */ t.jsx("div", { className: "grow", children: /* @__PURE__ */ t.jsx(
|
|
1187
|
-
|
|
1317
|
+
b,
|
|
1188
1318
|
{
|
|
1189
1319
|
type: "number",
|
|
1190
1320
|
placeholder: "Min",
|
|
1191
|
-
value:
|
|
1192
|
-
onChange: (
|
|
1193
|
-
const
|
|
1194
|
-
|
|
1321
|
+
value: s ?? "",
|
|
1322
|
+
onChange: (c) => {
|
|
1323
|
+
const l = parseInt(c.currentTarget.value, 10);
|
|
1324
|
+
n(Number.isNaN(l) ? null : l), a([Number.isNaN(l) ? null : l, i]);
|
|
1195
1325
|
}
|
|
1196
1326
|
}
|
|
1197
1327
|
) }),
|
|
1198
1328
|
/* @__PURE__ */ t.jsx("span", { className: "text-gray-300", children: "to" }),
|
|
1199
1329
|
/* @__PURE__ */ t.jsx("div", { className: "grow", children: /* @__PURE__ */ t.jsx(
|
|
1200
|
-
|
|
1330
|
+
b,
|
|
1201
1331
|
{
|
|
1202
1332
|
type: "number",
|
|
1203
1333
|
placeholder: "Max",
|
|
1204
|
-
value:
|
|
1205
|
-
onChange: (
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1334
|
+
value: i ?? "",
|
|
1335
|
+
onChange: (c) => {
|
|
1336
|
+
const l = parseInt(c.currentTarget.value, 10);
|
|
1337
|
+
o(Number.isNaN(l) ? null : l), a([s, Number.isNaN(l) ? null : l]);
|
|
1208
1338
|
}
|
|
1209
1339
|
}
|
|
1210
1340
|
) })
|
|
1211
1341
|
] });
|
|
1212
1342
|
}
|
|
1213
|
-
function
|
|
1343
|
+
function Ba({
|
|
1214
1344
|
value: e,
|
|
1215
1345
|
onChange: a
|
|
1216
1346
|
}) {
|
|
1217
|
-
const [
|
|
1347
|
+
const [s, n] = x(
|
|
1218
1348
|
Array.isArray(e) && typeof e[0] == "string" ? e[0] : null
|
|
1219
|
-
), [
|
|
1349
|
+
), [i, o] = x(
|
|
1220
1350
|
Array.isArray(e) && typeof e[1] == "string" ? e[1] : null
|
|
1221
1351
|
);
|
|
1222
1352
|
return /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-4", children: [
|
|
1223
1353
|
/* @__PURE__ */ t.jsx("div", { className: "grow", children: /* @__PURE__ */ t.jsx(
|
|
1224
|
-
|
|
1354
|
+
b,
|
|
1225
1355
|
{
|
|
1226
1356
|
type: "text",
|
|
1227
1357
|
placeholder: "Min",
|
|
1228
|
-
value:
|
|
1229
|
-
onChange: (
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1358
|
+
value: s ?? "",
|
|
1359
|
+
onChange: (c) => {
|
|
1360
|
+
const l = c.currentTarget.value;
|
|
1361
|
+
n(l), a([l, i]);
|
|
1232
1362
|
}
|
|
1233
1363
|
}
|
|
1234
1364
|
) }),
|
|
1235
1365
|
/* @__PURE__ */ t.jsx("span", { className: "text-gray-300", children: "to" }),
|
|
1236
1366
|
/* @__PURE__ */ t.jsx("div", { className: "grow", children: /* @__PURE__ */ t.jsx(
|
|
1237
|
-
|
|
1367
|
+
b,
|
|
1238
1368
|
{
|
|
1239
1369
|
type: "text",
|
|
1240
1370
|
placeholder: "Max",
|
|
1241
|
-
value:
|
|
1242
|
-
onChange: (
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1371
|
+
value: i ?? "",
|
|
1372
|
+
onChange: (c) => {
|
|
1373
|
+
const l = c.currentTarget.value;
|
|
1374
|
+
o(l), a([s, l]);
|
|
1245
1375
|
}
|
|
1246
1376
|
}
|
|
1247
1377
|
) })
|
|
1248
1378
|
] });
|
|
1249
1379
|
}
|
|
1250
|
-
function
|
|
1380
|
+
function Ya({
|
|
1251
1381
|
item: e,
|
|
1252
1382
|
pathPrefix: a
|
|
1253
1383
|
}) {
|
|
1254
|
-
const { setPath:
|
|
1384
|
+
const { setPath: s } = f(), { infos: n } = L(e), i = `${a}.value`, [o, c] = x(0), [l, r] = x(e?.matcher), u = e == null || ie.includes(
|
|
1255
1385
|
e.matcher
|
|
1256
1386
|
);
|
|
1257
|
-
let d =
|
|
1258
|
-
|
|
1259
|
-
const h =
|
|
1387
|
+
let d = n?.field?.type;
|
|
1388
|
+
ye(e) && (d == null && (d = pe(e.value)), (typeof e.value == "string" && /^{{.*}}$/.test(e.value) || Array.isArray(e.value) && e.value.some((m) => typeof m == "string" && /^{{.*}}$/.test(m))) && (d = "string"));
|
|
1389
|
+
const h = Xa(d, e?.matcher, n);
|
|
1260
1390
|
return _(
|
|
1261
1391
|
function() {
|
|
1262
|
-
|
|
1392
|
+
l !== e?.matcher && (r(e?.matcher), e?.matcher === "array_match" ? s(i, { in_and: [] }) : s(i, null), c((p) => p + 1));
|
|
1263
1393
|
},
|
|
1264
1394
|
[h]
|
|
1265
|
-
),
|
|
1266
|
-
|
|
1395
|
+
), u ? null : h === "arrayMatch" || h === "resourceSelector" && e?.matcher === "array_match" ? /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
|
|
1396
|
+
te,
|
|
1267
1397
|
{
|
|
1268
1398
|
item: e,
|
|
1269
1399
|
fieldType: d,
|
|
1270
1400
|
componentType: h,
|
|
1271
|
-
pathKey:
|
|
1401
|
+
pathKey: i
|
|
1272
1402
|
}
|
|
1273
|
-
) },
|
|
1403
|
+
) }, o) : /* @__PURE__ */ t.jsx(
|
|
1404
|
+
$,
|
|
1405
|
+
{
|
|
1406
|
+
label: /* @__PURE__ */ t.jsx(N, { variant: "info", size: "small", children: "Value" }),
|
|
1407
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1408
|
+
te,
|
|
1409
|
+
{
|
|
1410
|
+
item: e,
|
|
1411
|
+
fieldType: d,
|
|
1412
|
+
componentType: h,
|
|
1413
|
+
pathKey: i
|
|
1414
|
+
}
|
|
1415
|
+
)
|
|
1416
|
+
},
|
|
1417
|
+
o
|
|
1418
|
+
);
|
|
1274
1419
|
}
|
|
1275
|
-
function
|
|
1420
|
+
function te({
|
|
1276
1421
|
item: e,
|
|
1277
1422
|
fieldType: a,
|
|
1278
|
-
componentType:
|
|
1279
|
-
pathKey:
|
|
1423
|
+
componentType: s,
|
|
1424
|
+
pathKey: n
|
|
1280
1425
|
}) {
|
|
1281
|
-
const { setPath:
|
|
1282
|
-
switch (
|
|
1426
|
+
const { setPath: i } = f(), { user: o } = oe(), { infos: c } = L(e), l = ye(e) ? e.value : void 0;
|
|
1427
|
+
switch (s) {
|
|
1283
1428
|
case "date": {
|
|
1284
|
-
const
|
|
1429
|
+
const r = X(typeof l == "string" ? l : "");
|
|
1285
1430
|
return /* @__PURE__ */ t.jsx(
|
|
1286
|
-
|
|
1431
|
+
Na,
|
|
1287
1432
|
{
|
|
1288
|
-
value:
|
|
1433
|
+
value: E(r) ? r : void 0,
|
|
1289
1434
|
showTimeSelect: !0,
|
|
1290
1435
|
placeholder: "Enter value",
|
|
1291
|
-
onChange: (
|
|
1292
|
-
|
|
1436
|
+
onChange: (u) => {
|
|
1437
|
+
i(n, u?.toJSON());
|
|
1293
1438
|
},
|
|
1294
|
-
timezone:
|
|
1439
|
+
timezone: o?.timezone
|
|
1295
1440
|
}
|
|
1296
1441
|
);
|
|
1297
1442
|
}
|
|
1298
1443
|
case "dateRange": {
|
|
1299
|
-
const
|
|
1300
|
-
const d =
|
|
1301
|
-
return
|
|
1444
|
+
const r = Array.isArray(l) ? l.map((u) => {
|
|
1445
|
+
const d = X(typeof u == "string" ? u : "");
|
|
1446
|
+
return E(d) ? d : null;
|
|
1302
1447
|
}) : [null, null];
|
|
1303
1448
|
return /* @__PURE__ */ t.jsx(
|
|
1304
|
-
|
|
1449
|
+
Ta,
|
|
1305
1450
|
{
|
|
1306
|
-
value:
|
|
1451
|
+
value: r,
|
|
1307
1452
|
showTimeSelect: !0,
|
|
1308
|
-
onChange: (
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1453
|
+
onChange: (u) => {
|
|
1454
|
+
i(
|
|
1455
|
+
n,
|
|
1456
|
+
u.map((d) => d?.toJSON() ?? null)
|
|
1312
1457
|
);
|
|
1313
1458
|
}
|
|
1314
1459
|
}
|
|
@@ -1316,26 +1461,26 @@ function Wa({
|
|
|
1316
1461
|
}
|
|
1317
1462
|
case "numberRange":
|
|
1318
1463
|
return /* @__PURE__ */ t.jsx(
|
|
1319
|
-
|
|
1464
|
+
Wa,
|
|
1320
1465
|
{
|
|
1321
|
-
value:
|
|
1322
|
-
onChange: (
|
|
1323
|
-
|
|
1466
|
+
value: l,
|
|
1467
|
+
onChange: (r) => {
|
|
1468
|
+
i(n, r);
|
|
1324
1469
|
}
|
|
1325
1470
|
}
|
|
1326
1471
|
);
|
|
1327
1472
|
case "textRange":
|
|
1328
1473
|
return /* @__PURE__ */ t.jsx(
|
|
1329
|
-
|
|
1474
|
+
Ba,
|
|
1330
1475
|
{
|
|
1331
|
-
value:
|
|
1332
|
-
onChange: (
|
|
1333
|
-
|
|
1476
|
+
value: l,
|
|
1477
|
+
onChange: (r) => {
|
|
1478
|
+
i(n, r);
|
|
1334
1479
|
}
|
|
1335
1480
|
}
|
|
1336
1481
|
);
|
|
1337
1482
|
case "arrayMatch":
|
|
1338
|
-
return /* @__PURE__ */ t.jsx(
|
|
1483
|
+
return /* @__PURE__ */ t.jsx(ee, { infos: c, value: l, pathPrefix: n });
|
|
1339
1484
|
case "tag":
|
|
1340
1485
|
return /* @__PURE__ */ t.jsx(
|
|
1341
1486
|
v,
|
|
@@ -1343,45 +1488,45 @@ function Wa({
|
|
|
1343
1488
|
isMulti: !0,
|
|
1344
1489
|
isClearable: !1,
|
|
1345
1490
|
isCreatable: !0,
|
|
1346
|
-
defaultValue: Array.isArray(
|
|
1347
|
-
label:
|
|
1348
|
-
value:
|
|
1491
|
+
defaultValue: Array.isArray(l) ? l.map((r) => ({
|
|
1492
|
+
label: r.toString(),
|
|
1493
|
+
value: r
|
|
1349
1494
|
})) : [],
|
|
1350
1495
|
initialValues: [],
|
|
1351
|
-
onSelect: (
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1496
|
+
onSelect: (r) => {
|
|
1497
|
+
R(r) && i(
|
|
1498
|
+
n,
|
|
1499
|
+
r.map((u) => {
|
|
1355
1500
|
if (a === "integer") {
|
|
1356
|
-
const d = parseInt(
|
|
1501
|
+
const d = parseInt(u.value.toString(), 10);
|
|
1357
1502
|
return Number.isNaN(d) ? null : d;
|
|
1358
1503
|
}
|
|
1359
|
-
return
|
|
1360
|
-
}).filter((
|
|
1504
|
+
return u.value;
|
|
1505
|
+
}).filter((u) => u != null)
|
|
1361
1506
|
);
|
|
1362
1507
|
}
|
|
1363
1508
|
}
|
|
1364
1509
|
);
|
|
1365
1510
|
case "resourceSelector":
|
|
1366
1511
|
return e?.matcher === "array_match" ? /* @__PURE__ */ t.jsx(
|
|
1367
|
-
|
|
1512
|
+
ee,
|
|
1368
1513
|
{
|
|
1369
|
-
infos:
|
|
1370
|
-
value:
|
|
1371
|
-
pathPrefix:
|
|
1514
|
+
infos: c,
|
|
1515
|
+
value: l,
|
|
1516
|
+
pathPrefix: n,
|
|
1372
1517
|
hasResourceSelector: !0
|
|
1373
1518
|
}
|
|
1374
|
-
) : /* @__PURE__ */ t.jsx(
|
|
1519
|
+
) : /* @__PURE__ */ t.jsx(be, { infos: c, value: l, pathKey: n });
|
|
1375
1520
|
case "number":
|
|
1376
1521
|
return /* @__PURE__ */ t.jsx(
|
|
1377
|
-
|
|
1522
|
+
b,
|
|
1378
1523
|
{
|
|
1379
|
-
name:
|
|
1524
|
+
name: n,
|
|
1380
1525
|
type: "number",
|
|
1381
|
-
defaultValue: typeof
|
|
1526
|
+
defaultValue: typeof l == "number" ? l : "",
|
|
1382
1527
|
placeholder: "Enter value",
|
|
1383
|
-
onChange: (
|
|
1384
|
-
|
|
1528
|
+
onChange: (r) => {
|
|
1529
|
+
i(n, parseInt(r.currentTarget.value, 10));
|
|
1385
1530
|
}
|
|
1386
1531
|
}
|
|
1387
1532
|
);
|
|
@@ -1389,59 +1534,59 @@ function Wa({
|
|
|
1389
1534
|
return /* @__PURE__ */ t.jsx(
|
|
1390
1535
|
v,
|
|
1391
1536
|
{
|
|
1392
|
-
name:
|
|
1393
|
-
defaultValue: typeof
|
|
1394
|
-
label:
|
|
1395
|
-
value:
|
|
1537
|
+
name: n,
|
|
1538
|
+
defaultValue: typeof l == "boolean" ? {
|
|
1539
|
+
label: l ? "Yes" : "No",
|
|
1540
|
+
value: l
|
|
1396
1541
|
} : void 0,
|
|
1397
1542
|
initialValues: [
|
|
1398
1543
|
{ label: "Yes", value: !0 },
|
|
1399
1544
|
{ label: "No", value: !1 }
|
|
1400
1545
|
],
|
|
1401
|
-
onSelect: (
|
|
1402
|
-
|
|
1546
|
+
onSelect: (r) => {
|
|
1547
|
+
w(r) && i(n, r.value);
|
|
1403
1548
|
}
|
|
1404
1549
|
}
|
|
1405
1550
|
);
|
|
1406
1551
|
case "text":
|
|
1407
1552
|
case null:
|
|
1408
1553
|
return /* @__PURE__ */ t.jsx(
|
|
1409
|
-
|
|
1554
|
+
b,
|
|
1410
1555
|
{
|
|
1411
|
-
name:
|
|
1556
|
+
name: n,
|
|
1412
1557
|
type: "text",
|
|
1413
|
-
defaultValue: typeof
|
|
1558
|
+
defaultValue: typeof l == "string" ? l : JSON.stringify(l),
|
|
1414
1559
|
placeholder: "Enter value",
|
|
1415
|
-
onChange: (
|
|
1416
|
-
|
|
1560
|
+
onChange: (r) => {
|
|
1561
|
+
i(n, r.currentTarget.value);
|
|
1417
1562
|
}
|
|
1418
1563
|
}
|
|
1419
1564
|
);
|
|
1420
1565
|
default:
|
|
1421
|
-
return
|
|
1566
|
+
return ne();
|
|
1422
1567
|
}
|
|
1423
1568
|
}
|
|
1424
|
-
function
|
|
1569
|
+
function ye(e) {
|
|
1425
1570
|
return e != null && "value" in e;
|
|
1426
1571
|
}
|
|
1427
|
-
function
|
|
1428
|
-
let
|
|
1572
|
+
function Xa(e, a, s) {
|
|
1573
|
+
let n = null;
|
|
1429
1574
|
switch (e) {
|
|
1430
1575
|
case "datetime": {
|
|
1431
|
-
|
|
1576
|
+
n = "date";
|
|
1432
1577
|
break;
|
|
1433
1578
|
}
|
|
1434
1579
|
case "boolean": {
|
|
1435
|
-
|
|
1580
|
+
n = "boolean";
|
|
1436
1581
|
break;
|
|
1437
1582
|
}
|
|
1438
1583
|
case "string": {
|
|
1439
|
-
|
|
1584
|
+
n = "text";
|
|
1440
1585
|
break;
|
|
1441
1586
|
}
|
|
1442
1587
|
case "integer":
|
|
1443
1588
|
case "float": {
|
|
1444
|
-
|
|
1589
|
+
n = "number";
|
|
1445
1590
|
break;
|
|
1446
1591
|
}
|
|
1447
1592
|
case "array":
|
|
@@ -1449,7 +1594,7 @@ function Ja(e, a, n) {
|
|
|
1449
1594
|
case "object":
|
|
1450
1595
|
break;
|
|
1451
1596
|
default: {
|
|
1452
|
-
|
|
1597
|
+
n = "text";
|
|
1453
1598
|
break;
|
|
1454
1599
|
}
|
|
1455
1600
|
}
|
|
@@ -1473,191 +1618,134 @@ function Ja(e, a, n) {
|
|
|
1473
1618
|
case "gteq_lt":
|
|
1474
1619
|
case "gt_lteq":
|
|
1475
1620
|
case "gteq_lteq": {
|
|
1476
|
-
|
|
1621
|
+
n === "number" && (n = "numberRange"), n === "text" && (n = "textRange"), n === "date" && (n = "dateRange");
|
|
1477
1622
|
break;
|
|
1478
1623
|
}
|
|
1479
1624
|
case "is_in":
|
|
1480
1625
|
case "is_not_in": {
|
|
1481
|
-
|
|
1626
|
+
n = "tag";
|
|
1482
1627
|
break;
|
|
1483
1628
|
}
|
|
1484
1629
|
case "array_match": {
|
|
1485
|
-
|
|
1630
|
+
n = "arrayMatch";
|
|
1486
1631
|
break;
|
|
1487
1632
|
}
|
|
1488
1633
|
}
|
|
1489
|
-
return
|
|
1634
|
+
return s?.resourceSelectorAvailable && (n = "resourceSelector"), n;
|
|
1490
1635
|
}
|
|
1491
|
-
function
|
|
1636
|
+
function Ha({
|
|
1492
1637
|
item: e,
|
|
1493
1638
|
nestingLevel: a,
|
|
1494
|
-
pathPrefix:
|
|
1495
|
-
onDelete:
|
|
1639
|
+
pathPrefix: s,
|
|
1640
|
+
onDelete: n
|
|
1496
1641
|
}) {
|
|
1497
|
-
const { setPath:
|
|
1498
|
-
return
|
|
1499
|
-
/* @__PURE__ */ t.jsx(
|
|
1500
|
-
M,
|
|
1501
|
-
{
|
|
1502
|
-
label: "Set group",
|
|
1503
|
-
onClick: () => {
|
|
1504
|
-
u(!0);
|
|
1505
|
-
}
|
|
1506
|
-
}
|
|
1507
|
-
)
|
|
1508
|
-
), a < 2 && r[0].push(
|
|
1642
|
+
const { setPath: i } = f(), o = [];
|
|
1643
|
+
return a < 2 && (o[0] ??= [], o[0].push(
|
|
1509
1644
|
/* @__PURE__ */ t.jsx(
|
|
1510
|
-
|
|
1645
|
+
T,
|
|
1511
1646
|
{
|
|
1512
1647
|
label: "Nest conditions",
|
|
1513
1648
|
onClick: () => {
|
|
1514
|
-
|
|
1515
|
-
`${
|
|
1649
|
+
i(
|
|
1650
|
+
`${s}.nested.conditions.${(e?.nested?.conditions ?? []).length}`,
|
|
1516
1651
|
void 0
|
|
1517
1652
|
);
|
|
1518
1653
|
}
|
|
1519
1654
|
}
|
|
1520
1655
|
)
|
|
1521
|
-
),
|
|
1656
|
+
)), n != null && (o[1] ??= [], o[1].push(
|
|
1522
1657
|
/* @__PURE__ */ t.jsx(
|
|
1523
|
-
|
|
1658
|
+
T,
|
|
1524
1659
|
{
|
|
1525
1660
|
label: "Delete",
|
|
1526
1661
|
onClick: () => {
|
|
1527
|
-
|
|
1662
|
+
i(`${s}`, null), n();
|
|
1528
1663
|
}
|
|
1529
1664
|
}
|
|
1530
1665
|
)
|
|
1531
|
-
)), /* @__PURE__ */ t.
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
item: e
|
|
1539
|
-
}
|
|
1540
|
-
),
|
|
1541
|
-
e?.group != null && /* @__PURE__ */ t.jsxs("div", { className: "text-xs pb-4", children: [
|
|
1542
|
-
"Group: ",
|
|
1543
|
-
/* @__PURE__ */ t.jsx(le, { weight: "bold", children: e.group })
|
|
1544
|
-
] }),
|
|
1545
|
-
/* @__PURE__ */ t.jsxs("div", { className: "bg-gray-50 rounded-md flex items-center", children: [
|
|
1546
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-between gap-2 grow p-2", children: /* @__PURE__ */ t.jsxs("div", { className: "flex flex-col gap-2 grow", children: [
|
|
1547
|
-
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1548
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex-1", children: /* @__PURE__ */ t.jsx(
|
|
1549
|
-
Pa,
|
|
1550
|
-
{
|
|
1551
|
-
value: e?.field,
|
|
1552
|
-
name: `${n}.field`
|
|
1553
|
-
}
|
|
1554
|
-
) }),
|
|
1555
|
-
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(La, { item: e, pathPrefix: n }) })
|
|
1556
|
-
] }),
|
|
1557
|
-
/* @__PURE__ */ t.jsx(Ua, { item: e, pathPrefix: n })
|
|
1558
|
-
] }) }),
|
|
1559
|
-
r.length > 0 && /* @__PURE__ */ t.jsx(
|
|
1560
|
-
D,
|
|
1561
|
-
{
|
|
1562
|
-
className: "w-8 border-l border-gray-100 flex items-center justify-center self-stretch shrink-0",
|
|
1563
|
-
dropdownLabel: /* @__PURE__ */ t.jsx(
|
|
1564
|
-
"button",
|
|
1565
|
-
{
|
|
1566
|
-
type: "button",
|
|
1567
|
-
className: "flex items-center justify-center self-stretch grow",
|
|
1568
|
-
children: /* @__PURE__ */ t.jsx(j, { name: "dotsThreeVertical", size: 16, weight: "bold" })
|
|
1569
|
-
}
|
|
1570
|
-
),
|
|
1571
|
-
dropdownItems: r.map((l, i, d) => (
|
|
1666
|
+
)), /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsxs(
|
|
1667
|
+
ge,
|
|
1668
|
+
{
|
|
1669
|
+
dropdownItems: o.map((c, l, r) => (
|
|
1670
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
1671
|
+
/* @__PURE__ */ t.jsxs(Y.Fragment, { children: [
|
|
1672
|
+
c.map((u, d) => (
|
|
1572
1673
|
// biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here since items are static
|
|
1573
|
-
/* @__PURE__ */ t.
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1674
|
+
/* @__PURE__ */ t.jsx(Y.Fragment, { children: u }, d)
|
|
1675
|
+
)),
|
|
1676
|
+
l < r.length - 1 && /* @__PURE__ */ t.jsx(P, {})
|
|
1677
|
+
] }, l)
|
|
1678
|
+
)),
|
|
1679
|
+
options: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1680
|
+
/* @__PURE__ */ t.jsx(Ya, { item: e, pathPrefix: s }),
|
|
1681
|
+
/* @__PURE__ */ t.jsx(Qa, { item: e, pathPrefix: s })
|
|
1682
|
+
] }),
|
|
1683
|
+
children: [
|
|
1684
|
+
/* @__PURE__ */ t.jsx("div", { className: "flex-1", children: /* @__PURE__ */ t.jsx(Fa, { value: e?.field, name: `${s}.field` }) }),
|
|
1685
|
+
/* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(Ua, { item: e, pathPrefix: s }) })
|
|
1686
|
+
]
|
|
1687
|
+
}
|
|
1688
|
+
) });
|
|
1585
1689
|
}
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
onClose: a,
|
|
1589
|
-
pathPrefix: n,
|
|
1590
|
-
item: s
|
|
1591
|
-
}) => {
|
|
1592
|
-
const o = O(null), { setPath: c } = x(), u = pe(), [r, l] = g(s?.group);
|
|
1690
|
+
const Qa = ({ item: e, pathPrefix: a }) => {
|
|
1691
|
+
const { setPath: s } = f(), n = xe(), [i, o] = x(e?.group);
|
|
1593
1692
|
return _(() => {
|
|
1594
|
-
|
|
1595
|
-
}, [
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
/* @__PURE__ */ t.jsx(
|
|
1693
|
+
s(`${a}.group`, i);
|
|
1694
|
+
}, [i]), /* @__PURE__ */ t.jsx(
|
|
1695
|
+
$,
|
|
1696
|
+
{
|
|
1697
|
+
label: /* @__PURE__ */ t.jsx(N, { variant: "info", size: "small", children: "Groups" }),
|
|
1698
|
+
children: /* @__PURE__ */ t.jsx(
|
|
1599
1699
|
v,
|
|
1600
1700
|
{
|
|
1601
|
-
name: `${
|
|
1701
|
+
name: `${a}.group`,
|
|
1602
1702
|
isCreatable: !0,
|
|
1603
1703
|
isClearable: !0,
|
|
1604
|
-
|
|
1605
|
-
|
|
1704
|
+
initialValues: n.map((c) => ({
|
|
1705
|
+
value: c,
|
|
1706
|
+
label: c
|
|
1707
|
+
})),
|
|
1708
|
+
value: i != null ? {
|
|
1606
1709
|
value: i,
|
|
1607
1710
|
label: i
|
|
1608
|
-
})),
|
|
1609
|
-
value: r != null ? {
|
|
1610
|
-
value: r,
|
|
1611
|
-
label: r
|
|
1612
1711
|
} : void 0,
|
|
1613
|
-
onSelect: (
|
|
1614
|
-
(
|
|
1712
|
+
onSelect: (c) => {
|
|
1713
|
+
(c == null || w(c)) && o(c?.value.toString());
|
|
1615
1714
|
},
|
|
1616
1715
|
placeholder: "Select or create group…"
|
|
1617
1716
|
}
|
|
1618
|
-
)
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
/* @__PURE__ */ t.jsx(S.Footer, { children: /* @__PURE__ */ t.jsx(
|
|
1622
|
-
N,
|
|
1623
|
-
{
|
|
1624
|
-
onClick: () => {
|
|
1625
|
-
c(`${n}.group`, r), a();
|
|
1626
|
-
},
|
|
1627
|
-
fullWidth: !0,
|
|
1628
|
-
children: "Save"
|
|
1629
|
-
}
|
|
1630
|
-
) })
|
|
1631
|
-
] });
|
|
1717
|
+
)
|
|
1718
|
+
}
|
|
1719
|
+
);
|
|
1632
1720
|
};
|
|
1633
|
-
function
|
|
1721
|
+
function ve({
|
|
1634
1722
|
item: e,
|
|
1635
1723
|
children: a,
|
|
1636
|
-
nestingLevel:
|
|
1637
|
-
pathPrefix:
|
|
1724
|
+
nestingLevel: s = 0,
|
|
1725
|
+
pathPrefix: n
|
|
1638
1726
|
}) {
|
|
1639
1727
|
const {
|
|
1640
|
-
state: { selectedRuleIndex:
|
|
1641
|
-
} =
|
|
1728
|
+
state: { selectedRuleIndex: i }
|
|
1729
|
+
} = f(), o = e?.conditions_logic?.toLowerCase() ?? "and", { setPath: c } = f(), [l, r] = x(0), u = s > 0;
|
|
1642
1730
|
return /* @__PURE__ */ t.jsxs(
|
|
1643
1731
|
"div",
|
|
1644
1732
|
{
|
|
1645
|
-
className:
|
|
1646
|
-
"p-4 border border-gray-200 rounded-md":
|
|
1733
|
+
className: M("query-group", {
|
|
1734
|
+
"p-4 border border-gray-200 rounded-md": u
|
|
1647
1735
|
}),
|
|
1648
1736
|
children: [
|
|
1649
1737
|
a,
|
|
1650
1738
|
e != null && (e.conditions ?? []).length > 0 && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1651
|
-
|
|
1739
|
+
u && /* @__PURE__ */ t.jsxs(
|
|
1652
1740
|
"select",
|
|
1653
1741
|
{
|
|
1654
1742
|
onChange: (d) => {
|
|
1655
|
-
|
|
1656
|
-
`${
|
|
1743
|
+
c(
|
|
1744
|
+
`${n}.conditions_logic`,
|
|
1657
1745
|
d.currentTarget.value
|
|
1658
1746
|
);
|
|
1659
1747
|
},
|
|
1660
|
-
defaultValue:
|
|
1748
|
+
defaultValue: o,
|
|
1661
1749
|
className: "pl-4 pr-8 py-2 font-bold focus:ring-0 focus:outline-hidden appearance-none bg-gray-50 border border-gray-200 rounded-md text-sm leading-4",
|
|
1662
1750
|
children: [
|
|
1663
1751
|
/* @__PURE__ */ t.jsx("option", { value: "and", children: "Nested in AND" }),
|
|
@@ -1668,43 +1756,43 @@ function ge({
|
|
|
1668
1756
|
/* @__PURE__ */ t.jsx(
|
|
1669
1757
|
"div",
|
|
1670
1758
|
{
|
|
1671
|
-
className:
|
|
1672
|
-
"border-l border-gray-200 ml-3 pt-3":
|
|
1759
|
+
className: M({
|
|
1760
|
+
"border-l border-gray-200 ml-3 pt-3": u
|
|
1673
1761
|
}),
|
|
1674
|
-
children: e?.conditions?.map((d, h,
|
|
1675
|
-
const m = h ===
|
|
1762
|
+
children: e?.conditions?.map((d, h, j) => {
|
|
1763
|
+
const m = h === j.length - 1;
|
|
1676
1764
|
return /* @__PURE__ */ t.jsxs(
|
|
1677
1765
|
"div",
|
|
1678
1766
|
{
|
|
1679
1767
|
className: "flex items-center mb-4 last:mb-0 relative",
|
|
1680
1768
|
children: [
|
|
1681
|
-
|
|
1769
|
+
u && /* @__PURE__ */ t.jsx(Ka, { rounded: m }),
|
|
1682
1770
|
/* @__PURE__ */ t.jsx(
|
|
1683
1771
|
"div",
|
|
1684
1772
|
{
|
|
1685
|
-
className:
|
|
1686
|
-
"ml-4":
|
|
1773
|
+
className: M("w-full", {
|
|
1774
|
+
"ml-4": u
|
|
1687
1775
|
}),
|
|
1688
1776
|
children: /* @__PURE__ */ t.jsx(
|
|
1689
|
-
|
|
1777
|
+
ve,
|
|
1690
1778
|
{
|
|
1691
1779
|
item: d?.nested ?? void 0,
|
|
1692
|
-
nestingLevel: d?.nested != null ?
|
|
1693
|
-
pathPrefix: `${
|
|
1780
|
+
nestingLevel: d?.nested != null ? s + 1 : 0,
|
|
1781
|
+
pathPrefix: `${n}.conditions.${h}.nested`,
|
|
1694
1782
|
children: /* @__PURE__ */ t.jsx(
|
|
1695
1783
|
"div",
|
|
1696
1784
|
{
|
|
1697
|
-
className:
|
|
1785
|
+
className: M({
|
|
1698
1786
|
"mb-4": d?.nested != null
|
|
1699
1787
|
}),
|
|
1700
1788
|
children: /* @__PURE__ */ t.jsx(
|
|
1701
|
-
|
|
1789
|
+
Ha,
|
|
1702
1790
|
{
|
|
1703
1791
|
item: d,
|
|
1704
|
-
nestingLevel:
|
|
1705
|
-
pathPrefix: `${
|
|
1706
|
-
onDelete:
|
|
1707
|
-
|
|
1792
|
+
nestingLevel: s,
|
|
1793
|
+
pathPrefix: `${n}.conditions.${h}`,
|
|
1794
|
+
onDelete: j.length > 1 || s > 0 ? () => {
|
|
1795
|
+
r((p) => p + 1);
|
|
1708
1796
|
} : void 0
|
|
1709
1797
|
}
|
|
1710
1798
|
)
|
|
@@ -1716,7 +1804,7 @@ function ge({
|
|
|
1716
1804
|
)
|
|
1717
1805
|
]
|
|
1718
1806
|
},
|
|
1719
|
-
`${
|
|
1807
|
+
`${i}-${h}-${l}`
|
|
1720
1808
|
);
|
|
1721
1809
|
})
|
|
1722
1810
|
}
|
|
@@ -1726,7 +1814,7 @@ function ge({
|
|
|
1726
1814
|
}
|
|
1727
1815
|
);
|
|
1728
1816
|
}
|
|
1729
|
-
function
|
|
1817
|
+
function Ka({
|
|
1730
1818
|
rounded: e = !1
|
|
1731
1819
|
}) {
|
|
1732
1820
|
return e ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
@@ -1734,16 +1822,16 @@ function Xa({
|
|
|
1734
1822
|
/* @__PURE__ */ t.jsx("div", { className: "absolute -left-px top-1/2 -translate-y-1/2 w-3.5 h-3.5 border-l border-b rounded-es-sm bg-white border-gray-200" })
|
|
1735
1823
|
] }) : /* @__PURE__ */ t.jsx("div", { className: "absolute left-0 top-1/2 -translate-y-1/2 w-3.5 h-px bg-gray-200" });
|
|
1736
1824
|
}
|
|
1737
|
-
function
|
|
1825
|
+
function es() {
|
|
1738
1826
|
const {
|
|
1739
1827
|
setPath: e,
|
|
1740
|
-
state: { value: a, selectedRuleIndex:
|
|
1741
|
-
} =
|
|
1742
|
-
a.rules?.[
|
|
1828
|
+
state: { value: a, selectedRuleIndex: s }
|
|
1829
|
+
} = f(), [n, i] = x(
|
|
1830
|
+
a.rules?.[s]?.name ?? ""
|
|
1743
1831
|
);
|
|
1744
1832
|
return _(() => {
|
|
1745
|
-
|
|
1746
|
-
}, [
|
|
1833
|
+
i(a.rules?.[s]?.name ?? "");
|
|
1834
|
+
}, [s]), // <Input
|
|
1747
1835
|
// value={value.rules?.[selectedRuleIndex]?.name}
|
|
1748
1836
|
// onChange={(event) => {
|
|
1749
1837
|
// const target = event.currentTarget
|
|
@@ -1758,63 +1846,63 @@ function Ha() {
|
|
|
1758
1846
|
{
|
|
1759
1847
|
contentEditable: "plaintext-only",
|
|
1760
1848
|
suppressContentEditableWarning: !0,
|
|
1761
|
-
onInput: (
|
|
1762
|
-
const
|
|
1763
|
-
e(`rules.${
|
|
1849
|
+
onInput: (o) => {
|
|
1850
|
+
const l = o.currentTarget.innerText.replace(/[\n\s]+/g, " ").trim();
|
|
1851
|
+
e(`rules.${s}.name`, l);
|
|
1764
1852
|
},
|
|
1765
|
-
onKeyDown: (
|
|
1766
|
-
|
|
1853
|
+
onKeyDown: (o) => {
|
|
1854
|
+
o.key === "Enter" && (o.preventDefault(), o.currentTarget.blur());
|
|
1767
1855
|
},
|
|
1768
|
-
onBlur: (
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1856
|
+
onBlur: (o) => {
|
|
1857
|
+
const c = o.currentTarget;
|
|
1858
|
+
c.innerText = c.innerText.replace(/[\n\s]+/g, " ").trim();
|
|
1771
1859
|
},
|
|
1772
|
-
children:
|
|
1860
|
+
children: n
|
|
1773
1861
|
},
|
|
1774
|
-
|
|
1862
|
+
s
|
|
1775
1863
|
);
|
|
1776
1864
|
}
|
|
1777
|
-
const
|
|
1865
|
+
const ae = {
|
|
1778
1866
|
rules: []
|
|
1779
|
-
},
|
|
1867
|
+
}, A = (e) => {
|
|
1780
1868
|
try {
|
|
1781
|
-
return JSON.parse(e ?? JSON.stringify(
|
|
1869
|
+
return JSON.parse(e ?? JSON.stringify(ae));
|
|
1782
1870
|
} catch {
|
|
1783
|
-
return
|
|
1871
|
+
return ae;
|
|
1784
1872
|
}
|
|
1785
|
-
},
|
|
1873
|
+
}, ts = (e) => {
|
|
1786
1874
|
try {
|
|
1787
1875
|
return JSON.parse(e ?? "{}"), !0;
|
|
1788
1876
|
} catch {
|
|
1789
1877
|
return !1;
|
|
1790
1878
|
}
|
|
1791
1879
|
};
|
|
1792
|
-
function
|
|
1880
|
+
function us(e) {
|
|
1793
1881
|
const {
|
|
1794
1882
|
settings: { domain: a }
|
|
1795
|
-
} =
|
|
1796
|
-
|
|
1883
|
+
} = oe(), [s, n] = x([]), [i, o] = x(
|
|
1884
|
+
A(e.value ?? e.defaultValue)
|
|
1797
1885
|
);
|
|
1798
1886
|
return _(
|
|
1799
1887
|
function() {
|
|
1800
|
-
|
|
1888
|
+
i.rules?.length === 0 && o(A(e.value));
|
|
1801
1889
|
},
|
|
1802
1890
|
[e.value]
|
|
1803
1891
|
), _(
|
|
1804
1892
|
function() {
|
|
1805
|
-
|
|
1806
|
-
const
|
|
1807
|
-
properties:
|
|
1808
|
-
rules:
|
|
1809
|
-
items:
|
|
1810
|
-
properties:
|
|
1811
|
-
actions:
|
|
1812
|
-
items:
|
|
1813
|
-
anyOf:
|
|
1814
|
-
|
|
1815
|
-
properties:
|
|
1816
|
-
type:
|
|
1817
|
-
enum:
|
|
1893
|
+
wa(e.schemaType, a).then((l) => {
|
|
1894
|
+
const u = g.object({
|
|
1895
|
+
properties: g.object({
|
|
1896
|
+
rules: g.object({
|
|
1897
|
+
items: g.object({
|
|
1898
|
+
properties: g.object({
|
|
1899
|
+
actions: g.object({
|
|
1900
|
+
items: g.object({
|
|
1901
|
+
anyOf: g.array(
|
|
1902
|
+
g.object({
|
|
1903
|
+
properties: g.object({
|
|
1904
|
+
type: g.object({
|
|
1905
|
+
enum: g.string().array()
|
|
1818
1906
|
})
|
|
1819
1907
|
})
|
|
1820
1908
|
})
|
|
@@ -1825,49 +1913,49 @@ function is(e) {
|
|
|
1825
1913
|
})
|
|
1826
1914
|
})
|
|
1827
1915
|
})
|
|
1828
|
-
}).parse(
|
|
1916
|
+
}).parse(l).properties.rules.items.properties.actions.items.anyOf.flatMap(
|
|
1829
1917
|
(d) => d.properties.type.enum
|
|
1830
1918
|
);
|
|
1831
|
-
|
|
1919
|
+
n([...new Set(u)]);
|
|
1832
1920
|
});
|
|
1833
1921
|
},
|
|
1834
1922
|
[a]
|
|
1835
1923
|
), /* @__PURE__ */ t.jsx(
|
|
1836
|
-
|
|
1924
|
+
Ia,
|
|
1837
1925
|
{
|
|
1838
1926
|
initialValue: {
|
|
1839
|
-
value: { rules:
|
|
1840
|
-
availableActionTypes:
|
|
1927
|
+
value: { rules: i.rules },
|
|
1928
|
+
availableActionTypes: s,
|
|
1841
1929
|
schemaType: e.schemaType
|
|
1842
1930
|
},
|
|
1843
|
-
children: /* @__PURE__ */ t.jsx(
|
|
1931
|
+
children: /* @__PURE__ */ t.jsx(as, { ...e })
|
|
1844
1932
|
}
|
|
1845
1933
|
);
|
|
1846
1934
|
}
|
|
1847
|
-
function
|
|
1935
|
+
function as(e) {
|
|
1848
1936
|
const {
|
|
1849
|
-
state: { value: a, selectedRuleIndex:
|
|
1850
|
-
setSelectedRuleIndex:
|
|
1851
|
-
setValue:
|
|
1852
|
-
setPath:
|
|
1853
|
-
} =
|
|
1937
|
+
state: { value: a, selectedRuleIndex: s },
|
|
1938
|
+
setSelectedRuleIndex: n,
|
|
1939
|
+
setValue: i,
|
|
1940
|
+
setPath: o
|
|
1941
|
+
} = f(), [c, l] = x(
|
|
1854
1942
|
e.defaultCodeEditorVisible ?? !1
|
|
1855
|
-
),
|
|
1943
|
+
), r = a.rules?.[s], u = ue(null), [d, h] = x(0);
|
|
1856
1944
|
_(
|
|
1857
1945
|
function() {
|
|
1858
|
-
|
|
1946
|
+
q(A(u.current?.getValue()), a) || u.current?.setValue(JSON.stringify(a, null, 2)), e.onChange?.(a);
|
|
1859
1947
|
},
|
|
1860
1948
|
[a]
|
|
1861
1949
|
);
|
|
1862
|
-
const
|
|
1950
|
+
const j = k(
|
|
1863
1951
|
(m) => {
|
|
1864
|
-
const
|
|
1865
|
-
|
|
1952
|
+
const p = A(m);
|
|
1953
|
+
u.current?.hasTextFocus() && ts(m) && !q(p, a) && (i(p), h((I) => I + 1));
|
|
1866
1954
|
},
|
|
1867
1955
|
[a]
|
|
1868
1956
|
);
|
|
1869
1957
|
return /* @__PURE__ */ t.jsx(
|
|
1870
|
-
|
|
1958
|
+
Ma,
|
|
1871
1959
|
{
|
|
1872
1960
|
hint: e.hint,
|
|
1873
1961
|
feedback: e.feedback,
|
|
@@ -1876,12 +1964,12 @@ function Ka(e) {
|
|
|
1876
1964
|
/* @__PURE__ */ t.jsxs(
|
|
1877
1965
|
"div",
|
|
1878
1966
|
{
|
|
1879
|
-
className: `shrink-0 basis-3/5 overflow-x-auto relative flex flex-col ${
|
|
1967
|
+
className: `shrink-0 basis-3/5 overflow-x-auto relative flex flex-col ${c ? "" : "grow"}`,
|
|
1880
1968
|
children: [
|
|
1881
1969
|
/* @__PURE__ */ t.jsxs("header", { className: "w-full bg-white border-b border-gray-200 px-4 flex text-[13px] gap-4 text-gray-400 font-semibold items-center", children: [
|
|
1882
1970
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center flex-wrap basis-full", children: [
|
|
1883
|
-
a.rules?.map((m,
|
|
1884
|
-
const
|
|
1971
|
+
a.rules?.map((m, p, I) => {
|
|
1972
|
+
const je = `#${(p + 1).toString().padStart(2, "0")}`;
|
|
1885
1973
|
return /* @__PURE__ */ t.jsxs(
|
|
1886
1974
|
"div",
|
|
1887
1975
|
{
|
|
@@ -1891,42 +1979,42 @@ function Ka(e) {
|
|
|
1891
1979
|
"button",
|
|
1892
1980
|
{
|
|
1893
1981
|
type: "button",
|
|
1894
|
-
className:
|
|
1895
|
-
"text-black":
|
|
1982
|
+
className: M("font-bold mr-2", {
|
|
1983
|
+
"text-black": s === p
|
|
1896
1984
|
}),
|
|
1897
1985
|
onClick: () => {
|
|
1898
|
-
|
|
1986
|
+
n(p);
|
|
1899
1987
|
},
|
|
1900
|
-
children:
|
|
1988
|
+
children: je
|
|
1901
1989
|
}
|
|
1902
1990
|
),
|
|
1903
1991
|
/* @__PURE__ */ t.jsx(
|
|
1904
|
-
|
|
1992
|
+
V,
|
|
1905
1993
|
{
|
|
1906
|
-
menuPosition:
|
|
1907
|
-
dropdownLabel: /* @__PURE__ */ t.jsx(
|
|
1994
|
+
menuPosition: p === 0 ? "bottom-left" : "bottom-right",
|
|
1995
|
+
dropdownLabel: /* @__PURE__ */ t.jsx(S, { variant: "circle", children: /* @__PURE__ */ t.jsx(y, { name: "dotsThreeVertical", size: 16 }) }),
|
|
1908
1996
|
dropdownItems: /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1909
1997
|
/* @__PURE__ */ t.jsx(
|
|
1910
|
-
|
|
1998
|
+
T,
|
|
1911
1999
|
{
|
|
1912
2000
|
onClick: () => {
|
|
1913
|
-
const
|
|
1914
|
-
|
|
2001
|
+
const z = a.rules?.length ?? 0;
|
|
2002
|
+
o(`rules.${z}`, {
|
|
1915
2003
|
...m,
|
|
1916
2004
|
id: void 0,
|
|
1917
2005
|
name: `${m.name} (copy)`
|
|
1918
|
-
}),
|
|
2006
|
+
}), n(z);
|
|
1919
2007
|
},
|
|
1920
2008
|
label: "Duplicate"
|
|
1921
2009
|
}
|
|
1922
2010
|
),
|
|
1923
|
-
/* @__PURE__ */ t.jsx(
|
|
2011
|
+
/* @__PURE__ */ t.jsx(P, {}),
|
|
1924
2012
|
/* @__PURE__ */ t.jsx(
|
|
1925
|
-
|
|
2013
|
+
T,
|
|
1926
2014
|
{
|
|
1927
|
-
disabled:
|
|
2015
|
+
disabled: I.length === 1,
|
|
1928
2016
|
onClick: () => {
|
|
1929
|
-
|
|
2017
|
+
o(`rules.${p}`, null), s >= p && n(s - 1);
|
|
1930
2018
|
},
|
|
1931
2019
|
label: "Delete"
|
|
1932
2020
|
}
|
|
@@ -1936,43 +2024,43 @@ function Ka(e) {
|
|
|
1936
2024
|
)
|
|
1937
2025
|
]
|
|
1938
2026
|
},
|
|
1939
|
-
`${
|
|
2027
|
+
`${p}-${m.id}`
|
|
1940
2028
|
);
|
|
1941
2029
|
}),
|
|
1942
2030
|
/* @__PURE__ */ t.jsx("div", { className: "min-h-[49px] flex items-center", children: /* @__PURE__ */ t.jsx(
|
|
1943
|
-
|
|
2031
|
+
S,
|
|
1944
2032
|
{
|
|
1945
2033
|
variant: "circle",
|
|
1946
2034
|
className: "mx-4",
|
|
1947
2035
|
onClick: () => {
|
|
1948
|
-
|
|
2036
|
+
o(`rules.${a.rules?.length ?? 0}`, {
|
|
1949
2037
|
name: "Rule name",
|
|
1950
2038
|
actions: [null],
|
|
1951
2039
|
conditions: [null]
|
|
1952
|
-
}),
|
|
2040
|
+
}), n(a.rules?.length ?? 0);
|
|
1953
2041
|
},
|
|
1954
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2042
|
+
children: /* @__PURE__ */ t.jsx(y, { name: "plus", size: 16, className: "shrink-0" })
|
|
1955
2043
|
}
|
|
1956
2044
|
) })
|
|
1957
2045
|
] }),
|
|
1958
2046
|
/* @__PURE__ */ t.jsx("div", { className: "grow flex justify-end", children: /* @__PURE__ */ t.jsx(
|
|
1959
|
-
|
|
2047
|
+
S,
|
|
1960
2048
|
{
|
|
1961
2049
|
variant: "circle",
|
|
1962
2050
|
onClick: () => {
|
|
1963
|
-
|
|
2051
|
+
l(!c);
|
|
1964
2052
|
},
|
|
1965
|
-
children: /* @__PURE__ */ t.jsx(
|
|
2053
|
+
children: /* @__PURE__ */ t.jsx(y, { name: "sidebarSimple", size: 16 })
|
|
1966
2054
|
}
|
|
1967
2055
|
) })
|
|
1968
2056
|
] }),
|
|
1969
|
-
/* @__PURE__ */ t.jsx(
|
|
2057
|
+
/* @__PURE__ */ t.jsx(ns, { children: r && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1970
2058
|
/* @__PURE__ */ t.jsxs("div", { className: "mb-8 flex items-center gap-2", children: [
|
|
1971
|
-
/* @__PURE__ */ t.jsx(
|
|
1972
|
-
/* @__PURE__ */ t.jsx(
|
|
2059
|
+
/* @__PURE__ */ t.jsx(es, {}),
|
|
2060
|
+
/* @__PURE__ */ t.jsx(y, { name: "pencilSimple", size: 16, className: "shrink-0" })
|
|
1973
2061
|
] }),
|
|
1974
2062
|
/* @__PURE__ */ t.jsxs(
|
|
1975
|
-
|
|
2063
|
+
se,
|
|
1976
2064
|
{
|
|
1977
2065
|
title: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1978
2066
|
"If",
|
|
@@ -1981,12 +2069,12 @@ function Ka(e) {
|
|
|
1981
2069
|
"select",
|
|
1982
2070
|
{
|
|
1983
2071
|
onChange: (m) => {
|
|
1984
|
-
|
|
1985
|
-
`rules.${
|
|
2072
|
+
o(
|
|
2073
|
+
`rules.${s}.conditions_logic`,
|
|
1986
2074
|
m.currentTarget.value
|
|
1987
2075
|
);
|
|
1988
2076
|
},
|
|
1989
|
-
value:
|
|
2077
|
+
value: r?.conditions_logic ?? "all",
|
|
1990
2078
|
className: "font-bold py-1 pl-2 pr-6 bg-position-[right_center] focus:ring-0 focus:outline-hidden appearance-none border-0 rounded-md leading-4 ml-1 mr-1.5",
|
|
1991
2079
|
children: [
|
|
1992
2080
|
/* @__PURE__ */ t.jsx("option", { value: "and", children: "all" }),
|
|
@@ -1999,26 +2087,26 @@ function Ka(e) {
|
|
|
1999
2087
|
icon: "treeView",
|
|
2000
2088
|
children: [
|
|
2001
2089
|
/* @__PURE__ */ t.jsx(
|
|
2002
|
-
|
|
2090
|
+
ve,
|
|
2003
2091
|
{
|
|
2004
|
-
item:
|
|
2005
|
-
pathPrefix: `rules.${
|
|
2092
|
+
item: r,
|
|
2093
|
+
pathPrefix: `rules.${s}`
|
|
2006
2094
|
}
|
|
2007
2095
|
),
|
|
2008
2096
|
/* @__PURE__ */ t.jsx("div", { className: "mt-6", children: /* @__PURE__ */ t.jsxs(
|
|
2009
|
-
|
|
2097
|
+
S,
|
|
2010
2098
|
{
|
|
2011
2099
|
size: "small",
|
|
2012
2100
|
variant: "secondary",
|
|
2013
2101
|
alignItems: "center",
|
|
2014
2102
|
onClick: () => {
|
|
2015
|
-
|
|
2016
|
-
`rules.${
|
|
2103
|
+
o(
|
|
2104
|
+
`rules.${s}.conditions.${r?.conditions?.length ?? 0}`,
|
|
2017
2105
|
void 0
|
|
2018
2106
|
);
|
|
2019
2107
|
},
|
|
2020
2108
|
children: [
|
|
2021
|
-
/* @__PURE__ */ t.jsx(
|
|
2109
|
+
/* @__PURE__ */ t.jsx(y, { name: "plusCircle" }),
|
|
2022
2110
|
" Add condition"
|
|
2023
2111
|
]
|
|
2024
2112
|
}
|
|
@@ -2026,55 +2114,55 @@ function Ka(e) {
|
|
|
2026
2114
|
]
|
|
2027
2115
|
}
|
|
2028
2116
|
),
|
|
2029
|
-
/* @__PURE__ */ t.jsx(
|
|
2030
|
-
/* @__PURE__ */ t.jsx(
|
|
2117
|
+
/* @__PURE__ */ t.jsx(ss, { children: "do" }),
|
|
2118
|
+
/* @__PURE__ */ t.jsx(se, { title: "Actions", icon: "lightning", children: /* @__PURE__ */ t.jsx(za, { actions: r?.actions }) })
|
|
2031
2119
|
] }) })
|
|
2032
2120
|
]
|
|
2033
2121
|
},
|
|
2034
2122
|
d
|
|
2035
2123
|
),
|
|
2036
|
-
|
|
2037
|
-
|
|
2124
|
+
c && /* @__PURE__ */ t.jsx("div", { className: "shrink-0 basis-2/5", children: /* @__PURE__ */ t.jsx(
|
|
2125
|
+
Ca,
|
|
2038
2126
|
{
|
|
2039
|
-
ref:
|
|
2127
|
+
ref: u,
|
|
2040
2128
|
name: e.id ?? e.name,
|
|
2041
2129
|
height: "100%",
|
|
2042
2130
|
language: "json",
|
|
2043
2131
|
jsonSchema: e.schemaType,
|
|
2044
2132
|
defaultValue: JSON.stringify(a, null, 2),
|
|
2045
2133
|
noRounding: !0,
|
|
2046
|
-
onChange:
|
|
2134
|
+
onChange: j
|
|
2047
2135
|
}
|
|
2048
2136
|
) })
|
|
2049
2137
|
] })
|
|
2050
2138
|
}
|
|
2051
2139
|
);
|
|
2052
2140
|
}
|
|
2053
|
-
function
|
|
2141
|
+
function ss({ children: e }) {
|
|
2054
2142
|
return /* @__PURE__ */ t.jsxs("div", { className: "text-gray-500 flex items-center justify-center flex-col", children: [
|
|
2055
2143
|
/* @__PURE__ */ t.jsx("div", { className: "h-6 w-[2px] bg-gray-200" }),
|
|
2056
2144
|
/* @__PURE__ */ t.jsx("span", { className: "font-bold my-1 bg-gray-200 px-3 relative uppercase rounded h-[25px] items-center flex text-sm", children: e }),
|
|
2057
2145
|
/* @__PURE__ */ t.jsx("div", { className: "h-6 w-[2px] bg-gray-200" })
|
|
2058
2146
|
] });
|
|
2059
2147
|
}
|
|
2060
|
-
function
|
|
2148
|
+
function se({
|
|
2061
2149
|
children: e,
|
|
2062
2150
|
title: a,
|
|
2063
|
-
icon:
|
|
2151
|
+
icon: s
|
|
2064
2152
|
}) {
|
|
2065
2153
|
return /* @__PURE__ */ t.jsxs("div", { className: "rounded-md bg-white shadow-xs", children: [
|
|
2066
2154
|
/* @__PURE__ */ t.jsxs("div", { className: "flex items-center space-x-4 py-4 border-b border-gray-100", children: [
|
|
2067
|
-
/* @__PURE__ */ t.jsx("div", { className: "w-8 h-8 -ml-4 bg-white rounded-full border border-gray-200 flex items-center justify-center shadow-xs shadow-primary-200", children: /* @__PURE__ */ t.jsx(
|
|
2155
|
+
/* @__PURE__ */ t.jsx("div", { className: "w-8 h-8 -ml-4 bg-white rounded-full border border-gray-200 flex items-center justify-center shadow-xs shadow-primary-200", children: /* @__PURE__ */ t.jsx(y, { name: s }) }),
|
|
2068
2156
|
/* @__PURE__ */ t.jsx("h2", { className: "font-semibold", children: a })
|
|
2069
2157
|
] }),
|
|
2070
2158
|
/* @__PURE__ */ t.jsx("div", { className: "p-6", children: e })
|
|
2071
2159
|
] });
|
|
2072
2160
|
}
|
|
2073
|
-
function
|
|
2161
|
+
function ns({
|
|
2074
2162
|
children: e
|
|
2075
2163
|
}) {
|
|
2076
2164
|
return /* @__PURE__ */ t.jsx("div", { className: "h-full w-full bg-gray-50 p-8 bg-[radial-gradient(#d6d6d6_1px,transparent_1px)] bg-size-[16px_16px] overflow-auto", children: /* @__PURE__ */ t.jsx("div", { className: "max-w-[900px] mx-auto", children: e }) });
|
|
2077
2165
|
}
|
|
2078
2166
|
export {
|
|
2079
|
-
|
|
2167
|
+
us as RuleEngine
|
|
2080
2168
|
};
|