dara-core 1.25.1__py3-none-any.whl → 1.25.2__py3-none-any.whl

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.
@@ -14019,10 +14019,10 @@
14019
14019
  };
14020
14020
  }
14021
14021
  /*!
14022
- * tabbable 6.3.0
14022
+ * tabbable 6.4.0
14023
14023
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
14024
14024
  */
14025
- var candidateSelectors = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])", "a[href]:not([inert])", "button:not([inert])", "[tabindex]:not(slot):not([inert])", "audio[controls]:not([inert])", "video[controls]:not([inert])", '[contenteditable]:not([contenteditable="false"]):not([inert])', "details>summary:first-of-type:not([inert])", "details:not([inert])"];
14025
+ var candidateSelectors = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"];
14026
14026
  var candidateSelector = /* @__PURE__ */ candidateSelectors.join(",");
14027
14027
  var NoElement = typeof Element === "undefined";
14028
14028
  var matches = NoElement ? function() {
@@ -14040,7 +14040,9 @@
14040
14040
  }
14041
14041
  var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, "inert");
14042
14042
  var inert = inertAtt === "" || inertAtt === "true";
14043
- var result = inert || lookUp && node && _isInert(node.parentNode);
14043
+ var result = inert || lookUp && node && // closest does not exist on shadow roots, so we fall back to a manual
14044
+ // lookup upward, in case it is not defined.
14045
+ (typeof node.closest === "function" ? node.closest("[inert]") : _isInert(node.parentNode));
14044
14046
  return result;
14045
14047
  };
14046
14048
  var isContentEditable = function isContentEditable2(node) {
@@ -14274,10 +14276,7 @@
14274
14276
  return false;
14275
14277
  };
14276
14278
  var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) {
14277
- if (node.disabled || // we must do an inert look up to filter out any elements inside an inert ancestor
14278
- // because we're limited in the type of selectors we can use in JSDom (see related
14279
- // note related to `candidateSelectors`)
14280
- _isInert(node) || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
14279
+ if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus
14281
14280
  isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {
14282
14281
  return false;
14283
14282
  }
@@ -14391,6 +14390,62 @@
14391
14390
  }
14392
14391
  return coords;
14393
14392
  }
14393
+ async function detectOverflow$1(state, options) {
14394
+ var _await$platform$isEle;
14395
+ if (options === void 0) {
14396
+ options = {};
14397
+ }
14398
+ const {
14399
+ x,
14400
+ y,
14401
+ platform: platform2,
14402
+ rects,
14403
+ elements,
14404
+ strategy
14405
+ } = state;
14406
+ const {
14407
+ boundary = "clippingAncestors",
14408
+ rootBoundary = "viewport",
14409
+ elementContext = "floating",
14410
+ altBoundary = false,
14411
+ padding = 0
14412
+ } = evaluate(options, state);
14413
+ const paddingObject = getPaddingObject(padding);
14414
+ const altContext = elementContext === "floating" ? "reference" : "floating";
14415
+ const element = elements[altBoundary ? altContext : elementContext];
14416
+ const clippingClientRect = rectToClientRect$1(await platform2.getClippingRect({
14417
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
14418
+ boundary,
14419
+ rootBoundary,
14420
+ strategy
14421
+ }));
14422
+ const rect = elementContext === "floating" ? {
14423
+ x,
14424
+ y,
14425
+ width: rects.floating.width,
14426
+ height: rects.floating.height
14427
+ } : rects.reference;
14428
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
14429
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
14430
+ x: 1,
14431
+ y: 1
14432
+ } : {
14433
+ x: 1,
14434
+ y: 1
14435
+ };
14436
+ const elementClientRect = rectToClientRect$1(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
14437
+ elements,
14438
+ rect,
14439
+ offsetParent,
14440
+ strategy
14441
+ }) : rect);
14442
+ return {
14443
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
14444
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
14445
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
14446
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
14447
+ };
14448
+ }
14394
14449
  const computePosition$1 = async (reference2, floating, config2) => {
14395
14450
  const {
14396
14451
  placement = "bottom",
@@ -14413,6 +14468,7 @@
14413
14468
  let middlewareData = {};
14414
14469
  let resetCount = 0;
14415
14470
  for (let i2 = 0; i2 < validMiddleware.length; i2++) {
14471
+ var _platform$detectOverf;
14416
14472
  const {
14417
14473
  name,
14418
14474
  fn
@@ -14430,7 +14486,10 @@
14430
14486
  strategy,
14431
14487
  middlewareData,
14432
14488
  rects,
14433
- platform: platform2,
14489
+ platform: {
14490
+ ...platform2,
14491
+ detectOverflow: (_platform$detectOverf = platform2.detectOverflow) != null ? _platform$detectOverf : detectOverflow$1
14492
+ },
14434
14493
  elements: {
14435
14494
  reference: reference2,
14436
14495
  floating
@@ -14474,62 +14533,6 @@
14474
14533
  middlewareData
14475
14534
  };
14476
14535
  };
14477
- async function detectOverflow$1(state, options) {
14478
- var _await$platform$isEle;
14479
- if (options === void 0) {
14480
- options = {};
14481
- }
14482
- const {
14483
- x,
14484
- y,
14485
- platform: platform2,
14486
- rects,
14487
- elements,
14488
- strategy
14489
- } = state;
14490
- const {
14491
- boundary = "clippingAncestors",
14492
- rootBoundary = "viewport",
14493
- elementContext = "floating",
14494
- altBoundary = false,
14495
- padding = 0
14496
- } = evaluate(options, state);
14497
- const paddingObject = getPaddingObject(padding);
14498
- const altContext = elementContext === "floating" ? "reference" : "floating";
14499
- const element = elements[altBoundary ? altContext : elementContext];
14500
- const clippingClientRect = rectToClientRect$1(await platform2.getClippingRect({
14501
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
14502
- boundary,
14503
- rootBoundary,
14504
- strategy
14505
- }));
14506
- const rect = elementContext === "floating" ? {
14507
- x,
14508
- y,
14509
- width: rects.floating.width,
14510
- height: rects.floating.height
14511
- } : rects.reference;
14512
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
14513
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
14514
- x: 1,
14515
- y: 1
14516
- } : {
14517
- x: 1,
14518
- y: 1
14519
- };
14520
- const elementClientRect = rectToClientRect$1(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
14521
- elements,
14522
- rect,
14523
- offsetParent,
14524
- strategy
14525
- }) : rect);
14526
- return {
14527
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
14528
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
14529
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
14530
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
14531
- };
14532
- }
14533
14536
  const arrow$4 = (options) => ({
14534
14537
  name: "arrow",
14535
14538
  options,
@@ -14625,7 +14628,7 @@
14625
14628
  ...detectOverflowOptions
14626
14629
  } = evaluate(options, state);
14627
14630
  const placements$1$1 = alignment !== void 0 || allowedPlacements === placements$1 ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
14628
- const overflow = await detectOverflow$1(state, detectOverflowOptions);
14631
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
14629
14632
  const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
14630
14633
  const currentPlacement = placements$1$1[currentIndex];
14631
14634
  if (currentPlacement == null) {
@@ -14727,7 +14730,7 @@
14727
14730
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
14728
14731
  }
14729
14732
  const placements2 = [initialPlacement, ...fallbackPlacements];
14730
- const overflow = await detectOverflow$1(state, detectOverflowOptions);
14733
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
14731
14734
  const overflows = [];
14732
14735
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
14733
14736
  if (checkMainAxis) {
@@ -14876,7 +14879,8 @@
14876
14879
  const {
14877
14880
  x,
14878
14881
  y,
14879
- placement
14882
+ placement,
14883
+ platform: platform2
14880
14884
  } = state;
14881
14885
  const {
14882
14886
  mainAxis: checkMainAxis = true,
@@ -14899,7 +14903,7 @@
14899
14903
  x,
14900
14904
  y
14901
14905
  };
14902
- const overflow = await detectOverflow$1(state, detectOverflowOptions);
14906
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
14903
14907
  const crossAxis = getSideAxis(getSide(placement));
14904
14908
  const mainAxis = getOppositeAxis(crossAxis);
14905
14909
  let mainAxisCoord = coords[mainAxis];
@@ -14957,7 +14961,7 @@
14957
14961
  },
14958
14962
  ...detectOverflowOptions
14959
14963
  } = evaluate(options, state);
