@sanity/ui 3.0.15-canary.0 → 3.1.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.
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"), 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 () => {
@@ -48,7 +48,9 @@ function focusLastDescendant(element) {
48
48
  return !1;
49
49
  }
50
50
  function useArrayProp(val, defaultVal) {
51
- return react.useMemo(() => _visualEditing._getArrayProp(val, defaultVal), [val, defaultVal]);
51
+ const $ = reactCompilerRuntime.c(3);
52
+ let t0;
53
+ return $[0] !== defaultVal || $[1] !== val ? (t0 = _visualEditing._getArrayProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
52
54
  }
53
55
  function _getElements(element, elementsArg) {
54
56
  const ret = [element];
@@ -56,9 +58,13 @@ function _getElements(element, elementsArg) {
56
58
  Array.isArray(el) ? ret.push(...el) : ret.push(el);
57
59
  return ret.filter(Boolean);
58
60
  }
59
- function useClickOutside(listener, elementsArg = _visualEditing.EMPTY_ARRAY, boundaryElement) {
60
- const [element, setElement] = react.useState(null), [elements, setElements] = react.useState(() => _getElements(element, elementsArg)), elementsRef = react.useRef(elements);
61
- return react.useEffect(() => {
61
+ function useClickOutside(listener, t0, boundaryElement) {
62
+ const $ = reactCompilerRuntime.c(12), elementsArg = t0 === void 0 ? _visualEditing.EMPTY_ARRAY : t0, [element, setElement] = react.useState(null);
63
+ let t1;
64
+ $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
65
+ const [elements, setElements] = react.useState(t1), elementsRef = react.useRef(elements);
66
+ let t2, t3;
67
+ $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
62
68
  const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
63
69
  if (prevElements.length !== nextElements.length) {
64
70
  setElements(nextElements), elementsRef.current = nextElements;
@@ -69,18 +75,21 @@ function useClickOutside(listener, elementsArg = _visualEditing.EMPTY_ARRAY, bou
69
75
  setElements(nextElements), elementsRef.current = nextElements;
70
76
  return;
71
77
  }
72
- for (const el of nextElements)
73
- if (!prevElements.includes(el)) {
78
+ for (const el_0 of nextElements)
79
+ if (!prevElements.includes(el_0)) {
74
80
  setElements(nextElements), elementsRef.current = nextElements;
75
81
  return;
76
82
  }
77
- }, [element, elementsArg]), react.useEffect(() => {
78
- if (!listener) return;
83
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
84
+ let t4, t5;
85
+ return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
86
+ if (!listener)
87
+ return;
79
88
  const handleWindowMouseDown = (evt) => {
80
89
  const target = evt.target;
81
90
  if (target instanceof Node && !(boundaryElement && !boundaryElement.contains(target))) {
82
- for (const el of elements)
83
- if (target === el || el.contains(target))
91
+ for (const el_1 of elements)
92
+ if (target === el_1 || el_1.contains(target))
84
93
  return;
85
94
  listener(evt);
86
95
  }
@@ -88,14 +97,15 @@ function useClickOutside(listener, elementsArg = _visualEditing.EMPTY_ARRAY, bou
88
97
  return window.addEventListener("mousedown", handleWindowMouseDown), () => {
89
98
  window.removeEventListener("mousedown", handleWindowMouseDown);
90
99
  };
91
- }, [boundaryElement, listener, elements]), setElement;
100
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
92
101
  }
93
102
  function useElementRect(element) {
94
103
  return _visualEditing.useElementSize(element)?._contentRect || null;
95
104
  }
96
105
  function useForwardedRef(ref) {
97
- const innerRef = react.useRef(null);
98
- return react.useImperativeHandle(ref, () => innerRef.current), innerRef;
106
+ const $ = reactCompilerRuntime.c(1), innerRef = react.useRef(null);
107
+ let t0;
108
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(ref, t0), innerRef;
99
109
  }
100
110
  class ErrorBoundary extends react.Component {
101
111
  state = {
@@ -142,20 +152,27 @@ const StyledAutocomplete = styledComponents.styled.div.withConfig({
142
152
  componentId: "sc-1igauft-2"
143
153
  })`animation:${rotate} 500ms linear infinite;`;
144
154
  function AutocompleteOption(props) {
145
- const {
155
+ const $ = reactCompilerRuntime.c(11), {
146
156
  children,
147
157
  id,
148
158
  onSelect,
149
159
  selected,
150
160
  value
151
- } = props, handleClick = react.useCallback(() => {
161
+ } = props;
162
+ let t0;
163
+ $[0] !== onSelect || $[1] !== value ? (t0 = () => {
152
164
  setTimeout(() => {
153
165
  onSelect(value);
154
166
  }, 0);
155
- }, [onSelect, value]), handleKeyDown = react.useCallback((event) => {
167
+ }, $[0] = onSelect, $[1] = value, $[2] = t0) : t0 = $[2];
168
+ const handleClick = t0;
169
+ let t1;
170
+ $[3] !== handleClick ? (t1 = (event) => {
156
171
  event.key === "Enter" && !_visualEditing._isEnterToClickElement(event.currentTarget) && handleClick();
157
- }, [handleClick]);
158
- return /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children });
172
+ }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
173
+ const handleKeyDown = t1;
174
+ let t2;
175
+ return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsxRuntime.jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
159
176
  }
160
177
  function autocompleteReducer(state, msg) {
161
178
  return msg.type === "input/change" ? {
@@ -197,15 +214,17 @@ function autocompleteReducer(state, msg) {
197
214
  } : state;
198
215
  }
199
216
  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) {
200
- const {
201
- border = !0,
217
+ const $ = reactCompilerRuntime.c(180);
218
+ 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;
219
+ $[0] !== props ? ({
220
+ border: t0,
202
221
  customValidity,
203
222
  disabled,
204
223
  filterOption: filterOptionProp,
205
- fontSize = 2,
224
+ fontSize: t1,
206
225
  icon,
207
226
  id,
208
- listBox = _visualEditing.EMPTY_RECORD,
227
+ listBox: t2,
209
228
  loading,
210
229
  onBlur,
211
230
  onChange,
@@ -215,35 +234,60 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
215
234
  openButton,
216
235
  openOnFocus,
217
236
  options: optionsProp,
218
- padding: paddingProp = 3,
219
- popover = _visualEditing.EMPTY_RECORD,
237
+ padding: t3,
238
+ popover: t4,
220
239
  prefix,
221
- radius = 2,
240
+ radius: t5,
222
241
  readOnly,
223
242
  relatedElements,
224
243
  renderOption: renderOptionProp,
225
244
  renderPopover,
226
- renderValue = DEFAULT_RENDER_VALUE,
245
+ renderValue: t6,
227
246
  suffix,
228
247
  value: valueProp,
229
248
  ...restProps
230
- } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
231
- activeValue: valueProp || null,
249
+ } = 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]);
250
+ 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;
251
+ let t9;
252
+ $[30] !== t7 || $[31] !== t8 ? (t9 = {
253
+ activeValue: t7,
232
254
  focused: !1,
233
255
  listFocused: !1,
234
256
  query: null,
235
- value: valueProp || null
236
- }), {
257
+ value: t8
258
+ }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
259
+ const [state, dispatch] = react.useReducer(autocompleteReducer, t9), {
237
260
  activeValue,
238
261
  focused,
239
262
  listFocused,
240
263
  query,
241
264
  value
242
- } = state, defaultRenderOption = react.useCallback(({
243
- value: value2
244
- }) => /* @__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: value2 }) }), [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), [inputElement, setInputElement] = react.useState(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
245
- react.useImperativeHandle(inputElementRef, () => inputElement, [inputElement]), react.useImperativeHandle(forwardedRef, () => inputElement, [inputElement]);
246
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing._getArrayProp(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) => {
265
+ } = state;
266
+ let t10;
267
+ $[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t112) => {
268
+ const {
269
+ value: value_0
270
+ } = t112;
271
+ 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 }) });
272
+ }, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
273
+ 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);
274
+ let t11, t12;
275
+ $[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), react.useImperativeHandle(inputElementRef, t11, t12);
276
+ let t13, t14;
277
+ $[39] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[39] = inputElement, $[40] = t13, $[41] = t14) : (t13 = $[40], t14 = $[41]), react.useImperativeHandle(forwardedRef, t13, t14);
278
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing._getArrayProp(paddingProp);
279
+ let t15;
280
+ $[42] !== options || $[43] !== value ? (t15 = value !== null ? options.find((o) => o.value === value) : void 0, $[42] = options, $[43] = value, $[44] = t15) : t15 = $[44];
281
+ const currentOption = t15;
282
+ let t16;
283
+ if ($[45] !== filterOption || $[46] !== options || $[47] !== query) {
284
+ let t172;
285
+ $[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;
286
+ } else
287
+ t16 = $[48];
288
+ const filteredOptions = t16, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
289
+ let t17;
290
+ $[52] !== onBlur || $[53] !== onQueryChange || $[54] !== relatedElements ? (t17 = (event) => {
247
291
  setTimeout(() => {
248
292
  if (popoverMouseWithinRef.current)
249
293
  return;
@@ -260,21 +304,31 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
260
304
  type: "root/blur"
261
305
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
262
306
  }, 0);
263
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event) => {
264
- const listBoxElement = listBoxElementRef.current, focusedElement = event.target instanceof HTMLElement ? event.target : null, listFocused2 = listBoxElement?.contains(focusedElement) || !1;
265
- listFocused2 !== listFocusedRef.current && (listFocusedRef.current = listFocused2, dispatch({
307
+ }, $[52] = onBlur, $[53] = onQueryChange, $[54] = relatedElements, $[55] = t17) : t17 = $[55];
308
+ const handleRootBlur = t17;
309
+ let t18;
310
+ $[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
311
+ const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
312
+ listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
266
313
  type: "root/setListFocused",
267
- listFocused: listFocused2
314
+ listFocused: listFocused_0
268
315
  }));
269
- }, []), handleOptionSelect = react.useCallback((v) => {
316
+ }, $[56] = t18) : t18 = $[56];
317
+ const handleRootFocus = t18;
318
+ let t19;
319
+ $[57] !== onChange || $[58] !== onQueryChange || $[59] !== onSelect ? (t19 = (v) => {
270
320
  dispatch({
271
321
  type: "value/change",
272
322
  value: v
273
323
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
274
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event) => {
275
- if (event.key === "ArrowDown") {
276
- if (event.preventDefault(), !filteredOptionsLen) return;
277
- const activeOption = filteredOptions.find((o) => o.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
324
+ }, $[57] = onChange, $[58] = onQueryChange, $[59] = onSelect, $[60] = t19) : t19 = $[60];
325
+ const handleOptionSelect = t19;
326
+ let t20;
327
+ $[61] !== activeValue || $[62] !== filteredOptions || $[63] !== filteredOptionsLen || $[64] !== onQueryChange ? (t20 = (event_1) => {
328
+ if (event_1.key === "ArrowDown") {
329
+ if (event_1.preventDefault(), !filteredOptionsLen)
330
+ return;
331
+ const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
278
332
  nextActiveOption && dispatch({
279
333
  type: "root/setActiveValue",
280
334
  value: nextActiveOption.value,
@@ -282,56 +336,80 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
282
336
  });
283
337
  return;
284
338
  }
285
- if (event.key === "ArrowUp") {
286
- if (event.preventDefault(), !filteredOptionsLen) return;
287
- const activeOption = filteredOptions.find((o) => o.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[activeIndex === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex - 1) % filteredOptionsLen];
288
- nextActiveOption && dispatch({
339
+ if (event_1.key === "ArrowUp") {
340
+ if (event_1.preventDefault(), !filteredOptionsLen)
341
+ return;
342
+ 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];
343
+ nextActiveOption_0 && dispatch({
289
344
  type: "root/setActiveValue",
290
- value: nextActiveOption.value,
345
+ value: nextActiveOption_0.value,
291
346
  listFocused: !0
292
347
  });
293
348
  return;
294
349
  }
295
- if (event.key === "Escape") {
350
+ if (event_1.key === "Escape") {
296
351
  dispatch({
297
352
  type: "root/escape"
298
353
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
299
354
  return;
300
355
  }
301
- const target = event.target, listEl = listBoxElementRef.current;
302
- if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event.key)) {
356
+ const target = event_1.target, listEl = listBoxElementRef.current;
357
+ if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
303
358
  inputElementRef.current?.focus();
304
359
  return;
305
360
  }
306
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event) => {
307
- const nextQuery = event.currentTarget.value;
361
+ }, $[61] = activeValue, $[62] = filteredOptions, $[63] = filteredOptionsLen, $[64] = onQueryChange, $[65] = t20) : t20 = $[65];
362
+ const handleRootKeyDown = t20;
363
+ let t21;
364
+ $[66] !== onQueryChange ? (t21 = (event_2) => {
365
+ const nextQuery = event_2.currentTarget.value;
308
366
  dispatch({
309
367
  type: "input/change",
310
368
  query: nextQuery
311
369
  }), onQueryChange && onQueryChange(nextQuery);
312
- }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
370
+ }, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
371
+ const handleInputChange = t21;
372
+ let t22;
373
+ $[68] !== currentOption || $[69] !== renderValue || $[70] !== value ? (t22 = () => {
313
374
  dispatch({
314
375
  type: "root/open",
315
376
  query: value ? renderValue(value, currentOption) : ""
316
377
  });
317
- }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event) => {
378
+ }, $[68] = currentOption, $[69] = renderValue, $[70] = value, $[71] = t22) : t22 = $[71];
379
+ const dispatchOpen = t22;
380
+ let t23;
381
+ $[72] !== dispatchOpen || $[73] !== focused || $[74] !== onFocus || $[75] !== openOnFocus ? (t23 = (event_3) => {
318
382
  focused || (dispatch({
319
383
  type: "input/focus"
320
- }), onFocus && onFocus(event), openOnFocus && dispatchOpen());
321
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
384
+ }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
385
+ }, $[72] = dispatchOpen, $[73] = focused, $[74] = onFocus, $[75] = openOnFocus, $[76] = t23) : t23 = $[76];
386
+ const handleInputFocus = t23;
387
+ let t24;
388
+ $[77] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
322
389
  popoverMouseWithinRef.current = !0;
323
- }, []), handlePopoverMouseLeave = react.useCallback(() => {
390
+ }, $[77] = t24) : t24 = $[77];
391
+ const handlePopoverMouseEnter = t24;
392
+ let t25;
393
+ $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
324
394
  popoverMouseWithinRef.current = !1;
325
- }, []), handleClearButtonClick = react.useCallback(() => {
395
+ }, $[78] = t25) : t25 = $[78];
396
+ const handlePopoverMouseLeave = t25;
397
+ let t26;
398
+ $[79] !== onChange || $[80] !== onQueryChange ? (t26 = () => {
326
399
  dispatch({
327
400
  type: "root/clear"
328
401
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
329
- }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
402
+ }, $[79] = onChange, $[80] = onQueryChange, $[81] = t26) : t26 = $[81];
403
+ const handleClearButtonClick = t26;
404
+ let t27;
405
+ $[82] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
330
406
  dispatch({
331
407
  type: "input/focus"
332
408
  });
333
- }, []);
334
- react.useEffect(() => {
409
+ }, $[82] = t27) : t27 = $[82];
410
+ const handleClearButtonFocus = t27;
411
+ let t28, t29;
412
+ $[83] !== valueProp ? (t28 = () => {
335
413
  if (valueProp !== valuePropRef.current) {
336
414
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
337
415
  type: "value/change",
@@ -343,46 +421,117 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
343
421
  type: "value/change",
344
422
  value: valueProp || null
345
423
  }));
346
- }, [valueProp]), react.useEffect(() => {
424
+ }, t29 = [valueProp], $[83] = valueProp, $[84] = t28, $[85] = t29) : (t28 = $[84], t29 = $[85]), react.useEffect(t28, t29);
425
+ let t30, t31;
426
+ $[86] !== focused ? (t30 = () => {
347
427
  !focused && valueRef.current && dispatch({
348
428
  type: "root/setActiveValue",
349
429
  value: valueRef.current
350
430
  });
351
- }, [focused]), react.useEffect(() => {
431
+ }, t31 = [focused], $[86] = focused, $[87] = t30, $[88] = t31) : (t30 = $[87], t31 = $[88]), react.useEffect(t30, t31);
432
+ let t32, t33;
433
+ $[89] !== activeValue || $[90] !== filteredOptions ? (t32 = () => {
352
434
  const listElement = listBoxElementRef.current;
353
- if (!listElement) return;
354
- const activeOption = filteredOptions.find((o) => o.value === activeValue);
355
- if (activeOption) {
356
- const activeIndex = filteredOptions.indexOf(activeOption), activeItemElement = listElement.childNodes[activeIndex];
435
+ if (!listElement)
436
+ return;
437
+ const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
438
+ if (activeOption_1) {
439
+ const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
357
440
  if (activeItemElement) {
358
441
  if (_hasFocus(activeItemElement))
359
442
  return;
360
443
  focusFirstDescendant(activeItemElement);
361
444
  }
362
445
  }
363
- }, [activeValue, filteredOptions]);
364
- const clearButton = react.useMemo(() => {
365
- if (!loading && !disabled && value)
366
- return {
446
+ }, t33 = [activeValue, filteredOptions], $[89] = activeValue, $[90] = filteredOptions, $[91] = t32, $[92] = t33) : (t32 = $[91], t33 = $[92]), react.useEffect(t32, t33);
447
+ let t34;
448
+ bb0: {
449
+ if (!loading && !disabled && value) {
450
+ let t352;
451
+ $[93] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
367
452
  "aria-label": "Clear",
368
453
  onFocus: handleClearButtonFocus
369
- };
370
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = padding.map((v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2), openButtonPadding = padding.map((v) => Math.max(v - 1, 0)), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event) => {
371
- dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event), _raf(() => inputElementRef.current?.focus());
372
- }, [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]), handleListBoxKeyDown = react.useCallback((event) => {
373
- event.key === "Tab" && listFocused && inputElementRef.current?.focus();
374
- }, [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) => {
375
- const active = activeValue !== null ? option.value === activeValue : currentOption === option;
376
- return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option.value}`, onSelect: handleOptionSelect, selected: active, value: option.value, children: react.cloneElement(renderOption(option), {
377
- disabled: loading,
378
- selected: active,
379
- tabIndex: listFocused && active ? 0 : -1
380
- }) }, option.value);
381
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? /* @__PURE__ */ jsxRuntime.jsx(RenderPopover, { content: content2, hidden: !expanded, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }) : 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: inputElement, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, inputElement, popover, radius, renderPopover]);
382
- return /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
383
- /* @__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: setInputElement, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }),
454
+ }, $[93] = t352) : t352 = $[93], t34 = t352;
455
+ break bb0;
456
+ }
457
+ t34 = void 0;
458
+ }
459
+ const clearButton = t34, openButtonBoxPadding = padding.map(_temp$3), openButtonPadding = padding.map(_temp2$1), openButtonProps = typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD;
460
+ let t35;
461
+ $[94] !== dispatchOpen || $[95] !== openButtonProps ? (t35 = (event_4) => {
462
+ dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
463
+ }, $[94] = dispatchOpen, $[95] = openButtonProps, $[96] = t35) : t35 = $[96];
464
+ const handleOpenClick = t35;
465
+ let t36;
466
+ $[97] !== disabled || $[98] !== expanded || $[99] !== fontSize || $[100] !== handleOpenClick || $[101] !== openButton || $[102] !== openButtonBoxPadding || $[103] !== openButtonPadding || $[104] !== openButtonProps || $[105] !== readOnly ? (t36 = !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, $[97] = disabled, $[98] = expanded, $[99] = fontSize, $[100] = handleOpenClick, $[101] = openButton, $[102] = openButtonBoxPadding, $[103] = openButtonPadding, $[104] = openButtonProps, $[105] = readOnly, $[106] = t36) : t36 = $[106];
467
+ const openButtonNode = t36;
468
+ let t37;
469
+ bb1: {
470
+ if (query === null) {
471
+ if (value !== null) {
472
+ let t382;
473
+ $[107] !== currentOption || $[108] !== renderValue || $[109] !== value ? (t382 = renderValue(value, currentOption), $[107] = currentOption, $[108] = renderValue, $[109] = value, $[110] = t382) : t382 = $[110], t37 = t382;
474
+ break bb1;
475
+ }
476
+ t37 = "";
477
+ break bb1;
478
+ }
479
+ t37 = query;
480
+ }
481
+ const inputValue = t37;
482
+ let t38;
483
+ $[111] !== listFocused ? (t38 = (event_5) => {
484
+ event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
485
+ }, $[111] = listFocused, $[112] = t38) : t38 = $[112];
486
+ const handleListBoxKeyDown = t38;
487
+ let t39;
488
+ bb2: {
489
+ if (filteredOptions.length === 0) {
490
+ t39 = null;
491
+ break bb2;
492
+ }
493
+ let t402;
494
+ if ($[113] !== activeValue || $[114] !== currentOption || $[115] !== filteredOptions || $[116] !== handleOptionSelect || $[117] !== id || $[118] !== listFocused || $[119] !== loading || $[120] !== renderOption) {
495
+ let t413;
496
+ $[122] !== activeValue || $[123] !== currentOption || $[124] !== handleOptionSelect || $[125] !== id || $[126] !== listFocused || $[127] !== loading || $[128] !== renderOption ? (t413 = (option_0) => {
497
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
498
+ 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), {
499
+ disabled: loading,
500
+ selected: active,
501
+ tabIndex: listFocused && active ? 0 : -1
502
+ }) }, option_0.value);
503
+ }, $[122] = activeValue, $[123] = currentOption, $[124] = handleOptionSelect, $[125] = id, $[126] = listFocused, $[127] = loading, $[128] = renderOption, $[129] = t413) : t413 = $[129], t402 = filteredOptions.map(t413), $[113] = activeValue, $[114] = currentOption, $[115] = filteredOptions, $[116] = handleOptionSelect, $[117] = id, $[118] = listFocused, $[119] = loading, $[120] = renderOption, $[121] = t402;
504
+ } else
505
+ t402 = $[121];
506
+ let t412;
507
+ $[130] !== listBoxId || $[131] !== t402 ? (t412 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t402 }), $[130] = listBoxId, $[131] = t402, $[132] = t412) : t412 = $[132];
508
+ let t422;
509
+ $[133] !== handleListBoxKeyDown || $[134] !== listBox || $[135] !== t412 ? (t422 = /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t412 }), $[133] = handleListBoxKeyDown, $[134] = listBox, $[135] = t412, $[136] = t422) : t422 = $[136], t39 = t422;
510
+ }
511
+ const content2 = t39;
512
+ let t40;
513
+ bb3: {
514
+ if (renderPopover) {
515
+ const t413 = !expanded;
516
+ let t422;
517
+ $[137] !== content2 || $[138] !== handlePopoverMouseEnter || $[139] !== handlePopoverMouseLeave || $[140] !== inputElement || $[141] !== renderPopover || $[142] !== t413 ? (t422 = /* @__PURE__ */ jsxRuntime.jsx(RenderPopover, { content: content2, hidden: t413, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[137] = content2, $[138] = handlePopoverMouseEnter, $[139] = handlePopoverMouseLeave, $[140] = inputElement, $[141] = renderPopover, $[142] = t413, $[143] = t422) : t422 = $[143], t40 = t422;
518
+ break bb3;
519
+ }
520
+ if (filteredOptionsLen === 0) {
521
+ t40 = null;
522
+ break bb3;
523
+ }
524
+ let t412;
525
+ $[144] !== content2 || $[145] !== expanded || $[146] !== handlePopoverMouseEnter || $[147] !== handlePopoverMouseLeave || $[148] !== inputElement || $[149] !== popover || $[150] !== radius ? (t412 = /* @__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 }), $[144] = content2, $[145] = expanded, $[146] = handlePopoverMouseEnter, $[147] = handlePopoverMouseLeave, $[148] = inputElement, $[149] = popover, $[150] = radius, $[151] = t412) : t412 = $[151], t40 = t412;
526
+ }
527
+ const results = t40, t41 = loading && AnimatedSpinnerIcon, t42 = suffix || openButtonNode;
528
+ let t43;
529
+ $[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] !== t41 || $[172] !== t42 ? (t43 = /* @__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: t41, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t42, 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] = t41, $[172] = t42, $[173] = t43) : t43 = $[173];
530
+ let t44;
531
+ return $[174] !== handleRootBlur || $[175] !== handleRootFocus || $[176] !== handleRootKeyDown || $[177] !== results || $[178] !== t43 ? (t44 = /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
532
+ t43,
384
533
  results
385
- ] });
534
+ ] }), $[174] = handleRootBlur, $[175] = handleRootFocus, $[176] = handleRootKeyDown, $[177] = results, $[178] = t43, $[179] = t44) : t44 = $[179], t44;
386
535
  });
387
536
  function RenderPopover({
388
537
  renderPopover,
@@ -402,22 +551,46 @@ function RenderPopover({
402
551
  }, resultsPopoverElementRef);
403
552
  }
404
553
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
405
- const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
554
+ const Autocomplete = InnerAutocomplete;
555
+ function _temp$3(v_0) {
556
+ return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
557
+ }
558
+ function _temp2$1(v_1) {
559
+ return Math.max(v_1 - 1, 0);
560
+ }
561
+ const StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
406
562
  displayName: "StyledBreadcrumbs",
407
563
  componentId: "sc-1es8h8q-0"
408
564
  })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styledComponents.styled(_visualEditing.Button).withConfig({
409
565
  displayName: "ExpandButton",
410
566
  componentId: "sc-1es8h8q-1"
411
567
  })`appearance:none;margin:-4px;`, Breadcrumbs = react.forwardRef(function(props, ref) {
412
- const {
568
+ const $ = reactCompilerRuntime.c(29);
569
+ let children, maxLength, restProps, separator, t0;
570
+ $[0] !== props ? ({
413
571
  children,
414
572
  maxLength,
415
573
  separator,
416
- space: spaceRaw = 2,
574
+ space: t0,
417
575
  ...restProps
418
- } = props, space = _visualEditing._getArrayProp(spaceRaw), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
419
- _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
420
- const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = useItems({
576
+ } = props, $[0] = props, $[1] = children, $[2] = maxLength, $[3] = restProps, $[4] = separator, $[5] = t0) : (children = $[1], maxLength = $[2], restProps = $[3], separator = $[4], t0 = $[5]);
577
+ const spaceRaw = t0 === void 0 ? 2 : t0;
578
+ let t1;
579
+ $[6] !== spaceRaw ? (t1 = _visualEditing._getArrayProp(spaceRaw), $[6] = spaceRaw, $[7] = t1) : t1 = $[7];
580
+ const space = t1, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null);
581
+ let t2;
582
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!1), $[8] = t2) : t2 = $[8];
583
+ const collapse = t2;
584
+ let t3;
585
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!0), $[9] = t3) : t3 = $[9];
586
+ const expand = t3;
587
+ let t4;
588
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => [expandElementRef.current, popoverElementRef.current], $[10] = t4) : t4 = $[10], _visualEditing.useClickOutsideEvent(collapse, t4);
589
+ let t5;
590
+ $[11] !== children ? (t5 = react.Children.toArray(children).filter(react.isValidElement), $[11] = children, $[12] = t5) : t5 = $[12];
591
+ const rawItems = t5;
592
+ let t6;
593
+ $[13] !== maxLength || $[14] !== open || $[15] !== rawItems || $[16] !== space ? (t6 = {
421
594
  collapse,
422
595
  expand,
423
596
  expandElementRef,
@@ -426,27 +599,49 @@ const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styledComponents.sty
426
599
  popoverElementRef,
427
600
  rawItems,
428
601
  space
429
- });
430
- return /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
431
- itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
432
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
433
- ] }, itemIndex)) });
602
+ }, $[13] = maxLength, $[14] = open, $[15] = rawItems, $[16] = space, $[17] = t6) : t6 = $[17];
603
+ const items = useItems(t6);
604
+ let t7;
605
+ if ($[18] !== items || $[19] !== separator || $[20] !== space) {
606
+ let t82;
607
+ $[22] !== separator || $[23] !== space ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
608
+ itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
609
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
610
+ ] }, itemIndex), $[22] = separator, $[23] = space, $[24] = t82) : t82 = $[24], t7 = items.map(t82), $[18] = items, $[19] = separator, $[20] = space, $[21] = t7;
611
+ } else
612
+ t7 = $[21];
613
+ let t8;
614
+ return $[25] !== ref || $[26] !== restProps || $[27] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t7 }), $[25] = ref, $[26] = restProps, $[27] = t7, $[28] = t8) : t8 = $[28], t8;
434
615
  });
435
616
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
436
- function useItems({
437
- collapse,
438
- expand,
439
- expandElementRef,
440
- maxLength,
441
- open,
442
- popoverElementRef,
443
- rawItems,
444
- space
445
- }) {
446
- const len = rawItems.length;
617
+ function useItems(t0) {
618
+ const $ = reactCompilerRuntime.c(28), {
619
+ collapse,
620
+ expand,
621
+ expandElementRef,
622
+ maxLength,
623
+ open,
624
+ popoverElementRef,
625
+ rawItems,
626
+ space
627
+ } = t0, len = rawItems.length;
447
628
  if (maxLength && len > maxLength) {
448
629
  const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
449
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
630
+ let t1;
631
+ if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
632
+ const t2 = rawItems.slice(0, beforeLength - 1);
633
+ let t3;
634
+ $[11] !== afterLength || $[12] !== beforeLength || $[13] !== len || $[14] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[11] = afterLength, $[12] = beforeLength, $[13] = len, $[14] = rawItems, $[15] = t3) : t3 = $[15];
635
+ let t4;
636
+ $[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: t3 }), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
637
+ const t5 = open ? collapse : expand;
638
+ let t6;
639
+ $[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: t5, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }), $[19] = expandElementRef, $[20] = open, $[21] = t5, $[22] = t6) : t6 = $[22];
640
+ let t7;
641
+ $[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: t4, open, placement: "top", portal: !0, ref: popoverElementRef, children: t6 }, "button"), $[23] = open, $[24] = popoverElementRef, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t1 = [...t2, t7, ...rawItems.slice(len - afterLength)], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandElementRef, $[5] = len, $[6] = open, $[7] = popoverElementRef, $[8] = rawItems, $[9] = space, $[10] = t1;
642
+ } else
643
+ t1 = $[10];
644
+ return t1;
450
645
  }
451
646
  return rawItems;
452
647
  }
@@ -539,7 +734,7 @@ const StyledDialog = /* @__PURE__ */ styledComponents.styled(_visualEditing.Laye
539
734
  displayName: "DialogFooter",
540
735
  componentId: "sc-4n4xb3-6"
541
736
  })`position:relative;z-index:3;`, DialogCard = react.forwardRef(function(props, forwardedRef) {
542
- const {
737
+ const $ = reactCompilerRuntime.c(44), {
543
738
  __unstable_autoFocus: autoFocus,
544
739
  __unstable_hideCloseButton: hideCloseButton,
545
740
  children,
@@ -554,36 +749,71 @@ const StyledDialog = /* @__PURE__ */ styledComponents.styled(_visualEditing.Laye
554
749
  scheme,
555
750
  shadow: shadowProp,
556
751
  width: widthProp
557
- } = props, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, radius = _visualEditing._getArrayProp(radiusProp), shadow = _visualEditing._getArrayProp(shadowProp), width = _visualEditing._getArrayProp(widthProp), ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
752
+ } = props, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element;
753
+ let t0;
754
+ $[0] !== radiusProp ? (t0 = _visualEditing._getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0) : t0 = $[1];
755
+ const radius = t0;
756
+ let t1;
757
+ $[2] !== shadowProp ? (t1 = _visualEditing._getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1) : t1 = $[3];
758
+ const shadow = t1;
759
+ let t2;
760
+ $[4] !== widthProp ? (t2 = _visualEditing._getArrayProp(widthProp), $[4] = widthProp, $[5] = t2) : t2 = $[5];
761
+ const width = t2, ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
558
762
  isTopLayer
559
763
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
560
- return react.useImperativeHandle(forwardedRef, () => ref.current), react.useImperativeHandle(forwardedContentRef, () => contentRef.current), react.useEffect(() => {
764
+ let t3;
765
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], react.useImperativeHandle(forwardedRef, t3);
766
+ let t4;
767
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], react.useImperativeHandle(forwardedContentRef, t4);
768
+ let t5, t6;
769
+ $[8] !== autoFocus ? (t5 = () => {
561
770
  autoFocus && ref.current && focusFirstDescendant(ref.current);
562
- }, [autoFocus, ref]), _visualEditing.useGlobalKeyDown(react.useCallback((event) => {
563
- if (!isTopLayer || !onClose) return;
771
+ }, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6) : (t5 = $[9], t6 = $[10]), react.useEffect(t5, t6);
772
+ let t7;
773
+ $[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
774
+ if (!isTopLayer || !onClose)
775
+ return;
564
776
  const target = document.activeElement;
565
777
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
566
- }, [boundaryElement, isTopLayer, onClose, portalElement])), _visualEditing.useClickOutsideEvent(isTopLayer && onClickOutside && ((event) => {
567
- const target = event.target;
568
- target && !isTargetWithinScope(boundaryElement, portalElement, target) || onClickOutside();
569
- }), () => [ref.current]), /* @__PURE__ */ jsxRuntime.jsx(DialogContainer, { "data-ui": "DialogCard", width, children: /* @__PURE__ */ jsxRuntime.jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: /* @__PURE__ */ jsxRuntime.jsxs(DialogLayout, { direction: "column", children: [
570
- showHeader && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
571
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
572
- showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
573
- ] }) }),
574
- /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }),
575
- footer && /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: footer })
576
- ] }) }) });
778
+ }, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], _visualEditing.useGlobalKeyDown(t7);
779
+ let t8;
780
+ $[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
781
+ const target_0 = event_0.target;
782
+ target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
783
+ }), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
784
+ let t9;
785
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], _visualEditing.useClickOutsideEvent(t8, t9);
786
+ let t10;
787
+ $[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
788
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
789
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
790
+ ] }) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
791
+ let t11;
792
+ $[28] !== children ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[28] = children, $[29] = t11) : t11 = $[29];
793
+ let t12;
794
+ $[30] !== footer ? (t12 = footer && /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12) : t12 = $[31];
795
+ let t13;
796
+ $[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(DialogLayout, { direction: "column", children: [
797
+ t10,
798
+ t11,
799
+ t12
800
+ ] }), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
801
+ let t14;
802
+ $[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t13 }), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
803
+ let t15;
804
+ return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t14 }), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
577
805
  });
