/** * @mui/material v5.15.15 * * @license MIT * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom')) : typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MaterialUI = {}, global.React, global.ReactDOM)); })(this, (function (exports, React, ReactDOM) { 'use strict'; 'use client'; function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React); var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM); var common = { black: '#000', white: '#fff' }; var common$1 = common; var red = { 50: '#ffebee', 100: '#ffcdd2', 200: '#ef9a9a', 300: '#e57373', 400: '#ef5350', 500: '#f44336', 600: '#e53935', 700: '#d32f2f', 800: '#c62828', 900: '#b71c1c', A100: '#ff8a80', A200: '#ff5252', A400: '#ff1744', A700: '#d50000' }; var red$1 = red; var pink = { 50: '#fce4ec', 100: '#f8bbd0', 200: '#f48fb1', 300: '#f06292', 400: '#ec407a', 500: '#e91e63', 600: '#d81b60', 700: '#c2185b', 800: '#ad1457', 900: '#880e4f', A100: '#ff80ab', A200: '#ff4081', A400: '#f50057', A700: '#c51162' }; var pink$1 = pink; var purple = { 50: '#f3e5f5', 100: '#e1bee7', 200: '#ce93d8', 300: '#ba68c8', 400: '#ab47bc', 500: '#9c27b0', 600: '#8e24aa', 700: '#7b1fa2', 800: '#6a1b9a', 900: '#4a148c', A100: '#ea80fc', A200: '#e040fb', A400: '#d500f9', A700: '#aa00ff' }; var purple$1 = purple; var deepPurple = { 50: '#ede7f6', 100: '#d1c4e9', 200: '#b39ddb', 300: '#9575cd', 400: '#7e57c2', 500: '#673ab7', 600: '#5e35b1', 700: '#512da8', 800: '#4527a0', 900: '#311b92', A100: '#b388ff', A200: '#7c4dff', A400: '#651fff', A700: '#6200ea' }; var deepPurple$1 = deepPurple; var indigo = { 50: '#e8eaf6', 100: '#c5cae9', 200: '#9fa8da', 300: '#7986cb', 400: '#5c6bc0', 500: '#3f51b5', 600: '#3949ab', 700: '#303f9f', 800: '#283593', 900: '#1a237e', A100: '#8c9eff', A200: '#536dfe', A400: '#3d5afe', A700: '#304ffe' }; var indigo$1 = indigo; var blue = { 50: '#e3f2fd', 100: '#bbdefb', 200: '#90caf9', 300: '#64b5f6', 400: '#42a5f5', 500: '#2196f3', 600: '#1e88e5', 700: '#1976d2', 800: '#1565c0', 900: '#0d47a1', A100: '#82b1ff', A200: '#448aff', A400: '#2979ff', A700: '#2962ff' }; var blue$1 = blue; var lightBlue = { 50: '#e1f5fe', 100: '#b3e5fc', 200: '#81d4fa', 300: '#4fc3f7', 400: '#29b6f6', 500: '#03a9f4', 600: '#039be5', 700: '#0288d1', 800: '#0277bd', 900: '#01579b', A100: '#80d8ff', A200: '#40c4ff', A400: '#00b0ff', A700: '#0091ea' }; var lightBlue$1 = lightBlue; var cyan = { 50: '#e0f7fa', 100: '#b2ebf2', 200: '#80deea', 300: '#4dd0e1', 400: '#26c6da', 500: '#00bcd4', 600: '#00acc1', 700: '#0097a7', 800: '#00838f', 900: '#006064', A100: '#84ffff', A200: '#18ffff', A400: '#00e5ff', A700: '#00b8d4' }; var cyan$1 = cyan; var teal = { 50: '#e0f2f1', 100: '#b2dfdb', 200: '#80cbc4', 300: '#4db6ac', 400: '#26a69a', 500: '#009688', 600: '#00897b', 700: '#00796b', 800: '#00695c', 900: '#004d40', A100: '#a7ffeb', A200: '#64ffda', A400: '#1de9b6', A700: '#00bfa5' }; var teal$1 = teal; var green = { 50: '#e8f5e9', 100: '#c8e6c9', 200: '#a5d6a7', 300: '#81c784', 400: '#66bb6a', 500: '#4caf50', 600: '#43a047', 700: '#388e3c', 800: '#2e7d32', 900: '#1b5e20', A100: '#b9f6ca', A200: '#69f0ae', A400: '#00e676', A700: '#00c853' }; var green$1 = green; var lightGreen = { 50: '#f1f8e9', 100: '#dcedc8', 200: '#c5e1a5', 300: '#aed581', 400: '#9ccc65', 500: '#8bc34a', 600: '#7cb342', 700: '#689f38', 800: '#558b2f', 900: '#33691e', A100: '#ccff90', A200: '#b2ff59', A400: '#76ff03', A700: '#64dd17' }; var lightGreen$1 = lightGreen; var lime = { 50: '#f9fbe7', 100: '#f0f4c3', 200: '#e6ee9c', 300: '#dce775', 400: '#d4e157', 500: '#cddc39', 600: '#c0ca33', 700: '#afb42b', 800: '#9e9d24', 900: '#827717', A100: '#f4ff81', A200: '#eeff41', A400: '#c6ff00', A700: '#aeea00' }; var lime$1 = lime; var yellow = { 50: '#fffde7', 100: '#fff9c4', 200: '#fff59d', 300: '#fff176', 400: '#ffee58', 500: '#ffeb3b', 600: '#fdd835', 700: '#fbc02d', 800: '#f9a825', 900: '#f57f17', A100: '#ffff8d', A200: '#ffff00', A400: '#ffea00', A700: '#ffd600' }; var yellow$1 = yellow; var amber = { 50: '#fff8e1', 100: '#ffecb3', 200: '#ffe082', 300: '#ffd54f', 400: '#ffca28', 500: '#ffc107', 600: '#ffb300', 700: '#ffa000', 800: '#ff8f00', 900: '#ff6f00', A100: '#ffe57f', A200: '#ffd740', A400: '#ffc400', A700: '#ffab00' }; var amber$1 = amber; var orange = { 50: '#fff3e0', 100: '#ffe0b2', 200: '#ffcc80', 300: '#ffb74d', 400: '#ffa726', 500: '#ff9800', 600: '#fb8c00', 700: '#f57c00', 800: '#ef6c00', 900: '#e65100', A100: '#ffd180', A200: '#ffab40', A400: '#ff9100', A700: '#ff6d00' }; var orange$1 = orange; var deepOrange = { 50: '#fbe9e7', 100: '#ffccbc', 200: '#ffab91', 300: '#ff8a65', 400: '#ff7043', 500: '#ff5722', 600: '#f4511e', 700: '#e64a19', 800: '#d84315', 900: '#bf360c', A100: '#ff9e80', A200: '#ff6e40', A400: '#ff3d00', A700: '#dd2c00' }; var deepOrange$1 = deepOrange; var brown = { 50: '#efebe9', 100: '#d7ccc8', 200: '#bcaaa4', 300: '#a1887f', 400: '#8d6e63', 500: '#795548', 600: '#6d4c41', 700: '#5d4037', 800: '#4e342e', 900: '#3e2723', A100: '#d7ccc8', A200: '#bcaaa4', A400: '#8d6e63', A700: '#5d4037' }; var brown$1 = brown; var grey = { 50: '#fafafa', 100: '#f5f5f5', 200: '#eeeeee', 300: '#e0e0e0', 400: '#bdbdbd', 500: '#9e9e9e', 600: '#757575', 700: '#616161', 800: '#424242', 900: '#212121', A100: '#f5f5f5', A200: '#eeeeee', A400: '#bdbdbd', A700: '#616161' }; var grey$1 = grey; var blueGrey = { 50: '#eceff1', 100: '#cfd8dc', 200: '#b0bec5', 300: '#90a4ae', 400: '#78909c', 500: '#607d8b', 600: '#546e7a', 700: '#455a64', 800: '#37474f', 900: '#263238', A100: '#cfd8dc', A200: '#b0bec5', A400: '#78909c', A700: '#455a64' }; var blueGrey$1 = blueGrey; var index = /*#__PURE__*/Object.freeze({ __proto__: null, amber: amber$1, blue: blue$1, blueGrey: blueGrey$1, brown: brown$1, common: common$1, cyan: cyan$1, deepOrange: deepOrange$1, deepPurple: deepPurple$1, green: green$1, grey: grey$1, indigo: indigo$1, lightBlue: lightBlue$1, lightGreen: lightGreen$1, lime: lime$1, orange: orange$1, pink: pink$1, purple: purple$1, red: red$1, teal: teal$1, yellow: yellow$1 }); var global$1 = (typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}); if (typeof global$1.setTimeout === 'function') ; if (typeof global$1.clearTimeout === 'function') ; // from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js var performance$1 = global$1.performance || {}; performance$1.now || performance$1.mozNow || performance$1.msNow || performance$1.oNow || performance$1.webkitNow || function(){ return (new Date()).getTime() }; var THEME_ID = '$$material'; function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); } function _defineProperty(obj, key, value) { key = toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function memoize$1(fn) { var cache = Object.create(null); return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } 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|download|draggable|encType|enterKeyHint|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)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var isPropValid = /* #__PURE__ */memoize$1(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */ ); /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); tag.setAttribute('data-s', ''); return tag; } var StyleSheet = /*#__PURE__*/function () { // Using Node instead of HTMLElement since container may be a ShadowRoot function StyleSheet(options) { var _this = this; this._insertTag = function (tag) { var before; if (_this.tags.length === 0) { if (_this.insertionPoint) { before = _this.insertionPoint.nextSibling; } else if (_this.prepend) { before = _this.container.firstChild; } else { before = _this.before; } } else { before = _this.tags[_this.tags.length - 1].nextSibling; } _this.container.insertBefore(tag, before); _this.tags.push(tag); }; this.isSpeedy = options.speedy === undefined ? "development" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.prepend = options.prepend; this.insertionPoint = options.insertionPoint; this.before = null; } var _proto = StyleSheet.prototype; _proto.hydrate = function hydrate(nodes) { nodes.forEach(this._insertTag); }; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; { var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105; if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) { // this would only cause problem in speedy mode // but we don't want enabling speedy to affect the observable behavior // so we report this error at all times console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.'); } this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule; } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) { console.error("There was a problem inserting the following rule: \"" + rule + "\"", e); } } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode && tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; { this._alreadyInsertedOrderInsensitiveRule = false; } }; return StyleSheet; }(); var e="-ms-";var r$1="-moz-";var a="-webkit-";var n="comm";var c="rule";var s="decl";var i="@import";var h="@keyframes";var $="@layer";var g=Math.abs;var k=String.fromCharCode;var m=Object.assign;function x(e,r){return O(e,0)^45?(((r<<2^O(e,0))<<2^O(e,1))<<2^O(e,2))<<2^O(e,3):0}function y(e){return e.trim()}function j(e,r){return (e=r.exec(e))?e[0]:e}function z(e,r,a){return e.replace(r,a)}function C(e,r){return e.indexOf(r)}function O(e,r){return e.charCodeAt(r)|0}function A(e,r,a){return e.slice(r,a)}function M(e){return e.length}function S(e){return e.length}function q(e,r){return r.push(e),e}function B(e,r){return e.map(r).join("")}var D=1;var E=1;var F=0;var G=0;var H=0;var I="";function J(e,r,a,n,c,s,t){return {value:e,root:r,parent:a,type:n,props:c,children:s,line:D,column:E,length:t,return:""}}function K(e,r){return m(J("",null,null,"",null,null,0),e,{length:-e.length},r)}function L(){return H}function N(){H=G>0?O(I,--G):0;if(E--,H===10)E=1,D--;return H}function P(){H=G2||U(H)>3?"":" "}function ee(e,r){while(--r&&P())if(H<48||H>102||H>57&&H<65||H>70&&H<97)break;return T(e,R()+(r<6&&Q()==32&&P()==32))}function re(e){while(P())switch(H){case e:return G;case 34:case 39:if(e!==34&&e!==39)re(H);break;case 40:if(e===41)re(e);break;case 92:P();break}return G}function ae(e,r){while(P())if(e+H===47+10)break;else if(e+H===42+42&&Q()===47)break;return "/*"+T(r,G-1)+"*"+k(e===47?e:P())}function ne(e){while(!U(Q()))P();return T(e,G)}function ce(e){return W(se("",null,null,null,[""],e=V(e),0,[0],e))}function se(e,r,a,n,c,s,t,u,i){var f=0;var o=0;var l=t;var v=0;var p=0;var h=0;var b=1;var w=1;var d=1;var $=0;var g="";var m=c;var x=s;var y=n;var j=g;while(w)switch(h=$,$=P()){case 40:if(h!=108&&O(j,l-1)==58){if(C(j+=z(X($),"&","&\f"),"&\f")!=-1)d=-1;break}case 34:case 39:case 91:j+=X($);break;case 9:case 10:case 13:case 32:j+=Z(h);break;case 92:j+=ee(R()-1,7);continue;case 47:switch(Q()){case 42:case 47:q(ue(ae(P(),R()),r,a),i);break;default:j+="/";}break;case 123*b:u[f++]=M(j)*d;case 125*b:case 59:case 0:switch($){case 0:case 125:w=0;case 59+o:if(d==-1)j=z(j,/\f/g,"");if(p>0&&M(j)-l)q(p>32?ie(j+";",n,a,l-1):ie(z(j," ","")+";",n,a,l-2),i);break;case 59:j+=";";default:q(y=te(j,r,a,f,o,c,u,g,m=[],x=[],l),s);if($===123)if(o===0)se(j,r,y,y,m,s,l,u,x);else switch(v===99&&O(j,3)===110?100:v){case 100:case 108:case 109:case 115:se(e,y,y,n&&q(te(e,y,y,0,0,c,u,g,c,m=[],l),x),c,x,l,u,n?m:x);break;default:se(j,y,y,y,[""],x,0,u,x);}}f=o=p=0,b=d=1,g=j="",l=t;break;case 58:l=1+M(j),p=h;default:if(b<1)if($==123)--b;else if($==125&&b++==0&&N()==125)continue;switch(j+=k($),$*b){case 38:d=o>0?1:(j+="\f",-1);break;case 44:u[f++]=(M(j)-1)*d,d=1;break;case 64:if(Q()===45)j+=X(P());v=Q(),o=l=M(g=j+=ne(R())),$++;break;case 45:if(h===45&&M(j)==2)b=0;}}return s}function te(e,r,a,n,s,t,u,i,f,o,l){var v=s-1;var p=s===0?t:[""];var h=S(p);for(var b=0,w=0,d=0;b0?p[$]+" "+k:z(k,/&\f/g,p[$])))f[d++]=m;return J(e,r,a,s===0?c:i,f,o,l)}function ue(e,r,a){return J(e,r,a,n,k(L()),A(e,2,-2),0)}function ie(e,r,a,n){return J(e,r,a,s,A(e,0,n),A(e,n+1,-1),n)}function oe(e,r){var a="";var n=S(e);for(var c=0;c -1; }; var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { return function (element, index, children) { if (element.type !== 'rule' || cache.compat) return; var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); if (unsafePseudoClasses) { var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent` // // considering this input: // .a { // .b /* comm */ {} // color: hotpink; // } // we get output corresponding to this: // .a { // & { // /* comm */ // color: hotpink; // } // .b {} // } var commentContainer = isNested ? element.parent.children : // global rule at the root level children; for (var i = commentContainer.length - 1; i >= 0; i--) { var node = commentContainer[i]; if (node.line < element.line) { break; } // it is quite weird but comments are *usually* put at `column: element.column - 1` // so we seek *from the end* for the node that is earlier than the rule's `element` and check that // this will also match inputs like this: // .a { // /* comm */ // .b {} // } // // but that is fine // // it would be the easiest to change the placement of the comment to be the first child of the rule: // .a { // .b { /* comm */ } // } // with such inputs we wouldn't have to search for the comment at all // TODO: consider changing this comment placement in the next major version if (node.column < element.column) { if (isIgnoringComment(node)) { return; } break; } } unsafePseudoClasses.forEach(function (unsafePseudoClass) { console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); }); } }; }; var isImportRule = function isImportRule(element) { return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; }; var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { for (var i = index - 1; i >= 0; i--) { if (!isImportRule(children[i])) { return true; } } return false; }; // use this to remove incorrect elements from further processing // so they don't get handed to the `sheet` (or anything else) // as that could potentially lead to additional logs which in turn could be overhelming to the user var nullifyElement = function nullifyElement(element) { element.type = ''; element.value = ''; element["return"] = ''; element.children = ''; element.props = ''; }; var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { if (!isImportRule(element)) { return; } if (element.parent) { console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); nullifyElement(element); } else if (isPrependedWithRegularRules(index, children)) { console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); nullifyElement(element); } }; /* eslint-disable no-fallthrough */ function prefix(value, length) { switch (x(value, length)) { // color-adjust case 5103: return a + 'print-' + value + value; // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return a + value + value; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return a + value + r$1 + value + e + value + value; // flex, flex-direction case 6828: case 4268: return a + value + e + value + value; // order case 6165: return a + value + e + 'flex-' + value + value; // align-items case 5187: return a + value + z(value, /(\w+).+(:[^]+)/, a + 'box-$1$2' + e + 'flex-$1$2') + value; // align-self case 5443: return a + value + e + 'flex-item-' + z(value, /flex-|-self/, '') + value; // align-content case 4675: return a + value + e + 'flex-line-pack' + z(value, /align-content|flex-|-self/, '') + value; // flex-shrink case 5548: return a + value + e + z(value, 'shrink', 'negative') + value; // flex-basis case 5292: return a + value + e + z(value, 'basis', 'preferred-size') + value; // flex-grow case 6060: return a + 'box-' + z(value, '-grow', '') + a + value + e + z(value, 'grow', 'positive') + value; // transition case 4554: return a + z(value, /([^-])(transform)/g, '$1' + a + '$2') + value; // cursor case 6187: return z(z(z(value, /(zoom-|grab)/, a + '$1'), /(image-set)/, a + '$1'), value, '') + value; // background, background-image case 5495: case 3959: return z(value, /(image-set\([^]*)/, a + '$1' + '$`$1'); // justify-content case 4968: return z(z(value, /(.+:)(flex-)?(.*)/, a + 'box-pack:$3' + e + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + a + value + value; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return z(value, /(.+)-inline(.+)/, a + '$1$2') + value; // (min|max)?(width|height|inline-size|block-size) case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: // stretch, max-content, min-content, fill-available if (M(value) - 1 - length > 6) switch (O(value, length + 1)) { // (m)ax-content, (m)in-content case 109: // - if (O(value, length + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return z(value, /(.+:)(.+)-([^]+)/, '$1' + a + '$2-$3' + '$1' + r$1 + (O(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; // (s)tretch case 115: return ~C(value, 'stretch') ? prefix(z(value, 'stretch', 'fill-available'), length) + value : value; } break; // position: sticky case 4949: // (s)ticky? if (O(value, length + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (O(value, M(value) - 3 - (~C(value, '!important') && 10))) { // stic(k)y case 107: return z(value, ':', ':' + a) + value; // (inline-)?fl(e)x case 101: return z(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + a + (O(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + a + '$2$3' + '$1' + e + '$2box$3') + value; } break; // writing-mode case 5936: switch (O(value, length + 11)) { // vertical-l(r) case 114: return a + value + e + z(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; // vertical-r(l) case 108: return a + value + e + z(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; // horizontal(-)tb case 45: return a + value + e + z(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; } return a + value + e + value + value; } return value; } var prefixer = function prefixer(element, index, children, callback) { if (element.length > -1) if (!element["return"]) switch (element.type) { case s: element["return"] = prefix(element.value, element.length); break; case h: return oe([K(element, { value: z(element.value, '@', '@' + a) })], callback); case c: if (element.length) return B(element.props, function (value) { switch (j(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return oe([K(element, { props: [z(value, /:(read-\w+)/, ':' + r$1 + '$1')] })], callback); // :placeholder case '::placeholder': return oe([K(element, { props: [z(value, /:(plac\w+)/, ':' + a + 'input-$1')] }), K(element, { props: [z(value, /:(plac\w+)/, ':' + r$1 + '$1')] }), K(element, { props: [z(value, /:(plac\w+)/, e + 'input-$1')] })], callback); } return ''; }); } }; var isBrowser$5 = typeof document !== 'undefined'; var getServerStylisCache = isBrowser$5 ? undefined : weakMemoize(function () { return memoize$1(function () { var cache = {}; return function (name) { return cache[name]; }; }); }); var defaultStylisPlugins = [prefixer]; var createCache = function createCache(options) { var key = options.key; if (!key) { throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements."); } if (isBrowser$5 && key === 'css') { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure // that creating a cache works inside of render of a React component Array.prototype.forEach.call(ssrStyles, function (node) { // we want to only move elements which have a space in the data-emotion attribute value // because that indicates that it is an Emotion 11 server-side rendered style elements // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles // will not result in the Emotion 10 styles being destroyed var dataEmotionAttribute = node.getAttribute('data-emotion'); if (dataEmotionAttribute.indexOf(' ') === -1) { return; } document.head.appendChild(node); node.setAttribute('data-s', ''); }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; { // $FlowFixMe if (/[^a-z-]/.test(key)) { throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed"); } } var inserted = {}; var container; var nodesToHydrate = []; if (isBrowser$5) { container = options.container || document.head; Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe for (var i = 1; i < attrib.length; i++) { inserted[attrib[i]] = true; } nodesToHydrate.push(node); }); } var _insert; var omnipresentPlugins = [compat, removeLabel]; { omnipresentPlugins.push(createUnsafeSelectorsAlarm({ get compat() { return cache.compat; } }), incorrectImportAlarm); } if (isBrowser$5) { var currentSheet; var finalizingPlugins = [le, function (element) { if (!element.root) { if (element["return"]) { currentSheet.insert(element["return"]); } else if (element.value && element.type !== n) { // insert empty rule in non-production environments // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet currentSheet.insert(element.value + "{}"); } } } ]; var serializer = ve(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); var stylis = function stylis(styles) { return oe(ce(styles), serializer); }; _insert = function insert(selector, serialized, sheet, shouldCache) { currentSheet = sheet; if (serialized.map !== undefined) { currentSheet = { insert: function insert(rule) { sheet.insert(rule + serialized.map); } }; } stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache.inserted[serialized.name] = true; } }; } else { var _finalizingPlugins = [le]; var _serializer = ve(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins)); var _stylis = function _stylis(styles) { return oe(ce(styles), _serializer); }; // $FlowFixMe var serverStylisCache = getServerStylisCache(stylisPlugins)(key); var getRules = function getRules(selector, serialized) { var name = serialized.name; if (serverStylisCache[name] === undefined) { serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); } return serverStylisCache[name]; }; _insert = function _insert(selector, serialized, sheet, shouldCache) { var name = serialized.name; var rules = getRules(selector, serialized); if (cache.compat === undefined) { // in regular mode, we don't set the styles on the inserted cache // since we don't need to and that would be wasting memory // we return them so that they are rendered in a style tag if (shouldCache) { cache.inserted[name] = true; } if ( // using === development instead of !== production // because if people do ssr in tests, the source maps showing up would be annoying serialized.map !== undefined) { return rules + serialized.map; } return rules; } else { // in compat mode, we put the styles on the inserted cache so // that emotion-server can pull out the styles // except when we don't want to cache it which was in Global but now // is nowhere but we don't want to do a major right now // and just in case we're going to leave the case here // it's also not affecting client side bundle size // so it's really not a big deal if (shouldCache) { cache.inserted[name] = rules; } else { return rules; } } }; } var cache = { key: key, sheet: new StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy, prepend: options.prepend, insertionPoint: options.insertionPoint }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; cache.sheet.hydrate(nodesToHydrate); return cache; }; function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var reactIs_development$1 = createCommonjsModule(function (module, exports) { { (function() { // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary // (unstable) APIs that have been removed. Can we remove the symbols? var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } }); reactIs_development$1.AsyncMode; reactIs_development$1.ConcurrentMode; reactIs_development$1.ContextConsumer; reactIs_development$1.ContextProvider; reactIs_development$1.Element; reactIs_development$1.ForwardRef; reactIs_development$1.Fragment; reactIs_development$1.Lazy; reactIs_development$1.Memo; reactIs_development$1.Portal; reactIs_development$1.Profiler; reactIs_development$1.StrictMode; reactIs_development$1.Suspense; reactIs_development$1.isAsyncMode; reactIs_development$1.isConcurrentMode; reactIs_development$1.isContextConsumer; reactIs_development$1.isContextProvider; reactIs_development$1.isElement; reactIs_development$1.isForwardRef; reactIs_development$1.isFragment; reactIs_development$1.isLazy; reactIs_development$1.isMemo; reactIs_development$1.isPortal; reactIs_development$1.isProfiler; reactIs_development$1.isStrictMode; reactIs_development$1.isSuspense; reactIs_development$1.isValidElementType; reactIs_development$1.typeOf; var reactIs$1 = createCommonjsModule(function (module) { { module.exports = reactIs_development$1; } }); var FORWARD_REF_STATICS = { '$$typeof': true, render: true, defaultProps: true, displayName: true, propTypes: true }; var MEMO_STATICS = { '$$typeof': true, compare: true, defaultProps: true, displayName: true, propTypes: true, type: true }; var TYPE_STATICS = {}; TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS; TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS; var isBrowser$4 = typeof document !== 'undefined'; function getRegisteredStyles(registered, registeredStyles, classNames) { var rawClassName = ''; classNames.split(' ').forEach(function (className) { if (registered[className] !== undefined) { registeredStyles.push(registered[className] + ";"); } else { rawClassName += className + " "; } }); return rawClassName; } var registerStyles = function registerStyles(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; if ( // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (isStringTag === false || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser isBrowser$4 === false && cache.compat !== undefined) && cache.registered[className] === undefined) { cache.registered[className] = serialized.styles; } }; var insertStyles = function insertStyles(cache, serialized, isStringTag) { registerStyles(cache, serialized, isStringTag); var className = cache.key + "-" + serialized.name; if (cache.inserted[serialized.name] === undefined) { var stylesForSSR = ''; var current = serialized; do { var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); if (!isBrowser$4 && maybeStyles !== undefined) { stylesForSSR += maybeStyles; } current = current.next; } while (current !== undefined); if (!isBrowser$4 && stylesForSSR.length !== 0) { return stylesForSSR; } } }; /* eslint-disable */ // Inspired by https://github.com/garycourt/murmurhash-js // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 function murmur2(str) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. // const m = 0x5bd1e995; // const r = 24; // Initialize the hash var h = 0; // Mix 4 bytes at a time into the hash var k, i = 0, len = str.length; for (; len >= 4; ++i, len -= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); k ^= /* k >>> r: */ k >>> 24; h = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Handle the last few bytes of the input array switch (len) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h ^= h >>> 13; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); return ((h ^ h >>> 15) >>> 0).toString(36); } var unitlessKeys = { animationIterationCount: 1, aspectRatio: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; var ILLEGAL_ESCAPE_SEQUENCE_ERROR$1 = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; var hyphenateRegex = /[A-Z]|^ms/g; var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; var isCustomProperty = function isCustomProperty(property) { return property.charCodeAt(1) === 45; }; var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; var processStyleName = /* #__PURE__ */memoize$1(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); var processStyleValue = function processStyleValue(key, value) { switch (key) { case 'animation': case 'animationName': { if (typeof value === 'string') { return value.replace(animationRegex, function (match, p1, p2) { cursor = { name: p1, styles: p2, next: cursor }; return p1; }); } } } if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { return value + 'px'; } return value; }; { var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/; var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset']; var oldProcessStyleValue = processStyleValue; var msPattern = /^-ms-/; var hyphenPattern = /-(.)/g; var hyphenatedCache = {}; processStyleValue = function processStyleValue(key, value) { if (key === 'content') { if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) { throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`"); } } var processed = oldProcessStyleValue(key, value); if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) { hyphenatedCache[key] = true; console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { return _char.toUpperCase(); }) + "?"); } return processed; }; } var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.'; function handleInterpolation(mergedProps, registered, interpolation) { if (interpolation == null) { return ''; } if (interpolation.__emotion_styles !== undefined) { if (interpolation.toString() === 'NO_COMPONENT_SELECTOR') { throw new Error(noComponentSelectorMessage); } return interpolation; } switch (typeof interpolation) { case 'boolean': { return ''; } case 'object': { if (interpolation.anim === 1) { cursor = { name: interpolation.name, styles: interpolation.styles, next: cursor }; return interpolation.name; } if (interpolation.styles !== undefined) { var next = interpolation.next; if (next !== undefined) { // not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while (next !== undefined) { cursor = { name: next.name, styles: next.styles, next: cursor }; next = next.next; } } var styles = interpolation.styles + ";"; if (interpolation.map !== undefined) { styles += interpolation.map; } return styles; } return createStringFromObject(mergedProps, registered, interpolation); } case 'function': { if (mergedProps !== undefined) { var previousCursor = cursor; var result = interpolation(mergedProps); cursor = previousCursor; return handleInterpolation(mergedProps, registered, result); } else { console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`"); } break; } case 'string': { var matched = []; var replaced = interpolation.replace(animationRegex, function (match, p1, p2) { var fakeVarName = "animation" + matched.length; matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`"); return "${" + fakeVarName + "}"; }); if (matched.length) { console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`")); } } break; } // finalize string values (regular strings and functions interpolated into css calls) if (registered == null) { return interpolation; } var cached = registered[interpolation]; return cached !== undefined ? cached : interpolation; } function createStringFromObject(mergedProps, registered, obj) { var string = ''; if (Array.isArray(obj)) { for (var i = 0; i < obj.length; i++) { string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; } } else { for (var _key in obj) { var value = obj[_key]; if (typeof value !== 'object') { if (registered != null && registered[value] !== undefined) { string += _key + "{" + registered[value] + "}"; } else if (isProcessableValue(value)) { string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; } } else { if (_key === 'NO_COMPONENT_SELECTOR' && "development" !== 'production') { throw new Error(noComponentSelectorMessage); } if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { for (var _i = 0; _i < value.length; _i++) { if (isProcessableValue(value[_i])) { string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; } } } else { var interpolated = handleInterpolation(mergedProps, registered, value); switch (_key) { case 'animation': case 'animationName': { string += processStyleName(_key) + ":" + interpolated + ";"; break; } default: { if (_key === 'undefined') { console.error(UNDEFINED_AS_OBJECT_KEY_ERROR); } string += _key + "{" + interpolated + "}"; } } } } } } return string; } var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g; var sourceMapPattern; { sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; } // this is the cursor for keyframes // keyframes are stored on the SerializedStyles object as a linked list var cursor; var serializeStyles = function serializeStyles(args, registered, mergedProps) { if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { return args[0]; } var stringMode = true; var styles = ''; cursor = undefined; var strings = args[0]; if (strings == null || strings.raw === undefined) { stringMode = false; styles += handleInterpolation(mergedProps, registered, strings); } else { if (strings[0] === undefined) { console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1); } styles += strings[0]; } // we start at 1 since we've already handled the first arg for (var i = 1; i < args.length; i++) { styles += handleInterpolation(mergedProps, registered, args[i]); if (stringMode) { if (strings[i] === undefined) { console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1); } styles += strings[i]; } } var sourceMap; { styles = styles.replace(sourceMapPattern, function (match) { sourceMap = match; return ''; }); } // using a global regex with .exec is stateful so lastIndex has to be reset each time labelPattern.lastIndex = 0; var identifierName = ''; var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 while ((match = labelPattern.exec(styles)) !== null) { identifierName += '-' + // $FlowFixMe we know it's not null match[1]; } var name = murmur2(styles) + identifierName; { // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it) return { name: name, styles: styles, map: sourceMap, next: cursor, toString: function toString() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } }; } }; var isBrowser$3 = typeof document !== 'undefined'; var syncFallback = function syncFallback(create) { return create(); }; var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false; var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$3 ? syncFallback : useInsertionEffect || syncFallback; var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect; var isBrowser$2 = typeof document !== 'undefined'; var hasOwn = {}.hasOwnProperty; var EmotionCacheContext = /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({ key: 'css' }) : null); { EmotionCacheContext.displayName = 'EmotionCacheContext'; } var CacheProvider = EmotionCacheContext.Provider; var withEmotionCache = function withEmotionCache(func) { // $FlowFixMe return /*#__PURE__*/React.forwardRef(function (props, ref) { // the cache will never be null in the browser var cache = React.useContext(EmotionCacheContext); return func(props, cache, ref); }); }; if (!isBrowser$2) { withEmotionCache = function withEmotionCache(func) { return function (props) { var cache = React.useContext(EmotionCacheContext); if (cache === null) { // yes, we're potentially creating this on every render // it doesn't actually matter though since it's only on the server // so there will only every be a single render // that could change in the future because of suspense and etc. but for now, // this works and i don't want to optimise for a future thing that we aren't sure about cache = createCache({ key: 'css' }); return /*#__PURE__*/React__namespace.createElement(EmotionCacheContext.Provider, { value: cache }, func(props, cache)); } else { return func(props, cache); } }; }; } var ThemeContext$2 = /* #__PURE__ */React__namespace.createContext({}); { ThemeContext$2.displayName = 'EmotionThemeContext'; } var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; var Insertion$2 = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; registerStyles(cache, serialized, isStringTag); var rules = useInsertionEffectAlwaysWithSyncFallback(function () { return insertStyles(cache, serialized, isStringTag); }); if (!isBrowser$2 && rules !== undefined) { var _ref2; var serializedNames = serialized.name; var next = serialized.next; while (next !== undefined) { serializedNames += ' ' + next.name; next = next.next; } return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = { __html: rules }, _ref2.nonce = cache.sheet.nonce, _ref2)); } return null; }; var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) { var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { cssProp = cache.registered[cssProp]; } var WrappedComponent = props[typePropName]; var registeredStyles = [cssProp]; var className = ''; if (typeof props.className === 'string') { className = getRegisteredStyles(cache.registered, registeredStyles, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = serializeStyles(registeredStyles, undefined, React__namespace.useContext(ThemeContext$2)); if (serialized.name.indexOf('-') === -1) { var labelFromStack = props[labelPropName]; if (labelFromStack) { serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']); } } className += cache.key + "-" + serialized.name; var newProps = {}; for (var key in props) { if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (key !== labelPropName)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion$2, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' }), /*#__PURE__*/React__namespace.createElement(WrappedComponent, newProps)); }); { Emotion.displayName = 'EmotionCssPropInternal'; } var _extends_1 = createCommonjsModule(function (module) { function _extends() { module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }, module.exports.__esModule = true, module.exports["default"] = module.exports; return _extends.apply(this, arguments); } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; }); unwrapExports(_extends_1); var pkg = { name: "@emotion/react", version: "11.11.4", main: "dist/emotion-react.cjs.js", module: "dist/emotion-react.esm.js", browser: { "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js" }, exports: { ".": { module: { worker: "./dist/emotion-react.worker.esm.js", browser: "./dist/emotion-react.browser.esm.js", "default": "./dist/emotion-react.esm.js" }, "import": "./dist/emotion-react.cjs.mjs", "default": "./dist/emotion-react.cjs.js" }, "./jsx-runtime": { module: { worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js", browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js" }, "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs", "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js" }, "./_isolated-hnrs": { module: { worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js", browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js" }, "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs", "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js" }, "./jsx-dev-runtime": { module: { worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js", browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js" }, "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs", "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js" }, "./package.json": "./package.json", "./types/css-prop": "./types/css-prop.d.ts", "./macro": { types: { "import": "./macro.d.mts", "default": "./macro.d.ts" }, "default": "./macro.js" } }, types: "types/index.d.ts", files: [ "src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", "macro.*" ], sideEffects: false, author: "Emotion Contributors", license: "MIT", scripts: { "test:typescript": "dtslint types" }, dependencies: { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", "@emotion/cache": "^11.11.0", "@emotion/serialize": "^1.1.3", "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1", "@emotion/utils": "^1.2.1", "@emotion/weak-memoize": "^0.3.1", "hoist-non-react-statics": "^3.3.1" }, peerDependencies: { react: ">=16.8.0" }, peerDependenciesMeta: { "@types/react": { optional: true } }, devDependencies: { "@definitelytyped/dtslint": "0.0.112", "@emotion/css": "11.11.2", "@emotion/css-prettifier": "1.1.3", "@emotion/server": "11.11.0", "@emotion/styled": "11.11.0", "html-tag-names": "^1.1.2", react: "16.14.0", "svg-tag-names": "^1.1.1", typescript: "^4.5.5" }, repository: "https://github.com/emotion-js/emotion/tree/main/packages/react", publishConfig: { access: "public" }, "umd:main": "dist/emotion-react.umd.min.js", preconstruct: { entrypoints: [ "./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js" ], umdName: "emotionReact", exports: { envConditions: [ "browser", "worker" ], extra: { "./types/css-prop": "./types/css-prop.d.ts", "./macro": { types: { "import": "./macro.d.mts", "default": "./macro.d.ts" }, "default": "./macro.js" } } } } }; var warnedAboutCssPropForGlobal = false; // maintain place over rerenders. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild // initial client-side render from SSR, use place of hydrating tag var Global = /* #__PURE__ */withEmotionCache(function (props, cache) { if (!warnedAboutCssPropForGlobal && ( // check for className as well since the user is // probably using the custom createElement which // means it will be turned into a className prop // $FlowFixMe I don't really want to add it to the type since it shouldn't be used props.className || props.css)) { console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?"); warnedAboutCssPropForGlobal = true; } var styles = props.styles; var serialized = serializeStyles([styles], undefined, React__namespace.useContext(ThemeContext$2)); if (!isBrowser$2) { var _ref; var serializedNames = serialized.name; var serializedStyles = serialized.styles; var next = serialized.next; while (next !== undefined) { serializedNames += ' ' + next.name; serializedStyles += next.styles; next = next.next; } var shouldCache = cache.compat === true; var rules = cache.insert("", { name: serializedNames, styles: serializedStyles }, cache.sheet, shouldCache); if (shouldCache) { return null; } return /*#__PURE__*/React__namespace.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = { __html: rules }, _ref.nonce = cache.sheet.nonce, _ref)); } // yes, i know these hooks are used conditionally // but it is based on a constant that will never change at runtime // it's effectively like having two implementations and switching them out // so it's not actually breaking anything var sheetRef = React__namespace.useRef(); useInsertionEffectWithLayoutFallback(function () { var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675 var sheet = new cache.sheet.constructor({ key: key, nonce: cache.sheet.nonce, container: cache.sheet.container, speedy: cache.sheet.isSpeedy }); var rehydrating = false; // $FlowFixMe var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]"); if (cache.sheet.tags.length) { sheet.before = cache.sheet.tags[0]; } if (node !== null) { rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s node.setAttribute('data-emotion', key); sheet.hydrate([node]); } sheetRef.current = [sheet, rehydrating]; return function () { sheet.flush(); }; }, [cache]); useInsertionEffectWithLayoutFallback(function () { var sheetRefCurrent = sheetRef.current; var sheet = sheetRefCurrent[0], rehydrating = sheetRefCurrent[1]; if (rehydrating) { sheetRefCurrent[1] = false; return; } if (serialized.next !== undefined) { // insert keyframes insertStyles(cache, serialized.next, true); } if (sheet.tags.length) { // if this doesn't exist then it will be null so the style element will be appended var element = sheet.tags[sheet.tags.length - 1].nextElementSibling; sheet.before = element; sheet.flush(); } cache.insert("", serialized, sheet, false); }, [cache, serialized.name]); return null; }); { Global.displayName = 'EmotionGlobal'; } function css() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return serializeStyles(args); } var keyframes = function keyframes() { var insertable = css.apply(void 0, arguments); var name = "animation-" + insertable.name; // $FlowFixMe return { name: name, styles: "@keyframes " + name + "{" + insertable.styles + "}", anim: 1, toString: function toString() { return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; } }; }; var classnames = function classnames(args) { var len = args.length; var i = 0; var cls = ''; for (; i < len; i++) { var arg = args[i]; if (arg == null) continue; var toAdd = void 0; switch (typeof arg) { case 'boolean': break; case 'object': { if (Array.isArray(arg)) { toAdd = classnames(arg); } else { if (arg.styles !== undefined && arg.name !== undefined) { console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from component.'); } toAdd = ''; for (var k in arg) { if (arg[k] && k) { toAdd && (toAdd += ' '); toAdd += k; } } } break; } default: { toAdd = arg; } } if (toAdd) { cls && (cls += ' '); cls += toAdd; } } return cls; }; function merge$1(registered, css, className) { var registeredStyles = []; var rawClassName = getRegisteredStyles(registered, registeredStyles, className); if (registeredStyles.length < 2) { return className; } return rawClassName + css(registeredStyles); } var Insertion$1 = function Insertion(_ref) { var cache = _ref.cache, serializedArr = _ref.serializedArr; var rules = useInsertionEffectAlwaysWithSyncFallback(function () { var rules = ''; for (var i = 0; i < serializedArr.length; i++) { var res = insertStyles(cache, serializedArr[i], false); if (!isBrowser$2 && res !== undefined) { rules += res; } } if (!isBrowser$2) { return rules; } }); if (!isBrowser$2 && rules.length !== 0) { var _ref2; return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) { return serialized.name; }).join(' '), _ref2.dangerouslySetInnerHTML = { __html: rules }, _ref2.nonce = cache.sheet.nonce, _ref2)); } return null; }; var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) { var hasRendered = false; var serializedArr = []; var css = function css() { if (hasRendered && "development" !== 'production') { throw new Error('css can only be used during render'); } for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var serialized = serializeStyles(args, cache.registered); serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx` registerStyles(cache, serialized, false); return cache.key + "-" + serialized.name; }; var cx = function cx() { if (hasRendered && "development" !== 'production') { throw new Error('cx can only be used during render'); } for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return merge$1(cache.registered, css, classnames(args)); }; var content = { css: css, cx: cx, theme: React__namespace.useContext(ThemeContext$2) }; var ele = props.children(content); hasRendered = true; return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion$1, { cache: cache, serializedArr: serializedArr }), ele); }); { ClassNames.displayName = 'EmotionClassNames'; } { var isBrowser$1 = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined'; if (isBrowser$1 && !isTestEnv) { // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later var globalContext = // $FlowIgnore typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef : isBrowser$1 ? window : global$1; var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__"; if (globalContext[globalKey]) { console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.'); } globalContext[globalKey] = true; } } var testOmitPropsOnStringTag = isPropValid; var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { return key !== 'theme'; }; var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { return typeof tag === 'string' && // 96 is one less than the char code // for "a" so this is checking that // it's a lowercase character tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; }; var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) { var shouldForwardProp; if (options) { var optionsShouldForwardProp = options.shouldForwardProp; shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) { return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName); } : optionsShouldForwardProp; } if (typeof shouldForwardProp !== 'function' && isReal) { shouldForwardProp = tag.__emotion_forwardProp; } return shouldForwardProp; }; var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var isBrowser = typeof document !== 'undefined'; var Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; registerStyles(cache, serialized, isStringTag); var rules = useInsertionEffectAlwaysWithSyncFallback(function () { return insertStyles(cache, serialized, isStringTag); }); if (!isBrowser && rules !== undefined) { var _ref2; var serializedNames = serialized.name; var next = serialized.next; while (next !== undefined) { serializedNames += ' ' + next.name; next = next.next; } return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = { __html: rules }, _ref2.nonce = cache.sheet.nonce, _ref2)); } return null; }; var createStyled$1 = function createStyled(tag, options) { { if (tag === undefined) { throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.'); } } var isReal = tag.__emotion_real === tag; var baseTag = isReal && tag.__emotion_base || tag; var identifierName; var targetClassName; if (options !== undefined) { identifierName = options.label; targetClassName = options.target; } var shouldForwardProp = composeShouldForwardProps(tag, options, isReal); var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); var shouldUseAs = !defaultShouldForwardProp('as'); return function () { var args = arguments; var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; if (identifierName !== undefined) { styles.push("label:" + identifierName + ";"); } if (args[0] == null || args[0].raw === undefined) { styles.push.apply(styles, args); } else { if (args[0][0] === undefined) { console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); } styles.push(args[0][0]); var len = args.length; var i = 1; for (; i < len; i++) { if (args[0][i] === undefined) { console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); } styles.push(args[i], args[0][i]); } } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class var Styled = withEmotionCache(function (props, cache, ref) { var FinalTag = shouldUseAs && props.as || baseTag; var className = ''; var classInterpolations = []; var mergedProps = props; if (props.theme == null) { mergedProps = {}; for (var key in props) { mergedProps[key] = props[key]; } mergedProps.theme = React__namespace.useContext(ThemeContext$2); } if (typeof props.className === 'string') { className = getRegisteredStyles(cache.registered, classInterpolations, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps); className += cache.key + "-" + serialized.name; if (targetClassName !== undefined) { className += " " + targetClassName; } var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp; var newProps = {}; for (var _key in props) { if (shouldUseAs && _key === 'as') continue; if ( // $FlowFixMe finalShouldForwardProp(_key)) { newProps[_key] = props[_key]; } } newProps.className = className; newProps.ref = ref; return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof FinalTag === 'string' }), /*#__PURE__*/React__namespace.createElement(FinalTag, newProps)); }); Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; Styled.defaultProps = tag.defaultProps; Styled.__emotion_real = Styled; Styled.__emotion_base = baseTag; Styled.__emotion_styles = styles; Styled.__emotion_forwardProp = shouldForwardProp; Object.defineProperty(Styled, 'toString', { value: function value() { if (targetClassName === undefined && "development" !== 'production') { return 'NO_COMPONENT_SELECTOR'; } // $FlowFixMe: coerce undefined to string return "." + targetClassName; } }); Styled.withComponent = function (nextTag, nextOptions) { return createStyled(nextTag, _extends({}, options, nextOptions, { shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) })).apply(void 0, styles); }; return Styled; }; }; var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; var newStyled = createStyled$1.bind(); tags.forEach(function (tagName) { // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type newStyled[tagName] = newStyled(tagName); }); /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret$1 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret_1 = ReactPropTypesSecret$1; var has$1 = Function.call.bind(Object.prototype.hasOwnProperty); var printWarning$1 = function() {}; { var ReactPropTypesSecret = ReactPropTypesSecret_1; var loggedTypeFailures = {}; var has = has$1; printWarning$1 = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) { /**/ } }; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { { for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' ); err.name = 'Invariant Violation'; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning$1( (componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; printWarning$1( 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') ); } } } } } /** * Resets warning cache when testing. * * @private */ checkPropTypes.resetWarningCache = function() { { loggedTypeFailures = {}; } }; var checkPropTypes_1 = checkPropTypes; var printWarning = function() {}; { printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } function emptyFunctionThatReturnsNull() { return null; } var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bigint: createPrimitiveTypeChecker('bigint'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message, data) { this.message = message; this.data = data && typeof data === 'object' ? data: {}; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret_1) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } else if (typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { printWarning( 'You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {expectedType: expectedType} ); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!reactIs$1.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { { if (arguments.length > 1) { printWarning( 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' ); } else { printWarning('Invalid argument supplied to oneOf, expected an array.'); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === 'symbol') { return String(value); } return value; }); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (has$1(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') ; return emptyFunctionThatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { printWarning( 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { var expectedTypes = []; for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1); if (checkerResult == null) { return null; } if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) { expectedTypes.push(checkerResult.data.expectedType); } } var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function invalidValidatorError(componentName, location, propFullName, key, type) { return new PropTypeError( (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' ); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (typeof checker !== 'function') { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from props. var allKeys = objectAssign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (has$1(shapeTypes, key) && typeof checker !== 'function') { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // falsy value can't be a Symbol if (!propValue) { return false; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes_1; ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; var propTypes = createCommonjsModule(function (module) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ { var ReactIs = reactIs$1; // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess); } }); var PropTypes = propTypes; propTypes.elementType; propTypes.bool; propTypes.func; propTypes.object; propTypes.oneOfType; propTypes.element; React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner; var reactJsxRuntime_development = createCommonjsModule(function (module, exports) { { (function() { var React$1 = React; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } var ReactSharedInternals = React$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } // eslint-disable-next-line react-internal/safe-string-coercion var argsWithFormat = args.map(function (item) { return String(item); }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } // ----------------------------------------------------------------------------- var enableScopeAPI = false; // Experimental Create Event Handle API. var enableCacheElement = false; var enableTransitionTracing = false; // No known bugs, but needs performance testing var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber // stuff. Intended to enable React core members to more easily debug scheduling // issues in DEV builds. var enableDebugTracing = false; // Track which Fiber(s) schedule render work. var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; } // Keep in sync with react-reconciler/getComponentNameFromFiber function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || 'Memo'; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } // eslint-disable-next-line no-fallthrough } } return null; } var assign = Object.assign; // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "" // but we have a user-provided "displayName" // splice it in to make the stack more readable. if (fn.displayName && _frame.includes('')) { _frame = _frame.replace('', fn.displayName); } { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } var hasOwnProperty = Object.prototype.hasOwnProperty; var loggedTypeFailures = {}; var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { // eslint-disable-next-line react-internal/prod-error-codes var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); err.name = 'Invariant Violation'; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error('Failed %s type: %s', location, error$1.message); setCurrentlyValidatingElement(null); } } } } } var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare function isArray(a) { return isArrayImpl(a); } /* * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol * and Temporal.* types. See https://github.com/facebook/react/pull/22064. * * The functions in this module will throw an easier-to-understand, * easier-to-debug exception with a clear errors message message explaining the * problem. (Instead of a confusing exception thrown inside the implementation * of the `value` object). */ // $FlowFixMe only called in DEV, so void return is not possible. function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $FlowFixMe only called in DEV, so void return is not possible. function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + value`, an exception was thrown. // // The most common types that will cause this exception are `Symbol` instances // and Temporal objects like `Temporal.Instant`. But any object that has a // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this // exception. (Library authors do this to prevent users from using built-in // numeric operators like `+` or comparison operators like `>=` because custom // methods are needed to perform accurate arithmetic or comparison.) // // To fix the problem, coerce this object or symbol value to a string before // passing it to React. The most reliable way is usually `String(value)`. // // To find which value is throwing, check the browser or debugger console. // Before this exception was thrown, there should be `console.error` output // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the // problem and how that type was used: key, atrribute, input value prop, etc. // In most cases, this console output also shows the component and its // ancestor components where the exception happened. // // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown; var specialPropRefWarningShown; var didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } function warnIfStringRefCannotBeAutoConverted(config, self) { { if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref); didWarnAboutStringRefs[componentName] = true; } } } } function defineKeyPropWarningGetter(props, displayName) { { var warnAboutAccessingKey = function () { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } } function defineRefPropWarningGetter(props, displayName) { { var warnAboutAccessingRef = function () { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, instanceof check * will not work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} props * @param {*} key * @param {string|object} ref * @param {*} owner * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * https://github.com/reactjs/rfcs/pull/107 * @param {*} type * @param {object} props * @param {string} key */ function jsxDEV(type, config, maybeKey, source, self) { { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; // Currently, key can be spread in as a prop. This causes a potential // issue if key is also explicitly declared (ie.
// or
). We want to deprecate key spread, // but as an intermediary step, we will use jsxDEV for everything except //
, because we aren't currently able to tell if // key is explicitly declared to be undefined or not. if (maybeKey !== undefined) { { checkKeyStringCoercion(maybeKey); } key = '' + maybeKey; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = '' + config.key; } if (hasValidRef(config)) { ref = config.ref; warnIfStringRefCannotBeAutoConverted(config, self); } // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } if (key || ref) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement$1(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object * @return {boolean} True if `object` is a ReactElement. * @final */ function isValidElement(object) { { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } } function getDeclarationErrorAddendum() { { if (ReactCurrentOwner$1.current) { var name = getComponentNameFromType(ReactCurrentOwner$1.current.type); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } return ''; } } function getSourceInfoErrorAddendum(source) { { if (source !== undefined) { var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) { // Give the component that originally created this child. childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } setCurrentlyValidatingElement$1(element); error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { { if (typeof node !== 'object') { return; } if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { { var type = element.type; if (type === null || type === undefined || typeof type === 'string') { return; } var propTypes; if (typeof type === 'function') { propTypes = type.propTypes; } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { // Intentionally inside to avoid triggering lazy initializers: var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, 'prop', name, element); } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: var _name = getComponentNameFromType(type); error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); } if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } } /** * Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'children' && key !== 'key') { setCurrentlyValidatingElement$1(fragment); error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error('Invalid attribute `ref` supplied to `React.Fragment`.'); setCurrentlyValidatingElement$1(null); } } } function jsxWithValidation(type, props, key, isStaticChildren, source, self) { { var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendum(source); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = 'null'; } else if (isArray(type)) { typeString = 'array'; } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; info = ' Did you accidentally export a JSX literal instead of a component?'; } else { typeString = typeof type; } error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); } var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { var children = props.children; if (children !== undefined) { if (isStaticChildren) { if (isArray(children)) { for (var i = 0; i < children.length; i++) { validateChildKeys(children[i], type); } if (Object.freeze) { Object.freeze(children); } } else { error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.'); } } else { validateChildKeys(children, type); } } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } } // These two functions exist to still get child warnings in dev // even with the prod transform. This means that jsxDEV is purely // opt-in behavior for better messages but that we won't stop // giving you warnings if you use production apis. function jsxWithValidationStatic(type, props, key) { { return jsxWithValidation(type, props, key, true); } } function jsxWithValidationDynamic(type, props, key) { { return jsxWithValidation(type, props, key, false); } } var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children. // for now we can ship identical prod functions var jsxs = jsxWithValidationStatic ; exports.Fragment = REACT_FRAGMENT_TYPE; exports.jsx = jsx; exports.jsxs = jsxs; })(); } }); reactJsxRuntime_development.Fragment; reactJsxRuntime_development.jsx; reactJsxRuntime_development.jsxs; var jsxRuntime = createCommonjsModule(function (module) { { module.exports = reactJsxRuntime_development; } }); var jsxRuntime_1 = jsxRuntime.jsx; var jsxRuntime_2 = jsxRuntime.jsxs; var cache; if ((typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object') { cache = createCache({ key: 'css', prepend: true }); } function StyledEngineProvider(props) { var injectFirst = props.injectFirst, children = props.children; return injectFirst && cache ? /*#__PURE__*/jsxRuntime_1(CacheProvider, { value: cache, children: children }) : children; } StyledEngineProvider.propTypes = { /** * Your component tree. */ children: PropTypes.node, /** * By default, the styles are injected last in the element of the page. * As a result, they gain more specificity than any other style sheet. * If you want to override MUI's styles, set this prop. */ injectFirst: PropTypes.bool } ; function isEmpty$3(obj) { return obj === undefined || obj === null || Object.keys(obj).length === 0; } function GlobalStyles$2(props) { var styles = props.styles, _props$defaultTheme = props.defaultTheme, defaultTheme = _props$defaultTheme === void 0 ? {} : _props$defaultTheme; var globalStyles = typeof styles === 'function' ? function (themeInput) { return styles(isEmpty$3(themeInput) ? defaultTheme : themeInput); } : styles; return /*#__PURE__*/jsxRuntime_1(Global, { styles: globalStyles }); } GlobalStyles$2.propTypes = { defaultTheme: PropTypes.object, styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func]) } ; function styled$3(tag, options) { var stylesFactory = newStyled(tag, options); { return function () { var component = typeof tag === 'string' ? "\"".concat(tag, "\"") : 'component'; for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) { styles[_key] = arguments[_key]; } if (styles.length === 0) { console.error(["MUI: Seems like you called `styled(".concat(component, ")()` without a `style` argument."), 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join('\n')); } else if (styles.some(function (style) { return style === undefined; })) { console.error("MUI: the styled(".concat(component, ")(...args) API requires all its args to be defined.")); } return stylesFactory.apply(void 0, styles); }; } } // eslint-disable-next-line @typescript-eslint/naming-convention var internal_processStyles = function internal_processStyles(tag, processor) { // Emotion attaches all the styles as `__emotion_styles`. // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186 if (Array.isArray(tag.__emotion_styles)) { tag.__emotion_styles = processor(tag.__emotion_styles); } }; // https://github.com/sindresorhus/is-plain-obj/blob/main/index.js function isPlainObject(item) { if (_typeof(item) !== 'object' || item === null) { return false; } var prototype = Object.getPrototypeOf(item); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item); } function deepClone(source) { if (!isPlainObject(source)) { return source; } var output = {}; Object.keys(source).forEach(function (key) { output[key] = deepClone(source[key]); }); return output; } function deepmerge(target, source) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { clone: true }; var output = options.clone ? _extends({}, target) : target; if (isPlainObject(target) && isPlainObject(source)) { Object.keys(source).forEach(function (key) { // Avoid prototype pollution if (key === '__proto__') { return; } if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) { // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type. output[key] = deepmerge(target[key], source[key], options); } else if (options.clone) { output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key]; } else { output[key] = source[key]; } }); } return output; } var sortBreakpointsValues = function sortBreakpointsValues(values) { var breakpointsAsArray = Object.keys(values).map(function (key) { return { key: key, val: values[key] }; }) || []; // Sort in ascending order breakpointsAsArray.sort(function (breakpoint1, breakpoint2) { return breakpoint1.val - breakpoint2.val; }); return breakpointsAsArray.reduce(function (acc, obj) { return _extends({}, acc, _defineProperty({}, obj.key, obj.val)); }, {}); }; // Keep in mind that @media is inclusive by the CSS specification. function createBreakpoints(breakpoints) { var _breakpoints$values = breakpoints.values, values = _breakpoints$values === void 0 ? { xs: 0, // phone sm: 600, // tablet md: 900, // small laptop lg: 1200, // desktop xl: 1536 // large screen } : _breakpoints$values, _breakpoints$unit = breakpoints.unit, unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit, _breakpoints$step = breakpoints.step, step = _breakpoints$step === void 0 ? 5 : _breakpoints$step, other = _objectWithoutProperties(breakpoints, ["values", "unit", "step"]); var sortedValues = sortBreakpointsValues(values); var keys = Object.keys(sortedValues); function up(key) { var value = typeof values[key] === 'number' ? values[key] : key; return "@media (min-width:".concat(value).concat(unit, ")"); } function down(key) { var value = typeof values[key] === 'number' ? values[key] : key; return "@media (max-width:".concat(value - step / 100).concat(unit, ")"); } function between(start, end) { var endIndex = keys.indexOf(end); return "@media (min-width:".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, ") and ") + "(max-width:".concat((endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100).concat(unit, ")"); } function only(key) { if (keys.indexOf(key) + 1 < keys.length) { return between(key, keys[keys.indexOf(key) + 1]); } return up(key); } function not(key) { // handle first and last key separately, for better readability var keyIndex = keys.indexOf(key); if (keyIndex === 0) { return up(keys[1]); } if (keyIndex === keys.length - 1) { return down(keys[keyIndex]); } return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and'); } return _extends({ keys: keys, values: sortedValues, up: up, down: down, between: between, only: only, not: not, unit: unit }, other); } var shape = { borderRadius: 4 }; var shape$1 = shape; function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } var responsivePropType = PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) ; var responsivePropType$1 = responsivePropType; function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function merge(acc, item) { if (!item) { return acc; } return deepmerge(acc, item, { clone: false // No need to clone deep, it's way faster. }); } // The breakpoint **start** at this value. // For instance with the first breakpoint xs: [xs, sm[. var values$1 = { xs: 0, // phone sm: 600, // tablet md: 900, // small laptop lg: 1200, // desktop xl: 1536 // large screen }; var defaultBreakpoints = { // Sorted ASC by size. That's important. // It can't be configured as it's used statically for propTypes. keys: ['xs', 'sm', 'md', 'lg', 'xl'], up: function up(key) { return "@media (min-width:".concat(values$1[key], "px)"); } }; function handleBreakpoints(props, propValue, styleFromPropValue) { var theme = props.theme || {}; if (Array.isArray(propValue)) { var themeBreakpoints = theme.breakpoints || defaultBreakpoints; return propValue.reduce(function (acc, item, index) { acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]); return acc; }, {}); } if (_typeof(propValue) === 'object') { var _themeBreakpoints = theme.breakpoints || defaultBreakpoints; return Object.keys(propValue).reduce(function (acc, breakpoint) { // key is breakpoint if (Object.keys(_themeBreakpoints.values || values$1).indexOf(breakpoint) !== -1) { var mediaKey = _themeBreakpoints.up(breakpoint); acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint); } else { var cssKey = breakpoint; acc[cssKey] = propValue[cssKey]; } return acc; }, {}); } var output = styleFromPropValue(propValue); return output; } function createEmptyBreakpointObject() { var _breakpointsInput$key; var breakpointsInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce(function (acc, key) { var breakpointStyleKey = breakpointsInput.up(key); acc[breakpointStyleKey] = {}; return acc; }, {}); return breakpointsInOrder || {}; } function removeUnusedBreakpoints(breakpointKeys, style) { return breakpointKeys.reduce(function (acc, key) { var breakpointOutput = acc[key]; var isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0; if (isBreakpointUnused) { delete acc[key]; } return acc; }, style); } function mergeBreakpointsInOrder(breakpointsInput) { var emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput); for (var _len = arguments.length, styles = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { styles[_key - 1] = arguments[_key]; } var mergedOutput = [emptyBreakpoints].concat(styles).reduce(function (prev, next) { return deepmerge(prev, next); }, {}); return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput); } // compute base for responsive values; e.g., // [1,2,3] => {xs: true, sm: true, md: true} // {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true} function computeBreakpointsBase(breakpointValues, themeBreakpoints) { // fixed value if (_typeof(breakpointValues) !== 'object') { return {}; } var base = {}; var breakpointsKeys = Object.keys(themeBreakpoints); if (Array.isArray(breakpointValues)) { breakpointsKeys.forEach(function (breakpoint, i) { if (i < breakpointValues.length) { base[breakpoint] = true; } }); } else { breakpointsKeys.forEach(function (breakpoint) { if (breakpointValues[breakpoint] != null) { base[breakpoint] = true; } }); } return base; } function resolveBreakpointValues(_ref) { var breakpointValues = _ref.values, themeBreakpoints = _ref.breakpoints, customBase = _ref.base; var base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints); var keys = Object.keys(base); if (keys.length === 0) { return breakpointValues; } var previous; return keys.reduce(function (acc, breakpoint, i) { if (Array.isArray(breakpointValues)) { acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous]; previous = i; } else if (_typeof(breakpointValues) === 'object') { acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous]; previous = breakpoint; } else { acc[breakpoint] = breakpointValues; } return acc; }, {}); } // It should to be noted that this function isn't equivalent to `text-transform: capitalize`. // // A strict capitalization should uppercase the first letter of each word in the sentence. // We only handle the first word. function capitalize(string) { if (typeof string !== 'string') { throw new Error("MUI: `capitalize(string)` expects a string argument." ); } return string.charAt(0).toUpperCase() + string.slice(1); } function getPath(obj, path) { var checkVars = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (!path || typeof path !== 'string') { return null; } // Check if CSS variables are used if (obj && obj.vars && checkVars) { var val = "vars.".concat(path).split('.').reduce(function (acc, item) { return acc && acc[item] ? acc[item] : null; }, obj); if (val != null) { return val; } } return path.split('.').reduce(function (acc, item) { if (acc && acc[item] != null) { return acc[item]; } return null; }, obj); } function getStyleValue$1(themeMapping, transform, propValueFinal) { var userValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : propValueFinal; var value; if (typeof themeMapping === 'function') { value = themeMapping(propValueFinal); } else if (Array.isArray(themeMapping)) { value = themeMapping[propValueFinal] || userValue; } else { value = getPath(themeMapping, propValueFinal) || userValue; } if (transform) { value = transform(value, userValue, themeMapping); } return value; } function style$2(options) { var prop = options.prop, _options$cssProperty = options.cssProperty, cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty, themeKey = options.themeKey, transform = options.transform; // false positive // eslint-disable-next-line react/function-component-definition var fn = function fn(props) { if (props[prop] == null) { return null; } var propValue = props[prop]; var theme = props.theme; var themeMapping = getPath(theme, themeKey) || {}; var styleFromPropValue = function styleFromPropValue(propValueFinal) { var value = getStyleValue$1(themeMapping, transform, propValueFinal); if (propValueFinal === value && typeof propValueFinal === 'string') { // Haven't found value value = getStyleValue$1(themeMapping, transform, "".concat(prop).concat(propValueFinal === 'default' ? '' : capitalize(propValueFinal)), propValueFinal); } if (cssProperty === false) { return value; } return _defineProperty({}, cssProperty, value); }; return handleBreakpoints(props, propValue, styleFromPropValue); }; fn.propTypes = _defineProperty({}, prop, responsivePropType$1) ; fn.filterProps = [prop]; return fn; } function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) { cache[arg] = fn(arg); } return cache[arg]; }; } var properties = { m: 'margin', p: 'padding' }; var directions = { t: 'Top', r: 'Right', b: 'Bottom', l: 'Left', x: ['Left', 'Right'], y: ['Top', 'Bottom'] }; var aliases = { marginX: 'mx', marginY: 'my', paddingX: 'px', paddingY: 'py' }; // memoize() impact: // From 300,000 ops/sec // To 350,000 ops/sec var getCssProperties = memoize(function (prop) { // It's not a shorthand notation. if (prop.length > 2) { if (aliases[prop]) { prop = aliases[prop]; } else { return [prop]; } } var _prop$split = prop.split(''), _prop$split2 = _slicedToArray(_prop$split, 2), a = _prop$split2[0], b = _prop$split2[1]; var property = properties[a]; var direction = directions[b] || ''; return Array.isArray(direction) ? direction.map(function (dir) { return property + dir; }) : [property + direction]; }); var marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd']; var paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd']; var spacingKeys = [].concat(marginKeys, paddingKeys); function createUnaryUnit(theme, themeKey, defaultValue, propName) { var _getPath; var themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue; if (typeof themeSpacing === 'number') { return function (abs) { if (typeof abs === 'string') { return abs; } { if (typeof abs !== 'number') { console.error("MUI: Expected ".concat(propName, " argument to be a number or a string, got ").concat(abs, ".")); } } return themeSpacing * abs; }; } if (Array.isArray(themeSpacing)) { return function (abs) { if (typeof abs === 'string') { return abs; } { if (!Number.isInteger(abs)) { console.error(["MUI: The `theme.".concat(themeKey, "` array type cannot be combined with non integer values.") + "You should either use an integer value that can be used as index, or define the `theme.".concat(themeKey, "` as a number.")].join('\n')); } else if (abs > themeSpacing.length - 1) { console.error(["MUI: The value provided (".concat(abs, ") overflows."), "The supported values are: ".concat(JSON.stringify(themeSpacing), "."), "".concat(abs, " > ").concat(themeSpacing.length - 1, ", you need to add the missing values.")].join('\n')); } } return themeSpacing[abs]; }; } if (typeof themeSpacing === 'function') { return themeSpacing; } { console.error(["MUI: The `theme.".concat(themeKey, "` value (").concat(themeSpacing, ") is invalid."), 'It should be a number, an array or a function.'].join('\n')); } return function () { return undefined; }; } function createUnarySpacing(theme) { return createUnaryUnit(theme, 'spacing', 8, 'spacing'); } function getValue(transformer, propValue) { if (typeof propValue === 'string' || propValue == null) { return propValue; } var abs = Math.abs(propValue); var transformed = transformer(abs); if (propValue >= 0) { return transformed; } if (typeof transformed === 'number') { return -transformed; } return "-".concat(transformed); } function getStyleFromPropValue(cssProperties, transformer) { return function (propValue) { return cssProperties.reduce(function (acc, cssProperty) { acc[cssProperty] = getValue(transformer, propValue); return acc; }, {}); }; } function resolveCssProperty(props, keys, prop, transformer) { // Using a hash computation over an array iteration could be faster, but with only 28 items, // it's doesn't worth the bundle size. if (keys.indexOf(prop) === -1) { return null; } var cssProperties = getCssProperties(prop); var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer); var propValue = props[prop]; return handleBreakpoints(props, propValue, styleFromPropValue); } function style$1(props, keys) { var transformer = createUnarySpacing(props.theme); return Object.keys(props).map(function (prop) { return resolveCssProperty(props, keys, prop, transformer); }).reduce(merge, {}); } function margin(props) { return style$1(props, marginKeys); } margin.propTypes = marginKeys.reduce(function (obj, key) { obj[key] = responsivePropType$1; return obj; }, {}) ; margin.filterProps = marginKeys; function padding(props) { return style$1(props, paddingKeys); } padding.propTypes = paddingKeys.reduce(function (obj, key) { obj[key] = responsivePropType$1; return obj; }, {}) ; padding.filterProps = paddingKeys; spacingKeys.reduce(function (obj, key) { obj[key] = responsivePropType$1; return obj; }, {}) ; // The different signatures imply different meaning for their arguments that can't be expressed structurally. // We express the difference with variable names. function createSpacing() { var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8; // Already transformed. if (spacingInput.mui) { return spacingInput; } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout. // Smaller components, such as icons, can align to a 4dp grid. // https://m2.material.io/design/layout/understanding-layout.html var transform = createUnarySpacing({ spacing: spacingInput }); var spacing = function spacing() { for (var _len = arguments.length, argsInput = new Array(_len), _key = 0; _key < _len; _key++) { argsInput[_key] = arguments[_key]; } { if (!(argsInput.length <= 4)) { console.error("MUI: Too many arguments provided, expected between 0 and 4, got ".concat(argsInput.length)); } } var args = argsInput.length === 0 ? [1] : argsInput; return args.map(function (argument) { var output = transform(argument); return typeof output === 'number' ? "".concat(output, "px") : output; }).join(' '); }; spacing.mui = true; return spacing; } function compose() { for (var _len = arguments.length, styles = new Array(_len), _key = 0; _key < _len; _key++) { styles[_key] = arguments[_key]; } var handlers = styles.reduce(function (acc, style) { style.filterProps.forEach(function (prop) { acc[prop] = style; }); return acc; }, {}); // false positive // eslint-disable-next-line react/function-component-definition var fn = function fn(props) { return Object.keys(props).reduce(function (acc, prop) { if (handlers[prop]) { return merge(acc, handlers[prop](props)); } return acc; }, {}); }; fn.propTypes = styles.reduce(function (acc, style) { return Object.assign(acc, style.propTypes); }, {}) ; fn.filterProps = styles.reduce(function (acc, style) { return acc.concat(style.filterProps); }, []); return fn; } function borderTransform(value) { if (typeof value !== 'number') { return value; } return "".concat(value, "px solid"); } function createBorderStyle(prop, transform) { return style$2({ prop: prop, themeKey: 'borders', transform: transform }); } var border = createBorderStyle('border', borderTransform); var borderTop = createBorderStyle('borderTop', borderTransform); var borderRight = createBorderStyle('borderRight', borderTransform); var borderBottom = createBorderStyle('borderBottom', borderTransform); var borderLeft = createBorderStyle('borderLeft', borderTransform); var borderColor = createBorderStyle('borderColor'); var borderTopColor = createBorderStyle('borderTopColor'); var borderRightColor = createBorderStyle('borderRightColor'); var borderBottomColor = createBorderStyle('borderBottomColor'); var borderLeftColor = createBorderStyle('borderLeftColor'); var outline = createBorderStyle('outline', borderTransform); var outlineColor = createBorderStyle('outlineColor'); // false positive // eslint-disable-next-line react/function-component-definition var borderRadius = function borderRadius(props) { if (props.borderRadius !== undefined && props.borderRadius !== null) { var transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius'); var styleFromPropValue = function styleFromPropValue(propValue) { return { borderRadius: getValue(transformer, propValue) }; }; return handleBreakpoints(props, props.borderRadius, styleFromPropValue); } return null; }; borderRadius.propTypes = { borderRadius: responsivePropType$1 } ; borderRadius.filterProps = ['borderRadius']; compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor); // false positive // eslint-disable-next-line react/function-component-definition var gap = function gap(props) { if (props.gap !== undefined && props.gap !== null) { var transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap'); var styleFromPropValue = function styleFromPropValue(propValue) { return { gap: getValue(transformer, propValue) }; }; return handleBreakpoints(props, props.gap, styleFromPropValue); } return null; }; gap.propTypes = { gap: responsivePropType$1 } ; gap.filterProps = ['gap']; // false positive // eslint-disable-next-line react/function-component-definition var columnGap = function columnGap(props) { if (props.columnGap !== undefined && props.columnGap !== null) { var transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap'); var styleFromPropValue = function styleFromPropValue(propValue) { return { columnGap: getValue(transformer, propValue) }; }; return handleBreakpoints(props, props.columnGap, styleFromPropValue); } return null; }; columnGap.propTypes = { columnGap: responsivePropType$1 } ; columnGap.filterProps = ['columnGap']; // false positive // eslint-disable-next-line react/function-component-definition var rowGap = function rowGap(props) { if (props.rowGap !== undefined && props.rowGap !== null) { var transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap'); var styleFromPropValue = function styleFromPropValue(propValue) { return { rowGap: getValue(transformer, propValue) }; }; return handleBreakpoints(props, props.rowGap, styleFromPropValue); } return null; }; rowGap.propTypes = { rowGap: responsivePropType$1 } ; rowGap.filterProps = ['rowGap']; var gridColumn = style$2({ prop: 'gridColumn' }); var gridRow = style$2({ prop: 'gridRow' }); var gridAutoFlow = style$2({ prop: 'gridAutoFlow' }); var gridAutoColumns = style$2({ prop: 'gridAutoColumns' }); var gridAutoRows = style$2({ prop: 'gridAutoRows' }); var gridTemplateColumns = style$2({ prop: 'gridTemplateColumns' }); var gridTemplateRows = style$2({ prop: 'gridTemplateRows' }); var gridTemplateAreas = style$2({ prop: 'gridTemplateAreas' }); var gridArea = style$2({ prop: 'gridArea' }); compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea); function paletteTransform(value, userValue) { if (userValue === 'grey') { return userValue; } return value; } var color = style$2({ prop: 'color', themeKey: 'palette', transform: paletteTransform }); var bgcolor = style$2({ prop: 'bgcolor', cssProperty: 'backgroundColor', themeKey: 'palette', transform: paletteTransform }); var backgroundColor = style$2({ prop: 'backgroundColor', themeKey: 'palette', transform: paletteTransform }); compose(color, bgcolor, backgroundColor); function sizingTransform(value) { return value <= 1 && value !== 0 ? "".concat(value * 100, "%") : value; } var width = style$2({ prop: 'width', transform: sizingTransform }); var maxWidth = function maxWidth(props) { if (props.maxWidth !== undefined && props.maxWidth !== null) { var styleFromPropValue = function styleFromPropValue(propValue) { var _props$theme, _props$theme2; var breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || values$1[propValue]; if (!breakpoint) { return { maxWidth: sizingTransform(propValue) }; } if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') { return { maxWidth: "".concat(breakpoint).concat(props.theme.breakpoints.unit) }; } return { maxWidth: breakpoint }; }; return handleBreakpoints(props, props.maxWidth, styleFromPropValue); } return null; }; maxWidth.filterProps = ['maxWidth']; var minWidth = style$2({ prop: 'minWidth', transform: sizingTransform }); var height = style$2({ prop: 'height', transform: sizingTransform }); var maxHeight = style$2({ prop: 'maxHeight', transform: sizingTransform }); var minHeight = style$2({ prop: 'minHeight', transform: sizingTransform }); style$2({ prop: 'size', cssProperty: 'width', transform: sizingTransform }); style$2({ prop: 'size', cssProperty: 'height', transform: sizingTransform }); var boxSizing = style$2({ prop: 'boxSizing' }); compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing); var defaultSxConfig = { // borders border: { themeKey: 'borders', transform: borderTransform }, borderTop: { themeKey: 'borders', transform: borderTransform }, borderRight: { themeKey: 'borders', transform: borderTransform }, borderBottom: { themeKey: 'borders', transform: borderTransform }, borderLeft: { themeKey: 'borders', transform: borderTransform }, borderColor: { themeKey: 'palette' }, borderTopColor: { themeKey: 'palette' }, borderRightColor: { themeKey: 'palette' }, borderBottomColor: { themeKey: 'palette' }, borderLeftColor: { themeKey: 'palette' }, outline: { themeKey: 'borders', transform: borderTransform }, outlineColor: { themeKey: 'palette' }, borderRadius: { themeKey: 'shape.borderRadius', style: borderRadius }, // palette color: { themeKey: 'palette', transform: paletteTransform }, bgcolor: { themeKey: 'palette', cssProperty: 'backgroundColor', transform: paletteTransform }, backgroundColor: { themeKey: 'palette', transform: paletteTransform }, // spacing p: { style: padding }, pt: { style: padding }, pr: { style: padding }, pb: { style: padding }, pl: { style: padding }, px: { style: padding }, py: { style: padding }, padding: { style: padding }, paddingTop: { style: padding }, paddingRight: { style: padding }, paddingBottom: { style: padding }, paddingLeft: { style: padding }, paddingX: { style: padding }, paddingY: { style: padding }, paddingInline: { style: padding }, paddingInlineStart: { style: padding }, paddingInlineEnd: { style: padding }, paddingBlock: { style: padding }, paddingBlockStart: { style: padding }, paddingBlockEnd: { style: padding }, m: { style: margin }, mt: { style: margin }, mr: { style: margin }, mb: { style: margin }, ml: { style: margin }, mx: { style: margin }, my: { style: margin }, margin: { style: margin }, marginTop: { style: margin }, marginRight: { style: margin }, marginBottom: { style: margin }, marginLeft: { style: margin }, marginX: { style: margin }, marginY: { style: margin }, marginInline: { style: margin }, marginInlineStart: { style: margin }, marginInlineEnd: { style: margin }, marginBlock: { style: margin }, marginBlockStart: { style: margin }, marginBlockEnd: { style: margin }, // display displayPrint: { cssProperty: false, transform: function transform(value) { return { '@media print': { display: value } }; } }, display: {}, overflow: {}, textOverflow: {}, visibility: {}, whiteSpace: {}, // flexbox flexBasis: {}, flexDirection: {}, flexWrap: {}, justifyContent: {}, alignItems: {}, alignContent: {}, order: {}, flex: {}, flexGrow: {}, flexShrink: {}, alignSelf: {}, justifyItems: {}, justifySelf: {}, // grid gap: { style: gap }, rowGap: { style: rowGap }, columnGap: { style: columnGap }, gridColumn: {}, gridRow: {}, gridAutoFlow: {}, gridAutoColumns: {}, gridAutoRows: {}, gridTemplateColumns: {}, gridTemplateRows: {}, gridTemplateAreas: {}, gridArea: {}, // positions position: {}, zIndex: { themeKey: 'zIndex' }, top: {}, right: {}, bottom: {}, left: {}, // shadows boxShadow: { themeKey: 'shadows' }, // sizing width: { transform: sizingTransform }, maxWidth: { style: maxWidth }, minWidth: { transform: sizingTransform }, height: { transform: sizingTransform }, maxHeight: { transform: sizingTransform }, minHeight: { transform: sizingTransform }, boxSizing: {}, // typography fontFamily: { themeKey: 'typography' }, fontSize: { themeKey: 'typography' }, fontStyle: { themeKey: 'typography' }, fontWeight: { themeKey: 'typography' }, letterSpacing: {}, textTransform: {}, lineHeight: {}, textAlign: {}, typography: { cssProperty: false, themeKey: 'typography' } }; var defaultSxConfig$1 = defaultSxConfig; function objectsHaveSameKeys() { for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) { objects[_key] = arguments[_key]; } var allKeys = objects.reduce(function (keys, object) { return keys.concat(Object.keys(object)); }, []); var union = new Set(allKeys); return objects.every(function (object) { return union.size === Object.keys(object).length; }); } function callIfFn(maybeFn, arg) { return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn; } // eslint-disable-next-line @typescript-eslint/naming-convention function unstable_createStyleFunctionSx() { function getThemeValue(prop, val, theme, config) { var props = _defineProperty(_defineProperty({}, prop, val), "theme", theme); var options = config[prop]; if (!options) { return _defineProperty({}, prop, val); } var _options$cssProperty = options.cssProperty, cssProperty = _options$cssProperty === void 0 ? prop : _options$cssProperty, themeKey = options.themeKey, transform = options.transform, style = options.style; if (val == null) { return null; } // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123 if (themeKey === 'typography' && val === 'inherit') { return _defineProperty({}, prop, val); } var themeMapping = getPath(theme, themeKey) || {}; if (style) { return style(props); } var styleFromPropValue = function styleFromPropValue(propValueFinal) { var value = getStyleValue$1(themeMapping, transform, propValueFinal); if (propValueFinal === value && typeof propValueFinal === 'string') { // Haven't found value value = getStyleValue$1(themeMapping, transform, "".concat(prop).concat(propValueFinal === 'default' ? '' : capitalize(propValueFinal)), propValueFinal); } if (cssProperty === false) { return value; } return _defineProperty({}, cssProperty, value); }; return handleBreakpoints(props, val, styleFromPropValue); } function styleFunctionSx(props) { var _theme$unstable_sxCon; var _ref4 = props || {}, sx = _ref4.sx, _ref4$theme = _ref4.theme, theme = _ref4$theme === void 0 ? {} : _ref4$theme; if (!sx) { return null; // Emotion & styled-components will neglect null } var config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig$1; /* * Receive `sxInput` as object or callback * and then recursively check keys & values to create media query object styles. * (the result will be used in `styled`) */ function traverse(sxInput) { var sxObject = sxInput; if (typeof sxInput === 'function') { sxObject = sxInput(theme); } else if (_typeof(sxInput) !== 'object') { // value return sxInput; } if (!sxObject) { return null; } var emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints); var breakpointsKeys = Object.keys(emptyBreakpoints); var css = emptyBreakpoints; Object.keys(sxObject).forEach(function (styleKey) { var value = callIfFn(sxObject[styleKey], theme); if (value !== null && value !== undefined) { if (_typeof(value) === 'object') { if (config[styleKey]) { css = merge(css, getThemeValue(styleKey, value, theme, config)); } else { var breakpointsValues = handleBreakpoints({ theme: theme }, value, function (x) { return _defineProperty({}, styleKey, x); }); if (objectsHaveSameKeys(breakpointsValues, value)) { css[styleKey] = styleFunctionSx({ sx: value, theme: theme }); } else { css = merge(css, breakpointsValues); } } } else { css = merge(css, getThemeValue(styleKey, value, theme, config)); } } }); return removeUnusedBreakpoints(breakpointsKeys, css); } return Array.isArray(sx) ? sx.map(traverse) : traverse(sx); } return styleFunctionSx; } var styleFunctionSx = unstable_createStyleFunctionSx(); styleFunctionSx.filterProps = ['sx']; var styleFunctionSx$1 = styleFunctionSx; /** * A universal utility to style components with multiple color modes. Always use it from the theme object. * It works with: * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/) * - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/) * - Zero-runtime engine * * Tips: Use an array over object spread and place `theme.applyStyles()` last. * * ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })] * * 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })} * * @example * 1. using with `styled`: * ```jsx * const Component = styled('div')(({ theme }) => [ * { background: '#e5e5e5' }, * theme.applyStyles('dark', { * background: '#1c1c1c', * color: '#fff', * }), * ]); * ``` * * @example * 2. using with `sx` prop: * ```jsx * [ * { background: '#e5e5e5' }, * theme.applyStyles('dark', { * background: '#1c1c1c', * color: '#fff', * }), * ]} * /> * ``` * * @example * 3. theming a component: * ```jsx * extendTheme({ * components: { * MuiButton: { * styleOverrides: { * root: ({ theme }) => [ * { background: '#e5e5e5' }, * theme.applyStyles('dark', { * background: '#1c1c1c', * color: '#fff', * }), * ], * }, * } * } * }) *``` */ function applyStyles$2(key, styles) { // @ts-expect-error this is 'any' type var theme = this; if (theme.vars && typeof theme.getColorSchemeSelector === 'function') { // If CssVarsProvider is used as a provider, // returns '* :where([data-mui-color-scheme="light|dark"]) &' var selector = theme.getColorSchemeSelector(key).replace(/(\[[^\]]+\])/, '*:where($1)'); return _defineProperty({}, selector, styles); } if (theme.palette.mode === key) { return styles; } return {}; } function createTheme$1() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$breakpoints = options.breakpoints, breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints, _options$palette = options.palette, paletteInput = _options$palette === void 0 ? {} : _options$palette, spacingInput = options.spacing, _options$shape = options.shape, shapeInput = _options$shape === void 0 ? {} : _options$shape, other = _objectWithoutProperties(options, ["breakpoints", "palette", "spacing", "shape"]); var breakpoints = createBreakpoints(breakpointsInput); var spacing = createSpacing(spacingInput); var muiTheme = deepmerge({ breakpoints: breakpoints, direction: 'ltr', components: {}, // Inject component definitions. palette: _extends({ mode: 'light' }, paletteInput), spacing: spacing, shape: _extends({}, shape$1, shapeInput) }, other); muiTheme.applyStyles = applyStyles$2; for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } muiTheme = args.reduce(function (acc, argument) { return deepmerge(acc, argument); }, muiTheme); muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig); muiTheme.unstable_sx = function sx(props) { return styleFunctionSx$1({ sx: props, theme: this }); }; return muiTheme; } function isObjectEmpty(obj) { return Object.keys(obj).length === 0; } function useTheme$3() { var defaultTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; var contextTheme = React__namespace.useContext(ThemeContext$2); return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme; } var systemDefaultTheme$1 = createTheme$1(); function useTheme$2() { var defaultTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : systemDefaultTheme$1; return useTheme$3(defaultTheme); } function GlobalStyles$1(_ref) { var styles = _ref.styles, themeId = _ref.themeId, _ref$defaultTheme = _ref.defaultTheme, defaultTheme = _ref$defaultTheme === void 0 ? {} : _ref$defaultTheme; var upperTheme = useTheme$2(defaultTheme); var globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles; return /*#__PURE__*/jsxRuntime_1(GlobalStyles$2, { styles: globalStyles }); } GlobalStyles$1.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * @ignore */ defaultTheme: PropTypes.object, /** * @ignore */ styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]), /** * @ignore */ themeId: PropTypes.string } ; var splitProps = function splitProps(props) { var _props$theme$unstable, _props$theme; var result = { systemProps: {}, otherProps: {} }; var config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig$1; Object.keys(props).forEach(function (prop) { if (config[prop]) { result.systemProps[prop] = props[prop]; } else { result.otherProps[prop] = props[prop]; } }); return result; }; function extendSxProp(props) { var inSx = props.sx, other = _objectWithoutProperties(props, ["sx"]); var _splitProps = splitProps(other), systemProps = _splitProps.systemProps, otherProps = _splitProps.otherProps; var finalSx; if (Array.isArray(inSx)) { finalSx = [systemProps].concat(_toConsumableArray(inSx)); } else if (typeof inSx === 'function') { finalSx = function finalSx() { var result = inSx.apply(void 0, arguments); if (!isPlainObject(result)) { return systemProps; } return _extends({}, systemProps, result); }; } else { finalSx = _extends({}, systemProps, inSx); } return _extends({}, otherProps, { sx: finalSx }); } var defaultGenerator = function defaultGenerator(componentName) { return componentName; }; var createClassNameGenerator = function createClassNameGenerator() { var _generate = defaultGenerator; return { configure: function configure(generator) { _generate = generator; }, generate: function generate(componentName) { return _generate(componentName); }, reset: function reset() { _generate = defaultGenerator; } }; }; var ClassNameGenerator = createClassNameGenerator(); var ClassNameGenerator$1 = ClassNameGenerator; function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t 0 && arguments[0] !== undefined ? arguments[0] : {}; var themeId = options.themeId, defaultTheme = options.defaultTheme, _options$defaultClass = options.defaultClassName, defaultClassName = _options$defaultClass === void 0 ? 'MuiBox-root' : _options$defaultClass, generateClassName = options.generateClassName; var BoxRoot = styled$3('div', { shouldForwardProp: function shouldForwardProp(prop) { return prop !== 'theme' && prop !== 'sx' && prop !== 'as'; } })(styleFunctionSx$1); var Box = /*#__PURE__*/React__namespace.forwardRef(function Box(inProps, ref) { var theme = useTheme$2(defaultTheme); var _extendSxProp = extendSxProp(inProps), className = _extendSxProp.className, _extendSxProp$compone = _extendSxProp.component, component = _extendSxProp$compone === void 0 ? 'div' : _extendSxProp$compone, other = _objectWithoutProperties(_extendSxProp, ["className", "component"]); return /*#__PURE__*/jsxRuntime_1(BoxRoot, _extends({ as: component, ref: ref, className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName), theme: themeId ? theme[themeId] || theme : theme }, other)); }); return Box; } var globalStateClasses = { active: 'active', checked: 'checked', completed: 'completed', disabled: 'disabled', error: 'error', expanded: 'expanded', focused: 'focused', focusVisible: 'focusVisible', open: 'open', readOnly: 'readOnly', required: 'required', selected: 'selected' }; function generateUtilityClass$1(componentName, slot) { var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui'; var globalStateClass = globalStateClasses[slot]; return globalStateClass ? "".concat(globalStatePrefix, "-").concat(globalStateClass) : "".concat(ClassNameGenerator$1.generate(componentName), "-").concat(slot); } function generateUtilityClasses$1(componentName, slots) { var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui'; var result = {}; slots.forEach(function (slot) { result[slot] = generateUtilityClass$1(componentName, slot, globalStatePrefix); }); return result; } var reactIs_development = createCommonjsModule(function (module, exports) { { (function() { // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); // ----------------------------------------------------------------------------- var enableScopeAPI = false; // Experimental Create Event Handle API. var enableCacheElement = false; var enableTransitionTracing = false; // No known bugs, but needs performance testing var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber // stuff. Intended to enable React core members to more easily debug scheduling // issues in DEV builds. var enableDebugTracing = false; // Track which Fiber(s) schedule render work. var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: case REACT_SUSPENSE_LIST_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_SERVER_CONTEXT_TYPE: case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var SuspenseList = REACT_SUSPENSE_LIST_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isConcurrentMode(object) { { if (!hasWarnedAboutDeprecatedIsConcurrentMode) { hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } function isSuspenseList(object) { return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; } exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.SuspenseList = SuspenseList; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isSuspenseList = isSuspenseList; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } }); reactIs_development.ContextConsumer; reactIs_development.ContextProvider; reactIs_development.Element; reactIs_development.ForwardRef; reactIs_development.Fragment; reactIs_development.Lazy; reactIs_development.Memo; reactIs_development.Portal; reactIs_development.Profiler; reactIs_development.StrictMode; reactIs_development.Suspense; reactIs_development.SuspenseList; reactIs_development.isAsyncMode; reactIs_development.isConcurrentMode; reactIs_development.isContextConsumer; reactIs_development.isContextProvider; reactIs_development.isElement; reactIs_development.isForwardRef; reactIs_development.isFragment; reactIs_development.isLazy; reactIs_development.isMemo; reactIs_development.isPortal; reactIs_development.isProfiler; reactIs_development.isStrictMode; reactIs_development.isSuspense; reactIs_development.isSuspenseList; reactIs_development.isValidElementType; reactIs_development.typeOf; var reactIs = createCommonjsModule(function (module) { { module.exports = reactIs_development; } }); var reactIs_1 = reactIs.ForwardRef; var reactIs_2 = reactIs.isFragment; reactIs.isLazy; reactIs.isMemo; var reactIs_5 = reactIs.Memo; reactIs.isValidElementType; // Simplified polyfill for IE11 support // https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3 var fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/; function getFunctionName(fn) { var match = "".concat(fn).match(fnNameMatchRegex); var name = match && match[1]; return name || ''; } function getFunctionComponentName(Component) { var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return Component.displayName || Component.name || getFunctionName(Component) || fallback; } function getWrappedName(outerType, innerType, wrapperName) { var functionName = getFunctionComponentName(innerType); return outerType.displayName || (functionName !== '' ? "".concat(wrapperName, "(").concat(functionName, ")") : wrapperName); } /** * cherry-pick from * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js * originally forked from recompose/getDisplayName with added IE11 support */ function getDisplayName(Component) { if (Component == null) { return undefined; } if (typeof Component === 'string') { return Component; } if (typeof Component === 'function') { return getFunctionComponentName(Component, 'Component'); } // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense` if (_typeof(Component) === 'object') { switch (Component.$$typeof) { case reactIs_1: return getWrappedName(Component, Component.render, 'ForwardRef'); case reactIs_5: return getWrappedName(Component, Component.type, 'memo'); default: return undefined; } } return undefined; } function isEmpty$2(obj) { return Object.keys(obj).length === 0; } // https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40 function isStringTag(tag) { return typeof tag === 'string' && // 96 is one less than the char code // for "a" so this is checking that // it's a lowercase character tag.charCodeAt(0) > 96; } // Update /system/styled/#api in case if this changes function shouldForwardProp(prop) { return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as'; } var systemDefaultTheme = createTheme$1(); var lowercaseFirstLetter = function lowercaseFirstLetter(string) { if (!string) { return string; } return string.charAt(0).toLowerCase() + string.slice(1); }; function resolveTheme(_ref) { var defaultTheme = _ref.defaultTheme, theme = _ref.theme, themeId = _ref.themeId; return isEmpty$2(theme) ? defaultTheme : theme[themeId] || theme; } function defaultOverridesResolver(slot) { if (!slot) { return null; } return function (props, styles) { return styles[slot]; }; } function processStyleArg(callableStyle, _ref2) { var ownerState = _ref2.ownerState, props = _objectWithoutProperties(_ref2, ["ownerState"]); var resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle(_extends({ ownerState: ownerState }, props)) : callableStyle; if (Array.isArray(resolvedStylesArg)) { return resolvedStylesArg.flatMap(function (resolvedStyle) { return processStyleArg(resolvedStyle, _extends({ ownerState: ownerState }, props)); }); } if (!!resolvedStylesArg && _typeof(resolvedStylesArg) === 'object' && Array.isArray(resolvedStylesArg.variants)) { var _resolvedStylesArg$va = resolvedStylesArg.variants, variants = _resolvedStylesArg$va === void 0 ? [] : _resolvedStylesArg$va, otherStyles = _objectWithoutProperties(resolvedStylesArg, ["variants"]); var result = otherStyles; variants.forEach(function (variant) { var isMatch = true; if (typeof variant.props === 'function') { isMatch = variant.props(_extends({ ownerState: ownerState }, props, ownerState)); } else { Object.keys(variant.props).forEach(function (key) { if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) { isMatch = false; } }); } if (isMatch) { if (!Array.isArray(result)) { result = [result]; } result.push(typeof variant.style === 'function' ? variant.style(_extends({ ownerState: ownerState }, props, ownerState)) : variant.style); } }); return result; } return resolvedStylesArg; } function createStyled() { var input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var themeId = input.themeId, _input$defaultTheme = input.defaultTheme, defaultTheme = _input$defaultTheme === void 0 ? systemDefaultTheme : _input$defaultTheme, _input$rootShouldForw = input.rootShouldForwardProp, rootShouldForwardProp = _input$rootShouldForw === void 0 ? shouldForwardProp : _input$rootShouldForw, _input$slotShouldForw = input.slotShouldForwardProp, slotShouldForwardProp = _input$slotShouldForw === void 0 ? shouldForwardProp : _input$slotShouldForw; var systemSx = function systemSx(props) { return styleFunctionSx$1(_extends({}, props, { theme: resolveTheme(_extends({}, props, { defaultTheme: defaultTheme, themeId: themeId })) })); }; systemSx.__mui_systemSx = true; return function (tag) { var inputOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components. internal_processStyles(tag, function (styles) { return styles.filter(function (style) { return !(style != null && style.__mui_systemSx); }); }); var componentName = inputOptions.name, componentSlot = inputOptions.slot, inputSkipVariantsResolver = inputOptions.skipVariantsResolver, inputSkipSx = inputOptions.skipSx, _inputOptions$overrid = inputOptions.overridesResolver, overridesResolver = _inputOptions$overrid === void 0 ? defaultOverridesResolver(lowercaseFirstLetter(componentSlot)) : _inputOptions$overrid, options = _objectWithoutProperties(inputOptions, ["name", "slot", "skipVariantsResolver", "skipSx", "overridesResolver"]); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots. var skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : // TODO v6: remove `Root` in the next major release // For more details: https://github.com/mui/material-ui/pull/37908 componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false; var skipSx = inputSkipSx || false; var label; { if (componentName) { // TODO v6: remove `lowercaseFirstLetter()` in the next major release // For more details: https://github.com/mui/material-ui/pull/37908 label = "".concat(componentName, "-").concat(lowercaseFirstLetter(componentSlot || 'Root')); } } var shouldForwardPropOption = shouldForwardProp; // TODO v6: remove `Root` in the next major release // For more details: https://github.com/mui/material-ui/pull/37908 if (componentSlot === 'Root' || componentSlot === 'root') { shouldForwardPropOption = rootShouldForwardProp; } else if (componentSlot) { // any other slot specified shouldForwardPropOption = slotShouldForwardProp; } else if (isStringTag(tag)) { // for string (html) tag, preserve the behavior in emotion & styled-components. shouldForwardPropOption = undefined; } var defaultStyledResolver = styled$3(tag, _extends({ shouldForwardProp: shouldForwardPropOption, label: label }, options)); var transformStyleArg = function transformStyleArg(stylesArg) { // On the server Emotion doesn't use React.forwardRef for creating components, so the created // component stays as a function. This condition makes sure that we do not interpolate functions // which are basically components used as a selectors. if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || isPlainObject(stylesArg)) { return function (props) { return processStyleArg(stylesArg, _extends({}, props, { theme: resolveTheme({ theme: props.theme, defaultTheme: defaultTheme, themeId: themeId }) })); }; } return stylesArg; }; var muiStyledResolver = function muiStyledResolver(styleArg) { var transformedStyleArg = transformStyleArg(styleArg); for (var _len = arguments.length, expressions = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { expressions[_key - 1] = arguments[_key]; } var expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : []; if (componentName && overridesResolver) { expressionsWithDefaultTheme.push(function (props) { var theme = resolveTheme(_extends({}, props, { defaultTheme: defaultTheme, themeId: themeId })); if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) { return null; } var styleOverrides = theme.components[componentName].styleOverrides; var resolvedStyleOverrides = {}; // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly Object.entries(styleOverrides).forEach(function (_ref3) { var _ref4 = _slicedToArray(_ref3, 2), slotKey = _ref4[0], slotStyle = _ref4[1]; resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, _extends({}, props, { theme: theme })); }); return overridesResolver(props, resolvedStyleOverrides); }); } if (componentName && !skipVariantsResolver) { expressionsWithDefaultTheme.push(function (props) { var _theme$components; var theme = resolveTheme(_extends({}, props, { defaultTheme: defaultTheme, themeId: themeId })); var themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants; return processStyleArg({ variants: themeVariants }, _extends({}, props, { theme: theme })); }); } if (!skipSx) { expressionsWithDefaultTheme.push(systemSx); } var numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length; if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) { var placeholders = new Array(numOfCustomFnsApplied).fill(''); // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles. transformedStyleArg = [].concat(_toConsumableArray(styleArg), _toConsumableArray(placeholders)); transformedStyleArg.raw = [].concat(_toConsumableArray(styleArg.raw), _toConsumableArray(placeholders)); } var Component = defaultStyledResolver.apply(void 0, [transformedStyleArg].concat(_toConsumableArray(expressionsWithDefaultTheme))); { var displayName; if (componentName) { displayName = "".concat(componentName).concat(capitalize(componentSlot || '')); } if (displayName === undefined) { displayName = "Styled(".concat(getDisplayName(tag), ")"); } Component.displayName = displayName; } if (tag.muiName) { Component.muiName = tag.muiName; } return Component; }; if (defaultStyledResolver.withConfig) { muiStyledResolver.withConfig = defaultStyledResolver.withConfig; } return muiStyledResolver; }; } var styled$2 = createStyled(); var systemStyled = styled$2; /** * Add keys, values of `defaultProps` that does not exist in `props` * @param {object} defaultProps * @param {object} props * @returns {object} resolved props */ function resolveProps(defaultProps, props) { var output = _extends({}, props); Object.keys(defaultProps).forEach(function (propName) { if (propName.toString().match(/^(components|slots)$/)) { output[propName] = _extends({}, defaultProps[propName], output[propName]); } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) { var defaultSlotProps = defaultProps[propName] || {}; var slotProps = props[propName]; output[propName] = {}; if (!slotProps || !Object.keys(slotProps)) { // Reduce the iteration if the slot props is empty output[propName] = defaultSlotProps; } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) { // Reduce the iteration if the default slot props is empty output[propName] = slotProps; } else { output[propName] = _extends({}, slotProps); Object.keys(defaultSlotProps).forEach(function (slotPropName) { output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]); }); } } else if (output[propName] === undefined) { output[propName] = defaultProps[propName]; } }); return output; } function getThemeProps(params) { var theme = params.theme, name = params.name, props = params.props; if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) { return props; } return resolveProps(theme.components[name].defaultProps, props); } function useThemeProps$c(_ref) { var props = _ref.props, name = _ref.name, defaultTheme = _ref.defaultTheme, themeId = _ref.themeId; var theme = useTheme$2(defaultTheme); if (themeId) { theme = theme[themeId] || theme; } var mergedProps = getThemeProps({ theme: theme, name: name, props: props }); return mergedProps; } /** * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering. * This is useful for effects that are only needed for client-side rendering but not for SSR. * * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85 * and confirm it doesn't apply to your use-case. */ var useEnhancedEffect = typeof window !== 'undefined' ? React__namespace.useLayoutEffect : React__namespace.useEffect; var useEnhancedEffect$1 = useEnhancedEffect; /** * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead. */ /** * @deprecated Not used internally. Use `MediaQueryList` from lib.dom.d.ts instead. */ /** * @deprecated Not used internally. Use `(event: MediaQueryListEvent) => void` instead. */ function useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) { var _React$useState = React__namespace.useState(function () { if (noSsr && matchMedia) { return matchMedia(query).matches; } if (ssrMatchMedia) { return ssrMatchMedia(query).matches; } // Once the component is mounted, we rely on the // event listeners to return the correct matches value. return defaultMatches; }), match = _React$useState[0], setMatch = _React$useState[1]; useEnhancedEffect$1(function () { var active = true; if (!matchMedia) { return undefined; } var queryList = matchMedia(query); var updateMatch = function updateMatch() { // Workaround Safari wrong implementation of matchMedia // TODO can we remove it? // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677 if (active) { setMatch(queryList.matches); } }; updateMatch(); // TODO: Use `addEventListener` once support for Safari < 14 is dropped queryList.addListener(updateMatch); return function () { active = false; queryList.removeListener(updateMatch); }; }, [query, matchMedia]); return match; } // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814 var maybeReactUseSyncExternalStore = React__namespace['useSyncExternalStore' + '']; function useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) { var getDefaultSnapshot = React__namespace.useCallback(function () { return defaultMatches; }, [defaultMatches]); var getServerSnapshot = React__namespace.useMemo(function () { if (noSsr && matchMedia) { return function () { return matchMedia(query).matches; }; } if (ssrMatchMedia !== null) { var _ssrMatchMedia = ssrMatchMedia(query), matches = _ssrMatchMedia.matches; return function () { return matches; }; } return getDefaultSnapshot; }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]); var _React$useMemo = React__namespace.useMemo(function () { if (matchMedia === null) { return [getDefaultSnapshot, function () { return function () {}; }]; } var mediaQueryList = matchMedia(query); return [function () { return mediaQueryList.matches; }, function (notify) { // TODO: Use `addEventListener` once support for Safari < 14 is dropped mediaQueryList.addListener(notify); return function () { mediaQueryList.removeListener(notify); }; }]; }, [getDefaultSnapshot, matchMedia, query]), _React$useMemo2 = _slicedToArray(_React$useMemo, 2), getSnapshot = _React$useMemo2[0], subscribe = _React$useMemo2[1]; var match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); return match; } function useMediaQuery(queryInput) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var theme = useTheme$3(); // Wait for jsdom to support the match media feature. // All the browsers MUI support have this built-in. // This defensive check is here for simplicity. // Most of the time, the match media logic isn't central to people tests. var supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined'; var _getThemeProps = getThemeProps({ name: 'MuiUseMediaQuery', props: options, theme: theme }), _getThemeProps$defaul = _getThemeProps.defaultMatches, defaultMatches = _getThemeProps$defaul === void 0 ? false : _getThemeProps$defaul, _getThemeProps$matchM = _getThemeProps.matchMedia, matchMedia = _getThemeProps$matchM === void 0 ? supportMatchMedia ? window.matchMedia : null : _getThemeProps$matchM, _getThemeProps$ssrMat = _getThemeProps.ssrMatchMedia, ssrMatchMedia = _getThemeProps$ssrMat === void 0 ? null : _getThemeProps$ssrMat, _getThemeProps$noSsr = _getThemeProps.noSsr, noSsr = _getThemeProps$noSsr === void 0 ? false : _getThemeProps$noSsr; { if (typeof queryInput === 'function' && theme === null) { console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\n')); } } var query = typeof queryInput === 'function' ? queryInput(theme) : queryInput; query = query.replace(/^@media( ?)/m, ''); // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable var useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld; var match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr); { // eslint-disable-next-line react-hooks/rules-of-hooks React__namespace.useDebugValue({ query: query, match: match }); } return match; } function clamp(val) { var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MIN_SAFE_INTEGER; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Number.MAX_SAFE_INTEGER; return Math.max(min, Math.min(val, max)); } /** * Returns a number whose value is limited to the given range. * @param {number} value The value to be clamped * @param {number} min The lower boundary of the output range * @param {number} max The upper boundary of the output range * @returns {number} A number in the range [min, max] */ function clampWrapper(value) { var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; { if (value < min || value > max) { console.error("MUI: The value provided ".concat(value, " is out of range [").concat(min, ", ").concat(max, "].")); } } return clamp(value, min, max); } /** * Converts a color from CSS hex format to CSS rgb format. * @param {string} color - Hex color, i.e. #nnn or #nnnnnn * @returns {string} A CSS rgb color string */ function hexToRgb(color) { color = color.slice(1); var re = new RegExp(".{1,".concat(color.length >= 6 ? 2 : 1, "}"), 'g'); var colors = color.match(re); if (colors && colors[0].length === 1) { colors = colors.map(function (n) { return n + n; }); } return colors ? "rgb".concat(colors.length === 4 ? 'a' : '', "(").concat(colors.map(function (n, index) { return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000; }).join(', '), ")") : ''; } function intToHex(_int) { var hex = _int.toString(16); return hex.length === 1 ? "0".concat(hex) : hex; } /** * Returns an object with the type and values of a color. * * Note: Does not support rgb % values. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @returns {object} - A MUI color object: {type: string, values: number[]} */ function decomposeColor(color) { // Idempotent if (color.type) { return color; } if (color.charAt(0) === '#') { return decomposeColor(hexToRgb(color)); } var marker = color.indexOf('('); var type = color.substring(0, marker); if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) { throw new Error("MUI: Unsupported `".concat(color, "` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") ); } var values = color.substring(marker + 1, color.length - 1); var colorSpace; if (type === 'color') { values = values.split(' '); colorSpace = values.shift(); if (values.length === 4 && values[3].charAt(0) === '/') { values[3] = values[3].slice(1); } if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) { throw new Error("MUI: unsupported `".concat(colorSpace, "` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.") ); } } else { values = values.split(','); } values = values.map(function (value) { return parseFloat(value); }); return { type: type, values: values, colorSpace: colorSpace }; } /** * Returns a channel created from the input color. * * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @returns {string} - The channel for the color, that can be used in rgba or hsla colors */ var colorChannel = function colorChannel(color) { var decomposedColor = decomposeColor(color); return decomposedColor.values.slice(0, 3).map(function (val, idx) { return decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? "".concat(val, "%") : val; }).join(' '); }; var private_safeColorChannel = function private_safeColorChannel(color, warning) { try { return colorChannel(color); } catch (error) { if (warning && "development" !== 'production') { console.warn(warning); } return color; } }; /** * Converts a color object with type and values to a string. * @param {object} color - Decomposed color * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color' * @param {array} color.values - [n,n,n] or [n,n,n,n] * @returns {string} A CSS color string */ function recomposeColor(color) { var type = color.type, colorSpace = color.colorSpace; var values = color.values; if (type.indexOf('rgb') !== -1) { // Only convert the first 3 values to int (i.e. not alpha) values = values.map(function (n, i) { return i < 3 ? parseInt(n, 10) : n; }); } else if (type.indexOf('hsl') !== -1) { values[1] = "".concat(values[1], "%"); values[2] = "".concat(values[2], "%"); } if (type.indexOf('color') !== -1) { values = "".concat(colorSpace, " ").concat(values.join(' ')); } else { values = "".concat(values.join(', ')); } return "".concat(type, "(").concat(values, ")"); } /** * Converts a color from CSS rgb format to CSS hex format. * @param {string} color - RGB color, i.e. rgb(n, n, n) * @returns {string} A CSS rgb color string, i.e. #nnnnnn */ function rgbToHex(color) { // Idempotent if (color.indexOf('#') === 0) { return color; } var _decomposeColor = decomposeColor(color), values = _decomposeColor.values; return "#".concat(values.map(function (n, i) { return intToHex(i === 3 ? Math.round(255 * n) : n); }).join('')); } /** * Converts a color from hsl format to rgb format. * @param {string} color - HSL color values * @returns {string} rgb color values */ function hslToRgb(color) { color = decomposeColor(color); var _color = color, values = _color.values; var h = values[0]; var s = values[1] / 100; var l = values[2] / 100; var a = s * Math.min(l, 1 - l); var f = function f(n) { var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12; return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1); }; var type = 'rgb'; var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)]; if (color.type === 'hsla') { type += 'a'; rgb.push(values[3]); } return recomposeColor({ type: type, values: rgb }); } /** * The relative brightness of any point in a color space, * normalized to 0 for darkest black and 1 for lightest white. * * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @returns {number} The relative brightness of the color in the range 0 - 1 */ function getLuminance(color) { color = decomposeColor(color); var rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values; rgb = rgb.map(function (val) { if (color.type !== 'color') { val /= 255; // normalized } return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4); }); // Truncate at 3 digits return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3)); } /** * Calculates the contrast ratio between two colors. * * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla() * @returns {number} A contrast ratio value in the range 0 - 21. */ function getContrastRatio(foreground, background) { var lumA = getLuminance(foreground); var lumB = getLuminance(background); return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05); } /** * Sets the absolute transparency of a color. * Any existing alpha values are overwritten. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @param {number} value - value to set the alpha channel to in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function alpha(color, value) { color = decomposeColor(color); value = clampWrapper(value); if (color.type === 'rgb' || color.type === 'hsl') { color.type += 'a'; } if (color.type === 'color') { color.values[3] = "/".concat(value); } else { color.values[3] = value; } return recomposeColor(color); } function private_safeAlpha(color, value, warning) { try { return alpha(color, value); } catch (error) { if (warning && "development" !== 'production') { console.warn(warning); } return color; } } /** * Darkens a color. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @param {number} coefficient - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function darken(color, coefficient) { color = decomposeColor(color); coefficient = clampWrapper(coefficient); if (color.type.indexOf('hsl') !== -1) { color.values[2] *= 1 - coefficient; } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) { for (var i = 0; i < 3; i += 1) { color.values[i] *= 1 - coefficient; } } return recomposeColor(color); } function private_safeDarken(color, coefficient, warning) { try { return darken(color, coefficient); } catch (error) { if (warning && "development" !== 'production') { console.warn(warning); } return color; } } /** * Lightens a color. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @param {number} coefficient - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function lighten(color, coefficient) { color = decomposeColor(color); coefficient = clampWrapper(coefficient); if (color.type.indexOf('hsl') !== -1) { color.values[2] += (100 - color.values[2]) * coefficient; } else if (color.type.indexOf('rgb') !== -1) { for (var i = 0; i < 3; i += 1) { color.values[i] += (255 - color.values[i]) * coefficient; } } else if (color.type.indexOf('color') !== -1) { for (var _i = 0; _i < 3; _i += 1) { color.values[_i] += (1 - color.values[_i]) * coefficient; } } return recomposeColor(color); } function private_safeLighten(color, coefficient, warning) { try { return lighten(color, coefficient); } catch (error) { if (warning && "development" !== 'production') { console.warn(warning); } return color; } } /** * Darken or lighten a color, depending on its luminance. * Light colors are darkened, dark colors are lightened. * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color() * @param {number} coefficient=0.15 - multiplier in the range 0 - 1 * @returns {string} A CSS color string. Hex input values are returned as rgb */ function emphasize(color) { var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15; return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient); } function private_safeEmphasize(color, coefficient, warning) { try { return emphasize(color, coefficient); } catch (error) { if (warning && "development" !== 'production') { console.warn(warning); } return color; } } function chainPropTypes(propType1, propType2) { return function validate() { return propType1.apply(void 0, arguments) || propType2.apply(void 0, arguments); }; } function isClassComponent$1(elementType) { // elementType.prototype?.isReactComponent var _elementType$prototyp = elementType.prototype, prototype = _elementType$prototyp === void 0 ? {} : _elementType$prototyp; return Boolean(prototype.isReactComponent); } function acceptingRef(props, propName, componentName, location, propFullName) { var element = props[propName]; var safePropName = propFullName || propName; if (element == null || // When server-side rendering React doesn't warn either. // This is not an accurate check for SSR. // This is only in place for Emotion compat. // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved. typeof window === 'undefined') { return null; } var warningHint; var elementType = element.type; /** * Blacklisting instead of whitelisting * * Blacklisting will miss some components, such as React.Fragment. Those will at least * trigger a warning in React. * We can't whitelist because there is no safe way to detect React.forwardRef * or class components. "Safe" means there's no public API. * */ if (typeof elementType === 'function' && !isClassComponent$1(elementType)) { warningHint = 'Did you accidentally use a plain function component for an element instead?'; } if (warningHint !== undefined) { return new Error("Invalid ".concat(location, " `").concat(safePropName, "` supplied to `").concat(componentName, "`. ") + "Expected an element that can hold a ref. ".concat(warningHint, " ") + 'For more information see https://mui.com/r/caveat-with-refs-guide'); } return null; } var elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef); elementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef); var elementAcceptingRef$1 = elementAcceptingRef; function isClassComponent(elementType) { // elementType.prototype?.isReactComponent var _elementType$prototyp = elementType.prototype, prototype = _elementType$prototyp === void 0 ? {} : _elementType$prototyp; return Boolean(prototype.isReactComponent); } function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var safePropName = propFullName || propName; if (propValue == null || // When server-side rendering React doesn't warn either. // This is not an accurate check for SSR. // This is only in place for emotion compat. // TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved. typeof window === 'undefined') { return null; } var warningHint; /** * Blacklisting instead of whitelisting * * Blacklisting will miss some components, such as React.Fragment. Those will at least * trigger a warning in React. * We can't whitelist because there is no safe way to detect React.forwardRef * or class components. "Safe" means there's no public API. * */ if (typeof propValue === 'function' && !isClassComponent(propValue)) { warningHint = 'Did you accidentally provide a plain function component instead?'; } if (warningHint !== undefined) { return new Error("Invalid ".concat(location, " `").concat(safePropName, "` supplied to `").concat(componentName, "`. ") + "Expected an element type that can hold a ref. ".concat(warningHint, " ") + 'For more information see https://mui.com/r/caveat-with-refs-guide'); } return null; } var elementTypeAcceptingRef$1 = chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef); // This module is based on https://github.com/airbnb/prop-types-exact repository. // However, in order to reduce the number of dependencies and to remove some extra safe checks // the module was forked. var specialProperty = "exact-prop: \u200B"; function exactProp(propTypes) { return _extends({}, propTypes, _defineProperty({}, specialProperty, function (props) { var unsupportedProps = Object.keys(props).filter(function (prop) { return !propTypes.hasOwnProperty(prop); }); if (unsupportedProps.length > 0) { return new Error("The following props are not supported: ".concat(unsupportedProps.map(function (prop) { return "`".concat(prop, "`"); }).join(', '), ". Please remove them.")); } return null; })); } function HTMLElementType(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var safePropName = propFullName || propName; if (propValue == null) { return null; } if (propValue && propValue.nodeType !== 1) { return new Error("Invalid ".concat(location, " `").concat(safePropName, "` supplied to `").concat(componentName, "`. ") + "Expected an HTMLElement."); } return null; } var refType = PropTypes.oneOfType([PropTypes.func, PropTypes.object]); var refType$1 = refType; /** * Safe chained function. * * Will only create a new function if needed, * otherwise will pass back existing functions or null. */ function createChainedFunction() { for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { funcs[_key] = arguments[_key]; } return funcs.reduce(function (acc, func) { if (func == null) { return acc; } return function chainedFunction() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } acc.apply(this, args); func.apply(this, args); }; }, function () {}); } // Corresponds to 10 frames at 60 Hz. // A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B. function debounce$1(func) { var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166; var timeout; function debounced() { var _this = this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var later = function later() { // @ts-ignore func.apply(_this, args); }; clearTimeout(timeout); timeout = setTimeout(later, wait); } debounced.clear = function () { clearTimeout(timeout); }; return debounced; } function deprecatedPropType(validator, reason) { return function (props, propName, componentName, location, propFullName) { var componentNameSafe = componentName || '<>'; var propFullNameSafe = propFullName || propName; if (typeof props[propName] !== 'undefined') { return new Error("The ".concat(location, " `").concat(propFullNameSafe, "` of ") + "`".concat(componentNameSafe, "` is deprecated. ").concat(reason)); } return null; }; } function isMuiElement(element, muiNames) { var _muiName, _element$type; return /*#__PURE__*/React__namespace.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45 // eslint-disable-next-line no-underscore-dangle (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1; } function ownerDocument(node) { return node && node.ownerDocument || document; } function ownerWindow(node) { var doc = ownerDocument(node); return doc.defaultView || window; } function requirePropFactory(componentNameInError, Component) { // eslint-disable-next-line react/forbid-foreign-prop-types var prevPropTypes = Component ? _extends({}, Component.propTypes) : null; var requireProp = function requireProp(requiredProp) { return function (props, propName, componentName, location, propFullName) { var propFullNameSafe = propFullName || propName; var defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe]; if (defaultTypeChecker) { for (var _len = arguments.length, args = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { args[_key - 5] = arguments[_key]; } var typeCheckerResult = defaultTypeChecker.apply(void 0, [props, propName, componentName, location, propFullName].concat(args)); if (typeCheckerResult) { return typeCheckerResult; } } if (typeof props[propName] !== 'undefined' && !props[requiredProp]) { return new Error("The prop `".concat(propFullNameSafe, "` of ") + "`".concat(componentNameInError, "` can only be used together with the `").concat(requiredProp, "` prop.")); } return null; }; }; return requireProp; } /** * TODO v5: consider making it private * * passes {value} to {ref} * * WARNING: Be sure to only call this inside a callback that is passed as a ref. * Otherwise, make sure to cleanup the previous {ref} if it changes. See * https://github.com/mui/material-ui/issues/13539 * * Useful if you want to expose the ref of an inner component to the public API * while still using it inside the component. * @param ref A ref callback or ref object. If anything falsy, this is a no-op. */ function setRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } } var globalId = 0; function useGlobalId(idOverride) { var _React$useState = React__namespace.useState(idOverride), defaultId = _React$useState[0], setDefaultId = _React$useState[1]; var id = idOverride || defaultId; React__namespace.useEffect(function () { if (defaultId == null) { // Fallback to this default id when possible. // Use the incrementing value for client-side rendering only. // We can't use it server-side. // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem globalId += 1; setDefaultId("mui-".concat(globalId)); } }, [defaultId]); return id; } // downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814 var maybeReactUseId = React__namespace['useId'.toString()]; /** * * @example
* @param idOverride * @returns {string} */ function useId(idOverride) { if (maybeReactUseId !== undefined) { var reactId = maybeReactUseId(); return idOverride != null ? idOverride : reactId; } // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime. return useGlobalId(idOverride); } function unsupportedProp(props, propName, componentName, location, propFullName) { var propFullNameSafe = propFullName || propName; if (typeof props[propName] !== 'undefined') { return new Error("The prop `".concat(propFullNameSafe, "` is not supported. Please remove it.")); } return null; } function useControlled(_ref) { var controlled = _ref.controlled, defaultProp = _ref["default"], name = _ref.name, _ref$state = _ref.state, state = _ref$state === void 0 ? 'value' : _ref$state; // isControlled is ignored in the hook dependency lists as it should never change. var _React$useRef = React__namespace.useRef(controlled !== undefined), isControlled = _React$useRef.current; var _React$useState = React__namespace.useState(defaultProp), valueState = _React$useState[0], setValue = _React$useState[1]; var value = isControlled ? controlled : valueState; { React__namespace.useEffect(function () { if (isControlled !== (controlled !== undefined)) { console.error(["MUI: A component is changing the ".concat(isControlled ? '' : 'un', "controlled ").concat(state, " state of ").concat(name, " to be ").concat(isControlled ? 'un' : '', "controlled."), 'Elements should not switch from uncontrolled to controlled (or vice versa).', "Decide between using a controlled or uncontrolled ".concat(name, " ") + 'element for the lifetime of the component.', "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", 'More info: https://fb.me/react-controlled-components'].join('\n')); } }, [state, name, controlled]); var _React$useRef2 = React__namespace.useRef(defaultProp), defaultValue = _React$useRef2.current; React__namespace.useEffect(function () { if (!isControlled && defaultValue !== defaultProp) { console.error(["MUI: A component is changing the default ".concat(state, " state of an uncontrolled ").concat(name, " after being initialized. ") + "To suppress this warning opt to use a controlled ".concat(name, ".")].join('\n')); } }, [JSON.stringify(defaultProp)]); } var setValueIfUncontrolled = React__namespace.useCallback(function (newValue) { if (!isControlled) { setValue(newValue); } }, []); return [value, setValueIfUncontrolled]; } /** * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892 * See RFC in https://github.com/reactjs/rfcs/pull/220 */ function useEventCallback(fn) { var ref = React__namespace.useRef(fn); useEnhancedEffect$1(function () { ref.current = fn; }); return React__namespace.useRef(function () { return ( // @ts-expect-error hide `this` (ref.current).apply(void 0, arguments) ); }).current; } function useForkRef() { for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { refs[_key] = arguments[_key]; } /** * This will create a new function if the refs passed to this hook change and are all defined. * This means react will call the old forkRef with `null` and the new forkRef * with the ref. Cleanup naturally emerges from this behavior. */ return React__namespace.useMemo(function () { if (refs.every(function (ref) { return ref == null; })) { return null; } return function (instance) { refs.forEach(function (ref) { setRef(ref, instance); }); }; // eslint-disable-next-line react-hooks/exhaustive-deps }, refs); } var UNINITIALIZED = {}; /** * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional * initialization argument, so the initialization function doesn't need to be an inline closure. * * @usage * const ref = useLazyRef(sortColumns, columns) */ function useLazyRef(init, initArg) { var ref = React__namespace.useRef(UNINITIALIZED); if (ref.current === UNINITIALIZED) { ref.current = init(initArg); } return ref; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } var EMPTY = []; /** * A React.useEffect equivalent that runs once, when the component is mounted. */ function useOnMount(fn) { /* eslint-disable react-hooks/exhaustive-deps */ React__namespace.useEffect(fn, EMPTY); /* eslint-enable react-hooks/exhaustive-deps */ } var Timeout = /*#__PURE__*/function () { function Timeout() { var _this = this; _classCallCheck(this, Timeout); this.currentId = null; this.clear = function () { if (_this.currentId !== null) { clearTimeout(_this.currentId); _this.currentId = null; } }; this.disposeEffect = function () { return _this.clear; }; } _createClass(Timeout, [{ key: "start", value: /** * Executes `fn` after `delay`, clearing any previously scheduled call. */ function start(delay, fn) { var _this2 = this; this.clear(); this.currentId = setTimeout(function () { _this2.currentId = null; fn(); }, delay); } }], [{ key: "create", value: function create() { return new Timeout(); } }]); return Timeout; }(); function useTimeout() { var timeout = useLazyRef(Timeout.create).current; useOnMount(timeout.disposeEffect); return timeout; } var hadKeyboardEvent = true; var hadFocusVisibleRecently = false; var hadFocusVisibleRecentlyTimeout = new Timeout(); var inputTypesWhitelist = { text: true, search: true, url: true, tel: true, email: true, password: true, number: true, date: true, month: true, week: true, time: true, datetime: true, 'datetime-local': true }; /** * Computes whether the given element should automatically trigger the * `focus-visible` class being added, i.e. whether it should always match * `:focus-visible` when focused. * @param {Element} node * @returns {boolean} */ function focusTriggersKeyboardModality(node) { var _ref = node, type = _ref.type, tagName = _ref.tagName; if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) { return true; } if (tagName === 'TEXTAREA' && !node.readOnly) { return true; } if (node.isContentEditable) { return true; } return false; } /** * Keep track of our keyboard modality state with `hadKeyboardEvent`. * If the most recent user interaction was via the keyboard; * and the key press did not include a meta, alt/option, or control key; * then the modality is keyboard. Otherwise, the modality is not keyboard. * @param {KeyboardEvent} event */ function handleKeyDown(event) { if (event.metaKey || event.altKey || event.ctrlKey) { return; } hadKeyboardEvent = true; } /** * If at any point a user clicks with a pointing device, ensure that we change * the modality away from keyboard. * This avoids the situation where a user presses a key on an already focused * element, and then clicks on a different element, focusing it with a * pointing device, while we still think we're in keyboard modality. */ function handlePointerDown() { hadKeyboardEvent = false; } function handleVisibilityChange() { if (this.visibilityState === 'hidden') { // If the tab becomes active again, the browser will handle calling focus // on the element (Safari actually calls it twice). // If this tab change caused a blur on an element with focus-visible, // re-apply the class when the user switches back to the tab. if (hadFocusVisibleRecently) { hadKeyboardEvent = true; } } } function prepare(doc) { doc.addEventListener('keydown', handleKeyDown, true); doc.addEventListener('mousedown', handlePointerDown, true); doc.addEventListener('pointerdown', handlePointerDown, true); doc.addEventListener('touchstart', handlePointerDown, true); doc.addEventListener('visibilitychange', handleVisibilityChange, true); } function isFocusVisible(event) { var target = event.target; try { return target.matches(':focus-visible'); } catch (error) { // Browsers not implementing :focus-visible will throw a SyntaxError. // We use our own heuristic for those browsers. // Rethrow might be better if it's not the expected error but do we really // want to crash if focus-visible malfunctioned? } // No need for validFocusTarget check. The user does that by attaching it to // focusable events only. return hadKeyboardEvent || focusTriggersKeyboardModality(target); } function useIsFocusVisible() { var ref = React__namespace.useCallback(function (node) { if (node != null) { prepare(node.ownerDocument); } }, []); var isFocusVisibleRef = React__namespace.useRef(false); /** * Should be called if a blur event is fired */ function handleBlurVisible() { // checking against potential state variable does not suffice if we focus and blur synchronously. // React wouldn't have time to trigger a re-render so `focusVisible` would be stale. // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events. // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751 // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186). if (isFocusVisibleRef.current) { // To detect a tab/window switch, we look for a blur event followed // rapidly by a visibility change. // If we don't see a visibility change within 100ms, it's probably a // regular focus change. hadFocusVisibleRecently = true; hadFocusVisibleRecentlyTimeout.start(100, function () { hadFocusVisibleRecently = false; }); isFocusVisibleRef.current = false; return true; } return false; } /** * Should be called if a blur event is fired */ function handleFocusVisible(event) { if (isFocusVisible(event)) { isFocusVisibleRef.current = true; return true; } return false; } return { isFocusVisibleRef: isFocusVisibleRef, onFocus: handleFocusVisible, onBlur: handleBlurVisible, ref: ref }; } // A change of the browser zoom change the scrollbar size. // Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18 function getScrollbarSize(doc) { // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes var documentWidth = doc.documentElement.clientWidth; return Math.abs(window.innerWidth - documentWidth); } // Source from https://github.com/alitaheri/normalize-scroll-left var cachedType; /** * Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type * * Types of scrollLeft, assuming scrollWidth=100 and direction is rtl. * * Type | <- Most Left | Most Right -> | Initial * ---------------- | ------------ | ------------- | ------- * default | 0 | 100 | 100 * negative (spec*) | -100 | 0 | 0 * reverse | 100 | 0 | 0 * * Edge 85: default * Safari 14: negative * Chrome 85: negative * Firefox 81: negative * IE11: reverse * * spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll */ function detectScrollType() { if (cachedType) { return cachedType; } var dummy = document.createElement('div'); var container = document.createElement('div'); container.style.width = '10px'; container.style.height = '1px'; dummy.appendChild(container); dummy.dir = 'rtl'; dummy.style.fontSize = '14px'; dummy.style.width = '4px'; dummy.style.height = '1px'; dummy.style.position = 'absolute'; dummy.style.top = '-1000px'; dummy.style.overflow = 'scroll'; document.body.appendChild(dummy); cachedType = 'reverse'; if (dummy.scrollLeft > 0) { cachedType = 'default'; } else { dummy.scrollLeft = 1; if (dummy.scrollLeft === 0) { cachedType = 'negative'; } } document.body.removeChild(dummy); return cachedType; } // Based on https://stackoverflow.com/a/24394376 function getNormalizedScrollLeft(element, direction) { var scrollLeft = element.scrollLeft; // Perform the calculations only when direction is rtl to avoid messing up the ltr behavior if (direction !== 'rtl') { return scrollLeft; } var type = detectScrollType(); switch (type) { case 'negative': return element.scrollWidth - element.clientWidth + scrollLeft; case 'reverse': return element.scrollWidth - element.clientWidth - scrollLeft; default: return scrollLeft; } } var usePreviousProps = function usePreviousProps(value) { var ref = React__namespace.useRef({}); React__namespace.useEffect(function () { ref.current = value; }); return ref.current; }; var usePreviousProps$1 = usePreviousProps; /** * Gets only the valid children of a component, * and ignores any nullish or falsy child. * * @param children the children */ function getValidReactChildren(children) { return React__namespace.Children.toArray(children).filter(function (child) { return /*#__PURE__*/React__namespace.isValidElement(child); }); } var visuallyHidden = { border: 0, clip: 'rect(0 0 0 0)', height: '1px', margin: '-1px', overflow: 'hidden', padding: 0, position: 'absolute', whiteSpace: 'nowrap', width: '1px' }; var visuallyHidden$1 = visuallyHidden; function getTypeByValue(value) { var valueType = _typeof(value); switch (valueType) { case 'number': if (Number.isNaN(value)) { return 'NaN'; } if (!Number.isFinite(value)) { return 'Infinity'; } if (value !== Math.floor(value)) { return 'float'; } return 'number'; case 'object': if (value === null) { return 'null'; } return value.constructor.name; default: return valueType; } } // IE 11 support function ponyfillIsInteger(x) { // eslint-disable-next-line no-restricted-globals return typeof x === 'number' && isFinite(x) && Math.floor(x) === x; } var isInteger = Number.isInteger || ponyfillIsInteger; function requiredInteger(props, propName, componentName, location) { var propValue = props[propName]; if (propValue == null || !isInteger(propValue)) { var propType = getTypeByValue(propValue); return new RangeError("Invalid ".concat(location, " `").concat(propName, "` of type `").concat(propType, "` supplied to `").concat(componentName, "`, expected `integer`.")); } return null; } function validator(props, propName) { var propValue = props[propName]; if (propValue === undefined) { return null; } for (var _len = arguments.length, other = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { other[_key - 2] = arguments[_key]; } return requiredInteger.apply(void 0, [props, propName].concat(other)); } function validatorNoop() { return null; } validator.isRequired = requiredInteger; validatorNoop.isRequired = validatorNoop; var integerPropType = validator; function composeClasses(slots, getUtilityClass) { var classes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; var output = {}; Object.keys(slots).forEach( // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`. // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208 function (slot) { output[slot] = slots[slot].reduce(function (acc, key) { if (key) { var utilityClass = getUtilityClass(key); if (utilityClass !== '') { acc.push(utilityClass); } if (classes && classes[key]) { acc.push(classes[key]); } } return acc; }, []).join(' '); }); return output; } var ThemeContext = /*#__PURE__*/React__namespace.createContext(null); { ThemeContext.displayName = 'ThemeContext'; } var ThemeContext$1 = ThemeContext; function useTheme$1() { var theme = React__namespace.useContext(ThemeContext$1); { // eslint-disable-next-line react-hooks/rules-of-hooks React__namespace.useDebugValue(theme); } return theme; } var hasSymbol = typeof Symbol === 'function' && Symbol["for"]; var nested = hasSymbol ? Symbol["for"]('mui.nested') : '__THEME_NESTED__'; function mergeOuterLocalTheme(outerTheme, localTheme) { if (typeof localTheme === 'function') { var mergedTheme = localTheme(outerTheme); { if (!mergedTheme) { console.error(['MUI: You should return an object from your theme function, i.e.', ' ({})} />'].join('\n')); } } return mergedTheme; } return _extends({}, outerTheme, localTheme); } /** * This component takes a `theme` prop. * It makes the `theme` available down the React tree thanks to React context. * This component should preferably be used at **the root of your component tree**. */ function ThemeProvider$2(props) { var children = props.children, localTheme = props.theme; var outerTheme = useTheme$1(); { if (outerTheme === null && typeof localTheme === 'function') { console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n')); } } var theme = React__namespace.useMemo(function () { var output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme); if (output != null) { output[nested] = outerTheme !== null; } return output; }, [localTheme, outerTheme]); return /*#__PURE__*/jsxRuntime_1(ThemeContext$1.Provider, { value: theme, children: children }); } ThemeProvider$2.propTypes = { /** * Your component tree. */ children: PropTypes.node, /** * A theme object. You can provide a function to extend the outer theme. */ theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired } ; { ThemeProvider$2.propTypes = exactProp(ThemeProvider$2.propTypes) ; } var RtlContext = /*#__PURE__*/React__namespace.createContext(); function RtlProvider(_ref) { var value = _ref.value, props = _objectWithoutProperties(_ref, ["value"]); return /*#__PURE__*/jsxRuntime_1(RtlContext.Provider, _extends({ value: value != null ? value : true }, props)); } RtlProvider.propTypes = { children: PropTypes.node, value: PropTypes.bool } ; var useRtl = function useRtl() { var value = React__namespace.useContext(RtlContext); return value != null ? value : false; }; var EMPTY_THEME = {}; function useThemeScoping(themeId, upperTheme, localTheme) { var isPrivate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; return React__namespace.useMemo(function () { var resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme; if (typeof localTheme === 'function') { var mergedTheme = localTheme(resolvedTheme); var result = themeId ? _extends({}, upperTheme, _defineProperty({}, themeId, mergedTheme)) : mergedTheme; // must return a function for the private theme to NOT merge with the upper theme. // see the test case "use provided theme from a callback" in ThemeProvider.test.js if (isPrivate) { return function () { return result; }; } return result; } return themeId ? _extends({}, upperTheme, _defineProperty({}, themeId, localTheme)) : _extends({}, upperTheme, localTheme); }, [themeId, upperTheme, localTheme, isPrivate]); } /** * This component makes the `theme` available down the React tree. * It should preferably be used at **the root of your component tree**. * * // existing use case * // theme scoping */ function ThemeProvider$1(props) { var children = props.children, localTheme = props.theme, themeId = props.themeId; var upperTheme = useTheme$3(EMPTY_THEME); var upperPrivateTheme = useTheme$1() || EMPTY_THEME; { if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') { console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\n')); } } var engineTheme = useThemeScoping(themeId, upperTheme, localTheme); var privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true); var rtlValue = engineTheme.direction === 'rtl'; return /*#__PURE__*/jsxRuntime_1(ThemeProvider$2, { theme: privateTheme, children: /*#__PURE__*/jsxRuntime_1(ThemeContext$2.Provider, { value: engineTheme, children: /*#__PURE__*/jsxRuntime_1(RtlProvider, { value: rtlValue, children: children }) }) }); } ThemeProvider$1.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * Your component tree. */ children: PropTypes.node, /** * A theme object. You can provide a function to extend the outer theme. */ theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired, /** * The design system's unique id for getting the corresponded theme when there are multiple design systems. */ themeId: PropTypes.string } ; { ThemeProvider$1.propTypes = exactProp(ThemeProvider$1.propTypes) ; } var DEFAULT_MODE_STORAGE_KEY = 'mode'; var DEFAULT_COLOR_SCHEME_STORAGE_KEY = 'color-scheme'; var DEFAULT_ATTRIBUTE = 'data-color-scheme'; function getInitColorSchemeScript$1(options) { var _ref = options || {}, _ref$defaultMode = _ref.defaultMode, defaultMode = _ref$defaultMode === void 0 ? 'light' : _ref$defaultMode, _ref$defaultLightColo = _ref.defaultLightColorScheme, defaultLightColorScheme = _ref$defaultLightColo === void 0 ? 'light' : _ref$defaultLightColo, _ref$defaultDarkColor = _ref.defaultDarkColorScheme, defaultDarkColorScheme = _ref$defaultDarkColor === void 0 ? 'dark' : _ref$defaultDarkColor, _ref$modeStorageKey = _ref.modeStorageKey, modeStorageKey = _ref$modeStorageKey === void 0 ? DEFAULT_MODE_STORAGE_KEY : _ref$modeStorageKey, _ref$colorSchemeStora = _ref.colorSchemeStorageKey, colorSchemeStorageKey = _ref$colorSchemeStora === void 0 ? DEFAULT_COLOR_SCHEME_STORAGE_KEY : _ref$colorSchemeStora, _ref$attribute = _ref.attribute, attribute = _ref$attribute === void 0 ? DEFAULT_ATTRIBUTE : _ref$attribute, _ref$colorSchemeNode = _ref.colorSchemeNode, colorSchemeNode = _ref$colorSchemeNode === void 0 ? 'document.documentElement' : _ref$colorSchemeNode; return /*#__PURE__*/jsxRuntime_1("script", { // eslint-disable-next-line react/no-danger dangerouslySetInnerHTML: { __html: "(function() {\ntry {\n var mode = localStorage.getItem('".concat(modeStorageKey, "') || '").concat(defaultMode, "';\n var colorScheme = '';\n if (mode === 'system') {\n // handle system mode\n var mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n } else {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n }\n if (mode === 'light') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-light') || '").concat(defaultLightColorScheme, "';\n }\n if (mode === 'dark') {\n colorScheme = localStorage.getItem('").concat(colorSchemeStorageKey, "-dark') || '").concat(defaultDarkColorScheme, "';\n }\n if (colorScheme) {\n ").concat(colorSchemeNode, ".setAttribute('").concat(attribute, "', colorScheme);\n }\n} catch(e){}})();") } }, "mui-color-scheme-init"); } function getSystemMode(mode) { if (typeof window !== 'undefined' && mode === 'system') { var mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { return 'dark'; } return 'light'; } return undefined; } function processState(state, callback) { if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') { return callback('light'); } if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') { return callback('dark'); } return undefined; } function getColorScheme(state) { return processState(state, function (mode) { if (mode === 'light') { return state.lightColorScheme; } if (mode === 'dark') { return state.darkColorScheme; } return undefined; }); } function initializeValue(key, defaultValue) { if (typeof window === 'undefined') { return undefined; } var value; try { value = localStorage.getItem(key) || undefined; if (!value) { // the first time that user enters the site. localStorage.setItem(key, defaultValue); } } catch (e) { // Unsupported } return value || defaultValue; } function useCurrentColorScheme(options) { var _options$defaultMode = options.defaultMode, defaultMode = _options$defaultMode === void 0 ? 'light' : _options$defaultMode, defaultLightColorScheme = options.defaultLightColorScheme, defaultDarkColorScheme = options.defaultDarkColorScheme, _options$supportedCol = options.supportedColorSchemes, supportedColorSchemes = _options$supportedCol === void 0 ? [] : _options$supportedCol, _options$modeStorageK = options.modeStorageKey, modeStorageKey = _options$modeStorageK === void 0 ? DEFAULT_MODE_STORAGE_KEY : _options$modeStorageK, _options$colorSchemeS = options.colorSchemeStorageKey, colorSchemeStorageKey = _options$colorSchemeS === void 0 ? DEFAULT_COLOR_SCHEME_STORAGE_KEY : _options$colorSchemeS, _options$storageWindo = options.storageWindow, storageWindow = _options$storageWindo === void 0 ? typeof window === 'undefined' ? undefined : window : _options$storageWindo; var joinedColorSchemes = supportedColorSchemes.join(','); var _React$useState = React__namespace.useState(function () { var initialMode = initializeValue(modeStorageKey, defaultMode); var lightColorScheme = initializeValue("".concat(colorSchemeStorageKey, "-light"), defaultLightColorScheme); var darkColorScheme = initializeValue("".concat(colorSchemeStorageKey, "-dark"), defaultDarkColorScheme); return { mode: initialMode, systemMode: getSystemMode(initialMode), lightColorScheme: lightColorScheme, darkColorScheme: darkColorScheme }; }), state = _React$useState[0], setState = _React$useState[1]; var colorScheme = getColorScheme(state); var setMode = React__namespace.useCallback(function (mode) { setState(function (currentState) { if (mode === currentState.mode) { // do nothing if mode does not change return currentState; } var newMode = mode != null ? mode : defaultMode; try { localStorage.setItem(modeStorageKey, newMode); } catch (e) { // Unsupported } return _extends({}, currentState, { mode: newMode, systemMode: getSystemMode(newMode) }); }); }, [modeStorageKey, defaultMode]); var setColorScheme = React__namespace.useCallback(function (value) { if (!value) { setState(function (currentState) { try { localStorage.setItem("".concat(colorSchemeStorageKey, "-light"), defaultLightColorScheme); localStorage.setItem("".concat(colorSchemeStorageKey, "-dark"), defaultDarkColorScheme); } catch (e) { // Unsupported } return _extends({}, currentState, { lightColorScheme: defaultLightColorScheme, darkColorScheme: defaultDarkColorScheme }); }); } else if (typeof value === 'string') { if (value && !joinedColorSchemes.includes(value)) { console.error("`".concat(value, "` does not exist in `theme.colorSchemes`.")); } else { setState(function (currentState) { var newState = _extends({}, currentState); processState(currentState, function (mode) { try { localStorage.setItem("".concat(colorSchemeStorageKey, "-").concat(mode), value); } catch (e) { // Unsupported } if (mode === 'light') { newState.lightColorScheme = value; } if (mode === 'dark') { newState.darkColorScheme = value; } }); return newState; }); } } else { setState(function (currentState) { var newState = _extends({}, currentState); var newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light; var newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark; if (newLightColorScheme) { if (!joinedColorSchemes.includes(newLightColorScheme)) { console.error("`".concat(newLightColorScheme, "` does not exist in `theme.colorSchemes`.")); } else { newState.lightColorScheme = newLightColorScheme; try { localStorage.setItem("".concat(colorSchemeStorageKey, "-light"), newLightColorScheme); } catch (error) { // Unsupported } } } if (newDarkColorScheme) { if (!joinedColorSchemes.includes(newDarkColorScheme)) { console.error("`".concat(newDarkColorScheme, "` does not exist in `theme.colorSchemes`.")); } else { newState.darkColorScheme = newDarkColorScheme; try { localStorage.setItem("".concat(colorSchemeStorageKey, "-dark"), newDarkColorScheme); } catch (error) { // Unsupported } } } return newState; }); } }, [joinedColorSchemes, colorSchemeStorageKey, defaultLightColorScheme, defaultDarkColorScheme]); var handleMediaQuery = React__namespace.useCallback(function (event) { if (state.mode === 'system') { setState(function (currentState) { var systemMode = event != null && event.matches ? 'dark' : 'light'; // Early exit, nothing changed. if (currentState.systemMode === systemMode) { return currentState; } return _extends({}, currentState, { systemMode: systemMode }); }); } }, [state.mode]); // Ref hack to avoid adding handleMediaQuery as a dep var mediaListener = React__namespace.useRef(handleMediaQuery); mediaListener.current = handleMediaQuery; React__namespace.useEffect(function () { var handler = function handler() { return mediaListener.current.apply(mediaListener, arguments); }; // Always listen to System preference var media = window.matchMedia('(prefers-color-scheme: dark)'); // Intentionally use deprecated listener methods to support iOS & old browsers media.addListener(handler); handler(media); return function () { media.removeListener(handler); }; }, []); // Handle when localStorage has changed React__namespace.useEffect(function () { if (storageWindow) { var handleStorage = function handleStorage(event) { var value = event.newValue; if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) { // If the key is deleted, value will be null then reset color scheme to the default one. if (event.key.endsWith('light')) { setColorScheme({ light: value }); } if (event.key.endsWith('dark')) { setColorScheme({ dark: value }); } } if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) { setMode(value || defaultMode); } }; // For syncing color-scheme changes between iframes storageWindow.addEventListener('storage', handleStorage); return function () { storageWindow.removeEventListener('storage', handleStorage); }; } return undefined; }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]); return _extends({}, state, { colorScheme: colorScheme, setMode: setMode, setColorScheme: setColorScheme }); } var DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}'; function createCssVarsProvider(options) { var themeId = options.themeId, _options$theme = options.theme, defaultTheme = _options$theme === void 0 ? {} : _options$theme, _options$attribute = options.attribute, defaultAttribute = _options$attribute === void 0 ? DEFAULT_ATTRIBUTE : _options$attribute, _options$modeStorageK = options.modeStorageKey, defaultModeStorageKey = _options$modeStorageK === void 0 ? DEFAULT_MODE_STORAGE_KEY : _options$modeStorageK, _options$colorSchemeS = options.colorSchemeStorageKey, defaultColorSchemeStorageKey = _options$colorSchemeS === void 0 ? DEFAULT_COLOR_SCHEME_STORAGE_KEY : _options$colorSchemeS, _options$defaultMode = options.defaultMode, designSystemMode = _options$defaultMode === void 0 ? 'light' : _options$defaultMode, designSystemColorScheme = options.defaultColorScheme, _options$disableTrans = options.disableTransitionOnChange, designSystemTransitionOnChange = _options$disableTrans === void 0 ? false : _options$disableTrans, resolveTheme = options.resolveTheme, excludeVariablesFromRoot = options.excludeVariablesFromRoot; if (!defaultTheme.colorSchemes || typeof designSystemColorScheme === 'string' && !defaultTheme.colorSchemes[designSystemColorScheme] || _typeof(designSystemColorScheme) === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.light] || _typeof(designSystemColorScheme) === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme == null ? void 0 : designSystemColorScheme.dark]) { console.error("MUI: `".concat(designSystemColorScheme, "` does not exist in `theme.colorSchemes`.")); } var ColorSchemeContext = /*#__PURE__*/React__namespace.createContext(undefined); { ColorSchemeContext.displayName = 'ColorSchemeContext'; } var useColorScheme = function useColorScheme() { var value = React__namespace.useContext(ColorSchemeContext); if (!value) { throw new Error("MUI: `useColorScheme` must be called under " ); } return value; }; function CssVarsProvider(props) { var children = props.children, _props$theme = props.theme, themeProp = _props$theme === void 0 ? defaultTheme : _props$theme, _props$modeStorageKey = props.modeStorageKey, modeStorageKey = _props$modeStorageKey === void 0 ? defaultModeStorageKey : _props$modeStorageKey, _props$colorSchemeSto = props.colorSchemeStorageKey, colorSchemeStorageKey = _props$colorSchemeSto === void 0 ? defaultColorSchemeStorageKey : _props$colorSchemeSto, _props$attribute = props.attribute, attribute = _props$attribute === void 0 ? defaultAttribute : _props$attribute, _props$defaultMode = props.defaultMode, defaultMode = _props$defaultMode === void 0 ? designSystemMode : _props$defaultMode, _props$defaultColorSc = props.defaultColorScheme, defaultColorScheme = _props$defaultColorSc === void 0 ? designSystemColorScheme : _props$defaultColorSc, _props$disableTransit = props.disableTransitionOnChange, disableTransitionOnChange = _props$disableTransit === void 0 ? designSystemTransitionOnChange : _props$disableTransit, _props$storageWindow = props.storageWindow, storageWindow = _props$storageWindow === void 0 ? typeof window === 'undefined' ? undefined : window : _props$storageWindow, _props$documentNode = props.documentNode, documentNode = _props$documentNode === void 0 ? typeof document === 'undefined' ? undefined : document : _props$documentNode, _props$colorSchemeNod = props.colorSchemeNode, colorSchemeNode = _props$colorSchemeNod === void 0 ? typeof document === 'undefined' ? undefined : document.documentElement : _props$colorSchemeNod, _props$colorSchemeSel = props.colorSchemeSelector, colorSchemeSelector = _props$colorSchemeSel === void 0 ? ':root' : _props$colorSchemeSel, _props$disableNestedC = props.disableNestedContext, disableNestedContext = _props$disableNestedC === void 0 ? false : _props$disableNestedC, _props$disableStyleSh = props.disableStyleSheetGeneration, disableStyleSheetGeneration = _props$disableStyleSh === void 0 ? false : _props$disableStyleSh; var hasMounted = React__namespace.useRef(false); var upperTheme = useTheme$1(); var ctx = React__namespace.useContext(ColorSchemeContext); var nested = !!ctx && !disableNestedContext; var scopedTheme = themeProp[themeId]; var _ref = scopedTheme || themeProp, _ref$colorSchemes = _ref.colorSchemes, colorSchemes = _ref$colorSchemes === void 0 ? {} : _ref$colorSchemes, _ref$components = _ref.components, components = _ref$components === void 0 ? {} : _ref$components, _ref$generateCssVars = _ref.generateCssVars, generateCssVars = _ref$generateCssVars === void 0 ? function () { return { vars: {}, css: {} }; } : _ref$generateCssVars, cssVarPrefix = _ref.cssVarPrefix, restThemeProp = _objectWithoutProperties(_ref, ["colorSchemes", "components", "generateCssVars", "cssVarPrefix"]); var allColorSchemes = Object.keys(colorSchemes); var defaultLightColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.light; var defaultDarkColorScheme = typeof defaultColorScheme === 'string' ? defaultColorScheme : defaultColorScheme.dark; // 1. Get the data about the `mode`, `colorScheme`, and setter functions. var _useCurrentColorSchem = useCurrentColorScheme({ supportedColorSchemes: allColorSchemes, defaultLightColorScheme: defaultLightColorScheme, defaultDarkColorScheme: defaultDarkColorScheme, modeStorageKey: modeStorageKey, colorSchemeStorageKey: colorSchemeStorageKey, defaultMode: defaultMode, storageWindow: storageWindow }), stateMode = _useCurrentColorSchem.mode, setMode = _useCurrentColorSchem.setMode, systemMode = _useCurrentColorSchem.systemMode, lightColorScheme = _useCurrentColorSchem.lightColorScheme, darkColorScheme = _useCurrentColorSchem.darkColorScheme, stateColorScheme = _useCurrentColorSchem.colorScheme, setColorScheme = _useCurrentColorSchem.setColorScheme; var mode = stateMode; var colorScheme = stateColorScheme; if (nested) { mode = ctx.mode; colorScheme = ctx.colorScheme; } var calculatedMode = function () { if (mode) { return mode; } // This scope occurs on the server if (defaultMode === 'system') { return designSystemMode; } return defaultMode; }(); var calculatedColorScheme = function () { if (!colorScheme) { // This scope occurs on the server if (calculatedMode === 'dark') { return defaultDarkColorScheme; } // use light color scheme, if default mode is 'light' | 'system' return defaultLightColorScheme; } return colorScheme; }(); // 2. Create CSS variables and store them in objects (to be generated in stylesheets in the final step) var _generateCssVars = generateCssVars(), rootCss = _generateCssVars.css, rootVars = _generateCssVars.vars; // 3. Start composing the theme object var theme = _extends({}, restThemeProp, { components: components, colorSchemes: colorSchemes, cssVarPrefix: cssVarPrefix, vars: rootVars, getColorSchemeSelector: function getColorSchemeSelector(targetColorScheme) { return "[".concat(attribute, "=\"").concat(targetColorScheme, "\"] &"); } }); // 4. Create color CSS variables and store them in objects (to be generated in stylesheets in the final step) // The default color scheme stylesheet is constructed to have the least CSS specificity. // The other color schemes uses selector, default as data attribute, to increase the CSS specificity so that they can override the default color scheme stylesheet. var defaultColorSchemeStyleSheet = {}; var otherColorSchemesStyleSheet = {}; Object.entries(colorSchemes).forEach(function (_ref2) { var _ref3 = _slicedToArray(_ref2, 2), key = _ref3[0], scheme = _ref3[1]; var _generateCssVars2 = generateCssVars(key), css = _generateCssVars2.css, vars = _generateCssVars2.vars; theme.vars = deepmerge(theme.vars, vars); if (key === calculatedColorScheme) { // 4.1 Merge the selected color scheme to the theme Object.keys(scheme).forEach(function (schemeKey) { if (scheme[schemeKey] && _typeof(scheme[schemeKey]) === 'object') { // shallow merge the 1st level structure of the theme. theme[schemeKey] = _extends({}, theme[schemeKey], scheme[schemeKey]); } else { theme[schemeKey] = scheme[schemeKey]; } }); if (theme.palette) { theme.palette.colorScheme = key; } } var resolvedDefaultColorScheme = function () { if (typeof defaultColorScheme === 'string') { return defaultColorScheme; } if (defaultMode === 'dark') { return defaultColorScheme.dark; } return defaultColorScheme.light; }(); if (key === resolvedDefaultColorScheme) { if (excludeVariablesFromRoot) { var excludedVariables = {}; excludeVariablesFromRoot(cssVarPrefix).forEach(function (cssVar) { excludedVariables[cssVar] = css[cssVar]; delete css[cssVar]; }); defaultColorSchemeStyleSheet["[".concat(attribute, "=\"").concat(key, "\"]")] = excludedVariables; } defaultColorSchemeStyleSheet["".concat(colorSchemeSelector, ", [").concat(attribute, "=\"").concat(key, "\"]")] = css; } else { otherColorSchemesStyleSheet["".concat(colorSchemeSelector === ':root' ? '' : colorSchemeSelector, "[").concat(attribute, "=\"").concat(key, "\"]")] = css; } }); theme.vars = deepmerge(theme.vars, rootVars); // 5. Declaring effects // 5.1 Updates the selector value to use the current color scheme which tells CSS to use the proper stylesheet. React__namespace.useEffect(function () { if (colorScheme && colorSchemeNode) { // attaches attribute to because the css variables are attached to :root (html) colorSchemeNode.setAttribute(attribute, colorScheme); } }, [colorScheme, attribute, colorSchemeNode]); // 5.2 Remove the CSS transition when color scheme changes to create instant experience. // credit: https://github.com/pacocoursey/next-themes/blob/b5c2bad50de2d61ad7b52a9c5cdc801a78507d7a/index.tsx#L313 React__namespace.useEffect(function () { var timer; if (disableTransitionOnChange && hasMounted.current && documentNode) { var css = documentNode.createElement('style'); css.appendChild(documentNode.createTextNode(DISABLE_CSS_TRANSITION)); documentNode.head.appendChild(css); // Force browser repaint (function () { return window.getComputedStyle(documentNode.body); })(); timer = setTimeout(function () { documentNode.head.removeChild(css); }, 1); } return function () { clearTimeout(timer); }; }, [colorScheme, disableTransitionOnChange, documentNode]); React__namespace.useEffect(function () { hasMounted.current = true; return function () { hasMounted.current = false; }; }, []); var contextValue = React__namespace.useMemo(function () { return { allColorSchemes: allColorSchemes, colorScheme: colorScheme, darkColorScheme: darkColorScheme, lightColorScheme: lightColorScheme, mode: mode, setColorScheme: setColorScheme, setMode: setMode, systemMode: systemMode }; }, [allColorSchemes, colorScheme, darkColorScheme, lightColorScheme, mode, setColorScheme, setMode, systemMode]); var shouldGenerateStyleSheet = true; if (disableStyleSheetGeneration || nested && (upperTheme == null ? void 0 : upperTheme.cssVarPrefix) === cssVarPrefix) { shouldGenerateStyleSheet = false; } var element = /*#__PURE__*/jsxRuntime_2(React__namespace.Fragment, { children: [shouldGenerateStyleSheet && /*#__PURE__*/jsxRuntime_2(React__namespace.Fragment, { children: [/*#__PURE__*/jsxRuntime_1(GlobalStyles$2, { styles: _defineProperty({}, colorSchemeSelector, rootCss) }), /*#__PURE__*/jsxRuntime_1(GlobalStyles$2, { styles: defaultColorSchemeStyleSheet }), /*#__PURE__*/jsxRuntime_1(GlobalStyles$2, { styles: otherColorSchemesStyleSheet })] }), /*#__PURE__*/jsxRuntime_1(ThemeProvider$1, { themeId: scopedTheme ? themeId : undefined, theme: resolveTheme ? resolveTheme(theme) : theme, children: children })] }); if (nested) { return element; } return /*#__PURE__*/jsxRuntime_1(ColorSchemeContext.Provider, { value: contextValue, children: element }); } CssVarsProvider.propTypes = { /** * The body attribute name to attach colorScheme. */ attribute: PropTypes.string, /** * The component tree. */ children: PropTypes.node, /** * The node used to attach the color-scheme attribute */ colorSchemeNode: PropTypes.any, /** * The CSS selector for attaching the generated custom properties */ colorSchemeSelector: PropTypes.string, /** * localStorage key used to store `colorScheme` */ colorSchemeStorageKey: PropTypes.string, /** * The initial color scheme used. */ defaultColorScheme: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), /** * The initial mode used. */ defaultMode: PropTypes.string, /** * If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`. */ disableNestedContext: PropTypes.bool, /** * If `true`, the style sheet won't be generated. * * This is useful for controlling nested CssVarsProvider behavior. */ disableStyleSheetGeneration: PropTypes.bool, /** * Disable CSS transitions when switching between modes or color schemes. */ disableTransitionOnChange: PropTypes.bool, /** * The document to attach the attribute to. */ documentNode: PropTypes.any, /** * The key in the local storage used to store current color scheme. */ modeStorageKey: PropTypes.string, /** * The window that attaches the 'storage' event listener. * @default window */ storageWindow: PropTypes.any, /** * The calculated theme object that will be passed through context. */ theme: PropTypes.object } ; var defaultLightColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.light; var defaultDarkColorScheme = typeof designSystemColorScheme === 'string' ? designSystemColorScheme : designSystemColorScheme.dark; var getInitColorSchemeScript = function getInitColorSchemeScript(params) { return getInitColorSchemeScript$1(_extends({ attribute: defaultAttribute, colorSchemeStorageKey: defaultColorSchemeStorageKey, defaultMode: designSystemMode, defaultLightColorScheme: defaultLightColorScheme, defaultDarkColorScheme: defaultDarkColorScheme, modeStorageKey: defaultModeStorageKey }, params)); }; return { CssVarsProvider: CssVarsProvider, useColorScheme: useColorScheme, getInitColorSchemeScript: getInitColorSchemeScript }; } /** * The benefit of this function is to help developers get CSS var from theme without specifying the whole variable * and they does not need to remember the prefix (defined once). */ function createGetCssVar$1() { var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; function appendVar() { for (var _len = arguments.length, vars = new Array(_len), _key = 0; _key < _len; _key++) { vars[_key] = arguments[_key]; } if (!vars.length) { return ''; } var value = vars[0]; if (typeof value === 'string' && !value.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)) { return ", var(--".concat(prefix ? "".concat(prefix, "-") : '').concat(value).concat(appendVar.apply(void 0, _toConsumableArray(vars.slice(1))), ")"); } return ", ".concat(value); } // AdditionalVars makes `getCssVar` less strict, so it can be use like this `getCssVar('non-mui-variable')` without type error. var getCssVar = function getCssVar(field) { for (var _len2 = arguments.length, fallbacks = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { fallbacks[_key2 - 1] = arguments[_key2]; } return "var(--".concat(prefix ? "".concat(prefix, "-") : '').concat(field).concat(appendVar.apply(void 0, fallbacks), ")"); }; return getCssVar; } /** * This function create an object from keys, value and then assign to target * * @param {Object} obj : the target object to be assigned * @param {string[]} keys * @param {string | number} value * * @example * const source = {} * assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)') * console.log(source) // { palette: { primary: 'var(--palette-primary)' } } * * @example * const source = { palette: { primary: 'var(--palette-primary)' } } * assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)') * console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } } */ var assignNestedKeys = function assignNestedKeys(obj, keys, value) { var arrayKeys = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; var temp = obj; keys.forEach(function (k, index) { if (index === keys.length - 1) { if (Array.isArray(temp)) { temp[Number(k)] = value; } else if (temp && _typeof(temp) === 'object') { temp[k] = value; } } else if (temp && _typeof(temp) === 'object') { if (!temp[k]) { temp[k] = arrayKeys.includes(k) ? [] : {}; } temp = temp[k]; } }); }; /** * * @param {Object} obj : source object * @param {Function} callback : a function that will be called when * - the deepest key in source object is reached * - the value of the deepest key is NOT `undefined` | `null` * * @example * walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log) * // ['palette', 'primary', 'main'] '#000000' */ var walkObjectDeep = function walkObjectDeep(obj, callback, shouldSkipPaths) { function recurse(object) { var parentKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var arrayKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; Object.entries(object).forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value = _ref2[1]; if (!shouldSkipPaths || shouldSkipPaths && !shouldSkipPaths([].concat(_toConsumableArray(parentKeys), [key]))) { if (value !== undefined && value !== null) { if (_typeof(value) === 'object' && Object.keys(value).length > 0) { recurse(value, [].concat(_toConsumableArray(parentKeys), [key]), Array.isArray(value) ? [].concat(_toConsumableArray(arrayKeys), [key]) : arrayKeys); } else { callback([].concat(_toConsumableArray(parentKeys), [key]), value, arrayKeys); } } } }); } recurse(obj); }; var getCssValue = function getCssValue(keys, value) { if (typeof value === 'number') { if (['lineHeight', 'fontWeight', 'opacity', 'zIndex'].some(function (prop) { return keys.includes(prop); })) { // CSS property that are unitless return value; } var lastKey = keys[keys.length - 1]; if (lastKey.toLowerCase().indexOf('opacity') >= 0) { // opacity values are unitless return value; } return "".concat(value, "px"); } return value; }; /** * a function that parse theme and return { css, vars } * * @param {Object} theme * @param {{ * prefix?: string, * shouldSkipGeneratingVar?: (objectPathKeys: Array, value: string | number) => boolean * }} options. * `prefix`: The prefix of the generated CSS variables. This function does not change the value. * * @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme). * * @example * const { css, vars } = parser({ * fontSize: 12, * lineHeight: 1.2, * palette: { primary: { 500: 'var(--color)' } } * }, { prefix: 'foo' }) * * console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' } * console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } } */ function cssVarsParser(theme, options) { var _ref3 = options || {}, prefix = _ref3.prefix, shouldSkipGeneratingVar = _ref3.shouldSkipGeneratingVar; var css = {}; var vars = {}; var varsWithDefaults = {}; walkObjectDeep(theme, function (keys, value, arrayKeys) { if (typeof value === 'string' || typeof value === 'number') { if (!shouldSkipGeneratingVar || !shouldSkipGeneratingVar(keys, value)) { // only create css & var if `shouldSkipGeneratingVar` return false var cssVar = "--".concat(prefix ? "".concat(prefix, "-") : '').concat(keys.join('-')); Object.assign(css, _defineProperty({}, cssVar, getCssValue(keys, value))); assignNestedKeys(vars, keys, "var(".concat(cssVar, ")"), arrayKeys); assignNestedKeys(varsWithDefaults, keys, "var(".concat(cssVar, ", ").concat(value, ")"), arrayKeys); } } }, function (keys) { return keys[0] === 'vars'; } // skip 'vars/*' paths ); return { css: css, vars: vars, varsWithDefaults: varsWithDefaults }; } function prepareCssVars(theme, parserConfig) { // @ts-ignore - ignore components do not exist var _theme$colorSchemes = theme.colorSchemes, colorSchemes = _theme$colorSchemes === void 0 ? {} : _theme$colorSchemes; theme.components; var _theme$defaultColorSc = theme.defaultColorScheme, defaultColorScheme = _theme$defaultColorSc === void 0 ? 'light' : _theme$defaultColorSc, otherTheme = _objectWithoutProperties(theme, ["colorSchemes", "components", "defaultColorScheme"]); var _cssVarsParser = cssVarsParser(otherTheme, parserConfig), rootVars = _cssVarsParser.vars, rootCss = _cssVarsParser.css, rootVarsWithDefaults = _cssVarsParser.varsWithDefaults; var themeVars = rootVarsWithDefaults; var colorSchemesMap = {}; var light = colorSchemes[defaultColorScheme], otherColorSchemes = _objectWithoutProperties(colorSchemes, [defaultColorScheme].map(toPropertyKey)); Object.entries(otherColorSchemes || {}).forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], scheme = _ref2[1]; var _cssVarsParser2 = cssVarsParser(scheme, parserConfig), vars = _cssVarsParser2.vars, css = _cssVarsParser2.css, varsWithDefaults = _cssVarsParser2.varsWithDefaults; themeVars = deepmerge(themeVars, varsWithDefaults); colorSchemesMap[key] = { css: css, vars: vars }; }); if (light) { // default color scheme vars should be merged last to set as default var _cssVarsParser3 = cssVarsParser(light, parserConfig), _css = _cssVarsParser3.css, vars = _cssVarsParser3.vars, varsWithDefaults = _cssVarsParser3.varsWithDefaults; themeVars = deepmerge(themeVars, varsWithDefaults); colorSchemesMap[defaultColorScheme] = { css: _css, vars: vars }; } var generateCssVars = function generateCssVars(colorScheme) { var _parserConfig$getSele2; if (!colorScheme) { var _parserConfig$getSele; var _css2 = _extends({}, rootCss); return { css: _css2, vars: rootVars, selector: (parserConfig == null || (_parserConfig$getSele = parserConfig.getSelector) == null ? void 0 : _parserConfig$getSele.call(parserConfig, colorScheme, _css2)) || ':root' }; } var css = _extends({}, colorSchemesMap[colorScheme].css); return { css: css, vars: colorSchemesMap[colorScheme].vars, selector: (parserConfig == null || (_parserConfig$getSele2 = parserConfig.getSelector) == null ? void 0 : _parserConfig$getSele2.call(parserConfig, colorScheme, css)) || ':root' }; }; return { vars: themeVars, generateCssVars: generateCssVars }; } var defaultTheme$6 = createTheme$1(); var defaultCreateStyledComponent$2 = systemStyled('div', { name: 'MuiContainer', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [styles.root, styles["maxWidth".concat(capitalize(String(ownerState.maxWidth)))], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters]; } }); var useThemePropsDefault$2 = function useThemePropsDefault(inProps) { return useThemeProps$c({ props: inProps, name: 'MuiContainer', defaultTheme: defaultTheme$6 }); }; var useUtilityClasses$1Q = function useUtilityClasses(ownerState, componentName) { var getContainerUtilityClass = function getContainerUtilityClass(slot) { return generateUtilityClass$1(componentName, slot); }; var classes = ownerState.classes, fixed = ownerState.fixed, disableGutters = ownerState.disableGutters, maxWidth = ownerState.maxWidth; var slots = { root: ['root', maxWidth && "maxWidth".concat(capitalize(String(maxWidth))), fixed && 'fixed', disableGutters && 'disableGutters'] }; return composeClasses(slots, getContainerUtilityClass, classes); }; function createContainer() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$createStyled = options.createStyledComponent, createStyledComponent = _options$createStyled === void 0 ? defaultCreateStyledComponent$2 : _options$createStyled, _options$useThemeProp = options.useThemeProps, useThemeProps = _options$useThemeProp === void 0 ? useThemePropsDefault$2 : _options$useThemeProp, _options$componentNam = options.componentName, componentName = _options$componentNam === void 0 ? 'MuiContainer' : _options$componentNam; var ContainerRoot = createStyledComponent(function (_ref) { var theme = _ref.theme, ownerState = _ref.ownerState; return _extends({ width: '100%', marginLeft: 'auto', boxSizing: 'border-box', marginRight: 'auto', display: 'block' }, !ownerState.disableGutters && _defineProperty({ paddingLeft: theme.spacing(2), paddingRight: theme.spacing(2) }, theme.breakpoints.up('sm'), { paddingLeft: theme.spacing(3), paddingRight: theme.spacing(3) })); }, function (_ref3) { var theme = _ref3.theme, ownerState = _ref3.ownerState; return ownerState.fixed && Object.keys(theme.breakpoints.values).reduce(function (acc, breakpointValueKey) { var breakpoint = breakpointValueKey; var value = theme.breakpoints.values[breakpoint]; if (value !== 0) { // @ts-ignore acc[theme.breakpoints.up(breakpoint)] = { maxWidth: "".concat(value).concat(theme.breakpoints.unit) }; } return acc; }, {}); }, function (_ref4) { var theme = _ref4.theme, ownerState = _ref4.ownerState; return _extends({}, ownerState.maxWidth === 'xs' && _defineProperty({}, theme.breakpoints.up('xs'), { // @ts-ignore module augmentation fails if custom breakpoints are used maxWidth: Math.max(theme.breakpoints.values.xs, 444) }), ownerState.maxWidth && // @ts-ignore module augmentation fails if custom breakpoints are used ownerState.maxWidth !== 'xs' && _defineProperty({}, theme.breakpoints.up(ownerState.maxWidth), { // @ts-ignore module augmentation fails if custom breakpoints are used maxWidth: "".concat(theme.breakpoints.values[ownerState.maxWidth]).concat(theme.breakpoints.unit) })); }); var Container = /*#__PURE__*/React__namespace.forwardRef(function Container(inProps, ref) { var props = useThemeProps(inProps); var className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'div' : _props$component, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, _props$fixed = props.fixed, fixed = _props$fixed === void 0 ? false : _props$fixed, _props$maxWidth = props.maxWidth, maxWidth = _props$maxWidth === void 0 ? 'lg' : _props$maxWidth; props.classes; var other = _objectWithoutProperties(props, ["className", "component", "disableGutters", "fixed", "maxWidth", "classes"]); var ownerState = _extends({}, props, { component: component, disableGutters: disableGutters, fixed: fixed, maxWidth: maxWidth }); // @ts-ignore module augmentation fails if custom breakpoints are used var classes = useUtilityClasses$1Q(ownerState, componentName); return ( /*#__PURE__*/ // @ts-ignore theme is injected by the styled util jsxRuntime_1(ContainerRoot, _extends({ as: component // @ts-ignore module augmentation fails if custom breakpoints are used , ownerState: ownerState, className: clsx(classes.root, className), ref: ref }, other)) ); }); Container.propTypes /* remove-proptypes */ = { children: PropTypes.node, classes: PropTypes.object, className: PropTypes.string, component: PropTypes.elementType, disableGutters: PropTypes.bool, fixed: PropTypes.bool, maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]), sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } ; return Container; } var filterBreakpointKeys = function filterBreakpointKeys(breakpointsKeys, responsiveKeys) { return breakpointsKeys.filter(function (key) { return responsiveKeys.includes(key); }); }; var traverseBreakpoints = function traverseBreakpoints(breakpoints, responsive, iterator) { var smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`. if (Array.isArray(responsive)) { responsive.forEach(function (breakpointValue, index) { iterator(function (responsiveStyles, style) { if (index <= breakpoints.keys.length - 1) { if (index === 0) { Object.assign(responsiveStyles, style); } else { responsiveStyles[breakpoints.up(breakpoints.keys[index])] = style; } } }, breakpointValue); }); } else if (responsive && _typeof(responsive) === 'object') { // prevent null // responsive could be a very big object, pick the smallest responsive values var keys = Object.keys(responsive).length > breakpoints.keys.length ? breakpoints.keys : filterBreakpointKeys(breakpoints.keys, Object.keys(responsive)); keys.forEach(function (key) { if (breakpoints.keys.indexOf(key) !== -1) { // @ts-ignore already checked that responsive is an object var breakpointValue = responsive[key]; if (breakpointValue !== undefined) { iterator(function (responsiveStyles, style) { if (smallestBreakpoint === key) { Object.assign(responsiveStyles, style); } else { responsiveStyles[breakpoints.up(key)] = style; } }, breakpointValue); } } }); } else if (typeof responsive === 'number' || typeof responsive === 'string') { iterator(function (responsiveStyles, style) { Object.assign(responsiveStyles, style); }, responsive); } }; function appendLevel(level) { if (!level) { return ''; } return "Level".concat(level); } function isNestedContainer(ownerState) { return ownerState.unstable_level > 0 && ownerState.container; } function createGetSelfSpacing(ownerState) { return function getSelfSpacing(axis) { return "var(--Grid-".concat(axis, "Spacing").concat(appendLevel(ownerState.unstable_level), ")"); }; } function createGetParentSpacing(ownerState) { return function getParentSpacing(axis) { if (ownerState.unstable_level === 0) { return "var(--Grid-".concat(axis, "Spacing)"); } return "var(--Grid-".concat(axis, "Spacing").concat(appendLevel(ownerState.unstable_level - 1), ")"); }; } function getParentColumns(ownerState) { if (ownerState.unstable_level === 0) { return "var(--Grid-columns)"; } return "var(--Grid-columns".concat(appendLevel(ownerState.unstable_level - 1), ")"); } var generateGridSizeStyles = function generateGridSizeStyles(_ref) { var theme = _ref.theme, ownerState = _ref.ownerState; var getSelfSpacing = createGetSelfSpacing(ownerState); var styles = {}; traverseBreakpoints(theme.breakpoints, ownerState.gridSize, function (appendStyle, value) { var style = {}; if (value === true) { style = { flexBasis: 0, flexGrow: 1, maxWidth: '100%' }; } if (value === 'auto') { style = { flexBasis: 'auto', flexGrow: 0, flexShrink: 0, maxWidth: 'none', width: 'auto' }; } if (typeof value === 'number') { style = { flexGrow: 0, flexBasis: 'auto', width: "calc(100% * ".concat(value, " / ").concat(getParentColumns(ownerState)).concat(isNestedContainer(ownerState) ? " + ".concat(getSelfSpacing('column')) : '', ")") }; } appendStyle(styles, style); }); return styles; }; var generateGridOffsetStyles = function generateGridOffsetStyles(_ref2) { var theme = _ref2.theme, ownerState = _ref2.ownerState; var styles = {}; traverseBreakpoints(theme.breakpoints, ownerState.gridOffset, function (appendStyle, value) { var style = {}; if (value === 'auto') { style = { marginLeft: 'auto' }; } if (typeof value === 'number') { style = { marginLeft: value === 0 ? '0px' : "calc(100% * ".concat(value, " / ").concat(getParentColumns(ownerState), ")") }; } appendStyle(styles, style); }); return styles; }; var generateGridColumnsStyles = function generateGridColumnsStyles(_ref3) { var theme = _ref3.theme, ownerState = _ref3.ownerState; if (!ownerState.container) { return {}; } var styles = isNestedContainer(ownerState) ? _defineProperty({}, "--Grid-columns".concat(appendLevel(ownerState.unstable_level)), getParentColumns(ownerState)) : { '--Grid-columns': 12 }; traverseBreakpoints(theme.breakpoints, ownerState.columns, function (appendStyle, value) { appendStyle(styles, _defineProperty({}, "--Grid-columns".concat(appendLevel(ownerState.unstable_level)), value)); }); return styles; }; var generateGridRowSpacingStyles = function generateGridRowSpacingStyles(_ref5) { var theme = _ref5.theme, ownerState = _ref5.ownerState; if (!ownerState.container) { return {}; } var getParentSpacing = createGetParentSpacing(ownerState); var styles = isNestedContainer(ownerState) ? _defineProperty({}, "--Grid-rowSpacing".concat(appendLevel(ownerState.unstable_level)), getParentSpacing('row')) : {}; traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, function (appendStyle, value) { var _theme$spacing; appendStyle(styles, _defineProperty({}, "--Grid-rowSpacing".concat(appendLevel(ownerState.unstable_level)), typeof value === 'string' ? value : (_theme$spacing = theme.spacing) == null ? void 0 : _theme$spacing.call(theme, value))); }); return styles; }; var generateGridColumnSpacingStyles = function generateGridColumnSpacingStyles(_ref7) { var theme = _ref7.theme, ownerState = _ref7.ownerState; if (!ownerState.container) { return {}; } var getParentSpacing = createGetParentSpacing(ownerState); var styles = isNestedContainer(ownerState) ? _defineProperty({}, "--Grid-columnSpacing".concat(appendLevel(ownerState.unstable_level)), getParentSpacing('column')) : {}; traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, function (appendStyle, value) { var _theme$spacing2; appendStyle(styles, _defineProperty({}, "--Grid-columnSpacing".concat(appendLevel(ownerState.unstable_level)), typeof value === 'string' ? value : (_theme$spacing2 = theme.spacing) == null ? void 0 : _theme$spacing2.call(theme, value))); }); return styles; }; var generateGridDirectionStyles = function generateGridDirectionStyles(_ref9) { var theme = _ref9.theme, ownerState = _ref9.ownerState; if (!ownerState.container) { return {}; } var styles = {}; traverseBreakpoints(theme.breakpoints, ownerState.direction, function (appendStyle, value) { appendStyle(styles, { flexDirection: value }); }); return styles; }; var generateGridStyles = function generateGridStyles(_ref10) { var ownerState = _ref10.ownerState; var getSelfSpacing = createGetSelfSpacing(ownerState); var getParentSpacing = createGetParentSpacing(ownerState); return _extends({ minWidth: 0, boxSizing: 'border-box' }, ownerState.container && _extends({ display: 'flex', flexWrap: 'wrap' }, ownerState.wrap && ownerState.wrap !== 'wrap' && { flexWrap: ownerState.wrap }, { margin: "calc(".concat(getSelfSpacing('row'), " / -2) calc(").concat(getSelfSpacing('column'), " / -2)") }, ownerState.disableEqualOverflow && { margin: "calc(".concat(getSelfSpacing('row'), " * -1) 0px 0px calc(").concat(getSelfSpacing('column'), " * -1)") }), (!ownerState.container || isNestedContainer(ownerState)) && _extends({ padding: "calc(".concat(getParentSpacing('row'), " / 2) calc(").concat(getParentSpacing('column'), " / 2)") }, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && { padding: "".concat(getParentSpacing('row'), " 0px 0px ").concat(getParentSpacing('column')) })); }; var generateSizeClassNames = function generateSizeClassNames(gridSize) { var classNames = []; Object.entries(gridSize).forEach(function (_ref11) { var _ref12 = _slicedToArray(_ref11, 2), key = _ref12[0], value = _ref12[1]; if (value !== false && value !== undefined) { classNames.push("grid-".concat(key, "-").concat(String(value))); } }); return classNames; }; var generateSpacingClassNames = function generateSpacingClassNames(spacing) { var smallestBreakpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'xs'; function isValidSpacing(val) { if (val === undefined) { return false; } return typeof val === 'string' && !Number.isNaN(Number(val)) || typeof val === 'number' && val > 0; } if (isValidSpacing(spacing)) { return ["spacing-".concat(smallestBreakpoint, "-").concat(String(spacing))]; } if (_typeof(spacing) === 'object' && !Array.isArray(spacing)) { var classNames = []; Object.entries(spacing).forEach(function (_ref13) { var _ref14 = _slicedToArray(_ref13, 2), key = _ref14[0], value = _ref14[1]; if (isValidSpacing(value)) { classNames.push("spacing-".concat(key, "-").concat(String(value))); } }); return classNames; } return []; }; var generateDirectionClasses = function generateDirectionClasses(direction) { if (direction === undefined) { return []; } if (_typeof(direction) === 'object') { return Object.entries(direction).map(function (_ref15) { var _ref16 = _slicedToArray(_ref15, 2), key = _ref16[0], value = _ref16[1]; return "direction-".concat(key, "-").concat(value); }); } return ["direction-xs-".concat(String(direction))]; }; var defaultTheme$5 = createTheme$1(); // widening Theme to any so that the consumer can own the theme structure. var defaultCreateStyledComponent$1 = systemStyled('div', { name: 'MuiGrid', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { return styles.root; } }); function useThemePropsDefault$1(props) { return useThemeProps$c({ props: props, name: 'MuiGrid', defaultTheme: defaultTheme$5 }); } function createGrid() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$createStyled = options.createStyledComponent, createStyledComponent = _options$createStyled === void 0 ? defaultCreateStyledComponent$1 : _options$createStyled, _options$useThemeProp = options.useThemeProps, useThemeProps = _options$useThemeProp === void 0 ? useThemePropsDefault$1 : _options$useThemeProp, _options$componentNam = options.componentName, componentName = _options$componentNam === void 0 ? 'MuiGrid' : _options$componentNam; var GridOverflowContext = /*#__PURE__*/React__namespace.createContext(undefined); { GridOverflowContext.displayName = 'GridOverflowContext'; } var useUtilityClasses = function useUtilityClasses(ownerState, theme) { var container = ownerState.container, direction = ownerState.direction, spacing = ownerState.spacing, wrap = ownerState.wrap, gridSize = ownerState.gridSize; var slots = { root: ['root', container && 'container', wrap !== 'wrap' && "wrap-xs-".concat(String(wrap))].concat(_toConsumableArray(generateDirectionClasses(direction)), _toConsumableArray(generateSizeClassNames(gridSize)), _toConsumableArray(container ? generateSpacingClassNames(spacing, theme.breakpoints.keys[0]) : [])) }; return composeClasses(slots, function (slot) { return generateUtilityClass$1(componentName, slot); }, {}); }; var GridRoot = createStyledComponent(generateGridColumnsStyles, generateGridColumnSpacingStyles, generateGridRowSpacingStyles, generateGridSizeStyles, generateGridDirectionStyles, generateGridStyles, generateGridOffsetStyles); var Grid = /*#__PURE__*/React__namespace.forwardRef(function Grid(inProps, ref) { var _inProps$columns, _inProps$spacing, _ref3, _inProps$rowSpacing, _ref4, _inProps$columnSpacin, _ref5, _disableEqualOverflow; var theme = useTheme$2(); var themeProps = useThemeProps(inProps); var props = extendSxProp(themeProps); // `color` type conflicts with html color attribute. var overflow = React__namespace.useContext(GridOverflowContext); var className = props.className, children = props.children, _props$columns = props.columns, columnsProp = _props$columns === void 0 ? 12 : _props$columns, _props$container = props.container, container = _props$container === void 0 ? false : _props$container, _props$component = props.component, component = _props$component === void 0 ? 'div' : _props$component, _props$direction = props.direction, direction = _props$direction === void 0 ? 'row' : _props$direction, _props$wrap = props.wrap, wrap = _props$wrap === void 0 ? 'wrap' : _props$wrap, _props$spacing = props.spacing, spacingProp = _props$spacing === void 0 ? 0 : _props$spacing, _props$rowSpacing = props.rowSpacing, rowSpacingProp = _props$rowSpacing === void 0 ? spacingProp : _props$rowSpacing, _props$columnSpacing = props.columnSpacing, columnSpacingProp = _props$columnSpacing === void 0 ? spacingProp : _props$columnSpacing, themeDisableEqualOverflow = props.disableEqualOverflow, _props$unstable_level = props.unstable_level, level = _props$unstable_level === void 0 ? 0 : _props$unstable_level, rest = _objectWithoutProperties(props, ["className", "children", "columns", "container", "component", "direction", "wrap", "spacing", "rowSpacing", "columnSpacing", "disableEqualOverflow", "unstable_level"]); // Because `disableEqualOverflow` can be set from the theme's defaultProps, the **nested** grid should look at the instance props instead. var disableEqualOverflow = themeDisableEqualOverflow; if (level && themeDisableEqualOverflow !== undefined) { disableEqualOverflow = inProps.disableEqualOverflow; } // collect breakpoints related props because they can be customized from the theme. var gridSize = {}; var gridOffset = {}; var other = {}; Object.entries(rest).forEach(function (_ref) { var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], val = _ref2[1]; if (theme.breakpoints.values[key] !== undefined) { gridSize[key] = val; } else if (theme.breakpoints.values[key.replace('Offset', '')] !== undefined) { gridOffset[key.replace('Offset', '')] = val; } else { other[key] = val; } }); var columns = (_inProps$columns = inProps.columns) != null ? _inProps$columns : level ? undefined : columnsProp; var spacing = (_inProps$spacing = inProps.spacing) != null ? _inProps$spacing : level ? undefined : spacingProp; var rowSpacing = (_ref3 = (_inProps$rowSpacing = inProps.rowSpacing) != null ? _inProps$rowSpacing : inProps.spacing) != null ? _ref3 : level ? undefined : rowSpacingProp; var columnSpacing = (_ref4 = (_inProps$columnSpacin = inProps.columnSpacing) != null ? _inProps$columnSpacin : inProps.spacing) != null ? _ref4 : level ? undefined : columnSpacingProp; var ownerState = _extends({}, props, { level: level, columns: columns, container: container, direction: direction, wrap: wrap, spacing: spacing, rowSpacing: rowSpacing, columnSpacing: columnSpacing, gridSize: gridSize, gridOffset: gridOffset, disableEqualOverflow: (_ref5 = (_disableEqualOverflow = disableEqualOverflow) != null ? _disableEqualOverflow : overflow) != null ? _ref5 : false, // use context value if exists. parentDisableEqualOverflow: overflow // for nested grid }); var classes = useUtilityClasses(ownerState, theme); var result = /*#__PURE__*/jsxRuntime_1(GridRoot, _extends({ ref: ref, as: component, ownerState: ownerState, className: clsx(classes.root, className) }, other, { children: React__namespace.Children.map(children, function (child) { if ( /*#__PURE__*/React__namespace.isValidElement(child) && isMuiElement(child, ['Grid'])) { var _child$props$unstable; return /*#__PURE__*/React__namespace.cloneElement(child, { unstable_level: (_child$props$unstable = child.props.unstable_level) != null ? _child$props$unstable : level + 1 }); } return child; }) })); if (disableEqualOverflow !== undefined && disableEqualOverflow !== (overflow != null ? overflow : false)) { // There are 2 possibilities that should wrap with the GridOverflowContext to communicate with the nested grids: // 1. It is the root grid with `disableEqualOverflow`. // 2. It is a nested grid with different `disableEqualOverflow` from the context. result = /*#__PURE__*/jsxRuntime_1(GridOverflowContext.Provider, { value: disableEqualOverflow, children: result }); } return result; }); Grid.propTypes /* remove-proptypes */ = { children: PropTypes.node, className: PropTypes.string, columns: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.number), PropTypes.number, PropTypes.object]), columnSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]), component: PropTypes.elementType, container: PropTypes.bool, direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]), disableEqualOverflow: PropTypes.bool, lg: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]), lgOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]), md: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]), mdOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]), rowSpacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]), sm: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]), smOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]), spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]), sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]), wrap: PropTypes.oneOf(['nowrap', 'wrap-reverse', 'wrap']), xl: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]), xlOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]), xs: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.bool]), xsOffset: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number]) } ; // @ts-ignore internal logic for nested grid Grid.muiName = 'Grid'; return Grid; } var defaultTheme$4 = createTheme$1(); // widening Theme to any so that the consumer can own the theme structure. var defaultCreateStyledComponent = systemStyled('div', { name: 'MuiStack', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { return styles.root; } }); function useThemePropsDefault(props) { return useThemeProps$c({ props: props, name: 'MuiStack', defaultTheme: defaultTheme$4 }); } /** * Return an array with the separator React element interspersed between * each React node of the input children. * * > joinChildren([1,2,3], 0) * [1,0,2,0,3] */ function joinChildren(children, separator) { var childrenArray = React__namespace.Children.toArray(children).filter(Boolean); return childrenArray.reduce(function (output, child, index) { output.push(child); if (index < childrenArray.length - 1) { output.push( /*#__PURE__*/React__namespace.cloneElement(separator, { key: "separator-".concat(index) })); } return output; }, []); } var getSideFromDirection = function getSideFromDirection(direction) { return { row: 'Left', 'row-reverse': 'Right', column: 'Top', 'column-reverse': 'Bottom' }[direction]; }; var style = function style(_ref) { var ownerState = _ref.ownerState, theme = _ref.theme; var styles = _extends({ display: 'flex', flexDirection: 'column' }, handleBreakpoints({ theme: theme }, resolveBreakpointValues({ values: ownerState.direction, breakpoints: theme.breakpoints.values }), function (propValue) { return { flexDirection: propValue }; })); if (ownerState.spacing) { var transformer = createUnarySpacing(theme); var base = Object.keys(theme.breakpoints.values).reduce(function (acc, breakpoint) { if (_typeof(ownerState.spacing) === 'object' && ownerState.spacing[breakpoint] != null || _typeof(ownerState.direction) === 'object' && ownerState.direction[breakpoint] != null) { acc[breakpoint] = true; } return acc; }, {}); var directionValues = resolveBreakpointValues({ values: ownerState.direction, base: base }); var spacingValues = resolveBreakpointValues({ values: ownerState.spacing, base: base }); if (_typeof(directionValues) === 'object') { Object.keys(directionValues).forEach(function (breakpoint, index, breakpoints) { var directionValue = directionValues[breakpoint]; if (!directionValue) { var previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column'; directionValues[breakpoint] = previousDirectionValue; } }); } var styleFromPropValue = function styleFromPropValue(propValue, breakpoint) { if (ownerState.useFlexGap) { return { gap: getValue(transformer, propValue) }; } return { // The useFlexGap={false} implement relies on each child to give up control of the margin. // We need to reset the margin to avoid double spacing. '& > :not(style):not(style)': { margin: 0 }, '& > :not(style) ~ :not(style)': _defineProperty({}, "margin".concat(getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)), getValue(transformer, propValue)) }; }; styles = deepmerge(styles, handleBreakpoints({ theme: theme }, spacingValues, styleFromPropValue)); } styles = mergeBreakpointsInOrder(theme.breakpoints, styles); return styles; }; function createStack() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$createStyled = options.createStyledComponent, createStyledComponent = _options$createStyled === void 0 ? defaultCreateStyledComponent : _options$createStyled, _options$useThemeProp = options.useThemeProps, useThemeProps = _options$useThemeProp === void 0 ? useThemePropsDefault : _options$useThemeProp, _options$componentNam = options.componentName, componentName = _options$componentNam === void 0 ? 'MuiStack' : _options$componentNam; var useUtilityClasses = function useUtilityClasses() { var slots = { root: ['root'] }; return composeClasses(slots, function (slot) { return generateUtilityClass$1(componentName, slot); }, {}); }; var StackRoot = createStyledComponent(style); var Stack = /*#__PURE__*/React__namespace.forwardRef(function Grid(inProps, ref) { var themeProps = useThemeProps(inProps); var props = extendSxProp(themeProps); // `color` type conflicts with html color attribute. var _props$component = props.component, component = _props$component === void 0 ? 'div' : _props$component, _props$direction = props.direction, direction = _props$direction === void 0 ? 'column' : _props$direction, _props$spacing = props.spacing, spacing = _props$spacing === void 0 ? 0 : _props$spacing, divider = props.divider, children = props.children, className = props.className, _props$useFlexGap = props.useFlexGap, useFlexGap = _props$useFlexGap === void 0 ? false : _props$useFlexGap, other = _objectWithoutProperties(props, ["component", "direction", "spacing", "divider", "children", "className", "useFlexGap"]); var ownerState = { direction: direction, spacing: spacing, useFlexGap: useFlexGap }; var classes = useUtilityClasses(); return /*#__PURE__*/jsxRuntime_1(StackRoot, _extends({ as: component, ownerState: ownerState, ref: ref, className: clsx(classes.root, className) }, other, { children: divider ? joinChildren(children, divider) : children })); }); Stack.propTypes /* remove-proptypes */ = { children: PropTypes.node, direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]), divider: PropTypes.node, spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]), sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } ; return Stack; } function adaptV4Theme(inputTheme) { { console.warn(['MUI: adaptV4Theme() is deprecated.', 'Follow the upgrade guide on https://mui.com/r/migration-v4#theme.'].join('\n')); } var _inputTheme$defaultPr = inputTheme.defaultProps, defaultProps = _inputTheme$defaultPr === void 0 ? {} : _inputTheme$defaultPr, _inputTheme$mixins = inputTheme.mixins, mixins = _inputTheme$mixins === void 0 ? {} : _inputTheme$mixins, _inputTheme$overrides = inputTheme.overrides, overrides = _inputTheme$overrides === void 0 ? {} : _inputTheme$overrides, _inputTheme$palette = inputTheme.palette, palette = _inputTheme$palette === void 0 ? {} : _inputTheme$palette, _inputTheme$props = inputTheme.props, props = _inputTheme$props === void 0 ? {} : _inputTheme$props, _inputTheme$styleOver = inputTheme.styleOverrides, styleOverrides = _inputTheme$styleOver === void 0 ? {} : _inputTheme$styleOver, other = _objectWithoutProperties(inputTheme, ["defaultProps", "mixins", "overrides", "palette", "props", "styleOverrides"]); var theme = _extends({}, other, { components: {} }); // default props Object.keys(defaultProps).forEach(function (component) { var componentValue = theme.components[component] || {}; componentValue.defaultProps = defaultProps[component]; theme.components[component] = componentValue; }); Object.keys(props).forEach(function (component) { var componentValue = theme.components[component] || {}; componentValue.defaultProps = props[component]; theme.components[component] = componentValue; }); // CSS overrides Object.keys(styleOverrides).forEach(function (component) { var componentValue = theme.components[component] || {}; componentValue.styleOverrides = styleOverrides[component]; theme.components[component] = componentValue; }); Object.keys(overrides).forEach(function (component) { var componentValue = theme.components[component] || {}; componentValue.styleOverrides = overrides[component]; theme.components[component] = componentValue; }); // theme.spacing theme.spacing = createSpacing(inputTheme.spacing); // theme.mixins.gutters var breakpoints = createBreakpoints(inputTheme.breakpoints || {}); var spacing = theme.spacing; theme.mixins = _extends({ gutters: function gutters() { var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return _extends({ paddingLeft: spacing(2), paddingRight: spacing(2) }, styles, _defineProperty({}, breakpoints.up('sm'), _extends({ paddingLeft: spacing(3), paddingRight: spacing(3) }, styles[breakpoints.up('sm')]))); } }, mixins); var typeInput = palette.type, modeInput = palette.mode, paletteRest = _objectWithoutProperties(palette, ["type", "mode"]); var finalMode = modeInput || typeInput || 'light'; theme.palette = _extends({ // theme.palette.text.hint text: { hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)' }, mode: finalMode, type: finalMode }, paletteRest); return theme; } function createMixins(breakpoints, mixins) { return _extends({ toolbar: _defineProperty(_defineProperty({ minHeight: 56 }, breakpoints.up('xs'), { '@media (orientation: landscape)': { minHeight: 48 } }), breakpoints.up('sm'), { minHeight: 64 }) }, mixins); } var light = { // The colors used to style the text. text: { // The most important text. primary: 'rgba(0, 0, 0, 0.87)', // Secondary text. secondary: 'rgba(0, 0, 0, 0.6)', // Disabled text have even lower visual prominence. disabled: 'rgba(0, 0, 0, 0.38)' }, // The color used to divide different elements. divider: 'rgba(0, 0, 0, 0.12)', // The background colors used to style the surfaces. // Consistency between these values is important. background: { paper: common$1.white, "default": common$1.white }, // The colors used to style the action elements. action: { // The color of an active action like an icon button. active: 'rgba(0, 0, 0, 0.54)', // The color of an hovered action. hover: 'rgba(0, 0, 0, 0.04)', hoverOpacity: 0.04, // The color of a selected action. selected: 'rgba(0, 0, 0, 0.08)', selectedOpacity: 0.08, // The color of a disabled action. disabled: 'rgba(0, 0, 0, 0.26)', // The background color of a disabled action. disabledBackground: 'rgba(0, 0, 0, 0.12)', disabledOpacity: 0.38, focus: 'rgba(0, 0, 0, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.12 } }; var dark = { text: { primary: common$1.white, secondary: 'rgba(255, 255, 255, 0.7)', disabled: 'rgba(255, 255, 255, 0.5)', icon: 'rgba(255, 255, 255, 0.5)' }, divider: 'rgba(255, 255, 255, 0.12)', background: { paper: '#121212', "default": '#121212' }, action: { active: common$1.white, hover: 'rgba(255, 255, 255, 0.08)', hoverOpacity: 0.08, selected: 'rgba(255, 255, 255, 0.16)', selectedOpacity: 0.16, disabled: 'rgba(255, 255, 255, 0.3)', disabledBackground: 'rgba(255, 255, 255, 0.12)', disabledOpacity: 0.38, focus: 'rgba(255, 255, 255, 0.12)', focusOpacity: 0.12, activatedOpacity: 0.24 } }; function addLightOrDark(intent, direction, shade, tonalOffset) { var tonalOffsetLight = tonalOffset.light || tonalOffset; var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5; if (!intent[direction]) { if (intent.hasOwnProperty(shade)) { intent[direction] = intent[shade]; } else if (direction === 'light') { intent.light = lighten(intent.main, tonalOffsetLight); } else if (direction === 'dark') { intent.dark = darken(intent.main, tonalOffsetDark); } } } function getDefaultPrimary() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: blue$1[200], light: blue$1[50], dark: blue$1[400] }; } return { main: blue$1[700], light: blue$1[400], dark: blue$1[800] }; } function getDefaultSecondary() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: purple$1[200], light: purple$1[50], dark: purple$1[400] }; } return { main: purple$1[500], light: purple$1[300], dark: purple$1[700] }; } function getDefaultError() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: red$1[500], light: red$1[300], dark: red$1[700] }; } return { main: red$1[700], light: red$1[400], dark: red$1[800] }; } function getDefaultInfo() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: lightBlue$1[400], light: lightBlue$1[300], dark: lightBlue$1[700] }; } return { main: lightBlue$1[700], light: lightBlue$1[500], dark: lightBlue$1[900] }; } function getDefaultSuccess() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: green$1[400], light: green$1[300], dark: green$1[700] }; } return { main: green$1[800], light: green$1[500], dark: green$1[900] }; } function getDefaultWarning() { var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'light'; if (mode === 'dark') { return { main: orange$1[400], light: orange$1[300], dark: orange$1[700] }; } return { main: '#ed6c02', // closest to orange[800] that pass 3:1. light: orange$1[500], dark: orange$1[900] }; } function createPalette(palette) { var _palette$mode = palette.mode, mode = _palette$mode === void 0 ? 'light' : _palette$mode, _palette$contrastThre = palette.contrastThreshold, contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre, _palette$tonalOffset = palette.tonalOffset, tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset, other = _objectWithoutProperties(palette, ["mode", "contrastThreshold", "tonalOffset"]); var primary = palette.primary || getDefaultPrimary(mode); var secondary = palette.secondary || getDefaultSecondary(mode); var error = palette.error || getDefaultError(mode); var info = palette.info || getDefaultInfo(mode); var success = palette.success || getDefaultSuccess(mode); var warning = palette.warning || getDefaultWarning(mode); // Use the same logic as // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59 // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54 function getContrastText(background) { var contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary; { var contrast = getContrastRatio(background, contrastText); if (contrast < 3) { console.error(["MUI: The contrast ratio of ".concat(contrast, ":1 for ").concat(contrastText, " on ").concat(background), 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n')); } } return contrastText; } var augmentColor = function augmentColor(_ref) { var color = _ref.color, name = _ref.name, _ref$mainShade = _ref.mainShade, mainShade = _ref$mainShade === void 0 ? 500 : _ref$mainShade, _ref$lightShade = _ref.lightShade, lightShade = _ref$lightShade === void 0 ? 300 : _ref$lightShade, _ref$darkShade = _ref.darkShade, darkShade = _ref$darkShade === void 0 ? 700 : _ref$darkShade; color = _extends({}, color); if (!color.main && color[mainShade]) { color.main = color[mainShade]; } if (!color.hasOwnProperty('main')) { throw new Error("MUI: The color".concat(name ? " (".concat(name, ")") : '', " provided to augmentColor(color) is invalid.\nThe color object needs to have a `main` property or a `").concat(mainShade, "` property.") ); } if (typeof color.main !== 'string') { throw new Error("MUI: The color".concat(name ? " (".concat(name, ")") : '', " provided to augmentColor(color) is invalid.\n`color.main` should be a string, but `").concat(JSON.stringify(color.main), "` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });") ); } addLightOrDark(color, 'light', lightShade, tonalOffset); addLightOrDark(color, 'dark', darkShade, tonalOffset); if (!color.contrastText) { color.contrastText = getContrastText(color.main); } return color; }; var modes = { dark: dark, light: light }; { if (!modes[mode]) { console.error("MUI: The palette mode `".concat(mode, "` is not supported.")); } } var paletteOutput = deepmerge(_extends({ // A collection of common colors. common: _extends({}, common$1), // prevent mutable object. // The palette mode, can be light or dark. mode: mode, // The colors used to represent primary interface elements for a user. primary: augmentColor({ color: primary, name: 'primary' }), // The colors used to represent secondary interface elements for a user. secondary: augmentColor({ color: secondary, name: 'secondary', mainShade: 'A400', lightShade: 'A200', darkShade: 'A700' }), // The colors used to represent interface elements that the user should be made aware of. error: augmentColor({ color: error, name: 'error' }), // The colors used to represent potentially dangerous actions or important messages. warning: augmentColor({ color: warning, name: 'warning' }), // The colors used to present information to the user that is neutral and not necessarily important. info: augmentColor({ color: info, name: 'info' }), // The colors used to indicate the successful completion of an action that user triggered. success: augmentColor({ color: success, name: 'success' }), // The grey colors. grey: grey$1, // Used by `getContrastText()` to maximize the contrast between // the background and the text. contrastThreshold: contrastThreshold, // Takes a background color and returns the text color that maximizes the contrast. getContrastText: getContrastText, // Generate a rich color object. augmentColor: augmentColor, // Used by the functions below to shift a color's luminance by approximately // two indexes within its tonal palette. // E.g., shift from Red 500 to Red 300 or Red 700. tonalOffset: tonalOffset }, modes[mode]), other); return paletteOutput; } function round$2(value) { return Math.round(value * 1e5) / 1e5; } var caseAllCaps = { textTransform: 'uppercase' }; var defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif'; /** * @see @link{https://m2.material.io/design/typography/the-type-system.html} * @see @link{https://m2.material.io/design/typography/understanding-typography.html} */ function createTypography(palette, typography) { var _ref = typeof typography === 'function' ? typography(palette) : typography, _ref$fontFamily = _ref.fontFamily, fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily, _ref$fontSize = _ref.fontSize, fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize, _ref$fontWeightLight = _ref.fontWeightLight, fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight, _ref$fontWeightRegula = _ref.fontWeightRegular, fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula, _ref$fontWeightMedium = _ref.fontWeightMedium, fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium, _ref$fontWeightBold = _ref.fontWeightBold, fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold, _ref$htmlFontSize = _ref.htmlFontSize, htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize, allVariants = _ref.allVariants, pxToRem2 = _ref.pxToRem, other = _objectWithoutProperties(_ref, ["fontFamily", "fontSize", "fontWeightLight", "fontWeightRegular", "fontWeightMedium", "fontWeightBold", "htmlFontSize", "allVariants", "pxToRem"]); { if (typeof fontSize !== 'number') { console.error('MUI: `fontSize` is required to be a number.'); } if (typeof htmlFontSize !== 'number') { console.error('MUI: `htmlFontSize` is required to be a number.'); } } var coef = fontSize / 14; var pxToRem = pxToRem2 || function (size) { return "".concat(size / htmlFontSize * coef, "rem"); }; var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) { return _extends({ fontFamily: fontFamily, fontWeight: fontWeight, fontSize: pxToRem(size), // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/ lineHeight: lineHeight }, fontFamily === defaultFontFamily ? { letterSpacing: "".concat(round$2(letterSpacing / size), "em") } : {}, casing, allVariants); }; var variants = { h1: buildVariant(fontWeightLight, 96, 1.167, -1.5), h2: buildVariant(fontWeightLight, 60, 1.2, -0.5), h3: buildVariant(fontWeightRegular, 48, 1.167, 0), h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25), h5: buildVariant(fontWeightRegular, 24, 1.334, 0), h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15), subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15), subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1), body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15), body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15), button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps), caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4), overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps), // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types. inherit: { fontFamily: 'inherit', fontWeight: 'inherit', fontSize: 'inherit', lineHeight: 'inherit', letterSpacing: 'inherit' } }; return deepmerge(_extends({ htmlFontSize: htmlFontSize, pxToRem: pxToRem, fontFamily: fontFamily, fontSize: fontSize, fontWeightLight: fontWeightLight, fontWeightRegular: fontWeightRegular, fontWeightMedium: fontWeightMedium, fontWeightBold: fontWeightBold }, variants), other, { clone: false // No need to clone deep }); } var shadowKeyUmbraOpacity = 0.2; var shadowKeyPenumbraOpacity = 0.14; var shadowAmbientShadowOpacity = 0.12; function createShadow() { return ["".concat(arguments.length <= 0 ? undefined : arguments[0], "px ").concat(arguments.length <= 1 ? undefined : arguments[1], "px ").concat(arguments.length <= 2 ? undefined : arguments[2], "px ").concat(arguments.length <= 3 ? undefined : arguments[3], "px rgba(0,0,0,").concat(shadowKeyUmbraOpacity, ")"), "".concat(arguments.length <= 4 ? undefined : arguments[4], "px ").concat(arguments.length <= 5 ? undefined : arguments[5], "px ").concat(arguments.length <= 6 ? undefined : arguments[6], "px ").concat(arguments.length <= 7 ? undefined : arguments[7], "px rgba(0,0,0,").concat(shadowKeyPenumbraOpacity, ")"), "".concat(arguments.length <= 8 ? undefined : arguments[8], "px ").concat(arguments.length <= 9 ? undefined : arguments[9], "px ").concat(arguments.length <= 10 ? undefined : arguments[10], "px ").concat(arguments.length <= 11 ? undefined : arguments[11], "px rgba(0,0,0,").concat(shadowAmbientShadowOpacity, ")")].join(','); } // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss var 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)]; var shadows$1 = shadows; // Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves // to learn the context in which each easing should be used. var easing = { // This is the most common easing curve. easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)', // Objects enter the screen at full velocity from off-screen and // slowly decelerate to a resting point. easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)', // Objects leave the screen at full velocity. They do not decelerate when off-screen. easeIn: 'cubic-bezier(0.4, 0, 1, 1)', // The sharp curve is used by objects that may return to the screen at any time. sharp: 'cubic-bezier(0.4, 0, 0.6, 1)' }; // Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations // to learn when use what timing var duration = { shortest: 150, shorter: 200, "short": 250, // most basic recommended timing standard: 300, // this is to be used in complex animations complex: 375, // recommended when something is entering screen enteringScreen: 225, // recommended when something is leaving screen leavingScreen: 195 }; function formatMs(milliseconds) { return "".concat(Math.round(milliseconds), "ms"); } function getAutoHeightDuration(height) { if (!height) { return 0; } var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10 return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10); } function createTransitions(inputTransitions) { var mergedEasing = _extends({}, easing, inputTransitions.easing); var mergedDuration = _extends({}, duration, inputTransitions.duration); var create = function create() { var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all']; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$duration = options.duration, durationOption = _options$duration === void 0 ? mergedDuration.standard : _options$duration, _options$easing = options.easing, easingOption = _options$easing === void 0 ? mergedEasing.easeInOut : _options$easing, _options$delay = options.delay, delay = _options$delay === void 0 ? 0 : _options$delay, other = _objectWithoutProperties(options, ["duration", "easing", "delay"]); { var isString = function isString(value) { return typeof value === 'string'; }; // IE11 support, replace with Number.isNaN // eslint-disable-next-line no-restricted-globals var isNumber = function isNumber(value) { return !isNaN(parseFloat(value)); }; if (!isString(props) && !Array.isArray(props)) { console.error('MUI: Argument "props" must be a string or Array.'); } if (!isNumber(durationOption) && !isString(durationOption)) { console.error("MUI: Argument \"duration\" must be a number or a string but found ".concat(durationOption, ".")); } if (!isString(easingOption)) { console.error('MUI: Argument "easing" must be a string.'); } if (!isNumber(delay) && !isString(delay)) { console.error('MUI: Argument "delay" must be a number or a string.'); } if (_typeof(options) !== 'object') { console.error(['MUI: Secong argument of transition.create must be an object.', "Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join('\n')); } if (Object.keys(other).length !== 0) { console.error("MUI: Unrecognized argument(s) [".concat(Object.keys(other).join(','), "].")); } } return (Array.isArray(props) ? props : [props]).map(function (animatedProp) { return "".concat(animatedProp, " ").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), " ").concat(easingOption, " ").concat(typeof delay === 'string' ? delay : formatMs(delay)); }).join(','); }; return _extends({ getAutoHeightDuration: getAutoHeightDuration, create: create }, inputTransitions, { easing: mergedEasing, duration: mergedDuration }); } // We need to centralize the zIndex definitions as they work // like global values in the browser. var zIndex = { mobileStepper: 1000, fab: 1050, speedDial: 1050, appBar: 1100, drawer: 1200, modal: 1300, snackbar: 1400, tooltip: 1500 }; var zIndex$1 = zIndex; function createTheme() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; options.breakpoints; var _options$mixins = options.mixins, mixinsInput = _options$mixins === void 0 ? {} : _options$mixins; options.spacing; var _options$palette = options.palette, paletteInput = _options$palette === void 0 ? {} : _options$palette, _options$transitions = options.transitions, transitionsInput = _options$transitions === void 0 ? {} : _options$transitions, _options$typography = options.typography, typographyInput = _options$typography === void 0 ? {} : _options$typography; options.shape; var other = _objectWithoutProperties(options, ["breakpoints", "mixins", "spacing", "palette", "transitions", "typography", "shape"]); if (options.vars) { throw new Error("MUI: `vars` is a private field used for CSS variables support.\nPlease use another name." ); } var palette = createPalette(paletteInput); var systemTheme = createTheme$1(options); var muiTheme = deepmerge(systemTheme, { mixins: createMixins(systemTheme.breakpoints, mixinsInput), palette: palette, // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol. shadows: shadows$1.slice(), typography: createTypography(palette, typographyInput), transitions: createTransitions(transitionsInput), zIndex: _extends({}, zIndex$1) }); muiTheme = deepmerge(muiTheme, other); for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } muiTheme = args.reduce(function (acc, argument) { return deepmerge(acc, argument); }, muiTheme); { // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component. var stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected']; var traverse = function traverse(node, component) { var key; // eslint-disable-next-line guard-for-in, no-restricted-syntax for (key in node) { var child = node[key]; if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) { { var stateClass = generateUtilityClass$1('', key); console.error(["MUI: The `".concat(component, "` component increases ") + "the CSS specificity of the `".concat(key, "` internal state."), 'You can not override it like this: ', JSON.stringify(node, null, 2), '', "Instead, you need to use the '&.".concat(stateClass, "' syntax:"), JSON.stringify({ root: _defineProperty({}, "&.".concat(stateClass), child) }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\n')); } // Remove the style to prevent global conflicts. node[key] = {}; } } }; Object.keys(muiTheme.components).forEach(function (component) { var styleOverrides = muiTheme.components[component].styleOverrides; if (styleOverrides && component.indexOf('Mui') === 0) { traverse(styleOverrides, component); } }); } muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig$1, other == null ? void 0 : other.unstable_sxConfig); muiTheme.unstable_sx = function sx(props) { return styleFunctionSx$1({ sx: props, theme: this }); }; return muiTheme; } var warnedOnce$1 = false; function createMuiTheme() { { if (!warnedOnce$1) { warnedOnce$1 = true; console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', "You should use `import { createTheme } from '@mui/material/styles'`"].join('\n')); } } return createTheme.apply(void 0, arguments); } function createMuiStrictModeTheme(options) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return createTheme.apply(void 0, [deepmerge({ unstable_strictMode: true }, options)].concat(args)); } var warnedOnce = false; // To remove in v6 function createStyles(styles) { if (!warnedOnce) { console.warn(['MUI: createStyles from @mui/material/styles is deprecated.', 'Please use @mui/styles/createStyles'].join('\n')); warnedOnce = true; } return styles; } function isUnitless(value) { return String(parseFloat(value)).length === String(value).length; } // Ported from Compass // https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss // Emulate the sass function "unit" function getUnit(input) { return String(input).match(/[\d.\-+]*\s*(.*)/)[1] || ''; } // Emulate the sass function "unitless" function toUnitless(length) { return parseFloat(length); } // Convert any CSS or value to any another. // From https://github.com/KyleAMathews/convert-css-length function convertLength(baseFontSize) { return function (length, toUnit) { var fromUnit = getUnit(length); // Optimize for cases where `from` and `to` units are accidentally the same. if (fromUnit === toUnit) { return length; } // Convert input length to pixels. var pxLength = toUnitless(length); if (fromUnit !== 'px') { if (fromUnit === 'em') { pxLength = toUnitless(length) * toUnitless(baseFontSize); } else if (fromUnit === 'rem') { pxLength = toUnitless(length) * toUnitless(baseFontSize); } } // Convert length in pixels to the output unit var outputLength = pxLength; if (toUnit !== 'px') { if (toUnit === 'em') { outputLength = pxLength / toUnitless(baseFontSize); } else if (toUnit === 'rem') { outputLength = pxLength / toUnitless(baseFontSize); } else { return length; } } return parseFloat(outputLength.toFixed(5)) + toUnit; }; } function alignProperty(_ref) { var size = _ref.size, grid = _ref.grid; var sizeBelow = size - size % grid; var sizeAbove = sizeBelow + grid; return size - sizeBelow < sizeAbove - size ? sizeBelow : sizeAbove; } // fontGrid finds a minimal grid (in rem) for the fontSize values so that the // lineHeight falls under a x pixels grid, 4px in the case of Material Design, // without changing the relative line height function fontGrid(_ref2) { var lineHeight = _ref2.lineHeight, pixels = _ref2.pixels, htmlFontSize = _ref2.htmlFontSize; return pixels / (lineHeight * htmlFontSize); } /** * generate a responsive version of a given CSS property * @example * responsiveProperty({ * cssProperty: 'fontSize', * min: 15, * max: 20, * unit: 'px', * breakpoints: [300, 600], * }) * * // this returns * * { * fontSize: '15px', * '@media (min-width:300px)': { * fontSize: '17.5px', * }, * '@media (min-width:600px)': { * fontSize: '20px', * }, * } * @param {Object} params * @param {string} params.cssProperty - The CSS property to be made responsive * @param {number} params.min - The smallest value of the CSS property * @param {number} params.max - The largest value of the CSS property * @param {string} [params.unit] - The unit to be used for the CSS property * @param {Array.number} [params.breakpoints] - An array of breakpoints * @param {number} [params.alignStep] - Round scaled value to fall under this grid * @returns {Object} responsive styles for {params.cssProperty} */ function responsiveProperty(_ref3) { var cssProperty = _ref3.cssProperty, min = _ref3.min, max = _ref3.max, _ref3$unit = _ref3.unit, unit = _ref3$unit === void 0 ? 'rem' : _ref3$unit, _ref3$breakpoints = _ref3.breakpoints, breakpoints = _ref3$breakpoints === void 0 ? [600, 900, 1200] : _ref3$breakpoints, _ref3$transform = _ref3.transform, transform = _ref3$transform === void 0 ? null : _ref3$transform; var output = _defineProperty({}, cssProperty, "".concat(min).concat(unit)); var factor = (max - min) / breakpoints[breakpoints.length - 1]; breakpoints.forEach(function (breakpoint) { var value = min + factor * breakpoint; if (transform !== null) { value = transform(value); } output["@media (min-width:".concat(breakpoint, "px)")] = _defineProperty({}, cssProperty, "".concat(Math.round(value * 10000) / 10000).concat(unit)); }); return output; } function responsiveFontSizes(themeInput) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _options$breakpoints = options.breakpoints, breakpoints = _options$breakpoints === void 0 ? ['sm', 'md', 'lg'] : _options$breakpoints, _options$disableAlign = options.disableAlign, disableAlign = _options$disableAlign === void 0 ? false : _options$disableAlign, _options$factor = options.factor, factor = _options$factor === void 0 ? 2 : _options$factor, _options$variants = options.variants, variants = _options$variants === void 0 ? ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline'] : _options$variants; var theme = _extends({}, themeInput); theme.typography = _extends({}, theme.typography); var typography = theme.typography; // Convert between CSS lengths e.g. em->px or px->rem // Set the baseFontSize for your project. Defaults to 16px (also the browser default). var convert = convertLength(typography.htmlFontSize); var breakpointValues = breakpoints.map(function (x) { return theme.breakpoints.values[x]; }); variants.forEach(function (variant) { var style = typography[variant]; var remFontSize = parseFloat(convert(style.fontSize, 'rem')); if (remFontSize <= 1) { return; } var maxFontSize = remFontSize; var minFontSize = 1 + (maxFontSize - 1) / factor; var lineHeight = style.lineHeight; if (!isUnitless(lineHeight) && !disableAlign) { throw new Error("MUI: Unsupported non-unitless line height with grid alignment.\nUse unitless line heights instead." ); } if (!isUnitless(lineHeight)) { // make it unitless lineHeight = parseFloat(convert(lineHeight, 'rem')) / parseFloat(remFontSize); } var transform = null; if (!disableAlign) { transform = function transform(value) { return alignProperty({ size: value, grid: fontGrid({ pixels: 4, lineHeight: lineHeight, htmlFontSize: typography.htmlFontSize }) }); }; } typography[variant] = _extends({}, style, responsiveProperty({ cssProperty: 'fontSize', min: minFontSize, max: maxFontSize, unit: 'rem', breakpoints: breakpointValues, transform: transform })); }); return theme; } var defaultTheme$2 = createTheme(); var defaultTheme$3 = defaultTheme$2; function useTheme() { var theme = useTheme$2(defaultTheme$3); { // eslint-disable-next-line react-hooks/rules-of-hooks React__namespace.useDebugValue(theme); } return theme[THEME_ID] || theme; } function useThemeProps$b(_ref) { var props = _ref.props, name = _ref.name; return useThemeProps$c({ props: props, name: name, defaultTheme: defaultTheme$3, themeId: THEME_ID }); } // copied from @mui/system/createStyled function slotShouldForwardProp(prop) { return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as'; } var rootShouldForwardProp = function rootShouldForwardProp(prop) { return slotShouldForwardProp(prop) && prop !== 'classes'; }; var rootShouldForwardProp$1 = rootShouldForwardProp; var styled = createStyled({ themeId: THEME_ID, defaultTheme: defaultTheme$3, rootShouldForwardProp: rootShouldForwardProp$1 }); var styled$1 = styled; function ThemeProvider(_ref) { var themeInput = _ref.theme, props = _objectWithoutProperties(_ref, ["theme"]); var scopedTheme = themeInput[THEME_ID]; return /*#__PURE__*/jsxRuntime_1(ThemeProvider$1, _extends({}, props, { themeId: scopedTheme ? THEME_ID : undefined, theme: scopedTheme || themeInput })); } ThemeProvider.propTypes = { /** * Your component tree. */ children: PropTypes.node, /** * A theme object. You can provide a function to extend the outer theme. */ theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired } ; function makeStyles() { throw new Error("MUI: makeStyles is no longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." ); } function withStyles() { throw new Error("MUI: withStyles is no longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." ); } function withTheme() { throw new Error("MUI: withTheme is no longer exported from @mui/material/styles.\nYou have to import it from @mui/styles.\nSee https://mui.com/r/migration-v4/#mui-material-styles for more details." ); } function shouldSkipGeneratingVar(keys) { var _keys$; return !!keys[0].match(/(cssVarPrefix|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) || // ends with sxConfig keys[0] === 'palette' && !!((_keys$ = keys[1]) != null && _keys$.match(/(mode|contrastThreshold|tonalOffset)/)); } // Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61 var getOverlayAlpha = function getOverlayAlpha(elevation) { var alphaValue; if (elevation < 1) { alphaValue = 5.11916 * Math.pow(elevation, 2); } else { alphaValue = 4.5 * Math.log(elevation + 1) + 2; } return (alphaValue / 100).toFixed(2); }; var getOverlayAlpha$1 = getOverlayAlpha; var defaultDarkOverlays = _toConsumableArray(Array(25)).map(function (_, index) { if (index === 0) { return undefined; } var overlay = getOverlayAlpha$1(index); return "linear-gradient(rgba(255 255 255 / ".concat(overlay, "), rgba(255 255 255 / ").concat(overlay, "))"); }); function assignNode(obj, keys) { keys.forEach(function (k) { if (!obj[k]) { obj[k] = {}; } }); } function setColor(obj, key, defaultValue) { if (!obj[key] && defaultValue) { obj[key] = defaultValue; } } function toRgb(color) { if (!color || !color.startsWith('hsl')) { return color; } return hslToRgb(color); } function setColorChannel(obj, key) { if (!("".concat(key, "Channel") in obj)) { // custom channel token is not provided, generate one. // if channel token can't be generated, show a warning. obj["".concat(key, "Channel")] = private_safeColorChannel(toRgb(obj[key]), "MUI: Can't create `palette.".concat(key, "Channel` because `palette.").concat(key, "` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().") + '\n' + "To suppress this warning, you need to explicitly provide the `palette.".concat(key, "Channel` as a string (in rgb format, for example \"12 12 12\") or undefined if you want to remove the channel token.")); } } var silent = function silent(fn) { try { return fn(); } catch (error) { // ignore error } return undefined; }; var createGetCssVar = function createGetCssVar() { var cssVarPrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'mui'; return createGetCssVar$1(cssVarPrefix); }; function extendTheme() { var _colorSchemesInput$li, _colorSchemesInput$da, _colorSchemesInput$li2, _colorSchemesInput$li3, _colorSchemesInput$da2, _colorSchemesInput$da3; var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$colorSchemes = options.colorSchemes, colorSchemesInput = _options$colorSchemes === void 0 ? {} : _options$colorSchemes, _options$cssVarPrefix = options.cssVarPrefix, cssVarPrefix = _options$cssVarPrefix === void 0 ? 'mui' : _options$cssVarPrefix, _options$shouldSkipGe = options.shouldSkipGeneratingVar, shouldSkipGeneratingVar$1 = _options$shouldSkipGe === void 0 ? shouldSkipGeneratingVar : _options$shouldSkipGe, input = _objectWithoutProperties(options, ["colorSchemes", "cssVarPrefix", "shouldSkipGeneratingVar"]); var getCssVar = createGetCssVar(cssVarPrefix); var _createThemeWithoutVa = createTheme(_extends({}, input, colorSchemesInput.light && { palette: (_colorSchemesInput$li = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li.palette })), lightPalette = _createThemeWithoutVa.palette, muiTheme = _objectWithoutProperties(_createThemeWithoutVa, ["palette"]); var _createThemeWithoutVa2 = createTheme({ palette: _extends({ mode: 'dark' }, (_colorSchemesInput$da = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da.palette) }), darkPalette = _createThemeWithoutVa2.palette; var theme = _extends({}, muiTheme, { cssVarPrefix: cssVarPrefix, getCssVar: getCssVar, colorSchemes: _extends({}, colorSchemesInput, { light: _extends({}, colorSchemesInput.light, { palette: lightPalette, opacity: _extends({ inputPlaceholder: 0.42, inputUnderline: 0.42, switchTrackDisabled: 0.12, switchTrack: 0.38 }, (_colorSchemesInput$li2 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li2.opacity), overlays: ((_colorSchemesInput$li3 = colorSchemesInput.light) == null ? void 0 : _colorSchemesInput$li3.overlays) || [] }), dark: _extends({}, colorSchemesInput.dark, { palette: darkPalette, opacity: _extends({ inputPlaceholder: 0.5, inputUnderline: 0.7, switchTrackDisabled: 0.2, switchTrack: 0.3 }, (_colorSchemesInput$da2 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da2.opacity), overlays: ((_colorSchemesInput$da3 = colorSchemesInput.dark) == null ? void 0 : _colorSchemesInput$da3.overlays) || defaultDarkOverlays }) }) }); Object.keys(theme.colorSchemes).forEach(function (key) { var palette = theme.colorSchemes[key].palette; var setCssVarColor = function setCssVarColor(cssVar) { var tokens = cssVar.split('-'); var color = tokens[1]; var colorToken = tokens[2]; return getCssVar(cssVar, palette[color][colorToken]); }; // attach black & white channels to common node if (key === 'light') { setColor(palette.common, 'background', '#fff'); setColor(palette.common, 'onBackground', '#000'); } else { setColor(palette.common, 'background', '#000'); setColor(palette.common, 'onBackground', '#fff'); } // assign component variables assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']); if (key === 'light') { setColor(palette.Alert, 'errorColor', private_safeDarken(palette.error.light, 0.6)); setColor(palette.Alert, 'infoColor', private_safeDarken(palette.info.light, 0.6)); setColor(palette.Alert, 'successColor', private_safeDarken(palette.success.light, 0.6)); setColor(palette.Alert, 'warningColor', private_safeDarken(palette.warning.light, 0.6)); setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-main')); setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-main')); setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-main')); setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-main')); setColor(palette.Alert, 'errorFilledColor', silent(function () { return lightPalette.getContrastText(palette.error.main); })); setColor(palette.Alert, 'infoFilledColor', silent(function () { return lightPalette.getContrastText(palette.info.main); })); setColor(palette.Alert, 'successFilledColor', silent(function () { return lightPalette.getContrastText(palette.success.main); })); setColor(palette.Alert, 'warningFilledColor', silent(function () { return lightPalette.getContrastText(palette.warning.main); })); setColor(palette.Alert, 'errorStandardBg', private_safeLighten(palette.error.light, 0.9)); setColor(palette.Alert, 'infoStandardBg', private_safeLighten(palette.info.light, 0.9)); setColor(palette.Alert, 'successStandardBg', private_safeLighten(palette.success.light, 0.9)); setColor(palette.Alert, 'warningStandardBg', private_safeLighten(palette.warning.light, 0.9)); setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main')); setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main')); setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main')); setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main')); setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-100')); setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-400')); setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-300')); setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-A100')); setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-400')); setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-700')); setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-700')); setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)'); setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)'); setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)'); setColor(palette.LinearProgress, 'primaryBg', private_safeLighten(palette.primary.main, 0.62)); setColor(palette.LinearProgress, 'secondaryBg', private_safeLighten(palette.secondary.main, 0.62)); setColor(palette.LinearProgress, 'errorBg', private_safeLighten(palette.error.main, 0.62)); setColor(palette.LinearProgress, 'infoBg', private_safeLighten(palette.info.main, 0.62)); setColor(palette.LinearProgress, 'successBg', private_safeLighten(palette.success.main, 0.62)); setColor(palette.LinearProgress, 'warningBg', private_safeLighten(palette.warning.main, 0.62)); setColor(palette.Skeleton, 'bg', "rgba(".concat(setCssVarColor('palette-text-primaryChannel'), " / 0.11)")); setColor(palette.Slider, 'primaryTrack', private_safeLighten(palette.primary.main, 0.62)); setColor(palette.Slider, 'secondaryTrack', private_safeLighten(palette.secondary.main, 0.62)); setColor(palette.Slider, 'errorTrack', private_safeLighten(palette.error.main, 0.62)); setColor(palette.Slider, 'infoTrack', private_safeLighten(palette.info.main, 0.62)); setColor(palette.Slider, 'successTrack', private_safeLighten(palette.success.main, 0.62)); setColor(palette.Slider, 'warningTrack', private_safeLighten(palette.warning.main, 0.62)); var snackbarContentBackground = private_safeEmphasize(palette.background["default"], 0.8); setColor(palette.SnackbarContent, 'bg', snackbarContentBackground); setColor(palette.SnackbarContent, 'color', silent(function () { return lightPalette.getContrastText(snackbarContentBackground); })); setColor(palette.SpeedDialAction, 'fabHoverBg', private_safeEmphasize(palette.background.paper, 0.15)); setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-400')); setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-400')); setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-common-white')); setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-100')); setColor(palette.Switch, 'primaryDisabledColor', private_safeLighten(palette.primary.main, 0.62)); setColor(palette.Switch, 'secondaryDisabledColor', private_safeLighten(palette.secondary.main, 0.62)); setColor(palette.Switch, 'errorDisabledColor', private_safeLighten(palette.error.main, 0.62)); setColor(palette.Switch, 'infoDisabledColor', private_safeLighten(palette.info.main, 0.62)); setColor(palette.Switch, 'successDisabledColor', private_safeLighten(palette.success.main, 0.62)); setColor(palette.Switch, 'warningDisabledColor', private_safeLighten(palette.warning.main, 0.62)); setColor(palette.TableCell, 'border', private_safeLighten(private_safeAlpha(palette.divider, 1), 0.88)); setColor(palette.Tooltip, 'bg', private_safeAlpha(palette.grey[700], 0.92)); } else { setColor(palette.Alert, 'errorColor', private_safeLighten(palette.error.light, 0.6)); setColor(palette.Alert, 'infoColor', private_safeLighten(palette.info.light, 0.6)); setColor(palette.Alert, 'successColor', private_safeLighten(palette.success.light, 0.6)); setColor(palette.Alert, 'warningColor', private_safeLighten(palette.warning.light, 0.6)); setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-dark')); setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-dark')); setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-dark')); setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-dark')); setColor(palette.Alert, 'errorFilledColor', silent(function () { return darkPalette.getContrastText(palette.error.dark); })); setColor(palette.Alert, 'infoFilledColor', silent(function () { return darkPalette.getContrastText(palette.info.dark); })); setColor(palette.Alert, 'successFilledColor', silent(function () { return darkPalette.getContrastText(palette.success.dark); })); setColor(palette.Alert, 'warningFilledColor', silent(function () { return darkPalette.getContrastText(palette.warning.dark); })); setColor(palette.Alert, 'errorStandardBg', private_safeDarken(palette.error.light, 0.9)); setColor(palette.Alert, 'infoStandardBg', private_safeDarken(palette.info.light, 0.9)); setColor(palette.Alert, 'successStandardBg', private_safeDarken(palette.success.light, 0.9)); setColor(palette.Alert, 'warningStandardBg', private_safeDarken(palette.warning.light, 0.9)); setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main')); setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main')); setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main')); setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main')); setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-900')); setColor(palette.AppBar, 'darkBg', setCssVarColor('palette-background-paper')); // specific for dark mode setColor(palette.AppBar, 'darkColor', setCssVarColor('palette-text-primary')); // specific for dark mode setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-600')); setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-800')); setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-700')); setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-700')); setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-300')); setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-300')); setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)'); setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)'); setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)'); setColor(palette.LinearProgress, 'primaryBg', private_safeDarken(palette.primary.main, 0.5)); setColor(palette.LinearProgress, 'secondaryBg', private_safeDarken(palette.secondary.main, 0.5)); setColor(palette.LinearProgress, 'errorBg', private_safeDarken(palette.error.main, 0.5)); setColor(palette.LinearProgress, 'infoBg', private_safeDarken(palette.info.main, 0.5)); setColor(palette.LinearProgress, 'successBg', private_safeDarken(palette.success.main, 0.5)); setColor(palette.LinearProgress, 'warningBg', private_safeDarken(palette.warning.main, 0.5)); setColor(palette.Skeleton, 'bg', "rgba(".concat(setCssVarColor('palette-text-primaryChannel'), " / 0.13)")); setColor(palette.Slider, 'primaryTrack', private_safeDarken(palette.primary.main, 0.5)); setColor(palette.Slider, 'secondaryTrack', private_safeDarken(palette.secondary.main, 0.5)); setColor(palette.Slider, 'errorTrack', private_safeDarken(palette.error.main, 0.5)); setColor(palette.Slider, 'infoTrack', private_safeDarken(palette.info.main, 0.5)); setColor(palette.Slider, 'successTrack', private_safeDarken(palette.success.main, 0.5)); setColor(palette.Slider, 'warningTrack', private_safeDarken(palette.warning.main, 0.5)); var _snackbarContentBackground = private_safeEmphasize(palette.background["default"], 0.98); setColor(palette.SnackbarContent, 'bg', _snackbarContentBackground); setColor(palette.SnackbarContent, 'color', silent(function () { return darkPalette.getContrastText(_snackbarContentBackground); })); setColor(palette.SpeedDialAction, 'fabHoverBg', private_safeEmphasize(palette.background.paper, 0.15)); setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-600')); setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-600')); setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-grey-300')); setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-600')); setColor(palette.Switch, 'primaryDisabledColor', private_safeDarken(palette.primary.main, 0.55)); setColor(palette.Switch, 'secondaryDisabledColor', private_safeDarken(palette.secondary.main, 0.55)); setColor(palette.Switch, 'errorDisabledColor', private_safeDarken(palette.error.main, 0.55)); setColor(palette.Switch, 'infoDisabledColor', private_safeDarken(palette.info.main, 0.55)); setColor(palette.Switch, 'successDisabledColor', private_safeDarken(palette.success.main, 0.55)); setColor(palette.Switch, 'warningDisabledColor', private_safeDarken(palette.warning.main, 0.55)); setColor(palette.TableCell, 'border', private_safeDarken(private_safeAlpha(palette.divider, 1), 0.68)); setColor(palette.Tooltip, 'bg', private_safeAlpha(palette.grey[700], 0.92)); } // MUI X - DataGrid needs this token. setColorChannel(palette.background, 'default'); // added for consistency with the `background.default` token setColorChannel(palette.background, 'paper'); setColorChannel(palette.common, 'background'); setColorChannel(palette.common, 'onBackground'); setColorChannel(palette, 'divider'); Object.keys(palette).forEach(function (color) { var colors = palette[color]; // The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`. if (colors && _typeof(colors) === 'object') { // Silent the error for custom palettes. if (colors.main) { setColor(palette[color], 'mainChannel', private_safeColorChannel(toRgb(colors.main))); } if (colors.light) { setColor(palette[color], 'lightChannel', private_safeColorChannel(toRgb(colors.light))); } if (colors.dark) { setColor(palette[color], 'darkChannel', private_safeColorChannel(toRgb(colors.dark))); } if (colors.contrastText) { setColor(palette[color], 'contrastTextChannel', private_safeColorChannel(toRgb(colors.contrastText))); } if (color === 'text') { // Text colors: text.primary, text.secondary setColorChannel(palette[color], 'primary'); setColorChannel(palette[color], 'secondary'); } if (color === 'action') { // Action colors: action.active, action.selected if (colors.active) { setColorChannel(palette[color], 'active'); } if (colors.selected) { setColorChannel(palette[color], 'selected'); } } } }); }); for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } theme = args.reduce(function (acc, argument) { return deepmerge(acc, argument); }, theme); var parserConfig = { prefix: cssVarPrefix, shouldSkipGeneratingVar: shouldSkipGeneratingVar$1 }; var _prepareCssVars = prepareCssVars(theme, parserConfig), themeVars = _prepareCssVars.vars, generateCssVars = _prepareCssVars.generateCssVars; theme.vars = themeVars; theme.generateCssVars = generateCssVars; theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar$1; theme.unstable_sxConfig = _extends({}, defaultSxConfig$1, input == null ? void 0 : input.unstable_sxConfig); theme.unstable_sx = function sx(props) { return styleFunctionSx$1({ sx: props, theme: this }); }; return theme; } /** * @internal These variables should not appear in the :root stylesheet when the `defaultMode="dark"` */ var excludeVariablesFromRoot = function excludeVariablesFromRoot(cssVarPrefix) { return [].concat(_toConsumableArray(_toConsumableArray(Array(24)).map(function (_, index) { return "--".concat(cssVarPrefix ? "".concat(cssVarPrefix, "-") : '', "overlays-").concat(index + 1); })), ["--".concat(cssVarPrefix ? "".concat(cssVarPrefix, "-") : '', "palette-AppBar-darkBg"), "--".concat(cssVarPrefix ? "".concat(cssVarPrefix, "-") : '', "palette-AppBar-darkColor")]); }; var excludeVariablesFromRoot$1 = excludeVariablesFromRoot; var defaultTheme$1 = extendTheme(); var _createCssVarsProvide = createCssVarsProvider({ themeId: THEME_ID, theme: defaultTheme$1, attribute: 'data-mui-color-scheme', modeStorageKey: 'mui-mode', colorSchemeStorageKey: 'mui-color-scheme', defaultColorScheme: { light: 'light', dark: 'dark' }, resolveTheme: function resolveTheme(theme) { var newTheme = _extends({}, theme, { typography: createTypography(theme.palette, theme.typography) }); newTheme.unstable_sx = function sx(props) { return styleFunctionSx$1({ sx: props, theme: this }); }; return newTheme; }, excludeVariablesFromRoot: excludeVariablesFromRoot$1 }), CssVarsProvider = _createCssVarsProvide.CssVarsProvider, useColorScheme = _createCssVarsProvide.useColorScheme, getInitColorSchemeScript = _createCssVarsProvide.getInitColorSchemeScript; // TODO: Remove this function in v6. // eslint-disable-next-line @typescript-eslint/naming-convention function experimental_sx() { throw new Error("MUI: The `experimental_sx` has been moved to `theme.unstable_sx`.For more details, see https://github.com/mui/material-ui/pull/35150." ); } function getSvgIconUtilityClass(slot) { return generateUtilityClass$1('MuiSvgIcon', slot); } var svgIconClasses = generateUtilityClasses$1('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']); var svgIconClasses$1 = svgIconClasses; var useUtilityClasses$1P = function useUtilityClasses(ownerState) { var color = ownerState.color, fontSize = ownerState.fontSize, classes = ownerState.classes; var slots = { root: ['root', color !== 'inherit' && "color".concat(capitalize(color)), "fontSize".concat(capitalize(fontSize))] }; return composeClasses(slots, getSvgIconUtilityClass, classes); }; var SvgIconRoot = styled$1('svg', { name: 'MuiSvgIcon', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [styles.root, ownerState.color !== 'inherit' && styles["color".concat(capitalize(ownerState.color))], styles["fontSize".concat(capitalize(ownerState.fontSize))]]; } })(function (_ref) { var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3; var theme = _ref.theme, ownerState = _ref.ownerState; return { userSelect: 'none', width: '1em', height: '1em', display: 'inline-block', // the will define the property that has `currentColor` // for example heroicons uses fill="none" and stroke="currentColor" fill: ownerState.hasSvgAsChild ? undefined : 'currentColor', flexShrink: 0, transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', { duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter }), fontSize: { inherit: 'inherit', small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem', medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem', large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem' }[ownerState.fontSize], // TODO v5 deprecate, v6 remove for sx color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : { action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active, disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled, inherit: undefined }[ownerState.color] }; }); var SvgIcon = /*#__PURE__*/React__namespace.forwardRef(function SvgIcon(inProps, ref) { var props = useThemeProps$b({ props: inProps, name: 'MuiSvgIcon' }); var children = props.children, className = props.className, _props$color = props.color, color = _props$color === void 0 ? 'inherit' : _props$color, _props$component = props.component, component = _props$component === void 0 ? 'svg' : _props$component, _props$fontSize = props.fontSize, fontSize = _props$fontSize === void 0 ? 'medium' : _props$fontSize, htmlColor = props.htmlColor, _props$inheritViewBox = props.inheritViewBox, inheritViewBox = _props$inheritViewBox === void 0 ? false : _props$inheritViewBox, titleAccess = props.titleAccess, _props$viewBox = props.viewBox, viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox, other = _objectWithoutProperties(props, ["children", "className", "color", "component", "fontSize", "htmlColor", "inheritViewBox", "titleAccess", "viewBox"]); var hasSvgAsChild = /*#__PURE__*/React__namespace.isValidElement(children) && children.type === 'svg'; var ownerState = _extends({}, props, { color: color, component: component, fontSize: fontSize, instanceFontSize: inProps.fontSize, inheritViewBox: inheritViewBox, viewBox: viewBox, hasSvgAsChild: hasSvgAsChild }); var more = {}; if (!inheritViewBox) { more.viewBox = viewBox; } var classes = useUtilityClasses$1P(ownerState); return /*#__PURE__*/jsxRuntime_2(SvgIconRoot, _extends({ as: component, className: clsx(classes.root, className), focusable: "false", color: htmlColor, "aria-hidden": titleAccess ? undefined : true, role: titleAccess ? 'img' : undefined, ref: ref }, more, other, hasSvgAsChild && children.props, { ownerState: ownerState, children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/jsxRuntime_1("title", { children: titleAccess }) : null] })); }); SvgIcon.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * Node passed into the SVG element. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The color of the component. * It supports both default and custom theme colors, which can be added as shown in the * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors). * You can use the `htmlColor` prop to apply a color attribute to the SVG element. * @default 'inherit' */ color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]), /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: PropTypes.elementType, /** * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size. * @default 'medium' */ fontSize: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]), /** * Applies a color attribute to the SVG element. */ htmlColor: PropTypes.string, /** * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox` * prop will be ignored. * Useful when you want to reference a custom `component` and have `SvgIcon` pass that * `component`'s viewBox to the root node. * @default false */ inheritViewBox: PropTypes.bool, /** * The shape-rendering attribute. The behavior of the different options is described on the * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering). * If you are having issues with blurry icons you should investigate this prop. */ shapeRendering: PropTypes.string, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]), /** * Provides a human-readable title for the element that contains it. * https://www.w3.org/TR/SVG-access/#Equivalent */ titleAccess: PropTypes.string, /** * Allows you to redefine what the coordinates without units mean inside an SVG element. * For example, if the SVG element is 500 (width) by 200 (height), * and you pass viewBox="0 0 50 20", * this means that the coordinates inside the SVG will go from the top left corner (0,0) * to bottom right (50,20) and each unit will be worth 10px. * @default '0 0 24 24' */ viewBox: PropTypes.string } ; SvgIcon.muiName = 'SvgIcon'; var SvgIcon$1 = SvgIcon; function createSvgIcon(path, displayName) { function Component(props, ref) { return /*#__PURE__*/jsxRuntime_1(SvgIcon$1, _extends({ "data-testid": "".concat(displayName, "Icon"), ref: ref }, props, { children: path })); } { // Need to set `displayName` on the inner component for React.memo. // React prior to 16.14 ignores `displayName` on the wrapper. Component.displayName = "".concat(displayName, "Icon"); } Component.muiName = SvgIcon$1.muiName; return /*#__PURE__*/React__namespace.memo( /*#__PURE__*/React__namespace.forwardRef(Component)); } // TODO: remove this export once ClassNameGenerator is stable // eslint-disable-next-line @typescript-eslint/naming-convention var unstable_ClassNameGenerator = { configure: function configure(generator) { { console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n')); } ClassNameGenerator$1.configure(generator); } }; function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); } // eslint-disable-next-line @typescript-eslint/no-unused-vars function createUseThemeProps(name) { return useThemeProps$b; } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } var config = { disabled: false }; var timeoutsShape = PropTypes.oneOfType([PropTypes.number, PropTypes.shape({ enter: PropTypes.number, exit: PropTypes.number, appear: PropTypes.number }).isRequired]) ; PropTypes.oneOfType([PropTypes.string, PropTypes.shape({ enter: PropTypes.string, exit: PropTypes.string, active: PropTypes.string }), PropTypes.shape({ enter: PropTypes.string, enterDone: PropTypes.string, enterActive: PropTypes.string, exit: PropTypes.string, exitDone: PropTypes.string, exitActive: PropTypes.string })]) ; var TransitionGroupContext = React.createContext(null); var forceReflow = function forceReflow(node) { return node.scrollTop; }; var UNMOUNTED = 'unmounted'; var EXITED = 'exited'; var ENTERING = 'entering'; var ENTERED = 'entered'; var EXITING = 'exiting'; /** * The Transition component lets you describe a transition from one component * state to another _over time_ with a simple declarative API. Most commonly * it's used to animate the mounting and unmounting of a component, but can also * be used to describe in-place transition states as well. * * --- * * **Note**: `Transition` is a platform-agnostic base component. If you're using * transitions in CSS, you'll probably want to use * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition) * instead. It inherits all the features of `Transition`, but contains * additional features necessary to play nice with CSS transitions (hence the * name of the component). * * --- * * By default the `Transition` component does not alter the behavior of the * component it renders, it only tracks "enter" and "exit" states for the * components. It's up to you to give meaning and effect to those states. For * example we can add styles to a component when it enters or exits: * * ```jsx * import { Transition } from 'react-transition-group'; * * const duration = 300; * * const defaultStyle = { * transition: `opacity ${duration}ms ease-in-out`, * opacity: 0, * } * * const transitionStyles = { * entering: { opacity: 1 }, * entered: { opacity: 1 }, * exiting: { opacity: 0 }, * exited: { opacity: 0 }, * }; * * const Fade = ({ in: inProp }) => ( * * {state => ( *
* I'm a fade Transition! *
* )} * * ); * ``` * * There are 4 main states a Transition can be in: * - `'entering'` * - `'entered'` * - `'exiting'` * - `'exited'` * * Transition state is toggled via the `in` prop. When `true` the component * begins the "Enter" stage. During this stage, the component will shift from * its current transition state, to `'entering'` for the duration of the * transition and then to the `'entered'` stage once it's complete. Let's take * the following example (we'll use the * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook): * * ```jsx * function App() { * const [inProp, setInProp] = useState(false); * return ( *
* * {state => ( * // ... * )} * * *
* ); * } * ``` * * When the button is clicked the component will shift to the `'entering'` state * and stay there for 500ms (the value of `timeout`) before it finally switches * to `'entered'`. * * When `in` is `false` the same thing happens except the state moves from * `'exiting'` to `'exited'`. */ var Transition = /*#__PURE__*/function (_React$Component) { _inheritsLoose(Transition, _React$Component); function Transition(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; var parentGroup = context; // In the context of a TransitionGroup all enters are really appears var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear; var initialStatus; _this.appearStatus = null; if (props.in) { if (appear) { initialStatus = EXITED; _this.appearStatus = ENTERING; } else { initialStatus = ENTERED; } } else { if (props.unmountOnExit || props.mountOnEnter) { initialStatus = UNMOUNTED; } else { initialStatus = EXITED; } } _this.state = { status: initialStatus }; _this.nextCallback = null; return _this; } Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) { var nextIn = _ref.in; if (nextIn && prevState.status === UNMOUNTED) { return { status: EXITED }; } return null; } // getSnapshotBeforeUpdate(prevProps) { // let nextStatus = null // if (prevProps !== this.props) { // const { status } = this.state // if (this.props.in) { // if (status !== ENTERING && status !== ENTERED) { // nextStatus = ENTERING // } // } else { // if (status === ENTERING || status === ENTERED) { // nextStatus = EXITING // } // } // } // return { nextStatus } // } ; var _proto = Transition.prototype; _proto.componentDidMount = function componentDidMount() { this.updateStatus(true, this.appearStatus); }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { var nextStatus = null; if (prevProps !== this.props) { var status = this.state.status; if (this.props.in) { if (status !== ENTERING && status !== ENTERED) { nextStatus = ENTERING; } } else { if (status === ENTERING || status === ENTERED) { nextStatus = EXITING; } } } this.updateStatus(false, nextStatus); }; _proto.componentWillUnmount = function componentWillUnmount() { this.cancelNextCallback(); }; _proto.getTimeouts = function getTimeouts() { var timeout = this.props.timeout; var exit, enter, appear; exit = enter = appear = timeout; if (timeout != null && typeof timeout !== 'number') { exit = timeout.exit; enter = timeout.enter; // TODO: remove fallback for next major appear = timeout.appear !== undefined ? timeout.appear : enter; } return { exit: exit, enter: enter, appear: appear }; }; _proto.updateStatus = function updateStatus(mounting, nextStatus) { if (mounting === void 0) { mounting = false; } if (nextStatus !== null) { // nextStatus will always be ENTERING or EXITING. this.cancelNextCallback(); if (nextStatus === ENTERING) { if (this.props.unmountOnExit || this.props.mountOnEnter) { var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749 // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`. // To make the animation happen, we have to separate each rendering and avoid being processed as batched. if (node) forceReflow(node); } this.performEnter(mounting); } else { this.performExit(); } } else if (this.props.unmountOnExit && this.state.status === EXITED) { this.setState({ status: UNMOUNTED }); } }; _proto.performEnter = function performEnter(mounting) { var _this2 = this; var enter = this.props.enter; var appearing = this.context ? this.context.isMounting : mounting; var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing], maybeNode = _ref2[0], maybeAppearing = _ref2[1]; var timeouts = this.getTimeouts(); var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED // if we are mounting and running this it means appear _must_ be set if (!mounting && !enter || config.disabled) { this.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(maybeNode); }); return; } this.props.onEnter(maybeNode, maybeAppearing); this.safeSetState({ status: ENTERING }, function () { _this2.props.onEntering(maybeNode, maybeAppearing); _this2.onTransitionEnd(enterTimeout, function () { _this2.safeSetState({ status: ENTERED }, function () { _this2.props.onEntered(maybeNode, maybeAppearing); }); }); }); }; _proto.performExit = function performExit() { var _this3 = this; var exit = this.props.exit; var timeouts = this.getTimeouts(); var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED if (!exit || config.disabled) { this.safeSetState({ status: EXITED }, function () { _this3.props.onExited(maybeNode); }); return; } this.props.onExit(maybeNode); this.safeSetState({ status: EXITING }, function () { _this3.props.onExiting(maybeNode); _this3.onTransitionEnd(timeouts.exit, function () { _this3.safeSetState({ status: EXITED }, function () { _this3.props.onExited(maybeNode); }); }); }); }; _proto.cancelNextCallback = function cancelNextCallback() { if (this.nextCallback !== null) { this.nextCallback.cancel(); this.nextCallback = null; } }; _proto.safeSetState = function safeSetState(nextState, callback) { // This shouldn't be necessary, but there are weird race conditions with // setState callbacks and unmounting in testing, so always make sure that // we can cancel any pending setState callbacks after we unmount. callback = this.setNextCallback(callback); this.setState(nextState, callback); }; _proto.setNextCallback = function setNextCallback(callback) { var _this4 = this; var active = true; this.nextCallback = function (event) { if (active) { active = false; _this4.nextCallback = null; callback(event); } }; this.nextCallback.cancel = function () { active = false; }; return this.nextCallback; }; _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) { this.setNextCallback(handler); var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener; if (!node || doesNotHaveTimeoutOrListener) { setTimeout(this.nextCallback, 0); return; } if (this.props.addEndListener) { var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback], maybeNode = _ref3[0], maybeNextCallback = _ref3[1]; this.props.addEndListener(maybeNode, maybeNextCallback); } if (timeout != null) { setTimeout(this.nextCallback, timeout); } }; _proto.render = function render() { var status = this.state.status; if (status === UNMOUNTED) { return null; } var _this$props = this.props, children = _this$props.children; _this$props.in; _this$props.mountOnEnter; _this$props.unmountOnExit; _this$props.appear; _this$props.enter; _this$props.exit; _this$props.timeout; _this$props.addEndListener; _this$props.onEnter; _this$props.onEntering; _this$props.onEntered; _this$props.onExit; _this$props.onExiting; _this$props.onExited; _this$props.nodeRef; var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]); return ( /*#__PURE__*/ // allows for nested Transitions React.createElement(TransitionGroupContext.Provider, { value: null }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps)) ); }; return Transition; }(React.Component); Transition.contextType = TransitionGroupContext; Transition.propTypes = { /** * A React reference to DOM element that need to transition: * https://stackoverflow.com/a/51127130/4671932 * * - When `nodeRef` prop is used, `node` is not passed to callback functions * (e.g. `onEnter`) because user already has direct access to the node. * - When changing `key` prop of `Transition` in a `TransitionGroup` a new * `nodeRef` need to be provided to `Transition` with changed `key` prop * (see * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). */ nodeRef: PropTypes.shape({ current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) { var value = propValue[key]; return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret); } }), /** * A `function` child can be used instead of a React element. This function is * called with the current transition status (`'entering'`, `'entered'`, * `'exiting'`, `'exited'`), which can be used to apply context * specific props to a component. * * ```jsx * * {state => ( * * )} * * ``` */ children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired, /** * Show the component; triggers the enter or exit states */ in: PropTypes.bool, /** * By default the child component is mounted immediately along with * the parent `Transition` component. If you want to "lazy mount" the component on the * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay * mounted, even on "exited", unless you also specify `unmountOnExit`. */ mountOnEnter: PropTypes.bool, /** * By default the child component stays mounted after it reaches the `'exited'` state. * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting. */ unmountOnExit: PropTypes.bool, /** * By default the child component does not perform the enter transition when * it first mounts, regardless of the value of `in`. If you want this * behavior, set both `appear` and `in` to `true`. * * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop * > only adds an additional enter transition. However, in the * > `` component that first enter transition does result in * > additional `.appear-*` classes, that way you can choose to style it * > differently. */ appear: PropTypes.bool, /** * Enable or disable enter transitions. */ enter: PropTypes.bool, /** * Enable or disable exit transitions. */ exit: PropTypes.bool, /** * The duration of the transition, in milliseconds. * Required unless `addEndListener` is provided. * * You may specify a single timeout for all transitions: * * ```jsx * timeout={500} * ``` * * or individually: * * ```jsx * timeout={{ * appear: 500, * enter: 300, * exit: 500, * }} * ``` * * - `appear` defaults to the value of `enter` * - `enter` defaults to `0` * - `exit` defaults to `0` * * @type {number | { enter?: number, exit?: number, appear?: number }} */ timeout: function timeout(props) { var pt = timeoutsShape; if (!props.addEndListener) pt = pt.isRequired; for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return pt.apply(void 0, [props].concat(args)); }, /** * Add a custom transition end trigger. Called with the transitioning * DOM node and a `done` callback. Allows for more fine grained transition end * logic. Timeouts are still used as a fallback if provided. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * ```jsx * addEndListener={(node, done) => { * // use the css transitionend event to mark the finish of a transition * node.addEventListener('transitionend', done, false); * }} * ``` */ addEndListener: PropTypes.func, /** * Callback fired before the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEnter: PropTypes.func, /** * Callback fired after the "entering" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) */ onEntering: PropTypes.func, /** * Callback fired after the "entered" status is applied. An extra parameter * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement, isAppearing: bool) -> void */ onEntered: PropTypes.func, /** * Callback fired before the "exiting" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement) -> void */ onExit: PropTypes.func, /** * Callback fired after the "exiting" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed. * * @type Function(node: HtmlElement) -> void */ onExiting: PropTypes.func, /** * Callback fired after the "exited" status is applied. * * **Note**: when `nodeRef` prop is passed, `node` is not passed * * @type Function(node: HtmlElement) -> void */ onExited: PropTypes.func } ; // Name the function so it is clearer in the documentation function noop() {} Transition.defaultProps = { in: false, mountOnEnter: false, unmountOnExit: false, appear: false, enter: true, exit: true, onEnter: noop, onEntering: noop, onEntered: noop, onExit: noop, onExiting: noop, onExited: noop }; Transition.UNMOUNTED = UNMOUNTED; Transition.EXITED = EXITED; Transition.ENTERING = ENTERING; Transition.ENTERED = ENTERED; Transition.EXITING = EXITING; var Transition$1 = Transition; function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /** * Given `this.props.children`, return an object mapping key to child. * * @param {*} children `this.props.children` * @return {object} Mapping of key to child */ function getChildMapping(children, mapFn) { var mapper = function mapper(child) { return mapFn && React.isValidElement(child) ? mapFn(child) : child; }; var result = Object.create(null); if (children) React.Children.map(children, function (c) { return c; }).forEach(function (child) { // run the map function here instead so that the key is the computed one result[child.key] = mapper(child); }); return result; } /** * When you're adding or removing children some may be added or removed in the * same render pass. We want to show *both* since we want to simultaneously * animate elements in and out. This function takes a previous set of keys * and a new set of keys and merges them with its best guess of the correct * ordering. In the future we may expose some of the utilities in * ReactMultiChild to make this easy, but for now React itself does not * directly have this concept of the union of prevChildren and nextChildren * so we implement it here. * * @param {object} prev prev children as returned from * `ReactTransitionChildMapping.getChildMapping()`. * @param {object} next next children as returned from * `ReactTransitionChildMapping.getChildMapping()`. * @return {object} a key set that contains all keys in `prev` and all keys * in `next` in a reasonable order. */ function mergeChildMappings(prev, next) { prev = prev || {}; next = next || {}; function getValueForKey(key) { return key in next ? next[key] : prev[key]; } // For each key of `next`, the list of keys to insert before that key in // the combined list var nextKeysPending = Object.create(null); var pendingKeys = []; for (var prevKey in prev) { if (prevKey in next) { if (pendingKeys.length) { nextKeysPending[prevKey] = pendingKeys; pendingKeys = []; } } else { pendingKeys.push(prevKey); } } var i; var childMapping = {}; for (var nextKey in next) { if (nextKeysPending[nextKey]) { for (i = 0; i < nextKeysPending[nextKey].length; i++) { var pendingNextKey = nextKeysPending[nextKey][i]; childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey); } } childMapping[nextKey] = getValueForKey(nextKey); } // Finally, add the keys which didn't appear before any key in `next` for (i = 0; i < pendingKeys.length; i++) { childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]); } return childMapping; } function getProp(child, prop, props) { return props[prop] != null ? props[prop] : child.props[prop]; } function getInitialChildMapping(props, onExited) { return getChildMapping(props.children, function (child) { return React.cloneElement(child, { onExited: onExited.bind(null, child), in: true, appear: getProp(child, 'appear', props), enter: getProp(child, 'enter', props), exit: getProp(child, 'exit', props) }); }); } function getNextChildMapping(nextProps, prevChildMapping, onExited) { var nextChildMapping = getChildMapping(nextProps.children); var children = mergeChildMappings(prevChildMapping, nextChildMapping); Object.keys(children).forEach(function (key) { var child = children[key]; if (!React.isValidElement(child)) return; var hasPrev = (key in prevChildMapping); var hasNext = (key in nextChildMapping); var prevChild = prevChildMapping[key]; var isLeaving = React.isValidElement(prevChild) && !prevChild.props.in; // item is new (entering) if (hasNext && (!hasPrev || isLeaving)) { // console.log('entering', key) children[key] = React.cloneElement(child, { onExited: onExited.bind(null, child), in: true, exit: getProp(child, 'exit', nextProps), enter: getProp(child, 'enter', nextProps) }); } else if (!hasNext && hasPrev && !isLeaving) { // item is old (exiting) // console.log('leaving', key) children[key] = React.cloneElement(child, { in: false }); } else if (hasNext && hasPrev && React.isValidElement(prevChild)) { // item hasn't changed transition states // copy over the last transition props; // console.log('unchanged', key) children[key] = React.cloneElement(child, { onExited: onExited.bind(null, child), in: prevChild.props.in, exit: getProp(child, 'exit', nextProps), enter: getProp(child, 'enter', nextProps) }); } }); return children; } var values = Object.values || function (obj) { return Object.keys(obj).map(function (k) { return obj[k]; }); }; var defaultProps = { component: 'div', childFactory: function childFactory(child) { return child; } }; /** * The `` component manages a set of transition components * (`` and ``) in a list. Like with the transition * components, `` is a state machine for managing the mounting * and unmounting of components over time. * * Consider the example below. As items are removed or added to the TodoList the * `in` prop is toggled automatically by the ``. * * Note that `` does not define any animation behavior! * Exactly _how_ a list item animates is up to the individual transition * component. This means you can mix and match animations across different list * items. */ var TransitionGroup = /*#__PURE__*/function (_React$Component) { _inheritsLoose(TransitionGroup, _React$Component); function TransitionGroup(props, context) { var _this; _this = _React$Component.call(this, props, context) || this; var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear _this.state = { contextValue: { isMounting: true }, handleExited: handleExited, firstRender: true }; return _this; } var _proto = TransitionGroup.prototype; _proto.componentDidMount = function componentDidMount() { this.mounted = true; this.setState({ contextValue: { isMounting: false } }); }; _proto.componentWillUnmount = function componentWillUnmount() { this.mounted = false; }; TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) { var prevChildMapping = _ref.children, handleExited = _ref.handleExited, firstRender = _ref.firstRender; return { children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited), firstRender: false }; } // node is `undefined` when user provided `nodeRef` prop ; _proto.handleExited = function handleExited(child, node) { var currentChildMapping = getChildMapping(this.props.children); if (child.key in currentChildMapping) return; if (child.props.onExited) { child.props.onExited(node); } if (this.mounted) { this.setState(function (state) { var children = _extends({}, state.children); delete children[child.key]; return { children: children }; }); } }; _proto.render = function render() { var _this$props = this.props, Component = _this$props.component, childFactory = _this$props.childFactory, props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]); var contextValue = this.state.contextValue; var children = values(this.state.children).map(childFactory); delete props.appear; delete props.enter; delete props.exit; if (Component === null) { return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, { value: contextValue }, children); } return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, { value: contextValue }, /*#__PURE__*/React.createElement(Component, props, children)); }; return TransitionGroup; }(React.Component); TransitionGroup.propTypes = { /** * `` renders a `
` by default. You can change this * behavior by providing a `component` prop. * If you use React v16+ and would like to avoid a wrapping `
` element * you can pass in `component={null}`. This is useful if the wrapping div * borks your css styles. */ component: PropTypes.any, /** * A set of `` components, that are toggled `in` and out as they * leave. the `` will inject specific transition props, so * remember to spread them through if you are wrapping the `` as * with our `` example. * * While this component is meant for multiple `Transition` or `CSSTransition` * children, sometimes you may want to have a single transition child with * content that you want to be transitioned out and in when you change it * (e.g. routes, images etc.) In that case you can change the `key` prop of * the transition child as you change its content, this will cause * `TransitionGroup` to transition the child out and back in. */ children: PropTypes.node, /** * A convenience prop that enables or disables appear animations * for all children. Note that specifying this will override any defaults set * on individual children Transitions. */ appear: PropTypes.bool, /** * A convenience prop that enables or disables enter animations * for all children. Note that specifying this will override any defaults set * on individual children Transitions. */ enter: PropTypes.bool, /** * A convenience prop that enables or disables exit animations * for all children. Note that specifying this will override any defaults set * on individual children Transitions. */ exit: PropTypes.bool, /** * You may need to apply reactive updates to a child as it is exiting. * This is generally done by using `cloneElement` however in the case of an exiting * child the element has already been removed and not accessible to the consumer. * * If you do need to update a child as it leaves you can provide a `childFactory` * to wrap every child, even the ones that are leaving. * * @type Function(child: ReactElement) -> ReactElement */ childFactory: PropTypes.func } ; TransitionGroup.defaultProps = defaultProps; var TransitionGroup$1 = TransitionGroup; var reflow = function reflow(node) { return node.scrollTop; }; function getTransitionProps(props, options) { var _style$transitionDura, _style$transitionTimi; var timeout = props.timeout, easing = props.easing, _props$style = props.style, style = _props$style === void 0 ? {} : _props$style; return { duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0, easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : _typeof(easing) === 'object' ? easing[options.mode] : easing, delay: style.transitionDelay }; } function getCollapseUtilityClass(slot) { return generateUtilityClass$1('MuiCollapse', slot); } var collapseClasses = generateUtilityClasses$1('MuiCollapse', ['root', 'horizontal', 'vertical', 'entered', 'hidden', 'wrapper', 'wrapperInner']); var collapseClasses$1 = collapseClasses; var useUtilityClasses$1O = function useUtilityClasses(ownerState) { var orientation = ownerState.orientation, classes = ownerState.classes; var slots = { root: ['root', "".concat(orientation)], entered: ['entered'], hidden: ['hidden'], wrapper: ['wrapper', "".concat(orientation)], wrapperInner: ['wrapperInner', "".concat(orientation)] }; return composeClasses(slots, getCollapseUtilityClass, classes); }; var CollapseRoot = styled$1('div', { name: 'MuiCollapse', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [styles.root, styles[ownerState.orientation], ownerState.state === 'entered' && styles.entered, ownerState.state === 'exited' && !ownerState["in"] && ownerState.collapsedSize === '0px' && styles.hidden]; } })(function (_ref) { var theme = _ref.theme, ownerState = _ref.ownerState; return _extends({ height: 0, overflow: 'hidden', transition: theme.transitions.create('height') }, ownerState.orientation === 'horizontal' && { height: 'auto', width: 0, transition: theme.transitions.create('width') }, ownerState.state === 'entered' && _extends({ height: 'auto', overflow: 'visible' }, ownerState.orientation === 'horizontal' && { width: 'auto' }), ownerState.state === 'exited' && !ownerState["in"] && ownerState.collapsedSize === '0px' && { visibility: 'hidden' }); }); var CollapseWrapper = styled$1('div', { name: 'MuiCollapse', slot: 'Wrapper', overridesResolver: function overridesResolver(props, styles) { return styles.wrapper; } })(function (_ref2) { var ownerState = _ref2.ownerState; return _extends({ // Hack to get children with a negative margin to not falsify the height computation. display: 'flex', width: '100%' }, ownerState.orientation === 'horizontal' && { width: 'auto', height: '100%' }); }); var CollapseWrapperInner = styled$1('div', { name: 'MuiCollapse', slot: 'WrapperInner', overridesResolver: function overridesResolver(props, styles) { return styles.wrapperInner; } })(function (_ref3) { var ownerState = _ref3.ownerState; return _extends({ width: '100%' }, ownerState.orientation === 'horizontal' && { width: 'auto', height: '100%' }); }); /** * The Collapse transition is used by the * [Vertical Stepper](/material-ui/react-stepper/#vertical-stepper) StepContent component. * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally. */ var Collapse = /*#__PURE__*/React__namespace.forwardRef(function Collapse(inProps, ref) { var props = useThemeProps$b({ props: inProps, name: 'MuiCollapse' }); var addEndListener = props.addEndListener, _children = props.children, className = props.className, _props$collapsedSize = props.collapsedSize, collapsedSizeProp = _props$collapsedSize === void 0 ? '0px' : _props$collapsedSize, component = props.component, easing = props.easing, inProp = props["in"], onEnter = props.onEnter, onEntered = props.onEntered, onEntering = props.onEntering, onExit = props.onExit, onExited = props.onExited, onExiting = props.onExiting, _props$orientation = props.orientation, orientation = _props$orientation === void 0 ? 'vertical' : _props$orientation, style = props.style, _props$timeout = props.timeout, timeout = _props$timeout === void 0 ? duration.standard : _props$timeout, _props$TransitionComp = props.TransitionComponent, TransitionComponent = _props$TransitionComp === void 0 ? Transition$1 : _props$TransitionComp, other = _objectWithoutProperties(props, ["addEndListener", "children", "className", "collapsedSize", "component", "easing", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "orientation", "style", "timeout", "TransitionComponent"]); var ownerState = _extends({}, props, { orientation: orientation, collapsedSize: collapsedSizeProp }); var classes = useUtilityClasses$1O(ownerState); var theme = useTheme(); var timer = useTimeout(); var wrapperRef = React__namespace.useRef(null); var autoTransitionDuration = React__namespace.useRef(); var collapsedSize = typeof collapsedSizeProp === 'number' ? "".concat(collapsedSizeProp, "px") : collapsedSizeProp; var isHorizontal = orientation === 'horizontal'; var size = isHorizontal ? 'width' : 'height'; var nodeRef = React__namespace.useRef(null); var handleRef = useForkRef(ref, nodeRef); var normalizedTransitionCallback = function normalizedTransitionCallback(callback) { return function (maybeIsAppearing) { if (callback) { var node = nodeRef.current; // onEnterXxx and onExitXxx callbacks have a different arguments.length value. if (maybeIsAppearing === undefined) { callback(node); } else { callback(node, maybeIsAppearing); } } }; }; var getWrapperSize = function getWrapperSize() { return wrapperRef.current ? wrapperRef.current[isHorizontal ? 'clientWidth' : 'clientHeight'] : 0; }; var handleEnter = normalizedTransitionCallback(function (node, isAppearing) { if (wrapperRef.current && isHorizontal) { // Set absolute position to get the size of collapsed content wrapperRef.current.style.position = 'absolute'; } node.style[size] = collapsedSize; if (onEnter) { onEnter(node, isAppearing); } }); var handleEntering = normalizedTransitionCallback(function (node, isAppearing) { var wrapperSize = getWrapperSize(); if (wrapperRef.current && isHorizontal) { // After the size is read reset the position back to default wrapperRef.current.style.position = ''; } var _getTransitionProps = getTransitionProps({ style: style, timeout: timeout, easing: easing }, { mode: 'enter' }), transitionDuration = _getTransitionProps.duration, transitionTimingFunction = _getTransitionProps.easing; if (timeout === 'auto') { var duration2 = theme.transitions.getAutoHeightDuration(wrapperSize); node.style.transitionDuration = "".concat(duration2, "ms"); autoTransitionDuration.current = duration2; } else { node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : "".concat(transitionDuration, "ms"); } node.style[size] = "".concat(wrapperSize, "px"); node.style.transitionTimingFunction = transitionTimingFunction; if (onEntering) { onEntering(node, isAppearing); } }); var handleEntered = normalizedTransitionCallback(function (node, isAppearing) { node.style[size] = 'auto'; if (onEntered) { onEntered(node, isAppearing); } }); var handleExit = normalizedTransitionCallback(function (node) { node.style[size] = "".concat(getWrapperSize(), "px"); if (onExit) { onExit(node); } }); var handleExited = normalizedTransitionCallback(onExited); var handleExiting = normalizedTransitionCallback(function (node) { var wrapperSize = getWrapperSize(); var _getTransitionProps2 = getTransitionProps({ style: style, timeout: timeout, easing: easing }, { mode: 'exit' }), transitionDuration = _getTransitionProps2.duration, transitionTimingFunction = _getTransitionProps2.easing; if (timeout === 'auto') { // TODO: rename getAutoHeightDuration to something more generic (width support) // Actually it just calculates animation duration based on size var duration2 = theme.transitions.getAutoHeightDuration(wrapperSize); node.style.transitionDuration = "".concat(duration2, "ms"); autoTransitionDuration.current = duration2; } else { node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : "".concat(transitionDuration, "ms"); } node.style[size] = collapsedSize; node.style.transitionTimingFunction = transitionTimingFunction; if (onExiting) { onExiting(node); } }); var handleAddEndListener = function handleAddEndListener(next) { if (timeout === 'auto') { timer.start(autoTransitionDuration.current || 0, next); } if (addEndListener) { // Old call signature before `react-transition-group` implemented `nodeRef` addEndListener(nodeRef.current, next); } }; return /*#__PURE__*/jsxRuntime_1(TransitionComponent, _extends({ "in": inProp, onEnter: handleEnter, onEntered: handleEntered, onEntering: handleEntering, onExit: handleExit, onExited: handleExited, onExiting: handleExiting, addEndListener: handleAddEndListener, nodeRef: nodeRef, timeout: timeout === 'auto' ? null : timeout }, other, { children: function children(state, childProps) { return /*#__PURE__*/jsxRuntime_1(CollapseRoot, _extends({ as: component, className: clsx(classes.root, className, { 'entered': classes.entered, 'exited': !inProp && collapsedSize === '0px' && classes.hidden }[state]), style: _extends(_defineProperty({}, isHorizontal ? 'minWidth' : 'minHeight', collapsedSize), style), ref: handleRef }, childProps, { // `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps` // that might have been forwarded from the Transition component. ownerState: _extends({}, ownerState, { state: state }), children: /*#__PURE__*/jsxRuntime_1(CollapseWrapper, { ownerState: _extends({}, ownerState, { state: state }), className: classes.wrapper, ref: wrapperRef, children: /*#__PURE__*/jsxRuntime_1(CollapseWrapperInner, { ownerState: _extends({}, ownerState, { state: state }), className: classes.wrapperInner, children: _children }) }) })); } })); }); Collapse.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * Add a custom transition end trigger. Called with the transitioning DOM * node and a done callback. Allows for more fine grained transition end * logic. Note: Timeouts are still used as a fallback if provided. */ addEndListener: PropTypes.func, /** * The content node to be collapsed. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The width (horizontal) or height (vertical) of the container when collapsed. * @default '0px' */ collapsedSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: elementTypeAcceptingRef$1, /** * The transition timing function. * You may specify a single easing or a object containing enter and exit values. */ easing: PropTypes.oneOfType([PropTypes.shape({ enter: PropTypes.string, exit: PropTypes.string }), PropTypes.string]), /** * If `true`, the component will transition in. */ "in": PropTypes.bool, /** * @ignore */ onEnter: PropTypes.func, /** * @ignore */ onEntered: PropTypes.func, /** * @ignore */ onEntering: PropTypes.func, /** * @ignore */ onExit: PropTypes.func, /** * @ignore */ onExited: PropTypes.func, /** * @ignore */ onExiting: PropTypes.func, /** * The transition orientation. * @default 'vertical' */ orientation: PropTypes.oneOf(['horizontal', 'vertical']), /** * @ignore */ style: PropTypes.object, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]), /** * The duration for the transition, in milliseconds. * You may specify a single timeout for all transitions, or individually with an object. * * Set to 'auto' to automatically calculate transition time based on height. * @default duration.standard */ timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({ appear: PropTypes.number, enter: PropTypes.number, exit: PropTypes.number })]) } ; Collapse.muiSupportAuto = true; var Collapse$1 = Collapse; function getPaperUtilityClass(slot) { return generateUtilityClass$1('MuiPaper', slot); } var paperClasses = generateUtilityClasses$1('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']); var paperClasses$1 = paperClasses; var useUtilityClasses$1N = function useUtilityClasses(ownerState) { var square = ownerState.square, elevation = ownerState.elevation, variant = ownerState.variant, classes = ownerState.classes; var slots = { root: ['root', variant, !square && 'rounded', variant === 'elevation' && "elevation".concat(elevation)] }; return composeClasses(slots, getPaperUtilityClass, classes); }; var PaperRoot = styled$1('div', { name: 'MuiPaper', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles["elevation".concat(ownerState.elevation)]]; } })(function (_ref) { var _theme$vars$overlays; var theme = _ref.theme, ownerState = _ref.ownerState; return _extends({ backgroundColor: (theme.vars || theme).palette.background.paper, color: (theme.vars || theme).palette.text.primary, transition: theme.transitions.create('box-shadow') }, !ownerState.square && { borderRadius: theme.shape.borderRadius }, ownerState.variant === 'outlined' && { border: "1px solid ".concat((theme.vars || theme).palette.divider) }, ownerState.variant === 'elevation' && _extends({ boxShadow: (theme.vars || theme).shadows[ownerState.elevation] }, !theme.vars && theme.palette.mode === 'dark' && { backgroundImage: "linear-gradient(".concat(alpha('#fff', getOverlayAlpha$1(ownerState.elevation)), ", ").concat(alpha('#fff', getOverlayAlpha$1(ownerState.elevation)), ")") }, theme.vars && { backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation] })); }); var Paper = /*#__PURE__*/React__namespace.forwardRef(function Paper(inProps, ref) { var props = useThemeProps$b({ props: inProps, name: 'MuiPaper' }); var className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'div' : _props$component, _props$elevation = props.elevation, elevation = _props$elevation === void 0 ? 1 : _props$elevation, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$variant = props.variant, variant = _props$variant === void 0 ? 'elevation' : _props$variant, other = _objectWithoutProperties(props, ["className", "component", "elevation", "square", "variant"]); var ownerState = _extends({}, props, { component: component, elevation: elevation, square: square, variant: variant }); var classes = useUtilityClasses$1N(ownerState); { // eslint-disable-next-line react-hooks/rules-of-hooks var theme = useTheme(); if (theme.shadows[elevation] === undefined) { console.error(["MUI: The elevation provided is not available in the theme."), "Please make sure that `theme.shadows[".concat(elevation, "]` is defined.")].join('\n')); } } return /*#__PURE__*/jsxRuntime_1(PaperRoot, _extends({ as: component, ownerState: ownerState, className: clsx(classes.root, className), ref: ref }, other)); }); Paper.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: PropTypes.elementType, /** * Shadow depth, corresponds to `dp` in the spec. * It accepts values between 0 and 24 inclusive. * @default 1 */ elevation: chainPropTypes(integerPropType, function (props) { var elevation = props.elevation, variant = props.variant; if (elevation > 0 && variant === 'outlined') { return new Error("MUI: Combining `elevation={".concat(elevation, "}` with `variant=\"").concat(variant, "\"` has no effect. Either use `elevation={0}` or use a different `variant`.")); } return null; }), /** * If `true`, rounded corners are disabled. * @default false */ square: PropTypes.bool, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]), /** * The variant to use. * @default 'elevation' */ variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string]) } ; var Paper$1 = Paper; /** * @ignore - internal component. * @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>} */ var AccordionContext = /*#__PURE__*/React__namespace.createContext({}); { AccordionContext.displayName = 'AccordionContext'; } var AccordionContext$1 = AccordionContext; /** * Determines if a given element is a DOM element name (i.e. not a React component). */ function isHostComponent(element) { return typeof element === 'string'; } /** * Type of the ownerState based on the type of an element it applies to. * This resolves to the provided OwnerState for React components and `undefined` for host components. * Falls back to `OwnerState | undefined` when the exact type can't be determined in development time. */ /** * Appends the ownerState object to the props, merging with the existing one if necessary. * * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied. * @param otherProps Props of the element. * @param ownerState */ function appendOwnerState(elementType, otherProps, ownerState) { if (elementType === undefined || isHostComponent(elementType)) { return otherProps; } return _extends({}, otherProps, { ownerState: _extends({}, otherProps.ownerState, ownerState) }); } function areArraysEqual(array1, array2) { var itemComparer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (a, b) { return a === b; }; return array1.length === array2.length && array1.every(function (value, index) { return itemComparer(value, array2[index]); }); } var defaultContextValue = { disableDefaultClasses: false }; var ClassNameConfiguratorContext = /*#__PURE__*/React__namespace.createContext(defaultContextValue); { ClassNameConfiguratorContext.displayName = 'ClassNameConfiguratorContext'; } /** * @ignore - internal hook. * * Wraps the `generateUtilityClass` function and controls how the classes are generated. * Currently it only affects whether the classes are applied or not. * * @returns Function to be called with the `generateUtilityClass` function specific to a component to generate the classes. */ function useClassNamesOverride(generateUtilityClass) { var _React$useContext = React__namespace.useContext(ClassNameConfiguratorContext), disableDefaultClasses = _React$useContext.disableDefaultClasses; return function (slot) { if (disableDefaultClasses) { return ''; } return generateUtilityClass(slot); }; } /** * Extracts event handlers from a given object. * A prop is considered an event handler if it is a function and its name starts with `on`. * * @param object An object to extract event handlers from. * @param excludeKeys An array of keys to exclude from the returned object. */ function extractEventHandlers(object) { var excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; if (object === undefined) { return {}; } var result = {}; Object.keys(object).filter(function (prop) { return prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop); }).forEach(function (prop) { result[prop] = object[prop]; }); return result; } /** * If `componentProps` is a function, calls it with the provided `ownerState`. * Otherwise, just returns `componentProps`. */ function resolveComponentProps(componentProps, ownerState, slotState) { if (typeof componentProps === 'function') { return componentProps(ownerState, slotState); } return componentProps; } /** * Removes event handlers from the given object. * A field is considered an event handler if it is a function with a name beginning with `on`. * * @param object Object to remove event handlers from. * @returns Object with event handlers removed. */ function omitEventHandlers(object) { if (object === undefined) { return {}; } var result = {}; Object.keys(object).filter(function (prop) { return !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function'); }).forEach(function (prop) { result[prop] = object[prop]; }); return result; } /** * Merges the slot component internal props (usually coming from a hook) * with the externally provided ones. * * The merge order is (the latter overrides the former): * 1. The internal props (specified as a getter function to work with get*Props hook result) * 2. Additional props (specified internally on a Base UI component) * 3. External props specified on the owner component. These should only be used on a root slot. * 4. External props specified in the `slotProps.*` prop. * 5. The `className` prop - combined from all the above. * @param parameters * @returns */ function mergeSlotProps(parameters) { var getSlotProps = parameters.getSlotProps, additionalProps = parameters.additionalProps, externalSlotProps = parameters.externalSlotProps, externalForwardedProps = parameters.externalForwardedProps, className = parameters.className; if (!getSlotProps) { // The simpler case - getSlotProps is not defined, so no internal event handlers are defined, // so we can simply merge all the props without having to worry about extracting event handlers. var _joinedClasses = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className); var _mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style); var _props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps); if (_joinedClasses.length > 0) { _props.className = _joinedClasses; } if (Object.keys(_mergedStyle).length > 0) { _props.style = _mergedStyle; } return { props: _props, internalRef: undefined }; } // In this case, getSlotProps is responsible for calling the external event handlers. // We don't need to include them in the merged props because of this. var eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps)); var componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps); var otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps); var internalSlotProps = getSlotProps(eventHandlers); // The order of classes is important here. // Emotion (that we use in libraries consuming Base UI) depends on this order // to properly override style. It requires the most important classes to be last // (see https://github.com/mui/material-ui/pull/33205) for the related discussion. var joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className); var mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style); var props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers); if (joinedClasses.length > 0) { props.className = joinedClasses; } if (Object.keys(mergedStyle).length > 0) { props.style = mergedStyle; } return { props: props, internalRef: internalSlotProps.ref }; } /** * @ignore - do not document. * Builds the props to be passed into the slot of an unstyled component. * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior. * If the slot component is not a host component, it also merges in the `ownerState`. * * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component. */ function useSlotProps(parameters) { var _parameters$additiona; var elementType = parameters.elementType, externalSlotProps = parameters.externalSlotProps, ownerState = parameters.ownerState, _parameters$skipResol = parameters.skipResolvingSlotProps, skipResolvingSlotProps = _parameters$skipResol === void 0 ? false : _parameters$skipResol, rest = _objectWithoutProperties(parameters, ["elementType", "externalSlotProps", "ownerState", "skipResolvingSlotProps"]); var resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState); var _mergeSlotProps = mergeSlotProps(_extends({}, rest, { externalSlotProps: resolvedComponentsProps })), mergedProps = _mergeSlotProps.props, internalRef = _mergeSlotProps.internalRef; var ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref); var props = appendOwnerState(elementType, _extends({}, mergedProps, { ref: ref }), ownerState); return props; } /** * An internal function to create a Material UI slot. * * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop * while Base UI does not need to support leaf component customization. * * @param {string} name: name of the slot * @param {object} parameters * @returns {[Slot, slotProps]} The slot's React component and the slot's props * * Note: the returned slot's props * - will never contain `component` prop. * - might contain `as` prop. */ function useSlot( /** * The slot's name. All Material UI components should have `root` slot. * * If the name is `root`, the logic behaves differently from other slots, * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots. */ name, parameters) { var className = parameters.className, initialElementType = parameters.elementType, ownerState = parameters.ownerState, externalForwardedProps = parameters.externalForwardedProps, getSlotOwnerState = parameters.getSlotOwnerState, internalForwardedProps = parameters.internalForwardedProps, useSlotPropsParams = _objectWithoutProperties(parameters, ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"]); var rootComponent = externalForwardedProps.component, _externalForwardedPro = externalForwardedProps.slots, slots = _externalForwardedPro === void 0 ? _defineProperty({}, name, undefined) : _externalForwardedPro, _externalForwardedPro2 = externalForwardedProps.slotProps, slotProps = _externalForwardedPro2 === void 0 ? _defineProperty({}, name, undefined) : _externalForwardedPro2, other = _objectWithoutProperties(externalForwardedProps, ["component", "slots", "slotProps"]); var elementType = slots[name] || initialElementType; // `slotProps[name]` can be a callback that receives the component's ownerState. // `resolvedComponentsProps` is always a plain object. var resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState); var _mergeSlotProps = mergeSlotProps(_extends({ className: className }, useSlotPropsParams, { externalForwardedProps: name === 'root' ? other : undefined, externalSlotProps: resolvedComponentsProps })), _mergeSlotProps$props = _mergeSlotProps.props, slotComponent = _mergeSlotProps$props.component, mergedProps = _objectWithoutProperties(_mergeSlotProps$props, ["component"]), internalRef = _mergeSlotProps.internalRef; var ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref); var slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {}; var finalOwnerState = _extends({}, ownerState, slotOwnerState); var LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent; var props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && { as: LeafComponent }, { ref: ref }), finalOwnerState); Object.keys(slotOwnerState).forEach(function (propName) { delete props[propName]; }); return [elementType, props]; } function getAccordionUtilityClass(slot) { return generateUtilityClass$1('MuiAccordion', slot); } var accordionClasses = generateUtilityClasses$1('MuiAccordion', ['root', 'rounded', 'expanded', 'disabled', 'gutters', 'region']); var accordionClasses$1 = accordionClasses; var useThemeProps$a = createUseThemeProps(); var useUtilityClasses$1M = function useUtilityClasses(ownerState) { var classes = ownerState.classes, square = ownerState.square, expanded = ownerState.expanded, disabled = ownerState.disabled, disableGutters = ownerState.disableGutters; var slots = { root: ['root', !square && 'rounded', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'], region: ['region'] }; return composeClasses(slots, getAccordionUtilityClass, classes); }; var AccordionRoot = styled$1(Paper$1, { name: 'MuiAccordion', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [_defineProperty({}, "& .".concat(accordionClasses$1.region), styles.region), styles.root, !ownerState.square && styles.rounded, !ownerState.disableGutters && styles.gutters]; } })(function (_ref2) { var theme = _ref2.theme; var transition = { duration: theme.transitions.duration.shortest }; return _defineProperty(_defineProperty({ position: 'relative', transition: theme.transitions.create(['margin'], transition), overflowAnchor: 'none', // Keep the same scrolling position '&::before': { position: 'absolute', left: 0, top: -1, right: 0, height: 1, content: '""', opacity: 1, backgroundColor: (theme.vars || theme).palette.divider, transition: theme.transitions.create(['opacity', 'background-color'], transition) }, '&:first-of-type': { '&::before': { display: 'none' } } }, "&.".concat(accordionClasses$1.expanded), { '&::before': { opacity: 0 }, '&:first-of-type': { marginTop: 0 }, '&:last-of-type': { marginBottom: 0 }, '& + &': { '&::before': { display: 'none' } } }), "&.".concat(accordionClasses$1.disabled), { backgroundColor: (theme.vars || theme).palette.action.disabledBackground }); }, function (_ref4) { var theme = _ref4.theme; return { variants: [{ props: function props(_props) { return !_props.square; }, style: { borderRadius: 0, '&:first-of-type': { borderTopLeftRadius: (theme.vars || theme).shape.borderRadius, borderTopRightRadius: (theme.vars || theme).shape.borderRadius }, '&:last-of-type': { borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius, borderBottomRightRadius: (theme.vars || theme).shape.borderRadius, // Fix a rendering issue on Edge '@supports (-ms-ime-align: auto)': { borderBottomLeftRadius: 0, borderBottomRightRadius: 0 } } } }, { props: function props(_props2) { return !_props2.disableGutters; }, style: _defineProperty({}, "&.".concat(accordionClasses$1.expanded), { margin: '16px 0' }) }] }; }); var Accordion = /*#__PURE__*/React__namespace.forwardRef(function Accordion(inProps, ref) { var props = useThemeProps$a({ props: inProps, name: 'MuiAccordion' }); var childrenProp = props.children, className = props.className, _props$defaultExpande = props.defaultExpanded, defaultExpanded = _props$defaultExpande === void 0 ? false : _props$defaultExpande, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableGutters = props.disableGutters, disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters, expandedProp = props.expanded, onChange = props.onChange, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$slots = props.slots, slots = _props$slots === void 0 ? {} : _props$slots, _props$slotProps = props.slotProps, slotProps = _props$slotProps === void 0 ? {} : _props$slotProps, TransitionComponentProp = props.TransitionComponent, TransitionPropsProp = props.TransitionProps, other = _objectWithoutProperties(props, ["children", "className", "defaultExpanded", "disabled", "disableGutters", "expanded", "onChange", "square", "slots", "slotProps", "TransitionComponent", "TransitionProps"]); var _useControlled = useControlled({ controlled: expandedProp, "default": defaultExpanded, name: 'Accordion', state: 'expanded' }), _useControlled2 = _slicedToArray(_useControlled, 2), expanded = _useControlled2[0], setExpandedState = _useControlled2[1]; var handleChange = React__namespace.useCallback(function (event) { setExpandedState(!expanded); if (onChange) { onChange(event, !expanded); } }, [expanded, onChange, setExpandedState]); var _React$Children$toArr = React__namespace.Children.toArray(childrenProp), _React$Children$toArr2 = _toArray(_React$Children$toArr), summary = _React$Children$toArr2[0], children = _React$Children$toArr2.slice(1); var contextValue = React__namespace.useMemo(function () { return { expanded: expanded, disabled: disabled, disableGutters: disableGutters, toggle: handleChange }; }, [expanded, disabled, disableGutters, handleChange]); var ownerState = _extends({}, props, { square: square, disabled: disabled, disableGutters: disableGutters, expanded: expanded }); var classes = useUtilityClasses$1M(ownerState); var backwardCompatibleSlots = _extends({ transition: TransitionComponentProp }, slots); var backwardCompatibleSlotProps = _extends({ transition: TransitionPropsProp }, slotProps); var _useSlot = useSlot('transition', { elementType: Collapse$1, externalForwardedProps: { slots: backwardCompatibleSlots, slotProps: backwardCompatibleSlotProps }, ownerState: ownerState }), _useSlot2 = _slicedToArray(_useSlot, 2), TransitionSlot = _useSlot2[0], transitionProps = _useSlot2[1]; return /*#__PURE__*/jsxRuntime_2(AccordionRoot, _extends({ className: clsx(classes.root, className), ref: ref, ownerState: ownerState, square: square }, other, { children: [/*#__PURE__*/jsxRuntime_1(AccordionContext$1.Provider, { value: contextValue, children: summary }), /*#__PURE__*/jsxRuntime_1(TransitionSlot, _extends({ "in": expanded, timeout: "auto" }, transitionProps, { children: /*#__PURE__*/jsxRuntime_1("div", { "aria-labelledby": summary.props.id, id: summary.props['aria-controls'], role: "region", className: classes.region, children: children }) }))] })); }); Accordion.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * The content of the component. */ children: chainPropTypes(PropTypes.node.isRequired, function (props) { var summary = React__namespace.Children.toArray(props.children)[0]; if (reactIs_2(summary)) { return new Error("MUI: The Accordion doesn't accept a Fragment as a child. " + 'Consider providing an array instead.'); } if (! /*#__PURE__*/React__namespace.isValidElement(summary)) { return new Error('MUI: Expected the first child of Accordion to be a valid element.'); } return null; }), /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * If `true`, expands the accordion by default. * @default false */ defaultExpanded: PropTypes.bool, /** * If `true`, the component is disabled. * @default false */ disabled: PropTypes.bool, /** * If `true`, it removes the margin between two expanded accordion items and the increase of height. * @default false */ disableGutters: PropTypes.bool, /** * If `true`, expands the accordion, otherwise collapse it. * Setting this prop enables control over the accordion. */ expanded: PropTypes.bool, /** * Callback fired when the expand/collapse state is changed. * * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event. * @param {boolean} expanded The `expanded` state of the accordion. */ onChange: PropTypes.func, /** * The props used for each slot inside. * @default {} */ slotProps: PropTypes.shape({ transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object]) }), /** * The components used for each slot inside. * @default {} */ slots: PropTypes.shape({ transition: PropTypes.elementType }), /** * If `true`, rounded corners are disabled. * @default false */ square: PropTypes.bool, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]), /** * The component used for the transition. * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component. * @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/). */ TransitionComponent: PropTypes.elementType, /** * Props applied to the transition element. * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component. * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/). */ TransitionProps: PropTypes.object } ; var Accordion$1 = Accordion; function getAccordionActionsUtilityClass(slot) { return generateUtilityClass$1('MuiAccordionActions', slot); } var accordionActionsClasses = generateUtilityClasses$1('MuiAccordionActions', ['root', 'spacing']); var accordionActionsClasses$1 = accordionActionsClasses; var useThemeProps$9 = createUseThemeProps(); var useUtilityClasses$1L = function useUtilityClasses(ownerState) { var classes = ownerState.classes, disableSpacing = ownerState.disableSpacing; var slots = { root: ['root', !disableSpacing && 'spacing'] }; return composeClasses(slots, getAccordionActionsUtilityClass, classes); }; var AccordionActionsRoot = styled$1('div', { name: 'MuiAccordionActions', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { var ownerState = props.ownerState; return [styles.root, !ownerState.disableSpacing && styles.spacing]; } })({ display: 'flex', alignItems: 'center', padding: 8, justifyContent: 'flex-end', variants: [{ props: function props(_props) { return !_props.disableSpacing; }, style: { '& > :not(style) ~ :not(style)': { marginLeft: 8 } } }] }); var AccordionActions = /*#__PURE__*/React__namespace.forwardRef(function AccordionActions(inProps, ref) { var props = useThemeProps$9({ props: inProps, name: 'MuiAccordionActions' }); var className = props.className, _props$disableSpacing = props.disableSpacing, disableSpacing = _props$disableSpacing === void 0 ? false : _props$disableSpacing, other = _objectWithoutProperties(props, ["className", "disableSpacing"]); var ownerState = _extends({}, props, { disableSpacing: disableSpacing }); var classes = useUtilityClasses$1L(ownerState); return /*#__PURE__*/jsxRuntime_1(AccordionActionsRoot, _extends({ className: clsx(classes.root, className), ref: ref, ownerState: ownerState }, other)); }); AccordionActions.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * If `true`, the actions do not have additional margin. * @default false */ disableSpacing: PropTypes.bool, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } ; var AccordionActions$1 = AccordionActions; function getAccordionDetailsUtilityClass(slot) { return generateUtilityClass$1('MuiAccordionDetails', slot); } var accordionDetailsClasses = generateUtilityClasses$1('MuiAccordionDetails', ['root']); var accordionDetailsClasses$1 = accordionDetailsClasses; var useThemeProps$8 = createUseThemeProps(); var useUtilityClasses$1K = function useUtilityClasses(ownerState) { var classes = ownerState.classes; var slots = { root: ['root'] }; return composeClasses(slots, getAccordionDetailsUtilityClass, classes); }; var AccordionDetailsRoot = styled$1('div', { name: 'MuiAccordionDetails', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { return styles.root; } })(function (_ref) { var theme = _ref.theme; return { padding: theme.spacing(1, 2, 2) }; }); var AccordionDetails = /*#__PURE__*/React__namespace.forwardRef(function AccordionDetails(inProps, ref) { var props = useThemeProps$8({ props: inProps, name: 'MuiAccordionDetails' }); var className = props.className, other = _objectWithoutProperties(props, ["className"]); var ownerState = props; var classes = useUtilityClasses$1K(ownerState); return /*#__PURE__*/jsxRuntime_1(AccordionDetailsRoot, _extends({ className: clsx(classes.root, className), ref: ref, ownerState: ownerState }, other)); }); AccordionDetails.propTypes /* remove-proptypes */ = { // ┌────────────────────────────── Warning ──────────────────────────────┐ // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the d.ts file and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The system prop that allows defining system overrides as well as additional CSS styles. */ sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]) } ; var AccordionDetails$1 = AccordionDetails; function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } function Ripple(props) { var className = props.className, classes = props.classes, _props$pulsate = props.pulsate, pulsate = _props$pulsate === void 0 ? false : _props$pulsate, rippleX = props.rippleX, rippleY = props.rippleY, rippleSize = props.rippleSize, inProp = props["in"], onExited = props.onExited, timeout = props.timeout; var _React$useState = React__namespace.useState(false), leaving = _React$useState[0], setLeaving = _React$useState[1]; var rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate); var rippleStyles = { width: rippleSize, height: rippleSize, top: -(rippleSize / 2) + rippleY, left: -(rippleSize / 2) + rippleX }; var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate); if (!inProp && !leaving) { setLeaving(true); } React__namespace.useEffect(function () { if (!inProp && onExited != null) { // react-transition-group#onExited var timeoutId = setTimeout(onExited, timeout); return function () { clearTimeout(timeoutId); }; } return undefined; }, [onExited, inProp, timeout]); return /*#__PURE__*/jsxRuntime_1("span", { className: rippleClassName, style: rippleStyles, children: /*#__PURE__*/jsxRuntime_1("span", { className: childClassName }) }); } Ripple.propTypes = { /** * Override or extend the styles applied to the component. */ classes: PropTypes.object.isRequired, className: PropTypes.string, /** * @ignore - injected from TransitionGroup */ "in": PropTypes.bool, /** * @ignore - injected from TransitionGroup */ onExited: PropTypes.func, /** * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element. */ pulsate: PropTypes.bool, /** * Diameter of the ripple. */ rippleSize: PropTypes.number, /** * Horizontal position of the ripple center. */ rippleX: PropTypes.number, /** * Vertical position of the ripple center. */ rippleY: PropTypes.number, /** * exit delay */ timeout: PropTypes.number.isRequired } ; function getTouchRippleUtilityClass(slot) { return generateUtilityClass$1('MuiTouchRipple', slot); } var touchRippleClasses = generateUtilityClasses$1('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']); var touchRippleClasses$1 = touchRippleClasses; var _templateObject$3, _templateObject2$3, _templateObject3$3, _templateObject4$3; var DURATION = 550; var DELAY_RIPPLE = 80; var enterKeyframe = keyframes(_templateObject$3 || (_templateObject$3 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"]))); var exitKeyframe = keyframes(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"]))); var pulsateKeyframe = keyframes(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"]))); var TouchRippleRoot = styled$1('span', { name: 'MuiTouchRipple', slot: 'Root' })({ overflow: 'hidden', pointerEvents: 'none', position: 'absolute', zIndex: 0, top: 0, right: 0, bottom: 0, left: 0, borderRadius: 'inherit' }); // This `styled()` function invokes keyframes. `styled-components` only supports keyframes // in string templates. Do not convert these styles in JS object as it will break. var TouchRippleRipple = styled$1(Ripple, { name: 'MuiTouchRipple', slot: 'Ripple' })(_templateObject4$3 || (_templateObject4$3 = _taggedTemplateLiteral(["\n opacity: 0;\n position: absolute;\n\n &.", " {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n &.", " {\n animation-duration: ", "ms;\n }\n\n & .", " {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .", " {\n opacity: 0;\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n & .", " {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ", ";\n animation-duration: 2500ms;\n animation-timing-function: ", ";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"])), touchRippleClasses$1.rippleVisible, enterKeyframe, DURATION, function (_ref) { var theme = _ref.theme; return theme.transitions.easing.easeInOut; }, touchRippleClasses$1.ripplePulsate, function (_ref2) { var theme = _ref2.theme; return theme.transitions.duration.shorter; }, touchRippleClasses$1.child, touchRippleClasses$1.childLeaving, exitKeyframe, DURATION, function (_ref3) { var theme = _ref3.theme; return theme.transitions.easing.easeInOut; }, touchRippleClasses$1.childPulsate, pulsateKeyframe, function (_ref4) { var theme = _ref4.theme; return theme.transitions.easing.easeInOut; }); /** * @ignore - internal component. * * TODO v5: Make private */ var TouchRipple = /*#__PURE__*/React__namespace.forwardRef(function TouchRipple(inProps, ref) { var props = useThemeProps$b({ props: inProps, name: 'MuiTouchRipple' }); var _props$center = props.center, centerProp = _props$center === void 0 ? false : _props$center, _props$classes = props.classes, classes = _props$classes === void 0 ? {} : _props$classes, className = props.className, other = _objectWithoutProperties(props, ["center", "classes", "className"]); var _React$useState = React__namespace.useState([]), ripples = _React$useState[0], setRipples = _React$useState[1]; var nextKey = React__namespace.useRef(0); var rippleCallback = React__namespace.useRef(null); React__namespace.useEffect(function () { if (rippleCallback.current) { rippleCallback.current(); rippleCallback.current = null; } }, [ripples]); // Used to filter out mouse emulated events on mobile. var ignoringMouseDown = React__namespace.useRef(false); // We use a timer in order to only show the ripples for touch "click" like events. // We don't want to display the ripple for touch scroll events. var startTimer = useTimeout(); // This is the hook called once the previous timeout is ready. var startTimerCommit = React__namespace.useRef(null); var container = React__namespace.useRef(null); var startCommit = React__namespace.useCallback(function (params) { var pulsate = params.pulsate, rippleX = params.rippleX, rippleY = params.rippleY, rippleSize = params.rippleSize, cb = params.cb; setRipples(function (oldRipples) { return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/jsxRuntime_1(TouchRippleRipple, { classes: { ripple: clsx(classes.ripple, touchRippleClasses$1.ripple), rippleVisible: clsx(classes.rippleVisible, touchRippleClasses$1.rippleVisible), ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses$1.ripplePulsate), child: clsx(classes.child, touchRippleClasses$1.child), childLeaving: clsx(classes.childLeaving, touchRippleClasses$1.childLeaving), childPulsate: clsx(classes.childPulsate, touchRippleClasses$1.childPulsate) }, timeout: DURATION, pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize }, nextKey.current)]); }); nextKey.current += 1; rippleCallback.current = cb; }, [classes]); var start = React__namespace.useCallback(function () { var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {}; var _options$pulsate = options.pulsate, pulsate = _options$pulsate === void 0 ? false : _options$pulsate, _options$center = options.center, center = _options$center === void 0 ? centerProp || options.pulsate : _options$center, _options$fakeElement = options.fakeElement, fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement; if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) { ignoringMouseDown.current = false; return; } if ((event == null ? void 0 : event.type) === 'touchstart') { ignoringMouseDown.current = true; } var element = fakeElement ? null : container.current; var rect = element ? element.getBoundingClientRect() : { width: 0, height: 0, left: 0, top: 0 }; // Get the size of the ripple var rippleX; var rippleY; var rippleSize; if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) { rippleX = Math.round(rect.width / 2); rippleY = Math.round(rect.height / 2); } else { var _ref5 = event.touches && event.touches.length > 0 ? event.touches[0] : event, clientX = _ref5.clientX, clientY = _ref5.clientY; rippleX = Math.round(clientX - rect.left); rippleY = Math.round(clientY - rect.top); } if (center) { rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size is even. if (rippleSize % 2 === 0) { rippleSize += 1; } } else { var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2; var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2; rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2)); } // Touche devices if (event != null && event.touches) { // check that this isn't another touchstart due to multitouch // otherwise we will only clear a single timer when unmounting while two // are running if (startTimerCommit.current === null) { // Prepare the ripple effect. startTimerCommit.current = function () { startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb }); }; // Delay the execution of the ripple effect. // We have to make a tradeoff with this delay value. startTimer.start(DELAY_RIPPLE, function () { if (startTimerCommit.current) { startTimerCommit.current(); startTimerCommit.current = null; } }); } } else { startCommit({ pulsate: pulsate, rippleX: rippleX, rippleY: rippleY, rippleSize: rippleSize, cb: cb }); } }, [centerProp, startCommit, startTimer]); var pulsate = React__namespace.useCallback(function () { start({}, { pulsate: true }); }, [start]); var stop = React__namespace.useCallback(function (event, cb) { startTimer.clear(); // The touch interaction occurs too quickly. // We still want to show ripple effect. if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) { startTimerCommit.current(); startTimerCommit.current = null; startTimer.start(0, function () { stop(event, cb); }); return; } startTimerCommit.current = null; setRipples(function (oldRipples) { if (oldRipples.length > 0) { return oldRipples.slice(1); } return oldRipples; }); rippleCallback.current = cb; }, [startTimer]); React__namespace.useImperativeHandle(ref, function () { return { pulsate: pulsate, start: start, stop: stop }; }, [pulsate, start, stop]); return /*#__PURE__*/jsxRuntime_1(TouchRippleRoot, _extends({ className: clsx(touchRippleClasses$1.root, classes.root, className), ref: container }, other, { children: /*#__PURE__*/jsxRuntime_1(TransitionGroup$1, { component: null, exit: true, children: ripples }) })); }); TouchRipple.propTypes = { /** * If `true`, the ripple starts at the center of the component * rather than at the point of interaction. */ center: PropTypes.bool, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string } ; var TouchRipple$1 = TouchRipple; function getButtonBaseUtilityClass(slot) { return generateUtilityClass$1('MuiButtonBase', slot); } var buttonBaseClasses = generateUtilityClasses$1('MuiButtonBase', ['root', 'disabled', 'focusVisible']); var buttonBaseClasses$1 = buttonBaseClasses; var useUtilityClasses$1J = function useUtilityClasses(ownerState) { var disabled = ownerState.disabled, focusVisible = ownerState.focusVisible, focusVisibleClassName = ownerState.focusVisibleClassName, classes = ownerState.classes; var slots = { root: ['root', disabled && 'disabled', focusVisible && 'focusVisible'] }; var composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes); if (focusVisible && focusVisibleClassName) { composedClasses.root += " ".concat(focusVisibleClassName); } return composedClasses; }; var ButtonBaseRoot = styled$1('button', { name: 'MuiButtonBase', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { return styles.root; } })(_defineProperty(_defineProperty({ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', position: 'relative', boxSizing: 'border-box', WebkitTapHighlightColor: 'transparent', backgroundColor: 'transparent', // Reset default value // We disable the focus ring for mouse, touch and keyboard users. outline: 0, border: 0, margin: 0, // Remove the margin in Safari borderRadius: 0, padding: 0, // Remove the padding in Firefox cursor: 'pointer', userSelect: 'none', verticalAlign: 'middle', MozAppearance: 'none', // Reset WebkitAppearance: 'none', // Reset textDecoration: 'none', // So we take precedent over the style of a native element. color: 'inherit', '&::-moz-focus-inner': { borderStyle: 'none' // Remove Firefox dotted outline. } }, "&.".concat(buttonBaseClasses$1.disabled), { pointerEvents: 'none', // Disable link interactions cursor: 'default' }), '@media print', { colorAdjust: 'exact' })); /** * `ButtonBase` contains as few styles as possible. * It aims to be a simple building block for creating a button. * It contains a load of style reset and some focus/ripple logic. */ var ButtonBase = /*#__PURE__*/React__namespace.forwardRef(function ButtonBase(inProps, ref) { var props = useThemeProps$b({ props: inProps, name: 'MuiButtonBase' }); var action = props.action, _props$centerRipple = props.centerRipple, centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple, children = props.children, className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'button' : _props$component, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$disableRipple = props.disableRipple, disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple, _props$disableTouchRi = props.disableTouchRipple, disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi, _props$focusRipple = props.focusRipple, focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple; props.focusVisibleClassName; var _props$LinkComponent = props.LinkComponent, LinkComponent = _props$LinkComponent === void 0 ? 'a' : _props$LinkComponent, onBlur = props.onBlur, onClick = props.onClick, onContextMenu = props.onContextMenu, onDragLeave = props.onDragLeave, onFocus = props.onFocus, onFocusVisible = props.onFocusVisible, onKeyDown = props.onKeyDown, onKeyUp = props.onKeyUp, onMouseDown = props.onMouseDown, onMouseLeave = props.onMouseLeave, onMouseUp = props.onMouseUp, onTouchEnd = props.onTouchEnd, onTouchMove = props.onTouchMove, onTouchStart = props.onTouchStart, _props$tabIndex = props.tabIndex, tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex, TouchRippleProps = props.TouchRippleProps, touchRippleRef = props.touchRippleRef, type = props.type, other = _objectWithoutProperties(props, ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"]); var buttonRef = React__namespace.useRef(null); var rippleRef = React__namespace.useRef(null); var handleRippleRef = useForkRef(rippleRef, touchRippleRef); var _useIsFocusVisible = useIsFocusVisible(), isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef, handleFocusVisible = _useIsFocusVisible.onFocus, handleBlurVisible = _useIsFocusVisible.onBlur, focusVisibleRef = _useIsFocusVisible.ref; var _React$useState = React__namespace.useState(false), focusVisible = _React$useState[0], setFocusVisible = _React$useState[1]; if (disabled && focusVisible) { setFocusVisible(false); } React__namespace.useImperativeHandle(action, function () { return { focusVisible: function focusVisible() { setFocusVisible(true); buttonRef.current.focus(); } }; }, []); var _React$useState2 = React__namespace.useState(false), mountedState = _React$useState2[0], setMountedState = _React$useState2[1]; React__namespace.useEffect(function () { setMountedState(true); }, []); var enableTouchRipple = mountedState && !disableRipple && !disabled; React__namespace.useEffect(function () { if (focusVisible && focusRipple && !disableRipple && mountedState) { rippleRef.current.pulsate(); } }, [disableRipple, focusRipple, focusVisible, mountedState]); function useRippleHandler(rippleAction, eventCallback) { var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple; return useEventCallback(function (event) { if (eventCallback) { eventCallback(event); } var ignore = skipRippleAction; if (!ignore && rippleRef.current) { rippleRef.current[rippleAction](event); } return true; }); } var handleMouseDown = useRippleHandler('start', onMouseDown); var handleContextMenu = useRippleHandler('stop', onContextMenu); var handleDragLeave = useRippleHandler('stop', onDragLeave); var handleMouseUp = useRippleHandler('stop', onMouseUp); var handleMouseLeave = useRippleHandler('stop', function (event) { if (focusVisible) { event.preventDefault(); } if (onMouseLeave) { onMouseLeave(event); } }); var handleTouchStart = useRippleHandler('start', onTouchStart); var handleTouchEnd = useRippleHandler('stop', onTouchEnd); var handleTouchMove = useRippleHandler('stop', onTouchMove); var handleBlur = useRippleHandler('stop', function (event) { handleBlurVisible(event); if (isFocusVisibleRef.current === false) { setFocusVisible(false); } if (onBlur) { onBlur(event); } }, false); var handleFocus = useEventCallback(function (event) { // Fix for https://github.com/facebook/react/issues/7769 if (!buttonRef.current) { buttonRef.current = event.currentTarget; } handleFocusVisible(event); if (isFocusVisibleRef.current === true) { setFocusVisible(true); if (onFocusVisible) { onFocusVisible(event); } } if (onFocus) { onFocus(event); } }); var isNonNativeButton = function isNonNativeButton() { var button = buttonRef.current; return component && component !== 'button' && !(button.tagName === 'A' && button.href); }; /** * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat */ var keydownRef = React__namespace.useRef(false); var handleKeyDown = useEventCallback(function (event) { // Check if key is already down to avoid repeats being counted as multiple activations if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') { keydownRef.current = true; rippleRef.current.stop(event, function () { rippleRef.current.start(event); }); } if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') { event.preventDefault(); } if (onKeyDown) { onKeyDown(event); } // Keyboard accessibility for non interactive elements if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) { event.preventDefault(); if (onClick) { onClick(event); } } }); var handleKeyUp = useEventCallback(function (event) { // calling preventDefault in keyUp on a