14960
- const overflow = await detectOverflow$1(state, detectOverflowOptions);
14964
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
14961
14965
  const side = getSide(placement);
14962
14966
  const alignment = getAlignment(placement);
14963
14967
  const isYAxis = getSideAxis(placement) === "y";
@@ -34706,20 +34710,6 @@
34706
34710
  requireRound();
34707
34711
  const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React$1.useLayoutEffect : () => {
34708
34712
  };
34709
- var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
34710
- const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = React$1["useInsertionEffect"]) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
34711
- function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
34712
- const ref = React$1.useRef(null);
34713
- $8ae05eaa5c114e9c$var$useEarlyEffect(() => {
34714
- ref.current = fn;
34715
- }, [
34716
- fn
34717
- ]);
34718
- return React$1.useCallback((...args) => {
34719
- const f = ref.current;
34720
- return f === null || f === void 0 ? void 0 : f(...args);
34721
- }, []);
34722
- }
34723
34713
  const $b5e257d569688ac6$var$defaultContext = {
34724
34714
  prefix: String(Math.round(Math.random() * 1e10)),
34725
34715
  current: 0
@@ -34997,7 +34987,7 @@
34997
34987
  function $65484d02dcb7eb3e$export$457c3d6518dd4c6f(props, opts = {}) {
34998
34988
  let { labelable, isLink, global: global2, events = global2, propNames } = opts;
34999
34989
  let filteredProps = {};
35000
- for (const prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global2 && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && $65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith("Capture") && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7)) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
34990
+ for (const prop in props) if (Object.prototype.hasOwnProperty.call(props, prop) && ($65484d02dcb7eb3e$var$DOMPropNames.has(prop) || labelable && $65484d02dcb7eb3e$var$labelablePropNames.has(prop) || isLink && $65484d02dcb7eb3e$var$linkPropNames.has(prop) || global2 && $65484d02dcb7eb3e$var$globalAttrs.has(prop) || events && ($65484d02dcb7eb3e$var$globalEvents.has(prop) || prop.endsWith("Capture") && $65484d02dcb7eb3e$var$globalEvents.has(prop.slice(0, -7))) || (propNames === null || propNames === void 0 ? void 0 : propNames.has(prop)) || $65484d02dcb7eb3e$var$propRe.test(prop))) filteredProps[prop] = props[prop];
35001
34991
  return filteredProps;
35002
34992
  }
35003
34993
  function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
@@ -35082,9 +35072,46 @@
35082
35072
  const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
35083
35073
  return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
35084
35074
  });
35075
+ const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
35076
+ return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
35077
+ });
35078
+ const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
35079
+ return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
35080
+ });
35085
35081
  const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
35086
35082
  return $c87311424ea30a05$var$testUserAgent(/Android/i);
35087
35083
  });
35084
+ const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
35085
+ return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
35086
+ });
35087
+ function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = true) {
35088
+ var _window_event_type, _window_event;
35089
+ let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
35090
+ if ($c87311424ea30a05$export$b7d78993b74f766d() && ((_window_event = window.event) === null || _window_event === void 0 ? void 0 : (_window_event_type = _window_event.type) === null || _window_event_type === void 0 ? void 0 : _window_event_type.startsWith("key")) && target.target === "_blank") {
35091
+ if ($c87311424ea30a05$export$9ac100e40613ea10()) metaKey = true;
35092
+ else ctrlKey = true;
35093
+ }
35094
+ let event = $c87311424ea30a05$export$78551043582a6a98() && $c87311424ea30a05$export$9ac100e40613ea10() && !$c87311424ea30a05$export$7bef049ce92e4224() && true ? new KeyboardEvent("keydown", {
35095
+ keyIdentifier: "Enter",
35096
+ metaKey,
35097
+ ctrlKey,
35098
+ altKey,
35099
+ shiftKey
35100
+ }) : new MouseEvent("click", {
35101
+ metaKey,
35102
+ ctrlKey,
35103
+ altKey,
35104
+ shiftKey,
35105
+ detail: 1,
35106
+ bubbles: true,
35107
+ cancelable: true
35108
+ });
35109
+ $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening;
35110
+ $7215afc6de606d6b$export$de79e2c695e052f3(target);
35111
+ target.dispatchEvent(event);
35112
+ $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
35113
+ }
35114
+ $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = false;
35088
35115
  let $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map();
35089
35116
  let $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
35090
35117
  function $bbed8b41f857bcc0$var$setupGlobalEvents() {
@@ -35230,6 +35257,20 @@
35230
35257
  refEffect
35231
35258
  ]);
35232
35259
  }
35260
+ var $8ae05eaa5c114e9c$var$_React_useInsertionEffect;
35261
+ const $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = React$1["useInsertionEffect"]) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
35262
+ function $8ae05eaa5c114e9c$export$7f54fc3180508a52(fn) {
35263
+ const ref = React$1.useRef(null);
35264
+ $8ae05eaa5c114e9c$var$useEarlyEffect(() => {
35265
+ ref.current = fn;
35266
+ }, [
35267
+ fn
35268
+ ]);
35269
+ return React$1.useCallback((...args) => {
35270
+ const f = ref.current;
35271
+ return f === null || f === void 0 ? void 0 : f(...args);
35272
+ }, []);
35273
+ }
35233
35274
  function $e7801be82b4b2a53$export$4debdb1a3f0fa79e(context, ref) {
35234
35275
  $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
35235
35276
  if (context && context.ref && ref) {
@@ -35257,12 +35298,15 @@
35257
35298
  form === null || form === void 0 ? void 0 : form.removeEventListener("reset", handleReset2);
35258
35299
  };
35259
35300
  }, [
35260
- ref,
35261
- handleReset2
35301
+ ref
35262
35302
  ]);
35263
35303
  }