578
806
  DialogCard.displayName = "ForwardRef(DialogCard)";
579
807
  const Dialog = react.forwardRef(function(props, ref) {
580
- const dialog = useDialog(), {
808
+ const $ = reactCompilerRuntime.c(70), dialog = useDialog(), {
581
809
  layer
582
- } = _visualEditing.useTheme_v2(), {
583
- __unstable_autoFocus: autoFocus = !0,
584
- __unstable_hideCloseButton: hideCloseButton = !1,
585
- cardRadius: cardRadiusProp = 4,
586
- cardShadow = 3,
810
+ } = _visualEditing.useTheme_v2();
811
+ let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
812
+ $[0] !== props ? ({
813
+ __unstable_autoFocus: t0,
814
+ __unstable_hideCloseButton: t1,
815
+ cardRadius: t2,
816
+ cardShadow: t3,
587
817
  children,
588
818
  contentRef,
589
819
  footer,
@@ -593,15 +823,33 @@ const Dialog = react.forwardRef(function(props, ref) {
593
823
  onClickOutside,
594
824
  onClose,
595
825
  onFocus,
596
- padding: paddingProp = 3,
826
+ padding: t4,
597
827
  portal: portalProp,
598
828
  position: _positionProp,
599
829
  scheme,
600
- width: widthProp = 0,
830
+ width: t5,
601
831
  zOffset: _zOffsetProp,
602
- animate: _animate = !1,
832
+ animate: t6,
603
833
  ...restProps
604
- } = props, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing._getArrayProp(cardRadiusProp), padding = _visualEditing._getArrayProp(paddingProp), position = _visualEditing._getArrayProp(positionProp), width = _visualEditing._getArrayProp(widthProp), zOffset = _visualEditing._getArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null), handleFocus = react.useCallback((event) => {
834
+ } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
835
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element;
836
+ let t7;
837
+ $[22] !== cardRadiusProp ? (t7 = _visualEditing._getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7) : t7 = $[23];
838
+ const cardRadius = t7;
839
+ let t8;
840
+ $[24] !== paddingProp ? (t8 = _visualEditing._getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t8) : t8 = $[25];
841
+ const padding = t8;
842
+ let t9;
843
+ $[26] !== positionProp ? (t9 = _visualEditing._getArrayProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
844
+ const position = t9;
845
+ let t10;
846
+ $[28] !== widthProp ? (t10 = _visualEditing._getArrayProp(widthProp), $[28] = widthProp, $[29] = t10) : t10 = $[29];
847
+ const width = t10;
848
+ let t11;
849
+ $[30] !== zOffsetProp ? (t11 = _visualEditing._getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t11) : t11 = $[31];
850
+ const zOffset = t11, preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
851
+ let t12;
852
+ $[32] !== onFocus ? (t12 = (event) => {
605
853
  onFocus?.(event);
606
854
  const target = event.target, cardElement = cardRef.current;
607
855
  if (cardElement && target === preDivRef.current) {
@@ -613,43 +861,60 @@ const Dialog = react.forwardRef(function(props, ref) {
613
861
  return;
614
862
  }
615
863
  _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
616
- }, [onFocus]), labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0), handleRootClick = react.useCallback(() => {
864
+ }, $[32] = onFocus, $[33] = t12) : t12 = $[33];
865
+ const handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
866
+ let t13;
867
+ $[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
617
868
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
618
869
  const activeElement = document.activeElement;
619
870
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
620
- const target = focusedElementRef.current;
621
- if (!target || !document.body.contains(target)) {
622
- const cardElement = cardRef.current;
623
- cardElement && focusFirstDescendant(cardElement);
871
+ const target_0 = focusedElementRef.current;
872
+ if (!target_0 || !document.body.contains(target_0)) {
873
+ const cardElement_0 = cardRef.current;
874
+ cardElement_0 && focusFirstDescendant(cardElement_0);
624
875
  return;
625
876
  }
626
- target.focus();
877
+ target_0.focus();
627
878
  }
628
879
  }, 0);
629
- }, [boundaryElement, portalElement]);
630
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: /* @__PURE__ */ jsxRuntime.jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
631
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }),
632
- /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }),
633
- /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 })
634
- ] }) });
880
+ }, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
881
+ const handleRootClick = t13;
882
+ let t14;
883
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t14) : t14 = $[37];
884
+ let t15;
885
+ $[38] !== autoFocus || $[39] !== cardRadius || $[40] !== cardShadow || $[41] !== children || $[42] !== contentRef || $[43] !== footer || $[44] !== header || $[45] !== hideCloseButton || $[46] !== id || $[47] !== onClickOutside || $[48] !== onClose || $[49] !== portalProp || $[50] !== scheme || $[51] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[38] = autoFocus, $[39] = cardRadius, $[40] = cardShadow, $[41] = children, $[42] = contentRef, $[43] = footer, $[44] = header, $[45] = hideCloseButton, $[46] = id, $[47] = onClickOutside, $[48] = onClose, $[49] = portalProp, $[50] = scheme, $[51] = width, $[52] = t15) : t15 = $[52];
886
+ let t16;
887
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[53] = t16) : t16 = $[53];
888
+ let t17;
889
+ $[54] !== animate || $[55] !== handleFocus || $[56] !== handleRootClick || $[57] !== id || $[58] !== labelId || $[59] !== onActivate || $[60] !== padding || $[61] !== position || $[62] !== ref || $[63] !== restProps || $[64] !== t15 || $[65] !== zOffset ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
890
+ t14,
891
+ t15,
892
+ t16
893
+ ] }), $[54] = animate, $[55] = handleFocus, $[56] = handleRootClick, $[57] = id, $[58] = labelId, $[59] = onActivate, $[60] = padding, $[61] = position, $[62] = ref, $[63] = restProps, $[64] = t15, $[65] = zOffset, $[66] = t17) : t17 = $[66];
894
+ let t18;
895
+ return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t17 }), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
635
896
  });
