iobroker.javascript 9.1.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -8
- package/admin/assets/AiChatPanel-sgt697A2.js +296 -0
- package/admin/assets/AiDatapointProvider-B0i3I5Fm.js +2 -0
- package/admin/assets/AiDiffView-RPozjjHf.js +1 -0
- package/admin/assets/AiInlineProvider-Dd7eKxk4.js +7 -0
- package/admin/assets/{Save-Cld9qv9i.js → Save-CkuNSiWL.js} +1 -1
- package/admin/assets/{ScriptEditor-BVaX7Hcs.js → ScriptEditor-CH4qJzqq.js} +2 -2
- package/admin/assets/ScriptEditorVanillaMonaco-cB_90T0P.js +1 -0
- package/admin/assets/{createSvgIcon-DPvF8xqu.js → createSvgIcon-DYs_tNrE.js} +1 -1
- package/admin/assets/docs-compact-CKNGiYh2.js +336 -0
- package/admin/assets/index-BI3JsAz_.js +1 -0
- package/admin/assets/{index-D8iYqogF.js → index-DAkyON1r.js} +5 -5
- package/admin/assets/index-DW5CwIma.js +1256 -0
- package/admin/assets/index-SHs7_wDh.js +1 -0
- package/admin/assets/{index-DlDUIfpA.js → index-dN73sbyQ.js} +1 -1
- package/admin/assets/index-hwplVCgv.js +986 -0
- package/admin/assets/index-wHNMOf-c.js +5 -0
- package/admin/assets/inheritsLoose-CIXm_zPk.js +29 -0
- package/admin/assets/{iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-QWG5Arqe.js → iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-CV1_X-Lf.js} +1 -1
- package/admin/assets/{localSharedImportMap-AxgBkrOR.js → localSharedImportMap-CqvxvyGG.js} +1 -1
- package/admin/assets/useTheme-DuTJsNQ-.js +1 -0
- package/admin/assets/{virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-C9suQF96.js → virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-BJ03G6Pu.js} +2 -2
- package/admin/custom/assets/{Components-FfVbavBM.js → Components-B9ZyjeRI.js} +1 -1
- package/admin/custom/assets/{index-Be7j5wvd.js → index-BVwMgafs.js} +1 -1
- package/admin/custom/assets/index-CVIpIckw.js +960 -0
- package/admin/custom/assets/{index-DNdWk-cT.js → index-DsIn9jH_.js} +1 -1
- package/admin/custom/assets/{localSharedImportMap-BRxFonIn.js → localSharedImportMap-C4qXtGUd.js} +1 -1
- package/admin/custom/assets/{virtualExposes-DyedJotb.js → virtualExposes-jSvr-kK3.js} +1 -1
- package/admin/custom/assets/{virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-BtJxKB87.js → virtual_mf-REMOTE_ENTRY_ID_ConfigCustomJavascriptSet__customComponents_js-DFSXB0v2.js} +2 -2
- package/admin/custom/customComponents.js +1 -1
- package/admin/google-blockly/own/blocks_words.js +7 -0
- package/admin/google-blockly/own/field_oid.js +311 -37
- package/admin/i18n/de.json +8 -0
- package/admin/i18n/en.json +8 -0
- package/admin/i18n/es.json +8 -0
- package/admin/i18n/flat.txt +427 -0
- package/admin/i18n/fr.json +8 -0
- package/admin/i18n/it.json +8 -0
- package/admin/i18n/nl.json +8 -0
- package/admin/i18n/pl.json +8 -0
- package/admin/i18n/pt.json +8 -0
- package/admin/i18n/ru.json +8 -0
- package/admin/i18n/uk.json +8 -0
- package/admin/i18n/zh-cn.json +8 -0
- package/admin/img/anthropic.svg +1 -0
- package/admin/img/custom.svg +1 -0
- package/admin/img/deepseek.svg +1 -0
- package/admin/img/gemini.svg +1 -0
- package/admin/img/openai.svg +1 -0
- package/admin/jsonConfig.json +76 -14
- package/admin/mf-manifest.json +1 -1
- package/admin/remoteEntry.js +1 -1
- package/admin/tab.html +6 -6
- package/build/lib/debugger.js +2 -2
- package/build/lib/debugger.js.map +1 -1
- package/build/lib/inspect.js.map +1 -1
- package/build/lib/nodeModulesManagement.js +2 -2
- package/build/lib/nodeModulesManagement.js.map +1 -1
- package/build/lib/protectFs.js +5 -0
- package/build/lib/protectFs.js.map +1 -1
- package/build/lib/sandbox.js +2 -2
- package/build/lib/sandbox.js.map +1 -1
- package/build/main.js +72 -17
- package/build/main.js.map +1 -1
- package/build/types.d.ts +2 -0
- package/docs/de/README.md +21 -8
- package/docs/de/blockly.md +34 -0
- package/docs/en/README.md +21 -8
- package/docs/en/blockly.md +34 -0
- package/install/installTypings.js +1 -1
- package/io-package.json +27 -66
- package/package.json +7 -6
- package/admin/assets/OpenAiDialog-Dx-XNET0.js +0 -13
- package/admin/assets/ScriptEditorVanillaMonaco-yq11eIYC.js +0 -1
- package/admin/assets/docs-BrInh2Pn.js +0 -2036
- package/admin/assets/index-CLJ6-h9Q.js +0 -1
- package/admin/assets/index-COZhHfBn.js +0 -1230
- package/admin/assets/index-Cu-TydZj.js +0 -5
- package/admin/assets/index-Dnbw7_L3.js +0 -986
- package/admin/assets/index-gIA8x-8f.js +0 -1
- package/admin/assets/inheritsLoose-B0Ba5G9z.js +0 -29
- package/admin/assets/useTheme-hy6f3gra.js +0 -1
- package/admin/custom/assets/index-CYc31Gwg.js +0 -960
|
@@ -5,4 +5,4 @@ const theme = ${JSON.stringify(t,null,2)};
|
|
|
5
5
|
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
6
6
|
theme.transitions = createTransitions(theme.transitions || {});
|
|
7
7
|
|
|
8
|
-
export default theme;`}function Ue(e={},...t){const{breakpoints:r,mixins:n={},spacing:a,palette:o={},transitions:s={},typography:c={},shape:u,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(ce(20));const p=Yt(o),d=Ht(e);let m=H(d,{mixins:Go(d.breakpoints,n),palette:p,shadows:qo.slice(),typography:Ko(p,c),transitions:Jo(s),zIndex:{...ei}});return m=H(m,f),m=t.reduce((S,g)=>H(S,g),m),m.unstable_sxConfig={...pt,...f==null?void 0:f.unstable_sxConfig},m.unstable_sx=function(g){return Se({sx:g,theme:this})},m.toRuntimeSource=Zr,m}function Ii(...e){return Ue(...e)}function ri(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const ni=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=ri(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Jr(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function en(e){return e==="dark"?ni:[]}function ai(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...a}=e,o=Yt(t);return{palette:o,opacity:{...Jr(o.mode),...r},overlays:n||en(o.mode),...a}}function oi(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const ii=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],si=e=>(t,r)=>{const n=e.rootSelector||":root",a=e.colorSchemeSelector;let o=a;if(a==="class"&&(o=".%s"),a==="data"&&(o="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(o=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return ii(e.cssVarPrefix).forEach(c=>{s[c]=r[c],delete r[c]}),o==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:s}}:o?{[o.replace("%s",t)]:s,[`${n}, ${o.replace("%s",t)}`]:r}:{[n]:{...r,...s}}}if(o&&o!=="media")return`${n}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(o)return o.replace("%s",String(t))}return n};function ci(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function l(e,t,r){!e[t]&&r&&(e[t]=r)}function Te(e){return typeof e!="string"||!e.startsWith("hsl")?e:Yr(e)}function re(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Ae(Te(e[t])))}function li(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Z=e=>{try{return e()}catch{}},ui=(e="mui")=>Oo(e);function St(e,t,r,n){if(!t)return;t=t===!0?{}:t;const a=n==="dark"?"dark":"light";if(!r){e[n]=ai({...t,palette:{mode:a,...t==null?void 0:t.palette}});return}const{palette:o,...s}=Ue({...r,palette:{mode:a,...t==null?void 0:t.palette}});return e[n]={...t,palette:o,opacity:{...Jr(a),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||en(a)},s}function fi(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:a=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=oi,colorSchemeSelector:c=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...f}=e,p=Object.keys(r)[0],d=n||(r.light&&p!=="light"?"light":p),m=ui(o),{[d]:S,light:g,dark:h,...b}=r,v={...b};let A=S;if((d==="dark"&&!("dark"in r)||d==="light"&&!("light"in r))&&(A=!0),!A)throw new Error(ce(21,d));const x=St(v,A,f,d);g&&!v.light&&St(v,g,void 0,"light"),h&&!v.dark&&St(v,h,void 0,"dark");let w={defaultColorScheme:d,...x,cssVarPrefix:o,colorSchemeSelector:c,rootSelector:u,getCssVar:m,colorSchemes:v,font:{...Wo(x.typography),...x.font},spacing:li(f.spacing)};Object.keys(w.colorSchemes).forEach(F=>{const i=w.colorSchemes[F].palette,y=T=>{const _=T.split("-"),Y=_[1],G=_[2];return m(T,i[Y][G])};if(i.mode==="light"&&(l(i.common,"background","#fff"),l(i.common,"onBackground","#000")),i.mode==="dark"&&(l(i.common,"background","#000"),l(i.common,"onBackground","#fff")),ci(i,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),i.mode==="light"){l(i.Alert,"errorColor",E(i.error.light,.6)),l(i.Alert,"infoColor",E(i.info.light,.6)),l(i.Alert,"successColor",E(i.success.light,.6)),l(i.Alert,"warningColor",E(i.warning.light,.6)),l(i.Alert,"errorFilledBg",y("palette-error-main")),l(i.Alert,"infoFilledBg",y("palette-info-main")),l(i.Alert,"successFilledBg",y("palette-success-main")),l(i.Alert,"warningFilledBg",y("palette-warning-main")),l(i.Alert,"errorFilledColor",Z(()=>i.getContrastText(i.error.main))),l(i.Alert,"infoFilledColor",Z(()=>i.getContrastText(i.info.main))),l(i.Alert,"successFilledColor",Z(()=>i.getContrastText(i.success.main))),l(i.Alert,"warningFilledColor",Z(()=>i.getContrastText(i.warning.main))),l(i.Alert,"errorStandardBg",R(i.error.light,.9)),l(i.Alert,"infoStandardBg",R(i.info.light,.9)),l(i.Alert,"successStandardBg",R(i.success.light,.9)),l(i.Alert,"warningStandardBg",R(i.warning.light,.9)),l(i.Alert,"errorIconColor",y("palette-error-main")),l(i.Alert,"infoIconColor",y("palette-info-main")),l(i.Alert,"successIconColor",y("palette-success-main")),l(i.Alert,"warningIconColor",y("palette-warning-main")),l(i.AppBar,"defaultBg",y("palette-grey-100")),l(i.Avatar,"defaultBg",y("palette-grey-400")),l(i.Button,"inheritContainedBg",y("palette-grey-300")),l(i.Button,"inheritContainedHoverBg",y("palette-grey-A100")),l(i.Chip,"defaultBorder",y("palette-grey-400")),l(i.Chip,"defaultAvatarColor",y("palette-grey-700")),l(i.Chip,"defaultIconColor",y("palette-grey-700")),l(i.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),l(i.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),l(i.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),l(i.LinearProgress,"primaryBg",R(i.primary.main,.62)),l(i.LinearProgress,"secondaryBg",R(i.secondary.main,.62)),l(i.LinearProgress,"errorBg",R(i.error.main,.62)),l(i.LinearProgress,"infoBg",R(i.info.main,.62)),l(i.LinearProgress,"successBg",R(i.success.main,.62)),l(i.LinearProgress,"warningBg",R(i.warning.main,.62)),l(i.Skeleton,"bg",`rgba(${y("palette-text-primaryChannel")} / 0.11)`),l(i.Slider,"primaryTrack",R(i.primary.main,.62)),l(i.Slider,"secondaryTrack",R(i.secondary.main,.62)),l(i.Slider,"errorTrack",R(i.error.main,.62)),l(i.Slider,"infoTrack",R(i.info.main,.62)),l(i.Slider,"successTrack",R(i.success.main,.62)),l(i.Slider,"warningTrack",R(i.warning.main,.62));const T=je(i.background.default,.8);l(i.SnackbarContent,"bg",T),l(i.SnackbarContent,"color",Z(()=>i.getContrastText(T))),l(i.SpeedDialAction,"fabHoverBg",je(i.background.paper,.15)),l(i.StepConnector,"border",y("palette-grey-400")),l(i.StepContent,"border",y("palette-grey-400")),l(i.Switch,"defaultColor",y("palette-common-white")),l(i.Switch,"defaultDisabledColor",y("palette-grey-100")),l(i.Switch,"primaryDisabledColor",R(i.primary.main,.62)),l(i.Switch,"secondaryDisabledColor",R(i.secondary.main,.62)),l(i.Switch,"errorDisabledColor",R(i.error.main,.62)),l(i.Switch,"infoDisabledColor",R(i.info.main,.62)),l(i.Switch,"successDisabledColor",R(i.success.main,.62)),l(i.Switch,"warningDisabledColor",R(i.warning.main,.62)),l(i.TableCell,"border",R(Me(i.divider,1),.88)),l(i.Tooltip,"bg",Me(i.grey[700],.92))}if(i.mode==="dark"){l(i.Alert,"errorColor",R(i.error.light,.6)),l(i.Alert,"infoColor",R(i.info.light,.6)),l(i.Alert,"successColor",R(i.success.light,.6)),l(i.Alert,"warningColor",R(i.warning.light,.6)),l(i.Alert,"errorFilledBg",y("palette-error-dark")),l(i.Alert,"infoFilledBg",y("palette-info-dark")),l(i.Alert,"successFilledBg",y("palette-success-dark")),l(i.Alert,"warningFilledBg",y("palette-warning-dark")),l(i.Alert,"errorFilledColor",Z(()=>i.getContrastText(i.error.dark))),l(i.Alert,"infoFilledColor",Z(()=>i.getContrastText(i.info.dark))),l(i.Alert,"successFilledColor",Z(()=>i.getContrastText(i.success.dark))),l(i.Alert,"warningFilledColor",Z(()=>i.getContrastText(i.warning.dark))),l(i.Alert,"errorStandardBg",E(i.error.light,.9)),l(i.Alert,"infoStandardBg",E(i.info.light,.9)),l(i.Alert,"successStandardBg",E(i.success.light,.9)),l(i.Alert,"warningStandardBg",E(i.warning.light,.9)),l(i.Alert,"errorIconColor",y("palette-error-main")),l(i.Alert,"infoIconColor",y("palette-info-main")),l(i.Alert,"successIconColor",y("palette-success-main")),l(i.Alert,"warningIconColor",y("palette-warning-main")),l(i.AppBar,"defaultBg",y("palette-grey-900")),l(i.AppBar,"darkBg",y("palette-background-paper")),l(i.AppBar,"darkColor",y("palette-text-primary")),l(i.Avatar,"defaultBg",y("palette-grey-600")),l(i.Button,"inheritContainedBg",y("palette-grey-800")),l(i.Button,"inheritContainedHoverBg",y("palette-grey-700")),l(i.Chip,"defaultBorder",y("palette-grey-700")),l(i.Chip,"defaultAvatarColor",y("palette-grey-300")),l(i.Chip,"defaultIconColor",y("palette-grey-300")),l(i.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),l(i.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),l(i.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),l(i.LinearProgress,"primaryBg",E(i.primary.main,.5)),l(i.LinearProgress,"secondaryBg",E(i.secondary.main,.5)),l(i.LinearProgress,"errorBg",E(i.error.main,.5)),l(i.LinearProgress,"infoBg",E(i.info.main,.5)),l(i.LinearProgress,"successBg",E(i.success.main,.5)),l(i.LinearProgress,"warningBg",E(i.warning.main,.5)),l(i.Skeleton,"bg",`rgba(${y("palette-text-primaryChannel")} / 0.13)`),l(i.Slider,"primaryTrack",E(i.primary.main,.5)),l(i.Slider,"secondaryTrack",E(i.secondary.main,.5)),l(i.Slider,"errorTrack",E(i.error.main,.5)),l(i.Slider,"infoTrack",E(i.info.main,.5)),l(i.Slider,"successTrack",E(i.success.main,.5)),l(i.Slider,"warningTrack",E(i.warning.main,.5));const T=je(i.background.default,.98);l(i.SnackbarContent,"bg",T),l(i.SnackbarContent,"color",Z(()=>i.getContrastText(T))),l(i.SpeedDialAction,"fabHoverBg",je(i.background.paper,.15)),l(i.StepConnector,"border",y("palette-grey-600")),l(i.StepContent,"border",y("palette-grey-600")),l(i.Switch,"defaultColor",y("palette-grey-300")),l(i.Switch,"defaultDisabledColor",y("palette-grey-600")),l(i.Switch,"primaryDisabledColor",E(i.primary.main,.55)),l(i.Switch,"secondaryDisabledColor",E(i.secondary.main,.55)),l(i.Switch,"errorDisabledColor",E(i.error.main,.55)),l(i.Switch,"infoDisabledColor",E(i.info.main,.55)),l(i.Switch,"successDisabledColor",E(i.success.main,.55)),l(i.Switch,"warningDisabledColor",E(i.warning.main,.55)),l(i.TableCell,"border",E(Me(i.divider,1),.68)),l(i.Tooltip,"bg",Me(i.grey[700],.92))}re(i.background,"default"),re(i.background,"paper"),re(i.common,"background"),re(i.common,"onBackground"),re(i,"divider"),Object.keys(i).forEach(T=>{const _=i[T];T!=="tonalOffset"&&_&&typeof _=="object"&&(_.main&&l(i[T],"mainChannel",Ae(Te(_.main))),_.light&&l(i[T],"lightChannel",Ae(Te(_.light))),_.dark&&l(i[T],"darkChannel",Ae(Te(_.dark))),_.contrastText&&l(i[T],"contrastTextChannel",Ae(Te(_.contrastText))),T==="text"&&(re(i[T],"primary"),re(i[T],"secondary")),T==="action"&&(_.active&&re(i[T],"active"),_.selected&&re(i[T],"selected")))})}),w=t.reduce((F,i)=>H(F,i),w);const $={prefix:o,disableCssColorScheme:a,shouldSkipGeneratingVar:s,getSelector:si(w)},{vars:k,generateThemeVars:C,generateStyleSheets:N}=Ro(w,$);return w.vars=k,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([F,i])=>{w[F]=i}),w.generateThemeVars=C,w.generateStyleSheets=N,w.generateSpacing=function(){return Gr(f.spacing,Wt(this))},w.getColorSchemeSelector=Bo(c),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=s,w.unstable_sxConfig={...pt,...f==null?void 0:f.unstable_sxConfig},w.unstable_sx=function(i){return Se({sx:i,theme:this})},w.toRuntimeSource=Zr,w}function br(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Yt({...r===!0?{}:r.palette,mode:t})})}function di(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:a=r?void 0:{light:!0},defaultColorScheme:o=r==null?void 0:r.mode,...s}=e,c=o||"light",u=a==null?void 0:a[c],f={...a,...r?{[c]:{...typeof u!="boolean"&&u,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Ue(e,...t);let p=r;"palette"in e||f[c]&&(f[c]!==!0?p=f[c].palette:c==="dark"&&(p={mode:"dark"}));const d=Ue({...e,palette:p},...t);return d.defaultColorScheme=c,d.colorSchemes=f,d.palette.mode==="light"&&(d.colorSchemes.light={...f.light!==!0&&f.light,palette:d.palette},br(d,"dark",f.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:d.palette},br(d,"light",f.light)),d}return!r&&!("light"in f)&&c==="light"&&(f.light=!0),fi({...s,colorSchemes:f,defaultColorScheme:c,...typeof n!="boolean"&&n},...t)}const mi=di();function pi(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const hi=e=>pi(e)&&e!=="classes",gi=mo({themeId:fn,defaultTheme:mi,rootShouldForwardProp:hi}),yi=Po;function bi(e){return $o(e)}function Si(e){return Kr("MuiSvgIcon",e)}const Fi=co("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),vi=e=>{const{color:t,fontSize:r,classes:n}=e,a={root:["root",t!=="inherit"&&`color${be(t)}`,`fontSize${be(r)}`]};return Ao(a,Si,n)},Ci=gi("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${be(r.color)}`],t[`fontSize${be(r.fontSize)}`]]}})(yi(({theme:e})=>{var t,r,n,a,o,s,c,u,f,p,d,m,S,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(a=(t=e.transitions)==null?void 0:t.create)==null?void 0:a.call(t,"fill",{duration:(n=(r=(e.vars??e).transitions)==null?void 0:r.duration)==null?void 0:n.shorter}),variants:[{props:h=>!h.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((p=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:p.call(f,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,h])=>h&&h.main).map(([h])=>{var b,v;return{props:{color:h},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[h])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(g=(S=(e.vars??e).palette)==null?void 0:S.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Pt=_t(function(t,r){const n=bi({props:t,name:"MuiSvgIcon"}),{children:a,className:o,color:s="inherit",component:c="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:p=!1,titleAccess:d,viewBox:m="0 0 24 24",...S}=n,g=Et(a)&&a.type==="svg",h={...n,color:s,component:c,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:m,hasSvgAsChild:g},b={};p||(b.viewBox=m);const v=vi(h);return Ge.jsxs(Ci,{as:c,className:io(v.root,o),focusable:"false",color:f,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:r,...b,...S,...g&&a.props,ownerState:h,children:[g?a.props.children:a,d?Ge.jsx("title",{children:d}):null]})});Pt.muiName="SvgIcon";function Li(e,t){function r(n,a){return Ge.jsx(Pt,{"data-testid":`${t}Icon`,ref:a,...n,children:e})}return r.muiName=Pt.muiName,rn(_t(r))}export{Pt as $,Oi as A,Fe as B,Gr as C,ca as D,ce as E,mi as F,fi as G,oo as H,fe as I,Ee as J,de as K,le as L,co as M,bi as N,Qo as O,gi as P,yi as Q,ri as R,Ut as S,fn as T,Vt as U,ko as V,hi as W,ct as X,pi as Y,bo as Z,vt as _,Io as a,So as a0,Ri as a1,Yr as a2,oe as a3,ht as a4,wo as a5,$t as a6,Ii as a7,Jo as a8,Xo as a9,ai as aa,oi as ab,Ko as ac,Go as ad,ii as ae,Fi as af,Si as ag,Lt as ah,Lr as ai,Mt as aj,Ai as ak,Er as al,Mr as am,Pi as an,$i as ao,Ti as ap,Dn as aq,pn as ar,se as as,Bi as at,di as b,Li as c,xo as d,ne as e,pt as f,me as g,Se as h,Qn as i,Ge as j,io as k,mo as l,Tt as m,ro as n,ke as o,be as p,Ao as q,ue as r,na as s,Ht as t,Ei as u,Kr as v,ae as w,_i as x,Wt as y,H as z};
|
|
8
|
+
export default theme;`}function Ue(e={},...t){const{breakpoints:r,mixins:n={},spacing:a,palette:o={},transitions:s={},typography:c={},shape:u,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(ce(20));const p=Yt(o),d=Ht(e);let m=H(d,{mixins:Go(d.breakpoints,n),palette:p,shadows:qo.slice(),typography:Ko(p,c),transitions:Jo(s),zIndex:{...ei}});return m=H(m,f),m=t.reduce((S,g)=>H(S,g),m),m.unstable_sxConfig={...pt,...f==null?void 0:f.unstable_sxConfig},m.unstable_sx=function(g){return Se({sx:g,theme:this})},m.toRuntimeSource=Zr,m}function Ii(...e){return Ue(...e)}function ri(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const ni=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=ri(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Jr(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function en(e){return e==="dark"?ni:[]}function ai(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...a}=e,o=Yt(t);return{palette:o,opacity:{...Jr(o.mode),...r},overlays:n||en(o.mode),...a}}function oi(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const ii=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],si=e=>(t,r)=>{const n=e.rootSelector||":root",a=e.colorSchemeSelector;let o=a;if(a==="class"&&(o=".%s"),a==="data"&&(o="[data-%s]"),a!=null&&a.startsWith("data-")&&!a.includes("%s")&&(o=`[${a}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return ii(e.cssVarPrefix).forEach(c=>{s[c]=r[c],delete r[c]}),o==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:s}}:o?{[o.replace("%s",t)]:s,[`${n}, ${o.replace("%s",t)}`]:r}:{[n]:{...r,...s}}}if(o&&o!=="media")return`${n}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(o)return o.replace("%s",String(t))}return n};function ci(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function l(e,t,r){!e[t]&&r&&(e[t]=r)}function Te(e){return typeof e!="string"||!e.startsWith("hsl")?e:Yr(e)}function re(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Ae(Te(e[t])))}function li(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Z=e=>{try{return e()}catch{}},ui=(e="mui")=>Oo(e);function St(e,t,r,n){if(!t)return;t=t===!0?{}:t;const a=n==="dark"?"dark":"light";if(!r){e[n]=ai({...t,palette:{mode:a,...t==null?void 0:t.palette}});return}const{palette:o,...s}=Ue({...r,palette:{mode:a,...t==null?void 0:t.palette}});return e[n]={...t,palette:o,opacity:{...Jr(a),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||en(a)},s}function fi(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:a=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:s=oi,colorSchemeSelector:c=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...f}=e,p=Object.keys(r)[0],d=n||(r.light&&p!=="light"?"light":p),m=ui(o),{[d]:S,light:g,dark:h,...b}=r,v={...b};let A=S;if((d==="dark"&&!("dark"in r)||d==="light"&&!("light"in r))&&(A=!0),!A)throw new Error(ce(21,d));const x=St(v,A,f,d);g&&!v.light&&St(v,g,void 0,"light"),h&&!v.dark&&St(v,h,void 0,"dark");let w={defaultColorScheme:d,...x,cssVarPrefix:o,colorSchemeSelector:c,rootSelector:u,getCssVar:m,colorSchemes:v,font:{...Wo(x.typography),...x.font},spacing:li(f.spacing)};Object.keys(w.colorSchemes).forEach(F=>{const i=w.colorSchemes[F].palette,y=T=>{const _=T.split("-"),Y=_[1],G=_[2];return m(T,i[Y][G])};if(i.mode==="light"&&(l(i.common,"background","#fff"),l(i.common,"onBackground","#000")),i.mode==="dark"&&(l(i.common,"background","#000"),l(i.common,"onBackground","#fff")),ci(i,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),i.mode==="light"){l(i.Alert,"errorColor",E(i.error.light,.6)),l(i.Alert,"infoColor",E(i.info.light,.6)),l(i.Alert,"successColor",E(i.success.light,.6)),l(i.Alert,"warningColor",E(i.warning.light,.6)),l(i.Alert,"errorFilledBg",y("palette-error-main")),l(i.Alert,"infoFilledBg",y("palette-info-main")),l(i.Alert,"successFilledBg",y("palette-success-main")),l(i.Alert,"warningFilledBg",y("palette-warning-main")),l(i.Alert,"errorFilledColor",Z(()=>i.getContrastText(i.error.main))),l(i.Alert,"infoFilledColor",Z(()=>i.getContrastText(i.info.main))),l(i.Alert,"successFilledColor",Z(()=>i.getContrastText(i.success.main))),l(i.Alert,"warningFilledColor",Z(()=>i.getContrastText(i.warning.main))),l(i.Alert,"errorStandardBg",R(i.error.light,.9)),l(i.Alert,"infoStandardBg",R(i.info.light,.9)),l(i.Alert,"successStandardBg",R(i.success.light,.9)),l(i.Alert,"warningStandardBg",R(i.warning.light,.9)),l(i.Alert,"errorIconColor",y("palette-error-main")),l(i.Alert,"infoIconColor",y("palette-info-main")),l(i.Alert,"successIconColor",y("palette-success-main")),l(i.Alert,"warningIconColor",y("palette-warning-main")),l(i.AppBar,"defaultBg",y("palette-grey-100")),l(i.Avatar,"defaultBg",y("palette-grey-400")),l(i.Button,"inheritContainedBg",y("palette-grey-300")),l(i.Button,"inheritContainedHoverBg",y("palette-grey-A100")),l(i.Chip,"defaultBorder",y("palette-grey-400")),l(i.Chip,"defaultAvatarColor",y("palette-grey-700")),l(i.Chip,"defaultIconColor",y("palette-grey-700")),l(i.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),l(i.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),l(i.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),l(i.LinearProgress,"primaryBg",R(i.primary.main,.62)),l(i.LinearProgress,"secondaryBg",R(i.secondary.main,.62)),l(i.LinearProgress,"errorBg",R(i.error.main,.62)),l(i.LinearProgress,"infoBg",R(i.info.main,.62)),l(i.LinearProgress,"successBg",R(i.success.main,.62)),l(i.LinearProgress,"warningBg",R(i.warning.main,.62)),l(i.Skeleton,"bg",`rgba(${y("palette-text-primaryChannel")} / 0.11)`),l(i.Slider,"primaryTrack",R(i.primary.main,.62)),l(i.Slider,"secondaryTrack",R(i.secondary.main,.62)),l(i.Slider,"errorTrack",R(i.error.main,.62)),l(i.Slider,"infoTrack",R(i.info.main,.62)),l(i.Slider,"successTrack",R(i.success.main,.62)),l(i.Slider,"warningTrack",R(i.warning.main,.62));const T=je(i.background.default,.8);l(i.SnackbarContent,"bg",T),l(i.SnackbarContent,"color",Z(()=>i.getContrastText(T))),l(i.SpeedDialAction,"fabHoverBg",je(i.background.paper,.15)),l(i.StepConnector,"border",y("palette-grey-400")),l(i.StepContent,"border",y("palette-grey-400")),l(i.Switch,"defaultColor",y("palette-common-white")),l(i.Switch,"defaultDisabledColor",y("palette-grey-100")),l(i.Switch,"primaryDisabledColor",R(i.primary.main,.62)),l(i.Switch,"secondaryDisabledColor",R(i.secondary.main,.62)),l(i.Switch,"errorDisabledColor",R(i.error.main,.62)),l(i.Switch,"infoDisabledColor",R(i.info.main,.62)),l(i.Switch,"successDisabledColor",R(i.success.main,.62)),l(i.Switch,"warningDisabledColor",R(i.warning.main,.62)),l(i.TableCell,"border",R(Me(i.divider,1),.88)),l(i.Tooltip,"bg",Me(i.grey[700],.92))}if(i.mode==="dark"){l(i.Alert,"errorColor",R(i.error.light,.6)),l(i.Alert,"infoColor",R(i.info.light,.6)),l(i.Alert,"successColor",R(i.success.light,.6)),l(i.Alert,"warningColor",R(i.warning.light,.6)),l(i.Alert,"errorFilledBg",y("palette-error-dark")),l(i.Alert,"infoFilledBg",y("palette-info-dark")),l(i.Alert,"successFilledBg",y("palette-success-dark")),l(i.Alert,"warningFilledBg",y("palette-warning-dark")),l(i.Alert,"errorFilledColor",Z(()=>i.getContrastText(i.error.dark))),l(i.Alert,"infoFilledColor",Z(()=>i.getContrastText(i.info.dark))),l(i.Alert,"successFilledColor",Z(()=>i.getContrastText(i.success.dark))),l(i.Alert,"warningFilledColor",Z(()=>i.getContrastText(i.warning.dark))),l(i.Alert,"errorStandardBg",E(i.error.light,.9)),l(i.Alert,"infoStandardBg",E(i.info.light,.9)),l(i.Alert,"successStandardBg",E(i.success.light,.9)),l(i.Alert,"warningStandardBg",E(i.warning.light,.9)),l(i.Alert,"errorIconColor",y("palette-error-main")),l(i.Alert,"infoIconColor",y("palette-info-main")),l(i.Alert,"successIconColor",y("palette-success-main")),l(i.Alert,"warningIconColor",y("palette-warning-main")),l(i.AppBar,"defaultBg",y("palette-grey-900")),l(i.AppBar,"darkBg",y("palette-background-paper")),l(i.AppBar,"darkColor",y("palette-text-primary")),l(i.Avatar,"defaultBg",y("palette-grey-600")),l(i.Button,"inheritContainedBg",y("palette-grey-800")),l(i.Button,"inheritContainedHoverBg",y("palette-grey-700")),l(i.Chip,"defaultBorder",y("palette-grey-700")),l(i.Chip,"defaultAvatarColor",y("palette-grey-300")),l(i.Chip,"defaultIconColor",y("palette-grey-300")),l(i.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),l(i.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),l(i.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),l(i.LinearProgress,"primaryBg",E(i.primary.main,.5)),l(i.LinearProgress,"secondaryBg",E(i.secondary.main,.5)),l(i.LinearProgress,"errorBg",E(i.error.main,.5)),l(i.LinearProgress,"infoBg",E(i.info.main,.5)),l(i.LinearProgress,"successBg",E(i.success.main,.5)),l(i.LinearProgress,"warningBg",E(i.warning.main,.5)),l(i.Skeleton,"bg",`rgba(${y("palette-text-primaryChannel")} / 0.13)`),l(i.Slider,"primaryTrack",E(i.primary.main,.5)),l(i.Slider,"secondaryTrack",E(i.secondary.main,.5)),l(i.Slider,"errorTrack",E(i.error.main,.5)),l(i.Slider,"infoTrack",E(i.info.main,.5)),l(i.Slider,"successTrack",E(i.success.main,.5)),l(i.Slider,"warningTrack",E(i.warning.main,.5));const T=je(i.background.default,.98);l(i.SnackbarContent,"bg",T),l(i.SnackbarContent,"color",Z(()=>i.getContrastText(T))),l(i.SpeedDialAction,"fabHoverBg",je(i.background.paper,.15)),l(i.StepConnector,"border",y("palette-grey-600")),l(i.StepContent,"border",y("palette-grey-600")),l(i.Switch,"defaultColor",y("palette-grey-300")),l(i.Switch,"defaultDisabledColor",y("palette-grey-600")),l(i.Switch,"primaryDisabledColor",E(i.primary.main,.55)),l(i.Switch,"secondaryDisabledColor",E(i.secondary.main,.55)),l(i.Switch,"errorDisabledColor",E(i.error.main,.55)),l(i.Switch,"infoDisabledColor",E(i.info.main,.55)),l(i.Switch,"successDisabledColor",E(i.success.main,.55)),l(i.Switch,"warningDisabledColor",E(i.warning.main,.55)),l(i.TableCell,"border",E(Me(i.divider,1),.68)),l(i.Tooltip,"bg",Me(i.grey[700],.92))}re(i.background,"default"),re(i.background,"paper"),re(i.common,"background"),re(i.common,"onBackground"),re(i,"divider"),Object.keys(i).forEach(T=>{const _=i[T];T!=="tonalOffset"&&_&&typeof _=="object"&&(_.main&&l(i[T],"mainChannel",Ae(Te(_.main))),_.light&&l(i[T],"lightChannel",Ae(Te(_.light))),_.dark&&l(i[T],"darkChannel",Ae(Te(_.dark))),_.contrastText&&l(i[T],"contrastTextChannel",Ae(Te(_.contrastText))),T==="text"&&(re(i[T],"primary"),re(i[T],"secondary")),T==="action"&&(_.active&&re(i[T],"active"),_.selected&&re(i[T],"selected")))})}),w=t.reduce((F,i)=>H(F,i),w);const $={prefix:o,disableCssColorScheme:a,shouldSkipGeneratingVar:s,getSelector:si(w)},{vars:k,generateThemeVars:C,generateStyleSheets:N}=Ro(w,$);return w.vars=k,Object.entries(w.colorSchemes[w.defaultColorScheme]).forEach(([F,i])=>{w[F]=i}),w.generateThemeVars=C,w.generateStyleSheets=N,w.generateSpacing=function(){return Gr(f.spacing,Wt(this))},w.getColorSchemeSelector=Bo(c),w.spacing=w.generateSpacing(),w.shouldSkipGeneratingVar=s,w.unstable_sxConfig={...pt,...f==null?void 0:f.unstable_sxConfig},w.unstable_sx=function(i){return Se({sx:i,theme:this})},w.toRuntimeSource=Zr,w}function br(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Yt({...r===!0?{}:r.palette,mode:t})})}function di(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:a=r?void 0:{light:!0},defaultColorScheme:o=r==null?void 0:r.mode,...s}=e,c=o||"light",u=a==null?void 0:a[c],f={...a,...r?{[c]:{...typeof u!="boolean"&&u,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Ue(e,...t);let p=r;"palette"in e||f[c]&&(f[c]!==!0?p=f[c].palette:c==="dark"&&(p={mode:"dark"}));const d=Ue({...e,palette:p},...t);return d.defaultColorScheme=c,d.colorSchemes=f,d.palette.mode==="light"&&(d.colorSchemes.light={...f.light!==!0&&f.light,palette:d.palette},br(d,"dark",f.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:d.palette},br(d,"light",f.light)),d}return!r&&!("light"in f)&&c==="light"&&(f.light=!0),fi({...s,colorSchemes:f,defaultColorScheme:c,...typeof n!="boolean"&&n},...t)}const mi=di();function pi(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const hi=e=>pi(e)&&e!=="classes",gi=mo({themeId:fn,defaultTheme:mi,rootShouldForwardProp:hi}),yi=Po;function bi(e){return $o(e)}function Si(e){return Kr("MuiSvgIcon",e)}const Fi=co("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]),vi=e=>{const{color:t,fontSize:r,classes:n}=e,a={root:["root",t!=="inherit"&&`color${be(t)}`,`fontSize${be(r)}`]};return Ao(a,Si,n)},Ci=gi("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${be(r.color)}`],t[`fontSize${be(r.fontSize)}`]]}})(yi(({theme:e})=>{var t,r,n,a,o,s,c,u,f,p,d,m,S,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(a=(t=e.transitions)==null?void 0:t.create)==null?void 0:a.call(t,"fill",{duration:(n=(r=(e.vars??e).transitions)==null?void 0:r.duration)==null?void 0:n.shorter}),variants:[{props:h=>!h.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(o=e.typography)==null?void 0:o.pxToRem)==null?void 0:s.call(o,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((u=(c=e.typography)==null?void 0:c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((p=(f=e.typography)==null?void 0:f.pxToRem)==null?void 0:p.call(f,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,h])=>h&&h.main).map(([h])=>{var b,v;return{props:{color:h},style:{color:(v=(b=(e.vars??e).palette)==null?void 0:b[h])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(m=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:m.active}},{props:{color:"disabled"},style:{color:(g=(S=(e.vars??e).palette)==null?void 0:S.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Pt=_t(function(t,r){const n=bi({props:t,name:"MuiSvgIcon"}),{children:a,className:o,color:s="inherit",component:c="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:p=!1,titleAccess:d,viewBox:m="0 0 24 24",...S}=n,g=Et(a)&&a.type==="svg",h={...n,color:s,component:c,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:p,viewBox:m,hasSvgAsChild:g},b={};p||(b.viewBox=m);const v=vi(h);return Ge.jsxs(Ci,{as:c,className:io(v.root,o),focusable:"false",color:f,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:r,...b,...S,...g&&a.props,ownerState:h,children:[g?a.props.children:a,d?Ge.jsx("title",{children:d}):null]})});Pt.muiName="SvgIcon";function Li(e,t){function r(n,a){return Ge.jsx(Pt,{"data-testid":`${t}Icon`,ref:a,...n,children:e})}return r.muiName=Pt.muiName,rn(_t(r))}export{So as $,Fe as A,Gr as B,ca as C,ce as D,mi as E,fi as F,oo as G,fe as H,Ee as I,de as J,le as K,co as L,bi as M,Qo as N,gi as O,yi as P,ri as Q,Ut as R,Vt as S,fn as T,ko as U,hi as V,ct as W,pi as X,bo as Y,Pt as Z,vt as _,Io as a,Ri as a0,Yr as a1,oe as a2,ht as a3,wo as a4,$t as a5,Ii as a6,Jo as a7,Xo as a8,ai as a9,oi as aa,Ko as ab,Go as ac,ii as ad,Fi as ae,Si as af,Lt as ag,Lr as ah,Mt as ai,Ai as aj,Er as ak,Mr as al,Pi as am,$i as an,Ti as ao,Dn as ap,pn as aq,se as ar,Bi as as,di as b,Li as c,xo as d,pt as e,Se as f,me as g,io as h,ne as i,Ge as j,mo as k,Tt as l,ro as m,be as n,ke as o,Ao as p,Ht as q,ue as r,na as s,Kr as t,Ei as u,ae as v,_i as w,Wt as x,H as y,Oi as z};
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
const e=`# ioBroker JavaScript Adapter - API Reference
|
|
2
|
+
|
|
3
|
+
IMPORTANT RULES:
|
|
4
|
+
- ONLY use functions listed in this document. NEVER define your own helper functions.
|
|
5
|
+
- Use on() to react to state changes. NEVER use setTimeout/setInterval for polling states.
|
|
6
|
+
- Use setState(id, value) to control devices. Use getState(id).val to read values.
|
|
7
|
+
- All functions are pre-imported. NEVER use require() or import.
|
|
8
|
+
- Code runs inside an async context. You can use await directly.
|
|
9
|
+
|
|
10
|
+
## Quick Reference - Most Used Functions
|
|
11
|
+
|
|
12
|
+
\`\`\`js
|
|
13
|
+
// React to state changes:
|
|
14
|
+
on('adapter.0.device.state', (obj) => {
|
|
15
|
+
const val = obj.state.val;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Read a state value:
|
|
19
|
+
const val = getState('adapter.0.device.state').val;
|
|
20
|
+
|
|
21
|
+
// Set a state (control a device):
|
|
22
|
+
setState('adapter.0.device.state', true);
|
|
23
|
+
|
|
24
|
+
// Time-based schedule (cron):
|
|
25
|
+
schedule('0 7 * * *', () => { /* runs daily at 07:00 */ });
|
|
26
|
+
|
|
27
|
+
// Selector - find states by room/function:
|
|
28
|
+
$('state[state.id=*.state](rooms=Living room)').each((id) => {
|
|
29
|
+
setState(id, false);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Log output:
|
|
33
|
+
log('message');
|
|
34
|
+
\`\`\`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## exec(cmd, [options], callback)
|
|
39
|
+
Execute OS command. \`callback(error, stdout, stderr)\`. Requires "Enable command exec" option.
|
|
40
|
+
|
|
41
|
+
## on(pattern, callbackOrId, value)
|
|
42
|
+
Subscribe to state changes. Alias: \`subscribe\`. Returns handler for \`unsubscribe\`.
|
|
43
|
+
Callback receives \`{id, state: {val, ts, ack, lc, from}, oldState: {val, ts, ack, lc, from}}\`.
|
|
44
|
+
\`on('stateId1', 'stateId2')\` connects two states. \`on('stateId1', 'stateId2', 'triggered')\` sets fixed value.
|
|
45
|
+
Pattern can be: string ID, RegExp, or object with these properties:
|
|
46
|
+
- \`logic\` (string): "and"|"or" (default "and")
|
|
47
|
+
- \`id\` (string|RegExp|Array): state ID filter
|
|
48
|
+
- \`name\` (string|RegExp|Array): state name filter
|
|
49
|
+
- \`change\` (string): "eq","ne","gt","ge","lt","le","any" (default "ne" for string ID, "any" otherwise)
|
|
50
|
+
- \`val\`, \`valNe\`, \`valGt\`, \`valGe\`, \`valLt\`, \`valLe\` (mixed): new value conditions
|
|
51
|
+
- \`ack\` (boolean): new ack filter; \`q\` (number): quality filter (default 0, use '*' for any)
|
|
52
|
+
- \`oldVal\`, \`oldValNe\`, \`oldValGt\`, \`oldValGe\`, \`oldValLt\`, \`oldValLe\` (mixed): previous value conditions
|
|
53
|
+
- \`oldAck\` (bool), \`oldQ\` (number): previous ack/quality filters
|
|
54
|
+
- \`ts\`, \`tsGt\`, \`tsGe\`, \`tsLt\`, \`tsLe\` (string): new timestamp conditions
|
|
55
|
+
- \`oldTs\`, \`oldTsGt\`, \`oldTsGe\`, \`oldTsLt\`, \`oldTsLe\` (string): previous timestamp conditions
|
|
56
|
+
- \`lc\`, \`lcGt\`, \`lcGe\`, \`lcLt\`, \`lcLe\` (string): last change timestamp conditions
|
|
57
|
+
- \`oldLc\`, \`oldLcGt\`, \`oldLcGe\`, \`oldLcLt\`, \`oldLcLe\` (string): previous last change conditions
|
|
58
|
+
- \`channelId\`, \`channelName\`, \`deviceId\`, \`deviceName\` (string|RegExp|Array): channel/device filters
|
|
59
|
+
- \`enumId\`, \`enumName\` (string|RegExp|Array): enum filters
|
|
60
|
+
- \`from\`, \`fromNe\`, \`oldFrom\`, \`oldFromNe\` (string|RegExp|Array): adapter source filters
|
|
61
|
+
To get state deletions/expires, use \`change: 'ne'\` or \`'any'\` AND \`q: '*'\`.
|
|
62
|
+
|
|
63
|
+
## once(pattern, callback)
|
|
64
|
+
Like \`on()\`, but triggers only once then auto-unsubscribes.
|
|
65
|
+
|
|
66
|
+
## unsubscribe(idOrHandler)
|
|
67
|
+
Remove subscriptions by object ID (removes all) or by handler (removes specific).
|
|
68
|
+
|
|
69
|
+
## getSubscriptions()
|
|
70
|
+
Returns object \`{stateId: [{name, pattern}]}\` listing all state subscriptions.
|
|
71
|
+
|
|
72
|
+
## getFileSubscriptions()
|
|
73
|
+
Returns object listing all file subscriptions.
|
|
74
|
+
|
|
75
|
+
## schedule(pattern, callback)
|
|
76
|
+
Time scheduler with cron and astro support. Returns schedule object for \`clearSchedule\`.
|
|
77
|
+
Cron string: \`"sec min hour dayOfMonth month dayOfWeek"\` (sec optional, 5 or 6 fields).
|
|
78
|
+
Object pattern: \`{second, minute, hour, date, month, year, dayOfWeek}\`.
|
|
79
|
+
Date object: triggers once at that time.
|
|
80
|
+
With time range: \`{start, end, rule}\` where start/end are Date/string/ms, rule is cron string or object.
|
|
81
|
+
Astro: \`{astro: 'sunrise', shift: 10}\` (shift in minutes, can be negative).
|
|
82
|
+
Astro values: sunrise, sunriseEnd, goldenHourEnd, solarNoon, goldenHour, sunsetStart, sunset, dusk, nauticalDusk, night, nightEnd, nauticalDawn, dawn, nadir.
|
|
83
|
+
Requires latitude/longitude in adapter settings for astro.
|
|
84
|
+
Also works via \`on()\`: \`on({time: '*/2 * * * *'}, cb)\` or \`on({astro: 'sunset', shift: 10}, cb)\`.
|
|
85
|
+
|
|
86
|
+
## scheduleById(id, [ack], callback)
|
|
87
|
+
Schedule based on state value (format \`[h]h:[m]m[:ss]\`). Auto-updates when state changes.
|
|
88
|
+
|
|
89
|
+
## getSchedules(allScripts)
|
|
90
|
+
Returns list of all CRON/schedule jobs. Pass \`true\` for all scripts, otherwise current script only.
|
|
91
|
+
|
|
92
|
+
## clearSchedule(scheduleObject)
|
|
93
|
+
Cancel a schedule created by \`schedule()\`.
|
|
94
|
+
|
|
95
|
+
## getAttr(obj, path)
|
|
96
|
+
Get nested attribute: \`getAttr({a: {b: 5}}, 'a.b')\` returns 5. Parses JSON strings automatically.
|
|
97
|
+
|
|
98
|
+
## getAstroDate(pattern, date, offsetMinutes)
|
|
99
|
+
Returns Date object for astro event. Uses current day if no date given.
|
|
100
|
+
|
|
101
|
+
## isAstroDay()
|
|
102
|
+
Returns \`true\` if current time is between astro sunrise and sunset.
|
|
103
|
+
|
|
104
|
+
## compareTime(startTime, endTime, operation, timeToCompare)
|
|
105
|
+
Compare time with limits. Operations: ">", ">=", "<", "<=", "==", "<>", "between", "not between".
|
|
106
|
+
Times can be Date objects, date strings, time strings, or astro names.
|
|
107
|
+
Astro with offset: \`{astro: 'sunsetStart', offset: 30, date: new Date()}\`.
|
|
108
|
+
|
|
109
|
+
## setState(id, state, ack, callback)
|
|
110
|
+
Set state value. \`setState('id', 1)\` = \`setState('id', {val: 1, ack: false})\`.
|
|
111
|
+
\`ack=false\`: command to device; \`ack=true\`: confirmed state update.
|
|
112
|
+
|
|
113
|
+
## setStateAsync(id, state, ack)
|
|
114
|
+
Promise version of setState.
|
|
115
|
+
|
|
116
|
+
## setStateDelayed(id, state, isAck, delay, clearRunning, callback)
|
|
117
|
+
setState with delay in ms. Returns timer handler. \`clearRunning\` (default true) cancels previous delays.
|
|
118
|
+
|
|
119
|
+
## setStateChanged(id, state, ack)
|
|
120
|
+
Like setState, but only sets if value actually changed.
|
|
121
|
+
|
|
122
|
+
## setStateChangedAsync(id, state, ack)
|
|
123
|
+
Promise version of setStateChanged.
|
|
124
|
+
|
|
125
|
+
## clearStateDelayed(id, [timerId])
|
|
126
|
+
Clear delayed tasks for state ID, or specific timer.
|
|
127
|
+
|
|
128
|
+
## getStateDelayed(id)
|
|
129
|
+
Get list of running timers. Returns \`[{timerId, left, delay, val, ack}]\` for specific ID, or object keyed by ID for all.
|
|
130
|
+
|
|
131
|
+
## getState(id)
|
|
132
|
+
Returns \`{val, ack, ts, lc, from}\`. Returns \`{val: null, notExist: true}\` if missing.
|
|
133
|
+
|
|
134
|
+
## getStateAsync(id)
|
|
135
|
+
Promise version of getState.
|
|
136
|
+
|
|
137
|
+
## existsState(id, [callback])
|
|
138
|
+
Check if state exists. Sync (returns bool) if "Do not subscribe all states on start" is off, otherwise async.
|
|
139
|
+
|
|
140
|
+
## getObject(id, [enumName])
|
|
141
|
+
Get object description. With enumName (e.g. 'rooms' or true for all), adds enumIds/enumNames arrays.
|
|
142
|
+
|
|
143
|
+
## setObject(id, obj, callback)
|
|
144
|
+
Write object to DB. Use to modify objects read with getObject. Requires "Enable setObject" option.
|
|
145
|
+
|
|
146
|
+
## existsObject(id, [callback])
|
|
147
|
+
Check if object exists. Sync or async like existsState.
|
|
148
|
+
|
|
149
|
+
## extendObject(id, obj, callback)
|
|
150
|
+
Merge-update object. E.g. \`extendObject('system.adapter.sayit.0', {common: {enabled: false}})\`.
|
|
151
|
+
|
|
152
|
+
## deleteObject(id, [isRecursive], callback)
|
|
153
|
+
Delete object (and state value if type=state). \`isRecursive\` deletes children too.
|
|
154
|
+
|
|
155
|
+
## getIdByName(name, [alwaysArray])
|
|
156
|
+
Returns ID(s) for object with given name. Returns array if multiple or if \`alwaysArray\` is true.
|
|
157
|
+
|
|
158
|
+
## getEnums(enumName)
|
|
159
|
+
Get enums with members. Returns \`[{id, members, name}]\`.
|
|
160
|
+
|
|
161
|
+
## createState(name, [initialValue], [forceCreation], [common], [native], [callback])
|
|
162
|
+
Create state in \`javascript.X\` namespace. Prefer \`0_userdata.0.mystate\` for custom data points.
|
|
163
|
+
Common options: \`{type, role, read, write, name, unit, min, max, def, alias}\`.
|
|
164
|
+
Alias: set \`alias: true\` or \`alias: {id: 'alias.0.x', read: 'val/1000', write: 'val*1000'}\`.
|
|
165
|
+
|
|
166
|
+
## createStateAsync(name, [initialValue], [forceCreation], [common], [native])
|
|
167
|
+
Promise version of createState.
|
|
168
|
+
|
|
169
|
+
## deleteState(name, [callback])
|
|
170
|
+
Delete state in \`javascript.X\` namespace.
|
|
171
|
+
|
|
172
|
+
## deleteStateAsync(name)
|
|
173
|
+
Promise version of deleteState.
|
|
174
|
+
|
|
175
|
+
## createAlias(name, alias, [forceCreation], [common], [native], [callback])
|
|
176
|
+
Create alias in \`alias.0\` namespace. \`alias\` can be string ID or \`{id: {read: 'id1', write: 'id2'}}\`.
|
|
177
|
+
|
|
178
|
+
## createAliasAsync(name, alias, [forceCreation], [common], [native])
|
|
179
|
+
Promise version of createAlias.
|
|
180
|
+
|
|
181
|
+
## sendTo(adapter, command, message, [options], [callback])
|
|
182
|
+
Send message to adapter instance(s). \`options: {timeout}\` (default 20000ms).
|
|
183
|
+
E.g. \`sendTo('telegram.0', {user: 'User', text: 'Hi'})\`.
|
|
184
|
+
|
|
185
|
+
## sendToAsync(adapter, command, message, [options])
|
|
186
|
+
Promise version of sendTo.
|
|
187
|
+
|
|
188
|
+
## sendToHost(hostName, command, message, [callback])
|
|
189
|
+
Send message to host controller. Commands: cmdExec, getRepository, getInstalled, getVersion, getDiagData, getLocationOnDisk, getDevList, getLogs, getHostInfo.
|
|
190
|
+
|
|
191
|
+
## sendToHostAsync(hostName, command, message)
|
|
192
|
+
Promise version of sendToHost.
|
|
193
|
+
|
|
194
|
+
## setInterval(callback, ms, ...args)
|
|
195
|
+
Same as JS setInterval.
|
|
196
|
+
|
|
197
|
+
## clearInterval(id)
|
|
198
|
+
Same as JS clearInterval.
|
|
199
|
+
|
|
200
|
+
## setTimeout(callback, ms, ...args)
|
|
201
|
+
Same as JS setTimeout.
|
|
202
|
+
|
|
203
|
+
## clearTimeout(id)
|
|
204
|
+
Same as JS clearTimeout.
|
|
205
|
+
|
|
206
|
+
## setImmediate(callback, ...args)
|
|
207
|
+
Same as JS setImmediate (higher priority than setTimeout 0).
|
|
208
|
+
|
|
209
|
+
## formatDate(millisecondsOrDate, [format])
|
|
210
|
+
Format date. Tokens: YYYY(year), MM(month), DD(day), hh(hours), mm(min), ss(sec), sss(ms), WW/W(weekday), OO/O(month name).
|
|
211
|
+
|
|
212
|
+
## formatTimeDiff(milliseconds, [format])
|
|
213
|
+
Format time difference. Default \`hh:mm:ss\`. Tokens: DD/D(days), hh/h, mm/m, ss/s.
|
|
214
|
+
|
|
215
|
+
## getDateObject(stringOrNumber)
|
|
216
|
+
Convert string/number to Date. \`getDateObject('20:00')\` adds current date.
|
|
217
|
+
|
|
218
|
+
## formatValue(value, [decimals], [format])
|
|
219
|
+
Format number with locale. \`decimals\` default 2. Format: '.,', ',.', or ' .'.
|
|
220
|
+
|
|
221
|
+
## adapterSubscribe(id)
|
|
222
|
+
Send "subscribe" message to adapter. Auto-called for subscribable adapters.
|
|
223
|
+
|
|
224
|
+
## adapterUnsubscribe(id)
|
|
225
|
+
Send "unsubscribe" message to adapter.
|
|
226
|
+
|
|
227
|
+
## $(selector)
|
|
228
|
+
jQuery-like selector. Methods: \`.on(cb)\`, \`.each(cb)\`, \`.setState(val, ack)\`, \`.getState()\`, \`.toArray()\`.
|
|
229
|
+
Format: \`'name[commonAttr=val](enumName=val){nativeAttr=val}[id=filter][state.id=filter]'\`.
|
|
230
|
+
Name: state, channel, device, schedule. Wildcards \`*\` supported.
|
|
231
|
+
E.g. \`$('channel[role=switch][state.id=*.STATE](rooms=Living room)').setState(false)\`.
|
|
232
|
+
|
|
233
|
+
## readFile(adapter, fileName, callback)
|
|
234
|
+
Read file from DB. \`callback(error, bytes)\`. Default adapter: \`javascript.0\`.
|
|
235
|
+
|
|
236
|
+
## writeFile(adapter, fileName, bytes, callback)
|
|
237
|
+
Write file to DB. Accessible via web: \`http://ip:8082/javascript/path/file.ext\`.
|
|
238
|
+
|
|
239
|
+
## delFile(adapter, fileName, callback)
|
|
240
|
+
Delete file or directory from DB. Alias: \`unlink\`.
|
|
241
|
+
|
|
242
|
+
## renameFile(adapter, oldName, newName, callback)
|
|
243
|
+
Rename file or directory in DB. Alias: \`rename\`.
|
|
244
|
+
|
|
245
|
+
## onFile(id, fileName, withFile, callback)
|
|
246
|
+
Subscribe to file changes. \`id\`: meta object ID (e.g. 'vis.0'). \`fileName\`: name or glob pattern.
|
|
247
|
+
Callback: \`(id, fileName, size, fileData, mimeType)\`. \`fileData\`/\`mimeType\` only if \`withFile=true\`.
|
|
248
|
+
|
|
249
|
+
## offFile(id, fileName)
|
|
250
|
+
Unsubscribe from file changes.
|
|
251
|
+
|
|
252
|
+
## onStop(callback, [timeout])
|
|
253
|
+
Register callback for script stop. Default timeout 1000ms. Call \`callback()\` when cleanup done.
|
|
254
|
+
|
|
255
|
+
## getHistory(instance, options, callback)
|
|
256
|
+
Read history data. Options: \`{id, start, end, aggregate, count, timeout}\`.
|
|
257
|
+
\`aggregate\`: 'none', 'minmax', 'max', 'min', 'average', 'total', 'count', 'm4'.
|
|
258
|
+
If instance omitted, uses system default. \`callback(err, result, options, instance)\`.
|
|
259
|
+
|
|
260
|
+
## runScript(scriptName, [callback])
|
|
261
|
+
Start or restart a script by name.
|
|
262
|
+
|
|
263
|
+
## runScriptAsync(scriptName)
|
|
264
|
+
Promise version of runScript.
|
|
265
|
+
|
|
266
|
+
## startScript(scriptName, [ignoreIfStarted], [callback])
|
|
267
|
+
Start script. If \`ignoreIfStarted=true\`, does nothing if already running.
|
|
268
|
+
|
|
269
|
+
## startScriptAsync(scriptName, [ignoreIfStarted])
|
|
270
|
+
Promise version of startScript.
|
|
271
|
+
|
|
272
|
+
## stopScript([scriptName], [callback])
|
|
273
|
+
Stop script. No args = stop self.
|
|
274
|
+
|
|
275
|
+
## stopScriptAsync([scriptName])
|
|
276
|
+
Promise version of stopScript.
|
|
277
|
+
|
|
278
|
+
## isScriptActive(scriptName)
|
|
279
|
+
Returns if script is enabled (not necessarily running).
|
|
280
|
+
|
|
281
|
+
## toInt(val)
|
|
282
|
+
Convert to integer.
|
|
283
|
+
|
|
284
|
+
## toFloat(val)
|
|
285
|
+
Convert to float.
|
|
286
|
+
|
|
287
|
+
## toBoolean(val)
|
|
288
|
+
Convert to boolean.
|
|
289
|
+
|
|
290
|
+
## jsonataExpression(expr)
|
|
291
|
+
Evaluate JSONata expression.
|
|
292
|
+
|
|
293
|
+
## wait(ms) / sleep(ms)
|
|
294
|
+
Pause execution. Must use \`await wait(1000)\`.
|
|
295
|
+
|
|
296
|
+
## messageTo(target, data, [options], [callback])
|
|
297
|
+
Send message via message bus to other scripts. Target: \`{instance, script, message}\` or just \`'messageName'\`.
|
|
298
|
+
Default timeout 5000ms.
|
|
299
|
+
|
|
300
|
+
## messageToAsync(target, data, [options])
|
|
301
|
+
Promise version of messageTo.
|
|
302
|
+
|
|
303
|
+
## onMessage(messageName, callback)
|
|
304
|
+
Subscribe to message bus. \`callback(data, callback)\` - call callback with response.
|
|
305
|
+
|
|
306
|
+
## onMessageUnregister(idOrName)
|
|
307
|
+
Unsubscribe from message by handler ID or message name.
|
|
308
|
+
|
|
309
|
+
## onLog(severity, callback)
|
|
310
|
+
Subscribe to logs. Severity: 'error', 'warn', 'info', 'debug', or '*' for all.
|
|
311
|
+
\`callback({message, severity, ts})\`. Cannot log same severity in handler (infinite loop).
|
|
312
|
+
|
|
313
|
+
## onLogUnregister(idOrHandlerOrSeverity)
|
|
314
|
+
Unsubscribe from log handler by ID, function, or severity string.
|
|
315
|
+
|
|
316
|
+
## httpGet(url, [options], callback)
|
|
317
|
+
HTTP GET request. Options: \`{timeout, responseType, headers, basicAuth, validateCertificate}\`.
|
|
318
|
+
\`callback(err, response)\` where \`response: {statusCode, data, headers}\`.
|
|
319
|
+
Use \`responseType: 'arraybuffer'\` for binary data.
|
|
320
|
+
|
|
321
|
+
## httpPost(url, data, [options], callback)
|
|
322
|
+
HTTP POST request. Same options as httpGet plus \`basicAuth: {user, password}\`.
|
|
323
|
+
|
|
324
|
+
## createTempFile(fileName, data)
|
|
325
|
+
Create temporary file. Returns file path string. Useful for sendTo with file attachments.
|
|
326
|
+
|
|
327
|
+
# Global Variables
|
|
328
|
+
- \`scriptName\` - name of current script
|
|
329
|
+
- \`instance\` - JavaScript adapter instance number (e.g. 0)
|
|
330
|
+
- \`defaultDataDir\` - absolute path to iobroker-data directory
|
|
331
|
+
- \`verbose\` - boolean, verbose mode enabled
|
|
332
|
+
|
|
333
|
+
# Notes
|
|
334
|
+
- "Do not subscribe all states on start" mode: getState requires async callback \`getState(id, (err, state) => {})\`.
|
|
335
|
+
- Scripts can be enabled/disabled via state \`javascript.INSTANCE.scriptEnabled.SCRIPT_NAME\` (set with ack=false).
|
|
336
|
+
`;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as n}from"./createSvgIcon-DYs_tNrE.js";import{c as E,h as yt,j as M,m as nt,k as lt,l as Dt,b as ut,o as xt}from"./iobroker_javascript__loadShare__react__loadShare__.mjs-CTZOFJS2.js";import{_ as u}from"./iobroker_javascript__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__.mjs-DkBjPSMw.js";import{u as kt,a as St,M as Y,C as et,G as Nt,b as $t,c as bt,I as qt,S as J,d as Bt,e as ft,j as Mt,D as Ht,f as Wt}from"./index-DW5CwIma.js";import{_ as wt,b as Ct,h as vt,i as jt,p as Tt,f as Et,g as mt,o as Pt,Y as Ut,Z as Ft,C as Jt,D as st}from"./iobroker_javascript__loadShare___mf_0_mui_mf_1_material__loadShare__.mjs-CV1_X-Lf.js";import{I as Lt}from"./index-wHNMOf-c.js";import"./iobroker_javascript__loadShare__react__loadShare__.mjs_commonjs-proxy-CE9lvhW8.js";import"./iobroker_javascript__loadShare__prop_mf_2_types__loadShare__.mjs-BCtSFofY.js";import"./virtual_mf-REMOTE_ENTRY_ID_iobroker_javascript__remoteEntry_js-BJ03G6Pu.js";import"./preload-helper-BDBacUwf.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-RQRRZMX5.js";import"./iobroker_javascript__loadShare__react_mf_2_dom__loadShare__.mjs-DeVAS-oa.js";import"./inheritsLoose-CIXm_zPk.js";function zt(e){const s=kt().getMonitor(),[i,a]=St(s,e);return E(()=>s.subscribeToOffsetChange(a)),E(()=>s.subscribeToStateChange(a)),i}let V;function Gt(){return V||(V=new Image,V.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),V}const Kt="_wrapperRules_nnott_1",Qt="_rootWrapper_nnott_9",Yt="_addClass_nnott_14",ot={wrapperRules:Kt,rootWrapper:Qt,addClass:Yt},Zt="_switchesItem_10ls3_1",Xt="_switchesItemActive_10ls3_28",Vt="_iconTheme_10ls3_36",it={switchesItem:Zt,switchesItemActive:Xt,iconTheme:Vt},It=({name:e,id:t,active:s,icon:i,adapter:a,socket:o,onDoubleClick:c,title:l,onTouchMove:d,style:j})=>n.jsxs("div",{onDoubleClick:c,onTouchMove:d,title:l?u.I18n.t(l):void 0,className:u.Utils.clsx(it.switchesItem,s&&it.switchesItemActive,`block-${t}`),children:[n.jsx(Y,{iconName:i,className:it.iconTheme,adapter:a,socket:o,style:j}),n.jsx("span",{children:e?u.I18n.t(e):""})]},t),Rt="_cardStyle_8rq8v_1",tn="_cardStyleActive_8rq8v_17",nn="_controlMenu_8rq8v_22",en="_closeBtn_8rq8v_31",sn="_isDelete_8rq8v_73",on="_drag_mobile_8rq8v_90",G={cardStyle:Rt,cardStyleActive:tn,controlMenu:nn,closeBtn:en,isDelete:sn,drag_mobile:on};function K(e,t,s){let i;switch(e){case"actions":if(s==="else")return i={...t,actions:{...t[e],else:[...t[e].else]}},i;if(s==="then")return i={...t,actions:{...t[e],then:[...t[e].then]}},i;throw console.error(`Unknown additionalParameter: ${s}`),new Error(`Unknown additionalParameter: ${s}`);case"triggers":return i={...t,triggers:[...t.triggers]},i;case"conditions":return i={...t,conditions:[...t.conditions]},i;default:throw new Error(`Unknown name: ${e}`)}}function z(e,t,s,i){var a;switch(e){case"actions":return t.actions[s]=t.actions[s].filter(o=>o._id!==i),t;case"conditions":return t.conditions[s]=(a=t.conditions[s])==null?void 0:a.filter(o=>o._id!==i),t;default:return t.triggers=t.triggers.filter(o=>o._id!==i),t}}function cn(e,t,s){const{_id:i,acceptedBy:a}=e;let o;if(!a||!t[a])return console.warn(`Cannot find ${a}`),t;switch(a){case"actions":if(o=t.actions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.actions[s].indexOf(o);t.actions[s][c]=e}return t;case"conditions":if(o=t.conditions[s].find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.conditions[s].indexOf(o);t.conditions[s][c]=e}return t;default:if(o=t.triggers.find(c=>c._id===i),!o)console.warn(`Cannot find ${i}`);else{const c=t.triggers.indexOf(o);t.triggers[c]=e}return t}}const Ot=yt(e=>{var N;const{setUserRules:t,userRules:s,_id:i,id:a,blockValue:o,active:c,acceptedBy:l,isTourOpen:d,setTourStep:j,tourStep:O}=e,[I,_]=M(null),{blocks:r,socket:k,onUpdate:H,setOnUpdate:w,onDebugMessage:f,enableSimulation:x}=nt(et),p=lt(h=>r==null?void 0:r.find(b=>b.getStaticData().id===h),[r]),g=lt(h=>{const b=cn(h,s,o);b&&t(b)},[s]),C=h=>{h.currentTarget!==I&&_(h.currentTarget)},q=()=>_(null),T=Dt(()=>{const h=p(a)||Nt;return n.jsx(h,{...e,notFound:!p(a),isTourOpen:d,setTourStep:j,tourStep:O,onUpdate:H,setOnUpdate:w,enableSimulation:x,onDebugMessage:f,onChange:g,className:void 0,socket:k})},[s,H,f,x]),[S,B]=M(!1);return n.jsxs("div",{onMouseMove:C,onMouseEnter:C,onMouseLeave:q,onMouseDown:h=>{if(h.ctrlKey){let b;const v=K(l,s,o);l==="conditions"?(b=v.conditions[o].find(m=>m._id===i),b&&v.conditions[o].splice(v.conditions[o].indexOf(b),0,{...b,_id:Date.now()})):l==="actions"?(b=v.actions[o].find(m=>m._id===i),b&&v.actions[o].splice(v.actions[o].indexOf(b),0,{...b,_id:Date.now()})):(b=v.triggers.find(m=>m._id===i),b&&v.triggers.splice(v[l].indexOf(b),0,{...b,_id:Date.now()})),t(v)}},id:"height",style:c?{width:(((N=document.getElementById("width"))==null?void 0:N.clientWidth)||0)-70}:void 0,className:`${G.cardStyle} ${c?G.cardStyleActive:null} ${S?G.isDelete:null}`,children:[n.jsx("div",{className:G.drag_mobile}),T,t&&n.jsx("div",{className:G.controlMenu,style:I?{opacity:1}:{opacity:0},children:n.jsx("div",{onClick:()=>{let h=K(l,s,o);h=z(l,h,o,i),B(!0),setTimeout(()=>{l==="triggers"&&w(!0),t(h)},300)},className:G.closeBtn})})]})}),rn={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},an=(e,t,s)=>{if(!e||!t)return{display:"none"};let{x:i,y:a}=t;const o=`translate(${i}px, ${a}px)`;return{transform:o,WebkitTransform:o}},ln=e=>{const{itemType:t,isDragging:s,item:i,initialOffset:a,currentOffset:o,targetIds:c}=zt(d=>({item:d.getItem(),itemType:d.getItemType(),initialOffset:d.getInitialSourceClientOffset(),currentOffset:d.getSourceClientOffset(),isDragging:d.isDragging(),targetIds:d.getTargetIds()})),l=()=>t==="box"?c.length?n.jsx(Ot,{active:!0,...i,allBlocks:e.allBlocks}):n.jsx(It,{active:!0,...i,socket:e.socket}):null;return s?n.jsx("div",{style:rn,children:n.jsx("div",{style:an(a,o),children:l()})}):null},dn="_border_wrpm3_1",fn="_emptyBlockStyle_wrpm3_6",mn="_emptyBlock_wrpm3_6",gn="_selectOnChange_wrpm3_22",hn="_selectOnChangeHelp_wrpm3_28",_n="_selectOnChangeHelpIcon_wrpm3_34",pn="_emptyBlockNone_wrpm3_49",un="_mainBlockItemRules_wrpm3_55",xn="_nameBlockItems_wrpm3_63",bn="_contentBlockItem_wrpm3_73",wn="_wrapperMargin_wrpm3_81",Cn="_contentHeightOn_wrpm3_87",vn="_contentHeightOff_wrpm3_99",jn="_cardAdd_wrpm3_105",In="_blockCardAdd_wrpm3_125",On="_addClassOverflow_wrpm3_136",An="_addClassHeight_wrpm3_140",D={border:dn,emptyBlockStyle:fn,emptyBlock:mn,selectOnChange:gn,selectOnChangeHelp:hn,selectOnChangeHelpIcon:_n,emptyBlockNone:pn,mainBlockItemRules:un,nameBlockItems:xn,contentBlockItem:bn,wrapperMargin:wn,contentHeightOn:Cn,contentHeightOff:vn,cardAdd:jn,blockCardAdd:In,addClassOverflow:On,addClassHeight:An};function dt(e,t){const[s,i]=M(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||""):e);return[s,o=>{window.localStorage.setItem(t,JSON.stringify(o)),i(o)},!!window.localStorage.getItem(t)]}function yn(e,t){let s=0,i=null,a;return function(...o){const c=Date.now();a=o,c-s>=t?(s=c,e.apply(this,o)):i||(i=setTimeout(()=>{s=Date.now(),i=null,e.apply(this,a)},t-(c-s)))}}function tt(e){if(Array.isArray(e))return e.map(t=>tt(t));if(typeof e=="function")return e.bind(null);if(e&&typeof e=="object"){const t={};return Object.keys(e).forEach(s=>{t[s]=tt(e[s])}),t}return e}const ct=yn((e,t)=>e(t),0);function R(e,t){const s=t.find(i=>i._id===e);return{card:s,index:s?t.indexOf(s):-1}}function rt(e,t,s,i,a,o,c,l,d){const{card:j,index:O}=R(e,s);if(!(O<t&&l<d)&&!(O>t&&l>d)&&j&&O!==t){const I=tt(s);I.splice(O,1),I.splice(t,0,j);const _=tt(a);switch(o){case"actions":_.actions[c]=I,ct(i,_);return;case"conditions":_.conditions[c]=I,ct(i,_);return;default:_.triggers=I,ct(i,_);return}}}const Dn="_drag_7xfhc_1",kn="_root_7xfhc_11",gt={drag:Dn,root:kn},At=({typeBlock:e,allProperties:t,id:s,isActive:i,setUserRules:a,userRules:o,children:c,_id:l,blockValue:d})=>{const{setOnUpdate:j}=nt(et),[{opacity:O},I,_]=$t({type:"box",item:()=>({...t,id:s,isActive:i,_id:l}),end:(w,f)=>{const{acceptedBy:x}=w,p=f.getDropResult();let g;if(!p)return typeof l=="number"&&!f.getTargetIds().length&&(g=K(x,o,d),g=z(x,g,d,l),a(g)),null;if(p.blockValue!==d){const C=typeof l=="number"?l:Date.now();g=K(x,o,p.blockValue);const q={id:w.id,acceptedBy:w.acceptedBy};switch(x){case"actions":return d&&(g=z("actions",g,d,C)),g=z("actions",g,p.blockValue,C),g.actions[p.blockValue].push({...q,_id:C}),a(g);case"conditions":return typeof d=="number"&&(g=z("conditions",g,d,C)),g=z("conditions",g,p.blockValue,C),g.conditions[p.blockValue].push({...q,_id:C}),a(g);default:return j(!0),g=z("triggers",g,p.blockValue,C),g.triggers.push({...q,_id:C}),a(g)}}},collect:w=>({opacity:w.isDragging()?.4:1,isDragging:w.isDragging()})}),r=ut(null),[,k]=bt({accept:"box",canDrop:()=>!1,hover({_id:w,acceptedBy:f},x){var T;if(!r.current||e!==f)return;const p=(T=r.current)==null?void 0:T.getBoundingClientRect(),g=(p.bottom-p.top)/2,C=x.getClientOffset(),q=((C==null?void 0:C.y)||0)-p.top;if(l&&w!==l)switch(f){case"actions":if(d==="then"||d==="else"){const{index:S}=R(l,o.actions[d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;case"conditions":if(typeof d=="number"){const{index:S}=R(l,o[f][d]);S!==w&&rt(w,S,o[f][d],a,o,f,d,q,g)}return;default:{const{index:S}=R(l,o[f]);S!==w&&rt(w,S,o[f],a,o,f,void 0,q,g);return}}}});E(()=>{_(Gt(),{captureDraggingState:!0})},[]),I(k(r));const H=window.innerWidth<600;return n.jsxs("div",{ref:H&&l?null:r,className:gt.root,style:{opacity:O},children:[n.jsx("div",{className:l?gt.drag:null,ref:l&&H?r:null}),c]})},Sn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs("div",{style:{fontSize:"1rem",fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',fontWeight:400,lineHeight:1.5,letterSpacing:"0.00938em"},children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,startIcon:n.jsx(Lt,{}),children:u.I18n.t("OK")})})]}),Nn=({onClose:e,open:t})=>n.jsxs(wt,{open:t,onClose:e,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[n.jsx(Ct,{children:n.jsxs(Tt,{id:"alert-dialog-description",children:[n.jsx("h3",{children:u.I18n.t("On condition change")}),n.jsx("div",{children:u.I18n.t("help_on_change")}),n.jsx("h3",{children:u.I18n.t("Just check")}),n.jsx("div",{children:u.I18n.t("help_just_check")})]})}),n.jsx(vt,{children:n.jsx(jt,{onClick:e,color:"primary",autoFocus:!0,children:u.I18n.t("OK")})})]}),ht=({size:e,blockValue:t,boolean:s,typeBlock:i,userRules:a,setUserRules:o,animation:c,setTourStep:l,tourStep:d,isTourOpen:j,theme:O,themeType:I,themeName:_})=>{var W;const[r,k]=M(!1),[H,w]=M(!1),[f,x]=M(!1),[p,g]=M("");s===void 0&&(s=!0);const C=bt({accept:"box",drop:()=>({blockValue:t}),hover:({acceptedBy:A,_id:L},Z)=>{k(A===i),x(!!L),g(Z.getHandlerId()||"")},canDrop:({acceptedBy:A})=>(w(A===i),A===i),collect:A=>{var L;return{isOver:A.isOver(),canDrop:((L=A.getItem())==null?void 0:L.acceptedBy)===i,offset:A.getClientOffset(),targetId:A.getHandlerId()}}}),q=C[0],{canDrop:T,isOver:S,offset:B,targetId:N}=q,h=C[1];E(()=>{g("")},[B]);const b=T&&S;let v="";b?v=r?"#00fb003d":"#fb00002e":T?v=H?"#00fb003d":"#fb00002e":B&&(v=N===p?"#fb00002e":"");let m;return i==="actions"?m=a.actions[t]:i==="conditions"?m=a.conditions[t]:m=a.triggers,n.jsx("div",{ref:h,style:{backgroundColor:v},className:`${u.Utils.clsx(D.contentBlockItem,e&&D.addClassHeight)} ${s?c?D.contentHeightOn:null:D.contentHeightOff}`,children:n.jsxs("div",{className:D.wrapperMargin,children:[m.map(A=>n.jsx(At,{typeBlock:i,...A,blockValue:t,allProperties:A,userRules:a,setUserRules:o,children:n.jsx(Ot,{...A,isTourOpen:j,setTourStep:l,tourStep:d,settings:A,blockValue:t,userRules:a,setUserRules:o,theme:O,themeType:I,themeName:_})},A._id)),n.jsx("div",{style:b&&r&&!f?{height:((W=document.getElementById("height"))==null?void 0:W.clientHeight)||200}:void 0,className:`${D.emptyBlockStyle} ${b&&r&&!f?D.emptyBlock:D.emptyBlockNone}`})]})})},at=({size:e,typeBlock:t,name:s,nameAdditionally:i,additionally:a,border:o,userRules:c,setUserRules:l,iconName:d,adapter:j,socket:O,setTourStep:I,tourStep:_,isTourOpen:r,theme:k,themeType:H,themeName:w})=>{const[f,x,p]=dt(t==="actions"?!1:[],`additionallyClickItems_${t}`),[g,C]=M(!1),[q,T]=M(!1);E(()=>{if(t==="conditions"&&(f==null?void 0:f.length)!==c.conditions.length-1){const N=[];c.conditions.forEach((h,b)=>{b>0&&N.push({_id:Date.now(),open:!0})}),x([...f,...N])}t==="actions"&&!p&&c.actions.else.length&&x(!0)},[]);const[S,B]=M(!1);return n.jsxs("div",{className:`${u.Utils.clsx(D.mainBlockItemRules,e&&D.addClassOverflow)} ${o&&!e?D.border:null}`,children:[n.jsxs("span",{id:"width",className:D.nameBlockItems,children:[n.jsx(Y,{iconName:d,className:D.iconThemCard,adapter:j,socket:O}),s]}),t==="conditions"?n.jsxs("div",{style:{width:"100%"},children:[n.jsxs(Et,{variant:"standard",className:D.selectOnChange,value:c.justCheck||!1,onChange:N=>{const h=K("conditions",c);h.justCheck=N.target.value==="true",l(h)},children:[n.jsx(mt,{value:"false",children:u.I18n.t("on condition change")}),n.jsx(mt,{value:"true",children:u.I18n.t("just check")})]}),n.jsx(Pt,{size:"small",title:u.I18n.t("Explanation"),className:D.selectOnChangeHelp,onClick:()=>C(!0),children:n.jsx(qt,{className:D.selectOnChangeHelpIcon})})]}):null,n.jsx(ht,{setTourStep:I,tourStep:_,isTourOpen:r,blockValue:t==="actions"?"then":t==="conditions"?0:t,typeBlock:t,setUserRules:l,userRules:c,theme:k,themeName:w,themeType:H,size:e}),a&&[...Array(t==="actions"?1:c.conditions.length-1)].map((N,h)=>{const b=(v=h)=>t==="actions"?!!f:!!f.find((m,W)=>W===v&&m.open);return n.jsxs(xt,{children:[n.jsxs("div",{onClick:()=>{if(t==="actions")return x(!f),null;let v=JSON.parse(JSON.stringify(f));if(c.conditions[h+1].length)return v[h].open=!v[h].open,x(v),null;v=v.filter((m,W)=>W!==h),x(v),B(h),setTimeout(()=>{B(!1),l({...c,conditions:[...c.conditions.filter((m,W)=>W!==h+1)]})},250)},className:D.blockCardAdd,children:[b()?"-":"+",n.jsx("div",{className:D.cardAdd,children:i})]},h),n.jsx(ht,{blockValue:t==="actions"?"else":t==="conditions"?h+1:t,typeBlock:t,setUserRules:l,userRules:c,boolean:b(),animation:S===h,size:e,theme:k,themeName:w,themeType:H})]},`${h}_block_${t}`)}),a&&t==="conditions"&&n.jsxs("div",{onClick:()=>{x([...f,{_id:Date.now(),open:!0}]),l({...c,conditions:[...c.conditions,[]]}),B(c.conditions.length-1),setTimeout(()=>B(!1),1e3)},className:D.blockCardAdd,children:["+",n.jsx("div",{className:D.cardAdd,children:i})]}),n.jsx(Sn,{open:g,onClose:()=>C(!1)}),n.jsx(Nn,{open:q,onClose:()=>T(!1)})]})},$n="_menuRules_1qqcb_1",qn="_switchesRenderWrapper_1qqcb_13",Bn="_menuOff_1qqcb_22",Mn="_menuTitle_1qqcb_28",Hn="_marginAuto_1qqcb_42",Wn="_inputWidth_1qqcb_47",Tn="_menuWrapper_1qqcb_52",En="_hamburgerWrapper_1qqcb_57",Pn="_hamburgerOff_1qqcb_74",Un="_nothingFound_1qqcb_82",Fn="_resetSearch_1qqcb_89",Jn="_controlPanel_1qqcb_101",Ln="_controlPanelAppBar_1qqcb_112",zn="_addClassMenu_1qqcb_126",Gn="_addClassBackground_1qqcb_132",Kn="_addClassPosition_1qqcb_136",$={menuRules:$n,switchesRenderWrapper:qn,menuOff:Bn,menuTitle:Mn,marginAuto:Hn,inputWidth:Wn,menuWrapper:Tn,hamburgerWrapper:En,hamburgerOff:Pn,nothingFound:Un,resetSearch:Fn,controlPanel:Jn,controlPanelAppBar:Ln,addClassMenu:zn,addClassBackground:Gn,addClassPosition:Kn},Qn=e=>{const{allProperties:t,allProperties:{acceptedBy:s,id:i},setUserRules:a,userRules:o,setTourStep:c,tourStep:l,isTourOpen:d,onTouchMove:j,isActive:O}=e;return n.jsx(At,{allProperties:t,id:t.id,isActive:O,setUserRules:a,userRules:o,children:n.jsx(It,{onDoubleClick:()=>{d&&l===J.addScheduleByDoubleClick&&i==="TriggerScheduleBlock"&&c(J.openTagsMenu),d&&l===J.addActionPrintText&&i==="ActionPrintText"&&c(J.showJavascript);const I=Date.now();let _;switch(s){case"actions":_="then";break;case"conditions":_=o[s].length-1;break}const r=K(s,o,_),k={id:i,_id:I,acceptedBy:s};_!==void 0?s==="actions"?r.actions[_].push({...k}):s==="conditions"&&r.conditions[_].push({...k}):r.triggers.push({...k}),a(r)},...e,...t,onTouchMove:j})})},Yn="_hamburgerMenu_hqnsm_8",Zn="_animate_hqnsm_21",_t={hamburgerMenu:Yn,animate:Zn};function Xn({bool:e}){return n.jsx("div",{className:`${_t.hamburgerMenu} ${e?_t.animate:""}`})}const Vn=({addClass:e,setAllBlocks:t,allBlocks:s,userRules:i,onChangeBlocks:a,setTourStep:o,tourStep:c,isTourOpen:l})=>{const{blocks:d,socket:j}=nt(et),[O,I]=dt(!1,"hamburgerOnOff"),[_,r]=dt({text:"",type:"triggers",index:0},"filterControlPanel"),k=(f=_.text,x=_.type)=>{if(!d)return;let p=[...d];p=p.filter(g=>{if(!f)return!0;const{name:C}=g.getStaticData();return C&&u.I18n.t(C).toLowerCase().includes(f.toLowerCase())}),p=p.filter(g=>x===g.getStaticData().acceptedBy),t(p)},H=(f,x)=>{l&&x===0&&c===J.selectTriggers&&o(J.addScheduleByDoubleClick),l&&x===2&&c===J.selectActions&&o(J.addActionPrintText),r({..._,index:x,type:["triggers","conditions","actions"][x]}),k(_.text,["triggers","conditions","actions"][x])},w=f=>({id:`scrollable-force-tab-${f}`,"aria-controls":`scrollable-force-tabpanel-${f}`});return E(()=>{k()},[d]),n.jsx(Ut,{mouseEvent:!1,touchEvent:"onTouchStart",onClickAway:()=>I(!0),children:n.jsxs("div",{className:u.Utils.clsx($.menuWrapper,e[1035]&&$.addClassMenu),children:[n.jsx("div",{className:`${$.hamburgerWrapper} ${O?$.hamburgerOff:null}`,onClick:()=>I(!O),children:n.jsx(Xn,{bool:!O})}),n.jsxs("div",{className:`${u.Utils.clsx($.menuRules,e[1035]&&$.addClassBackground,e[835]&&$.addClassPosition)} ${O?$.menuOff:null}`,children:[n.jsx("div",{className:$.controlPanel,children:n.jsx(Ft,{className:$.controlPanelAppBar,position:"static",children:n.jsxs(Jt,{value:_.index,onChange:H,children:[n.jsx(st,{className:"blocks-triggers",title:u.I18n.t("Triggers"),icon:n.jsx(Y,{iconName:"FlashOn"}),...w(0)}),n.jsx(st,{title:u.I18n.t("Conditions"),className:"blocks-conditions",icon:n.jsx(Y,{iconName:"Help"}),...w(1)}),n.jsx(st,{title:u.I18n.t("Actions"),className:"blocks-actions",icon:n.jsx(Y,{iconName:"PlayForWork"}),...w(2)})]})})}),n.jsx("div",{className:$.switchesRenderWrapper,children:n.jsxs("span",{children:[s.map(f=>{const{name:x,id:p,icon:g,adapter:C}=f.getStaticData();return n.jsx(xt,{children:n.jsx(Qn,{adapter:C,allProperties:f.getStaticData(),icon:g,id:p,isActive:!1,isTourOpen:l,name:x,onTouchMove:()=>I(!0),setTourStep:o,setUserRules:a,socket:j,tourStep:c,userRules:i})},p)}),!s.length&&n.jsxs("div",{className:$.nothingFound,children:[u.I18n.t("Nothing found"),"...",n.jsx("div",{className:$.resetSearch,onClick:()=>{r({..._,text:""}),k("")},children:u.I18n.t("reset search")})]})]})}),n.jsx("div",{className:u.Utils.clsx($.menuTitle,$.marginAuto)}),n.jsx(Bt,{className:$.inputWidth,fullWidth:!0,customValue:!0,value:_.text,size:"small",autoComplete:"off",label:u.I18n.t("search"),variant:"outlined",onChange:f=>{r({..._,text:f}),k(f)}})]})]})})};let pt=[];const me=({code:e,onChange:t,themeName:s,themeType:i,theme:a,setTourStep:o,tourStep:c,isTourOpen:l,command:d,scriptId:j,changed:O,running:I})=>{var v;const{blocks:_,socket:r,setOnUpdate:k,setOnDebugMessage:H,setEnableSimulation:w}=nt(et),[f,x]=M([]),[p,g]=M(ft(e)),[C,q]=M(""),[T,S]=M(!1);E(()=>{let m,W;const A=(P,y)=>{P===`${m}.alive`&&W!==(y==null?void 0:y.val)&&(W=!!(y!=null&&y.val),W&&m&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)))},L=(P,y)=>{var U,Q;r&&m!==((U=y==null?void 0:y.common)==null?void 0:U.engine)&&(m&&(r.unsubscribeState(`${m}.alive`,A),W&&r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOn",j)),m=(Q=y==null?void 0:y.common)==null?void 0:Q.engine,m&&m&&r.subscribeState(`${m}.alive`,A))},Z=(P,y)=>{if(y)try{const U=JSON.parse(y.val),Q=Date.now();if(U.ruleId===j&&Q-U.ts<1e3){const F=[...pt,{blockId:U.blockId,data:U.data,ts:U.ts}];F.length>200&&F.splice(0,200-F.length);for(let X=F.length-1;X>=0;X--)if(F[X].ts<Q-5e3){F.splice(0,X);break}pt=F,H(F)}}catch{console.error(`Cannot parse: ${y.val}`)}};return r==null||r.getObject(j).then(P=>{var y;m=(y=P==null?void 0:P.common)==null?void 0:y.engine,r.subscribeObject(j,L),m&&(r.subscribeState(`${m}.alive`,A),r.subscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}),function(){r==null||r.unsubscribeObject(j,L),m&&(r==null||r.unsubscribeState(`${m}.alive`,A),W&&(r==null||r.sendTo(m.replace(/^system\.adapter\./,""),"rulesOff",j)),r==null||r.unsubscribeState(`${m.replace(/^system\.adapter\./,"")}.debug.rules`,Z))}},[]),E(()=>{w(!O&&I)},[O,I,w]),E(()=>{d&&(q(d),T||S(!0))},[d]),E(()=>{const m=ft(e);JSON.stringify(m)!==JSON.stringify(p)&&(g(m),k(!0))},[e]),E(()=>{document.getElementsByTagName("HTML")[0].className=s||"blue"},[s]);const B=lt(m=>{g(m),_&&t(Mt(m,_))},[_,t]),N=ut(null),[h,b]=M({835:!1,1035:!1});return E(()=>{N.current&&(N.current.clientWidth<=1035&&b({835:!1,1035:!0}),N.current.clientWidth<=835&&b({1035:!0,835:!0}),N.current.clientWidth>1035&&b({835:!1,1035:!1}))},[((v=N.current)==null?void 0:v.clientWidth)||0]),!_||!r?null:n.jsxs("div",{className:ot.wrapperRules,ref:N,children:[n.jsx(ln,{allBlocks:f,socket:r}),T?C==="export"?n.jsx(Ht,{scriptId:j,themeType:i,onClose:()=>S(!1),text:JSON.stringify(p,null,2)}):n.jsx(Wt,{themeType:i,onClose:m=>{S(!1),m&&B(JSON.parse(m))}}):null,n.jsxs("div",{className:u.Utils.clsx(ot.rootWrapper,h[835]&&ot.addClass),children:[n.jsx(Vn,{setAllBlocks:x,allBlocks:f,userRules:p,onChangeBlocks:B,setTourStep:o,tourStep:c,addClass:h,isTourOpen:l}),n.jsx(at,{socket:r,setUserRules:B,userRules:p,isTourOpen:l,setTourStep:o,tourStep:c,name:`${u.I18n.t("when")}...`,typeBlock:"triggers",iconName:"FlashOn",size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("and")}...`,typeBlock:"conditions",iconName:"Help",nameAdditionally:u.I18n.t("or"),additionally:!0,border:!0,size:h[835],themeType:i,themeName:s,theme:a}),n.jsx(at,{socket:r,setUserRules:B,isTourOpen:l,setTourStep:o,tourStep:c,userRules:p,name:`...${u.I18n.t("then")}`,typeBlock:"actions",iconName:"PlayForWork",nameAdditionally:u.I18n.t("else"),additionally:!0,size:h[835],themeType:i,themeName:s,theme:a})]})]},"rulesEditor")};export{me as default};
|