35304
+ var $458b0a5536c1a7cf$var$_React_useInsertionEffect;
35305
+ const $458b0a5536c1a7cf$var$useEarlyEffect = typeof document !== "undefined" ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = React$1["useInsertionEffect"]) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : React$1.useLayoutEffect : () => {
35306
+ };
35264
35307
  function $458b0a5536c1a7cf$export$40bfa8c7b0832715(value, defaultValue, onChange2) {
35265
35308
  let [stateValue, setStateValue] = React$1.useState(value || defaultValue);
35309
+ let valueRef = React$1.useRef(stateValue);
35266
35310
  let isControlledRef = React$1.useRef(value !== void 0);
35267
35311
  let isControlled = value !== void 0;
35268
35312
  React$1.useEffect(() => {
@@ -35272,29 +35316,19 @@
35272
35316
  isControlled
35273
35317
  ]);
35274
35318
  let currentValue = isControlled ? value : stateValue;
35319
+ $458b0a5536c1a7cf$var$useEarlyEffect(() => {
35320
+ valueRef.current = currentValue;
35321
+ });
35322
+ let [, forceUpdate] = React$1.useReducer(() => ({}), {});
35275
35323
  let setValue = React$1.useCallback((value2, ...args) => {
35276
- let onChangeCaller = (value3, ...onChangeArgs) => {
35277
- if (onChange2) {
35278
- if (!Object.is(currentValue, value3)) onChange2(value3, ...onChangeArgs);
35279
- }
35280
- if (!isControlled)
35281
- currentValue = value3;
35282
- };
35283
- if (typeof value2 === "function") {
35284
- let updateFunction = (oldValue, ...functionArgs) => {
35285
- let interceptedValue = value2(isControlled ? currentValue : oldValue, ...functionArgs);
35286
- onChangeCaller(interceptedValue, ...args);
35287
- if (!isControlled) return interceptedValue;
35288
- return oldValue;
35289
- };
35290
- setStateValue(updateFunction);
35291
- } else {
35292
- if (!isControlled) setStateValue(value2);
35293
- onChangeCaller(value2, ...args);
35324
+ let newValue = typeof value2 === "function" ? value2(valueRef.current) : value2;
35325
+ if (!Object.is(valueRef.current, newValue)) {
35326
+ valueRef.current = newValue;
35327
+ setStateValue(newValue);
35328
+ forceUpdate();
35329
+ onChange2 === null || onChange2 === void 0 ? void 0 : onChange2(newValue, ...args);
35294
35330
  }
35295
35331
  }, [
35296
- isControlled,
35297
- currentValue,
35298
35332
  onChange2
35299
35333
  ]);
35300
35334
  return [
@@ -35524,10 +35558,13 @@
35524
35558
  if ($1e5a04cdaf7d1af8$var$listeners.size === 0) window.removeEventListener("languagechange", $1e5a04cdaf7d1af8$var$updateLocale);
35525
35559
  };
35526
35560
  }, []);
35527
- if (isSSR2) return {
35528
- locale: "en-US",
35529
- direction: "ltr"
35530
- };
35561
+ if (isSSR2) {
35562
+ let locale2 = typeof window !== "undefined" && window[$1e5a04cdaf7d1af8$var$localeSymbol];
35563
+ return {
35564
+ locale: locale2 || "en-US",
35565
+ direction: "ltr"
35566
+ };
35567
+ }
35531
35568
  return defaultLocale;
35532
35569
  }
35533
35570
  const $18f2051aff69b9bf$var$I18nContext = /* @__PURE__ */ React$1.createContext(null);
@@ -35711,9 +35748,6 @@
35711
35748
  }
35712
35749
  };
35713
35750
  }, []);
35714
- let dispatchBlur = $8ae05eaa5c114e9c$export$7f54fc3180508a52((e2) => {
35715
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(e2);
35716
- });
35717
35751
  return React$1.useCallback((e2) => {
35718
35752
  if (e2.target instanceof HTMLButtonElement || e2.target instanceof HTMLInputElement || e2.target instanceof HTMLTextAreaElement || e2.target instanceof HTMLSelectElement) {
35719
35753
  stateRef.current.isFocused = true;
@@ -35722,7 +35756,7 @@
35722
35756
  stateRef.current.isFocused = false;
35723
35757
  if (target.disabled) {
35724
35758
  let event = $8a9cb279dc87e130$export$525bc4921d56d4a(e3);
35725
- dispatchBlur(event);
35759
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
35726
35760
  }
35727
35761
  if (stateRef.current.observer) {
35728
35762
  stateRef.current.observer.disconnect();
@@ -35754,7 +35788,7 @@
35754
35788
  });
35755
35789
  }
35756
35790
  }, [
35757
- dispatchBlur
35791
+ onBlur
35758
35792
  ]);
35759
35793
  }
35760
35794
  let $8a9cb279dc87e130$export$fda7da73ab5d4c48 = false;
@@ -35816,20 +35850,21 @@
35816
35850
  }
35817
35851
  function $507fabe10e71c6fb$var$handleKeyboardEvent(e2) {
35818
35852
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
35819
- if ($507fabe10e71c6fb$var$isValidKey(e2)) {
35853
+ if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $507fabe10e71c6fb$var$isValidKey(e2)) {
35820
35854
  $507fabe10e71c6fb$var$currentModality = "keyboard";
35821
35855
  $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e2);
35822
35856
  }
35823
35857
  }
35824
35858
  function $507fabe10e71c6fb$var$handlePointerEvent(e2) {
35825
35859
  $507fabe10e71c6fb$var$currentModality = "pointer";
35860
+ "pointerType" in e2 ? e2.pointerType : "mouse";
35826
35861
  if (e2.type === "mousedown" || e2.type === "pointerdown") {
35827
35862
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
35828
35863
  $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e2);
35829
35864
  }
35830
35865
  }
35831
35866
  function $507fabe10e71c6fb$var$handleClickEvent(e2) {
35832
- if ($6a7db85432448f7f$export$60278871457622de(e2)) {
35867
+ if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening && $6a7db85432448f7f$export$60278871457622de(e2)) {
35833
35868
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
35834
35869
  $507fabe10e71c6fb$var$currentModality = "virtual";
35835
35870
  }
@@ -35951,11 +35986,11 @@
35951
35986
  }
35952
35987
  function $3ad3f6e1647bc98d$export$80f3e147d781571c(element) {
35953
35988
  const ownerDocument = $431fbd86ca7dc216$export$b204af158042fbac(element);
35954
- const activeElement2 = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
35955
35989
  if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "virtual") {
35956
- let lastFocusedElement = activeElement2;
35990
+ let lastFocusedElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
35957
35991
  $bbed8b41f857bcc0$export$24490316f764c430(() => {
35958
- if ($d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument) === lastFocusedElement && element.isConnected) $7215afc6de606d6b$export$de79e2c695e052f3(element);
35992
+ const activeElement2 = $d4ee10de306f2510$export$cd4e5573fbe2b576(ownerDocument);
35993
+ if ((activeElement2 === lastFocusedElement || activeElement2 === ownerDocument.body) && element.isConnected) $7215afc6de606d6b$export$de79e2c695e052f3(element);
35959
35994
  });
35960
35995
  } else $7215afc6de606d6b$export$de79e2c695e052f3(element);
35961
35996
  }
@@ -36232,7 +36267,7 @@
36232
36267
  id: null
36233
36268
  });
36234
36269
  let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