636
897
  Dialog.displayName = "ForwardRef(Dialog)";
637
898
  function DialogProvider(props) {
638
- const {
899
+ const $ = reactCompilerRuntime.c(6), {
639
900
  children,
640
901
  position,
641
902
  zOffset
642
- } = props, contextValue = react.useMemo(() => ({
903
+ } = props;
904
+ let t0;
905
+ $[0] !== position || $[1] !== zOffset ? (t0 = {
643
906
  version: 0,
644
907
  position,
645
908
  zOffset
646
- }), [position, zOffset]);
647
- return /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children });
909
+ }, $[0] = position, $[1] = zOffset, $[2] = t0) : t0 = $[2];
910
+ const contextValue = t0;
911
+ let t1;
912
+ return $[3] !== children || $[4] !== contextValue ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t1) : t1 = $[5], t1;
648
913
  }
649
914
  DialogProvider.displayName = "DialogProvider";
650
915
  const MenuButton = react.forwardRef(function(props, forwardedRef) {
651
- const {
652
- __unstable_disableRestoreFocusOnClose: disableRestoreFocusOnClose = !1,
916
+ const $ = reactCompilerRuntime.c(62), {
917
+ __unstable_disableRestoreFocusOnClose: t0,
653
918
  boundaryElement: deprecated_boundaryElement,
654
919
  button: buttonProp,
655
920
  id,
@@ -658,52 +923,85 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
658
923
  onOpen,
659
924
  placement: deprecated_placement,
660
925
  popoverScheme: deprecated_popoverScheme,
661
- portal: deprecated_portal = !0,
926
+ portal: t1,
662
927
  popover,
663
928
  popoverRadius: deprecated_popoverRadius,
664
929
  preventOverflow: deprecated_preventOverflow
665
- } = props, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null), [menuElements, setChildMenuElements] = react.useState([]), openRef = react.useRef(open);
666
- react.useEffect(() => {
930
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
931
+ let t2;
932
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
933
+ const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
934
+ let t3, t4;
935
+ $[1] !== onOpen || $[2] !== open ? (t3 = () => {
667
936
  onOpen && open && !openRef.current && onOpen();
668
- }, [onOpen, open]), react.useEffect(() => {
937
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
938
+ let t5, t6;
939
+ $[5] !== onClose || $[6] !== open ? (t5 = () => {
669
940
  onClose && !open && openRef.current && onClose();
670
- }, [onClose, open]), react.useEffect(() => {
941
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
942
+ let t7, t8;
943
+ $[9] !== open ? (t7 = () => {
671
944
  openRef.current = open;
672
- }, [open]);
673
- const handleButtonClick = react.useCallback(() => {
674
- setOpen((v) => !v), setShouldFocus(null);
675
- }, []), handleMouseDown = react.useCallback((event) => {
945
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
946
+ let t9;
947
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
948
+ setOpen(_temp$2), setShouldFocus(null);
949
+ }, $[12] = t9) : t9 = $[12];
950
+ const handleButtonClick = t9;
951
+ let t10;
952
+ $[13] !== open ? (t10 = (event) => {
676
953
  open && event.preventDefault();
677
- }, [open]), handleButtonKeyDown = react.useCallback((event) => {
678
- if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
679
- event.preventDefault(), setOpen(!0), setShouldFocus("first");
954
+ }, $[13] = open, $[14] = t10) : t10 = $[14];
955
+ const handleMouseDown = t10;
956
+ let t11;
957
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
958
+ if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
959
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
680
960
  return;
681
961
  }
682
- if (event.key === "ArrowUp") {
683
- event.preventDefault(), setOpen(!0), setShouldFocus("last");
962
+ if (event_0.key === "ArrowUp") {
963
+ event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
684
964
  return;
685
965
  }
686
- }, []), handleMenuClickOutside = react.useCallback((event) => {
687
- const target = event.target;
966
+ }, $[15] = t11) : t11 = $[15];
967
+ const handleButtonKeyDown = t11;
968
+ let t12;
969
+ $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
970
+ const target = event_1.target;
688
971
  if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
689
972
  for (const el of menuElements)
690
973
  if (target === el || el.contains(target))
691
974
  return;
692
975
  setOpen(!1);
693
976
  }
694
- }, [buttonElement, menuElements]), handleMenuEscape = react.useCallback(() => {
977
+ }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
978
+ const handleMenuClickOutside = t12;
979
+ let t13;
980
+ $[19] !== buttonElement || $[20] !== disableRestoreFocusOnClose ? (t13 = () => {
695
981
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
696
- }, [buttonElement, disableRestoreFocusOnClose]), handleBlur = react.useCallback((event) => {
697
- const target = event.relatedTarget;
698
- if (target instanceof Node) {
699
- for (const el of menuElements)
700
- if (el === target || el.contains(target))
982
+ }, $[19] = buttonElement, $[20] = disableRestoreFocusOnClose, $[21] = t13) : t13 = $[21];
983
+ const handleMenuEscape = t13;
984
+ let t14;
985
+ $[22] !== menuElements ? (t14 = (event_2) => {
986
+ const target_0 = event_2.relatedTarget;
987
+ if (target_0 instanceof Node) {
988
+ for (const el_0 of menuElements)
989
+ if (el_0 === target_0 || el_0.contains(target_0))
701
990
  return;
702
991
  setOpen(!1);
703
992
  }
704
- }, [menuElements]), handleItemClick = react.useCallback(() => {
993
+ }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
994
+ const handleBlur = t14;
995
+ let t15;
996
+ $[24] !== buttonElement || $[25] !== disableRestoreFocusOnClose ? (t15 = () => {
705
997
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
706
- }, [buttonElement, disableRestoreFocusOnClose]), registerElement = react.useCallback((el) => (setChildMenuElements((els) => els.concat([el])), () => setChildMenuElements((els) => els.filter((_el) => _el !== el))), []), menu = menuProp && react.cloneElement(menuProp, {
998
+ }, $[24] = buttonElement, $[25] = disableRestoreFocusOnClose, $[26] = t15) : t15 = $[26];
999
+ const handleItemClick = t15;
1000
+ let t16;
1001
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
1002
+ const registerElement = t16;
1003
+ let t17;
1004
+ $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && react.cloneElement(menuProp, {
707
1005
  "aria-labelledby": id,
708
1006
  onBlurCapture: handleBlur,
709
1007
  onClickOutside: handleMenuClickOutside,
@@ -712,7 +1010,10 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
712
1010
  originElement: buttonElement,
713
1011
  registerElement,
714
1012
  shouldFocus
715
- }), button = react.useMemo(() => buttonProp && react.cloneElement(buttonProp, {
1013
+ }), $[28] = buttonElement, $[29] = handleBlur, $[30] = handleItemClick, $[31] = handleMenuClickOutside, $[32] = handleMenuEscape, $[33] = id, $[34] = menuProp, $[35] = shouldFocus, $[36] = t17) : t17 = $[36];
1014
+ const menu = t17;
1015
+ let t18;
1016
+ $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open ? (t18 = buttonProp && react.cloneElement(buttonProp, {
716
1017
  "data-ui": "MenuButton",
717
1018
  id,
718
1019
  onClick: handleButtonClick,
@@ -722,9 +1023,14 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
722
1023
  "aria-expanded": open,
723
1024
  ref: setButtonElement,
724
1025
  selected: buttonProp.props.selected ?? open
725
- }), [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open]);
726
- react.useImperativeHandle(forwardedRef, () => buttonElement, [buttonElement]);
727
- const popoverProps = react.useMemo(() => ({
1026
+ }), $[37] = buttonProp, $[38] = handleMouseDown, $[39] = id, $[40] = open, $[41] = t18) : t18 = $[41];
1027
+ const button = t18;
1028
+ let t19, t20;
1029
+ $[42] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[42] = buttonElement, $[43] = t19, $[44] = t20) : (t19 = $[43], t20 = $[44]), react.useImperativeHandle(forwardedRef, t19, t20);
1030
+ let t21;
1031
+ $[45] !== popover ? (t21 = popover || {}, $[45] = popover, $[46] = t21) : t21 = $[46];
1032
+ let t22;
1033
+ $[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_popoverRadius || $[50] !== deprecated_popoverScheme || $[51] !== deprecated_portal || $[52] !== deprecated_preventOverflow || $[53] !== t21 ? (t22 = {
728
1034
  boundaryElement: deprecated_boundaryElement,
729
1035
  overflow: "auto",
730
1036
  placement: deprecated_placement,
@@ -732,11 +1038,18 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
732
1038
  preventOverflow: deprecated_preventOverflow,
733
1039
  radius: deprecated_popoverRadius,
734
1040
  scheme: deprecated_popoverScheme,
735
- ...popover || {}
736
- }), [deprecated_boundaryElement, deprecated_placement, deprecated_popoverRadius, deprecated_popoverScheme, deprecated_portal, deprecated_preventOverflow, popover]);
737
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
1041
+ ...t21
1042
+ }, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_popoverRadius, $[50] = deprecated_popoverScheme, $[51] = deprecated_portal, $[52] = deprecated_preventOverflow, $[53] = t21, $[54] = t22) : t22 = $[54];
1043
+ const popoverProps = t22;
1044
+ let t23;
1045
+ $[55] !== button ? (t23 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[55] = button, $[56] = t23) : t23 = $[56];
1046
+ let t24;
1047
+ return $[57] !== menu || $[58] !== open || $[59] !== popoverProps || $[60] !== t23 ? (t24 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t23 }), $[57] = menu, $[58] = open, $[59] = popoverProps, $[60] = t23, $[61] = t24) : t24 = $[61], t24;
738
1048
  });
