@sanity/ui 3.0.10 → 3.0.11

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/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), framerMotion = require("framer-motion");
3
+ var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), theme = require("@sanity/ui/theme"), framerMotion = require("framer-motion");
4
4
  function _raf(fn) {
5
5
  const frameId = requestAnimationFrame(fn);
6
6
  return () => {
@@ -209,15 +209,17 @@ function autocompleteReducer(state, msg) {
209
209
  } : state;
210
210
  }
211
211
  const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = react.forwardRef(function(props, forwardedRef) {
212
- const {
213
- border = !0,
212
+ const $ = reactCompilerRuntime.c(179);
213
+ let customValidity, disabled, filterOptionProp, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
214
+ $[0] !== props ? ({
215
+ border: t0,
214
216
  customValidity,
215
217
  disabled,
216
218
  filterOption: filterOptionProp,
217
- fontSize = 2,
219
+ fontSize: t1,
218
220
  icon,
219
221
  id,
220
- listBox = _visualEditing.EMPTY_RECORD,
222
+ listBox: t2,
221
223
  loading,
222
224
  onBlur,
223
225
  onChange,
@@ -227,35 +229,60 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
227
229
  openButton,
228
230
  openOnFocus,
229
231
  options: optionsProp,
230
- padding: paddingProp = 3,
231
- popover = _visualEditing.EMPTY_RECORD,
232
+ padding: t3,
233
+ popover: t4,
232
234
  prefix,
233
- radius = 2,
235
+ radius: t5,
234
236
  readOnly,
235
237
  relatedElements,
236
238
  renderOption: renderOptionProp,
237
239
  renderPopover,
238
- renderValue = DEFAULT_RENDER_VALUE,
240
+ renderValue: t6,
239
241
  suffix,
240
242
  value: valueProp,
241
243
  ...restProps
242
- } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
243
- activeValue: valueProp || null,
244
+ } = props, $[0] = props, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = icon, $[5] = id, $[6] = loading, $[7] = onBlur, $[8] = onChange, $[9] = onFocus, $[10] = onQueryChange, $[11] = onSelect, $[12] = openButton, $[13] = openOnFocus, $[14] = optionsProp, $[15] = prefix, $[16] = readOnly, $[17] = relatedElements, $[18] = renderOptionProp, $[19] = renderPopover, $[20] = restProps, $[21] = suffix, $[22] = t0, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = valueProp) : (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], icon = $[4], id = $[5], loading = $[6], onBlur = $[7], onChange = $[8], onFocus = $[9], onQueryChange = $[10], onSelect = $[11], openButton = $[12], openOnFocus = $[13], optionsProp = $[14], prefix = $[15], readOnly = $[16], relatedElements = $[17], renderOptionProp = $[18], renderPopover = $[19], restProps = $[20], suffix = $[21], t0 = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], valueProp = $[29]);
245
+ const border = t0 === void 0 ? !0 : t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? _visualEditing.EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? _visualEditing.EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null;
246
+ let t9;
247
+ $[30] !== t7 || $[31] !== t8 ? (t9 = {
248
+ activeValue: t7,
244
249
  focused: !1,
245
250
  listFocused: !1,
246
251
  query: null,
247
- value: valueProp || null
248
- }), {
252
+ value: t8
253
+ }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
254
+ const [state, dispatch] = react.useReducer(autocompleteReducer, t9), {
249
255
  activeValue,
250
256
  focused,
251
257
  listFocused,
252
258
  query,
253
259
  value
254
- } = state, defaultRenderOption = react.useCallback(({
255
- value: value_0
256
- }) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
257
- react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
258
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
260
+ } = state;
261
+ let t10;
262
+ $[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t112) => {
263
+ const {
264
+ value: value_0
265
+ } = t112;
266
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
267
+ }, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
268
+ const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), [inputElement, setInputElement] = react.useState(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
269
+ let t11, t12;
270
+ $[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), react.useImperativeHandle(inputElementRef, t11, t12);
271
+ let t13, t14;
272
+ $[39] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[39] = inputElement, $[40] = t13, $[41] = t14) : (t13 = $[40], t14 = $[41]), react.useImperativeHandle(forwardedRef, t13, t14);
273
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp);
274
+ let t15;
275
+ $[42] !== options || $[43] !== value ? (t15 = value !== null ? options.find((o) => o.value === value) : void 0, $[42] = options, $[43] = value, $[44] = t15) : t15 = $[44];
276
+ const currentOption = t15;
277
+ let t16;
278
+ if ($[45] !== filterOption || $[46] !== options || $[47] !== query) {
279
+ let t172;
280
+ $[49] !== filterOption || $[50] !== query ? (t172 = (option) => query ? filterOption(query, option) : !0, $[49] = filterOption, $[50] = query, $[51] = t172) : t172 = $[51], t16 = options.filter(t172), $[45] = filterOption, $[46] = options, $[47] = query, $[48] = t16;
281
+ } else
282
+ t16 = $[48];
283
+ const filteredOptions = t16, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
284
+ let t17;
285
+ $[52] !== onBlur || $[53] !== onQueryChange || $[54] !== relatedElements ? (t17 = (event) => {
259
286
  setTimeout(() => {
260
287
  if (popoverMouseWithinRef.current)
261
288
  return;
@@ -272,20 +299,30 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
272
299
  type: "root/blur"
273
300
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
274
301
  }, 0);
275
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
302
+ }, $[52] = onBlur, $[53] = onQueryChange, $[54] = relatedElements, $[55] = t17) : t17 = $[55];
303
+ const handleRootBlur = t17;
304
+ let t18;
305
+ $[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
276
306
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
277
307
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
278
308
  type: "root/setListFocused",
279
309
  listFocused: listFocused_0
280
310
  }));