36235
- let move = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType, deltaX, deltaY) => {
36270
+ let move = React$1.useCallback((originalEvent, pointerType, deltaX, deltaY) => {
36236
36271
  if (deltaX === 0 && deltaY === 0) return;
36237
36272
  if (!state.current.didMove) {
36238
36273
  state.current.didMove = true;
@@ -36255,8 +36290,13 @@
36255
36290
  ctrlKey: originalEvent.ctrlKey,
36256
36291
  altKey: originalEvent.altKey
36257
36292
  });
36258
- });
36259
- let end2 = $8ae05eaa5c114e9c$export$7f54fc3180508a52((originalEvent, pointerType) => {
36293
+ }, [
36294
+ onMoveStart,
36295
+ onMove,
36296
+ state
36297
+ ]);
36298
+ let moveEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(move);
36299
+ let end2 = React$1.useCallback((originalEvent, pointerType) => {
36260
36300
  $14c0b72509d70225$export$b0d6fa1ab32e3295();
36261
36301
  if (state.current.didMove) onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd({
36262
36302
  type: "moveend",
@@ -36266,20 +36306,20 @@
36266
36306
  ctrlKey: originalEvent.ctrlKey,
36267
36307
  altKey: originalEvent.altKey
36268
36308
  });
36269
- });
36270
- let moveProps = React$1.useMemo(() => {
36271
- let moveProps2 = {};
36272
- let start2 = () => {
36273
- $14c0b72509d70225$export$16a4697467175487();
36274
- state.current.didMove = false;
36275
- };
36276
- {
36309
+ }, [
36310
+ onMoveEnd,
36311
+ state
36312
+ ]);
36313
+ let endEvent = $8ae05eaa5c114e9c$export$7f54fc3180508a52(end2);
36314
+ let [pointerDown, setPointerDown] = React$1.useState(null);
36315
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
36316
+ if (pointerDown === "pointer") {
36277
36317
  let onPointerMove = (e2) => {
36278
36318
  if (e2.pointerId === state.current.id) {
36279
36319
  var _state_current_lastPosition, _state_current_lastPosition1;
36280
36320
  let pointerType = e2.pointerType || "mouse";
36281
36321
  var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
36282
- move(e2, pointerType, e2.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e2.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
36322
+ moveEvent(e2, pointerType, e2.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e2.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
36283
36323
  state.current.lastPosition = {
36284
36324
  pageX: e2.pageX,
36285
36325
  pageY: e2.pageY
@@ -36289,29 +36329,47 @@
36289
36329
  let onPointerUp = (e2) => {
36290
36330
  if (e2.pointerId === state.current.id) {
36291
36331
  let pointerType = e2.pointerType || "mouse";
36292
- end2(e2, pointerType);
36332
+ endEvent(e2, pointerType);
36293
36333
  state.current.id = null;
36294
36334
  removeGlobalListener(window, "pointermove", onPointerMove, false);
36295
36335
  removeGlobalListener(window, "pointerup", onPointerUp, false);
36296
36336
  removeGlobalListener(window, "pointercancel", onPointerUp, false);
36337
+ setPointerDown(null);
36297
36338
  }
36298
36339
  };
36299
- moveProps2.onPointerDown = (e2) => {
36300
- if (e2.button === 0 && state.current.id == null) {
36301
- start2();
36302
- e2.stopPropagation();
36303
- e2.preventDefault();
36304
- state.current.lastPosition = {
36305
- pageX: e2.pageX,
36306
- pageY: e2.pageY
36307
- };
36308
- state.current.id = e2.pointerId;
36309
- addGlobalListener(window, "pointermove", onPointerMove, false);
36310
- addGlobalListener(window, "pointerup", onPointerUp, false);
36311
- addGlobalListener(window, "pointercancel", onPointerUp, false);
36312
- }
36340
+ addGlobalListener(window, "pointermove", onPointerMove, false);
36341
+ addGlobalListener(window, "pointerup", onPointerUp, false);
36342
+ addGlobalListener(window, "pointercancel", onPointerUp, false);
36343
+ return () => {
36344
+ removeGlobalListener(window, "pointermove", onPointerMove, false);
36345
+ removeGlobalListener(window, "pointerup", onPointerUp, false);
36346
+ removeGlobalListener(window, "pointercancel", onPointerUp, false);
36313
36347
  };
36314
36348
  }
36349
+ }, [
36350
+ pointerDown,
36351
+ addGlobalListener,
36352
+ removeGlobalListener
36353
+ ]);
36354
+ let moveProps = React$1.useMemo(() => {
36355
+ let moveProps2 = {};
36356
+ let start2 = () => {
36357
+ $14c0b72509d70225$export$16a4697467175487();
36358
+ state.current.didMove = false;
36359
+ };
36360
+ moveProps2.onPointerDown = (e2) => {
36361
+ if (e2.button === 0 && state.current.id == null) {
36362
+ start2();
36363
+ e2.stopPropagation();
36364
+ e2.preventDefault();
36365
+ state.current.lastPosition = {
36366
+ pageX: e2.pageX,
36367
+ pageY: e2.pageY
36368
+ };
36369
+ state.current.id = e2.pointerId;
36370
+ setPointerDown("pointer");
36371
+ }
36372
+ };
36315
36373
  let triggerKeyboardMove = (e2, deltaX, deltaY) => {
36316
36374
  start2();
36317
36375
  move(e2, "keyboard", deltaX, deltaY);
@@ -36348,8 +36406,6 @@
36348
36406
  return moveProps2;
36349
36407
  }, [
36350
36408
  state,
36351
- addGlobalListener,
36352
- removeGlobalListener,
36353
36409
  move,
36354
36410
  end2
36355
36411
  ]);
@@ -61666,12 +61722,19 @@ import(${JSON.stringify(manifest.entry.module)});`;
61666
61722
  if (hasRequiredDist) return dist;
61667
61723
  hasRequiredDist = 1;
61668
61724
  Object.defineProperty(dist, "__esModule", { value: true });
61669
- dist.parse = parse2;
61670
- dist.serialize = serialize;
61725
+ dist.parseCookie = parseCookie;
61726
+ dist.parse = parseCookie;
61727
+ dist.stringifyCookie = stringifyCookie;
61728
+ dist.stringifySetCookie = stringifySetCookie;
61729
+ dist.serialize = stringifySetCookie;
61730
+ dist.parseSetCookie = parseSetCookie;
61731
+ dist.stringifySetCookie = stringifySetCookie;
61732
+ dist.serialize = stringifySetCookie;
61671
61733
  const cookieNameRegExp = /^[\u0021-\u003A\u003C\u003E-\u007E]+$/;
61672
61734
  const cookieValueRegExp = /^[\u0021-\u003A\u003C-\u007E]*$/;
61673
61735
  const domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;
61674
61736
  const pathValueRegExp = /^[\u0020-\u003A\u003D-\u007E]*$/;
61737
+ const maxAgeRegExp = /^-?\d+$/;
61675
61738
  const __toString = Object.prototype.toString;
61676
61739
  const NullObject = /* @__PURE__ */ (() => {
61677
61740
  const C = function() {
@@ -61679,7 +61742,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
61679
61742
  C.prototype = /* @__PURE__ */ Object.create(null);
61680
61743
  return C;
61681
61744
  })();
61682
- function parse2(str, options) {
61745
+ function parseCookie(str, options) {
61683
61746
  const obj = new NullObject();
61684
61747
  const len = str.length;
61685
61748
  if (len < 2)
@@ -61687,91 +61750,87 @@ import(${JSON.stringify(manifest.entry.module)});`;
61687
61750
  const dec = options?.decode || decode2;
61688
61751
  let index2 = 0;
61689
61752
  do {
61690
- const eqIdx = str.indexOf("=", index2);
61753
+ const eqIdx = eqIndex(str, index2, len);
61691
61754
  if (eqIdx === -1)
61692
61755
  break;
61693
- const colonIdx = str.indexOf(";", index2);
61694
- const endIdx = colonIdx === -1 ? len : colonIdx;
61756
+ const endIdx = endIndex(str, index2, len);
61695
61757
  if (eqIdx > endIdx) {
61696
61758
  index2 = str.lastIndexOf(";", eqIdx - 1) + 1;
61697
61759
  continue;
61698
61760
  }
61699
- const keyStartIdx = startIndex(str, index2, eqIdx);
61700
- const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);
61701
- const key = str.slice(keyStartIdx, keyEndIdx);
61761
+ const key = valueSlice(str, index2, eqIdx);
61702
61762
  if (obj[key] === void 0) {
61703
- let valStartIdx = startIndex(str, eqIdx + 1, endIdx);
61704
- let valEndIdx = endIndex(str, endIdx, valStartIdx);
61705
- const value = dec(str.slice(valStartIdx, valEndIdx));
61706
- obj[key] = value;
61763
+ obj[key] = dec(valueSlice(str, eqIdx + 1, endIdx));
61707
61764
  }
61708
61765
  index2 = endIdx + 1;
61709
61766
  } while (index2 < len);
61710
61767
  return obj;
61711
61768
  }
61712
- function startIndex(str, index2, max2) {
61713
- do {
61714
- const code = str.charCodeAt(index2);
61715
- if (code !== 32 && code !== 9)
61716
- return index2;
61717
- } while (++index2 < max2);
61718
- return max2;
61719
- }
61720
- function endIndex(str, index2, min2) {
61721
- while (index2 > min2) {
61722
- const code = str.charCodeAt(--index2);
61723
- if (code !== 32 && code !== 9)
61724
- return index2 + 1;
61769
+ function stringifyCookie(cookie, options) {
61770
+ const enc = options?.encode || encodeURIComponent;
61771
+ const cookieStrings = [];
61772
+ for (const name of Object.keys(cookie)) {
61773
+ const val = cookie[name];
61774
+ if (val === void 0)
61775
+ continue;
61776
+ if (!cookieNameRegExp.test(name)) {
61777
+ throw new TypeError(`cookie name is invalid: ${name}`);
61778
+ }
61779
+ const value = enc(val);
61780
+ if (!cookieValueRegExp.test(value)) {
61781
+ throw new TypeError(`cookie val is invalid: ${val}`);
61782
+ }
61783
+ cookieStrings.push(`${name}=${value}`);
61725
61784
  }
61726
- return min2;
61785
+ return cookieStrings.join("; ");
61727
61786
  }
61728
- function serialize(name, val, options) {
61787
+ function stringifySetCookie(_name, _val, _opts) {
61788
+ const cookie = typeof _name === "object" ? _name : { ..._opts, name: _name, value: String(_val) };
61789
+ const options = typeof _val === "object" ? _val : _opts;
61729
61790
  const enc = options?.encode || encodeURIComponent;
61730
- if (!cookieNameRegExp.test(name)) {
61731
- throw new TypeError(`argument name is invalid: ${name}`);
61791
+ if (!cookieNameRegExp.test(cookie.name)) {
61792
+ throw new TypeError(`argument name is invalid: ${cookie.name}`);
61732
61793
  }
61733
- const value = enc(val);
61794
+ const value = cookie.value ? enc(cookie.value) : "";
61734
61795
  if (!cookieValueRegExp.test(value)) {
61735
- throw new TypeError(`argument val is invalid: ${val}`);
61796
+ throw new TypeError(`argument val is invalid: ${cookie.value}`);
61736
61797
  }
61737
- let str = name + "=" + value;
61738
- if (!options)
61739
- return str;
61740
- if (options.maxAge !== void 0) {
61741
- if (!Number.isInteger(options.maxAge)) {
61742
- throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);
61798
+ let str = cookie.name + "=" + value;
61799
+ if (cookie.maxAge !== void 0) {
61800
+ if (!Number.isInteger(cookie.maxAge)) {
61801
+ throw new TypeError(`option maxAge is invalid: ${cookie.maxAge}`);
61743
61802
  }
61744
- str += "; Max-Age=" + options.maxAge;
61803
+ str += "; Max-Age=" + cookie.maxAge;
61745
61804
  }
61746
- if (options.domain) {
61747
- if (!domainValueRegExp.test(options.domain)) {
61748
- throw new TypeError(`option domain is invalid: ${options.domain}`);
61805
+ if (cookie.domain) {
61806
+ if (!domainValueRegExp.test(cookie.domain)) {
61807
+ throw new TypeError(`option domain is invalid: ${cookie.domain}`);
61749
61808
  }
61750
- str += "; Domain=" + options.domain;
61809
+ str += "; Domain=" + cookie.domain;
61751
61810
  }
61752
- if (options.path) {
61753
- if (!pathValueRegExp.test(options.path)) {
61754
- throw new TypeError(`option path is invalid: ${options.path}`);
61811
+ if (cookie.path) {
61812
+ if (!pathValueRegExp.test(cookie.path)) {
61813
+ throw new TypeError(`option path is invalid: ${cookie.path}`);
61755
61814
  }
61756
- str += "; Path=" + options.path;
61815
+ str += "; Path=" + cookie.path;
61757
61816
  }
61758
- if (options.expires) {
61759
- if (!isDate2(options.expires) || !Number.isFinite(options.expires.valueOf())) {
61760
- throw new TypeError(`option expires is invalid: ${options.expires}`);
61817
+ if (cookie.expires) {
61818
+ if (!isDate2(cookie.expires) || !Number.isFinite(cookie.expires.valueOf())) {
61819
+ throw new TypeError(`option expires is invalid: ${cookie.expires}`);
61761
61820
  }
61762
- str += "; Expires=" + options.expires.toUTCString();
61821
+ str += "; Expires=" + cookie.expires.toUTCString();
61763
61822
  }
61764
- if (options.httpOnly) {
61823
+ if (cookie.httpOnly) {
61765
61824
  str += "; HttpOnly";
61766
61825
  }
61767
- if (options.secure) {
61826
+ if (cookie.secure) {
61768
61827
  str += "; Secure";
61769
61828
  }
61770
- if (options.partitioned) {
61829
+ if (cookie.partitioned) {
61771
61830
  str += "; Partitioned";
61772
61831
  }
61773
- if (options.priority) {
61774
- const priority = typeof options.priority === "string" ? options.priority.toLowerCase() : void 0;
61832
+ if (cookie.priority) {
61833
+ const priority = typeof cookie.priority === "string" ? cookie.priority.toLowerCase() : void 0;
61775
61834
  switch (priority) {
61776
61835
  case "low":
61777
61836
  str += "; Priority=Low";
@@ -61783,11 +61842,11 @@ import(${JSON.stringify(manifest.entry.module)});`;
61783
61842
  str += "; Priority=High";
61784
61843
  break;
61785
61844
  default:
61786
- throw new TypeError(`option priority is invalid: ${options.priority}`);
61845
+ throw new TypeError(`option priority is invalid: ${cookie.priority}`);
61787
61846
  }
61788
61847
  }
61789
- if (options.sameSite) {
61790
- const sameSite = typeof options.sameSite === "string" ? options.sameSite.toLowerCase() : options.sameSite;
61848
+ if (cookie.sameSite) {
61849
+ const sameSite = typeof cookie.sameSite === "string" ? cookie.sameSite.toLowerCase() : cookie.sameSite;
61791
61850
  switch (sameSite) {
61792
61851
  case true:
61793
61852
  case "strict":
@@ -61800,11 +61859,98 @@ import(${JSON.stringify(manifest.entry.module)});`;
61800
61859
  str += "; SameSite=None";
61801
61860
  break;
61802
61861
  default:
61803
- throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);
61862
+ throw new TypeError(`option sameSite is invalid: ${cookie.sameSite}`);
61804
61863
  }
61805
61864
  }
61806
61865
  return str;
61807
61866
  }
61867
+ function parseSetCookie(str, options) {
61868
+ const dec = options?.decode || decode2;
61869
+ const len = str.length;
61870
+ const endIdx = endIndex(str, 0, len);
61871
+ const eqIdx = eqIndex(str, 0, endIdx);
61872
+ const setCookie2 = eqIdx === -1 ? { name: "", value: dec(valueSlice(str, 0, endIdx)) } : {
61873
+ name: valueSlice(str, 0, eqIdx),
61874
+ value: dec(valueSlice(str, eqIdx + 1, endIdx))
61875
+ };
61876
+ let index2 = endIdx + 1;
61877
+ while (index2 < len) {
61878
+ const endIdx2 = endIndex(str, index2, len);
61879
+ const eqIdx2 = eqIndex(str, index2, endIdx2);
61880
+ const attr2 = eqIdx2 === -1 ? valueSlice(str, index2, endIdx2) : valueSlice(str, index2, eqIdx2);
61881
+ const val = eqIdx2 === -1 ? void 0 : valueSlice(str, eqIdx2 + 1, endIdx2);
61882
+ switch (attr2.toLowerCase()) {
61883
+ case "httponly":
61884
+ setCookie2.httpOnly = true;
61885
+ break;
61886
+ case "secure":
61887
+ setCookie2.secure = true;
61888
+ break;
61889
+ case "partitioned":
61890
+ setCookie2.partitioned = true;
61891
+ break;
61892
+ case "domain":
61893
+ setCookie2.domain = val;
61894
+ break;
61895
+ case "path":
61896
+ setCookie2.path = val;
61897
+ break;
61898
+ case "max-age":
61899
+ if (val && maxAgeRegExp.test(val))
61900
+ setCookie2.maxAge = Number(val);
61901
+ break;
61902
+ case "expires":
61903
+ if (!val)
61904
+ break;
61905
+ const date2 = new Date(val);
61906
+ if (Number.isFinite(date2.valueOf()))
61907
+ setCookie2.expires = date2;
61908
+ break;
61909
+ case "priority":
61910
+ if (!val)
61911
+ break;
61912
+ const priority = val.toLowerCase();
61913
+ if (priority === "low" || priority === "medium" || priority === "high") {
61914
+ setCookie2.priority = priority;
61915
+ }
61916
+ break;
61917
+ case "samesite":
61918
+ if (!val)
61919
+ break;
61920
+ const sameSite = val.toLowerCase();
61921
+ if (sameSite === "lax" || sameSite === "strict" || sameSite === "none") {
61922
+ setCookie2.sameSite = sameSite;
61923
+ }
61924
+ break;
61925
+ }
61926
+ index2 = endIdx2 + 1;
61927
+ }
61928
+ return setCookie2;
61929
+ }
61930
+ function endIndex(str, min2, len) {
61931
+ const index2 = str.indexOf(";", min2);
61932
+ return index2 === -1 ? len : index2;
61933
+ }
61934
+ function eqIndex(str, min2, max2) {
61935
+ const index2 = str.indexOf("=", min2);
61936
+ return index2 < max2 ? index2 : -1;
61937
+ }
61938
+ function valueSlice(str, min2, max2) {
61939
+ let start2 = min2;
61940
+ let end2 = max2;
61941
+ do {
61942
+ const code = str.charCodeAt(start2);
61943
+ if (code !== 32 && code !== 9)
61944
+ break;
61945
+ } while (++start2 < end2);
61946
+ while (end2 > start2) {
61947
+ const code = str.charCodeAt(end2 - 1);
61948
+ if (code !== 32 && code !== 9)
61949
+ break;
61950
+ end2--;
61951
+ }
61952
+ return str.slice(start2, end2);
61953
+ }
61808
61954
  function decode2(str) {
61809
61955
  if (str.indexOf("%") === -1)
61810
61956
  return str;
@@ -61819,7 +61965,7 @@ import(${JSON.stringify(manifest.entry.module)});`;
61819
61965
  }
61820
61966
  return dist;
61821
61967
  }
61822
- var distExports = requireDist();
61968
+ var distExports = /* @__PURE__ */ requireDist();
61823
61969
  var setCookie = { exports: {} };
61824
61970
  var hasRequiredSetCookie;
61825
61971
  function requireSetCookie() {
@@ -64424,6 +64570,71 @@ ${String(error)}`;
64424
64570
  }, [bus, onEvent]);
64425
64571
  return /* @__PURE__ */ React__namespace.createElement(EventBusContext.Provider, { value: bus }, children);
64426
64572
  }
64573
+ function findStreamVariables(variable) {
64574
+ const streams = [];
64575
+ const visited = /* @__PURE__ */ new Set();
64576
+ function walk(v) {
64577
+ if (!isVariable(v)) {
64578
+ return;
64579
+ }
64580
+ if (visited.has(v.uid)) {
64581
+ return;
64582
+ }
64583
+ visited.add(v.uid);
64584
+ if (isStreamVariable(v)) {
64585
+ streams.push(v);
64586
+ if (v.variables && Array.isArray(v.variables)) {
64587
+ v.variables.forEach(walk);
64588
+ }
64589
+ return;
64590
+ }
64591
+ if (isDerivedVariable(v)) {
64592
+ if (v.variables && Array.isArray(v.variables)) {
64593
+ v.variables.forEach(walk);
64594
+ }
64595
+ return;
64596
+ }
64597
+ if (isSwitchVariable(v)) {
64598
+ if (isVariable(v.value)) {
64599
+ walk(v.value);
64600
+ } else if (isCondition(v.value)) {
64601
+ walk(v.value.variable);
64602
+ }
64603
+ if (v.value_map && typeof v.value_map === "object") {
64604
+ Object.values(v.value_map).forEach(walk);
64605
+ }
64606
+ if (isVariable(v.default)) {
64607
+ walk(v.default);
64608
+ }
64609
+ return;
64610
+ }
64611
+ if (isStateVariable(v)) {
64612
+ walk(v.parent_variable);
64613
+ return;
64614
+ }
64615
+ if ("default" in v && isVariable(v.default)) {
64616
+ walk(v.default);
64617
+ }
64618
+ }
64619
+ walk(variable);
64620
+ return streams;
64621
+ }
64622
+ function findStreamVariablesInArray(variables) {
64623
+ const allStreams = [];
64624
+ const seenUids = /* @__PURE__ */ new Set();
64625
+ for (const v of variables) {
64626
+ if (isVariable(v)) {
64627
+ const streams = findStreamVariables(v);
64628
+ for (const stream of streams) {
64629
+ if (!seenUids.has(stream.uid)) {
64630
+ seenUids.add(stream.uid);
64631
+ allStreams.push(stream);
64632
+ }
64633
+ }
64634
+ }
64635
+ }
64636
+ return allStreams;
64637
+ }
64427
64638
  class StateSynchronizer {
64428
64639
  #observers;
64429
64640
  constructor() {
@@ -70948,6 +71159,138 @@ ${String(error)}`;
70948
71159
  });
70949
71160
  var getExports = requireGet();
70950
71161
  const get = /* @__PURE__ */ getDefaultExportFromCjs(getExports);
71162
+ const PAUSE_DEBOUNCE_MS = 1500;
71163
+ const ORPHAN_TIMEOUT_MS = 5e3;
71164
+ function createSubscriptionKey(uid2, extras) {
71165
+ return `${uid2}::${JSON.stringify(extras)}`;
71166
+ }
71167
+ const streamUsage = /* @__PURE__ */ new Map();
71168
+ function getOrCreateUsage(key) {
71169
+ let usage = streamUsage.get(key);
71170
+ if (!usage) {
71171
+ usage = { count: 0, connections: /* @__PURE__ */ new Map() };
71172
+ streamUsage.set(key, usage);
71173
+ }
71174
+ return usage;
71175
+ }
71176
+ function cleanupConnections(key) {
71177
+ const usage = streamUsage.get(key);
71178
+ if (!usage) {
71179
+ return;
71180
+ }
71181
+ if (usage.count > 0) {
71182
+ return;
71183
+ }
71184
+ for (const [, conn] of usage.connections) {
71185
+ if (conn.active) {
71186
+ if (conn.controller) {
71187
+ conn.controller.abort();
71188
+ }
71189
+ conn.cleanup = void 0;
71190
+ conn.controller = void 0;
71191
+ conn.active = false;
71192
+ }
71193
+ }
71194
+ }
71195
+ function restartConnections(key) {
71196
+ const usage = streamUsage.get(key);
71197
+ if (!usage) {
71198
+ return;
71199
+ }
71200
+ for (const [atomKey, conn] of usage.connections) {
71201
+ if (!conn.active) {
71202
+ try {
71203
+ const { cleanup, controller } = conn.start();
71204
+ conn.cleanup = cleanup;
71205
+ conn.controller = controller;
71206
+ conn.active = true;
71207
+ } catch (err2) {
71208
+ console.error(`Failed to restart stream connection ${atomKey}:`, err2);
71209
+ }
71210
+ }
71211
+ }
71212
+ }
71213
+ function abortExistingConnection(atomKey) {
71214
+ for (const usage of streamUsage.values()) {
71215
+ const conn = usage.connections.get(atomKey);
71216
+ if (conn?.active && conn.controller) {
71217
+ conn.controller.abort();
71218
+ conn.active = false;
71219
+ conn.cleanup = void 0;
71220
+ conn.controller = void 0;
71221
+ return true;
71222
+ }
71223
+ }
71224
+ return false;
71225
+ }
71226
+ function registerStreamConnection(uid2, extras, atomKey, start2) {
71227
+ const key = createSubscriptionKey(uid2, extras);
71228
+ const usage = getOrCreateUsage(key);
71229
+ abortExistingConnection(atomKey);
71230
+ const { cleanup, controller } = start2();
71231
+ usage.connections.set(atomKey, { start: start2, cleanup, controller, active: true });
71232
+ if (usage.count === 0 && !usage.orphanTimer) {
71233
+ usage.orphanTimer = setTimeout(() => {
71234
+ usage.orphanTimer = void 0;
71235
+ if (usage.count === 0) {
71236
+ cleanupConnections(key);
71237
+ }
71238
+ }, ORPHAN_TIMEOUT_MS);
71239
+ }
71240
+ return () => {
71241
+ const currentUsage = streamUsage.get(key);
71242
+ if (!currentUsage) {
71243
+ return;
71244
+ }
71245
+ const conn = currentUsage.connections.get(atomKey);
71246
+ if (conn?.active) {
71247
+ if (conn.controller) {
71248
+ conn.controller.abort();
71249
+ }
71250
+ conn.cleanup = void 0;
71251
+ conn.controller = void 0;
71252
+ conn.active = false;
71253
+ }
71254
+ currentUsage.connections.delete(atomKey);
71255
+ if (currentUsage.connections.size === 0 && currentUsage.count === 0) {
71256
+ if (currentUsage.cleanupTimer) {
71257
+ clearTimeout(currentUsage.cleanupTimer);
71258
+ }
71259
+ streamUsage.delete(key);
71260
+ }
71261
+ };
71262
+ }
71263
+ function subscribeStream(uid2, extras) {
71264
+ const key = createSubscriptionKey(uid2, extras);
71265
+ const usage = getOrCreateUsage(key);
71266
+ if (usage.cleanupTimer) {
71267
+ clearTimeout(usage.cleanupTimer);
71268
+ usage.cleanupTimer = void 0;
71269
+ }
71270
+ if (usage.orphanTimer) {
71271
+ clearTimeout(usage.orphanTimer);
71272
+ usage.orphanTimer = void 0;
71273
+ }
71274
+ const wasEmpty = usage.count === 0;
71275
+ usage.count++;
71276
+ if (wasEmpty) {
71277
+ restartConnections(key);
71278
+ }
71279
+ return () => {
71280
+ const currentUsage = streamUsage.get(key);
71281
+ if (!currentUsage) {
71282
+ return;
71283
+ }
71284
+ currentUsage.count = Math.max(0, currentUsage.count - 1);
71285
+ if (currentUsage.count === 0) {
71286
+ currentUsage.cleanupTimer = setTimeout(() => {
71287
+ currentUsage.cleanupTimer = void 0;
71288
+ cleanupConnections(key);
71289
+ }, PAUSE_DEBOUNCE_MS);
71290
+ }
71291
+ };
71292
+ }
71293
+ const streamSelectorFamilyRegistry = /* @__PURE__ */ new Map();
70951
71294
  function extractKey(item, keyAccessor) {
70952
71295
  if (item === null || item === void 0) {
70953
71296
  return void 0;
@@ -71113,19 +71456,12 @@ ${String(error)}`;
71113
71456
  function deserializeAtomParams(key) {
71114
71457
  return JSON.parse(key);
71115
71458
  }
71116
- const activeConnections = /* @__PURE__ */ new Map();
71117
71459
  const INITIAL_CONNECTED_STATE = {
71118
71460
  data: void 0,
71119
71461
  status: "connected"
71120
71462
  };
71121
71463
  function startStreamConnection(params, callbacks) {
71122
- const connectionKey = serializeAtomParams(params);
71123
- const existingController = activeConnections.get(connectionKey);
71124
- if (existingController) {
71125
- existingController.abort();
71126
- }
71127
71464
  const controller = new AbortController();
71128
- activeConnections.set(connectionKey, controller);
71129
71465
  let retryCount = 0;
71130
71466
  let isFirstMessage = true;
71131
71467
  let currentState = INITIAL_CONNECTED_STATE;
@@ -71186,9 +71522,11 @@ ${String(error)}`;
71186
71522
  // @ts-expect-error - Headers type doesn't match exactly
71187
71523
  headers: params.extras.headers
71188
71524
  });
71189
- return () => {
71190
- controller.abort();
71191
- activeConnections.delete(connectionKey);
71525
+ return {
71526
+ cleanup: () => {
71527
+ controller.abort();
71528
+ },
71529
+ controller
71192
71530
  };
71193
71531
  }
71194
71532
  function streamConnectionEffect(atomKey) {
@@ -71201,33 +71539,36 @@ ${String(error)}`;
71201
71539
  rejectInitialData = reject;
71202
71540
  });
71203
71541
  setSelf(initialDataPromise);
71204
- const cleanup = startStreamConnection(params, {
71205
- onFirstData: (state) => {
71206
- if (resolveInitialData) {
71207
- resolveInitialData(state);
71208
- resolveInitialData = null;
71209
- rejectInitialData = null;
71210
- }
71211
- setSelf(state);
71212
- },
71213
- onUpdate: (state) => {
71214
- setSelf(state);
71215
- },
71216
- onError: (error) => {
71217
- if (rejectInitialData) {
71218
- rejectInitialData(new Error(error));
71219
- resolveInitialData = null;
71220
- rejectInitialData = null;
71221
- } else {
71222
- setSelf({
71223
- data: void 0,
71224
- status: "error",
71225
- error
71226
- });
71542
+ const startConnection = () => {
71543
+ return startStreamConnection(params, {
71544
+ onFirstData: (state) => {
71545
+ if (resolveInitialData) {
71546
+ resolveInitialData(state);
71547
+ resolveInitialData = null;
71548
+ rejectInitialData = null;
71549
+ }
71550
+ setSelf(state);
71551
+ },
71552
+ onUpdate: (state) => {
71553
+ setSelf(state);
71554
+ },
71555
+ onError: (error) => {
71556
+ if (rejectInitialData) {
71557
+ rejectInitialData(new Error(error));
71558
+ resolveInitialData = null;
71559
+ rejectInitialData = null;
71560
+ } else {
71561
+ setSelf({
71562
+ data: void 0,
71563
+ status: "error",
71564
+ error
71565
+ });
71566
+ }
71227
71567
  }
71228
- }
71229
- });
71230
- return cleanup;
71568
+ });
71569
+ };
71570
+ const unregister = registerStreamConnection(params.uid, params.extras, atomKey, startConnection);
71571
+ return unregister;
71231
71572
  };
71232
71573
  }
71233
71574
  const streamAtomFamily = Recoil_index_10({
@@ -71239,8 +71580,8 @@ ${String(error)}`;
71239
71580
  }
71240
71581
  function getOrRegisterStreamVariableParams(variable, client2, taskContext, extras) {
71241
71582
  const key = getStreamRegistryKey(variable, "params-selector");
71242
- if (!selectorFamilyRegistry.has(key)) {
71243
- selectorFamilyRegistry.set(
71583
+ if (!streamSelectorFamilyRegistry.has(key)) {
71584
+ streamSelectorFamilyRegistry.set(
71244
71585
  key,
71245
71586
  Recoil_index_11({
71246
71587
  key: nanoid$1(),
@@ -71268,19 +71609,13 @@ ${String(error)}`;
71268
71609
  })
71269
71610
  );
71270
71611
  }
71271
- const family = selectorFamilyRegistry.get(key);
71272
- const serializableExtras = new RequestExtrasSerializable(extras);
71273
- const selectorInstance = family(serializableExtras);
71274
- if (!selectorFamilyMembersRegistry.has(family)) {
71275
- selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
71276
- }
71277
- selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
71278
- return selectorInstance;
71612
+ const family = streamSelectorFamilyRegistry.get(key);
71613
+ return family(new RequestExtrasSerializable(extras));
71279
71614
  }
71280
71615
  function getOrRegisterStreamVariableValue(variable, client2, taskContext, extras) {
71281
71616
  const key = getStreamRegistryKey(variable, "value-selector");
71282
- if (!selectorFamilyRegistry.has(key)) {
71283
- selectorFamilyRegistry.set(
71617
+ if (!streamSelectorFamilyRegistry.has(key)) {
71618
+ streamSelectorFamilyRegistry.set(
71284
71619
  key,
71285
71620
  Recoil_index_11({
71286
71621
  key: nanoid$1(),
@@ -71293,28 +71628,19 @@ ${String(error)}`;
71293
71628
  );
71294
71629
  const atomKey = get2(paramsSelector);
71295
71630
  const atom2 = streamAtomFamily(atomKey);
71296
- if (!streamAtomRegistry.has(atomKey)) {
71297
- streamAtomRegistry.set(atomKey, atom2);
71298
- }
71299
71631
  const streamState = get2(atom2);
71300
71632
  return getStreamValue(streamState, variable.key_accessor);
71301
71633
  }
71302
71634
  })
71303
71635
  );
71304
71636
  }
71305
- const family = selectorFamilyRegistry.get(key);
71306
- const serializableExtras = new RequestExtrasSerializable(extras);
71307
- const selectorInstance = family(serializableExtras);
71308
- if (!selectorFamilyMembersRegistry.has(family)) {
71309
- selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
71310
- }
71311
- selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
71312
- return selectorInstance;
71637
+ const family = streamSelectorFamilyRegistry.get(key);
71638
+ return family(new RequestExtrasSerializable(extras));
71313
71639
  }
71314
71640
  function getOrRegisterStreamVariable(variable, client2, taskContext, extras) {
71315
71641
  const key = `StreamVariable:${getUniqueIdentifier(variable, { useNested: true })}:nested-selector`;
71316
- if (!selectorFamilyRegistry.has(key)) {
71317
- selectorFamilyRegistry.set(
71642
+ if (!streamSelectorFamilyRegistry.has(key)) {
71643
+ streamSelectorFamilyRegistry.set(
71318
71644
  key,
71319
71645
  Recoil_index_11({
71320
71646
  key: nanoid$1(),
@@ -71331,14 +71657,8 @@ ${String(error)}`;
71331
71657
  })
71332
71658
  );
71333
71659
  }
71334
- const family = selectorFamilyRegistry.get(key);
71335
- const serializableExtras = new RequestExtrasSerializable(extras);
71336
- const selectorInstance = family(serializableExtras);
71337
- if (!selectorFamilyMembersRegistry.has(family)) {
71338
- selectorFamilyMembersRegistry.set(family, /* @__PURE__ */ new Map());
71339
- }
71340
- selectorFamilyMembersRegistry.get(family).set(serializableExtras.toJSON(), selectorInstance);
71341
- return selectorInstance;
71660
+ const family = streamSelectorFamilyRegistry.get(key);
71661
+ return family(new RequestExtrasSerializable(extras));
71342
71662
  }
71343
71663
  var clone_1;
71344
71664
  var hasRequiredClone;
@@ -72442,6 +72762,17 @@ Inferred class string: "${iconClasses}."`
72442
72762
  const lookupKey = String(value);
72443
72763
  return valueMap[lookupKey] ?? defaultValue;
72444
72764
  }
72765
+ function useStreamSubscription(streamUids, extras) {
72766
+ React$1.useEffect(() => {
72767
+ if (streamUids.length === 0) {
72768
+ return;
72769
+ }
72770
+ const unsubscribes = streamUids.map((uid2) => subscribeStream(uid2, extras));
72771
+ return () => {
72772
+ unsubscribes.forEach((unsub) => unsub());
72773
+ };
72774
+ }, [useDeepCompare(streamUids), extras]);
72775
+ }
72445
72776
  function isTaskResponse(response) {
72446
72777
  return response && typeof response === "object" && "task_id" in response;
72447
72778
  }
@@ -72664,6 +72995,11 @@ Inferred class string: "${iconClasses}."`
72664
72995
  variablesContext?.variables.current.delete(getComponentRegistryKey(uid2));
72665
72996
  };
72666
72997
  }, []);
72998
+ const streamUids = React$1.useMemo(
72999
+ () => findStreamVariablesInArray(Object.values(dynamicKwargs)).map((s) => s.uid),
73000
+ [dynamicKwargs]
73001
+ );
73002
+ useStreamSubscription(streamUids, extras);
72667
73003
  const componentSelector = getOrRegisterServerComponent({
72668
73004
  name,
72669
73005
  uid: uid2,
@@ -74733,6 +75069,8 @@ Inferred class string: "${iconClasses}."`
74733
75069
  variablesContext?.variables.current.delete(variable.uid);
74734
75070
  };
74735
75071
  }, []);
75072
+ const streamUids = React$1.useMemo(() => findStreamVariables(variable).map((s) => s.uid), [variable.uid]);
75073
+ useStreamSubscription(streamUids, extras);
74736
75074
  if (isDerivedVariable(variable)) {
74737
75075
  const selector2 = useDerivedVariable(variable, wsClient, taskContext, extras);
74738
75076
  const selectorLoadable = Recoil_index_28(selector2);