739
1049
  MenuButton.displayName = "ForwardRef(MenuButton)";
1050
+ function _temp$2(v) {
1051
+ return !v;
1052
+ }
740
1053
  const keyframe = styledComponents.keyframes`
741
1054
  0% {
742
1055
  background-position: 100%;
@@ -781,13 +1094,17 @@ const keyframe = styledComponents.keyframes`
781
1094
  displayName: "StyledSkeleton",
782
1095
  componentId: "sc-ebtpni-0"
783
1096
  })(_visualEditing.responsiveRadiusStyle, skeletonStyle), Skeleton = react.forwardRef(function(props, ref) {
784
- const {
785
- animated = !1,
1097
+ const $ = reactCompilerRuntime.c(16);
1098
+ let delay, radius, restProps, t0;
1099
+ $[0] !== props ? ({
1100
+ animated: t0,
786
1101
  delay,
787
1102
  radius,
788
1103
  ...restProps
789
- } = props, [visible, setVisible] = react.useState(!delay);
790
- return react.useEffect(() => {
1104
+ } = props, $[0] = props, $[1] = delay, $[2] = radius, $[3] = restProps, $[4] = t0) : (delay = $[1], radius = $[2], restProps = $[3], t0 = $[4]);
1105
+ const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = react.useState(!delay);
1106
+ let t1, t2;
1107
+ $[5] !== delay ? (t1 = () => {
791
1108
  if (!delay)
792
1109
  return;
793
1110
  const timeout = setTimeout(() => {
@@ -796,7 +1113,12 @@ const keyframe = styledComponents.keyframes`
796
1113
  return () => {
797
1114
  clearTimeout(timeout);
798
1115
  };
799
- }, [delay]), /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: _visualEditing._getArrayProp(radius), $visible: delay ? visible : !0, ref });
1116
+ }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), react.useEffect(t1, t2);
1117
+ let t3;
1118
+ $[8] !== radius ? (t3 = _visualEditing._getArrayProp(radius), $[8] = radius, $[9] = t3) : t3 = $[9];
1119
+ const t4 = delay ? visible : !0;
1120
+ let t5;
1121
+ return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: t3, $visible: t4, ref }), $[10] = animated, $[11] = ref, $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5) : t5 = $[15], t5;
800
1122
  });
801
1123
  Skeleton.displayName = "ForwardRef(Skeleton)";
802
1124
  const StyledSkeleton = /* @__PURE__ */ styledComponents.styled(Skeleton).withConfig({
@@ -817,43 +1139,75 @@ const StyledSkeleton = /* @__PURE__ */ styledComponents.styled(Skeleton).withCon
817
1139
  };
818
1140
  });
819
1141
  }), TextSkeleton = react.forwardRef(function(props, ref) {
820
- const {
821
- size = 2,
1142
+ const $ = reactCompilerRuntime.c(9);
1143
+ let restProps, t0;
1144
+ $[0] !== props ? ({
1145
+ size: t0,
822
1146
  ...restProps
823
- } = props, $size = _visualEditing._getArrayProp(size);
824
- return /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" });
1147
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1148
+ const size = t0 === void 0 ? 2 : t0;
1149
+ let t1;
1150
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1151
+ const $size = t1;
1152
+ let t2;
1153
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
825
1154
  });
826
1155
  TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
827
1156
  const LabelSkeleton = react.forwardRef(function(props, ref) {
828
- const {
829
- size = 2,
1157
+ const $ = reactCompilerRuntime.c(9);
1158
+ let restProps, t0;
1159
+ $[0] !== props ? ({
1160
+ size: t0,
830
1161
  ...restProps
831
- } = props, $size = _visualEditing._getArrayProp(size);
832
- return /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" });
1162
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1163
+ const size = t0 === void 0 ? 2 : t0;
1164
+ let t1;
1165
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1166
+ const $size = t1;
1167
+ let t2;
1168
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
833
1169
  });
834
1170
  LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
835
1171
  const HeadingSkeleton = react.forwardRef(function(props, ref) {
836
- const {
837
- size = 2,
1172
+ const $ = reactCompilerRuntime.c(9);
1173
+ let restProps, t0;
1174
+ $[0] !== props ? ({
1175
+ size: t0,
838
1176
  ...restProps
839
- } = props, $size = _visualEditing._getArrayProp(size);
840
- return /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" });
1177
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1178
+ const size = t0 === void 0 ? 2 : t0;
1179
+ let t1;
1180
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1181
+ const $size = t1;
1182
+ let t2;
1183
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
841
1184
  });
842
1185
  HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
843
1186
  const CodeSkeleton = react.forwardRef(function(props, ref) {
844
- const {
845
- size = 2,
1187
+ const $ = reactCompilerRuntime.c(9);
1188
+ let restProps, t0;
1189
+ $[0] !== props ? ({
1190
+ size: t0,
846
1191
  ...restProps
847
- } = props, $size = _visualEditing._getArrayProp(size);
848
- return /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" });
1192
+ } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1193
+ const size = t0 === void 0 ? 2 : t0;
1194
+ let t1;
1195
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1196
+ const $size = t1;
1197
+ let t2;
1198
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
849
1199
  });
850
1200
  CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
851
1201
  const TabPanel = react.forwardRef(function(props, ref) {
852
- const {
1202
+ const $ = reactCompilerRuntime.c(9);
1203
+ let flex, restProps;
1204
+ $[0] !== props ? ({
853
1205
  flex,
854
1206
  ...restProps
855
- } = props;
856
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: props.tabIndex === void 0 ? 0 : props.tabIndex, children: props.children });
1207
+ } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
1208
+ const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
1209
+ let t1;
1210
+ return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
857
1211
  });
858
1212
  TabPanel.displayName = "ForwardRef(TabPanel)";
859
1213
  const LOADING_BAR_HEIGHT = 2, STATUS_CARD_TONE = {
@@ -893,46 +1247,74 @@ const LOADING_BAR_HEIGHT = 2, STATUS_CARD_TONE = {
893
1247
  info: "alert"
894
1248
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
895
1249
  function Toast(props) {
896
- const {
1250
+ const $ = reactCompilerRuntime.c(50);
1251
+ let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
1252
+ $[0] !== props ? ({
897
1253
  closable,
898
1254
  description,
899
1255
  duration,
900
1256
  onClose,
901
- radius = 3,
1257
+ radius: t0,
902
1258
  title,
903
1259
  status,
904
1260
  updatedAt,
905
1261
  ...restProps
906
- } = props, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26, transition = visualDuration ? {
1262
+ } = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
1263
+ const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
1264
+ let t1;
1265
+ $[10] !== visualDuration ? (t1 = visualDuration ? {
907
1266
  type: "spring",
908
1267
  visualDuration,
909
1268
  bounce: 0.25
910
1269
  } : {
911
1270
  duration: 0
912
- }, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
913
- return /* @__PURE__ */ jsxRuntime.jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": hasDuration ? "" : void 0, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial: ["hidden", "initial"], animate: ["visible", "slideIn"], exit: ["hidden", "slideOut"], transition, children: [
914
- /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
915
- /* @__PURE__ */ jsxRuntime.jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { space: 3, children: [
916
- title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }),
917
- description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description })
918
- ] }) }),
919
- closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
920
- verticalAlign: "top"
921
- } }) })
922
- ] }),
923
- hasDuration && /* @__PURE__ */ jsxRuntime.jsxs(MotionLoadingBar, { variants: content, transition, children: [
924
- /* @__PURE__ */ jsxRuntime.jsx(LoadingBarMask, { tone: cardTone, radius }),
925
- /* @__PURE__ */ jsxRuntime.jsx(MotionLoadingBarProgress, { tone: cardTone, initial: {
926
- scaleX: 0
927
- }, animate: {
928
- scaleX: 1
929
- }, transition: {
930
- delay: visualDuration,
931
- duration: duration / 1e3,
932
- ease: "linear"
933
- }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
934
- ] })
935
- ] });
1271
+ }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
1272
+ const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
1273
+ let t2;
1274
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
1275
+ const initial = t2;
1276
+ let t3;
1277
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
1278
+ const animate = t3;
1279
+ let t4;
1280
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
1281
+ const exit = t4, t5 = hasDuration ? "" : void 0;
1282
+ let t6;
1283
+ $[15] !== title ? (t6 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[15] = title, $[16] = t6) : t6 = $[16];
1284
+ let t7;
1285
+ $[17] !== description || $[18] !== transition ? (t7 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[17] = description, $[18] = transition, $[19] = t7) : t7 = $[19];
1286
+ let t8;
1287
+ $[20] !== t6 || $[21] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(TextBox, { flex: 1, padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { space: 3, children: [
1288
+ t6,
1289
+ t7
1290
+ ] }) }), $[20] = t6, $[21] = t7, $[22] = t8) : t8 = $[22];
1291
+ let t9;
1292
+ $[23] !== buttonTone || $[24] !== closable || $[25] !== onClose ? (t9 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
1293
+ verticalAlign: "top"
1294
+ } }) }), $[23] = buttonTone, $[24] = closable, $[25] = onClose, $[26] = t9) : t9 = $[26];
1295
+ let t10;
1296
+ $[27] !== t8 || $[28] !== t9 || $[29] !== transition ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
1297
+ t8,
1298
+ t9
1299
+ ] }), $[27] = t8, $[28] = t9, $[29] = transition, $[30] = t10) : t10 = $[30];
1300
+ let t11;
1301
+ $[31] !== cardTone || $[32] !== duration || $[33] !== hasDuration || $[34] !== onClose || $[35] !== radius || $[36] !== transition || $[37] !== updatedAt || $[38] !== visualDuration ? (t11 = hasDuration && /* @__PURE__ */ jsxRuntime.jsxs(MotionLoadingBar, { variants: content, transition, children: [
1302
+ /* @__PURE__ */ jsxRuntime.jsx(LoadingBarMask, { tone: cardTone, radius }),
1303
+ /* @__PURE__ */ jsxRuntime.jsx(MotionLoadingBarProgress, { tone: cardTone, initial: {
1304
+ scaleX: 0
1305
+ }, animate: {
1306
+ scaleX: 1
1307
+ }, transition: {
1308
+ delay: visualDuration,
1309
+ duration: duration / 1e3,
1310
+ ease: "linear"
1311
+ }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
1312
+ ] }), $[31] = cardTone, $[32] = duration, $[33] = hasDuration, $[34] = onClose, $[35] = radius, $[36] = transition, $[37] = updatedAt, $[38] = visualDuration, $[39] = t11) : t11 = $[39];
1313
+ let t12;
1314
+ return $[40] !== cardTone || $[41] !== radius || $[42] !== restProps || $[43] !== role || $[44] !== t10 || $[45] !== t11 || $[46] !== t5 || $[47] !== transition || $[48] !== visualDuration ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(MotionToast, { "data-ui": "Toast", role, ...restProps, "data-has-duration": t5, custom: visualDuration, radius, shadow: 2, tone: cardTone, forwardedAs: "li", layout: "position", variants: container, initial, animate, exit, transition, children: [
1315
+ t10,
1316
+ t11
1317
+ ] }), $[40] = cardTone, $[41] = radius, $[42] = restProps, $[43] = role, $[44] = t10, $[45] = t11, $[46] = t5, $[47] = transition, $[48] = visualDuration, $[49] = t12) : t12 = $[49], t12;
936
1318
  }
937
1319
  Toast.displayName = "Toast";
938
1320
  const container = {
@@ -974,23 +1356,32 @@ const container = {
974
1356
  }
975
1357
  }, MotionToast = framerMotion.motion.create(StyledToast), MotionFlex = framerMotion.motion.create(_visualEditing.Flex), MotionText = framerMotion.motion.create(_visualEditing.Text), MotionLoadingBar = framerMotion.motion.create(LoadingBar), MotionLoadingBarProgress = framerMotion.motion.create(LoadingBarProgress);
976
1358
  function useMounted() {
977
- return react.useSyncExternalStore(subscribe, () => !0, () => !1);
1359
+ return react.useSyncExternalStore(subscribe, _temp$1, _temp2);
1360
+ }
1361
+ function _temp2() {
1362
+ return !1;
1363
+ }
1364
+ function _temp$1() {
1365
+ return !0;
978
1366
  }
979
1367
  const subscribe = () => () => {
980
1368
  }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null);
981
1369
  function ToastLayer(props) {
982
- const {
1370
+ const $ = reactCompilerRuntime.c(9), {
983
1371
  children,
984
- padding = 4,
1372
+ padding: t0,
985
1373
  paddingX,
986
1374
  paddingY,
987
- gap = 3
988
- } = props, {
1375
+ gap: t1
1376
+ } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
989
1377
  zIndex
990
1378
  } = _visualEditing.useLayer();
991
- return /* @__PURE__ */ jsxRuntime.jsx(StyledLayer, { forwardedAs: "ul", "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: {
1379
+ let t2;
1380
+ $[0] !== zIndex ? (t2 = {
992
1381
  zIndex
993
- }, children });
1382
+ }, $[0] = zIndex, $[1] = t2) : t2 = $[1];
1383
+ let t3;
1384
+ return $[2] !== children || $[3] !== gap || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(StyledLayer, { forwardedAs: "ul", "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t2, children }), $[2] = children, $[3] = gap, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
994
1385
  }
995
1386
  ToastLayer.displayName = "ToastLayer";
996
1387
  const StyledLayer = styledComponents.styled(_visualEditing.Grid).withConfig({
@@ -1002,14 +1393,19 @@ function generateToastId() {
1002
1393
  return String(toastId++);
1003
1394
  }
1004
1395
  function ToastProvider(props) {
1005
- const {
1396
+ const $ = reactCompilerRuntime.c(13), {
1006
1397
  children,
1007
1398
  padding,
1008
1399
  paddingX,
1009
1400
  paddingY,
1010
1401
  gap,
1011
- zOffset = 1
1012
- } = props, [state, setState] = react.useState([]), mounted = useMounted(), value = react.useMemo(() => ({
1402
+ zOffset: t0
1403
+ } = props, zOffset = t0 === void 0 ? 1 : t0;
1404
+ let t1;
1405
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1406
+ const [state, setState] = react.useState(t1), mounted = useMounted();
1407
+ let t2;
1408
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {
1013
1409
  version: 0,
1014
1410
  push: (params) => {
1015
1411
  const id = params.id || generateToastId(), duration = params.duration || 5e3;
@@ -1017,8 +1413,8 @@ function ToastProvider(props) {
1017
1413
  setState((prevState) => {
1018
1414
  if (duration === 0.01)
1019
1415
  return prevState.filter((toast) => toast.id !== id);
1020
- const dismiss = () => react.startTransition(() => setState((currentState) => currentState.filter((toast) => toast.id !== id)));
1021
- return [...prevState.filter((toast) => toast.id !== id), {
1416
+ const dismiss = () => react.startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1417
+ return [...prevState.filter((toast_1) => toast_1.id !== id), {
1022
1418
  dismiss,
1023
1419
  id,
1024
1420
  updatedAt: Date.now(),
@@ -1030,16 +1426,24 @@ function ToastProvider(props) {
1030
1426
  });
1031
1427
  }), id;
1032
1428
  }
1033
- }), []);
1034
- return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1429
+ }, $[1] = t2) : t2 = $[1];
1430
+ const value = t2;
1431
+ let t3;
1432
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t3 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t3) : t3 = $[9];
1433
+ let t4;
1434
+ return $[10] !== children || $[11] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1035
1435
  children,
1036
- mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(({
1037
- dismiss,
1038
- id,
1039
- params,
1040
- updatedAt
1041
- }) => /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params.closable, description: params.description, onClose: dismiss, status: params.status, title: params.title, duration: params.duration, updatedAt }, id)) }) }) })
1042
- ] });
1436
+ t3
1437
+ ] }), $[10] = children, $[11] = t3, $[12] = t4) : t4 = $[12], t4;
1438
+ }
1439
+ function _temp(t0) {
1440
+ const {
1441
+ dismiss: dismiss_0,
1442
+ id: id_0,
1443
+ params: params_0,
1444
+ updatedAt
1445
+ } = t0;
1446
+ return /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1043
1447
  }
1044
1448
  ToastProvider.displayName = "ToastProvider";
1045
1449
  function useToast() {
@@ -1105,44 +1509,68 @@ function _focusItemElement(el) {
1105
1509
  }
1106
1510
  }
1107
1511
  const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = react.forwardRef(function(props, forwardedRef) {
1108
- const {
1512
+ const $ = reactCompilerRuntime.c(37);
1513
+ let children, onFocus, restProps, t0;
1514
+ $[0] !== props ? ({
1109
1515
  children,
1110
- space = 1,
1516
+ space: t0,
1111
1517
  onFocus,
1112
1518
  ...restProps
1113
- } = props, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement), path = react.useMemo(() => [], []), [itemElements, setItemElements] = react.useState([]), [state, setState] = react.useState({}), stateRef = react.useRef(state);
1114
- react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
1519
+ } = props, $[0] = props, $[1] = children, $[2] = onFocus, $[3] = restProps, $[4] = t0) : (children = $[1], onFocus = $[2], restProps = $[3], t0 = $[4]);
1520
+ const space = t0 === void 0 ? 1 : t0, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1521
+ let t1;
1522
+ $[5] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[5] = t1) : t1 = $[5];
1523
+ const path = t1;
1524
+ let t2;
1525
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6];
1526
+ const [itemElements, setItemElements] = react.useState(t2);
1527
+ let t3;
1528
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[7] = t3) : t3 = $[7];
1529
+ const [state, setState] = react.useState(t3), stateRef = react.useRef(state);
1530
+ let t4;
1531
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[8] = t4) : t4 = $[8], react.useImperativeHandle(forwardedRef, t4);
1532
+ let t5, t6;
1533
+ $[9] !== focusedElement ? (t5 = () => {
1115
1534
  focusedElementRef.current = focusedElement;
1116
- }, [focusedElement]), react.useEffect(() => {
1535
+ }, t6 = [focusedElement], $[9] = focusedElement, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), react.useEffect(t5, t6);
1536
+ let t7, t8;
1537
+ $[12] !== state ? (t7 = () => {
1117
1538
  stateRef.current = state;
1118
- }, [state]);
1119
- const registerItem = react.useCallback((element, path2, expanded, selected) => (setState((s) => ({
1539
+ }, t8 = [state], $[12] = state, $[13] = t7, $[14] = t8) : (t7 = $[13], t8 = $[14]), react.useEffect(t7, t8);
1540
+ let t9;
1541
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
1120
1542
  ...s,
1121
- [path2]: {
1543
+ [path_0]: {
1122
1544
  element,
1123
1545
  expanded
1124
1546
  }
1125
1547
  })), selected && setFocusedElement(element), () => {
1126
- setState((s) => {
1548
+ setState((s_0) => {
1127
1549
  const newState = {
1128
- ...s
1550
+ ...s_0
1129
1551
  };
1130
- return delete newState[path2], newState;
1552
+ return delete newState[path_0], newState;
1131
1553
  });
1132
- }), []), setExpanded = react.useCallback((path2, expanded) => {
1133
- setState((s) => {
1134
- const itemState = s[path2];
1554
+ }), $[15] = t9) : t9 = $[15];
1555
+ const registerItem = t9;
1556
+ let t10;
1557
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
1558
+ setState((s_1) => {
1559
+ const itemState = s_1[path_1];
1135
1560
  return itemState ? {
1136
- ...s,
1137
- [path2]: {
1561
+ ...s_1,
1562
+ [path_1]: {
1138
1563
  ...itemState,
1139
- expanded
1564
+ expanded: expanded_0
1140
1565
  }
1141
- } : s;
1566
+ } : s_1;
1142
1567
  });
1143
- }, []), contextValue = react.useMemo(() => ({
1568
+ }, $[16] = t10) : t10 = $[16];
1569
+ const setExpanded = t10, t11 = focusedElement || itemElements[0] || null;
1570
+ let t12;
1571
+ $[17] !== space || $[18] !== state || $[19] !== t11 ? (t12 = {
1144
1572
  version: 0,
1145
- focusedElement: focusedElement || itemElements[0] || null,
1573
+ focusedElement: t11,
1146
1574
  level: 0,
1147
1575
  path,
1148
1576
  registerItem,
@@ -1150,7 +1578,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1150
1578
  setFocusedElement,
1151
1579
  space,
1152
1580
  state
1153
- }), [focusedElement, itemElements, path, registerItem, setExpanded, space, state]), handleKeyDown = react.useCallback((event) => {
1581
+ }, $[17] = space, $[18] = state, $[19] = t11, $[20] = t12) : t12 = $[20];
1582
+ const contextValue = t12;
1583
+ let t13;
1584
+ $[21] !== itemElements ? (t13 = (event) => {
1154
1585
  if (focusedElementRef.current) {
1155
1586
  if (event.key === "ArrowDown") {
1156
1587
  event.preventDefault();
@@ -1167,19 +1598,21 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1167
1598
  if (event.key === "ArrowLeft") {
1168
1599
  event.preventDefault();
1169
1600
  const itemKey = focusedElementRef.current.getAttribute("data-tree-key");
1170
- if (!itemKey) return;
1171
- const itemState = stateRef.current[itemKey];
1172
- if (!itemState) return;
1173
- if (itemState.expanded)
1174
- setState((s) => {
1175
- const itemState2 = s[itemKey];
1176
- return itemState2 ? {
1177
- ...s,
1601
+ if (!itemKey)
1602
+ return;
1603
+ const itemState_0 = stateRef.current[itemKey];
1604
+ if (!itemState_0)
1605
+ return;
1606
+ if (itemState_0.expanded)
1607
+ setState((s_2) => {
1608
+ const itemState_1 = s_2[itemKey];
1609
+ return itemState_1 ? {
1610
+ ...s_2,
1178
1611
  [itemKey]: {
1179
- ...itemState2,
1612
+ ...itemState_1,
1180
1613
  expanded: !1
1181
1614
  }
1182
- } : s;
1615
+ } : s_2;
1183
1616
  });
1184
1617
  else {
1185
1618
  const itemPath = itemKey.split("/");
@@ -1192,28 +1625,41 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1192
1625
  if (event.key === "ArrowRight") {
1193
1626
  event.preventDefault();
1194
1627
  const focusedKey = focusedElementRef.current.getAttribute("data-tree-key");
1195
- if (!focusedKey) return;
1196
- stateRef.current[focusedKey]?.expanded || setState((s) => {
1197
- const itemState = s[focusedKey];
1198
- return itemState ? {
1199
- ...s,
1628
+ if (!focusedKey)
1629
+ return;
1630
+ stateRef.current[focusedKey]?.expanded || setState((s_3) => {
1631
+ const itemState_2 = s_3[focusedKey];
1632
+ return itemState_2 ? {
1633
+ ...s_3,
1200
1634
  [focusedKey]: {
1201
- ...itemState,
1635
+ ...itemState_2,
1202
1636
  expanded: !0
1203
1637
  }
1204
- } : s;
1638
+ } : s_3;
1205
1639
  });
1206
1640
  return;
1207
1641
  }
1208
1642
  }
1209
- }, [itemElements]), handleFocus = react.useCallback((event) => {
1210
- setFocusedElement(event.target), onFocus?.(event);
1211
- }, [onFocus]);
1212
- return react.useEffect(() => {
1213
- if (!ref.current) return;
1643
+ }, $[21] = itemElements, $[22] = t13) : t13 = $[22];
1644
+ const handleKeyDown = t13;
1645
+ let t14;
1646
+ $[23] !== onFocus ? (t14 = (event_0) => {
1647
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1648
+ }, $[23] = onFocus, $[24] = t14) : t14 = $[24];
1649
+ const handleFocus = t14;
1650
+ let t15;
1651
+ $[25] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
1652
+ if (!ref.current)
1653
+ return;
1214
1654
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1215
1655
  setItemElements(_itemElements);
1216
- }, [children]), /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", space, children }) });
1656
+ }, $[25] = t15) : t15 = $[25];
1657
+ let t16;
1658
+ $[26] !== children ? (t16 = [children], $[26] = children, $[27] = t16) : t16 = $[27], react.useEffect(t15, t16);
1659
+ let t17;
1660
+ $[28] !== children || $[29] !== handleFocus || $[30] !== handleKeyDown || $[31] !== restProps || $[32] !== space ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", space, children }), $[28] = children, $[29] = handleFocus, $[30] = handleKeyDown, $[31] = restProps, $[32] = space, $[33] = t17) : t17 = $[33];
1661
+ let t18;
1662
+ return $[34] !== contextValue || $[35] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[34] = contextValue, $[35] = t17, $[36] = t18) : t18 = $[36], t18;
1217
1663
  });
1218
1664
  Tree.displayName = "ForwardRef(Tree)";
1219
1665
  function treeItemRootStyle() {
@@ -1315,12 +1761,16 @@ function useTree() {
1315
1761
  return tree;
1316
1762
  }
1317
1763
  function TreeGroup(props) {
1318
- const {
1764
+ const $ = reactCompilerRuntime.c(9);
1765
+ let children, restProps, t0;
1766
+ $[0] !== props ? ({
1319
1767
  children,
1320
- expanded = !1,
1768
+ expanded: t0,
1321
1769
  ...restProps
1322
- } = props, tree = useTree();
1323
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: !expanded, marginTop: tree.space, role: "group", space: tree.space, children });
1770
+ } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1771
+ const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1772
+ let t2;
1773
+ return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1324
1774
  }
1325
1775
  const StyledTreeItem = /* @__PURE__ */ styledComponents.styled.li.withConfig({
1326
1776
  displayName: "StyledTreeItem",
@@ -1335,64 +1785,115 @@ const StyledTreeItem = /* @__PURE__ */ styledComponents.styled.li.withConfig({
1335
1785
  componentId: "sc-iiskig-2"
1336
1786
  })`& > svg{transition:transform 100ms;}`;
1337
1787
  function TreeItem(props) {
1338
- const {
1788
+ const $ = reactCompilerRuntime.c(112);
1789
+ let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1790
+ $[0] !== props ? ({
1339
1791
  children,
1340
- expanded: expandedProp = !1,
1341
- fontSize = 1,
1792
+ expanded: t0,
1793
+ fontSize: t1,
1342
1794
  href,
1343
1795
  icon: IconComponent,
1344
1796
  id: idProp,
1345
1797
  linkAs,
1346
1798
  muted,
1347
1799
  onClick,
1348
- padding = 2,
1349
- selected = !1,
1350
- space = 2,
1800
+ padding: t2,
1801
+ selected: t3,
1802
+ space: t4,
1351
1803
  text,
1352
1804
  weight,
1353
1805
  ...restProps
1354
- } = props, [rootElement, setRootElement] = react.useState(null), treeitemRef = react.useRef(null), tree = useTree(), {
1806
+ } = 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]);
1807
+ 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(), {
1355
1808
  path,
1356
1809
  registerItem,
1357
1810
  setExpanded,
1358
1811
  setFocusedElement
1359
- } = tree, _id = react.useId(), id = idProp || _id, [itemPath, itemKey] = react.useMemo(() => {
1360
- const itemPath2 = path.concat([id || ""]);
1361
- return [itemPath2, itemPath2.join("/")];
1362
- }, [id, path]), 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, contextValue = react.useMemo(() => ({
1812
+ } = tree, _id = react.useId(), id = idProp || _id;
1813
+ let t5, t6;
1814
+ if ($[16] !== id || $[17] !== path) {
1815
+ const itemPath = path.concat([id || ""]);
1816
+ t5 = itemPath, t6 = itemPath.join("/"), $[16] = id, $[17] = path, $[18] = t5, $[19] = t6;
1817
+ } else
1818
+ t5 = $[18], t6 = $[19];
1819
+ let t7;
1820
+ $[20] !== t5 || $[21] !== t6 ? (t7 = [t5, t6], $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22];
1821
+ 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;
1822
+ let t9;
1823
+ $[23] !== itemPath_0 || $[24] !== t8 || $[25] !== tree ? (t9 = {
1363
1824
  ...tree,
1364
- level: tree.level + 1,
1365
- path: itemPath
1366
- }), [itemPath, tree]), handleClick = react.useCallback((event) => {
1825
+ level: t8,
1826
+ path: itemPath_0
1827
+ }, $[23] = itemPath_0, $[24] = t8, $[25] = tree, $[26] = t9) : t9 = $[26];
1828
+ const contextValue = t9;
1829
+ let t10;
1830
+ $[27] !== expanded || $[28] !== itemKey || $[29] !== onClick || $[30] !== rootElement || $[31] !== setExpanded || $[32] !== setFocusedElement ? (t10 = (event) => {
1367
1831
  onClick && onClick(event);
1368
1832
  const target = event.target;
1369
1833
  target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
1370
- }, [expanded, itemKey, onClick, rootElement, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event) => {
1371
- focused && event.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1372
- }, [focused, rootElement]);
1373
- react.useEffect(() => {
1834
+ }, $[27] = expanded, $[28] = itemKey, $[29] = onClick, $[30] = rootElement, $[31] = setExpanded, $[32] = setFocusedElement, $[33] = t10) : t10 = $[33];
1835
+ const handleClick = t10;
1836
+ let t11;
1837
+ $[34] !== focused || $[35] !== rootElement ? (t11 = (event_0) => {
1838
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1839
+ }, $[34] = focused, $[35] = rootElement, $[36] = t11) : t11 = $[36];
1840
+ const handleKeyDown = t11;
1841
+ let t12, t13;
1842
+ $[37] !== expanded || $[38] !== itemKey || $[39] !== registerItem || $[40] !== rootElement || $[41] !== selected ? (t12 = () => {
1374
1843
  if (rootElement)
1375
1844
  return registerItem(rootElement, itemKey, expanded, selected);
1376
- }, [expanded, itemKey, registerItem, rootElement, selected]);
1377
- const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { padding, children: [
1378
- /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { marginRight: space, style: {
1379
- visibility: IconComponent || children ? "visible" : "hidden",
1380
- pointerEvents: "none"
1381
- }, children: [
1382
- IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
1383
- !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
1384
- transform: expanded ? "rotate(90deg)" : void 0
1385
- } }) })
1386
- ] }),
1387
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1388
- ] });
1389
- 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: setRootElement, role: "none", children: [
1390
- /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }),
1391
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
1392
- ] }) : /* @__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: setRootElement, role: "treeitem", tabIndex, children: [
1393
- /* @__PURE__ */ jsxRuntime.jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }),
1394
- /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
1395
- ] });
1845
+ }, 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);
1846
+ const t14 = IconComponent || children ? "visible" : "hidden";
1847
+ let t15;
1848
+ $[44] !== t14 ? (t15 = {
1849
+ visibility: t14,
1850
+ pointerEvents: "none"
1851
+ }, $[44] = t14, $[45] = t15) : t15 = $[45];
1852
+ let t16;
1853
+ $[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];
1854
+ let t17;
1855
+ $[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: {
1856
+ transform: expanded ? "rotate(90deg)" : void 0
1857
+ } }) }), $[51] = IconComponent, $[52] = expanded, $[53] = fontSize, $[54] = muted, $[55] = weight, $[56] = t17) : t17 = $[56];
1858
+ let t18;
1859
+ $[57] !== space || $[58] !== t15 || $[59] !== t16 || $[60] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { marginRight: space, style: t15, children: [
1860
+ t16,
1861
+ t17
1862
+ ] }), $[57] = space, $[58] = t15, $[59] = t16, $[60] = t17, $[61] = t18) : t18 = $[61];
1863
+ let t19;
1864
+ $[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];
1865
+ let t20;
1866
+ $[67] !== padding || $[68] !== t18 || $[69] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { padding, children: [
1867
+ t18,
1868
+ t19
1869
+ ] }), $[67] = padding, $[68] = t18, $[69] = t19, $[70] = t20) : t20 = $[70];
1870
+ const content2 = t20;
1871
+ if (href) {
1872
+ const t212 = selected ? "" : void 0;
1873
+ let t222;
1874
+ $[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];
1875
+ let t232;
1876
+ $[78] !== children || $[79] !== expanded ? (t232 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }), $[78] = children, $[79] = expanded, $[80] = t232) : t232 = $[80];
1877
+ let t242;
1878
+ $[81] !== contextValue || $[82] !== t232 ? (t242 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t232 }), $[81] = contextValue, $[82] = t232, $[83] = t242) : t242 = $[83];
1879
+ let t252;
1880
+ 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: [
1881
+ t222,
1882
+ t242
1883
+ ] }), $[84] = handleClick, $[85] = id, $[86] = itemKey, $[87] = restProps, $[88] = t212, $[89] = t222, $[90] = t242, $[91] = t252) : t252 = $[91], t252;
1884
+ }
1885
+ const t21 = selected ? "" : void 0;
1886
+ let t22;
1887
+ $[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];
1888
+ let t23;
1889
+ $[95] !== children || $[96] !== expanded ? (t23 = children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }), $[95] = children, $[96] = expanded, $[97] = t23) : t23 = $[97];
1890
+ let t24;
1891
+ $[98] !== contextValue || $[99] !== t23 ? (t24 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t23 }), $[98] = contextValue, $[99] = t23, $[100] = t24) : t24 = $[100];
1892
+ let t25;
1893
+ 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: [
1894
+ t22,
1895
+ t24
1896
+ ] }), $[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;
1396
1897
  }
1397
1898
  TreeItem.displayName = "TreeItem";
1398
1899
  exports.Arrow = _visualEditing.Arrow;