281
- }, []), handleOptionSelect = react.useCallback((v) => {
311
+ }, $[56] = t18) : t18 = $[56];
312
+ const handleRootFocus = t18;
313
+ let t19;
314
+ $[57] !== onChange || $[58] !== onQueryChange || $[59] !== onSelect ? (t19 = (v) => {
282
315
  dispatch({
283
316
  type: "value/change",
284
317
  value: v
285
318
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
286
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
319
+ }, $[57] = onChange, $[58] = onQueryChange, $[59] = onSelect, $[60] = t19) : t19 = $[60];
320
+ const handleOptionSelect = t19;
321
+ let t20;
322
+ $[61] !== activeValue || $[62] !== filteredOptions || $[63] !== filteredOptionsLen || $[64] !== onQueryChange ? (t20 = (event_1) => {
287
323
  if (event_1.key === "ArrowDown") {
288
- if (event_1.preventDefault(), !filteredOptionsLen) return;
324
+ if (event_1.preventDefault(), !filteredOptionsLen)
325
+ return;
289
326
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
290
327
  nextActiveOption && dispatch({
291
328
  type: "root/setActiveValue",
@@ -295,7 +332,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
295
332
  return;
296
333
  }
297
334
  if (event_1.key === "ArrowUp") {
298
- if (event_1.preventDefault(), !filteredOptionsLen) return;
335
+ if (event_1.preventDefault(), !filteredOptionsLen)
336
+ return;
299
337
  const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
300
338
  nextActiveOption_0 && dispatch({
301
339
  type: "root/setActiveValue",
@@ -315,35 +353,58 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
315
353
  inputElementRef.current?.focus();
316
354
  return;
317
355
  }
318
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
356
+ }, $[61] = activeValue, $[62] = filteredOptions, $[63] = filteredOptionsLen, $[64] = onQueryChange, $[65] = t20) : t20 = $[65];
357
+ const handleRootKeyDown = t20;
358
+ let t21;
359
+ $[66] !== onQueryChange ? (t21 = (event_2) => {
319
360
  const nextQuery = event_2.currentTarget.value;
320
361
  dispatch({
321
362
  type: "input/change",
322
363
  query: nextQuery
323
364
  }), onQueryChange && onQueryChange(nextQuery);
324
- }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
365
+ }, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
366
+ const handleInputChange = t21;
367
+ let t22;
368
+ $[68] !== currentOption || $[69] !== renderValue || $[70] !== value ? (t22 = () => {
325
369
  dispatch({
326
370
  type: "root/open",
327
371
  query: value ? renderValue(value, currentOption) : ""
328
372
  });
329
- }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
373
+ }, $[68] = currentOption, $[69] = renderValue, $[70] = value, $[71] = t22) : t22 = $[71];
374
+ const dispatchOpen = t22;
375
+ let t23;
376
+ $[72] !== dispatchOpen || $[73] !== focused || $[74] !== onFocus || $[75] !== openOnFocus ? (t23 = (event_3) => {
330
377
  focused || (dispatch({
331
378
  type: "input/focus"
332
379
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
333
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
380
+ }, $[72] = dispatchOpen, $[73] = focused, $[74] = onFocus, $[75] = openOnFocus, $[76] = t23) : t23 = $[76];
381
+ const handleInputFocus = t23;
382
+ let t24;
383
+ $[77] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
334
384
  popoverMouseWithinRef.current = !0;
335
- }, []), handlePopoverMouseLeave = react.useCallback(() => {
385
+ }, $[77] = t24) : t24 = $[77];
386
+ const handlePopoverMouseEnter = t24;
387
+ let t25;
388
+ $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
336
389
  popoverMouseWithinRef.current = !1;
337
- }, []), handleClearButtonClick = react.useCallback(() => {
390
+ }, $[78] = t25) : t25 = $[78];
391
+ const handlePopoverMouseLeave = t25;
392
+ let t26;
393
+ $[79] !== onChange || $[80] !== onQueryChange ? (t26 = () => {
338
394
  dispatch({
339
395
  type: "root/clear"
340
396
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
341
- }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
397
+ }, $[79] = onChange, $[80] = onQueryChange, $[81] = t26) : t26 = $[81];
398
+ const handleClearButtonClick = t26;
399
+ let t27;
400
+ $[82] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
342
401
  dispatch({
343
402
  type: "input/focus"
344
403
  });
345
- }, []);
346
- react.useEffect(() => {
404
+ }, $[82] = t27) : t27 = $[82];
405
+ const handleClearButtonFocus = t27;
406
+ let t28, t29;
407
+ $[83] !== valueProp ? (t28 = () => {
347
408
  if (valueProp !== valuePropRef.current) {
348
409
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
349
410
  type: "value/change",
@@ -355,14 +416,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
355
416
  type: "value/change",
356
417
  value: valueProp || null
357
418
  }));
358
- }, [valueProp]), react.useEffect(() => {
419
+ }, t29 = [valueProp], $[83] = valueProp, $[84] = t28, $[85] = t29) : (t28 = $[84], t29 = $[85]), react.useEffect(t28, t29);
420
+ let t30, t31;
421
+ $[86] !== focused ? (t30 = () => {
359
422
  !focused && valueRef.current && dispatch({
360
423
  type: "root/setActiveValue",
361
424
  value: valueRef.current
362
425
  });
363
- }, [focused]), react.useEffect(() => {
426
+ }, t31 = [focused], $[86] = focused, $[87] = t30, $[88] = t31) : (t30 = $[87], t31 = $[88]), react.useEffect(t30, t31);
427
+ let t32, t33;
428
+ $[89] !== activeValue || $[90] !== filteredOptions ? (t32 = () => {
364
429
  const listElement = listBoxElementRef.current;
365
- if (!listElement) return;
430
+ if (!listElement)
431
+ return;
366
432
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
367
433
  if (activeOption_1) {
368
434
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -372,38 +438,128 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
372
438
  focusFirstDescendant(activeItemElement);
373
439
  }
374
440
  }
375
- }, [activeValue, filteredOptions]);
376
- const clearButton = react.useMemo(() => {
377
- if (!loading && !disabled && value)
378
- return {
441
+ }, t33 = [activeValue, filteredOptions], $[89] = activeValue, $[90] = filteredOptions, $[91] = t32, $[92] = t33) : (t32 = $[91], t33 = $[92]), react.useEffect(t32, t33);
442
+ let t34;
443
+ bb0: {
444
+ if (!loading && !disabled && value) {
445
+ let t352;
446
+ $[93] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
379
447
  "aria-label": "Clear",
380
448
  onFocus: handleClearButtonFocus
381
- };
382
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = react.useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
449
+ }, $[93] = t352) : t352 = $[93], t34 = t352;
450
+ break bb0;
451
+ }
452
+ t34 = void 0;
453
+ }
454
+ const clearButton = t34;
455
+ let t35;
456
+ $[94] !== padding ? (t35 = padding.map(_temp$3), $[94] = padding, $[95] = t35) : t35 = $[95];
457
+ const openButtonBoxPadding = t35;
458
+ let t36;
459
+ $[96] !== padding ? (t36 = padding.map(_temp2$1), $[96] = padding, $[97] = t36) : t36 = $[97];
460
+ const openButtonPadding = t36, openButtonProps = typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD;
461
+ let t37;
462
+ $[98] !== dispatchOpen || $[99] !== openButtonProps ? (t37 = (event_4) => {
383
463
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
384
- }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = react.useCallback((event_5) => {
464
+ }, $[98] = dispatchOpen, $[99] = openButtonProps, $[100] = t37) : t37 = $[100];
465
+ const handleOpenClick = t37;
466
+ let t38;
467
+ $[101] !== disabled || $[102] !== expanded || $[103] !== fontSize || $[104] !== handleOpenClick || $[105] !== openButton || $[106] !== openButtonBoxPadding || $[107] !== openButtonPadding || $[108] !== openButtonProps || $[109] !== readOnly ? (t38 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[101] = disabled, $[102] = expanded, $[103] = fontSize, $[104] = handleOpenClick, $[105] = openButton, $[106] = openButtonBoxPadding, $[107] = openButtonPadding, $[108] = openButtonProps, $[109] = readOnly, $[110] = t38) : t38 = $[110];
468
+ const openButtonNode = t38;
469
+ let t39;
470
+ bb1: {
471
+ if (query === null) {
472
+ if (value !== null) {
473
+ let t402;
474
+ $[111] !== currentOption || $[112] !== renderValue || $[113] !== value ? (t402 = renderValue(value, currentOption), $[111] = currentOption, $[112] = renderValue, $[113] = value, $[114] = t402) : t402 = $[114], t39 = t402;
475
+ break bb1;
476
+ }
477
+ t39 = "";
478
+ break bb1;
479
+ }
480
+ t39 = query;
481
+ }
482
+ const inputValue = t39;
483
+ let t40;
484
+ $[115] !== listFocused ? (t40 = (event_5) => {
385
485
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
386
- }, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
387
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
388
- return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
389
- disabled: loading,
390
- selected: active,
391
- tabIndex: listFocused && active ? 0 : -1
392
- }) }, option_0.value);
393
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
394
- content: content2,
395
- hidden: !expanded,
396
- inputElement: inputElementRef.current,
397
- onMouseEnter: handlePopoverMouseEnter,
398
- onMouseLeave: handlePopoverMouseLeave
399
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
400
- return /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
401
- input,
486
+ }, $[115] = listFocused, $[116] = t40) : t40 = $[116];
487
+ const handleListBoxKeyDown = t40;
488
+ let t41;
489
+ bb2: {
490
+ if (filteredOptions.length === 0) {
491
+ t41 = null;
492
+ break bb2;
493
+ }
494
+ let t422;
495
+ if ($[117] !== activeValue || $[118] !== currentOption || $[119] !== filteredOptions || $[120] !== handleOptionSelect || $[121] !== id || $[122] !== listFocused || $[123] !== loading || $[124] !== renderOption) {
496
+ let t433;
497
+ $[126] !== activeValue || $[127] !== currentOption || $[128] !== handleOptionSelect || $[129] !== id || $[130] !== listFocused || $[131] !== loading || $[132] !== renderOption ? (t433 = (option_0) => {
498
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
499
+ return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
500
+ disabled: loading,
501
+ selected: active,
502
+ tabIndex: listFocused && active ? 0 : -1
503
+ }) }, option_0.value);
504
+ }, $[126] = activeValue, $[127] = currentOption, $[128] = handleOptionSelect, $[129] = id, $[130] = listFocused, $[131] = loading, $[132] = renderOption, $[133] = t433) : t433 = $[133], t422 = filteredOptions.map(t433), $[117] = activeValue, $[118] = currentOption, $[119] = filteredOptions, $[120] = handleOptionSelect, $[121] = id, $[122] = listFocused, $[123] = loading, $[124] = renderOption, $[125] = t422;
505
+ } else
506
+ t422 = $[125];
507
+ let t432;
508
+ $[134] !== listBoxId || $[135] !== t422 ? (t432 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t422 }), $[134] = listBoxId, $[135] = t422, $[136] = t432) : t432 = $[136];
509
+ let t442;
510
+ $[137] !== handleListBoxKeyDown || $[138] !== listBox || $[139] !== t432 ? (t442 = /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t432 }), $[137] = handleListBoxKeyDown, $[138] = listBox, $[139] = t432, $[140] = t442) : t442 = $[140], t41 = t442;
511
+ }
512
+ const content2 = t41;
513
+ let t42;
514
+ bb3: {
515
+ if (renderPopover) {
516
+ const t433 = !expanded;
517
+ let t442;
518
+ $[141] !== content2 || $[142] !== inputElement || $[143] !== renderPopover || $[144] !== t433 ? (t442 = /* @__PURE__ */ jsxRuntime.jsx(RenderPopover, { content: content2, hidden: t433, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[141] = content2, $[142] = inputElement, $[143] = renderPopover, $[144] = t433, $[145] = t442) : t442 = $[145], t42 = t442;
519
+ break bb3;
520
+ }
521
+ if (filteredOptionsLen === 0) {
522
+ t42 = null;
523
+ break bb3;
524
+ }
525
+ let t432;
526
+ $[146] !== content2 || $[147] !== expanded || $[148] !== inputElement || $[149] !== popover || $[150] !== radius ? (t432 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), $[146] = content2, $[147] = expanded, $[148] = inputElement, $[149] = popover, $[150] = radius, $[151] = t432) : t432 = $[151], t42 = t432;
527
+ }
528
+ const results = t42, t43 = loading && AnimatedSpinnerIcon, t44 = suffix || openButtonNode;
529
+ let t45;
530
+ $[152] !== activeItemId || $[153] !== border || $[154] !== clearButton || $[155] !== customValidity || $[156] !== disabled || $[157] !== expanded || $[158] !== fontSize || $[159] !== handleClearButtonClick || $[160] !== handleInputChange || $[161] !== handleInputFocus || $[162] !== icon || $[163] !== id || $[164] !== inputValue || $[165] !== listBoxId || $[166] !== padding || $[167] !== prefix || $[168] !== radius || $[169] !== readOnly || $[170] !== restProps || $[171] !== t43 || $[172] !== t44 ? (t45 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: t43, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t44, value: inputValue }), $[152] = activeItemId, $[153] = border, $[154] = clearButton, $[155] = customValidity, $[156] = disabled, $[157] = expanded, $[158] = fontSize, $[159] = handleClearButtonClick, $[160] = handleInputChange, $[161] = handleInputFocus, $[162] = icon, $[163] = id, $[164] = inputValue, $[165] = listBoxId, $[166] = padding, $[167] = prefix, $[168] = radius, $[169] = readOnly, $[170] = restProps, $[171] = t43, $[172] = t44, $[173] = t45) : t45 = $[173];
531
+ let t46;
532
+ return $[174] !== handleRootBlur || $[175] !== handleRootKeyDown || $[176] !== results || $[177] !== t45 ? (t46 = /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
533
+ t45,
402
534
  results
403
- ] });
535
+ ] }), $[174] = handleRootBlur, $[175] = handleRootKeyDown, $[176] = results, $[177] = t45, $[178] = t46) : t46 = $[178], t46;
404
536
  });
