@vitessce/vega 4.0.9 → 4.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.
Files changed (2) hide show
  1. package/dist/index.js +854 -568
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -549,7 +549,7 @@ function lruCache$1(maxsize) {
549
549
  set: (key2, value2) => has$2(curr, key2) ? curr[key2] = value2 : update2(key2, value2)
550
550
  };
551
551
  }
552
- function merge$4(compare2, array0, array1, output2) {
552
+ function merge$3(compare2, array0, array1, output2) {
553
553
  const n0 = array0.length, n1 = array1.length;
554
554
  if (!n1) return array0;
555
555
  if (!n0) return array1;
@@ -1541,7 +1541,7 @@ function* flatten(arrays) {
1541
1541
  yield* array2;
1542
1542
  }
1543
1543
  }
1544
- function merge$3(arrays) {
1544
+ function merge$2(arrays) {
1545
1545
  return Array.from(flatten(arrays));
1546
1546
  }
1547
1547
  function range$6(start, stop3, step) {
@@ -2893,7 +2893,7 @@ function defaultLocale$1(definition2) {
2893
2893
  utcParse$1 = locale$1.utcParse;
2894
2894
  return locale$1;
2895
2895
  }
2896
- function memoize$2(method2) {
2896
+ function memoize$1(method2) {
2897
2897
  const cache2 = {};
2898
2898
  return (spec) => cache2[spec] || (cache2[spec] = method2(spec));
2899
2899
  }
@@ -2919,7 +2919,7 @@ function rightmostDigit(str, dec) {
2919
2919
  }
2920
2920
  }
2921
2921
  function numberLocale(locale2) {
2922
- const format2 = memoize$2(locale2.format), formatPrefix2 = locale2.formatPrefix;
2922
+ const format2 = memoize$1(locale2.format), formatPrefix2 = locale2.formatPrefix;
2923
2923
  return {
2924
2924
  format: format2,
2925
2925
  formatPrefix: formatPrefix2,
@@ -3003,12 +3003,12 @@ function timeMultiFormat(format2, interval2, spec) {
3003
3003
  return (date2) => (second2(date2) < date2 ? L : minute(date2) < date2 ? S : hour(date2) < date2 ? M2 : day(date2) < date2 ? H : month(date2) < date2 ? week2(date2) < date2 ? d : w2 : year(date2) < date2 ? quarter2(date2) < date2 ? m2 : q : y2)(date2);
3004
3004
  }
3005
3005
  function timeLocale(locale2) {
3006
- const timeFormat2 = memoize$2(locale2.format), utcFormat2 = memoize$2(locale2.utcFormat);
3006
+ const timeFormat2 = memoize$1(locale2.format), utcFormat2 = memoize$1(locale2.utcFormat);
3007
3007
  return {
3008
3008
  timeFormat: (spec) => isString(spec) ? timeFormat2(spec) : timeMultiFormat(timeFormat2, timeInterval, spec),
3009
3009
  utcFormat: (spec) => isString(spec) ? utcFormat2(spec) : timeMultiFormat(utcFormat2, utcInterval, spec),
3010
- timeParse: memoize$2(locale2.parse),
3011
- utcParse: memoize$2(locale2.utcParse)
3010
+ timeParse: memoize$1(locale2.parse),
3011
+ utcParse: memoize$1(locale2.utcParse)
3012
3012
  };
3013
3013
  }
3014
3014
  let defaultTimeLocale;
@@ -6400,7 +6400,7 @@ function SortedList(idFunc, source2, input) {
6400
6400
  data2.sort(compare2);
6401
6401
  }
6402
6402
  if (add2.length) {
6403
- data2 = compare2 ? merge$4(compare2, data2, add2.sort(compare2)) : data2.concat(add2);
6403
+ data2 = compare2 ? merge$3(compare2, data2, add2.sort(compare2)) : data2.concat(add2);
6404
6404
  add2 = [];
6405
6405
  }
6406
6406
  return data2;
@@ -16346,7 +16346,7 @@ function get$2(opt, key2, d) {
16346
16346
  const v = isObject$1(opt) ? opt[key2] : opt;
16347
16347
  return v != null ? v : d !== void 0 ? d : 0;
16348
16348
  }
16349
- function offsetValue$1(v) {
16349
+ function offsetValue$2(v) {
16350
16350
  return v < 0 ? Math.ceil(-v) : 0;
16351
16351
  }
16352
16352
  function gridLayout(view, groups, opt) {
@@ -16366,8 +16366,8 @@ function gridLayout(view, groups, opt) {
16366
16366
  yMax = Math.max(yMax, py2 = Math.ceil(b2.y2));
16367
16367
  xExtent[c2] = Math.max(xExtent[c2], px2);
16368
16368
  yExtent[r3] = Math.max(yExtent[r3], py2);
16369
- xOffset[i] = padCol + offsetValue$1(b2.x1);
16370
- yOffset[i] = padRow + offsetValue$1(b2.y1);
16369
+ xOffset[i] = padCol + offsetValue$2(b2.x1);
16370
+ yOffset[i] = padRow + offsetValue$2(b2.y1);
16371
16371
  if (dirty) view.dirty(groups[i]);
16372
16372
  }
16373
16373
  for (i = 0; i < n; ++i) {
@@ -18208,7 +18208,7 @@ function clip$1(pointVisible, clipLine2, interpolate2, start) {
18208
18208
  clip2.point = point2;
18209
18209
  clip2.lineStart = lineStart;
18210
18210
  clip2.lineEnd = lineEnd;
18211
- segments2 = merge$3(segments2);
18211
+ segments2 = merge$2(segments2);
18212
18212
  var startInside = polygonContains(polygon, start);
18213
18213
  if (segments2.length) {
18214
18214
  if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
@@ -18557,7 +18557,7 @@ function clipRectangle(x02, y02, x12, y12) {
18557
18557
  activeStream = bufferStream, segments2 = [], polygon = [], clean = true;
18558
18558
  }
18559
18559
  function polygonEnd() {
18560
- var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments2 = merge$3(segments2)).length;
18560
+ var startInside = polygonInside(), cleanInside = clean && startInside, visible2 = (segments2 = merge$2(segments2)).length;
18561
18561
  if (cleanInside || visible2) {
18562
18562
  stream2.polygonStart();
18563
18563
  if (cleanInside) {
@@ -25820,7 +25820,7 @@ function SortedIndex() {
25820
25820
  oldi = index2;
25821
25821
  value2 = Array(n0 + n1);
25822
25822
  index2 = array32(n0 + n1);
25823
- merge$2(base2, oldv, oldi, n0, addv, addi, n1, value2, index2);
25823
+ merge$1(base2, oldv, oldi, n0, addv, addi, n1, value2, index2);
25824
25824
  } else {
25825
25825
  if (base2 > 0) for (i = 0; i < n1; ++i) {
25826
25826
  addi[i] += base2;
@@ -25878,7 +25878,7 @@ function sort(values2, index2) {
25878
25878
  });
25879
25879
  return permute(values2, index2);
25880
25880
  }
25881
- function merge$2(base2, value0, index0, n0, value1, index1, n1, value2, index2) {
25881
+ function merge$1(base2, value0, index0, n0, value1, index1, n1, value2, index2) {
25882
25882
  let i0 = 0, i1 = 0, i;
25883
25883
  for (i = 0; i0 < n0 && i1 < n1; ++i) {
25884
25884
  if (value0[i0] < value1[i1]) {
@@ -27919,7 +27919,7 @@ function contrast(color1, color2) {
27919
27919
  const lum1 = luminance(color1), lum2 = luminance(color2), lumL = Math.max(lum1, lum2), lumD = Math.min(lum1, lum2);
27920
27920
  return (lumL + 0.05) / (lumD + 0.05);
27921
27921
  }
27922
- function merge$1() {
27922
+ function merge() {
27923
27923
  const args = [].slice.call(arguments);
27924
27924
  args.unshift({});
27925
27925
  return extend$1(...args);
@@ -28212,7 +28212,7 @@ const functionContext = {
28212
28212
  slice: slice$2,
28213
28213
  flush,
28214
28214
  lerp,
28215
- merge: merge$1,
28215
+ merge,
28216
28216
  pad: pad$2,
28217
28217
  peek: peek$2,
28218
28218
  pluck,
@@ -32093,7 +32093,7 @@ function position$1(spec, pos) {
32093
32093
  };
32094
32094
  }
32095
32095
  function axisGrid(spec, config, userEncode, dataRef, band2) {
32096
- const _ = lookup(spec, config), orient2 = spec.orient, vscale = spec.gridScale, sign2 = getSign(orient2, 1, -1), offset2 = offsetValue(spec.offset, sign2);
32096
+ const _ = lookup(spec, config), orient2 = spec.orient, vscale = spec.gridScale, sign2 = getSign(orient2, 1, -1), offset2 = offsetValue$1(spec.offset, sign2);
32097
32097
  let enter, exit, update2;
32098
32098
  const encode2 = {
32099
32099
  enter: enter = {
@@ -32159,7 +32159,7 @@ function axisGrid(spec, config, userEncode, dataRef, band2) {
32159
32159
  encode: encode2
32160
32160
  }, userEncode);
32161
32161
  }
32162
- function offsetValue(offset2, sign2) {
32162
+ function offsetValue$1(offset2, sign2) {
32163
32163
  if (sign2 === 1) ;
32164
32164
  else if (!isObject$1(offset2)) {
32165
32165
  offset2 = isSignal(sign2) ? {
@@ -33235,7 +33235,7 @@ const vegaImport = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
33235
33235
  logger,
33236
33236
  lruCache: lruCache$1,
33237
33237
  markup,
33238
- merge: merge$4,
33238
+ merge: merge$3,
33239
33239
  mergeConfig,
33240
33240
  multiLineOffset,
33241
33241
  one: one$2,
@@ -33790,7 +33790,7 @@ function rulesheet(callback) {
33790
33790
  }
33791
33791
  };
33792
33792
  }
33793
- function memoize$1(fn) {
33793
+ function memoize(fn) {
33794
33794
  var cache2 = /* @__PURE__ */ Object.create(null);
33795
33795
  return function(arg2) {
33796
33796
  if (cache2[arg2] === void 0) cache2[arg2] = fn(arg2);
@@ -34078,10 +34078,10 @@ var createCache = function createCache2(options) {
34078
34078
  }
34079
34079
  var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
34080
34080
  var inserted = {};
34081
- var container;
34081
+ var container2;
34082
34082
  var nodesToHydrate = [];
34083
34083
  {
34084
- container = options.container || document.head;
34084
+ container2 = options.container || document.head;
34085
34085
  Array.prototype.forEach.call(
34086
34086
  // this means we will ignore elements which don't have a space in them which
34087
34087
  // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
@@ -34118,7 +34118,7 @@ var createCache = function createCache2(options) {
34118
34118
  key: key2,
34119
34119
  sheet: new StyleSheet({
34120
34120
  key: key2,
34121
- container,
34121
+ container: container2,
34122
34122
  nonce: options.nonce,
34123
34123
  speedy: options.speedy,
34124
34124
  prepend: options.prepend,
@@ -34560,7 +34560,7 @@ var isCustomProperty = function isCustomProperty2(property2) {
34560
34560
  var isProcessableValue = function isProcessableValue2(value2) {
34561
34561
  return value2 != null && typeof value2 !== "boolean";
34562
34562
  };
34563
- var processStyleName = /* @__PURE__ */ memoize$1(function(styleName) {
34563
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
34564
34564
  return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
34565
34565
  });
34566
34566
  var processStyleValue = function processStyleValue2(key2, value2) {
@@ -35585,7 +35585,7 @@ const { tss: tss$1 } = createTss({
35585
35585
  tss$1.create({});
35586
35586
  const THEME_ID = "$$material";
35587
35587
  var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
35588
- var isPropValid = /* @__PURE__ */ memoize$1(
35588
+ var isPropValid = /* @__PURE__ */ memoize(
35589
35589
  function(prop) {
35590
35590
  return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
35591
35591
  }
@@ -36535,8 +36535,7 @@ function requireReactIs_development() {
36535
36535
  }
36536
36536
  }
36537
36537
  }
36538
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
36539
- var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
36538
+ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
36540
36539
  reactIs_development.ContextConsumer = REACT_CONSUMER_TYPE;
36541
36540
  reactIs_development.ContextProvider = REACT_CONTEXT_TYPE;
36542
36541
  reactIs_development.Element = REACT_ELEMENT_TYPE;
@@ -36586,7 +36585,7 @@ function requireReactIs_development() {
36586
36585
  return typeOf(object2) === REACT_SUSPENSE_LIST_TYPE;
36587
36586
  };
36588
36587
  reactIs_development.isValidElementType = function(type2) {
36589
- return "string" === typeof type2 || "function" === typeof type2 || type2 === REACT_FRAGMENT_TYPE || type2 === REACT_PROFILER_TYPE || type2 === REACT_STRICT_MODE_TYPE || type2 === REACT_SUSPENSE_TYPE || type2 === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type2 && null !== type2 && (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_CONSUMER_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type2.getModuleId) ? true : false;
36588
+ return "string" === typeof type2 || "function" === typeof type2 || type2 === REACT_FRAGMENT_TYPE || type2 === REACT_PROFILER_TYPE || type2 === REACT_STRICT_MODE_TYPE || type2 === REACT_SUSPENSE_TYPE || type2 === REACT_SUSPENSE_LIST_TYPE || type2 === REACT_VIEW_TRANSITION_TYPE || "object" === typeof type2 && null !== type2 && (type2.$$typeof === REACT_LAZY_TYPE || type2.$$typeof === REACT_MEMO_TYPE || type2.$$typeof === REACT_CONTEXT_TYPE || type2.$$typeof === REACT_CONSUMER_TYPE || type2.$$typeof === REACT_FORWARD_REF_TYPE || type2.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type2.getModuleId) ? true : false;
36590
36589
  };
36591
36590
  reactIs_development.typeOf = typeOf;
36592
36591
  })();
@@ -36656,19 +36655,12 @@ const sortBreakpointsValues = (values2) => {
36656
36655
  };
36657
36656
  function createBreakpoints(breakpoints) {
36658
36657
  const {
36659
- // The breakpoint **start** at this value.
36660
- // For instance with the first breakpoint xs: [xs, sm).
36661
36658
  values: values2 = {
36662
36659
  xs: 0,
36663
- // phone
36664
36660
  sm: 600,
36665
- // tablet
36666
36661
  md: 900,
36667
- // small laptop
36668
36662
  lg: 1200,
36669
- // desktop
36670
36663
  xl: 1536
36671
- // large screen
36672
36664
  },
36673
36665
  unit: unit2 = "px",
36674
36666
  step = 5,
@@ -36704,6 +36696,10 @@ function createBreakpoints(breakpoints) {
36704
36696
  }
36705
36697
  return between(key2, keys2[keys2.indexOf(key2) + 1]).replace("@media", "@media not all and");
36706
36698
  }
36699
+ const mediaKeys = [];
36700
+ for (let i = 0; i < keys2.length; i += 1) {
36701
+ mediaKeys.push(up(keys2[i]));
36702
+ }
36707
36703
  return {
36708
36704
  keys: keys2,
36709
36705
  values: sortedValues,
@@ -36713,28 +36709,40 @@ function createBreakpoints(breakpoints) {
36713
36709
  only,
36714
36710
  not,
36715
36711
  unit: unit2,
36712
+ internal_mediaKeys: mediaKeys,
36716
36713
  ...other
36717
36714
  };
36718
36715
  }
36716
+ const MIN_WIDTH_PATTERN = /min-width:\s*([0-9.]+)/;
36719
36717
  function sortContainerQueries(theme, css2) {
36720
- if (!theme.containerQueries) {
36718
+ if (!theme.containerQueries || !hasContainerQuery(css2)) {
36721
36719
  return css2;
36722
36720
  }
36723
- const sorted = Object.keys(css2).filter((key2) => key2.startsWith("@container")).sort((a2, b2) => {
36724
- const regex = /min-width:\s*([0-9.]+)/;
36725
- return +(a2.match(regex)?.[1] || 0) - +(b2.match(regex)?.[1] || 0);
36726
- });
36727
- if (!sorted.length) {
36728
- return css2;
36721
+ const keys2 = [];
36722
+ for (const key2 in css2) {
36723
+ if (key2.startsWith("@container")) {
36724
+ keys2.push(key2);
36725
+ }
36729
36726
  }
36730
- return sorted.reduce((acc, key2) => {
36731
- const value2 = css2[key2];
36732
- delete acc[key2];
36733
- acc[key2] = value2;
36734
- return acc;
36735
- }, {
36736
- ...css2
36727
+ keys2.sort((a2, b2) => {
36728
+ return +(a2.match(MIN_WIDTH_PATTERN)?.[1] || 0) - +(b2.match(MIN_WIDTH_PATTERN)?.[1] || 0);
36737
36729
  });
36730
+ const result = css2;
36731
+ for (let i = 0; i < keys2.length; i += 1) {
36732
+ const key2 = keys2[i];
36733
+ const value2 = result[key2];
36734
+ delete result[key2];
36735
+ result[key2] = value2;
36736
+ }
36737
+ return result;
36738
+ }
36739
+ function hasContainerQuery(css2) {
36740
+ for (const key2 in css2) {
36741
+ if (key2.startsWith("@container")) {
36742
+ return true;
36743
+ }
36744
+ }
36745
+ return false;
36738
36746
  }
36739
36747
  function isCqShorthand(breakpointKeys, value2) {
36740
36748
  return value2 === "@" || value2.startsWith("@") && (breakpointKeys.some((key2) => value2.startsWith(`@${key2}`)) || !!value2.match(/^@\d/));
@@ -36743,8 +36751,11 @@ function getContainerQuery(theme, shorthand) {
36743
36751
  const matches = shorthand.match(/^@([^/]+)?\/?(.+)?$/);
36744
36752
  if (!matches) {
36745
36753
  {
36746
- throw new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
36747
- For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);
36754
+ throw (
36755
+ /* minify-error */
36756
+ new Error(`MUI: The provided shorthand ${`(${shorthand})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.
36757
+ For example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`)
36758
+ );
36748
36759
  }
36749
36760
  }
36750
36761
  const [, containerQuery, containerName] = matches;
@@ -36781,15 +36792,82 @@ const shape = {
36781
36792
  borderRadius: 4
36782
36793
  };
36783
36794
  const responsivePropType = _pt.oneOfType([_pt.number, _pt.string, _pt.object, _pt.array]);
36784
- function merge(acc, item) {
36785
- if (!item) {
36786
- return acc;
36795
+ function isObjectEmpty$1(object2) {
36796
+ if (object2 == null) {
36797
+ return true;
36787
36798
  }
36788
- return deepmerge(acc, item, {
36789
- clone: false
36790
- // No need to clone deep, it's way faster.
36791
- });
36799
+ for (const _ in object2) {
36800
+ return false;
36801
+ }
36802
+ return true;
36792
36803
  }
36804
+ function fastDeepAssign(target2, source2) {
36805
+ const sourceIsArray = Array.isArray(source2);
36806
+ const targetIsArray = Array.isArray(target2);
36807
+ if (isPrimitive(source2)) {
36808
+ return source2;
36809
+ } else if (isPrimitiveOrBuiltIn(target2)) {
36810
+ return clone$1(source2);
36811
+ } else if (sourceIsArray && targetIsArray) {
36812
+ return mergeArray(target2, source2);
36813
+ } else if (sourceIsArray !== targetIsArray) {
36814
+ return clone$1(source2);
36815
+ } else {
36816
+ return mergeObject(target2, source2);
36817
+ }
36818
+ }
36819
+ function cloneArray(value2) {
36820
+ let i = 0;
36821
+ const il = value2.length;
36822
+ const result = new Array(il);
36823
+ for (i = 0; i < il; i += 1) {
36824
+ result[i] = clone$1(value2[i]);
36825
+ }
36826
+ return result;
36827
+ }
36828
+ function cloneObject(target2) {
36829
+ const result = {};
36830
+ for (const key2 in target2) {
36831
+ if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") {
36832
+ continue;
36833
+ }
36834
+ result[key2] = clone$1(target2[key2]);
36835
+ }
36836
+ return result;
36837
+ }
36838
+ function mergeArray(target2, source2) {
36839
+ const tl2 = target2.length;
36840
+ for (let i = 0; i < source2.length; i += 1) {
36841
+ target2[tl2 + i] = clone$1(source2[i]);
36842
+ }
36843
+ return target2;
36844
+ }
36845
+ function isMergeableObject(value2) {
36846
+ return typeof value2 === "object" && value2 !== null && !(value2 instanceof RegExp) && !(value2 instanceof Date);
36847
+ }
36848
+ function isPrimitive(value2) {
36849
+ return typeof value2 !== "object" || value2 === null;
36850
+ }
36851
+ function isPrimitiveOrBuiltIn(value2) {
36852
+ return typeof value2 !== "object" || value2 === null || value2 instanceof RegExp || value2 instanceof Date;
36853
+ }
36854
+ function clone$1(entry2) {
36855
+ return isMergeableObject(entry2) ? Array.isArray(entry2) ? cloneArray(entry2) : cloneObject(entry2) : entry2;
36856
+ }
36857
+ function mergeObject(target2, source2) {
36858
+ for (const key2 in source2) {
36859
+ if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") {
36860
+ continue;
36861
+ }
36862
+ if (key2 in target2) {
36863
+ target2[key2] = fastDeepAssign(target2[key2], source2[key2]);
36864
+ } else {
36865
+ target2[key2] = clone$1(source2[key2]);
36866
+ }
36867
+ }
36868
+ return target2;
36869
+ }
36870
+ const EMPTY_THEME$2 = {};
36793
36871
  const values$3 = {
36794
36872
  xs: 0,
36795
36873
  // phone
@@ -36802,12 +36880,9 @@ const values$3 = {
36802
36880
  xl: 1536
36803
36881
  // large screen
36804
36882
  };
36805
- const defaultBreakpoints = {
36806
- // Sorted ASC by size. That's important.
36807
- // It can't be configured as it's used statically for propTypes.
36808
- keys: ["xs", "sm", "md", "lg", "xl"],
36809
- up: (key2) => `@media (min-width:${values$3[key2]}px)`
36810
- };
36883
+ const DEFAULT_BREAKPOINTS = createBreakpoints({
36884
+ values: values$3
36885
+ });
36811
36886
  const defaultContainerQueries = {
36812
36887
  containerQueries: (containerName) => ({
36813
36888
  up: (key2) => {
@@ -36820,52 +36895,89 @@ const defaultContainerQueries = {
36820
36895
  })
36821
36896
  };
36822
36897
  function handleBreakpoints(props, propValue, styleFromPropValue) {
36823
- const theme = props.theme || {};
36898
+ const result = {};
36899
+ return iterateBreakpoints(result, props.theme, propValue, (mediaKey, value2, initialKey) => {
36900
+ const finalValue = styleFromPropValue(value2, initialKey);
36901
+ if (mediaKey) {
36902
+ result[mediaKey] = finalValue;
36903
+ } else {
36904
+ fastDeepAssign(result, finalValue);
36905
+ }
36906
+ });
36907
+ }
36908
+ function iterateBreakpoints(target2, theme, propValue, callback) {
36909
+ theme ??= EMPTY_THEME$2;
36824
36910
  if (Array.isArray(propValue)) {
36825
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
36826
- return propValue.reduce((acc, item, index2) => {
36827
- acc[themeBreakpoints.up(themeBreakpoints.keys[index2])] = styleFromPropValue(propValue[index2]);
36828
- return acc;
36829
- }, {});
36911
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
36912
+ for (let i = 0; i < propValue.length; i += 1) {
36913
+ buildBreakpoint(target2, breakpoints.up(breakpoints.keys[i]), propValue[i], void 0, callback);
36914
+ }
36915
+ return target2;
36830
36916
  }
36831
36917
  if (typeof propValue === "object") {
36832
- const themeBreakpoints = theme.breakpoints || defaultBreakpoints;
36833
- return Object.keys(propValue).reduce((acc, breakpoint) => {
36834
- if (isCqShorthand(themeBreakpoints.keys, breakpoint)) {
36835
- const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, breakpoint);
36918
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
36919
+ const breakpointValues = breakpoints.values ?? values$3;
36920
+ for (const key2 in propValue) {
36921
+ if (isCqShorthand(breakpoints.keys, key2)) {
36922
+ const containerKey = getContainerQuery(theme.containerQueries ? theme : defaultContainerQueries, key2);
36836
36923
  if (containerKey) {
36837
- acc[containerKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
36924
+ buildBreakpoint(target2, containerKey, propValue[key2], key2, callback);
36838
36925
  }
36839
- } else if (Object.keys(themeBreakpoints.values || values$3).includes(breakpoint)) {
36840
- const mediaKey = themeBreakpoints.up(breakpoint);
36841
- acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);
36926
+ } else if (key2 in breakpointValues) {
36927
+ const mediaKey = breakpoints.up(key2);
36928
+ buildBreakpoint(target2, mediaKey, propValue[key2], key2, callback);
36842
36929
  } else {
36843
- const cssKey = breakpoint;
36844
- acc[cssKey] = propValue[cssKey];
36930
+ const cssKey = key2;
36931
+ target2[cssKey] = propValue[cssKey];
36845
36932
  }
36846
- return acc;
36847
- }, {});
36933
+ }
36934
+ return target2;
36848
36935
  }
36849
- const output2 = styleFromPropValue(propValue);
36850
- return output2;
36936
+ callback(void 0, propValue);
36937
+ return target2;
36851
36938
  }
36852
- function createEmptyBreakpointObject(breakpointsInput = {}) {
36853
- const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key2) => {
36854
- const breakpointStyleKey = breakpointsInput.up(key2);
36855
- acc[breakpointStyleKey] = {};
36856
- return acc;
36857
- }, {});
36858
- return breakpointsInOrder || {};
36939
+ function buildBreakpoint(target2, mediaKey, value2, initialKey, callback) {
36940
+ target2[mediaKey] ??= {};
36941
+ callback(mediaKey, value2, initialKey);
36942
+ }
36943
+ function createEmptyBreakpointObject(breakpoints = DEFAULT_BREAKPOINTS) {
36944
+ const {
36945
+ internal_mediaKeys: mediaKeys
36946
+ } = breakpoints;
36947
+ const result = {};
36948
+ for (let i = 0; i < mediaKeys.length; i += 1) {
36949
+ result[mediaKeys[i]] = {};
36950
+ }
36951
+ return result;
36859
36952
  }
36860
- function removeUnusedBreakpoints(breakpointKeys, style2) {
36861
- return breakpointKeys.reduce((acc, key2) => {
36862
- const breakpointOutput = acc[key2];
36863
- const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;
36864
- if (isBreakpointUnused) {
36865
- delete acc[key2];
36953
+ function removeUnusedBreakpoints(breakpoints, style2) {
36954
+ const breakpointKeys = breakpoints.internal_mediaKeys;
36955
+ for (let i = 0; i < breakpointKeys.length; i += 1) {
36956
+ const key2 = breakpointKeys[i];
36957
+ if (isObjectEmpty$1(style2[key2])) {
36958
+ delete style2[key2];
36866
36959
  }
36867
- return acc;
36868
- }, style2);
36960
+ }
36961
+ return style2;
36962
+ }
36963
+ function hasBreakpoint(breakpoints, value2) {
36964
+ if (Array.isArray(value2)) {
36965
+ return true;
36966
+ }
36967
+ if (typeof value2 === "object" && value2 !== null) {
36968
+ for (let i = 0; i < breakpoints.keys.length; i += 1) {
36969
+ if (breakpoints.keys[i] in value2) {
36970
+ return true;
36971
+ }
36972
+ }
36973
+ const valueKeys = Object.keys(value2);
36974
+ for (let i = 0; i < valueKeys.length; i += 1) {
36975
+ if (isCqShorthand(breakpoints.keys, valueKeys[i])) {
36976
+ return true;
36977
+ }
36978
+ }
36979
+ }
36980
+ return false;
36869
36981
  }
36870
36982
  function capitalize$1(string2) {
36871
36983
  if (typeof string2 !== "string") {
@@ -36873,37 +36985,54 @@ function capitalize$1(string2) {
36873
36985
  }
36874
36986
  return string2.charAt(0).toUpperCase() + string2.slice(1);
36875
36987
  }
36876
- function getPath(obj, path2, checkVars = true) {
36877
- if (!path2 || typeof path2 !== "string") {
36878
- return null;
36879
- }
36880
- if (obj && obj.vars && checkVars) {
36881
- const val = `vars.${path2}`.split(".").reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);
36882
- if (val != null) {
36883
- return val;
36884
- }
36885
- }
36886
- return path2.split(".").reduce((acc, item) => {
36887
- if (acc && acc[item] != null) {
36888
- return acc[item];
36889
- }
36890
- return null;
36891
- }, obj);
36892
- }
36893
- function getStyleValue(themeMapping, transform2, propValueFinal, userValue = propValueFinal) {
36988
+ function getStyleValue2(themeMapping, transform2, userValue, alternateProp) {
36894
36989
  let value2;
36895
36990
  if (typeof themeMapping === "function") {
36896
- value2 = themeMapping(propValueFinal);
36991
+ value2 = themeMapping(userValue);
36897
36992
  } else if (Array.isArray(themeMapping)) {
36898
- value2 = themeMapping[propValueFinal] || userValue;
36993
+ value2 = themeMapping[userValue] || userValue;
36994
+ } else if (typeof userValue === "string") {
36995
+ value2 = getPath(themeMapping, userValue, true, alternateProp) || userValue;
36899
36996
  } else {
36900
- value2 = getPath(themeMapping, propValueFinal) || userValue;
36997
+ value2 = userValue;
36901
36998
  }
36902
36999
  if (transform2) {
36903
37000
  value2 = transform2(value2, userValue, themeMapping);
36904
37001
  }
36905
37002
  return value2;
36906
37003
  }
37004
+ function getPath(obj, pathInput, checkVars = true, alternateProp = void 0) {
37005
+ if (!obj || !pathInput) {
37006
+ return null;
37007
+ }
37008
+ const path2 = pathInput.split(".");
37009
+ if (obj.vars && checkVars) {
37010
+ const val = getPathImpl(obj.vars, path2, alternateProp);
37011
+ if (val != null) {
37012
+ return val;
37013
+ }
37014
+ }
37015
+ return getPathImpl(obj, path2, alternateProp);
37016
+ }
37017
+ function getPathImpl(object2, path2, alternateProp = void 0) {
37018
+ let lastResult = void 0;
37019
+ let result = object2;
37020
+ let index2 = 0;
37021
+ while (index2 < path2.length) {
37022
+ if (result === null || result === void 0) {
37023
+ return result;
37024
+ }
37025
+ lastResult = result;
37026
+ result = result[path2[index2]];
37027
+ index2 += 1;
37028
+ }
37029
+ if (alternateProp && result === void 0) {
37030
+ const lastKey = path2[path2.length - 1];
37031
+ const alternateKey = `${alternateProp}${lastKey === "default" ? "" : capitalize$1(lastKey)}`;
37032
+ return lastResult?.[alternateKey];
37033
+ }
37034
+ return result;
37035
+ }
36907
37036
  function style$1(options) {
36908
37037
  const {
36909
37038
  prop,
@@ -36918,15 +37047,9 @@ function style$1(options) {
36918
37047
  const propValue = props[prop];
36919
37048
  const theme = props.theme;
36920
37049
  const themeMapping = getPath(theme, themeKey) || {};
36921
- const styleFromPropValue = (propValueFinal) => {
36922
- let value2 = getStyleValue(themeMapping, transform2, propValueFinal);
36923
- if (propValueFinal === value2 && typeof propValueFinal === "string") {
36924
- value2 = getStyleValue(themeMapping, transform2, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
36925
- }
36926
- if (cssProperty === false) {
36927
- return value2;
36928
- }
36929
- return {
37050
+ const styleFromPropValue = (valueFinal) => {
37051
+ const value2 = getStyleValue2(themeMapping, transform2, valueFinal, prop);
37052
+ return cssProperty === false ? value2 : {
36930
37053
  [cssProperty]: value2
36931
37054
  };
36932
37055
  };
@@ -36938,15 +37061,9 @@ function style$1(options) {
36938
37061
  fn.filterProps = [prop];
36939
37062
  return fn;
36940
37063
  }
36941
- function memoize(fn) {
36942
- const cache2 = {};
36943
- return (arg2) => {
36944
- if (cache2[arg2] === void 0) {
36945
- cache2[arg2] = fn(arg2);
36946
- }
36947
- return cache2[arg2];
36948
- };
36949
- }
37064
+ const EMPTY_THEME$1 = {
37065
+ internal_cache: {}
37066
+ };
36950
37067
  const properties = {
36951
37068
  m: "margin",
36952
37069
  p: "padding"
@@ -36965,22 +37082,24 @@ const aliases = {
36965
37082
  paddingX: "px",
36966
37083
  paddingY: "py"
36967
37084
  };
36968
- const getCssProperties = memoize((prop) => {
36969
- if (prop.length > 2) {
36970
- if (aliases[prop]) {
36971
- prop = aliases[prop];
36972
- } else {
36973
- return [prop];
36974
- }
37085
+ const CSS_PROPERTIES = {};
37086
+ for (const key2 in properties) {
37087
+ CSS_PROPERTIES[key2] = [properties[key2]];
37088
+ }
37089
+ for (const keyProperty in properties) {
37090
+ for (const keyDirection in directions) {
37091
+ const property2 = properties[keyProperty];
37092
+ const direction = directions[keyDirection];
37093
+ const value2 = Array.isArray(direction) ? direction.map((dir) => property2 + dir) : [property2 + direction];
37094
+ CSS_PROPERTIES[keyProperty + keyDirection] = value2;
36975
37095
  }
36976
- const [a2, b2] = prop.split("");
36977
- const property2 = properties[a2];
36978
- const direction = directions[b2] || "";
36979
- return Array.isArray(direction) ? direction.map((dir) => property2 + dir) : [property2 + direction];
36980
- });
36981
- const marginKeys = ["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"];
36982
- const paddingKeys = ["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"];
36983
- const spacingKeys = [...marginKeys, ...paddingKeys];
37096
+ }
37097
+ for (const key2 in aliases) {
37098
+ CSS_PROPERTIES[key2] = CSS_PROPERTIES[aliases[key2]];
37099
+ }
37100
+ const marginKeys = /* @__PURE__ */ new Set(["m", "mt", "mr", "mb", "ml", "mx", "my", "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "marginX", "marginY", "marginInline", "marginInlineStart", "marginInlineEnd", "marginBlock", "marginBlockStart", "marginBlockEnd"]);
37101
+ const paddingKeys = /* @__PURE__ */ new Set(["p", "pt", "pr", "pb", "pl", "px", "py", "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "paddingX", "paddingY", "paddingInline", "paddingInlineStart", "paddingInlineEnd", "paddingBlock", "paddingBlockStart", "paddingBlockEnd"]);
37102
+ const spacingKeys = /* @__PURE__ */ new Set([...marginKeys, ...paddingKeys]);
36984
37103
  function createUnaryUnit(theme, themeKey, defaultValue, propName) {
36985
37104
  const themeSpacing = getPath(theme, themeKey, true) ?? defaultValue;
36986
37105
  if (typeof themeSpacing === "number" || typeof themeSpacing === "string") {
@@ -37048,42 +37167,45 @@ function getValue$1(transformer2, propValue) {
37048
37167
  }
37049
37168
  return transformer2(propValue);
37050
37169
  }
37051
- function getStyleFromPropValue(cssProperties, transformer2) {
37052
- return (propValue) => cssProperties.reduce((acc, cssProperty) => {
37053
- acc[cssProperty] = getValue$1(transformer2, propValue);
37054
- return acc;
37055
- }, {});
37056
- }
37057
- function resolveCssProperty(props, keys2, prop, transformer2) {
37058
- if (!keys2.includes(prop)) {
37059
- return null;
37060
- }
37061
- const cssProperties = getCssProperties(prop);
37062
- const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer2);
37063
- const propValue = props[prop];
37064
- return handleBreakpoints(props, propValue, styleFromPropValue);
37065
- }
37170
+ const container = [""];
37066
37171
  function style(props, keys2) {
37067
- const transformer2 = createUnarySpacing(props.theme);
37068
- return Object.keys(props).map((prop) => resolveCssProperty(props, keys2, prop, transformer2)).reduce(merge, {});
37172
+ const theme = props.theme ?? EMPTY_THEME$1;
37173
+ const transformer2 = theme?.internal_cache?.unarySpacing ?? createUnarySpacing(theme);
37174
+ const result = {};
37175
+ for (const prop in props) {
37176
+ if (!keys2.has(prop)) {
37177
+ continue;
37178
+ }
37179
+ const cssProperties = CSS_PROPERTIES[prop] ?? (container[0] = prop, container);
37180
+ const propValue = props[prop];
37181
+ iterateBreakpoints(result, props.theme, propValue, (mediaKey, value2) => {
37182
+ const target2 = mediaKey ? result[mediaKey] : result;
37183
+ for (let i = 0; i < cssProperties.length; i += 1) {
37184
+ target2[cssProperties[i]] = getValue$1(transformer2, value2);
37185
+ }
37186
+ });
37187
+ }
37188
+ return result;
37069
37189
  }
37070
- function margin(props) {
37190
+ function marginFn(props) {
37071
37191
  return style(props, marginKeys);
37072
37192
  }
37073
- margin.propTypes = marginKeys.reduce((obj, key2) => {
37193
+ marginFn.propTypes = Array.from(marginKeys).reduce((obj, key2) => {
37074
37194
  obj[key2] = responsivePropType;
37075
37195
  return obj;
37076
37196
  }, {});
37077
- margin.filterProps = marginKeys;
37078
- function padding$1(props) {
37197
+ marginFn.filterProps = marginKeys;
37198
+ const margin = marginFn;
37199
+ function paddingFn(props) {
37079
37200
  return style(props, paddingKeys);
37080
37201
  }
37081
- padding$1.propTypes = paddingKeys.reduce((obj, key2) => {
37202
+ paddingFn.propTypes = Array.from(paddingKeys).reduce((obj, key2) => {
37082
37203
  obj[key2] = responsivePropType;
37083
37204
  return obj;
37084
37205
  }, {});
37085
- padding$1.filterProps = paddingKeys;
37086
- spacingKeys.reduce((obj, key2) => {
37206
+ paddingFn.filterProps = paddingKeys;
37207
+ const padding$1 = paddingFn;
37208
+ Array.from(spacingKeys).reduce((obj, key2) => {
37087
37209
  obj[key2] = responsivePropType;
37088
37210
  return obj;
37089
37211
  }, {});
@@ -37116,12 +37238,13 @@ function compose(...styles) {
37116
37238
  return acc;
37117
37239
  }, {});
37118
37240
  const fn = (props) => {
37119
- return Object.keys(props).reduce((acc, prop) => {
37241
+ const result = {};
37242
+ for (const prop in props) {
37120
37243
  if (handlers[prop]) {
37121
- return merge(acc, handlers[prop](props));
37244
+ fastDeepAssign(result, handlers[prop](props));
37122
37245
  }
37123
- return acc;
37124
- }, {});
37246
+ }
37247
+ return result;
37125
37248
  };
37126
37249
  fn.propTypes = styles.reduce((acc, style2) => Object.assign(acc, style2.propTypes), {});
37127
37250
  fn.filterProps = styles.reduce((acc, style2) => acc.concat(style2.filterProps), []);
@@ -37260,6 +37383,7 @@ const backgroundColor$3 = style$1({
37260
37383
  transform: paletteTransform
37261
37384
  });
37262
37385
  compose(color$1, bgcolor, backgroundColor$3);
37386
+ const breakpointsValues = values$3;
37263
37387
  function sizingTransform(value2) {
37264
37388
  return value2 <= 1 && value2 !== 0 ? `${value2 * 100}%` : value2;
37265
37389
  }
@@ -37270,7 +37394,7 @@ const width = style$1({
37270
37394
  const maxWidth = (props) => {
37271
37395
  if (props.maxWidth !== void 0 && props.maxWidth !== null) {
37272
37396
  const styleFromPropValue = (propValue) => {
37273
- const breakpoint = props.theme?.breakpoints?.values?.[propValue] || values$3[propValue];
37397
+ const breakpoint = props.theme?.breakpoints?.values?.[propValue] || breakpointsValues[propValue];
37274
37398
  if (!breakpoint) {
37275
37399
  return {
37276
37400
  maxWidth: sizingTransform(propValue)
@@ -37608,68 +37732,24 @@ const defaultSxConfig = {
37608
37732
  themeKey: "typography"
37609
37733
  }
37610
37734
  };
37611
- function objectsHaveSameKeys(...objects) {
37612
- const allKeys = objects.reduce((keys2, object2) => keys2.concat(Object.keys(object2)), []);
37613
- const union2 = new Set(allKeys);
37614
- return objects.every((object2) => union2.size === Object.keys(object2).length);
37615
- }
37616
- function callIfFn(maybeFn, arg2) {
37617
- return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
37618
- }
37735
+ const EMPTY_THEME = {};
37619
37736
  function unstable_createStyleFunctionSx() {
37620
- function getThemeValue(prop, val, theme, config) {
37621
- const props = {
37622
- [prop]: val,
37623
- theme
37624
- };
37625
- const options = config[prop];
37626
- if (!options) {
37627
- return {
37628
- [prop]: val
37629
- };
37630
- }
37631
- const {
37632
- cssProperty = prop,
37633
- themeKey,
37634
- transform: transform2,
37635
- style: style2
37636
- } = options;
37637
- if (val == null) {
37737
+ function styleFunctionSx2(props) {
37738
+ if (!props.sx) {
37638
37739
  return null;
37639
37740
  }
37640
- if (themeKey === "typography" && val === "inherit") {
37641
- return {
37642
- [prop]: val
37643
- };
37644
- }
37645
- const themeMapping = getPath(theme, themeKey) || {};
37646
- if (style2) {
37647
- return style2(props);
37648
- }
37649
- const styleFromPropValue = (propValueFinal) => {
37650
- let value2 = getStyleValue(themeMapping, transform2, propValueFinal);
37651
- if (propValueFinal === value2 && typeof propValueFinal === "string") {
37652
- value2 = getStyleValue(themeMapping, transform2, `${prop}${propValueFinal === "default" ? "" : capitalize$1(propValueFinal)}`, propValueFinal);
37653
- }
37654
- if (cssProperty === false) {
37655
- return value2;
37656
- }
37657
- return {
37658
- [cssProperty]: value2
37659
- };
37660
- };
37661
- return handleBreakpoints(props, val, styleFromPropValue);
37662
- }
37663
- function styleFunctionSx2(props) {
37664
37741
  const {
37665
37742
  sx,
37666
- theme = {}
37667
- } = props || {};
37668
- if (!sx) {
37669
- return null;
37670
- }
37743
+ theme = EMPTY_THEME,
37744
+ nested: nested2
37745
+ } = props;
37671
37746
  const config = theme.unstable_sxConfig ?? defaultSxConfig;
37672
- function traverse(sxInput) {
37747
+ const wrapper2 = {
37748
+ sx: null,
37749
+ theme,
37750
+ nested: true
37751
+ };
37752
+ function process2(sxInput) {
37673
37753
  let sxObject = sxInput;
37674
37754
  if (typeof sxInput === "function") {
37675
37755
  sxObject = sxInput(theme);
@@ -37679,43 +37759,94 @@ function unstable_createStyleFunctionSx() {
37679
37759
  if (!sxObject) {
37680
37760
  return null;
37681
37761
  }
37682
- const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
37683
- const breakpointsKeys = Object.keys(emptyBreakpoints);
37684
- let css2 = emptyBreakpoints;
37685
- Object.keys(sxObject).forEach((styleKey) => {
37762
+ const breakpoints = theme.breakpoints ?? DEFAULT_BREAKPOINTS;
37763
+ const css2 = createEmptyBreakpointObject(breakpoints);
37764
+ for (const styleKey in sxObject) {
37686
37765
  const value2 = callIfFn(sxObject[styleKey], theme);
37687
- if (value2 !== null && value2 !== void 0) {
37688
- if (typeof value2 === "object") {
37689
- if (config[styleKey]) {
37690
- css2 = merge(css2, getThemeValue(styleKey, value2, theme, config));
37691
- } else {
37692
- const breakpointsValues = handleBreakpoints({
37693
- theme
37694
- }, value2, (x2) => ({
37695
- [styleKey]: x2
37696
- }));
37697
- if (objectsHaveSameKeys(breakpointsValues, value2)) {
37698
- css2[styleKey] = styleFunctionSx2({
37699
- sx: value2,
37700
- theme
37701
- });
37702
- } else {
37703
- css2 = merge(css2, breakpointsValues);
37704
- }
37705
- }
37706
- } else {
37707
- css2 = merge(css2, getThemeValue(styleKey, value2, theme, config));
37708
- }
37766
+ if (value2 === null || value2 === void 0) {
37767
+ continue;
37709
37768
  }
37710
- });
37711
- return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css2));
37769
+ if (typeof value2 !== "object") {
37770
+ setThemeValue(css2, styleKey, value2, theme, config);
37771
+ continue;
37772
+ }
37773
+ if (config[styleKey]) {
37774
+ setThemeValue(css2, styleKey, value2, theme, config);
37775
+ continue;
37776
+ }
37777
+ if (hasBreakpoint(breakpoints, value2)) {
37778
+ iterateBreakpoints(css2, props.theme, value2, (mediaKey, finalValue) => {
37779
+ css2[mediaKey][styleKey] = finalValue;
37780
+ });
37781
+ } else {
37782
+ wrapper2.sx = value2;
37783
+ css2[styleKey] = styleFunctionSx2(wrapper2);
37784
+ }
37785
+ }
37786
+ if (!nested2 && theme.modularCssLayers) {
37787
+ return {
37788
+ "@layer sx": sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css2))
37789
+ };
37790
+ }
37791
+ return sortContainerQueries(theme, removeUnusedBreakpoints(breakpoints, css2));
37712
37792
  }
37713
- return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
37793
+ return Array.isArray(sx) ? sx.map(process2) : process2(sx);
37714
37794
  }
37795
+ styleFunctionSx2.filterProps = ["sx"];
37715
37796
  return styleFunctionSx2;
37716
37797
  }
37717
37798
  const styleFunctionSx = unstable_createStyleFunctionSx();
37718
- styleFunctionSx.filterProps = ["sx"];
37799
+ function setThemeValue(css2, prop, value2, theme, config) {
37800
+ const options = config[prop];
37801
+ if (!options) {
37802
+ css2[prop] = value2;
37803
+ return;
37804
+ }
37805
+ if (value2 == null) {
37806
+ return;
37807
+ }
37808
+ const {
37809
+ themeKey
37810
+ } = options;
37811
+ if (themeKey === "typography" && value2 === "inherit") {
37812
+ css2[prop] = value2;
37813
+ return;
37814
+ }
37815
+ const {
37816
+ style: style2
37817
+ } = options;
37818
+ if (style2) {
37819
+ fastDeepAssign(css2, style2({
37820
+ [prop]: value2,
37821
+ theme
37822
+ }));
37823
+ return;
37824
+ }
37825
+ const {
37826
+ cssProperty = prop,
37827
+ transform: transform2
37828
+ } = options;
37829
+ const themeMapping = getPath(theme, themeKey);
37830
+ iterateBreakpoints(css2, theme, value2, (mediaKey, valueFinal) => {
37831
+ const finalValue = getStyleValue2(themeMapping, transform2, valueFinal, prop);
37832
+ if (cssProperty === false) {
37833
+ if (mediaKey) {
37834
+ fastDeepAssign(css2[mediaKey], finalValue);
37835
+ } else {
37836
+ fastDeepAssign(css2, finalValue);
37837
+ }
37838
+ } else {
37839
+ if (mediaKey) {
37840
+ css2[mediaKey][cssProperty] = finalValue;
37841
+ } else {
37842
+ css2[cssProperty] = finalValue;
37843
+ }
37844
+ }
37845
+ });
37846
+ }
37847
+ function callIfFn(maybeFn, arg2) {
37848
+ return typeof maybeFn === "function" ? maybeFn(arg2) : maybeFn;
37849
+ }
37719
37850
  function applyStyles(key2, styles) {
37720
37851
  const theme = this;
37721
37852
  if (theme.vars) {
@@ -37776,67 +37907,19 @@ function createTheme$1(options = {}, ...args) {
37776
37907
  theme: this
37777
37908
  });
37778
37909
  };
37910
+ muiTheme.internal_cache = {};
37779
37911
  return muiTheme;
37780
37912
  }
37781
- function isObjectEmpty$1(obj) {
37913
+ function isObjectEmpty(obj) {
37782
37914
  return Object.keys(obj).length === 0;
37783
37915
  }
37784
- function useTheme$2(defaultTheme2 = null) {
37916
+ function useThemeWithoutDefault(defaultTheme2 = null) {
37785
37917
  const contextTheme = React$1.useContext(ThemeContext);
37786
- return !contextTheme || isObjectEmpty$1(contextTheme) ? defaultTheme2 : contextTheme;
37918
+ return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme2 : contextTheme;
37787
37919
  }
37788
37920
  const systemDefaultTheme$1 = createTheme$1();
37789
37921
  function useTheme$1(defaultTheme2 = systemDefaultTheme$1) {
37790
- return useTheme$2(defaultTheme2);
37791
- }
37792
- const splitProps = (props) => {
37793
- const result = {
37794
- systemProps: {},
37795
- otherProps: {}
37796
- };
37797
- const config = props?.theme?.unstable_sxConfig ?? defaultSxConfig;
37798
- Object.keys(props).forEach((prop) => {
37799
- if (config[prop]) {
37800
- result.systemProps[prop] = props[prop];
37801
- } else {
37802
- result.otherProps[prop] = props[prop];
37803
- }
37804
- });
37805
- return result;
37806
- };
37807
- function extendSxProp$1(props) {
37808
- const {
37809
- sx: inSx,
37810
- ...other
37811
- } = props;
37812
- const {
37813
- systemProps,
37814
- otherProps
37815
- } = splitProps(other);
37816
- let finalSx;
37817
- if (Array.isArray(inSx)) {
37818
- finalSx = [systemProps, ...inSx];
37819
- } else if (typeof inSx === "function") {
37820
- finalSx = (...args) => {
37821
- const result = inSx(...args);
37822
- if (!isPlainObject(result)) {
37823
- return systemProps;
37824
- }
37825
- return {
37826
- ...systemProps,
37827
- ...result
37828
- };
37829
- };
37830
- } else {
37831
- finalSx = {
37832
- ...systemProps,
37833
- ...inSx
37834
- };
37835
- }
37836
- return {
37837
- ...otherProps,
37838
- sx: finalSx
37839
- };
37922
+ return useThemeWithoutDefault(defaultTheme2);
37840
37923
  }
37841
37924
  const defaultGenerator = (componentName) => componentName;
37842
37925
  const createClassNameGenerator = () => {
@@ -37947,6 +38030,12 @@ const systemDefaultTheme = createTheme$1();
37947
38030
  function shouldForwardProp(prop) {
37948
38031
  return prop !== "ownerState" && prop !== "theme" && prop !== "sx" && prop !== "as";
37949
38032
  }
38033
+ function shallowLayer(serialized, layerName) {
38034
+ if (layerName && serialized && typeof serialized === "object" && serialized.styles && !serialized.styles.startsWith("@layer")) {
38035
+ serialized.styles = `@layer ${layerName}{${String(serialized.styles)}}`;
38036
+ }
38037
+ return serialized;
38038
+ }
37950
38039
  function defaultOverridesResolver(slot) {
37951
38040
  if (!slot) {
37952
38041
  return null;
@@ -37954,32 +38043,32 @@ function defaultOverridesResolver(slot) {
37954
38043
  return (_props, styles) => styles[slot];
37955
38044
  }
37956
38045
  function attachTheme(props, themeId, defaultTheme2) {
37957
- props.theme = isObjectEmpty(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
38046
+ props.theme = isObjectEmpty$1(props.theme) ? defaultTheme2 : props.theme[themeId] || props.theme;
37958
38047
  }
37959
- function processStyle(props, style2) {
38048
+ function processStyle(props, style2, layerName) {
37960
38049
  const resolvedStyle = typeof style2 === "function" ? style2(props) : style2;
37961
38050
  if (Array.isArray(resolvedStyle)) {
37962
- return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle));
38051
+ return resolvedStyle.flatMap((subStyle) => processStyle(props, subStyle, layerName));
37963
38052
  }
37964
38053
  if (Array.isArray(resolvedStyle?.variants)) {
37965
38054
  let rootStyle;
37966
38055
  if (resolvedStyle.isProcessed) {
37967
- rootStyle = resolvedStyle.style;
38056
+ rootStyle = layerName ? shallowLayer(resolvedStyle.style, layerName) : resolvedStyle.style;
37968
38057
  } else {
37969
38058
  const {
37970
38059
  variants,
37971
38060
  ...otherStyles
37972
38061
  } = resolvedStyle;
37973
- rootStyle = otherStyles;
38062
+ rootStyle = layerName ? shallowLayer(internal_serializeStyles(otherStyles), layerName) : otherStyles;
37974
38063
  }
37975
- return processStyleVariants(props, resolvedStyle.variants, [rootStyle]);
38064
+ return processStyleVariants(props, resolvedStyle.variants, [rootStyle], layerName);
37976
38065
  }
37977
38066
  if (resolvedStyle?.isProcessed) {
37978
- return resolvedStyle.style;
38067
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle.style), layerName) : resolvedStyle.style;
37979
38068
  }
37980
- return resolvedStyle;
38069
+ return layerName ? shallowLayer(internal_serializeStyles(resolvedStyle), layerName) : resolvedStyle;
37981
38070
  }
37982
- function processStyleVariants(props, variants, results = []) {
38071
+ function processStyleVariants(props, variants, results = [], layerName = void 0) {
37983
38072
  let mergedState;
37984
38073
  variantLoop: for (let i = 0; i < variants.length; i += 1) {
37985
38074
  const variant = variants[i];
@@ -38005,9 +38094,9 @@ function processStyleVariants(props, variants, results = []) {
38005
38094
  ...props.ownerState,
38006
38095
  ownerState: props.ownerState
38007
38096
  };
38008
- results.push(variant.style(mergedState));
38097
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style(mergedState)), layerName) : variant.style(mergedState));
38009
38098
  } else {
38010
- results.push(variant.style);
38099
+ results.push(layerName ? shallowLayer(internal_serializeStyles(variant.style), layerName) : variant.style);
38011
38100
  }
38012
38101
  }
38013
38102
  return results;
@@ -38034,6 +38123,7 @@ function createStyled2(input = {}) {
38034
38123
  overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot)),
38035
38124
  ...options
38036
38125
  } = inputOptions;
38126
+ const layerName = componentName && componentName.startsWith("Mui") || !!componentSlot ? "components" : "custom";
38037
38127
  const skipVariantsResolver = inputSkipVariantsResolver !== void 0 ? inputSkipVariantsResolver : (
38038
38128
  // TODO v6: remove `Root` in the next major release
38039
38129
  // For more details: https://github.com/mui/material-ui/pull/37908
@@ -38054,18 +38144,21 @@ function createStyled2(input = {}) {
38054
38144
  ...options
38055
38145
  });
38056
38146
  const transformStyle = (style2) => {
38057
- if (typeof style2 === "function" && style2.__emotion_real !== style2) {
38147
+ if (style2.__emotion_real === style2) {
38148
+ return style2;
38149
+ }
38150
+ if (typeof style2 === "function") {
38058
38151
  return function styleFunctionProcessor(props) {
38059
- return processStyle(props, style2);
38152
+ return processStyle(props, style2, props.theme.modularCssLayers ? layerName : void 0);
38060
38153
  };
38061
38154
  }
38062
38155
  if (isPlainObject(style2)) {
38063
38156
  const serialized = preprocessStyles(style2);
38064
- if (!serialized.variants) {
38065
- return serialized.style;
38066
- }
38067
38157
  return function styleObjectProcessor(props) {
38068
- return processStyle(props, serialized);
38158
+ if (!serialized.variants) {
38159
+ return props.theme.modularCssLayers ? shallowLayer(serialized.style, layerName) : serialized.style;
38160
+ }
38161
+ return processStyle(props, serialized, props.theme.modularCssLayers ? layerName : void 0);
38069
38162
  };
38070
38163
  }
38071
38164
  return style2;
@@ -38084,7 +38177,7 @@ function createStyled2(input = {}) {
38084
38177
  }
38085
38178
  const resolvedStyleOverrides = {};
38086
38179
  for (const slotKey in styleOverrides) {
38087
- resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey]);
38180
+ resolvedStyleOverrides[slotKey] = processStyle(props, styleOverrides[slotKey], props.theme.modularCssLayers ? "theme" : void 0);
38088
38181
  }
38089
38182
  return overridesResolver(props, resolvedStyleOverrides);
38090
38183
  });
@@ -38096,7 +38189,7 @@ function createStyled2(input = {}) {
38096
38189
  if (!themeVariants) {
38097
38190
  return null;
38098
38191
  }
38099
- return processStyleVariants(props, themeVariants);
38192
+ return processStyleVariants(props, themeVariants, [], props.theme.modularCssLayers ? "theme" : void 0);
38100
38193
  });
38101
38194
  }
38102
38195
  if (!skipSx) {
@@ -38145,12 +38238,6 @@ function generateStyledLabel(componentName, componentSlot) {
38145
38238
  }
38146
38239
  return label2;
38147
38240
  }
38148
- function isObjectEmpty(object2) {
38149
- for (const _ in object2) {
38150
- return false;
38151
- }
38152
- return true;
38153
- }
38154
38241
  function isStringTag(tag) {
38155
38242
  return typeof tag === "string" && // 96 is one less than the char code
38156
38243
  // for "a" so this is checking that
@@ -38163,7 +38250,7 @@ function lowercaseFirstLetter(string2) {
38163
38250
  }
38164
38251
  return string2.charAt(0).toLowerCase() + string2.slice(1);
38165
38252
  }
38166
- function resolveProps(defaultProps, props) {
38253
+ function resolveProps(defaultProps, props, mergeClassNameAndStyle = false) {
38167
38254
  const output2 = {
38168
38255
  ...props
38169
38256
  };
@@ -38189,10 +38276,23 @@ function resolveProps(defaultProps, props) {
38189
38276
  for (const slotKey in defaultSlotProps) {
38190
38277
  if (Object.prototype.hasOwnProperty.call(defaultSlotProps, slotKey)) {
38191
38278
  const slotPropName = slotKey;
38192
- output2[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);
38279
+ const defaultSlotPropValue = defaultSlotProps[slotPropName];
38280
+ const slotPropValue = slotProps[slotPropName];
38281
+ if (typeof defaultSlotPropValue === "function" || typeof slotPropValue === "function") {
38282
+ output2[propName][slotPropName] = (...args) => resolveProps((typeof defaultSlotPropValue === "function" ? defaultSlotPropValue(...args) : defaultSlotPropValue) ?? {}, (typeof slotPropValue === "function" ? slotPropValue(...args) : slotPropValue) ?? {}, mergeClassNameAndStyle);
38283
+ } else {
38284
+ output2[propName][slotPropName] = resolveProps(defaultSlotPropValue ?? {}, slotPropValue ?? {}, mergeClassNameAndStyle);
38285
+ }
38193
38286
  }
38194
38287
  }
38195
38288
  }
38289
+ } else if (propName === "className" && mergeClassNameAndStyle && props.className !== void 0) {
38290
+ output2.className = clsx(defaultProps?.className, props?.className);
38291
+ } else if (propName === "style" && mergeClassNameAndStyle && props.style) {
38292
+ output2.style = {
38293
+ ...defaultProps?.style,
38294
+ ...props?.style
38295
+ };
38196
38296
  } else if (output2[propName] === void 0) {
38197
38297
  output2[propName] = defaultProps[propName];
38198
38298
  }
@@ -38352,6 +38452,9 @@ function private_safeAlpha(color2, value2, warning) {
38352
38452
  try {
38353
38453
  return alpha(color2, value2);
38354
38454
  } catch (error2) {
38455
+ if (warning && true) {
38456
+ console.warn(warning);
38457
+ }
38355
38458
  return color2;
38356
38459
  }
38357
38460
  }
@@ -38371,6 +38474,9 @@ function private_safeDarken(color2, coefficient, warning) {
38371
38474
  try {
38372
38475
  return darken(color2, coefficient);
38373
38476
  } catch (error2) {
38477
+ if (warning && true) {
38478
+ console.warn(warning);
38479
+ }
38374
38480
  return color2;
38375
38481
  }
38376
38482
  }
@@ -38394,6 +38500,9 @@ function private_safeLighten(color2, coefficient, warning) {
38394
38500
  try {
38395
38501
  return lighten(color2, coefficient);
38396
38502
  } catch (error2) {
38503
+ if (warning && true) {
38504
+ console.warn(warning);
38505
+ }
38397
38506
  return color2;
38398
38507
  }
38399
38508
  }
@@ -38446,10 +38555,10 @@ function getThemeProps(params2) {
38446
38555
  }
38447
38556
  const config = theme.components[name];
38448
38557
  if (config.defaultProps) {
38449
- return resolveProps(config.defaultProps, props);
38558
+ return resolveProps(config.defaultProps, props, theme.components.mergeClassNameAndStyle);
38450
38559
  }
38451
38560
  if (!config.styleOverrides && !config.variants) {
38452
- return resolveProps(config, props);
38561
+ return resolveProps(config, props, theme.components.mergeClassNameAndStyle);
38453
38562
  }
38454
38563
  return props;
38455
38564
  }
@@ -38499,9 +38608,14 @@ function createGetCssVar$1(prefix2 = "") {
38499
38608
  };
38500
38609
  return getCssVar;
38501
38610
  }
38611
+ const prototypePollutingKeys = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
38502
38612
  const assignNestedKeys = (obj, keys2, value2, arrayKeys = []) => {
38503
38613
  let temp2 = obj;
38504
- keys2.forEach((k, index2) => {
38614
+ for (let index2 = 0; index2 < keys2.length; index2 += 1) {
38615
+ const k = keys2[index2];
38616
+ if (prototypePollutingKeys.has(k)) {
38617
+ break;
38618
+ }
38505
38619
  if (index2 === keys2.length - 1) {
38506
38620
  if (Array.isArray(temp2)) {
38507
38621
  temp2[Number(k)] = value2;
@@ -38514,7 +38628,7 @@ const assignNestedKeys = (obj, keys2, value2, arrayKeys = []) => {
38514
38628
  }
38515
38629
  temp2 = temp2[k];
38516
38630
  }
38517
- });
38631
+ }
38518
38632
  };
38519
38633
  const walkObjectDeep = (obj, callback, shouldSkipPaths) => {
38520
38634
  function recurse2(object2, parentKeys = [], arrayKeys = []) {
@@ -38581,7 +38695,8 @@ function prepareCssVars(theme, parserConfig = {}) {
38581
38695
  const {
38582
38696
  getSelector = defaultGetSelector2,
38583
38697
  disableCssColorScheme,
38584
- colorSchemeSelector: selector
38698
+ colorSchemeSelector: selector,
38699
+ enableContrastVars
38585
38700
  } = parserConfig;
38586
38701
  const {
38587
38702
  colorSchemes: colorSchemes2 = {},
@@ -38715,6 +38830,17 @@ function prepareCssVars(theme, parserConfig = {}) {
38715
38830
  ...finalCss
38716
38831
  }), finalCss);
38717
38832
  });
38833
+ if (enableContrastVars) {
38834
+ stylesheets.push({
38835
+ ":root": {
38836
+ // use double underscore to indicate that these are private variables
38837
+ "--__l-threshold": "0.7",
38838
+ "--__l": "clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)",
38839
+ "--__a": "clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"
38840
+ // 0.87 is the default alpha value for black text.
38841
+ }
38842
+ });
38843
+ }
38718
38844
  return stylesheets;
38719
38845
  };
38720
38846
  return {
@@ -38915,6 +39041,19 @@ function addLightOrDark(intent, direction, shade, tonalOffset) {
38915
39041
  }
38916
39042
  }
38917
39043
  }
39044
+ function mixLightOrDark(colorSpace, intent, direction, shade, tonalOffset) {
39045
+ const tonalOffsetLight = tonalOffset.light || tonalOffset;
39046
+ const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
39047
+ if (!intent[direction]) {
39048
+ if (intent.hasOwnProperty(shade)) {
39049
+ intent[direction] = intent[shade];
39050
+ } else if (direction === "light") {
39051
+ intent.light = `color-mix(in ${colorSpace}, ${intent.main}, #fff ${(tonalOffsetLight * 100).toFixed(0)}%)`;
39052
+ } else if (direction === "dark") {
39053
+ intent.dark = `color-mix(in ${colorSpace}, ${intent.main}, #000 ${(tonalOffsetDark * 100).toFixed(0)}%)`;
39054
+ }
39055
+ }
39056
+ }
38918
39057
  function getDefaultPrimary(mode = "light") {
38919
39058
  if (mode === "dark") {
38920
39059
  return {
@@ -39000,11 +39139,15 @@ function getDefaultWarning(mode = "light") {
39000
39139
  dark: orange[900]
39001
39140
  };
39002
39141
  }
39142
+ function contrastColor(background2) {
39143
+ return `oklch(from ${background2} var(--__l) 0 h / var(--__a))`;
39144
+ }
39003
39145
  function createPalette(palette) {
39004
39146
  const {
39005
39147
  mode = "light",
39006
39148
  contrastThreshold = 3,
39007
39149
  tonalOffset = 0.2,
39150
+ colorSpace,
39008
39151
  ...other
39009
39152
  } = palette;
39010
39153
  const primary = palette.primary || getDefaultPrimary(mode);
@@ -39014,6 +39157,9 @@ function createPalette(palette) {
39014
39157
  const success = palette.success || getDefaultSuccess(mode);
39015
39158
  const warning = palette.warning || getDefaultWarning(mode);
39016
39159
  function getContrastText(background2) {
39160
+ if (colorSpace) {
39161
+ return contrastColor(background2);
39162
+ }
39017
39163
  const contrastText = getContrastRatio(background2, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
39018
39164
  {
39019
39165
  const contrast2 = getContrastRatio(background2, contrastText);
@@ -39056,8 +39202,13 @@ const theme2 = createTheme({ palette: {
39056
39202
  primary: { main: green[500] },
39057
39203
  } });`);
39058
39204
  }
39059
- addLightOrDark(color2, "light", lightShade, tonalOffset);
39060
- addLightOrDark(color2, "dark", darkShade, tonalOffset);
39205
+ if (colorSpace) {
39206
+ mixLightOrDark(colorSpace, color2, "light", lightShade, tonalOffset);
39207
+ mixLightOrDark(colorSpace, color2, "dark", darkShade, tonalOffset);
39208
+ } else {
39209
+ addLightOrDark(color2, "light", lightShade, tonalOffset);
39210
+ addLightOrDark(color2, "dark", darkShade, tonalOffset);
39211
+ }
39061
39212
  if (!color2.contrastText) {
39062
39213
  color2.contrastText = getContrastText(color2.main);
39063
39214
  }
@@ -39133,6 +39284,44 @@ const theme2 = createTheme({ palette: {
39133
39284
  }, other);
39134
39285
  return paletteOutput;
39135
39286
  }
39287
+ const focusVisibleOffsetVar = "--_focusVisible-offset";
39288
+ const focusVisibleBehaviorVar = "--_focusVisible-behavior";
39289
+ const focusVisibleShadowVar = "--_focusVisible-shadow";
39290
+ const offsetValue = `var(${focusVisibleOffsetVar}, 1)`;
39291
+ const behaviorValue = `var(${focusVisibleBehaviorVar}, )`;
39292
+ function mergeFocusVisibleInput(optionsFocusVisible, args) {
39293
+ return args.reduce((acc, arg2) => arg2 && "focusVisible" in arg2 ? deepmerge(acc, {
39294
+ focusVisible: arg2.focusVisible
39295
+ }) : acc, {
39296
+ focusVisible: optionsFocusVisible
39297
+ }).focusVisible;
39298
+ }
39299
+ function isResolvedFocusVisible(input) {
39300
+ return input != null && typeof input === "object" && typeof input.outlineOffset === "string" && input.outlineOffset.includes(focusVisibleOffsetVar);
39301
+ }
39302
+ function resolveFocusVisible(input, outlineColor2) {
39303
+ return wireFocusVisibleVars({
39304
+ outlineStyle: "solid",
39305
+ outlineColor: outlineColor2,
39306
+ outlineWidth: 2,
39307
+ outlineOffset: 2,
39308
+ // invisible shadow for parent component with solid background (AppBar, Snackbar, Alert) can control the ring color.
39309
+ boxShadow: `var(${focusVisibleShadowVar}, 0 0)`,
39310
+ ...input === true ? null : input
39311
+ });
39312
+ }
39313
+ function wireFocusVisibleVars(resolved) {
39314
+ const offset2 = resolved.outlineOffset ?? 0;
39315
+ if (typeof offset2 !== "string" || !offset2.includes(focusVisibleOffsetVar)) {
39316
+ const offsetPx = typeof offset2 === "number" ? `${offset2}px` : offset2;
39317
+ resolved.outlineOffset = `calc(${offsetValue} * ${offsetPx})`;
39318
+ }
39319
+ const standaloneBoxShadows = /* @__PURE__ */ new Set(["none", "initial", "inherit", "unset", "revert", "revert-layer"]);
39320
+ if (typeof resolved.boxShadow === "string" && !standaloneBoxShadows.has(resolved.boxShadow.trim().toLowerCase()) && !/\binset\b/.test(resolved.boxShadow) && !resolved.boxShadow.includes(focusVisibleBehaviorVar)) {
39321
+ resolved.boxShadow = `${behaviorValue} ${resolved.boxShadow}`;
39322
+ }
39323
+ return resolved;
39324
+ }
39136
39325
  function prepareTypographyVars(typography) {
39137
39326
  const vars = {};
39138
39327
  const entries2 = Object.entries(typography);
@@ -39254,6 +39443,8 @@ function createShadow(...px2) {
39254
39443
  return [`${px2[0]}px ${px2[1]}px ${px2[2]}px ${px2[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px2[4]}px ${px2[5]}px ${px2[6]}px ${px2[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px2[8]}px ${px2[9]}px ${px2[10]}px ${px2[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",");
39255
39444
  }
39256
39445
  const shadows = ["none", createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
39446
+ const DEFAULT_TRANSITION_PROPS = ["all"];
39447
+ const EMPTY_OPTIONS = {};
39257
39448
  const easing = {
39258
39449
  // This is the most common easing curve.
39259
39450
  easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)",
@@ -39289,15 +39480,19 @@ function getAutoHeightDuration(height2) {
39289
39480
  return Math.min(Math.round((4 + 15 * constant2 ** 0.25 + constant2 / 5) * 10), 3e3);
39290
39481
  }
39291
39482
  function createTransitions(inputTransitions) {
39483
+ const transitions = {
39484
+ ...inputTransitions
39485
+ };
39486
+ delete transitions.reducedMotion;
39292
39487
  const mergedEasing = {
39293
39488
  ...easing,
39294
- ...inputTransitions.easing
39489
+ ...transitions.easing
39295
39490
  };
39296
39491
  const mergedDuration = {
39297
39492
  ...duration,
39298
- ...inputTransitions.duration
39493
+ ...transitions.duration
39299
39494
  };
39300
- const create2 = (props = ["all"], options = {}) => {
39495
+ const createTransitionValue = (props = DEFAULT_TRANSITION_PROPS, options = EMPTY_OPTIONS) => {
39301
39496
  const {
39302
39497
  duration: durationOption = mergedDuration.standard,
39303
39498
  easing: easingOption = mergedEasing.easeInOut,
@@ -39328,14 +39523,22 @@ function createTransitions(inputTransitions) {
39328
39523
  }
39329
39524
  return (Array.isArray(props) ? props : [props]).map((animatedProp) => `${animatedProp} ${typeof durationOption === "string" ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === "string" ? delay : formatMs(delay)}`).join(",");
39330
39525
  };
39526
+ const create2 = transitions.create ?? createTransitionValue;
39331
39527
  return {
39332
39528
  getAutoHeightDuration,
39333
39529
  create: create2,
39334
- ...inputTransitions,
39530
+ ...transitions,
39335
39531
  easing: mergedEasing,
39336
39532
  duration: mergedDuration
39337
39533
  };
39338
39534
  }
39535
+ const EMPTY_MOTION = {};
39536
+ function createMotion(inputMotion = EMPTY_MOTION) {
39537
+ return {
39538
+ reducedMotion: "never",
39539
+ ...inputMotion
39540
+ };
39541
+ }
39339
39542
  const zIndex = {
39340
39543
  mobileStepper: 1e3,
39341
39544
  fab: 1050,
@@ -39357,7 +39560,7 @@ function stringifyTheme(baseTheme = {}) {
39357
39560
  const array2 = Object.entries(object2);
39358
39561
  for (let index2 = 0; index2 < array2.length; index2++) {
39359
39562
  const [key2, value2] = array2[index2];
39360
- if (!isSerializable(value2) || key2.startsWith("unstable_")) {
39563
+ if (!isSerializable(value2) || key2.startsWith("unstable_") || key2.startsWith("internal_")) {
39361
39564
  delete object2[key2];
39362
39565
  } else if (isPlainObject(value2)) {
39363
39566
  object2[key2] = {
@@ -39373,19 +39576,70 @@ function stringifyTheme(baseTheme = {}) {
39373
39576
  const theme = ${JSON.stringify(serializableTheme, null, 2)};
39374
39577
 
39375
39578
  theme.breakpoints = createBreakpoints(theme.breakpoints || {});
39579
+ theme.motion = { reducedMotion: 'never', ...theme.motion };
39376
39580
  theme.transitions = createTransitions(theme.transitions || {});
39377
39581
 
39378
39582
  export default theme;`;
39379
39583
  }
39584
+ function coefficientToPercentage(coefficient) {
39585
+ if (typeof coefficient === "number") {
39586
+ return `${(coefficient * 100).toFixed(0)}%`;
39587
+ }
39588
+ return `calc((${coefficient}) * 100%)`;
39589
+ }
39590
+ const parseAddition = (str) => {
39591
+ if (!Number.isNaN(+str)) {
39592
+ return +str;
39593
+ }
39594
+ const numbers2 = str.match(/\d*\.?\d+/g);
39595
+ if (!numbers2) {
39596
+ return 0;
39597
+ }
39598
+ let sum2 = 0;
39599
+ for (let i = 0; i < numbers2.length; i += 1) {
39600
+ sum2 += +numbers2[i];
39601
+ }
39602
+ return sum2;
39603
+ };
39604
+ function attachColorManipulators(theme) {
39605
+ Object.assign(theme, {
39606
+ alpha(color2, coefficient) {
39607
+ const obj = this || theme;
39608
+ if (obj.colorSpace) {
39609
+ return `oklch(from ${color2} l c h / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
39610
+ }
39611
+ if (obj.vars) {
39612
+ return `rgba(${color2.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g, "var(--$1Channel)")} / ${typeof coefficient === "string" ? `calc(${coefficient})` : coefficient})`;
39613
+ }
39614
+ return alpha(color2, parseAddition(coefficient));
39615
+ },
39616
+ lighten(color2, coefficient) {
39617
+ const obj = this || theme;
39618
+ if (obj.colorSpace) {
39619
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #fff ${coefficientToPercentage(coefficient)})`;
39620
+ }
39621
+ return lighten(color2, coefficient);
39622
+ },
39623
+ darken(color2, coefficient) {
39624
+ const obj = this || theme;
39625
+ if (obj.colorSpace) {
39626
+ return `color-mix(in ${obj.colorSpace}, ${color2}, #000 ${coefficientToPercentage(coefficient)})`;
39627
+ }
39628
+ return darken(color2, coefficient);
39629
+ }
39630
+ });
39631
+ }
39380
39632
  function createThemeNoVars(options = {}, ...args) {
39381
39633
  const {
39382
39634
  breakpoints: breakpointsInput,
39383
39635
  mixins: mixinsInput = {},
39384
39636
  spacing: spacingInput,
39385
39637
  palette: paletteInput = {},
39638
+ motion: motionInput = {},
39386
39639
  transitions: transitionsInput = {},
39387
39640
  typography: typographyInput = {},
39388
39641
  shape: shapeInput,
39642
+ colorSpace,
39389
39643
  ...other
39390
39644
  } = options;
39391
39645
  if (options.vars && // The error should throw only for the root theme creation because user is not allowed to use a custom node `vars`.
@@ -39393,7 +39647,10 @@ function createThemeNoVars(options = {}, ...args) {
39393
39647
  options.generateThemeVars === void 0) {
39394
39648
  throw new Error("MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");
39395
39649
  }
39396
- const palette = createPalette(paletteInput);
39650
+ const palette = createPalette({
39651
+ ...paletteInput,
39652
+ colorSpace
39653
+ });
39397
39654
  const systemTheme = createTheme$1(options);
39398
39655
  let muiTheme = deepmerge(systemTheme, {
39399
39656
  mixins: createMixins(systemTheme.breakpoints, mixinsInput),
@@ -39401,6 +39658,7 @@ function createThemeNoVars(options = {}, ...args) {
39401
39658
  // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
39402
39659
  shadows: shadows.slice(),
39403
39660
  typography: createTypography(palette, typographyInput),
39661
+ motion: createMotion(motionInput),
39404
39662
  transitions: createTransitions(transitionsInput),
39405
39663
  zIndex: {
39406
39664
  ...zIndex
@@ -39408,6 +39666,10 @@ function createThemeNoVars(options = {}, ...args) {
39408
39666
  });
39409
39667
  muiTheme = deepmerge(muiTheme, other);
39410
39668
  muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
39669
+ delete muiTheme.transitions.reducedMotion;
39670
+ if (muiTheme.focusVisible != null && muiTheme.focusVisible !== false) {
39671
+ muiTheme.focusVisible = resolveFocusVisible(muiTheme.focusVisible, muiTheme.palette.primary.main);
39672
+ }
39411
39673
  {
39412
39674
  const stateClasses = ["active", "checked", "completed", "disabled", "error", "expanded", "focused", "focusVisible", "required", "selected"];
39413
39675
  const traverse = (node2, component) => {
@@ -39445,6 +39707,7 @@ function createThemeNoVars(options = {}, ...args) {
39445
39707
  });
39446
39708
  };
39447
39709
  muiTheme.toRuntimeSource = stringifyTheme;
39710
+ attachColorManipulators(muiTheme);
39448
39711
  return muiTheme;
39449
39712
  }
39450
39713
  function getOverlayAlpha(elevation) {
@@ -39482,9 +39745,13 @@ function createColorScheme(options) {
39482
39745
  // need to cast to avoid module augmentation test
39483
39746
  opacity: opacity2,
39484
39747
  overlays,
39485
- ...rest
39748
+ colorSpace,
39749
+ ...other
39486
39750
  } = options;
39487
- const palette = createPalette(paletteInput);
39751
+ const palette = createPalette({
39752
+ ...paletteInput,
39753
+ colorSpace
39754
+ });
39488
39755
  return {
39489
39756
  palette,
39490
39757
  opacity: {
@@ -39492,11 +39759,14 @@ function createColorScheme(options) {
39492
39759
  ...opacity2
39493
39760
  },
39494
39761
  overlays: overlays || getOverlays(palette.mode),
39495
- ...rest
39762
+ ...other
39496
39763
  };
39497
39764
  }
39498
39765
  function shouldSkipGeneratingVar(keys2) {
39499
- return !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
39766
+ return keys2[0] === "motion" || // Keep `focusVisible` inline: its values reference the per-component private vars
39767
+ // (`--_focusVisible-offset`/`-behavior`). Hoisted to a `:root` var they resolve where those
39768
+ // vars are unset, silently breaking the inner-ring inset.
39769
+ keys2[0] === "focusVisible" || !!keys2[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys2[0].match(/sxConfig$/) || // ends with sxConfig
39500
39770
  keys2[0] === "palette" && !!keys2[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
39501
39771
  }
39502
39772
  const excludeVariablesFromRoot = (cssVarPrefix) => [...[...Array(25)].map((_, index2) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}overlays-${index2}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ""}palette-AppBar-darkColor`];
@@ -39599,7 +39869,7 @@ const silent = (fn) => {
39599
39869
  return void 0;
39600
39870
  };
39601
39871
  const createGetCssVar = (cssVarPrefix = "mui") => createGetCssVar$1(cssVarPrefix);
39602
- function attachColorScheme$1(colorSchemes2, scheme2, restTheme, colorScheme) {
39872
+ function attachColorScheme$1(colorSpace, colorSchemes2, scheme2, restTheme, colorScheme) {
39603
39873
  if (!scheme2) {
39604
39874
  return void 0;
39605
39875
  }
@@ -39611,7 +39881,8 @@ function attachColorScheme$1(colorSchemes2, scheme2, restTheme, colorScheme) {
39611
39881
  palette: {
39612
39882
  mode,
39613
39883
  ...scheme2?.palette
39614
- }
39884
+ },
39885
+ colorSpace
39615
39886
  });
39616
39887
  return void 0;
39617
39888
  }
@@ -39623,7 +39894,8 @@ function attachColorScheme$1(colorSchemes2, scheme2, restTheme, colorScheme) {
39623
39894
  palette: {
39624
39895
  mode,
39625
39896
  ...scheme2?.palette
39626
- }
39897
+ },
39898
+ colorSpace
39627
39899
  });
39628
39900
  colorSchemes2[colorScheme] = {
39629
39901
  ...scheme2,
@@ -39644,6 +39916,7 @@ function createThemeWithVars(options = {}, ...args) {
39644
39916
  defaultColorScheme: defaultColorSchemeInput,
39645
39917
  disableCssColorScheme = false,
39646
39918
  cssVarPrefix = "mui",
39919
+ nativeColor = false,
39647
39920
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 = shouldSkipGeneratingVar,
39648
39921
  colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? "media" : void 0,
39649
39922
  rootSelector = ":root",
@@ -39668,12 +39941,16 @@ function createThemeWithVars(options = {}, ...args) {
39668
39941
  if (!defaultScheme) {
39669
39942
  throw new Error(`MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.`);
39670
39943
  }
39671
- const muiTheme = attachColorScheme$1(colorSchemes2, defaultScheme, input, defaultColorScheme);
39944
+ let colorSpace;
39945
+ if (nativeColor) {
39946
+ colorSpace = "oklch";
39947
+ }
39948
+ const muiTheme = attachColorScheme$1(colorSpace, colorSchemes2, defaultScheme, input, defaultColorScheme);
39672
39949
  if (builtInLight && !colorSchemes2.light) {
39673
- attachColorScheme$1(colorSchemes2, builtInLight, void 0, "light");
39950
+ attachColorScheme$1(colorSpace, colorSchemes2, builtInLight, void 0, "light");
39674
39951
  }
39675
39952
  if (builtInDark && !colorSchemes2.dark) {
39676
- attachColorScheme$1(colorSchemes2, builtInDark, void 0, "dark");
39953
+ attachColorScheme$1(colorSpace, colorSchemes2, builtInDark, void 0, "dark");
39677
39954
  }
39678
39955
  let theme = {
39679
39956
  defaultColorScheme,
@@ -39705,12 +39982,28 @@ function createThemeWithVars(options = {}, ...args) {
39705
39982
  setColor(palette.common, "background", "#000");
39706
39983
  setColor(palette.common, "onBackground", "#fff");
39707
39984
  }
39985
+ function colorMix(method2, color2, coefficient) {
39986
+ if (colorSpace) {
39987
+ let mixer;
39988
+ if (method2 === private_safeAlpha) {
39989
+ mixer = `transparent ${((1 - coefficient) * 100).toFixed(0)}%`;
39990
+ }
39991
+ if (method2 === private_safeDarken) {
39992
+ mixer = `#000 ${(coefficient * 100).toFixed(0)}%`;
39993
+ }
39994
+ if (method2 === private_safeLighten) {
39995
+ mixer = `#fff ${(coefficient * 100).toFixed(0)}%`;
39996
+ }
39997
+ return `color-mix(in ${colorSpace}, ${color2}, ${mixer})`;
39998
+ }
39999
+ return method2(color2, coefficient);
40000
+ }
39708
40001
  assignNode(palette, ["Alert", "AppBar", "Avatar", "Button", "Chip", "FilledInput", "LinearProgress", "Skeleton", "Slider", "SnackbarContent", "SpeedDialAction", "StepConnector", "StepContent", "Switch", "TableCell", "Tooltip"]);
39709
40002
  if (palette.mode === "light") {
39710
- setColor(palette.Alert, "errorColor", private_safeDarken(palette.error.light, 0.6));
39711
- setColor(palette.Alert, "infoColor", private_safeDarken(palette.info.light, 0.6));
39712
- setColor(palette.Alert, "successColor", private_safeDarken(palette.success.light, 0.6));
39713
- setColor(palette.Alert, "warningColor", private_safeDarken(palette.warning.light, 0.6));
40003
+ setColor(palette.Alert, "errorColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
40004
+ setColor(palette.Alert, "infoColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
40005
+ setColor(palette.Alert, "successColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
40006
+ setColor(palette.Alert, "warningColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
39714
40007
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-main"));
39715
40008
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-main"));
39716
40009
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-main"));
@@ -39719,10 +40012,10 @@ function createThemeWithVars(options = {}, ...args) {
39719
40012
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.main)));
39720
40013
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.main)));
39721
40014
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.main)));
39722
- setColor(palette.Alert, "errorStandardBg", private_safeLighten(palette.error.light, 0.9));
39723
- setColor(palette.Alert, "infoStandardBg", private_safeLighten(palette.info.light, 0.9));
39724
- setColor(palette.Alert, "successStandardBg", private_safeLighten(palette.success.light, 0.9));
39725
- setColor(palette.Alert, "warningStandardBg", private_safeLighten(palette.warning.light, 0.9));
40015
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
40016
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
40017
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
40018
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
39726
40019
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
39727
40020
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
39728
40021
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -39737,41 +40030,41 @@ function createThemeWithVars(options = {}, ...args) {
39737
40030
  setColor(palette.FilledInput, "bg", "rgba(0, 0, 0, 0.06)");
39738
40031
  setColor(palette.FilledInput, "hoverBg", "rgba(0, 0, 0, 0.09)");
39739
40032
  setColor(palette.FilledInput, "disabledBg", "rgba(0, 0, 0, 0.12)");
39740
- setColor(palette.LinearProgress, "primaryBg", private_safeLighten(palette.primary.main, 0.62));
39741
- setColor(palette.LinearProgress, "secondaryBg", private_safeLighten(palette.secondary.main, 0.62));
39742
- setColor(palette.LinearProgress, "errorBg", private_safeLighten(palette.error.main, 0.62));
39743
- setColor(palette.LinearProgress, "infoBg", private_safeLighten(palette.info.main, 0.62));
39744
- setColor(palette.LinearProgress, "successBg", private_safeLighten(palette.success.main, 0.62));
39745
- setColor(palette.LinearProgress, "warningBg", private_safeLighten(palette.warning.main, 0.62));
39746
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
39747
- setColor(palette.Slider, "primaryTrack", private_safeLighten(palette.primary.main, 0.62));
39748
- setColor(palette.Slider, "secondaryTrack", private_safeLighten(palette.secondary.main, 0.62));
39749
- setColor(palette.Slider, "errorTrack", private_safeLighten(palette.error.main, 0.62));
39750
- setColor(palette.Slider, "infoTrack", private_safeLighten(palette.info.main, 0.62));
39751
- setColor(palette.Slider, "successTrack", private_safeLighten(palette.success.main, 0.62));
39752
- setColor(palette.Slider, "warningTrack", private_safeLighten(palette.warning.main, 0.62));
39753
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.8);
40033
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
40034
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
40035
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
40036
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
40037
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
40038
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.62));
40039
+ setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.11) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.11)`);
40040
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
40041
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
40042
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
40043
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
40044
+ setColor(palette.Slider, "successTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
40045
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
40046
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeDarken, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.6825) : private_safeEmphasize(palette.background.default, 0.8);
39754
40047
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
39755
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
40048
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? dark.text.primary : palette.getContrastText(snackbarContentBackground)));
39756
40049
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
39757
40050
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-400"));
39758
40051
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-400"));
39759
40052
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-common-white"));
39760
40053
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-100"));
39761
- setColor(palette.Switch, "primaryDisabledColor", private_safeLighten(palette.primary.main, 0.62));
39762
- setColor(palette.Switch, "secondaryDisabledColor", private_safeLighten(palette.secondary.main, 0.62));
39763
- setColor(palette.Switch, "errorDisabledColor", private_safeLighten(palette.error.main, 0.62));
39764
- setColor(palette.Switch, "infoDisabledColor", private_safeLighten(palette.info.main, 0.62));
39765
- setColor(palette.Switch, "successDisabledColor", private_safeLighten(palette.success.main, 0.62));
39766
- setColor(palette.Switch, "warningDisabledColor", private_safeLighten(palette.warning.main, 0.62));
39767
- setColor(palette.TableCell, "border", private_safeLighten(private_safeAlpha(palette.divider, 1), 0.88));
39768
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
40054
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.62));
40055
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.62));
40056
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.62));
40057
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.62));
40058
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.62));
40059
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.62));
40060
+ setColor(palette.TableCell, "border", colorMix(private_safeLighten, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.88));
40061
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
39769
40062
  }
39770
40063
  if (palette.mode === "dark") {
39771
- setColor(palette.Alert, "errorColor", private_safeLighten(palette.error.light, 0.6));
39772
- setColor(palette.Alert, "infoColor", private_safeLighten(palette.info.light, 0.6));
39773
- setColor(palette.Alert, "successColor", private_safeLighten(palette.success.light, 0.6));
39774
- setColor(palette.Alert, "warningColor", private_safeLighten(palette.warning.light, 0.6));
40064
+ setColor(palette.Alert, "errorColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.6));
40065
+ setColor(palette.Alert, "infoColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.6));
40066
+ setColor(palette.Alert, "successColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.6));
40067
+ setColor(palette.Alert, "warningColor", colorMix(private_safeLighten, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.6));
39775
40068
  setColor(palette.Alert, "errorFilledBg", setCssVarColor("palette-error-dark"));
39776
40069
  setColor(palette.Alert, "infoFilledBg", setCssVarColor("palette-info-dark"));
39777
40070
  setColor(palette.Alert, "successFilledBg", setCssVarColor("palette-success-dark"));
@@ -39780,10 +40073,10 @@ function createThemeWithVars(options = {}, ...args) {
39780
40073
  setColor(palette.Alert, "infoFilledColor", silent(() => palette.getContrastText(palette.info.dark)));
39781
40074
  setColor(palette.Alert, "successFilledColor", silent(() => palette.getContrastText(palette.success.dark)));
39782
40075
  setColor(palette.Alert, "warningFilledColor", silent(() => palette.getContrastText(palette.warning.dark)));
39783
- setColor(palette.Alert, "errorStandardBg", private_safeDarken(palette.error.light, 0.9));
39784
- setColor(palette.Alert, "infoStandardBg", private_safeDarken(palette.info.light, 0.9));
39785
- setColor(palette.Alert, "successStandardBg", private_safeDarken(palette.success.light, 0.9));
39786
- setColor(palette.Alert, "warningStandardBg", private_safeDarken(palette.warning.light, 0.9));
40076
+ setColor(palette.Alert, "errorStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-light") : palette.error.light, 0.9));
40077
+ setColor(palette.Alert, "infoStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-light") : palette.info.light, 0.9));
40078
+ setColor(palette.Alert, "successStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-light") : palette.success.light, 0.9));
40079
+ setColor(palette.Alert, "warningStandardBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.light, 0.9));
39787
40080
  setColor(palette.Alert, "errorIconColor", setCssVarColor("palette-error-main"));
39788
40081
  setColor(palette.Alert, "infoIconColor", setCssVarColor("palette-info-main"));
39789
40082
  setColor(palette.Alert, "successIconColor", setCssVarColor("palette-success-main"));
@@ -39800,44 +40093,46 @@ function createThemeWithVars(options = {}, ...args) {
39800
40093
  setColor(palette.FilledInput, "bg", "rgba(255, 255, 255, 0.09)");
39801
40094
  setColor(palette.FilledInput, "hoverBg", "rgba(255, 255, 255, 0.13)");
39802
40095
  setColor(palette.FilledInput, "disabledBg", "rgba(255, 255, 255, 0.12)");
39803
- setColor(palette.LinearProgress, "primaryBg", private_safeDarken(palette.primary.main, 0.5));
39804
- setColor(palette.LinearProgress, "secondaryBg", private_safeDarken(palette.secondary.main, 0.5));
39805
- setColor(palette.LinearProgress, "errorBg", private_safeDarken(palette.error.main, 0.5));
39806
- setColor(palette.LinearProgress, "infoBg", private_safeDarken(palette.info.main, 0.5));
39807
- setColor(palette.LinearProgress, "successBg", private_safeDarken(palette.success.main, 0.5));
39808
- setColor(palette.LinearProgress, "warningBg", private_safeDarken(palette.warning.main, 0.5));
39809
- setColor(palette.Skeleton, "bg", `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
39810
- setColor(palette.Slider, "primaryTrack", private_safeDarken(palette.primary.main, 0.5));
39811
- setColor(palette.Slider, "secondaryTrack", private_safeDarken(palette.secondary.main, 0.5));
39812
- setColor(palette.Slider, "errorTrack", private_safeDarken(palette.error.main, 0.5));
39813
- setColor(palette.Slider, "infoTrack", private_safeDarken(palette.info.main, 0.5));
39814
- setColor(palette.Slider, "successTrack", private_safeDarken(palette.success.main, 0.5));
39815
- setColor(palette.Slider, "warningTrack", private_safeDarken(palette.warning.main, 0.5));
39816
- const snackbarContentBackground = private_safeEmphasize(palette.background.default, 0.98);
40096
+ setColor(palette.LinearProgress, "primaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
40097
+ setColor(palette.LinearProgress, "secondaryBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
40098
+ setColor(palette.LinearProgress, "errorBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
40099
+ setColor(palette.LinearProgress, "infoBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
40100
+ setColor(palette.LinearProgress, "successBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
40101
+ setColor(palette.LinearProgress, "warningBg", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-main") : palette.warning.main, 0.5));
40102
+ setColor(palette.Skeleton, "bg", colorSpace ? colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-text-primary") : palette.text.primary, 0.13) : `rgba(${setCssVarColor("palette-text-primaryChannel")} / 0.13)`);
40103
+ setColor(palette.Slider, "primaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.5));
40104
+ setColor(palette.Slider, "secondaryTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.5));
40105
+ setColor(palette.Slider, "errorTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.5));
40106
+ setColor(palette.Slider, "infoTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.5));
40107
+ setColor(palette.Slider, "successTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.5));
40108
+ setColor(palette.Slider, "warningTrack", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.5));
40109
+ const snackbarContentBackground = colorSpace ? colorMix(private_safeLighten, nativeColor ? getCssVar("palette-background-default") : palette.background.default, 0.985) : private_safeEmphasize(palette.background.default, 0.98);
39817
40110
  setColor(palette.SnackbarContent, "bg", snackbarContentBackground);
39818
- setColor(palette.SnackbarContent, "color", silent(() => palette.getContrastText(snackbarContentBackground)));
40111
+ setColor(palette.SnackbarContent, "color", silent(() => colorSpace ? light.text.primary : palette.getContrastText(snackbarContentBackground)));
39819
40112
  setColor(palette.SpeedDialAction, "fabHoverBg", private_safeEmphasize(palette.background.paper, 0.15));
39820
40113
  setColor(palette.StepConnector, "border", setCssVarColor("palette-grey-600"));
39821
40114
  setColor(palette.StepContent, "border", setCssVarColor("palette-grey-600"));
39822
40115
  setColor(palette.Switch, "defaultColor", setCssVarColor("palette-grey-300"));
39823
40116
  setColor(palette.Switch, "defaultDisabledColor", setCssVarColor("palette-grey-600"));
39824
- setColor(palette.Switch, "primaryDisabledColor", private_safeDarken(palette.primary.main, 0.55));
39825
- setColor(palette.Switch, "secondaryDisabledColor", private_safeDarken(palette.secondary.main, 0.55));
39826
- setColor(palette.Switch, "errorDisabledColor", private_safeDarken(palette.error.main, 0.55));
39827
- setColor(palette.Switch, "infoDisabledColor", private_safeDarken(palette.info.main, 0.55));
39828
- setColor(palette.Switch, "successDisabledColor", private_safeDarken(palette.success.main, 0.55));
39829
- setColor(palette.Switch, "warningDisabledColor", private_safeDarken(palette.warning.main, 0.55));
39830
- setColor(palette.TableCell, "border", private_safeDarken(private_safeAlpha(palette.divider, 1), 0.68));
39831
- setColor(palette.Tooltip, "bg", private_safeAlpha(palette.grey[700], 0.92));
39832
- }
39833
- setColorChannel(palette.background, "default");
39834
- setColorChannel(palette.background, "paper");
39835
- setColorChannel(palette.common, "background");
39836
- setColorChannel(palette.common, "onBackground");
39837
- setColorChannel(palette, "divider");
40117
+ setColor(palette.Switch, "primaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-primary-main") : palette.primary.main, 0.55));
40118
+ setColor(palette.Switch, "secondaryDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-secondary-main") : palette.secondary.main, 0.55));
40119
+ setColor(palette.Switch, "errorDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-error-main") : palette.error.main, 0.55));
40120
+ setColor(palette.Switch, "infoDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-info-main") : palette.info.main, 0.55));
40121
+ setColor(palette.Switch, "successDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-success-main") : palette.success.main, 0.55));
40122
+ setColor(palette.Switch, "warningDisabledColor", colorMix(private_safeDarken, nativeColor ? getCssVar("palette-warning-light") : palette.warning.main, 0.55));
40123
+ setColor(palette.TableCell, "border", colorMix(private_safeDarken, private_safeAlpha(nativeColor ? getCssVar("palette-divider") : palette.divider, 1), 0.68));
40124
+ setColor(palette.Tooltip, "bg", colorMix(private_safeAlpha, nativeColor ? getCssVar("palette-grey-700") : palette.grey[700], 0.92));
40125
+ }
40126
+ if (!nativeColor) {
40127
+ setColorChannel(palette.background, "default");
40128
+ setColorChannel(palette.background, "paper");
40129
+ setColorChannel(palette.common, "background");
40130
+ setColorChannel(palette.common, "onBackground");
40131
+ setColorChannel(palette, "divider");
40132
+ }
39838
40133
  Object.keys(palette).forEach((color2) => {
39839
40134
  const colors2 = palette[color2];
39840
- if (color2 !== "tonalOffset" && colors2 && typeof colors2 === "object") {
40135
+ if (color2 !== "tonalOffset" && !nativeColor && colors2 && typeof colors2 === "object") {
39841
40136
  if (colors2.main) {
39842
40137
  setColor(palette[color2], "mainChannel", private_safeColorChannel(toRgb(colors2.main)));
39843
40138
  }
@@ -39866,11 +40161,16 @@ function createThemeWithVars(options = {}, ...args) {
39866
40161
  });
39867
40162
  });
39868
40163
  theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
40164
+ const focusVisibleInput = mergeFocusVisibleInput(options.focusVisible, args);
40165
+ if (focusVisibleInput != null && focusVisibleInput !== false) {
40166
+ theme.focusVisible = resolveFocusVisible(focusVisibleInput, getCssVar("palette-primary-main"));
40167
+ }
39869
40168
  const parserConfig = {
39870
40169
  prefix: cssVarPrefix,
39871
40170
  disableCssColorScheme,
39872
40171
  shouldSkipGeneratingVar: shouldSkipGeneratingVar$1,
39873
- getSelector: defaultGetSelector(theme)
40172
+ getSelector: defaultGetSelector(theme),
40173
+ enableContrastVars: nativeColor
39874
40174
  };
39875
40175
  const {
39876
40176
  vars,
@@ -39899,6 +40199,7 @@ function createThemeWithVars(options = {}, ...args) {
39899
40199
  theme: this
39900
40200
  });
39901
40201
  };
40202
+ theme.internal_cache = {};
39902
40203
  theme.toRuntimeSource = stringifyTheme;
39903
40204
  return theme;
39904
40205
  }
@@ -39925,7 +40226,7 @@ function createTheme(options = {}, ...args) {
39925
40226
  light: true
39926
40227
  } : void 0,
39927
40228
  defaultColorScheme: initialDefaultColorScheme = palette?.mode,
39928
- ...rest
40229
+ ...other
39929
40230
  } = options;
39930
40231
  const defaultColorSchemeInput = initialDefaultColorScheme || "light";
39931
40232
  const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
@@ -39974,18 +40275,74 @@ function createTheme(options = {}, ...args) {
39974
40275
  };
39975
40276
  attachColorScheme(theme, "light", colorSchemesInput.light);
39976
40277
  }
40278
+ if (theme.focusVisible != null && theme.focusVisible !== false) {
40279
+ let focusVisibleInput = theme.focusVisible;
40280
+ const rawFocusVisible = mergeFocusVisibleInput(options.focusVisible, args);
40281
+ const authoredColor = rawFocusVisible && typeof rawFocusVisible === "object" ? rawFocusVisible.outlineColor : void 0;
40282
+ if (!authoredColor || isResolvedFocusVisible(rawFocusVisible) && authoredColor === theme.palette.primary.main) {
40283
+ const {
40284
+ outlineColor: outlineColor2,
40285
+ ...rest
40286
+ } = focusVisibleInput;
40287
+ focusVisibleInput = rest;
40288
+ }
40289
+ Object.keys(theme.colorSchemes).forEach((scheme2) => {
40290
+ const schemePalette = theme.colorSchemes?.[scheme2]?.palette;
40291
+ if (schemePalette?.primary) {
40292
+ theme.colorSchemes[scheme2].focusVisible = resolveFocusVisible(focusVisibleInput, schemePalette.primary.main);
40293
+ }
40294
+ });
40295
+ }
39977
40296
  return theme;
39978
40297
  }
39979
40298
  if (!palette && !("light" in colorSchemesInput) && defaultColorSchemeInput === "light") {
39980
40299
  colorSchemesInput.light = true;
39981
40300
  }
39982
40301
  return createThemeWithVars({
39983
- ...rest,
40302
+ ...other,
39984
40303
  colorSchemes: colorSchemesInput,
39985
40304
  defaultColorScheme: defaultColorSchemeInput,
39986
40305
  ...typeof cssVariables !== "boolean" && cssVariables
39987
40306
  }, ...args);
39988
40307
  }
40308
+ function useForkRef$1(...refs) {
40309
+ const cleanupRef = React$1.useRef(void 0);
40310
+ const refEffect = React$1.useCallback((instance) => {
40311
+ const cleanups = refs.map((ref2) => {
40312
+ if (ref2 == null) {
40313
+ return null;
40314
+ }
40315
+ if (typeof ref2 === "function") {
40316
+ const refCallback = ref2;
40317
+ const refCleanup = refCallback(instance);
40318
+ return typeof refCleanup === "function" ? refCleanup : () => {
40319
+ refCallback(null);
40320
+ };
40321
+ }
40322
+ ref2.current = instance;
40323
+ return () => {
40324
+ ref2.current = null;
40325
+ };
40326
+ });
40327
+ return () => {
40328
+ cleanups.forEach((refCleanup) => refCleanup?.());
40329
+ };
40330
+ }, refs);
40331
+ return React$1.useMemo(() => {
40332
+ if (refs.every((ref2) => ref2 == null)) {
40333
+ return null;
40334
+ }
40335
+ return (value2) => {
40336
+ if (cleanupRef.current) {
40337
+ cleanupRef.current();
40338
+ cleanupRef.current = void 0;
40339
+ }
40340
+ if (value2 != null) {
40341
+ cleanupRef.current = refEffect(value2);
40342
+ }
40343
+ };
40344
+ }, refs);
40345
+ }
39989
40346
  const defaultTheme = createTheme();
39990
40347
  function useTheme() {
39991
40348
  const theme = useTheme$1(defaultTheme);
@@ -40003,20 +40360,6 @@ const styled = createStyled2({
40003
40360
  defaultTheme,
40004
40361
  rootShouldForwardProp
40005
40362
  });
40006
- const { makeStyles } = createMakeAndWithStyles({
40007
- useTheme
40008
- });
40009
- const { tss } = createTss({
40010
- "useContext": function useContext2() {
40011
- const theme = useTheme();
40012
- return { theme };
40013
- },
40014
- "usePlugin": useMuiThemeStyleOverridesPlugin
40015
- });
40016
- const useStyles$1 = tss.create({});
40017
- function internal_createExtendSxProp() {
40018
- return extendSxProp$1;
40019
- }
40020
40363
  const memoTheme = unstable_memoTheme;
40021
40364
  ({
40022
40365
  // ┌────────────────────────────── Warning ──────────────────────────────┐
@@ -40035,6 +40378,17 @@ const memoTheme = unstable_memoTheme;
40035
40378
  function useDefaultProps(params2) {
40036
40379
  return useDefaultProps$1(params2);
40037
40380
  }
40381
+ const { makeStyles } = createMakeAndWithStyles({
40382
+ useTheme
40383
+ });
40384
+ const { tss } = createTss({
40385
+ "useContext": function useContext2() {
40386
+ const theme = useTheme();
40387
+ return { theme };
40388
+ },
40389
+ "usePlugin": useMuiThemeStyleOverridesPlugin
40390
+ });
40391
+ const useStyles$1 = tss.create({});
40038
40392
  function setRef$1(ref2, value2) {
40039
40393
  if (typeof ref2 === "function") {
40040
40394
  ref2(value2);
@@ -40042,56 +40396,6 @@ function setRef$1(ref2, value2) {
40042
40396
  ref2.current = value2;
40043
40397
  }
40044
40398
  }
40045
- function useForkRef$1(...refs) {
40046
- const cleanupRef = React$1.useRef(void 0);
40047
- const refEffect = React$1.useCallback((instance) => {
40048
- const cleanups = refs.map((ref2) => {
40049
- if (ref2 == null) {
40050
- return null;
40051
- }
40052
- if (typeof ref2 === "function") {
40053
- const refCallback = ref2;
40054
- const refCleanup = refCallback(instance);
40055
- return typeof refCleanup === "function" ? refCleanup : () => {
40056
- refCallback(null);
40057
- };
40058
- }
40059
- ref2.current = instance;
40060
- return () => {
40061
- ref2.current = null;
40062
- };
40063
- });
40064
- return () => {
40065
- cleanups.forEach((refCleanup) => refCleanup?.());
40066
- };
40067
- }, refs);
40068
- return React$1.useMemo(() => {
40069
- if (refs.every((ref2) => ref2 == null)) {
40070
- return null;
40071
- }
40072
- return (value2) => {
40073
- if (cleanupRef.current) {
40074
- cleanupRef.current();
40075
- cleanupRef.current = void 0;
40076
- }
40077
- if (value2 != null) {
40078
- cleanupRef.current = refEffect(value2);
40079
- }
40080
- };
40081
- }, refs);
40082
- }
40083
- function _setPrototypeOf(t4, e3) {
40084
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t5, e4) {
40085
- return t5.__proto__ = e4, t5;
40086
- }, _setPrototypeOf(t4, e3);
40087
- }
40088
- function _inheritsLoose(t4, o) {
40089
- t4.prototype = Object.create(o.prototype), t4.prototype.constructor = t4, _setPrototypeOf(t4, o);
40090
- }
40091
- function _assertThisInitialized(e3) {
40092
- if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
40093
- return e3;
40094
- }
40095
40399
  function hasCorrectMainProperty(obj) {
40096
40400
  return typeof obj.main === "string";
40097
40401
  }
@@ -40126,22 +40430,22 @@ function getReactElementRef(element2) {
40126
40430
  }
40127
40431
  return element2?.ref || null;
40128
40432
  }
40129
- function getContainer(container) {
40130
- return typeof container === "function" ? container() : container;
40433
+ function getContainer(container2) {
40434
+ return typeof container2 === "function" ? container2() : container2;
40131
40435
  }
40132
40436
  const Portal = /* @__PURE__ */ React$1.forwardRef(function Portal2(props, forwardedRef) {
40133
40437
  const {
40134
40438
  children: children2,
40135
- container,
40439
+ container: container2,
40136
40440
  disablePortal = false
40137
40441
  } = props;
40138
40442
  const [mountNode, setMountNode] = React$1.useState(null);
40139
40443
  const handleRef = useForkRef$1(/* @__PURE__ */ React$1.isValidElement(children2) ? getReactElementRef(children2) : null, forwardedRef);
40140
40444
  useEnhancedEffect$1(() => {
40141
40445
  if (!disablePortal) {
40142
- setMountNode(getContainer(container) || document.body);
40446
+ setMountNode(getContainer(container2) || document.body);
40143
40447
  }
40144
- }, [container, disablePortal]);
40448
+ }, [container2, disablePortal]);
40145
40449
  useEnhancedEffect$1(() => {
40146
40450
  if (mountNode && !disablePortal) {
40147
40451
  setRef$1(forwardedRef, mountNode);
@@ -40194,30 +40498,17 @@ Portal.propTypes = {
40194
40498
  function getTypographyUtilityClass(slot) {
40195
40499
  return generateUtilityClass("MuiTypography", slot);
40196
40500
  }
40197
- generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]);
40198
- const v6Colors = {
40199
- primary: true,
40200
- secondary: true,
40201
- error: true,
40202
- info: true,
40203
- success: true,
40204
- warning: true,
40205
- textPrimary: true,
40206
- textSecondary: true,
40207
- textDisabled: true
40208
- };
40209
- const extendSxProp = internal_createExtendSxProp();
40501
+ generateUtilityClasses("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom"]);
40210
40502
  const useUtilityClasses = (ownerState) => {
40211
40503
  const {
40212
40504
  align: align2,
40213
40505
  gutterBottom,
40214
40506
  noWrap,
40215
- paragraph,
40216
40507
  variant,
40217
40508
  classes
40218
40509
  } = ownerState;
40219
40510
  const slots = {
40220
- root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize$1(align2)}`, gutterBottom && "gutterBottom", noWrap && "noWrap", paragraph && "paragraph"]
40511
+ root: ["root", variant, ownerState.align !== "inherit" && `align${capitalize$1(align2)}`, gutterBottom && "gutterBottom", noWrap && "noWrap"]
40221
40512
  };
40222
40513
  return composeClasses(slots, getTypographyUtilityClass, classes);
40223
40514
  };
@@ -40228,7 +40519,7 @@ const TypographyRoot = styled("span", {
40228
40519
  const {
40229
40520
  ownerState
40230
40521
  } = props;
40231
- return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize$1(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];
40522
+ return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== "inherit" && styles[`align${capitalize$1(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom];
40232
40523
  }
40233
40524
  })(memoTheme(({
40234
40525
  theme
@@ -40286,13 +40577,6 @@ const TypographyRoot = styled("span", {
40286
40577
  style: {
40287
40578
  marginBottom: "0.35em"
40288
40579
  }
40289
- }, {
40290
- props: ({
40291
- ownerState
40292
- }) => ownerState.paragraph,
40293
- style: {
40294
- marginBottom: 16
40295
- }
40296
40580
  }]
40297
40581
  })));
40298
40582
  const defaultVariantMapping = {
@@ -40309,27 +40593,17 @@ const defaultVariantMapping = {
40309
40593
  inherit: "p"
40310
40594
  };
40311
40595
  const Typography = /* @__PURE__ */ React$1.forwardRef(function Typography2(inProps, ref2) {
40312
- const {
40313
- color: color2,
40314
- ...themeProps
40315
- } = useDefaultProps({
40596
+ const props = useDefaultProps({
40316
40597
  props: inProps,
40317
40598
  name: "MuiTypography"
40318
40599
  });
40319
- const isSxColor = !v6Colors[color2];
40320
- const props = extendSxProp({
40321
- ...themeProps,
40322
- ...isSxColor && {
40323
- color: color2
40324
- }
40325
- });
40326
40600
  const {
40601
+ color: color2,
40327
40602
  align: align2 = "inherit",
40328
40603
  className,
40329
40604
  component,
40330
40605
  gutterBottom = false,
40331
40606
  noWrap = false,
40332
- paragraph = false,
40333
40607
  variant = "body1",
40334
40608
  variantMapping = defaultVariantMapping,
40335
40609
  ...other
@@ -40342,11 +40616,10 @@ const Typography = /* @__PURE__ */ React$1.forwardRef(function Typography2(inPro
40342
40616
  component,
40343
40617
  gutterBottom,
40344
40618
  noWrap,
40345
- paragraph,
40346
40619
  variant,
40347
40620
  variantMapping
40348
40621
  };
40349
- const Component = component || (paragraph ? "p" : variantMapping[variant] || defaultVariantMapping[variant]) || "span";
40622
+ const Component = component || variantMapping[variant] || defaultVariantMapping[variant] || "span";
40350
40623
  const classes = useUtilityClasses(ownerState);
40351
40624
  return /* @__PURE__ */ jsx$1(TypographyRoot, {
40352
40625
  as: Component,
@@ -40408,12 +40681,6 @@ Typography.propTypes = {
40408
40681
  * @default false
40409
40682
  */
40410
40683
  noWrap: _pt.bool,
40411
- /**
40412
- * If `true`, the element will be a paragraph element.
40413
- * @default false
40414
- * @deprecated Use the `component` prop instead. This prop will be removed in a future major release. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
40415
- */
40416
- paragraph: _pt.bool,
40417
40684
  /**
40418
40685
  * @ignore
40419
40686
  */
@@ -42043,7 +42310,7 @@ function getAnchorEl(anchorEl) {
42043
42310
  const useEnhancedEffect = typeof window !== "undefined" ? React$1.useLayoutEffect : React$1.useEffect;
42044
42311
  const defaultPopperOptions = {};
42045
42312
  React$1.forwardRef((props, ref2) => {
42046
- const { anchorEl, children: children2, container, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
42313
+ const { anchorEl, children: children2, container: container2, disablePortal = false, keepMounted = false, modifiers: modifiers2, open, placement: initialPlacement = "bottom", popperOptions = defaultPopperOptions, popperRef: popperRefProp, style: style2, transition = false, ...other } = props;
42047
42314
  const tooltipRef = React$1.useRef(null);
42048
42315
  const ownRef = useForkRef(tooltipRef, ref2);
42049
42316
  const popperRef = React$1.useRef(null);
@@ -42140,7 +42407,7 @@ React$1.forwardRef((props, ref2) => {
42140
42407
  onExited: handleExited
42141
42408
  };
42142
42409
  }
42143
- return jsx$1(Portal, { disablePortal, container, children: jsx$1("div", { ref: handleRef, role: "tooltip", ...other, style: {
42410
+ return jsx$1(Portal, { disablePortal, container: container2, children: jsx$1("div", { ref: handleRef, role: "tooltip", ...other, style: {
42144
42411
  // Prevents scroll issue, waiting for Popper.js to add this style once initiated.
42145
42412
  position: "fixed",
42146
42413
  // Fix Popper.js display issue
@@ -42150,6 +42417,18 @@ React$1.forwardRef((props, ref2) => {
42150
42417
  ...style2
42151
42418
  }, children: typeof children2 === "function" ? children2(childProps) : children2 }) });
42152
42419
  });
42420
+ function _assertThisInitialized(e3) {
42421
+ if (void 0 === e3) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
42422
+ return e3;
42423
+ }
42424
+ function _setPrototypeOf(t4, e3) {
42425
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t5, e4) {
42426
+ return t5.__proto__ = e4, t5;
42427
+ }, _setPrototypeOf(t4, e3);
42428
+ }
42429
+ function _inheritsLoose(t4, o) {
42430
+ t4.prototype = Object.create(o.prototype), t4.prototype.constructor = t4, _setPrototypeOf(t4, o);
42431
+ }
42153
42432
  var safeIsNaN = Number.isNaN || function ponyfill(value2) {
42154
42433
  return typeof value2 === "number" && value2 !== value2;
42155
42434
  };
@@ -51765,6 +52044,7 @@ const CoordinationType$1 = {
51765
52044
  SPATIAL_ROTATION_ORBIT: "spatialRotationOrbit",
51766
52045
  SPATIAL_ORBIT_AXIS: "spatialOrbitAxis",
51767
52046
  SPATIAL_AXIS_FIXED: "spatialAxisFixed",
52047
+ SPATIAL_CAMERA_SNAPSHOT: "spatialCameraSnapshot",
51768
52048
  HEATMAP_ZOOM_X: "heatmapZoomX",
51769
52049
  HEATMAP_ZOOM_Y: "heatmapZoomY",
51770
52050
  HEATMAP_TARGET_X: "heatmapTargetX",
@@ -51816,6 +52096,7 @@ const CoordinationType$1 = {
51816
52096
  SPATIAL_TARGET_C: "spatialTargetC",
51817
52097
  SPATIAL_LAYER_VISIBLE: "spatialLayerVisible",
51818
52098
  SPATIAL_LAYER_OPACITY: "spatialLayerOpacity",
52099
+ SPATIAL_LAYER_OPACITY_UNSELECTED: "spatialLayerOpacityUnselected",
51819
52100
  SPATIAL_LAYER_COLORMAP: "spatialLayerColormap",
51820
52101
  SPATIAL_LAYER_LABEL: "spatialLayerLabel",
51821
52102
  SPATIAL_LAYER_TRANSPARENT_COLOR: "spatialLayerTransparentColor",
@@ -52181,6 +52462,7 @@ const CoordinationType$1 = {
52181
52462
  CoordinationType$1.SPATIAL_ROTATION_ORBIT,
52182
52463
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
52183
52464
  CoordinationType$1.SPATIAL_ZOOM,
52465
+ CoordinationType$1.SPATIAL_CAMERA_SNAPSHOT,
52184
52466
  CoordinationType$1.OBS_FILTER,
52185
52467
  CoordinationType$1.OBS_HIGHLIGHT,
52186
52468
  CoordinationType$1.OBS_SET_SELECTION,
@@ -52206,6 +52488,7 @@ const CoordinationType$1 = {
52206
52488
  CoordinationType$1.FEATURE_VALUE_COLORMAP_RANGE,
52207
52489
  CoordinationType$1.SPATIAL_LAYER_COLOR,
52208
52490
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
52491
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
52209
52492
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
52210
52493
  CoordinationType$1.SPATIAL_LAYER_LABEL,
52211
52494
  CoordinationType$1.SPATIAL_CHANNEL_COLOR,
@@ -52410,6 +52693,7 @@ const CoordinationType$1 = {
52410
52693
  CoordinationType$1.SPATIAL_ROTATION_ORBIT,
52411
52694
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
52412
52695
  CoordinationType$1.SPATIAL_AXIS_FIXED,
52696
+ CoordinationType$1.SPATIAL_CAMERA_SNAPSHOT,
52413
52697
  CoordinationType$1.OBS_FILTER,
52414
52698
  CoordinationType$1.OBS_HIGHLIGHT,
52415
52699
  CoordinationType$1.OBS_SET_SELECTION,
@@ -52431,6 +52715,7 @@ const CoordinationType$1 = {
52431
52715
  CoordinationType$1.SPATIAL_TARGET_C,
52432
52716
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
52433
52717
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
52718
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
52434
52719
  CoordinationType$1.SPATIAL_LAYER_COLORMAP,
52435
52720
  CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
52436
52721
  CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
@@ -52626,6 +52911,7 @@ const CoordinationType$1 = {
52626
52911
  CoordinationType$1.SPATIAL_LAYER_VISIBLE,
52627
52912
  CoordinationType$1.SPATIAL_LAYER_LABEL,
52628
52913
  CoordinationType$1.SPATIAL_LAYER_OPACITY,
52914
+ CoordinationType$1.SPATIAL_LAYER_OPACITY_UNSELECTED,
52629
52915
  CoordinationType$1.SPATIAL_LAYER_COLORMAP,
52630
52916
  CoordinationType$1.SPATIAL_LAYER_TRANSPARENT_COLOR,
52631
52917
  CoordinationType$1.SPATIAL_LAYER_MODEL_MATRIX,
@@ -75527,7 +75813,7 @@ function _embed(_x5, _x6) {
75527
75813
  function _embed3() {
75528
75814
  _embed3 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime.mark(function _callee4(el, spec) {
75529
75815
  var _opts$config, _opts$actions, _opts$renderer, _opts$logLevel, _opts$downloadFileNam, _ref, _expressionInterprete;
75530
- var opts2, loader2, config, actions, i18n, renderer, logLevel, downloadFileName, element2, ID, _getRoot, root2, rootContainer, style2, mode, vgSpec, parsed, container, chartWrapper, patch2, name, expressionFunction2, ast, runtime2, view, handler, hover2, _ref2, hoverSet, updateSet, documentClickHandler, wrapper2, details, summary, ctrl, _iterator, _step, _loop, viewSourceLink, compileLink, _opts$editorUrl, editorUrl, editorLink, finalize2, _args4 = arguments;
75816
+ var opts2, loader2, config, actions, i18n, renderer, logLevel, downloadFileName, element2, ID, _getRoot, root2, rootContainer, style2, mode, vgSpec, parsed, container2, chartWrapper, patch2, name, expressionFunction2, ast, runtime2, view, handler, hover2, _ref2, hoverSet, updateSet, documentClickHandler, wrapper2, details, summary, ctrl, _iterator, _step, _loop, viewSourceLink, compileLink, _opts$editorUrl, editorUrl, editorLink, finalize2, _args4 = arguments;
75531
75817
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
75532
75818
  while (1) {
75533
75819
  switch (_context4.prev = _context4.next) {
@@ -75578,12 +75864,12 @@ function _embed3() {
75578
75864
  element2.classList.add("has-actions");
75579
75865
  }
75580
75866
  element2.innerHTML = "";
75581
- container = element2;
75867
+ container2 = element2;
75582
75868
  if (actions) {
75583
75869
  chartWrapper = document.createElement("div");
75584
75870
  chartWrapper.classList.add(CHART_WRAPPER_CLASS);
75585
75871
  element2.appendChild(chartWrapper);
75586
- container = chartWrapper;
75872
+ container2 = chartWrapper;
75587
75873
  }
75588
75874
  patch2 = opts2.patch;
75589
75875
  if (patch2) {
@@ -75619,15 +75905,15 @@ function _embed3() {
75619
75905
  view.addSignalListener("autosize", (_, autosize) => {
75620
75906
  var type2 = autosize.type;
75621
75907
  if (type2 == "fit-x") {
75622
- container.classList.add("fit-x");
75623
- container.classList.remove("fit-y");
75908
+ container2.classList.add("fit-x");
75909
+ container2.classList.remove("fit-y");
75624
75910
  } else if (type2 == "fit-y") {
75625
- container.classList.remove("fit-x");
75626
- container.classList.add("fit-y");
75911
+ container2.classList.remove("fit-x");
75912
+ container2.classList.add("fit-y");
75627
75913
  } else if (type2 == "fit") {
75628
- container.classList.add("fit-x", "fit-y");
75914
+ container2.classList.add("fit-x", "fit-y");
75629
75915
  } else {
75630
- container.classList.remove("fit-x", "fit-y");
75916
+ container2.classList.remove("fit-x", "fit-y");
75631
75917
  }
75632
75918
  });
75633
75919
  if (opts2.tooltip !== false) {
@@ -75657,7 +75943,7 @@ function _embed3() {
75657
75943
  }
75658
75944
  }
75659
75945
  _context4.next = 37;
75660
- return view.initialize(container, opts2.bind).runAsync();
75946
+ return view.initialize(container2, opts2.bind).runAsync();
75661
75947
  case 37:
75662
75948
  if (actions !== false) {
75663
75949
  wrapper2 = element2;