UNPKG

iobroker.javascript

Version:
2 lines (1 loc) 4.87 kB
import{d as K}from"./defaultTheme-C_aSR-NR.js";import{d as Z,s as $,Z as J,T as Q}from"./createTheme-Ajie0adn.js";import{i as w,a as X,s as Y,u as z}from"./DefaultPropsProvider-CfXkmG16.js";import"./ConfigCustomJavascriptSet__loadShare__react__loadShare__-B_YWmFeG.js";import"./jsx-runtime-lE4rOet2.js";const M=e=>e,N=()=>{let e=M;return{configure(r){e=r},generate(r){return e(r)},reset(){e=M}}},ee=N();function E(e){var r,n,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(r=0;r<s;r++)e[r]&&(n=E(e[r]))&&(t&&(t+=" "),t+=n)}else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function we(){for(var e,r,n=0,t="",s=arguments.length;n<s;n++)(e=arguments[n])&&(r=E(e))&&(t&&(t+=" "),t+=r);return t}const te={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 ne(e,r,n="Mui"){const t=te[r];return t?`${n}-${t}`:`${ee.generate(e)}-${r}`}function ge(e,r,n="Mui"){const t={};return r.forEach(s=>{t[s]=ne(e,s,n)}),t}function D(e){const{variants:r,...n}=e,t={variants:r,style:w(n),isProcessed:!0};return t.style===n||r&&r.forEach(s=>{typeof s.style!="function"&&(s.style=w(s.style))}),t}const re=Z();function O(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function p(e,r){return r&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${r}{${String(e.styles)}}`),e}function se(e){return e?(r,n)=>n[e]:null}function oe(e,r,n){e.theme=ue(e.theme)?n:e.theme[r]||e.theme}function P(e,r,n){const t=typeof r=="function"?r(e):r;if(Array.isArray(t))return t.flatMap(s=>P(e,s,n));if(Array.isArray(t==null?void 0:t.variants)){let s;if(t.isProcessed)s=n?p(t.style,n):t.style;else{const{variants:i,...l}=t;s=n?p(w(l),n):l}return G(e,t.variants,[s],n)}return t!=null&&t.isProcessed?n?p(w(t.style),n):t.style:n?p(w(t),n):t}function G(e,r,n=[],t=void 0){var i;let s;e:for(let l=0;l<r.length;l+=1){const o=r[l];if(typeof o.props=="function"){if(s??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(s))continue}else for(const d in o.props)if(e[d]!==o.props[d]&&((i=e.ownerState)==null?void 0:i[d])!==o.props[d])continue e;typeof o.style=="function"?(s??={...e,...e.ownerState,ownerState:e.ownerState},n.push(t?p(w(o.style(s)),t):o.style(s))):n.push(t?p(w(o.style),t):o.style)}return n}function ie(e={}){const{themeId:r,defaultTheme:n=re,rootShouldForwardProp:t=O,slotShouldForwardProp:s=O}=e;function i(o){oe(o,r,n)}return(o,d={})=>{X(o,a=>a.filter(u=>u!==$));const{name:c,slot:y,skipVariantsResolver:F,skipSx:H,overridesResolver:k=se(ce(y)),...I}=d,x=c&&c.startsWith("Mui")||y?"components":"custom",q=F!==void 0?F:y&&y!=="Root"&&y!=="root"||!1,U=H||!1;let C=O;y==="Root"||y==="root"?C=t:y?C=s:le(o)&&(C=void 0);const A=Y(o,{shouldForwardProp:C,label:ae(),...I}),W=a=>{if(a.__emotion_real===a)return a;if(typeof a=="function")return function(S){return P(S,a,S.theme.modularCssLayers?x:void 0)};if(J(a)){const u=D(a);return function(h){return u.variants?P(h,u,h.theme.modularCssLayers?x:void 0):h.theme.modularCssLayers?p(u.style,x):u.style}}return a},L=(...a)=>{const u=[],S=a.map(W),h=[];if(u.push(i),c&&k&&h.push(function(f){var b,V;const m=(V=(b=f.theme.components)==null?void 0:b[c])==null?void 0:V.styleOverrides;if(!m)return null;const g={};for(const _ in m)g[_]=P(f,m[_],f.theme.modularCssLayers?"theme":void 0);return k(f,g)}),c&&!q&&h.push(function(f){var g,b;const v=f.theme,m=(b=(g=v==null?void 0:v.components)==null?void 0:g[c])==null?void 0:b.variants;return m?G(f,m,[],f.theme.modularCssLayers?"theme":void 0):null}),U||h.push($),Array.isArray(S[0])){const T=S.shift(),f=new Array(u.length).fill(""),v=new Array(h.length).fill("");let m;m=[...f,...T,...v],m.raw=[...f,...T.raw,...v],u.unshift(m)}const B=[...u,...S,...h],R=A(...B);return o.muiName&&(R.muiName=o.muiName),R};return A.withConfig&&(L.withConfig=A.withConfig),L}}function ae(e,r){return void 0}function ue(e){for(const r in e)return!1;return!0}function le(e){return typeof e=="string"&&e.charCodeAt(0)>96}function ce(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function be(e,r,n=void 0){const t={};for(const s in e){const i=e[s];let l="",o=!0;for(let d=0;d<i.length;d+=1){const c=i[d];c&&(l+=(o===!0?"":" ")+r(c),o=!1,n&&n[c]&&(l+=" "+n[c]))}t[s]=l}return t}const j={theme:void 0};function fe(e){let r,n;return function(s){let i=r;return(i===void 0||s.theme!==n)&&(j.theme=s.theme,i=D(e(j)),r=i,n=s.theme),i}}function de(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const me=e=>de(e)&&e!=="classes",Ce=ie({themeId:Q,defaultTheme:K,rootShouldForwardProp:me}),Te=fe;function Pe(e){return z(e)}export{ee as C,ge as a,be as b,we as c,ie as d,de as e,ne as g,Te as m,me as r,Ce as s,Pe as u};