camox 0.18.2 → 0.20.0

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.
@@ -1,6 +1,7 @@
1
1
  import { useProjectSlug } from "../../../lib/auth.js";
2
2
  import { pageQueries, projectQueries } from "../../../lib/queries.js";
3
3
  import { cn, formatPathSegment } from "../../../lib/utils.js";
4
+ import { useDebouncedField } from "../../../hooks/use-debounced-field.js";
4
5
  import { c } from "react/compiler-runtime";
5
6
  import { Input } from "@camox/ui/input";
6
7
  import { Label } from "@camox/ui/label";
@@ -24,10 +25,10 @@ const normalizeLinkValue = (value) => {
24
25
  return value;
25
26
  };
26
27
  const LinkFieldEditor = (t0) => {
27
- const $ = c(76);
28
- if ($[0] !== "fe9989574021dca3d84b6e4d5a16b1a739d91ba1250a8a3ea4bc0adfe2cf5512") {
29
- for (let $i = 0; $i < 76; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
30
- $[0] = "fe9989574021dca3d84b6e4d5a16b1a739d91ba1250a8a3ea4bc0adfe2cf5512";
28
+ const $ = c(79);
29
+ if ($[0] !== "95e7177e7020f25e169b343158727482bdf3b88263993823abf2f5febed7d12e") {
30
+ for (let $i = 0; $i < 79; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
31
+ $[0] = "95e7177e7020f25e169b343158727482bdf3b88263993823abf2f5febed7d12e";
31
32
  }
32
33
  const { fieldName, linkValue: rawLinkValue, onSave } = t0;
33
34
  let t1;
@@ -37,382 +38,332 @@ const LinkFieldEditor = (t0) => {
37
38
  $[2] = t1;
38
39
  } else t1 = $[2];
39
40
  const linkValue = t1;
40
- const timerRef = React.useRef(null);
41
- const [text, setText] = React.useState(linkValue.text);
42
- const [href, setHref] = React.useState(linkValue.type === "external" ? linkValue.href : "");
43
- const [isTextFocused, setIsTextFocused] = React.useState(false);
44
- const [isHrefFocused, setIsHrefFocused] = React.useState(false);
45
41
  const linkValueRef = React.useRef(linkValue);
46
- const [pagePickerOpen, setPagePickerOpen] = React.useState(false);
47
- const projectSlug = useProjectSlug();
48
42
  let t2;
49
- if ($[3] !== projectSlug) {
50
- t2 = projectQueries.getBySlug(projectSlug);
51
- $[3] = projectSlug;
52
- $[4] = t2;
53
- } else t2 = $[4];
54
- const { data: project } = useQuery(t2);
55
43
  let t3;
56
- if ($[5] !== project?.id) {
57
- t3 = pageQueries.list(project?.id ?? 0);
58
- $[5] = project?.id;
59
- $[6] = t3;
60
- } else t3 = $[6];
61
- const t4 = !!project;
62
- let t5;
63
- if ($[7] !== t3 || $[8] !== t4) {
64
- t5 = {
65
- ...t3,
66
- enabled: t4
67
- };
68
- $[7] = t3;
69
- $[8] = t4;
70
- $[9] = t5;
71
- } else t5 = $[9];
72
- const { data: pages } = useQuery(t5);
73
- const selectedPage = linkValue.type === "page" ? pages?.find((p) => String(p.id) === linkValue.pageId) : null;
74
- let t6;
75
- let t7;
76
- if ($[10] !== linkValue) {
77
- t6 = () => {
44
+ if ($[3] !== linkValue) {
45
+ t2 = () => {
78
46
  linkValueRef.current = linkValue;
79
47
  };
80
- t7 = [linkValue];
81
- $[10] = linkValue;
82
- $[11] = t6;
83
- $[12] = t7;
48
+ t3 = [linkValue];
49
+ $[3] = linkValue;
50
+ $[4] = t2;
51
+ $[5] = t3;
84
52
  } else {
85
- t6 = $[11];
86
- t7 = $[12];
53
+ t2 = $[4];
54
+ t3 = $[5];
87
55
  }
88
- React.useEffect(t6, t7);
89
- let t8;
56
+ React.useEffect(t2, t3);
57
+ let t4;
58
+ if ($[6] !== fieldName || $[7] !== onSave) {
59
+ t4 = (value) => onSave(fieldName, {
60
+ ...linkValueRef.current,
61
+ text: value
62
+ });
63
+ $[6] = fieldName;
64
+ $[7] = onSave;
65
+ $[8] = t4;
66
+ } else t4 = $[8];
67
+ const textField = useDebouncedField(linkValue.text, t4);
68
+ let t5;
69
+ if ($[9] !== fieldName || $[10] !== onSave) {
70
+ t5 = (value_0) => onSave(fieldName, {
71
+ ...linkValueRef.current,
72
+ href: value_0
73
+ });
74
+ $[9] = fieldName;
75
+ $[10] = onSave;
76
+ $[11] = t5;
77
+ } else t5 = $[11];
78
+ const hrefField = useDebouncedField(linkValue.type === "external" ? linkValue.href : "", t5);
79
+ const [pagePickerOpen, setPagePickerOpen] = React.useState(false);
80
+ const projectSlug = useProjectSlug();
81
+ let t6;
82
+ if ($[12] !== projectSlug) {
83
+ t6 = projectQueries.getBySlug(projectSlug);
84
+ $[12] = projectSlug;
85
+ $[13] = t6;
86
+ } else t6 = $[13];
87
+ const { data: project } = useQuery(t6);
88
+ let t7;
89
+ if ($[14] !== project?.id) {
90
+ t7 = pageQueries.list(project?.id ?? 0);
91
+ $[14] = project?.id;
92
+ $[15] = t7;
93
+ } else t7 = $[15];
94
+ const t8 = !!project;
90
95
  let t9;
91
- if ($[13] !== isTextFocused || $[14] !== linkValue.text) {
92
- t8 = () => {
93
- if (!isTextFocused) setText(linkValue.text);
96
+ if ($[16] !== t7 || $[17] !== t8) {
97
+ t9 = {
98
+ ...t7,
99
+ enabled: t8
94
100
  };
95
- t9 = [linkValue.text, isTextFocused];
96
- $[13] = isTextFocused;
97
- $[14] = linkValue.text;
98
- $[15] = t8;
99
- $[16] = t9;
100
- } else {
101
- t8 = $[15];
102
- t9 = $[16];
103
- }
104
- React.useEffect(t8, t9);
101
+ $[16] = t7;
102
+ $[17] = t8;
103
+ $[18] = t9;
104
+ } else t9 = $[18];
105
+ const { data: pages } = useQuery(t9);
105
106
  let t10;
106
- if ($[17] !== isHrefFocused || $[18] !== linkValue.href || $[19] !== linkValue.type) {
107
- t10 = () => {
108
- if (linkValue.type === "external" && !isHrefFocused) setHref(linkValue.href);
109
- };
110
- $[17] = isHrefFocused;
111
- $[18] = linkValue.href;
112
- $[19] = linkValue.type;
113
- $[20] = t10;
114
- } else t10 = $[20];
115
107
  let t11;
116
- if ($[21] !== isHrefFocused || $[22] !== linkValue) {
117
- t11 = [linkValue, isHrefFocused];
118
- $[21] = isHrefFocused;
119
- $[22] = linkValue;
120
- $[23] = t11;
121
- } else t11 = $[23];
122
- React.useEffect(t10, t11);
123
108
  let t12;
124
109
  let t13;
125
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
126
- t12 = () => () => {
127
- if (timerRef.current) clearTimeout(timerRef.current);
128
- };
129
- t13 = [];
130
- $[24] = t12;
131
- $[25] = t13;
132
- } else {
133
- t12 = $[24];
134
- t13 = $[25];
135
- }
136
- React.useEffect(t12, t13);
137
110
  let t14;
138
- if ($[26] !== fieldName || $[27] !== onSave) {
139
- t14 = (value) => {
140
- if (timerRef.current) clearTimeout(timerRef.current);
141
- timerRef.current = window.setTimeout(() => {
142
- onSave(fieldName, {
143
- ...linkValueRef.current,
144
- text: value
145
- });
146
- }, 500);
147
- };
148
- $[26] = fieldName;
149
- $[27] = onSave;
150
- $[28] = t14;
151
- } else t14 = $[28];
152
- const handleTextChange = t14;
153
111
  let t15;
154
- if ($[29] !== fieldName || $[30] !== onSave) {
155
- t15 = (value_0) => {
156
- if (timerRef.current) clearTimeout(timerRef.current);
157
- timerRef.current = window.setTimeout(() => {
112
+ if ($[19] !== fieldName || $[20] !== hrefField || $[21] !== linkValue.pageId || $[22] !== linkValue.type || $[23] !== onSave || $[24] !== pagePickerOpen || $[25] !== pages || $[26] !== textField) {
113
+ const selectedPage = linkValue.type === "page" ? pages?.find((p) => String(p.id) === linkValue.pageId) : null;
114
+ let t16;
115
+ if ($[33] !== fieldName || $[34] !== onSave) {
116
+ t16 = (mode) => {
117
+ if (mode === "page") onSave(fieldName, {
118
+ type: "page",
119
+ text: linkValueRef.current.text,
120
+ pageId: "",
121
+ newTab: linkValueRef.current.newTab
122
+ });
123
+ else onSave(fieldName, {
124
+ type: "external",
125
+ text: linkValueRef.current.text,
126
+ href: "",
127
+ newTab: linkValueRef.current.newTab
128
+ });
129
+ };
130
+ $[33] = fieldName;
131
+ $[34] = onSave;
132
+ $[35] = t16;
133
+ } else t16 = $[35];
134
+ const handleModeChange = t16;
135
+ let t17;
136
+ if ($[36] !== fieldName || $[37] !== onSave) {
137
+ t17 = (pageId) => {
158
138
  onSave(fieldName, {
159
- ...linkValueRef.current,
160
- href: value_0
139
+ type: "page",
140
+ text: linkValueRef.current.text,
141
+ pageId,
142
+ newTab: linkValueRef.current.newTab
161
143
  });
162
- }, 500);
163
- };
164
- $[29] = fieldName;
165
- $[30] = onSave;
166
- $[31] = t15;
167
- } else t15 = $[31];
168
- const handleHrefChange = t15;
169
- let t16;
170
- if ($[32] !== fieldName || $[33] !== onSave) {
171
- t16 = (mode) => {
172
- if (mode === "page") onSave(fieldName, {
173
- type: "page",
174
- text: linkValueRef.current.text,
175
- pageId: "",
176
- newTab: linkValueRef.current.newTab
144
+ setPagePickerOpen(false);
145
+ };
146
+ $[36] = fieldName;
147
+ $[37] = onSave;
148
+ $[38] = t17;
149
+ } else t17 = $[38];
150
+ const handlePageSelect = t17;
151
+ t14 = "grid gap-3";
152
+ const t18 = `${fieldName}-text`;
153
+ let t19;
154
+ if ($[39] !== t18) {
155
+ t19 = /* @__PURE__ */ jsx(Label, {
156
+ htmlFor: t18,
157
+ children: "Text"
177
158
  });
178
- else onSave(fieldName, {
179
- type: "external",
180
- text: linkValueRef.current.text,
181
- href: "",
182
- newTab: linkValueRef.current.newTab
159
+ $[39] = t18;
160
+ $[40] = t19;
161
+ } else t19 = $[40];
162
+ const t20 = `${fieldName}-text`;
163
+ let t21;
164
+ if ($[41] !== textField) {
165
+ t21 = (e) => textField.setValue(e.target.value);
166
+ $[41] = textField;
167
+ $[42] = t21;
168
+ } else t21 = $[42];
169
+ let t22;
170
+ if ($[43] !== t20 || $[44] !== t21 || $[45] !== textField.onBlur || $[46] !== textField.onFocus || $[47] !== textField.value) {
171
+ t22 = /* @__PURE__ */ jsx(Input, {
172
+ id: t20,
173
+ value: textField.value,
174
+ onChange: t21,
175
+ onFocus: textField.onFocus,
176
+ onBlur: textField.onBlur,
177
+ autoFocus: true
183
178
  });
184
- };
185
- $[32] = fieldName;
186
- $[33] = onSave;
187
- $[34] = t16;
188
- } else t16 = $[34];
189
- const handleModeChange = t16;
190
- let t17;
191
- if ($[35] !== fieldName || $[36] !== onSave) {
192
- t17 = (pageId) => {
193
- onSave(fieldName, {
194
- type: "page",
195
- text: linkValueRef.current.text,
196
- pageId,
197
- newTab: linkValueRef.current.newTab
179
+ $[43] = t20;
180
+ $[44] = t21;
181
+ $[45] = textField.onBlur;
182
+ $[46] = textField.onFocus;
183
+ $[47] = textField.value;
184
+ $[48] = t22;
185
+ } else t22 = $[48];
186
+ if ($[49] !== t19 || $[50] !== t22) {
187
+ t15 = /* @__PURE__ */ jsxs("div", {
188
+ className: "grid gap-1.5",
189
+ children: [t19, t22]
198
190
  });
199
- setPagePickerOpen(false);
200
- };
201
- $[35] = fieldName;
202
- $[36] = onSave;
203
- $[37] = t17;
204
- } else t17 = $[37];
205
- const handlePageSelect = t17;
206
- const t18 = "grid gap-3";
207
- const t19 = `${fieldName}-text`;
208
- let t20;
209
- if ($[38] !== t19) {
210
- t20 = /* @__PURE__ */ jsx(Label, {
211
- htmlFor: t19,
212
- children: "Text"
191
+ $[49] = t19;
192
+ $[50] = t22;
193
+ $[51] = t15;
194
+ } else t15 = $[51];
195
+ t10 = "grid gap-1.5";
196
+ if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
197
+ t11 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
198
+ $[52] = t11;
199
+ } else t11 = $[52];
200
+ let t23;
201
+ if ($[53] === Symbol.for("react.memo_cache_sentinel")) {
202
+ t23 = /* @__PURE__ */ jsxs(TabsList, {
203
+ className: "w-full",
204
+ children: [/* @__PURE__ */ jsx(TabsTrigger, {
205
+ value: "page",
206
+ children: "Page"
207
+ }), /* @__PURE__ */ jsx(TabsTrigger, {
208
+ value: "external",
209
+ children: "URL"
210
+ })]
211
+ });
212
+ $[53] = t23;
213
+ } else t23 = $[53];
214
+ if ($[54] !== handleModeChange || $[55] !== linkValue.type) {
215
+ t12 = /* @__PURE__ */ jsx(Tabs, {
216
+ value: linkValue.type,
217
+ onValueChange: handleModeChange,
218
+ children: t23
219
+ });
220
+ $[54] = handleModeChange;
221
+ $[55] = linkValue.type;
222
+ $[56] = t12;
223
+ } else t12 = $[56];
224
+ t13 = linkValue.type === "page" ? /* @__PURE__ */ jsxs(Popover, {
225
+ open: pagePickerOpen,
226
+ onOpenChange: setPagePickerOpen,
227
+ children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
228
+ render: /* @__PURE__ */ jsx(Button, {
229
+ variant: "outline",
230
+ role: "combobox",
231
+ className: "justify-between font-normal"
232
+ }),
233
+ children: [selectedPage ? /* @__PURE__ */ jsx("span", {
234
+ className: "truncate",
235
+ children: selectedPage.metaTitle ?? formatPathSegment(selectedPage.pathSegment)
236
+ }) : /* @__PURE__ */ jsx("span", {
237
+ className: "text-muted-foreground",
238
+ children: "Select a page"
239
+ }), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
240
+ }), /* @__PURE__ */ jsx(PopoverContent, {
241
+ align: "start",
242
+ className: "p-0",
243
+ children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, {
244
+ placeholder: "Search page...",
245
+ className: "h-9"
246
+ }), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }), /* @__PURE__ */ jsx(CommandGroup, { children: pages?.map((page) => /* @__PURE__ */ jsxs(CommandItem, {
247
+ value: page.fullPath,
248
+ onSelect: () => handlePageSelect(String(page.id)),
249
+ children: [/* @__PURE__ */ jsx(Check, { className: cn("mr-2 size-4", selectedPage?.id === page.id ? "opacity-100" : "opacity-0") }), /* @__PURE__ */ jsxs("div", {
250
+ className: "flex flex-col",
251
+ children: [/* @__PURE__ */ jsx("span", { children: page.metaTitle ?? formatPathSegment(page.pathSegment) }), /* @__PURE__ */ jsx("span", {
252
+ className: "text-muted-foreground font-mono text-xs",
253
+ children: page.fullPath
254
+ })]
255
+ })]
256
+ }, page.id)) })] })] })
257
+ })]
258
+ }) : /* @__PURE__ */ jsx(Input, {
259
+ type: "url",
260
+ id: `${fieldName}-href`,
261
+ placeholder: "https://",
262
+ value: hrefField.value,
263
+ onChange: (e_0) => hrefField.setValue(e_0.target.value),
264
+ onFocus: hrefField.onFocus,
265
+ onBlur: hrefField.onBlur
213
266
  });
214
- $[38] = t19;
215
- $[39] = t20;
216
- } else t20 = $[39];
217
- const t21 = `${fieldName}-text`;
218
- let t22;
219
- if ($[40] !== handleTextChange) {
220
- t22 = (e) => {
221
- setText(e.target.value);
222
- handleTextChange(e.target.value);
223
- };
224
- $[40] = handleTextChange;
225
- $[41] = t22;
226
- } else t22 = $[41];
227
- let t23;
228
- let t24;
229
- if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
230
- t23 = () => setIsTextFocused(true);
231
- t24 = () => setIsTextFocused(false);
232
- $[42] = t23;
233
- $[43] = t24;
267
+ $[19] = fieldName;
268
+ $[20] = hrefField;
269
+ $[21] = linkValue.pageId;
270
+ $[22] = linkValue.type;
271
+ $[23] = onSave;
272
+ $[24] = pagePickerOpen;
273
+ $[25] = pages;
274
+ $[26] = textField;
275
+ $[27] = t10;
276
+ $[28] = t11;
277
+ $[29] = t12;
278
+ $[30] = t13;
279
+ $[31] = t14;
280
+ $[32] = t15;
234
281
  } else {
235
- t23 = $[42];
236
- t24 = $[43];
282
+ t10 = $[27];
283
+ t11 = $[28];
284
+ t12 = $[29];
285
+ t13 = $[30];
286
+ t14 = $[31];
287
+ t15 = $[32];
237
288
  }
238
- let t25;
239
- if ($[44] !== t21 || $[45] !== t22 || $[46] !== text) {
240
- t25 = /* @__PURE__ */ jsx(Input, {
241
- id: t21,
242
- value: text,
243
- onChange: t22,
244
- onFocus: t23,
245
- onBlur: t24,
246
- autoFocus: true
247
- });
248
- $[44] = t21;
249
- $[45] = t22;
250
- $[46] = text;
251
- $[47] = t25;
252
- } else t25 = $[47];
253
- let t26;
254
- if ($[48] !== t20 || $[49] !== t25) {
255
- t26 = /* @__PURE__ */ jsxs("div", {
256
- className: "grid gap-1.5",
257
- children: [t20, t25]
258
- });
259
- $[48] = t20;
260
- $[49] = t25;
261
- $[50] = t26;
262
- } else t26 = $[50];
263
- const t27 = "grid gap-1.5";
264
- let t28;
265
- if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
266
- t28 = /* @__PURE__ */ jsx(Label, { children: "Destination" });
267
- $[51] = t28;
268
- } else t28 = $[51];
269
- let t29;
270
- if ($[52] === Symbol.for("react.memo_cache_sentinel")) {
271
- t29 = /* @__PURE__ */ jsxs(TabsList, {
272
- className: "w-full",
273
- children: [/* @__PURE__ */ jsx(TabsTrigger, {
274
- value: "page",
275
- children: "Page"
276
- }), /* @__PURE__ */ jsx(TabsTrigger, {
277
- value: "external",
278
- children: "URL"
279
- })]
280
- });
281
- $[52] = t29;
282
- } else t29 = $[52];
283
- let t30;
284
- if ($[53] !== handleModeChange || $[54] !== linkValue.type) {
285
- t30 = /* @__PURE__ */ jsx(Tabs, {
286
- value: linkValue.type,
287
- onValueChange: handleModeChange,
288
- children: t29
289
- });
290
- $[53] = handleModeChange;
291
- $[54] = linkValue.type;
292
- $[55] = t30;
293
- } else t30 = $[55];
294
- const t31 = linkValue.type === "page" ? /* @__PURE__ */ jsxs(Popover, {
295
- open: pagePickerOpen,
296
- onOpenChange: setPagePickerOpen,
297
- children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
298
- render: /* @__PURE__ */ jsx(Button, {
299
- variant: "outline",
300
- role: "combobox",
301
- className: "justify-between font-normal"
302
- }),
303
- children: [selectedPage ? /* @__PURE__ */ jsx("span", {
304
- className: "truncate",
305
- children: selectedPage.metaTitle ?? formatPathSegment(selectedPage.pathSegment)
306
- }) : /* @__PURE__ */ jsx("span", {
307
- className: "text-muted-foreground",
308
- children: "Select a page"
309
- }), /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4 shrink-0 opacity-50" })]
310
- }), /* @__PURE__ */ jsx(PopoverContent, {
311
- align: "start",
312
- className: "p-0",
313
- children: /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(CommandInput, {
314
- placeholder: "Search page...",
315
- className: "h-9"
316
- }), /* @__PURE__ */ jsxs(CommandList, { children: [/* @__PURE__ */ jsx(CommandEmpty, { children: "No page found." }), /* @__PURE__ */ jsx(CommandGroup, { children: pages?.map((page) => /* @__PURE__ */ jsxs(CommandItem, {
317
- value: page.fullPath,
318
- onSelect: () => handlePageSelect(String(page.id)),
319
- children: [/* @__PURE__ */ jsx(Check, { className: cn("mr-2 size-4", selectedPage?.id === page.id ? "opacity-100" : "opacity-0") }), /* @__PURE__ */ jsxs("div", {
320
- className: "flex flex-col",
321
- children: [/* @__PURE__ */ jsx("span", { children: page.metaTitle ?? formatPathSegment(page.pathSegment) }), /* @__PURE__ */ jsx("span", {
322
- className: "text-muted-foreground font-mono text-xs",
323
- children: page.fullPath
324
- })]
325
- })]
326
- }, page.id)) })] })] })
327
- })]
328
- }) : /* @__PURE__ */ jsx(Input, {
329
- type: "url",
330
- id: `${fieldName}-href`,
331
- placeholder: "https://",
332
- value: href,
333
- onChange: (e_0) => {
334
- setHref(e_0.target.value);
335
- handleHrefChange(e_0.target.value);
336
- },
337
- onFocus: () => setIsHrefFocused(true),
338
- onBlur: () => setIsHrefFocused(false)
339
- });
340
- let t32;
341
- if ($[56] !== t28 || $[57] !== t30 || $[58] !== t31) {
342
- t32 = /* @__PURE__ */ jsxs("div", {
343
- className: t27,
289
+ let t16;
290
+ if ($[57] !== t10 || $[58] !== t11 || $[59] !== t12 || $[60] !== t13) {
291
+ t16 = /* @__PURE__ */ jsxs("div", {
292
+ className: t10,
344
293
  children: [
345
- t28,
346
- t30,
347
- t31
294
+ t11,
295
+ t12,
296
+ t13
348
297
  ]
349
298
  });
350
- $[56] = t28;
351
- $[57] = t30;
352
- $[58] = t31;
353
- $[59] = t32;
354
- } else t32 = $[59];
355
- const t33 = `${fieldName}-newtab`;
356
- let t34;
357
- if ($[60] !== fieldName || $[61] !== onSave) {
358
- t34 = (checked) => {
299
+ $[57] = t10;
300
+ $[58] = t11;
301
+ $[59] = t12;
302
+ $[60] = t13;
303
+ $[61] = t16;
304
+ } else t16 = $[61];
305
+ const t17 = `${fieldName}-newtab`;
306
+ let t18;
307
+ if ($[62] !== fieldName || $[63] !== onSave) {
308
+ t18 = (checked) => {
359
309
  onSave(fieldName, {
360
310
  ...linkValueRef.current,
361
311
  newTab: checked
362
312
  });
363
313
  };
364
- $[60] = fieldName;
365
- $[61] = onSave;
366
- $[62] = t34;
367
- } else t34 = $[62];
368
- let t35;
369
- if ($[63] !== linkValue.newTab || $[64] !== t33 || $[65] !== t34) {
370
- t35 = /* @__PURE__ */ jsx(Switch, {
371
- id: t33,
314
+ $[62] = fieldName;
315
+ $[63] = onSave;
316
+ $[64] = t18;
317
+ } else t18 = $[64];
318
+ let t19;
319
+ if ($[65] !== linkValue.newTab || $[66] !== t17 || $[67] !== t18) {
320
+ t19 = /* @__PURE__ */ jsx(Switch, {
321
+ id: t17,
372
322
  checked: linkValue.newTab,
373
- onCheckedChange: t34
323
+ onCheckedChange: t18
374
324
  });
375
- $[63] = linkValue.newTab;
376
- $[64] = t33;
377
- $[65] = t34;
378
- $[66] = t35;
379
- } else t35 = $[66];
380
- const t36 = `${fieldName}-newtab`;
381
- let t37;
382
- if ($[67] !== t36) {
383
- t37 = /* @__PURE__ */ jsx(Label, {
384
- htmlFor: t36,
325
+ $[65] = linkValue.newTab;
326
+ $[66] = t17;
327
+ $[67] = t18;
328
+ $[68] = t19;
329
+ } else t19 = $[68];
330
+ const t20 = `${fieldName}-newtab`;
331
+ let t21;
332
+ if ($[69] !== t20) {
333
+ t21 = /* @__PURE__ */ jsx(Label, {
334
+ htmlFor: t20,
385
335
  children: "Open in new tab"
386
336
  });
387
- $[67] = t36;
388
- $[68] = t37;
389
- } else t37 = $[68];
390
- let t38;
391
- if ($[69] !== t35 || $[70] !== t37) {
392
- t38 = /* @__PURE__ */ jsxs("div", {
337
+ $[69] = t20;
338
+ $[70] = t21;
339
+ } else t21 = $[70];
340
+ let t22;
341
+ if ($[71] !== t19 || $[72] !== t21) {
342
+ t22 = /* @__PURE__ */ jsxs("div", {
393
343
  className: "flex items-center gap-2",
394
- children: [t35, t37]
344
+ children: [t19, t21]
395
345
  });
396
- $[69] = t35;
397
- $[70] = t37;
398
- $[71] = t38;
399
- } else t38 = $[71];
400
- let t39;
401
- if ($[72] !== t26 || $[73] !== t32 || $[74] !== t38) {
402
- t39 = /* @__PURE__ */ jsxs("form", {
403
- className: t18,
346
+ $[71] = t19;
347
+ $[72] = t21;
348
+ $[73] = t22;
349
+ } else t22 = $[73];
350
+ let t23;
351
+ if ($[74] !== t14 || $[75] !== t15 || $[76] !== t16 || $[77] !== t22) {
352
+ t23 = /* @__PURE__ */ jsxs("form", {
353
+ className: t14,
404
354
  children: [
405
- t26,
406
- t32,
407
- t38
355
+ t15,
356
+ t16,
357
+ t22
408
358
  ]
409
359
  });
410
- $[72] = t26;
411
- $[73] = t32;
412
- $[74] = t38;
413
- $[75] = t39;
414
- } else t39 = $[75];
415
- return t39;
360
+ $[74] = t14;
361
+ $[75] = t15;
362
+ $[76] = t16;
363
+ $[77] = t22;
364
+ $[78] = t23;
365
+ } else t23 = $[78];
366
+ return t23;
416
367
  };
417
368
 
418
369
  //#endregion