537
+ function RenderPopover({
538
+ renderPopover,
539
+ content: content2,
540
+ hidden,
541
+ inputElement,
542
+ onMouseEnter,
543
+ onMouseLeave,
544
+ resultsPopoverElementRef
545
+ }) {
546
+ return renderPopover({
547
+ content: content2,
548
+ hidden,
549
+ inputElement,
550
+ onMouseEnter,
551
+ onMouseLeave
552
+ }, resultsPopoverElementRef);
553
+ }
405
554
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
406
- const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
555
+ const Autocomplete = InnerAutocomplete;
556
+ function _temp$3(v_0) {
557
+ return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
558
+ }
559
+ function _temp2$1(v_1) {
560
+ return Math.max(v_1 - 1, 0);
561
+ }
562
+ const StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
407
563
  displayName: "StyledBreadcrumbs",
408
564
  componentId: "sc-1es8h8q-0"
409
565
  })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styledComponents.styled(_visualEditing.Button).withConfig({
@@ -1532,61 +1688,115 @@ const TreeGroup = react.memo(function(props) {
1532
1688
  displayName: "ToggleArrowText",
1533
1689
  componentId: "sc-iiskig-2"
1534
1690
  })`& > svg{transition:transform 100ms;}`, TreeItem = react.memo(function(props) {
1535
- const {
1691
+ const $ = reactCompilerRuntime.c(112);
1692
+ let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1693
+ $[0] !== props ? ({
1536
1694
  children,
1537
- expanded: expandedProp = !1,
1538
- fontSize = 1,
1695
+ expanded: t0,
1696
+ fontSize: t1,
1539
1697
  href,
1540
1698
  icon: IconComponent,
1541
1699
  id: idProp,
1542
1700
  linkAs,
1543
1701
  muted,
1544
1702
  onClick,
1545
- padding = 2,
1546
- selected = !1,
1547
- space = 2,
1703
+ padding: t2,
1704
+ selected: t3,
1705
+ space: t4,
1548
1706
  text,
1549
1707
  weight,
1550
1708
  ...restProps
1551
- } = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
1709
+ } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = href, $[4] = idProp, $[5] = linkAs, $[6] = muted, $[7] = onClick, $[8] = restProps, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4, $[14] = text, $[15] = weight) : (IconComponent = $[1], children = $[2], href = $[3], idProp = $[4], linkAs = $[5], muted = $[6], onClick = $[7], restProps = $[8], t0 = $[9], t1 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], text = $[14], weight = $[15]);
1710
+ const expandedProp = t0 === void 0 ? !1 : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, space = t4 === void 0 ? 2 : t4, [rootElement, setRootElement] = react.useState(null), treeitemRef = react.useRef(null), tree = useTree(), {
1552
1711
  path,
1553
1712
  registerItem,
1554
1713
  setExpanded,
1555
1714
  setFocusedElement
1556
- } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = react.useMemo(() => ({
1715
+ } = tree, _id = react.useId(), id = idProp || _id;
1716
+ let t5, t6;
1717
+ if ($[16] !== id || $[17] !== path) {
1718
+ const itemPath = path.concat([id || ""]);
1719
+ t5 = itemPath, t6 = itemPath.join("/"), $[16] = id, $[17] = path, $[18] = t5, $[19] = t6;
1720
+ } else
1721
+ t5 = $[18], t6 = $[19];
1722
+ let t7;
1723
+ $[20] !== t5 || $[21] !== t6 ? (t7 = [t5, t6], $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22];
1724
+ const [itemPath_0, itemKey] = t7, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t8 = tree.level + 1;
1725
+ let t9;
1726
+ $[23] !== itemPath_0 || $[24] !== t8 || $[25] !== tree ? (t9 = {
1557
1727
  ...tree,
1558
- level: tree.level + 1,
1559
- path: itemPath
1560
- }), [itemPath, tree]), handleClick = react.useCallback((event) => {
1728
+ level: t8,
1729
+ path: itemPath_0
1730
+ }, $[23] = itemPath_0, $[24] = t8, $[25] = tree, $[26] = t9) : t9 = $[26];
1731
+ const contextValue = t9;
1732
+ let t10;
1733
+ $[27] !== expanded || $[28] !== itemKey || $[29] !== onClick || $[30] !== rootElement || $[31] !== setExpanded || $[32] !== setFocusedElement ? (t10 = (event) => {
1561
1734
  onClick && onClick(event);
1562
1735
  const target = event.target;
1563
- target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
1564
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event_0) => {
1565
- focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
1566
- }, [focused]);
1567
- react.useEffect(() => {
1568
- if (rootRef.current)
1569
- return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
1570
- }, [expanded, itemPath, registerItem, selected]);
1571
- const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { padding, children: [
1572
- /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { marginRight: space, style: {
1573
- visibility: IconComponent || children ? "visible" : "hidden",
1574
- pointerEvents: "none"
1575
- }, children: [
1576
- IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
1577
- !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
1578
- transform: expanded ? "rotate(90deg)" : void 0
1579
- } }) })
1580
- ] }),
1581
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1582
- ] });
1583
- return href ? /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
1584
- /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }),
1585
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
1586
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1587
- /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }),
1588
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
1589
- ] });
1736
+ target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
1737
+ }, $[27] = expanded, $[28] = itemKey, $[29] = onClick, $[30] = rootElement, $[31] = setExpanded, $[32] = setFocusedElement, $[33] = t10) : t10 = $[33];
1738
+ const handleClick = t10;
1739
+ let t11;
1740
+ $[34] !== focused || $[35] !== rootElement ? (t11 = (event_0) => {
1741
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1742
+ }, $[34] = focused, $[35] = rootElement, $[36] = t11) : t11 = $[36];
1743
+ const handleKeyDown = t11;
1744
+ let t12, t13;
1745
+ $[37] !== expanded || $[38] !== itemKey || $[39] !== registerItem || $[40] !== rootElement || $[41] !== selected ? (t12 = () => {
1746
+ if (rootElement)
1747
+ return registerItem(rootElement, itemKey, expanded, selected);
1748
+ }, t13 = [expanded, itemKey, registerItem, rootElement, selected], $[37] = expanded, $[38] = itemKey, $[39] = registerItem, $[40] = rootElement, $[41] = selected, $[42] = t12, $[43] = t13) : (t12 = $[42], t13 = $[43]), react.useEffect(t12, t13);
1749
+ const t14 = IconComponent || children ? "visible" : "hidden";
1750
+ let t15;
1751
+ $[44] !== t14 ? (t15 = {
1752
+ visibility: t14,
1753
+ pointerEvents: "none"
1754
+ }, $[44] = t14, $[45] = t15) : t15 = $[45];
1755
+ let t16;
1756
+ $[46] !== IconComponent || $[47] !== fontSize || $[48] !== muted || $[49] !== weight ? (t16 = IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }), $[46] = IconComponent, $[47] = fontSize, $[48] = muted, $[49] = weight, $[50] = t16) : t16 = $[50];
1757
+ let t17;
1758
+ $[51] !== IconComponent || $[52] !== expanded || $[53] !== fontSize || $[54] !== muted || $[55] !== weight ? (t17 = !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
1759
+ transform: expanded ? "rotate(90deg)" : void 0
1760
+ } }) }), $[51] = IconComponent, $[52] = expanded, $[53] = fontSize, $[54] = muted, $[55] = weight, $[56] = t17) : t17 = $[56];
1761
+ let t18;
1762
+ $[57] !== space || $[58] !== t15 || $[59] !== t16 || $[60] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { marginRight: space, style: t15, children: [
1763
+ t16,
1764
+ t17
1765
+ ] }), $[57] = space, $[58] = t15, $[59] = t16, $[60] = t17, $[61] = t18) : t18 = $[61];
1766
+ let t19;
1767
+ $[62] !== fontSize || $[63] !== muted || $[64] !== text || $[65] !== weight ? (t19 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) }), $[62] = fontSize, $[63] = muted, $[64] = text, $[65] = weight, $[66] = t19) : t19 = $[66];
1768
+ let t20;
1769
+ $[67] !== padding || $[68] !== t18 || $[69] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { padding, children: [
1770
+ t18,
1771
+ t19
1772
+ ] }), $[67] = padding, $[68] = t18, $[69] = t19, $[70] = t20) : t20 = $[70];
1773
+ const content2 = t20;
1774
+ if (href) {
1775
+ const t212 = selected ? "" : void 0;
1776
+ let t222;
1777
+ $[71] !== content2 || $[72] !== expanded || $[73] !== href || $[74] !== linkAs || $[75] !== tabIndex || $[76] !== tree.level ? (t222 = /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }), $[71] = content2, $[72] = expanded, $[73] = href, $[74] = linkAs, $[75] = tabIndex, $[76] = tree.level, $[77] = t222) : t222 = $[77];
1778
+ let t232;
1779
+ $[78] !== children || $[79] !== expanded ? (t232 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }), $[78] = children, $[79] = expanded, $[80] = t232) : t232 = $[80];
1780
+ let t242;
1781
+ $[81] !== contextValue || $[82] !== t232 ? (t242 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t232 }), $[81] = contextValue, $[82] = t232, $[83] = t242) : t242 = $[83];
1782
+ let t252;
1783
+ return $[84] !== handleClick || $[85] !== id || $[86] !== itemKey || $[87] !== restProps || $[88] !== t212 || $[89] !== t222 || $[90] !== t242 ? (t252 = /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItem, { "data-selected": t212, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
1784
+ t222,
1785
+ t242
1786
+ ] }), $[84] = handleClick, $[85] = id, $[86] = itemKey, $[87] = restProps, $[88] = t212, $[89] = t222, $[90] = t242, $[91] = t252) : t252 = $[91], t252;
1787
+ }
1788
+ const t21 = selected ? "" : void 0;
1789
+ let t22;
1790
+ $[92] !== content2 || $[93] !== tree.level ? (t22 = /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }), $[92] = content2, $[93] = tree.level, $[94] = t22) : t22 = $[94];
1791
+ let t23;
1792
+ $[95] !== children || $[96] !== expanded ? (t23 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }), $[95] = children, $[96] = expanded, $[97] = t23) : t23 = $[97];
1793
+ let t24;
1794
+ $[98] !== contextValue || $[99] !== t23 ? (t24 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t23 }), $[98] = contextValue, $[99] = t23, $[100] = t24) : t24 = $[100];
1795
+ let t25;
1796
+ return $[101] !== expanded || $[102] !== handleClick || $[103] !== handleKeyDown || $[104] !== id || $[105] !== itemKey || $[106] !== restProps || $[107] !== t21 || $[108] !== t22 || $[109] !== t24 || $[110] !== tabIndex ? (t25 = /* @__PURE__ */ jsxRuntime.jsxs(StyledTreeItem, { "data-selected": t21, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
1797
+ t22,
1798
+ t24
1799
+ ] }), $[101] = expanded, $[102] = handleClick, $[103] = handleKeyDown, $[104] = id, $[105] = itemKey, $[106] = restProps, $[107] = t21, $[108] = t22, $[109] = t24, $[110] = tabIndex, $[111] = t25) : t25 = $[111], t25;
1590
1800
  });
1591
1801
  TreeItem.displayName = "Memo(TreeItem)";
1592
1802
  exports.Arrow = _visualEditing.Arrow;