From e18ddebc37d695c6fca51981598e6a20640b5050 Mon Sep 17 00:00:00 2001 From: Johannes Krobath Date: Mon, 24 Aug 2026 21:48:31 +0200 Subject: [PATCH 1/2] Fix saving of Blockly scripts: named timers/schedules under Blockly 13, and functions without statements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since 10.1.0, editing an existing Blockly script that contains a named timeout, interval or schedule does not offer the Save button anymore — changes cannot be saved, and edits made after touching such a block are lost (#2349). Independently, since at least 9.0.11 a script containing a function with a return value whose "statements" checkbox is off cannot be saved either (#1958). The editor only decides "something changed — show Save" after it has regenerated the script: `workspaceToCode` plus `Xml.workspaceToDom`. When any single block throws inside that chain, the change handler dies and the Save button never appears — without any visible error. - The timer and schedule blocks answered `getVarModels()` with hand-built variable models in the Blockly 11 shape (`{ getId, name, type }`). Blockly 13 reads variable models through methods — `Xml.variablesToDom` calls `getName()`/ `getType()` while saving — so every save of a script containing `timeouts_settimeout`, `timeouts_settimeout_variable`, `timeouts_setinterval`, `timeouts_setinterval_variable` or `schedule_create` threw `getName is not a function`. The pseudo models now carry `getName()`/`getType()`/`getId()`; the bare `name`/`type` properties stay for adapter block files written against the Blockly 11 shape (the compatibility promise of BLOCKLY_TS.md). - The function generator read the STACK input unconditionally. With "statements" unchecked the mutation removes that input, and `statementToCode` throws for a missing one — the same trap the RETURN input is already guarded against one line below. The STACK read is now guarded the same way. Why the snapshots stayed green: the harness only exercised code generation, and that path touches `getId()` only. It now additionally saves every corpus block the way the editor does it and reloads the saved XML to the same code — with the two fixes reverted, this test fails on exactly the affected block types. A new fixture covers the statement-less function, a state the toolbox (statements on by default) can never show. Verified on 10.1.1: `npm run test:blockly` 25 passing (24 + 1 failing with the fix reverted), `npm run lint`, `npm run test:package` 72 passing, `npm run build`. The snapshot diff against master is the new fixture's entry only — no existing block's generated code changed. Fixes #2349 Fixes #1958 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- README.md | 3 ++ ...el-BFtl-m3b.js => AiChatPanel-9G6bIR9k.js} | 4 +-- ...ugger-C6H0IK4l.js => Debugger-CCdzg9pi.js} | 2 +- ...or-C8w1UaWO.js => RulesEditor-B84Rh__9.js} | 2 +- ...r-1vbWtjKB.js => ScriptEditor-COVJ2tCs.js} | 2 +- ... => ScriptEditorVanillaMonaco-0Mwut6ZY.js} | 4 +-- admin/assets/aiPromptBuilder-CBfkFGhG.js | 1 + admin/assets/aiPromptBuilder-HfYvjqbs.js | 1 - admin/assets/blocks_action-C3rgCWyA.js | 1 - admin/assets/blocks_action-HH802DF8.js | 1 + ...DpPMvgqR.js => blocks_convert-B1CD0UVU.js} | 4 +-- ...c-CDtLDgvr.js => blocks_logic-Cyd7_0kb.js} | 2 +- ...-Dtveo3bM.js => blocks_number-lMRwWLtK.js} | 2 +- admin/assets/blocks_object-B6SUr8HP.js | 1 - admin/assets/blocks_object-DCupwas8.js | 1 + ...QY-Dy.js => blocks_procedures-Cxfr0wu8.js} | 2 +- ...-CgDyguqB.js => blocks_sendto-CbTqmkT5.js} | 6 ++-- ...-CcBSyo3I.js => blocks_switch-55ZePjfL.js} | 2 +- admin/assets/blocks_system-9p9UhPDv.js | 1 + admin/assets/blocks_system-CKoiEzef.js | 1 - ...xt-DqsVhl4Q.js => blocks_text-BkD85XTp.js} | 2 +- admin/assets/blocks_time-CD9NP7Te.js | 1 + admin/assets/blocks_time-DJfyX0NT.js | 1 - admin/assets/blocks_timeout-BCswLlY9.js | 1 - admin/assets/blocks_timeout-D4yZ2uPk.js | 1 + admin/assets/blocks_trigger-DoyYYWM8.js | 2 -- admin/assets/blocks_trigger-FHBUZCQ8.js | 2 ++ ...elpers-BPUU5RuQ.js => helpers-n7EZ1fEP.js} | 2 +- .../{index-sJ01GB6X.js => index-DlFpMLlN.js} | 6 ++-- ...19.js => mf-entry-bootstrap-0-515477cc.js} | 2 +- admin/mf-stats.json | 2 +- admin/tab.html | 4 +-- .../blocks/blocks_procedures.ts | 4 ++- .../blockly-plugins/blocks/blocks_timeout.ts | 6 ++-- .../blockly-plugins/blocks/blocks_trigger.ts | 17 +++++++--- .../blockly-plugins/blocks/helpers.ts | 25 +++++++++++++++ test/blockly/env.js | 26 +++++++++++++++- .../procedures_defreturn_no_statements.xml | 18 +++++++++++ test/blockly/golden/fixtures.txt | 10 +++++- test/blockly/snapshot.js | 2 +- test/testBlocklyGenerator.js | 31 ++++++++++++++++++- 41 files changed, 163 insertions(+), 45 deletions(-) rename admin/assets/{AiChatPanel-BFtl-m3b.js => AiChatPanel-9G6bIR9k.js} (99%) rename admin/assets/{Debugger-C6H0IK4l.js => Debugger-CCdzg9pi.js} (99%) rename admin/assets/{RulesEditor-C8w1UaWO.js => RulesEditor-B84Rh__9.js} (99%) rename admin/assets/{ScriptEditor-1vbWtjKB.js => ScriptEditor-COVJ2tCs.js} (97%) rename admin/assets/{ScriptEditorVanillaMonaco-BJVSL-yc.js => ScriptEditorVanillaMonaco-0Mwut6ZY.js} (98%) create mode 100644 admin/assets/aiPromptBuilder-CBfkFGhG.js delete mode 100644 admin/assets/aiPromptBuilder-HfYvjqbs.js delete mode 100644 admin/assets/blocks_action-C3rgCWyA.js create mode 100644 admin/assets/blocks_action-HH802DF8.js rename admin/assets/{blocks_convert-DpPMvgqR.js => blocks_convert-B1CD0UVU.js} (74%) rename admin/assets/{blocks_logic-CDtLDgvr.js => blocks_logic-Cyd7_0kb.js} (96%) rename admin/assets/{blocks_number-Dtveo3bM.js => blocks_number-lMRwWLtK.js} (90%) delete mode 100644 admin/assets/blocks_object-B6SUr8HP.js create mode 100644 admin/assets/blocks_object-DCupwas8.js rename admin/assets/{blocks_procedures-DkNQY-Dy.js => blocks_procedures-Cxfr0wu8.js} (58%) rename admin/assets/{blocks_sendto-CgDyguqB.js => blocks_sendto-CbTqmkT5.js} (80%) rename admin/assets/{blocks_switch-CcBSyo3I.js => blocks_switch-55ZePjfL.js} (98%) create mode 100644 admin/assets/blocks_system-9p9UhPDv.js delete mode 100644 admin/assets/blocks_system-CKoiEzef.js rename admin/assets/{blocks_text-DqsVhl4Q.js => blocks_text-BkD85XTp.js} (96%) create mode 100644 admin/assets/blocks_time-CD9NP7Te.js delete mode 100644 admin/assets/blocks_time-DJfyX0NT.js delete mode 100644 admin/assets/blocks_timeout-BCswLlY9.js create mode 100644 admin/assets/blocks_timeout-D4yZ2uPk.js delete mode 100644 admin/assets/blocks_trigger-DoyYYWM8.js create mode 100644 admin/assets/blocks_trigger-FHBUZCQ8.js rename admin/assets/{helpers-BPUU5RuQ.js => helpers-n7EZ1fEP.js} (84%) rename admin/assets/{index-sJ01GB6X.js => index-DlFpMLlN.js} (99%) rename admin/assets/{mf-entry-bootstrap-0-670c2619.js => mf-entry-bootstrap-0-515477cc.js} (96%) create mode 100644 test/blockly/fixtures/procedures_defreturn_no_statements.xml diff --git a/README.md b/README.md index 1a8c85b4..b5aac435 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ Executes Javascript, Typescript Scripts. ## Changelog ### **WORK IN PROGRESS** * (@GermanBluefox) Added new rule blocks +* (@krobipd) Fixed saving of Blockly scripts under Blockly 13: a script containing a named timeout, interval or schedule could not be saved anymore - the save button did not appear (#2349) +* (@krobipd) Fixed saving of Blockly scripts containing a function with a return value and no statements (#1958) +* (@krobipd) The Blockly regression tests now also cover saving: every block is serialized the way the editor does it and reloaded to the same code ### 10.1.1 (2026-08-24) * (@GermanBluefox) The credentials of the central storage (Basic settings -> Credentials) are available in the scripts as `SECRETS`, e.g. `SECRETS.CameraPassword.key`. The values are decrypted, read-only and are updated live when a credential is edited in the admin UI diff --git a/admin/assets/AiChatPanel-BFtl-m3b.js b/admin/assets/AiChatPanel-9G6bIR9k.js similarity index 99% rename from admin/assets/AiChatPanel-BFtl-m3b.js rename to admin/assets/AiChatPanel-9G6bIR9k.js index d935e662..a3191489 100644 --- a/admin/assets/AiChatPanel-BFtl-m3b.js +++ b/admin/assets/AiChatPanel-9G6bIR9k.js @@ -1,4 +1,4 @@ -import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{An as n,Bt as r,Cn as i,Dn as a,En as o,Ht as s,Jn as c,Lt as l,Rn as u,Ut as d,Vt as f,Xt as p,Yn as m,Zt as h,_r as g,br as _,bt as v,f as y,fr as b,kn as x,mn as S,mr as C,pn as w,st as T,ut as E,vt as D,wr as O,xn as k,yn as A,yr as j,yt as M,zt as N}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{b as P,f as ee,m as F,p as I,s as L}from"./index-sJ01GB6X.js";var R=u(c(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m5 11h-4v4h-2v-4H7v-2h4V7h2v4h4z`}),`AddCircleOutlined`),z=u(c(`path`,{d:`M21.99 4c0-1.1-.89-2-1.99-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14l4 4zM17 11h-4v4h-2v-4H7V9h4V5h2v4h4z`}),`AddComment`),B=u(c(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10h5v-2h-5c-4.34 0-8-3.66-8-8s3.66-8 8-8 8 3.66 8 8v1.43c0 .79-.71 1.57-1.5 1.57s-1.5-.78-1.5-1.57V12c0-2.76-2.24-5-5-5s-5 2.24-5 5 2.24 5 5 5c1.38 0 2.64-.56 3.54-1.47.65.89 1.77 1.47 2.96 1.47 1.97 0 3.5-1.6 3.5-3.57V12c0-5.52-4.48-10-10-10m0 13c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3`}),`AlternateEmail`),V=u(c(`path`,{d:`M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z`}),`CompareArrows`),te=u(c(`path`,{d:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4`}),`Person`),H=u(c(`path`,{d:`M3 10h11v2H3zm0-4h11v2H3zm0 8h7v2H3zm17.59-2.07-4.25 4.24-2.12-2.12-1.41 1.41L16.34 19 22 13.34z`}),`PlaylistAddCheck`),U=u(c(`path`,{d:`M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13`}),`SmartToy`);O();var W=e(T(),1),G=t(()=>import(`./docs-compact-D7rpMc7r.js`),[],import.meta.url),K={openai:`img/openai.svg`,anthropic:`img/anthropic.svg`,gemini:`img/gemini.svg`,deepseek:`img/deepseek.svg`,custom:`img/custom.svg`},q={width:16,height:16,flexShrink:0,opacity:.7},ne={ru:`Russian`,en:`English`,de:`German`,es:`Spanish`,fr:`French`,it:`Italian`,pl:`Polish`,nl:`Dutch`,pt:`Portuguese`,uk:`Ukrainian`,"zh-cn":`Chinese`},J=null,Y=null,X=null,Z=null;function re(){J=null,Y=null,X=null,Z=null}async function ie(e,t){if(J)return J;let n=Object.keys(t)[0];if(!n)return null;let r=await e.sendTo(n,`getAvailableAiProviders`,{}),i=((r==null?void 0:r.providers)||[]).map(e=>e.provider),a=((r==null?void 0:r.providers)||[]).find(e=>e.provider===`custom`);return i.length?(J={providers:i,gptBaseUrl:a==null?void 0:a.baseUrl},J):null}var ae=`embedding.text-embedding.textembedding.embeddinggemma.embed-.-embed.bge-.mxbai-embed.nomic-embed.arctic-embed.snowflake-arctic-embed.all-minilm.multilingual-e5.jina-embed.voyage-.gecko.paraphrase-multilingual.dall-e.gpt-image.image-edit.-image-preview.-image-latest.flash-image.nano-banana.stable-diffusion.sdxl.midjourney.flux-.imagen.sora.veo-.cogvideo.runway-.lumiere.lyria.whisper.tts-.-tts.speech-.audio-preview.mini-tts.mini-transcribe.-transcribe.native-audio.flash-live.gpt-audio.realtime.bark-.xtts.voicebox.moderation.omni-moderation.llama-guard.shieldgemma.prompt-guard.-guardian.safeguard.rerank.reranker.babbage-.davinci-.curie-.text-ada-.text-davinci.text-curie.text-babbage.instructgpt.code-davinci.code-cushman.-turbo-instruct.-search-preview.-search-api.code-search.text-search.similarity-.computer-use-preview.deep-research.robotics.aqa.reader-lm.-nsql.minicheck`.split(`.`);function oe(e){let t=e.toLowerCase();return!(ae.some(e=>t.includes(e))||t.startsWith(`claude-1`)||t.startsWith(`claude-instant`))}async function se(e,t){let n=await ie(e,t);if(!n)return{models:[],providerMap:{},errors:[`No API keys configured`]};let r=Object.keys(t)[0];if(!r)return{models:[],providerMap:{},errors:[y.t(`No running javascript instance found`)]};let i=[],a={},o=[],s=(e,t)=>{for(let n of e)oe(n)&&(a[n]||(i.push(n),a[n]=t))},c=[],l=(t,n)=>{c.push(e.sendTo(r,`testApiConnection`,{provider:t===`custom`?`openai`:t}).then(e=>{e.models?s(e.models,t):e.error&&o.push(`${n||t}: ${e.error}`)}).catch(e=>{o.push(`${n||t}: ${String(e)}`)}))},u={openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Gemini`,deepseek:`DeepSeek`,custom:`Custom`};for(let e of n.providers)l(e,u[e]);return await Promise.all(c),i.sort(),{models:i,providerMap:a,errors:o}}async function ce(e,t,n){var r;return await e.sendTo(t,`chatCompletion`,{timeout:n.timeout||6e5,model:n.model,provider:n.provider,messages:n.messages,...n.baseUrl?{baseUrl:n.baseUrl}:{},...(r=n.tools)!=null&&r.length?{tools:n.tools}:{}})}async function le(e){if(Z)return Z;let t=await e.getObjectViewSystem(`state`,``,`香`),n=await e.getObjectViewSystem(`channel`,``,`香`),r=await e.getObjectViewSystem(`device`,``,`香`),i=await e.getObjectViewSystem(`folder`,``,`香`),a=await e.getObjectViewSystem(`enum`,``,`香`);return Z=Object.assign(t,n,r,i,a),Z}async function ue(e){return le(e)}function de(e,t){return e&&typeof e==`object`?e[t]||e.en:e||``}async function fe(e){if(Y)return Y;let t=y.getLanguage(),n=await le(e),r=Object.keys(n).sort(),i=new W.default,a=[],o=[`UNREACH_STICKY`],s=[W.Types.info],c=[],l=[],u=[],d=[];r.forEach(e=>{var t,r;((t=n[e])==null?void 0:t.type)===`enum`?c.push(e):(r=n[e])!=null&&(r=r.common)!=null&&r.smartName&&d.push(e)}),c.forEach(e=>{e.startsWith(`enum.rooms.`)?l.push(e):e.startsWith(`enum.functions.`)&&u.push(e);let t=n[e].common.members;t!=null&&t.length&&t.forEach(e=>{n[e]&&!d.includes(e)&&d.push(e)})});let f={id:``,objects:n,_keysOptional:r,_usedIdsOptional:a,ignoreIndicators:o,excludedTypes:s},p=[];d.forEach(e=>{f.id=e;let r=i.detect(f);r&&r.forEach(e=>{var r;let i=(r=e.states.find(e=>e.id))==null?void 0:r.id;if(!i||p.find(e=>e.id===i))return;let a=n[i],o={id:i,name:de(a.common.name,t),type:a.type,deviceType:e.type,states:e.states.filter(e=>e.id).map(e=>({id:e.id,name:e.name,role:e.defaultRole,type:n[e.id].common.type,unit:n[e.id].common.unit,read:n[e.id].common.read??!0,write:n[e.id].common.write??!0}))},s=i.split(`.`),c,d;(a.type===`channel`||a.type===`state`)&&(s.pop(),c=s.join(`.`),n[c]&&(n[c].type===`channel`||n[c].type===`folder`)?(s.pop(),d=s.join(`.`),(!n[d]||n[d].type!==`device`&&n[c].type!==`folder`)&&(d=void 0)):c=void 0);let f=l.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});f&&(o.room=de(n[f].common.name,t));let m=u.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});m&&(o.function=de(n[m].common.name,t)),p.push(o)})});for(let e=0;eimport(`./docs-compact-D7rpMc7r.js`),[],import.meta.url),K={openai:`img/openai.svg`,anthropic:`img/anthropic.svg`,gemini:`img/gemini.svg`,deepseek:`img/deepseek.svg`,custom:`img/custom.svg`},q={width:16,height:16,flexShrink:0,opacity:.7},ne={ru:`Russian`,en:`English`,de:`German`,es:`Spanish`,fr:`French`,it:`Italian`,pl:`Polish`,nl:`Dutch`,pt:`Portuguese`,uk:`Ukrainian`,"zh-cn":`Chinese`},J=null,Y=null,X=null,Z=null;function re(){J=null,Y=null,X=null,Z=null}async function ie(e,t){if(J)return J;let n=Object.keys(t)[0];if(!n)return null;let r=await e.sendTo(n,`getAvailableAiProviders`,{}),i=((r==null?void 0:r.providers)||[]).map(e=>e.provider),a=((r==null?void 0:r.providers)||[]).find(e=>e.provider===`custom`);return i.length?(J={providers:i,gptBaseUrl:a==null?void 0:a.baseUrl},J):null}var ae=`embedding.text-embedding.textembedding.embeddinggemma.embed-.-embed.bge-.mxbai-embed.nomic-embed.arctic-embed.snowflake-arctic-embed.all-minilm.multilingual-e5.jina-embed.voyage-.gecko.paraphrase-multilingual.dall-e.gpt-image.image-edit.-image-preview.-image-latest.flash-image.nano-banana.stable-diffusion.sdxl.midjourney.flux-.imagen.sora.veo-.cogvideo.runway-.lumiere.lyria.whisper.tts-.-tts.speech-.audio-preview.mini-tts.mini-transcribe.-transcribe.native-audio.flash-live.gpt-audio.realtime.bark-.xtts.voicebox.moderation.omni-moderation.llama-guard.shieldgemma.prompt-guard.-guardian.safeguard.rerank.reranker.babbage-.davinci-.curie-.text-ada-.text-davinci.text-curie.text-babbage.instructgpt.code-davinci.code-cushman.-turbo-instruct.-search-preview.-search-api.code-search.text-search.similarity-.computer-use-preview.deep-research.robotics.aqa.reader-lm.-nsql.minicheck`.split(`.`);function oe(e){let t=e.toLowerCase();return!(ae.some(e=>t.includes(e))||t.startsWith(`claude-1`)||t.startsWith(`claude-instant`))}async function se(e,t){let n=await ie(e,t);if(!n)return{models:[],providerMap:{},errors:[`No API keys configured`]};let r=Object.keys(t)[0];if(!r)return{models:[],providerMap:{},errors:[y.t(`No running javascript instance found`)]};let i=[],a={},o=[],s=(e,t)=>{for(let n of e)oe(n)&&(a[n]||(i.push(n),a[n]=t))},c=[],l=(t,n)=>{c.push(e.sendTo(r,`testApiConnection`,{provider:t===`custom`?`openai`:t}).then(e=>{e.models?s(e.models,t):e.error&&o.push(`${n||t}: ${e.error}`)}).catch(e=>{o.push(`${n||t}: ${String(e)}`)}))},u={openai:`OpenAI`,anthropic:`Anthropic`,gemini:`Gemini`,deepseek:`DeepSeek`,custom:`Custom`};for(let e of n.providers)l(e,u[e]);return await Promise.all(c),i.sort(),{models:i,providerMap:a,errors:o}}async function ce(e,t,n){var r;return await e.sendTo(t,`chatCompletion`,{timeout:n.timeout||6e5,model:n.model,provider:n.provider,messages:n.messages,...n.baseUrl?{baseUrl:n.baseUrl}:{},...(r=n.tools)!=null&&r.length?{tools:n.tools}:{}})}async function le(e){if(Z)return Z;let t=await e.getObjectViewSystem(`state`,``,`香`),n=await e.getObjectViewSystem(`channel`,``,`香`),r=await e.getObjectViewSystem(`device`,``,`香`),i=await e.getObjectViewSystem(`folder`,``,`香`),a=await e.getObjectViewSystem(`enum`,``,`香`);return Z=Object.assign(t,n,r,i,a),Z}async function ue(e){return le(e)}function de(e,t){return e&&typeof e==`object`?e[t]||e.en:e||``}async function fe(e){if(Y)return Y;let t=y.getLanguage(),n=await le(e),r=Object.keys(n).sort(),i=new W.default,a=[],o=[`UNREACH_STICKY`],s=[W.Types.info],c=[],l=[],u=[],d=[];r.forEach(e=>{var t,r;((t=n[e])==null?void 0:t.type)===`enum`?c.push(e):(r=n[e])!=null&&(r=r.common)!=null&&r.smartName&&d.push(e)}),c.forEach(e=>{e.startsWith(`enum.rooms.`)?l.push(e):e.startsWith(`enum.functions.`)&&u.push(e);let t=n[e].common.members;t!=null&&t.length&&t.forEach(e=>{n[e]&&!d.includes(e)&&d.push(e)})});let f={id:``,objects:n,_keysOptional:r,_usedIdsOptional:a,ignoreIndicators:o,excludedTypes:s},p=[];d.forEach(e=>{f.id=e;let r=i.detect(f);r&&r.forEach(e=>{var r;let i=(r=e.states.find(e=>e.id))==null?void 0:r.id;if(!i||p.find(e=>e.id===i))return;let a=n[i],o={id:i,name:de(a.common.name,t),type:a.type,deviceType:e.type,states:e.states.filter(e=>e.id).map(e=>({id:e.id,name:e.name,role:e.defaultRole,type:n[e.id].common.type,unit:n[e.id].common.unit,read:n[e.id].common.read??!0,write:n[e.id].common.write??!0}))},s=i.split(`.`),c,d;(a.type===`channel`||a.type===`state`)&&(s.pop(),c=s.join(`.`),n[c]&&(n[c].type===`channel`||n[c].type===`folder`)?(s.pop(),d=s.join(`.`),(!n[d]||n[d].type!==`device`&&n[c].type!==`folder`)&&(d=void 0)):c=void 0);let f=l.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});f&&(o.room=de(n[f].common.name,t));let m=u.find(e=>{var t,r,a;return(t=n[e].common.members)!=null&&t.includes(i)||c&&(r=n[e].common.members)!=null&&r.includes(c)?!0:d&&((a=n[e].common.members)==null?void 0:a.includes(d))});m&&(o.function=de(n[m].common.name,t)),p.push(o)})});for(let e=0;e{let t=[...e],n=t[t.length-1];return(n==null?void 0:n.role)===`assistant`&&(t[t.length-1]={...n,content:l.join(` -`)}),t}),e.push({role:`assistant`,content:i.content||``,tool_calls:i.tool_calls});for(let t of i.tool_calls){let r=await je(n,t,o,s,a);e.push({role:`tool`,tool_call_id:t.id,content:r})}}}catch(e){T(String(e)),f(e=>e.slice(0,-1))}m(!1)},[E,A,u,p,n,r,W,U,o,v,G,f,l,s]),q=b(()=>{f([]),T(null),m(!1),g(null),re(),window.localStorage.removeItem(`Editor.aiChatHistory`)},[f]),ne=b(async(e,t)=>{let i=A[E];if(!i)return`Error: ${y.t(`Please select a valid model`)}`;let o=R.current||await ie(n,r);if(R.current=o,!o)return`Error: ${y.t(`No API keys configured`)}`;let s=Object.keys(r)[0];if(!s)return`Error: ${y.t(`No running javascript instance found`)}`;let c=i===`custom`&&o.gptBaseUrl||``,l=a||`javascript`,u=`You are an assistant for writing ioBroker ${l} scripts. The user will ask a question about a snippet of their code. Match your answer to the question: \n- If they ask for an explanation, description, or "what does this do?", reply with clear prose (a few sentences). Do NOT repeat the code unchanged. \n- If they explicitly ask for a change, refactor, fix, or rewrite, reply with a single fenced \`\`\`${l===`blockly`?`xml`:l}\`\`\` code block containing the full replacement for the selection. You may add one short sentence before or after the block. \n- If they ask something ambiguous or meta (e.g. "is this correct?"), reply in prose first and only include code if proposing a change. \nioBroker globals available in scripts: on, setState, getState, schedule, sendTo, log, createState, setStateDelayed, existsState, httpGet, httpPost.`,d=t?`Code from my editor:\n\n\`\`\`${l===`blockly`?`xml`:l}\n${t}\n\`\`\`\n\n${e}`:e;try{let e=await ce(n,s,{messages:[{role:`system`,content:u},{role:`user`,content:d}],model:E,provider:i,baseUrl:c});return e.error?`Error: ${e.error}`:e.content||``}catch(e){return`Error: ${e.message||String(e)}`}},[E,A,r,n,a]);return{messages:u,isLoading:p,error:w,model:E,availableModels:O,modelProviderMap:A,modelsLoading:N,modelsError:I,lastContextInfo:h,mode:v,setMode:S,setModel:te,sendMessage:K,triggerAiAction:b(e=>{e.range&&e.code?z.current=l(e.kind||`codelens`,e.range,e.code):z.current=null,t(async()=>{let{buildActionPrompt:e}=await import(`./aiPromptBuilder-HfYvjqbs.js`);return{buildActionPrompt:e}},[],import.meta.url).then(({buildActionPrompt:t})=>{let n=t({action:e.action,code:e.code,language:a||`javascript`,diagnostic:e.diagnostic,question:e.question,rangeLabel:e.rangeLabel});n?K(n):z.current=null}).catch(()=>{z.current=null,T(y.t(`Failed to build AI action prompt`))})},[K,a,l]),askInline:ne,clearChat:q,retryLoadModels:H}}O();var Fe=({code:e,language:t,themeType:n,onInsertCode:r,onShowDiff:i,sourceRange:a})=>{let o=j(null);C(()=>{var r;let i=window.monaco;if(!o.current||!(i!=null&&(r=i.editor)!=null&&r.colorize))return;let a=t===`ts`||t===`typescript`?`typescript`:t||`javascript`;i.editor.colorize(e,a,{theme:n===`dark`?`vs-dark`:`vs`}).then(e=>{o.current&&(o.current.innerHTML=e)})},[e,t,n]);let s=b(()=>{navigator.clipboard.writeText(e)},[e]);return m(f,{sx:{position:`relative`,my:1,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`},children:[m(f,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,px:1,py:.5,bgcolor:`action.hover`,borderBottom:`1px solid`,borderColor:`divider`},children:[c(f,{sx:{fontSize:`0.75rem`,color:`text.secondary`,textTransform:`uppercase`},children:t||`javascript`}),m(f,{children:[c(N,{title:y.t(`Copy`),children:c(S,{size:`small`,onClick:s,children:c(D,{sx:{fontSize:16}})})}),r&&c(N,{title:y.t(`Insert into editor`),children:c(S,{size:`small`,onClick:()=>r(e),children:c(R,{sx:{fontSize:16}})})}),i&&c(N,{title:y.t(`Show as diff`),children:c(S,{size:`small`,onClick:()=>i(e,a),children:c(V,{sx:{fontSize:16}})})})]})]}),c(`pre`,{ref:o,style:{margin:0,padding:`8px 12px`,overflow:`auto`,maxHeight:400,fontSize:`13px`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`,backgroundColor:n===`dark`?`#1e1e1e`:`#f8f8f8`,color:n===`dark`?`#d4d4d4`:`#333`},children:e})]})};O();var Ie=({xml:e,themeType:t})=>{let n=j(null),r=j(null),[i,a]=_(60),o=j(!1);return C(()=>{o.current&&(o.current=!1,requestAnimationFrame(()=>{let e=window.Blockly,t=r.current;e&&t&&(e.svgResize(t),t.scrollCenter())}))},[i]),C(()=>{let i=window.Blockly;if(!(!i||!n.current)){r.current&&=(r.current.dispose(),null);try{let s=i.inject(n.current,{readOnly:!0,toolbox:null,trashcan:!1,zoom:{controls:!1,wheel:!1,startScale:1},move:{scrollbars:!1,drag:!1,wheel:!1},sounds:!1,renderer:`thrasos`,theme:t===`dark`?L():`classic`,media:`google-blockly/media/`});r.current=s;let c=e.trim();c.startsWith(`${c}`);let l=i.utils.xml.textToDom(c),u=10,d=Array.from(l.querySelectorAll(`:scope > block`));for(let e of d)e.setAttribute(`x`,`10`),e.setAttribute(`y`,String(u)),u+=200;i.Xml.domToWorkspace(l,s);let f=s.getTopBlocks(!1);if(f.length>1){let e=10;for(let t of f){let n=t.getRelativeToSurfaceXY();t.moveBy(10-n.x,e-n.y),e+=t.getHeightWidth().height+20}}let p=s.getBlocksBoundingBox();if(p){let e=p.bottom-p.top+20,t=Math.max(60,Math.ceil(e));o.current=!0,a(t)}}catch{}return()=>{r.current&&=(r.current.dispose(),null)}}},[e,t]),c(f,{ref:n,sx:{width:`100%`,height:i,minHeight:60,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`}})};O();function Le(e){let t=[],n=/```(\w*)\n?([\s\S]*?)```/g,r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r){let n=e.substring(r,i.index).trim();n&&t.push({type:`text`,content:n})}t.push({type:`code`,content:i[2].trim(),language:i[1]||`javascript`}),r=i.index+i[0].length}if(rr&&t.push(e.substring(r,i.index)),i[2]?t.push(c(`strong`,{children:i[2]},a++)):i[3]?t.push(c(`em`,{children:i[3]},a++)):i[4]&&t.push(c(`code`,{className:`ai-chat-inline-code`,style:{padding:`2px 6px`,borderRadius:4,fontSize:`0.85em`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`},children:i[4]},a++)),r=i.index+i[0].length;return re.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()),a=i(e[0]),o=e.slice(2).map(i);return c(f,{sx:{overflowX:`auto`,my:1},children:m(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:`0.8rem`,color:t.palette.text.primary},children:[c(`thead`,{children:c(`tr`,{children:a.map((e,n)=>c(`th`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,backgroundColor:r?t.palette.grey[800]:t.palette.grey[100],color:t.palette.text.primary,fontWeight:600,textAlign:`left`},children:$(e)},n))})}),c(`tbody`,{children:o.map((e,n)=>c(`tr`,{style:{backgroundColor:n%2==1?r?t.palette.grey[900]:t.palette.grey[50]:void 0},children:e.map((e,n)=>c(`td`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,color:t.palette.text.primary},children:$(e)},n))},n))})]})},n)}function Ve(e,t){let n=e.split(` +`)}),t}),e.push({role:`assistant`,content:i.content||``,tool_calls:i.tool_calls});for(let t of i.tool_calls){let r=await je(n,t,o,s,a);e.push({role:`tool`,tool_call_id:t.id,content:r})}}}catch(e){T(String(e)),f(e=>e.slice(0,-1))}m(!1)},[E,A,u,p,n,r,W,U,o,v,G,f,l,s]),q=b(()=>{f([]),T(null),m(!1),g(null),re(),window.localStorage.removeItem(`Editor.aiChatHistory`)},[f]),ne=b(async(e,t)=>{let i=A[E];if(!i)return`Error: ${y.t(`Please select a valid model`)}`;let o=R.current||await ie(n,r);if(R.current=o,!o)return`Error: ${y.t(`No API keys configured`)}`;let s=Object.keys(r)[0];if(!s)return`Error: ${y.t(`No running javascript instance found`)}`;let c=i===`custom`&&o.gptBaseUrl||``,l=a||`javascript`,u=`You are an assistant for writing ioBroker ${l} scripts. The user will ask a question about a snippet of their code. Match your answer to the question: \n- If they ask for an explanation, description, or "what does this do?", reply with clear prose (a few sentences). Do NOT repeat the code unchanged. \n- If they explicitly ask for a change, refactor, fix, or rewrite, reply with a single fenced \`\`\`${l===`blockly`?`xml`:l}\`\`\` code block containing the full replacement for the selection. You may add one short sentence before or after the block. \n- If they ask something ambiguous or meta (e.g. "is this correct?"), reply in prose first and only include code if proposing a change. \nioBroker globals available in scripts: on, setState, getState, schedule, sendTo, log, createState, setStateDelayed, existsState, httpGet, httpPost.`,d=t?`Code from my editor:\n\n\`\`\`${l===`blockly`?`xml`:l}\n${t}\n\`\`\`\n\n${e}`:e;try{let e=await ce(n,s,{messages:[{role:`system`,content:u},{role:`user`,content:d}],model:E,provider:i,baseUrl:c});return e.error?`Error: ${e.error}`:e.content||``}catch(e){return`Error: ${e.message||String(e)}`}},[E,A,r,n,a]);return{messages:u,isLoading:p,error:w,model:E,availableModels:O,modelProviderMap:A,modelsLoading:N,modelsError:I,lastContextInfo:h,mode:v,setMode:S,setModel:te,sendMessage:K,triggerAiAction:b(e=>{e.range&&e.code?z.current=l(e.kind||`codelens`,e.range,e.code):z.current=null,t(async()=>{let{buildActionPrompt:e}=await import(`./aiPromptBuilder-CBfkFGhG.js`);return{buildActionPrompt:e}},[],import.meta.url).then(({buildActionPrompt:t})=>{let n=t({action:e.action,code:e.code,language:a||`javascript`,diagnostic:e.diagnostic,question:e.question,rangeLabel:e.rangeLabel});n?K(n):z.current=null}).catch(()=>{z.current=null,T(y.t(`Failed to build AI action prompt`))})},[K,a,l]),askInline:ne,clearChat:q,retryLoadModels:H}}O();var Fe=({code:e,language:t,themeType:n,onInsertCode:r,onShowDiff:i,sourceRange:a})=>{let o=j(null);C(()=>{var r;let i=window.monaco;if(!o.current||!(i!=null&&(r=i.editor)!=null&&r.colorize))return;let a=t===`ts`||t===`typescript`?`typescript`:t||`javascript`;i.editor.colorize(e,a,{theme:n===`dark`?`vs-dark`:`vs`}).then(e=>{o.current&&(o.current.innerHTML=e)})},[e,t,n]);let s=b(()=>{navigator.clipboard.writeText(e)},[e]);return m(f,{sx:{position:`relative`,my:1,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`},children:[m(f,{sx:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,px:1,py:.5,bgcolor:`action.hover`,borderBottom:`1px solid`,borderColor:`divider`},children:[c(f,{sx:{fontSize:`0.75rem`,color:`text.secondary`,textTransform:`uppercase`},children:t||`javascript`}),m(f,{children:[c(N,{title:y.t(`Copy`),children:c(S,{size:`small`,onClick:s,children:c(D,{sx:{fontSize:16}})})}),r&&c(N,{title:y.t(`Insert into editor`),children:c(S,{size:`small`,onClick:()=>r(e),children:c(R,{sx:{fontSize:16}})})}),i&&c(N,{title:y.t(`Show as diff`),children:c(S,{size:`small`,onClick:()=>i(e,a),children:c(V,{sx:{fontSize:16}})})})]})]}),c(`pre`,{ref:o,style:{margin:0,padding:`8px 12px`,overflow:`auto`,maxHeight:400,fontSize:`13px`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`,backgroundColor:n===`dark`?`#1e1e1e`:`#f8f8f8`,color:n===`dark`?`#d4d4d4`:`#333`},children:e})]})};O();var Ie=({xml:e,themeType:t})=>{let n=j(null),r=j(null),[i,a]=_(60),o=j(!1);return C(()=>{o.current&&(o.current=!1,requestAnimationFrame(()=>{let e=window.Blockly,t=r.current;e&&t&&(e.svgResize(t),t.scrollCenter())}))},[i]),C(()=>{let i=window.Blockly;if(!(!i||!n.current)){r.current&&=(r.current.dispose(),null);try{let s=i.inject(n.current,{readOnly:!0,toolbox:null,trashcan:!1,zoom:{controls:!1,wheel:!1,startScale:1},move:{scrollbars:!1,drag:!1,wheel:!1},sounds:!1,renderer:`thrasos`,theme:t===`dark`?L():`classic`,media:`google-blockly/media/`});r.current=s;let c=e.trim();c.startsWith(`${c}`);let l=i.utils.xml.textToDom(c),u=10,d=Array.from(l.querySelectorAll(`:scope > block`));for(let e of d)e.setAttribute(`x`,`10`),e.setAttribute(`y`,String(u)),u+=200;i.Xml.domToWorkspace(l,s);let f=s.getTopBlocks(!1);if(f.length>1){let e=10;for(let t of f){let n=t.getRelativeToSurfaceXY();t.moveBy(10-n.x,e-n.y),e+=t.getHeightWidth().height+20}}let p=s.getBlocksBoundingBox();if(p){let e=p.bottom-p.top+20,t=Math.max(60,Math.ceil(e));o.current=!0,a(t)}}catch{}return()=>{r.current&&=(r.current.dispose(),null)}}},[e,t]),c(f,{ref:n,sx:{width:`100%`,height:i,minHeight:60,borderRadius:1,overflow:`hidden`,border:`1px solid`,borderColor:`divider`}})};O();function Le(e){let t=[],n=/```(\w*)\n?([\s\S]*?)```/g,r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r){let n=e.substring(r,i.index).trim();n&&t.push({type:`text`,content:n})}t.push({type:`code`,content:i[2].trim(),language:i[1]||`javascript`}),r=i.index+i[0].length}if(rr&&t.push(e.substring(r,i.index)),i[2]?t.push(c(`strong`,{children:i[2]},a++)):i[3]?t.push(c(`em`,{children:i[3]},a++)):i[4]&&t.push(c(`code`,{className:`ai-chat-inline-code`,style:{padding:`2px 6px`,borderRadius:4,fontSize:`0.85em`,fontFamily:`'Cascadia Code', 'Fira Code', 'Consolas', monospace`},children:i[4]},a++)),r=i.index+i[0].length;return re.trim().replace(/^\||\|$/g,``).split(`|`).map(e=>e.trim()),a=i(e[0]),o=e.slice(2).map(i);return c(f,{sx:{overflowX:`auto`,my:1},children:m(`table`,{style:{borderCollapse:`collapse`,width:`100%`,fontSize:`0.8rem`,color:t.palette.text.primary},children:[c(`thead`,{children:c(`tr`,{children:a.map((e,n)=>c(`th`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,backgroundColor:r?t.palette.grey[800]:t.palette.grey[100],color:t.palette.text.primary,fontWeight:600,textAlign:`left`},children:$(e)},n))})}),c(`tbody`,{children:o.map((e,n)=>c(`tr`,{style:{backgroundColor:n%2==1?r?t.palette.grey[900]:t.palette.grey[50]:void 0},children:e.map((e,n)=>c(`td`,{style:{border:`1px solid ${t.palette.divider}`,padding:`6px 10px`,color:t.palette.text.primary},children:$(e)},n))},n))})]})},n)}function Ve(e,t){let n=e.split(` `),r=[],i=0,a=0;for(;ac(`li`,{children:$(e)},t))},i++));continue}if(/^\d+[.)]\s/.test(e)){let e=[];for(;ac(`li`,{children:$(e)},t))},i++));continue}r.push(c(`div`,{children:$(e)},i++)),a++}return r}var He=({message:e,themeType:t,currentLanguage:r,onInsertCode:i,onShowDiff:a,onApplyCode:o})=>{let l=e.role===`user`,u=s(),p=l?t===`dark`?u.palette.primary.dark:u.palette.primary.main:t===`dark`?u.palette.secondary.dark:u.palette.secondary.main,h=u.palette.getContrastText(p),_=g(()=>Le(e.content),[e.content]),v=(e,t)=>!!(e===`xml`||e===`blockly`||r===`blockly`&&t&&/n.type===`code`?v(n.language,n.content)?m(f,{sx:{my:1},children:[c(Ie,{xml:n.content,themeType:t}),m(f,{sx:{display:`flex`,gap:.5,mt:.5},children:[o&&c(d,{size:`small`,variant:`contained`,color:`primary`,startIcon:c(H,{sx:{fontSize:14}}),onClick:()=>o(n.content),sx:{textTransform:`none`,fontSize:`0.75rem`},children:y.t(`Apply blocks`)}),i&&c(d,{size:`small`,variant:`outlined`,startIcon:c(R,{sx:{fontSize:14}}),onClick:()=>i(n.content),sx:{textTransform:`none`,fontSize:`0.75rem`},children:y.t(`Insert blocks`)})]})]},r):c(Fe,{code:n.content,language:n.language||`javascript`,themeType:t,onInsertCode:i,onShowDiff:a,sourceRange:e.sourceRange||null},r):c(f,{sx:{wordBreak:`break-word`,color:u.palette.text.primary},children:Ve(n.content,u)},r))})]})};function Ue(e){let t=(e||``).toLowerCase();return t.includes(`blockly`)||t.includes(`rules`)?`blockly`:t.includes(`typescript`)?`typescript`:`javascript`}function We(e,t){return`\`\`\`${t===`blockly`?`xml`:t}\n${e}\n\`\`\``}function Ge(e){let t=(e.code||``).trim(),n=Ue(e.language),r=e.rangeLabel?` (${e.rangeLabel})`:``;switch(e.action){case`explain`:return t?[`Please explain what this ioBroker ${n} code does${r}.`,`Focus on: which datapoints it reads/writes, which triggers fire it, and any side-effects.`,``,We(t,n)].join(` `):null;case`refactor`:return t?[`Refactor this ioBroker ${n} code${r} to be cleaner and more idiomatic.`,`Preserve behavior exactly. Keep ioBroker APIs (on, setState, getState, schedule, sendTo, log).`,`Return the full refactored block inside a \`\`\`${n===`blockly`?`xml`:n}\`\`\` code block so it can be smart-applied.`,``,We(t,n)].join(` `):null;case`comment`:return t?[`Add clear, concise inline comments to this ioBroker ${n} code${r}.`,`Only add comments where they add real value (non-obvious logic, tricky edge cases, business rules).`,`Do not over-comment trivial lines. Return the commented version in a code block.`,``,We(t,n)].join(` diff --git a/admin/assets/Debugger-C6H0IK4l.js b/admin/assets/Debugger-CCdzg9pi.js similarity index 99% rename from admin/assets/Debugger-C6H0IK4l.js rename to admin/assets/Debugger-CCdzg9pi.js index fcadc32e..61bd7cd2 100644 --- a/admin/assets/Debugger-C6H0IK4l.js +++ b/admin/assets/Debugger-CCdzg9pi.js @@ -1,4 +1,4 @@ -import{a as e,o as t,t as n}from"./rolldown-runtime-C0FnF6B9.js";import{$ as r,C as i,Cn as a,Cr as o,F as s,Ft as c,I as l,It as u,Jn as d,L as f,Ln as p,N as m,Ot as h,Rt as g,T as _,U as v,Vt as y,W as b,X as x,Yn as S,en as C,f as w,g as T,gn as E,hn as D,in as O,j as k,mn as A,nr as j,q as ee,vn as M,w as N,wr as P,x as F,xn as I,yn as te}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as L}from"./Error-1oeF0cix.js";import{C as R,S as z}from"./index-sJ01GB6X.js";import{t as B}from"./ScriptEditorVanillaMonaco-BJVSL-yc.js";P();var V={editorDiv:{height:`100%`,width:`100%`,overflow:`hidden`,position:`relative`}},H=class extends j.Component{constructor(e){super(e),this.state={lines:(this.props.script||``).split(/\r\n|\n/)}}render(){return d(`div`,{style:V.editorDiv,children:d(B,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||``,isDark:this.props.themeType===`dark`,socket:this.props.socket,runningInstances:this.props.runningInstances,language:`javascript`,breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:e=>this.props.onToggleBreakpoint(e)},`scriptEditor2`)},`scriptEditorDiv2`)}};P();var U=34,W={logBox:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`},logBoxInner:e=>({display:`inline-block`,color:e.palette.mode===`dark`?`white`:`black`,width:`calc(100% - ${U}px)`,height:`100%`,overflow:`auto`,position:`relative`,verticalAlign:`top`}),info:e=>({background:e.palette.mode===`dark`?`darkgrey`:`lightgrey`,color:(e.palette.mode,`black`)}),error:e=>({background:`#FF0000`,color:e.palette.mode===`dark`?`black`:`white`}),warn:e=>({background:`#FF8000`,color:e.palette.mode===`dark`?`black`:`white`}),debug:e=>({background:`gray`,opacity:.8,color:e.palette.mode===`dark`?`black`:`white`}),silly:e=>({background:`gray`,opacity:.6,color:e.palette.mode===`dark`?`black`:`white`}),table:{fontFamily:`monospace`,width:`100%`},toolbox:{width:U,height:`100%`,boxShadow:`2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)`,display:`inline-block`,verticalAlign:`top`,overflow:`hidden`},trTime:{width:90},trSeverity:{width:40,fontWeight:`bold`},iconButtons:{width:32,height:32,padding:4}};function ne(e){let t,n=e.getHours();return n<10&&(n=`0${n.toString()}`),t=`${n}:`,n=e.getMinutes(),n<10&&(n=`0${n.toString()}`),t+=`${n}:`,n=e.getSeconds(),n<10&&(n=`0${n.toString()}`),t+=`${n}.`,n=e.getMilliseconds(),n<10?n=`00${n.toString()}`:n<100&&(n=`0${n.toString()}`),t+=n,t}var re=class e extends j.Component{constructor(e){super(e),p(this,`messagesEnd`,void 0),this.state={goBottom:!0},this.messagesEnd=j.createRef()}static generateLine(e){return S(y,{component:`tr`,sx:W[e.severity],children:[d(`td`,{style:W.trTime,children:ne(new Date(e.ts))}),d(`td`,{style:W.trSeverity,children:e.severity}),d(`td`,{children:e.text})]},`tr_${e.ts}_${e.text.substring(e.text.length-10,e.text.length)}`)}renderLogList(t){return t!=null&&t.length?S(y,{sx:W.logBoxInner,children:[d(`table`,{style:W.table,children:d(`tbody`,{children:t.map(t=>e.generateLine(t))})},`logTable`),d(`div`,{ref:this.messagesEnd,style:{float:`left`,clear:`both`}},`logScrollPoint`)]},`logList`):d(y,{sx:W.logBoxInner,style:{paddingLeft:10},children:w.t(`Log outputs`)},`logList`)}onCopy(){T.copyToClipboard(this.props.console.join(` +import{a as e,o as t,t as n}from"./rolldown-runtime-C0FnF6B9.js";import{$ as r,C as i,Cn as a,Cr as o,F as s,Ft as c,I as l,It as u,Jn as d,L as f,Ln as p,N as m,Ot as h,Rt as g,T as _,U as v,Vt as y,W as b,X as x,Yn as S,en as C,f as w,g as T,gn as E,hn as D,in as O,j as k,mn as A,nr as j,q as ee,vn as M,w as N,wr as P,x as F,xn as I,yn as te}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as L}from"./Error-1oeF0cix.js";import{C as R,S as z}from"./index-DlFpMLlN.js";import{t as B}from"./ScriptEditorVanillaMonaco-0Mwut6ZY.js";P();var V={editorDiv:{height:`100%`,width:`100%`,overflow:`hidden`,position:`relative`}},H=class extends j.Component{constructor(e){super(e),this.state={lines:(this.props.script||``).split(/\r\n|\n/)}}render(){return d(`div`,{style:V.editorDiv,children:d(B,{triggerPrettier:1,name:this.props.scriptName,adapterName:this.props.adapterName,readOnly:!0,code:this.props.script||``,isDark:this.props.themeType===`dark`,socket:this.props.socket,runningInstances:this.props.runningInstances,language:`javascript`,breakpoints:this.props.breakpoints,location:this.props.paused?this.props.location:null,onToggleBreakpoint:e=>this.props.onToggleBreakpoint(e)},`scriptEditor2`)},`scriptEditorDiv2`)}};P();var U=34,W={logBox:{width:`100%`,height:`100%`,position:`relative`,overflow:`hidden`},logBoxInner:e=>({display:`inline-block`,color:e.palette.mode===`dark`?`white`:`black`,width:`calc(100% - ${U}px)`,height:`100%`,overflow:`auto`,position:`relative`,verticalAlign:`top`}),info:e=>({background:e.palette.mode===`dark`?`darkgrey`:`lightgrey`,color:(e.palette.mode,`black`)}),error:e=>({background:`#FF0000`,color:e.palette.mode===`dark`?`black`:`white`}),warn:e=>({background:`#FF8000`,color:e.palette.mode===`dark`?`black`:`white`}),debug:e=>({background:`gray`,opacity:.8,color:e.palette.mode===`dark`?`black`:`white`}),silly:e=>({background:`gray`,opacity:.6,color:e.palette.mode===`dark`?`black`:`white`}),table:{fontFamily:`monospace`,width:`100%`},toolbox:{width:U,height:`100%`,boxShadow:`2px 0px 4px -1px rgba(0, 0, 0, 0.2), 4px 0px 5px 0px rgba(0, 0, 0, 0.14), 1px 0px 10px 0px rgba(0, 0, 0, 0.12)`,display:`inline-block`,verticalAlign:`top`,overflow:`hidden`},trTime:{width:90},trSeverity:{width:40,fontWeight:`bold`},iconButtons:{width:32,height:32,padding:4}};function ne(e){let t,n=e.getHours();return n<10&&(n=`0${n.toString()}`),t=`${n}:`,n=e.getMinutes(),n<10&&(n=`0${n.toString()}`),t+=`${n}:`,n=e.getSeconds(),n<10&&(n=`0${n.toString()}`),t+=`${n}.`,n=e.getMilliseconds(),n<10?n=`00${n.toString()}`:n<100&&(n=`0${n.toString()}`),t+=n,t}var re=class e extends j.Component{constructor(e){super(e),p(this,`messagesEnd`,void 0),this.state={goBottom:!0},this.messagesEnd=j.createRef()}static generateLine(e){return S(y,{component:`tr`,sx:W[e.severity],children:[d(`td`,{style:W.trTime,children:ne(new Date(e.ts))}),d(`td`,{style:W.trSeverity,children:e.severity}),d(`td`,{children:e.text})]},`tr_${e.ts}_${e.text.substring(e.text.length-10,e.text.length)}`)}renderLogList(t){return t!=null&&t.length?S(y,{sx:W.logBoxInner,children:[d(`table`,{style:W.table,children:d(`tbody`,{children:t.map(t=>e.generateLine(t))})},`logTable`),d(`div`,{ref:this.messagesEnd,style:{float:`left`,clear:`both`}},`logScrollPoint`)]},`logList`):d(y,{sx:W.logBoxInner,style:{paddingLeft:10},children:w.t(`Log outputs`)},`logList`)}onCopy(){T.copyToClipboard(this.props.console.join(` `))}scrollToBottom(){var e;(e=this.messagesEnd)==null||(e=e.current)==null||e.scrollIntoView({behavior:`smooth`})}componentDidUpdate(){this.state.goBottom&&this.scrollToBottom()}render(){let e=this.props.console;return S(`div`,{style:W.logBox,children:[S(`div`,{style:W.toolbox,children:[d(A,{style:W.iconButtons,onClick:()=>this.setState({goBottom:!this.state.goBottom}),color:this.state.goBottom?`secondary`:void 0,size:`medium`,children:d(x,{})}),e!=null&&e.length?d(A,{style:W.iconButtons,onClick:()=>this.props.onClearAllLogs(),size:`medium`,children:d(f,{})}):null,e!=null&&e.length?d(A,{style:W.iconButtons,onClick:()=>this.onCopy(),size:`medium`,children:d(s,{})}):null]},`toolbox`),this.renderLogList(e)]})}},G=n(((t,n)=>{(function(r,i){typeof t==`object`&&typeof n==`object`?n.exports=i((P(),e(o))):typeof define==`function`&&define.amd?define([`react`],i):typeof t==`object`?t.reactJsonView=i((P(),e(o))):r.reactJsonView=i(r.React)})(t,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=48)}([function(t,n){t.exports=e},function(e,t){var n=e.exports={version:`2.6.12`};typeof __e==`number`&&(__e=n)},function(e,t,n){var r=n(26)(`wks`),i=n(17),a=n(3).Symbol,o=typeof a==`function`;(e.exports=function(e){return r[e]||(r[e]=o&&a[e]||(o?a:i)(`Symbol.`+e))}).store=r},function(e,t){var n=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=n)},function(e,t,n){e.exports=!n(8)((function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}))},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){var r=n(7),i=n(16);e.exports=n(4)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(10),i=n(35),a=n(23),o=Object.defineProperty;t.f=n(4)?Object.defineProperty:function(e,t,n){if(r(e),t=a(t,!0),r(n),i)try{return o(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},function(e,t){e.exports=function(e){try{return!!e()}catch{return!0}}},function(e,t,n){var r=n(40),i=n(22);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(11);e.exports=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e}},function(e,t){e.exports=function(e){return typeof e==`object`?e!==null:typeof e==`function`}},function(e,t){e.exports={}},function(e,t,n){var r=n(39),i=n(27);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=!0},function(e,t,n){var r=n(3),i=n(1),a=n(53),o=n(6),s=n(5),c=function(e,t,n){var l,u,d,f=e&c.F,p=e&c.G,m=e&c.S,h=e&c.P,g=e&c.B,_=e&c.W,v=p?i:i[t]||(i[t]={}),y=v.prototype,b=p?r:m?r[t]:(r[t]||{}).prototype;for(l in p&&(n=t),n)(u=!f&&b&&b[l]!==void 0)&&s(v,l)||(d=u?b[l]:n[l],v[l]=p&&typeof b[l]!=`function`?n[l]:g&&u?a(d,r):_&&b[l]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):h&&typeof d==`function`?a(Function.call,d):d,h&&((v.virtual||={})[l]=d,e&c.R&&y&&!y[l]&&o(y,l,d)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return`Symbol(${e===void 0?``:e})_${(++n+r).toString(36)}`}},function(e,t,n){var r=n(22);e.exports=function(e){return Object(r(e))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(52)(!0);n(34)(String,`String`,(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})}))},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e}},function(e,t,n){var r=n(11);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(26)(`keys`),i=n(17);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(1),i=n(3),a=i[`__core-js_shared__`]||={};(e.exports=function(e,t){return a[e]||(a[e]=t===void 0?{}:t)})(`versions`,[]).push({version:r.version,mode:n(14)?`pure`:`global`,copyright:`© 2020 Denis Pushkarev (zloirock.ru)`})},function(e,t){e.exports=`constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf`.split(`,`)},function(e,t,n){var r=n(7).f,i=n(5),a=n(2)(`toStringTag`);e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},function(e,t,n){n(62);for(var r=n(3),i=n(6),a=n(12),o=n(2)(`toStringTag`),s=`CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList`.split(`,`),c=0;cdocument.F=Object<\/script>`),e.close(),c=e.F;r--;)delete c.prototype[a[r]];return c()};e.exports=Object.create||function(e,t){var n;return e===null?n=c():(s.prototype=r(e),n=new s,s.prototype=null,n[o]=e),t===void 0?n:i(n,t)}},function(e,t,n){var r=n(5),i=n(9),a=n(57)(!1),o=n(25)(`IE_PROTO`);e.exports=function(e,t){var n,s=i(e),c=0,l=[];for(n in s)n!=o&&r(s,n)&&l.push(n);for(;t.length>c;)r(s,n=t[c++])&&(~a(l,n)||l.push(n));return l}},function(e,t,n){var r=n(24);e.exports=Object(`z`).propertyIsEnumerable(0)?Object:function(e){return r(e)==`String`?e.split(``):Object(e)}},function(e,t,n){var r=n(39),i=n(27).concat(`length`,`prototype`);t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},function(e,t,n){var r=n(24),i=n(2)(`toStringTag`),a=r(function(){return arguments}())==`Arguments`;e.exports=function(e){var t,n,o;return e===void 0?`Undefined`:e===null?`Null`:typeof(n=function(e,t){try{return e[t]}catch{}}(t=Object(e),i))==`string`?n:a?r(t):(o=r(t))==`Object`&&typeof t.callee==`function`?`Arguments`:o}},function(e,t){var n=function(){return this}();try{n||=Function(`return this`)()}catch{typeof window==`object`&&(n=window)}e.exports=n},function(e,t){var n=/-?\d+(\.\d+)?%?/g;e.exports=function(e){return e.match(n)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.getBase16Theme=t.createStyling=t.invertTheme=void 0;var r=p(n(49)),i=p(n(76)),a=p(n(81)),o=p(n(89)),s=p(n(93)),c=function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(94)),l=p(n(132)),u=p(n(133)),d=p(n(138)),f=n(139);function p(e){return e&&e.__esModule?e:{default:e}}var m=c.default,h=(0,o.default)(m),g=(0,d.default)(u.default,f.rgb2yuv,(function(e){var t,n=(0,a.default)(e,3),r=n[0],i=n[1],o=n[2];return[(t=r,t<.25?1:t<.5?.9-t:1.1-t),i,o]}),f.yuv2rgb,l.default),_=function(e){return function(t){return{className:[t.className,e.className].filter(Boolean).join(` `),style:(0,i.default)({},t.style||{},e.style||{})}}},v=function(e,t){var n=(0,o.default)(t);for(var a in e)n.indexOf(a)===-1&&n.push(a);return n.reduce((function(n,a){return n[a]=function(e,t){if(e===void 0)return t;if(t===void 0)return e;var n=e===void 0?`undefined`:(0,r.default)(e),a=t===void 0?`undefined`:(0,r.default)(t);switch(n){case`string`:switch(a){case`string`:return[t,e].filter(Boolean).join(` `);case`object`:return _({className:e,style:t});case`function`:return function(n){var r=[...arguments].slice(1);return _({className:e})(t.apply(void 0,[n].concat(r)))}}case`object`:switch(a){case`string`:return _({className:t,style:e});case`object`:return(0,i.default)({},t,e);case`function`:return function(n){var r=[...arguments].slice(1);return _({style:e})(t.apply(void 0,[n].concat(r)))}}case`function`:switch(a){case`string`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[_(n)({className:t})].concat(r))};case`object`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[_(n)({style:t})].concat(r))};case`function`:return function(n){var r=[...arguments].slice(1);return e.apply(void 0,[t.apply(void 0,[n].concat(r))].concat(r))}}}}(e[a],t[a]),n}),{})},y=function(e,t){var n=[...arguments].slice(2);if(t===null)return e;Array.isArray(t)||(t=[t]);var a=t.map((function(t){return e[t]})).filter(Boolean).reduce((function(e,t){return typeof t==`string`?e.className=[e.className,t].filter(Boolean).join(` `):(t===void 0?`undefined`:(0,r.default)(t))===`object`?e.style=(0,i.default)({},e.style,t):typeof t==`function`&&(e=(0,i.default)({},e,t.apply(void 0,[e].concat(n)))),e}),{className:``,style:{}});return a.className||delete a.className,(0,o.default)(a.style).length===0&&delete a.style,a},b=t.invertTheme=function(e){return(0,o.default)(e).reduce((function(t,n){return t[n]=/^base/.test(n)?g(e[n]):n===`scheme`?e[n]+`:inverted`:e[n],t}),{})},x=(t.createStyling=(0,s.default)((function(e){var t=[...arguments].slice(3),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=n.defaultBase16,c=a===void 0?m:a,l=n.base16Themes,u=x(r,l===void 0?null:l);u&&(r=(0,i.default)({},u,r));var d=h.reduce((function(e,t){return e[t]=r[t]||c[t],e}),{}),f=v((0,o.default)(r).reduce((function(e,t){return h.indexOf(t)===-1&&(e[t]=r[t]),e}),{}),e(d));return(0,s.default)(y,2).apply(void 0,[f].concat(t))}),3),t.getBase16Theme=function(e,t){if(e&&e.extend&&(e=e.extend),typeof e==`string`){var n=e.split(`:`),r=(0,a.default)(n,2),i=r[0],o=r[1];e=(t||{})[i]||c[i],o===`inverted`&&(e=b(e))}return e&&e.hasOwnProperty(`base00`)?e:void 0})},function(e,t,n){var r,i=typeof Reflect==`object`?Reflect:null,a=i&&typeof i.apply==`function`?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&typeof i.ownKeys==`function`?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(){a!==void 0&&e.removeListener(`error`,a),n([].slice.call(arguments))}var a;t!==`error`&&(a=function(n){e.removeListener(t,i),r(n)},e.once(`error`,a)),e.once(t,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,s;if(l(n),(a=e._events)===void 0?(a=e._events=Object.create(null),e._eventsCount=0):(a.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),a=e._events),o=a[t]),o===void 0)o=a[t]=n,++e._eventsCount;else if(typeof o==`function`?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=u(e))>0&&o.length>i&&!o.warned){o.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+o.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=o.length,s=c,console&&console.warn&&console.warn(s)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?function(e){for(var t=Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=i[e];if(c===void 0)return!1;if(typeof c==`function`)a(c,this,t);else{var l=c.length,u=g(c,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports.Dispatcher=n(140)},function(e,t,n){e.exports=n(142)},function(e,t,n){t.__esModule=!0;var r=o(n(50)),i=o(n(65)),a=typeof i.default==`function`&&typeof r.default==`symbol`?function(e){return typeof e}:function(e){return e&&typeof i.default==`function`&&e.constructor===i.default&&e!==i.default.prototype?`symbol`:typeof e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=typeof i.default==`function`&&a(r.default)===`symbol`?function(e){return e===void 0?`undefined`:a(e)}:function(e){return e&&typeof i.default==`function`&&e.constructor===i.default&&e!==i.default.prototype?`symbol`:e===void 0?`undefined`:a(e)}},function(e,t,n){e.exports={default:n(51),__esModule:!0}},function(e,t,n){n(20),n(29),e.exports=n(30).f(`iterator`)},function(e,t,n){var r=n(21),i=n(22);e.exports=function(e){return function(t,n){var a,o,s=String(i(t)),c=r(n),l=s.length;return c<0||c>=l?e?``:void 0:(a=s.charCodeAt(c))<55296||a>56319||c+1===l||(o=s.charCodeAt(c+1))<56320||o>57343?e?s.charAt(c):a:e?s.slice(c,c+2):o-56320+(a-55296<<10)+65536}}},function(e,t,n){var r=n(54);e.exports=function(e,t,n){if(r(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e}},function(e,t,n){var r=n(38),i=n(16),a=n(28),o={};n(6)(o,n(2)(`iterator`),(function(){return this})),e.exports=function(e,t,n){e.prototype=r(o,{next:i(1,n)}),a(e,t+` Iterator`)}},function(e,t,n){var r=n(7),i=n(10),a=n(13);e.exports=n(4)?Object.defineProperties:function(e,t){i(e);for(var n,o=a(t),s=o.length,c=0;s>c;)r.f(e,n=o[c++],t[n]);return e}},function(e,t,n){var r=n(9),i=n(58),a=n(59);e.exports=function(e){return function(t,n,o){var s,c=r(t),l=i(c.length),u=a(o,l);if(e&&n!=n){for(;l>u;)if((s=c[u++])!=s)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===n)return e||u||0;return!e&&-1}}},function(e,t,n){var r=n(21),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(21),i=Math.max,a=Math.min;e.exports=function(e,t){return(e=r(e))<0?i(e+t,0):a(e,t)}},function(e,t,n){var r=n(3).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(5),i=n(18),a=n(25)(`IE_PROTO`),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,a)?e[a]:typeof e.constructor==`function`&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var r=n(63),i=n(64),a=n(12),o=n(9);e.exports=n(34)(Array,`Array`,(function(e,t){this._t=o(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):i(0,t==`keys`?n:t==`values`?e[n]:[n,e[n]])}),`values`),a.Arguments=a.Array,r(`keys`),r(`values`),r(`entries`)},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){e.exports={default:n(66),__esModule:!0}},function(e,t,n){n(67),n(73),n(74),n(75),e.exports=n(1).Symbol},function(e,t,n){var r=n(3),i=n(5),a=n(4),o=n(15),s=n(37),c=n(68).KEY,l=n(8),u=n(26),d=n(28),f=n(17),p=n(2),m=n(30),h=n(31),g=n(69),_=n(70),v=n(10),y=n(11),b=n(18),x=n(9),S=n(23),C=n(16),w=n(38),T=n(71),E=n(72),D=n(32),O=n(7),k=n(13),A=E.f,j=O.f,ee=T.f,M=r.Symbol,N=r.JSON,P=N&&N.stringify,F=p(`_hidden`),I=p(`toPrimitive`),te={}.propertyIsEnumerable,L=u(`symbol-registry`),R=u(`symbols`),z=u(`op-symbols`),B=Object.prototype,V=typeof M==`function`&&!!D.f,H=r.QObject,U=!H||!H.prototype||!H.prototype.findChild,W=a&&l((function(){return w(j({},`a`,{get:function(){return j(this,`a`,{value:7}).a}})).a!=7}))?function(e,t,n){var r=A(B,t);r&&delete B[t],j(e,t,n),r&&e!==B&&j(B,t,r)}:j,ne=function(e){var t=R[e]=w(M.prototype);return t._k=e,t},re=V&&typeof M.iterator==`symbol`?function(e){return typeof e==`symbol`}:function(e){return e instanceof M},G=function(e,t,n){return e===B&&G(z,t,n),v(e),t=S(t,!0),v(n),i(R,t)?(n.enumerable?(i(e,F)&&e[F][t]&&(e[F][t]=!1),n=w(n,{enumerable:C(0,!1)})):(i(e,F)||j(e,F,C(1,{})),e[F][t]=!0),W(e,t,n)):j(e,t,n)},ie=function(e,t){v(e);for(var n,r=g(t=x(t)),i=0,a=r.length;a>i;)G(e,n=r[i++],t[n]);return e},K=function(e){var t=te.call(this,e=S(e,!0));return!(this===B&&i(R,e)&&!i(z,e))&&(!(t||!i(this,e)||!i(R,e)||i(this,F)&&this[F][e])||t)},q=function(e,t){if(e=x(e),t=S(t,!0),e!==B||!i(R,t)||i(z,t)){var n=A(e,t);return!n||!i(R,t)||i(e,F)&&e[F][t]||(n.enumerable=!0),n}},J=function(e){for(var t,n=ee(x(e)),r=[],a=0;n.length>a;)i(R,t=n[a++])||t==F||t==c||r.push(t);return r},Y=function(e){for(var t,n=e===B,r=ee(n?z:x(e)),a=[],o=0;r.length>o;)!i(R,t=r[o++])||n&&!i(B,t)||a.push(R[t]);return a};V||(s((M=function(){if(this instanceof M)throw TypeError(`Symbol is not a constructor!`);var e=f(arguments.length>0?arguments[0]:void 0),t=function(n){this===B&&t.call(z,n),i(this,F)&&i(this[F],e)&&(this[F][e]=!1),W(this,e,C(1,n))};return a&&U&&W(B,e,{configurable:!0,set:t}),ne(e)}).prototype,`toString`,(function(){return this._k})),E.f=q,O.f=G,n(41).f=T.f=J,n(19).f=K,D.f=Y,a&&!n(14)&&s(B,`propertyIsEnumerable`,K,!0),m.f=function(e){return ne(p(e))}),o(o.G+o.W+o.F*!V,{Symbol:M});for(var X=`hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables`.split(`,`),Z=0;X.length>Z;)p(X[Z++]);for(var ae=k(p.store),oe=0;ae.length>oe;)h(ae[oe++]);o(o.S+o.F*!V,`Symbol`,{for:function(e){return i(L,e+=``)?L[e]:L[e]=M(e)},keyFor:function(e){if(!re(e))throw TypeError(e+` is not a symbol!`);for(var t in L)if(L[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),o(o.S+o.F*!V,`Object`,{create:function(e,t){return t===void 0?w(e):ie(w(e),t)},defineProperty:G,defineProperties:ie,getOwnPropertyDescriptor:q,getOwnPropertyNames:J,getOwnPropertySymbols:Y});var se=l((function(){D.f(1)}));o(o.S+o.F*se,`Object`,{getOwnPropertySymbols:function(e){return D.f(b(e))}}),N&&o(o.S+o.F*(!V||l((function(){var e=M();return P([e])!=`[null]`||P({a:e})!=`{}`||P(Object(e))!=`{}`}))),`JSON`,{stringify:function(e){for(var t,n,r=[e],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=t=r[1],(y(t)||e!==void 0)&&!re(e))return _(t)||(t=function(e,t){if(typeof n==`function`&&(t=n.call(this,e,t)),!re(t))return t}),r[1]=t,P.apply(N,r)}}),M.prototype[I]||n(6)(M.prototype,I,M.prototype.valueOf),d(M,`Symbol`),d(Math,`Math`,!0),d(r.JSON,`JSON`,!0)},function(e,t,n){var r=n(17)(`meta`),i=n(11),a=n(5),o=n(7).f,s=0,c=Object.isExtensible||function(){return!0},l=!n(8)((function(){return c(Object.preventExtensions({}))})),u=function(e){o(e,r,{value:{i:`O`+ ++s,w:{}}})},d=e.exports={KEY:r,NEED:!1,fastKey:function(e,t){if(!i(e))return typeof e==`symbol`?e:(typeof e==`string`?`S`:`P`)+e;if(!a(e,r)){if(!c(e))return`F`;if(!t)return`E`;u(e)}return e[r].i},getWeak:function(e,t){if(!a(e,r)){if(!c(e))return!0;if(!t)return!1;u(e)}return e[r].w},onFreeze:function(e){return l&&d.NEED&&c(e)&&!a(e,r)&&u(e),e}}},function(e,t,n){var r=n(13),i=n(32),a=n(19);e.exports=function(e){var t=r(e),n=i.f;if(n)for(var o,s=n(e),c=a.f,l=0;s.length>l;)c.call(e,o=s[l++])&&t.push(o);return t}},function(e,t,n){var r=n(24);e.exports=Array.isArray||function(e){return r(e)==`Array`}},function(e,t,n){var r=n(9),i=n(41).f,a={}.toString,o=typeof window==`object`&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&a.call(e)==`[object Window]`?function(e){try{return i(e)}catch{return o.slice()}}(e):i(r(e))}},function(e,t,n){var r=n(19),i=n(16),a=n(9),o=n(23),s=n(5),c=n(35),l=Object.getOwnPropertyDescriptor;t.f=n(4)?l:function(e,t){if(e=a(e),t=o(t,!0),c)try{return l(e,t)}catch{}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t){},function(e,t,n){n(31)(`asyncIterator`)},function(e,t,n){n(31)(`observable`)},function(e,t,n){t.__esModule=!0;var r;t.default=((r=n(77))&&r.__esModule?r:{default:r}).default||function(e){for(var t=1;tu;)for(var p,m=c(arguments[u++]),h=d?i(m).concat(d(m)):i(m),g=h.length,_=0;g>_;)p=h[_++],r&&!f.call(m,p)||(n[p]=m[p]);return n}:l},function(e,t,n){t.__esModule=!0;var r=a(n(82)),i=a(n(85));function a(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){if(Array.isArray(e))return e;if((0,r.default)(Object(e)))return function(e,t){var n=[],r=!0,a=!1,o=void 0;try{for(var s,c=(0,i.default)(e);!(r=(s=c.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){a=!0,o=e}finally{try{!r&&c.return&&c.return()}finally{if(a)throw o}}return n}(e,t);throw TypeError(`Invalid attempt to destructure non-iterable instance`)}},function(e,t,n){e.exports={default:n(83),__esModule:!0}},function(e,t,n){n(29),n(20),e.exports=n(84)},function(e,t,n){var r=n(42),i=n(2)(`iterator`),a=n(12);e.exports=n(1).isIterable=function(e){var t=Object(e);return t[i]!==void 0||`@@iterator`in t||a.hasOwnProperty(r(t))}},function(e,t,n){e.exports={default:n(86),__esModule:!0}},function(e,t,n){n(29),n(20),e.exports=n(87)},function(e,t,n){var r=n(10),i=n(88);e.exports=n(1).getIterator=function(e){var t=i(e);if(typeof t!=`function`)throw TypeError(e+` is not iterable!`);return r(t.call(e))}},function(e,t,n){var r=n(42),i=n(2)(`iterator`),a=n(12);e.exports=n(1).getIteratorMethod=function(e){if(e!=null)return e[i]||e[`@@iterator`]||a[r(e)]}},function(e,t,n){e.exports={default:n(90),__esModule:!0}},function(e,t,n){n(91),e.exports=n(1).Object.keys},function(e,t,n){var r=n(18),i=n(13);n(92)(`keys`,(function(){return function(e){return i(r(e))}}))},function(e,t,n){var r=n(15),i=n(1),a=n(8);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],o={};o[e]=t(n),r(r.S+r.F*a((function(){n(1)})),`Object`,o)}},function(e,t,n){(function(t){var n=[[`ary`,128],[`bind`,1],[`bindKey`,2],[`curry`,8],[`curryRight`,16],[`flip`,512],[`partial`,32],[`partialRight`,64],[`rearg`,256]],r=/^\s+|\s+$/g,i=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,a=/\{\n\/\* \[wrapped with (.+)\] \*/,o=/,? & /,s=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^\[object .+?Constructor\]$/,u=/^0o[0-7]+$/i,d=/^(?:0|[1-9]\d*)$/,f=parseInt,p=typeof t==`object`&&t&&t.Object===Object&&t,m=typeof self==`object`&&self&&self.Object===Object&&self,h=p||m||Function(`return this`)();function g(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _(e,t){return!!(e&&e.length)&&function(e,t,n){if(t!=t)return function(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a-1}function v(e){return e!=e}function y(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&r++;return r}function b(e,t){for(var n=-1,r=e.length,i=0,a=[];++n2?S:void 0);function F(e){return J(e)?ee(e):{}}function I(e){return!(!J(e)||function(e){return!!D&&D in e}(e))&&(function(e){var t=J(e)?A.call(e):``;return t==`[object Function]`||t==`[object GeneratorFunction]`}(e)||function(e){var t=!1;if(e!=null&&typeof e.toString!=`function`)try{t=!!(e+``)}catch{}return t}(e)?j:l).test(function(e){if(e!=null){try{return O.call(e)}catch{}try{return e+``}catch{}}return``}(e))}function te(e,t,n,r){for(var i=-1,a=e.length,o=n.length,s=-1,c=t.length,l=M(a-o,0),u=Array(c+l),d=!r;++s1&&x.reverse(),u&&c1?`& `:``)+t[r],t=t.join(n>2?`, `:` `),e.replace(i,`{ /* [wrapped with `+t+`] */ `)}function re(e,t){return!!(t??=9007199254740991)&&(typeof e==`number`||d.test(e))&&e>-1&&e%1==0&&e1&&r--,a=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,i[l]=255*a;return i}},function(e,t,n){(function(t){var n=typeof t==`object`&&t&&t.Object===Object&&t,r=typeof self==`object`&&self&&self.Object===Object&&self,i=n||r||Function(`return this`)();function a(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function o(e,t){for(var n=-1,r=t.length,i=e.length;++n-1&&e%1==0&&e<=9007199254740991}(e.length)&&!function(e){var t=function(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}(e)?l.call(e):``;return t==`[object Function]`||t==`[object GeneratorFunction]`}(e)}(e)}(e)&&c.call(e,`callee`)&&(!d.call(e,`callee`)||l.call(e)==`[object Arguments]`)}(e)||!!(f&&e&&e[f])}var h=Array.isArray,g,_,v;e.exports=(_=function(e){var t=(e=function e(t,n,r,i,a){var s=-1,c=t.length;for(r||=m,a||=[];++s0&&r(l)?n>1?e(l,n-1,r,i,a):o(a,l):i||(a[a.length]=l)}return a}(e,1)).length,n=t;for(g&&e.reverse();n--;)if(typeof e[n]!=`function`)throw TypeError(`Expected a function`);return function(){for(var n=0,r=t?e[n].apply(this,arguments):arguments[0];++n`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch{return!1}}();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return m(this,n)}}n.r(t);var g=n(0),_=n.n(g);function v(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function y(e){this.setState(function(t){return this.constructor.getDerivedStateFromProps(e,t)??null}.bind(this))}function b(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function x(e){var t=e.prototype;if(!t||!t.isReactComponent)throw Error(`Can only polyfill class components`);if(typeof e.getDerivedStateFromProps!=`function`&&typeof t.getSnapshotBeforeUpdate!=`function`)return e;var n=null,r=null,i=null;if(typeof t.componentWillMount==`function`?n=`componentWillMount`:typeof t.UNSAFE_componentWillMount==`function`&&(n=`UNSAFE_componentWillMount`),typeof t.componentWillReceiveProps==`function`?r=`componentWillReceiveProps`:typeof t.UNSAFE_componentWillReceiveProps==`function`&&(r=`UNSAFE_componentWillReceiveProps`),typeof t.componentWillUpdate==`function`?i=`componentWillUpdate`:typeof t.UNSAFE_componentWillUpdate==`function`&&(i=`UNSAFE_componentWillUpdate`),n!==null||r!==null||i!==null){var a=e.displayName||e.name,o=typeof e.getDerivedStateFromProps==`function`?`getDerivedStateFromProps()`:`getSnapshotBeforeUpdate()`;throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. diff --git a/admin/assets/RulesEditor-C8w1UaWO.js b/admin/assets/RulesEditor-B84Rh__9.js similarity index 99% rename from admin/assets/RulesEditor-C8w1UaWO.js rename to admin/assets/RulesEditor-B84Rh__9.js index a8be0c29..ab5c5495 100644 --- a/admin/assets/RulesEditor-C8w1UaWO.js +++ b/admin/assets/RulesEditor-B84Rh__9.js @@ -1 +1 @@ -import{En as e,Et as t,Fn as n,Ft as r,Jn as i,Ot as a,Qt as o,Rn as s,St as c,Tt as l,Ut as u,Yn as d,_r as f,br as p,bt as m,dt as h,en as g,f as _,fr as v,g as y,hr as b,in as x,kn as S,mn as C,mr as w,nn as T,pr as E,rn as D,tn as O,ur as k,wn as A,wr as j,wt as M,yr as N}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{n as P,t as ee}from"./Import-BH2X_ziv.js";import{_ as te,a as F,g as I,h as L,i as R,n as z,o as B,r as ne,t as V,v as H,x as U,y as W}from"./index-sJ01GB6X.js";var re=s(i(`path`,{d:`M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12z`}),`AutoFixHigh`),ie=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`),ae=s(i(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),oe=s(i(`path`,{d:`M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z`}),`DeleteOutlined`),se=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`NavigateBefore`);j();function ce(e){let t=H().getMonitor(),[n,r]=W(t,e);return w(()=>t.subscribeToOffsetChange(r)),w(()=>t.subscribeToStateChange(r)),n}var G;function le(){return G||(G=new Image,G.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),G}var K={wrapperRules:`_wrapperRules_147jt_8`,rootWrapper:`_rootWrapper_147jt_14`,bands:`_bands_147jt_26`,emptyRule:`_emptyRule_147jt_39`,emptyRuleText:`_emptyRuleText_147jt_51`},ue={switchesItem:`_switchesItem_10ls3_1`,switchesItemActive:`_switchesItemActive_10ls3_28`,iconTheme:`_iconTheme_10ls3_36`};j();var de=({name:e,id:t,active:n,icon:r,adapter:a,socket:o,onDoubleClick:s,title:c,onTouchMove:l,style:u})=>d(`div`,{onDoubleClick:s,onTouchMove:l,title:c?_.t(c):void 0,className:y.clsx(ue.switchesItem,n&&ue.switchesItemActive,`block-${t}`),children:[i(F,{iconName:r,className:ue.iconTheme,adapter:a,socket:o,style:u}),i(`span`,{children:e?_.t(e):``})]},t),q={cardStyle:`_cardStyle_vibq0_1`,railTriggers:`_railTriggers_vibq0_25`,railConditions:`_railConditions_vibq0_29`,railActions:`_railActions_vibq0_33`,cardStyleActive:`_cardStyleActive_vibq0_37`,controlMenu:`_controlMenu_vibq0_42`,closeBtn:`_closeBtn_vibq0_60`,isDelete:`_isDelete_vibq0_102`,drag_mobile:`_drag_mobile_vibq0_121`};function J(e,t,n){let r;switch(e){case`actions`:if(n===`else`)return r={...t,actions:{...t[e],else:[...t[e].else]}},r;if(n===`then`)return r={...t,actions:{...t[e],then:[...t[e].then]}},r;throw console.error(`Unknown additionalParameter: ${n}`),Error(`Unknown additionalParameter: ${n}`);case`triggers`:return r={...t,triggers:[...t.triggers]},r;case`conditions`:return r={...t,conditions:[...t.conditions]},r;default:throw Error(`Unknown name: ${e}`)}}function Y(e,t,n,r){switch(e){case`actions`:return t.actions[n]=t.actions[n].filter(e=>e._id!==r),t;case`conditions`:var i;return t.conditions[n]=(i=t.conditions[n])==null?void 0:i.filter(e=>e._id!==r),t;default:return t.triggers=t.triggers.filter(e=>e._id!==r),t}}function fe(e,t,n){let{_id:r,acceptedBy:i}=e,a;if(!i||!t[i])return console.warn(`Cannot find ${i}`),t;switch(i){case`actions`:if(a=t.actions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.actions[n].indexOf(a);t.actions[n][r]=e}return t;case`conditions`:if(a=t.conditions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.conditions[n].indexOf(a);t.conditions[n][r]=e}return t;default:if(a=t.triggers.find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let n=t.triggers.indexOf(a);t.triggers[n]=e}return t}}j();var pe={triggers:q.railTriggers,conditions:q.railConditions,actions:q.railActions},me=k(e=>{var t;let{setUserRules:n,userRules:r,_id:a,id:o,blockValue:s,active:c,acceptedBy:l,isTourOpen:u,setTourStep:m,tourStep:h}=e,{blocks:g,socket:_,onUpdate:y,setOnUpdate:b,onDebugMessage:x,enableSimulation:S}=E(V),C=v(e=>g==null?void 0:g.find(t=>t.getStaticData().id===e),[g]),w=v(e=>{let t=fe(e,r,s);t&&n(t)},[r]),T=f(()=>{let t=C(o)||R;return i(t,{...e,notFound:!C(o),isTourOpen:u,setTourStep:m,tourStep:h,onUpdate:y,setOnUpdate:b,enableSimulation:S,onDebugMessage:x,onChange:w,className:void 0,socket:_})},[r,y,x,S]),[D,O]=p(!1);return d(`div`,{onMouseDown:e=>{if(e.ctrlKey){let e,t=J(l,r,s);l===`conditions`?(e=t.conditions[s].find(e=>e._id===a),e&&t.conditions[s].splice(t.conditions[s].indexOf(e),0,{...e,_id:Date.now()})):l===`actions`?(e=t.actions[s].find(e=>e._id===a),e&&t.actions[s].splice(t.actions[s].indexOf(e),0,{...e,_id:Date.now()})):(e=t.triggers.find(e=>e._id===a),e&&t.triggers.splice(t[l].indexOf(e),0,{...e,_id:Date.now()})),n(t)}},id:`height`,style:c?{width:(((t=document.getElementById(`width`))==null?void 0:t.clientWidth)||0)-70}:void 0,className:[q.cardStyle,pe[l],c&&q.cardStyleActive,D&&q.isDelete].filter(Boolean).join(` `),children:[i(`div`,{className:q.drag_mobile}),T,n&&i(`div`,{className:q.controlMenu,children:i(`div`,{onClick:()=>{let e=J(l,r,s);e=Y(l,e,s,a),O(!0),setTimeout(()=>{l===`triggers`&&b(!0),n(e)},300)},className:q.closeBtn})})]})});j();var he={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},ge=(e,t)=>[Math.round(e/32)*32,Math.round(t/32)*32],_e=(e,t,n)=>{if(!e||!t)return{display:`none`};let{x:r,y:i}=t;n&&(r-=e.x,i-=e.y,[r,i]=ge(r,i),r+=e.x,i+=e.y);let a=`translate(${r}px, ${i}px)`;return{transform:a,WebkitTransform:a}},ve=e=>{let{itemType:t,isDragging:n,item:r,initialOffset:a,currentOffset:o,targetIds:s}=ce(e=>({item:e.getItem(),itemType:e.getItemType(),initialOffset:e.getInitialSourceClientOffset(),currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),targetIds:e.getTargetIds()}));return n?i(`div`,{style:he,children:i(`div`,{style:_e(a,o),children:(()=>{switch(t){case`box`:return s.length?i(me,{active:!0,...r,allBlocks:e.allBlocks}):i(de,{active:!0,...r,socket:e.socket});default:return null}})()})}):null},X={emptyBlockStyle:`_emptyBlockStyle_p7qtf_1`,emptyBlock:`_emptyBlock_p7qtf_1`,marginTop:`_marginTop_p7qtf_1`,selectOnChange:`_selectOnChange_p7qtf_17`,selectOnChangeHelp:`_selectOnChangeHelp_p7qtf_23`,selectOnChangeHelpIcon:`_selectOnChangeHelpIcon_p7qtf_29`,emptyBlockNone:`_emptyBlockNone_p7qtf_44`,bandTriggers:`_bandTriggers_p7qtf_57`,bandConditions:`_bandConditions_p7qtf_61`,bandActions:`_bandActions_p7qtf_65`,mainBlockItemRules:`_mainBlockItemRules_p7qtf_69`,nameBlockItems:`_nameBlockItems_p7qtf_93`,contentBlockItem:`_contentBlockItem_p7qtf_119`,wrapperMargin:`_wrapperMargin_p7qtf_127`,contentHeightOn:`_contentHeightOn_p7qtf_134`,heightBlock:`_heightBlock_p7qtf_1`,contentHeightOff:`_contentHeightOff_p7qtf_146`,cardAdd:`_cardAdd_p7qtf_152`,blockCardAdd:`_blockCardAdd_p7qtf_172`};j();function ye(e,t){let[n,r]=p(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||``):e);return[n,e=>{window.localStorage.setItem(t,JSON.stringify(e)),r(e)},!!window.localStorage.getItem(t)]}function be(e,t){let n=0,r=null,i;return function(...a){let o=Date.now();i=a,o-n>=t?(n=o,e.apply(this,a)):r||=setTimeout(()=>{n=Date.now(),r=null,e.apply(this,i)},t-(o-n))}}function xe(e){if(Array.isArray(e))return e.map(e=>xe(e));if(typeof e==`function`)return e.bind(null);if(e&&typeof e==`object`){let t={};return Object.keys(e).forEach(n=>{t[n]=xe(e[n])}),t}return e}var Se=be((e,t)=>e(t),0);function Ce(e,t){let n=t.find(t=>t._id===e);return{card:n,index:n?t.indexOf(n):-1}}function we(e,t,n,r,i,a,o,s,c){let{card:l,index:u}=Ce(e,n);if(!(ut&&s>c)&&l&&u!==t){let e=xe(n);e.splice(u,1),e.splice(t,0,l);let s=xe(i);switch(a){case`actions`:s.actions[o]=e,Se(r,s);return;case`conditions`:s.conditions[o]=e,Se(r,s);return;default:s.triggers=e,Se(r,s);return}}}var Te={drag:`_drag_7xfhc_1`,root:`_root_7xfhc_11`};j();var Ee=({typeBlock:e,allProperties:t,id:n,isActive:r,setUserRules:a,userRules:o,children:s,_id:c,blockValue:l})=>{let{setOnUpdate:u}=E(V),[{opacity:f},p,m]=te({type:`box`,item:()=>({...t,id:n,isActive:r,_id:c}),end:(e,t)=>{let{acceptedBy:n}=e,r=t.getDropResult(),i;if(!r)return typeof c==`number`&&!t.getTargetIds().length&&(i=J(n,o,l),i=Y(n,i,l,c),a(i)),null;if(r.blockValue!==l){let t=typeof c==`number`?c:Date.now();i=J(n,o,r.blockValue);let s={id:e.id,acceptedBy:e.acceptedBy};switch(n){case`actions`:return l&&(i=Y(`actions`,i,l,t)),i=Y(`actions`,i,r.blockValue,t),i.actions[r.blockValue].push({...s,_id:t}),a(i);case`conditions`:return typeof l==`number`&&(i=Y(`conditions`,i,l,t)),i=Y(`conditions`,i,r.blockValue,t),i.conditions[r.blockValue].push({...s,_id:t}),a(i);default:return u(!0),i=Y(`triggers`,i,r.blockValue,t),i.triggers.push({...s,_id:t}),a(i)}}},collect:e=>({opacity:e.isDragging()?.4:1,isDragging:e.isDragging()})}),h=N(null),[,g]=I({accept:`box`,canDrop:()=>!1,hover({_id:t,acceptedBy:n},r){var i;if(!h.current||e!==n)return;let s=(i=h.current)==null?void 0:i.getBoundingClientRect(),u=(s.bottom-s.top)/2,d=r.getClientOffset(),f=((d==null?void 0:d.y)||0)-s.top;if(c&&t!==c)switch(n){case`actions`:if(l===`then`||l===`else`){let{index:e}=Ce(c,o.actions[l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;case`conditions`:if(typeof l==`number`){let{index:e}=Ce(c,o[n][l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;default:{let{index:e}=Ce(c,o[n]);e!==t&&we(t,e,o[n],a,o,n,void 0,f,u);return}}}});w(()=>{m(le(),{captureDraggingState:!0})},[]),p(g(h));let _=window.innerWidth<600;return d(`div`,{ref:_&&c?null:h,className:Te.root,style:{opacity:f},children:[i(`div`,{className:c?Te.drag:null,ref:c&&_?h:null}),s]})};j();var De=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(`div`,{style:{fontSize:`1rem`,fontFamily:`"Roboto", "Helvetica", "Arial", sans-serif`,fontWeight:400,lineHeight:1.5,letterSpacing:`0.00938em`},children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,startIcon:i(c,{}),children:_.t(`OK`)})})]});j();var Oe=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(D,{id:`alert-dialog-description`,children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,children:_.t(`OK`)})})]});j();var ke={triggers:X.bandTriggers,conditions:X.bandConditions,actions:X.bandActions},Ae=({blockValue:e,boolean:t,typeBlock:n,userRules:r,setUserRules:a,animation:o,setTourStep:s,tourStep:c,isTourOpen:l,theme:u,themeType:f,themeName:m})=>{var h;let[g,_]=p(!1),[v,b]=p(!1),[x,S]=p(!1),[C,T]=p(``);t===void 0&&(t=!0);let E=I({accept:`box`,drop:()=>({blockValue:e}),hover:({acceptedBy:e,_id:t},r)=>{_(e===n),S(!!t),T(r.getHandlerId()||``)},canDrop:({acceptedBy:e})=>(b(e===n),e===n),collect:e=>{var t;return{isOver:e.isOver(),canDrop:((t=e.getItem())==null?void 0:t.acceptedBy)===n,offset:e.getClientOffset(),targetId:e.getHandlerId()}}}),{canDrop:D,isOver:O,offset:k,targetId:A}=E[0],j=E[1];w(()=>{T(``)},[k]);let M=D&&O,N=``;M?N=g?`#00fb003d`:`#fb00002e`:D?N=v?`#00fb003d`:`#fb00002e`:k&&(N=A===C?`#fb00002e`:``);let P;return P=n===`actions`?r.actions[e]:n===`conditions`?r.conditions[e]:r.triggers,i(`div`,{ref:e=>{j(e)},style:{backgroundColor:N},className:y.clsx(X.contentBlockItem,t?o&&X.contentHeightOn:X.contentHeightOff),children:d(`div`,{className:X.wrapperMargin,children:[P.map(t=>i(Ee,{typeBlock:n,...t,blockValue:e,allProperties:t,userRules:r,setUserRules:a,children:i(me,{...t,isTourOpen:l,setTourStep:s,tourStep:c,settings:t,blockValue:e,userRules:r,setUserRules:a,theme:u,themeType:f,themeName:m})},t._id)),i(`div`,{style:M&&g&&!x?{height:((h=document.getElementById(`height`))==null?void 0:h.clientHeight)||200}:void 0,className:`${X.emptyBlockStyle} ${M&&g&&!x?X.emptyBlock:X.emptyBlockNone}`})]})})},je=({typeBlock:t,name:n,nameAdditionally:r,additionally:a,userRules:o,setUserRules:s,iconName:c,adapter:l,socket:u,setTourStep:f,tourStep:m,isTourOpen:h,theme:g,themeType:v,themeName:y})=>{let[x,T,E]=ye(t!==`actions`&&[],`additionallyClickItems_${t}`),[D,O]=p(!1),[k,A]=p(!1);w(()=>{if(t===`conditions`&&(x==null?void 0:x.length)!==o.conditions.length-1){let e=[];o.conditions.forEach((t,n)=>{n>0&&e.push({_id:Date.now(),open:!0})}),T([...x,...e])}t===`actions`&&!E&&o.actions.else.length&&T(!0)},[]);let[j,M]=p(!1);return d(`div`,{className:`${X.mainBlockItemRules} ${ke[t]}`,children:[d(`span`,{id:`width`,className:X.nameBlockItems,children:[i(F,{iconName:c,className:X.iconThemCard,adapter:l,socket:u}),n]}),t===`conditions`?d(`div`,{style:{width:`100%`},children:[d(S,{variant:`standard`,className:X.selectOnChange,value:o.justCheck||!1,onChange:e=>{let t=J(`conditions`,o);t.justCheck=e.target.value===`true`,s(t)},children:[i(e,{value:`false`,children:_.t(`on condition change`)}),i(e,{value:`true`,children:_.t(`just check`)})]}),i(C,{size:`small`,title:_.t(`Explanation`),className:X.selectOnChangeHelp,onClick:()=>O(!0),children:i(U,{className:X.selectOnChangeHelpIcon})})]}):null,i(Ae,{setTourStep:f,tourStep:m,isTourOpen:h,blockValue:t===`actions`?`then`:t===`conditions`?0:t,typeBlock:t,setUserRules:s,userRules:o,theme:g,themeName:y,themeType:v}),a&&[...Array(t===`actions`?1:o.conditions.length-1)].map((e,n)=>{let a=(e=n)=>t===`actions`?!!x:!!x.find((t,n)=>n===e&&t.open);return d(b,{children:[d(`div`,{onClick:()=>{if(t===`actions`)return T(!x),null;let e=JSON.parse(JSON.stringify(x));if(o.conditions[n+1].length)return e[n].open=!e[n].open,T(e),null;e=e.filter((e,t)=>t!==n),T(e),M(n),setTimeout(()=>{M(!1),s({...o,conditions:[...o.conditions.filter((e,t)=>t!==n+1)]})},250)},className:X.blockCardAdd,children:[a()?`-`:`+`,i(`div`,{className:X.cardAdd,children:r})]},n),i(Ae,{blockValue:t===`actions`?`else`:t===`conditions`?n+1:t,typeBlock:t,setUserRules:s,userRules:o,boolean:a(),animation:j===n,theme:g,themeName:y,themeType:v})]},`${n}_block_${t}`)}),a&&t===`conditions`&&d(`div`,{onClick:()=>{T([...x,{_id:Date.now(),open:!0}]),s({...o,conditions:[...o.conditions,[]]}),M(o.conditions.length-1),setTimeout(()=>M(!1),1e3)},className:X.blockCardAdd,children:[`+`,i(`div`,{className:X.cardAdd,children:r})]}),i(De,{open:D,onClose:()=>O(!1)}),i(Oe,{open:k,onClose:()=>A(!1)})]})},Z={menuRules:`_menuRules_1b2q2_1`,wizardButton:`_wizardButton_1b2q2_13`,switchesRenderWrapper:`_switchesRenderWrapper_1b2q2_21`,menuOff:`_menuOff_1b2q2_30`,menuTitle:`_menuTitle_1b2q2_36`,marginAuto:`_marginAuto_1b2q2_50`,inputWidth:`_inputWidth_1b2q2_55`,menuWrapper:`_menuWrapper_1b2q2_60`,hamburgerWrapper:`_hamburgerWrapper_1b2q2_68`,hamburgerOff:`_hamburgerOff_1b2q2_96`,nothingFound:`_nothingFound_1b2q2_104`,resetSearch:`_resetSearch_1b2q2_111`,controlPanel:`_controlPanel_1b2q2_123`,controlPanelAppBar:`_controlPanelAppBar_1b2q2_134`,addClassMenu:`_addClassMenu_1b2q2_148`,addClassBackground:`_addClassBackground_1b2q2_154`,addClassPosition:`_addClassPosition_1b2q2_158`};j();var Me=e=>{let{allProperties:t,allProperties:{acceptedBy:n,id:r},setUserRules:a,userRules:o,setTourStep:s,tourStep:c,isTourOpen:l,onTouchMove:u,isActive:d}=e;return i(Ee,{allProperties:t,id:t.id,isActive:d,setUserRules:a,userRules:o,children:i(de,{onDoubleClick:()=>{l&&c===L.addScheduleByDoubleClick&&r===`TriggerScheduleBlock`&&s(L.openTagsMenu),l&&c===L.addActionPrintText&&r===`ActionPrintText`&&s(L.showJavascript);let e=Date.now(),t;switch(n){case`actions`:t=`then`;break;case`conditions`:t=o[n].length-1}let i=J(n,o,t),u={id:r,_id:e,acceptedBy:n};t===void 0?i.triggers.push({...u}):n===`actions`?i.actions[t].push({...u}):n===`conditions`&&i.conditions[t].push({...u}),a(i)},...e,...t,onTouchMove:u})})};j();var Ne=({addClass:e,setAllBlocks:t,allBlocks:n,userRules:s,onChangeBlocks:c,setTourStep:l,tourStep:f,isTourOpen:p,onStartWizard:m})=>{let{blocks:h,socket:g}=E(V),[v,x]=ye(!1,`hamburgerOnOff`),[S,C]=ye({text:``,type:`triggers`,index:0},`filterControlPanel`),T=(e=S.text,n=S.type)=>{if(!h)return;let r=[...h];r=r.filter(t=>{if(!e)return!0;let{name:n}=t.getStaticData();return n&&_.t(n).toLowerCase().includes(e.toLowerCase())}),r=r.filter(e=>n===e.getStaticData().acceptedBy),t(r)},D=(e,t)=>{p&&t===0&&f===L.selectTriggers&&l(L.addScheduleByDoubleClick),p&&t===2&&f===L.selectActions&&l(L.addActionPrintText),C({...S,index:t,type:[`triggers`,`conditions`,`actions`][t]}),T(S.text,[`triggers`,`conditions`,`actions`][t])},O=e=>({id:`scrollable-force-tab-${e}`,"aria-controls":`scrollable-force-tabpanel-${e}`});return w(()=>{T()},[h]),i(o,{mouseEvent:!1,touchEvent:`onTouchStart`,onClickAway:()=>x(!0),children:d(`div`,{className:y.clsx(Z.menuWrapper,e[1035]&&Z.addClassMenu),children:[i(`div`,{className:`${Z.hamburgerWrapper} ${v?Z.hamburgerOff:null}`,onClick:()=>x(!v),children:i(v?ae:ie,{})}),d(`div`,{className:`${y.clsx(Z.menuRules,e[1035]&&Z.addClassBackground,e[835]&&Z.addClassPosition)} ${v?Z.menuOff:null}`,children:[i(u,{className:Z.wizardButton,fullWidth:!0,size:`small`,variant:`outlined`,startIcon:i(re,{}),onClick:m,children:_.t(`Wizard`)}),i(`div`,{className:Z.controlPanel,children:i(A,{className:Z.controlPanelAppBar,position:`static`,children:d(r,{value:S.index,onChange:D,children:[i(a,{className:`blocks-triggers`,title:_.t(`Triggers`),icon:i(F,{iconName:`FlashOn`}),...O(0)}),i(a,{title:_.t(`Conditions`),className:`blocks-conditions`,icon:i(F,{iconName:`Help`}),...O(1)}),i(a,{title:_.t(`Actions`),className:`blocks-actions`,icon:i(F,{iconName:`PlayForWork`}),...O(2)})]})})}),i(`div`,{className:Z.switchesRenderWrapper,children:d(`span`,{children:[n.map(e=>{let{name:t,id:n,icon:r,adapter:a}=e.getStaticData();return i(b,{children:i(Me,{adapter:a,allProperties:e.getStaticData(),icon:r,id:n,isActive:!1,isTourOpen:p,name:t,onTouchMove:()=>x(!0),setTourStep:l,setUserRules:c,socket:g,tourStep:f,userRules:s})},n)}),!n.length&&d(`div`,{className:Z.nothingFound,children:[_.t(`Nothing found`),`...`,i(`div`,{className:Z.resetSearch,onClick:()=>{C({...S,text:``}),T(``)},children:_.t(`reset search`)})]})]})}),i(`div`,{className:y.clsx(Z.menuTitle,Z.marginAuto)}),i(B,{className:Z.inputWidth,fullWidth:!0,customValue:!0,value:S.text,size:`small`,autoComplete:`off`,label:_.t(`search`),variant:`outlined`,onChange:e=>{C({...S,text:e}),T(e)}})]})]})})},Q={bandTriggers:`_bandTriggers_91vrz_5`,bandConditions:`_bandConditions_91vrz_9`,bandActions:`_bandActions_91vrz_13`,paper:`_paper_91vrz_17`,title:`_title_91vrz_22`,close:`_close_91vrz_29`,content:`_content_91vrz_35`,stepper:`_stepper_91vrz_40`,step:`_step_91vrz_40`,hint:`_hint_91vrz_56`,warning:`_warning_91vrz_61`,blockCard:`_blockCard_91vrz_68`,blockBody:`_blockBody_91vrz_79`,remove:`_remove_91vrz_86`,notFound:`_notFound_91vrz_93`,chooser:`_chooser_91vrz_99`,choice:`_choice_91vrz_105`,choiceIcon:`_choiceIcon_91vrz_128`,choiceName:`_choiceName_91vrz_136`,addMore:`_addMore_91vrz_144`,summaryBand:`_summaryBand_91vrz_150`,summaryLabel:`_summaryLabel_91vrz_156`,preview:`_preview_91vrz_164`,actions:`_actions_91vrz_169`,spacer:`_spacer_91vrz_173`};j();var $=[`triggers`,`conditions`,`actions`],Pe={triggers:`Triggers`,conditions:`Conditions`,actions:`Actions`},Fe={triggers:`What should start the rule?`,conditions:`When should the rule run? This step is optional.`,actions:`What should happen?`},Ie={triggers:`when`,conditions:`and`,actions:`then`},Le={triggers:Q.bandTriggers,conditions:Q.bandConditions,actions:Q.bandActions},Re=()=>({triggers:[],conditions:[],actions:[]}),ze=({onCreate:e,onClose:r,hasRule:a,socket:o,theme:s,themeType:c,themeName:v})=>{let{blocks:b}=E(V),[S,w]=p(0),[D,k]=p(Re),[A,j]=p(null),P=N(0),ee=f(()=>{let e={triggers:[],conditions:[],actions:[]};return b==null||b.forEach(t=>{var n;let{acceptedBy:r}=t.getStaticData();(n=e[r])==null||n.push(t)}),e},[b]),te=f(()=>({triggers:D.triggers,conditions:D.conditions.length?[D.conditions]:[[]],justCheck:!1,actions:{then:D.actions,else:[]}}),[D]),I=(e,t)=>{P.current+=1,k(n=>({...n,[e]:[...n[e],{id:t,_id:P.current,acceptedBy:e}]})),j(null)},L=(e,t)=>k(n=>({...n,[e]:n[e].filter(e=>e._id!==t)})),R=(e,t,n)=>k(r=>({...r,[e]:r[e].map(r=>r._id===t?{...n,_id:t,id:r.id,acceptedBy:e}:r)})),z=(e,t,n)=>{let r=b==null?void 0:b.find(t=>t.getStaticData().id===e.id);return r?i(r,{_id:e._id,settings:e,acceptedBy:t,onChange:n?()=>{}:n=>R(t,e._id,n),socket:o,theme:s,themeType:c,themeName:v,enableSimulation:!1,userRules:te,onUpdate:!1,setOnUpdate:()=>{}}):i(`div`,{className:Q.notFound,children:_.t(`Block not found`)})},B=e=>i(`div`,{className:Q.chooser,children:ee[e].map(t=>{let{id:n,name:r,icon:a,adapter:s,title:c}=t.getStaticData();return d(`button`,{type:`button`,className:Q.choice,title:c?_.t(c):void 0,onClick:()=>I(e,n),children:[i(F,{iconName:a,adapter:s,socket:o,className:Q.choiceIcon}),i(`span`,{className:Q.choiceName,children:_.t(r)})]},n)})}),ne=(e,t)=>d(`div`,{className:Q.step,hidden:S!==t,children:[i(`div`,{className:Q.hint,children:_.t(Fe[e])}),D[e].map(t=>d(`div`,{className:y.clsx(Q.blockCard,Le[e]),children:[i(`div`,{className:Q.blockBody,children:z(t,e)}),i(C,{className:Q.remove,size:`small`,title:_.t(`Delete`),onClick:()=>L(e,t._id),children:i(oe,{fontSize:`small`})})]},t._id)),A===e||!D[e].length?B(e):i(u,{className:Q.addMore,startIcon:i(M,{}),onClick:()=>j(e),children:_.t(`Add another`)})]},e),H=()=>d(`div`,{className:Q.step,children:[$.map(e=>D[e].length?d(`div`,{className:Q.summaryBand,children:[i(`div`,{className:y.clsx(Q.summaryLabel,Le[e]),children:_.t(Ie[e])}),D[e].map(t=>i(`div`,{className:y.clsx(Q.blockCard,Q.preview,Le[e]),children:i(`div`,{className:Q.blockBody,children:z(t,e,!0)})},t._id))]},e):null),D.conditions.length?null:i(`div`,{className:Q.hint,children:_.t(`Without a condition the rule always runs`)}),a?i(`div`,{className:Q.warning,children:_.t(`The current rule will be replaced`)}):null]}),U=S===$.length,W=U||S===1||!!D[$[S]].length;return d(g,{open:!0,fullWidth:!0,maxWidth:`md`,onClose:r,classes:{paper:Q.paper},children:[d(x,{className:Q.title,children:[_.t(`Create a rule step by step`),i(C,{className:Q.close,size:`small`,title:_.t(`Close`),onClick:r,children:i(m,{})})]}),d(T,{className:Q.content,children:[d(t,{className:Q.stepper,activeStep:S,children:[$.map(e=>i(n,{children:i(l,{children:_.t(Pe[e])})},e)),i(n,{children:i(l,{children:_.t(`Summary`)})})]}),$.map(ne),U?H():null]}),d(O,{className:Q.actions,children:[i(u,{disabled:!S,startIcon:i(se,{}),onClick:()=>w(S-1),children:_.t(`Back`)}),i(`div`,{className:Q.spacer}),i(u,{onClick:r,children:_.t(`Cancel`)}),U?i(u,{variant:`contained`,color:`primary`,onClick:()=>{e(te),r()},children:_.t(a?`Replace rule`:`Create rule`)}):i(u,{variant:`contained`,color:`primary`,disabled:!W,endIcon:i(h,{}),onClick:()=>w(S+1),children:_.t(S===1&&!D.conditions.length?`Skip`:`Next`)})]})]})};j();var Be=[],Ve=({code:e,onChange:t,themeName:n,themeType:r,theme:a,setTourStep:o,tourStep:s,isTourOpen:c,command:l,scriptId:f,changed:m,running:h,newRuleId:g,onNewRuleHandled:y})=>{var b;let{blocks:x,socket:S,setOnUpdate:C,setOnDebugMessage:T,setEnableSimulation:D}=E(V),[O,k]=p([]),[A,j]=p(z(e)),[M,te]=p(``),[F,I]=p(!1),[L,R]=p(!1);w(()=>{let e,t,n=(n,r)=>{n===`${e}.alive`&&t!==(r==null?void 0:r.val)&&(t=!!(r!=null&&r.val),t&&e&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)))},r=(r,i)=>{var a;if(S&&e!==(i==null||(a=i.common)==null?void 0:a.engine)){var o;e&&(S.unsubscribeState(`${e}.alive`,n),t&&S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)),e=i==null||(o=i.common)==null?void 0:o.engine,e&&e&&S.subscribeState(`${e}.alive`,n)}},i=(e,t)=>{if(t)try{let e=JSON.parse(t.val),n=Date.now();if(e.ruleId===f&&n-e.ts<1e3){let t=[...Be,{blockId:e.blockId,data:e.data,ts:e.ts}];t.length>200&&t.splice(0,t.length-200);for(let e=t.length-1;e>=0;e--)if(t[e].ts{var a;e=t==null||(a=t.common)==null?void 0:a.engine,S.subscribeObject(f,r),e&&(S.subscribeState(`${e}.alive`,n),S.subscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}),function(){S==null||S.unsubscribeObject(f,r),e&&(S==null||S.unsubscribeState(`${e}.alive`,n),t&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOff`,f)),S==null||S.unsubscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}},[]),w(()=>{D(!m&&h)},[m,h,D]),w(()=>{l&&(te(l),F||I(!0))},[l]),w(()=>{let t=z(e);JSON.stringify(t)!==JSON.stringify(A)&&(j(t),C(!0))},[e]),w(()=>{document.getElementsByTagName(`HTML`)[0].className=n||`blue`},[n]),w(()=>{g&&g===f&&(y(),R(!0))},[g,f,y]);let B=v(e=>{j(e),x&&t(ne(e,x))},[x,t]),H=N(null),[U,W]=p({835:!1,1035:!1});if(w(()=>{H.current&&(H.current.clientWidth<=1035&&W({835:!1,1035:!0}),H.current.clientWidth<=835&&W({1035:!0,835:!0}),H.current.clientWidth>1035&&W({835:!1,1035:!1}))},[((b=H.current)==null?void 0:b.clientWidth)||0]),!x||!S)return null;let ie=!A.triggers.length&&!A.actions.then.length&&!A.actions.else.length&&!A.conditions.some(e=>e.length);return d(`div`,{className:K.wrapperRules,ref:H,children:[i(ve,{allBlocks:O,socket:S}),F?M===`export`?i(P,{scriptId:f,themeType:r,onClose:()=>I(!1),text:JSON.stringify(A,null,2)}):i(ee,{themeType:r,onClose:e=>{I(!1),e&&B(JSON.parse(e))}}):null,L?i(ze,{hasRule:!ie,socket:S,theme:a,themeType:r,themeName:n,onCreate:B,onClose:()=>R(!1)}):null,d(`div`,{className:K.rootWrapper,children:[i(Ne,{setAllBlocks:k,allBlocks:O,userRules:A,onChangeBlocks:B,setTourStep:o,tourStep:s,addClass:U,isTourOpen:c,onStartWizard:()=>R(!0)}),d(`div`,{className:K.bands,children:[ie?d(`div`,{className:K.emptyRule,children:[i(`div`,{className:K.emptyRuleText,children:_.t(`Create a rule step by step`)}),i(u,{variant:`contained`,color:`primary`,startIcon:i(re,{}),onClick:()=>R(!0),children:_.t(`Wizard`)})]}):null,i(je,{socket:S,setUserRules:B,userRules:A,isTourOpen:c,setTourStep:o,tourStep:s,name:`${_.t(`when`)}...`,typeBlock:`triggers`,iconName:`FlashOn`,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`and`)}...`,typeBlock:`conditions`,iconName:`Help`,nameAdditionally:_.t(`or`),additionally:!0,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`then`)}`,typeBlock:`actions`,iconName:`PlayForWork`,nameAdditionally:_.t(`else`),additionally:!0,themeType:r,themeName:n,theme:a})]})]})]},`rulesEditor`)};export{Ve as default}; \ No newline at end of file +import{En as e,Et as t,Fn as n,Ft as r,Jn as i,Ot as a,Qt as o,Rn as s,St as c,Tt as l,Ut as u,Yn as d,_r as f,br as p,bt as m,dt as h,en as g,f as _,fr as v,g as y,hr as b,in as x,kn as S,mn as C,mr as w,nn as T,pr as E,rn as D,tn as O,ur as k,wn as A,wr as j,wt as M,yr as N}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{n as P,t as ee}from"./Import-BH2X_ziv.js";import{_ as te,a as F,g as I,h as L,i as R,n as z,o as B,r as ne,t as V,v as H,x as U,y as W}from"./index-DlFpMLlN.js";var re=s(i(`path`,{d:`M7.5 5.6 10 7 8.6 4.5 10 2 7.5 3.4 5 2l1.4 2.5L5 7zm12 9.8L17 14l1.4 2.5L17 19l2.5-1.4L22 19l-1.4-2.5L22 14zM22 2l-2.5 1.4L17 2l1.4 2.5L17 7l2.5-1.4L22 7l-1.4-2.5zm-7.63 5.29a.996.996 0 0 0-1.41 0L1.29 18.96c-.39.39-.39 1.02 0 1.41l2.34 2.34c.39.39 1.02.39 1.41 0L16.7 11.05c.39-.39.39-1.02 0-1.41zm-1.03 5.49-2.12-2.12 2.44-2.44 2.12 2.12z`}),`AutoFixHigh`),ie=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`),ae=s(i(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`),oe=s(i(`path`,{d:`M16 9v10H8V9zm-1.5-6h-5l-1 1H5v2h14V4h-3.5zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2z`}),`DeleteOutlined`),se=s(i(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`NavigateBefore`);j();function ce(e){let t=H().getMonitor(),[n,r]=W(t,e);return w(()=>t.subscribeToOffsetChange(r)),w(()=>t.subscribeToStateChange(r)),n}var G;function le(){return G||(G=new Image,G.src=`data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==`),G}var K={wrapperRules:`_wrapperRules_147jt_8`,rootWrapper:`_rootWrapper_147jt_14`,bands:`_bands_147jt_26`,emptyRule:`_emptyRule_147jt_39`,emptyRuleText:`_emptyRuleText_147jt_51`},ue={switchesItem:`_switchesItem_10ls3_1`,switchesItemActive:`_switchesItemActive_10ls3_28`,iconTheme:`_iconTheme_10ls3_36`};j();var de=({name:e,id:t,active:n,icon:r,adapter:a,socket:o,onDoubleClick:s,title:c,onTouchMove:l,style:u})=>d(`div`,{onDoubleClick:s,onTouchMove:l,title:c?_.t(c):void 0,className:y.clsx(ue.switchesItem,n&&ue.switchesItemActive,`block-${t}`),children:[i(F,{iconName:r,className:ue.iconTheme,adapter:a,socket:o,style:u}),i(`span`,{children:e?_.t(e):``})]},t),q={cardStyle:`_cardStyle_vibq0_1`,railTriggers:`_railTriggers_vibq0_25`,railConditions:`_railConditions_vibq0_29`,railActions:`_railActions_vibq0_33`,cardStyleActive:`_cardStyleActive_vibq0_37`,controlMenu:`_controlMenu_vibq0_42`,closeBtn:`_closeBtn_vibq0_60`,isDelete:`_isDelete_vibq0_102`,drag_mobile:`_drag_mobile_vibq0_121`};function J(e,t,n){let r;switch(e){case`actions`:if(n===`else`)return r={...t,actions:{...t[e],else:[...t[e].else]}},r;if(n===`then`)return r={...t,actions:{...t[e],then:[...t[e].then]}},r;throw console.error(`Unknown additionalParameter: ${n}`),Error(`Unknown additionalParameter: ${n}`);case`triggers`:return r={...t,triggers:[...t.triggers]},r;case`conditions`:return r={...t,conditions:[...t.conditions]},r;default:throw Error(`Unknown name: ${e}`)}}function Y(e,t,n,r){switch(e){case`actions`:return t.actions[n]=t.actions[n].filter(e=>e._id!==r),t;case`conditions`:var i;return t.conditions[n]=(i=t.conditions[n])==null?void 0:i.filter(e=>e._id!==r),t;default:return t.triggers=t.triggers.filter(e=>e._id!==r),t}}function fe(e,t,n){let{_id:r,acceptedBy:i}=e,a;if(!i||!t[i])return console.warn(`Cannot find ${i}`),t;switch(i){case`actions`:if(a=t.actions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.actions[n].indexOf(a);t.actions[n][r]=e}return t;case`conditions`:if(a=t.conditions[n].find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let r=t.conditions[n].indexOf(a);t.conditions[n][r]=e}return t;default:if(a=t.triggers.find(e=>e._id===r),!a)console.warn(`Cannot find ${r}`);else{let n=t.triggers.indexOf(a);t.triggers[n]=e}return t}}j();var pe={triggers:q.railTriggers,conditions:q.railConditions,actions:q.railActions},me=k(e=>{var t;let{setUserRules:n,userRules:r,_id:a,id:o,blockValue:s,active:c,acceptedBy:l,isTourOpen:u,setTourStep:m,tourStep:h}=e,{blocks:g,socket:_,onUpdate:y,setOnUpdate:b,onDebugMessage:x,enableSimulation:S}=E(V),C=v(e=>g==null?void 0:g.find(t=>t.getStaticData().id===e),[g]),w=v(e=>{let t=fe(e,r,s);t&&n(t)},[r]),T=f(()=>{let t=C(o)||R;return i(t,{...e,notFound:!C(o),isTourOpen:u,setTourStep:m,tourStep:h,onUpdate:y,setOnUpdate:b,enableSimulation:S,onDebugMessage:x,onChange:w,className:void 0,socket:_})},[r,y,x,S]),[D,O]=p(!1);return d(`div`,{onMouseDown:e=>{if(e.ctrlKey){let e,t=J(l,r,s);l===`conditions`?(e=t.conditions[s].find(e=>e._id===a),e&&t.conditions[s].splice(t.conditions[s].indexOf(e),0,{...e,_id:Date.now()})):l===`actions`?(e=t.actions[s].find(e=>e._id===a),e&&t.actions[s].splice(t.actions[s].indexOf(e),0,{...e,_id:Date.now()})):(e=t.triggers.find(e=>e._id===a),e&&t.triggers.splice(t[l].indexOf(e),0,{...e,_id:Date.now()})),n(t)}},id:`height`,style:c?{width:(((t=document.getElementById(`width`))==null?void 0:t.clientWidth)||0)-70}:void 0,className:[q.cardStyle,pe[l],c&&q.cardStyleActive,D&&q.isDelete].filter(Boolean).join(` `),children:[i(`div`,{className:q.drag_mobile}),T,n&&i(`div`,{className:q.controlMenu,children:i(`div`,{onClick:()=>{let e=J(l,r,s);e=Y(l,e,s,a),O(!0),setTimeout(()=>{l===`triggers`&&b(!0),n(e)},300)},className:q.closeBtn})})]})});j();var he={position:`fixed`,pointerEvents:`none`,zIndex:100,left:0,top:0,width:`100%`,height:`100%`},ge=(e,t)=>[Math.round(e/32)*32,Math.round(t/32)*32],_e=(e,t,n)=>{if(!e||!t)return{display:`none`};let{x:r,y:i}=t;n&&(r-=e.x,i-=e.y,[r,i]=ge(r,i),r+=e.x,i+=e.y);let a=`translate(${r}px, ${i}px)`;return{transform:a,WebkitTransform:a}},ve=e=>{let{itemType:t,isDragging:n,item:r,initialOffset:a,currentOffset:o,targetIds:s}=ce(e=>({item:e.getItem(),itemType:e.getItemType(),initialOffset:e.getInitialSourceClientOffset(),currentOffset:e.getSourceClientOffset(),isDragging:e.isDragging(),targetIds:e.getTargetIds()}));return n?i(`div`,{style:he,children:i(`div`,{style:_e(a,o),children:(()=>{switch(t){case`box`:return s.length?i(me,{active:!0,...r,allBlocks:e.allBlocks}):i(de,{active:!0,...r,socket:e.socket});default:return null}})()})}):null},X={emptyBlockStyle:`_emptyBlockStyle_p7qtf_1`,emptyBlock:`_emptyBlock_p7qtf_1`,marginTop:`_marginTop_p7qtf_1`,selectOnChange:`_selectOnChange_p7qtf_17`,selectOnChangeHelp:`_selectOnChangeHelp_p7qtf_23`,selectOnChangeHelpIcon:`_selectOnChangeHelpIcon_p7qtf_29`,emptyBlockNone:`_emptyBlockNone_p7qtf_44`,bandTriggers:`_bandTriggers_p7qtf_57`,bandConditions:`_bandConditions_p7qtf_61`,bandActions:`_bandActions_p7qtf_65`,mainBlockItemRules:`_mainBlockItemRules_p7qtf_69`,nameBlockItems:`_nameBlockItems_p7qtf_93`,contentBlockItem:`_contentBlockItem_p7qtf_119`,wrapperMargin:`_wrapperMargin_p7qtf_127`,contentHeightOn:`_contentHeightOn_p7qtf_134`,heightBlock:`_heightBlock_p7qtf_1`,contentHeightOff:`_contentHeightOff_p7qtf_146`,cardAdd:`_cardAdd_p7qtf_152`,blockCardAdd:`_blockCardAdd_p7qtf_172`};j();function ye(e,t){let[n,r]=p(window.localStorage.getItem(t)?JSON.parse(window.localStorage.getItem(t)||``):e);return[n,e=>{window.localStorage.setItem(t,JSON.stringify(e)),r(e)},!!window.localStorage.getItem(t)]}function be(e,t){let n=0,r=null,i;return function(...a){let o=Date.now();i=a,o-n>=t?(n=o,e.apply(this,a)):r||=setTimeout(()=>{n=Date.now(),r=null,e.apply(this,i)},t-(o-n))}}function xe(e){if(Array.isArray(e))return e.map(e=>xe(e));if(typeof e==`function`)return e.bind(null);if(e&&typeof e==`object`){let t={};return Object.keys(e).forEach(n=>{t[n]=xe(e[n])}),t}return e}var Se=be((e,t)=>e(t),0);function Ce(e,t){let n=t.find(t=>t._id===e);return{card:n,index:n?t.indexOf(n):-1}}function we(e,t,n,r,i,a,o,s,c){let{card:l,index:u}=Ce(e,n);if(!(ut&&s>c)&&l&&u!==t){let e=xe(n);e.splice(u,1),e.splice(t,0,l);let s=xe(i);switch(a){case`actions`:s.actions[o]=e,Se(r,s);return;case`conditions`:s.conditions[o]=e,Se(r,s);return;default:s.triggers=e,Se(r,s);return}}}var Te={drag:`_drag_7xfhc_1`,root:`_root_7xfhc_11`};j();var Ee=({typeBlock:e,allProperties:t,id:n,isActive:r,setUserRules:a,userRules:o,children:s,_id:c,blockValue:l})=>{let{setOnUpdate:u}=E(V),[{opacity:f},p,m]=te({type:`box`,item:()=>({...t,id:n,isActive:r,_id:c}),end:(e,t)=>{let{acceptedBy:n}=e,r=t.getDropResult(),i;if(!r)return typeof c==`number`&&!t.getTargetIds().length&&(i=J(n,o,l),i=Y(n,i,l,c),a(i)),null;if(r.blockValue!==l){let t=typeof c==`number`?c:Date.now();i=J(n,o,r.blockValue);let s={id:e.id,acceptedBy:e.acceptedBy};switch(n){case`actions`:return l&&(i=Y(`actions`,i,l,t)),i=Y(`actions`,i,r.blockValue,t),i.actions[r.blockValue].push({...s,_id:t}),a(i);case`conditions`:return typeof l==`number`&&(i=Y(`conditions`,i,l,t)),i=Y(`conditions`,i,r.blockValue,t),i.conditions[r.blockValue].push({...s,_id:t}),a(i);default:return u(!0),i=Y(`triggers`,i,r.blockValue,t),i.triggers.push({...s,_id:t}),a(i)}}},collect:e=>({opacity:e.isDragging()?.4:1,isDragging:e.isDragging()})}),h=N(null),[,g]=I({accept:`box`,canDrop:()=>!1,hover({_id:t,acceptedBy:n},r){var i;if(!h.current||e!==n)return;let s=(i=h.current)==null?void 0:i.getBoundingClientRect(),u=(s.bottom-s.top)/2,d=r.getClientOffset(),f=((d==null?void 0:d.y)||0)-s.top;if(c&&t!==c)switch(n){case`actions`:if(l===`then`||l===`else`){let{index:e}=Ce(c,o.actions[l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;case`conditions`:if(typeof l==`number`){let{index:e}=Ce(c,o[n][l]);e!==t&&we(t,e,o[n][l],a,o,n,l,f,u)}return;default:{let{index:e}=Ce(c,o[n]);e!==t&&we(t,e,o[n],a,o,n,void 0,f,u);return}}}});w(()=>{m(le(),{captureDraggingState:!0})},[]),p(g(h));let _=window.innerWidth<600;return d(`div`,{ref:_&&c?null:h,className:Te.root,style:{opacity:f},children:[i(`div`,{className:c?Te.drag:null,ref:c&&_?h:null}),s]})};j();var De=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(`div`,{style:{fontSize:`1rem`,fontFamily:`"Roboto", "Helvetica", "Arial", sans-serif`,fontWeight:400,lineHeight:1.5,letterSpacing:`0.00938em`},children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,startIcon:i(c,{}),children:_.t(`OK`)})})]});j();var Oe=({onClose:e,open:t})=>d(g,{open:t,onClose:e,"aria-labelledby":`alert-dialog-title`,"aria-describedby":`alert-dialog-description`,children:[i(T,{children:d(D,{id:`alert-dialog-description`,children:[i(`h3`,{children:_.t(`On condition change`)}),i(`div`,{children:_.t(`help_on_change`)}),i(`h3`,{children:_.t(`Just check`)}),i(`div`,{children:_.t(`help_just_check`)})]})}),i(O,{children:i(u,{onClick:e,color:`primary`,autoFocus:!0,children:_.t(`OK`)})})]});j();var ke={triggers:X.bandTriggers,conditions:X.bandConditions,actions:X.bandActions},Ae=({blockValue:e,boolean:t,typeBlock:n,userRules:r,setUserRules:a,animation:o,setTourStep:s,tourStep:c,isTourOpen:l,theme:u,themeType:f,themeName:m})=>{var h;let[g,_]=p(!1),[v,b]=p(!1),[x,S]=p(!1),[C,T]=p(``);t===void 0&&(t=!0);let E=I({accept:`box`,drop:()=>({blockValue:e}),hover:({acceptedBy:e,_id:t},r)=>{_(e===n),S(!!t),T(r.getHandlerId()||``)},canDrop:({acceptedBy:e})=>(b(e===n),e===n),collect:e=>{var t;return{isOver:e.isOver(),canDrop:((t=e.getItem())==null?void 0:t.acceptedBy)===n,offset:e.getClientOffset(),targetId:e.getHandlerId()}}}),{canDrop:D,isOver:O,offset:k,targetId:A}=E[0],j=E[1];w(()=>{T(``)},[k]);let M=D&&O,N=``;M?N=g?`#00fb003d`:`#fb00002e`:D?N=v?`#00fb003d`:`#fb00002e`:k&&(N=A===C?`#fb00002e`:``);let P;return P=n===`actions`?r.actions[e]:n===`conditions`?r.conditions[e]:r.triggers,i(`div`,{ref:e=>{j(e)},style:{backgroundColor:N},className:y.clsx(X.contentBlockItem,t?o&&X.contentHeightOn:X.contentHeightOff),children:d(`div`,{className:X.wrapperMargin,children:[P.map(t=>i(Ee,{typeBlock:n,...t,blockValue:e,allProperties:t,userRules:r,setUserRules:a,children:i(me,{...t,isTourOpen:l,setTourStep:s,tourStep:c,settings:t,blockValue:e,userRules:r,setUserRules:a,theme:u,themeType:f,themeName:m})},t._id)),i(`div`,{style:M&&g&&!x?{height:((h=document.getElementById(`height`))==null?void 0:h.clientHeight)||200}:void 0,className:`${X.emptyBlockStyle} ${M&&g&&!x?X.emptyBlock:X.emptyBlockNone}`})]})})},je=({typeBlock:t,name:n,nameAdditionally:r,additionally:a,userRules:o,setUserRules:s,iconName:c,adapter:l,socket:u,setTourStep:f,tourStep:m,isTourOpen:h,theme:g,themeType:v,themeName:y})=>{let[x,T,E]=ye(t!==`actions`&&[],`additionallyClickItems_${t}`),[D,O]=p(!1),[k,A]=p(!1);w(()=>{if(t===`conditions`&&(x==null?void 0:x.length)!==o.conditions.length-1){let e=[];o.conditions.forEach((t,n)=>{n>0&&e.push({_id:Date.now(),open:!0})}),T([...x,...e])}t===`actions`&&!E&&o.actions.else.length&&T(!0)},[]);let[j,M]=p(!1);return d(`div`,{className:`${X.mainBlockItemRules} ${ke[t]}`,children:[d(`span`,{id:`width`,className:X.nameBlockItems,children:[i(F,{iconName:c,className:X.iconThemCard,adapter:l,socket:u}),n]}),t===`conditions`?d(`div`,{style:{width:`100%`},children:[d(S,{variant:`standard`,className:X.selectOnChange,value:o.justCheck||!1,onChange:e=>{let t=J(`conditions`,o);t.justCheck=e.target.value===`true`,s(t)},children:[i(e,{value:`false`,children:_.t(`on condition change`)}),i(e,{value:`true`,children:_.t(`just check`)})]}),i(C,{size:`small`,title:_.t(`Explanation`),className:X.selectOnChangeHelp,onClick:()=>O(!0),children:i(U,{className:X.selectOnChangeHelpIcon})})]}):null,i(Ae,{setTourStep:f,tourStep:m,isTourOpen:h,blockValue:t===`actions`?`then`:t===`conditions`?0:t,typeBlock:t,setUserRules:s,userRules:o,theme:g,themeName:y,themeType:v}),a&&[...Array(t===`actions`?1:o.conditions.length-1)].map((e,n)=>{let a=(e=n)=>t===`actions`?!!x:!!x.find((t,n)=>n===e&&t.open);return d(b,{children:[d(`div`,{onClick:()=>{if(t===`actions`)return T(!x),null;let e=JSON.parse(JSON.stringify(x));if(o.conditions[n+1].length)return e[n].open=!e[n].open,T(e),null;e=e.filter((e,t)=>t!==n),T(e),M(n),setTimeout(()=>{M(!1),s({...o,conditions:[...o.conditions.filter((e,t)=>t!==n+1)]})},250)},className:X.blockCardAdd,children:[a()?`-`:`+`,i(`div`,{className:X.cardAdd,children:r})]},n),i(Ae,{blockValue:t===`actions`?`else`:t===`conditions`?n+1:t,typeBlock:t,setUserRules:s,userRules:o,boolean:a(),animation:j===n,theme:g,themeName:y,themeType:v})]},`${n}_block_${t}`)}),a&&t===`conditions`&&d(`div`,{onClick:()=>{T([...x,{_id:Date.now(),open:!0}]),s({...o,conditions:[...o.conditions,[]]}),M(o.conditions.length-1),setTimeout(()=>M(!1),1e3)},className:X.blockCardAdd,children:[`+`,i(`div`,{className:X.cardAdd,children:r})]}),i(De,{open:D,onClose:()=>O(!1)}),i(Oe,{open:k,onClose:()=>A(!1)})]})},Z={menuRules:`_menuRules_1b2q2_1`,wizardButton:`_wizardButton_1b2q2_13`,switchesRenderWrapper:`_switchesRenderWrapper_1b2q2_21`,menuOff:`_menuOff_1b2q2_30`,menuTitle:`_menuTitle_1b2q2_36`,marginAuto:`_marginAuto_1b2q2_50`,inputWidth:`_inputWidth_1b2q2_55`,menuWrapper:`_menuWrapper_1b2q2_60`,hamburgerWrapper:`_hamburgerWrapper_1b2q2_68`,hamburgerOff:`_hamburgerOff_1b2q2_96`,nothingFound:`_nothingFound_1b2q2_104`,resetSearch:`_resetSearch_1b2q2_111`,controlPanel:`_controlPanel_1b2q2_123`,controlPanelAppBar:`_controlPanelAppBar_1b2q2_134`,addClassMenu:`_addClassMenu_1b2q2_148`,addClassBackground:`_addClassBackground_1b2q2_154`,addClassPosition:`_addClassPosition_1b2q2_158`};j();var Me=e=>{let{allProperties:t,allProperties:{acceptedBy:n,id:r},setUserRules:a,userRules:o,setTourStep:s,tourStep:c,isTourOpen:l,onTouchMove:u,isActive:d}=e;return i(Ee,{allProperties:t,id:t.id,isActive:d,setUserRules:a,userRules:o,children:i(de,{onDoubleClick:()=>{l&&c===L.addScheduleByDoubleClick&&r===`TriggerScheduleBlock`&&s(L.openTagsMenu),l&&c===L.addActionPrintText&&r===`ActionPrintText`&&s(L.showJavascript);let e=Date.now(),t;switch(n){case`actions`:t=`then`;break;case`conditions`:t=o[n].length-1}let i=J(n,o,t),u={id:r,_id:e,acceptedBy:n};t===void 0?i.triggers.push({...u}):n===`actions`?i.actions[t].push({...u}):n===`conditions`&&i.conditions[t].push({...u}),a(i)},...e,...t,onTouchMove:u})})};j();var Ne=({addClass:e,setAllBlocks:t,allBlocks:n,userRules:s,onChangeBlocks:c,setTourStep:l,tourStep:f,isTourOpen:p,onStartWizard:m})=>{let{blocks:h,socket:g}=E(V),[v,x]=ye(!1,`hamburgerOnOff`),[S,C]=ye({text:``,type:`triggers`,index:0},`filterControlPanel`),T=(e=S.text,n=S.type)=>{if(!h)return;let r=[...h];r=r.filter(t=>{if(!e)return!0;let{name:n}=t.getStaticData();return n&&_.t(n).toLowerCase().includes(e.toLowerCase())}),r=r.filter(e=>n===e.getStaticData().acceptedBy),t(r)},D=(e,t)=>{p&&t===0&&f===L.selectTriggers&&l(L.addScheduleByDoubleClick),p&&t===2&&f===L.selectActions&&l(L.addActionPrintText),C({...S,index:t,type:[`triggers`,`conditions`,`actions`][t]}),T(S.text,[`triggers`,`conditions`,`actions`][t])},O=e=>({id:`scrollable-force-tab-${e}`,"aria-controls":`scrollable-force-tabpanel-${e}`});return w(()=>{T()},[h]),i(o,{mouseEvent:!1,touchEvent:`onTouchStart`,onClickAway:()=>x(!0),children:d(`div`,{className:y.clsx(Z.menuWrapper,e[1035]&&Z.addClassMenu),children:[i(`div`,{className:`${Z.hamburgerWrapper} ${v?Z.hamburgerOff:null}`,onClick:()=>x(!v),children:i(v?ae:ie,{})}),d(`div`,{className:`${y.clsx(Z.menuRules,e[1035]&&Z.addClassBackground,e[835]&&Z.addClassPosition)} ${v?Z.menuOff:null}`,children:[i(u,{className:Z.wizardButton,fullWidth:!0,size:`small`,variant:`outlined`,startIcon:i(re,{}),onClick:m,children:_.t(`Wizard`)}),i(`div`,{className:Z.controlPanel,children:i(A,{className:Z.controlPanelAppBar,position:`static`,children:d(r,{value:S.index,onChange:D,children:[i(a,{className:`blocks-triggers`,title:_.t(`Triggers`),icon:i(F,{iconName:`FlashOn`}),...O(0)}),i(a,{title:_.t(`Conditions`),className:`blocks-conditions`,icon:i(F,{iconName:`Help`}),...O(1)}),i(a,{title:_.t(`Actions`),className:`blocks-actions`,icon:i(F,{iconName:`PlayForWork`}),...O(2)})]})})}),i(`div`,{className:Z.switchesRenderWrapper,children:d(`span`,{children:[n.map(e=>{let{name:t,id:n,icon:r,adapter:a}=e.getStaticData();return i(b,{children:i(Me,{adapter:a,allProperties:e.getStaticData(),icon:r,id:n,isActive:!1,isTourOpen:p,name:t,onTouchMove:()=>x(!0),setTourStep:l,setUserRules:c,socket:g,tourStep:f,userRules:s})},n)}),!n.length&&d(`div`,{className:Z.nothingFound,children:[_.t(`Nothing found`),`...`,i(`div`,{className:Z.resetSearch,onClick:()=>{C({...S,text:``}),T(``)},children:_.t(`reset search`)})]})]})}),i(`div`,{className:y.clsx(Z.menuTitle,Z.marginAuto)}),i(B,{className:Z.inputWidth,fullWidth:!0,customValue:!0,value:S.text,size:`small`,autoComplete:`off`,label:_.t(`search`),variant:`outlined`,onChange:e=>{C({...S,text:e}),T(e)}})]})]})})},Q={bandTriggers:`_bandTriggers_91vrz_5`,bandConditions:`_bandConditions_91vrz_9`,bandActions:`_bandActions_91vrz_13`,paper:`_paper_91vrz_17`,title:`_title_91vrz_22`,close:`_close_91vrz_29`,content:`_content_91vrz_35`,stepper:`_stepper_91vrz_40`,step:`_step_91vrz_40`,hint:`_hint_91vrz_56`,warning:`_warning_91vrz_61`,blockCard:`_blockCard_91vrz_68`,blockBody:`_blockBody_91vrz_79`,remove:`_remove_91vrz_86`,notFound:`_notFound_91vrz_93`,chooser:`_chooser_91vrz_99`,choice:`_choice_91vrz_105`,choiceIcon:`_choiceIcon_91vrz_128`,choiceName:`_choiceName_91vrz_136`,addMore:`_addMore_91vrz_144`,summaryBand:`_summaryBand_91vrz_150`,summaryLabel:`_summaryLabel_91vrz_156`,preview:`_preview_91vrz_164`,actions:`_actions_91vrz_169`,spacer:`_spacer_91vrz_173`};j();var $=[`triggers`,`conditions`,`actions`],Pe={triggers:`Triggers`,conditions:`Conditions`,actions:`Actions`},Fe={triggers:`What should start the rule?`,conditions:`When should the rule run? This step is optional.`,actions:`What should happen?`},Ie={triggers:`when`,conditions:`and`,actions:`then`},Le={triggers:Q.bandTriggers,conditions:Q.bandConditions,actions:Q.bandActions},Re=()=>({triggers:[],conditions:[],actions:[]}),ze=({onCreate:e,onClose:r,hasRule:a,socket:o,theme:s,themeType:c,themeName:v})=>{let{blocks:b}=E(V),[S,w]=p(0),[D,k]=p(Re),[A,j]=p(null),P=N(0),ee=f(()=>{let e={triggers:[],conditions:[],actions:[]};return b==null||b.forEach(t=>{var n;let{acceptedBy:r}=t.getStaticData();(n=e[r])==null||n.push(t)}),e},[b]),te=f(()=>({triggers:D.triggers,conditions:D.conditions.length?[D.conditions]:[[]],justCheck:!1,actions:{then:D.actions,else:[]}}),[D]),I=(e,t)=>{P.current+=1,k(n=>({...n,[e]:[...n[e],{id:t,_id:P.current,acceptedBy:e}]})),j(null)},L=(e,t)=>k(n=>({...n,[e]:n[e].filter(e=>e._id!==t)})),R=(e,t,n)=>k(r=>({...r,[e]:r[e].map(r=>r._id===t?{...n,_id:t,id:r.id,acceptedBy:e}:r)})),z=(e,t,n)=>{let r=b==null?void 0:b.find(t=>t.getStaticData().id===e.id);return r?i(r,{_id:e._id,settings:e,acceptedBy:t,onChange:n?()=>{}:n=>R(t,e._id,n),socket:o,theme:s,themeType:c,themeName:v,enableSimulation:!1,userRules:te,onUpdate:!1,setOnUpdate:()=>{}}):i(`div`,{className:Q.notFound,children:_.t(`Block not found`)})},B=e=>i(`div`,{className:Q.chooser,children:ee[e].map(t=>{let{id:n,name:r,icon:a,adapter:s,title:c}=t.getStaticData();return d(`button`,{type:`button`,className:Q.choice,title:c?_.t(c):void 0,onClick:()=>I(e,n),children:[i(F,{iconName:a,adapter:s,socket:o,className:Q.choiceIcon}),i(`span`,{className:Q.choiceName,children:_.t(r)})]},n)})}),ne=(e,t)=>d(`div`,{className:Q.step,hidden:S!==t,children:[i(`div`,{className:Q.hint,children:_.t(Fe[e])}),D[e].map(t=>d(`div`,{className:y.clsx(Q.blockCard,Le[e]),children:[i(`div`,{className:Q.blockBody,children:z(t,e)}),i(C,{className:Q.remove,size:`small`,title:_.t(`Delete`),onClick:()=>L(e,t._id),children:i(oe,{fontSize:`small`})})]},t._id)),A===e||!D[e].length?B(e):i(u,{className:Q.addMore,startIcon:i(M,{}),onClick:()=>j(e),children:_.t(`Add another`)})]},e),H=()=>d(`div`,{className:Q.step,children:[$.map(e=>D[e].length?d(`div`,{className:Q.summaryBand,children:[i(`div`,{className:y.clsx(Q.summaryLabel,Le[e]),children:_.t(Ie[e])}),D[e].map(t=>i(`div`,{className:y.clsx(Q.blockCard,Q.preview,Le[e]),children:i(`div`,{className:Q.blockBody,children:z(t,e,!0)})},t._id))]},e):null),D.conditions.length?null:i(`div`,{className:Q.hint,children:_.t(`Without a condition the rule always runs`)}),a?i(`div`,{className:Q.warning,children:_.t(`The current rule will be replaced`)}):null]}),U=S===$.length,W=U||S===1||!!D[$[S]].length;return d(g,{open:!0,fullWidth:!0,maxWidth:`md`,onClose:r,classes:{paper:Q.paper},children:[d(x,{className:Q.title,children:[_.t(`Create a rule step by step`),i(C,{className:Q.close,size:`small`,title:_.t(`Close`),onClick:r,children:i(m,{})})]}),d(T,{className:Q.content,children:[d(t,{className:Q.stepper,activeStep:S,children:[$.map(e=>i(n,{children:i(l,{children:_.t(Pe[e])})},e)),i(n,{children:i(l,{children:_.t(`Summary`)})})]}),$.map(ne),U?H():null]}),d(O,{className:Q.actions,children:[i(u,{disabled:!S,startIcon:i(se,{}),onClick:()=>w(S-1),children:_.t(`Back`)}),i(`div`,{className:Q.spacer}),i(u,{onClick:r,children:_.t(`Cancel`)}),U?i(u,{variant:`contained`,color:`primary`,onClick:()=>{e(te),r()},children:_.t(a?`Replace rule`:`Create rule`)}):i(u,{variant:`contained`,color:`primary`,disabled:!W,endIcon:i(h,{}),onClick:()=>w(S+1),children:_.t(S===1&&!D.conditions.length?`Skip`:`Next`)})]})]})};j();var Be=[],Ve=({code:e,onChange:t,themeName:n,themeType:r,theme:a,setTourStep:o,tourStep:s,isTourOpen:c,command:l,scriptId:f,changed:m,running:h,newRuleId:g,onNewRuleHandled:y})=>{var b;let{blocks:x,socket:S,setOnUpdate:C,setOnDebugMessage:T,setEnableSimulation:D}=E(V),[O,k]=p([]),[A,j]=p(z(e)),[M,te]=p(``),[F,I]=p(!1),[L,R]=p(!1);w(()=>{let e,t,n=(n,r)=>{n===`${e}.alive`&&t!==(r==null?void 0:r.val)&&(t=!!(r!=null&&r.val),t&&e&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)))},r=(r,i)=>{var a;if(S&&e!==(i==null||(a=i.common)==null?void 0:a.engine)){var o;e&&(S.unsubscribeState(`${e}.alive`,n),t&&S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOn`,f)),e=i==null||(o=i.common)==null?void 0:o.engine,e&&e&&S.subscribeState(`${e}.alive`,n)}},i=(e,t)=>{if(t)try{let e=JSON.parse(t.val),n=Date.now();if(e.ruleId===f&&n-e.ts<1e3){let t=[...Be,{blockId:e.blockId,data:e.data,ts:e.ts}];t.length>200&&t.splice(0,t.length-200);for(let e=t.length-1;e>=0;e--)if(t[e].ts{var a;e=t==null||(a=t.common)==null?void 0:a.engine,S.subscribeObject(f,r),e&&(S.subscribeState(`${e}.alive`,n),S.subscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}),function(){S==null||S.unsubscribeObject(f,r),e&&(S==null||S.unsubscribeState(`${e}.alive`,n),t&&(S==null||S.sendTo(e.replace(/^system\.adapter\./,``),`rulesOff`,f)),S==null||S.unsubscribeState(`${e.replace(/^system\.adapter\./,``)}.debug.rules`,i))}},[]),w(()=>{D(!m&&h)},[m,h,D]),w(()=>{l&&(te(l),F||I(!0))},[l]),w(()=>{let t=z(e);JSON.stringify(t)!==JSON.stringify(A)&&(j(t),C(!0))},[e]),w(()=>{document.getElementsByTagName(`HTML`)[0].className=n||`blue`},[n]),w(()=>{g&&g===f&&(y(),R(!0))},[g,f,y]);let B=v(e=>{j(e),x&&t(ne(e,x))},[x,t]),H=N(null),[U,W]=p({835:!1,1035:!1});if(w(()=>{H.current&&(H.current.clientWidth<=1035&&W({835:!1,1035:!0}),H.current.clientWidth<=835&&W({1035:!0,835:!0}),H.current.clientWidth>1035&&W({835:!1,1035:!1}))},[((b=H.current)==null?void 0:b.clientWidth)||0]),!x||!S)return null;let ie=!A.triggers.length&&!A.actions.then.length&&!A.actions.else.length&&!A.conditions.some(e=>e.length);return d(`div`,{className:K.wrapperRules,ref:H,children:[i(ve,{allBlocks:O,socket:S}),F?M===`export`?i(P,{scriptId:f,themeType:r,onClose:()=>I(!1),text:JSON.stringify(A,null,2)}):i(ee,{themeType:r,onClose:e=>{I(!1),e&&B(JSON.parse(e))}}):null,L?i(ze,{hasRule:!ie,socket:S,theme:a,themeType:r,themeName:n,onCreate:B,onClose:()=>R(!1)}):null,d(`div`,{className:K.rootWrapper,children:[i(Ne,{setAllBlocks:k,allBlocks:O,userRules:A,onChangeBlocks:B,setTourStep:o,tourStep:s,addClass:U,isTourOpen:c,onStartWizard:()=>R(!0)}),d(`div`,{className:K.bands,children:[ie?d(`div`,{className:K.emptyRule,children:[i(`div`,{className:K.emptyRuleText,children:_.t(`Create a rule step by step`)}),i(u,{variant:`contained`,color:`primary`,startIcon:i(re,{}),onClick:()=>R(!0),children:_.t(`Wizard`)})]}):null,i(je,{socket:S,setUserRules:B,userRules:A,isTourOpen:c,setTourStep:o,tourStep:s,name:`${_.t(`when`)}...`,typeBlock:`triggers`,iconName:`FlashOn`,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`and`)}...`,typeBlock:`conditions`,iconName:`Help`,nameAdditionally:_.t(`or`),additionally:!0,themeType:r,themeName:n,theme:a}),i(je,{socket:S,setUserRules:B,isTourOpen:c,setTourStep:o,tourStep:s,userRules:A,name:`...${_.t(`then`)}`,typeBlock:`actions`,iconName:`PlayForWork`,nameAdditionally:_.t(`else`),additionally:!0,themeType:r,themeName:n,theme:a})]})]})]},`rulesEditor`)};export{Ve as default}; \ No newline at end of file diff --git a/admin/assets/ScriptEditor-1vbWtjKB.js b/admin/assets/ScriptEditor-COVJ2tCs.js similarity index 97% rename from admin/assets/ScriptEditor-1vbWtjKB.js rename to admin/assets/ScriptEditor-COVJ2tCs.js index 75f37a15..8abb49fd 100644 --- a/admin/assets/ScriptEditor-1vbWtjKB.js +++ b/admin/assets/ScriptEditor-COVJ2tCs.js @@ -1,2 +1,2 @@ -import{Ct as e,Jn as t,Ut as n,Vt as r,Yn as i,en as a,f as o,in as s,lt as c,nn as l,nr as u,tn as d,wr as f}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as p}from"./ScriptEditorVanillaMonaco-BJVSL-yc.js";f();var m={textArea:{width:`calc(100% - 10px)`,resize:`none`},dialog:{height:`95%`},fullHeight:{height:`100%`,overflow:`hidden`},args:e=>({color:e.palette.mode===`dark`?`white`:`black`,height:30,width:`100%`,fontSize:16}),argsTitle:e=>({color:e.palette.mode===`dark`?`white`:`black`,fontWeight:`bold`})},h=class extends u.Component{constructor(e){super(e),this.state={changed:!1,source:!e.source&&e.isReturn?` +import{Ct as e,Jn as t,Ut as n,Vt as r,Yn as i,en as a,f as o,in as s,lt as c,nn as l,nr as u,tn as d,wr as f}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as p}from"./ScriptEditorVanillaMonaco-0Mwut6ZY.js";f();var m={textArea:{width:`calc(100% - 10px)`,resize:`none`},dialog:{height:`95%`},fullHeight:{height:`100%`,overflow:`hidden`},args:e=>({color:e.palette.mode===`dark`?`white`:`black`,height:30,width:`100%`,fontSize:16}),argsTitle:e=>({color:e.palette.mode===`dark`?`white`:`black`,fontWeight:`bold`})},h=class extends u.Component{constructor(e){super(e),this.state={changed:!1,source:!e.source&&e.isReturn?` return false`:e.source}}componentDidMount(){setTimeout(()=>{try{var e;(e=window.document.getElementById(`source-text-area`))==null||e.focus()}catch{}},100)}handleCancel(){this.props.onClose(!1)}handleOk(){(!this.props.isReturn||this.state.source.includes(`return `))&&this.props.onClose(this.state.source)}onChange(e){this.setState({changed:!0,source:e})}render(){return i(a,{onClose:()=>!1,maxWidth:`lg`,sx:{"& .MuiDialog-paper":m.dialog},fullWidth:!0,open:!0,"aria-labelledby":`source-dialog-title`,children:[t(s,{id:`source-dialog-title`,children:o.t(`Function editor`)}),i(l,{style:m.fullHeight,children:[this.props.args&&i(r,{sx:m.args,children:[t(r,{component:`span`,sx:m.argsTitle,children:o.t(`function (`)}),this.props.args,t(r,{component:`span`,sx:m.argsTitle,children:`)`})]},`arguments`),t(p,{triggerPrettier:1,adapterName:this.props.adapterName,runningInstances:this.props.runningInstances,style:{...m.textArea,height:this.props.args?`calc(100% - 30px)`:`100%`},name:`blockly`,socket:this.props.socket,readOnly:!1,checkJs:!1,changed:this.state.changed,code:this.state.source,isDark:this.props.themeType===`dark`,onChange:e=>this.onChange(e),language:`javascript`},`scriptEditor`)]}),i(d,{children:[t(n,{variant:`contained`,onClick:()=>this.handleOk(),color:`primary`,startIcon:t(c,{}),children:o.t(`Save`)}),t(n,{color:`grey`,variant:`contained`,onClick:()=>this.handleCancel(),startIcon:t(e,{}),children:o.t(`Cancel`)})]})]})}};export{h as default}; \ No newline at end of file diff --git a/admin/assets/ScriptEditorVanillaMonaco-BJVSL-yc.js b/admin/assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js similarity index 98% rename from admin/assets/ScriptEditorVanillaMonaco-BJVSL-yc.js rename to admin/assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js index 3b1fe8e7..d8176561 100644 --- a/admin/assets/ScriptEditorVanillaMonaco-BJVSL-yc.js +++ b/admin/assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./stateHoverProvider-CIFNrLee.js","./cronHoverProvider-BhX-SvkB.js","./index-sJ01GB6X.js","./Import-BH2X_ziv.js","./Error-1oeF0cix.js","./blockly-DBw-ytY1.js","./index-Z8Hkv58g.css","./inlineDiffController-DianrKl1.js","./applyCodeEdit-D3nb7erO.js","./inlineChatWidget-CBVgT6FZ.js"])))=>i.map(i=>d[i]); -import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{Jn as n,Ln as r,N as i,Nn as a,Ut as o,Yn as s,en as c,f as l,in as u,mn as d,nn as f,nr as p,sn as m,tn as h,wr as g,z as _}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{d as v}from"./index-sJ01GB6X.js";var y=e({default:()=>C});g();function b(e){return/^script\.js\.global\./.test(e)}var x=0;function S(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}var C=class extends p.Component{get monacoTS(){var e;return(e=this.monaco)==null||(e=e.languages)==null?void 0:e.typescript}constructor(e){super(e),r(this,`monacoDiv`,null),r(this,`editor`,null),r(this,`monaco`,window.monaco),r(this,`insert`,``),r(this,`originalCode`,void 0),r(this,`runningInstancesStr`,void 0),r(this,`monacoCounter`,0),r(this,`location`,void 0),r(this,`breakpoints`,void 0),r(this,`lastSearch`,``),r(this,`typings`,{}),r(this,`decorations`,[]),r(this,`datapointProviderDisposable`,null),r(this,`inlineProviderDisposable`,null),r(this,`stateHoverDisposable`,null),r(this,`showStateValueDisposable`,null),r(this,`cronHoverDisposable`,null),r(this,`codeLensDisposable`,null),r(this,`inlineChatWidgetInstance`,null),r(this,`inlineDiffInstance`,null),r(this,`inlineDiffCssInjected`,!1),r(this,`triggerPrettier`,void 0),r(this,`contentChangeDisposable`,null),r(this,`mouseDownDisposable`,null),this.state={name:`current`,isDark:e.isDark||!1,language:e.language||`javascript`,readOnly:e.readOnly||!1,alive:!0,check:!1,searchText:this.props.searchText||``,typingsLoaded:!1,showError:null},this.triggerPrettier=e.triggerPrettier,this.runningInstancesStr=JSON.stringify(this.props.runningInstances),this.originalCode=e.code||``,this.monacoDiv=p.createRef()}waitForMonaco(e){var t;let n=!!((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),this.monacoCounter++,!n&&this.monacoCounter<20){console.log(`wait for monaco loaded`),setTimeout(()=>this.waitForMonaco(e),200);return}this.monacoCounter>=20&&console.error(`Cannot load monaco!`)}else e&&e()}loadTypings(e){if(!this.editor)return;e||=this.props.runningInstances;let t=e&&Object.keys(e).find(t=>e==null?void 0:e[t]);t&&this.props.socket.sendTo(t.replace(`system.adapter.`,``),`loadTypings`,null).then(e=>{this.setState({alive:!0,check:!0,typingsLoaded:!0}),this.setTypeCheck(!0),e.typings?(this.typings=e.typings,this.setEditorTypings(this.state.name)):console.error(`failed to load typings: ${e.error}`)})}componentDidMount(){var e;this.undo,this.redo,this.showInlineDiff,this.getEditorSelection,this.getEditorContent,this.getCursorPosition,this.highlightLineRange,this.goToLine,this.replaceSelection,this.getDiagnostics,this.getDocumentSymbols;let n=!!((e=this.monacoTS)!=null&&(e=e.typescriptDefaults)!=null&&e.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),!n){console.log(`wait for monaco loaded...`),this.waitForMonaco(()=>this.componentDidMount());return}}if(!this.editor&&n&&this.monaco){var i,a,o;console.log(`Init editor`),(i=(a=this.props).onRegisterSelect)==null||i.call(a,()=>{if(this.editor){let t=this.editor.getSelection();if(t){var e;return(e=this.editor.getModel())==null?void 0:e.getValueInRange(t)}}});let e=this.monacoTS.typescriptDefaults.getCompilerOptions();if(e.allowJs=!0,e.checkJs=this.props.checkJs!==!1,e.noLib=!0,e.lib=[],e.useUnknownInCatchVariables=!1,e.moduleResolution=this.monacoTS.ModuleResolutionKind.NodeJs,e.target=this.monacoTS.ScriptTarget.ESNext,e.module=this.monacoTS.ModuleKind.ESNext,e.allowNonTsExtensions=!0,this.monacoTS.typescriptDefaults.setCompilerOptions(e),this.setTypeCheck(!1),(o=this.monacoDiv)!=null&&o.current){var s;this.editor=this.monaco.editor.create((s=this.monacoDiv)==null?void 0:s.current,{lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,glyphMargin:!!this.props.breakpoints,colorDecorators:!0,hover:{enabled:`on`,delay:200,sticky:!0},fixedOverflowWidgets:!0}),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange()),this.monaco&&!this.datapointProviderDisposable&&t(async()=>{let{registerDatapointProvider:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{registerDatapointProvider:e}},[],import.meta.url).then(({registerDatapointProvider:e})=>{this.monaco&&(this.datapointProviderDisposable=e(this.monaco,this.props.socket))}).catch(()=>{}),this.monaco&&!this.stateHoverDisposable&&t(async()=>{let{registerStateHoverProvider:e,registerShowStateValueAction:t}=await import(`./stateHoverProvider-CIFNrLee.js`);return{registerStateHoverProvider:e,registerShowStateValueAction:t}},__vite__mapDeps([0]),import.meta.url).then(({registerStateHoverProvider:e,registerShowStateValueAction:t})=>{this.monaco&&(this.stateHoverDisposable=e(this.monaco,this.props.socket)),this.monaco&&this.editor&&!this.showStateValueDisposable&&(this.showStateValueDisposable=t(this.editor,this.monaco,l.t(`Show ioBroker state value`)))}).catch(()=>{}),this.monaco&&!this.cronHoverDisposable&&t(async()=>{let{registerCronHoverProvider:e}=await import(`./cronHoverProvider-BhX-SvkB.js`);return{registerCronHoverProvider:e}},__vite__mapDeps([1]),import.meta.url).then(({registerCronHoverProvider:e})=>{this.monaco&&(this.cronHoverDisposable=e(this.monaco))}).catch(()=>{}),this.props.aiCompletionsEnabled&&this.monaco&&!this.inlineProviderDisposable&&t(async()=>{let{registerAiInlineProvider:e}=await import(`./AiInlineProvider-CaHd2G2Q.js`);return{registerAiInlineProvider:e}},[],import.meta.url).then(({registerAiInlineProvider:e})=>{this.monaco&&(this.inlineProviderDisposable=e(this.monaco,this.props.socket,this.props.runningInstances))}).catch(()=>{}),this.loadTypings(),this.props.onForceSave&&this.editor.addCommand(this.monaco.KeyMod.CtrlCmd|this.monaco.KeyCode.KeyS,()=>this.props.onForceSave&&this.props.onForceSave()),this.registerAiActions(),this.monaco&&this.editor&&this.props.onAiAction&&!this.codeLensDisposable&&t(async()=>{let{registerAiCodeLensProvider:e}=await import(`./index-sJ01GB6X.js`).then(e=>e.u);return{registerAiCodeLensProvider:e}},__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(({registerAiCodeLensProvider:e})=>{this.monaco&&this.editor&&this.props.onAiAction&&(this.codeLensDisposable=e(this.monaco,this.editor,(e,t,n,r,i)=>{var a,o,s;let c=(a=this.editor)==null?void 0:a.getModel(),l=c?c.getLineMaxColumn(Math.min(i,c.getLineCount())):1;(o=(s=this.props).onAiAction)==null||o.call(s,{action:e,code:t,rangeLabel:n,range:{startLine:r,startColumn:1,endLine:i,endColumn:l},kind:`codelens`})}))}).catch(()=>{}),setTimeout(()=>{this.highlightText(this.state.searchText),this.location=this.props.location||void 0,this.breakpoints=this.props.breakpoints,this.showDecorators()})}}let c={selectOnLineNumbers:!0,scrollBeyondLastLine:!1,automaticLayout:!0,readOnly:this.state.readOnly,language:this.state.language,isDark:this.state.isDark};this.setEditorOptions(c),this.editor&&(this.editor.focus(),this.editor.setValue(this.originalCode),this.props.onToggleBreakpoint&&(this.mouseDownDisposable=this.editor.onMouseDown(e=>{var t;let n=e.target;this.props.onToggleBreakpoint&&((t=n.detail)==null?void 0:t.glyphMarginLeft)!==void 0&&n.position&&this.props.onToggleBreakpoint(n.position.lineNumber-1)})))}setEditorOptions(e){if(e&&(e.language&&this.setEditorLanguage(e.language),this.editor&&(e.readOnly!==void 0&&this.editor.updateOptions({readOnly:e.readOnly}),e.lineWrap!==void 0&&this.editor.updateOptions({wordWrap:e.lineWrap?`on`:`off`})),e.typeCheck!==void 0&&this.setTypeCheck(e.typeCheck),e.isDark!==void 0)){var t;(t=this.monaco)==null||t.editor.setTheme(e.isDark?`vs-dark`:`vs`)}}componentWillUnmount(){var e,n,r,i,a,o,s,c,l;if((e=this.contentChangeDisposable)==null||e.dispose(),this.contentChangeDisposable=null,(n=this.mouseDownDisposable)==null||n.dispose(),this.mouseDownDisposable=null,(r=this.datapointProviderDisposable)==null||r.dispose(),this.datapointProviderDisposable=null,t(async()=>{let{clearDatapointCache:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{clearDatapointCache:e}},[],import.meta.url).then(({clearDatapointCache:e})=>e()).catch(()=>{}),(i=this.inlineProviderDisposable)==null||i.dispose(),this.inlineProviderDisposable=null,(a=this.stateHoverDisposable)==null||a.dispose(),this.stateHoverDisposable=null,(o=this.showStateValueDisposable)==null||o.dispose(),this.showStateValueDisposable=null,t(async()=>{let{clearStateHoverCache:e}=await import(`./stateHoverProvider-CIFNrLee.js`);return{clearStateHoverCache:e}},__vite__mapDeps([0]),import.meta.url).then(({clearStateHoverCache:e})=>e()).catch(()=>{}),(s=this.cronHoverDisposable)==null||s.dispose(),this.cronHoverDisposable=null,(c=this.codeLensDisposable)==null||c.dispose(),this.codeLensDisposable=null,(l=this.inlineChatWidgetInstance)==null||l.dispose(),this.inlineChatWidgetInstance=null,this.hideInlineDiff(),this.editor){var u,d;(u=(d=this.props).onRegisterSelect)==null||u.call(d,null),this.editor.dispose(),this.editor=null}}async doPrettier(){var e;let t=this.props.runningInstances&&Object.keys(this.props.runningInstances).find(e=>{var t;return(t=this.props.runningInstances)==null?void 0:t[e]});if(!t){window.alert(l.t(`No script adapter instance found to format the code`));return}let n=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`prettier`,{code:(e=this.editor)==null?void 0:e.getValue(),type:this.state.language});if(n.error)this.setState({showError:{title:l.t(`Error formatting code`),message:S(n.error)}});else if(n.code){var r,i,a;(r=this.editor)==null||r.setValue(n.code),(i=(a=this.props).onChange)==null||i.call(a,n.code),this.showDecorators()}}setEditorLanguage(e){if(!this.editor)return;let t=this.editor.getModel();if(t){var n;let i=t.getValue(),a=t.uri.path,o=typeof a==`string`&&a.includes(`.`)?a.substring(0,a.lastIndexOf(`.`)):`index`,s=e===`javascript`?`js`:e===`typescript`?`ts`:e;t.dispose();let c=e===`javascript`||e===`typescript`?`typescript`:e,l=(n=this.monaco)==null?void 0:n.editor.createModel(i,c,this.monaco.Uri.from({scheme:window.location.protocol.replace(`:`,``),path:`${o}${x++}.${s}`}));if(l){var r;this.editor.setModel(l),(r=this.contentChangeDisposable)==null||r.dispose(),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange())}}}setTypeCheck(e){var t,n;let r={noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive};(t=this.monacoTS)==null||t.typescriptDefaults.setDiagnosticsOptions(r),(n=this.monacoTS)==null||n.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive})}setEditorTypings(e=``){var t,n;let r=b(e),i=`${e}.d.ts`,a=[];for(let e of Object.keys(this.typings))r&&(e===`global.d.ts`||e.startsWith(`script.js.global`)&&e!==i)||a.push({filePath:e,content:this.typings[e]});if((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.setExtraLibs)this.monacoTS.typescriptDefaults.setExtraLibs(a);else if((n=this.monacoTS)!=null&&(n=n.typescriptDefaults)!=null&&n.addExtraLib){let e=this.monacoTS.typescriptDefaults.getExtraLibs();a.forEach(t=>{!e[t.filePath]&&this.monaco&&this.monacoTS.typescriptDefaults.addExtraLib(t.content,t.filePath)})}}undo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`undo`,null)}redo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`redo`,null)}insertTextIntoEditor(e){if(!this.editor||!this.monaco)return;let t=this.editor.getSelection();if(t){let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}])}this.editor.focus()}highlightText(e){var t;if(!this.editor||!this.monaco)return 0;let n=e?(t=this.editor.getModel())==null?void 0:t.findMatches(e,!0,!1,!1,null,!0):void 0;if(n!=null&&n.length)return n.forEach(e=>{var t;return(t=this.editor)==null?void 0:t.setSelection(e.range)}),this.editor.revealLine(n[0].range.startLineNumber),n.length;let r=this.editor.getPosition();if(r){let e=r.lineNumber,t=r.column;this.editor.setSelection(new this.monaco.Range(e,t,e,t))}return 0}showInlineDiff(e){if(!this.editor||!this.monaco)return;let n=this.editor,r=this.monaco;this.hideInlineDiff(),t(async()=>{let{InlineDiffController:e,INLINE_DIFF_CSS:t}=await import(`./inlineDiffController-DianrKl1.js`);return{InlineDiffController:e,INLINE_DIFF_CSS:t}},__vite__mapDeps([7,8]),import.meta.url).then(({InlineDiffController:t,INLINE_DIFF_CSS:i})=>{if(!this.inlineDiffCssInjected){let e=document.createElement(`style`);e.textContent=i,e.setAttribute(`data-iob-aichat`,`inline-diff`),document.head.appendChild(e),this.inlineDiffCssInjected=!0}let a=new t(n,r,{range:e.range,originalText:e.originalText,modifiedText:e.modifiedText,onAccepted:()=>{var t;this.inlineDiffInstance=null,(t=e.onAccepted)==null||t.call(e)},onRejected:()=>{var t;this.inlineDiffInstance=null,(t=e.onRejected)==null||t.call(e)}});this.inlineDiffInstance=a,a.show()}).catch(()=>{})}hideInlineDiff(){if(this.inlineDiffInstance){try{this.inlineDiffInstance.dispose()}catch{}this.inlineDiffInstance=null}}showInlineChatWidget(){if(!this.editor||!this.monaco||!this.props.onInlineAsk)return;if(this.inlineChatWidgetInstance){this.inlineChatWidgetInstance.show();return}let e=this.editor,n=this.monaco,r=this.props.onInlineAsk,i=this.props.onAiAction;t(async()=>{let{InlineChatWidget:e}=await import(`./inlineChatWidget-CBVgT6FZ.js`);return{InlineChatWidget:e}},__vite__mapDeps([9,8]),import.meta.url).then(({InlineChatWidget:t})=>{let a=new t(e,n,{onSubmit:async e=>r({question:e.question,selectedCode:e.selectedCode}),onEscalateToChat:e=>{i&&i({action:`ask`,code:e.selectedCode,question:e.question,rangeLabel:e.range?`lines ${e.range.startLineNumber}-${e.range.endLineNumber}`:`whole file`})}});this.inlineChatWidgetInstance=a,a.show()}).catch(()=>{})}registerAiActions(){if(!this.editor||!this.monaco||!this.props.onAiAction)return;let e=this.monaco,t=(t,n={})=>{if(!this.editor||!this.props.onAiAction)return;let r=this.editor.getModel();if(!r)return;let i=this.editor.getSelection(),a=i&&!i.isEmpty(),o,s,c,l=`selection`;if(a)o=r.getValueInRange(i),s=i.startLineNumber===i.endLineNumber?`line ${i.startLineNumber}`:`lines ${i.startLineNumber}-${i.endLineNumber}`,c={startLine:i.startLineNumber,startColumn:i.startColumn,endLine:i.endLineNumber,endColumn:i.endColumn},l=`selection`;else{let t=this.editor.getPosition(),n=null;if(t)try{n=v(r.getValue(),t.lineNumber)}catch{}if(n){let t=n.startLine,i=n.endLine,a=r.getLineMaxColumn(i),u=new e.Range(t,1,i,a);o=r.getValueInRange(u),s=t===i?`line ${t}`:`lines ${t}-${i}`,c={startLine:t,startColumn:1,endLine:i,endColumn:a},l=`codelens`}else o=r.getValue(),s=`whole file`,l=`none`}this.props.onAiAction({action:t,code:o,rangeLabel:s,range:c,kind:l,...n})},n=[{id:`iobroker.ai.inline`,label:`🤖 ${l.t(`AI: Inline chat…`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyI],order:1,run:()=>{if(this.props.onInlineAsk)this.showInlineChatWidget();else{let e=window.prompt(l.t(`Ask the AI about the selected code:`));e&&e.trim()&&t(`ask`,{question:e.trim()})}}},{id:`iobroker.ai.explain`,label:`💡 ${l.t(`AI: Explain`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyE],order:2,run:()=>t(`explain`)},{id:`iobroker.ai.refactor`,label:`🔧 ${l.t(`AI: Refactor`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyR],order:3,run:()=>t(`refactor`)},{id:`iobroker.ai.comment`,label:`💬 ${l.t(`AI: Add comments`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyC],order:4,run:()=>t(`comment`)},{id:`iobroker.ai.fix`,label:`🛠️ ${l.t(`AI: Fix problem`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyF],order:5,run:()=>{let n;try{var r,i;let t=(r=this.editor)==null?void 0:r.getModel(),a=(i=this.editor)==null?void 0:i.getPosition();if(t&&a){let r=e.editor.getModelMarkers({resource:t.uri}).find(e=>a.lineNumber>=e.startLineNumber&&a.lineNumber<=e.endLineNumber);r&&(n=r.message)}}catch{}t(`fix`,{diagnostic:n})}},{id:`iobroker.ai.tests`,label:`✅ ${l.t(`AI: Suggest tests`)}`,order:6,run:()=>t(`tests`)}];for(let e of n)try{this.editor.addAction({id:e.id,label:e.label,contextMenuGroupId:`aichat`,contextMenuOrder:e.order,keybindings:e.keybindings,run:()=>e.run()})}catch{}}getEditorSelection(){if(!this.editor)return null;let e=this.editor.getSelection();if(!e||e.isEmpty())return null;let t=this.editor.getModel();return t?{text:t.getValueInRange(e),range:{startLine:e.startLineNumber,startColumn:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn}}:null}getEditorContent(){var e;return((e=this.editor)==null||(e=e.getModel())==null?void 0:e.getValue())??``}getCursorPosition(){var e;let t=(e=this.editor)==null?void 0:e.getPosition();return t?{line:t.lineNumber,column:t.column}:null}highlightLineRange(e,t){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r)),a=Math.max(i,Math.min(t,r)),o=n.getLineMaxColumn(a);return this.editor.setSelection(new this.monaco.Range(i,1,a,o)),this.editor.revealLineInCenter(i),!0}goToLine(e,t=1){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r));return this.editor.setPosition({lineNumber:i,column:t}),this.editor.revealLineInCenter(i),this.editor.focus(),!0}replaceSelection(e){if(!this.editor||!this.monaco)return!1;let t=this.editor.getSelection();if(!t)return!1;let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);return this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}]),this.editor.focus(),!0}getDiagnostics(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=this.monaco.editor.getModelMarkers({resource:e.uri}),n={8:`error`,4:`warning`,2:`info`,1:`hint`};return t.map(e=>({line:e.startLineNumber,column:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn,severity:n[e.severity]||`info`,message:e.message,...e.source?{source:e.source}:{}}))}async getDocumentSymbols(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=[];try{var n;let r=this.monaco.languages,i=(n=r.getDocumentSymbolProviders)==null?void 0:n.call(r,e);if(i!=null&&i.length){let n={0:`file`,1:`module`,2:`namespace`,3:`package`,4:`class`,5:`method`,6:`property`,7:`field`,8:`constructor`,9:`enum`,10:`interface`,11:`function`,12:`variable`,13:`constant`,14:`string`,15:`number`,16:`boolean`,17:`array`,18:`object`,19:`key`,20:`null`,21:`enum-member`,22:`struct`,23:`event`,24:`operator`,25:`type-parameter`};for(let r of i){let i=await r.provideDocumentSymbols(e,{isCancellationRequested:!1});if(!i)continue;let a=e=>{for(let i of e){var r;t.push({name:i.name,kind:n[i.kind]||String(i.kind),line:i.range.startLineNumber,endLine:i.range.endLineNumber,...i.detail?{detail:i.detail}:{}}),(r=i.children)!=null&&r.length&&a(i.children)}};if(a(i),t.length)break}}}catch{}if(t.length===0){let n=e.getValue().split(` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./stateHoverProvider-CIFNrLee.js","./cronHoverProvider-BhX-SvkB.js","./index-DlFpMLlN.js","./Import-BH2X_ziv.js","./Error-1oeF0cix.js","./blockly-DBw-ytY1.js","./index-Z8Hkv58g.css","./inlineDiffController-DianrKl1.js","./applyCodeEdit-D3nb7erO.js","./inlineChatWidget-CBVgT6FZ.js"])))=>i.map(i=>d[i]); +import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./vite-preload-helper-B7qeedMF.js";import{Jn as n,Ln as r,N as i,Nn as a,Ut as o,Yn as s,en as c,f as l,in as u,mn as d,nn as f,nr as p,sn as m,tn as h,wr as g,z as _}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{d as v}from"./index-DlFpMLlN.js";var y=e({default:()=>C});g();function b(e){return/^script\.js\.global\./.test(e)}var x=0;function S(e){return e.replace(/\x1b\[[0-9;]*m/g,``)}var C=class extends p.Component{get monacoTS(){var e;return(e=this.monaco)==null||(e=e.languages)==null?void 0:e.typescript}constructor(e){super(e),r(this,`monacoDiv`,null),r(this,`editor`,null),r(this,`monaco`,window.monaco),r(this,`insert`,``),r(this,`originalCode`,void 0),r(this,`runningInstancesStr`,void 0),r(this,`monacoCounter`,0),r(this,`location`,void 0),r(this,`breakpoints`,void 0),r(this,`lastSearch`,``),r(this,`typings`,{}),r(this,`decorations`,[]),r(this,`datapointProviderDisposable`,null),r(this,`inlineProviderDisposable`,null),r(this,`stateHoverDisposable`,null),r(this,`showStateValueDisposable`,null),r(this,`cronHoverDisposable`,null),r(this,`codeLensDisposable`,null),r(this,`inlineChatWidgetInstance`,null),r(this,`inlineDiffInstance`,null),r(this,`inlineDiffCssInjected`,!1),r(this,`triggerPrettier`,void 0),r(this,`contentChangeDisposable`,null),r(this,`mouseDownDisposable`,null),this.state={name:`current`,isDark:e.isDark||!1,language:e.language||`javascript`,readOnly:e.readOnly||!1,alive:!0,check:!1,searchText:this.props.searchText||``,typingsLoaded:!1,showError:null},this.triggerPrettier=e.triggerPrettier,this.runningInstancesStr=JSON.stringify(this.props.runningInstances),this.originalCode=e.code||``,this.monacoDiv=p.createRef()}waitForMonaco(e){var t;let n=!!((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),this.monacoCounter++,!n&&this.monacoCounter<20){console.log(`wait for monaco loaded`),setTimeout(()=>this.waitForMonaco(e),200);return}this.monacoCounter>=20&&console.error(`Cannot load monaco!`)}else e&&e()}loadTypings(e){if(!this.editor)return;e||=this.props.runningInstances;let t=e&&Object.keys(e).find(t=>e==null?void 0:e[t]);t&&this.props.socket.sendTo(t.replace(`system.adapter.`,``),`loadTypings`,null).then(e=>{this.setState({alive:!0,check:!0,typingsLoaded:!0}),this.setTypeCheck(!0),e.typings?(this.typings=e.typings,this.setEditorTypings(this.state.name)):console.error(`failed to load typings: ${e.error}`)})}componentDidMount(){var e;this.undo,this.redo,this.showInlineDiff,this.getEditorSelection,this.getEditorContent,this.getCursorPosition,this.highlightLineRange,this.goToLine,this.replaceSelection,this.getDiagnostics,this.getDocumentSymbols;let n=!!((e=this.monacoTS)!=null&&(e=e.typescriptDefaults)!=null&&e.getCompilerOptions);if(!n||!this.props.runningInstances){var r;if(this.monaco=window.monaco,n=!!((r=this.monacoTS)!=null&&(r=r.typescriptDefaults)!=null&&r.getCompilerOptions),!n){console.log(`wait for monaco loaded...`),this.waitForMonaco(()=>this.componentDidMount());return}}if(!this.editor&&n&&this.monaco){var i,a,o;console.log(`Init editor`),(i=(a=this.props).onRegisterSelect)==null||i.call(a,()=>{if(this.editor){let t=this.editor.getSelection();if(t){var e;return(e=this.editor.getModel())==null?void 0:e.getValueInRange(t)}}});let e=this.monacoTS.typescriptDefaults.getCompilerOptions();if(e.allowJs=!0,e.checkJs=this.props.checkJs!==!1,e.noLib=!0,e.lib=[],e.useUnknownInCatchVariables=!1,e.moduleResolution=this.monacoTS.ModuleResolutionKind.NodeJs,e.target=this.monacoTS.ScriptTarget.ESNext,e.module=this.monacoTS.ModuleKind.ESNext,e.allowNonTsExtensions=!0,this.monacoTS.typescriptDefaults.setCompilerOptions(e),this.setTypeCheck(!1),(o=this.monacoDiv)!=null&&o.current){var s;this.editor=this.monaco.editor.create((s=this.monacoDiv)==null?void 0:s.current,{lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,glyphMargin:!!this.props.breakpoints,colorDecorators:!0,hover:{enabled:`on`,delay:200,sticky:!0},fixedOverflowWidgets:!0}),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange()),this.monaco&&!this.datapointProviderDisposable&&t(async()=>{let{registerDatapointProvider:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{registerDatapointProvider:e}},[],import.meta.url).then(({registerDatapointProvider:e})=>{this.monaco&&(this.datapointProviderDisposable=e(this.monaco,this.props.socket))}).catch(()=>{}),this.monaco&&!this.stateHoverDisposable&&t(async()=>{let{registerStateHoverProvider:e,registerShowStateValueAction:t}=await import(`./stateHoverProvider-CIFNrLee.js`);return{registerStateHoverProvider:e,registerShowStateValueAction:t}},__vite__mapDeps([0]),import.meta.url).then(({registerStateHoverProvider:e,registerShowStateValueAction:t})=>{this.monaco&&(this.stateHoverDisposable=e(this.monaco,this.props.socket)),this.monaco&&this.editor&&!this.showStateValueDisposable&&(this.showStateValueDisposable=t(this.editor,this.monaco,l.t(`Show ioBroker state value`)))}).catch(()=>{}),this.monaco&&!this.cronHoverDisposable&&t(async()=>{let{registerCronHoverProvider:e}=await import(`./cronHoverProvider-BhX-SvkB.js`);return{registerCronHoverProvider:e}},__vite__mapDeps([1]),import.meta.url).then(({registerCronHoverProvider:e})=>{this.monaco&&(this.cronHoverDisposable=e(this.monaco))}).catch(()=>{}),this.props.aiCompletionsEnabled&&this.monaco&&!this.inlineProviderDisposable&&t(async()=>{let{registerAiInlineProvider:e}=await import(`./AiInlineProvider-CaHd2G2Q.js`);return{registerAiInlineProvider:e}},[],import.meta.url).then(({registerAiInlineProvider:e})=>{this.monaco&&(this.inlineProviderDisposable=e(this.monaco,this.props.socket,this.props.runningInstances))}).catch(()=>{}),this.loadTypings(),this.props.onForceSave&&this.editor.addCommand(this.monaco.KeyMod.CtrlCmd|this.monaco.KeyCode.KeyS,()=>this.props.onForceSave&&this.props.onForceSave()),this.registerAiActions(),this.monaco&&this.editor&&this.props.onAiAction&&!this.codeLensDisposable&&t(async()=>{let{registerAiCodeLensProvider:e}=await import(`./index-DlFpMLlN.js`).then(e=>e.u);return{registerAiCodeLensProvider:e}},__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(({registerAiCodeLensProvider:e})=>{this.monaco&&this.editor&&this.props.onAiAction&&(this.codeLensDisposable=e(this.monaco,this.editor,(e,t,n,r,i)=>{var a,o,s;let c=(a=this.editor)==null?void 0:a.getModel(),l=c?c.getLineMaxColumn(Math.min(i,c.getLineCount())):1;(o=(s=this.props).onAiAction)==null||o.call(s,{action:e,code:t,rangeLabel:n,range:{startLine:r,startColumn:1,endLine:i,endColumn:l},kind:`codelens`})}))}).catch(()=>{}),setTimeout(()=>{this.highlightText(this.state.searchText),this.location=this.props.location||void 0,this.breakpoints=this.props.breakpoints,this.showDecorators()})}}let c={selectOnLineNumbers:!0,scrollBeyondLastLine:!1,automaticLayout:!0,readOnly:this.state.readOnly,language:this.state.language,isDark:this.state.isDark};this.setEditorOptions(c),this.editor&&(this.editor.focus(),this.editor.setValue(this.originalCode),this.props.onToggleBreakpoint&&(this.mouseDownDisposable=this.editor.onMouseDown(e=>{var t;let n=e.target;this.props.onToggleBreakpoint&&((t=n.detail)==null?void 0:t.glyphMarginLeft)!==void 0&&n.position&&this.props.onToggleBreakpoint(n.position.lineNumber-1)})))}setEditorOptions(e){if(e&&(e.language&&this.setEditorLanguage(e.language),this.editor&&(e.readOnly!==void 0&&this.editor.updateOptions({readOnly:e.readOnly}),e.lineWrap!==void 0&&this.editor.updateOptions({wordWrap:e.lineWrap?`on`:`off`})),e.typeCheck!==void 0&&this.setTypeCheck(e.typeCheck),e.isDark!==void 0)){var t;(t=this.monaco)==null||t.editor.setTheme(e.isDark?`vs-dark`:`vs`)}}componentWillUnmount(){var e,n,r,i,a,o,s,c,l;if((e=this.contentChangeDisposable)==null||e.dispose(),this.contentChangeDisposable=null,(n=this.mouseDownDisposable)==null||n.dispose(),this.mouseDownDisposable=null,(r=this.datapointProviderDisposable)==null||r.dispose(),this.datapointProviderDisposable=null,t(async()=>{let{clearDatapointCache:e}=await import(`./AiDatapointProvider-DzFpUKkT.js`);return{clearDatapointCache:e}},[],import.meta.url).then(({clearDatapointCache:e})=>e()).catch(()=>{}),(i=this.inlineProviderDisposable)==null||i.dispose(),this.inlineProviderDisposable=null,(a=this.stateHoverDisposable)==null||a.dispose(),this.stateHoverDisposable=null,(o=this.showStateValueDisposable)==null||o.dispose(),this.showStateValueDisposable=null,t(async()=>{let{clearStateHoverCache:e}=await import(`./stateHoverProvider-CIFNrLee.js`);return{clearStateHoverCache:e}},__vite__mapDeps([0]),import.meta.url).then(({clearStateHoverCache:e})=>e()).catch(()=>{}),(s=this.cronHoverDisposable)==null||s.dispose(),this.cronHoverDisposable=null,(c=this.codeLensDisposable)==null||c.dispose(),this.codeLensDisposable=null,(l=this.inlineChatWidgetInstance)==null||l.dispose(),this.inlineChatWidgetInstance=null,this.hideInlineDiff(),this.editor){var u,d;(u=(d=this.props).onRegisterSelect)==null||u.call(d,null),this.editor.dispose(),this.editor=null}}async doPrettier(){var e;let t=this.props.runningInstances&&Object.keys(this.props.runningInstances).find(e=>{var t;return(t=this.props.runningInstances)==null?void 0:t[e]});if(!t){window.alert(l.t(`No script adapter instance found to format the code`));return}let n=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`prettier`,{code:(e=this.editor)==null?void 0:e.getValue(),type:this.state.language});if(n.error)this.setState({showError:{title:l.t(`Error formatting code`),message:S(n.error)}});else if(n.code){var r,i,a;(r=this.editor)==null||r.setValue(n.code),(i=(a=this.props).onChange)==null||i.call(a,n.code),this.showDecorators()}}setEditorLanguage(e){if(!this.editor)return;let t=this.editor.getModel();if(t){var n;let i=t.getValue(),a=t.uri.path,o=typeof a==`string`&&a.includes(`.`)?a.substring(0,a.lastIndexOf(`.`)):`index`,s=e===`javascript`?`js`:e===`typescript`?`ts`:e;t.dispose();let c=e===`javascript`||e===`typescript`?`typescript`:e,l=(n=this.monaco)==null?void 0:n.editor.createModel(i,c,this.monaco.Uri.from({scheme:window.location.protocol.replace(`:`,``),path:`${o}${x++}.${s}`}));if(l){var r;this.editor.setModel(l),(r=this.contentChangeDisposable)==null||r.dispose(),this.contentChangeDisposable=this.editor.onDidChangeModelContent(()=>this.onChange())}}}setTypeCheck(e){var t,n;let r={noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive};(t=this.monacoTS)==null||t.typescriptDefaults.setDiagnosticsOptions(r),(n=this.monacoTS)==null||n.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!this.state.alive||!e,noSyntaxValidation:!this.state.alive})}setEditorTypings(e=``){var t,n;let r=b(e),i=`${e}.d.ts`,a=[];for(let e of Object.keys(this.typings))r&&(e===`global.d.ts`||e.startsWith(`script.js.global`)&&e!==i)||a.push({filePath:e,content:this.typings[e]});if((t=this.monacoTS)!=null&&(t=t.typescriptDefaults)!=null&&t.setExtraLibs)this.monacoTS.typescriptDefaults.setExtraLibs(a);else if((n=this.monacoTS)!=null&&(n=n.typescriptDefaults)!=null&&n.addExtraLib){let e=this.monacoTS.typescriptDefaults.getExtraLibs();a.forEach(t=>{!e[t.filePath]&&this.monaco&&this.monacoTS.typescriptDefaults.addExtraLib(t.content,t.filePath)})}}undo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`undo`,null)}redo(){var e;(e=this.editor)==null||e.trigger(`toolbar`,`redo`,null)}insertTextIntoEditor(e){if(!this.editor||!this.monaco)return;let t=this.editor.getSelection();if(t){let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}])}this.editor.focus()}highlightText(e){var t;if(!this.editor||!this.monaco)return 0;let n=e?(t=this.editor.getModel())==null?void 0:t.findMatches(e,!0,!1,!1,null,!0):void 0;if(n!=null&&n.length)return n.forEach(e=>{var t;return(t=this.editor)==null?void 0:t.setSelection(e.range)}),this.editor.revealLine(n[0].range.startLineNumber),n.length;let r=this.editor.getPosition();if(r){let e=r.lineNumber,t=r.column;this.editor.setSelection(new this.monaco.Range(e,t,e,t))}return 0}showInlineDiff(e){if(!this.editor||!this.monaco)return;let n=this.editor,r=this.monaco;this.hideInlineDiff(),t(async()=>{let{InlineDiffController:e,INLINE_DIFF_CSS:t}=await import(`./inlineDiffController-DianrKl1.js`);return{InlineDiffController:e,INLINE_DIFF_CSS:t}},__vite__mapDeps([7,8]),import.meta.url).then(({InlineDiffController:t,INLINE_DIFF_CSS:i})=>{if(!this.inlineDiffCssInjected){let e=document.createElement(`style`);e.textContent=i,e.setAttribute(`data-iob-aichat`,`inline-diff`),document.head.appendChild(e),this.inlineDiffCssInjected=!0}let a=new t(n,r,{range:e.range,originalText:e.originalText,modifiedText:e.modifiedText,onAccepted:()=>{var t;this.inlineDiffInstance=null,(t=e.onAccepted)==null||t.call(e)},onRejected:()=>{var t;this.inlineDiffInstance=null,(t=e.onRejected)==null||t.call(e)}});this.inlineDiffInstance=a,a.show()}).catch(()=>{})}hideInlineDiff(){if(this.inlineDiffInstance){try{this.inlineDiffInstance.dispose()}catch{}this.inlineDiffInstance=null}}showInlineChatWidget(){if(!this.editor||!this.monaco||!this.props.onInlineAsk)return;if(this.inlineChatWidgetInstance){this.inlineChatWidgetInstance.show();return}let e=this.editor,n=this.monaco,r=this.props.onInlineAsk,i=this.props.onAiAction;t(async()=>{let{InlineChatWidget:e}=await import(`./inlineChatWidget-CBVgT6FZ.js`);return{InlineChatWidget:e}},__vite__mapDeps([9,8]),import.meta.url).then(({InlineChatWidget:t})=>{let a=new t(e,n,{onSubmit:async e=>r({question:e.question,selectedCode:e.selectedCode}),onEscalateToChat:e=>{i&&i({action:`ask`,code:e.selectedCode,question:e.question,rangeLabel:e.range?`lines ${e.range.startLineNumber}-${e.range.endLineNumber}`:`whole file`})}});this.inlineChatWidgetInstance=a,a.show()}).catch(()=>{})}registerAiActions(){if(!this.editor||!this.monaco||!this.props.onAiAction)return;let e=this.monaco,t=(t,n={})=>{if(!this.editor||!this.props.onAiAction)return;let r=this.editor.getModel();if(!r)return;let i=this.editor.getSelection(),a=i&&!i.isEmpty(),o,s,c,l=`selection`;if(a)o=r.getValueInRange(i),s=i.startLineNumber===i.endLineNumber?`line ${i.startLineNumber}`:`lines ${i.startLineNumber}-${i.endLineNumber}`,c={startLine:i.startLineNumber,startColumn:i.startColumn,endLine:i.endLineNumber,endColumn:i.endColumn},l=`selection`;else{let t=this.editor.getPosition(),n=null;if(t)try{n=v(r.getValue(),t.lineNumber)}catch{}if(n){let t=n.startLine,i=n.endLine,a=r.getLineMaxColumn(i),u=new e.Range(t,1,i,a);o=r.getValueInRange(u),s=t===i?`line ${t}`:`lines ${t}-${i}`,c={startLine:t,startColumn:1,endLine:i,endColumn:a},l=`codelens`}else o=r.getValue(),s=`whole file`,l=`none`}this.props.onAiAction({action:t,code:o,rangeLabel:s,range:c,kind:l,...n})},n=[{id:`iobroker.ai.inline`,label:`🤖 ${l.t(`AI: Inline chat…`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyI],order:1,run:()=>{if(this.props.onInlineAsk)this.showInlineChatWidget();else{let e=window.prompt(l.t(`Ask the AI about the selected code:`));e&&e.trim()&&t(`ask`,{question:e.trim()})}}},{id:`iobroker.ai.explain`,label:`💡 ${l.t(`AI: Explain`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyE],order:2,run:()=>t(`explain`)},{id:`iobroker.ai.refactor`,label:`🔧 ${l.t(`AI: Refactor`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyR],order:3,run:()=>t(`refactor`)},{id:`iobroker.ai.comment`,label:`💬 ${l.t(`AI: Add comments`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyC],order:4,run:()=>t(`comment`)},{id:`iobroker.ai.fix`,label:`🛠️ ${l.t(`AI: Fix problem`)}`,keybindings:[e.KeyMod.CtrlCmd|e.KeyMod.Alt|e.KeyCode.KeyF],order:5,run:()=>{let n;try{var r,i;let t=(r=this.editor)==null?void 0:r.getModel(),a=(i=this.editor)==null?void 0:i.getPosition();if(t&&a){let r=e.editor.getModelMarkers({resource:t.uri}).find(e=>a.lineNumber>=e.startLineNumber&&a.lineNumber<=e.endLineNumber);r&&(n=r.message)}}catch{}t(`fix`,{diagnostic:n})}},{id:`iobroker.ai.tests`,label:`✅ ${l.t(`AI: Suggest tests`)}`,order:6,run:()=>t(`tests`)}];for(let e of n)try{this.editor.addAction({id:e.id,label:e.label,contextMenuGroupId:`aichat`,contextMenuOrder:e.order,keybindings:e.keybindings,run:()=>e.run()})}catch{}}getEditorSelection(){if(!this.editor)return null;let e=this.editor.getSelection();if(!e||e.isEmpty())return null;let t=this.editor.getModel();return t?{text:t.getValueInRange(e),range:{startLine:e.startLineNumber,startColumn:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn}}:null}getEditorContent(){var e;return((e=this.editor)==null||(e=e.getModel())==null?void 0:e.getValue())??``}getCursorPosition(){var e;let t=(e=this.editor)==null?void 0:e.getPosition();return t?{line:t.lineNumber,column:t.column}:null}highlightLineRange(e,t){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r)),a=Math.max(i,Math.min(t,r)),o=n.getLineMaxColumn(a);return this.editor.setSelection(new this.monaco.Range(i,1,a,o)),this.editor.revealLineInCenter(i),!0}goToLine(e,t=1){if(!this.editor||!this.monaco)return!1;let n=this.editor.getModel();if(!n)return!1;let r=n.getLineCount(),i=Math.max(1,Math.min(e,r));return this.editor.setPosition({lineNumber:i,column:t}),this.editor.revealLineInCenter(i),this.editor.focus(),!0}replaceSelection(e){if(!this.editor||!this.monaco)return!1;let t=this.editor.getSelection();if(!t)return!1;let n=new this.monaco.Range(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn);return this.editor.executeEdits(``,[{range:n,text:e,forceMoveMarkers:!0}]),this.editor.focus(),!0}getDiagnostics(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=this.monaco.editor.getModelMarkers({resource:e.uri}),n={8:`error`,4:`warning`,2:`info`,1:`hint`};return t.map(e=>({line:e.startLineNumber,column:e.startColumn,endLine:e.endLineNumber,endColumn:e.endColumn,severity:n[e.severity]||`info`,message:e.message,...e.source?{source:e.source}:{}}))}async getDocumentSymbols(){if(!this.editor||!this.monaco)return[];let e=this.editor.getModel();if(!e)return[];let t=[];try{var n;let r=this.monaco.languages,i=(n=r.getDocumentSymbolProviders)==null?void 0:n.call(r,e);if(i!=null&&i.length){let n={0:`file`,1:`module`,2:`namespace`,3:`package`,4:`class`,5:`method`,6:`property`,7:`field`,8:`constructor`,9:`enum`,10:`interface`,11:`function`,12:`variable`,13:`constant`,14:`string`,15:`number`,16:`boolean`,17:`array`,18:`object`,19:`key`,20:`null`,21:`enum-member`,22:`struct`,23:`event`,24:`operator`,25:`type-parameter`};for(let r of i){let i=await r.provideDocumentSymbols(e,{isCancellationRequested:!1});if(!i)continue;let a=e=>{for(let i of e){var r;t.push({name:i.name,kind:n[i.kind]||String(i.kind),line:i.range.startLineNumber,endLine:i.range.endLineNumber,...i.detail?{detail:i.detail}:{}}),(r=i.children)!=null&&r.length&&a(i.children)}};if(a(i),t.length)break}}}catch{}if(t.length===0){let n=e.getValue().split(` `),r=[{re:/^(?:export\s+)?(?:async\s+)?function\s+(\w+)/,kind:`function`},{re:/^(?:export\s+)?class\s+(\w+)/,kind:`class`},{re:/^(?:export\s+)?(?:const|let|var)\s+(\w+)/,kind:`variable`}];for(let e=0;e{this.monaco&&t.push({range:new this.monaco.Range(e.location.lineNumber+1,0,e.location.lineNumber+1,100),options:{isWholeLine:!0,glyphMarginClassName:this.props.isDark?`monacoBreakPointDark`:`monacoBreakPoint`}})}),this.editor){let e=this.editor.getModel();e&&(this.decorations=e.deltaDecorations(this.decorations,t))}}initNewScript(e,t){var n;this.setState({name:e}),this.originalCode=t||``,(n=this.editor)==null||n.setValue(t||``),this.highlightText(this.lastSearch),this.showDecorators(),this.setEditorTypings(e)}scrollToLineIfNeeded(e){if(this.editor){let t=this.editor.getVisibleRanges();(!t||!t[0]||t[0].startLineNumber>e||e>t[0].endLineNumber)&&this.editor.revealLineInCenter(e)}}UNSAFE_componentWillReceiveProps(e){let n={};this.state.name!==e.name&&this.initNewScript(e.name,e.code),JSON.stringify(e.runningInstances)!==this.runningInstancesStr&&(this.runningInstancesStr=JSON.stringify(e.runningInstances),this.state.typingsLoaded||this.loadTypings(e.runningInstances)),this.editor&&!e.changed&&(e.code!==this.originalCode||e.code!==this.editor.getValue())&&(this.originalCode=e.code||``,this.editor.setValue(this.originalCode),this.showDecorators(),this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)),e.searchText!==this.lastSearch&&(this.lastSearch=e.searchText||``,this.highlightText(this.lastSearch)),JSON.stringify(e.location)!==JSON.stringify(this.location)&&JSON.stringify(e.breakpoints)!==JSON.stringify(this.breakpoints)?(this.location=e.location||void 0,this.breakpoints=e.breakpoints,this.showDecorators(),this.editor&&this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)):JSON.stringify(e.breakpoints)===JSON.stringify(this.breakpoints)?JSON.stringify(e.location)!==JSON.stringify(this.location)&&(this.location=e.location||void 0,this.showDecorators(),this.editor&&this.location&&this.scrollToLineIfNeeded(this.location.lineNumber+1)):(this.breakpoints=e.breakpoints,this.showDecorators()),this.state.language===(e.language||`javascript`)?this.state.readOnly===(e.readOnly||!1)?this.state.isDark!==(e.isDark||!1)&&(this.setState({isDark:e.isDark||!1}),n.isDark=e.isDark):(this.setState({readOnly:e.readOnly||!1}),n.readOnly=e.readOnly):(this.setState({language:e.language||`javascript`}),n.language=e.language||`javascript`),this.setEditorOptions(n),e.aiCompletionsEnabled!==this.props.aiCompletionsEnabled&&(e.aiCompletionsEnabled&&this.monaco&&!this.inlineProviderDisposable?t(async()=>{let{registerAiInlineProvider:e}=await import(`./AiInlineProvider-CaHd2G2Q.js`);return{registerAiInlineProvider:e}},[],import.meta.url).then(({registerAiInlineProvider:e})=>{this.monaco&&(this.inlineProviderDisposable=e(this.monaco,this.props.socket,this.props.runningInstances))}).catch(()=>{}):!e.aiCompletionsEnabled&&this.inlineProviderDisposable&&(this.inlineProviderDisposable.dispose(),this.inlineProviderDisposable=null)),this.insert!==e.insert&&(this.insert=e.insert||``,this.insert&&(console.log(`Insert text: ${this.insert}`),setTimeout(e=>{this.insertTextIntoEditor(e),setTimeout(()=>this.props.onInserted&&this.props.onInserted(),100)},100,this.insert)))}onChange(){if(!this.props.readOnly&&this.editor){var e,t;(e=(t=this.props).onChange)==null||e.call(t,this.editor.getValue())}}renderErrorDialog(){return this.state.showError?this.state.showError.full?s(c,{open:!0,maxWidth:`md`,onClose:()=>this.setState({showError:null}),children:[n(u,{children:this.state.showError.title||l.t(`Error`)}),n(f,{children:n(`pre`,{children:n(`code`,{children:this.state.showError.message})})}),n(h,{children:s(o,{variant:`contained`,startIcon:n(i,{}),onClick:()=>this.setState({showError:null}),children:[l.t(`Close`),` `]})})]}):n(a,{open:!0,autoHideDuration:5e3,onClose:()=>this.setState({showError:null}),message:this.state.showError.title,action:s(p.Fragment,{children:[n(o,{color:`secondary`,size:`small`,onClick:()=>this.setState({showError:{...this.state.showError,full:!0}}),children:l.t(`More`)}),n(d,{size:`small`,"aria-label":`close`,color:`inherit`,onClick:()=>this.setState({showError:null}),children:n(i,{fontSize:`small`})})]})}):null}render(){var e;return!((e=this.monacoTS)!=null&&e.typescriptDefaults)||!this.props.runningInstances?(setTimeout(()=>{this.monaco=window.monaco,this.forceUpdate()},200),null):(this.props.triggerPrettier!==this.triggerPrettier&&(this.triggerPrettier=this.props.triggerPrettier,setTimeout(()=>this.doPrettier().catch(e=>console.error(`Error formatting code:`,e)),50)),s(`div`,{ref:this.monacoDiv,style:{...this.props.style,width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`},children:[this.renderErrorDialog(),!this.state.check&&n(m,{size:`small`,title:l.t(`Check is not active, because javascript adapter is disabled`),style:{bottom:10,right:10,opacity:.5,position:`absolute`,zIndex:1,background:`red`,color:`white`},color:`secondary`,children:n(_,{})})]}))}};export{y as n,C as t}; \ No newline at end of file diff --git a/admin/assets/aiPromptBuilder-CBfkFGhG.js b/admin/assets/aiPromptBuilder-CBfkFGhG.js new file mode 100644 index 00000000..60722e45 --- /dev/null +++ b/admin/assets/aiPromptBuilder-CBfkFGhG.js @@ -0,0 +1 @@ +import{t as e}from"./AiChatPanel-9G6bIR9k.js";export{e as buildActionPrompt}; \ No newline at end of file diff --git a/admin/assets/aiPromptBuilder-HfYvjqbs.js b/admin/assets/aiPromptBuilder-HfYvjqbs.js deleted file mode 100644 index 8eaf7b8b..00000000 --- a/admin/assets/aiPromptBuilder-HfYvjqbs.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./AiChatPanel-BFtl-m3b.js";export{e as buildActionPrompt}; \ No newline at end of file diff --git a/admin/assets/blocks_action-C3rgCWyA.js b/admin/assets/blocks_action-C3rgCWyA.js deleted file mode 100644 index 271705df..00000000 --- a/admin/assets/blocks_action-C3rgCWyA.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";import{f as o,i as s,o as c,r as l,u}from"./helpers-BPUU5RuQ.js";function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Action`),d.Action={HUE:330,blocks:{}};let m=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),h=()=>[[f(`http_timeout_ms`),`ms`],[f(`http_timeout_sec`),`sec`]],g=()=>[[f(`http_type_text`),`text`],[f(`http_type_arraybuffer`),`arraybuffer`]],_={mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`with_statement`,String(l(this.getFieldValue(`WITH_STATEMENT`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`with_statement`)))},updateShape_:function(e){u(this,e)}},v=(t,n,s,c,l,u)=>{r[t]={init:function(){this.appendDummyInput().appendField(n),this.appendDummyInput(`ATTR`).appendField(new e(s),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Action.HUE),this.setTooltip(f(`${t}_tooltip`)),u&&this.setHelpUrl(p(u))},onchange:function(){o(this,c,l)},FUNCTION_TYPES:c},a.forBlock[t]=function(e){return[e.getFieldValue(`ATTR`),i.ATOMIC]}};d.Action.blocks.exec=` FALSE pwd `,r.exec={init:function(){this.appendDummyInput(`TEXT`).appendField(`» ${f(`exec`)}`),this.appendValueInput(`COMMAND`).appendField(f(`exec_command`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`exec_tooltip`)),this.setHelpUrl(p(`exec_help`))},..._},a.forBlock.exec=function(e){let t=a.valueToCode(e,`COMMAND`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('exec: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`exec(${t}, async (error, result, stderr) => {\n${n}});\n${r}`}return`exec(${t});\n${r}`},d.Action.blocks.exec_result=` result`,v(`exec_result`,`»`,[[f(`exec_result_result`),`result`],[f(`exec_result_stderr`),`stderr`],[f(`exec_result_error`),`error`]],[`exec`],`exec_result_warning`,`exec_help`),d.Action.blocks.http_get=` 2000 ms text http:// `,r.http_get={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_get`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_get_tooltip`)),this.setHelpUrl(p(`http_get_help`))}},a.forBlock.http_get=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);Number.isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.statementToCode(e,`STATEMENT`);return`httpGet(${t}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${s}});\n`},d.Action.blocks.http_post=` 2000 ms text http:// `,r.http_post={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_post`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendValueInput(`DATA`).appendField(f(`http_post_data`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_post_tooltip`)),this.setHelpUrl(p(`http_post_help`))}},a.forBlock.http_post=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.valueToCode(e,`DATA`,i.ATOMIC)||`null`,c=a.statementToCode(e,`STATEMENT`);return`httpPost(${t}, ${s}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${c}});\n`},d.Action.blocks.http_response=` response.data`,v(`http_response`,`🌐`,[[f(`http_response_data`),`response.data`],[f(`http_response_statuscode`),`response.statusCode`],[f(`http_response_responsetime`),`response.responseTime`],[f(`http_response_headers`),`response.headers`],[f(`http_response_error`),`err`]],[`http_get`,`http_post`],`http_response_warning`,`http_response_help`),d.Action.blocks.http_response_tofile=` temp.jpg `,r.http_response_tofile={init:function(){this.appendDummyInput().appendField(`🌐 ${f(`http_response_tofile`)}`),this.appendValueInput(`FILENAME`).appendField(f(`http_response_tofile_filename`)).setCheck(null),this.setInputsInline(!1),this.setOutput(!0,`String`),this.setColour(d.Action.HUE),this.setTooltip(f(`http_response_tofile_tooltip`)),this.setHelpUrl(p(`http_response_tofile_help`))},onchange:function(){o(this,[`http_get`,`http_post`],`http_response_warning`)},FUNCTION_TYPES:[`http_get`,`http_post`]},a.forBlock.http_response_tofile=function(e){return[`createTempFile(${a.valueToCode(e,`FILENAME`,i.ATOMIC)}, response.data)`,i.ATOMIC]};let y=()=>`${a.prefixLines(`if (err) {`,a.INDENT)}\n${a.prefixLines(`console.error(err);`,a.INDENT+a.INDENT)}\n${a.prefixLines(`}`,a.INDENT)}\n`;d.Action.blocks.file_write=` 0_userdata.0 demo.json `,r.file_write={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_write`)}`),this.appendValueInput(`FILE`).appendField(f(`file_write_filename`)).setCheck(null),this.appendValueInput(`DATA`).appendField(f(`file_write_data`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_write_tooltip`)),this.setHelpUrl(p(`file_write_help`))}},a.forBlock.file_write=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.valueToCode(e,`DATA`,i.ATOMIC),o=c(t);return`writeFile(${t}${o?` /* ${o} */`:``}, String(${n}), ${r||`null`}, (err) => {\n${y()}});\n`},d.Action.blocks.file_read=` 0_userdata.0 demo.json `,r.file_read={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_read`)}`),this.appendValueInput(`FILE`).appendField(f(`file_read_filename`)).setCheck(null),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_read_tooltip`)),this.setHelpUrl(p(`file_read_help`))}},a.forBlock.file_read=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.statementToCode(e,`STATEMENT`),o=c(t);return`readFile(${t}${o?` /* ${o} */`:``}, String(${n}), (err, data, mimeType) => {\n${y()}${r}});\n`},d.Action.blocks.file_data=` data`,v(`file_data`,`📁`,[[f(`file_data_data`),`data`],[f(`file_data_mimeType`),`mimeType`]],[`file_read`],`file_data_warning`),d.Action.blocks.request=` FALSE http:// `,r.request={init:function(){this.appendDummyInput(`TEXT`).appendField(f(`request`)),this.appendValueInput(`URL`).appendField(f(`request_url`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`request_tooltip`)),this.setHelpUrl(f(`request_help`))},..._},a.forBlock.request=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('request: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`try {\n require("request")(${t}, async (error, response, result) => {\n ${n} }).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}return`try {\n require("request")(${t}).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_action-HH802DF8.js b/admin/assets/blocks_action-HH802DF8.js new file mode 100644 index 00000000..db085bb0 --- /dev/null +++ b/admin/assets/blocks_action-HH802DF8.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{d as o,i as s,p as c,r as l,s as u}from"./helpers-n7EZ1fEP.js";function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Action`),d.Action={HUE:330,blocks:{}};let m=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),h=()=>[[f(`http_timeout_ms`),`ms`],[f(`http_timeout_sec`),`sec`]],g=()=>[[f(`http_type_text`),`text`],[f(`http_type_arraybuffer`),`arraybuffer`]],_={mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`with_statement`,String(l(this.getFieldValue(`WITH_STATEMENT`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`with_statement`)))},updateShape_:function(e){o(this,e)}},v=(t,n,o,s,l,u)=>{r[t]={init:function(){this.appendDummyInput().appendField(n),this.appendDummyInput(`ATTR`).appendField(new e(o),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Action.HUE),this.setTooltip(f(`${t}_tooltip`)),u&&this.setHelpUrl(p(u))},onchange:function(){c(this,s,l)},FUNCTION_TYPES:s},a.forBlock[t]=function(e){return[e.getFieldValue(`ATTR`),i.ATOMIC]}};d.Action.blocks.exec=` FALSE pwd `,r.exec={init:function(){this.appendDummyInput(`TEXT`).appendField(`» ${f(`exec`)}`),this.appendValueInput(`COMMAND`).appendField(f(`exec_command`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`exec_tooltip`)),this.setHelpUrl(p(`exec_help`))},..._},a.forBlock.exec=function(e){let t=a.valueToCode(e,`COMMAND`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('exec: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`exec(${t}, async (error, result, stderr) => {\n${n}});\n${r}`}return`exec(${t});\n${r}`},d.Action.blocks.exec_result=` result`,v(`exec_result`,`»`,[[f(`exec_result_result`),`result`],[f(`exec_result_stderr`),`stderr`],[f(`exec_result_error`),`error`]],[`exec`],`exec_result_warning`,`exec_help`),d.Action.blocks.http_get=` 2000 ms text http:// `,r.http_get={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_get`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_get_tooltip`)),this.setHelpUrl(p(`http_get_help`))}},a.forBlock.http_get=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);Number.isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.statementToCode(e,`STATEMENT`);return`httpGet(${t}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${s}});\n`},d.Action.blocks.http_post=` 2000 ms text http:// `,r.http_post={init:function(){this.appendValueInput(`URL`).appendField(`🌐 ${f(`http_post`)}`),this.appendDummyInput().appendField(f(`http_timeout`)).appendField(new t(`2000`),`TIMEOUT`).appendField(new e(h()),`UNIT`),this.appendDummyInput(`TYPE`).appendField(f(`http_type`)).appendField(new e(g()),`TYPE`),this.appendValueInput(`DATA`).appendField(f(`http_post_data`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`http_post_tooltip`)),this.setHelpUrl(p(`http_post_help`))}},a.forBlock.http_post=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`UNIT`),r=e.getFieldValue(`TIMEOUT`);isNaN(r)&&(r=2e3),n===`sec`&&(r*=1e3);let o=e.getFieldValue(`TYPE`)||`text`,s=a.valueToCode(e,`DATA`,i.ATOMIC)||`null`,c=a.statementToCode(e,`STATEMENT`);return`httpPost(${t}, ${s}, { timeout: ${r}, responseType: '${o}' }, async (err, response) => {\n${c}});\n`},d.Action.blocks.http_response=` response.data`,v(`http_response`,`🌐`,[[f(`http_response_data`),`response.data`],[f(`http_response_statuscode`),`response.statusCode`],[f(`http_response_responsetime`),`response.responseTime`],[f(`http_response_headers`),`response.headers`],[f(`http_response_error`),`err`]],[`http_get`,`http_post`],`http_response_warning`,`http_response_help`),d.Action.blocks.http_response_tofile=` temp.jpg `,r.http_response_tofile={init:function(){this.appendDummyInput().appendField(`🌐 ${f(`http_response_tofile`)}`),this.appendValueInput(`FILENAME`).appendField(f(`http_response_tofile_filename`)).setCheck(null),this.setInputsInline(!1),this.setOutput(!0,`String`),this.setColour(d.Action.HUE),this.setTooltip(f(`http_response_tofile_tooltip`)),this.setHelpUrl(p(`http_response_tofile_help`))},onchange:function(){c(this,[`http_get`,`http_post`],`http_response_warning`)},FUNCTION_TYPES:[`http_get`,`http_post`]},a.forBlock.http_response_tofile=function(e){return[`createTempFile(${a.valueToCode(e,`FILENAME`,i.ATOMIC)}, response.data)`,i.ATOMIC]};let y=()=>`${a.prefixLines(`if (err) {`,a.INDENT)}\n${a.prefixLines(`console.error(err);`,a.INDENT+a.INDENT)}\n${a.prefixLines(`}`,a.INDENT)}\n`;d.Action.blocks.file_write=` 0_userdata.0 demo.json `,r.file_write={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_write`)}`),this.appendValueInput(`FILE`).appendField(f(`file_write_filename`)).setCheck(null),this.appendValueInput(`DATA`).appendField(f(`file_write_data`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_write_tooltip`)),this.setHelpUrl(p(`file_write_help`))}},a.forBlock.file_write=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.valueToCode(e,`DATA`,i.ATOMIC),o=u(t);return`writeFile(${t}${o?` /* ${o} */`:``}, String(${n}), ${r||`null`}, (err) => {\n${y()}});\n`},d.Action.blocks.file_read=` 0_userdata.0 demo.json `,r.file_read={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${f(`file_read`)}`),this.appendValueInput(`FILE`).appendField(f(`file_read_filename`)).setCheck(null),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`file_read_tooltip`)),this.setHelpUrl(p(`file_read_help`))}},a.forBlock.file_read=function(e){let t=a.valueToCode(e,`OID`,i.ATOMIC),n=a.valueToCode(e,`FILE`,i.ATOMIC),r=a.statementToCode(e,`STATEMENT`),o=u(t);return`readFile(${t}${o?` /* ${o} */`:``}, String(${n}), (err, data, mimeType) => {\n${y()}${r}});\n`},d.Action.blocks.file_data=` data`,v(`file_data`,`📁`,[[f(`file_data_data`),`data`],[f(`file_data_mimeType`),`mimeType`]],[`file_read`],`file_data_warning`),d.Action.blocks.request=` FALSE http:// `,r.request={init:function(){this.appendDummyInput(`TEXT`).appendField(f(`request`)),this.appendValueInput(`URL`).appendField(f(`request_url`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(f(`with_results`)).appendField(m(),`WITH_STATEMENT`),this.appendDummyInput(`LOG`).appendField(f(`loglevel`)).appendField(new e(s()),`LOG`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Action.HUE),this.setTooltip(f(`request_tooltip`)),this.setHelpUrl(f(`request_help`))},..._},a.forBlock.request=function(e){let t=a.valueToCode(e,`URL`,i.ATOMIC),n=e.getFieldValue(`LOG`),r=``;if(n&&(r=`console.${n}('request: ' + ${t});\n`),l(e.getFieldValue(`WITH_STATEMENT`))){let n=a.statementToCode(e,`STATEMENT`);if(n)return`try {\n require("request")(${t}, async (error, response, result) => {\n ${n} }).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}return`try {\n require("request")(${t}).on("error", (e) => { console.error(e); });\n} catch (e) { console.error(e); }\n${r}`}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_convert-DpPMvgqR.js b/admin/assets/blocks_convert-B1CD0UVU.js similarity index 74% rename from admin/assets/blocks_convert-DpPMvgqR.js rename to admin/assets/blocks_convert-B1CD0UVU.js index bfbcdaf6..703f191a 100644 --- a/admin/assets/blocks_convert-DpPMvgqR.js +++ b/admin/assets/blocks_convert-B1CD0UVU.js @@ -1,3 +1,3 @@ -import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";import{n as o,s,t as c}from"./helpers-BPUU5RuQ.js";function l(){let l=window.Blockly,u=l.Translate;l.CustomBlocks=l.CustomBlocks||[],l.CustomBlocks.push(`Convert`),l.Convert={HUE:280,blocks:{}},l.Convert.blocks.convert_tonumber=``,r.convert_tonumber={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tonumber`)),this.setOutput(!0,`Number`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tonumber_tooltip`))}},a.forBlock.convert_tonumber=function(e){return[`parseFloat(${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_toboolean=``,r.convert_toboolean={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_toboolean`)),this.setOutput(!0,`Boolean`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_toboolean_tooltip`))}},a.forBlock.convert_toboolean=function(e){return[`(() => { +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{c as o,n as s,t as c}from"./helpers-n7EZ1fEP.js";function l(){let l=window.Blockly,u=l.Translate;l.CustomBlocks=l.CustomBlocks||[],l.CustomBlocks.push(`Convert`),l.Convert={HUE:280,blocks:{}},l.Convert.blocks.convert_tonumber=``,r.convert_tonumber={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tonumber`)),this.setOutput(!0,`Number`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tonumber_tooltip`))}},a.forBlock.convert_tonumber=function(e){return[`parseFloat(${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_toboolean=``,r.convert_toboolean={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_toboolean`)),this.setOutput(!0,`Boolean`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_toboolean_tooltip`))}},a.forBlock.convert_toboolean=function(e){return[`(() => { const val = ${a.valueToCode(e,`VALUE`,i.ATOMIC)};\n if (val === 'true' || val === 'TRUE') return true;\n if (val === 'false' || val === 'FALSE') return false;\n return !!val; -})()`,i.ATOMIC]},l.Convert.blocks.convert_tostring=``,r.convert_tostring={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tostring`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tostring_tooltip`))}},a.forBlock.convert_tostring=function(e){return[`('' + ${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_type=``,r.convert_type={init:function(){this.appendValueInput(`ITEM`).appendField(u(`convert_type`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_type_tooltip`))}},a.forBlock.convert_type=function(e){return[`typeof ${a.valueToCode(e,`ITEM`,i.ATOMIC)}`,i.ATOMIC]},l.Convert.blocks.convert_to_date=``,r.convert_to_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_to_date`)),this.setOutput(!0,`Date`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_to_date_tooltip`))}},a.forBlock.convert_to_date=function(e){return[`getDateObject(${a.valueToCode(e,`VALUE`,i.ATOMIC)}).getTime()`,i.ATOMIC]},l.Convert.blocks.convert_from_date=` object`,r.convert_from_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_from_date`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdts`||e===`wdt`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_from_date_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`),n=e.getAttribute(`language`);this.updateShape_(t===`true`||t===`TRUE`,n===`true`||n===`TRUE`)},updateShape_:function(n,r){if(n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r){if(!this.getInput(`LANGUAGE`)){let t=o();this.appendDummyInput(`LANGUAGE`).appendField(new e(t),`LANGUAGE`)}}else this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.convert_from_date=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),o=a.valueToCode(e,`VALUE`,i.ATOMIC),c;return c=t===`object`?`getDateObject(${o}).getTime()`:t===`ms`?`getDateObject(${o}).getMilliseconds()`:t===`s`?`getDateObject(${o}).getSeconds()`:t===`sid`?`(() => { const v = getDateObject(${o}); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`getDateObject(${o}).getMinutes()`:t===`mid`?`(() => { const v = getDateObject(${o}); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`getDateObject(${o}).getHours()`:t===`d`?`getDateObject(${o}).getDate()`:t===`M`?`(getDateObject(${o}).getMonth() + 1)`:t===`Mt`?`formatDate(getDateObject(${o}), 'OO', '${r}')`:t===`Mts`?`formatDate(getDateObject(${o}), 'O', '${r}')`:t===`y`?`getDateObject(${o}).getYear()`:t===`fy`?`getDateObject(${o}).getFullYear()`:t===`wdt`?`formatDate(getDateObject(${o}), 'WW', '${r}')`:t===`wdts`?`formatDate(getDateObject(${o}), 'W', '${r}')`:t===`wd`?`(() => { const d = getDateObject(${o}).getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(getDateObject(${o}))`:t===`custom`?`formatDate(getDateObject(${o}), ${s(n)})`:`formatDate(getDateObject(${o}), ${s(t)})`,[c,i.ATOMIC]},l.Convert.blocks.convert_time_difference=` hh:mm:ss `,r.convert_time_difference={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_time_difference`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e([[u(`time_difference_hh:mm:ss`),`hh:mm:ss`],[u(`time_difference_h:m:s`),`h:m:s`],[u(`time_difference_hh:mm`),`hh:mm`],[u(`time_difference_h:m`),`h:m`],[u(`time_difference_mm:ss`),`mm:ss`],[u(`time_difference_m:s`),`m:s`],[u(`time_difference_custom`),`custom`]],function(e){this.getSourceBlock().updateShape_(e===`custom`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_time_difference_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`);this.updateShape_(t===`true`||t===`TRUE`)},updateShape_:function(e){e?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_difference_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`)}},a.forBlock.convert_time_difference=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`);return[`formatTimeDiff(${a.valueToCode(e,`VALUE`,i.ATOMIC)||`0`}, ${s(t===`custom`?n:t)})`,i.ATOMIC]},l.Convert.blocks.convert_json2object=``,r.convert_json2object={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_json2object`)),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_json2object_tooltip`))}},a.forBlock.convert_json2object=function(e){return[`(() => { try { return JSON.parse(${a.valueToCode(e,`VALUE`,i.ATOMIC)}); } catch (e) { return {}; }})()`,i.ATOMIC]},l.Convert.blocks.convert_object2json=` FALSE`,r.convert_object2json={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_object2json`)),this.appendDummyInput(`PRETTIFY`).appendField(u(`convert_object2json_prettify`)).appendField(new n(`FALSE`),`PRETTIFY`),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_object2json_tooltip`))}},a.forBlock.convert_object2json=function(e){let t=a.valueToCode(e,`VALUE`,i.ATOMIC),n=e.getFieldValue(`PRETTIFY`);return[`JSON.stringify(${t}${n===`TRUE`||n===`true`||n===!0?`, null, 2`:``})`,i.ATOMIC]},l.Convert.blocks.convert_jsonata=` * `,r.convert_jsonata={init:function(){this.appendValueInput(`EXPRESSION`).appendField(u(`convert_jsonata`)),this.appendValueInput(`TARGET`).appendField(u(`convert_jsonata_target`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_jsonata_tooltip`))}},a.forBlock.convert_jsonata=function(e){let t=a.valueToCode(e,`EXPRESSION`,i.ATOMIC),n=a.valueToCode(e,`TARGET`,i.ATOMIC);return n||=`{}`,[`(await jsonataExpression(${n}, ${t}))`,i.ATOMIC]}}export{l as install}; \ No newline at end of file +})()`,i.ATOMIC]},l.Convert.blocks.convert_tostring=``,r.convert_tostring={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_tostring`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_tostring_tooltip`))}},a.forBlock.convert_tostring=function(e){return[`('' + ${a.valueToCode(e,`VALUE`,i.ATOMIC)})`,i.ATOMIC]},l.Convert.blocks.convert_type=``,r.convert_type={init:function(){this.appendValueInput(`ITEM`).appendField(u(`convert_type`)),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_type_tooltip`))}},a.forBlock.convert_type=function(e){return[`typeof ${a.valueToCode(e,`ITEM`,i.ATOMIC)}`,i.ATOMIC]},l.Convert.blocks.convert_to_date=``,r.convert_to_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_to_date`)),this.setOutput(!0,`Date`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_to_date_tooltip`))}},a.forBlock.convert_to_date=function(e){return[`getDateObject(${a.valueToCode(e,`VALUE`,i.ATOMIC)}).getTime()`,i.ATOMIC]},l.Convert.blocks.convert_from_date=` object`,r.convert_from_date={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_from_date`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdts`||e===`wdt`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_from_date_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`),n=e.getAttribute(`language`);this.updateShape_(t===`true`||t===`TRUE`,n===`true`||n===`TRUE`)},updateShape_:function(n,r){if(n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r){if(!this.getInput(`LANGUAGE`)){let t=s();this.appendDummyInput(`LANGUAGE`).appendField(new e(t),`LANGUAGE`)}}else this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.convert_from_date=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),s=a.valueToCode(e,`VALUE`,i.ATOMIC),c;return c=t===`object`?`getDateObject(${s}).getTime()`:t===`ms`?`getDateObject(${s}).getMilliseconds()`:t===`s`?`getDateObject(${s}).getSeconds()`:t===`sid`?`(() => { const v = getDateObject(${s}); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`getDateObject(${s}).getMinutes()`:t===`mid`?`(() => { const v = getDateObject(${s}); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`getDateObject(${s}).getHours()`:t===`d`?`getDateObject(${s}).getDate()`:t===`M`?`(getDateObject(${s}).getMonth() + 1)`:t===`Mt`?`formatDate(getDateObject(${s}), 'OO', '${r}')`:t===`Mts`?`formatDate(getDateObject(${s}), 'O', '${r}')`:t===`y`?`getDateObject(${s}).getYear()`:t===`fy`?`getDateObject(${s}).getFullYear()`:t===`wdt`?`formatDate(getDateObject(${s}), 'WW', '${r}')`:t===`wdts`?`formatDate(getDateObject(${s}), 'W', '${r}')`:t===`wd`?`(() => { const d = getDateObject(${s}).getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(getDateObject(${s}))`:t===`custom`?`formatDate(getDateObject(${s}), ${o(n)})`:`formatDate(getDateObject(${s}), ${o(t)})`,[c,i.ATOMIC]},l.Convert.blocks.convert_time_difference=` hh:mm:ss `,r.convert_time_difference={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_time_difference`)),this.appendDummyInput(`OPTION`).appendField(u(`convert_to`)).appendField(new e([[u(`time_difference_hh:mm:ss`),`hh:mm:ss`],[u(`time_difference_h:m:s`),`h:m:s`],[u(`time_difference_hh:mm`),`hh:mm`],[u(`time_difference_h:m`),`h:m`],[u(`time_difference_mm:ss`),`mm:ss`],[u(`time_difference_m:s`),`m:s`],[u(`time_difference_custom`),`custom`]],function(e){this.getSourceBlock().updateShape_(e===`custom`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_time_difference_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e},domToMutation:function(e){let t=e.getAttribute(`format`);this.updateShape_(t===`true`||t===`TRUE`)},updateShape_:function(e){e?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(u(`time_difference_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`)}},a.forBlock.convert_time_difference=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`);return[`formatTimeDiff(${a.valueToCode(e,`VALUE`,i.ATOMIC)||`0`}, ${o(t===`custom`?n:t)})`,i.ATOMIC]},l.Convert.blocks.convert_json2object=``,r.convert_json2object={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_json2object`)),this.setOutput(!0),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_json2object_tooltip`))}},a.forBlock.convert_json2object=function(e){return[`(() => { try { return JSON.parse(${a.valueToCode(e,`VALUE`,i.ATOMIC)}); } catch (e) { return {}; }})()`,i.ATOMIC]},l.Convert.blocks.convert_object2json=` FALSE`,r.convert_object2json={init:function(){this.appendValueInput(`VALUE`).appendField(u(`convert_object2json`)),this.appendDummyInput(`PRETTIFY`).appendField(u(`convert_object2json_prettify`)).appendField(new n(`FALSE`),`PRETTIFY`),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_object2json_tooltip`))}},a.forBlock.convert_object2json=function(e){let t=a.valueToCode(e,`VALUE`,i.ATOMIC),n=e.getFieldValue(`PRETTIFY`);return[`JSON.stringify(${t}${n===`TRUE`||n===`true`||n===!0?`, null, 2`:``})`,i.ATOMIC]},l.Convert.blocks.convert_jsonata=` * `,r.convert_jsonata={init:function(){this.appendValueInput(`EXPRESSION`).appendField(u(`convert_jsonata`)),this.appendValueInput(`TARGET`).appendField(u(`convert_jsonata_target`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(l.Convert.HUE),this.setTooltip(u(`convert_jsonata_tooltip`))}},a.forBlock.convert_jsonata=function(e){let t=a.valueToCode(e,`EXPRESSION`,i.ATOMIC),n=a.valueToCode(e,`TARGET`,i.ATOMIC);return n||=`{}`,[`(await jsonataExpression(${n}, ${t}))`,i.ATOMIC]}}export{l as install}; \ No newline at end of file diff --git a/admin/assets/blocks_logic-CDtLDgvr.js b/admin/assets/blocks_logic-Cyd7_0kb.js similarity index 96% rename from admin/assets/blocks_logic-CDtLDgvr.js rename to admin/assets/blocks_logic-Cyd7_0kb.js index 0d8eda01..8d6e1eaf 100644 --- a/admin/assets/blocks_logic-CDtLDgvr.js +++ b/admin/assets/blocks_logic-Cyd7_0kb.js @@ -1 +1 @@ -import{f as e,i as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";import{c as o}from"./helpers-BPUU5RuQ.js";function s(t,s,c,l,u){let d=window.Blockly.Translate,f=`${t}_container`,p=`${t}_mutator`;r[f]={init:function(){this.appendDummyInput().appendField(d(t)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[p]={init:function(){this.appendDummyInput(s).appendField(d(c)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[t]={init:function(){this.itemCount_=2,this.setMutator(new e.MutatorIcon([p],this)),this.setInputsInline(!1),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(f);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t0&&t.appendField(d(c))}for(let e=this.itemCount_;this.getInput(`${s}${e}`);e++)this.removeInput(`${s}${e}`)}},a.forBlock[t]=function(e){let t=e,n=[];for(let r=0;r0?n.join(l):`false`}`,u]}}function c(){let e=window.Blockly.Translate;s(`logic_multi_and`,`AND`,`logic_multi_and_and`,` && `,i.LOGICAL_AND),s(`logic_multi_or`,`OR`,`logic_multi_or_or`,` || `,i.LOGICAL_OR),r.logic_between={init:function(){this.appendValueInput(`MIN`).setCheck(`Number`),this.appendValueInput(`VALUE`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MIN_OPERATOR`),this.appendValueInput(`MAX`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MAX_OPERATOR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_between_tooltip`))}},a.forBlock.logic_between=function(e){let t=a.valueToCode(e,`MIN`,i.RELATIONAL)||0,n=a.valueToCode(e,`VALUE`,i.RELATIONAL)||0,r=a.valueToCode(e,`MAX`,i.RELATIONAL)||0;return[`${t} ${e.getFieldValue(`MIN_OPERATOR`)===`LT`?`<`:`<=`} ${n} && ${n} ${e.getFieldValue(`MAX_OPERATOR`)===`LT`?`<`:`<=`} ${r}`,i.LOGICAL_AND]},r.logic_ifempty={init:function(){this.appendValueInput(`VALUE`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty`)),this.appendValueInput(`DEFLT`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty_then`)),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_ifempty_tooltip`))}},a.forBlock.logic_ifempty=function(e){return[`${a.valueToCode(e,`VALUE`,i.LOGICAL_OR)||null} || ${a.valueToCode(e,`DEFLT`,i.LOGICAL_OR)||null}`,i.LOGICAL_OR]}}export{c as install}; \ No newline at end of file +import{f as e,i as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{l as o}from"./helpers-n7EZ1fEP.js";function s(t,s,c,l,u){let d=window.Blockly.Translate,f=`${t}_container`,p=`${t}_mutator`;r[f]={init:function(){this.appendDummyInput().appendField(d(t)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[p]={init:function(){this.appendDummyInput(s).appendField(d(c)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`)),this.contextMenu=!1}},r[t]={init:function(){this.itemCount_=2,this.setMutator(new e.MutatorIcon([p],this)),this.setInputsInline(!1),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(d(`${t}_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(f);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t0&&t.appendField(d(c))}for(let e=this.itemCount_;this.getInput(`${s}${e}`);e++)this.removeInput(`${s}${e}`)}},a.forBlock[t]=function(e){let t=e,n=[];for(let r=0;r0?n.join(l):`false`}`,u]}}function c(){let e=window.Blockly.Translate;s(`logic_multi_and`,`AND`,`logic_multi_and_and`,` && `,i.LOGICAL_AND),s(`logic_multi_or`,`OR`,`logic_multi_or_or`,` || `,i.LOGICAL_OR),r.logic_between={init:function(){this.appendValueInput(`MIN`).setCheck(`Number`),this.appendValueInput(`VALUE`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MIN_OPERATOR`),this.appendValueInput(`MAX`).setCheck(`Number`).appendField(new t([[`<`,`LT`],[`≤`,`LE`]]),`MAX_OPERATOR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_between_tooltip`))}},a.forBlock.logic_between=function(e){let t=a.valueToCode(e,`MIN`,i.RELATIONAL)||0,n=a.valueToCode(e,`VALUE`,i.RELATIONAL)||0,r=a.valueToCode(e,`MAX`,i.RELATIONAL)||0;return[`${t} ${e.getFieldValue(`MIN_OPERATOR`)===`LT`?`<`:`<=`} ${n} && ${n} ${e.getFieldValue(`MAX_OPERATOR`)===`LT`?`<`:`<=`} ${r}`,i.LOGICAL_AND]},r.logic_ifempty={init:function(){this.appendValueInput(`VALUE`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty`)),this.appendValueInput(`DEFLT`).setCheck(null).setAlign(n.Align.RIGHT).appendField(e(`logic_ifempty_then`)),this.setInputsInline(!0),this.setOutput(!0,null),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(e(`logic_ifempty_tooltip`))}},a.forBlock.logic_ifempty=function(e){return[`${a.valueToCode(e,`VALUE`,i.LOGICAL_OR)||null} || ${a.valueToCode(e,`DEFLT`,i.LOGICAL_OR)||null}`,i.LOGICAL_OR]}}export{c as install}; \ No newline at end of file diff --git a/admin/assets/blocks_number-Dtveo3bM.js b/admin/assets/blocks_number-lMRwWLtK.js similarity index 90% rename from admin/assets/blocks_number-Dtveo3bM.js rename to admin/assets/blocks_number-lMRwWLtK.js index f8dfca43..a042aab8 100644 --- a/admin/assets/blocks_number-Dtveo3bM.js +++ b/admin/assets/blocks_number-lMRwWLtK.js @@ -1 +1 @@ -import{a as e,s as t,t as n}from"./blockly-DBw-ytY1.js";import{c as r,l as i}from"./index-sJ01GB6X.js";function a(){let a=window.Blockly.Translate;n.math_rndfixed={init:function(){this.appendValueInput(`x`).setCheck(`Number`).appendField(a(`math_rndfixed_round`)),this.appendDummyInput().appendField(a(`math_rndfixed_to`)).appendField(new e(0,1,25),`n`).appendField(a(`math_rndfixed_decplcs`)),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(t.MATH_HUE),this.setTooltip(a(`math_rndfixed_tooltip`))}},i.forBlock.math_rndfixed=function(e){let t=i.valueToCode(e,`x`,r.ATOMIC),n=10**Number(e.getFieldValue(`n`));return[`Math.round(${t} * ${n}) / ${n}`,r.ATOMIC]}}export{a as install}; \ No newline at end of file +import{a as e,s as t,t as n}from"./blockly-DBw-ytY1.js";import{c as r,l as i}from"./index-DlFpMLlN.js";function a(){let a=window.Blockly.Translate;n.math_rndfixed={init:function(){this.appendValueInput(`x`).setCheck(`Number`).appendField(a(`math_rndfixed_round`)),this.appendDummyInput().appendField(a(`math_rndfixed_to`)).appendField(new e(0,1,25),`n`).appendField(a(`math_rndfixed_decplcs`)),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(t.MATH_HUE),this.setTooltip(a(`math_rndfixed_tooltip`))}},i.forBlock.math_rndfixed=function(e){let t=i.valueToCode(e,`x`,r.ATOMIC),n=10**Number(e.getFieldValue(`n`));return[`Math.round(${t} * ${n}) / ${n}`,r.ATOMIC]}}export{a as install}; \ No newline at end of file diff --git a/admin/assets/blocks_object-B6SUr8HP.js b/admin/assets/blocks_object-B6SUr8HP.js deleted file mode 100644 index 27259d5b..00000000 --- a/admin/assets/blocks_object-B6SUr8HP.js +++ /dev/null @@ -1 +0,0 @@ -import{f as e,o as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";import{c as o,s}from"./helpers-BPUU5RuQ.js";function c(){let c=window.Blockly,l=c.Translate;c.CustomBlocks=c.CustomBlocks||[],c.CustomBlocks.push(`Object`),c.Object={HUE:40,blocks:{}},c.Object.blocks.object_new=``,r.object_new_container={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput().appendField(l(`object_new_attributes`)),this.appendStatementInput(`STACK`),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new_mutator={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput(`ATTR`).appendField(l(`object_new_attribute`)).appendField(new t(`attribute1`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new={init:function(){this.appendDummyInput(`NAME`).appendField(l(`object_new`)),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`object_new_mutator`],this)),this.setInputsInline(!1),this.setOutput(!0),this.setColour(c.Object.HUE),this.setTooltip(l(`object_new_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);for(let t=0;t{var n;if(!((n=t.connection)!=null&&n.isConnected())){let n=e.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(t.connection)}},100,r)}for(let e=this.itemCount_;this.getInput(`ATTR_${e}`);e++)this.removeInput(`ATTR_${e}`)}},a.forBlock.object_new=function(e){let t=e,n=[];for(let r=0;r attribute1 value `,r.object_set_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_set_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_set_attr_object`)),this.appendValueInput(`VALUE`).setCheck(null).appendField(l(`object_set_attr_value`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_set_attr_tooltip`))}},a.forBlock.object_set_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`VALUE`,i.ATOMIC),r=a.valueToCode(e,`OBJECT`,i.ATOMIC);return r||=`{}`,`((obj) => { if (typeof obj === 'object') { obj[${s(t)}] = ${n}; } })(${r});\n`},c.Object.blocks.object_del_attr=` attribute1`,r.object_del_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_del_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_del_attr_object`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_del_attr_tooltip`))}},a.forBlock.object_del_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`OBJECT`,i.ATOMIC);return n||=`{}`,`((obj) => { if (typeof obj === 'object') { delete obj[${s(t)}]; } })(${n});\n`},c.Object.blocks.object_has_attr=` attribute1 Object ID `,r.object_has_attr={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_has_attr`)),this.appendDummyInput(`ATTR`).appendField(l(`object_has_attr_attr`)).appendField(new t(`attribute1`),`ATTR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_has_attr_tooltip`))}},a.forBlock.object_has_attr=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC),n=e.getFieldValue(`ATTR`);return[`Object.prototype.hasOwnProperty.call(${t}, ${s(n)})`,i.ATOMIC]},c.Object.blocks.object_keys=` Object ID `,r.object_keys={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_keys`)),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_keys_tooltip`))}},a.forBlock.object_keys=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC);return t||=`{}`,[`Object.keys(${t})`,i.ATOMIC]}}export{c as install}; \ No newline at end of file diff --git a/admin/assets/blocks_object-DCupwas8.js b/admin/assets/blocks_object-DCupwas8.js new file mode 100644 index 00000000..060160e0 --- /dev/null +++ b/admin/assets/blocks_object-DCupwas8.js @@ -0,0 +1 @@ +import{f as e,o as t,p as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{c as o,l as s}from"./helpers-n7EZ1fEP.js";function c(){let c=window.Blockly,l=c.Translate;c.CustomBlocks=c.CustomBlocks||[],c.CustomBlocks.push(`Object`),c.Object={HUE:40,blocks:{}},c.Object.blocks.object_new=``,r.object_new_container={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput().appendField(l(`object_new_attributes`)),this.appendStatementInput(`STACK`),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new_mutator={init:function(){this.setColour(c.Object.HUE),this.appendDummyInput(`ATTR`).appendField(l(`object_new_attribute`)).appendField(new t(`attribute1`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setTooltip(l(`object_new_tooltip`)),this.contextMenu=!1}},r.object_new={init:function(){this.appendDummyInput(`NAME`).appendField(l(`object_new`)),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`object_new_mutator`],this)),this.setInputsInline(!1),this.setOutput(!0),this.setColour(c.Object.HUE),this.setTooltip(l(`object_new_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);for(let t=0;t{var n;if(!((n=t.connection)!=null&&n.isConnected())){let n=e.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(t.connection)}},100,r)}for(let e=this.itemCount_;this.getInput(`ATTR_${e}`);e++)this.removeInput(`ATTR_${e}`)}},a.forBlock.object_new=function(e){let t=e,n=[];for(let r=0;r attribute1 value `,r.object_set_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_set_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_set_attr_object`)),this.appendValueInput(`VALUE`).setCheck(null).appendField(l(`object_set_attr_value`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_set_attr_tooltip`))}},a.forBlock.object_set_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`VALUE`,i.ATOMIC),r=a.valueToCode(e,`OBJECT`,i.ATOMIC);return r||=`{}`,`((obj) => { if (typeof obj === 'object') { obj[${o(t)}] = ${n}; } })(${r});\n`},c.Object.blocks.object_del_attr=` attribute1`,r.object_del_attr={init:function(){this.appendDummyInput(`ATTR`).appendField(l(`object_del_attr`)).appendField(new t(`attribute1`),`ATTR`),this.appendValueInput(`OBJECT`).appendField(l(`object_del_attr_object`)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(c.Object.HUE),this.setTooltip(l(`object_del_attr_tooltip`))}},a.forBlock.object_del_attr=function(e){let t=e.getFieldValue(`ATTR`),n=a.valueToCode(e,`OBJECT`,i.ATOMIC);return n||=`{}`,`((obj) => { if (typeof obj === 'object') { delete obj[${o(t)}]; } })(${n});\n`},c.Object.blocks.object_has_attr=` attribute1 Object ID `,r.object_has_attr={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_has_attr`)),this.appendDummyInput(`ATTR`).appendField(l(`object_has_attr_attr`)).appendField(new t(`attribute1`),`ATTR`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_has_attr_tooltip`))}},a.forBlock.object_has_attr=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC),n=e.getFieldValue(`ATTR`);return[`Object.prototype.hasOwnProperty.call(${t}, ${o(n)})`,i.ATOMIC]},c.Object.blocks.object_keys=` Object ID `,r.object_keys={init:function(){this.appendValueInput(`OBJECT`).appendField(l(`object_keys`)),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(c.Object.HUE),this.setTooltip(l(`object_keys_tooltip`))}},a.forBlock.object_keys=function(e){let t=a.valueToCode(e,`OBJECT`,i.ATOMIC);return t||=`{}`,[`Object.keys(${t})`,i.ATOMIC]}}export{c as install}; \ No newline at end of file diff --git a/admin/assets/blocks_procedures-DkNQY-Dy.js b/admin/assets/blocks_procedures-Cxfr0wu8.js similarity index 58% rename from admin/assets/blocks_procedures-DkNQY-Dy.js rename to admin/assets/blocks_procedures-Cxfr0wu8.js index 910d869b..bc66a349 100644 --- a/admin/assets/blocks_procedures-DkNQY-Dy.js +++ b/admin/assets/blocks_procedures-Cxfr0wu8.js @@ -1,3 +1,3 @@ -import{f as e,h as t,l as n,o as r,s as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-sJ01GB6X.js";import{FieldScript as c,b64DecodeUnicode as l}from"./field_script-4IGidWJ7.js";function u(e){return a[e]}function d(){let d=window.Blockly,f=d.Translate,p=t.xml,m=u(`procedures_ifreturn`);m.FUNCTION_TYPES.includes(`procedures_defcustomreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomreturn`),m.FUNCTION_TYPES.includes(`procedures_defcustomnoreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomnoreturn`),d.Procedures.allProceduresNew=function(e){let t=n.allProcedures(e),r=()=>e.getProcedureMap().getProcedures().filter(e=>!!e.getReturnTypes()).map(e=>[e.getName(),e.getParameters().map(e=>e.getName()),!0]),i=t=>{let i=r();return e.getBlocksByType(t,!1).forEach(e=>{n.isProcedureBlock(e)||i.push(e.getProcedureDef())}),i};return t.concat([i(`procedures_defcustomnoreturn`),i(`procedures_defcustomreturn`)])},d.Procedures.flyoutCategoryNew=function(e){let t=[],n=(e,n)=>{if(!a[e])return;let r=p.createElement(`block`);r.setAttribute(`type`,e),r.setAttribute(`gap`,`16`);let o=p.createElement(`field`);o.setAttribute(`name`,`NAME`),o.appendChild(p.createTextNode(i[n])),r.appendChild(o),t.push(r)},r=e=>{if(!a[e])return;let n=p.createElement(`block`);n.setAttribute(`type`,e),n.setAttribute(`gap`,`16`),t.push(n)};n(`procedures_defnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),r(`procedures_ifreturn`),r(`procedures_return`),n(`procedures_defcustomnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defcustomreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),t.length&&t[t.length-1].setAttribute(`gap`,`24`);let o=(e,n)=>{for(let[r,i]of e){let e=p.createElement(`block`);e.setAttribute(`type`,n),e.setAttribute(`gap`,`16`);let a=p.createElement(`mutation`);a.setAttribute(`name`,r),e.appendChild(a);for(let e of i){let t=p.createElement(`arg`);t.setAttribute(`name`,e),a.appendChild(t)}t.push(e)}},s=d.Procedures.allProceduresNew(e);return o(s[0],`procedures_callnoreturn`),o(s[1],`procedures_callreturn`),o(s[2],`procedures_callcustomnoreturn`),o(s[3],`procedures_callcustomreturn`),t},s.forBlock.procedures_defreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=``;t.STATEMENT_PREFIX&&(i+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(i+=t.injectId(t.STATEMENT_SUFFIX,e)),i&&=t.prefixLines(i,t.INDENT);let a=``;t.INFINITE_LOOP_TRAP&&(a=t.prefixLines(t.injectId(t.INFINITE_LOOP_TRAP,e),t.INDENT));let c=``,l=``,u=t.statementToCode(e,`STACK`);e.getInput(`RETURN`)&&(c=t.valueToCode(e,`RETURN`,o.NONE)||``,u&&c&&(l=i),c&&=`${t.INDENT}return ${c};\n`);let d=`async function ${r}(${e.getVarModels().map(e=>t.nameDB_.getName(e.name,`VARIABLE`)).join(`, `)}) {\n${i}${a}${u}${l}${c}}`;return d=t.scrub_(e,d),t.definitions_[`%${r}`]=d,null},s.forBlock.procedures_defnoreturn=s.forBlock.procedures_defreturn,s.forBlock.procedures_callreturn=function(e){let t=s;return[`await ${t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME)}(${e.getVarModels().map((n,r)=>t.valueToCode(e,`ARG${r}`,o.NONE)||`null`).join(`, `)})`,o.FUNCTION_CALL]};let h=t=>{let o=t?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`,s=u(t?`procedures_defreturn`:`procedures_defnoreturn`),l=t?`procedures_defcustomreturn_name`:`procedures_defcustomnoreturn_name`,d=t?`PROCEDURES_DEFRETURN`:`PROCEDURES_DEFNORETURN`;a[o]={getProcedureModel(){return this.model},isProcedureDef(){return!0},init:function(){var a;let o=new r(``,n.rename);o.setSpellcheck(!1),this.appendDummyInput().appendField(f(l)).appendField(o,`NAME`).appendField(``,`PARAMS`),this.setMutator(new e.MutatorIcon([`procedures_mutatorarg`],this));let s=this.workspace.options;(s.comments||(a=s.parentWorkspace)!=null&&a.options.comments)&&i[`${d}_COMMENT`]&&this.setCommentText(i[`${d}_COMMENT`]),this.setStyle(`procedure_blocks`),t||this.setColour(i.PROCEDURES_HUE),this.setTooltip(i[`${d}_TOOLTIP`]),this.setHelpUrl(i[`${d}_HELPURL`]),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null,this.appendDummyInput(`SCRIPT`).appendField(new c(t?btoa(`return 0;`):``),`SCRIPT`),this.setInputsInline(!0),this.setStatements_(!1)},setStatements_:s.setStatements_,updateParams_:s.updateParams_,mutationToDom:s.mutationToDom,domToMutation:s.domToMutation,decompose:function(e){var t,r;let i=e.newBlock(`procedures_mutatorcontainer`);i.initSvg(),(t=i.getInput(`STATEMENT_INPUT`))==null||t.setVisible(!1);let a=(r=i.getInput(`STACK`))==null?void 0:r.connection;for(let t=0;t{let t=e?`procedures_callcustomreturn`:`procedures_callcustomnoreturn`,n=u(e?`procedures_callreturn`:`procedures_callnoreturn`);a[t]={init:n.init,getProcedureCall:n.getProcedureCall,renameProcedure:n.renameProcedure,setProcedureParameters_:n.setProcedureParameters_,updateShape_:n.updateShape_,mutationToDom:n.mutationToDom,domToMutation:n.domToMutation,getVarModels:n.getVarModels,onchange:n.onchange,customContextMenu:n.customContextMenu,defType_:e?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`}};h(!0),s.forBlock.procedures_defcustomreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=e.arguments_.map(e=>t.nameDB_.getName(e,`VARIABLE`)),a=l(e.getFieldValue(`SCRIPT`)||``).split(` +import{f as e,h as t,l as n,o as r,s as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-DlFpMLlN.js";import{FieldScript as c,b64DecodeUnicode as l}from"./field_script-4IGidWJ7.js";function u(e){return a[e]}function d(){let d=window.Blockly,f=d.Translate,p=t.xml,m=u(`procedures_ifreturn`);m.FUNCTION_TYPES.includes(`procedures_defcustomreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomreturn`),m.FUNCTION_TYPES.includes(`procedures_defcustomnoreturn`)||m.FUNCTION_TYPES.push(`procedures_defcustomnoreturn`),d.Procedures.allProceduresNew=function(e){let t=n.allProcedures(e),r=()=>e.getProcedureMap().getProcedures().filter(e=>!!e.getReturnTypes()).map(e=>[e.getName(),e.getParameters().map(e=>e.getName()),!0]),i=t=>{let i=r();return e.getBlocksByType(t,!1).forEach(e=>{n.isProcedureBlock(e)||i.push(e.getProcedureDef())}),i};return t.concat([i(`procedures_defcustomnoreturn`),i(`procedures_defcustomreturn`)])},d.Procedures.flyoutCategoryNew=function(e){let t=[],n=(e,n)=>{if(!a[e])return;let r=p.createElement(`block`);r.setAttribute(`type`,e),r.setAttribute(`gap`,`16`);let o=p.createElement(`field`);o.setAttribute(`name`,`NAME`),o.appendChild(p.createTextNode(i[n])),r.appendChild(o),t.push(r)},r=e=>{if(!a[e])return;let n=p.createElement(`block`);n.setAttribute(`type`,e),n.setAttribute(`gap`,`16`),t.push(n)};n(`procedures_defnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),r(`procedures_ifreturn`),r(`procedures_return`),n(`procedures_defcustomnoreturn`,`PROCEDURES_DEFNORETURN_PROCEDURE`),n(`procedures_defcustomreturn`,`PROCEDURES_DEFRETURN_PROCEDURE`),t.length&&t[t.length-1].setAttribute(`gap`,`24`);let o=(e,n)=>{for(let[r,i]of e){let e=p.createElement(`block`);e.setAttribute(`type`,n),e.setAttribute(`gap`,`16`);let a=p.createElement(`mutation`);a.setAttribute(`name`,r),e.appendChild(a);for(let e of i){let t=p.createElement(`arg`);t.setAttribute(`name`,e),a.appendChild(t)}t.push(e)}},s=d.Procedures.allProceduresNew(e);return o(s[0],`procedures_callnoreturn`),o(s[1],`procedures_callreturn`),o(s[2],`procedures_callcustomnoreturn`),o(s[3],`procedures_callcustomreturn`),t},s.forBlock.procedures_defreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=``;t.STATEMENT_PREFIX&&(i+=t.injectId(t.STATEMENT_PREFIX,e)),t.STATEMENT_SUFFIX&&(i+=t.injectId(t.STATEMENT_SUFFIX,e)),i&&=t.prefixLines(i,t.INDENT);let a=``;t.INFINITE_LOOP_TRAP&&(a=t.prefixLines(t.injectId(t.INFINITE_LOOP_TRAP,e),t.INDENT));let c=``,l=``,u=e.getInput(`STACK`)?t.statementToCode(e,`STACK`):``;e.getInput(`RETURN`)&&(c=t.valueToCode(e,`RETURN`,o.NONE)||``,u&&c&&(l=i),c&&=`${t.INDENT}return ${c};\n`);let d=`async function ${r}(${e.getVarModels().map(e=>t.nameDB_.getName(e.name,`VARIABLE`)).join(`, `)}) {\n${i}${a}${u}${l}${c}}`;return d=t.scrub_(e,d),t.definitions_[`%${r}`]=d,null},s.forBlock.procedures_defnoreturn=s.forBlock.procedures_defreturn,s.forBlock.procedures_callreturn=function(e){let t=s;return[`await ${t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME)}(${e.getVarModels().map((n,r)=>t.valueToCode(e,`ARG${r}`,o.NONE)||`null`).join(`, `)})`,o.FUNCTION_CALL]};let h=t=>{let o=t?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`,s=u(t?`procedures_defreturn`:`procedures_defnoreturn`),l=t?`procedures_defcustomreturn_name`:`procedures_defcustomnoreturn_name`,d=t?`PROCEDURES_DEFRETURN`:`PROCEDURES_DEFNORETURN`;a[o]={getProcedureModel(){return this.model},isProcedureDef(){return!0},init:function(){var a;let o=new r(``,n.rename);o.setSpellcheck(!1),this.appendDummyInput().appendField(f(l)).appendField(o,`NAME`).appendField(``,`PARAMS`),this.setMutator(new e.MutatorIcon([`procedures_mutatorarg`],this));let s=this.workspace.options;(s.comments||(a=s.parentWorkspace)!=null&&a.options.comments)&&i[`${d}_COMMENT`]&&this.setCommentText(i[`${d}_COMMENT`]),this.setStyle(`procedure_blocks`),t||this.setColour(i.PROCEDURES_HUE),this.setTooltip(i[`${d}_TOOLTIP`]),this.setHelpUrl(i[`${d}_HELPURL`]),this.arguments_=[],this.argumentVarModels_=[],this.setStatements_(!0),this.statementConnection_=null,this.appendDummyInput(`SCRIPT`).appendField(new c(t?btoa(`return 0;`):``),`SCRIPT`),this.setInputsInline(!0),this.setStatements_(!1)},setStatements_:s.setStatements_,updateParams_:s.updateParams_,mutationToDom:s.mutationToDom,domToMutation:s.domToMutation,decompose:function(e){var t,r;let i=e.newBlock(`procedures_mutatorcontainer`);i.initSvg(),(t=i.getInput(`STATEMENT_INPUT`))==null||t.setVisible(!1);let a=(r=i.getInput(`STACK`))==null?void 0:r.connection;for(let t=0;t{let t=e?`procedures_callcustomreturn`:`procedures_callcustomnoreturn`,n=u(e?`procedures_callreturn`:`procedures_callnoreturn`);a[t]={init:n.init,getProcedureCall:n.getProcedureCall,renameProcedure:n.renameProcedure,setProcedureParameters_:n.setProcedureParameters_,updateShape_:n.updateShape_,mutationToDom:n.mutationToDom,domToMutation:n.domToMutation,getVarModels:n.getVarModels,onchange:n.onchange,customContextMenu:n.customContextMenu,defType_:e?`procedures_defcustomreturn`:`procedures_defcustomnoreturn`}};h(!0),s.forBlock.procedures_defcustomreturn=function(e){let t=s,r=t.nameDB_.getName(e.getFieldValue(`NAME`),n.CATEGORY_NAME),i=e.arguments_.map(e=>t.nameDB_.getName(e,`VARIABLE`)),a=l(e.getFieldValue(`SCRIPT`)||``).split(` `).map(e=>` ${e}`),o=`async function ${r}(${i.join(`, `)}) {\n${a.join(` `)}\n}`;return o=t.scrub_(e,o),t.definitions_[`%${r}`]=o,null},g(!0),s.forBlock.procedures_callcustomreturn=s.forBlock.procedures_callreturn,u(`procedures_ifreturn`).init=function(){let e=this.appendValueInput(`CONDITION`).setCheck(`Boolean`).appendField(i.CONTROLS_IF_MSG_IF),t=this.workspace.newBlock(`logic_boolean`);t.setShadow(!0),t.setFieldValue(`TRUE`,`BOOL`),t.outputConnection.connect(e.connection),this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setTooltip(i.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(i.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},h(!1),a.procedures_defcustomnoreturn.decompose=a.procedures_defcustomreturn.decompose,a.procedures_defcustomnoreturn.compose=a.procedures_defcustomreturn.compose,s.forBlock.procedures_defcustomnoreturn=s.forBlock.procedures_defcustomreturn,g(!1),s.forBlock.procedures_callcustomnoreturn=function(e){return`${s.forBlock.procedures_callcustomreturn(e,s)[0]};\n`},a.procedures_return={init:function(){this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.setInputsInline(!0),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setStyle(`procedure_blocks`),this.setTooltip(i.PROCEDURES_IFRETURN_TOOLTIP),this.setHelpUrl(i.PROCEDURES_IFRETURN_HELPURL),this.hasReturnValue_=!0},mutationToDom:function(){let e=p.createElement(`mutation`);return e.setAttribute(`value`,String(Number(this.hasReturnValue_))),e},domToMutation:function(e){this.hasReturnValue_=e.getAttribute(`value`)===`1`,this.hasReturnValue_||(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN))},onchange:function(e){var t,n;if((t=(n=this.workspace).isDragging)!=null&&t.call(n)||e.type!==`move`&&e.type!==`create`)return;let r=!1,a=this;do{if(this.FUNCTION_TYPES.includes(a.type)){r=!0;break}a=a.getSurroundParent()}while(a);r?(a.type===`procedures_defnoreturn`&&this.hasReturnValue_?(this.removeInput(`VALUE`),this.appendDummyInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!1):a.type===`procedures_defreturn`&&!this.hasReturnValue_&&(this.removeInput(`VALUE`),this.appendValueInput(`VALUE`).appendField(i.PROCEDURES_DEFRETURN_RETURN),this.hasReturnValue_=!0),this.setWarningText(null)):this.setWarningText(i.PROCEDURES_IFRETURN_WARNING),this.isInFlyout||this.setDisabledReason(!r,`UNPARENTED_IFRETURN`)},FUNCTION_TYPES:[`procedures_defnoreturn`,`procedures_defreturn`,`procedures_defcustomreturn`,`procedures_defcustomnoreturn`]},s.forBlock.procedures_return=function(e,t){let n=``;if(t.STATEMENT_SUFFIX&&(n+=t.prefixLines(t.injectId(t.STATEMENT_SUFFIX,e),t.INDENT)),e.hasReturnValue_){let r=t.valueToCode(e,`VALUE`,o.NONE)||`null`;n+=`${t.INDENT}return ${r};\n`}else n+=`${t.INDENT}return;\n`;return n}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_sendto-CgDyguqB.js b/admin/assets/blocks_sendto-CbTqmkT5.js similarity index 80% rename from admin/assets/blocks_sendto-CgDyguqB.js rename to admin/assets/blocks_sendto-CbTqmkT5.js index 237ccf70..12655bf7 100644 --- a/admin/assets/blocks_sendto-CgDyguqB.js +++ b/admin/assets/blocks_sendto-CbTqmkT5.js @@ -1,5 +1,5 @@ -import{f as e,i as t,o as n,p as r,r as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-sJ01GB6X.js";import{c,i as l,o as u,r as d,s as f,u as p}from"./helpers-BPUU5RuQ.js";function m(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function h(){let h=window.Blockly,g=h.Translate,_=window.getHelp;h.CustomBlocks=h.CustomBlocks||[],h.CustomBlocks.push(`Sendto`),h.Sendto={HUE:310,blocks:{}};let v=()=>new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(d(e))});h.Sendto.blocks.sendto_custom=` admin.0 send FALSE `,a.sendto_custom_container={init:function(){this.appendDummyInput().appendField(g(`sendto_custom_arguments`)),this.appendStatementInput(`STACK`),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom_mutator={init:function(){this.appendDummyInput(`ATTR`).appendField(g(`sendto_custom_argument`)).appendField(new n(`parameter`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom={init:function(){var r;let i=[];if((r=window.main)!=null&&r.instances){for(let e of window.main.instances){var a;if((a=window.main.objects[e])!=null&&(a=a.common)!=null&&a.messagebox){let t=e.substring(15);i.push([t,t])}}i.length||i.push([g(`sendto_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new t(i),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new n(`adapter.0`),`INSTANCE`);this.appendDummyInput(`COMMAND`).appendField(g(`sendto_custom_command`)).appendField(new n(`send`),`COMMAND`),this.appendDummyInput(`LOG`).appendField(g(`loglevel`)).appendField(new t(l()),`LOG`),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`sendto_custom_mutator`],this)),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_tooltip`)),this.setHelpUrl(_(`sendto_custom_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,this.attributes_.map(e=>encodeURIComponent(e)).join(`,`)),e},domToMutation:function(e){this.attributes_=e.getAttribute(`items`).split(`,`).map(e=>decodeURIComponent(e)),this.itemCount_=this.attributes_.length,this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`sendto_custom_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t=1&&n.fieldRow[0].setValue(this.attributes_[e]):(n=this.appendValueInput(`ARG${e}`).setAlign(r.Align.RIGHT),n.appendField(this.attributes_[e])),setTimeout(e=>{var n;if(!((n=e.connection)!=null&&n.isConnected())){let n=t.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(e.connection)}},100,n)}for(let e=this.itemCount_;this.getInput(`ARG${e}`);e++)this.removeInput(`ARG${e}`);p(this,e)}},s.forBlock.sendto_custom=function(e){let t=e,n=e.getFieldValue(`INSTANCE`),r=e.getFieldValue(`LOG`),i=e.getFieldValue(`COMMAND`),a=``,c;d(e.getFieldValue(`WITH_STATEMENT`))&&(c=s.statementToCode(e,`STATEMENT`));let l=[];for(let u=0;u {\n${c}});\n${a}`:`sendTo('${n}', ${f(i)}, ${p});\n${a}`;l.push({attr:d.replace(/'/g,`\\'`),val:p})}let u=l.length?l.map(e=>s.prefixLines(`'${e.attr}': ${e.val},`,s.INDENT)).join(` -`):``;return r&&(a=`console.${r}('sendTo[custom] ${n}: ${l.length?l.map(e=>`${e.attr}: ' + ${e.val} + '`).join(`, `):`[no args]`}');\n`),c?`sendTo('${n}', ${f(i)}, {\n${u}\n}, async (result) => {\n${c}});\n${a}`:`sendTo('${n}', ${f(i)}, {\n${u}\n});\n${a}`},h.Sendto.blocks.sendto_otherscript=` 0 1000 ms customMessage FALSE Script Object ID `,a.sendto_otherscript={init:function(){var e;let r=[];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.javascript\.(\d+)$/);if(t){let e=parseInt(t[1],10);r.push([`javascript.${e}`,String(e)])}}if(!r.length)for(let e=0;e<=4;e++)r.push([`javascript.${e}`,String(e)]);this.appendDummyInput(`NAME`).appendField(`✉️ ${g(`sendto_otherscript_name`)}`),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_otherscript_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_otherscript_script`)).setCheck(null),this.appendDummyInput().appendField(g(`sendto_otherscript_timeout`)).appendField(new n(`1000`),`TIMEOUT`).appendField(new t([[g(`timeouts_settimeout_ms`),`ms`],[g(`timeouts_settimeout_sec`),`sec`],[g(`timeouts_settimeout_min`),`min`]]),`UNIT`),this.appendDummyInput(`MESSAGE`).appendField(g(`sendto_otherscript_message`)).appendField(new n(`customMessage`),`MESSAGE`),this.appendValueInput(`DATA`).appendField(g(`sendto_otherscript_data`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_otherscript_tooltip`)),this.setHelpUrl(_(`sendto_otherscript_help`))},updateShape_:function(e){p(this,e)}},s.forBlock.sendto_otherscript=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=e.getFieldValue(`MESSAGE`),i=m(e.getFieldValue(`TIMEOUT`),e.getFieldValue(`UNIT`)),a;d(e.getFieldValue(`WITH_STATEMENT`))&&(a=s.statementToCode(e,`STATEMENT`));let c=u(n),l=s.valueToCode(e,`DATA`,o.ATOMIC)||`true`,p=`{ instance: ${t}, script: ${n}${c?` /* ${c} */`:``}, message: ${f(r)} }`;return a?`messageTo(${p}, ${l}, { timeout: ${i} }, (result) => {\n${a}})\n`:`messageTo(${p}, ${l}, { timeout: ${i} });\n`},h.Sendto.blocks.sendto_gethistory=` default none 0 500 min dayStart dayEnd `,a.sendto_gethistory={init:function(){var e;let r=[[`default`,`default`]];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.(history|influxdb|sql)\.(\d+)$/);if(t){let e=`${t[1]}.${t[2]}`;r.push([e,e])}}this.appendDummyInput(`NAME`).appendField(g(`sendto_gethistory_name`)),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_gethistory_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_gethistory_oid`)).setCheck(null),this.appendValueInput(`START`).appendField(g(`sendto_gethistory_start`)).setCheck(null),this.appendValueInput(`END`).appendField(g(`sendto_gethistory_end`)).setCheck(null),this.appendDummyInput(`AGGREGATE`).appendField(g(`sendto_gethistory_aggregate`)).appendField(new t([[g(`sendto_gethistory_none`),`none`],[g(`sendto_gethistory_minimum`),`min`],[g(`sendto_gethistory_maximum`),`max`],[g(`sendto_gethistory_avg`),`average`],[g(`sendto_gethistory_cnt`),`count`]]),`AGGREGATE`),this.appendDummyInput(`UNIT`).appendField(g(`sendto_gethistory_step`)).appendField(new n(`0`),`STEP`).appendField(new t([[g(`sendto_gethistory_ms`),`ms`],[g(`sendto_gethistory_sec`),`sec`],[g(`sendto_gethistory_min`),`min`],[g(`sendto_gethistory_hour`),`hour`],[g(`sendto_gethistory_day`),`day`]]),`UNIT`),this.appendDummyInput(`COUNT`).appendField(g(`sendto_gethistory_count`)).appendField(new n(`0`),`COUNT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_gethistory_tooltip`)),this.setHelpUrl(_(`sendto_gethistory_help`))}},s.forBlock.sendto_gethistory=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=s.valueToCode(e,`START`,o.ATOMIC),i=s.valueToCode(e,`END`,o.ATOMIC),a=e.getFieldValue(`AGGREGATE`),c=e.getFieldValue(`UNIT`),l=parseInt(e.getFieldValue(`COUNT`),10),d=parseFloat(e.getFieldValue(`STEP`));c===`day`?d*=864e5:c===`hour`?d*=36e5:c===`min`?d*=6e4:c===`sec`&&(d*=1e3);let p=s.statementToCode(e,`STATEMENT`),m=u(n);return`getHistory(${t==="default"?``:`${f(t)}, `}{\n id: ${n}${m?` /* ${m} */`:``},\n start: ${r},\n end: ${i},\n`+(d>0&&a!==`none`?` step: ${d},\n`:``)+(d===0||a===`none`?` count: ${l},\n`:``)+` aggregate: '${a}',\n removeBorderValues: true,\n}, async (err, result) => {\n if (err) {\n console.error(err);\n`+(p?` } else { -`:``)+(p?s.prefixLines(p,s.INDENT):``)+` } +import{f as e,i as t,o as n,p as r,r as i,t as a}from"./blockly-DBw-ytY1.js";import{c as o,l as s}from"./index-DlFpMLlN.js";import{c,d as l,i as u,l as d,r as f,s as p}from"./helpers-n7EZ1fEP.js";function m(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function h(){let h=window.Blockly,g=h.Translate,_=window.getHelp;h.CustomBlocks=h.CustomBlocks||[],h.CustomBlocks.push(`Sendto`),h.Sendto={HUE:310,blocks:{}};let v=()=>new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(f(e))});h.Sendto.blocks.sendto_custom=` admin.0 send FALSE `,a.sendto_custom_container={init:function(){this.appendDummyInput().appendField(g(`sendto_custom_arguments`)),this.appendStatementInput(`STACK`),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom_mutator={init:function(){this.appendDummyInput(`ATTR`).appendField(g(`sendto_custom_argument`)).appendField(new n(`parameter`),`ATTR`),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_arg_tooltip`)),this.contextMenu=!1}},a.sendto_custom={init:function(){var r;let i=[];if((r=window.main)!=null&&r.instances){for(let e of window.main.instances){var a;if((a=window.main.objects[e])!=null&&(a=a.common)!=null&&a.messagebox){let t=e.substring(15);i.push([t,t])}}i.length||i.push([g(`sendto_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new t(i),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_custom`)).appendField(new n(`adapter.0`),`INSTANCE`);this.appendDummyInput(`COMMAND`).appendField(g(`sendto_custom_command`)).appendField(new n(`send`),`COMMAND`),this.appendDummyInput(`LOG`).appendField(g(`loglevel`)).appendField(new t(u()),`LOG`),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.attributes_=[],this.itemCount_=0,this.setMutator(new e.MutatorIcon([`sendto_custom_mutator`],this)),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_custom_tooltip`)),this.setHelpUrl(_(`sendto_custom_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,this.attributes_.map(e=>encodeURIComponent(e)).join(`,`)),e},domToMutation:function(e){this.attributes_=e.getAttribute(`items`).split(`,`).map(e=>decodeURIComponent(e)),this.itemCount_=this.attributes_.length,this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`sendto_custom_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t=1&&n.fieldRow[0].setValue(this.attributes_[e]):(n=this.appendValueInput(`ARG${e}`).setAlign(r.Align.RIGHT),n.appendField(this.attributes_[e])),setTimeout(e=>{var n;if(!((n=e.connection)!=null&&n.isConnected())){let n=t.newBlock(`text`);n.setShadow(!0),n.initSvg(),n.render(),n.outputConnection.connect(e.connection)}},100,n)}for(let e=this.itemCount_;this.getInput(`ARG${e}`);e++)this.removeInput(`ARG${e}`);l(this,e)}},s.forBlock.sendto_custom=function(e){let t=e,n=e.getFieldValue(`INSTANCE`),r=e.getFieldValue(`LOG`),i=e.getFieldValue(`COMMAND`),a=``,l;f(e.getFieldValue(`WITH_STATEMENT`))&&(l=s.statementToCode(e,`STATEMENT`));let u=[];for(let d=0;d {\n${l}});\n${a}`:`sendTo('${n}', ${c(i)}, ${p});\n${a}`;u.push({attr:f.replace(/'/g,`\\'`),val:p})}let d=u.length?u.map(e=>s.prefixLines(`'${e.attr}': ${e.val},`,s.INDENT)).join(` +`):``;return r&&(a=`console.${r}('sendTo[custom] ${n}: ${u.length?u.map(e=>`${e.attr}: ' + ${e.val} + '`).join(`, `):`[no args]`}');\n`),l?`sendTo('${n}', ${c(i)}, {\n${d}\n}, async (result) => {\n${l}});\n${a}`:`sendTo('${n}', ${c(i)}, {\n${d}\n});\n${a}`},h.Sendto.blocks.sendto_otherscript=` 0 1000 ms customMessage FALSE Script Object ID `,a.sendto_otherscript={init:function(){var e;let r=[];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.javascript\.(\d+)$/);if(t){let e=parseInt(t[1],10);r.push([`javascript.${e}`,String(e)])}}if(!r.length)for(let e=0;e<=4;e++)r.push([`javascript.${e}`,String(e)]);this.appendDummyInput(`NAME`).appendField(`✉️ ${g(`sendto_otherscript_name`)}`),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_otherscript_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_otherscript_script`)).setCheck(null),this.appendDummyInput().appendField(g(`sendto_otherscript_timeout`)).appendField(new n(`1000`),`TIMEOUT`).appendField(new t([[g(`timeouts_settimeout_ms`),`ms`],[g(`timeouts_settimeout_sec`),`sec`],[g(`timeouts_settimeout_min`),`min`]]),`UNIT`),this.appendDummyInput(`MESSAGE`).appendField(g(`sendto_otherscript_message`)).appendField(new n(`customMessage`),`MESSAGE`),this.appendValueInput(`DATA`).appendField(g(`sendto_otherscript_data`)),this.appendDummyInput(`WITH_STATEMENT`).appendField(g(`with_results`)).appendField(v(),`WITH_STATEMENT`),this.updateShape_(),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_otherscript_tooltip`)),this.setHelpUrl(_(`sendto_otherscript_help`))},updateShape_:function(e){l(this,e)}},s.forBlock.sendto_otherscript=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=e.getFieldValue(`MESSAGE`),i=m(e.getFieldValue(`TIMEOUT`),e.getFieldValue(`UNIT`)),a;f(e.getFieldValue(`WITH_STATEMENT`))&&(a=s.statementToCode(e,`STATEMENT`));let l=p(n),u=s.valueToCode(e,`DATA`,o.ATOMIC)||`true`,d=`{ instance: ${t}, script: ${n}${l?` /* ${l} */`:``}, message: ${c(r)} }`;return a?`messageTo(${d}, ${u}, { timeout: ${i} }, (result) => {\n${a}})\n`:`messageTo(${d}, ${u}, { timeout: ${i} });\n`},h.Sendto.blocks.sendto_gethistory=` default none 0 500 min dayStart dayEnd `,a.sendto_gethistory={init:function(){var e;let r=[[`default`,`default`]];if((e=window.main)!=null&&e.instances)for(let e of window.main.instances){let t=e.match(/^system\.adapter\.(history|influxdb|sql)\.(\d+)$/);if(t){let e=`${t[1]}.${t[2]}`;r.push([e,e])}}this.appendDummyInput(`NAME`).appendField(g(`sendto_gethistory_name`)),this.appendDummyInput(`INSTANCE`).appendField(g(`sendto_gethistory_instance`)).appendField(new t(r),`INSTANCE`),this.appendValueInput(`OID`).appendField(g(`sendto_gethistory_oid`)).setCheck(null),this.appendValueInput(`START`).appendField(g(`sendto_gethistory_start`)).setCheck(null),this.appendValueInput(`END`).appendField(g(`sendto_gethistory_end`)).setCheck(null),this.appendDummyInput(`AGGREGATE`).appendField(g(`sendto_gethistory_aggregate`)).appendField(new t([[g(`sendto_gethistory_none`),`none`],[g(`sendto_gethistory_minimum`),`min`],[g(`sendto_gethistory_maximum`),`max`],[g(`sendto_gethistory_avg`),`average`],[g(`sendto_gethistory_cnt`),`count`]]),`AGGREGATE`),this.appendDummyInput(`UNIT`).appendField(g(`sendto_gethistory_step`)).appendField(new n(`0`),`STEP`).appendField(new t([[g(`sendto_gethistory_ms`),`ms`],[g(`sendto_gethistory_sec`),`sec`],[g(`sendto_gethistory_min`),`min`],[g(`sendto_gethistory_hour`),`hour`],[g(`sendto_gethistory_day`),`day`]]),`UNIT`),this.appendDummyInput(`COUNT`).appendField(g(`sendto_gethistory_count`)).appendField(new n(`0`),`COUNT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(h.Sendto.HUE),this.setTooltip(g(`sendto_gethistory_tooltip`)),this.setHelpUrl(_(`sendto_gethistory_help`))}},s.forBlock.sendto_gethistory=function(e){let t=e.getFieldValue(`INSTANCE`),n=s.valueToCode(e,`OID`,o.ATOMIC),r=s.valueToCode(e,`START`,o.ATOMIC),i=s.valueToCode(e,`END`,o.ATOMIC),a=e.getFieldValue(`AGGREGATE`),l=e.getFieldValue(`UNIT`),u=parseInt(e.getFieldValue(`COUNT`),10),d=parseFloat(e.getFieldValue(`STEP`));l===`day`?d*=864e5:l===`hour`?d*=36e5:l===`min`?d*=6e4:l===`sec`&&(d*=1e3);let f=s.statementToCode(e,`STATEMENT`),m=p(n);return`getHistory(${t==="default"?``:`${c(t)}, `}{\n id: ${n}${m?` /* ${m} */`:``},\n start: ${r},\n end: ${i},\n`+(d>0&&a!==`none`?` step: ${d},\n`:``)+(d===0||a===`none`?` count: ${u},\n`:``)+` aggregate: '${a}',\n removeBorderValues: true,\n}, async (err, result) => {\n if (err) {\n console.error(err);\n`+(f?` } else { +`:``)+(f?s.prefixLines(f,s.INDENT):``)+` } }); `}}export{h as install}; \ No newline at end of file diff --git a/admin/assets/blocks_switch-CcBSyo3I.js b/admin/assets/blocks_switch-55ZePjfL.js similarity index 98% rename from admin/assets/blocks_switch-CcBSyo3I.js rename to admin/assets/blocks_switch-55ZePjfL.js index c59a5d37..e6048c27 100644 --- a/admin/assets/blocks_switch-CcBSyo3I.js +++ b/admin/assets/blocks_switch-55ZePjfL.js @@ -1,2 +1,2 @@ -import{f as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-sJ01GB6X.js";function i(){let i=window.Blockly.Translate;t.logic_switch_case={init:function(){this.appendValueInput(`CONDITION`).appendField(i(`logic_switch_case_is`)),this.appendValueInput(`CASECONDITION0`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE0`).appendField(i(`logic_switch_do`)),this.setMutator(new e.MutatorIcon([`case_incaseof`,`case_default`],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_tooltip`)),this.caseCount_=0,this.defaultCount_=0},mutationToDom:function(){if(!this.caseCount_&&!this.defaultCount_)return null;let e=document.createElement(`mutation`);return this.caseCount_&&e.setAttribute(`case`,String(this.caseCount_)),this.defaultCount_&&e.setAttribute(`default`,`1`),e},domToMutation:function(e){this.caseCount_=parseInt(e.getAttribute(`case`),10),this.defaultCount_=parseInt(e.getAttribute(`default`),10);for(let e=1;e<=this.caseCount_;e++)this.appendValueInput(`CASECONDITION${e}`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE${e}`).appendField(i(`logic_switch_do`));this.defaultCount_&&this.appendStatementInput(`ONDEFAULT`).appendField(`default`)},decompose:function(e){var t;let n=e.newBlock(`control_case`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=1;t<=this.caseCount_;t++){let t=e.newBlock(`case_incaseof`);t.initSvg(),r.connect(t.previousConnection),r=t.nextConnection}if(this.defaultCount_){let t=e.newBlock(`case_default`);t.initSvg(),r.connect(t.previousConnection)}return n},compose:function(e){this.defaultCount_&&this.removeInput(`ONDEFAULT`),this.defaultCount_=0;for(let e=this.caseCount_;e>0;e--)this.removeInput(`CASECONDITION${e}`),this.removeInput(`CASE${e}`);this.caseCount_=0;let t=e.getInputTargetBlock(`STACK`);for(;t;){switch(t.type){case`case_incaseof`:{this.caseCount_++;let e=this.appendValueInput(`CASECONDITION${this.caseCount_}`).appendField(i(`logic_switch_case_of`)),a=this.appendStatementInput(`CASE${this.caseCount_}`).appendField(i(`logic_switch_do`));if(t.valueConnection_){var n;(n=e.connection)==null||n.connect(t.valueConnection_)}if(t.statementConnection_){var r;(r=a.connection)==null||r.connect(t.statementConnection_)}break}case`case_default`:{this.defaultCount_++;let e=this.appendStatementInput(`ONDEFAULT`).appendField(`default`);if(t.statementConnection_){var a;(a=e.connection)==null||a.connect(t.statementConnection_)}break}default:throw`Unknown block type.`}t=t.nextConnection&&t.nextConnection.targetBlock()}},saveConnections:function(e){let t=e.getInputTargetBlock(`STACK`),n=1;for(;t;){var r;switch(t.type){case`case_incaseof`:{var i,a;let e=this.getInput(`CASECONDITION${n}`),r=this.getInput(`CASE${n}`);t.valueConnection_=e==null||(i=e.connection)==null?void 0:i.targetConnection,t.statementConnection_=r==null||(a=r.connection)==null?void 0:a.targetConnection,n++;break}case`case_default`:{var o;let e=this.getInput(`ONDEFAULT`);t.statementConnection_=e==null||(o=e.connection)==null?void 0:o.targetConnection;break}default:throw`Unknown block type`}t=(r=t.nextConnection)==null?void 0:r.targetBlock()}}},t.control_case={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_is`)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_control_case_tooltip`)),this.contextMenu=!1}},t.case_incaseof={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_of`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_case_incaseof_tooltip`)),this.contextMenu=!1}},t.case_default={init:function(){this.appendDummyInput().appendField(`default`),this.setPreviousStatement(!0),this.setNextStatement(!1),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_default_tooltip`)),this.contextMenu=!1}},r.forBlock.logic_switch_case=function(e){let t=e,i=``,a,o,s=r.valueToCode(e,`CONDITION`,n.NONE)||null;if(s){if(/^\(?([._$\d\w"'?: ()])*\)?$/g.test(s)){i=`\nswitch (${s}) {\n`;let c=r.valueToCode(e,`CASECONDITION0`,n.NONE)||null,l=r.statementToCode(e,`CASE0`);i+=`\tcase ${c}:\n${l}\n\t\tbreak;\n`;for(let s=1;s<=t.caseCount_;s++)o=r.valueToCode(e,`CASECONDITION${s}`,n.NONE)||null,o&&(a=r.statementToCode(e,`CASE${s}`),i+=`\tcase ${o}:\n${a}\n\t\tbreak;\n`);t.defaultCount_&&(a=r.statementToCode(e,`ONDEFAULT`),i+=`\tdefault:\n${a}\n\t\tbreak;\n`),i+=`} +import{f as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-DlFpMLlN.js";function i(){let i=window.Blockly.Translate;t.logic_switch_case={init:function(){this.appendValueInput(`CONDITION`).appendField(i(`logic_switch_case_is`)),this.appendValueInput(`CASECONDITION0`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE0`).appendField(i(`logic_switch_do`)),this.setMutator(new e.MutatorIcon([`case_incaseof`,`case_default`],this)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_tooltip`)),this.caseCount_=0,this.defaultCount_=0},mutationToDom:function(){if(!this.caseCount_&&!this.defaultCount_)return null;let e=document.createElement(`mutation`);return this.caseCount_&&e.setAttribute(`case`,String(this.caseCount_)),this.defaultCount_&&e.setAttribute(`default`,`1`),e},domToMutation:function(e){this.caseCount_=parseInt(e.getAttribute(`case`),10),this.defaultCount_=parseInt(e.getAttribute(`default`),10);for(let e=1;e<=this.caseCount_;e++)this.appendValueInput(`CASECONDITION${e}`).appendField(i(`logic_switch_case_of`)),this.appendStatementInput(`CASE${e}`).appendField(i(`logic_switch_do`));this.defaultCount_&&this.appendStatementInput(`ONDEFAULT`).appendField(`default`)},decompose:function(e){var t;let n=e.newBlock(`control_case`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=1;t<=this.caseCount_;t++){let t=e.newBlock(`case_incaseof`);t.initSvg(),r.connect(t.previousConnection),r=t.nextConnection}if(this.defaultCount_){let t=e.newBlock(`case_default`);t.initSvg(),r.connect(t.previousConnection)}return n},compose:function(e){this.defaultCount_&&this.removeInput(`ONDEFAULT`),this.defaultCount_=0;for(let e=this.caseCount_;e>0;e--)this.removeInput(`CASECONDITION${e}`),this.removeInput(`CASE${e}`);this.caseCount_=0;let t=e.getInputTargetBlock(`STACK`);for(;t;){switch(t.type){case`case_incaseof`:{this.caseCount_++;let e=this.appendValueInput(`CASECONDITION${this.caseCount_}`).appendField(i(`logic_switch_case_of`)),a=this.appendStatementInput(`CASE${this.caseCount_}`).appendField(i(`logic_switch_do`));if(t.valueConnection_){var n;(n=e.connection)==null||n.connect(t.valueConnection_)}if(t.statementConnection_){var r;(r=a.connection)==null||r.connect(t.statementConnection_)}break}case`case_default`:{this.defaultCount_++;let e=this.appendStatementInput(`ONDEFAULT`).appendField(`default`);if(t.statementConnection_){var a;(a=e.connection)==null||a.connect(t.statementConnection_)}break}default:throw`Unknown block type.`}t=t.nextConnection&&t.nextConnection.targetBlock()}},saveConnections:function(e){let t=e.getInputTargetBlock(`STACK`),n=1;for(;t;){var r;switch(t.type){case`case_incaseof`:{var i,a;let e=this.getInput(`CASECONDITION${n}`),r=this.getInput(`CASE${n}`);t.valueConnection_=e==null||(i=e.connection)==null?void 0:i.targetConnection,t.statementConnection_=r==null||(a=r.connection)==null?void 0:a.targetConnection,n++;break}case`case_default`:{var o;let e=this.getInput(`ONDEFAULT`);t.statementConnection_=e==null||(o=e.connection)==null?void 0:o.targetConnection;break}default:throw`Unknown block type`}t=(r=t.nextConnection)==null?void 0:r.targetBlock()}}},t.control_case={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_is`)),this.appendStatementInput(`STACK`),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_control_case_tooltip`)),this.contextMenu=!1}},t.case_incaseof={init:function(){this.appendDummyInput().appendField(i(`logic_switch_case_of`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_case_incaseof_tooltip`)),this.contextMenu=!1}},t.case_default={init:function(){this.appendDummyInput().appendField(`default`),this.setPreviousStatement(!0),this.setNextStatement(!1),this.setColour(`%{BKY_LOGIC_HUE}`),this.setTooltip(i(`logic_switch_default_tooltip`)),this.contextMenu=!1}},r.forBlock.logic_switch_case=function(e){let t=e,i=``,a,o,s=r.valueToCode(e,`CONDITION`,n.NONE)||null;if(s){if(/^\(?([._$\d\w"'?: ()])*\)?$/g.test(s)){i=`\nswitch (${s}) {\n`;let c=r.valueToCode(e,`CASECONDITION0`,n.NONE)||null,l=r.statementToCode(e,`CASE0`);i+=`\tcase ${c}:\n${l}\n\t\tbreak;\n`;for(let s=1;s<=t.caseCount_;s++)o=r.valueToCode(e,`CASECONDITION${s}`,n.NONE)||null,o&&(a=r.statementToCode(e,`CASE${s}`),i+=`\tcase ${o}:\n${a}\n\t\tbreak;\n`);t.defaultCount_&&(a=r.statementToCode(e,`ONDEFAULT`),i+=`\tdefault:\n${a}\n\t\tbreak;\n`),i+=`} `}else alert(`logic_switch_case: ${s} is not a variable name`)}return i}}export{i as install}; \ No newline at end of file diff --git a/admin/assets/blocks_system-9p9UhPDv.js b/admin/assets/blocks_system-9p9UhPDv.js new file mode 100644 index 00000000..55455431 --- /dev/null +++ b/admin/assets/blocks_system-9p9UhPDv.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,s as r,t as i}from"./blockly-DBw-ytY1.js";import{c as a,l as o}from"./index-DlFpMLlN.js";import{c as s,o as c,r as l,u}from"./helpers-n7EZ1fEP.js";import{FieldOID as d}from"./field_oid-CJZIeruf.js";function f(){let f=window.Blockly,p=f.Translate,m=window.getHelp;f.CustomBlocks=f.CustomBlocks||[],f.CustomBlocks.push(`System`),f.System={HUE:210,blocks:{},WARNING_PARENTS:[`on_ext`]};let h=e=>[[p(`get_value_val`),`val`],[p(`get_value_ack`),`ack`],[p(`get_value_ts`),`ts`],[p(`get_value_lc`),`lc`],[p(`get_value_q`),`q`],[p(`get_value_comment`),`c`],[p(`get_value_from`),`from`],...e?[[p(`get_value_user`),`user`]]:[],[p(`get_common_name`),`common.name`],[p(`get_common_desc`),`common.desc`],[p(`get_common_unit`),`common.unit`],[p(`get_common_role`),`common.role`],[p(`get_common_state_type`),`common.type`],[p(`get_common_read`),`common.read`],[p(`get_common_write`),`common.write`]],g=e=>e===`type`||e.startsWith(`common.`),_=function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):this.setWarningText(null,this.id)},v=r=>({mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`delay_input`,String(l(this.getFieldValue(`WITH_DELAY`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`delay_input`)))},updateShape_:function(i){i?this.getInput(`DELAY`)||this.appendDummyInput(`DELAY`).appendField(` `).appendField(new t(`1000`),`DELAY_MS`).appendField(new e([[p(`control_ms`),`ms`],[p(`control_sec`),`sec`],[p(`control_min`),`min`]]),`UNIT`):this.getInput(`DELAY`)&&this.removeInput(`DELAY`),i?this.getInput(`CLEAR_RUNNING_INPUT`)||this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(r)).appendField(new n,`CLEAR_RUNNING`):this.getInput(`CLEAR_RUNNING_INPUT`)&&this.removeInput(`CLEAR_RUNNING_INPUT`)}}),y=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),b=e=>u(e.getFieldValue(`DELAY_MS`),e.getFieldValue(`UNIT`));f.System.blocks.global_var=` scriptName`,i.global_var={init:function(){this.appendDummyInput(`VAR`).appendField(new e([[p(`global_var_scriptname`),`scriptName`],[p(`global_var_defaultdatadir`),`defaultDataDir`],[p(`global_var_verbose`),`verbose`]]),`VAR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`global_var_tooltip`)),this.setHelpUrl(m(`global_var`))}},o.forBlock.global_var=function(e){return[e.getFieldValue(`VAR`),a.ATOMIC]},f.System.blocks.secret=``;let x=()=>{var e;return((e=window.main)==null?void 0:e.secrets)||[]},S=()=>x().length?x().map(e=>[e.name,e.name]):[[p(`secret_no_secrets`),``]],C=function(){var e,t;let n=(e=this.getSourceBlock())==null?void 0:e.getFieldValue(`NAME`),r=(t=x().find(e=>e.name===n))==null?void 0:t.fields;return(r!=null&&r.length?r:[`key`,`login`,`password`]).map(e=>[e,e])};i.secret={init:function(){let n=this.appendDummyInput(`SECRET`).appendField(p(`secret`));x().length?n.appendField(new e(S),`NAME`):n.appendField(new t(`CameraPassword`),`NAME`),n.appendField(p(`secret_attr`)).appendField(new e(C),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`secret_tooltip`)),this.setHelpUrl(m(`secret_help`))}},o.forBlock.secret=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`ATTR`),r=/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n)?`.${n}`:`[${s(n)}]`;return[`SECRETS[${s(t)}]?${r}`,a.ATOMIC]},f.System.blocks.debug=` info test `,i.debug={init:function(){this.appendValueInput(`TEXT`).setCheck(null).appendField(p(`debug`)),this.appendDummyInput(`Severity`).appendField(new e([[p(`loglevel_debug`),`debug`],[p(`loglevel_info`),`info`],[p(`loglevel_warn`),`warn`],[p(`loglevel_error`),`error`]]),`Severity`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`debug_tooltip`)),this.setHelpUrl(m(`debug_help`))}},o.forBlock.debug=function(e){let t=o.valueToCode(e,`TEXT`,a.ATOMIC);return`console.${e.getFieldValue(`Severity`)}(${t});\n`},f.System.blocks.comment=``,i.comment={init:function(){this.appendDummyInput(`COMMENT`).appendField(new f.FieldMultilineInput(p(`comment`)),`COMMENT`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(`#FFFF00`),this.setTooltip(p(`comment_tooltip`))}},o.forBlock.comment=function(e){return`${o.prefixLines(e.getFieldValue(`COMMENT`),`// `)}\n`},f.System.blocks.control=` FALSE`,i.control={init:function(){this.appendDummyInput().appendField(p(`control`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`control_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))},...v(`control_clear_running`)},o.forBlock.control=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=b(e),i=l(e.getFieldValue(`CLEAR_RUNNING`)),s=o.valueToCode(e,`VALUE`,a.ATOMIC),u=c(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${s}, ${n}, ${i});\n`:`setState('${t}'${d}, ${s});\n`},f.System.blocks.toggle=` FALSE`,i.toggle={init:function(){this.appendDummyInput().appendField(p(`toggle`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendDummyInput(`WITH_DELAY`).appendField(p(`toggle_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`toggle_tooltip`)),this.setHelpUrl(m(`toggle_help`))},...v(`toggle_clear_running`)},o.forBlock.toggle=function(e){var t;let n=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let i=b(e),a=(t=window.main)==null||(t=t.objects[n])==null?void 0:t.common,s=(a==null?void 0:a.type)||`boolean`,u=c(n),d=u?` /* ${u} */`:``,f=l(e.getFieldValue(`CLEAR_RUNNING`)),p;if(s===`number`){let e=a.max===void 0?100:parseFloat(a.max),t=a.min===void 0?0:parseFloat(a.min);p=`setState('${n}'${d}, state ? (state.val === ${t} ? ${e} : ${t}) : ${e});`}else p=`setState('${n}'${d}, state ? !state.val : true);`;let m=l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${n}'${d}, state ? !state.val : true, ${i}, ${f});`:p;return`getState('${n}', (err, state) => {\n${o.prefixLines(m,o.INDENT)}\n});\n`},f.System.blocks.update=` FALSE`,i.update={init:function(){this.appendDummyInput().appendField(p(`update`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`update_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`update_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`update_tooltip`)),this.setHelpUrl(m(`update_help`))},...v(`control_clear_running`)},o.forBlock.update=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=o.valueToCode(e,`VALUE`,a.ATOMIC),i=b(e),s=l(e.getFieldValue(`CLEAR_RUNNING`)),u=c(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${n}, true, ${i}, ${s});\n`:`setState('${t}'${d}, ${n}, true);\n`},f.System.blocks.control_ex=` false FALSE TRUE 0 0 `,i.control_ex={init:function(){this.appendDummyInput().appendField(p(`control_ex`)),this.appendValueInput(`OID`).setCheck(`String`).appendField(p(`field_oid_OID`)),this.appendDummyInput(`TYPE`).appendField(new e([[p(`control_ex_control`),`false`],[p(`control_ex_update`),`true`]]),`TYPE`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_ex_value`)),this.appendValueInput(`DELAY_MS`).setCheck(`Number`).appendField(p(`control_ex_delay`)),this.appendValueInput(`EXPIRE`).setCheck(`Number`).appendField(p(`control_ex_expire`)),this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(`control_ex_clear_running`)).appendField(new n,`CLEAR_RUNNING`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))}},o.forBlock.control_ex=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=o.valueToCode(e,`DELAY_MS`,a.ATOMIC),i=o.valueToCode(e,`EXPIRE`,a.ATOMIC),s=l(e.getFieldValue(`CLEAR_RUNNING`));return`setStateDelayed(${t}, { val: ${n}, ack: ${l(e.getFieldValue(`TYPE`))}${i?`, expire: ${i}`:``} }, parseInt(((${r}) || '').toString(), 10), ${s});\n`},f.System.blocks.create=` 0_userdata.0.example`,i.create={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`);let e=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));e.connection&&(e.connection._optional=!0);let n=this.appendValueInput(`COMMON`).setCheck(null).appendField(p(`create_common`));n.connection&&(n.connection._optional=!0),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create=function(e){let t=e.getFieldValue(`NAME`),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=n!==null&&n!==``?`, ${n}`:``,i=o.valueToCode(e,`COMMON`,a.ATOMIC),c=i!==null&&i!==``?`, ((common) => typeof common !== 'object' ? JSON.parse(common) : common)(${i})`:``,l=o.statementToCode(e,`STATEMENT`);return`createState(${s(t)}${r}${c}, async () => {\n${l}});\n`},f.System.blocks.create_ex=` 0_userdata.0.example string FALSE FALSE`,i.create_ex={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`),this.appendDummyInput(`TYPE`).appendField(p(`create_type`)).appendField(new e([[p(`create_type_string`),`string`],[p(`create_type_number`),`number`],[p(`create_type_boolean`),`boolean`],[p(`create_type_json`),`json`],[p(`create_type_object`),`object`],[p(`create_type_array`),`array`]]),`TYPE`);let r=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));r.connection&&(r.connection._optional=!0),this.appendDummyInput(`READABLE_INPUT`).appendField(p(`create_readable`)).appendField(new n(`FALSE`),`READABLE`),this.appendDummyInput(`WRITEABLE_INPUT`).appendField(p(`create_writeable`)).appendField(new n(`FALSE`),`WRITEABLE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create_ex=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`TYPE`),r=``,i=o.valueToCode(e,`VALUE`,a.ATOMIC);i!==null&&i!==``&&(r=n===`number`?`, parseFloat(${i})`:n===`boolean`?`, !!${i}`:n===`string`?`, String(${i})`:`, ${i}`);let c=l(e.getFieldValue(`READABLE`)),u=l(e.getFieldValue(`WRITEABLE`)),d=o.statementToCode(e,`STATEMENT`);return`createState(${s(t)}${r}, { type: '${n}', read: ${c}, write: ${u} }, async () => {\n${d}});\n`},f.System.blocks.get_value=` val`,i.get_value={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!0)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync('${t}')).${n}`,a.ATOMIC]:[`getState(${s(t)}).${n}`,a.ATOMIC]},f.System.blocks.get_value_var=` val `,i.get_value_var={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value_var=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync(${t})).${n}`,a.ATOMIC]:[`getState(${t}).${n}`,a.ATOMIC]},f.System.blocks.get_value_async=` val`,i.get_value_async={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))}},o.forBlock.get_value_async=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`),r=o.statementToCode(e,`STATEMENT`),i=g(n)?{call:`getObjectAsync`,args:`(err, obj)`,from:`obj`}:{call:`getState`,args:`(err, state)`,from:`state`};return`${i.call}(${s(t)}, async ${i.args} => {\n${o.prefixLines(`let value = ${i.from}.${n};`,o.INDENT)}\n${r}});\n`},f.System.blocks.get_object=``,i.get_object={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))},onchange:function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):e&&[`direct`,`control_ex`,`get_value_var`].includes(e.type)?this.setWarningText(p(`get_object_connection_warning`),this.id):this.setWarningText(null,this.id)}},o.forBlock.get_object=function(e){return[`getObject(${s(e.getFieldValue(`OID`))})`,a.ATOMIC]},f.System.blocks.get_object_async=``,i.get_object_async={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))}},o.forBlock.get_object_async=function(e){let t=o.statementToCode(e,`STATEMENT`);return`getObjectAsync(${s(e.getFieldValue(`OID`))}).then(async (obj) => {\n${t}});\n`},f.System.blocks.state_exists_var=` `,i.state_exists_var={init:function(){this.appendDummyInput().appendField(p(`state_exists`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(f.System.HUE),this.setTooltip(p(`state_exists_tooltip`)),this.setHelpUrl(m(`state_exists_help`))}},o.forBlock.state_exists_var=function(e){return[`(await existsStateAsync(${o.valueToCode(e,`OID`,a.ATOMIC)||`''`}))`,a.ATOMIC]};let w=(e,t,n)=>{i[e]={init:function(){this.appendDummyInput().appendField(p(t)),this.appendDummyInput().appendField(new d(p(`select_id`),n),`oid`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(p(`field_oid_tooltip`))}},o.forBlock[e]=function(e){return[s(e.getFieldValue(`oid`)),a.ATOMIC]}};f.System.blocks.field_oid=``,w(`field_oid`,`field_oid_OID`,`state`),f.System.blocks.field_oid_meta=``,w(`field_oid_meta`,`field_oid_OID_meta`,`meta`),f.System.blocks.field_oid_script=``,w(`field_oid_script`,`field_oid_OID_script`,`script`),f.System.blocks.get_attr=` attribute1 Object ID `,i.get_attr={init:function(){this.appendValueInput(`PATH`).setCheck(null).appendField(p(`get_attr_path`)),this.appendValueInput(`OBJECT`).appendField(p(`get_attr_by`)),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_attr_tooltip`)),this.setHelpUrl(m(`get_attr_help`))}},o.forBlock.get_attr=function(e){return[`getAttr(${o.valueToCode(e,`OBJECT`,a.ATOMIC)}, ${o.valueToCode(e,`PATH`,a.ATOMIC)})`,a.ATOMIC]},f.System.blocks.direct=` TRUE Object ID 1 Object ID 2 `,i.direct={init:function(){this.appendDummyInput().appendField(p(`direct`)),this.appendValueInput(`OID_SRC`).setCheck(`String`).appendField(p(`direct_oid_src`)),this.appendValueInput(`OID_DST`).setCheck(`String`).appendField(p(`direct_oid_dst`)),this.appendDummyInput(`ONLY_CHANGES`).appendField(p(`direct_only_changes`)).appendField(new n(`TRUE`),`ONLY_CHANGES`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.Trigger.HUE),this.setTooltip(p(`direct_tooltip`)),this.setHelpUrl(m(`direct_help`))}},o.forBlock.direct=function(e){let t=o.valueToCode(e,`OID_SRC`,a.ATOMIC),n=o.valueToCode(e,`OID_DST`,a.ATOMIC);return`on({ id: ${t}, change: '${l(e.getFieldValue(`ONLY_CHANGES`))?`ne`:`any`}' }, (obj) => {\n${o.prefixLines(`setState(${n}, obj.state.val);`,o.INDENT)}\n});\n`},f.System.blocks.control_instance=` admin.0 restartInstanceAsync`,i.control_instance={init:function(){var n;let r=[];if((n=window.main)!=null&&n.instances){for(let e of window.main.instances){let t=e.substring(15);r.push([t,t])}r.length||r.push([p(`control_instance_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new e(r),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new t(`adapter.0`),`INSTANCE`);this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_instance_start`),`startInstanceAsync`],[p(`control_instance_stop`),`stopInstanceAsync`],[p(`control_instance_restart`),`restartInstanceAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_instance_tooltip`)),this.setHelpUrl(m(`control_instance_help`))}},o.forBlock.control_instance=function(e){return`await ${e.getFieldValue(`ACTION`)}(${s(e.getFieldValue(`INSTANCE`))});\n`},f.System.blocks.control_script=` startScriptAsync`,i.control_script={init:function(){this.appendDummyInput(`OID`).appendField(p(`control_script`)).appendField(new d(p(`select_id`),`script`),`OID`),this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_script_start`),`startScriptAsync`],[p(`control_script_stop`),`stopScriptAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_script_tooltip`)),this.setHelpUrl(m(`control_script_help`))}},o.forBlock.control_script=function(e){return`await ${e.getFieldValue(`ACTION`)}(${s(e.getFieldValue(`OID`))});\n`},f.System.blocks.regex=` (.*)`,i.regex={init:function(){this.appendDummyInput().appendField(`RegExp`),this.appendDummyInput(`TEXT`).appendField(new t(`(.*)`),`TEXT`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.regex=function(e){return[`new RegExp(${s(e.getFieldValue(`TEXT`))})`,a.ATOMIC]},f.System.blocks.selector=` channel[state.id=*]`,i.selector={init:function(){this.appendDummyInput().appendField(`${p(`selector`)} $(`),this.appendDummyInput(`TEXT`).appendField(new t(`channel[state.id=*]`),`TEXT`),this.appendDummyInput().appendField(`)`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.selector=function(e){return[`Array.prototype.slice.apply($(${s(e.getFieldValue(`TEXT`))}))`,a.ATOMIC]}}export{f as install}; \ No newline at end of file diff --git a/admin/assets/blocks_system-CKoiEzef.js b/admin/assets/blocks_system-CKoiEzef.js deleted file mode 100644 index c9588c30..00000000 --- a/admin/assets/blocks_system-CKoiEzef.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,o as t,r as n,s as r,t as i}from"./blockly-DBw-ytY1.js";import{c as a,l as o}from"./index-sJ01GB6X.js";import{a as s,l as c,r as l,s as u}from"./helpers-BPUU5RuQ.js";import{FieldOID as d}from"./field_oid-CJZIeruf.js";function f(){let f=window.Blockly,p=f.Translate,m=window.getHelp;f.CustomBlocks=f.CustomBlocks||[],f.CustomBlocks.push(`System`),f.System={HUE:210,blocks:{},WARNING_PARENTS:[`on_ext`]};let h=e=>[[p(`get_value_val`),`val`],[p(`get_value_ack`),`ack`],[p(`get_value_ts`),`ts`],[p(`get_value_lc`),`lc`],[p(`get_value_q`),`q`],[p(`get_value_comment`),`c`],[p(`get_value_from`),`from`],...e?[[p(`get_value_user`),`user`]]:[],[p(`get_common_name`),`common.name`],[p(`get_common_desc`),`common.desc`],[p(`get_common_unit`),`common.unit`],[p(`get_common_role`),`common.role`],[p(`get_common_state_type`),`common.type`],[p(`get_common_read`),`common.read`],[p(`get_common_write`),`common.write`]],g=e=>e===`type`||e.startsWith(`common.`),_=function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):this.setWarningText(null,this.id)},v=r=>({mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`delay_input`,String(l(this.getFieldValue(`WITH_DELAY`)))),e},domToMutation:function(e){this.updateShape_(l(e.getAttribute(`delay_input`)))},updateShape_:function(i){i?this.getInput(`DELAY`)||this.appendDummyInput(`DELAY`).appendField(` `).appendField(new t(`1000`),`DELAY_MS`).appendField(new e([[p(`control_ms`),`ms`],[p(`control_sec`),`sec`],[p(`control_min`),`min`]]),`UNIT`):this.getInput(`DELAY`)&&this.removeInput(`DELAY`),i?this.getInput(`CLEAR_RUNNING_INPUT`)||this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(r)).appendField(new n,`CLEAR_RUNNING`):this.getInput(`CLEAR_RUNNING_INPUT`)&&this.removeInput(`CLEAR_RUNNING_INPUT`)}}),y=()=>new n(`FALSE`,function(e){this.getSourceBlock().updateShape_(l(e))}),b=e=>c(e.getFieldValue(`DELAY_MS`),e.getFieldValue(`UNIT`));f.System.blocks.global_var=` scriptName`,i.global_var={init:function(){this.appendDummyInput(`VAR`).appendField(new e([[p(`global_var_scriptname`),`scriptName`],[p(`global_var_defaultdatadir`),`defaultDataDir`],[p(`global_var_verbose`),`verbose`]]),`VAR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`global_var_tooltip`)),this.setHelpUrl(m(`global_var`))}},o.forBlock.global_var=function(e){return[e.getFieldValue(`VAR`),a.ATOMIC]},f.System.blocks.secret=``;let x=()=>{var e;return((e=window.main)==null?void 0:e.secrets)||[]},S=()=>x().length?x().map(e=>[e.name,e.name]):[[p(`secret_no_secrets`),``]],C=function(){var e,t;let n=(e=this.getSourceBlock())==null?void 0:e.getFieldValue(`NAME`),r=(t=x().find(e=>e.name===n))==null?void 0:t.fields;return(r!=null&&r.length?r:[`key`,`login`,`password`]).map(e=>[e,e])};i.secret={init:function(){let n=this.appendDummyInput(`SECRET`).appendField(p(`secret`));x().length?n.appendField(new e(S),`NAME`):n.appendField(new t(`CameraPassword`),`NAME`),n.appendField(p(`secret_attr`)).appendField(new e(C),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`secret_tooltip`)),this.setHelpUrl(m(`secret_help`))}},o.forBlock.secret=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`ATTR`),r=/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(n)?`.${n}`:`[${u(n)}]`;return[`SECRETS[${u(t)}]?${r}`,a.ATOMIC]},f.System.blocks.debug=` info test `,i.debug={init:function(){this.appendValueInput(`TEXT`).setCheck(null).appendField(p(`debug`)),this.appendDummyInput(`Severity`).appendField(new e([[p(`loglevel_debug`),`debug`],[p(`loglevel_info`),`info`],[p(`loglevel_warn`),`warn`],[p(`loglevel_error`),`error`]]),`Severity`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`debug_tooltip`)),this.setHelpUrl(m(`debug_help`))}},o.forBlock.debug=function(e){let t=o.valueToCode(e,`TEXT`,a.ATOMIC);return`console.${e.getFieldValue(`Severity`)}(${t});\n`},f.System.blocks.comment=``,i.comment={init:function(){this.appendDummyInput(`COMMENT`).appendField(new f.FieldMultilineInput(p(`comment`)),`COMMENT`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(`#FFFF00`),this.setTooltip(p(`comment_tooltip`))}},o.forBlock.comment=function(e){return`${o.prefixLines(e.getFieldValue(`COMMENT`),`// `)}\n`},f.System.blocks.control=` FALSE`,i.control={init:function(){this.appendDummyInput().appendField(p(`control`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`control_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))},...v(`control_clear_running`)},o.forBlock.control=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=b(e),i=l(e.getFieldValue(`CLEAR_RUNNING`)),c=o.valueToCode(e,`VALUE`,a.ATOMIC),u=s(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${c}, ${n}, ${i});\n`:`setState('${t}'${d}, ${c});\n`},f.System.blocks.toggle=` FALSE`,i.toggle={init:function(){this.appendDummyInput().appendField(p(`toggle`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendDummyInput(`WITH_DELAY`).appendField(p(`toggle_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`toggle_tooltip`)),this.setHelpUrl(m(`toggle_help`))},...v(`toggle_clear_running`)},o.forBlock.toggle=function(e){var t;let n=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let i=b(e),a=(t=window.main)==null||(t=t.objects[n])==null?void 0:t.common,c=(a==null?void 0:a.type)||`boolean`,u=s(n),d=u?` /* ${u} */`:``,f=l(e.getFieldValue(`CLEAR_RUNNING`)),p;if(c===`number`){let e=a.max===void 0?100:parseFloat(a.max),t=a.min===void 0?0:parseFloat(a.min);p=`setState('${n}'${d}, state ? (state.val === ${t} ? ${e} : ${t}) : ${e});`}else p=`setState('${n}'${d}, state ? !state.val : true);`;let m=l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${n}'${d}, state ? !state.val : true, ${i}, ${f});`:p;return`getState('${n}', (err, state) => {\n${o.prefixLines(m,o.INDENT)}\n});\n`},f.System.blocks.update=` FALSE`,i.update={init:function(){this.appendDummyInput().appendField(p(`update`)),this.appendDummyInput(`OID`).appendField(new d(p(`select_id`),`state`),`OID`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`update_with`)),this.appendDummyInput(`WITH_DELAY`).appendField(p(`update_delay`)).appendField(y(),`WITH_DELAY`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`update_tooltip`)),this.setHelpUrl(m(`update_help`))},...v(`control_clear_running`)},o.forBlock.update=function(e){let t=e.getFieldValue(`OID`);r.VARIABLES_DEFAULT_NAME=`value`;let n=o.valueToCode(e,`VALUE`,a.ATOMIC),i=b(e),c=l(e.getFieldValue(`CLEAR_RUNNING`)),u=s(t),d=u?` /* ${u} */`:``;return l(e.getFieldValue(`WITH_DELAY`))?`setStateDelayed('${t}'${d}, ${n}, true, ${i}, ${c});\n`:`setState('${t}'${d}, ${n}, true);\n`},f.System.blocks.control_ex=` false FALSE TRUE 0 0 `,i.control_ex={init:function(){this.appendDummyInput().appendField(p(`control_ex`)),this.appendValueInput(`OID`).setCheck(`String`).appendField(p(`field_oid_OID`)),this.appendDummyInput(`TYPE`).appendField(new e([[p(`control_ex_control`),`false`],[p(`control_ex_update`),`true`]]),`TYPE`),this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`control_ex_value`)),this.appendValueInput(`DELAY_MS`).setCheck(`Number`).appendField(p(`control_ex_delay`)),this.appendValueInput(`EXPIRE`).setCheck(`Number`).appendField(p(`control_ex_expire`)),this.appendDummyInput(`CLEAR_RUNNING_INPUT`).appendField(p(`control_ex_clear_running`)).appendField(new n,`CLEAR_RUNNING`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_tooltip`)),this.setHelpUrl(m(`control_help`))}},o.forBlock.control_ex=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=o.valueToCode(e,`DELAY_MS`,a.ATOMIC),i=o.valueToCode(e,`EXPIRE`,a.ATOMIC),s=l(e.getFieldValue(`CLEAR_RUNNING`));return`setStateDelayed(${t}, { val: ${n}, ack: ${l(e.getFieldValue(`TYPE`))}${i?`, expire: ${i}`:``} }, parseInt(((${r}) || '').toString(), 10), ${s});\n`},f.System.blocks.create=` 0_userdata.0.example`,i.create={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`);let e=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));e.connection&&(e.connection._optional=!0);let n=this.appendValueInput(`COMMON`).setCheck(null).appendField(p(`create_common`));n.connection&&(n.connection._optional=!0),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create=function(e){let t=e.getFieldValue(`NAME`),n=o.valueToCode(e,`VALUE`,a.ATOMIC),r=n!==null&&n!==``?`, ${n}`:``,i=o.valueToCode(e,`COMMON`,a.ATOMIC),s=i!==null&&i!==``?`, ((common) => typeof common !== 'object' ? JSON.parse(common) : common)(${i})`:``,c=o.statementToCode(e,`STATEMENT`);return`createState(${u(t)}${r}${s}, async () => {\n${c}});\n`},f.System.blocks.create_ex=` 0_userdata.0.example string FALSE FALSE`,i.create_ex={init:function(){this.appendDummyInput().appendField(p(`create`)),this.appendDummyInput(`NAME`).appendField(p(`create_oid`)).appendField(new t(`0_userdata.0.example`),`NAME`),this.appendDummyInput(`TYPE`).appendField(p(`create_type`)).appendField(new e([[p(`create_type_string`),`string`],[p(`create_type_number`),`number`],[p(`create_type_boolean`),`boolean`],[p(`create_type_json`),`json`],[p(`create_type_object`),`object`],[p(`create_type_array`),`array`]]),`TYPE`);let r=this.appendValueInput(`VALUE`).setCheck(null).appendField(p(`create_init`));r.connection&&(r.connection._optional=!0),this.appendDummyInput(`READABLE_INPUT`).appendField(p(`create_readable`)).appendField(new n(`FALSE`),`READABLE`),this.appendDummyInput(`WRITEABLE_INPUT`).appendField(p(`create_writeable`)).appendField(new n(`FALSE`),`WRITEABLE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`create_tooltip`)),this.setHelpUrl(m(`create_help`))}},o.forBlock.create_ex=function(e){let t=e.getFieldValue(`NAME`),n=e.getFieldValue(`TYPE`),r=``,i=o.valueToCode(e,`VALUE`,a.ATOMIC);i!==null&&i!==``&&(r=n===`number`?`, parseFloat(${i})`:n===`boolean`?`, !!${i}`:n===`string`?`, String(${i})`:`, ${i}`);let s=l(e.getFieldValue(`READABLE`)),c=l(e.getFieldValue(`WRITEABLE`)),d=o.statementToCode(e,`STATEMENT`);return`createState(${u(t)}${r}, { type: '${n}', read: ${s}, write: ${c} }, async () => {\n${d}});\n`},f.System.blocks.get_value=` val`,i.get_value={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!0)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync('${t}')).${n}`,a.ATOMIC]:[`getState(${u(t)}).${n}`,a.ATOMIC]},f.System.blocks.get_value_var=` val `,i.get_value_var={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))},onchange:_},o.forBlock.get_value_var=function(e){let t=o.valueToCode(e,`OID`,a.ATOMIC),n=e.getFieldValue(`ATTR`);return g(n)?[`(await getObjectAsync(${t})).${n}`,a.ATOMIC]:[`getState(${t}).${n}`,a.ATOMIC]},f.System.blocks.get_value_async=` val`,i.get_value_async={init:function(){this.appendDummyInput(`ATTR`).appendField(new e(h(!1)),`ATTR`),this.appendDummyInput().appendField(p(`get_value_OID`)),this.appendDummyInput().appendField(new d(p(`select_id`),`state`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`get_value_tooltip`)),this.setHelpUrl(m(`get_value_help`))}},o.forBlock.get_value_async=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ATTR`),r=o.statementToCode(e,`STATEMENT`),i=g(n)?{call:`getObjectAsync`,args:`(err, obj)`,from:`obj`}:{call:`getState`,args:`(err, state)`,from:`state`};return`${i.call}(${u(t)}, async ${i.args} => {\n${o.prefixLines(`let value = ${i.from}.${n};`,o.INDENT)}\n${r}});\n`},f.System.blocks.get_object=``,i.get_object={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))},onchange:function(){let e=this.getParent();e&&f.System.WARNING_PARENTS.includes(e.type)?this.setWarningText(p(`false_connection_trigger_warning`),this.id):e&&[`direct`,`control_ex`,`get_value_var`].includes(e.type)?this.setWarningText(p(`get_object_connection_warning`),this.id):this.setWarningText(null,this.id)}},o.forBlock.get_object=function(e){return[`getObject(${u(e.getFieldValue(`OID`))})`,a.ATOMIC]},f.System.blocks.get_object_async=``,i.get_object_async={init:function(){this.appendDummyInput().appendField(p(`get_object`)),this.appendDummyInput().appendField(new d(p(`select_id`),`all`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setInputsInline(!0),this.setColour(f.Object.HUE),this.setTooltip(p(`get_object_tooltip`)),this.setHelpUrl(m(`get_object_help`))}},o.forBlock.get_object_async=function(e){let t=o.statementToCode(e,`STATEMENT`);return`getObjectAsync(${u(e.getFieldValue(`OID`))}).then(async (obj) => {\n${t}});\n`},f.System.blocks.state_exists_var=` `,i.state_exists_var={init:function(){this.appendDummyInput().appendField(p(`state_exists`)),this.appendValueInput(`OID`).setCheck(null),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(f.System.HUE),this.setTooltip(p(`state_exists_tooltip`)),this.setHelpUrl(m(`state_exists_help`))}},o.forBlock.state_exists_var=function(e){return[`(await existsStateAsync(${o.valueToCode(e,`OID`,a.ATOMIC)||`''`}))`,a.ATOMIC]};let w=(e,t,n)=>{i[e]={init:function(){this.appendDummyInput().appendField(p(t)),this.appendDummyInput().appendField(new d(p(`select_id`),n),`oid`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(p(`field_oid_tooltip`))}},o.forBlock[e]=function(e){return[u(e.getFieldValue(`oid`)),a.ATOMIC]}};f.System.blocks.field_oid=``,w(`field_oid`,`field_oid_OID`,`state`),f.System.blocks.field_oid_meta=``,w(`field_oid_meta`,`field_oid_OID_meta`,`meta`),f.System.blocks.field_oid_script=``,w(`field_oid_script`,`field_oid_OID_script`,`script`),f.System.blocks.get_attr=` attribute1 Object ID `,i.get_attr={init:function(){this.appendValueInput(`PATH`).setCheck(null).appendField(p(`get_attr_path`)),this.appendValueInput(`OBJECT`).appendField(p(`get_attr_by`)),this.setInputsInline(!0),this.setOutput(!0),this.setColour(f.System.HUE),this.setTooltip(p(`get_attr_tooltip`)),this.setHelpUrl(m(`get_attr_help`))}},o.forBlock.get_attr=function(e){return[`getAttr(${o.valueToCode(e,`OBJECT`,a.ATOMIC)}, ${o.valueToCode(e,`PATH`,a.ATOMIC)})`,a.ATOMIC]},f.System.blocks.direct=` TRUE Object ID 1 Object ID 2 `,i.direct={init:function(){this.appendDummyInput().appendField(p(`direct`)),this.appendValueInput(`OID_SRC`).setCheck(`String`).appendField(p(`direct_oid_src`)),this.appendValueInput(`OID_DST`).setCheck(`String`).appendField(p(`direct_oid_dst`)),this.appendDummyInput(`ONLY_CHANGES`).appendField(p(`direct_only_changes`)).appendField(new n(`TRUE`),`ONLY_CHANGES`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.Trigger.HUE),this.setTooltip(p(`direct_tooltip`)),this.setHelpUrl(m(`direct_help`))}},o.forBlock.direct=function(e){let t=o.valueToCode(e,`OID_SRC`,a.ATOMIC),n=o.valueToCode(e,`OID_DST`,a.ATOMIC);return`on({ id: ${t}, change: '${l(e.getFieldValue(`ONLY_CHANGES`))?`ne`:`any`}' }, (obj) => {\n${o.prefixLines(`setState(${n}, obj.state.val);`,o.INDENT)}\n});\n`},f.System.blocks.control_instance=` admin.0 restartInstanceAsync`,i.control_instance={init:function(){var n;let r=[];if((n=window.main)!=null&&n.instances){for(let e of window.main.instances){let t=e.substring(15);r.push([t,t])}r.length||r.push([p(`control_instance_no_instances`),``]),this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new e(r),`INSTANCE`)}else this.appendDummyInput(`INSTANCE`).appendField(p(`control_instance`)).appendField(new t(`adapter.0`),`INSTANCE`);this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_instance_start`),`startInstanceAsync`],[p(`control_instance_stop`),`stopInstanceAsync`],[p(`control_instance_restart`),`restartInstanceAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_instance_tooltip`)),this.setHelpUrl(m(`control_instance_help`))}},o.forBlock.control_instance=function(e){return`await ${e.getFieldValue(`ACTION`)}(${u(e.getFieldValue(`INSTANCE`))});\n`},f.System.blocks.control_script=` startScriptAsync`,i.control_script={init:function(){this.appendDummyInput(`OID`).appendField(p(`control_script`)).appendField(new d(p(`select_id`),`script`),`OID`),this.appendDummyInput(`ACTION`).appendField(p(`control_instance_action`)).appendField(new e([[p(`control_script_start`),`startScriptAsync`],[p(`control_script_stop`),`stopScriptAsync`]]),`ACTION`),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(f.System.HUE),this.setTooltip(p(`control_script_tooltip`)),this.setHelpUrl(m(`control_script_help`))}},o.forBlock.control_script=function(e){return`await ${e.getFieldValue(`ACTION`)}(${u(e.getFieldValue(`OID`))});\n`},f.System.blocks.regex=` (.*)`,i.regex={init:function(){this.appendDummyInput().appendField(`RegExp`),this.appendDummyInput(`TEXT`).appendField(new t(`(.*)`),`TEXT`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.regex=function(e){return[`new RegExp(${u(e.getFieldValue(`TEXT`))})`,a.ATOMIC]},f.System.blocks.selector=` channel[state.id=*]`,i.selector={init:function(){this.appendDummyInput().appendField(`${p(`selector`)} $(`),this.appendDummyInput(`TEXT`).appendField(new t(`channel[state.id=*]`),`TEXT`),this.appendDummyInput().appendField(`)`),this.setInputsInline(!0),this.setOutput(!0,`Array`),this.setColour(f.System.HUE)}},o.forBlock.selector=function(e){return[`Array.prototype.slice.apply($(${u(e.getFieldValue(`TEXT`))}))`,a.ATOMIC]}}export{f as install}; \ No newline at end of file diff --git a/admin/assets/blocks_text-DqsVhl4Q.js b/admin/assets/blocks_text-BkD85XTp.js similarity index 96% rename from admin/assets/blocks_text-DqsVhl4Q.js rename to admin/assets/blocks_text-BkD85XTp.js index 685dddc0..003745c6 100644 --- a/admin/assets/blocks_text-DqsVhl4Q.js +++ b/admin/assets/blocks_text-BkD85XTp.js @@ -1 +1 @@ -import{i as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-sJ01GB6X.js";function i(){let i=window.Blockly.Translate;t.text_newline={init:function(){this.appendDummyInput().appendField(i(`text_newline`)),this.appendDummyInput().appendField(new e([[`\\n`,`\\n`],[`\\r`,`\\r`],[`\\r\\n`,`\\r\\n`]]),`Type`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(i(`text_newline_tooltip`))}},r.forBlock.text_newline=function(e){return[`'${e.getFieldValue(`Type`)}'`,n.ATOMIC]},t.text_contains={init:function(){this.appendDummyInput().appendField(i(`text_contains`)),this.appendValueInput(`VALUE`).setCheck(null),this.appendValueInput(`FIND`).setCheck(null).appendField(i(`text_contains_value`)),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_contains=function(e){return[`String(${r.valueToCode(e,`VALUE`,n.ATOMIC)}).includes(${r.valueToCode(e,`FIND`,n.ATOMIC)})`,n.ATOMIC]},t.text_format_value={init:function(){this.appendValueInput(`VALUE`).appendField(i(`text_format_value`)).setCheck(null),this.appendDummyInput().appendField(i(`text_format_value_format`)).appendField(new e([[`System`,`system`],[`.,`,`.,`],[`,.`,`,.`],[` .`,` .`]]),`FORMAT`),this.appendValueInput(`DECIMALS`).appendField(i(`text_format_value_decimals`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_format_value=function(e){let t=r.valueToCode(e,`VALUE`,n.ATOMIC),i=r.valueToCode(e,`DECIMALS`,n.ATOMIC),a=e.getFieldValue(`FORMAT`);return a===`system`?[`formatValue(parseFloat(${t}), ${i})`,n.ATOMIC]:[`formatValue(parseFloat(${t}), ${i}, '${a}')`,n.ATOMIC]}}export{i as install}; \ No newline at end of file +import{i as e,t}from"./blockly-DBw-ytY1.js";import{c as n,l as r}from"./index-DlFpMLlN.js";function i(){let i=window.Blockly.Translate;t.text_newline={init:function(){this.appendDummyInput().appendField(i(`text_newline`)),this.appendDummyInput().appendField(new e([[`\\n`,`\\n`],[`\\r`,`\\r`],[`\\r\\n`,`\\r\\n`]]),`Type`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`),this.setTooltip(i(`text_newline_tooltip`))}},r.forBlock.text_newline=function(e){return[`'${e.getFieldValue(`Type`)}'`,n.ATOMIC]},t.text_contains={init:function(){this.appendDummyInput().appendField(i(`text_contains`)),this.appendValueInput(`VALUE`).setCheck(null),this.appendValueInput(`FIND`).setCheck(null).appendField(i(`text_contains_value`)),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_contains=function(e){return[`String(${r.valueToCode(e,`VALUE`,n.ATOMIC)}).includes(${r.valueToCode(e,`FIND`,n.ATOMIC)})`,n.ATOMIC]},t.text_format_value={init:function(){this.appendValueInput(`VALUE`).appendField(i(`text_format_value`)).setCheck(null),this.appendDummyInput().appendField(i(`text_format_value_format`)).appendField(new e([[`System`,`system`],[`.,`,`.,`],[`,.`,`,.`],[` .`,` .`]]),`FORMAT`),this.appendValueInput(`DECIMALS`).appendField(i(`text_format_value_decimals`)),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(`%{BKY_TEXTS_HUE}`)}},r.forBlock.text_format_value=function(e){let t=r.valueToCode(e,`VALUE`,n.ATOMIC),i=r.valueToCode(e,`DECIMALS`,n.ATOMIC),a=e.getFieldValue(`FORMAT`);return a===`system`?[`formatValue(parseFloat(${t}), ${i})`,n.ATOMIC]:[`formatValue(parseFloat(${t}), ${i}, '${a}')`,n.ATOMIC]}}export{i as install}; \ No newline at end of file diff --git a/admin/assets/blocks_time-CD9NP7Te.js b/admin/assets/blocks_time-CD9NP7Te.js new file mode 100644 index 00000000..82e35635 --- /dev/null +++ b/admin/assets/blocks_time-CD9NP7Te.js @@ -0,0 +1 @@ +import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{c as o,n as s,t as c}from"./helpers-n7EZ1fEP.js";var l={"time_get_yyyy.mm.dd":`YYYY.MM.DD`,"time_get_yyyy/mm/dd":`YYYY/MM/DD`,"time_get_yy.mm.dd":`YY.MM.DD`,"time_get_yy/mm/dd":`YY/MM/DD`,"time_get_dd.mm.yyyy":`DD.MM.YYYY`,"time_get_dd/mm/yyyy":`DD/MM/YYYY`,"time_get_dd.mm.yy":`DD.MM.YY`,"time_get_dd/mm/yy":`DD/MM/YY`,"time_get_mm/dd/yyyy":`MM/DD/YYYY`,"time_get_mm/dd/yy":`MM/DD/YY`,"time_get_dd.mm":`DD.MM.`,"time_get_dd/mm":`DD/MM`,"time_get_mm.dd":`MM.DD`,"time_get_mm/dd":`MM/DD`,time_get_hh_mm:`hh:mm`,time_get_hh_mm_ss:`hh:mm:ss`,"time_get_hh_mm_ss.sss":`hh:mm:ss.sss`};function u(e){return e===!0||e===`true`||e===`TRUE`}function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Time`),d.Time={HUE:270,blocks:{}};for(let[e,t]of Object.entries(l))d.Words[e].format=t;let m=()=>[[f(`time_compare_lt`),`<`],[f(`time_compare_le`),`<=`],[f(`time_compare_gt`),`>`],[f(`time_compare_ge`),`>=`],[f(`time_compare_eq`),`==`],[f(`time_compare_bw`),`between`],[f(`time_compare_nb`),`not between`]];d.Time.blocks.time_compare_ex=` TRUE < 12:00 `,r.time_compare_ex={init:function(){this.appendDummyInput(`TIME_TEXT`).appendField(f(`time_compare_ex`)),this.appendDummyInput(`USE_ACTUAL_TIME`).appendField(new n(`TRUE`,function(e){this.getSourceBlock().updateShape_(void 0,e)}),`USE_ACTUAL_TIME`),this.appendDummyInput().appendField(f(`time_compare_is_ex`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendValueInput(`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_ex_tooltip`)),this.setHelpUrl(p(`time_compare_ex_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`),n=this.getFieldValue(`USE_ACTUAL_TIME`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e.setAttribute(`actual_time`,u(n)?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)),u(e.getAttribute(`actual_time`)))},updateShape_:function(e,t){if(e===void 0&&(e=this.getFieldValue(`OPTION`)===`between`||this.getFieldValue(`OPTION`)===`not between`),e){if(!this.getInput(`END_TIME`)&&(this.getInput(`CUSTOM_TIME`)&&(this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)),this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendValueInput(`END_TIME`),!window.scripts.loading)){let e=this.workspace;setTimeout(()=>{var t;let n=this.getInput(`END_TIME`);if(!(n!=null&&(t=n.connection)!=null&&t.isConnected())){let t=e.newBlock(`text`);t.setShadow(!0),t.setFieldValue(`18:00`,`TEXT`),t.outputConnection.connect(n.connection),t.initSvg(),t.render()}},100)}}else this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`));t===void 0&&(t=this.getFieldValue(`USE_ACTUAL_TIME`));let n=u(t),r=this.getInput(`CUSTOM_TIME`);n?r&&(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_ex`)),this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)):(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_custom_ex`)),r||(this.appendDummyInput(`CUSTOM_TEXT`).appendField(f(`time_compare_ex_custom`)),this.appendValueInput(`CUSTOM_TIME`)))}},a.forBlock.time_compare_ex=function(e){let t=e.getFieldValue(`OPTION`);return[`compareTime(${a.valueToCode(e,`START_TIME`,i.ATOMIC)}, ${e.getInput(`END_TIME`)&&a.valueToCode(e,`END_TIME`,i.ATOMIC)||null}, '${t}', ${e.getInput(`CUSTOM_TIME`)&&a.valueToCode(e,`CUSTOM_TIME`,i.ATOMIC)||null})`,i.ATOMIC]},d.Time.blocks.time_compare=` < 12:00`,r.time_compare={init:function(){this.appendDummyInput().appendField(f(`time_compare`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendDummyInput(`START_TIME`).appendField(new t(`12:00`),`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_tooltip`)),this.setHelpUrl(p(`time_compare_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)))},updateShape_:function(e){e?this.getInput(`END_TIME`)||(this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendDummyInput(`END_TIME`).appendField(new t(`18:00`),`END_TIME`)):this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`))}},a.forBlock.time_compare=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`START_TIME`),r=e.getFieldValue(`END_TIME`);return[`compareTime(${o(n)}, ${r?o(r):`null`}, ${o(t)})`,i.ATOMIC]},d.Time.blocks.time_get=` object`,r.time_get={init:function(){this.appendDummyInput().appendField(f(`time_get`)),this.appendDummyInput(`OPTION`).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdt`||e===`wdts`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`format`)),u(e.getAttribute(`language`)))},updateShape_:function(n,r){n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(f(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r?this.getInput(`LANGUAGE`)||this.appendDummyInput(`LANGUAGE`).appendField(new e(s()),`LANGUAGE`):this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.time_get=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),a;return a=t===`object`?`(new Date().getTime())`:t===`ms`?`(new Date().getMilliseconds())`:t===`s`?`(new Date().getSeconds())`:t===`sid`?`(() => { const v = new Date(); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`(new Date().getMinutes())`:t===`mid`?`(() => { const v = new Date(); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`(new Date().getHours())`:t===`d`?`(new Date().getDate())`:t===`M`?`(new Date().getMonth() + 1)`:t===`Mt`?`formatDate(new Date(), 'OO', '${r}')`:t===`Mts`?`formatDate(new Date(), 'O', '${r}')`:t===`y`?`(new Date().getYear())`:t===`fy`?`(new Date().getFullYear())`:t===`wdt`?`formatDate(new Date(), 'WW', '${r}')`:t===`wdts`?`formatDate(new Date(), 'W', '${r}')`:t===`wd`?`(() => { const d = new Date().getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(new Date())`:t===`custom`?`formatDate(new Date(), ${o(n)})`:`formatDate(new Date(), ${o(t)})`,[a,i.ATOMIC]},d.Time.blocks.time_get_special=` dayStart`,r.time_get_special={init:function(){this.appendDummyInput().appendField(f(`time_get_special`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`time_get_special_day_start`),`dayStart`],[f(`time_get_special_day_end`),`dayEnd`],[f(`time_get_special_week_start`),`weekStart`],[f(`time_get_special_week_end`),`weekEnd`],[f(`time_get_special_month_start`),`monthStart`],[f(`time_get_special_month_end`),`monthEnd`]]),`TYPE`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_special_tooltip`))}},a.forBlock.time_get_special=function(e){let t=e.getFieldValue(`TYPE`),n=``;return t===`dayStart`?n=`/* start of day */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return d.getTime(); })()`:t===`dayEnd`?n=`/* end of day */ (() => { const d = new Date(); d.setHours(23, 59, 59, 999); return d.getTime(); })()`:t===`weekStart`?n=`/* start of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() - d.getDay() + (d.getDay() == 0 ? -6 : 1)).getTime(); })()`:t===`weekEnd`?n=`/* end of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() + (8 - d.getDay())).getTime() - 1; })()`:t===`monthStart`?n=`/* start of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); d.setDate(1); return d.getTime(); })()`:t===`monthEnd`&&(n=`/* end of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth() + 1, 1).getTime() - 1; })()`),[n,i.ATOMIC]},d.Time.blocks.time_astro=` sunrise 0`,r.time_astro={init:function(){this.appendDummyInput().appendField(f(`time_astro`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`astro_sunriseText`),`sunrise`],[f(`astro_sunriseEndText`),`sunriseEnd`],[f(`astro_goldenHourEndText`),`goldenHourEnd`],[f(`astro_solarNoonText`),`solarNoon`],[f(`astro_goldenHourText`),`goldenHour`],[f(`astro_sunsetStartText`),`sunsetStart`],[f(`astro_sunsetText`),`sunset`],[f(`astro_duskText`),`dusk`],[f(`astro_nauticalDuskText`),`nauticalDusk`],[f(`astro_nightText`),`night`],[f(`astro_nightEndText`),`nightEnd`],[f(`astro_nauticalDawnText`),`nauticalDawn`],[f(`astro_dawnText`),`dawn`],[f(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput(`OFFSET`).appendField(f(`time_astro_offset`)).appendField(new t(`0`),`OFFSET`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_astro_tooltip`)),this.setHelpUrl(p(`time_astro_help`))}},a.forBlock.time_astro=function(e){return[`getAstroDate('${e.getFieldValue(`TYPE`)}', undefined, ${parseFloat(e.getFieldValue(`OFFSET`))})`,i.ATOMIC]},d.Time.blocks.time_calculation=` + ms object 1 `,r.time_calculation={init:function(){this.appendDummyInput(`NAME`).appendField(f(`time_calculation`)),this.appendValueInput(`DATE_TIME`).appendField(f(`time_calculation_on`)).setCheck(null),this.appendDummyInput(`OPERATION`).appendField(new e([[`+`,`+`],[`-`,`-`]]),`OPERATION`),this.appendValueInput(`VALUE`),this.appendDummyInput(`UNIT`).appendField(new e([[f(`time_calculation_ms`),`ms`],[f(`time_calculation_sec`),`sec`],[f(`time_calculation_min`),`min`],[f(`time_calculation_hour`),`hour`],[f(`time_calculation_day`),`day`],[f(`time_calculation_week`),`week`]]),`UNIT`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_calculation_tooltip`))}},a.forBlock.time_calculation=function(e){let t=a.valueToCode(e,`DATE_TIME`,i.ATOMIC),n=e.getFieldValue(`OPERATION`),r=a.valueToCode(e,`VALUE`,i.ATOMIC),o=e.getFieldValue(`UNIT`),s=1;return o===`sec`?s=1e3:o===`min`?s=6e4:o===`hour`?s=36e5:o===`day`?s=864e5:o===`week`&&(s=6048e5),[`/* time calculation */ ((dateTime) => { const ts = (typeof dateTime === 'object' ? dateTime.getTime() : dateTime); return ts ${n} ((${r}) * ${s}); })(${t})`,i.ATOMIC]}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_time-DJfyX0NT.js b/admin/assets/blocks_time-DJfyX0NT.js deleted file mode 100644 index 14953f53..00000000 --- a/admin/assets/blocks_time-DJfyX0NT.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,o as t,r as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";import{n as o,s,t as c}from"./helpers-BPUU5RuQ.js";var l={"time_get_yyyy.mm.dd":`YYYY.MM.DD`,"time_get_yyyy/mm/dd":`YYYY/MM/DD`,"time_get_yy.mm.dd":`YY.MM.DD`,"time_get_yy/mm/dd":`YY/MM/DD`,"time_get_dd.mm.yyyy":`DD.MM.YYYY`,"time_get_dd/mm/yyyy":`DD/MM/YYYY`,"time_get_dd.mm.yy":`DD.MM.YY`,"time_get_dd/mm/yy":`DD/MM/YY`,"time_get_mm/dd/yyyy":`MM/DD/YYYY`,"time_get_mm/dd/yy":`MM/DD/YY`,"time_get_dd.mm":`DD.MM.`,"time_get_dd/mm":`DD/MM`,"time_get_mm.dd":`MM.DD`,"time_get_mm/dd":`MM/DD`,time_get_hh_mm:`hh:mm`,time_get_hh_mm_ss:`hh:mm:ss`,"time_get_hh_mm_ss.sss":`hh:mm:ss.sss`};function u(e){return e===!0||e===`true`||e===`TRUE`}function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Time`),d.Time={HUE:270,blocks:{}};for(let[e,t]of Object.entries(l))d.Words[e].format=t;let m=()=>[[f(`time_compare_lt`),`<`],[f(`time_compare_le`),`<=`],[f(`time_compare_gt`),`>`],[f(`time_compare_ge`),`>=`],[f(`time_compare_eq`),`==`],[f(`time_compare_bw`),`between`],[f(`time_compare_nb`),`not between`]];d.Time.blocks.time_compare_ex=` TRUE < 12:00 `,r.time_compare_ex={init:function(){this.appendDummyInput(`TIME_TEXT`).appendField(f(`time_compare_ex`)),this.appendDummyInput(`USE_ACTUAL_TIME`).appendField(new n(`TRUE`,function(e){this.getSourceBlock().updateShape_(void 0,e)}),`USE_ACTUAL_TIME`),this.appendDummyInput().appendField(f(`time_compare_is_ex`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendValueInput(`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_ex_tooltip`)),this.setHelpUrl(p(`time_compare_ex_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`),n=this.getFieldValue(`USE_ACTUAL_TIME`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e.setAttribute(`actual_time`,u(n)?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)),u(e.getAttribute(`actual_time`)))},updateShape_:function(e,t){if(e===void 0&&(e=this.getFieldValue(`OPTION`)===`between`||this.getFieldValue(`OPTION`)===`not between`),e){if(!this.getInput(`END_TIME`)&&(this.getInput(`CUSTOM_TIME`)&&(this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)),this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendValueInput(`END_TIME`),!window.scripts.loading)){let e=this.workspace;setTimeout(()=>{var t;let n=this.getInput(`END_TIME`);if(!(n!=null&&(t=n.connection)!=null&&t.isConnected())){let t=e.newBlock(`text`);t.setShadow(!0),t.setFieldValue(`18:00`,`TEXT`),t.outputConnection.connect(n.connection),t.initSvg(),t.render()}},100)}}else this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`));t===void 0&&(t=this.getFieldValue(`USE_ACTUAL_TIME`));let n=u(t),r=this.getInput(`CUSTOM_TIME`);n?r&&(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_ex`)),this.removeInput(`CUSTOM_TIME`),this.removeInput(`CUSTOM_TEXT`)):(this.getInput(`TIME_TEXT`).fieldRow[0].setValue(f(`time_compare_custom_ex`)),r||(this.appendDummyInput(`CUSTOM_TEXT`).appendField(f(`time_compare_ex_custom`)),this.appendValueInput(`CUSTOM_TIME`)))}},a.forBlock.time_compare_ex=function(e){let t=e.getFieldValue(`OPTION`);return[`compareTime(${a.valueToCode(e,`START_TIME`,i.ATOMIC)}, ${e.getInput(`END_TIME`)&&a.valueToCode(e,`END_TIME`,i.ATOMIC)||null}, '${t}', ${e.getInput(`CUSTOM_TIME`)&&a.valueToCode(e,`CUSTOM_TIME`,i.ATOMIC)||null})`,i.ATOMIC]},d.Time.blocks.time_compare=` < 12:00`,r.time_compare={init:function(){this.appendDummyInput().appendField(f(`time_compare`)),this.appendDummyInput(`OPTION`).appendField(new e(m(),function(e){this.getSourceBlock().updateShape_(e===`between`||e===`not between`)}),`OPTION`),this.appendDummyInput().appendField(` `),this.appendDummyInput(`START_TIME`).appendField(new t(`12:00`),`START_TIME`),this.setInputsInline(!0),this.setOutput(!0,`Boolean`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_compare_tooltip`)),this.setHelpUrl(p(`time_compare_help`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`end_time`,t===`between`||t===`not between`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`end_time`)))},updateShape_:function(e){e?this.getInput(`END_TIME`)||(this.appendDummyInput(`AND`).appendField(f(`time_compare_and`)),this.appendDummyInput(`END_TIME`).appendField(new t(`18:00`),`END_TIME`)):this.getInput(`END_TIME`)&&(this.removeInput(`END_TIME`),this.removeInput(`AND`))}},a.forBlock.time_compare=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`START_TIME`),r=e.getFieldValue(`END_TIME`);return[`compareTime(${s(n)}, ${r?s(r):`null`}, ${s(t)})`,i.ATOMIC]},d.Time.blocks.time_get=` object`,r.time_get={init:function(){this.appendDummyInput().appendField(f(`time_get`)),this.appendDummyInput(`OPTION`).appendField(new e(c(),function(e){this.getSourceBlock().updateShape_(e===`custom`,e===`wdt`||e===`wdts`||e===`Mt`||e===`Mts`)}),`OPTION`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`),t=this.getFieldValue(`OPTION`);return e.setAttribute(`format`,t===`custom`?`true`:`false`),e.setAttribute(`language`,t===`wdt`||t===`wdts`||t===`Mt`||t===`Mts`?`true`:`false`),e},domToMutation:function(e){this.updateShape_(u(e.getAttribute(`format`)),u(e.getAttribute(`language`)))},updateShape_:function(n,r){n?this.getInput(`FORMAT`)||this.appendDummyInput(`FORMAT`).appendField(` `).appendField(new t(f(`time_get_default_format`)),`FORMAT`):this.getInput(`FORMAT`)&&this.removeInput(`FORMAT`),r?this.getInput(`LANGUAGE`)||this.appendDummyInput(`LANGUAGE`).appendField(new e(o()),`LANGUAGE`):this.getInput(`LANGUAGE`)&&this.removeInput(`LANGUAGE`)}},a.forBlock.time_get=function(e){let t=e.getFieldValue(`OPTION`),n=e.getFieldValue(`FORMAT`),r=e.getFieldValue(`LANGUAGE`),a;return a=t===`object`?`(new Date().getTime())`:t===`ms`?`(new Date().getMilliseconds())`:t===`s`?`(new Date().getSeconds())`:t===`sid`?`(() => { const v = new Date(); return v.getHours() * 3600 + v.getMinutes() * 60 + v.getSeconds(); })()`:t===`m`?`(new Date().getMinutes())`:t===`mid`?`(() => { const v = new Date(); return v.getHours() * 60 + v.getMinutes(); })()`:t===`h`?`(new Date().getHours())`:t===`d`?`(new Date().getDate())`:t===`M`?`(new Date().getMonth() + 1)`:t===`Mt`?`formatDate(new Date(), 'OO', '${r}')`:t===`Mts`?`formatDate(new Date(), 'O', '${r}')`:t===`y`?`(new Date().getYear())`:t===`fy`?`(new Date().getFullYear())`:t===`wdt`?`formatDate(new Date(), 'WW', '${r}')`:t===`wdts`?`formatDate(new Date(), 'W', '${r}')`:t===`wd`?`(() => { const d = new Date().getDay(); return d === 0 ? 7 : d; })()`:t===`cw`?`((date) => { const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate())); const dayNum = d.getUTCDay() || 7; d.setUTCDate(d.getUTCDate() + 4 - dayNum); const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1)); return Math.ceil(((d.getTime() - yearStart.getTime()) / 86400000 + 1) / 7); })(new Date())`:t===`custom`?`formatDate(new Date(), ${s(n)})`:`formatDate(new Date(), ${s(t)})`,[a,i.ATOMIC]},d.Time.blocks.time_get_special=` dayStart`,r.time_get_special={init:function(){this.appendDummyInput().appendField(f(`time_get_special`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`time_get_special_day_start`),`dayStart`],[f(`time_get_special_day_end`),`dayEnd`],[f(`time_get_special_week_start`),`weekStart`],[f(`time_get_special_week_end`),`weekEnd`],[f(`time_get_special_month_start`),`monthStart`],[f(`time_get_special_month_end`),`monthEnd`]]),`TYPE`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_get_special_tooltip`))}},a.forBlock.time_get_special=function(e){let t=e.getFieldValue(`TYPE`),n=``;return t===`dayStart`?n=`/* start of day */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return d.getTime(); })()`:t===`dayEnd`?n=`/* end of day */ (() => { const d = new Date(); d.setHours(23, 59, 59, 999); return d.getTime(); })()`:t===`weekStart`?n=`/* start of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() - d.getDay() + (d.getDay() == 0 ? -6 : 1)).getTime(); })()`:t===`weekEnd`?n=`/* end of week */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth(), d.getDate() + (8 - d.getDay())).getTime() - 1; })()`:t===`monthStart`?n=`/* start of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); d.setDate(1); return d.getTime(); })()`:t===`monthEnd`&&(n=`/* end of month */ (() => { const d = new Date(); d.setHours(0, 0, 0, 0); return new Date(d.getFullYear(), d.getMonth() + 1, 1).getTime() - 1; })()`),[n,i.ATOMIC]},d.Time.blocks.time_astro=` sunrise 0`,r.time_astro={init:function(){this.appendDummyInput().appendField(f(`time_astro`)),this.appendDummyInput(`TYPE`).appendField(new e([[f(`astro_sunriseText`),`sunrise`],[f(`astro_sunriseEndText`),`sunriseEnd`],[f(`astro_goldenHourEndText`),`goldenHourEnd`],[f(`astro_solarNoonText`),`solarNoon`],[f(`astro_goldenHourText`),`goldenHour`],[f(`astro_sunsetStartText`),`sunsetStart`],[f(`astro_sunsetText`),`sunset`],[f(`astro_duskText`),`dusk`],[f(`astro_nauticalDuskText`),`nauticalDusk`],[f(`astro_nightText`),`night`],[f(`astro_nightEndText`),`nightEnd`],[f(`astro_nauticalDawnText`),`nauticalDawn`],[f(`astro_dawnText`),`dawn`],[f(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput(`OFFSET`).appendField(f(`time_astro_offset`)).appendField(new t(`0`),`OFFSET`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Time.HUE),this.setTooltip(f(`time_astro_tooltip`)),this.setHelpUrl(p(`time_astro_help`))}},a.forBlock.time_astro=function(e){return[`getAstroDate('${e.getFieldValue(`TYPE`)}', undefined, ${parseFloat(e.getFieldValue(`OFFSET`))})`,i.ATOMIC]},d.Time.blocks.time_calculation=` + ms object 1 `,r.time_calculation={init:function(){this.appendDummyInput(`NAME`).appendField(f(`time_calculation`)),this.appendValueInput(`DATE_TIME`).appendField(f(`time_calculation_on`)).setCheck(null),this.appendDummyInput(`OPERATION`).appendField(new e([[`+`,`+`],[`-`,`-`]]),`OPERATION`),this.appendValueInput(`VALUE`),this.appendDummyInput(`UNIT`).appendField(new e([[f(`time_calculation_ms`),`ms`],[f(`time_calculation_sec`),`sec`],[f(`time_calculation_min`),`min`],[f(`time_calculation_hour`),`hour`],[f(`time_calculation_day`),`day`],[f(`time_calculation_week`),`week`]]),`UNIT`),this.setInputsInline(!0),this.setOutput(!0,`Number`),this.setColour(d.Time.HUE),this.setTooltip(f(`time_calculation_tooltip`))}},a.forBlock.time_calculation=function(e){let t=a.valueToCode(e,`DATE_TIME`,i.ATOMIC),n=e.getFieldValue(`OPERATION`),r=a.valueToCode(e,`VALUE`,i.ATOMIC),o=e.getFieldValue(`UNIT`),s=1;return o===`sec`?s=1e3:o===`min`?s=6e4:o===`hour`?s=36e5:o===`day`?s=864e5:o===`week`&&(s=6048e5),[`/* time calculation */ ((dateTime) => { const ts = (typeof dateTime === 'object' ? dateTime.getTime() : dateTime); return ts ${n} ((${r}) * ${s}); })(${t})`,i.ATOMIC]}}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_timeout-BCswLlY9.js b/admin/assets/blocks_timeout-BCswLlY9.js deleted file mode 100644 index 6f68cca0..00000000 --- a/admin/assets/blocks_timeout-BCswLlY9.js +++ /dev/null @@ -1 +0,0 @@ -import{c as e,i as t,o as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-sJ01GB6X.js";var o={id:`timeout`,marker:`isTimeout_`,variableType:`timeout`},s={id:`interval`,marker:`isInterval_`,variableType:`interval`};function c(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function l(e){return a.nameDB_.safeName(e.getFieldValue(`NAME`))}function u(){let u=window.Blockly,d=u.Translate,f=window.getHelp;u.CustomBlocks=u.CustomBlocks||[],u.CustomBlocks.push(`Timeouts`);let p=()=>[[d(`timeouts_settimeout_ms`),`ms`],[d(`timeouts_settimeout_sec`),`sec`],[d(`timeouts_settimeout_min`),`min`]],m=(t,n,r)=>{for(let i of n.getAllBlocks())if(i!==r&&(i.isTimeout_||i.isInterval_)&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},h=(e,t)=>{if(t.isInFlyout)return e;for(;!m(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`2`}return e},g=function(e){return h(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())},_=(e,t)=>{let n=[];for(let r of e.getAllBlocks())if(r[t.marker]){let e=r.getFieldValue(`NAME`);n.push([e,e])}if(window.scripts.loading)for(let t of e.getVariableMap().getVariablesOfType(``))n.find(e=>e[0]===t.getName())||n.push([t.getName(),t.getName()]);for(let r of e.getVariableMap().getVariablesOfType(t.variableType))n.find(e=>e[0]===r.getName())||n.push([r.getName(),r.getName()]);return n.length||n.push([``,``]),n};u.Timeouts={HUE:70,blocks:{},getAllTimeouts:e=>_(e,o),getAllIntervals:e=>_(e,s)};let v=e=>new t(()=>{var t;return(t=window.scripts)!=null&&t.blocklyWorkspace?_(window.scripts.blocklyWorkspace,e):[]});u.Timeouts.blocks.timeouts_wait=` 1000 ms`,r.timeouts_wait={init:function(){this.appendDummyInput().appendField(d(`timeouts_wait`)).appendField(new n(`1000`),`DELAY`).appendField(new t(p()),`UNIT`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(u.Timeouts.HUE),this.setTooltip(d(`timeouts_wait_tooltip`)),this.setHelpUrl(f(`timeouts_wait_help`))}},a.forBlock.timeouts_wait=function(e){return`await wait(${c(e.getFieldValue(`DELAY`),e.getFieldValue(`UNIT`))});\n`};let y=(e,o)=>{let s=e.id===`timeout`,m=`timeouts_set${e.id}${o?`_variable`:``}`,_=s?`DELAY`:`INTERVAL`,v=s?`DELAY_MS`:`INTERVAL_MS`,y=`timeouts_set${e.id}`,b=s?`timeout`:d(`timeouts_setinterval_name`);r[m]={init:function(){let e=new n(h(b,this),g);e.setSpellcheck(!1);let r=this.appendDummyInput().appendField(d(y)).appendField(e,`NAME`).appendField(d(`${y}_in`));o?this.appendValueInput(v).setCheck(`Number`).appendField(d(`timeouts_settimeout_ms`)):r.appendField(new n(`1000`),_).appendField(new t(p()),`UNIT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(o),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(u.Timeouts.HUE),this.setTooltip(d(`${y}_tooltip`)),this.setHelpUrl(f(`${y}_help`))},[e.marker]:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){let t=this.getFieldValue(`NAME`);return[{getId:()=>t,name:t,type:e.variableType}]}},a.forBlock[m]=function(e){let t=l(e),n=a.statementToCode(e,`STATEMENT`),r=o?`parseInt(${a.valueToCode(e,v,i.ATOMIC)})`:String(c(e.getFieldValue(_),e.getFieldValue(`UNIT`))),u=s?`${a.prefixLines(`${t} = null;`,a.INDENT)}\n`:``;return`${t} = ${s?`setTimeout`:`setInterval`}(async () => {\n${u}${n}}, ${r});\n`}},b=e=>{let t=`timeouts_clear${e.id}`,n=`timeouts_get${e.id}`;u.Timeouts.blocks[t]=` `,r[t]={init:function(){this.appendDummyInput(`NAME`).appendField(d(t)).appendField(v(e),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(u.Timeouts.HUE),this.setTooltip(d(`${t}_tooltip`)),this.setHelpUrl(f(`${t}_help`))}},a.forBlock[t]=function(t){let n=l(t);return`(() => { if (${n}) { ${e.id===`timeout`?`clearTimeout`:`clearInterval`}(${n}); ${n} = null; }})();\n`},u.Timeouts.blocks[n]=` `,r[n]={init:function(){this.appendDummyInput(`NAME`).appendField(d(n)).appendField(v(e),`NAME`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(u.Timeouts.HUE),this.setTooltip(d(`${n}_tooltip`)),this.setHelpUrl(f(`${n}_help`))}},a.forBlock[n]=function(e){return[l(e),i.ATOMIC]}};u.Timeouts.blocks.timeouts_settimeout=` timeout 1000 ms`,y(o,!1),u.Timeouts.blocks.timeouts_settimeout_variable=` 1000 `,y(o,!0),b(o),u.Timeouts.blocks.timeouts_setinterval=` 1000 ms`,y(s,!1),u.Timeouts.blocks.timeouts_setinterval_variable=` 1000 `,y(s,!0),b(s)}export{u as install}; \ No newline at end of file diff --git a/admin/assets/blocks_timeout-D4yZ2uPk.js b/admin/assets/blocks_timeout-D4yZ2uPk.js new file mode 100644 index 00000000..52f880a9 --- /dev/null +++ b/admin/assets/blocks_timeout-D4yZ2uPk.js @@ -0,0 +1 @@ +import{c as e,i as t,o as n,t as r}from"./blockly-DBw-ytY1.js";import{c as i,l as a}from"./index-DlFpMLlN.js";import{a as o}from"./helpers-n7EZ1fEP.js";var s={id:`timeout`,marker:`isTimeout_`,variableType:`timeout`},c={id:`interval`,marker:`isInterval_`,variableType:`interval`};function l(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function u(e){return a.nameDB_.safeName(e.getFieldValue(`NAME`))}function d(){let d=window.Blockly,f=d.Translate,p=window.getHelp;d.CustomBlocks=d.CustomBlocks||[],d.CustomBlocks.push(`Timeouts`);let m=()=>[[f(`timeouts_settimeout_ms`),`ms`],[f(`timeouts_settimeout_sec`),`sec`],[f(`timeouts_settimeout_min`),`min`]],h=(t,n,r)=>{for(let i of n.getAllBlocks())if(i!==r&&(i.isTimeout_||i.isInterval_)&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},g=(e,t)=>{if(t.isInFlyout)return e;for(;!h(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`2`}return e},_=function(e){return g(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())},v=(e,t)=>{let n=[];for(let r of e.getAllBlocks())if(r[t.marker]){let e=r.getFieldValue(`NAME`);n.push([e,e])}if(window.scripts.loading)for(let t of e.getVariableMap().getVariablesOfType(``))n.find(e=>e[0]===t.getName())||n.push([t.getName(),t.getName()]);for(let r of e.getVariableMap().getVariablesOfType(t.variableType))n.find(e=>e[0]===r.getName())||n.push([r.getName(),r.getName()]);return n.length||n.push([``,``]),n};d.Timeouts={HUE:70,blocks:{},getAllTimeouts:e=>v(e,s),getAllIntervals:e=>v(e,c)};let y=e=>new t(()=>{var t;return(t=window.scripts)!=null&&t.blocklyWorkspace?v(window.scripts.blocklyWorkspace,e):[]});d.Timeouts.blocks.timeouts_wait=` 1000 ms`,r.timeouts_wait={init:function(){this.appendDummyInput().appendField(f(`timeouts_wait`)).appendField(new n(`1000`),`DELAY`).appendField(new t(m()),`UNIT`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`timeouts_wait_tooltip`)),this.setHelpUrl(p(`timeouts_wait_help`))}},a.forBlock.timeouts_wait=function(e){return`await wait(${l(e.getFieldValue(`DELAY`),e.getFieldValue(`UNIT`))});\n`};let b=(e,s)=>{let c=e.id===`timeout`,h=`timeouts_set${e.id}${s?`_variable`:``}`,v=c?`DELAY`:`INTERVAL`,y=c?`DELAY_MS`:`INTERVAL_MS`,b=`timeouts_set${e.id}`,x=c?`timeout`:f(`timeouts_setinterval_name`);r[h]={init:function(){let e=new n(g(x,this),_);e.setSpellcheck(!1);let r=this.appendDummyInput().appendField(f(b)).appendField(e,`NAME`).appendField(f(`${b}_in`));s?this.appendValueInput(y).setCheck(`Number`).appendField(f(`timeouts_settimeout_ms`)):r.appendField(new n(`1000`),v).appendField(new t(m()),`UNIT`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(s),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${b}_tooltip`)),this.setHelpUrl(p(`${b}_help`))},[e.marker]:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){return[o(this.getFieldValue(`NAME`),e.variableType)]}},a.forBlock[h]=function(e){let t=u(e),n=a.statementToCode(e,`STATEMENT`),r=s?`parseInt(${a.valueToCode(e,y,i.ATOMIC)})`:String(l(e.getFieldValue(v),e.getFieldValue(`UNIT`))),o=c?`${a.prefixLines(`${t} = null;`,a.INDENT)}\n`:``;return`${t} = ${c?`setTimeout`:`setInterval`}(async () => {\n${o}${n}}, ${r});\n`}},x=e=>{let t=`timeouts_clear${e.id}`,n=`timeouts_get${e.id}`;d.Timeouts.blocks[t]=` `,r[t]={init:function(){this.appendDummyInput(`NAME`).appendField(f(t)).appendField(y(e),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${t}_tooltip`)),this.setHelpUrl(p(`${t}_help`))}},a.forBlock[t]=function(t){let n=u(t);return`(() => { if (${n}) { ${e.id===`timeout`?`clearTimeout`:`clearInterval`}(${n}); ${n} = null; }})();\n`},d.Timeouts.blocks[n]=` `,r[n]={init:function(){this.appendDummyInput(`NAME`).appendField(f(n)).appendField(y(e),`NAME`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(d.Timeouts.HUE),this.setTooltip(f(`${n}_tooltip`)),this.setHelpUrl(p(`${n}_help`))}},a.forBlock[n]=function(e){return[u(e),i.ATOMIC]}};d.Timeouts.blocks.timeouts_settimeout=` timeout 1000 ms`,b(s,!1),d.Timeouts.blocks.timeouts_settimeout_variable=` 1000 `,b(s,!0),x(s),d.Timeouts.blocks.timeouts_setinterval=` 1000 ms`,b(c,!1),d.Timeouts.blocks.timeouts_setinterval_variable=` 1000 `,b(c,!0),x(c)}export{d as install}; \ No newline at end of file diff --git a/admin/assets/blocks_trigger-DoyYYWM8.js b/admin/assets/blocks_trigger-DoyYYWM8.js deleted file mode 100644 index 578f4fe7..00000000 --- a/admin/assets/blocks_trigger-DoyYYWM8.js +++ /dev/null @@ -1,2 +0,0 @@ -import{c as e,f as t,i as n,o as r,r as i,s as a,t as o}from"./blockly-DBw-ytY1.js";import{c as s,l as c}from"./index-sJ01GB6X.js";import{a as l,c as u,d,f,o as p,r as m,s as h}from"./helpers-BPUU5RuQ.js";import{FieldOID as g}from"./field_oid-CJZIeruf.js";import{FieldCRON as _}from"./field_cron-BJLkgNzf.js";function v(e){return c.nameDB_.safeName(e.getFieldValue(`NAME`))}function y(){let y=window.Blockly,b=y.Translate,x=window.getHelp;y.CustomBlocks=y.CustomBlocks||[],y.CustomBlocks.push(`Trigger`);let S=e=>{let t=[];for(let n of e.getAllBlocks())if(n.isSchedule_){let e=n.getFieldValue(`NAME`);t.push([e,e])}if(window.scripts.loading)for(let n of e.getVariableMap().getVariablesOfType(``))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);for(let n of e.getVariableMap().getVariablesOfType(`cron`))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);return t.length||t.push([``,``]),t};y.Trigger={HUE:330,getAllSchedules:S,blocks:{},WARNING_PARENTS:[`on`,`on_ext`,`schedule`,`schedule_by_id`,`schedule_create`,`astro`,`onMessage`,`onFile`,`onLog`,`onEnumMembers`,`timeouts_setinterval`,`timeouts_setinterval_variable`,`controls_repeat_ext`,`controls_repeat_ext`,`controls_for`,`controls_forEach`]};let C=()=>[[b(`on_onchange`),`ne`],[b(`on_any`),`any`],[b(`on_gt`),`gt`],[b(`on_ge`),`ge`],[b(`on_lt`),`lt`],[b(`on_le`),`le`],[b(`on_true`),`true`],[b(`on_false`),`false`]],w=()=>[[b(`on_ack_any`),``],[b(`on_ack_true`),`true`],[b(`on_ack_false`),`false`]],T=e=>e===`true`||e===`false`?`val: ${e}`:`change: '${e}'`,E=()=>`${c.prefixLines(`let value = obj.state.val;`,c.INDENT)}\n${c.prefixLines(`let oldValue = obj.oldState.val;`,c.INDENT)}\n`,D=(e,t,n,r)=>{setTimeout(()=>{var i;if(!((i=t.connection)!=null&&i.isConnected())){let i=e.newBlock(n);i.setShadow(!0),r&&i.setFieldValue(r[1],r[0]),i.outputConnection.connect(t.connection),i.initSvg(),i.render()}},100)},O=(e,t,r,i,a,s,c)=>{o[e]={init:function(){this.appendDummyInput().appendField(t),this.appendDummyInput(`ATTR`).appendField(new n(r),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(s),this.setTooltip(b(`${e}_tooltip`)),c&&this.setHelpUrl(x(c))},onchange:function(){f(this,i,a)},FUNCTION_TYPES:i}};y.Trigger.blocks.on_ext=` ne `,o.on_ext_oid_container={init:function(){this.appendDummyInput().appendField(b(`on_ext_on`)),this.appendStatementInput(`STACK`),this.setColour(y.Trigger.HUE),this.setTooltip(b(`on_ext_on_tooltip`)),this.contextMenu=!1}},o.on_ext_oid={init:function(){this.appendDummyInput(`OID`).appendField(b(`on_ext_oid`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(y.Trigger.HUE),this.setTooltip(b(`on_ext_oid_tooltip`)),this.contextMenu=!1}},o.on_ext={init:function(){this.itemCount_=1,this.setMutator(new t.MutatorIcon([`on_ext_oid`],this)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`on_ext_tooltip`)),this.setHelpUrl(x(`on_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`on_ext_oid_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t {\n${i.length===1?E():``}${o}});\n`},y.Trigger.blocks.on=` ne `,o.on={init:function(){this.appendDummyInput().appendField(b(`on`)),this.appendDummyInput(`OID`).appendField(new g(b(`select_id`),`state`),`OID`),this.appendDummyInput(`CONDITION`).appendField(new n(C()),`CONDITION`),this.appendDummyInput(`ACK_CONDITION`).appendField(b(`on_ack`)).appendField(new n(w()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`on_tooltip`)),this.setHelpUrl(x(`on_help`))},onchange:function(){d(this)}},c.forBlock.on=function(e){let t=e.getFieldValue(`OID`),n=T(e.getFieldValue(`CONDITION`)),r=e.getFieldValue(`ACK_CONDITION`);a.VARIABLES_DEFAULT_NAME=`value`;let i=l(t),o=c.statementToCode(e,`STATEMENT`);return`on({ id: '${t}'${i?` /* ${i} */`:``}, ${n}${r?`, ack: ${r}`:``} }, async (obj) => {\n${E()}${o}});\n`},y.Trigger.blocks.on_source=` state.val`,O(`on_source`,`↪`,[[b(`on_source_state_val`),`state.val`],[b(`on_source_state_ts`),`state.ts`],[b(`on_source_state_q`),`state.q`],[b(`on_source_state_from`),`state.from`],[b(`on_source_state_ack`),`state.ack`],[b(`on_source_state_lc`),`state.lc`],[b(`on_source_state_c`),`state.c`],[b(`on_source_state_user`),`state.user`],[b(`on_source_id`),`id`],[b(`on_source_name`),`common.name`],[b(`on_source_desc`),`common.desc`],[b(`on_source_channel_id`),`channelId`],[b(`on_source_channel_name`),`channelName`],[b(`on_source_device_id`),`deviceId`],[b(`on_source_device_name`),`deviceName`],[b(`on_source_oldstate_val`),`oldState.val`],[b(`on_source_oldstate_ts`),`oldState.ts`],[b(`on_source_oldstate_q`),`oldState.q`],[b(`on_source_oldstate_from`),`oldState.from`],[b(`on_source_oldstate_ack`),`oldState.ack`],[b(`on_source_oldstate_lc`),`oldState.lc`],[b(`on_source_oldstate_c`),`oldState.c`],[b(`on_source_oldstate_user`),`oldState.user`]],[`on`,`on_ext`,`onEnumMembers`],`on_source_warning`,y.Trigger.HUE,`on_help`),c.forBlock.on_source=function(e){let t=e.getFieldValue(`ATTR`),n=t.split(`.`);return[n.length>1?`(obj.${n[0]} ? obj.${t} : '')`:`obj.${t}`,s.ATOMIC]},y.Trigger.blocks.on_ack_value=``,o.on_ack_value={init:function(){this.appendDummyInput().appendField(`↪ ${b(`on_ack_value`)}`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`on_ack_value_tooltip`)),this.setHelpUrl(x(`on_help`))},onchange:function(){f(this,[`on`,`on_ext`,`onEnumMembers`],`on_ack_value_warning`)},FUNCTION_TYPES:[`on`,`on_ext`,`onEnumMembers`]},c.forBlock.on_ack_value=function(){return`if (obj.id && obj?.state && !obj.state.ack) { -${c.prefixLines(`await setStateAsync(obj.id, { val: obj.state.val, ack: true });`,c.INDENT)}\n}\n`},y.Trigger.blocks.astro=` sunrise 0`,o.astro={init:function(){this.appendDummyInput().appendField(b(`astro`)),this.appendDummyInput(`TYPE`).appendField(new n([[b(`astro_sunriseText`),`sunrise`],[b(`astro_sunriseEndText`),`sunriseEnd`],[b(`astro_goldenHourEndText`),`goldenHourEnd`],[b(`astro_solarNoonText`),`solarNoon`],[b(`astro_goldenHourText`),`goldenHour`],[b(`astro_sunsetStartText`),`sunsetStart`],[b(`astro_sunsetText`),`sunset`],[b(`astro_duskText`),`dusk`],[b(`astro_nauticalDuskText`),`nauticalDusk`],[b(`astro_nightText`),`night`],[b(`astro_nightEndText`),`nightEnd`],[b(`astro_nauticalDawnText`),`nauticalDawn`],[b(`astro_dawnText`),`dawn`],[b(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput().appendField(b(`astro_offset`)),this.appendDummyInput(`OFFSET`).appendField(new r(`0`),`OFFSET`),this.appendDummyInput().appendField(b(`astro_minutes`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`astro_tooltip`)),this.setHelpUrl(x(`astro_help`))},onchange:function(){d(this)}},c.forBlock.astro=function(e){return`schedule({ astro: '${e.getFieldValue(`TYPE`)}', shift: ${parseInt(e.getFieldValue(`OFFSET`),10)} }, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},y.Trigger.blocks.schedule=` * * * * *`,o.schedule={init:function(){this.appendDummyInput().appendField(b(`schedule`)),this.appendDummyInput(`SCHEDULE`).appendField(new _(`* * * * *`),`SCHEDULE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`schedule_tooltip`)),this.setHelpUrl(x(`schedule_help`))},onchange:function(){d(this)}},c.forBlock.schedule=function(e){let t=e.getFieldValue(`SCHEDULE`),n=c.statementToCode(e,`STATEMENT`);return`schedule(${t.startsWith(`{`)?`'${t}'`:`"${t}"`}, async () => {\n${n}});\n`},y.Trigger.blocks.schedule_by_id=` `,o.schedule_by_id={init:function(){this.appendDummyInput().appendField(b(`schedule_by_id`)),this.appendDummyInput(`OID`).appendField(new g(b(`select_id`),`state`),`OID`),this.appendDummyInput(`ACK_CONDITION`).appendField(b(`on_ack`)).appendField(new n(w()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`schedule_by_id_tooltip`)),this.setHelpUrl(x(`schedule_by_id_help`))}},c.forBlock.schedule_by_id=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ACK_CONDITION`),r=c.statementToCode(e,`STATEMENT`),i=l(t);return`scheduleById('${t}'${i?` /* ${i} */`:``}${n?`, ${n}`:``}, async () => {\n${r}});\n`},y.Trigger.blocks.schedule_create=` schedule `;let k=(t,n,r)=>{if(t===`schedule`)return!1;for(let i of n.getAllBlocks())if(i!==r&&i.isSchedule_&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},A=(e,t)=>{if(t.isInFlyout)return e;for(;!k(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`1`}return e},j=function(e){return A(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())};o.schedule_create={init:function(){let e=new r(A(`schedule`,this),j);e.setSpellcheck(!1),this.appendDummyInput(`NAME`).appendField(b(`schedule_create`)).appendField(e,`NAME`),this.appendValueInput(`SCHEDULE`).appendField(b(`schedule_text`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`schedule_create_tooltip`)),this.setHelpUrl(x(`schedule_create_help`))},isSchedule_:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){let e=this.getFieldValue(`NAME`);return[{getId:()=>e,name:e,type:`cron`}]}},c.forBlock.schedule_create=function(e){return`${v(e)} = schedule(${c.valueToCode(e,`SCHEDULE`,s.ATOMIC)}, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},y.Trigger.blocks.schedule_clear=` `,o.schedule_clear={init:function(){this.appendDummyInput(`NAME`).appendField(b(`schedule_clear`)).appendField(new n(()=>{var e;return(e=window.scripts)!=null&&e.blocklyWorkspace?S(window.scripts.blocklyWorkspace):[]}),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`schedule_clear_tooltip`)),this.setHelpUrl(x(`schedule_clear_help`))}},c.forBlock.schedule_clear=function(e){let t=v(e);return`(() => { if (${t}) { clearSchedule(${t}); ${t} = null; }})();\n`},y.Trigger.blocks.field_cron=` * * * * *`,o.field_cron={init:function(){this.appendDummyInput().appendField(b(`field_cron_CRON`)),this.appendDummyInput().appendField(new _(`* * * * *`),`CRON`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(y.Trigger.HUE),this.setTooltip(b(`field_cron_tooltip`))}},c.forBlock.field_cron=function(e){return[`'${e.getFieldValue(`CRON`)}'`,s.ATOMIC]},y.Trigger.blocks.cron_builder=` FALSE FALSE * * * * * `,o.cron_builder={init:function(){this.appendDummyInput().appendField(b(`cron_builder_CRON`)),this.appendDummyInput(`LINE`).appendField(b(`cron_builder_line`)).appendField(new i(`FALSE`,function(e){var t;(t=this.getSourceBlock())==null||t.setInputsInline(m(e))}),`LINE`);let e=this.workspace;for(let[t,n]of[[`DOW`,`cron_builder_dow`],[`MONTHS`,`cron_builder_month`],[`DAYS`,`cron_builder_day`],[`HOURS`,`cron_builder_hour`],[`MINUTES`,`cron_builder_minutes`]]){let r=this.appendValueInput(t).appendField(b(n));D(e,r,`text`,[`TEXT`,`*`])}this.appendDummyInput(`WITH_SECONDS`).appendField(b(`cron_builder_with_seconds`)).appendField(new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(m(e))}),`WITH_SECONDS`),this.seconds_=!1,this.as_line_=!1,this.setInputsInline(this.as_line_),this.setOutput(!0,`String`),this.setColour(y.Trigger.HUE),this.setTooltip(b(`field_cron_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`seconds`,String(this.seconds_)),e.setAttribute(`as_line`,String(this.as_line_)),e},domToMutation:function(e){this.seconds_=e.getAttribute(`seconds`)===`true`,this.as_line_=e.getAttribute(`as_line`)===`true`,this.setInputsInline(this.as_line_),this.updateShape_(this.seconds_)},updateShape_:function(e){if(this.seconds_=e,e){if(!this.getInput(`SECONDS`)){let e=this.appendValueInput(`SECONDS`).appendField(b(`cron_builder_seconds`));D(this.workspace,e,`text`,[`TEXT`,`*`])}}else this.getInput(`SECONDS`)&&this.removeInput(`SECONDS`)}},c.forBlock.cron_builder=function(e){let t=t=>c.valueToCode(e,t,s.ATOMIC),n=e.getFieldValue(`WITH_SECONDS`),r=n&&e.getInput(`SECONDS`)?t(`SECONDS`):`0`;return[(m(n)?`${r}.toString().trim() + ' ' + `:``)+`${t(`MINUTES`)}.toString().trim() + ' ' + ${t(`HOURS`)}.toString().trim() + ' ' + ${t(`DAYS`)}.toString().trim() + ' ' + ${t(`MONTHS`)}.toString().trim() + ' ' + ${t(`DOW`)}.toString().trim()`,s.ATOMIC]},y.Trigger.blocks.onMessage=` customMessage`,o.onMessage={init:function(){this.appendDummyInput(`NAME`).appendField(`✉️ ${b(`onMessage`)}`),this.appendDummyInput(`MESSAGE`).appendField(b(`onMessage_message`)).appendField(new r(`customMessage`),`MESSAGE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`onMessage_tooltip`)),this.setHelpUrl(x(`onMessage_help`))},onchange:function(){d(this)}},c.forBlock.onMessage=function(e){let t=e.getFieldValue(`MESSAGE`),n=c.statementToCode(e,`STATEMENT`);return`onMessage(${h(t)}, async (data, callback) => {\n${n}${c.prefixLines(`typeof callback === 'function' && callback({ result: true }); // default callback`,c.INDENT)}\n});\n`},y.Trigger.blocks.onMessage_data=` data`,O(`onMessage_data`,`✉️ `,[[b(`onMessage_data_data`),`data`]],[`onMessage`],`onMessage_data_warning`,y.Action.HUE,`onMessage_data_help`),c.forBlock.onMessage_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},y.Trigger.blocks.onFile=` FALSE 0_userdata.0 * `,o.onFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${b(`onFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(b(`onFile_file`)).setCheck(null),this.appendDummyInput(`WITH_FILE_INPUT`).appendField(b(`onFile_withFile`)).appendField(new i(`FALSE`),`WITH_FILE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`onFile_tooltip`)),this.setHelpUrl(x(`onFile_help`))},onchange:function(){d(this)}},c.forBlock.onFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=e.getFieldValue(`WITH_FILE`),i=c.statementToCode(e,`STATEMENT`),a=p(t);return`onFile(${t}${a?` /* ${a} */`:``}, ${n}, ${r===`TRUE`?`true`:`false`}, async (id, fileName, size, data, mimeType) => {\n${i}});\n`},y.Trigger.blocks.onFile_data=` data`,O(`onFile_data`,`📁`,[[b(`onFile_data_data`),`data`],[b(`onFile_data_filename`),`fileName`],[b(`onFile_data_size`),`size`],[b(`onFile_data_mimeType`),`mimeType`],[b(`onFile_data_id`),`id`],[b(`onFile_data_tempFile`),`TEMP_FILE_PATH`]],[`onFile`],`onFile_data_warning`,y.Trigger.HUE),c.forBlock.onFile_data=function(e){let t=e.getFieldValue(`ATTR`);return t===`TEMP_FILE_PATH`?[`createTempFile(fileName, data)`,s.ATOMIC]:[t,s.ATOMIC]},y.Trigger.blocks.offFile=` 0_userdata.0 * `,o.offFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${b(`offFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(b(`onFile_file`)).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`offFile_tooltip`)),this.setHelpUrl(x(`offFile_help`))}},c.forBlock.offFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=p(t);return`offFile(${t}${r?` /* ${r} */`:``}, ${n});\n`},y.Trigger.blocks.onLog=` error`,o.onLog={init:function(){this.appendDummyInput(`TEXT`).appendField(`💬 ${b(`onLog`)}`),this.appendDummyInput(`Severity`).appendField(b(`loglevel`)).appendField(new n([[b(`loglevel_error`),`error`],[b(`loglevel_warn`),`warn`],[b(`loglevel_info`),`info`],[b(`loglevel_debug`),`debug`],[b(`loglevel_all`),`*`]]),`Severity`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`onLog_tooltip`)),this.setHelpUrl(x(`onLog_help`))},onchange:function(){d(this)}},c.forBlock.onLog=function(e){let t=c.statementToCode(e,`STATEMENT`);return`onLog('${e.getFieldValue(`Severity`)}', async (data) => {\n${t}});\n`},y.Trigger.blocks.onLog_data=` data.message`,O(`onLog_data`,`💬 `,[[b(`onLog_data_message`),`data.message`],[b(`loglevel`),`data.severity`],[b(`onLog_data_from`),`data.from`],[b(`onLog_data_ts`),`data.ts`]],[`onLog`],`onLog_data_warning`,y.Trigger.HUE),c.forBlock.onLog_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},y.Trigger.blocks.onEnumMembers=``,o.onEnumMembers={init:function(){this.appendDummyInput().appendField(b(`onEnumMembers`)),this.appendDummyInput(`OID`).appendField(new g(b(`select_id`),`enum`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(y.Trigger.HUE),this.setTooltip(b(`onEnumMembers_tooltip`)),this.setHelpUrl(x(`onEnumMembers_help`))},onchange:function(){d(this)}},c.forBlock.onEnumMembers=function(e){let t=e.getFieldValue(`OID`),n=c.statementToCode(e,`STATEMENT`),r=l(t);return`onEnumMembers('${t}'${r?` /* ${r} */`:``}, async (obj) => {\n${E()}${n}});\n`}}export{y as install}; \ No newline at end of file diff --git a/admin/assets/blocks_trigger-FHBUZCQ8.js b/admin/assets/blocks_trigger-FHBUZCQ8.js new file mode 100644 index 00000000..ec487816 --- /dev/null +++ b/admin/assets/blocks_trigger-FHBUZCQ8.js @@ -0,0 +1,2 @@ +import{c as e,f as t,i as n,o as r,r as i,s as a,t as o}from"./blockly-DBw-ytY1.js";import{c as s,l as c}from"./index-DlFpMLlN.js";import{a as l,c as u,f as d,l as f,o as p,p as m,r as h,s as g}from"./helpers-n7EZ1fEP.js";import{FieldOID as _}from"./field_oid-CJZIeruf.js";import{FieldCRON as v}from"./field_cron-BJLkgNzf.js";function y(e){return c.nameDB_.safeName(e.getFieldValue(`NAME`))}function b(){let b=window.Blockly,x=b.Translate,S=window.getHelp;b.CustomBlocks=b.CustomBlocks||[],b.CustomBlocks.push(`Trigger`);let C=e=>{let t=[];for(let n of e.getAllBlocks())if(n.isSchedule_){let e=n.getFieldValue(`NAME`);t.push([e,e])}if(window.scripts.loading)for(let n of e.getVariableMap().getVariablesOfType(``))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);for(let n of e.getVariableMap().getVariablesOfType(`cron`))t.find(e=>e[0]===n.getName())||t.push([n.getName(),n.getName()]);return t.length||t.push([``,``]),t};b.Trigger={HUE:330,getAllSchedules:C,blocks:{},WARNING_PARENTS:[`on`,`on_ext`,`schedule`,`schedule_by_id`,`schedule_create`,`astro`,`onMessage`,`onFile`,`onLog`,`onEnumMembers`,`timeouts_setinterval`,`timeouts_setinterval_variable`,`controls_repeat_ext`,`controls_repeat_ext`,`controls_for`,`controls_forEach`]};let w=()=>[[x(`on_onchange`),`ne`],[x(`on_any`),`any`],[x(`on_gt`),`gt`],[x(`on_ge`),`ge`],[x(`on_lt`),`lt`],[x(`on_le`),`le`],[x(`on_true`),`true`],[x(`on_false`),`false`]],T=()=>[[x(`on_ack_any`),``],[x(`on_ack_true`),`true`],[x(`on_ack_false`),`false`]],E=e=>e===`true`||e===`false`?`val: ${e}`:`change: '${e}'`,D=()=>`${c.prefixLines(`let value = obj.state.val;`,c.INDENT)}\n${c.prefixLines(`let oldValue = obj.oldState.val;`,c.INDENT)}\n`,O=(e,t,n,r)=>{setTimeout(()=>{var i;if(!((i=t.connection)!=null&&i.isConnected())){let i=e.newBlock(n);i.setShadow(!0),r&&i.setFieldValue(r[1],r[0]),i.outputConnection.connect(t.connection),i.initSvg(),i.render()}},100)},k=(e,t,r,i,a,s,c)=>{o[e]={init:function(){this.appendDummyInput().appendField(t),this.appendDummyInput(`ATTR`).appendField(new n(r),`ATTR`),this.setInputsInline(!0),this.setOutput(!0),this.setColour(s),this.setTooltip(x(`${e}_tooltip`)),c&&this.setHelpUrl(S(c))},onchange:function(){m(this,i,a)},FUNCTION_TYPES:i}};b.Trigger.blocks.on_ext=` ne `,o.on_ext_oid_container={init:function(){this.appendDummyInput().appendField(x(`on_ext_on`)),this.appendStatementInput(`STACK`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_on_tooltip`)),this.contextMenu=!1}},o.on_ext_oid={init:function(){this.appendDummyInput(`OID`).appendField(x(`on_ext_oid`)),this.setPreviousStatement(!0),this.setNextStatement(!0),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_oid_tooltip`)),this.contextMenu=!1}},o.on_ext={init:function(){this.itemCount_=1,this.setMutator(new t.MutatorIcon([`on_ext_oid`],this)),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ext_tooltip`)),this.setHelpUrl(S(`on_help`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`items`,String(this.itemCount_)),e},domToMutation:function(e){this.itemCount_=parseInt(e.getAttribute(`items`),10),this.updateShape_()},decompose:function(e){var t;let n=e.newBlock(`on_ext_oid_container`);n.initSvg();let r=(t=n.getInput(`STACK`))==null?void 0:t.connection;for(let t=0;t {\n${i.length===1?D():``}${o}});\n`},b.Trigger.blocks.on=` ne `,o.on={init:function(){this.appendDummyInput().appendField(x(`on`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`state`),`OID`),this.appendDummyInput(`CONDITION`).appendField(new n(w()),`CONDITION`),this.appendDummyInput(`ACK_CONDITION`).appendField(x(`on_ack`)).appendField(new n(T()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_tooltip`)),this.setHelpUrl(S(`on_help`))},onchange:function(){d(this)}},c.forBlock.on=function(e){let t=e.getFieldValue(`OID`),n=E(e.getFieldValue(`CONDITION`)),r=e.getFieldValue(`ACK_CONDITION`);a.VARIABLES_DEFAULT_NAME=`value`;let i=p(t),o=c.statementToCode(e,`STATEMENT`);return`on({ id: '${t}'${i?` /* ${i} */`:``}, ${n}${r?`, ack: ${r}`:``} }, async (obj) => {\n${D()}${o}});\n`},b.Trigger.blocks.on_source=` state.val`,k(`on_source`,`↪`,[[x(`on_source_state_val`),`state.val`],[x(`on_source_state_ts`),`state.ts`],[x(`on_source_state_q`),`state.q`],[x(`on_source_state_from`),`state.from`],[x(`on_source_state_ack`),`state.ack`],[x(`on_source_state_lc`),`state.lc`],[x(`on_source_state_c`),`state.c`],[x(`on_source_state_user`),`state.user`],[x(`on_source_id`),`id`],[x(`on_source_name`),`common.name`],[x(`on_source_desc`),`common.desc`],[x(`on_source_channel_id`),`channelId`],[x(`on_source_channel_name`),`channelName`],[x(`on_source_device_id`),`deviceId`],[x(`on_source_device_name`),`deviceName`],[x(`on_source_oldstate_val`),`oldState.val`],[x(`on_source_oldstate_ts`),`oldState.ts`],[x(`on_source_oldstate_q`),`oldState.q`],[x(`on_source_oldstate_from`),`oldState.from`],[x(`on_source_oldstate_ack`),`oldState.ack`],[x(`on_source_oldstate_lc`),`oldState.lc`],[x(`on_source_oldstate_c`),`oldState.c`],[x(`on_source_oldstate_user`),`oldState.user`]],[`on`,`on_ext`,`onEnumMembers`],`on_source_warning`,b.Trigger.HUE,`on_help`),c.forBlock.on_source=function(e){let t=e.getFieldValue(`ATTR`),n=t.split(`.`);return[n.length>1?`(obj.${n[0]} ? obj.${t} : '')`:`obj.${t}`,s.ATOMIC]},b.Trigger.blocks.on_ack_value=``,o.on_ack_value={init:function(){this.appendDummyInput().appendField(`↪ ${x(`on_ack_value`)}`),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`on_ack_value_tooltip`)),this.setHelpUrl(S(`on_help`))},onchange:function(){m(this,[`on`,`on_ext`,`onEnumMembers`],`on_ack_value_warning`)},FUNCTION_TYPES:[`on`,`on_ext`,`onEnumMembers`]},c.forBlock.on_ack_value=function(){return`if (obj.id && obj?.state && !obj.state.ack) { +${c.prefixLines(`await setStateAsync(obj.id, { val: obj.state.val, ack: true });`,c.INDENT)}\n}\n`},b.Trigger.blocks.astro=` sunrise 0`,o.astro={init:function(){this.appendDummyInput().appendField(x(`astro`)),this.appendDummyInput(`TYPE`).appendField(new n([[x(`astro_sunriseText`),`sunrise`],[x(`astro_sunriseEndText`),`sunriseEnd`],[x(`astro_goldenHourEndText`),`goldenHourEnd`],[x(`astro_solarNoonText`),`solarNoon`],[x(`astro_goldenHourText`),`goldenHour`],[x(`astro_sunsetStartText`),`sunsetStart`],[x(`astro_sunsetText`),`sunset`],[x(`astro_duskText`),`dusk`],[x(`astro_nauticalDuskText`),`nauticalDusk`],[x(`astro_nightText`),`night`],[x(`astro_nightEndText`),`nightEnd`],[x(`astro_nauticalDawnText`),`nauticalDawn`],[x(`astro_dawnText`),`dawn`],[x(`astro_nadirText`),`nadir`]]),`TYPE`),this.appendDummyInput().appendField(x(`astro_offset`)),this.appendDummyInput(`OFFSET`).appendField(new r(`0`),`OFFSET`),this.appendDummyInput().appendField(x(`astro_minutes`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`astro_tooltip`)),this.setHelpUrl(S(`astro_help`))},onchange:function(){d(this)}},c.forBlock.astro=function(e){return`schedule({ astro: '${e.getFieldValue(`TYPE`)}', shift: ${parseInt(e.getFieldValue(`OFFSET`),10)} }, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},b.Trigger.blocks.schedule=` * * * * *`,o.schedule={init:function(){this.appendDummyInput().appendField(x(`schedule`)),this.appendDummyInput(`SCHEDULE`).appendField(new v(`* * * * *`),`SCHEDULE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_tooltip`)),this.setHelpUrl(S(`schedule_help`))},onchange:function(){d(this)}},c.forBlock.schedule=function(e){let t=e.getFieldValue(`SCHEDULE`),n=c.statementToCode(e,`STATEMENT`);return`schedule(${t.startsWith(`{`)?`'${t}'`:`"${t}"`}, async () => {\n${n}});\n`},b.Trigger.blocks.schedule_by_id=` `,o.schedule_by_id={init:function(){this.appendDummyInput().appendField(x(`schedule_by_id`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`state`),`OID`),this.appendDummyInput(`ACK_CONDITION`).appendField(x(`on_ack`)).appendField(new n(T()),`ACK_CONDITION`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_by_id_tooltip`)),this.setHelpUrl(S(`schedule_by_id_help`))}},c.forBlock.schedule_by_id=function(e){let t=e.getFieldValue(`OID`),n=e.getFieldValue(`ACK_CONDITION`),r=c.statementToCode(e,`STATEMENT`),i=p(t);return`scheduleById('${t}'${i?` /* ${i} */`:``}${n?`, ${n}`:``}, async () => {\n${r}});\n`},b.Trigger.blocks.schedule_create=` schedule `;let A=(t,n,r)=>{if(t===`schedule`)return!1;for(let i of n.getAllBlocks())if(i!==r&&i.isSchedule_&&e.equals(i.getFieldValue(`NAME`),t))return!1;return!0},j=(e,t)=>{if(t.isInFlyout)return e;for(;!A(e,t.workspace,t);){let t=e.match(/^(.*?)(\d+)$/);t?e=t[1]+(parseInt(t[2],10)+1):e+=`1`}return e},M=function(e){return j(e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,``),this.getSourceBlock())};o.schedule_create={init:function(){let e=new r(j(`schedule`,this),M);e.setSpellcheck(!1),this.appendDummyInput(`NAME`).appendField(x(`schedule_create`)).appendField(e,`NAME`),this.appendValueInput(`SCHEDULE`).appendField(x(`schedule_text`)),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_create_tooltip`)),this.setHelpUrl(S(`schedule_create_help`))},isSchedule_:!0,getVars:function(){return[this.getFieldValue(`NAME`)]},getVarModels:function(){return[l(this.getFieldValue(`NAME`),`cron`)]}},c.forBlock.schedule_create=function(e){return`${y(e)} = schedule(${c.valueToCode(e,`SCHEDULE`,s.ATOMIC)}, async () => {\n${c.statementToCode(e,`STATEMENT`)}});\n`},b.Trigger.blocks.schedule_clear=` `,o.schedule_clear={init:function(){this.appendDummyInput(`NAME`).appendField(x(`schedule_clear`)).appendField(new n(()=>{var e;return(e=window.scripts)!=null&&e.blocklyWorkspace?C(window.scripts.blocklyWorkspace):[]}),`NAME`),this.setInputsInline(!0),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`schedule_clear_tooltip`)),this.setHelpUrl(S(`schedule_clear_help`))}},c.forBlock.schedule_clear=function(e){let t=y(e);return`(() => { if (${t}) { clearSchedule(${t}); ${t} = null; }})();\n`},b.Trigger.blocks.field_cron=` * * * * *`,o.field_cron={init:function(){this.appendDummyInput().appendField(x(`field_cron_CRON`)),this.appendDummyInput().appendField(new v(`* * * * *`),`CRON`),this.setInputsInline(!0),this.setOutput(!0,`String`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`field_cron_tooltip`))}},c.forBlock.field_cron=function(e){return[`'${e.getFieldValue(`CRON`)}'`,s.ATOMIC]},b.Trigger.blocks.cron_builder=` FALSE FALSE * * * * * `,o.cron_builder={init:function(){this.appendDummyInput().appendField(x(`cron_builder_CRON`)),this.appendDummyInput(`LINE`).appendField(x(`cron_builder_line`)).appendField(new i(`FALSE`,function(e){var t;(t=this.getSourceBlock())==null||t.setInputsInline(h(e))}),`LINE`);let e=this.workspace;for(let[t,n]of[[`DOW`,`cron_builder_dow`],[`MONTHS`,`cron_builder_month`],[`DAYS`,`cron_builder_day`],[`HOURS`,`cron_builder_hour`],[`MINUTES`,`cron_builder_minutes`]]){let r=this.appendValueInput(t).appendField(x(n));O(e,r,`text`,[`TEXT`,`*`])}this.appendDummyInput(`WITH_SECONDS`).appendField(x(`cron_builder_with_seconds`)).appendField(new i(`FALSE`,function(e){this.getSourceBlock().updateShape_(h(e))}),`WITH_SECONDS`),this.seconds_=!1,this.as_line_=!1,this.setInputsInline(this.as_line_),this.setOutput(!0,`String`),this.setColour(b.Trigger.HUE),this.setTooltip(x(`field_cron_tooltip`))},mutationToDom:function(){let e=document.createElement(`mutation`);return e.setAttribute(`seconds`,String(this.seconds_)),e.setAttribute(`as_line`,String(this.as_line_)),e},domToMutation:function(e){this.seconds_=e.getAttribute(`seconds`)===`true`,this.as_line_=e.getAttribute(`as_line`)===`true`,this.setInputsInline(this.as_line_),this.updateShape_(this.seconds_)},updateShape_:function(e){if(this.seconds_=e,e){if(!this.getInput(`SECONDS`)){let e=this.appendValueInput(`SECONDS`).appendField(x(`cron_builder_seconds`));O(this.workspace,e,`text`,[`TEXT`,`*`])}}else this.getInput(`SECONDS`)&&this.removeInput(`SECONDS`)}},c.forBlock.cron_builder=function(e){let t=t=>c.valueToCode(e,t,s.ATOMIC),n=e.getFieldValue(`WITH_SECONDS`),r=n&&e.getInput(`SECONDS`)?t(`SECONDS`):`0`;return[(h(n)?`${r}.toString().trim() + ' ' + `:``)+`${t(`MINUTES`)}.toString().trim() + ' ' + ${t(`HOURS`)}.toString().trim() + ' ' + ${t(`DAYS`)}.toString().trim() + ' ' + ${t(`MONTHS`)}.toString().trim() + ' ' + ${t(`DOW`)}.toString().trim()`,s.ATOMIC]},b.Trigger.blocks.onMessage=` customMessage`,o.onMessage={init:function(){this.appendDummyInput(`NAME`).appendField(`✉️ ${x(`onMessage`)}`),this.appendDummyInput(`MESSAGE`).appendField(x(`onMessage_message`)).appendField(new r(`customMessage`),`MESSAGE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onMessage_tooltip`)),this.setHelpUrl(S(`onMessage_help`))},onchange:function(){d(this)}},c.forBlock.onMessage=function(e){let t=e.getFieldValue(`MESSAGE`),n=c.statementToCode(e,`STATEMENT`);return`onMessage(${u(t)}, async (data, callback) => {\n${n}${c.prefixLines(`typeof callback === 'function' && callback({ result: true }); // default callback`,c.INDENT)}\n});\n`},b.Trigger.blocks.onMessage_data=` data`,k(`onMessage_data`,`✉️ `,[[x(`onMessage_data_data`),`data`]],[`onMessage`],`onMessage_data_warning`,b.Action.HUE,`onMessage_data_help`),c.forBlock.onMessage_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},b.Trigger.blocks.onFile=` FALSE 0_userdata.0 * `,o.onFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${x(`onFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(x(`onFile_file`)).setCheck(null),this.appendDummyInput(`WITH_FILE_INPUT`).appendField(x(`onFile_withFile`)).appendField(new i(`FALSE`),`WITH_FILE`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onFile_tooltip`)),this.setHelpUrl(S(`onFile_help`))},onchange:function(){d(this)}},c.forBlock.onFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=e.getFieldValue(`WITH_FILE`),i=c.statementToCode(e,`STATEMENT`),a=g(t);return`onFile(${t}${a?` /* ${a} */`:``}, ${n}, ${r===`TRUE`?`true`:`false`}, async (id, fileName, size, data, mimeType) => {\n${i}});\n`},b.Trigger.blocks.onFile_data=` data`,k(`onFile_data`,`📁`,[[x(`onFile_data_data`),`data`],[x(`onFile_data_filename`),`fileName`],[x(`onFile_data_size`),`size`],[x(`onFile_data_mimeType`),`mimeType`],[x(`onFile_data_id`),`id`],[x(`onFile_data_tempFile`),`TEMP_FILE_PATH`]],[`onFile`],`onFile_data_warning`,b.Trigger.HUE),c.forBlock.onFile_data=function(e){let t=e.getFieldValue(`ATTR`);return t===`TEMP_FILE_PATH`?[`createTempFile(fileName, data)`,s.ATOMIC]:[t,s.ATOMIC]},b.Trigger.blocks.offFile=` 0_userdata.0 * `,o.offFile={init:function(){this.appendValueInput(`OID`).appendField(`📁 ${x(`offFile`)}`).setCheck(null),this.appendValueInput(`FILE`).appendField(x(`onFile_file`)).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`offFile_tooltip`)),this.setHelpUrl(S(`offFile_help`))}},c.forBlock.offFile=function(e){let t=c.valueToCode(e,`OID`,s.ATOMIC),n=c.valueToCode(e,`FILE`,s.ATOMIC),r=g(t);return`offFile(${t}${r?` /* ${r} */`:``}, ${n});\n`},b.Trigger.blocks.onLog=` error`,o.onLog={init:function(){this.appendDummyInput(`TEXT`).appendField(`💬 ${x(`onLog`)}`),this.appendDummyInput(`Severity`).appendField(x(`loglevel`)).appendField(new n([[x(`loglevel_error`),`error`],[x(`loglevel_warn`),`warn`],[x(`loglevel_info`),`info`],[x(`loglevel_debug`),`debug`],[x(`loglevel_all`),`*`]]),`Severity`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onLog_tooltip`)),this.setHelpUrl(S(`onLog_help`))},onchange:function(){d(this)}},c.forBlock.onLog=function(e){let t=c.statementToCode(e,`STATEMENT`);return`onLog('${e.getFieldValue(`Severity`)}', async (data) => {\n${t}});\n`},b.Trigger.blocks.onLog_data=` data.message`,k(`onLog_data`,`💬 `,[[x(`onLog_data_message`),`data.message`],[x(`loglevel`),`data.severity`],[x(`onLog_data_from`),`data.from`],[x(`onLog_data_ts`),`data.ts`]],[`onLog`],`onLog_data_warning`,b.Trigger.HUE),c.forBlock.onLog_data=function(e){return[e.getFieldValue(`ATTR`),s.ATOMIC]},b.Trigger.blocks.onEnumMembers=``,o.onEnumMembers={init:function(){this.appendDummyInput().appendField(x(`onEnumMembers`)),this.appendDummyInput(`OID`).appendField(new _(x(`select_id`),`enum`),`OID`),this.appendStatementInput(`STATEMENT`).setCheck(null),this.setInputsInline(!1),this.setPreviousStatement(!0,null),this.setNextStatement(!0,null),this.setColour(b.Trigger.HUE),this.setTooltip(x(`onEnumMembers_tooltip`)),this.setHelpUrl(S(`onEnumMembers_help`))},onchange:function(){d(this)}},c.forBlock.onEnumMembers=function(e){let t=e.getFieldValue(`OID`),n=c.statementToCode(e,`STATEMENT`),r=p(t);return`onEnumMembers('${t}'${r?` /* ${r} */`:``}, async (obj) => {\n${D()}${n}});\n`}}export{b as install}; \ No newline at end of file diff --git a/admin/assets/helpers-BPUU5RuQ.js b/admin/assets/helpers-n7EZ1fEP.js similarity index 84% rename from admin/assets/helpers-BPUU5RuQ.js rename to admin/assets/helpers-n7EZ1fEP.js index 549b8d6b..2261d122 100644 --- a/admin/assets/helpers-BPUU5RuQ.js +++ b/admin/assets/helpers-n7EZ1fEP.js @@ -1 +1 @@ -import{l as javascriptGenerator}from"./index-sJ01GB6X.js";function reconnectChild(e,t,n){var r;if(!(e!=null&&e.getSourceBlock().workspace))return!1;let i=(r=t.getInput(n))==null?void 0:r.connection;if(!i)return!1;let a=e.targetBlock();return(!a||a===t)&&i.targetConnection!==e&&(i.isConnected()&&i.disconnect(),i.connect(e),!0)}function quote(e){return javascriptGenerator.quote_(e)}function dateFormat(e){return window.Blockly.Words[e].format}function dateFormatOptions(){let e=window.Blockly.Translate,t=[`object`,`ms`,`s`,`sid`,`m`,`mid`,`h`,`d`,`M`,`Mt`,`Mts`,`y`,`fy`,`wdt`,`wdts`,`wd`,`cw`,`custom`],n=[`time_get_yyyy.mm.dd`,`time_get_yyyy/mm/dd`,`time_get_yy.mm.dd`,`time_get_yy/mm/dd`,`time_get_dd.mm.yyyy`,`time_get_dd/mm/yyyy`,`time_get_dd.mm.yy`,`time_get_dd/mm/yy`,`time_get_mm/dd/yyyy`,`time_get_mm/dd/yy`,`time_get_dd.mm`,`time_get_dd/mm`,`time_get_mm.dd`,`time_get_mm/dd`,`time_get_hh_mm`,`time_get_hh_mm_ss`,`time_get_hh_mm_ss.sss`];return[...t.map(t=>[e(`time_get_${t}`),t]),...n.map(t=>[e(t),dateFormat(t)])]}function dateLanguageOptions(){let e=[`in english`,`en`],t=[`auf deutsch`,`de`],n=[`на русском`,`ru`];return window.systemLang===`de`?[t,e,n]:window.systemLang===`ru`?[n,e,t]:[e,t,n]}function isTrue(e){return e===!0||e===`true`||e===`TRUE`}function logLevelOptions(){let e=window.Blockly.Translate;return[[e(`loglevel_none`),``],[e(`loglevel_debug`),`debug`],[e(`loglevel_info`),`info`],[e(`loglevel_warn`),`warn`],[e(`loglevel_error`),`error`]]}function updateStatementInput(e,t){let n=t===void 0?isTrue(e.getFieldValue(`WITH_STATEMENT`)):t;e.getInput(`STATEMENT`)&&e.removeInput(`STATEMENT`),n&&e.appendStatementInput(`STATEMENT`)}function warnIfNotNestedIn(e,t,n){let r=!1,i=e;do{if(t.includes(i.type)){r=!0;break}i=i.getSurroundParent()}while(i);e.setWarningText(r?null:window.Blockly.Translate(n),e.id)}function objectNameOf(code){try{var _window$main;const objId=eval(code);let name=((_window$main=window.main)==null||(_window$main=_window$main.objects[objId])==null||(_window$main=_window$main.common)==null?void 0:_window$main.name)||``;return typeof name==`object`&&(name=name[window.systemLang]||name.en),name||``}catch{return``}}function toMilliseconds(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function objectNameById(e){var t;let n=((t=window.main)==null||(t=t.objects[e])==null||(t=t.common)==null?void 0:t.name)||``;return typeof n==`object`&&(n=n[window.systemLang]||n.en),n||``}function warnIfInsideTrigger(e){let t=e.getSurroundParent();for(;t;){if(window.Blockly.Trigger.WARNING_PARENTS.includes(t.type)){e.setWarningText(window.Blockly.Translate(`trigger_in_trigger_warning`),e.id);return}t=t.getSurroundParent()}e.setWarningText(null,e.id)}export{objectNameById as a,reconnectChild as c,warnIfInsideTrigger as d,warnIfNotNestedIn as f,logLevelOptions as i,toMilliseconds as l,dateLanguageOptions as n,objectNameOf as o,isTrue as r,quote as s,dateFormatOptions as t,updateStatementInput as u}; \ No newline at end of file +import{l as javascriptGenerator}from"./index-DlFpMLlN.js";function reconnectChild(e,t,n){var r;if(!(e!=null&&e.getSourceBlock().workspace))return!1;let i=(r=t.getInput(n))==null?void 0:r.connection;if(!i)return!1;let a=e.targetBlock();return(!a||a===t)&&i.targetConnection!==e&&(i.isConnected()&&i.disconnect(),i.connect(e),!0)}function quote(e){return javascriptGenerator.quote_(e)}function dateFormat(e){return window.Blockly.Words[e].format}function dateFormatOptions(){let e=window.Blockly.Translate,t=[`object`,`ms`,`s`,`sid`,`m`,`mid`,`h`,`d`,`M`,`Mt`,`Mts`,`y`,`fy`,`wdt`,`wdts`,`wd`,`cw`,`custom`],n=[`time_get_yyyy.mm.dd`,`time_get_yyyy/mm/dd`,`time_get_yy.mm.dd`,`time_get_yy/mm/dd`,`time_get_dd.mm.yyyy`,`time_get_dd/mm/yyyy`,`time_get_dd.mm.yy`,`time_get_dd/mm/yy`,`time_get_mm/dd/yyyy`,`time_get_mm/dd/yy`,`time_get_dd.mm`,`time_get_dd/mm`,`time_get_mm.dd`,`time_get_mm/dd`,`time_get_hh_mm`,`time_get_hh_mm_ss`,`time_get_hh_mm_ss.sss`];return[...t.map(t=>[e(`time_get_${t}`),t]),...n.map(t=>[e(t),dateFormat(t)])]}function dateLanguageOptions(){let e=[`in english`,`en`],t=[`auf deutsch`,`de`],n=[`на русском`,`ru`];return window.systemLang===`de`?[t,e,n]:window.systemLang===`ru`?[n,e,t]:[e,t,n]}function isTrue(e){return e===!0||e===`true`||e===`TRUE`}function logLevelOptions(){let e=window.Blockly.Translate;return[[e(`loglevel_none`),``],[e(`loglevel_debug`),`debug`],[e(`loglevel_info`),`info`],[e(`loglevel_warn`),`warn`],[e(`loglevel_error`),`error`]]}function updateStatementInput(e,t){let n=t===void 0?isTrue(e.getFieldValue(`WITH_STATEMENT`)):t;e.getInput(`STATEMENT`)&&e.removeInput(`STATEMENT`),n&&e.appendStatementInput(`STATEMENT`)}function warnIfNotNestedIn(e,t,n){let r=!1,i=e;do{if(t.includes(i.type)){r=!0;break}i=i.getSurroundParent()}while(i);e.setWarningText(r?null:window.Blockly.Translate(n),e.id)}function objectNameOf(code){try{var _window$main;const objId=eval(code);let name=((_window$main=window.main)==null||(_window$main=_window$main.objects[objId])==null||(_window$main=_window$main.common)==null?void 0:_window$main.name)||``;return typeof name==`object`&&(name=name[window.systemLang]||name.en),name||``}catch{return``}}function toMilliseconds(e,t){let n=parseFloat(e);return t===`min`?n*6e4:t===`sec`?n*1e3:n}function objectNameById(e){var t;let n=((t=window.main)==null||(t=t.objects[e])==null||(t=t.common)==null?void 0:t.name)||``;return typeof n==`object`&&(n=n[window.systemLang]||n.en),n||``}function warnIfInsideTrigger(e){let t=e.getSurroundParent();for(;t;){if(window.Blockly.Trigger.WARNING_PARENTS.includes(t.type)){e.setWarningText(window.Blockly.Translate(`trigger_in_trigger_warning`),e.id);return}t=t.getSurroundParent()}e.setWarningText(null,e.id)}function namedResourceVariableModel(e,t){return{getId:()=>e,getName:()=>e,getType:()=>t,name:e,type:t}}export{namedResourceVariableModel as a,quote as c,updateStatementInput as d,warnIfInsideTrigger as f,logLevelOptions as i,reconnectChild as l,dateLanguageOptions as n,objectNameById as o,warnIfNotNestedIn as p,isTrue as r,objectNameOf as s,dateFormatOptions as t,toMilliseconds as u}; \ No newline at end of file diff --git a/admin/assets/index-sJ01GB6X.js b/admin/assets/index-DlFpMLlN.js similarity index 99% rename from admin/assets/index-sJ01GB6X.js rename to admin/assets/index-DlFpMLlN.js index e4d655ee..218e733b 100644 --- a/admin/assets/index-sJ01GB6X.js +++ b/admin/assets/index-DlFpMLlN.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RulesEditor-C8w1UaWO.js","./Import-BH2X_ziv.js","./RulesEditor-BcGsf9n4.css","./Debugger-C6H0IK4l.js","./Error-1oeF0cix.js","./ScriptEditorVanillaMonaco-BJVSL-yc.js","./ScriptEditor-1vbWtjKB.js","./AiChatPanel-BFtl-m3b.js","./AiDiffView-DtbcD6Yx.js","./blocks_action-C3rgCWyA.js","./blockly-DBw-ytY1.js","./rolldown-runtime-C0FnF6B9.js","./helpers-BPUU5RuQ.js","./blocks_convert-DpPMvgqR.js","./blocks_logic-CDtLDgvr.js","./blocks_number-Dtveo3bM.js","./blocks_procedures-DkNQY-Dy.js","./field_script-4IGidWJ7.js","./blocks_sendto-CgDyguqB.js","./blocks_system-CKoiEzef.js","./field_oid-CJZIeruf.js","./field_cron-BJLkgNzf.js","./blocks_object-B6SUr8HP.js","./blocks_switch-CcBSyo3I.js","./blocks_text-DqsVhl4Q.js","./blocks_time-DJfyX0NT.js","./blocks_trigger-DoyYYWM8.js","./blocks_timeout-BCswLlY9.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./RulesEditor-B84Rh__9.js","./Import-BH2X_ziv.js","./RulesEditor-BcGsf9n4.css","./Debugger-CCdzg9pi.js","./Error-1oeF0cix.js","./ScriptEditorVanillaMonaco-0Mwut6ZY.js","./ScriptEditor-COVJ2tCs.js","./AiChatPanel-9G6bIR9k.js","./AiDiffView-DtbcD6Yx.js","./blocks_action-HH802DF8.js","./blockly-DBw-ytY1.js","./rolldown-runtime-C0FnF6B9.js","./helpers-n7EZ1fEP.js","./blocks_convert-B1CD0UVU.js","./blocks_logic-Cyd7_0kb.js","./blocks_number-lMRwWLtK.js","./blocks_procedures-Cxfr0wu8.js","./field_script-4IGidWJ7.js","./blocks_sendto-CbTqmkT5.js","./blocks_system-9p9UhPDv.js","./field_oid-CJZIeruf.js","./field_cron-BJLkgNzf.js","./blocks_object-DCupwas8.js","./blocks_switch-55ZePjfL.js","./blocks_text-BkD85XTp.js","./blocks_time-CD9NP7Te.js","./blocks_trigger-FHBUZCQ8.js","./blocks_timeout-D4yZ2uPk.js"])))=>i.map(i=>d[i]); import{i as e,o as t,r as n,t as r}from"./rolldown-runtime-C0FnF6B9.js";import{n as i,r as a}from"./dist-CaOsN0XW.js";import{t as o}from"./vite-preload-helper-B7qeedMF.js";import"./virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js";import{$n as s,$t as c,A as l,At as u,B as d,Bn as f,Cn as p,Ct as m,D as h,Dn as g,Dt as _,E as v,En as y,F as b,Ft as x,G as S,Gt as C,H as w,Hn as T,It as E,J as D,Jn as O,Jt as k,K as A,Kn as j,Kt as M,L as ee,Ln as N,Lt as P,M as F,Mn as I,Mt as te,N as ne,Nn as re,Nt as ie,O as ae,Ot as oe,P as se,Pn as ce,Pt as le,Q as ue,R as de,Rn as L,Rt as fe,S as pe,Sn as me,Sr as he,St as ge,Tn as _e,U as ve,Un as ye,Ut as R,V as be,Vn as xe,Vt as Se,W as Ce,Wn as z,Wt as we,X as Te,Y as Ee,Yn as B,Yt as De,Z as Oe,Zn as ke,_ as Ae,_n as je,_r as Me,_t as Ne,a as Pe,an as Fe,ar as Ie,at as Le,bn as Re,br as ze,bt as Be,c as Ve,cr as He,ct as Ue,d as We,dn as Ge,dr as Ke,en as qe,et as Je,f as V,fn as Ye,fr as Xe,ft as Ze,g as H,gn as Qe,gr as $e,gt as et,h as tt,hn as nt,hr as rt,ht as it,i as at,in as ot,ir as st,it as ct,j as lt,jn as ut,jt as dt,k as ft,kn as pt,kt as mt,l as ht,ln as gt,lr as _t,m as vt,mn as U,mr as yt,mt as bt,n as xt,nn as St,nr as W,nt as Ct,o as wt,on as Tt,or as Et,ot as Dt,p as Ot,pr as kt,pt as At,q as jt,qn as Mt,qt as Nt,r as Pt,rn as Ft,rr as It,rt as Lt,s as Rt,sr as zt,t as Bt,tn as Vt,tt as Ht,u as Ut,un as Wt,ur as Gt,v as Kt,vn as qt,vr as Jt,vt as Yt,wr as G,wt as Xt,x as Zt,xn as Qt,xr as $t,xt as en,y as tn,yn as nn,yr as rn,zn as an,zt as on}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js";import{t as sn}from"./_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js";import{n as cn,t as ln}from"./Import-BH2X_ziv.js";import{t as un}from"./Error-1oeF0cix.js";import{d as dn,g as fn,m as pn}from"./blockly-DBw-ytY1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),G();var mn=r((e=>{var t=60103,n=60106,r=60107,i=60108,a=60114,o=60109,s=60110,c=60112,l=60113,u=60120,d=60115,f=60116;if(typeof Symbol==`function`&&Symbol.for){var p=Symbol.for;t=p(`react.element`),n=p(`react.portal`),r=p(`react.fragment`),i=p(`react.strict_mode`),a=p(`react.profiler`),o=p(`react.provider`),s=p(`react.context`),c=p(`react.forward_ref`),l=p(`react.suspense`),u=p(`react.suspense_list`),d=p(`react.memo`),f=p(`react.lazy`),p(`react.block`),p(`react.server.block`),p(`react.fundamental`),p(`react.debug_trace_mode`),p(`react.legacy_hidden`)}function m(e){if(typeof e==`object`&&e){var p=e.$$typeof;switch(p){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:case o:return e;default:return p}}case n:return p}}}e.isFragment=function(e){return m(e)===r}})),hn=r(((e,t)=>{t.exports=mn()}))();function gn(e,t){let n=getComputedStyle(t);if(!n)return;let r=e===wn.Horizontal?t.clientWidth:t.clientHeight;return r===0?void 0:(e===wn.Horizontal?r-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight):r-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),r)}function _n(e,t,n=[],r={condition:!0}){let{condition:i}=r,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i(i&&window.addEventListener(e,t,a),()=>{i&&window.removeEventListener(e,t)})),[e,t,i,...n])}(function(e,t){t===void 0&&(t={});var n=t.insertAt;if(e&&typeof document<`u`){var r=document.head||document.getElementsByTagName(`head`)[0],i=document.createElement(`style`);i.type=`text/css`,n===`top`&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}})(`/* === Main Container === */ .__dbk__container { height: 100%; @@ -282,7 +282,7 @@ Note: Some script sources were omitted due to size. The user can ask about speci `);if(r.length<2||i.length<2)return null;let a=new Set;for(let e of r){let t=e.trim();oh(t)&&a.add(t)}if(a.size<2)return null;let o=r.length,s=Math.ceil(o*1.5),c=Math.max(2,Math.floor(o*.5)),l=-1,u=-1,d=0,f=new Uint8Array(i.length);for(let e=0;ed&&(d=n,l=e,u=t)}if(l<0||dl+1&&!f[u-1];)u--;for(;le.trim()).filter(e=>e.length>0);return t.length!==0&&t.every(e=>e.startsWith(`//`)||e.startsWith(`/*`)||e.startsWith(`*`)||e.endsWith(`*/`))}function lh(e){let t=[],n=!1,r=null,i=0;for(let a=0;a0||o.length===0)&&(t.push({startLine:i,endLine:a}),n=!1,r=null):o.startsWith(`/*`)?(n=!0,r=`jsdoc`,i=a+1,o.includes(`*/`)&&(t.push({startLine:i,endLine:a+1}),n=!1,r=null)):o.startsWith(`//`)&&(n=!0,r=`line`,i=a+1)}return n&&i>0&&t.push({startLine:i,endLine:e.length}),t}function uh(e,t,n=.2){if(!ch(e)||!t)return null;let r=t.split(` `),i=lh(r);if(!i.length)return null;let a=new Set;for(let t of e.split(` -`)){let e=t.trim().replace(/^\/\*+/,``).replace(/\*+\/$/,``).replace(/^\/\//,``).replace(/^\*+/,``).trim();e.length>=3&&a.add(e.toLowerCase())}if(a.size===0){if(i.length===1){let e=i[0],t=r[e.endLine-1]??``;return{range:{startLine:e.startLine,startColumn:1,endLine:e.endLine,endColumn:t.length+1},confidence:.5,method:`similarity`}}return null}let o=i[0],s=0;for(let e of i){let t=0;for(let n=e.startLine-1;ns&&(s=n,o=e)}if(so(()=>Promise.resolve().then(()=>qO),void 0,import.meta.url)),mh=W.lazy(()=>o(()=>import(`./RulesEditor-C8w1UaWO.js`),__vite__mapDeps([0,1,2]),import.meta.url)),hh=W.lazy(()=>o(()=>import(`./Debugger-C6H0IK4l.js`),__vite__mapDeps([3,4,5]),import.meta.url)),gh=W.lazy(()=>o(()=>import(`./ScriptEditorVanillaMonaco-BJVSL-yc.js`).then(e=>e.n),__vite__mapDeps([5]),import.meta.url)),_h=W.lazy(()=>o(()=>import(`./ScriptEditor-1vbWtjKB.js`),__vite__mapDeps([6,5]),import.meta.url)),vh=W.lazy(()=>o(()=>import(`./AiChatPanel-BFtl-m3b.js`),__vite__mapDeps([7]),import.meta.url)),yh=W.lazy(()=>o(()=>import(`./AiDiffView-DtbcD6Yx.js`),__vite__mapDeps([8]),import.meta.url)),bh={Blockly:jo,"Javascript/js":Ao,Rules:No,def:Ao,"TypeScript/ts":Mo},xh=48,Sh=`#02a102`,Ch=`#70aae9`,wh=xe[400],Th=T[400],Y={toolbar:e=>({minHeight:38,boxShadow:`0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)`,backgroundColor:e.palette.mode===`dark`?`#1e1e1e`:`#E2E2E2`}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:`grayscale(100%)`,opacity:.5},editorDiv:e=>({height:`calc(100% - ${(parseInt(e.toolbar.height,10)||48)+38+10}px)`,width:`100%`,overflow:`hidden`,position:`relative`}),textButton:{marginRight:10,minHeight:24,padding:`6px 16px`,height:32},saveButton:{background:`#ff9900`},textIcon:{marginLeft:8},tabIcon:{width:24,height:24,verticalAlign:`middle`,marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:`0 8px 0 8px`},hintText:{},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:`absolute`,top:0,right:0},tabChanged:e=>({color:e.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`inline-block`,verticalAlign:`middle`},tabChangedIcon:{color:`#FF0000`,fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:`#ffbc00`,marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:`inline-block`},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}},Eh=class e extends W.Component{constructor(e){var t;super(e),N(this,`getSelect`,null),N(this,`changedMirror`,{}),N(this,`cron`,{initValue:null,callback:null}),N(this,`scriptDialog`,{initValue:null,callback:null,args:null,isReturn:!1}),N(this,`objects`,void 0),N(this,`scripts`,void 0),N(this,`selectId`,{initValue:null,callback:null}),N(this,`confirmCallback`,null),N(this,`blocklyEditorRef`,W.createRef()),N(this,`scriptEditorRef`,W.createRef()),N(this,`lastKnownTs`,{}),N(this,`onBrowserClose`,e=>{let t=Object.keys(this.scripts).find(e=>JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e)));if(t){console.log(`Script ${JSON.stringify(this.scripts[t])}`);let n=V.t(`Configuration not saved.`);return e||=window.event,e&&(e.returnValue=n),n}}),N(this,`cachedScriptInfos`,null),N(this,`lastObjectsHash`,``),N(this,`setTourStep`,e=>this.setState({tourStep:e}));let n=window.localStorage.getItem(`Editor.selected`)||``,r=window.localStorage.getItem(`Editor.editing`)||`[]`,i;try{i=JSON.parse(r)}catch{i=[]}n&&!i.includes(n)&&i.push(n),n&&!this.props.password&&(t=this.props.objects[n])!=null&&(t=t.native)!=null&&t.protected&&(n=i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),!n&&i.length&&(n=this.props.password?i[0]:i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:``,cmdToRules:``,confirm:``,debugEnabled:!1,editing:i,insert:``,instancesLoaded:!1,isTourOpen:window.localStorage.getItem(`tour`)!==`true`,menuDebugAnchorEl:null,menuOidDisplayAnchorEl:null,oidDisplayMode:parseInt(window.localStorage.getItem(`Blockly.FieldOID.displayMode`)||`0`,10)||0,oidShowIcon:window.localStorage.getItem(`Blockly.FieldOID.showIcon`)===`true`,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,aiChatOpen:window.localStorage.getItem(`Editor.aiChatOpen`)===`true`,aiDiffView:null,aiActionRequest:null,inlineAskHandler:null,aiCompletionsEnabled:window.localStorage.getItem(`Editor.aiCompletions`)!==`false`,triggerPrettier:1,scriptConflict:``,rules:null,runningInstances:this.props.runningInstances||{},searchText:``,selected:n,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:``,tourStep:Im.selectTriggers,verboseEnabled:!1,visible:e.visible},this.setChangedInAdmin(),window.systemLang=V.getLanguage(),window.main={objects:{},getObject:(e,t)=>this.props.socket.getObject(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),getState:(e,t)=>this.props.socket.getState(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),instances:[],secrets:[],selectIdDialog:(e,t,n)=>{typeof t==`function`&&(n=t,t=null),this.selectId.callback=n,this.selectId.initValue=e,this.selectId.type=t,this.setState({showSelectId:!0})},cronDialog:(e,t)=>{this.cron.callback=t,this.cron.initValue=e,this.setState({showCron:!0})},showScriptDialog:(e,t,n,r)=>{this.scriptDialog.callback=r,this.scriptDialog.initValue=e,this.scriptDialog.args=t,this.scriptDialog.isReturn=n||!1,this.setState({showScript:!0})}},this.objects=e.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){let e=await this.props.socket.getAdapterInstances(!0),t={},n=e.map(e=>(t[e._id]=e,e._id));window.main.objects=t,window.main.instances=n,this.setState({instancesLoaded:!0})}static onInstanceChanged(e,t){if(e){if(!t&&window.main.instances.includes(e)){delete window.main.objects[e];let t=window.main.instances.indexOf(e);window.main.instances.splice(t,1)}else(t==null?void 0:t.type)===`instance`&&(window.main.instances.includes(e)||(window.main.instances.push(e),window.main.instances.sort()),window.main.objects[e]=t)}}setChangedInAdmin(){let e=Object.keys(this.state.changed).find(e=>this.state.changed[e]);Object.keys(this.state.changed).forEach(e=>{this.changedMirror[e]=this.state.changed[e]}),Object.keys(this.changedMirror).forEach(e=>{this.state.changed[e]===void 0&&delete this.changedMirror[e]}),this.props.onChangedChanged(this.changedMirror),window.parent!==void 0&&window.parent&&(window.parent.configNotSaved=!!e)}componentDidMount(){window.addEventListener(`beforeunload`,this.onBrowserClose,!1),this.props.socket.subscribeObject(`system.adapter.*`,e.onInstanceChanged),this.loadSecrets()}async loadSecrets(e){e||=this.state.runningInstances;let t=Object.keys(e).find(t=>e[t]);if(t)try{let e=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`getSecrets`,null);window.main.secrets=(e==null?void 0:e.secrets)||[]}catch(e){console.error(`Cannot read the credentials: ${e}`)}}componentWillUnmount(){window.removeEventListener(`beforeunload`,this.onBrowserClose),this.props.socket.unsubscribeObject(`system.adapter.*`,e.onInstanceChanged)}componentDidUpdate(e){if(e.scriptsHash!==this.props.scriptsHash)for(let e of this.state.editing){let t=this.props.objects[e];if(!t||t.type!==`script`)continue;let n=t.ts||0,r=this.lastKnownTs[e];r!==void 0&&n!==r&&(this.state.changed[e]?this.state.scriptConflict||this.setState({scriptConflict:e}):(this.scripts[e]=this.getScriptFromObject(e),this.lastKnownTs[e]=n))}}removeNonExistingScripts(e,t){e||=this.props,t||={};let n=!1;if(this.state.editing&&this.state.editing.find(t=>e&&!e.objects[t])){let e=[...this.state.editing];for(let t=e.length-1;t>=0;t--)this.objects[e[t]]||(n=!0,e.splice(t,1));n&&(t.editing=e),this.state.selected&&!this.objects[this.state.selected]&&(n=!0,t.selected=e[0]||``,t.selected&&this.scripts[t.selected]&&(this.state.blockly!==(this.scripts[t.selected].engineType===`Blockly`)&&(t.blockly=this.scripts[t.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[t.selected].engineType===`Rules`)&&(t.rules=this.scripts[t.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[t.selected].verbose&&(t.verboseEnabled=this.scripts[t.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[t.selected].debug&&(t.debugEnabled=this.scripts[t.selected].debug,n=!0)))}return n}UNSAFE_componentWillReceiveProps(e){let t={},n=!1;if(JSON.stringify(e.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(n=!0,t.runningInstances=e.runningInstances,this.loadSecrets(e.runningInstances)),this.state.menuOpened!==e.menuOpened&&(t.menuOpened=e.menuOpened,n=!0),this.state.themeType!==e.themeType&&(t.themeType=e.themeType,n=!0),this.removeNonExistingScripts(e,t)&&(n=!0),this.state.searchText!==e.searchText&&(t.searchText=e.searchText,n=!0),this.objects!==e.objects){this.objects=e.objects,window.main.objects=e.objects,Object.keys(this.scripts).forEach(e=>{let t=this.scripts[e].source;this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=t}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType===`Blockly`)&&(t.blockly=this.scripts[this.state.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[this.state.selected].engineType===`Rules`)&&(t.rules=this.scripts[this.state.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(t.verboseEnabled=this.scripts[this.state.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(t.debugEnabled=this.scripts[this.state.selected].debug,n=!0));let r=[...this.state.editing];for(let e=r.length-1;e>=0;e--)this.objects[r[e]]||(n=!0,r.splice(e,1),this.state.changed[r[e]]!==void 0&&(t.changed||={...this.state.changed},t.changed&&delete t.changed[r[e]]));this.state.selected&&!this.objects[this.state.selected]&&(t.selected=r[0]||``),n&&(t.editing=r)}else for(let e in this.scripts){var r;if(Object.prototype.hasOwnProperty.call(this.scripts,e)){if((r=this.objects[e])!=null&&r.common){if(this.objects[e].type===`script`){let r=this.scripts[e].source,o=JSON.parse(JSON.stringify(this.scripts[e]));if(o.source=this.objects[e].common.source,JSON.stringify(o)!==JSON.stringify(this.objects[e].common)&&(this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=r),r!==this.objects[e].common.source){if(this.state.changed[e]){var i;(i=this.objects[e].from)!=null&&i.startsWith(`system.adapter.javascript.`)&&(this.objects[e].from=`system.adapter.admin.0`,this.setState({toast:V.t(`Script %s was modified on disk.`,e.split(`.`).pop())}))}else{var a;this.props.password&&(a=this.objects[e].native)!=null&&a.protected?this.scripts[e].source=Qo(this.props.password,this.objects[e].common.source):this.scripts[e].source=this.objects[e].common.source}}else this.state.changed[e]&&(t.changed||={...this.state.changed},t.changed&&(t.changed[e]=!1),n=!0)}}else if(this.scripts[e]&&(delete this.scripts[e],this.state.selected===e)){if(this.state.editing.indexOf(e)!==-1){let r=[...this.state.editing],i=r.indexOf(e);i!==-1&&(r.splice(i,1),t.editing=r,n=!0)}t.selected=this.state.editing[0]||``,n=!0}}}if(e.selected&&this.state.selected!==e.selected){let r=this.getScriptFromObject(e.selected);this.scripts[e.selected]||=r;let i=r&&JSON.stringify(this.scripts[e.selected])!==JSON.stringify(r),a=[...this.state.editing];e.selected&&!a.includes(e.selected)&&(a.push(e.selected),this.props.onSelectedChange(e.selected,a),window.localStorage.setItem(`Editor.editing`,JSON.stringify(a))),n=!0,t.changed||={...this.state.changed},t.changed[e.selected]=!!i,t.editing=a,t.selected=e.selected,t.blockly=this.scripts[e.selected].engineType===`Blockly`,t.rules=this.scripts[e.selected].engineType===`Rules`,t.verboseEnabled=this.scripts[e.selected].verbose,t.debugEnabled=this.scripts[e.selected].debug,t.showCompiledCode=!1}this.state.visible!==e.visible&&(n=!0,t.visible=e.visible),n&&this.setState(t,()=>this.setChangedInAdmin())}onRestart(){var e,t;(e=(t=this.props).onRestart)==null||e.call(t,this.state.selected)}onStartStop(){var e,t,n;let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));r.enabled=!r.enabled,this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Im.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem(`tour`,`true`)),this.state.changed[this.state.selected]){let e={...this.state.changed};e[this.state.selected]=!1,this.setState({changed:e},()=>{var e,t,n;this.setChangedInAdmin();let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)})}}onSaveAll(){let e={...this.state.changed};Object.keys(e).forEach(t=>{if(e[t]){var n,r,i;e[t]=!1;let a=JSON.parse(JSON.stringify(this.scripts[t]));this.props.password&&(n=this.props.objects[t].native)!=null&&n.protected&&(a.source=Zo(this.props.password,a.source)),(r=(i=this.props).onChange)==null||r.call(i,t,a)}}),this.setState({changed:e},()=>this.setChangedInAdmin())}onCancel(){var e;this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((e=this.props.objects[this.state.selected])==null?void 0:e.ts)||0;let t={...this.state.changed};t[this.state.selected]=!1,this.setState({changed:t},()=>this.setChangedInAdmin())}onRegisterSelect(e){this.getSelect=e}handleAiAction(e){let t={aiActionRequest:e};this.state.aiChatOpen||(window.localStorage.setItem(`Editor.aiChatOpen`,`true`),t.aiChatOpen=!0),this.setState(t)}getEditorApi(){let e=()=>this.scriptEditorRef.current;return{getSelection:()=>{var t,n;return((t=e())==null||(n=t.getEditorSelection)==null?void 0:n.call(t))??null},getContent:()=>{var t,n;return((t=e())==null||(n=t.getEditorContent)==null?void 0:n.call(t))??``},getCursorPosition:()=>{var t,n;return((t=e())==null||(n=t.getCursorPosition)==null?void 0:n.call(t))??null},highlightText:t=>{var n,r;return((n=e())==null||(r=n.highlightText)==null?void 0:r.call(n,t))??0},highlightLineRange:(t,n)=>{var r,i;return((r=e())==null||(i=r.highlightLineRange)==null?void 0:i.call(r,t,n))??!1},goToLine:(t,n)=>{var r,i;return((r=e())==null||(i=r.goToLine)==null?void 0:i.call(r,t,n))??!1},insertTextAtCursor:t=>{let n=e();return n!=null&&n.insertTextIntoEditor?(n.insertTextIntoEditor(t),!0):!1},replaceSelection:t=>{var n,r;return((n=e())==null||(r=n.replaceSelection)==null?void 0:r.call(n,t))??!1},getDiagnostics:()=>{var t,n;return((t=e())==null||(n=t.getDiagnostics)==null?void 0:n.call(t))??[]},getSymbols:async()=>{var t,n;return((t=e())==null||(n=t.getDocumentSymbols)==null?void 0:n.call(t))??[]}}}onConvertBlockly2JS(){this.showConfirmDialog(V.t(`It will not be possible to revert this operation.`),e=>{if(e){this.scripts[this.state.selected].engineType=`Javascript/js`;let e=this.scripts[this.state.selected].source.split(` +`)){let e=t.trim().replace(/^\/\*+/,``).replace(/\*+\/$/,``).replace(/^\/\//,``).replace(/^\*+/,``).trim();e.length>=3&&a.add(e.toLowerCase())}if(a.size===0){if(i.length===1){let e=i[0],t=r[e.endLine-1]??``;return{range:{startLine:e.startLine,startColumn:1,endLine:e.endLine,endColumn:t.length+1},confidence:.5,method:`similarity`}}return null}let o=i[0],s=0;for(let e of i){let t=0;for(let n=e.startLine-1;ns&&(s=n,o=e)}if(so(()=>Promise.resolve().then(()=>qO),void 0,import.meta.url)),mh=W.lazy(()=>o(()=>import(`./RulesEditor-B84Rh__9.js`),__vite__mapDeps([0,1,2]),import.meta.url)),hh=W.lazy(()=>o(()=>import(`./Debugger-CCdzg9pi.js`),__vite__mapDeps([3,4,5]),import.meta.url)),gh=W.lazy(()=>o(()=>import(`./ScriptEditorVanillaMonaco-0Mwut6ZY.js`).then(e=>e.n),__vite__mapDeps([5]),import.meta.url)),_h=W.lazy(()=>o(()=>import(`./ScriptEditor-COVJ2tCs.js`),__vite__mapDeps([6,5]),import.meta.url)),vh=W.lazy(()=>o(()=>import(`./AiChatPanel-9G6bIR9k.js`),__vite__mapDeps([7]),import.meta.url)),yh=W.lazy(()=>o(()=>import(`./AiDiffView-DtbcD6Yx.js`),__vite__mapDeps([8]),import.meta.url)),bh={Blockly:jo,"Javascript/js":Ao,Rules:No,def:Ao,"TypeScript/ts":Mo},xh=48,Sh=`#02a102`,Ch=`#70aae9`,wh=xe[400],Th=T[400],Y={toolbar:e=>({minHeight:38,boxShadow:`0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12)`,backgroundColor:e.palette.mode===`dark`?`#1e1e1e`:`#E2E2E2`}),toolbarButtons:{padding:4,marginLeft:4},toolbarButtonsDisabled:{filter:`grayscale(100%)`,opacity:.5},editorDiv:e=>({height:`calc(100% - ${(parseInt(e.toolbar.height,10)||48)+38+10}px)`,width:`100%`,overflow:`hidden`,position:`relative`}),textButton:{marginRight:10,minHeight:24,padding:`6px 16px`,height:32},saveButton:{background:`#ff9900`},textIcon:{marginLeft:8},tabIcon:{width:24,height:24,verticalAlign:`middle`,marginBottom:2,marginRight:2,borderRadius:3},hintIcon:{padding:`0 8px 0 8px`},hintText:{},hintButton:{marginTop:8,marginLeft:20},tabMenuButton:{position:`absolute`,top:0,right:0},tabChanged:e=>({color:e.palette.secondary.main}),tabText:{maxWidth:130,textOverflow:`ellipsis`,whiteSpace:`nowrap`,overflow:`hidden`,display:`inline-block`,verticalAlign:`middle`},tabChangedIcon:{color:`#FF0000`,fontSize:16,marginLeft:5},closeButton:{marginLeft:5},notRunning:{color:`#ffbc00`,marginRight:8,marginLeft:8},tabButton:{minHeight:48},tabButtonWrapper:{display:`inline-block`},menuIcon:{width:18,height:18,borderRadius:2,marginRight:5}},Eh=class e extends W.Component{constructor(e){var t;super(e),N(this,`getSelect`,null),N(this,`changedMirror`,{}),N(this,`cron`,{initValue:null,callback:null}),N(this,`scriptDialog`,{initValue:null,callback:null,args:null,isReturn:!1}),N(this,`objects`,void 0),N(this,`scripts`,void 0),N(this,`selectId`,{initValue:null,callback:null}),N(this,`confirmCallback`,null),N(this,`blocklyEditorRef`,W.createRef()),N(this,`scriptEditorRef`,W.createRef()),N(this,`lastKnownTs`,{}),N(this,`onBrowserClose`,e=>{let t=Object.keys(this.scripts).find(e=>JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e)));if(t){console.log(`Script ${JSON.stringify(this.scripts[t])}`);let n=V.t(`Configuration not saved.`);return e||=window.event,e&&(e.returnValue=n),n}}),N(this,`cachedScriptInfos`,null),N(this,`lastObjectsHash`,``),N(this,`setTourStep`,e=>this.setState({tourStep:e}));let n=window.localStorage.getItem(`Editor.selected`)||``,r=window.localStorage.getItem(`Editor.editing`)||`[]`,i;try{i=JSON.parse(r)}catch{i=[]}n&&!i.includes(n)&&i.push(n),n&&!this.props.password&&(t=this.props.objects[n])!=null&&(t=t.native)!=null&&t.protected&&(n=i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),!n&&i.length&&(n=this.props.password?i[0]:i.find(e=>{var t;return!((t=this.props.objects[e])!=null&&(t=t.native)!=null&&t.protected)})||``),this.state={askAboutDebug:!1,astroEvents:null,blockly:null,changed:{},cmdToBlockly:``,cmdToRules:``,confirm:``,debugEnabled:!1,editing:i,insert:``,instancesLoaded:!1,isTourOpen:window.localStorage.getItem(`tour`)!==`true`,menuDebugAnchorEl:null,menuOidDisplayAnchorEl:null,oidDisplayMode:parseInt(window.localStorage.getItem(`Blockly.FieldOID.displayMode`)||`0`,10)||0,oidShowIcon:window.localStorage.getItem(`Blockly.FieldOID.showIcon`)===`true`,menuOpened:!!this.props.menuOpened,menuTabsOpened:!1,aiChatOpen:window.localStorage.getItem(`Editor.aiChatOpen`)===`true`,aiDiffView:null,aiActionRequest:null,inlineAskHandler:null,aiCompletionsEnabled:window.localStorage.getItem(`Editor.aiCompletions`)!==`false`,triggerPrettier:1,scriptConflict:``,rules:null,runningInstances:this.props.runningInstances||{},searchText:``,selected:n,showAdapterDebug:!1,showAstro:!1,showCompiledCode:!1,showCron:!1,showDebugMenu:!1,showScript:!1,showSelectId:!1,themeType:this.props.themeType,toast:``,tourStep:Im.selectTriggers,verboseEnabled:!1,visible:e.visible},this.setChangedInAdmin(),window.systemLang=V.getLanguage(),window.main={objects:{},getObject:(e,t)=>this.props.socket.getObject(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),getState:(e,t)=>this.props.socket.getState(e).then(e=>t==null?void 0:t(null,e)).catch(e=>t==null?void 0:t(e)),instances:[],secrets:[],selectIdDialog:(e,t,n)=>{typeof t==`function`&&(n=t,t=null),this.selectId.callback=n,this.selectId.initValue=e,this.selectId.type=t,this.setState({showSelectId:!0})},cronDialog:(e,t)=>{this.cron.callback=t,this.cron.initValue=e,this.setState({showCron:!0})},showScriptDialog:(e,t,n,r)=>{this.scriptDialog.callback=r,this.scriptDialog.initValue=e,this.scriptDialog.args=t,this.scriptDialog.isReturn=n||!1,this.setState({showScript:!0})}},this.objects=e.objects,this.scripts={},this.getAllAdapterInstances().then(()=>{this.props.onSelectedChange&&this.state.selected&&setTimeout(()=>this.props.onSelectedChange(this.state.selected,this.state.editing),100)})}async getAllAdapterInstances(){let e=await this.props.socket.getAdapterInstances(!0),t={},n=e.map(e=>(t[e._id]=e,e._id));window.main.objects=t,window.main.instances=n,this.setState({instancesLoaded:!0})}static onInstanceChanged(e,t){if(e){if(!t&&window.main.instances.includes(e)){delete window.main.objects[e];let t=window.main.instances.indexOf(e);window.main.instances.splice(t,1)}else(t==null?void 0:t.type)===`instance`&&(window.main.instances.includes(e)||(window.main.instances.push(e),window.main.instances.sort()),window.main.objects[e]=t)}}setChangedInAdmin(){let e=Object.keys(this.state.changed).find(e=>this.state.changed[e]);Object.keys(this.state.changed).forEach(e=>{this.changedMirror[e]=this.state.changed[e]}),Object.keys(this.changedMirror).forEach(e=>{this.state.changed[e]===void 0&&delete this.changedMirror[e]}),this.props.onChangedChanged(this.changedMirror),window.parent!==void 0&&window.parent&&(window.parent.configNotSaved=!!e)}componentDidMount(){window.addEventListener(`beforeunload`,this.onBrowserClose,!1),this.props.socket.subscribeObject(`system.adapter.*`,e.onInstanceChanged),this.loadSecrets()}async loadSecrets(e){e||=this.state.runningInstances;let t=Object.keys(e).find(t=>e[t]);if(t)try{let e=await this.props.socket.sendTo(t.replace(`system.adapter.`,``),`getSecrets`,null);window.main.secrets=(e==null?void 0:e.secrets)||[]}catch(e){console.error(`Cannot read the credentials: ${e}`)}}componentWillUnmount(){window.removeEventListener(`beforeunload`,this.onBrowserClose),this.props.socket.unsubscribeObject(`system.adapter.*`,e.onInstanceChanged)}componentDidUpdate(e){if(e.scriptsHash!==this.props.scriptsHash)for(let e of this.state.editing){let t=this.props.objects[e];if(!t||t.type!==`script`)continue;let n=t.ts||0,r=this.lastKnownTs[e];r!==void 0&&n!==r&&(this.state.changed[e]?this.state.scriptConflict||this.setState({scriptConflict:e}):(this.scripts[e]=this.getScriptFromObject(e),this.lastKnownTs[e]=n))}}removeNonExistingScripts(e,t){e||=this.props,t||={};let n=!1;if(this.state.editing&&this.state.editing.find(t=>e&&!e.objects[t])){let e=[...this.state.editing];for(let t=e.length-1;t>=0;t--)this.objects[e[t]]||(n=!0,e.splice(t,1));n&&(t.editing=e),this.state.selected&&!this.objects[this.state.selected]&&(n=!0,t.selected=e[0]||``,t.selected&&this.scripts[t.selected]&&(this.state.blockly!==(this.scripts[t.selected].engineType===`Blockly`)&&(t.blockly=this.scripts[t.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[t.selected].engineType===`Rules`)&&(t.rules=this.scripts[t.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[t.selected].verbose&&(t.verboseEnabled=this.scripts[t.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[t.selected].debug&&(t.debugEnabled=this.scripts[t.selected].debug,n=!0)))}return n}UNSAFE_componentWillReceiveProps(e){let t={},n=!1;if(JSON.stringify(e.runningInstances)!==JSON.stringify(this.state.runningInstances)&&(n=!0,t.runningInstances=e.runningInstances,this.loadSecrets(e.runningInstances)),this.state.menuOpened!==e.menuOpened&&(t.menuOpened=e.menuOpened,n=!0),this.state.themeType!==e.themeType&&(t.themeType=e.themeType,n=!0),this.removeNonExistingScripts(e,t)&&(n=!0),this.state.searchText!==e.searchText&&(t.searchText=e.searchText,n=!0),this.objects!==e.objects){this.objects=e.objects,window.main.objects=e.objects,Object.keys(this.scripts).forEach(e=>{let t=this.scripts[e].source;this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=t}),this.state.selected&&this.objects[this.state.selected]&&(this.scripts[this.state.selected]||=JSON.parse(JSON.stringify(this.objects[this.state.selected].common)),this.state.blockly!==(this.scripts[this.state.selected].engineType===`Blockly`)&&(t.blockly=this.scripts[this.state.selected].engineType===`Blockly`,n=!0),this.state.rules!==(this.scripts[this.state.selected].engineType===`Rules`)&&(t.rules=this.scripts[this.state.selected].engineType===`Rules`,n=!0),this.state.verboseEnabled!==this.scripts[this.state.selected].verbose&&(t.verboseEnabled=this.scripts[this.state.selected].verbose,n=!0),this.state.debugEnabled!==this.scripts[this.state.selected].debug&&(t.debugEnabled=this.scripts[this.state.selected].debug,n=!0));let r=[...this.state.editing];for(let e=r.length-1;e>=0;e--)this.objects[r[e]]||(n=!0,r.splice(e,1),this.state.changed[r[e]]!==void 0&&(t.changed||={...this.state.changed},t.changed&&delete t.changed[r[e]]));this.state.selected&&!this.objects[this.state.selected]&&(t.selected=r[0]||``),n&&(t.editing=r)}else for(let e in this.scripts){var r;if(Object.prototype.hasOwnProperty.call(this.scripts,e)){if((r=this.objects[e])!=null&&r.common){if(this.objects[e].type===`script`){let r=this.scripts[e].source,o=JSON.parse(JSON.stringify(this.scripts[e]));if(o.source=this.objects[e].common.source,JSON.stringify(o)!==JSON.stringify(this.objects[e].common)&&(this.scripts[e]=JSON.parse(JSON.stringify(this.objects[e].common)),this.scripts[e].source=r),r!==this.objects[e].common.source){if(this.state.changed[e]){var i;(i=this.objects[e].from)!=null&&i.startsWith(`system.adapter.javascript.`)&&(this.objects[e].from=`system.adapter.admin.0`,this.setState({toast:V.t(`Script %s was modified on disk.`,e.split(`.`).pop())}))}else{var a;this.props.password&&(a=this.objects[e].native)!=null&&a.protected?this.scripts[e].source=Qo(this.props.password,this.objects[e].common.source):this.scripts[e].source=this.objects[e].common.source}}else this.state.changed[e]&&(t.changed||={...this.state.changed},t.changed&&(t.changed[e]=!1),n=!0)}}else if(this.scripts[e]&&(delete this.scripts[e],this.state.selected===e)){if(this.state.editing.indexOf(e)!==-1){let r=[...this.state.editing],i=r.indexOf(e);i!==-1&&(r.splice(i,1),t.editing=r,n=!0)}t.selected=this.state.editing[0]||``,n=!0}}}if(e.selected&&this.state.selected!==e.selected){let r=this.getScriptFromObject(e.selected);this.scripts[e.selected]||=r;let i=r&&JSON.stringify(this.scripts[e.selected])!==JSON.stringify(r),a=[...this.state.editing];e.selected&&!a.includes(e.selected)&&(a.push(e.selected),this.props.onSelectedChange(e.selected,a),window.localStorage.setItem(`Editor.editing`,JSON.stringify(a))),n=!0,t.changed||={...this.state.changed},t.changed[e.selected]=!!i,t.editing=a,t.selected=e.selected,t.blockly=this.scripts[e.selected].engineType===`Blockly`,t.rules=this.scripts[e.selected].engineType===`Rules`,t.verboseEnabled=this.scripts[e.selected].verbose,t.debugEnabled=this.scripts[e.selected].debug,t.showCompiledCode=!1}this.state.visible!==e.visible&&(n=!0,t.visible=e.visible),n&&this.setState(t,()=>this.setChangedInAdmin())}onRestart(){var e,t;(e=(t=this.props).onRestart)==null||e.call(t,this.state.selected)}onStartStop(){var e,t,n;let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));r.enabled=!r.enabled,this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)}onSave(){if(this.state.isTourOpen&&this.state.tourStep===Im.saveTheScript&&(this.setState({isTourOpen:!1}),window.localStorage.setItem(`tour`,`true`)),this.state.changed[this.state.selected]){let e={...this.state.changed};e[this.state.selected]=!1,this.setState({changed:e},()=>{var e,t,n;this.setChangedInAdmin();let r=JSON.parse(JSON.stringify(this.scripts[this.state.selected]));this.props.password&&(e=this.props.objects[this.state.selected].native)!=null&&e.protected&&(r.source=Zo(this.props.password,r.source)),(t=(n=this.props).onChange)==null||t.call(n,this.state.selected,r)})}}onSaveAll(){let e={...this.state.changed};Object.keys(e).forEach(t=>{if(e[t]){var n,r,i;e[t]=!1;let a=JSON.parse(JSON.stringify(this.scripts[t]));this.props.password&&(n=this.props.objects[t].native)!=null&&n.protected&&(a.source=Zo(this.props.password,a.source)),(r=(i=this.props).onChange)==null||r.call(i,t,a)}}),this.setState({changed:e},()=>this.setChangedInAdmin())}onCancel(){var e;this.scripts[this.state.selected]=this.getScriptFromObject(this.state.selected),this.lastKnownTs[this.state.selected]=((e=this.props.objects[this.state.selected])==null?void 0:e.ts)||0;let t={...this.state.changed};t[this.state.selected]=!1,this.setState({changed:t},()=>this.setChangedInAdmin())}onRegisterSelect(e){this.getSelect=e}handleAiAction(e){let t={aiActionRequest:e};this.state.aiChatOpen||(window.localStorage.setItem(`Editor.aiChatOpen`,`true`),t.aiChatOpen=!0),this.setState(t)}getEditorApi(){let e=()=>this.scriptEditorRef.current;return{getSelection:()=>{var t,n;return((t=e())==null||(n=t.getEditorSelection)==null?void 0:n.call(t))??null},getContent:()=>{var t,n;return((t=e())==null||(n=t.getEditorContent)==null?void 0:n.call(t))??``},getCursorPosition:()=>{var t,n;return((t=e())==null||(n=t.getCursorPosition)==null?void 0:n.call(t))??null},highlightText:t=>{var n,r;return((n=e())==null||(r=n.highlightText)==null?void 0:r.call(n,t))??0},highlightLineRange:(t,n)=>{var r,i;return((r=e())==null||(i=r.highlightLineRange)==null?void 0:i.call(r,t,n))??!1},goToLine:(t,n)=>{var r,i;return((r=e())==null||(i=r.goToLine)==null?void 0:i.call(r,t,n))??!1},insertTextAtCursor:t=>{let n=e();return n!=null&&n.insertTextIntoEditor?(n.insertTextIntoEditor(t),!0):!1},replaceSelection:t=>{var n,r;return((n=e())==null||(r=n.replaceSelection)==null?void 0:r.call(n,t))??!1},getDiagnostics:()=>{var t,n;return((t=e())==null||(n=t.getDiagnostics)==null?void 0:n.call(t))??[]},getSymbols:async()=>{var t,n;return((t=e())==null||(n=t.getDocumentSymbols)==null?void 0:n.call(t))??[]}}}onConvertBlockly2JS(){this.showConfirmDialog(V.t(`It will not be possible to revert this operation.`),e=>{if(e){this.scripts[this.state.selected].engineType=`Javascript/js`;let e=this.scripts[this.state.selected].source.split(` `);e.pop(),this.scripts[this.state.selected].source=e.join(` `);let t=this.state.selected,n={...this.state.changed};n[this.state.selected]=!0,this.setState({changed:n,blockly:!1,selected:``},()=>{this.setChangedInAdmin(),setTimeout(()=>this.setState({selected:t}),100)})}})}onChange(e){if(e.script!==void 0){if(e.script===this.scripts[this.state.selected].source)return;this.scripts[this.state.selected].source=e.script}e.debug!==void 0&&(this.scripts[this.state.selected].debug=e.debug),e.verbose!==void 0&&(this.scripts[this.state.selected].verbose=e.verbose);let t=JSON.stringify(this.scripts[this.state.selected])!==JSON.stringify(this.getScriptFromObject(this.state.selected));if(t!==!!this.state.changed[this.state.selected]){let e={...this.state.changed};e[this.state.selected]=t,this.objects[this.state.selected].from=`system.adapter.admin.0`,this.setState({changed:e},()=>this.setChangedInAdmin())}}onTabChange(e){var t,n;if(this.props.debugMode)return;window.localStorage.setItem(`Editor.selected`,e);let r=this.scripts[e]||this.getScriptFromObject(e);this.scripts[e]||(this.scripts[e]=r),this.lastKnownTs[e]===void 0&&this.props.objects[e]&&(this.lastKnownTs[e]=this.props.objects[e].ts||0),this.setState({selected:e,rules:r.engineType===`Rules`,blockly:r.engineType===`Blockly`,showCompiledCode:!1,verboseEnabled:r.verbose,debugEnabled:r.debug}),(t=(n=this.props).onSelectedChange)==null||t.call(n,e,this.state.editing)}isScriptChanged(e){return!!(this.scripts[e]&&this.props.objects[e]&&JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e)))}onTabClose(e,t){t==null||t.stopPropagation();let n=this.state.editing.indexOf(e);if(this.state.editing.includes(e)){if(this.isScriptChanged(e))this.showConfirmDialog(V.t(`Discard changes for %s`,this.props.objects[e].common.name),t=>{t&&(delete this.scripts[e],delete this.lastKnownTs[e],this.onTabClose(e))});else{let t=[...this.state.editing];t.splice(n,1);let r={editing:t};if(e===this.state.selected?r.selected=t.length?n===0||t.length===1?t[0]:t[n-1]:``:this.state.selected&&!t.length&&(r.selected=``),window.localStorage.setItem(`Editor.editing`,JSON.stringify(t)),r.selected!==void 0){r.changed||={...this.state.changed},r.changed[r.selected]=this.isScriptChanged(r.selected);let e=r.selected?this.scripts[r.selected]||this.getScriptFromObject(r.selected):void 0;r.blockly=(e==null?void 0:e.engineType)===`Blockly`,r.rules=(e==null?void 0:e.engineType)===`Rules`,r.verboseEnabled=!!(e!=null&&e.verbose),r.debugEnabled=!!(e!=null&&e.debug),r.showCompiledCode=!1}this.setState(r,()=>{if(this.setChangedInAdmin(),r.selected!==void 0){var e,t;(e=(t=this.props).onSelectedChange)==null||e.call(t,r.selected,this.state.editing),window.localStorage.setItem(`Editor.selected`,r.selected)}else{var n,i;(n=(i=this.props).onSelectedChange)==null||n.call(i,this.state.selected,this.state.editing)}})}}}showConfirmDialog(e,t){this.confirmCallback=t,this.setState({confirm:e})}sendCommandToBlockly(e){this.setState({cmdToBlockly:e},()=>setTimeout(()=>this.setState({cmdToBlockly:``}),200))}sendCommandToRules(e){this.setState({cmdToRules:e},()=>setTimeout(()=>this.setState({cmdToRules:``}),200))}static getText(e){return typeof e==`object`?e[V.getLanguage()]||e.en:e}getScriptFullName(t){let n=t.split(`.`);n.shift(),n.shift();let r=[],i=`script.js`;for(let t=0;tthis.onTabChange(t),indicatorColor:`primary`,style:{position:`relative`,marginLeft:10,width:this.state.editing.length>1?`calc(100% - 50px)`:`100%`,display:`inline-block`},textColor:`primary`,variant:`scrollable`,scrollButtons:`auto`,allowScrollButtonsMobile:!0,children:[this.state.editing.map(t=>{var n,r;if(!this.props.objects[t]){let e=[O(Se,{sx:this.isScriptChanged(t)?Y.tabChanged:void 0,style:Y.tabText,children:t.split(`.`).pop()},`text`),O(U,{onClick:e=>this.onTabClose(t,e),style:Y.closeButton,size:`small`,component:`span`,children:O(ne,{})},`icon`)];return O(oe,{wrapped:!0,href:`#${t}`,label:e,value:t,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},t)}if(!this.props.password&&(n=this.props.objects[t].native)!=null&&n.protected)return null;let i=e.getText(this.props.objects[t].common.name)||``,a=this.getScriptFullName(t);i.length>18&&(i=`${i.substring(0,15)}...`);let o=(r=this.getScriptFromObject(t))==null?void 0:r.source,s=this.scripts[t]&&o!==this.scripts[t].source,c=[O(Se,{sx:this.isScriptChanged(t)?Y.tabChanged:void 0,style:Y.tabText,children:i},`text`),s?O(`span`,{style:Y.tabChangedIcon,children:`▣`},`changedSign`):null,!this.props.debugInstance&&(!this.props.debugMode||this.state.selected!==t)&&O(U,{onClick:e=>this.onTabClose(t,e),style:Y.closeButton,size:`small`,component:`span`,children:O(ne,{})},`icon`)];return O(oe,{disabled:!!this.props.debugInstance||this.state.selected!==t&&this.props.debugMode,wrapped:!0,iconPosition:`start`,icon:O(`img`,{alt:``,src:bh[this.props.objects[t].common.engineType]||bh.def,style:Y.tabIcon},`icon`),href:`#${t}`,label:c,style:Y.tabButton,value:t,title:a,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},t)}),this.props.debugInstance?O(oe,{disabled:!1,wrapped:!0,href:`#${this.props.debugInstance.adapter}`,label:this.props.debugInstance.adapter,style:Y.tabButton,value:this.props.debugInstance.adapter,title:this.props.debugInstance.adapter,sx:{"& .MuiTab-wrapper":Y.tabButtonWrapper}},this.props.debugInstance.adapter):``]},`tabs1`),this.state.editing.length>1?O(U,{href:`#`,"aria-label":`Close all but current`,style:Y.tabMenuButton,title:V.t(`Close all but current`),"aria-haspopup":`false`,onClick:e=>{let t=[this.state.selected];Object.keys(this.scripts).forEach(e=>e!==this.state.selected&&JSON.stringify(this.scripts[e])!==JSON.stringify(this.getScriptFromObject(e))&&t.push(e)),window.localStorage.setItem(`Editor.editing`,JSON.stringify(t)),this.setState({menuTabsOpened:!1,editing:t})},size:`medium`,children:O(F,{})},`menuButton`):null]:O(Se,{sx:Y.toolbar,children:B(R,{color:`grey`,disabled:!0,style:Y.hintButton,href:``,children:[O(`span`,{children:V.t(`Click on this icon`)},`select2`),O(be,{style:Y.hintIcon},`select3`),O(`span`,{children:V.t(`for edit or create script`)},`select4`)]},`select1`)},`tabs2`)}getDebugMenu(){return this.state.showDebugMenu?B(_e,{id:`menu-debug`,anchorEl:this.state.menuDebugAnchorEl,open:this.state.showDebugMenu,onClose:()=>this.setState({showDebugMenu:!1,menuDebugAnchorEl:null}),slotProps:{root:{style:{maxHeight:xh*7.5}}},children:[B(y,{title:V.t(`debug_help`),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,debugEnabled:!this.state.debugEnabled},()=>this.onChange({debug:this.state.debugEnabled}))},children:[O(De,{checked:this.state.debugEnabled}),O(ae,{style:{...Y.menuIcon,color:Sh}}),V.t(`debug_label`)]},`debugEnabled`),B(y,{title:V.t(`verbose_help`),onClick:e=>{e.stopPropagation(),e.preventDefault(),this.setState({showDebugMenu:!1,menuDebugAnchorEl:null,verboseEnabled:!this.state.verboseEnabled},()=>this.onChange({verbose:this.state.verboseEnabled}))},children:[O(De,{checked:this.state.verboseEnabled}),O(S,{style:{...Y.menuIcon,color:Ch}}),V.t(`verbose_label`)]},`verboseEnabled`)]},`menuDebug`):null}getDebugBadge(){return[this.state.debugEnabled&&this.state.verboseEnabled?O(ae,{style:{...Y.menuIcon,color:Ch}},`DebugVerbose`):null,this.state.debugEnabled&&!this.state.verboseEnabled?O(ae,{style:{...Y.menuIcon,color:Sh}},`DebugNoVerbose`):null,!this.state.debugEnabled&&this.state.verboseEnabled?O(S,{style:{...Y.menuIcon,color:Ch}},`noDebugVerbose`):null]}getAskAboutDebug(){return this.state.askAboutDebug?O(Bt,{onClose:()=>{this.setState({askAboutDebug:!1},()=>this.props.onDebugModeChange(!0))},ok:V.t(`Yes`),cancel:V.t(`Cancel`),text:V.t(`The script will be stopped and must be activated manually after debugging. Continue?`)}):null}getToolbar(){var e,t;let n=!!(this.state.selected&&(e=this.scripts[this.state.selected])!=null&&e.engine&&this.state.runningInstances[this.scripts[this.state.selected].engine]),r=!!(this.state.selected&&(t=this.scripts[this.state.selected])!=null&&t.enabled);if(this.state.selected){let e=Object.keys(this.state.changed).filter(e=>this.state.changed[e]).length,t=this.state.changed[this.state.selected];return B(fe,{variant:`dense`,sx:Y.toolbar,children:[!this.props.debugInstance&&this.state.menuOpened&&this.props.onLocate&&O(U,{style:Y.toolbarButtons,title:V.t(`Locate file`),onClick:()=>this.props.onLocate(this.state.selected),size:`medium`,children:O(d,{})},`locate`),!this.props.debugInstance&&!t&&n?O(U,{disabled:this.props.debugMode,style:Y.toolbarButtons,onClick:()=>this.onRestart(),title:V.t(`Restart`),size:`medium`,children:O(jt,{})},`restart`):null,!this.props.debugInstance&&!t?O(U,{disabled:this.props.debugMode,onClick:()=>this.onStartStop(),title:r?V.t(`Pause script`):V.t(`Run script`),size:`medium`,style:{...Y.toolbarButtons,color:r?wh:Th},children:O(r?ve:Ce,{})},`start-stop`):null,!this.props.debugInstance&&!t&&!r?O(`span`,{style:Y.notRunning,children:V.t(`Script is not running`)}):null,!t&&r&&!n?O(`span`,{style:Y.notRunning,children:V.t(`Instance is disabled`)}):null,t?O(R,{color:`grey`,variant:`contained`,style:{...Y.textButton,...Y.saveButton},className:`button-save`,onClick:()=>this.onSave(),endIcon:O(D,{}),children:V.t(`Save`)},`save`):null,e>1||e===1&&!t?O(R,{color:`grey`,variant:`contained`,style:Y.textButton,onClick:()=>this.onSaveAll(),endIcon:O(D,{}),children:V.t(`Save all`)},`saveall`):null,t?O(R,{color:`grey`,variant:`contained`,style:Y.textButton,onClick:()=>this.onCancel(),endIcon:O(l,{}),children:V.t(`Cancel`)},`cancel`):null,!this.state.showCompiledCode&&!this.state.rules?O(U,{title:V.t(`Undo`),style:Y.toolbarButtons,onClick:()=>{if(this.state.blockly){var e;let t=(e=this.blocklyEditorRef.current)==null?void 0:e.blocklyWorkspace;t==null||t.undo(!1)}else{var t;(t=this.scriptEditorRef.current)==null||t.undo()}},size:`medium`,children:O(Ee,{})},`undo`):null,!this.state.showCompiledCode&&!this.state.rules?O(U,{title:V.t(`Redo`),style:Y.toolbarButtons,onClick:()=>{if(this.state.blockly){var e;let t=(e=this.blocklyEditorRef.current)==null?void 0:e.blocklyWorkspace;t==null||t.undo(!0)}else{var t;(t=this.scriptEditorRef.current)==null||t.redo()}},size:`medium`,children:O(A,{})},`redo`):null,O(`div`,{style:{flex:2}}),this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`OID display mode`,title:V.t(`OID display mode`),style:Y.toolbarButtons,onClick:e=>this.setState({menuOidDisplayAnchorEl:e.currentTarget}),size:`medium`,children:O(`img`,{src:fh[this.state.oidDisplayMode]||fh[0],alt:`OID`,width:36,height:22})},`oid-display-mode`),B(_e,{anchorEl:this.state.menuOidDisplayAnchorEl,open:!!this.state.menuOidDisplayAnchorEl,onClose:()=>this.setState({menuOidDisplayAnchorEl:null}),children:[fh.map((e,t)=>B(y,{selected:this.state.oidDisplayMode===t,onClick:()=>{var e,n;this.setState({oidDisplayMode:t,menuOidDisplayAnchorEl:null});let r=(e=window.scripts)==null?void 0:e.blocklyWorkspace;r&&(n=window.Blockly)!=null&&(n=n.FieldOID)!=null&&n.setDisplayMode&&window.Blockly.FieldOID.setDisplayMode(t,r)},children:[O(`img`,{src:e,alt:``,width:48,height:28,style:{marginRight:8}}),(()=>{var e,n,r;let i=(e=window.Blockly)==null||(e=e.FieldOID)==null||(e=e.DISPLAY_MODE_KEYS)==null?void 0:e[t];return i&&(((n=window.Blockly)==null||(n=n.Words)==null||(n=n[i])==null?void 0:n[V.getLanguage()])||((r=window.Blockly)==null||(r=r.Words)==null||(r=r[i])==null?void 0:r.en))||[`Show name`,`Show name path`,`Show ID`,`Show full ID`][t]})()]},`oid-mode-${t}`)),O(Fe,{}),B(y,{onClick:()=>{var e,t;let n=!this.state.oidShowIcon;this.setState({oidShowIcon:n});let r=(e=window.scripts)==null?void 0:e.blocklyWorkspace;r&&(t=window.Blockly)!=null&&(t=t.FieldOID)!=null&&t.setShowIcon&&window.Blockly.FieldOID.setShowIcon(n,r)},children:[O(De,{checked:this.state.oidShowIcon,style:{padding:0,marginRight:8}}),(()=>{var e,t;let n=`oid_show_icon`;return((e=window.Blockly)==null||(e=e.Words)==null||(e=e[n])==null?void 0:e[V.getLanguage()])||((t=window.Blockly)==null||(t=t.Words)==null||(t=t[n])==null?void 0:t.en)||`Show icon`})()]},`oid-show-icon`)]},`menuOidDisplay`),!this.props.debugInstance&&!this.state.showCompiledCode&&O(U,{style:Y.toolbarButtons,title:V.t(`Prettify the script`),onClick:()=>this.setState({triggerPrettier:this.state.triggerPrettier+1}),size:`medium`,children:O(se,{})},`prettier`),this.state.blockly&&!this.state.showCompiledCode?O(U,{"aria-label":`Export Blocks`,title:V.t(`Export blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`export`),size:`medium`,children:O(Ct,{})},`export`):null,this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`Import Blocks`,title:V.t(`Import blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`import`),size:`medium`,children:O(Lt,{})},`import`),this.state.blockly&&!this.state.showCompiledCode&&O(U,{"aria-label":`Check code`,title:V.t(`Check blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToBlockly(`check`),size:`medium`,children:O(ct,{})},`check`),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode?O(U,{"aria-label":`create CRON`,title:V.t(`Create or edit CRON or time wizard`),style:Y.toolbarButtons,onClick:()=>this.setState({showCron:!0}),size:`medium`,children:O(Ht,{})},`select-cron`):null,this.scripts[this.state.selected]&&this.scripts[this.state.selected].engineType!==`Rules`?O(Mt,{children:O(U,{"aria-label":`AI`,title:V.t(`AI Chat`),style:{...Y.toolbarButtons,...this.state.aiChatOpen?{color:`#4caf50`}:{}},size:`medium`,onClick:()=>{let e=!this.state.aiChatOpen;window.localStorage.setItem(`Editor.aiChatOpen`,String(e)),this.setState({aiChatOpen:e})},children:O(v,{})},`ai`)}):null,O(U,{"aria-label":`Show astronomical events`,title:V.t(`Show astronomical events`),style:Y.toolbarButtons,disabled:!n,onClick:()=>{this.setState({showAstro:!0,astroEvents:null}),this.props.socket.sendTo(this.scripts[this.state.selected].engine.replace(`system.adapter.`,``),`calcAstroAll`,{}).then(e=>this.setState({astroEvents:e}))},size:`medium`,children:O(h,{})},`show-astro`),!this.props.debugMode&&!this.state.blockly&&!this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`select ID`,title:V.t(`Insert object ID`),style:Y.toolbarButtons,onClick:()=>this.setState({showSelectId:!0}),size:`medium`,children:O(Je,{})},`select-id`),this.state.blockly&&!this.state.rules&&this.state.showCompiledCode&&O(R,{color:`grey`,"aria-label":`convert to javascript`,title:V.t(`Convert blockly to javascript for ever.`),onClick:()=>this.onConvertBlockly2JS(),children:`Blockly=>JS`},`convert2js`),this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`Export Blocks`,title:V.t(`Export blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToRules(`export`),size:`medium`,children:O(Ct,{})},`export`),this.state.rules&&!this.state.showCompiledCode&&O(U,{"aria-label":`Import Blocks`,title:V.t(`Import blocks`),style:Y.toolbarButtons,onClick:()=>this.sendCommandToRules(`import`),size:`medium`,children:O(Lt,{})},`import`),this.props.expertMode&&!t&&(this.props.debugMode||!this.state.blockly&&!this.state.rules||(this.state.blockly||this.state.rules)&&this.state.showCompiledCode)&&O(U,{style:Y.toolbarButtons,color:this.props.debugMode?`primary`:`default`,disabled:!this.props.debugMode&&!n,onClick:()=>{!this.props.debugMode&&r?this.setState({askAboutDebug:!0}):this.props.onDebugModeChange(!this.props.debugMode)},size:`medium`,children:O(ae,{style:{fontSize:32}})}),(this.state.blockly||this.state.rules)&&O(R,{"aria-label":`blockly`,title:V.t(`Show javascript code`),className:`button-js-code`,color:this.state.showCompiledCode?`secondary`:`inherit`,disabled:this.props.debugMode,style:{...Y.toolbarButtons,...this.props.debugMode?Y.toolbarButtonsDisabled:void 0,padding:`0 5px`},onClick:()=>{this.props.debugMode||(this.setState({showCompiledCode:!this.state.showCompiledCode}),this.state.isTourOpen&&this.state.tourStep===Im.showJavascript&&this.setState({tourStep:Im.switchBackToRules}),this.state.isTourOpen&&this.state.tourStep===Im.switchBackToRules&&this.setState({tourStep:Im.saveTheScript}))},children:O(`img`,{alt:this.state.blockly?`blockly2js`:`rules2js`,src:this.state.blockly?``+new URL(`blockly2js-B3Jxf2e-.svg`,import.meta.url).href:``+new URL(`rules2js-DnYyR8mI.svg`,import.meta.url).href})},`blockly-code`),O(U,{disabled:this.props.debugMode,"aria-label":`Debug menu`,title:V.t(`Debug options`),style:Y.toolbarButtons,onClick:e=>this.setState({showDebugMenu:!0,menuDebugAnchorEl:e.currentTarget}),size:`medium`,children:O(E,{style:Y.badgeMargin,badgeContent:this.getDebugBadge(),children:O(ft,{})})},`debug`)]},`toolbar1`)}return null}getScriptInfos(){let e=Object.keys(this.props.objects).join(`,`);return this.cachedScriptInfos&&this.lastObjectsHash===e?this.cachedScriptInfos:(this.lastObjectsHash=e,this.cachedScriptInfos=Vm(this.props.objects),this.cachedScriptInfos)}getScriptEditor(){if(!this.props.debugMode&&this.state.selected&&this.props.objects[this.state.selected]&&this.state.blockly!==null&&(!this.state.blockly||this.state.showCompiledCode)&&(!this.state.rules||this.state.showCompiledCode)){this.scripts[this.state.selected]||=this.getScriptFromObject(this.state.selected);let n=this.scripts[this.state.selected].engineType===`TypeScript/ts`?`typescript`:`javascript`,r=O(he,{fallback:O(Bm,{}),children:O(gh,{ref:this.scriptEditorRef,name:this.state.selected,adapterName:this.props.adapterName,insert:this.state.insert,onInserted:()=>this.setState({insert:``}),onForceSave:()=>this.onSave(),searchText:this.state.searchText,onRegisterSelect:e=>this.onRegisterSelect(e),readOnly:this.state.showCompiledCode,changed:this.state.changed[this.state.selected],code:this.scripts[this.state.selected].source||``,isDark:this.state.themeType===`dark`,socket:this.props.socket,runningInstances:this.state.runningInstances,triggerPrettier:this.state.triggerPrettier,onChange:e=>this.onChange({script:e}),language:n,aiCompletionsEnabled:this.state.aiCompletionsEnabled,onAiAction:e=>this.handleAiAction(e),onInlineAsk:this.state.inlineAskHandler?e=>this.state.inlineAskHandler(e.question,e.selectedCode):void 0},`scriptEditor1`)});if(this.state.aiDiffView)return O(Se,{sx:Y.editorDiv,children:O(he,{fallback:O(Bm,{}),children:O(yh,{originalCode:this.state.aiDiffView.original,modifiedCode:this.state.aiDiffView.modified,language:n,themeType:this.state.themeType,onAccept:e=>{this.onChange({script:e}),this.setState({aiDiffView:null})},onReject:()=>this.setState({aiDiffView:null})})})},`scriptEditorDiv`);if(this.state.aiChatOpen){var e,t;let i=window.localStorage.getItem(`Editor.aiChatSizes`),a=[70,30];try{i&&(a=JSON.parse(i))}catch{}return O(Se,{sx:Y.editorDiv,children:B(kn,{direction:wn.Horizontal,initialSizes:a,minWidths:[200,250],gutterClassName:this.state.themeType===`dark`?`Dark visGutter`:`Light visGutter`,onResizeFinished:(e,t)=>{window.localStorage.setItem(`Editor.aiChatSizes`,JSON.stringify(t))},children:[r,O(he,{fallback:O(Bm,{}),children:O(vh,{socket:this.props.socket,runningInstances:this.state.runningInstances,themeType:this.state.themeType,currentCode:((e=this.scripts[this.state.selected])==null?void 0:e.source)||``,currentLanguage:n,selectedCode:((t=this.getSelect)==null?void 0:t.call(this))||``,allScripts:this.getScriptInfos(),editorApi:this.getEditorApi(),aiActionRequest:this.state.aiActionRequest,onAiActionConsumed:()=>this.setState({aiActionRequest:null}),onRegisterInlineAsk:e=>this.setState({inlineAskHandler:e}),currentScriptId:this.state.selected,onInsertCode:e=>this.setState({insert:e}),onShowDiff:(e,t)=>{var n;let r=this.state.selected,i=((n=this.scripts[r])==null?void 0:n.source)||``,a=this.scriptEditorRef.current,o=(t,n)=>{a==null||a.showInlineDiff({range:t,originalText:n,modifiedText:e,onAccepted:()=>{var e;let t=(a==null||(e=a.getEditorContent)==null?void 0:e.call(a))||i;this.onChange({script:t})}})};if(t&&t.range&&t.scriptId===r){o(t.range,t.originalText);return}try{let t=dh(e,i);if(t){let e=i.split(` `).slice(t.range.startLine-1,t.range.endLine).join(` @@ -505,7 +505,7 @@ function ${t.FUNCTION_NAME_PLACEHOLDER_}(type, direction) { var compare = compareFuncs[type]; return function(a, b) { return compare(a, b) * direction; }; } - `),[n+`.slice().sort(`+t+`("`+e+`", `+r+`))`,f.FUNCTION_CALL]},lists_split:function(e,t){var n=t.valueToCode(e,`INPUT`,f.MEMBER);if(t=t.valueToCode(e,`DELIM`,f.NONE)||`''`,e=e.getFieldValue(`MODE`),e===`SPLIT`)n||=`''`,e=`split`;else if(e===`JOIN`)n||=`[]`,e=`join`;else throw Error(`Unknown mode: `+e);return[n+`.`+e+`(`+t+`)`,f.FUNCTION_CALL]}},h,g,_,v,b,x,S);for(let e in w)C.forBlock[e]=w[e];var T={};return T.JavascriptGenerator=m,T.Order=f,T.javascriptGenerator=C,t.__chunk_javascript=T,t.__chunk_javascript.__namespace__=t,t.__chunk_javascript})}))(),1).default,Vh=r(((e,t)=>{(function(n,r){if(typeof e==`object`)t.exports=r();else{var i=r();for(var a in i)n.Blockly.Msg[a]=i[a]}})(e,function(){var e=e||{Msg:Object.create(null)};return e.Msg.ADD_COMMENT=`Add Comment`,e.Msg.ALT_KEY=`Alt`,e.Msg.ANNOUNCE_MOVE_AFTER=`Moving %1 after %2.`,e.Msg.ANNOUNCE_MOVE_AROUND=`Moving %1 around %2.`,e.Msg.ANNOUNCE_MOVE_BEFORE=`Moving %1 before %2.`,e.Msg.ANNOUNCE_MOVE_CANCELED=`Canceled movement.`,e.Msg.ANNOUNCE_MOVE_INSIDE=`Moving %1 inside %2.`,e.Msg.ANNOUNCE_MOVE_OF=`%1 of %2`,e.Msg.ANNOUNCE_MOVE_TO=`Moving %1 to %2.`,e.Msg.ANNOUNCE_MOVE_WORKSPACE=`Moving %1 on workspace.`,e.Msg.ARIA_LABEL_ADD_ELSE_IF=`Add else if`,e.Msg.ARIA_LABEL_ADD_INPUT=`Add input`,e.Msg.ARIA_LABEL_ADD_LIST_ITEM=`Add list item`,e.Msg.ARIA_LABEL_ADD_TEXT=`Add text`,e.Msg.ARIA_LABEL_BUTTON=`button`,e.Msg.ARIA_LABEL_COMMENT=`Comment`,e.Msg.ARIA_LABEL_COMMENT_COLLAPSE=`Collapse Comment`,e.Msg.ARIA_LABEL_COMMENT_EXPAND=`Expand Comment`,e.Msg.ARIA_LABEL_FIELD_ANGLE=`%1 degrees`,e.Msg.ARIA_LABEL_HEADING=`heading`,e.Msg.ARIA_LABEL_REMOVE_ELSE_IF=`Remove else if`,e.Msg.ARIA_LABEL_REMOVE_INPUT=`Remove input`,e.Msg.ARIA_LABEL_REMOVE_LIST_ITEM=`Remove list item`,e.Msg.ARIA_LABEL_REMOVE_TEXT=`Remove text`,e.Msg.ARIA_LABEL_TRASH_EMPTY=`Trash, currently empty`,e.Msg.ARIA_TYPE_FIELD_ANGLE=`angle`,e.Msg.ARIA_TYPE_FIELD_BITMAP=`pixel image`,e.Msg.ARIA_TYPE_FIELD_CHECKBOX=`checkbox`,e.Msg.ARIA_TYPE_FIELD_COLOUR=`color`,e.Msg.ARIA_TYPE_FIELD_DATE=`date`,e.Msg.ARIA_TYPE_FIELD_DROPDOWN=`dropdown`,e.Msg.ARIA_TYPE_FIELD_GRID=`grid dropdown`,e.Msg.ARIA_TYPE_FIELD_IMAGE=`image`,e.Msg.ARIA_TYPE_FIELD_INPUT=`input`,e.Msg.ARIA_TYPE_FIELD_NUMBER=`number`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT=`text`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT=`input name`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE=`function name`,e.Msg.BACKSPACE_KEY=`Backspace`,e.Msg.BLOCK_LABEL_BEGIN_PREFIX=`Begin %1`,e.Msg.BLOCK_LABEL_BEGIN_STACK=`Begin stack`,e.Msg.BLOCK_LABEL_COLLAPSED=`collapsed`,e.Msg.BLOCK_LABEL_CONTAINER=`container`,e.Msg.BLOCK_LABEL_DISABLED=`disabled`,e.Msg.BLOCK_LABEL_HAS_BRANCHES=`has %1 branches`,e.Msg.BLOCK_LABEL_HAS_INPUT=`has input`,e.Msg.BLOCK_LABEL_HAS_INPUTS=`has inputs`,e.Msg.BLOCK_LABEL_REPLACEABLE=`replaceable`,e.Msg.BLOCK_LABEL_STACK_BLOCKS=`%1 stack blocks`,e.Msg.BLOCK_LABEL_STATEMENT=`statement`,e.Msg.BLOCK_LABEL_TOOLBOX_CATEGORY=`%1 category`,e.Msg.BLOCK_LABEL_VALUE=`value`,e.Msg.BUBBLE_LABEL_COMMENT=`Comment: %1`,e.Msg.BUBBLE_LABEL_DEFAULT=`Bubble`,e.Msg.BUBBLE_LABEL_WARNING=`Warning: %1`,e.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE=`Can't delete the variable '%1' because it's part of the definition of the function '%2'`,e.Msg.CAPS_LOCK_KEY=`Caps Lock`,e.Msg.CHANGE_VALUE_TITLE=`Change value:`,e.Msg.CHROME_OS=`ChromeOS`,e.Msg.CLEAN_UP=`Clean up Blocks`,e.Msg.CLOSE=`Close`,e.Msg.CLOSE_BACKPACK=`Close backpack`,e.Msg.COLLAPSED_WARNINGS_WARNING=`Collapsed blocks contain warnings.`,e.Msg.COLLAPSE_ALL=`Collapse Blocks`,e.Msg.COLLAPSE_BLOCK=`Collapse Block`,e.Msg.COLOUR_BLEND_COLOUR1=`colour 1`,e.Msg.COLOUR_BLEND_COLOUR2=`colour 2`,e.Msg.COLOUR_BLEND_HELPURL=`https://meyerweb.com/eric/tools/color-blend/#:::rgbp`,e.Msg.COLOUR_BLEND_RATIO=`ratio`,e.Msg.COLOUR_BLEND_TITLE=`blend`,e.Msg.COLOUR_BLEND_TOOLTIP=`Blends two colours together with a given ratio (0.0 - 1.0).`,e.Msg.COLOUR_PICKER_HELPURL=`https://en.wikipedia.org/wiki/Color`,e.Msg.COLOUR_PICKER_TOOLTIP=`Choose a colour from the palette.`,e.Msg.COLOUR_RANDOM_HELPURL=`http://randomcolour.com`,e.Msg.COLOUR_RANDOM_TITLE=`random colour`,e.Msg.COLOUR_RANDOM_TOOLTIP=`Choose a colour at random.`,e.Msg.COLOUR_RGB_BLUE=`blue`,e.Msg.COLOUR_RGB_GREEN=`green`,e.Msg.COLOUR_RGB_HELPURL=`https://www.december.com/html/spec/colorpercompact.html`,e.Msg.COLOUR_RGB_RED=`red`,e.Msg.COLOUR_RGB_TITLE=`colour with`,e.Msg.COLOUR_RGB_TOOLTIP=`Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.`,e.Msg.COMMAND_KEY=`Command`,e.Msg.CONTEXT_MENU_KEY=`≣ Menu`,e.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#loop-termination-blocks`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK=`break out of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE=`continue with next iteration of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK=`Break out of the containing loop.`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE=`Skip the rest of this loop, and continue with the next iteration.`,e.Msg.CONTROLS_FLOW_STATEMENTS_WARNING=`Warning: This block may only be used within a loop.`,e.Msg.CONTROLS_FOREACH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#for-each`,e.Msg.CONTROLS_FOREACH_TITLE=`for each item %1 in list %2`,e.Msg.CONTROLS_FOREACH_TOOLTIP=`For each item in a list, set the variable '%1' to the item, and then do some statements.`,e.Msg.CONTROLS_FOR_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#count-with`,e.Msg.CONTROLS_FOR_TITLE=`count with %1 from %2 to %3 by %4`,e.Msg.CONTROLS_FOR_TOOLTIP=`Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.`,e.Msg.CONTROLS_IF_ELSEIF_TOOLTIP=`Add a condition to the if block.`,e.Msg.CONTROLS_IF_ELSE_TOOLTIP=`Add a final, catch-all condition to the if block.`,e.Msg.CONTROLS_IF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/IfElse`,e.Msg.CONTROLS_IF_IF_TOOLTIP=`Add, remove, or reorder sections to reconfigure this if block.`,e.Msg.CONTROLS_IF_MSG_ELSE=`else`,e.Msg.CONTROLS_IF_MSG_ELSEIF=`else if`,e.Msg.CONTROLS_IF_MSG_IF=`if`,e.Msg.CONTROLS_IF_TOOLTIP_1=`If a value is true, then do some statements.`,e.Msg.CONTROLS_IF_TOOLTIP_2=`If a value is true, then do the first block of statements. Otherwise, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_3=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_4=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.`,e.Msg.CONTROLS_REPEAT_HELPURL=`https://en.wikipedia.org/wiki/For_loop`,e.Msg.CONTROLS_REPEAT_INPUT_DO=`do`,e.Msg.CONTROLS_REPEAT_TITLE=`repeat %1 times`,e.Msg.CONTROLS_REPEAT_TOOLTIP=`Do some statements several times.`,e.Msg.CONTROLS_WHILEUNTIL_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#repeat`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL=`repeat until`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE=`repeat while`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL=`While a value is false, then do some statements.`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE=`While a value is true, then do some statements.`,e.Msg.CONTROL_KEY=`Control`,e.Msg.COPY_ALL_TO_BACKPACK=`Copy All Blocks to Backpack`,e.Msg.COPY_SHORTCUT=`Copy`,e.Msg.COPY_TO_BACKPACK=`Copy to Backpack`,e.Msg.CURRENT_BLOCK_ANNOUNCEMENT=`Current block: %1`,e.Msg.CUT_SHORTCUT=`Cut`,e.Msg.DELETE_ALL_BLOCKS=`Delete all %1 blocks?`,e.Msg.DELETE_BLOCK=`Delete Block`,e.Msg.DELETE_KEY=`Delete`,e.Msg.DELETE_VARIABLE=`Delete the '%1' variable`,e.Msg.DELETE_VARIABLE_CONFIRMATION=`Delete %1 uses of the '%2' variable?`,e.Msg.DELETE_X_BLOCKS=`Delete %1 Blocks`,e.Msg.DIALOG_CANCEL=`Cancel`,e.Msg.DIALOG_OK=`OK`,e.Msg.DISABLE_BLOCK=`Disable Block`,e.Msg.DUPLICATE_BLOCK=`Duplicate`,e.Msg.DUPLICATE_COMMENT=`Duplicate Comment`,e.Msg.EDIT_BLOCK_CONTENTS=`Edit Block contents`,e.Msg.EMPTY_BACKPACK=`Empty Backpack`,e.Msg.ENABLE_BLOCK=`Enable Block`,e.Msg.END_KEY=`End`,e.Msg.ENTER_KEY=`Enter`,e.Msg.ESCAPE=`Escape`,e.Msg.EXPAND_ALL=`Expand Blocks`,e.Msg.EXPAND_BLOCK=`Expand Block`,e.Msg.EXTERNAL_INPUTS=`External Inputs`,e.Msg.FIELD_BITMAP_ARIA_VALUE=`%1 by %2, %3 pixels on`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_CLEAR=`Clear`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE=`Randomize`,e.Msg.FIELD_BITMAP_PIXEL_LABEL=`%1, row %2, column %3`,e.Msg.FIELD_BITMAP_PIXEL_OFF=`off`,e.Msg.FIELD_BITMAP_PIXEL_ON=`on`,e.Msg.FIELD_LABEL_CHECKBOX_CHECKED=`Checked`,e.Msg.FIELD_LABEL_CHECKBOX_UNCHECKED=`Not checked`,e.Msg.FIELD_LABEL_EDIT_PREFIX=`Edit %1`,e.Msg.FIELD_LABEL_EMPTY=`empty`,e.Msg.FIELD_LABEL_OPTION_INDEX=`Option %1`,e.Msg.FIELD_LABEL_VARIABLE=`Variable '%1'`,e.Msg.FIELD_MULTILINEINPUT_FINISH_EDITING=`Finish editing`,e.Msg.FIELD_MULTILINEINPUT_NEW_LINE=`New line`,e.Msg.HELP=`Help`,e.Msg.HELP_PROMPT=`Press %1 for help on keyboard controls.`,e.Msg.HOME_KEY=`Home`,e.Msg.ICON_LABEL_COMMENT_CLOSED=`Open Comment`,e.Msg.ICON_LABEL_COMMENT_OPEN=`Close Comment`,e.Msg.ICON_LABEL_DEFAULT=`Icon`,e.Msg.ICON_LABEL_MUTATOR_CLOSED=`Edit this block`,e.Msg.ICON_LABEL_MUTATOR_OPEN=`Close block editor`,e.Msg.ICON_LABEL_WARNING_CLOSED=`Open Warning`,e.Msg.ICON_LABEL_WARNING_OPEN=`Close Warning`,e.Msg.INLINE_INPUTS=`Inline Inputs`,e.Msg.INPUT_LABEL_CONDITION=`condition`,e.Msg.INPUT_LABEL_CONDITION_A=`first condition`,e.Msg.INPUT_LABEL_CONDITION_B=`second condition`,e.Msg.INPUT_LABEL_EMPTY=`Empty`,e.Msg.INPUT_LABEL_END_STATEMENT=`End %1`,e.Msg.INPUT_LABEL_INDEX=`input %1`,e.Msg.INPUT_LABEL_LISTS_CREATE_WITH_ITEM=`value %1`,e.Msg.INPUT_LABEL_LISTS_DELIMITER=`delimiter`,e.Msg.INPUT_LABEL_LISTS_END_POSITION=`end position`,e.Msg.INPUT_LABEL_LISTS_LIST_FROM_TEXT=`text to split`,e.Msg.INPUT_LABEL_LISTS_POSITION=`position within list`,e.Msg.INPUT_LABEL_LISTS_REPEAT_ITEM=`value to repeat`,e.Msg.INPUT_LABEL_LISTS_REPEAT_NUM=`number of times to repeat`,e.Msg.INPUT_LABEL_LISTS_START_POSITION=`start position`,e.Msg.INPUT_LABEL_LISTS_TEXT_FROM_LIST=`list to join`,e.Msg.INPUT_LABEL_LISTS_TO_CHANGE=`list to change`,e.Msg.INPUT_LABEL_LISTS_TO_CHECK=`list to check`,e.Msg.INPUT_LABEL_LISTS_VALUE_TO_SET=`value to set`,e.Msg.INPUT_LABEL_LOOP_BY=`increment`,e.Msg.INPUT_LABEL_LOOP_FROM=`starting number`,e.Msg.INPUT_LABEL_LOOP_LIST=`list to iterate over`,e.Msg.INPUT_LABEL_LOOP_TIMES=`number of times to repeat`,e.Msg.INPUT_LABEL_LOOP_TO=`ending number`,e.Msg.INPUT_LABEL_MATH_CHANGE_BY=`amount to change by`,e.Msg.INPUT_LABEL_MATH_CONSTRAIN_VALUE=`number to constrain`,e.Msg.INPUT_LABEL_MATH_DIVIDEND=`dividend`,e.Msg.INPUT_LABEL_MATH_DIVISOR=`divisor`,e.Msg.INPUT_LABEL_NUMBER=`number`,e.Msg.INPUT_LABEL_NUMBER_A=`first number`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_X=`x coordinate`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_Y=`y coordinate`,e.Msg.INPUT_LABEL_NUMBER_B=`second number`,e.Msg.INPUT_LABEL_NUMBER_LIST=`list of numbers`,e.Msg.INPUT_LABEL_NUMBER_MAX=`maximum`,e.Msg.INPUT_LABEL_NUMBER_MIN=`minimum`,e.Msg.INPUT_LABEL_NUMBER_TO_CHECK=`number to check`,e.Msg.INPUT_LABEL_STATEMENT=`statement position`,e.Msg.INPUT_LABEL_TEXT_APPEND=`value to append`,e.Msg.INPUT_LABEL_TEXT_END_POSITION=`end position`,e.Msg.INPUT_LABEL_TEXT_JOIN_ITEM=`value %1`,e.Msg.INPUT_LABEL_TEXT_POSITION=`letter position`,e.Msg.INPUT_LABEL_TEXT_PROMPT_MESSAGE=`message`,e.Msg.INPUT_LABEL_TEXT_START_POSITION=`start position`,e.Msg.INPUT_LABEL_TEXT_TO_CHANGE=`text to change`,e.Msg.INPUT_LABEL_TEXT_TO_CHECK=`text to check`,e.Msg.INPUT_LABEL_TEXT_TO_FIND=`text to find`,e.Msg.INPUT_LABEL_TEXT_TO_REPLACE=`text to replace`,e.Msg.INPUT_LABEL_VALUE=`value position`,e.Msg.INPUT_LABEL_VALUE_A=`first value`,e.Msg.INPUT_LABEL_VALUE_B=`second value`,e.Msg.INPUT_LABEL_VARIABLES_SET=`value to set`,e.Msg.INSERT_KEY=`Insert`,e.Msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT=`Use %1 to navigate inside of blocks.`,e.Msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT=`Use the arrow keys to move, then %1 to accept the position.`,e.Msg.KEYBOARD_NAV_COPIED_HINT=`Copied. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_CUT_HINT=`Cut. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_FLYOUT_LABEL_HINT=`Use the arrow keys to navigate to a block, or press %1 to go to the next heading.`,e.Msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT=`Hold %1 and use arrow keys to move freely, then %2 to accept the position.`,e.Msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT=`Use the arrow keys to navigate.`,e.Msg.LINUX=`Linux`,e.Msg.LISTS_CREATE_EMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-empty-list`,e.Msg.LISTS_CREATE_EMPTY_TITLE=`create empty list`,e.Msg.LISTS_CREATE_EMPTY_TOOLTIP=`Returns a list, of length 0, containing no data records`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD=`list`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP=`Add, remove, or reorder sections to reconfigure this list block.`,e.Msg.LISTS_CREATE_WITH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_CREATE_WITH_INPUT_WITH=`create list with`,e.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP=`Add an item to the list.`,e.Msg.LISTS_CREATE_WITH_TOOLTIP=`Create a list with any number of items.`,e.Msg.LISTS_GET_INDEX_FIRST=`first`,e.Msg.LISTS_GET_INDEX_FROM_END=`# from end`,e.Msg.LISTS_GET_INDEX_FROM_START=`#`,e.Msg.LISTS_GET_INDEX_GET=`get`,e.Msg.LISTS_GET_INDEX_GET_REMOVE=`get and remove`,e.Msg.LISTS_GET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-items-from-a-list`,e.Msg.LISTS_GET_INDEX_LAST=`last`,e.Msg.LISTS_GET_INDEX_RANDOM=`random`,e.Msg.LISTS_GET_INDEX_REMOVE=`remove`,e.Msg.LISTS_GET_INDEX_TAIL=``,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST=`Returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM=`Returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST=`Returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM=`Returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST=`Removes and returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM=`Removes and returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST=`Removes and returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM=`Removes and returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST=`Removes the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM=`Removes the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST=`Removes the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM=`Removes a random item in a list.`,e.Msg.LISTS_GET_SUBLIST_END_FROM_END=`to # from end`,e.Msg.LISTS_GET_SUBLIST_END_FROM_START=`to #`,e.Msg.LISTS_GET_SUBLIST_END_LAST=`to last`,e.Msg.LISTS_GET_SUBLIST_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-a-sublist`,e.Msg.LISTS_GET_SUBLIST_START_FIRST=`get sub-list from first`,e.Msg.LISTS_GET_SUBLIST_START_FROM_END=`get sub-list from # from end`,e.Msg.LISTS_GET_SUBLIST_START_FROM_START=`get sub-list from #`,e.Msg.LISTS_GET_SUBLIST_TAIL=``,e.Msg.LISTS_GET_SUBLIST_TOOLTIP=`Creates a copy of the specified portion of a list.`,e.Msg.LISTS_INDEX_FROM_END_TOOLTIP=`%1 is the last item.`,e.Msg.LISTS_INDEX_FROM_START_TOOLTIP=`%1 is the first item.`,e.Msg.LISTS_INDEX_OF_FIRST=`find first occurrence of item`,e.Msg.LISTS_INDEX_OF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#finding-items-in-a-list`,e.Msg.LISTS_INDEX_OF_LAST=`find last occurrence of item`,e.Msg.LISTS_INDEX_OF_TOOLTIP=`Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.`,e.Msg.LISTS_INLIST=`in list`,e.Msg.LISTS_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#is-empty`,e.Msg.LISTS_ISEMPTY_TITLE=`%1 is empty`,e.Msg.LISTS_ISEMPTY_TOOLTIP=`Returns true if the list is empty.`,e.Msg.LISTS_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#length-of`,e.Msg.LISTS_LENGTH_TITLE=`length of %1`,e.Msg.LISTS_LENGTH_TOOLTIP=`Returns the length of a list.`,e.Msg.LISTS_REPEAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_REPEAT_TITLE=`create list with item %1 repeated %2 times`,e.Msg.LISTS_REPEAT_TOOLTIP=`Creates a list consisting of the given value repeated the specified number of times.`,e.Msg.LISTS_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#reversing-a-list`,e.Msg.LISTS_REVERSE_MESSAGE0=`reverse %1`,e.Msg.LISTS_REVERSE_TOOLTIP=`Reverse a copy of a list.`,e.Msg.LISTS_SET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#in-list--set`,e.Msg.LISTS_SET_INDEX_INPUT_TO=`as`,e.Msg.LISTS_SET_INDEX_INSERT=`insert at`,e.Msg.LISTS_SET_INDEX_SET=`set`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST=`Inserts the item at the start of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM=`Inserts the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST=`Append the item to the end of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM=`Inserts the item randomly in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST=`Sets the first item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM=`Sets the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST=`Sets the last item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM=`Sets a random item in a list.`,e.Msg.LISTS_SORT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#sorting-a-list`,e.Msg.LISTS_SORT_ORDER_ASCENDING=`ascending`,e.Msg.LISTS_SORT_ORDER_DESCENDING=`descending`,e.Msg.LISTS_SORT_TITLE=`sort %1 %2 %3`,e.Msg.LISTS_SORT_TOOLTIP=`Sort a copy of a list.`,e.Msg.LISTS_SORT_TYPE_IGNORECASE=`alphabetic, ignore case`,e.Msg.LISTS_SORT_TYPE_NUMERIC=`numeric`,e.Msg.LISTS_SORT_TYPE_TEXT=`alphabetic`,e.Msg.LISTS_SPLIT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#splitting-strings-and-joining-lists`,e.Msg.LISTS_SPLIT_LIST_FROM_TEXT=`make list from text`,e.Msg.LISTS_SPLIT_TEXT_FROM_LIST=`make text from list`,e.Msg.LISTS_SPLIT_TOOLTIP_JOIN=`Join a list of texts into one text, separated by a delimiter.`,e.Msg.LISTS_SPLIT_TOOLTIP_SPLIT=`Split text into a list of texts, breaking at each delimiter.`,e.Msg.LISTS_SPLIT_WITH_DELIMITER=`with delimiter`,e.Msg.LOGIC_BOOLEAN_FALSE=`false`,e.Msg.LOGIC_BOOLEAN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#values`,e.Msg.LOGIC_BOOLEAN_TOOLTIP=`Returns either true or false.`,e.Msg.LOGIC_BOOLEAN_TRUE=`true`,e.Msg.LOGIC_COMPARE_EQ_ARIA=`equals`,e.Msg.LOGIC_COMPARE_GTE_ARIA=`greater than or equal to`,e.Msg.LOGIC_COMPARE_GT_ARIA=`greater than`,e.Msg.LOGIC_COMPARE_HELPURL=`https://en.wikipedia.org/wiki/Inequality_(mathematics)`,e.Msg.LOGIC_COMPARE_LTE_ARIA=`less than or equal to`,e.Msg.LOGIC_COMPARE_LT_ARIA=`less than`,e.Msg.LOGIC_COMPARE_NEQ_ARIA=`not equals`,e.Msg.LOGIC_COMPARE_TOOLTIP_EQ=`Return true if both inputs equal each other.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GT=`Return true if the first input is greater than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GTE=`Return true if the first input is greater than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LT=`Return true if the first input is smaller than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LTE=`Return true if the first input is smaller than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_NEQ=`Return true if both inputs are not equal to each other.`,e.Msg.LOGIC_NEGATE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#not`,e.Msg.LOGIC_NEGATE_TITLE=`not %1`,e.Msg.LOGIC_NEGATE_TOOLTIP=`Returns true if the input is false. Returns false if the input is true.`,e.Msg.LOGIC_NULL=`null`,e.Msg.LOGIC_NULL_HELPURL=`https://en.wikipedia.org/wiki/Nullable_type`,e.Msg.LOGIC_NULL_TOOLTIP=`Returns null.`,e.Msg.LOGIC_OPERATION_AND=`and`,e.Msg.LOGIC_OPERATION_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#logical-operations`,e.Msg.LOGIC_OPERATION_OR=`or`,e.Msg.LOGIC_OPERATION_TOOLTIP_AND=`Return true if both inputs are true.`,e.Msg.LOGIC_OPERATION_TOOLTIP_OR=`Return true if at least one of the inputs is true.`,e.Msg.LOGIC_TERNARY_CONDITION=`test`,e.Msg.LOGIC_TERNARY_HELPURL=`https://en.wikipedia.org/wiki/%3F:`,e.Msg.LOGIC_TERNARY_IF_FALSE=`if false`,e.Msg.LOGIC_TERNARY_IF_TRUE=`if true`,e.Msg.LOGIC_TERNARY_TOOLTIP=`Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.`,e.Msg.MAC_OS=`macOS`,e.Msg.MATH_ADDITION_SYMBOL=`+`,e.Msg.MATH_ADDITION_SYMBOL_ARIA=`plus`,e.Msg.MATH_ARITHMETIC_HELPURL=`https://en.wikipedia.org/wiki/Arithmetic`,e.Msg.MATH_ARITHMETIC_TOOLTIP_ADD=`Return the sum of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE=`Return the quotient of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS=`Return the difference of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY=`Return the product of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_POWER=`Return the first number raised to the power of the second number.`,e.Msg.MATH_ATAN2_HELPURL=`https://en.wikipedia.org/wiki/Atan2`,e.Msg.MATH_ATAN2_TITLE=`atan2 of X:%1 Y:%2`,e.Msg.MATH_ATAN2_TOOLTIP=`Return the arctangent of point (X, Y) in degrees from -180 to 180.`,e.Msg.MATH_CHANGE_HELPURL=`https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter`,e.Msg.MATH_CHANGE_TITLE=`change %1 by %2`,e.Msg.MATH_CHANGE_TOOLTIP=`Add a number to variable '%1'.`,e.Msg.MATH_CONSTANT_E_ARIA=`e`,e.Msg.MATH_CONSTANT_GOLDEN_RATIO_ARIA=`golden ratio`,e.Msg.MATH_CONSTANT_HELPURL=`https://en.wikipedia.org/wiki/Mathematical_constant`,e.Msg.MATH_CONSTANT_INFINITY_ARIA=`infinity`,e.Msg.MATH_CONSTANT_PI_ARIA=`pi`,e.Msg.MATH_CONSTANT_SQRT1_2_ARIA=`square root of 1 over 2`,e.Msg.MATH_CONSTANT_SQRT2_ARIA=`square root of 2`,e.Msg.MATH_CONSTANT_TOOLTIP=`Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).`,e.Msg.MATH_CONSTRAIN_HELPURL=`https://en.wikipedia.org/wiki/Clamping_(graphics)`,e.Msg.MATH_CONSTRAIN_TITLE=`constrain %1 low %2 high %3`,e.Msg.MATH_CONSTRAIN_TOOLTIP=`Constrain a number to be between the specified limits (inclusive).`,e.Msg.MATH_DIVISION_SYMBOL=`÷`,e.Msg.MATH_DIVISION_SYMBOL_ARIA=`divided by`,e.Msg.MATH_IS_DIVISIBLE_BY=`is divisible by`,e.Msg.MATH_IS_EVEN=`is even`,e.Msg.MATH_IS_NEGATIVE=`is negative`,e.Msg.MATH_IS_ODD=`is odd`,e.Msg.MATH_IS_POSITIVE=`is positive`,e.Msg.MATH_IS_PRIME=`is prime`,e.Msg.MATH_IS_TOOLTIP=`Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.`,e.Msg.MATH_IS_WHOLE=`is whole`,e.Msg.MATH_MODULO_HELPURL=`https://en.wikipedia.org/wiki/Modulo_operation`,e.Msg.MATH_MODULO_TITLE=`remainder of %1 ÷ %2`,e.Msg.MATH_MODULO_TOOLTIP=`Return the remainder from dividing the two numbers.`,e.Msg.MATH_MULTIPLICATION_SYMBOL=`×`,e.Msg.MATH_MULTIPLICATION_SYMBOL_ARIA=`times`,e.Msg.MATH_NUMBER_HELPURL=`https://en.wikipedia.org/wiki/Number`,e.Msg.MATH_NUMBER_TOOLTIP=`A number.`,e.Msg.MATH_ONLIST_HELPURL=``,e.Msg.MATH_ONLIST_OPERATOR_AVERAGE=`average of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX=`max of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX_ARIA=`maximum`,e.Msg.MATH_ONLIST_OPERATOR_MEDIAN=`median of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN=`min of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN_ARIA=`minimum`,e.Msg.MATH_ONLIST_OPERATOR_MODE=`modes of list`,e.Msg.MATH_ONLIST_OPERATOR_RANDOM=`random item of list`,e.Msg.MATH_ONLIST_OPERATOR_STD_DEV=`standard deviation of list`,e.Msg.MATH_ONLIST_OPERATOR_SUM=`sum of list`,e.Msg.MATH_ONLIST_TOOLTIP_AVERAGE=`Return the average (arithmetic mean) of the numeric values in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MAX=`Return the largest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MEDIAN=`Return the median number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MIN=`Return the smallest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MODE=`Return a list of the most common item(s) in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_RANDOM=`Return a random element from the list.`,e.Msg.MATH_ONLIST_TOOLTIP_STD_DEV=`Return the standard deviation of the list.`,e.Msg.MATH_ONLIST_TOOLTIP_SUM=`Return the sum of all the numbers in the list.`,e.Msg.MATH_POWER_SYMBOL=`^`,e.Msg.MATH_POWER_SYMBOL_ARIA=`to the power of`,e.Msg.MATH_RANDOM_FLOAT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM=`random fraction`,e.Msg.MATH_RANDOM_FLOAT_TOOLTIP=`Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).`,e.Msg.MATH_RANDOM_INT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_INT_TITLE=`random integer from %1 to %2`,e.Msg.MATH_RANDOM_INT_TOOLTIP=`Return a random integer between the two specified limits, inclusive.`,e.Msg.MATH_ROUND_HELPURL=`https://en.wikipedia.org/wiki/Rounding`,e.Msg.MATH_ROUND_OPERATOR_ROUND=`round`,e.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN=`round down`,e.Msg.MATH_ROUND_OPERATOR_ROUNDUP=`round up`,e.Msg.MATH_ROUND_TOOLTIP=`Round a number up or down.`,e.Msg.MATH_SINGLE_HELPURL=`https://en.wikipedia.org/wiki/Square_root`,e.Msg.MATH_SINGLE_OP_ABSOLUTE=`absolute`,e.Msg.MATH_SINGLE_OP_ABSOLUTE_ARIA=`absolute value`,e.Msg.MATH_SINGLE_OP_EXP_ARIA=`e to the power of`,e.Msg.MATH_SINGLE_OP_LN_ARIA=`natural logarithm`,e.Msg.MATH_SINGLE_OP_LOG10_ARIA=`base 10 logarithm`,e.Msg.MATH_SINGLE_OP_NEG_ARIA=`negative`,e.Msg.MATH_SINGLE_OP_POW10_ARIA=`10 to the power of`,e.Msg.MATH_SINGLE_OP_ROOT=`square root`,e.Msg.MATH_SINGLE_TOOLTIP_ABS=`Return the absolute value of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_EXP=`Return e to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LN=`Return the natural logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LOG10=`Return the base 10 logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_NEG=`Return the negation of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_POW10=`Return 10 to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_ROOT=`Return the square root of a number.`,e.Msg.MATH_SUBTRACTION_SYMBOL=`-`,e.Msg.MATH_SUBTRACTION_SYMBOL_ARIA=`minus`,e.Msg.MATH_TRIG_ACOS=`acos`,e.Msg.MATH_TRIG_ACOS_ARIA=`inverse cosine`,e.Msg.MATH_TRIG_ASIN=`asin`,e.Msg.MATH_TRIG_ASIN_ARIA=`inverse sine`,e.Msg.MATH_TRIG_ATAN=`atan`,e.Msg.MATH_TRIG_ATAN_ARIA=`inverse tangent`,e.Msg.MATH_TRIG_COS=`cos`,e.Msg.MATH_TRIG_COS_ARIA=`cosine`,e.Msg.MATH_TRIG_HELPURL=`https://en.wikipedia.org/wiki/Trigonometric_functions`,e.Msg.MATH_TRIG_SIN=`sin`,e.Msg.MATH_TRIG_SIN_ARIA=`sine`,e.Msg.MATH_TRIG_TAN=`tan`,e.Msg.MATH_TRIG_TAN_ARIA=`tangent`,e.Msg.MATH_TRIG_TOOLTIP_ACOS=`Return the arccosine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ASIN=`Return the arcsine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ATAN=`Return the arctangent of a number.`,e.Msg.MATH_TRIG_TOOLTIP_COS=`Return the cosine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_SIN=`Return the sine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_TAN=`Return the tangent of a degree (not radian).`,e.Msg.MINIMAP_ARIA_LABEL=`Workspace minimap. Use the arrow keys to pan the workspace.`,e.Msg.MOVE_BLOCK=`Move Block`,e.Msg.NEW_COLOUR_VARIABLE=`Create colour variable...`,e.Msg.NEW_NUMBER_VARIABLE=`Create number variable...`,e.Msg.NEW_STRING_VARIABLE=`Create string variable...`,e.Msg.NEW_VARIABLE=`Create variable...`,e.Msg.NEW_VARIABLE_TITLE=`New variable name:`,e.Msg.NEW_VARIABLE_TYPE_TITLE=`New variable type:`,e.Msg.NO_PARENT_ANNOUNCEMENT=`Current block has no parent`,e.Msg.OPEN_BACKPACK=`Open backpack`,e.Msg.OPEN_TRASH=`Open trash`,e.Msg.OPTION_KEY=`Option`,e.Msg.ORDINAL_NUMBER_SUFFIX=``,e.Msg.PAGE_DOWN_KEY=`Page Down`,e.Msg.PAGE_UP_KEY=`Page Up`,e.Msg.PARENT_BLOCKS_ANNOUNCEMENT=`Parent blocks: %1`,e.Msg.PASTE_ALL_FROM_BACKPACK=`Paste All Blocks from Backpack`,e.Msg.PASTE_SHORTCUT=`Paste`,e.Msg.PAUSE_KEY=`Pause`,e.Msg.PROCEDURES_ALLOW_STATEMENTS=`allow statements`,e.Msg.PROCEDURES_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALLNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLNORETURN_TOOLTIP=`Run the user-defined function '%1'.`,e.Msg.PROCEDURES_CALLRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLRETURN_TOOLTIP=`Run the user-defined function '%1' and use its output.`,e.Msg.PROCEDURES_CALL_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALL_DISABLED_DEF_WARNING=`Can't run the user-defined function '%1' because the definition block is disabled.`,e.Msg.PROCEDURES_CREATE_DO=`Create '%1'`,e.Msg.PROCEDURES_DEFNORETURN_COMMENT=`Describe this function...`,e.Msg.PROCEDURES_DEFNORETURN_DO=``,e.Msg.PROCEDURES_DEFNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE=`do something`,e.Msg.PROCEDURES_DEFNORETURN_TITLE=`to`,e.Msg.PROCEDURES_DEFNORETURN_TOOLTIP=`Creates a function with no output.`,e.Msg.PROCEDURES_DEFRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFRETURN_RETURN=`return`,e.Msg.PROCEDURES_DEFRETURN_TOOLTIP=`Creates a function with an output.`,e.Msg.PROCEDURES_DEF_DUPLICATE_WARNING=`Warning: This function has duplicate parameters.`,e.Msg.PROCEDURES_HIGHLIGHT_DEF=`Highlight function definition`,e.Msg.PROCEDURES_IFRETURN_HELPURL=`https://c2.com/cgi/wiki?GuardClause`,e.Msg.PROCEDURES_IFRETURN_TOOLTIP=`If a value is true, then return a second value.`,e.Msg.PROCEDURES_IFRETURN_WARNING=`Warning: This block may be used only within a function definition.`,e.Msg.PROCEDURES_MUTATORARG_TITLE=`input name:`,e.Msg.PROCEDURES_MUTATORARG_TOOLTIP=`Add an input to the function.`,e.Msg.PROCEDURES_MUTATORCONTAINER_TITLE=`inputs`,e.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP=`Add, remove, or reorder inputs to this function.`,e.Msg.REDO=`Redo`,e.Msg.REMOVE_COMMENT=`Remove Comment`,e.Msg.REMOVE_FROM_BACKPACK=`Remove from Backpack`,e.Msg.RENAME_VARIABLE=`Rename the '%1' variable`,e.Msg.RENAME_VARIABLE_TITLE=`Rename all '%1' variables to:`,e.Msg.RESET_ZOOM=`Reset zoom`,e.Msg.SCREENREADER_HINT=`Use the arrow keys to navigate. Press %1 to toggle screenreader accessibility mode.`,e.Msg.SCREENREADER_MODE_DISABLED=`Screenreader mode is off, press %1 to turn it on`,e.Msg.SCREENREADER_MODE_ENABLED=`Screenreader mode is on, press %1 to turn it off`,e.Msg.SHIFT_KEY=`Shift`,e.Msg.SHORTCUTS_ABORT_MOVE=`Abort move`,e.Msg.SHORTCUTS_CLEANUP=`Clean up workspace`,e.Msg.SHORTCUTS_CODE_NAVIGATION=`Code navigation`,e.Msg.SHORTCUTS_DELETE=`Delete`,e.Msg.SHORTCUTS_DISCONNECT=`Disconnect block`,e.Msg.SHORTCUTS_DUPLICATE=`Duplicate`,e.Msg.SHORTCUTS_EDITING=`Editing`,e.Msg.SHORTCUTS_ESCAPE=`Exit`,e.Msg.SHORTCUTS_EXTENDED_INFORMATION=`Announce detailed information`,e.Msg.SHORTCUTS_FINISH_MOVE=`Finish move`,e.Msg.SHORTCUTS_FOCUS_TOOLBOX=`Focus toolbox`,e.Msg.SHORTCUTS_FOCUS_WORKSPACE=`Focus workspace`,e.Msg.SHORTCUTS_GENERAL=`General`,e.Msg.SHORTCUTS_INFORMATION=`Announce information`,e.Msg.SHORTCUTS_JUMP_BLOCK_END=`Jump to block end`,e.Msg.SHORTCUTS_JUMP_BLOCK_START=`Jump to block start`,e.Msg.SHORTCUTS_JUMP_BOTTOM_STACK=`Jump to bottom of stack`,e.Msg.SHORTCUTS_JUMP_FIRST_BLOCK=`Jump to first block`,e.Msg.SHORTCUTS_JUMP_LAST_BLOCK=`Jump to last block`,e.Msg.SHORTCUTS_JUMP_TOP_STACK=`Jump to top of stack`,e.Msg.SHORTCUTS_MOVE_DOWN=`Move down`,e.Msg.SHORTCUTS_MOVE_LEFT=`Move left`,e.Msg.SHORTCUTS_MOVE_RIGHT=`Move right`,e.Msg.SHORTCUTS_MOVE_UP=`Move up`,e.Msg.SHORTCUTS_NEXT_HEADING=`Next heading`,e.Msg.SHORTCUTS_NEXT_STACK=`Next stack`,e.Msg.SHORTCUTS_PERFORM_ACTION=`Edit or confirm`,e.Msg.SHORTCUTS_PREVIOUS_HEADING=`Previous heading`,e.Msg.SHORTCUTS_PREVIOUS_STACK=`Previous stack`,e.Msg.SHORTCUTS_SHOW_CONTEXT_MENU=`Show menu`,e.Msg.SHORTCUTS_SHOW_TOOLTIP=`Show tooltip`,e.Msg.SHORTCUTS_START_MOVE=`Start move`,e.Msg.SHORTCUTS_START_MOVE_STACK=`Start move stack`,e.Msg.SHORTCUTS_TOGGLE_SCREENREADER_MODE=`Toggle screenreader mode`,e.Msg.SPACE_KEY=`Space`,e.Msg.TAB_KEY=`Tab`,e.Msg.TEXT_APPEND_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_APPEND_TITLE=`to %1 append text %2`,e.Msg.TEXT_APPEND_TOOLTIP=`Append some text to variable '%1'.`,e.Msg.TEXT_CHANGECASE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#adjusting-text-case`,e.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE=`to lower case`,e.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE=`to Title Case`,e.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE=`to UPPER CASE`,e.Msg.TEXT_CHANGECASE_TOOLTIP=`Return a copy of the text in a different case.`,e.Msg.TEXT_CHARAT_FIRST=`get first letter`,e.Msg.TEXT_CHARAT_FROM_END=`get letter # from end`,e.Msg.TEXT_CHARAT_FROM_START=`get letter #`,e.Msg.TEXT_CHARAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-text`,e.Msg.TEXT_CHARAT_LAST=`get last letter`,e.Msg.TEXT_CHARAT_RANDOM=`get random letter`,e.Msg.TEXT_CHARAT_TAIL=``,e.Msg.TEXT_CHARAT_TITLE=`in text %1 %2`,e.Msg.TEXT_CHARAT_TOOLTIP=`Returns the letter at the specified position.`,e.Msg.TEXT_COUNT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#counting-substrings`,e.Msg.TEXT_COUNT_MESSAGE0=`count %1 in %2`,e.Msg.TEXT_COUNT_TOOLTIP=`Count how many times some text occurs within some other text.`,e.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP=`Add an item to the text.`,e.Msg.TEXT_CREATE_JOIN_TITLE_JOIN=`join`,e.Msg.TEXT_CREATE_JOIN_TOOLTIP=`Add, remove, or reorder sections to reconfigure this text block.`,e.Msg.TEXT_FROM_END_ARIA=`letter number from end`,e.Msg.TEXT_FROM_START_ARIA=`letter number`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_END=`to letter # from end`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_START=`to letter #`,e.Msg.TEXT_GET_SUBSTRING_END_LAST=`to last letter`,e.Msg.TEXT_GET_SUBSTRING_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-a-region-of-text`,e.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT=`in text`,e.Msg.TEXT_GET_SUBSTRING_START_FIRST=`get substring from first letter`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_END=`get substring from letter # from end`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_START=`get substring from letter #`,e.Msg.TEXT_GET_SUBSTRING_TAIL=``,e.Msg.TEXT_GET_SUBSTRING_TOOLTIP=`Returns a specified portion of the text.`,e.Msg.TEXT_INDEXOF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#finding-text`,e.Msg.TEXT_INDEXOF_OPERATOR_FIRST=`find first occurrence of text`,e.Msg.TEXT_INDEXOF_OPERATOR_LAST=`find last occurrence of text`,e.Msg.TEXT_INDEXOF_TITLE=`in text %1 %2 %3`,e.Msg.TEXT_INDEXOF_TOOLTIP=`Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.`,e.Msg.TEXT_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#checking-for-empty-text`,e.Msg.TEXT_ISEMPTY_TITLE=`%1 is empty`,e.Msg.TEXT_ISEMPTY_TOOLTIP=`Returns true if the provided text is empty.`,e.Msg.TEXT_JOIN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-creation`,e.Msg.TEXT_JOIN_TITLE_CREATEWITH=`create text with`,e.Msg.TEXT_JOIN_TOOLTIP=`Create a piece of text by joining together any number of items.`,e.Msg.TEXT_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_LENGTH_TITLE=`length of %1`,e.Msg.TEXT_LENGTH_TOOLTIP=`Returns the number of letters (including spaces) in the provided text.`,e.Msg.TEXT_PRINT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#printing-text`,e.Msg.TEXT_PRINT_TITLE=`print %1`,e.Msg.TEXT_PRINT_TOOLTIP=`Print the specified text, number or other value.`,e.Msg.TEXT_PROMPT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#getting-input-from-the-user`,e.Msg.TEXT_PROMPT_TOOLTIP_NUMBER=`Prompt for user for a number.`,e.Msg.TEXT_PROMPT_TOOLTIP_TEXT=`Prompt for user for some text.`,e.Msg.TEXT_PROMPT_TYPE_NUMBER=`prompt for number with message`,e.Msg.TEXT_PROMPT_TYPE_TEXT=`prompt for text with message`,e.Msg.TEXT_REPLACE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#replacing-substrings`,e.Msg.TEXT_REPLACE_MESSAGE0=`replace %1 with %2 in %3`,e.Msg.TEXT_REPLACE_TOOLTIP=`Replace all occurances of some text within some other text.`,e.Msg.TEXT_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#reversing-text`,e.Msg.TEXT_REVERSE_MESSAGE0=`reverse %1`,e.Msg.TEXT_REVERSE_TOOLTIP=`Reverses the order of the characters in the text.`,e.Msg.TEXT_TEXT_HELPURL=`https://en.wikipedia.org/wiki/String_(computer_science)`,e.Msg.TEXT_TEXT_TOOLTIP=`A letter, word, or line of text.`,e.Msg.TEXT_TRIM_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#trimming-removing-spaces`,e.Msg.TEXT_TRIM_OPERATOR_BOTH=`trim spaces from both sides of`,e.Msg.TEXT_TRIM_OPERATOR_LEFT=`trim spaces from left side of`,e.Msg.TEXT_TRIM_OPERATOR_RIGHT=`trim spaces from right side of`,e.Msg.TEXT_TRIM_TOOLTIP=`Return a copy of the text with spaces removed from one or both ends.`,e.Msg.TODAY=`Today`,e.Msg.UNDO=`Undo`,e.Msg.UNKNOWN=`Unknown`,e.Msg.UNNAMED_KEY=`unnamed`,e.Msg.VARIABLES_DEFAULT_NAME=`item`,e.Msg.VARIABLES_GET_CREATE_SET=`Create 'set %1'`,e.Msg.VARIABLES_GET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#get`,e.Msg.VARIABLES_GET_TOOLTIP=`Returns the value of this variable.`,e.Msg.VARIABLES_SET=`set %1 to %2`,e.Msg.VARIABLES_SET_CREATE_GET=`Create 'get %1'`,e.Msg.VARIABLES_SET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#set`,e.Msg.VARIABLES_SET_TOOLTIP=`Sets this variable to be equal to the input.`,e.Msg.VARIABLE_ALREADY_EXISTS=`A variable named '%1' already exists.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE=`A variable named '%1' already exists for another type: '%2'.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER=`A variable named '%1' already exists as a parameter in the procedure '%2'.`,e.Msg.WINDOWS=`Windows`,e.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT=`Say something...`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_MANY=`%1 stacks of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ONE=`One stack of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ZERO=`No blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_MANY=` and %1 comments`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_ONE=` and one comment`,e.Msg.WORKSPACE_LABEL_1_STACK=`1 stack of blocks`,e.Msg.WORKSPACE_LABEL_FLYOUT_WORKSPACE=`%1 blocks`,e.Msg.WORKSPACE_LABEL_MANY_STACKS=`%1 stacks of blocks`,e.Msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE=`Block editor workspace`,e.Msg.WORKSPACE_LABEL_PLAIN=`Blocks workspace.`,e.Msg.WORKSPACE_ROLEDESCRIPTION=`workspace`,e.Msg.ZOOM_IN=`Zoom in`,e.Msg.ZOOM_OUT=`Zoom out`,e.Msg.ZOOM_TO_FIT_ARIA_LABEL=`Zoom to fit`,e.Msg.CONTROLS_FOREACH_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_FOR_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=e.Msg.CONTROLS_IF_MSG_ELSEIF,e.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=e.Msg.CONTROLS_IF_MSG_ELSE,e.Msg.CONTROLS_IF_IF_TITLE_IF=e.Msg.CONTROLS_IF_MSG_IF,e.Msg.CONTROLS_IF_MSG_THEN=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.LISTS_CREATE_WITH_ITEM_TITLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.MATH_CHANGE_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.PROCEDURES_DEFRETURN_COMMENT=e.Msg.PROCEDURES_DEFNORETURN_COMMENT,e.Msg.PROCEDURES_DEFRETURN_DO=e.Msg.PROCEDURES_DEFNORETURN_DO,e.Msg.PROCEDURES_DEFRETURN_PROCEDURE=e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,e.Msg.PROCEDURES_DEFRETURN_TITLE=e.Msg.PROCEDURES_DEFNORETURN_TITLE,e.Msg.TEXT_APPEND_VARIABLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.COLOUR_HUE=`20`,e.Msg.LISTS_HUE=`260`,e.Msg.LOGIC_HUE=`210`,e.Msg.LOOPS_HUE=`120`,e.Msg.MATH_HUE=`230`,e.Msg.PROCEDURES_HUE=`290`,e.Msg.TEXTS_HUE=`160`,e.Msg.VARIABLES_DYNAMIC_HUE=`310`,e.Msg.VARIABLES_HUE=`330`,e.Msg})})),Hh=n({ADD_COMMENT:()=>ng,ALT_KEY:()=>bw,ANNOUNCE_MOVE_AFTER:()=>XE,ANNOUNCE_MOVE_AROUND:()=>QE,ANNOUNCE_MOVE_BEFORE:()=>YE,ANNOUNCE_MOVE_CANCELED:()=>tD,ANNOUNCE_MOVE_INSIDE:()=>ZE,ANNOUNCE_MOVE_OF:()=>eD,ANNOUNCE_MOVE_TO:()=>$E,ANNOUNCE_MOVE_WORKSPACE:()=>JE,ARIA_LABEL_ADD_ELSE_IF:()=>VD,ARIA_LABEL_ADD_INPUT:()=>qD,ARIA_LABEL_ADD_LIST_ITEM:()=>UD,ARIA_LABEL_ADD_TEXT:()=>GD,ARIA_LABEL_BUTTON:()=>bD,ARIA_LABEL_COMMENT:()=>MD,ARIA_LABEL_COMMENT_COLLAPSE:()=>ND,ARIA_LABEL_COMMENT_EXPAND:()=>PD,ARIA_LABEL_FIELD_ANGLE:()=>XD,ARIA_LABEL_HEADING:()=>xD,ARIA_LABEL_REMOVE_ELSE_IF:()=>HD,ARIA_LABEL_REMOVE_INPUT:()=>JD,ARIA_LABEL_REMOVE_LIST_ITEM:()=>WD,ARIA_LABEL_REMOVE_TEXT:()=>KD,ARIA_LABEL_TRASH_EMPTY:()=>vO,ARIA_TYPE_FIELD_ANGLE:()=>YD,ARIA_TYPE_FIELD_BITMAP:()=>$D,ARIA_TYPE_FIELD_CHECKBOX:()=>uD,ARIA_TYPE_FIELD_COLOUR:()=>QD,ARIA_TYPE_FIELD_DATE:()=>ZD,ARIA_TYPE_FIELD_DROPDOWN:()=>cD,ARIA_TYPE_FIELD_GRID:()=>eO,ARIA_TYPE_FIELD_IMAGE:()=>lD,ARIA_TYPE_FIELD_INPUT:()=>rD,ARIA_TYPE_FIELD_NUMBER:()=>aD,ARIA_TYPE_FIELD_TEXT_INPUT:()=>iD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:()=>sD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:()=>oD,BACKSPACE_KEY:()=>Sw,BLOCK_LABEL_BEGIN_PREFIX:()=>zT,BLOCK_LABEL_BEGIN_STACK:()=>RT,BLOCK_LABEL_COLLAPSED:()=>HT,BLOCK_LABEL_CONTAINER:()=>JT,BLOCK_LABEL_DISABLED:()=>VT,BLOCK_LABEL_HAS_BRANCHES:()=>KT,BLOCK_LABEL_HAS_INPUT:()=>WT,BLOCK_LABEL_HAS_INPUTS:()=>GT,BLOCK_LABEL_REPLACEABLE:()=>UT,BLOCK_LABEL_STACK_BLOCKS:()=>XT,BLOCK_LABEL_STATEMENT:()=>qT,BLOCK_LABEL_TOOLBOX_CATEGORY:()=>BT,BLOCK_LABEL_VALUE:()=>YT,BUBBLE_LABEL_COMMENT:()=>CD,BUBBLE_LABEL_DEFAULT:()=>SD,BUBBLE_LABEL_WARNING:()=>wD,CANNOT_DELETE_VARIABLE_PROCEDURE:()=>Pg,CAPS_LOCK_KEY:()=>Dw,CHANGE_VALUE_TITLE:()=>xg,CHROME_OS:()=>mw,CLEAN_UP:()=>ug,CLOSE:()=>dg,CLOSE_BACKPACK:()=>cO,COLLAPSED_WARNINGS_WARNING:()=>sw,COLLAPSE_ALL:()=>pg,COLLAPSE_BLOCK:()=>fg,COLOUR_BLEND_COLOUR1:()=>Yg,COLOUR_BLEND_COLOUR2:()=>Xg,COLOUR_BLEND_HELPURL:()=>qg,COLOUR_BLEND_RATIO:()=>Zg,COLOUR_BLEND_TITLE:()=>Jg,COLOUR_BLEND_TOOLTIP:()=>Qg,COLOUR_HUE:()=>Jh,COLOUR_PICKER_HELPURL:()=>Ig,COLOUR_PICKER_TOOLTIP:()=>Lg,COLOUR_RANDOM_HELPURL:()=>Rg,COLOUR_RANDOM_TITLE:()=>zg,COLOUR_RANDOM_TOOLTIP:()=>Bg,COLOUR_RGB_BLUE:()=>Gg,COLOUR_RGB_GREEN:()=>Wg,COLOUR_RGB_HELPURL:()=>Vg,COLOUR_RGB_RED:()=>Ug,COLOUR_RGB_TITLE:()=>Hg,COLOUR_RGB_TOOLTIP:()=>Kg,COMMAND_KEY:()=>vw,CONTEXT_MENU_KEY:()=>Fw,CONTROLS_FLOW_STATEMENTS_HELPURL:()=>__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:()=>v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:()=>y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:()=>b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:()=>x_,CONTROLS_FLOW_STATEMENTS_WARNING:()=>S_,CONTROLS_FOREACH_HELPURL:()=>p_,CONTROLS_FOREACH_INPUT_DO:()=>h_,CONTROLS_FOREACH_TITLE:()=>m_,CONTROLS_FOREACH_TOOLTIP:()=>g_,CONTROLS_FOR_HELPURL:()=>l_,CONTROLS_FOR_INPUT_DO:()=>f_,CONTROLS_FOR_TITLE:()=>d_,CONTROLS_FOR_TOOLTIP:()=>u_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:()=>P_,CONTROLS_IF_ELSEIF_TOOLTIP:()=>F_,CONTROLS_IF_ELSE_TITLE_ELSE:()=>I_,CONTROLS_IF_ELSE_TOOLTIP:()=>L_,CONTROLS_IF_HELPURL:()=>C_,CONTROLS_IF_IF_TITLE_IF:()=>M_,CONTROLS_IF_IF_TOOLTIP:()=>N_,CONTROLS_IF_MSG_ELSE:()=>A_,CONTROLS_IF_MSG_ELSEIF:()=>k_,CONTROLS_IF_MSG_IF:()=>O_,CONTROLS_IF_MSG_THEN:()=>j_,CONTROLS_IF_TOOLTIP_1:()=>w_,CONTROLS_IF_TOOLTIP_2:()=>T_,CONTROLS_IF_TOOLTIP_3:()=>E_,CONTROLS_IF_TOOLTIP_4:()=>D_,CONTROLS_REPEAT_HELPURL:()=>$g,CONTROLS_REPEAT_INPUT_DO:()=>t_,CONTROLS_REPEAT_TITLE:()=>e_,CONTROLS_REPEAT_TOOLTIP:()=>n_,CONTROLS_WHILEUNTIL_HELPURL:()=>r_,CONTROLS_WHILEUNTIL_INPUT_DO:()=>i_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:()=>o_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:()=>a_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:()=>c_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:()=>s_,CONTROL_KEY:()=>_w,COPY_ALL_TO_BACKPACK:()=>lO,COPY_SHORTCUT:()=>Lw,COPY_TO_BACKPACK:()=>uO,CURRENT_BLOCK_ANNOUNCEMENT:()=>LD,CUT_SHORTCUT:()=>Iw,DELETE_ALL_BLOCKS:()=>lg,DELETE_BLOCK:()=>sg,DELETE_KEY:()=>Cw,DELETE_VARIABLE:()=>Fg,DELETE_VARIABLE_CONFIRMATION:()=>Ng,DELETE_X_BLOCKS:()=>cg,DIALOG_CANCEL:()=>lw,DIALOG_OK:()=>cw,DISABLE_BLOCK:()=>gg,DUPLICATE_BLOCK:()=>tg,DUPLICATE_COMMENT:()=>ig,EDIT_BLOCK_CONTENTS:()=>uw,EMPTY_BACKPACK:()=>dO,ENABLE_BLOCK:()=>_g,END_KEY:()=>jw,ENTER_KEY:()=>xw,ESCAPE:()=>ww,EXPAND_ALL:()=>hg,EXPAND_BLOCK:()=>mg,EXTERNAL_INPUTS:()=>ag,FIELD_BITMAP_ARIA_VALUE:()=>oO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:()=>nO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:()=>tO,FIELD_BITMAP_PIXEL_LABEL:()=>aO,FIELD_BITMAP_PIXEL_OFF:()=>iO,FIELD_BITMAP_PIXEL_ON:()=>rO,FIELD_LABEL_CHECKBOX_CHECKED:()=>_D,FIELD_LABEL_CHECKBOX_UNCHECKED:()=>vD,FIELD_LABEL_EDIT_PREFIX:()=>dD,FIELD_LABEL_EMPTY:()=>nD,FIELD_LABEL_OPTION_INDEX:()=>gD,FIELD_LABEL_VARIABLE:()=>yD,FIELD_MULTILINEINPUT_FINISH_EDITING:()=>mO,FIELD_MULTILINEINPUT_NEW_LINE:()=>hO,HELP:()=>vg,HELP_PROMPT:()=>zw,HOME_KEY:()=>Mw,ICON_LABEL_COMMENT_CLOSED:()=>ED,ICON_LABEL_COMMENT_OPEN:()=>DD,ICON_LABEL_DEFAULT:()=>TD,ICON_LABEL_MUTATOR_CLOSED:()=>OD,ICON_LABEL_MUTATOR_OPEN:()=>kD,ICON_LABEL_WARNING_CLOSED:()=>AD,ICON_LABEL_WARNING_OPEN:()=>jD,INLINE_INPUTS:()=>og,INPUT_LABEL_CONDITION:()=>nE,INPUT_LABEL_CONDITION_A:()=>rE,INPUT_LABEL_CONDITION_B:()=>iE,INPUT_LABEL_EMPTY:()=>tE,INPUT_LABEL_END_STATEMENT:()=>eE,INPUT_LABEL_INDEX:()=>ZT,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:()=>IE,INPUT_LABEL_LISTS_DELIMITER:()=>KE,INPUT_LABEL_LISTS_END_POSITION:()=>UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:()=>WE,INPUT_LABEL_LISTS_POSITION:()=>VE,INPUT_LABEL_LISTS_REPEAT_ITEM:()=>LE,INPUT_LABEL_LISTS_REPEAT_NUM:()=>RE,INPUT_LABEL_LISTS_START_POSITION:()=>HE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:()=>GE,INPUT_LABEL_LISTS_TO_CHANGE:()=>qE,INPUT_LABEL_LISTS_TO_CHECK:()=>zE,INPUT_LABEL_LISTS_VALUE_TO_SET:()=>BE,INPUT_LABEL_LOOP_BY:()=>CE,INPUT_LABEL_LOOP_FROM:()=>xE,INPUT_LABEL_LOOP_LIST:()=>wE,INPUT_LABEL_LOOP_TIMES:()=>bE,INPUT_LABEL_LOOP_TO:()=>SE,INPUT_LABEL_MATH_CHANGE_BY:()=>mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:()=>hE,INPUT_LABEL_MATH_DIVIDEND:()=>fE,INPUT_LABEL_MATH_DIVISOR:()=>pE,INPUT_LABEL_NUMBER:()=>sE,INPUT_LABEL_NUMBER_A:()=>cE,INPUT_LABEL_NUMBER_ATAN2_X:()=>vE,INPUT_LABEL_NUMBER_ATAN2_Y:()=>yE,INPUT_LABEL_NUMBER_B:()=>lE,INPUT_LABEL_NUMBER_LIST:()=>dE,INPUT_LABEL_NUMBER_MAX:()=>_E,INPUT_LABEL_NUMBER_MIN:()=>gE,INPUT_LABEL_NUMBER_TO_CHECK:()=>uE,INPUT_LABEL_STATEMENT:()=>$T,INPUT_LABEL_TEXT_APPEND:()=>EE,INPUT_LABEL_TEXT_END_POSITION:()=>NE,INPUT_LABEL_TEXT_JOIN_ITEM:()=>TE,INPUT_LABEL_TEXT_POSITION:()=>jE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:()=>PE,INPUT_LABEL_TEXT_START_POSITION:()=>ME,INPUT_LABEL_TEXT_TO_CHANGE:()=>DE,INPUT_LABEL_TEXT_TO_CHECK:()=>OE,INPUT_LABEL_TEXT_TO_FIND:()=>kE,INPUT_LABEL_TEXT_TO_REPLACE:()=>AE,INPUT_LABEL_VALUE:()=>QT,INPUT_LABEL_VALUE_A:()=>aE,INPUT_LABEL_VALUE_B:()=>oE,INPUT_LABEL_VARIABLES_SET:()=>FE,INSERT_KEY:()=>Nw,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:()=>FT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:()=>xT,KEYBOARD_NAV_COPIED_HINT:()=>ST,KEYBOARD_NAV_CUT_HINT:()=>CT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:()=>LT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:()=>bT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:()=>IT,LINUX:()=>hw,LISTS_CREATE_EMPTY_HELPURL:()=>zx,LISTS_CREATE_EMPTY_TITLE:()=>Bx,LISTS_CREATE_EMPTY_TOOLTIP:()=>Vx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:()=>Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:()=>Kx,LISTS_CREATE_WITH_HELPURL:()=>Hx,LISTS_CREATE_WITH_INPUT_WITH:()=>Wx,LISTS_CREATE_WITH_ITEM_TITLE:()=>qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:()=>Jx,LISTS_CREATE_WITH_TOOLTIP:()=>Ux,LISTS_GET_INDEX_FIRST:()=>gS,LISTS_GET_INDEX_FROM_END:()=>hS,LISTS_GET_INDEX_FROM_START:()=>mS,LISTS_GET_INDEX_GET:()=>dS,LISTS_GET_INDEX_GET_REMOVE:()=>fS,LISTS_GET_INDEX_HELPURL:()=>uS,LISTS_GET_INDEX_INPUT_IN_LIST:()=>bS,LISTS_GET_INDEX_LAST:()=>_S,LISTS_GET_INDEX_RANDOM:()=>vS,LISTS_GET_INDEX_REMOVE:()=>pS,LISTS_GET_INDEX_TAIL:()=>yS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:()=>wS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:()=>CS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:()=>TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:()=>ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:()=>OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:()=>DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:()=>kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:()=>AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:()=>MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:()=>jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:()=>NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:()=>PS,LISTS_GET_SUBLIST_END_FROM_END:()=>eC,LISTS_GET_SUBLIST_END_FROM_START:()=>$S,LISTS_GET_SUBLIST_END_LAST:()=>tC,LISTS_GET_SUBLIST_HELPURL:()=>JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:()=>YS,LISTS_GET_SUBLIST_START_FIRST:()=>QS,LISTS_GET_SUBLIST_START_FROM_END:()=>ZS,LISTS_GET_SUBLIST_START_FROM_START:()=>XS,LISTS_GET_SUBLIST_TAIL:()=>nC,LISTS_GET_SUBLIST_TOOLTIP:()=>rC,LISTS_HUE:()=>qh,LISTS_INDEX_FROM_END_TOOLTIP:()=>SS,LISTS_INDEX_FROM_START_TOOLTIP:()=>xS,LISTS_INDEX_OF_FIRST:()=>sS,LISTS_INDEX_OF_HELPURL:()=>aS,LISTS_INDEX_OF_INPUT_IN_LIST:()=>oS,LISTS_INDEX_OF_LAST:()=>cS,LISTS_INDEX_OF_TOOLTIP:()=>lS,LISTS_INLIST:()=>iS,LISTS_ISEMPTY_HELPURL:()=>tS,LISTS_ISEMPTY_TITLE:()=>nS,LISTS_ISEMPTY_TOOLTIP:()=>rS,LISTS_LENGTH_HELPURL:()=>Qx,LISTS_LENGTH_TITLE:()=>$x,LISTS_LENGTH_TOOLTIP:()=>eS,LISTS_REPEAT_HELPURL:()=>Yx,LISTS_REPEAT_TITLE:()=>Zx,LISTS_REPEAT_TOOLTIP:()=>Xx,LISTS_REVERSE_HELPURL:()=>vC,LISTS_REVERSE_MESSAGE0:()=>yC,LISTS_REVERSE_TOOLTIP:()=>bC,LISTS_SET_INDEX_HELPURL:()=>FS,LISTS_SET_INDEX_INPUT_IN_LIST:()=>IS,LISTS_SET_INDEX_INPUT_TO:()=>zS,LISTS_SET_INDEX_INSERT:()=>RS,LISTS_SET_INDEX_SET:()=>LS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:()=>GS,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:()=>WS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:()=>KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:()=>qS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:()=>VS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:()=>BS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:()=>HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:()=>US,LISTS_SORT_HELPURL:()=>iC,LISTS_SORT_ORDER_ASCENDING:()=>sC,LISTS_SORT_ORDER_DESCENDING:()=>cC,LISTS_SORT_TITLE:()=>aC,LISTS_SORT_TOOLTIP:()=>oC,LISTS_SORT_TYPE_IGNORECASE:()=>dC,LISTS_SORT_TYPE_NUMERIC:()=>lC,LISTS_SORT_TYPE_TEXT:()=>uC,LISTS_SPLIT_HELPURL:()=>fC,LISTS_SPLIT_LIST_FROM_TEXT:()=>pC,LISTS_SPLIT_TEXT_FROM_LIST:()=>mC,LISTS_SPLIT_TOOLTIP_JOIN:()=>_C,LISTS_SPLIT_TOOLTIP_SPLIT:()=>gC,LISTS_SPLIT_WITH_DELIMITER:()=>hC,LOGIC_BOOLEAN_FALSE:()=>sv,LOGIC_BOOLEAN_HELPURL:()=>av,LOGIC_BOOLEAN_TOOLTIP:()=>cv,LOGIC_BOOLEAN_TRUE:()=>ov,LOGIC_COMPARE_EQ_ARIA:()=>z_,LOGIC_COMPARE_GTE_ARIA:()=>Y_,LOGIC_COMPARE_GT_ARIA:()=>q_,LOGIC_COMPARE_HELPURL:()=>R_,LOGIC_COMPARE_LTE_ARIA:()=>G_,LOGIC_COMPARE_LT_ARIA:()=>U_,LOGIC_COMPARE_NEQ_ARIA:()=>V_,LOGIC_COMPARE_TOOLTIP_EQ:()=>B_,LOGIC_COMPARE_TOOLTIP_GT:()=>J_,LOGIC_COMPARE_TOOLTIP_GTE:()=>X_,LOGIC_COMPARE_TOOLTIP_LT:()=>W_,LOGIC_COMPARE_TOOLTIP_LTE:()=>K_,LOGIC_COMPARE_TOOLTIP_NEQ:()=>H_,LOGIC_HUE:()=>Uh,LOGIC_NEGATE_HELPURL:()=>nv,LOGIC_NEGATE_TITLE:()=>rv,LOGIC_NEGATE_TOOLTIP:()=>iv,LOGIC_NULL:()=>uv,LOGIC_NULL_HELPURL:()=>lv,LOGIC_NULL_TOOLTIP:()=>dv,LOGIC_OPERATION_AND:()=>$_,LOGIC_OPERATION_HELPURL:()=>Z_,LOGIC_OPERATION_OR:()=>tv,LOGIC_OPERATION_TOOLTIP_AND:()=>Q_,LOGIC_OPERATION_TOOLTIP_OR:()=>ev,LOGIC_TERNARY_CONDITION:()=>pv,LOGIC_TERNARY_HELPURL:()=>fv,LOGIC_TERNARY_IF_FALSE:()=>hv,LOGIC_TERNARY_IF_TRUE:()=>mv,LOGIC_TERNARY_TOOLTIP:()=>gv,LOOPS_HUE:()=>Wh,MAC_OS:()=>pw,MATH_ADDITION_SYMBOL:()=>yv,MATH_ADDITION_SYMBOL_ARIA:()=>bv,MATH_ARITHMETIC_HELPURL:()=>qv,MATH_ARITHMETIC_TOOLTIP_ADD:()=>Jv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:()=>Zv,MATH_ARITHMETIC_TOOLTIP_MINUS:()=>Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:()=>Xv,MATH_ARITHMETIC_TOOLTIP_POWER:()=>Qv,MATH_ATAN2_HELPURL:()=>vb,MATH_ATAN2_TITLE:()=>yb,MATH_ATAN2_TOOLTIP:()=>bb,MATH_CHANGE_HELPURL:()=>My,MATH_CHANGE_TITLE:()=>Ny,MATH_CHANGE_TITLE_ITEM:()=>Py,MATH_CHANGE_TOOLTIP:()=>Fy,MATH_CONSTANT_E_ARIA:()=>Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:()=>Uv,MATH_CONSTANT_HELPURL:()=>Sy,MATH_CONSTANT_INFINITY_ARIA:()=>Kv,MATH_CONSTANT_PI_ARIA:()=>Vv,MATH_CONSTANT_SQRT1_2_ARIA:()=>Gv,MATH_CONSTANT_SQRT2_ARIA:()=>Wv,MATH_CONSTANT_TOOLTIP:()=>Cy,MATH_CONSTRAIN_HELPURL:()=>lb,MATH_CONSTRAIN_TITLE:()=>ub,MATH_CONSTRAIN_TOOLTIP:()=>db,MATH_DIVISION_SYMBOL:()=>Cv,MATH_DIVISION_SYMBOL_ARIA:()=>wv,MATH_HUE:()=>Gh,MATH_IS_DIVISIBLE_BY:()=>Ay,MATH_IS_EVEN:()=>wy,MATH_IS_NEGATIVE:()=>ky,MATH_IS_ODD:()=>Ty,MATH_IS_POSITIVE:()=>Oy,MATH_IS_PRIME:()=>Ey,MATH_IS_TOOLTIP:()=>jy,MATH_IS_WHOLE:()=>Dy,MATH_MODULO_HELPURL:()=>ob,MATH_MODULO_TITLE:()=>sb,MATH_MODULO_TOOLTIP:()=>cb,MATH_MULTIPLICATION_SYMBOL:()=>Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:()=>Ev,MATH_NUMBER_HELPURL:()=>_v,MATH_NUMBER_TOOLTIP:()=>vv,MATH_ONLIST_HELPURL:()=>Vy,MATH_ONLIST_OPERATOR_AVERAGE:()=>Xy,MATH_ONLIST_OPERATOR_MAX:()=>qy,MATH_ONLIST_OPERATOR_MAX_ARIA:()=>Jy,MATH_ONLIST_OPERATOR_MEDIAN:()=>Qy,MATH_ONLIST_OPERATOR_MIN:()=>Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:()=>Gy,MATH_ONLIST_OPERATOR_MODE:()=>eb,MATH_ONLIST_OPERATOR_RANDOM:()=>ib,MATH_ONLIST_OPERATOR_STD_DEV:()=>nb,MATH_ONLIST_OPERATOR_SUM:()=>Hy,MATH_ONLIST_TOOLTIP_AVERAGE:()=>Zy,MATH_ONLIST_TOOLTIP_MAX:()=>Yy,MATH_ONLIST_TOOLTIP_MEDIAN:()=>$y,MATH_ONLIST_TOOLTIP_MIN:()=>Ky,MATH_ONLIST_TOOLTIP_MODE:()=>tb,MATH_ONLIST_TOOLTIP_RANDOM:()=>ab,MATH_ONLIST_TOOLTIP_STD_DEV:()=>rb,MATH_ONLIST_TOOLTIP_SUM:()=>Uy,MATH_POWER_SYMBOL:()=>Dv,MATH_POWER_SYMBOL_ARIA:()=>Ov,MATH_RANDOM_FLOAT_HELPURL:()=>hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:()=>gb,MATH_RANDOM_FLOAT_TOOLTIP:()=>_b,MATH_RANDOM_INT_HELPURL:()=>fb,MATH_RANDOM_INT_TITLE:()=>pb,MATH_RANDOM_INT_TOOLTIP:()=>mb,MATH_ROUND_HELPURL:()=>Iy,MATH_ROUND_OPERATOR_ROUND:()=>Ry,MATH_ROUND_OPERATOR_ROUNDDOWN:()=>By,MATH_ROUND_OPERATOR_ROUNDUP:()=>zy,MATH_ROUND_TOOLTIP:()=>Ly,MATH_SINGLE_HELPURL:()=>$v,MATH_SINGLE_OP_ABSOLUTE:()=>ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:()=>ry,MATH_SINGLE_OP_EXP_ARIA:()=>cy,MATH_SINGLE_OP_LN_ARIA:()=>oy,MATH_SINGLE_OP_LOG10_ARIA:()=>sy,MATH_SINGLE_OP_NEG_ARIA:()=>ay,MATH_SINGLE_OP_POW10_ARIA:()=>ly,MATH_SINGLE_OP_ROOT:()=>ey,MATH_SINGLE_TOOLTIP_ABS:()=>iy,MATH_SINGLE_TOOLTIP_EXP:()=>py,MATH_SINGLE_TOOLTIP_LN:()=>dy,MATH_SINGLE_TOOLTIP_LOG10:()=>fy,MATH_SINGLE_TOOLTIP_NEG:()=>uy,MATH_SINGLE_TOOLTIP_POW10:()=>my,MATH_SINGLE_TOOLTIP_ROOT:()=>ty,MATH_SUBTRACTION_SYMBOL:()=>xv,MATH_SUBTRACTION_SYMBOL_ARIA:()=>Sv,MATH_TRIG_ACOS:()=>Lv,MATH_TRIG_ACOS_ARIA:()=>Rv,MATH_TRIG_ASIN:()=>Fv,MATH_TRIG_ASIN_ARIA:()=>Iv,MATH_TRIG_ATAN:()=>zv,MATH_TRIG_ATAN_ARIA:()=>Bv,MATH_TRIG_COS:()=>jv,MATH_TRIG_COS_ARIA:()=>Mv,MATH_TRIG_HELPURL:()=>hy,MATH_TRIG_SIN:()=>kv,MATH_TRIG_SIN_ARIA:()=>Av,MATH_TRIG_TAN:()=>Nv,MATH_TRIG_TAN_ARIA:()=>Pv,MATH_TRIG_TOOLTIP_ACOS:()=>by,MATH_TRIG_TOOLTIP_ASIN:()=>yy,MATH_TRIG_TOOLTIP_ATAN:()=>xy,MATH_TRIG_TOOLTIP_COS:()=>_y,MATH_TRIG_TOOLTIP_SIN:()=>gy,MATH_TRIG_TOOLTIP_TAN:()=>vy,MINIMAP_ARIA_LABEL:()=>_O,MOVE_BLOCK:()=>dw,NEW_COLOUR_VARIABLE:()=>Dg,NEW_NUMBER_VARIABLE:()=>Eg,NEW_STRING_VARIABLE:()=>Tg,NEW_VARIABLE:()=>wg,NEW_VARIABLE_TITLE:()=>kg,NEW_VARIABLE_TYPE_TITLE:()=>Og,NO_PARENT_ANNOUNCEMENT:()=>zD,OPEN_BACKPACK:()=>sO,OPEN_TRASH:()=>fD,OPTION_KEY:()=>yw,ORDINAL_NUMBER_SUFFIX:()=>xC,PAGE_DOWN_KEY:()=>Aw,PAGE_UP_KEY:()=>kw,PARENT_BLOCKS_ANNOUNCEMENT:()=>RD,PASTE_ALL_FROM_BACKPACK:()=>fO,PASTE_SHORTCUT:()=>Rw,PAUSE_KEY:()=>Pw,PROCEDURES_ALLOW_STATEMENTS:()=>GC,PROCEDURES_BEFORE_PARAMS:()=>MC,PROCEDURES_CALLNORETURN_HELPURL:()=>qC,PROCEDURES_CALLNORETURN_TOOLTIP:()=>JC,PROCEDURES_CALLRETURN_HELPURL:()=>YC,PROCEDURES_CALLRETURN_TOOLTIP:()=>XC,PROCEDURES_CALL_BEFORE_PARAMS:()=>NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:()=>PC,PROCEDURES_CREATE_DO:()=>nw,PROCEDURES_DEFNORETURN_COMMENT:()=>LC,PROCEDURES_DEFNORETURN_DO:()=>FC,PROCEDURES_DEFNORETURN_HELPURL:()=>kC,PROCEDURES_DEFNORETURN_PROCEDURE:()=>jC,PROCEDURES_DEFNORETURN_TITLE:()=>AC,PROCEDURES_DEFNORETURN_TOOLTIP:()=>IC,PROCEDURES_DEFRETURN_COMMENT:()=>HC,PROCEDURES_DEFRETURN_DO:()=>VC,PROCEDURES_DEFRETURN_HELPURL:()=>RC,PROCEDURES_DEFRETURN_PROCEDURE:()=>BC,PROCEDURES_DEFRETURN_RETURN:()=>UC,PROCEDURES_DEFRETURN_TITLE:()=>zC,PROCEDURES_DEFRETURN_TOOLTIP:()=>WC,PROCEDURES_DEF_DUPLICATE_WARNING:()=>KC,PROCEDURES_HIGHLIGHT_DEF:()=>tw,PROCEDURES_HUE:()=>Zh,PROCEDURES_IFRETURN_HELPURL:()=>iw,PROCEDURES_IFRETURN_TOOLTIP:()=>rw,PROCEDURES_IFRETURN_WARNING:()=>aw,PROCEDURES_MUTATORARG_TITLE:()=>$C,PROCEDURES_MUTATORARG_TOOLTIP:()=>ew,PROCEDURES_MUTATORCONTAINER_TITLE:()=>ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:()=>QC,REDO:()=>bg,REMOVE_COMMENT:()=>rg,REMOVE_FROM_BACKPACK:()=>pO,RENAME_VARIABLE:()=>Sg,RENAME_VARIABLE_TITLE:()=>Cg,RESET_ZOOM:()=>hD,SCREENREADER_HINT:()=>BD,SCREENREADER_MODE_DISABLED:()=>ID,SCREENREADER_MODE_ENABLED:()=>FD,SHIFT_KEY:()=>Ew,SHORTCUTS_ABORT_MOVE:()=>Qw,SHORTCUTS_CLEANUP:()=>dT,SHORTCUTS_CODE_NAVIGATION:()=>Hw,SHORTCUTS_DELETE:()=>Ww,SHORTCUTS_DISCONNECT:()=>iT,SHORTCUTS_DUPLICATE:()=>uT,SHORTCUTS_EDITING:()=>Vw,SHORTCUTS_ESCAPE:()=>Uw,SHORTCUTS_EXTENDED_INFORMATION:()=>rT,SHORTCUTS_FINISH_MOVE:()=>Zw,SHORTCUTS_FOCUS_TOOLBOX:()=>tT,SHORTCUTS_FOCUS_WORKSPACE:()=>eT,SHORTCUTS_GENERAL:()=>Bw,SHORTCUTS_INFORMATION:()=>nT,SHORTCUTS_JUMP_BLOCK_END:()=>hT,SHORTCUTS_JUMP_BLOCK_START:()=>mT,SHORTCUTS_JUMP_BOTTOM_STACK:()=>_T,SHORTCUTS_JUMP_FIRST_BLOCK:()=>vT,SHORTCUTS_JUMP_LAST_BLOCK:()=>yT,SHORTCUTS_JUMP_TOP_STACK:()=>gT,SHORTCUTS_MOVE_DOWN:()=>Xw,SHORTCUTS_MOVE_LEFT:()=>qw,SHORTCUTS_MOVE_RIGHT:()=>Jw,SHORTCUTS_MOVE_UP:()=>Yw,SHORTCUTS_NEXT_HEADING:()=>sT,SHORTCUTS_NEXT_STACK:()=>aT,SHORTCUTS_PERFORM_ACTION:()=>lT,SHORTCUTS_PREVIOUS_HEADING:()=>cT,SHORTCUTS_PREVIOUS_STACK:()=>oT,SHORTCUTS_SHOW_CONTEXT_MENU:()=>$w,SHORTCUTS_SHOW_TOOLTIP:()=>fT,SHORTCUTS_START_MOVE:()=>Gw,SHORTCUTS_START_MOVE_STACK:()=>Kw,SHORTCUTS_TOGGLE_SCREENREADER_MODE:()=>pT,SPACE_KEY:()=>Ow,TAB_KEY:()=>Tw,TEXTS_HUE:()=>Kh,TEXT_APPEND_HELPURL:()=>Ab,TEXT_APPEND_TITLE:()=>jb,TEXT_APPEND_TOOLTIP:()=>Nb,TEXT_APPEND_VARIABLE:()=>Mb,TEXT_CHANGECASE_HELPURL:()=>fx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:()=>hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:()=>gx,TEXT_CHANGECASE_OPERATOR_UPPERCASE:()=>mx,TEXT_CHANGECASE_TOOLTIP:()=>px,TEXT_CHARAT_FIRST:()=>Zb,TEXT_CHARAT_FROM_END:()=>Xb,TEXT_CHARAT_FROM_START:()=>Yb,TEXT_CHARAT_HELPURL:()=>qb,TEXT_CHARAT_LAST:()=>Qb,TEXT_CHARAT_RANDOM:()=>$b,TEXT_CHARAT_TAIL:()=>ex,TEXT_CHARAT_TITLE:()=>Jb,TEXT_CHARAT_TOOLTIP:()=>tx,TEXT_COUNT_HELPURL:()=>jx,TEXT_COUNT_MESSAGE0:()=>Ax,TEXT_COUNT_TOOLTIP:()=>Mx,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:()=>Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:()=>kb,TEXT_CREATE_JOIN_TITLE_JOIN:()=>Eb,TEXT_CREATE_JOIN_TOOLTIP:()=>Db,TEXT_FROM_END_ARIA:()=>Kb,TEXT_FROM_START_ARIA:()=>Gb,TEXT_GET_SUBSTRING_END_FROM_END:()=>lx,TEXT_GET_SUBSTRING_END_FROM_START:()=>cx,TEXT_GET_SUBSTRING_END_LAST:()=>ux,TEXT_GET_SUBSTRING_HELPURL:()=>rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:()=>ix,TEXT_GET_SUBSTRING_START_FIRST:()=>sx,TEXT_GET_SUBSTRING_START_FROM_END:()=>ox,TEXT_GET_SUBSTRING_START_FROM_START:()=>ax,TEXT_GET_SUBSTRING_TAIL:()=>dx,TEXT_GET_SUBSTRING_TOOLTIP:()=>nx,TEXT_INDEXOF_HELPURL:()=>Bb,TEXT_INDEXOF_OPERATOR_FIRST:()=>Ub,TEXT_INDEXOF_OPERATOR_LAST:()=>Wb,TEXT_INDEXOF_TITLE:()=>Hb,TEXT_INDEXOF_TOOLTIP:()=>Vb,TEXT_ISEMPTY_HELPURL:()=>Lb,TEXT_ISEMPTY_TITLE:()=>Rb,TEXT_ISEMPTY_TOOLTIP:()=>zb,TEXT_JOIN_HELPURL:()=>Cb,TEXT_JOIN_TITLE_CREATEWITH:()=>wb,TEXT_JOIN_TOOLTIP:()=>Tb,TEXT_LENGTH_HELPURL:()=>Pb,TEXT_LENGTH_TITLE:()=>Fb,TEXT_LENGTH_TOOLTIP:()=>Ib,TEXT_PRINT_HELPURL:()=>Sx,TEXT_PRINT_TITLE:()=>Cx,TEXT_PRINT_TOOLTIP:()=>wx,TEXT_PROMPT_HELPURL:()=>Tx,TEXT_PROMPT_TOOLTIP_NUMBER:()=>Ox,TEXT_PROMPT_TOOLTIP_TEXT:()=>kx,TEXT_PROMPT_TYPE_NUMBER:()=>Dx,TEXT_PROMPT_TYPE_TEXT:()=>Ex,TEXT_REPLACE_HELPURL:()=>Px,TEXT_REPLACE_MESSAGE0:()=>Nx,TEXT_REPLACE_TOOLTIP:()=>Fx,TEXT_REVERSE_HELPURL:()=>Lx,TEXT_REVERSE_MESSAGE0:()=>Ix,TEXT_REVERSE_TOOLTIP:()=>Rx,TEXT_TEXT_HELPURL:()=>xb,TEXT_TEXT_TOOLTIP:()=>Sb,TEXT_TRIM_HELPURL:()=>_x,TEXT_TRIM_OPERATOR_BOTH:()=>yx,TEXT_TRIM_OPERATOR_LEFT:()=>bx,TEXT_TRIM_OPERATOR_RIGHT:()=>xx,TEXT_TRIM_TOOLTIP:()=>vx,TODAY:()=>eg,UNDO:()=>yg,UNKNOWN:()=>gw,UNNAMED_KEY:()=>$h,VARIABLES_DEFAULT_NAME:()=>Qh,VARIABLES_DYNAMIC_HUE:()=>Xh,VARIABLES_GET_CREATE_SET:()=>wC,VARIABLES_GET_HELPURL:()=>SC,VARIABLES_GET_TOOLTIP:()=>CC,VARIABLES_HUE:()=>Yh,VARIABLES_SET:()=>EC,VARIABLES_SET_CREATE_GET:()=>OC,VARIABLES_SET_HELPURL:()=>TC,VARIABLES_SET_TOOLTIP:()=>DC,VARIABLE_ALREADY_EXISTS:()=>Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:()=>jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:()=>Mg,WINDOWS:()=>fw,WORKSPACE_COMMENT_DEFAULT_TEXT:()=>ow,WORKSPACE_CONTENTS_BLOCKS_MANY:()=>AT,WORKSPACE_CONTENTS_BLOCKS_ONE:()=>jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:()=>MT,WORKSPACE_CONTENTS_COMMENTS_MANY:()=>NT,WORKSPACE_CONTENTS_COMMENTS_ONE:()=>PT,WORKSPACE_LABEL_1_STACK:()=>ET,WORKSPACE_LABEL_FLYOUT_WORKSPACE:()=>kT,WORKSPACE_LABEL_MANY_STACKS:()=>DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:()=>OT,WORKSPACE_LABEL_PLAIN:()=>wT,WORKSPACE_ROLEDESCRIPTION:()=>TT,ZOOM_IN:()=>pD,ZOOM_OUT:()=>mD,ZOOM_TO_FIT_ARIA_LABEL:()=>gO}),{LOGIC_HUE:Uh,LOOPS_HUE:Wh,MATH_HUE:Gh,TEXTS_HUE:Kh,LISTS_HUE:qh,COLOUR_HUE:Jh,VARIABLES_HUE:Yh,VARIABLES_DYNAMIC_HUE:Xh,PROCEDURES_HUE:Zh,VARIABLES_DEFAULT_NAME:Qh,UNNAMED_KEY:$h,TODAY:eg,DUPLICATE_BLOCK:tg,ADD_COMMENT:ng,REMOVE_COMMENT:rg,DUPLICATE_COMMENT:ig,EXTERNAL_INPUTS:ag,INLINE_INPUTS:og,DELETE_BLOCK:sg,DELETE_X_BLOCKS:cg,DELETE_ALL_BLOCKS:lg,CLEAN_UP:ug,CLOSE:dg,COLLAPSE_BLOCK:fg,COLLAPSE_ALL:pg,EXPAND_BLOCK:mg,EXPAND_ALL:hg,DISABLE_BLOCK:gg,ENABLE_BLOCK:_g,HELP:vg,UNDO:yg,REDO:bg,CHANGE_VALUE_TITLE:xg,RENAME_VARIABLE:Sg,RENAME_VARIABLE_TITLE:Cg,NEW_VARIABLE:wg,NEW_STRING_VARIABLE:Tg,NEW_NUMBER_VARIABLE:Eg,NEW_COLOUR_VARIABLE:Dg,NEW_VARIABLE_TYPE_TITLE:Og,NEW_VARIABLE_TITLE:kg,VARIABLE_ALREADY_EXISTS:Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:Mg,DELETE_VARIABLE_CONFIRMATION:Ng,CANNOT_DELETE_VARIABLE_PROCEDURE:Pg,DELETE_VARIABLE:Fg,COLOUR_PICKER_HELPURL:Ig,COLOUR_PICKER_TOOLTIP:Lg,COLOUR_RANDOM_HELPURL:Rg,COLOUR_RANDOM_TITLE:zg,COLOUR_RANDOM_TOOLTIP:Bg,COLOUR_RGB_HELPURL:Vg,COLOUR_RGB_TITLE:Hg,COLOUR_RGB_RED:Ug,COLOUR_RGB_GREEN:Wg,COLOUR_RGB_BLUE:Gg,COLOUR_RGB_TOOLTIP:Kg,COLOUR_BLEND_HELPURL:qg,COLOUR_BLEND_TITLE:Jg,COLOUR_BLEND_COLOUR1:Yg,COLOUR_BLEND_COLOUR2:Xg,COLOUR_BLEND_RATIO:Zg,COLOUR_BLEND_TOOLTIP:Qg,CONTROLS_REPEAT_HELPURL:$g,CONTROLS_REPEAT_TITLE:e_,CONTROLS_REPEAT_INPUT_DO:t_,CONTROLS_REPEAT_TOOLTIP:n_,CONTROLS_WHILEUNTIL_HELPURL:r_,CONTROLS_WHILEUNTIL_INPUT_DO:i_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:a_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:o_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:s_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:c_,CONTROLS_FOR_HELPURL:l_,CONTROLS_FOR_TOOLTIP:u_,CONTROLS_FOR_TITLE:d_,CONTROLS_FOR_INPUT_DO:f_,CONTROLS_FOREACH_HELPURL:p_,CONTROLS_FOREACH_TITLE:m_,CONTROLS_FOREACH_INPUT_DO:h_,CONTROLS_FOREACH_TOOLTIP:g_,CONTROLS_FLOW_STATEMENTS_HELPURL:__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:x_,CONTROLS_FLOW_STATEMENTS_WARNING:S_,CONTROLS_IF_HELPURL:C_,CONTROLS_IF_TOOLTIP_1:w_,CONTROLS_IF_TOOLTIP_2:T_,CONTROLS_IF_TOOLTIP_3:E_,CONTROLS_IF_TOOLTIP_4:D_,CONTROLS_IF_MSG_IF:O_,CONTROLS_IF_MSG_ELSEIF:k_,CONTROLS_IF_MSG_ELSE:A_,CONTROLS_IF_MSG_THEN:j_,CONTROLS_IF_IF_TITLE_IF:M_,CONTROLS_IF_IF_TOOLTIP:N_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:P_,CONTROLS_IF_ELSEIF_TOOLTIP:F_,CONTROLS_IF_ELSE_TITLE_ELSE:I_,CONTROLS_IF_ELSE_TOOLTIP:L_,LOGIC_COMPARE_HELPURL:R_,LOGIC_COMPARE_EQ_ARIA:z_,LOGIC_COMPARE_TOOLTIP_EQ:B_,LOGIC_COMPARE_NEQ_ARIA:V_,LOGIC_COMPARE_TOOLTIP_NEQ:H_,LOGIC_COMPARE_LT_ARIA:U_,LOGIC_COMPARE_TOOLTIP_LT:W_,LOGIC_COMPARE_LTE_ARIA:G_,LOGIC_COMPARE_TOOLTIP_LTE:K_,LOGIC_COMPARE_GT_ARIA:q_,LOGIC_COMPARE_TOOLTIP_GT:J_,LOGIC_COMPARE_GTE_ARIA:Y_,LOGIC_COMPARE_TOOLTIP_GTE:X_,LOGIC_OPERATION_HELPURL:Z_,LOGIC_OPERATION_TOOLTIP_AND:Q_,LOGIC_OPERATION_AND:$_,LOGIC_OPERATION_TOOLTIP_OR:ev,LOGIC_OPERATION_OR:tv,LOGIC_NEGATE_HELPURL:nv,LOGIC_NEGATE_TITLE:rv,LOGIC_NEGATE_TOOLTIP:iv,LOGIC_BOOLEAN_HELPURL:av,LOGIC_BOOLEAN_TRUE:ov,LOGIC_BOOLEAN_FALSE:sv,LOGIC_BOOLEAN_TOOLTIP:cv,LOGIC_NULL_HELPURL:lv,LOGIC_NULL:uv,LOGIC_NULL_TOOLTIP:dv,LOGIC_TERNARY_HELPURL:fv,LOGIC_TERNARY_CONDITION:pv,LOGIC_TERNARY_IF_TRUE:mv,LOGIC_TERNARY_IF_FALSE:hv,LOGIC_TERNARY_TOOLTIP:gv,MATH_NUMBER_HELPURL:_v,MATH_NUMBER_TOOLTIP:vv,MATH_ADDITION_SYMBOL:yv,MATH_ADDITION_SYMBOL_ARIA:bv,MATH_SUBTRACTION_SYMBOL:xv,MATH_SUBTRACTION_SYMBOL_ARIA:Sv,MATH_DIVISION_SYMBOL:Cv,MATH_DIVISION_SYMBOL_ARIA:wv,MATH_MULTIPLICATION_SYMBOL:Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:Ev,MATH_POWER_SYMBOL:Dv,MATH_POWER_SYMBOL_ARIA:Ov,MATH_TRIG_SIN:kv,MATH_TRIG_SIN_ARIA:Av,MATH_TRIG_COS:jv,MATH_TRIG_COS_ARIA:Mv,MATH_TRIG_TAN:Nv,MATH_TRIG_TAN_ARIA:Pv,MATH_TRIG_ASIN:Fv,MATH_TRIG_ASIN_ARIA:Iv,MATH_TRIG_ACOS:Lv,MATH_TRIG_ACOS_ARIA:Rv,MATH_TRIG_ATAN:zv,MATH_TRIG_ATAN_ARIA:Bv,MATH_CONSTANT_PI_ARIA:Vv,MATH_CONSTANT_E_ARIA:Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:Uv,MATH_CONSTANT_SQRT2_ARIA:Wv,MATH_CONSTANT_SQRT1_2_ARIA:Gv,MATH_CONSTANT_INFINITY_ARIA:Kv,MATH_ARITHMETIC_HELPURL:qv,MATH_ARITHMETIC_TOOLTIP_ADD:Jv,MATH_ARITHMETIC_TOOLTIP_MINUS:Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:Xv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:Zv,MATH_ARITHMETIC_TOOLTIP_POWER:Qv,MATH_SINGLE_HELPURL:$v,MATH_SINGLE_OP_ROOT:ey,MATH_SINGLE_TOOLTIP_ROOT:ty,MATH_SINGLE_OP_ABSOLUTE:ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:ry,MATH_SINGLE_TOOLTIP_ABS:iy,MATH_SINGLE_OP_NEG_ARIA:ay,MATH_SINGLE_OP_LN_ARIA:oy,MATH_SINGLE_OP_LOG10_ARIA:sy,MATH_SINGLE_OP_EXP_ARIA:cy,MATH_SINGLE_OP_POW10_ARIA:ly,MATH_SINGLE_TOOLTIP_NEG:uy,MATH_SINGLE_TOOLTIP_LN:dy,MATH_SINGLE_TOOLTIP_LOG10:fy,MATH_SINGLE_TOOLTIP_EXP:py,MATH_SINGLE_TOOLTIP_POW10:my,MATH_TRIG_HELPURL:hy,MATH_TRIG_TOOLTIP_SIN:gy,MATH_TRIG_TOOLTIP_COS:_y,MATH_TRIG_TOOLTIP_TAN:vy,MATH_TRIG_TOOLTIP_ASIN:yy,MATH_TRIG_TOOLTIP_ACOS:by,MATH_TRIG_TOOLTIP_ATAN:xy,MATH_CONSTANT_HELPURL:Sy,MATH_CONSTANT_TOOLTIP:Cy,MATH_IS_EVEN:wy,MATH_IS_ODD:Ty,MATH_IS_PRIME:Ey,MATH_IS_WHOLE:Dy,MATH_IS_POSITIVE:Oy,MATH_IS_NEGATIVE:ky,MATH_IS_DIVISIBLE_BY:Ay,MATH_IS_TOOLTIP:jy,MATH_CHANGE_HELPURL:My,MATH_CHANGE_TITLE:Ny,MATH_CHANGE_TITLE_ITEM:Py,MATH_CHANGE_TOOLTIP:Fy,MATH_ROUND_HELPURL:Iy,MATH_ROUND_TOOLTIP:Ly,MATH_ROUND_OPERATOR_ROUND:Ry,MATH_ROUND_OPERATOR_ROUNDUP:zy,MATH_ROUND_OPERATOR_ROUNDDOWN:By,MATH_ONLIST_HELPURL:Vy,MATH_ONLIST_OPERATOR_SUM:Hy,MATH_ONLIST_TOOLTIP_SUM:Uy,MATH_ONLIST_OPERATOR_MIN:Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:Gy,MATH_ONLIST_TOOLTIP_MIN:Ky,MATH_ONLIST_OPERATOR_MAX:qy,MATH_ONLIST_OPERATOR_MAX_ARIA:Jy,MATH_ONLIST_TOOLTIP_MAX:Yy,MATH_ONLIST_OPERATOR_AVERAGE:Xy,MATH_ONLIST_TOOLTIP_AVERAGE:Zy,MATH_ONLIST_OPERATOR_MEDIAN:Qy,MATH_ONLIST_TOOLTIP_MEDIAN:$y,MATH_ONLIST_OPERATOR_MODE:eb,MATH_ONLIST_TOOLTIP_MODE:tb,MATH_ONLIST_OPERATOR_STD_DEV:nb,MATH_ONLIST_TOOLTIP_STD_DEV:rb,MATH_ONLIST_OPERATOR_RANDOM:ib,MATH_ONLIST_TOOLTIP_RANDOM:ab,MATH_MODULO_HELPURL:ob,MATH_MODULO_TITLE:sb,MATH_MODULO_TOOLTIP:cb,MATH_CONSTRAIN_HELPURL:lb,MATH_CONSTRAIN_TITLE:ub,MATH_CONSTRAIN_TOOLTIP:db,MATH_RANDOM_INT_HELPURL:fb,MATH_RANDOM_INT_TITLE:pb,MATH_RANDOM_INT_TOOLTIP:mb,MATH_RANDOM_FLOAT_HELPURL:hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:gb,MATH_RANDOM_FLOAT_TOOLTIP:_b,MATH_ATAN2_HELPURL:vb,MATH_ATAN2_TITLE:yb,MATH_ATAN2_TOOLTIP:bb,TEXT_TEXT_HELPURL:xb,TEXT_TEXT_TOOLTIP:Sb,TEXT_JOIN_HELPURL:Cb,TEXT_JOIN_TITLE_CREATEWITH:wb,TEXT_JOIN_TOOLTIP:Tb,TEXT_CREATE_JOIN_TITLE_JOIN:Eb,TEXT_CREATE_JOIN_TOOLTIP:Db,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:kb,TEXT_APPEND_HELPURL:Ab,TEXT_APPEND_TITLE:jb,TEXT_APPEND_VARIABLE:Mb,TEXT_APPEND_TOOLTIP:Nb,TEXT_LENGTH_HELPURL:Pb,TEXT_LENGTH_TITLE:Fb,TEXT_LENGTH_TOOLTIP:Ib,TEXT_ISEMPTY_HELPURL:Lb,TEXT_ISEMPTY_TITLE:Rb,TEXT_ISEMPTY_TOOLTIP:zb,TEXT_INDEXOF_HELPURL:Bb,TEXT_INDEXOF_TOOLTIP:Vb,TEXT_INDEXOF_TITLE:Hb,TEXT_INDEXOF_OPERATOR_FIRST:Ub,TEXT_INDEXOF_OPERATOR_LAST:Wb,TEXT_FROM_START_ARIA:Gb,TEXT_FROM_END_ARIA:Kb,TEXT_CHARAT_HELPURL:qb,TEXT_CHARAT_TITLE:Jb,TEXT_CHARAT_FROM_START:Yb,TEXT_CHARAT_FROM_END:Xb,TEXT_CHARAT_FIRST:Zb,TEXT_CHARAT_LAST:Qb,TEXT_CHARAT_RANDOM:$b,TEXT_CHARAT_TAIL:ex,TEXT_CHARAT_TOOLTIP:tx,TEXT_GET_SUBSTRING_TOOLTIP:nx,TEXT_GET_SUBSTRING_HELPURL:rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:ix,TEXT_GET_SUBSTRING_START_FROM_START:ax,TEXT_GET_SUBSTRING_START_FROM_END:ox,TEXT_GET_SUBSTRING_START_FIRST:sx,TEXT_GET_SUBSTRING_END_FROM_START:cx,TEXT_GET_SUBSTRING_END_FROM_END:lx,TEXT_GET_SUBSTRING_END_LAST:ux,TEXT_GET_SUBSTRING_TAIL:dx,TEXT_CHANGECASE_HELPURL:fx,TEXT_CHANGECASE_TOOLTIP:px,TEXT_CHANGECASE_OPERATOR_UPPERCASE:mx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:gx,TEXT_TRIM_HELPURL:_x,TEXT_TRIM_TOOLTIP:vx,TEXT_TRIM_OPERATOR_BOTH:yx,TEXT_TRIM_OPERATOR_LEFT:bx,TEXT_TRIM_OPERATOR_RIGHT:xx,TEXT_PRINT_HELPURL:Sx,TEXT_PRINT_TITLE:Cx,TEXT_PRINT_TOOLTIP:wx,TEXT_PROMPT_HELPURL:Tx,TEXT_PROMPT_TYPE_TEXT:Ex,TEXT_PROMPT_TYPE_NUMBER:Dx,TEXT_PROMPT_TOOLTIP_NUMBER:Ox,TEXT_PROMPT_TOOLTIP_TEXT:kx,TEXT_COUNT_MESSAGE0:Ax,TEXT_COUNT_HELPURL:jx,TEXT_COUNT_TOOLTIP:Mx,TEXT_REPLACE_MESSAGE0:Nx,TEXT_REPLACE_HELPURL:Px,TEXT_REPLACE_TOOLTIP:Fx,TEXT_REVERSE_MESSAGE0:Ix,TEXT_REVERSE_HELPURL:Lx,TEXT_REVERSE_TOOLTIP:Rx,LISTS_CREATE_EMPTY_HELPURL:zx,LISTS_CREATE_EMPTY_TITLE:Bx,LISTS_CREATE_EMPTY_TOOLTIP:Vx,LISTS_CREATE_WITH_HELPURL:Hx,LISTS_CREATE_WITH_TOOLTIP:Ux,LISTS_CREATE_WITH_INPUT_WITH:Wx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:Kx,LISTS_CREATE_WITH_ITEM_TITLE:qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:Jx,LISTS_REPEAT_HELPURL:Yx,LISTS_REPEAT_TOOLTIP:Xx,LISTS_REPEAT_TITLE:Zx,LISTS_LENGTH_HELPURL:Qx,LISTS_LENGTH_TITLE:$x,LISTS_LENGTH_TOOLTIP:eS,LISTS_ISEMPTY_HELPURL:tS,LISTS_ISEMPTY_TITLE:nS,LISTS_ISEMPTY_TOOLTIP:rS,LISTS_INLIST:iS,LISTS_INDEX_OF_HELPURL:aS,LISTS_INDEX_OF_INPUT_IN_LIST:oS,LISTS_INDEX_OF_FIRST:sS,LISTS_INDEX_OF_LAST:cS,LISTS_INDEX_OF_TOOLTIP:lS,LISTS_GET_INDEX_HELPURL:uS,LISTS_GET_INDEX_GET:dS,LISTS_GET_INDEX_GET_REMOVE:fS,LISTS_GET_INDEX_REMOVE:pS,LISTS_GET_INDEX_FROM_START:mS,LISTS_GET_INDEX_FROM_END:hS,LISTS_GET_INDEX_FIRST:gS,LISTS_GET_INDEX_LAST:_S,LISTS_GET_INDEX_RANDOM:vS,LISTS_GET_INDEX_TAIL:yS,LISTS_GET_INDEX_INPUT_IN_LIST:bS,LISTS_INDEX_FROM_START_TOOLTIP:xS,LISTS_INDEX_FROM_END_TOOLTIP:SS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:CS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:wS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:PS,LISTS_SET_INDEX_HELPURL:FS,LISTS_SET_INDEX_INPUT_IN_LIST:IS,LISTS_SET_INDEX_SET:LS,LISTS_SET_INDEX_INSERT:RS,LISTS_SET_INDEX_INPUT_TO:zS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:BS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:VS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:US,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:WS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:GS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:qS,LISTS_GET_SUBLIST_HELPURL:JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:YS,LISTS_GET_SUBLIST_START_FROM_START:XS,LISTS_GET_SUBLIST_START_FROM_END:ZS,LISTS_GET_SUBLIST_START_FIRST:QS,LISTS_GET_SUBLIST_END_FROM_START:$S,LISTS_GET_SUBLIST_END_FROM_END:eC,LISTS_GET_SUBLIST_END_LAST:tC,LISTS_GET_SUBLIST_TAIL:nC,LISTS_GET_SUBLIST_TOOLTIP:rC,LISTS_SORT_HELPURL:iC,LISTS_SORT_TITLE:aC,LISTS_SORT_TOOLTIP:oC,LISTS_SORT_ORDER_ASCENDING:sC,LISTS_SORT_ORDER_DESCENDING:cC,LISTS_SORT_TYPE_NUMERIC:lC,LISTS_SORT_TYPE_TEXT:uC,LISTS_SORT_TYPE_IGNORECASE:dC,LISTS_SPLIT_HELPURL:fC,LISTS_SPLIT_LIST_FROM_TEXT:pC,LISTS_SPLIT_TEXT_FROM_LIST:mC,LISTS_SPLIT_WITH_DELIMITER:hC,LISTS_SPLIT_TOOLTIP_SPLIT:gC,LISTS_SPLIT_TOOLTIP_JOIN:_C,LISTS_REVERSE_HELPURL:vC,LISTS_REVERSE_MESSAGE0:yC,LISTS_REVERSE_TOOLTIP:bC,ORDINAL_NUMBER_SUFFIX:xC,VARIABLES_GET_HELPURL:SC,VARIABLES_GET_TOOLTIP:CC,VARIABLES_GET_CREATE_SET:wC,VARIABLES_SET_HELPURL:TC,VARIABLES_SET:EC,VARIABLES_SET_TOOLTIP:DC,VARIABLES_SET_CREATE_GET:OC,PROCEDURES_DEFNORETURN_HELPURL:kC,PROCEDURES_DEFNORETURN_TITLE:AC,PROCEDURES_DEFNORETURN_PROCEDURE:jC,PROCEDURES_BEFORE_PARAMS:MC,PROCEDURES_CALL_BEFORE_PARAMS:NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:PC,PROCEDURES_DEFNORETURN_DO:FC,PROCEDURES_DEFNORETURN_TOOLTIP:IC,PROCEDURES_DEFNORETURN_COMMENT:LC,PROCEDURES_DEFRETURN_HELPURL:RC,PROCEDURES_DEFRETURN_TITLE:zC,PROCEDURES_DEFRETURN_PROCEDURE:BC,PROCEDURES_DEFRETURN_DO:VC,PROCEDURES_DEFRETURN_COMMENT:HC,PROCEDURES_DEFRETURN_RETURN:UC,PROCEDURES_DEFRETURN_TOOLTIP:WC,PROCEDURES_ALLOW_STATEMENTS:GC,PROCEDURES_DEF_DUPLICATE_WARNING:KC,PROCEDURES_CALLNORETURN_HELPURL:qC,PROCEDURES_CALLNORETURN_TOOLTIP:JC,PROCEDURES_CALLRETURN_HELPURL:YC,PROCEDURES_CALLRETURN_TOOLTIP:XC,PROCEDURES_MUTATORCONTAINER_TITLE:ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:QC,PROCEDURES_MUTATORARG_TITLE:$C,PROCEDURES_MUTATORARG_TOOLTIP:ew,PROCEDURES_HIGHLIGHT_DEF:tw,PROCEDURES_CREATE_DO:nw,PROCEDURES_IFRETURN_TOOLTIP:rw,PROCEDURES_IFRETURN_HELPURL:iw,PROCEDURES_IFRETURN_WARNING:aw,WORKSPACE_COMMENT_DEFAULT_TEXT:ow,COLLAPSED_WARNINGS_WARNING:sw,DIALOG_OK:cw,DIALOG_CANCEL:lw,EDIT_BLOCK_CONTENTS:uw,MOVE_BLOCK:dw,WINDOWS:fw,MAC_OS:pw,CHROME_OS:mw,LINUX:hw,UNKNOWN:gw,CONTROL_KEY:_w,COMMAND_KEY:vw,OPTION_KEY:yw,ALT_KEY:bw,ENTER_KEY:xw,BACKSPACE_KEY:Sw,DELETE_KEY:Cw,ESCAPE:ww,TAB_KEY:Tw,SHIFT_KEY:Ew,CAPS_LOCK_KEY:Dw,SPACE_KEY:Ow,PAGE_UP_KEY:kw,PAGE_DOWN_KEY:Aw,END_KEY:jw,HOME_KEY:Mw,INSERT_KEY:Nw,PAUSE_KEY:Pw,CONTEXT_MENU_KEY:Fw,CUT_SHORTCUT:Iw,COPY_SHORTCUT:Lw,PASTE_SHORTCUT:Rw,HELP_PROMPT:zw,SHORTCUTS_GENERAL:Bw,SHORTCUTS_EDITING:Vw,SHORTCUTS_CODE_NAVIGATION:Hw,SHORTCUTS_ESCAPE:Uw,SHORTCUTS_DELETE:Ww,SHORTCUTS_START_MOVE:Gw,SHORTCUTS_START_MOVE_STACK:Kw,SHORTCUTS_MOVE_LEFT:qw,SHORTCUTS_MOVE_RIGHT:Jw,SHORTCUTS_MOVE_UP:Yw,SHORTCUTS_MOVE_DOWN:Xw,SHORTCUTS_FINISH_MOVE:Zw,SHORTCUTS_ABORT_MOVE:Qw,SHORTCUTS_SHOW_CONTEXT_MENU:$w,SHORTCUTS_FOCUS_WORKSPACE:eT,SHORTCUTS_FOCUS_TOOLBOX:tT,SHORTCUTS_INFORMATION:nT,SHORTCUTS_EXTENDED_INFORMATION:rT,SHORTCUTS_DISCONNECT:iT,SHORTCUTS_NEXT_STACK:aT,SHORTCUTS_PREVIOUS_STACK:oT,SHORTCUTS_NEXT_HEADING:sT,SHORTCUTS_PREVIOUS_HEADING:cT,SHORTCUTS_PERFORM_ACTION:lT,SHORTCUTS_DUPLICATE:uT,SHORTCUTS_CLEANUP:dT,SHORTCUTS_SHOW_TOOLTIP:fT,SHORTCUTS_TOGGLE_SCREENREADER_MODE:pT,SHORTCUTS_JUMP_BLOCK_START:mT,SHORTCUTS_JUMP_BLOCK_END:hT,SHORTCUTS_JUMP_TOP_STACK:gT,SHORTCUTS_JUMP_BOTTOM_STACK:_T,SHORTCUTS_JUMP_FIRST_BLOCK:vT,SHORTCUTS_JUMP_LAST_BLOCK:yT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:bT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:xT,KEYBOARD_NAV_COPIED_HINT:ST,KEYBOARD_NAV_CUT_HINT:CT,WORKSPACE_LABEL_PLAIN:wT,WORKSPACE_ROLEDESCRIPTION:TT,WORKSPACE_LABEL_1_STACK:ET,WORKSPACE_LABEL_MANY_STACKS:DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:OT,WORKSPACE_LABEL_FLYOUT_WORKSPACE:kT,WORKSPACE_CONTENTS_BLOCKS_MANY:AT,WORKSPACE_CONTENTS_BLOCKS_ONE:jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:MT,WORKSPACE_CONTENTS_COMMENTS_MANY:NT,WORKSPACE_CONTENTS_COMMENTS_ONE:PT,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:FT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:IT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:LT,BLOCK_LABEL_BEGIN_STACK:RT,BLOCK_LABEL_BEGIN_PREFIX:zT,BLOCK_LABEL_TOOLBOX_CATEGORY:BT,BLOCK_LABEL_DISABLED:VT,BLOCK_LABEL_COLLAPSED:HT,BLOCK_LABEL_REPLACEABLE:UT,BLOCK_LABEL_HAS_INPUT:WT,BLOCK_LABEL_HAS_INPUTS:GT,BLOCK_LABEL_HAS_BRANCHES:KT,BLOCK_LABEL_STATEMENT:qT,BLOCK_LABEL_CONTAINER:JT,BLOCK_LABEL_VALUE:YT,BLOCK_LABEL_STACK_BLOCKS:XT,INPUT_LABEL_INDEX:ZT,INPUT_LABEL_VALUE:QT,INPUT_LABEL_STATEMENT:$T,INPUT_LABEL_END_STATEMENT:eE,INPUT_LABEL_EMPTY:tE,INPUT_LABEL_CONDITION:nE,INPUT_LABEL_CONDITION_A:rE,INPUT_LABEL_CONDITION_B:iE,INPUT_LABEL_VALUE_A:aE,INPUT_LABEL_VALUE_B:oE,INPUT_LABEL_NUMBER:sE,INPUT_LABEL_NUMBER_A:cE,INPUT_LABEL_NUMBER_B:lE,INPUT_LABEL_NUMBER_TO_CHECK:uE,INPUT_LABEL_NUMBER_LIST:dE,INPUT_LABEL_MATH_DIVIDEND:fE,INPUT_LABEL_MATH_DIVISOR:pE,INPUT_LABEL_MATH_CHANGE_BY:mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:hE,INPUT_LABEL_NUMBER_MIN:gE,INPUT_LABEL_NUMBER_MAX:_E,INPUT_LABEL_NUMBER_ATAN2_X:vE,INPUT_LABEL_NUMBER_ATAN2_Y:yE,INPUT_LABEL_LOOP_TIMES:bE,INPUT_LABEL_LOOP_FROM:xE,INPUT_LABEL_LOOP_TO:SE,INPUT_LABEL_LOOP_BY:CE,INPUT_LABEL_LOOP_LIST:wE,INPUT_LABEL_TEXT_JOIN_ITEM:TE,INPUT_LABEL_TEXT_APPEND:EE,INPUT_LABEL_TEXT_TO_CHANGE:DE,INPUT_LABEL_TEXT_TO_CHECK:OE,INPUT_LABEL_TEXT_TO_FIND:kE,INPUT_LABEL_TEXT_TO_REPLACE:AE,INPUT_LABEL_TEXT_POSITION:jE,INPUT_LABEL_TEXT_START_POSITION:ME,INPUT_LABEL_TEXT_END_POSITION:NE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:PE,INPUT_LABEL_VARIABLES_SET:FE,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:IE,INPUT_LABEL_LISTS_REPEAT_ITEM:LE,INPUT_LABEL_LISTS_REPEAT_NUM:RE,INPUT_LABEL_LISTS_TO_CHECK:zE,INPUT_LABEL_LISTS_VALUE_TO_SET:BE,INPUT_LABEL_LISTS_POSITION:VE,INPUT_LABEL_LISTS_START_POSITION:HE,INPUT_LABEL_LISTS_END_POSITION:UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:WE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:GE,INPUT_LABEL_LISTS_DELIMITER:KE,INPUT_LABEL_LISTS_TO_CHANGE:qE,ANNOUNCE_MOVE_WORKSPACE:JE,ANNOUNCE_MOVE_BEFORE:YE,ANNOUNCE_MOVE_AFTER:XE,ANNOUNCE_MOVE_INSIDE:ZE,ANNOUNCE_MOVE_AROUND:QE,ANNOUNCE_MOVE_TO:$E,ANNOUNCE_MOVE_OF:eD,ANNOUNCE_MOVE_CANCELED:tD,FIELD_LABEL_EMPTY:nD,ARIA_TYPE_FIELD_INPUT:rD,ARIA_TYPE_FIELD_TEXT_INPUT:iD,ARIA_TYPE_FIELD_NUMBER:aD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:oD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:sD,ARIA_TYPE_FIELD_DROPDOWN:cD,ARIA_TYPE_FIELD_IMAGE:lD,ARIA_TYPE_FIELD_CHECKBOX:uD,FIELD_LABEL_EDIT_PREFIX:dD,OPEN_TRASH:fD,ZOOM_IN:pD,ZOOM_OUT:mD,RESET_ZOOM:hD,FIELD_LABEL_OPTION_INDEX:gD,FIELD_LABEL_CHECKBOX_CHECKED:_D,FIELD_LABEL_CHECKBOX_UNCHECKED:vD,FIELD_LABEL_VARIABLE:yD,ARIA_LABEL_BUTTON:bD,ARIA_LABEL_HEADING:xD,BUBBLE_LABEL_DEFAULT:SD,BUBBLE_LABEL_COMMENT:CD,BUBBLE_LABEL_WARNING:wD,ICON_LABEL_DEFAULT:TD,ICON_LABEL_COMMENT_CLOSED:ED,ICON_LABEL_COMMENT_OPEN:DD,ICON_LABEL_MUTATOR_CLOSED:OD,ICON_LABEL_MUTATOR_OPEN:kD,ICON_LABEL_WARNING_CLOSED:AD,ICON_LABEL_WARNING_OPEN:jD,ARIA_LABEL_COMMENT:MD,ARIA_LABEL_COMMENT_COLLAPSE:ND,ARIA_LABEL_COMMENT_EXPAND:PD,SCREENREADER_MODE_ENABLED:FD,SCREENREADER_MODE_DISABLED:ID,CURRENT_BLOCK_ANNOUNCEMENT:LD,PARENT_BLOCKS_ANNOUNCEMENT:RD,NO_PARENT_ANNOUNCEMENT:zD,SCREENREADER_HINT:BD,ARIA_LABEL_ADD_ELSE_IF:VD,ARIA_LABEL_REMOVE_ELSE_IF:HD,ARIA_LABEL_ADD_LIST_ITEM:UD,ARIA_LABEL_REMOVE_LIST_ITEM:WD,ARIA_LABEL_ADD_TEXT:GD,ARIA_LABEL_REMOVE_TEXT:KD,ARIA_LABEL_ADD_INPUT:qD,ARIA_LABEL_REMOVE_INPUT:JD,ARIA_TYPE_FIELD_ANGLE:YD,ARIA_LABEL_FIELD_ANGLE:XD,ARIA_TYPE_FIELD_DATE:ZD,ARIA_TYPE_FIELD_COLOUR:QD,ARIA_TYPE_FIELD_BITMAP:$D,ARIA_TYPE_FIELD_GRID:eO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:tO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:nO,FIELD_BITMAP_PIXEL_ON:rO,FIELD_BITMAP_PIXEL_OFF:iO,FIELD_BITMAP_PIXEL_LABEL:aO,FIELD_BITMAP_ARIA_VALUE:oO,OPEN_BACKPACK:sO,CLOSE_BACKPACK:cO,COPY_ALL_TO_BACKPACK:lO,COPY_TO_BACKPACK:uO,EMPTY_BACKPACK:dO,PASTE_ALL_FROM_BACKPACK:fO,REMOVE_FROM_BACKPACK:pO,FIELD_MULTILINEINPUT_FINISH_EDITING:mO,FIELD_MULTILINEINPUT_NEW_LINE:hO,ZOOM_TO_FIT_ARIA_LABEL:gO,MINIMAP_ARIA_LABEL:_O,ARIA_LABEL_TRASH_EMPTY:vO}=t(Vh(),1).default,yO=[{id:`blocks_words`,source:`module`},{id:`blocks_procedures`,source:`module`},{id:`blocks_logic`,source:`module`},{id:`blocks_switch`,source:`module`},{id:`blocks_text`,source:`module`},{id:`blocks_number`,source:`module`},{id:`field_oid`,source:`module`},{id:`field_cron`,source:`module`},{id:`field_script`,source:`module`},{id:`blocks_system`,source:`module`},{id:`blocks_action`,source:`module`},{id:`blocks_sendto`,source:`module`},{id:`blocks_time`,source:`module`},{id:`blocks_convert`,source:`module`},{id:`blocks_trigger`,source:`module`},{id:`blocks_timeout`,source:`module`},{id:`blocks_object`,source:`module`}],bO={blocks_action:()=>o(()=>import(`./blocks_action-C3rgCWyA.js`),__vite__mapDeps([9,10,11,12]),import.meta.url),blocks_convert:()=>o(()=>import(`./blocks_convert-DpPMvgqR.js`),__vite__mapDeps([13,10,11,12]),import.meta.url),blocks_words:()=>o(()=>import(`./blocks_words-BhHIf_1o.js`),[],import.meta.url),blocks_logic:()=>o(()=>import(`./blocks_logic-CDtLDgvr.js`),__vite__mapDeps([14,10,11,12]),import.meta.url),blocks_number:()=>o(()=>import(`./blocks_number-Dtveo3bM.js`),__vite__mapDeps([15,10,11]),import.meta.url),blocks_procedures:()=>o(()=>import(`./blocks_procedures-DkNQY-Dy.js`),__vite__mapDeps([16,10,17]),import.meta.url),blocks_sendto:()=>o(()=>import(`./blocks_sendto-CgDyguqB.js`),__vite__mapDeps([18,10,11,12]),import.meta.url),blocks_system:()=>o(()=>import(`./blocks_system-CKoiEzef.js`),__vite__mapDeps([19,10,12,20]),import.meta.url),field_cron:()=>o(()=>import(`./field_cron-BJLkgNzf.js`),__vite__mapDeps([21,10]),import.meta.url),field_oid:()=>o(()=>import(`./field_oid-CJZIeruf.js`),__vite__mapDeps([20,10]),import.meta.url),field_script:()=>o(()=>import(`./field_script-4IGidWJ7.js`),__vite__mapDeps([17,10]),import.meta.url),blocks_object:()=>o(()=>import(`./blocks_object-B6SUr8HP.js`),__vite__mapDeps([22,10,11,12]),import.meta.url),blocks_switch:()=>o(()=>import(`./blocks_switch-CcBSyo3I.js`),__vite__mapDeps([23,10,11]),import.meta.url),blocks_text:()=>o(()=>import(`./blocks_text-DqsVhl4Q.js`),__vite__mapDeps([24,10,11]),import.meta.url),blocks_time:()=>o(()=>import(`./blocks_time-DJfyX0NT.js`),__vite__mapDeps([25,10,11,12]),import.meta.url),blocks_trigger:()=>o(()=>import(`./blocks_trigger-DoyYYWM8.js`),__vite__mapDeps([26,10,12,20,21]),import.meta.url),blocks_timeout:()=>o(()=>import(`./blocks_timeout-BCswLlY9.js`),__vite__mapDeps([27,10,11]),import.meta.url)},xO={...dn,JavaScript:Bh};pn(Hh),window.Blockly=xO,window.goog||={provide:()=>{},require:()=>{}};function SO(e){return new Promise(t=>{let n=window.document.createElement(`script`);n.src=e,n.onload=()=>t(),n.onerror=()=>{console.error(`Cannot load ${e}`),t()},window.document.head.appendChild(n)})}var CO=null;function wO(){return CO||=(async()=>{for(let e of yO)if(e.source===`module`){let t=bO[e.id];if(!t){console.error(`No module registered for "${e.id}" - check BLOCK_MODULES in bridge.ts`);continue}(await t()).install()}else await SO(`google-blockly/own/${e.id}.js`)})(),CO}var X=window.Blockly,TO=class extends Error{constructor(){super(`The field has not yet been attached to its input. Call appendField to attach it.`)}},EO=class e extends X.Field{constructor(e,t,n){super(e),N(this,`textGroup`,null),N(this,`borderRect_`,null),N(this,`maxLines_`,1/0),N(this,`isOverflowedY_`,!1),e!==Symbol(`SKIP_SETUP`)&&(n&&this.configure_(n),this.SERIALIZABLE=!0,this.setValue((e==null?void 0:e.toString())||``),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.maxLines&&this.setMaxLines(e.maxLines)}toXml(e){return e.textContent=this.getValue().replace(/\n/g,` `),e}fromXml(e){this.setValue(e.textContent.replace(/ /g,` + `),[n+`.slice().sort(`+t+`("`+e+`", `+r+`))`,f.FUNCTION_CALL]},lists_split:function(e,t){var n=t.valueToCode(e,`INPUT`,f.MEMBER);if(t=t.valueToCode(e,`DELIM`,f.NONE)||`''`,e=e.getFieldValue(`MODE`),e===`SPLIT`)n||=`''`,e=`split`;else if(e===`JOIN`)n||=`[]`,e=`join`;else throw Error(`Unknown mode: `+e);return[n+`.`+e+`(`+t+`)`,f.FUNCTION_CALL]}},h,g,_,v,b,x,S);for(let e in w)C.forBlock[e]=w[e];var T={};return T.JavascriptGenerator=m,T.Order=f,T.javascriptGenerator=C,t.__chunk_javascript=T,t.__chunk_javascript.__namespace__=t,t.__chunk_javascript})}))(),1).default,Vh=r(((e,t)=>{(function(n,r){if(typeof e==`object`)t.exports=r();else{var i=r();for(var a in i)n.Blockly.Msg[a]=i[a]}})(e,function(){var e=e||{Msg:Object.create(null)};return e.Msg.ADD_COMMENT=`Add Comment`,e.Msg.ALT_KEY=`Alt`,e.Msg.ANNOUNCE_MOVE_AFTER=`Moving %1 after %2.`,e.Msg.ANNOUNCE_MOVE_AROUND=`Moving %1 around %2.`,e.Msg.ANNOUNCE_MOVE_BEFORE=`Moving %1 before %2.`,e.Msg.ANNOUNCE_MOVE_CANCELED=`Canceled movement.`,e.Msg.ANNOUNCE_MOVE_INSIDE=`Moving %1 inside %2.`,e.Msg.ANNOUNCE_MOVE_OF=`%1 of %2`,e.Msg.ANNOUNCE_MOVE_TO=`Moving %1 to %2.`,e.Msg.ANNOUNCE_MOVE_WORKSPACE=`Moving %1 on workspace.`,e.Msg.ARIA_LABEL_ADD_ELSE_IF=`Add else if`,e.Msg.ARIA_LABEL_ADD_INPUT=`Add input`,e.Msg.ARIA_LABEL_ADD_LIST_ITEM=`Add list item`,e.Msg.ARIA_LABEL_ADD_TEXT=`Add text`,e.Msg.ARIA_LABEL_BUTTON=`button`,e.Msg.ARIA_LABEL_COMMENT=`Comment`,e.Msg.ARIA_LABEL_COMMENT_COLLAPSE=`Collapse Comment`,e.Msg.ARIA_LABEL_COMMENT_EXPAND=`Expand Comment`,e.Msg.ARIA_LABEL_FIELD_ANGLE=`%1 degrees`,e.Msg.ARIA_LABEL_HEADING=`heading`,e.Msg.ARIA_LABEL_REMOVE_ELSE_IF=`Remove else if`,e.Msg.ARIA_LABEL_REMOVE_INPUT=`Remove input`,e.Msg.ARIA_LABEL_REMOVE_LIST_ITEM=`Remove list item`,e.Msg.ARIA_LABEL_REMOVE_TEXT=`Remove text`,e.Msg.ARIA_LABEL_TRASH_EMPTY=`Trash, currently empty`,e.Msg.ARIA_TYPE_FIELD_ANGLE=`angle`,e.Msg.ARIA_TYPE_FIELD_BITMAP=`pixel image`,e.Msg.ARIA_TYPE_FIELD_CHECKBOX=`checkbox`,e.Msg.ARIA_TYPE_FIELD_COLOUR=`color`,e.Msg.ARIA_TYPE_FIELD_DATE=`date`,e.Msg.ARIA_TYPE_FIELD_DROPDOWN=`dropdown`,e.Msg.ARIA_TYPE_FIELD_GRID=`grid dropdown`,e.Msg.ARIA_TYPE_FIELD_IMAGE=`image`,e.Msg.ARIA_TYPE_FIELD_INPUT=`input`,e.Msg.ARIA_TYPE_FIELD_NUMBER=`number`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT=`text`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT=`input name`,e.Msg.ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE=`function name`,e.Msg.BACKSPACE_KEY=`Backspace`,e.Msg.BLOCK_LABEL_BEGIN_PREFIX=`Begin %1`,e.Msg.BLOCK_LABEL_BEGIN_STACK=`Begin stack`,e.Msg.BLOCK_LABEL_COLLAPSED=`collapsed`,e.Msg.BLOCK_LABEL_CONTAINER=`container`,e.Msg.BLOCK_LABEL_DISABLED=`disabled`,e.Msg.BLOCK_LABEL_HAS_BRANCHES=`has %1 branches`,e.Msg.BLOCK_LABEL_HAS_INPUT=`has input`,e.Msg.BLOCK_LABEL_HAS_INPUTS=`has inputs`,e.Msg.BLOCK_LABEL_REPLACEABLE=`replaceable`,e.Msg.BLOCK_LABEL_STACK_BLOCKS=`%1 stack blocks`,e.Msg.BLOCK_LABEL_STATEMENT=`statement`,e.Msg.BLOCK_LABEL_TOOLBOX_CATEGORY=`%1 category`,e.Msg.BLOCK_LABEL_VALUE=`value`,e.Msg.BUBBLE_LABEL_COMMENT=`Comment: %1`,e.Msg.BUBBLE_LABEL_DEFAULT=`Bubble`,e.Msg.BUBBLE_LABEL_WARNING=`Warning: %1`,e.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE=`Can't delete the variable '%1' because it's part of the definition of the function '%2'`,e.Msg.CAPS_LOCK_KEY=`Caps Lock`,e.Msg.CHANGE_VALUE_TITLE=`Change value:`,e.Msg.CHROME_OS=`ChromeOS`,e.Msg.CLEAN_UP=`Clean up Blocks`,e.Msg.CLOSE=`Close`,e.Msg.CLOSE_BACKPACK=`Close backpack`,e.Msg.COLLAPSED_WARNINGS_WARNING=`Collapsed blocks contain warnings.`,e.Msg.COLLAPSE_ALL=`Collapse Blocks`,e.Msg.COLLAPSE_BLOCK=`Collapse Block`,e.Msg.COLOUR_BLEND_COLOUR1=`colour 1`,e.Msg.COLOUR_BLEND_COLOUR2=`colour 2`,e.Msg.COLOUR_BLEND_HELPURL=`https://meyerweb.com/eric/tools/color-blend/#:::rgbp`,e.Msg.COLOUR_BLEND_RATIO=`ratio`,e.Msg.COLOUR_BLEND_TITLE=`blend`,e.Msg.COLOUR_BLEND_TOOLTIP=`Blends two colours together with a given ratio (0.0 - 1.0).`,e.Msg.COLOUR_PICKER_HELPURL=`https://en.wikipedia.org/wiki/Color`,e.Msg.COLOUR_PICKER_TOOLTIP=`Choose a colour from the palette.`,e.Msg.COLOUR_RANDOM_HELPURL=`http://randomcolour.com`,e.Msg.COLOUR_RANDOM_TITLE=`random colour`,e.Msg.COLOUR_RANDOM_TOOLTIP=`Choose a colour at random.`,e.Msg.COLOUR_RGB_BLUE=`blue`,e.Msg.COLOUR_RGB_GREEN=`green`,e.Msg.COLOUR_RGB_HELPURL=`https://www.december.com/html/spec/colorpercompact.html`,e.Msg.COLOUR_RGB_RED=`red`,e.Msg.COLOUR_RGB_TITLE=`colour with`,e.Msg.COLOUR_RGB_TOOLTIP=`Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.`,e.Msg.COMMAND_KEY=`Command`,e.Msg.CONTEXT_MENU_KEY=`≣ Menu`,e.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#loop-termination-blocks`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK=`break out of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE=`continue with next iteration of loop`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK=`Break out of the containing loop.`,e.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE=`Skip the rest of this loop, and continue with the next iteration.`,e.Msg.CONTROLS_FLOW_STATEMENTS_WARNING=`Warning: This block may only be used within a loop.`,e.Msg.CONTROLS_FOREACH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#for-each`,e.Msg.CONTROLS_FOREACH_TITLE=`for each item %1 in list %2`,e.Msg.CONTROLS_FOREACH_TOOLTIP=`For each item in a list, set the variable '%1' to the item, and then do some statements.`,e.Msg.CONTROLS_FOR_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#count-with`,e.Msg.CONTROLS_FOR_TITLE=`count with %1 from %2 to %3 by %4`,e.Msg.CONTROLS_FOR_TOOLTIP=`Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.`,e.Msg.CONTROLS_IF_ELSEIF_TOOLTIP=`Add a condition to the if block.`,e.Msg.CONTROLS_IF_ELSE_TOOLTIP=`Add a final, catch-all condition to the if block.`,e.Msg.CONTROLS_IF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/IfElse`,e.Msg.CONTROLS_IF_IF_TOOLTIP=`Add, remove, or reorder sections to reconfigure this if block.`,e.Msg.CONTROLS_IF_MSG_ELSE=`else`,e.Msg.CONTROLS_IF_MSG_ELSEIF=`else if`,e.Msg.CONTROLS_IF_MSG_IF=`if`,e.Msg.CONTROLS_IF_TOOLTIP_1=`If a value is true, then do some statements.`,e.Msg.CONTROLS_IF_TOOLTIP_2=`If a value is true, then do the first block of statements. Otherwise, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_3=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements.`,e.Msg.CONTROLS_IF_TOOLTIP_4=`If the first value is true, then do the first block of statements. Otherwise, if the second value is true, do the second block of statements. If none of the values are true, do the last block of statements.`,e.Msg.CONTROLS_REPEAT_HELPURL=`https://en.wikipedia.org/wiki/For_loop`,e.Msg.CONTROLS_REPEAT_INPUT_DO=`do`,e.Msg.CONTROLS_REPEAT_TITLE=`repeat %1 times`,e.Msg.CONTROLS_REPEAT_TOOLTIP=`Do some statements several times.`,e.Msg.CONTROLS_WHILEUNTIL_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#repeat`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL=`repeat until`,e.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE=`repeat while`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL=`While a value is false, then do some statements.`,e.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE=`While a value is true, then do some statements.`,e.Msg.CONTROL_KEY=`Control`,e.Msg.COPY_ALL_TO_BACKPACK=`Copy All Blocks to Backpack`,e.Msg.COPY_SHORTCUT=`Copy`,e.Msg.COPY_TO_BACKPACK=`Copy to Backpack`,e.Msg.CURRENT_BLOCK_ANNOUNCEMENT=`Current block: %1`,e.Msg.CUT_SHORTCUT=`Cut`,e.Msg.DELETE_ALL_BLOCKS=`Delete all %1 blocks?`,e.Msg.DELETE_BLOCK=`Delete Block`,e.Msg.DELETE_KEY=`Delete`,e.Msg.DELETE_VARIABLE=`Delete the '%1' variable`,e.Msg.DELETE_VARIABLE_CONFIRMATION=`Delete %1 uses of the '%2' variable?`,e.Msg.DELETE_X_BLOCKS=`Delete %1 Blocks`,e.Msg.DIALOG_CANCEL=`Cancel`,e.Msg.DIALOG_OK=`OK`,e.Msg.DISABLE_BLOCK=`Disable Block`,e.Msg.DUPLICATE_BLOCK=`Duplicate`,e.Msg.DUPLICATE_COMMENT=`Duplicate Comment`,e.Msg.EDIT_BLOCK_CONTENTS=`Edit Block contents`,e.Msg.EMPTY_BACKPACK=`Empty Backpack`,e.Msg.ENABLE_BLOCK=`Enable Block`,e.Msg.END_KEY=`End`,e.Msg.ENTER_KEY=`Enter`,e.Msg.ESCAPE=`Escape`,e.Msg.EXPAND_ALL=`Expand Blocks`,e.Msg.EXPAND_BLOCK=`Expand Block`,e.Msg.EXTERNAL_INPUTS=`External Inputs`,e.Msg.FIELD_BITMAP_ARIA_VALUE=`%1 by %2, %3 pixels on`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_CLEAR=`Clear`,e.Msg.FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE=`Randomize`,e.Msg.FIELD_BITMAP_PIXEL_LABEL=`%1, row %2, column %3`,e.Msg.FIELD_BITMAP_PIXEL_OFF=`off`,e.Msg.FIELD_BITMAP_PIXEL_ON=`on`,e.Msg.FIELD_LABEL_CHECKBOX_CHECKED=`Checked`,e.Msg.FIELD_LABEL_CHECKBOX_UNCHECKED=`Not checked`,e.Msg.FIELD_LABEL_EDIT_PREFIX=`Edit %1`,e.Msg.FIELD_LABEL_EMPTY=`empty`,e.Msg.FIELD_LABEL_OPTION_INDEX=`Option %1`,e.Msg.FIELD_LABEL_VARIABLE=`Variable '%1'`,e.Msg.FIELD_MULTILINEINPUT_FINISH_EDITING=`Finish editing`,e.Msg.FIELD_MULTILINEINPUT_NEW_LINE=`New line`,e.Msg.HELP=`Help`,e.Msg.HELP_PROMPT=`Press %1 for help on keyboard controls.`,e.Msg.HOME_KEY=`Home`,e.Msg.ICON_LABEL_COMMENT_CLOSED=`Open Comment`,e.Msg.ICON_LABEL_COMMENT_OPEN=`Close Comment`,e.Msg.ICON_LABEL_DEFAULT=`Icon`,e.Msg.ICON_LABEL_MUTATOR_CLOSED=`Edit this block`,e.Msg.ICON_LABEL_MUTATOR_OPEN=`Close block editor`,e.Msg.ICON_LABEL_WARNING_CLOSED=`Open Warning`,e.Msg.ICON_LABEL_WARNING_OPEN=`Close Warning`,e.Msg.INLINE_INPUTS=`Inline Inputs`,e.Msg.INPUT_LABEL_CONDITION=`condition`,e.Msg.INPUT_LABEL_CONDITION_A=`first condition`,e.Msg.INPUT_LABEL_CONDITION_B=`second condition`,e.Msg.INPUT_LABEL_EMPTY=`Empty`,e.Msg.INPUT_LABEL_END_STATEMENT=`End %1`,e.Msg.INPUT_LABEL_INDEX=`input %1`,e.Msg.INPUT_LABEL_LISTS_CREATE_WITH_ITEM=`value %1`,e.Msg.INPUT_LABEL_LISTS_DELIMITER=`delimiter`,e.Msg.INPUT_LABEL_LISTS_END_POSITION=`end position`,e.Msg.INPUT_LABEL_LISTS_LIST_FROM_TEXT=`text to split`,e.Msg.INPUT_LABEL_LISTS_POSITION=`position within list`,e.Msg.INPUT_LABEL_LISTS_REPEAT_ITEM=`value to repeat`,e.Msg.INPUT_LABEL_LISTS_REPEAT_NUM=`number of times to repeat`,e.Msg.INPUT_LABEL_LISTS_START_POSITION=`start position`,e.Msg.INPUT_LABEL_LISTS_TEXT_FROM_LIST=`list to join`,e.Msg.INPUT_LABEL_LISTS_TO_CHANGE=`list to change`,e.Msg.INPUT_LABEL_LISTS_TO_CHECK=`list to check`,e.Msg.INPUT_LABEL_LISTS_VALUE_TO_SET=`value to set`,e.Msg.INPUT_LABEL_LOOP_BY=`increment`,e.Msg.INPUT_LABEL_LOOP_FROM=`starting number`,e.Msg.INPUT_LABEL_LOOP_LIST=`list to iterate over`,e.Msg.INPUT_LABEL_LOOP_TIMES=`number of times to repeat`,e.Msg.INPUT_LABEL_LOOP_TO=`ending number`,e.Msg.INPUT_LABEL_MATH_CHANGE_BY=`amount to change by`,e.Msg.INPUT_LABEL_MATH_CONSTRAIN_VALUE=`number to constrain`,e.Msg.INPUT_LABEL_MATH_DIVIDEND=`dividend`,e.Msg.INPUT_LABEL_MATH_DIVISOR=`divisor`,e.Msg.INPUT_LABEL_NUMBER=`number`,e.Msg.INPUT_LABEL_NUMBER_A=`first number`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_X=`x coordinate`,e.Msg.INPUT_LABEL_NUMBER_ATAN2_Y=`y coordinate`,e.Msg.INPUT_LABEL_NUMBER_B=`second number`,e.Msg.INPUT_LABEL_NUMBER_LIST=`list of numbers`,e.Msg.INPUT_LABEL_NUMBER_MAX=`maximum`,e.Msg.INPUT_LABEL_NUMBER_MIN=`minimum`,e.Msg.INPUT_LABEL_NUMBER_TO_CHECK=`number to check`,e.Msg.INPUT_LABEL_STATEMENT=`statement position`,e.Msg.INPUT_LABEL_TEXT_APPEND=`value to append`,e.Msg.INPUT_LABEL_TEXT_END_POSITION=`end position`,e.Msg.INPUT_LABEL_TEXT_JOIN_ITEM=`value %1`,e.Msg.INPUT_LABEL_TEXT_POSITION=`letter position`,e.Msg.INPUT_LABEL_TEXT_PROMPT_MESSAGE=`message`,e.Msg.INPUT_LABEL_TEXT_START_POSITION=`start position`,e.Msg.INPUT_LABEL_TEXT_TO_CHANGE=`text to change`,e.Msg.INPUT_LABEL_TEXT_TO_CHECK=`text to check`,e.Msg.INPUT_LABEL_TEXT_TO_FIND=`text to find`,e.Msg.INPUT_LABEL_TEXT_TO_REPLACE=`text to replace`,e.Msg.INPUT_LABEL_VALUE=`value position`,e.Msg.INPUT_LABEL_VALUE_A=`first value`,e.Msg.INPUT_LABEL_VALUE_B=`second value`,e.Msg.INPUT_LABEL_VARIABLES_SET=`value to set`,e.Msg.INSERT_KEY=`Insert`,e.Msg.KEYBOARD_NAV_BLOCK_NAVIGATION_HINT=`Use %1 to navigate inside of blocks.`,e.Msg.KEYBOARD_NAV_CONSTRAINED_MOVE_HINT=`Use the arrow keys to move, then %1 to accept the position.`,e.Msg.KEYBOARD_NAV_COPIED_HINT=`Copied. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_CUT_HINT=`Cut. Press %1 to paste.`,e.Msg.KEYBOARD_NAV_FLYOUT_LABEL_HINT=`Use the arrow keys to navigate to a block, or press %1 to go to the next heading.`,e.Msg.KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT=`Hold %1 and use arrow keys to move freely, then %2 to accept the position.`,e.Msg.KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT=`Use the arrow keys to navigate.`,e.Msg.LINUX=`Linux`,e.Msg.LISTS_CREATE_EMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-empty-list`,e.Msg.LISTS_CREATE_EMPTY_TITLE=`create empty list`,e.Msg.LISTS_CREATE_EMPTY_TOOLTIP=`Returns a list, of length 0, containing no data records`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD=`list`,e.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP=`Add, remove, or reorder sections to reconfigure this list block.`,e.Msg.LISTS_CREATE_WITH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_CREATE_WITH_INPUT_WITH=`create list with`,e.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP=`Add an item to the list.`,e.Msg.LISTS_CREATE_WITH_TOOLTIP=`Create a list with any number of items.`,e.Msg.LISTS_GET_INDEX_FIRST=`first`,e.Msg.LISTS_GET_INDEX_FROM_END=`# from end`,e.Msg.LISTS_GET_INDEX_FROM_START=`#`,e.Msg.LISTS_GET_INDEX_GET=`get`,e.Msg.LISTS_GET_INDEX_GET_REMOVE=`get and remove`,e.Msg.LISTS_GET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-items-from-a-list`,e.Msg.LISTS_GET_INDEX_LAST=`last`,e.Msg.LISTS_GET_INDEX_RANDOM=`random`,e.Msg.LISTS_GET_INDEX_REMOVE=`remove`,e.Msg.LISTS_GET_INDEX_TAIL=``,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST=`Returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM=`Returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST=`Returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM=`Returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST=`Removes and returns the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM=`Removes and returns the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST=`Removes and returns the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM=`Removes and returns a random item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST=`Removes the first item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM=`Removes the item at the specified position in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST=`Removes the last item in a list.`,e.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM=`Removes a random item in a list.`,e.Msg.LISTS_GET_SUBLIST_END_FROM_END=`to # from end`,e.Msg.LISTS_GET_SUBLIST_END_FROM_START=`to #`,e.Msg.LISTS_GET_SUBLIST_END_LAST=`to last`,e.Msg.LISTS_GET_SUBLIST_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-a-sublist`,e.Msg.LISTS_GET_SUBLIST_START_FIRST=`get sub-list from first`,e.Msg.LISTS_GET_SUBLIST_START_FROM_END=`get sub-list from # from end`,e.Msg.LISTS_GET_SUBLIST_START_FROM_START=`get sub-list from #`,e.Msg.LISTS_GET_SUBLIST_TAIL=``,e.Msg.LISTS_GET_SUBLIST_TOOLTIP=`Creates a copy of the specified portion of a list.`,e.Msg.LISTS_INDEX_FROM_END_TOOLTIP=`%1 is the last item.`,e.Msg.LISTS_INDEX_FROM_START_TOOLTIP=`%1 is the first item.`,e.Msg.LISTS_INDEX_OF_FIRST=`find first occurrence of item`,e.Msg.LISTS_INDEX_OF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#finding-items-in-a-list`,e.Msg.LISTS_INDEX_OF_LAST=`find last occurrence of item`,e.Msg.LISTS_INDEX_OF_TOOLTIP=`Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.`,e.Msg.LISTS_INLIST=`in list`,e.Msg.LISTS_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#is-empty`,e.Msg.LISTS_ISEMPTY_TITLE=`%1 is empty`,e.Msg.LISTS_ISEMPTY_TOOLTIP=`Returns true if the list is empty.`,e.Msg.LISTS_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#length-of`,e.Msg.LISTS_LENGTH_TITLE=`length of %1`,e.Msg.LISTS_LENGTH_TOOLTIP=`Returns the length of a list.`,e.Msg.LISTS_REPEAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with`,e.Msg.LISTS_REPEAT_TITLE=`create list with item %1 repeated %2 times`,e.Msg.LISTS_REPEAT_TOOLTIP=`Creates a list consisting of the given value repeated the specified number of times.`,e.Msg.LISTS_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#reversing-a-list`,e.Msg.LISTS_REVERSE_MESSAGE0=`reverse %1`,e.Msg.LISTS_REVERSE_TOOLTIP=`Reverse a copy of a list.`,e.Msg.LISTS_SET_INDEX_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#in-list--set`,e.Msg.LISTS_SET_INDEX_INPUT_TO=`as`,e.Msg.LISTS_SET_INDEX_INSERT=`insert at`,e.Msg.LISTS_SET_INDEX_SET=`set`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST=`Inserts the item at the start of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM=`Inserts the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST=`Append the item to the end of a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM=`Inserts the item randomly in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST=`Sets the first item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM=`Sets the item at the specified position in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST=`Sets the last item in a list.`,e.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM=`Sets a random item in a list.`,e.Msg.LISTS_SORT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#sorting-a-list`,e.Msg.LISTS_SORT_ORDER_ASCENDING=`ascending`,e.Msg.LISTS_SORT_ORDER_DESCENDING=`descending`,e.Msg.LISTS_SORT_TITLE=`sort %1 %2 %3`,e.Msg.LISTS_SORT_TOOLTIP=`Sort a copy of a list.`,e.Msg.LISTS_SORT_TYPE_IGNORECASE=`alphabetic, ignore case`,e.Msg.LISTS_SORT_TYPE_NUMERIC=`numeric`,e.Msg.LISTS_SORT_TYPE_TEXT=`alphabetic`,e.Msg.LISTS_SPLIT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#splitting-strings-and-joining-lists`,e.Msg.LISTS_SPLIT_LIST_FROM_TEXT=`make list from text`,e.Msg.LISTS_SPLIT_TEXT_FROM_LIST=`make text from list`,e.Msg.LISTS_SPLIT_TOOLTIP_JOIN=`Join a list of texts into one text, separated by a delimiter.`,e.Msg.LISTS_SPLIT_TOOLTIP_SPLIT=`Split text into a list of texts, breaking at each delimiter.`,e.Msg.LISTS_SPLIT_WITH_DELIMITER=`with delimiter`,e.Msg.LOGIC_BOOLEAN_FALSE=`false`,e.Msg.LOGIC_BOOLEAN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#values`,e.Msg.LOGIC_BOOLEAN_TOOLTIP=`Returns either true or false.`,e.Msg.LOGIC_BOOLEAN_TRUE=`true`,e.Msg.LOGIC_COMPARE_EQ_ARIA=`equals`,e.Msg.LOGIC_COMPARE_GTE_ARIA=`greater than or equal to`,e.Msg.LOGIC_COMPARE_GT_ARIA=`greater than`,e.Msg.LOGIC_COMPARE_HELPURL=`https://en.wikipedia.org/wiki/Inequality_(mathematics)`,e.Msg.LOGIC_COMPARE_LTE_ARIA=`less than or equal to`,e.Msg.LOGIC_COMPARE_LT_ARIA=`less than`,e.Msg.LOGIC_COMPARE_NEQ_ARIA=`not equals`,e.Msg.LOGIC_COMPARE_TOOLTIP_EQ=`Return true if both inputs equal each other.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GT=`Return true if the first input is greater than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_GTE=`Return true if the first input is greater than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LT=`Return true if the first input is smaller than the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_LTE=`Return true if the first input is smaller than or equal to the second input.`,e.Msg.LOGIC_COMPARE_TOOLTIP_NEQ=`Return true if both inputs are not equal to each other.`,e.Msg.LOGIC_NEGATE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#not`,e.Msg.LOGIC_NEGATE_TITLE=`not %1`,e.Msg.LOGIC_NEGATE_TOOLTIP=`Returns true if the input is false. Returns false if the input is true.`,e.Msg.LOGIC_NULL=`null`,e.Msg.LOGIC_NULL_HELPURL=`https://en.wikipedia.org/wiki/Nullable_type`,e.Msg.LOGIC_NULL_TOOLTIP=`Returns null.`,e.Msg.LOGIC_OPERATION_AND=`and`,e.Msg.LOGIC_OPERATION_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#logical-operations`,e.Msg.LOGIC_OPERATION_OR=`or`,e.Msg.LOGIC_OPERATION_TOOLTIP_AND=`Return true if both inputs are true.`,e.Msg.LOGIC_OPERATION_TOOLTIP_OR=`Return true if at least one of the inputs is true.`,e.Msg.LOGIC_TERNARY_CONDITION=`test`,e.Msg.LOGIC_TERNARY_HELPURL=`https://en.wikipedia.org/wiki/%3F:`,e.Msg.LOGIC_TERNARY_IF_FALSE=`if false`,e.Msg.LOGIC_TERNARY_IF_TRUE=`if true`,e.Msg.LOGIC_TERNARY_TOOLTIP=`Check the condition in 'test'. If the condition is true, returns the 'if true' value; otherwise returns the 'if false' value.`,e.Msg.MAC_OS=`macOS`,e.Msg.MATH_ADDITION_SYMBOL=`+`,e.Msg.MATH_ADDITION_SYMBOL_ARIA=`plus`,e.Msg.MATH_ARITHMETIC_HELPURL=`https://en.wikipedia.org/wiki/Arithmetic`,e.Msg.MATH_ARITHMETIC_TOOLTIP_ADD=`Return the sum of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE=`Return the quotient of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS=`Return the difference of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY=`Return the product of the two numbers.`,e.Msg.MATH_ARITHMETIC_TOOLTIP_POWER=`Return the first number raised to the power of the second number.`,e.Msg.MATH_ATAN2_HELPURL=`https://en.wikipedia.org/wiki/Atan2`,e.Msg.MATH_ATAN2_TITLE=`atan2 of X:%1 Y:%2`,e.Msg.MATH_ATAN2_TOOLTIP=`Return the arctangent of point (X, Y) in degrees from -180 to 180.`,e.Msg.MATH_CHANGE_HELPURL=`https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter`,e.Msg.MATH_CHANGE_TITLE=`change %1 by %2`,e.Msg.MATH_CHANGE_TOOLTIP=`Add a number to variable '%1'.`,e.Msg.MATH_CONSTANT_E_ARIA=`e`,e.Msg.MATH_CONSTANT_GOLDEN_RATIO_ARIA=`golden ratio`,e.Msg.MATH_CONSTANT_HELPURL=`https://en.wikipedia.org/wiki/Mathematical_constant`,e.Msg.MATH_CONSTANT_INFINITY_ARIA=`infinity`,e.Msg.MATH_CONSTANT_PI_ARIA=`pi`,e.Msg.MATH_CONSTANT_SQRT1_2_ARIA=`square root of 1 over 2`,e.Msg.MATH_CONSTANT_SQRT2_ARIA=`square root of 2`,e.Msg.MATH_CONSTANT_TOOLTIP=`Return one of the common constants: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…), or ∞ (infinity).`,e.Msg.MATH_CONSTRAIN_HELPURL=`https://en.wikipedia.org/wiki/Clamping_(graphics)`,e.Msg.MATH_CONSTRAIN_TITLE=`constrain %1 low %2 high %3`,e.Msg.MATH_CONSTRAIN_TOOLTIP=`Constrain a number to be between the specified limits (inclusive).`,e.Msg.MATH_DIVISION_SYMBOL=`÷`,e.Msg.MATH_DIVISION_SYMBOL_ARIA=`divided by`,e.Msg.MATH_IS_DIVISIBLE_BY=`is divisible by`,e.Msg.MATH_IS_EVEN=`is even`,e.Msg.MATH_IS_NEGATIVE=`is negative`,e.Msg.MATH_IS_ODD=`is odd`,e.Msg.MATH_IS_POSITIVE=`is positive`,e.Msg.MATH_IS_PRIME=`is prime`,e.Msg.MATH_IS_TOOLTIP=`Check if a number is an even, odd, prime, whole, positive, negative, or if it is divisible by certain number. Returns true or false.`,e.Msg.MATH_IS_WHOLE=`is whole`,e.Msg.MATH_MODULO_HELPURL=`https://en.wikipedia.org/wiki/Modulo_operation`,e.Msg.MATH_MODULO_TITLE=`remainder of %1 ÷ %2`,e.Msg.MATH_MODULO_TOOLTIP=`Return the remainder from dividing the two numbers.`,e.Msg.MATH_MULTIPLICATION_SYMBOL=`×`,e.Msg.MATH_MULTIPLICATION_SYMBOL_ARIA=`times`,e.Msg.MATH_NUMBER_HELPURL=`https://en.wikipedia.org/wiki/Number`,e.Msg.MATH_NUMBER_TOOLTIP=`A number.`,e.Msg.MATH_ONLIST_HELPURL=``,e.Msg.MATH_ONLIST_OPERATOR_AVERAGE=`average of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX=`max of list`,e.Msg.MATH_ONLIST_OPERATOR_MAX_ARIA=`maximum`,e.Msg.MATH_ONLIST_OPERATOR_MEDIAN=`median of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN=`min of list`,e.Msg.MATH_ONLIST_OPERATOR_MIN_ARIA=`minimum`,e.Msg.MATH_ONLIST_OPERATOR_MODE=`modes of list`,e.Msg.MATH_ONLIST_OPERATOR_RANDOM=`random item of list`,e.Msg.MATH_ONLIST_OPERATOR_STD_DEV=`standard deviation of list`,e.Msg.MATH_ONLIST_OPERATOR_SUM=`sum of list`,e.Msg.MATH_ONLIST_TOOLTIP_AVERAGE=`Return the average (arithmetic mean) of the numeric values in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MAX=`Return the largest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MEDIAN=`Return the median number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MIN=`Return the smallest number in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_MODE=`Return a list of the most common item(s) in the list.`,e.Msg.MATH_ONLIST_TOOLTIP_RANDOM=`Return a random element from the list.`,e.Msg.MATH_ONLIST_TOOLTIP_STD_DEV=`Return the standard deviation of the list.`,e.Msg.MATH_ONLIST_TOOLTIP_SUM=`Return the sum of all the numbers in the list.`,e.Msg.MATH_POWER_SYMBOL=`^`,e.Msg.MATH_POWER_SYMBOL_ARIA=`to the power of`,e.Msg.MATH_RANDOM_FLOAT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM=`random fraction`,e.Msg.MATH_RANDOM_FLOAT_TOOLTIP=`Return a random fraction between 0.0 (inclusive) and 1.0 (exclusive).`,e.Msg.MATH_RANDOM_INT_HELPURL=`https://en.wikipedia.org/wiki/Random_number_generation`,e.Msg.MATH_RANDOM_INT_TITLE=`random integer from %1 to %2`,e.Msg.MATH_RANDOM_INT_TOOLTIP=`Return a random integer between the two specified limits, inclusive.`,e.Msg.MATH_ROUND_HELPURL=`https://en.wikipedia.org/wiki/Rounding`,e.Msg.MATH_ROUND_OPERATOR_ROUND=`round`,e.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN=`round down`,e.Msg.MATH_ROUND_OPERATOR_ROUNDUP=`round up`,e.Msg.MATH_ROUND_TOOLTIP=`Round a number up or down.`,e.Msg.MATH_SINGLE_HELPURL=`https://en.wikipedia.org/wiki/Square_root`,e.Msg.MATH_SINGLE_OP_ABSOLUTE=`absolute`,e.Msg.MATH_SINGLE_OP_ABSOLUTE_ARIA=`absolute value`,e.Msg.MATH_SINGLE_OP_EXP_ARIA=`e to the power of`,e.Msg.MATH_SINGLE_OP_LN_ARIA=`natural logarithm`,e.Msg.MATH_SINGLE_OP_LOG10_ARIA=`base 10 logarithm`,e.Msg.MATH_SINGLE_OP_NEG_ARIA=`negative`,e.Msg.MATH_SINGLE_OP_POW10_ARIA=`10 to the power of`,e.Msg.MATH_SINGLE_OP_ROOT=`square root`,e.Msg.MATH_SINGLE_TOOLTIP_ABS=`Return the absolute value of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_EXP=`Return e to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LN=`Return the natural logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_LOG10=`Return the base 10 logarithm of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_NEG=`Return the negation of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_POW10=`Return 10 to the power of a number.`,e.Msg.MATH_SINGLE_TOOLTIP_ROOT=`Return the square root of a number.`,e.Msg.MATH_SUBTRACTION_SYMBOL=`-`,e.Msg.MATH_SUBTRACTION_SYMBOL_ARIA=`minus`,e.Msg.MATH_TRIG_ACOS=`acos`,e.Msg.MATH_TRIG_ACOS_ARIA=`inverse cosine`,e.Msg.MATH_TRIG_ASIN=`asin`,e.Msg.MATH_TRIG_ASIN_ARIA=`inverse sine`,e.Msg.MATH_TRIG_ATAN=`atan`,e.Msg.MATH_TRIG_ATAN_ARIA=`inverse tangent`,e.Msg.MATH_TRIG_COS=`cos`,e.Msg.MATH_TRIG_COS_ARIA=`cosine`,e.Msg.MATH_TRIG_HELPURL=`https://en.wikipedia.org/wiki/Trigonometric_functions`,e.Msg.MATH_TRIG_SIN=`sin`,e.Msg.MATH_TRIG_SIN_ARIA=`sine`,e.Msg.MATH_TRIG_TAN=`tan`,e.Msg.MATH_TRIG_TAN_ARIA=`tangent`,e.Msg.MATH_TRIG_TOOLTIP_ACOS=`Return the arccosine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ASIN=`Return the arcsine of a number.`,e.Msg.MATH_TRIG_TOOLTIP_ATAN=`Return the arctangent of a number.`,e.Msg.MATH_TRIG_TOOLTIP_COS=`Return the cosine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_SIN=`Return the sine of a degree (not radian).`,e.Msg.MATH_TRIG_TOOLTIP_TAN=`Return the tangent of a degree (not radian).`,e.Msg.MINIMAP_ARIA_LABEL=`Workspace minimap. Use the arrow keys to pan the workspace.`,e.Msg.MOVE_BLOCK=`Move Block`,e.Msg.NEW_COLOUR_VARIABLE=`Create colour variable...`,e.Msg.NEW_NUMBER_VARIABLE=`Create number variable...`,e.Msg.NEW_STRING_VARIABLE=`Create string variable...`,e.Msg.NEW_VARIABLE=`Create variable...`,e.Msg.NEW_VARIABLE_TITLE=`New variable name:`,e.Msg.NEW_VARIABLE_TYPE_TITLE=`New variable type:`,e.Msg.NO_PARENT_ANNOUNCEMENT=`Current block has no parent`,e.Msg.OPEN_BACKPACK=`Open backpack`,e.Msg.OPEN_TRASH=`Open trash`,e.Msg.OPTION_KEY=`Option`,e.Msg.ORDINAL_NUMBER_SUFFIX=``,e.Msg.PAGE_DOWN_KEY=`Page Down`,e.Msg.PAGE_UP_KEY=`Page Up`,e.Msg.PARENT_BLOCKS_ANNOUNCEMENT=`Parent blocks: %1`,e.Msg.PASTE_ALL_FROM_BACKPACK=`Paste All Blocks from Backpack`,e.Msg.PASTE_SHORTCUT=`Paste`,e.Msg.PAUSE_KEY=`Pause`,e.Msg.PROCEDURES_ALLOW_STATEMENTS=`allow statements`,e.Msg.PROCEDURES_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALLNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLNORETURN_TOOLTIP=`Run the user-defined function '%1'.`,e.Msg.PROCEDURES_CALLRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_CALLRETURN_TOOLTIP=`Run the user-defined function '%1' and use its output.`,e.Msg.PROCEDURES_CALL_BEFORE_PARAMS=`with:`,e.Msg.PROCEDURES_CALL_DISABLED_DEF_WARNING=`Can't run the user-defined function '%1' because the definition block is disabled.`,e.Msg.PROCEDURES_CREATE_DO=`Create '%1'`,e.Msg.PROCEDURES_DEFNORETURN_COMMENT=`Describe this function...`,e.Msg.PROCEDURES_DEFNORETURN_DO=``,e.Msg.PROCEDURES_DEFNORETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE=`do something`,e.Msg.PROCEDURES_DEFNORETURN_TITLE=`to`,e.Msg.PROCEDURES_DEFNORETURN_TOOLTIP=`Creates a function with no output.`,e.Msg.PROCEDURES_DEFRETURN_HELPURL=`https://en.wikipedia.org/wiki/Subroutine`,e.Msg.PROCEDURES_DEFRETURN_RETURN=`return`,e.Msg.PROCEDURES_DEFRETURN_TOOLTIP=`Creates a function with an output.`,e.Msg.PROCEDURES_DEF_DUPLICATE_WARNING=`Warning: This function has duplicate parameters.`,e.Msg.PROCEDURES_HIGHLIGHT_DEF=`Highlight function definition`,e.Msg.PROCEDURES_IFRETURN_HELPURL=`https://c2.com/cgi/wiki?GuardClause`,e.Msg.PROCEDURES_IFRETURN_TOOLTIP=`If a value is true, then return a second value.`,e.Msg.PROCEDURES_IFRETURN_WARNING=`Warning: This block may be used only within a function definition.`,e.Msg.PROCEDURES_MUTATORARG_TITLE=`input name:`,e.Msg.PROCEDURES_MUTATORARG_TOOLTIP=`Add an input to the function.`,e.Msg.PROCEDURES_MUTATORCONTAINER_TITLE=`inputs`,e.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP=`Add, remove, or reorder inputs to this function.`,e.Msg.REDO=`Redo`,e.Msg.REMOVE_COMMENT=`Remove Comment`,e.Msg.REMOVE_FROM_BACKPACK=`Remove from Backpack`,e.Msg.RENAME_VARIABLE=`Rename the '%1' variable`,e.Msg.RENAME_VARIABLE_TITLE=`Rename all '%1' variables to:`,e.Msg.RESET_ZOOM=`Reset zoom`,e.Msg.SCREENREADER_HINT=`Use the arrow keys to navigate. Press %1 to toggle screenreader accessibility mode.`,e.Msg.SCREENREADER_MODE_DISABLED=`Screenreader mode is off, press %1 to turn it on`,e.Msg.SCREENREADER_MODE_ENABLED=`Screenreader mode is on, press %1 to turn it off`,e.Msg.SHIFT_KEY=`Shift`,e.Msg.SHORTCUTS_ABORT_MOVE=`Abort move`,e.Msg.SHORTCUTS_CLEANUP=`Clean up workspace`,e.Msg.SHORTCUTS_CODE_NAVIGATION=`Code navigation`,e.Msg.SHORTCUTS_DELETE=`Delete`,e.Msg.SHORTCUTS_DISCONNECT=`Disconnect block`,e.Msg.SHORTCUTS_DUPLICATE=`Duplicate`,e.Msg.SHORTCUTS_EDITING=`Editing`,e.Msg.SHORTCUTS_ESCAPE=`Exit`,e.Msg.SHORTCUTS_EXTENDED_INFORMATION=`Announce detailed information`,e.Msg.SHORTCUTS_FINISH_MOVE=`Finish move`,e.Msg.SHORTCUTS_FOCUS_TOOLBOX=`Focus toolbox`,e.Msg.SHORTCUTS_FOCUS_WORKSPACE=`Focus workspace`,e.Msg.SHORTCUTS_GENERAL=`General`,e.Msg.SHORTCUTS_INFORMATION=`Announce information`,e.Msg.SHORTCUTS_JUMP_BLOCK_END=`Jump to block end`,e.Msg.SHORTCUTS_JUMP_BLOCK_START=`Jump to block start`,e.Msg.SHORTCUTS_JUMP_BOTTOM_STACK=`Jump to bottom of stack`,e.Msg.SHORTCUTS_JUMP_FIRST_BLOCK=`Jump to first block`,e.Msg.SHORTCUTS_JUMP_LAST_BLOCK=`Jump to last block`,e.Msg.SHORTCUTS_JUMP_TOP_STACK=`Jump to top of stack`,e.Msg.SHORTCUTS_MOVE_DOWN=`Move down`,e.Msg.SHORTCUTS_MOVE_LEFT=`Move left`,e.Msg.SHORTCUTS_MOVE_RIGHT=`Move right`,e.Msg.SHORTCUTS_MOVE_UP=`Move up`,e.Msg.SHORTCUTS_NEXT_HEADING=`Next heading`,e.Msg.SHORTCUTS_NEXT_STACK=`Next stack`,e.Msg.SHORTCUTS_PERFORM_ACTION=`Edit or confirm`,e.Msg.SHORTCUTS_PREVIOUS_HEADING=`Previous heading`,e.Msg.SHORTCUTS_PREVIOUS_STACK=`Previous stack`,e.Msg.SHORTCUTS_SHOW_CONTEXT_MENU=`Show menu`,e.Msg.SHORTCUTS_SHOW_TOOLTIP=`Show tooltip`,e.Msg.SHORTCUTS_START_MOVE=`Start move`,e.Msg.SHORTCUTS_START_MOVE_STACK=`Start move stack`,e.Msg.SHORTCUTS_TOGGLE_SCREENREADER_MODE=`Toggle screenreader mode`,e.Msg.SPACE_KEY=`Space`,e.Msg.TAB_KEY=`Tab`,e.Msg.TEXT_APPEND_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_APPEND_TITLE=`to %1 append text %2`,e.Msg.TEXT_APPEND_TOOLTIP=`Append some text to variable '%1'.`,e.Msg.TEXT_CHANGECASE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#adjusting-text-case`,e.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE=`to lower case`,e.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE=`to Title Case`,e.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE=`to UPPER CASE`,e.Msg.TEXT_CHANGECASE_TOOLTIP=`Return a copy of the text in a different case.`,e.Msg.TEXT_CHARAT_FIRST=`get first letter`,e.Msg.TEXT_CHARAT_FROM_END=`get letter # from end`,e.Msg.TEXT_CHARAT_FROM_START=`get letter #`,e.Msg.TEXT_CHARAT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-text`,e.Msg.TEXT_CHARAT_LAST=`get last letter`,e.Msg.TEXT_CHARAT_RANDOM=`get random letter`,e.Msg.TEXT_CHARAT_TAIL=``,e.Msg.TEXT_CHARAT_TITLE=`in text %1 %2`,e.Msg.TEXT_CHARAT_TOOLTIP=`Returns the letter at the specified position.`,e.Msg.TEXT_COUNT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#counting-substrings`,e.Msg.TEXT_COUNT_MESSAGE0=`count %1 in %2`,e.Msg.TEXT_COUNT_TOOLTIP=`Count how many times some text occurs within some other text.`,e.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP=`Add an item to the text.`,e.Msg.TEXT_CREATE_JOIN_TITLE_JOIN=`join`,e.Msg.TEXT_CREATE_JOIN_TOOLTIP=`Add, remove, or reorder sections to reconfigure this text block.`,e.Msg.TEXT_FROM_END_ARIA=`letter number from end`,e.Msg.TEXT_FROM_START_ARIA=`letter number`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_END=`to letter # from end`,e.Msg.TEXT_GET_SUBSTRING_END_FROM_START=`to letter #`,e.Msg.TEXT_GET_SUBSTRING_END_LAST=`to last letter`,e.Msg.TEXT_GET_SUBSTRING_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-a-region-of-text`,e.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT=`in text`,e.Msg.TEXT_GET_SUBSTRING_START_FIRST=`get substring from first letter`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_END=`get substring from letter # from end`,e.Msg.TEXT_GET_SUBSTRING_START_FROM_START=`get substring from letter #`,e.Msg.TEXT_GET_SUBSTRING_TAIL=``,e.Msg.TEXT_GET_SUBSTRING_TOOLTIP=`Returns a specified portion of the text.`,e.Msg.TEXT_INDEXOF_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#finding-text`,e.Msg.TEXT_INDEXOF_OPERATOR_FIRST=`find first occurrence of text`,e.Msg.TEXT_INDEXOF_OPERATOR_LAST=`find last occurrence of text`,e.Msg.TEXT_INDEXOF_TITLE=`in text %1 %2 %3`,e.Msg.TEXT_INDEXOF_TOOLTIP=`Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.`,e.Msg.TEXT_ISEMPTY_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#checking-for-empty-text`,e.Msg.TEXT_ISEMPTY_TITLE=`%1 is empty`,e.Msg.TEXT_ISEMPTY_TOOLTIP=`Returns true if the provided text is empty.`,e.Msg.TEXT_JOIN_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-creation`,e.Msg.TEXT_JOIN_TITLE_CREATEWITH=`create text with`,e.Msg.TEXT_JOIN_TOOLTIP=`Create a piece of text by joining together any number of items.`,e.Msg.TEXT_LENGTH_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification`,e.Msg.TEXT_LENGTH_TITLE=`length of %1`,e.Msg.TEXT_LENGTH_TOOLTIP=`Returns the number of letters (including spaces) in the provided text.`,e.Msg.TEXT_PRINT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#printing-text`,e.Msg.TEXT_PRINT_TITLE=`print %1`,e.Msg.TEXT_PRINT_TOOLTIP=`Print the specified text, number or other value.`,e.Msg.TEXT_PROMPT_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#getting-input-from-the-user`,e.Msg.TEXT_PROMPT_TOOLTIP_NUMBER=`Prompt for user for a number.`,e.Msg.TEXT_PROMPT_TOOLTIP_TEXT=`Prompt for user for some text.`,e.Msg.TEXT_PROMPT_TYPE_NUMBER=`prompt for number with message`,e.Msg.TEXT_PROMPT_TYPE_TEXT=`prompt for text with message`,e.Msg.TEXT_REPLACE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#replacing-substrings`,e.Msg.TEXT_REPLACE_MESSAGE0=`replace %1 with %2 in %3`,e.Msg.TEXT_REPLACE_TOOLTIP=`Replace all occurances of some text within some other text.`,e.Msg.TEXT_REVERSE_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#reversing-text`,e.Msg.TEXT_REVERSE_MESSAGE0=`reverse %1`,e.Msg.TEXT_REVERSE_TOOLTIP=`Reverses the order of the characters in the text.`,e.Msg.TEXT_TEXT_HELPURL=`https://en.wikipedia.org/wiki/String_(computer_science)`,e.Msg.TEXT_TEXT_TOOLTIP=`A letter, word, or line of text.`,e.Msg.TEXT_TRIM_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Text#trimming-removing-spaces`,e.Msg.TEXT_TRIM_OPERATOR_BOTH=`trim spaces from both sides of`,e.Msg.TEXT_TRIM_OPERATOR_LEFT=`trim spaces from left side of`,e.Msg.TEXT_TRIM_OPERATOR_RIGHT=`trim spaces from right side of`,e.Msg.TEXT_TRIM_TOOLTIP=`Return a copy of the text with spaces removed from one or both ends.`,e.Msg.TODAY=`Today`,e.Msg.UNDO=`Undo`,e.Msg.UNKNOWN=`Unknown`,e.Msg.UNNAMED_KEY=`unnamed`,e.Msg.VARIABLES_DEFAULT_NAME=`item`,e.Msg.VARIABLES_GET_CREATE_SET=`Create 'set %1'`,e.Msg.VARIABLES_GET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#get`,e.Msg.VARIABLES_GET_TOOLTIP=`Returns the value of this variable.`,e.Msg.VARIABLES_SET=`set %1 to %2`,e.Msg.VARIABLES_SET_CREATE_GET=`Create 'get %1'`,e.Msg.VARIABLES_SET_HELPURL=`https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#set`,e.Msg.VARIABLES_SET_TOOLTIP=`Sets this variable to be equal to the input.`,e.Msg.VARIABLE_ALREADY_EXISTS=`A variable named '%1' already exists.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE=`A variable named '%1' already exists for another type: '%2'.`,e.Msg.VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER=`A variable named '%1' already exists as a parameter in the procedure '%2'.`,e.Msg.WINDOWS=`Windows`,e.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT=`Say something...`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_MANY=`%1 stacks of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ONE=`One stack of blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_BLOCKS_ZERO=`No blocks%2 in workspace.`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_MANY=` and %1 comments`,e.Msg.WORKSPACE_CONTENTS_COMMENTS_ONE=` and one comment`,e.Msg.WORKSPACE_LABEL_1_STACK=`1 stack of blocks`,e.Msg.WORKSPACE_LABEL_FLYOUT_WORKSPACE=`%1 blocks`,e.Msg.WORKSPACE_LABEL_MANY_STACKS=`%1 stacks of blocks`,e.Msg.WORKSPACE_LABEL_MUTATOR_WORKSPACE=`Block editor workspace`,e.Msg.WORKSPACE_LABEL_PLAIN=`Blocks workspace.`,e.Msg.WORKSPACE_ROLEDESCRIPTION=`workspace`,e.Msg.ZOOM_IN=`Zoom in`,e.Msg.ZOOM_OUT=`Zoom out`,e.Msg.ZOOM_TO_FIT_ARIA_LABEL=`Zoom to fit`,e.Msg.CONTROLS_FOREACH_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_FOR_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF=e.Msg.CONTROLS_IF_MSG_ELSEIF,e.Msg.CONTROLS_IF_ELSE_TITLE_ELSE=e.Msg.CONTROLS_IF_MSG_ELSE,e.Msg.CONTROLS_IF_IF_TITLE_IF=e.Msg.CONTROLS_IF_MSG_IF,e.Msg.CONTROLS_IF_MSG_THEN=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.CONTROLS_WHILEUNTIL_INPUT_DO=e.Msg.CONTROLS_REPEAT_INPUT_DO,e.Msg.LISTS_CREATE_WITH_ITEM_TITLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.LISTS_GET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_INDEX_OF_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.LISTS_SET_INDEX_INPUT_IN_LIST=e.Msg.LISTS_INLIST,e.Msg.MATH_CHANGE_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.PROCEDURES_DEFRETURN_COMMENT=e.Msg.PROCEDURES_DEFNORETURN_COMMENT,e.Msg.PROCEDURES_DEFRETURN_DO=e.Msg.PROCEDURES_DEFNORETURN_DO,e.Msg.PROCEDURES_DEFRETURN_PROCEDURE=e.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,e.Msg.PROCEDURES_DEFRETURN_TITLE=e.Msg.PROCEDURES_DEFNORETURN_TITLE,e.Msg.TEXT_APPEND_VARIABLE=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM=e.Msg.VARIABLES_DEFAULT_NAME,e.Msg.COLOUR_HUE=`20`,e.Msg.LISTS_HUE=`260`,e.Msg.LOGIC_HUE=`210`,e.Msg.LOOPS_HUE=`120`,e.Msg.MATH_HUE=`230`,e.Msg.PROCEDURES_HUE=`290`,e.Msg.TEXTS_HUE=`160`,e.Msg.VARIABLES_DYNAMIC_HUE=`310`,e.Msg.VARIABLES_HUE=`330`,e.Msg})})),Hh=n({ADD_COMMENT:()=>ng,ALT_KEY:()=>bw,ANNOUNCE_MOVE_AFTER:()=>XE,ANNOUNCE_MOVE_AROUND:()=>QE,ANNOUNCE_MOVE_BEFORE:()=>YE,ANNOUNCE_MOVE_CANCELED:()=>tD,ANNOUNCE_MOVE_INSIDE:()=>ZE,ANNOUNCE_MOVE_OF:()=>eD,ANNOUNCE_MOVE_TO:()=>$E,ANNOUNCE_MOVE_WORKSPACE:()=>JE,ARIA_LABEL_ADD_ELSE_IF:()=>VD,ARIA_LABEL_ADD_INPUT:()=>qD,ARIA_LABEL_ADD_LIST_ITEM:()=>UD,ARIA_LABEL_ADD_TEXT:()=>GD,ARIA_LABEL_BUTTON:()=>bD,ARIA_LABEL_COMMENT:()=>MD,ARIA_LABEL_COMMENT_COLLAPSE:()=>ND,ARIA_LABEL_COMMENT_EXPAND:()=>PD,ARIA_LABEL_FIELD_ANGLE:()=>XD,ARIA_LABEL_HEADING:()=>xD,ARIA_LABEL_REMOVE_ELSE_IF:()=>HD,ARIA_LABEL_REMOVE_INPUT:()=>JD,ARIA_LABEL_REMOVE_LIST_ITEM:()=>WD,ARIA_LABEL_REMOVE_TEXT:()=>KD,ARIA_LABEL_TRASH_EMPTY:()=>vO,ARIA_TYPE_FIELD_ANGLE:()=>YD,ARIA_TYPE_FIELD_BITMAP:()=>$D,ARIA_TYPE_FIELD_CHECKBOX:()=>uD,ARIA_TYPE_FIELD_COLOUR:()=>QD,ARIA_TYPE_FIELD_DATE:()=>ZD,ARIA_TYPE_FIELD_DROPDOWN:()=>cD,ARIA_TYPE_FIELD_GRID:()=>eO,ARIA_TYPE_FIELD_IMAGE:()=>lD,ARIA_TYPE_FIELD_INPUT:()=>rD,ARIA_TYPE_FIELD_NUMBER:()=>aD,ARIA_TYPE_FIELD_TEXT_INPUT:()=>iD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:()=>sD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:()=>oD,BACKSPACE_KEY:()=>Sw,BLOCK_LABEL_BEGIN_PREFIX:()=>zT,BLOCK_LABEL_BEGIN_STACK:()=>RT,BLOCK_LABEL_COLLAPSED:()=>HT,BLOCK_LABEL_CONTAINER:()=>JT,BLOCK_LABEL_DISABLED:()=>VT,BLOCK_LABEL_HAS_BRANCHES:()=>KT,BLOCK_LABEL_HAS_INPUT:()=>WT,BLOCK_LABEL_HAS_INPUTS:()=>GT,BLOCK_LABEL_REPLACEABLE:()=>UT,BLOCK_LABEL_STACK_BLOCKS:()=>XT,BLOCK_LABEL_STATEMENT:()=>qT,BLOCK_LABEL_TOOLBOX_CATEGORY:()=>BT,BLOCK_LABEL_VALUE:()=>YT,BUBBLE_LABEL_COMMENT:()=>CD,BUBBLE_LABEL_DEFAULT:()=>SD,BUBBLE_LABEL_WARNING:()=>wD,CANNOT_DELETE_VARIABLE_PROCEDURE:()=>Pg,CAPS_LOCK_KEY:()=>Dw,CHANGE_VALUE_TITLE:()=>xg,CHROME_OS:()=>mw,CLEAN_UP:()=>ug,CLOSE:()=>dg,CLOSE_BACKPACK:()=>cO,COLLAPSED_WARNINGS_WARNING:()=>sw,COLLAPSE_ALL:()=>pg,COLLAPSE_BLOCK:()=>fg,COLOUR_BLEND_COLOUR1:()=>Yg,COLOUR_BLEND_COLOUR2:()=>Xg,COLOUR_BLEND_HELPURL:()=>qg,COLOUR_BLEND_RATIO:()=>Zg,COLOUR_BLEND_TITLE:()=>Jg,COLOUR_BLEND_TOOLTIP:()=>Qg,COLOUR_HUE:()=>Jh,COLOUR_PICKER_HELPURL:()=>Ig,COLOUR_PICKER_TOOLTIP:()=>Lg,COLOUR_RANDOM_HELPURL:()=>Rg,COLOUR_RANDOM_TITLE:()=>zg,COLOUR_RANDOM_TOOLTIP:()=>Bg,COLOUR_RGB_BLUE:()=>Gg,COLOUR_RGB_GREEN:()=>Wg,COLOUR_RGB_HELPURL:()=>Vg,COLOUR_RGB_RED:()=>Ug,COLOUR_RGB_TITLE:()=>Hg,COLOUR_RGB_TOOLTIP:()=>Kg,COMMAND_KEY:()=>vw,CONTEXT_MENU_KEY:()=>Fw,CONTROLS_FLOW_STATEMENTS_HELPURL:()=>__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:()=>v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:()=>y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:()=>b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:()=>x_,CONTROLS_FLOW_STATEMENTS_WARNING:()=>S_,CONTROLS_FOREACH_HELPURL:()=>p_,CONTROLS_FOREACH_INPUT_DO:()=>h_,CONTROLS_FOREACH_TITLE:()=>m_,CONTROLS_FOREACH_TOOLTIP:()=>g_,CONTROLS_FOR_HELPURL:()=>l_,CONTROLS_FOR_INPUT_DO:()=>f_,CONTROLS_FOR_TITLE:()=>d_,CONTROLS_FOR_TOOLTIP:()=>u_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:()=>P_,CONTROLS_IF_ELSEIF_TOOLTIP:()=>F_,CONTROLS_IF_ELSE_TITLE_ELSE:()=>I_,CONTROLS_IF_ELSE_TOOLTIP:()=>L_,CONTROLS_IF_HELPURL:()=>C_,CONTROLS_IF_IF_TITLE_IF:()=>M_,CONTROLS_IF_IF_TOOLTIP:()=>N_,CONTROLS_IF_MSG_ELSE:()=>A_,CONTROLS_IF_MSG_ELSEIF:()=>k_,CONTROLS_IF_MSG_IF:()=>O_,CONTROLS_IF_MSG_THEN:()=>j_,CONTROLS_IF_TOOLTIP_1:()=>w_,CONTROLS_IF_TOOLTIP_2:()=>T_,CONTROLS_IF_TOOLTIP_3:()=>E_,CONTROLS_IF_TOOLTIP_4:()=>D_,CONTROLS_REPEAT_HELPURL:()=>$g,CONTROLS_REPEAT_INPUT_DO:()=>t_,CONTROLS_REPEAT_TITLE:()=>e_,CONTROLS_REPEAT_TOOLTIP:()=>n_,CONTROLS_WHILEUNTIL_HELPURL:()=>r_,CONTROLS_WHILEUNTIL_INPUT_DO:()=>i_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:()=>o_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:()=>a_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:()=>c_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:()=>s_,CONTROL_KEY:()=>_w,COPY_ALL_TO_BACKPACK:()=>lO,COPY_SHORTCUT:()=>Lw,COPY_TO_BACKPACK:()=>uO,CURRENT_BLOCK_ANNOUNCEMENT:()=>LD,CUT_SHORTCUT:()=>Iw,DELETE_ALL_BLOCKS:()=>lg,DELETE_BLOCK:()=>sg,DELETE_KEY:()=>Cw,DELETE_VARIABLE:()=>Fg,DELETE_VARIABLE_CONFIRMATION:()=>Ng,DELETE_X_BLOCKS:()=>cg,DIALOG_CANCEL:()=>lw,DIALOG_OK:()=>cw,DISABLE_BLOCK:()=>gg,DUPLICATE_BLOCK:()=>tg,DUPLICATE_COMMENT:()=>ig,EDIT_BLOCK_CONTENTS:()=>uw,EMPTY_BACKPACK:()=>dO,ENABLE_BLOCK:()=>_g,END_KEY:()=>jw,ENTER_KEY:()=>xw,ESCAPE:()=>ww,EXPAND_ALL:()=>hg,EXPAND_BLOCK:()=>mg,EXTERNAL_INPUTS:()=>ag,FIELD_BITMAP_ARIA_VALUE:()=>oO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:()=>nO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:()=>tO,FIELD_BITMAP_PIXEL_LABEL:()=>aO,FIELD_BITMAP_PIXEL_OFF:()=>iO,FIELD_BITMAP_PIXEL_ON:()=>rO,FIELD_LABEL_CHECKBOX_CHECKED:()=>_D,FIELD_LABEL_CHECKBOX_UNCHECKED:()=>vD,FIELD_LABEL_EDIT_PREFIX:()=>dD,FIELD_LABEL_EMPTY:()=>nD,FIELD_LABEL_OPTION_INDEX:()=>gD,FIELD_LABEL_VARIABLE:()=>yD,FIELD_MULTILINEINPUT_FINISH_EDITING:()=>mO,FIELD_MULTILINEINPUT_NEW_LINE:()=>hO,HELP:()=>vg,HELP_PROMPT:()=>zw,HOME_KEY:()=>Mw,ICON_LABEL_COMMENT_CLOSED:()=>ED,ICON_LABEL_COMMENT_OPEN:()=>DD,ICON_LABEL_DEFAULT:()=>TD,ICON_LABEL_MUTATOR_CLOSED:()=>OD,ICON_LABEL_MUTATOR_OPEN:()=>kD,ICON_LABEL_WARNING_CLOSED:()=>AD,ICON_LABEL_WARNING_OPEN:()=>jD,INLINE_INPUTS:()=>og,INPUT_LABEL_CONDITION:()=>nE,INPUT_LABEL_CONDITION_A:()=>rE,INPUT_LABEL_CONDITION_B:()=>iE,INPUT_LABEL_EMPTY:()=>tE,INPUT_LABEL_END_STATEMENT:()=>eE,INPUT_LABEL_INDEX:()=>ZT,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:()=>IE,INPUT_LABEL_LISTS_DELIMITER:()=>KE,INPUT_LABEL_LISTS_END_POSITION:()=>UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:()=>WE,INPUT_LABEL_LISTS_POSITION:()=>VE,INPUT_LABEL_LISTS_REPEAT_ITEM:()=>LE,INPUT_LABEL_LISTS_REPEAT_NUM:()=>RE,INPUT_LABEL_LISTS_START_POSITION:()=>HE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:()=>GE,INPUT_LABEL_LISTS_TO_CHANGE:()=>qE,INPUT_LABEL_LISTS_TO_CHECK:()=>zE,INPUT_LABEL_LISTS_VALUE_TO_SET:()=>BE,INPUT_LABEL_LOOP_BY:()=>CE,INPUT_LABEL_LOOP_FROM:()=>xE,INPUT_LABEL_LOOP_LIST:()=>wE,INPUT_LABEL_LOOP_TIMES:()=>bE,INPUT_LABEL_LOOP_TO:()=>SE,INPUT_LABEL_MATH_CHANGE_BY:()=>mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:()=>hE,INPUT_LABEL_MATH_DIVIDEND:()=>fE,INPUT_LABEL_MATH_DIVISOR:()=>pE,INPUT_LABEL_NUMBER:()=>sE,INPUT_LABEL_NUMBER_A:()=>cE,INPUT_LABEL_NUMBER_ATAN2_X:()=>vE,INPUT_LABEL_NUMBER_ATAN2_Y:()=>yE,INPUT_LABEL_NUMBER_B:()=>lE,INPUT_LABEL_NUMBER_LIST:()=>dE,INPUT_LABEL_NUMBER_MAX:()=>_E,INPUT_LABEL_NUMBER_MIN:()=>gE,INPUT_LABEL_NUMBER_TO_CHECK:()=>uE,INPUT_LABEL_STATEMENT:()=>$T,INPUT_LABEL_TEXT_APPEND:()=>EE,INPUT_LABEL_TEXT_END_POSITION:()=>NE,INPUT_LABEL_TEXT_JOIN_ITEM:()=>TE,INPUT_LABEL_TEXT_POSITION:()=>jE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:()=>PE,INPUT_LABEL_TEXT_START_POSITION:()=>ME,INPUT_LABEL_TEXT_TO_CHANGE:()=>DE,INPUT_LABEL_TEXT_TO_CHECK:()=>OE,INPUT_LABEL_TEXT_TO_FIND:()=>kE,INPUT_LABEL_TEXT_TO_REPLACE:()=>AE,INPUT_LABEL_VALUE:()=>QT,INPUT_LABEL_VALUE_A:()=>aE,INPUT_LABEL_VALUE_B:()=>oE,INPUT_LABEL_VARIABLES_SET:()=>FE,INSERT_KEY:()=>Nw,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:()=>FT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:()=>xT,KEYBOARD_NAV_COPIED_HINT:()=>ST,KEYBOARD_NAV_CUT_HINT:()=>CT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:()=>LT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:()=>bT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:()=>IT,LINUX:()=>hw,LISTS_CREATE_EMPTY_HELPURL:()=>zx,LISTS_CREATE_EMPTY_TITLE:()=>Bx,LISTS_CREATE_EMPTY_TOOLTIP:()=>Vx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:()=>Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:()=>Kx,LISTS_CREATE_WITH_HELPURL:()=>Hx,LISTS_CREATE_WITH_INPUT_WITH:()=>Wx,LISTS_CREATE_WITH_ITEM_TITLE:()=>qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:()=>Jx,LISTS_CREATE_WITH_TOOLTIP:()=>Ux,LISTS_GET_INDEX_FIRST:()=>gS,LISTS_GET_INDEX_FROM_END:()=>hS,LISTS_GET_INDEX_FROM_START:()=>mS,LISTS_GET_INDEX_GET:()=>dS,LISTS_GET_INDEX_GET_REMOVE:()=>fS,LISTS_GET_INDEX_HELPURL:()=>uS,LISTS_GET_INDEX_INPUT_IN_LIST:()=>bS,LISTS_GET_INDEX_LAST:()=>_S,LISTS_GET_INDEX_RANDOM:()=>vS,LISTS_GET_INDEX_REMOVE:()=>pS,LISTS_GET_INDEX_TAIL:()=>yS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:()=>wS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:()=>CS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:()=>TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:()=>ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:()=>OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:()=>DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:()=>kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:()=>AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:()=>MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:()=>jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:()=>NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:()=>PS,LISTS_GET_SUBLIST_END_FROM_END:()=>eC,LISTS_GET_SUBLIST_END_FROM_START:()=>$S,LISTS_GET_SUBLIST_END_LAST:()=>tC,LISTS_GET_SUBLIST_HELPURL:()=>JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:()=>YS,LISTS_GET_SUBLIST_START_FIRST:()=>QS,LISTS_GET_SUBLIST_START_FROM_END:()=>ZS,LISTS_GET_SUBLIST_START_FROM_START:()=>XS,LISTS_GET_SUBLIST_TAIL:()=>nC,LISTS_GET_SUBLIST_TOOLTIP:()=>rC,LISTS_HUE:()=>qh,LISTS_INDEX_FROM_END_TOOLTIP:()=>SS,LISTS_INDEX_FROM_START_TOOLTIP:()=>xS,LISTS_INDEX_OF_FIRST:()=>sS,LISTS_INDEX_OF_HELPURL:()=>aS,LISTS_INDEX_OF_INPUT_IN_LIST:()=>oS,LISTS_INDEX_OF_LAST:()=>cS,LISTS_INDEX_OF_TOOLTIP:()=>lS,LISTS_INLIST:()=>iS,LISTS_ISEMPTY_HELPURL:()=>tS,LISTS_ISEMPTY_TITLE:()=>nS,LISTS_ISEMPTY_TOOLTIP:()=>rS,LISTS_LENGTH_HELPURL:()=>Qx,LISTS_LENGTH_TITLE:()=>$x,LISTS_LENGTH_TOOLTIP:()=>eS,LISTS_REPEAT_HELPURL:()=>Yx,LISTS_REPEAT_TITLE:()=>Zx,LISTS_REPEAT_TOOLTIP:()=>Xx,LISTS_REVERSE_HELPURL:()=>vC,LISTS_REVERSE_MESSAGE0:()=>yC,LISTS_REVERSE_TOOLTIP:()=>bC,LISTS_SET_INDEX_HELPURL:()=>FS,LISTS_SET_INDEX_INPUT_IN_LIST:()=>IS,LISTS_SET_INDEX_INPUT_TO:()=>zS,LISTS_SET_INDEX_INSERT:()=>RS,LISTS_SET_INDEX_SET:()=>LS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:()=>GS,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:()=>WS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:()=>KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:()=>qS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:()=>VS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:()=>BS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:()=>HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:()=>US,LISTS_SORT_HELPURL:()=>iC,LISTS_SORT_ORDER_ASCENDING:()=>sC,LISTS_SORT_ORDER_DESCENDING:()=>cC,LISTS_SORT_TITLE:()=>aC,LISTS_SORT_TOOLTIP:()=>oC,LISTS_SORT_TYPE_IGNORECASE:()=>dC,LISTS_SORT_TYPE_NUMERIC:()=>lC,LISTS_SORT_TYPE_TEXT:()=>uC,LISTS_SPLIT_HELPURL:()=>fC,LISTS_SPLIT_LIST_FROM_TEXT:()=>pC,LISTS_SPLIT_TEXT_FROM_LIST:()=>mC,LISTS_SPLIT_TOOLTIP_JOIN:()=>_C,LISTS_SPLIT_TOOLTIP_SPLIT:()=>gC,LISTS_SPLIT_WITH_DELIMITER:()=>hC,LOGIC_BOOLEAN_FALSE:()=>sv,LOGIC_BOOLEAN_HELPURL:()=>av,LOGIC_BOOLEAN_TOOLTIP:()=>cv,LOGIC_BOOLEAN_TRUE:()=>ov,LOGIC_COMPARE_EQ_ARIA:()=>z_,LOGIC_COMPARE_GTE_ARIA:()=>Y_,LOGIC_COMPARE_GT_ARIA:()=>q_,LOGIC_COMPARE_HELPURL:()=>R_,LOGIC_COMPARE_LTE_ARIA:()=>G_,LOGIC_COMPARE_LT_ARIA:()=>U_,LOGIC_COMPARE_NEQ_ARIA:()=>V_,LOGIC_COMPARE_TOOLTIP_EQ:()=>B_,LOGIC_COMPARE_TOOLTIP_GT:()=>J_,LOGIC_COMPARE_TOOLTIP_GTE:()=>X_,LOGIC_COMPARE_TOOLTIP_LT:()=>W_,LOGIC_COMPARE_TOOLTIP_LTE:()=>K_,LOGIC_COMPARE_TOOLTIP_NEQ:()=>H_,LOGIC_HUE:()=>Uh,LOGIC_NEGATE_HELPURL:()=>nv,LOGIC_NEGATE_TITLE:()=>rv,LOGIC_NEGATE_TOOLTIP:()=>iv,LOGIC_NULL:()=>uv,LOGIC_NULL_HELPURL:()=>lv,LOGIC_NULL_TOOLTIP:()=>dv,LOGIC_OPERATION_AND:()=>$_,LOGIC_OPERATION_HELPURL:()=>Z_,LOGIC_OPERATION_OR:()=>tv,LOGIC_OPERATION_TOOLTIP_AND:()=>Q_,LOGIC_OPERATION_TOOLTIP_OR:()=>ev,LOGIC_TERNARY_CONDITION:()=>pv,LOGIC_TERNARY_HELPURL:()=>fv,LOGIC_TERNARY_IF_FALSE:()=>hv,LOGIC_TERNARY_IF_TRUE:()=>mv,LOGIC_TERNARY_TOOLTIP:()=>gv,LOOPS_HUE:()=>Wh,MAC_OS:()=>pw,MATH_ADDITION_SYMBOL:()=>yv,MATH_ADDITION_SYMBOL_ARIA:()=>bv,MATH_ARITHMETIC_HELPURL:()=>qv,MATH_ARITHMETIC_TOOLTIP_ADD:()=>Jv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:()=>Zv,MATH_ARITHMETIC_TOOLTIP_MINUS:()=>Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:()=>Xv,MATH_ARITHMETIC_TOOLTIP_POWER:()=>Qv,MATH_ATAN2_HELPURL:()=>vb,MATH_ATAN2_TITLE:()=>yb,MATH_ATAN2_TOOLTIP:()=>bb,MATH_CHANGE_HELPURL:()=>My,MATH_CHANGE_TITLE:()=>Ny,MATH_CHANGE_TITLE_ITEM:()=>Py,MATH_CHANGE_TOOLTIP:()=>Fy,MATH_CONSTANT_E_ARIA:()=>Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:()=>Uv,MATH_CONSTANT_HELPURL:()=>Sy,MATH_CONSTANT_INFINITY_ARIA:()=>Kv,MATH_CONSTANT_PI_ARIA:()=>Vv,MATH_CONSTANT_SQRT1_2_ARIA:()=>Gv,MATH_CONSTANT_SQRT2_ARIA:()=>Wv,MATH_CONSTANT_TOOLTIP:()=>Cy,MATH_CONSTRAIN_HELPURL:()=>lb,MATH_CONSTRAIN_TITLE:()=>ub,MATH_CONSTRAIN_TOOLTIP:()=>db,MATH_DIVISION_SYMBOL:()=>Cv,MATH_DIVISION_SYMBOL_ARIA:()=>wv,MATH_HUE:()=>Gh,MATH_IS_DIVISIBLE_BY:()=>Ay,MATH_IS_EVEN:()=>wy,MATH_IS_NEGATIVE:()=>ky,MATH_IS_ODD:()=>Ty,MATH_IS_POSITIVE:()=>Oy,MATH_IS_PRIME:()=>Ey,MATH_IS_TOOLTIP:()=>jy,MATH_IS_WHOLE:()=>Dy,MATH_MODULO_HELPURL:()=>ob,MATH_MODULO_TITLE:()=>sb,MATH_MODULO_TOOLTIP:()=>cb,MATH_MULTIPLICATION_SYMBOL:()=>Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:()=>Ev,MATH_NUMBER_HELPURL:()=>_v,MATH_NUMBER_TOOLTIP:()=>vv,MATH_ONLIST_HELPURL:()=>Vy,MATH_ONLIST_OPERATOR_AVERAGE:()=>Xy,MATH_ONLIST_OPERATOR_MAX:()=>qy,MATH_ONLIST_OPERATOR_MAX_ARIA:()=>Jy,MATH_ONLIST_OPERATOR_MEDIAN:()=>Qy,MATH_ONLIST_OPERATOR_MIN:()=>Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:()=>Gy,MATH_ONLIST_OPERATOR_MODE:()=>eb,MATH_ONLIST_OPERATOR_RANDOM:()=>ib,MATH_ONLIST_OPERATOR_STD_DEV:()=>nb,MATH_ONLIST_OPERATOR_SUM:()=>Hy,MATH_ONLIST_TOOLTIP_AVERAGE:()=>Zy,MATH_ONLIST_TOOLTIP_MAX:()=>Yy,MATH_ONLIST_TOOLTIP_MEDIAN:()=>$y,MATH_ONLIST_TOOLTIP_MIN:()=>Ky,MATH_ONLIST_TOOLTIP_MODE:()=>tb,MATH_ONLIST_TOOLTIP_RANDOM:()=>ab,MATH_ONLIST_TOOLTIP_STD_DEV:()=>rb,MATH_ONLIST_TOOLTIP_SUM:()=>Uy,MATH_POWER_SYMBOL:()=>Dv,MATH_POWER_SYMBOL_ARIA:()=>Ov,MATH_RANDOM_FLOAT_HELPURL:()=>hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:()=>gb,MATH_RANDOM_FLOAT_TOOLTIP:()=>_b,MATH_RANDOM_INT_HELPURL:()=>fb,MATH_RANDOM_INT_TITLE:()=>pb,MATH_RANDOM_INT_TOOLTIP:()=>mb,MATH_ROUND_HELPURL:()=>Iy,MATH_ROUND_OPERATOR_ROUND:()=>Ry,MATH_ROUND_OPERATOR_ROUNDDOWN:()=>By,MATH_ROUND_OPERATOR_ROUNDUP:()=>zy,MATH_ROUND_TOOLTIP:()=>Ly,MATH_SINGLE_HELPURL:()=>$v,MATH_SINGLE_OP_ABSOLUTE:()=>ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:()=>ry,MATH_SINGLE_OP_EXP_ARIA:()=>cy,MATH_SINGLE_OP_LN_ARIA:()=>oy,MATH_SINGLE_OP_LOG10_ARIA:()=>sy,MATH_SINGLE_OP_NEG_ARIA:()=>ay,MATH_SINGLE_OP_POW10_ARIA:()=>ly,MATH_SINGLE_OP_ROOT:()=>ey,MATH_SINGLE_TOOLTIP_ABS:()=>iy,MATH_SINGLE_TOOLTIP_EXP:()=>py,MATH_SINGLE_TOOLTIP_LN:()=>dy,MATH_SINGLE_TOOLTIP_LOG10:()=>fy,MATH_SINGLE_TOOLTIP_NEG:()=>uy,MATH_SINGLE_TOOLTIP_POW10:()=>my,MATH_SINGLE_TOOLTIP_ROOT:()=>ty,MATH_SUBTRACTION_SYMBOL:()=>xv,MATH_SUBTRACTION_SYMBOL_ARIA:()=>Sv,MATH_TRIG_ACOS:()=>Lv,MATH_TRIG_ACOS_ARIA:()=>Rv,MATH_TRIG_ASIN:()=>Fv,MATH_TRIG_ASIN_ARIA:()=>Iv,MATH_TRIG_ATAN:()=>zv,MATH_TRIG_ATAN_ARIA:()=>Bv,MATH_TRIG_COS:()=>jv,MATH_TRIG_COS_ARIA:()=>Mv,MATH_TRIG_HELPURL:()=>hy,MATH_TRIG_SIN:()=>kv,MATH_TRIG_SIN_ARIA:()=>Av,MATH_TRIG_TAN:()=>Nv,MATH_TRIG_TAN_ARIA:()=>Pv,MATH_TRIG_TOOLTIP_ACOS:()=>by,MATH_TRIG_TOOLTIP_ASIN:()=>yy,MATH_TRIG_TOOLTIP_ATAN:()=>xy,MATH_TRIG_TOOLTIP_COS:()=>_y,MATH_TRIG_TOOLTIP_SIN:()=>gy,MATH_TRIG_TOOLTIP_TAN:()=>vy,MINIMAP_ARIA_LABEL:()=>_O,MOVE_BLOCK:()=>dw,NEW_COLOUR_VARIABLE:()=>Dg,NEW_NUMBER_VARIABLE:()=>Eg,NEW_STRING_VARIABLE:()=>Tg,NEW_VARIABLE:()=>wg,NEW_VARIABLE_TITLE:()=>kg,NEW_VARIABLE_TYPE_TITLE:()=>Og,NO_PARENT_ANNOUNCEMENT:()=>zD,OPEN_BACKPACK:()=>sO,OPEN_TRASH:()=>fD,OPTION_KEY:()=>yw,ORDINAL_NUMBER_SUFFIX:()=>xC,PAGE_DOWN_KEY:()=>Aw,PAGE_UP_KEY:()=>kw,PARENT_BLOCKS_ANNOUNCEMENT:()=>RD,PASTE_ALL_FROM_BACKPACK:()=>fO,PASTE_SHORTCUT:()=>Rw,PAUSE_KEY:()=>Pw,PROCEDURES_ALLOW_STATEMENTS:()=>GC,PROCEDURES_BEFORE_PARAMS:()=>MC,PROCEDURES_CALLNORETURN_HELPURL:()=>qC,PROCEDURES_CALLNORETURN_TOOLTIP:()=>JC,PROCEDURES_CALLRETURN_HELPURL:()=>YC,PROCEDURES_CALLRETURN_TOOLTIP:()=>XC,PROCEDURES_CALL_BEFORE_PARAMS:()=>NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:()=>PC,PROCEDURES_CREATE_DO:()=>nw,PROCEDURES_DEFNORETURN_COMMENT:()=>LC,PROCEDURES_DEFNORETURN_DO:()=>FC,PROCEDURES_DEFNORETURN_HELPURL:()=>kC,PROCEDURES_DEFNORETURN_PROCEDURE:()=>jC,PROCEDURES_DEFNORETURN_TITLE:()=>AC,PROCEDURES_DEFNORETURN_TOOLTIP:()=>IC,PROCEDURES_DEFRETURN_COMMENT:()=>HC,PROCEDURES_DEFRETURN_DO:()=>VC,PROCEDURES_DEFRETURN_HELPURL:()=>RC,PROCEDURES_DEFRETURN_PROCEDURE:()=>BC,PROCEDURES_DEFRETURN_RETURN:()=>UC,PROCEDURES_DEFRETURN_TITLE:()=>zC,PROCEDURES_DEFRETURN_TOOLTIP:()=>WC,PROCEDURES_DEF_DUPLICATE_WARNING:()=>KC,PROCEDURES_HIGHLIGHT_DEF:()=>tw,PROCEDURES_HUE:()=>Zh,PROCEDURES_IFRETURN_HELPURL:()=>iw,PROCEDURES_IFRETURN_TOOLTIP:()=>rw,PROCEDURES_IFRETURN_WARNING:()=>aw,PROCEDURES_MUTATORARG_TITLE:()=>$C,PROCEDURES_MUTATORARG_TOOLTIP:()=>ew,PROCEDURES_MUTATORCONTAINER_TITLE:()=>ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:()=>QC,REDO:()=>bg,REMOVE_COMMENT:()=>rg,REMOVE_FROM_BACKPACK:()=>pO,RENAME_VARIABLE:()=>Sg,RENAME_VARIABLE_TITLE:()=>Cg,RESET_ZOOM:()=>hD,SCREENREADER_HINT:()=>BD,SCREENREADER_MODE_DISABLED:()=>ID,SCREENREADER_MODE_ENABLED:()=>FD,SHIFT_KEY:()=>Ew,SHORTCUTS_ABORT_MOVE:()=>Qw,SHORTCUTS_CLEANUP:()=>dT,SHORTCUTS_CODE_NAVIGATION:()=>Hw,SHORTCUTS_DELETE:()=>Ww,SHORTCUTS_DISCONNECT:()=>iT,SHORTCUTS_DUPLICATE:()=>uT,SHORTCUTS_EDITING:()=>Vw,SHORTCUTS_ESCAPE:()=>Uw,SHORTCUTS_EXTENDED_INFORMATION:()=>rT,SHORTCUTS_FINISH_MOVE:()=>Zw,SHORTCUTS_FOCUS_TOOLBOX:()=>tT,SHORTCUTS_FOCUS_WORKSPACE:()=>eT,SHORTCUTS_GENERAL:()=>Bw,SHORTCUTS_INFORMATION:()=>nT,SHORTCUTS_JUMP_BLOCK_END:()=>hT,SHORTCUTS_JUMP_BLOCK_START:()=>mT,SHORTCUTS_JUMP_BOTTOM_STACK:()=>_T,SHORTCUTS_JUMP_FIRST_BLOCK:()=>vT,SHORTCUTS_JUMP_LAST_BLOCK:()=>yT,SHORTCUTS_JUMP_TOP_STACK:()=>gT,SHORTCUTS_MOVE_DOWN:()=>Xw,SHORTCUTS_MOVE_LEFT:()=>qw,SHORTCUTS_MOVE_RIGHT:()=>Jw,SHORTCUTS_MOVE_UP:()=>Yw,SHORTCUTS_NEXT_HEADING:()=>sT,SHORTCUTS_NEXT_STACK:()=>aT,SHORTCUTS_PERFORM_ACTION:()=>lT,SHORTCUTS_PREVIOUS_HEADING:()=>cT,SHORTCUTS_PREVIOUS_STACK:()=>oT,SHORTCUTS_SHOW_CONTEXT_MENU:()=>$w,SHORTCUTS_SHOW_TOOLTIP:()=>fT,SHORTCUTS_START_MOVE:()=>Gw,SHORTCUTS_START_MOVE_STACK:()=>Kw,SHORTCUTS_TOGGLE_SCREENREADER_MODE:()=>pT,SPACE_KEY:()=>Ow,TAB_KEY:()=>Tw,TEXTS_HUE:()=>Kh,TEXT_APPEND_HELPURL:()=>Ab,TEXT_APPEND_TITLE:()=>jb,TEXT_APPEND_TOOLTIP:()=>Nb,TEXT_APPEND_VARIABLE:()=>Mb,TEXT_CHANGECASE_HELPURL:()=>fx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:()=>hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:()=>gx,TEXT_CHANGECASE_OPERATOR_UPPERCASE:()=>mx,TEXT_CHANGECASE_TOOLTIP:()=>px,TEXT_CHARAT_FIRST:()=>Zb,TEXT_CHARAT_FROM_END:()=>Xb,TEXT_CHARAT_FROM_START:()=>Yb,TEXT_CHARAT_HELPURL:()=>qb,TEXT_CHARAT_LAST:()=>Qb,TEXT_CHARAT_RANDOM:()=>$b,TEXT_CHARAT_TAIL:()=>ex,TEXT_CHARAT_TITLE:()=>Jb,TEXT_CHARAT_TOOLTIP:()=>tx,TEXT_COUNT_HELPURL:()=>jx,TEXT_COUNT_MESSAGE0:()=>Ax,TEXT_COUNT_TOOLTIP:()=>Mx,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:()=>Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:()=>kb,TEXT_CREATE_JOIN_TITLE_JOIN:()=>Eb,TEXT_CREATE_JOIN_TOOLTIP:()=>Db,TEXT_FROM_END_ARIA:()=>Kb,TEXT_FROM_START_ARIA:()=>Gb,TEXT_GET_SUBSTRING_END_FROM_END:()=>lx,TEXT_GET_SUBSTRING_END_FROM_START:()=>cx,TEXT_GET_SUBSTRING_END_LAST:()=>ux,TEXT_GET_SUBSTRING_HELPURL:()=>rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:()=>ix,TEXT_GET_SUBSTRING_START_FIRST:()=>sx,TEXT_GET_SUBSTRING_START_FROM_END:()=>ox,TEXT_GET_SUBSTRING_START_FROM_START:()=>ax,TEXT_GET_SUBSTRING_TAIL:()=>dx,TEXT_GET_SUBSTRING_TOOLTIP:()=>nx,TEXT_INDEXOF_HELPURL:()=>Bb,TEXT_INDEXOF_OPERATOR_FIRST:()=>Ub,TEXT_INDEXOF_OPERATOR_LAST:()=>Wb,TEXT_INDEXOF_TITLE:()=>Hb,TEXT_INDEXOF_TOOLTIP:()=>Vb,TEXT_ISEMPTY_HELPURL:()=>Lb,TEXT_ISEMPTY_TITLE:()=>Rb,TEXT_ISEMPTY_TOOLTIP:()=>zb,TEXT_JOIN_HELPURL:()=>Cb,TEXT_JOIN_TITLE_CREATEWITH:()=>wb,TEXT_JOIN_TOOLTIP:()=>Tb,TEXT_LENGTH_HELPURL:()=>Pb,TEXT_LENGTH_TITLE:()=>Fb,TEXT_LENGTH_TOOLTIP:()=>Ib,TEXT_PRINT_HELPURL:()=>Sx,TEXT_PRINT_TITLE:()=>Cx,TEXT_PRINT_TOOLTIP:()=>wx,TEXT_PROMPT_HELPURL:()=>Tx,TEXT_PROMPT_TOOLTIP_NUMBER:()=>Ox,TEXT_PROMPT_TOOLTIP_TEXT:()=>kx,TEXT_PROMPT_TYPE_NUMBER:()=>Dx,TEXT_PROMPT_TYPE_TEXT:()=>Ex,TEXT_REPLACE_HELPURL:()=>Px,TEXT_REPLACE_MESSAGE0:()=>Nx,TEXT_REPLACE_TOOLTIP:()=>Fx,TEXT_REVERSE_HELPURL:()=>Lx,TEXT_REVERSE_MESSAGE0:()=>Ix,TEXT_REVERSE_TOOLTIP:()=>Rx,TEXT_TEXT_HELPURL:()=>xb,TEXT_TEXT_TOOLTIP:()=>Sb,TEXT_TRIM_HELPURL:()=>_x,TEXT_TRIM_OPERATOR_BOTH:()=>yx,TEXT_TRIM_OPERATOR_LEFT:()=>bx,TEXT_TRIM_OPERATOR_RIGHT:()=>xx,TEXT_TRIM_TOOLTIP:()=>vx,TODAY:()=>eg,UNDO:()=>yg,UNKNOWN:()=>gw,UNNAMED_KEY:()=>$h,VARIABLES_DEFAULT_NAME:()=>Qh,VARIABLES_DYNAMIC_HUE:()=>Xh,VARIABLES_GET_CREATE_SET:()=>wC,VARIABLES_GET_HELPURL:()=>SC,VARIABLES_GET_TOOLTIP:()=>CC,VARIABLES_HUE:()=>Yh,VARIABLES_SET:()=>EC,VARIABLES_SET_CREATE_GET:()=>OC,VARIABLES_SET_HELPURL:()=>TC,VARIABLES_SET_TOOLTIP:()=>DC,VARIABLE_ALREADY_EXISTS:()=>Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:()=>jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:()=>Mg,WINDOWS:()=>fw,WORKSPACE_COMMENT_DEFAULT_TEXT:()=>ow,WORKSPACE_CONTENTS_BLOCKS_MANY:()=>AT,WORKSPACE_CONTENTS_BLOCKS_ONE:()=>jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:()=>MT,WORKSPACE_CONTENTS_COMMENTS_MANY:()=>NT,WORKSPACE_CONTENTS_COMMENTS_ONE:()=>PT,WORKSPACE_LABEL_1_STACK:()=>ET,WORKSPACE_LABEL_FLYOUT_WORKSPACE:()=>kT,WORKSPACE_LABEL_MANY_STACKS:()=>DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:()=>OT,WORKSPACE_LABEL_PLAIN:()=>wT,WORKSPACE_ROLEDESCRIPTION:()=>TT,ZOOM_IN:()=>pD,ZOOM_OUT:()=>mD,ZOOM_TO_FIT_ARIA_LABEL:()=>gO}),{LOGIC_HUE:Uh,LOOPS_HUE:Wh,MATH_HUE:Gh,TEXTS_HUE:Kh,LISTS_HUE:qh,COLOUR_HUE:Jh,VARIABLES_HUE:Yh,VARIABLES_DYNAMIC_HUE:Xh,PROCEDURES_HUE:Zh,VARIABLES_DEFAULT_NAME:Qh,UNNAMED_KEY:$h,TODAY:eg,DUPLICATE_BLOCK:tg,ADD_COMMENT:ng,REMOVE_COMMENT:rg,DUPLICATE_COMMENT:ig,EXTERNAL_INPUTS:ag,INLINE_INPUTS:og,DELETE_BLOCK:sg,DELETE_X_BLOCKS:cg,DELETE_ALL_BLOCKS:lg,CLEAN_UP:ug,CLOSE:dg,COLLAPSE_BLOCK:fg,COLLAPSE_ALL:pg,EXPAND_BLOCK:mg,EXPAND_ALL:hg,DISABLE_BLOCK:gg,ENABLE_BLOCK:_g,HELP:vg,UNDO:yg,REDO:bg,CHANGE_VALUE_TITLE:xg,RENAME_VARIABLE:Sg,RENAME_VARIABLE_TITLE:Cg,NEW_VARIABLE:wg,NEW_STRING_VARIABLE:Tg,NEW_NUMBER_VARIABLE:Eg,NEW_COLOUR_VARIABLE:Dg,NEW_VARIABLE_TYPE_TITLE:Og,NEW_VARIABLE_TITLE:kg,VARIABLE_ALREADY_EXISTS:Ag,VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE:jg,VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER:Mg,DELETE_VARIABLE_CONFIRMATION:Ng,CANNOT_DELETE_VARIABLE_PROCEDURE:Pg,DELETE_VARIABLE:Fg,COLOUR_PICKER_HELPURL:Ig,COLOUR_PICKER_TOOLTIP:Lg,COLOUR_RANDOM_HELPURL:Rg,COLOUR_RANDOM_TITLE:zg,COLOUR_RANDOM_TOOLTIP:Bg,COLOUR_RGB_HELPURL:Vg,COLOUR_RGB_TITLE:Hg,COLOUR_RGB_RED:Ug,COLOUR_RGB_GREEN:Wg,COLOUR_RGB_BLUE:Gg,COLOUR_RGB_TOOLTIP:Kg,COLOUR_BLEND_HELPURL:qg,COLOUR_BLEND_TITLE:Jg,COLOUR_BLEND_COLOUR1:Yg,COLOUR_BLEND_COLOUR2:Xg,COLOUR_BLEND_RATIO:Zg,COLOUR_BLEND_TOOLTIP:Qg,CONTROLS_REPEAT_HELPURL:$g,CONTROLS_REPEAT_TITLE:e_,CONTROLS_REPEAT_INPUT_DO:t_,CONTROLS_REPEAT_TOOLTIP:n_,CONTROLS_WHILEUNTIL_HELPURL:r_,CONTROLS_WHILEUNTIL_INPUT_DO:i_,CONTROLS_WHILEUNTIL_OPERATOR_WHILE:a_,CONTROLS_WHILEUNTIL_OPERATOR_UNTIL:o_,CONTROLS_WHILEUNTIL_TOOLTIP_WHILE:s_,CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL:c_,CONTROLS_FOR_HELPURL:l_,CONTROLS_FOR_TOOLTIP:u_,CONTROLS_FOR_TITLE:d_,CONTROLS_FOR_INPUT_DO:f_,CONTROLS_FOREACH_HELPURL:p_,CONTROLS_FOREACH_TITLE:m_,CONTROLS_FOREACH_INPUT_DO:h_,CONTROLS_FOREACH_TOOLTIP:g_,CONTROLS_FLOW_STATEMENTS_HELPURL:__,CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK:v_,CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE:y_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK:b_,CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE:x_,CONTROLS_FLOW_STATEMENTS_WARNING:S_,CONTROLS_IF_HELPURL:C_,CONTROLS_IF_TOOLTIP_1:w_,CONTROLS_IF_TOOLTIP_2:T_,CONTROLS_IF_TOOLTIP_3:E_,CONTROLS_IF_TOOLTIP_4:D_,CONTROLS_IF_MSG_IF:O_,CONTROLS_IF_MSG_ELSEIF:k_,CONTROLS_IF_MSG_ELSE:A_,CONTROLS_IF_MSG_THEN:j_,CONTROLS_IF_IF_TITLE_IF:M_,CONTROLS_IF_IF_TOOLTIP:N_,CONTROLS_IF_ELSEIF_TITLE_ELSEIF:P_,CONTROLS_IF_ELSEIF_TOOLTIP:F_,CONTROLS_IF_ELSE_TITLE_ELSE:I_,CONTROLS_IF_ELSE_TOOLTIP:L_,LOGIC_COMPARE_HELPURL:R_,LOGIC_COMPARE_EQ_ARIA:z_,LOGIC_COMPARE_TOOLTIP_EQ:B_,LOGIC_COMPARE_NEQ_ARIA:V_,LOGIC_COMPARE_TOOLTIP_NEQ:H_,LOGIC_COMPARE_LT_ARIA:U_,LOGIC_COMPARE_TOOLTIP_LT:W_,LOGIC_COMPARE_LTE_ARIA:G_,LOGIC_COMPARE_TOOLTIP_LTE:K_,LOGIC_COMPARE_GT_ARIA:q_,LOGIC_COMPARE_TOOLTIP_GT:J_,LOGIC_COMPARE_GTE_ARIA:Y_,LOGIC_COMPARE_TOOLTIP_GTE:X_,LOGIC_OPERATION_HELPURL:Z_,LOGIC_OPERATION_TOOLTIP_AND:Q_,LOGIC_OPERATION_AND:$_,LOGIC_OPERATION_TOOLTIP_OR:ev,LOGIC_OPERATION_OR:tv,LOGIC_NEGATE_HELPURL:nv,LOGIC_NEGATE_TITLE:rv,LOGIC_NEGATE_TOOLTIP:iv,LOGIC_BOOLEAN_HELPURL:av,LOGIC_BOOLEAN_TRUE:ov,LOGIC_BOOLEAN_FALSE:sv,LOGIC_BOOLEAN_TOOLTIP:cv,LOGIC_NULL_HELPURL:lv,LOGIC_NULL:uv,LOGIC_NULL_TOOLTIP:dv,LOGIC_TERNARY_HELPURL:fv,LOGIC_TERNARY_CONDITION:pv,LOGIC_TERNARY_IF_TRUE:mv,LOGIC_TERNARY_IF_FALSE:hv,LOGIC_TERNARY_TOOLTIP:gv,MATH_NUMBER_HELPURL:_v,MATH_NUMBER_TOOLTIP:vv,MATH_ADDITION_SYMBOL:yv,MATH_ADDITION_SYMBOL_ARIA:bv,MATH_SUBTRACTION_SYMBOL:xv,MATH_SUBTRACTION_SYMBOL_ARIA:Sv,MATH_DIVISION_SYMBOL:Cv,MATH_DIVISION_SYMBOL_ARIA:wv,MATH_MULTIPLICATION_SYMBOL:Tv,MATH_MULTIPLICATION_SYMBOL_ARIA:Ev,MATH_POWER_SYMBOL:Dv,MATH_POWER_SYMBOL_ARIA:Ov,MATH_TRIG_SIN:kv,MATH_TRIG_SIN_ARIA:Av,MATH_TRIG_COS:jv,MATH_TRIG_COS_ARIA:Mv,MATH_TRIG_TAN:Nv,MATH_TRIG_TAN_ARIA:Pv,MATH_TRIG_ASIN:Fv,MATH_TRIG_ASIN_ARIA:Iv,MATH_TRIG_ACOS:Lv,MATH_TRIG_ACOS_ARIA:Rv,MATH_TRIG_ATAN:zv,MATH_TRIG_ATAN_ARIA:Bv,MATH_CONSTANT_PI_ARIA:Vv,MATH_CONSTANT_E_ARIA:Hv,MATH_CONSTANT_GOLDEN_RATIO_ARIA:Uv,MATH_CONSTANT_SQRT2_ARIA:Wv,MATH_CONSTANT_SQRT1_2_ARIA:Gv,MATH_CONSTANT_INFINITY_ARIA:Kv,MATH_ARITHMETIC_HELPURL:qv,MATH_ARITHMETIC_TOOLTIP_ADD:Jv,MATH_ARITHMETIC_TOOLTIP_MINUS:Yv,MATH_ARITHMETIC_TOOLTIP_MULTIPLY:Xv,MATH_ARITHMETIC_TOOLTIP_DIVIDE:Zv,MATH_ARITHMETIC_TOOLTIP_POWER:Qv,MATH_SINGLE_HELPURL:$v,MATH_SINGLE_OP_ROOT:ey,MATH_SINGLE_TOOLTIP_ROOT:ty,MATH_SINGLE_OP_ABSOLUTE:ny,MATH_SINGLE_OP_ABSOLUTE_ARIA:ry,MATH_SINGLE_TOOLTIP_ABS:iy,MATH_SINGLE_OP_NEG_ARIA:ay,MATH_SINGLE_OP_LN_ARIA:oy,MATH_SINGLE_OP_LOG10_ARIA:sy,MATH_SINGLE_OP_EXP_ARIA:cy,MATH_SINGLE_OP_POW10_ARIA:ly,MATH_SINGLE_TOOLTIP_NEG:uy,MATH_SINGLE_TOOLTIP_LN:dy,MATH_SINGLE_TOOLTIP_LOG10:fy,MATH_SINGLE_TOOLTIP_EXP:py,MATH_SINGLE_TOOLTIP_POW10:my,MATH_TRIG_HELPURL:hy,MATH_TRIG_TOOLTIP_SIN:gy,MATH_TRIG_TOOLTIP_COS:_y,MATH_TRIG_TOOLTIP_TAN:vy,MATH_TRIG_TOOLTIP_ASIN:yy,MATH_TRIG_TOOLTIP_ACOS:by,MATH_TRIG_TOOLTIP_ATAN:xy,MATH_CONSTANT_HELPURL:Sy,MATH_CONSTANT_TOOLTIP:Cy,MATH_IS_EVEN:wy,MATH_IS_ODD:Ty,MATH_IS_PRIME:Ey,MATH_IS_WHOLE:Dy,MATH_IS_POSITIVE:Oy,MATH_IS_NEGATIVE:ky,MATH_IS_DIVISIBLE_BY:Ay,MATH_IS_TOOLTIP:jy,MATH_CHANGE_HELPURL:My,MATH_CHANGE_TITLE:Ny,MATH_CHANGE_TITLE_ITEM:Py,MATH_CHANGE_TOOLTIP:Fy,MATH_ROUND_HELPURL:Iy,MATH_ROUND_TOOLTIP:Ly,MATH_ROUND_OPERATOR_ROUND:Ry,MATH_ROUND_OPERATOR_ROUNDUP:zy,MATH_ROUND_OPERATOR_ROUNDDOWN:By,MATH_ONLIST_HELPURL:Vy,MATH_ONLIST_OPERATOR_SUM:Hy,MATH_ONLIST_TOOLTIP_SUM:Uy,MATH_ONLIST_OPERATOR_MIN:Wy,MATH_ONLIST_OPERATOR_MIN_ARIA:Gy,MATH_ONLIST_TOOLTIP_MIN:Ky,MATH_ONLIST_OPERATOR_MAX:qy,MATH_ONLIST_OPERATOR_MAX_ARIA:Jy,MATH_ONLIST_TOOLTIP_MAX:Yy,MATH_ONLIST_OPERATOR_AVERAGE:Xy,MATH_ONLIST_TOOLTIP_AVERAGE:Zy,MATH_ONLIST_OPERATOR_MEDIAN:Qy,MATH_ONLIST_TOOLTIP_MEDIAN:$y,MATH_ONLIST_OPERATOR_MODE:eb,MATH_ONLIST_TOOLTIP_MODE:tb,MATH_ONLIST_OPERATOR_STD_DEV:nb,MATH_ONLIST_TOOLTIP_STD_DEV:rb,MATH_ONLIST_OPERATOR_RANDOM:ib,MATH_ONLIST_TOOLTIP_RANDOM:ab,MATH_MODULO_HELPURL:ob,MATH_MODULO_TITLE:sb,MATH_MODULO_TOOLTIP:cb,MATH_CONSTRAIN_HELPURL:lb,MATH_CONSTRAIN_TITLE:ub,MATH_CONSTRAIN_TOOLTIP:db,MATH_RANDOM_INT_HELPURL:fb,MATH_RANDOM_INT_TITLE:pb,MATH_RANDOM_INT_TOOLTIP:mb,MATH_RANDOM_FLOAT_HELPURL:hb,MATH_RANDOM_FLOAT_TITLE_RANDOM:gb,MATH_RANDOM_FLOAT_TOOLTIP:_b,MATH_ATAN2_HELPURL:vb,MATH_ATAN2_TITLE:yb,MATH_ATAN2_TOOLTIP:bb,TEXT_TEXT_HELPURL:xb,TEXT_TEXT_TOOLTIP:Sb,TEXT_JOIN_HELPURL:Cb,TEXT_JOIN_TITLE_CREATEWITH:wb,TEXT_JOIN_TOOLTIP:Tb,TEXT_CREATE_JOIN_TITLE_JOIN:Eb,TEXT_CREATE_JOIN_TOOLTIP:Db,TEXT_CREATE_JOIN_ITEM_TITLE_ITEM:Ob,TEXT_CREATE_JOIN_ITEM_TOOLTIP:kb,TEXT_APPEND_HELPURL:Ab,TEXT_APPEND_TITLE:jb,TEXT_APPEND_VARIABLE:Mb,TEXT_APPEND_TOOLTIP:Nb,TEXT_LENGTH_HELPURL:Pb,TEXT_LENGTH_TITLE:Fb,TEXT_LENGTH_TOOLTIP:Ib,TEXT_ISEMPTY_HELPURL:Lb,TEXT_ISEMPTY_TITLE:Rb,TEXT_ISEMPTY_TOOLTIP:zb,TEXT_INDEXOF_HELPURL:Bb,TEXT_INDEXOF_TOOLTIP:Vb,TEXT_INDEXOF_TITLE:Hb,TEXT_INDEXOF_OPERATOR_FIRST:Ub,TEXT_INDEXOF_OPERATOR_LAST:Wb,TEXT_FROM_START_ARIA:Gb,TEXT_FROM_END_ARIA:Kb,TEXT_CHARAT_HELPURL:qb,TEXT_CHARAT_TITLE:Jb,TEXT_CHARAT_FROM_START:Yb,TEXT_CHARAT_FROM_END:Xb,TEXT_CHARAT_FIRST:Zb,TEXT_CHARAT_LAST:Qb,TEXT_CHARAT_RANDOM:$b,TEXT_CHARAT_TAIL:ex,TEXT_CHARAT_TOOLTIP:tx,TEXT_GET_SUBSTRING_TOOLTIP:nx,TEXT_GET_SUBSTRING_HELPURL:rx,TEXT_GET_SUBSTRING_INPUT_IN_TEXT:ix,TEXT_GET_SUBSTRING_START_FROM_START:ax,TEXT_GET_SUBSTRING_START_FROM_END:ox,TEXT_GET_SUBSTRING_START_FIRST:sx,TEXT_GET_SUBSTRING_END_FROM_START:cx,TEXT_GET_SUBSTRING_END_FROM_END:lx,TEXT_GET_SUBSTRING_END_LAST:ux,TEXT_GET_SUBSTRING_TAIL:dx,TEXT_CHANGECASE_HELPURL:fx,TEXT_CHANGECASE_TOOLTIP:px,TEXT_CHANGECASE_OPERATOR_UPPERCASE:mx,TEXT_CHANGECASE_OPERATOR_LOWERCASE:hx,TEXT_CHANGECASE_OPERATOR_TITLECASE:gx,TEXT_TRIM_HELPURL:_x,TEXT_TRIM_TOOLTIP:vx,TEXT_TRIM_OPERATOR_BOTH:yx,TEXT_TRIM_OPERATOR_LEFT:bx,TEXT_TRIM_OPERATOR_RIGHT:xx,TEXT_PRINT_HELPURL:Sx,TEXT_PRINT_TITLE:Cx,TEXT_PRINT_TOOLTIP:wx,TEXT_PROMPT_HELPURL:Tx,TEXT_PROMPT_TYPE_TEXT:Ex,TEXT_PROMPT_TYPE_NUMBER:Dx,TEXT_PROMPT_TOOLTIP_NUMBER:Ox,TEXT_PROMPT_TOOLTIP_TEXT:kx,TEXT_COUNT_MESSAGE0:Ax,TEXT_COUNT_HELPURL:jx,TEXT_COUNT_TOOLTIP:Mx,TEXT_REPLACE_MESSAGE0:Nx,TEXT_REPLACE_HELPURL:Px,TEXT_REPLACE_TOOLTIP:Fx,TEXT_REVERSE_MESSAGE0:Ix,TEXT_REVERSE_HELPURL:Lx,TEXT_REVERSE_TOOLTIP:Rx,LISTS_CREATE_EMPTY_HELPURL:zx,LISTS_CREATE_EMPTY_TITLE:Bx,LISTS_CREATE_EMPTY_TOOLTIP:Vx,LISTS_CREATE_WITH_HELPURL:Hx,LISTS_CREATE_WITH_TOOLTIP:Ux,LISTS_CREATE_WITH_INPUT_WITH:Wx,LISTS_CREATE_WITH_CONTAINER_TITLE_ADD:Gx,LISTS_CREATE_WITH_CONTAINER_TOOLTIP:Kx,LISTS_CREATE_WITH_ITEM_TITLE:qx,LISTS_CREATE_WITH_ITEM_TOOLTIP:Jx,LISTS_REPEAT_HELPURL:Yx,LISTS_REPEAT_TOOLTIP:Xx,LISTS_REPEAT_TITLE:Zx,LISTS_LENGTH_HELPURL:Qx,LISTS_LENGTH_TITLE:$x,LISTS_LENGTH_TOOLTIP:eS,LISTS_ISEMPTY_HELPURL:tS,LISTS_ISEMPTY_TITLE:nS,LISTS_ISEMPTY_TOOLTIP:rS,LISTS_INLIST:iS,LISTS_INDEX_OF_HELPURL:aS,LISTS_INDEX_OF_INPUT_IN_LIST:oS,LISTS_INDEX_OF_FIRST:sS,LISTS_INDEX_OF_LAST:cS,LISTS_INDEX_OF_TOOLTIP:lS,LISTS_GET_INDEX_HELPURL:uS,LISTS_GET_INDEX_GET:dS,LISTS_GET_INDEX_GET_REMOVE:fS,LISTS_GET_INDEX_REMOVE:pS,LISTS_GET_INDEX_FROM_START:mS,LISTS_GET_INDEX_FROM_END:hS,LISTS_GET_INDEX_FIRST:gS,LISTS_GET_INDEX_LAST:_S,LISTS_GET_INDEX_RANDOM:vS,LISTS_GET_INDEX_TAIL:yS,LISTS_GET_INDEX_INPUT_IN_LIST:bS,LISTS_INDEX_FROM_START_TOOLTIP:xS,LISTS_INDEX_FROM_END_TOOLTIP:SS,LISTS_GET_INDEX_TOOLTIP_GET_FROM:CS,LISTS_GET_INDEX_TOOLTIP_GET_FIRST:wS,LISTS_GET_INDEX_TOOLTIP_GET_LAST:TS,LISTS_GET_INDEX_TOOLTIP_GET_RANDOM:ES,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM:DS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST:OS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST:kS,LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM:AS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM:jS,LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST:MS,LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST:NS,LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM:PS,LISTS_SET_INDEX_HELPURL:FS,LISTS_SET_INDEX_INPUT_IN_LIST:IS,LISTS_SET_INDEX_SET:LS,LISTS_SET_INDEX_INSERT:RS,LISTS_SET_INDEX_INPUT_TO:zS,LISTS_SET_INDEX_TOOLTIP_SET_FROM:BS,LISTS_SET_INDEX_TOOLTIP_SET_FIRST:VS,LISTS_SET_INDEX_TOOLTIP_SET_LAST:HS,LISTS_SET_INDEX_TOOLTIP_SET_RANDOM:US,LISTS_SET_INDEX_TOOLTIP_INSERT_FROM:WS,LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST:GS,LISTS_SET_INDEX_TOOLTIP_INSERT_LAST:KS,LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM:qS,LISTS_GET_SUBLIST_HELPURL:JS,LISTS_GET_SUBLIST_INPUT_IN_LIST:YS,LISTS_GET_SUBLIST_START_FROM_START:XS,LISTS_GET_SUBLIST_START_FROM_END:ZS,LISTS_GET_SUBLIST_START_FIRST:QS,LISTS_GET_SUBLIST_END_FROM_START:$S,LISTS_GET_SUBLIST_END_FROM_END:eC,LISTS_GET_SUBLIST_END_LAST:tC,LISTS_GET_SUBLIST_TAIL:nC,LISTS_GET_SUBLIST_TOOLTIP:rC,LISTS_SORT_HELPURL:iC,LISTS_SORT_TITLE:aC,LISTS_SORT_TOOLTIP:oC,LISTS_SORT_ORDER_ASCENDING:sC,LISTS_SORT_ORDER_DESCENDING:cC,LISTS_SORT_TYPE_NUMERIC:lC,LISTS_SORT_TYPE_TEXT:uC,LISTS_SORT_TYPE_IGNORECASE:dC,LISTS_SPLIT_HELPURL:fC,LISTS_SPLIT_LIST_FROM_TEXT:pC,LISTS_SPLIT_TEXT_FROM_LIST:mC,LISTS_SPLIT_WITH_DELIMITER:hC,LISTS_SPLIT_TOOLTIP_SPLIT:gC,LISTS_SPLIT_TOOLTIP_JOIN:_C,LISTS_REVERSE_HELPURL:vC,LISTS_REVERSE_MESSAGE0:yC,LISTS_REVERSE_TOOLTIP:bC,ORDINAL_NUMBER_SUFFIX:xC,VARIABLES_GET_HELPURL:SC,VARIABLES_GET_TOOLTIP:CC,VARIABLES_GET_CREATE_SET:wC,VARIABLES_SET_HELPURL:TC,VARIABLES_SET:EC,VARIABLES_SET_TOOLTIP:DC,VARIABLES_SET_CREATE_GET:OC,PROCEDURES_DEFNORETURN_HELPURL:kC,PROCEDURES_DEFNORETURN_TITLE:AC,PROCEDURES_DEFNORETURN_PROCEDURE:jC,PROCEDURES_BEFORE_PARAMS:MC,PROCEDURES_CALL_BEFORE_PARAMS:NC,PROCEDURES_CALL_DISABLED_DEF_WARNING:PC,PROCEDURES_DEFNORETURN_DO:FC,PROCEDURES_DEFNORETURN_TOOLTIP:IC,PROCEDURES_DEFNORETURN_COMMENT:LC,PROCEDURES_DEFRETURN_HELPURL:RC,PROCEDURES_DEFRETURN_TITLE:zC,PROCEDURES_DEFRETURN_PROCEDURE:BC,PROCEDURES_DEFRETURN_DO:VC,PROCEDURES_DEFRETURN_COMMENT:HC,PROCEDURES_DEFRETURN_RETURN:UC,PROCEDURES_DEFRETURN_TOOLTIP:WC,PROCEDURES_ALLOW_STATEMENTS:GC,PROCEDURES_DEF_DUPLICATE_WARNING:KC,PROCEDURES_CALLNORETURN_HELPURL:qC,PROCEDURES_CALLNORETURN_TOOLTIP:JC,PROCEDURES_CALLRETURN_HELPURL:YC,PROCEDURES_CALLRETURN_TOOLTIP:XC,PROCEDURES_MUTATORCONTAINER_TITLE:ZC,PROCEDURES_MUTATORCONTAINER_TOOLTIP:QC,PROCEDURES_MUTATORARG_TITLE:$C,PROCEDURES_MUTATORARG_TOOLTIP:ew,PROCEDURES_HIGHLIGHT_DEF:tw,PROCEDURES_CREATE_DO:nw,PROCEDURES_IFRETURN_TOOLTIP:rw,PROCEDURES_IFRETURN_HELPURL:iw,PROCEDURES_IFRETURN_WARNING:aw,WORKSPACE_COMMENT_DEFAULT_TEXT:ow,COLLAPSED_WARNINGS_WARNING:sw,DIALOG_OK:cw,DIALOG_CANCEL:lw,EDIT_BLOCK_CONTENTS:uw,MOVE_BLOCK:dw,WINDOWS:fw,MAC_OS:pw,CHROME_OS:mw,LINUX:hw,UNKNOWN:gw,CONTROL_KEY:_w,COMMAND_KEY:vw,OPTION_KEY:yw,ALT_KEY:bw,ENTER_KEY:xw,BACKSPACE_KEY:Sw,DELETE_KEY:Cw,ESCAPE:ww,TAB_KEY:Tw,SHIFT_KEY:Ew,CAPS_LOCK_KEY:Dw,SPACE_KEY:Ow,PAGE_UP_KEY:kw,PAGE_DOWN_KEY:Aw,END_KEY:jw,HOME_KEY:Mw,INSERT_KEY:Nw,PAUSE_KEY:Pw,CONTEXT_MENU_KEY:Fw,CUT_SHORTCUT:Iw,COPY_SHORTCUT:Lw,PASTE_SHORTCUT:Rw,HELP_PROMPT:zw,SHORTCUTS_GENERAL:Bw,SHORTCUTS_EDITING:Vw,SHORTCUTS_CODE_NAVIGATION:Hw,SHORTCUTS_ESCAPE:Uw,SHORTCUTS_DELETE:Ww,SHORTCUTS_START_MOVE:Gw,SHORTCUTS_START_MOVE_STACK:Kw,SHORTCUTS_MOVE_LEFT:qw,SHORTCUTS_MOVE_RIGHT:Jw,SHORTCUTS_MOVE_UP:Yw,SHORTCUTS_MOVE_DOWN:Xw,SHORTCUTS_FINISH_MOVE:Zw,SHORTCUTS_ABORT_MOVE:Qw,SHORTCUTS_SHOW_CONTEXT_MENU:$w,SHORTCUTS_FOCUS_WORKSPACE:eT,SHORTCUTS_FOCUS_TOOLBOX:tT,SHORTCUTS_INFORMATION:nT,SHORTCUTS_EXTENDED_INFORMATION:rT,SHORTCUTS_DISCONNECT:iT,SHORTCUTS_NEXT_STACK:aT,SHORTCUTS_PREVIOUS_STACK:oT,SHORTCUTS_NEXT_HEADING:sT,SHORTCUTS_PREVIOUS_HEADING:cT,SHORTCUTS_PERFORM_ACTION:lT,SHORTCUTS_DUPLICATE:uT,SHORTCUTS_CLEANUP:dT,SHORTCUTS_SHOW_TOOLTIP:fT,SHORTCUTS_TOGGLE_SCREENREADER_MODE:pT,SHORTCUTS_JUMP_BLOCK_START:mT,SHORTCUTS_JUMP_BLOCK_END:hT,SHORTCUTS_JUMP_TOP_STACK:gT,SHORTCUTS_JUMP_BOTTOM_STACK:_T,SHORTCUTS_JUMP_FIRST_BLOCK:vT,SHORTCUTS_JUMP_LAST_BLOCK:yT,KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT:bT,KEYBOARD_NAV_CONSTRAINED_MOVE_HINT:xT,KEYBOARD_NAV_COPIED_HINT:ST,KEYBOARD_NAV_CUT_HINT:CT,WORKSPACE_LABEL_PLAIN:wT,WORKSPACE_ROLEDESCRIPTION:TT,WORKSPACE_LABEL_1_STACK:ET,WORKSPACE_LABEL_MANY_STACKS:DT,WORKSPACE_LABEL_MUTATOR_WORKSPACE:OT,WORKSPACE_LABEL_FLYOUT_WORKSPACE:kT,WORKSPACE_CONTENTS_BLOCKS_MANY:AT,WORKSPACE_CONTENTS_BLOCKS_ONE:jT,WORKSPACE_CONTENTS_BLOCKS_ZERO:MT,WORKSPACE_CONTENTS_COMMENTS_MANY:NT,WORKSPACE_CONTENTS_COMMENTS_ONE:PT,KEYBOARD_NAV_BLOCK_NAVIGATION_HINT:FT,KEYBOARD_NAV_WORKSPACE_NAVIGATION_HINT:IT,KEYBOARD_NAV_FLYOUT_LABEL_HINT:LT,BLOCK_LABEL_BEGIN_STACK:RT,BLOCK_LABEL_BEGIN_PREFIX:zT,BLOCK_LABEL_TOOLBOX_CATEGORY:BT,BLOCK_LABEL_DISABLED:VT,BLOCK_LABEL_COLLAPSED:HT,BLOCK_LABEL_REPLACEABLE:UT,BLOCK_LABEL_HAS_INPUT:WT,BLOCK_LABEL_HAS_INPUTS:GT,BLOCK_LABEL_HAS_BRANCHES:KT,BLOCK_LABEL_STATEMENT:qT,BLOCK_LABEL_CONTAINER:JT,BLOCK_LABEL_VALUE:YT,BLOCK_LABEL_STACK_BLOCKS:XT,INPUT_LABEL_INDEX:ZT,INPUT_LABEL_VALUE:QT,INPUT_LABEL_STATEMENT:$T,INPUT_LABEL_END_STATEMENT:eE,INPUT_LABEL_EMPTY:tE,INPUT_LABEL_CONDITION:nE,INPUT_LABEL_CONDITION_A:rE,INPUT_LABEL_CONDITION_B:iE,INPUT_LABEL_VALUE_A:aE,INPUT_LABEL_VALUE_B:oE,INPUT_LABEL_NUMBER:sE,INPUT_LABEL_NUMBER_A:cE,INPUT_LABEL_NUMBER_B:lE,INPUT_LABEL_NUMBER_TO_CHECK:uE,INPUT_LABEL_NUMBER_LIST:dE,INPUT_LABEL_MATH_DIVIDEND:fE,INPUT_LABEL_MATH_DIVISOR:pE,INPUT_LABEL_MATH_CHANGE_BY:mE,INPUT_LABEL_MATH_CONSTRAIN_VALUE:hE,INPUT_LABEL_NUMBER_MIN:gE,INPUT_LABEL_NUMBER_MAX:_E,INPUT_LABEL_NUMBER_ATAN2_X:vE,INPUT_LABEL_NUMBER_ATAN2_Y:yE,INPUT_LABEL_LOOP_TIMES:bE,INPUT_LABEL_LOOP_FROM:xE,INPUT_LABEL_LOOP_TO:SE,INPUT_LABEL_LOOP_BY:CE,INPUT_LABEL_LOOP_LIST:wE,INPUT_LABEL_TEXT_JOIN_ITEM:TE,INPUT_LABEL_TEXT_APPEND:EE,INPUT_LABEL_TEXT_TO_CHANGE:DE,INPUT_LABEL_TEXT_TO_CHECK:OE,INPUT_LABEL_TEXT_TO_FIND:kE,INPUT_LABEL_TEXT_TO_REPLACE:AE,INPUT_LABEL_TEXT_POSITION:jE,INPUT_LABEL_TEXT_START_POSITION:ME,INPUT_LABEL_TEXT_END_POSITION:NE,INPUT_LABEL_TEXT_PROMPT_MESSAGE:PE,INPUT_LABEL_VARIABLES_SET:FE,INPUT_LABEL_LISTS_CREATE_WITH_ITEM:IE,INPUT_LABEL_LISTS_REPEAT_ITEM:LE,INPUT_LABEL_LISTS_REPEAT_NUM:RE,INPUT_LABEL_LISTS_TO_CHECK:zE,INPUT_LABEL_LISTS_VALUE_TO_SET:BE,INPUT_LABEL_LISTS_POSITION:VE,INPUT_LABEL_LISTS_START_POSITION:HE,INPUT_LABEL_LISTS_END_POSITION:UE,INPUT_LABEL_LISTS_LIST_FROM_TEXT:WE,INPUT_LABEL_LISTS_TEXT_FROM_LIST:GE,INPUT_LABEL_LISTS_DELIMITER:KE,INPUT_LABEL_LISTS_TO_CHANGE:qE,ANNOUNCE_MOVE_WORKSPACE:JE,ANNOUNCE_MOVE_BEFORE:YE,ANNOUNCE_MOVE_AFTER:XE,ANNOUNCE_MOVE_INSIDE:ZE,ANNOUNCE_MOVE_AROUND:QE,ANNOUNCE_MOVE_TO:$E,ANNOUNCE_MOVE_OF:eD,ANNOUNCE_MOVE_CANCELED:tD,FIELD_LABEL_EMPTY:nD,ARIA_TYPE_FIELD_INPUT:rD,ARIA_TYPE_FIELD_TEXT_INPUT:iD,ARIA_TYPE_FIELD_NUMBER:aD,ARIA_TYPE_FIELD_TEXT_INPUT_PROCEDURE:oD,ARIA_TYPE_FIELD_TEXT_INPUT_ARGUMENT:sD,ARIA_TYPE_FIELD_DROPDOWN:cD,ARIA_TYPE_FIELD_IMAGE:lD,ARIA_TYPE_FIELD_CHECKBOX:uD,FIELD_LABEL_EDIT_PREFIX:dD,OPEN_TRASH:fD,ZOOM_IN:pD,ZOOM_OUT:mD,RESET_ZOOM:hD,FIELD_LABEL_OPTION_INDEX:gD,FIELD_LABEL_CHECKBOX_CHECKED:_D,FIELD_LABEL_CHECKBOX_UNCHECKED:vD,FIELD_LABEL_VARIABLE:yD,ARIA_LABEL_BUTTON:bD,ARIA_LABEL_HEADING:xD,BUBBLE_LABEL_DEFAULT:SD,BUBBLE_LABEL_COMMENT:CD,BUBBLE_LABEL_WARNING:wD,ICON_LABEL_DEFAULT:TD,ICON_LABEL_COMMENT_CLOSED:ED,ICON_LABEL_COMMENT_OPEN:DD,ICON_LABEL_MUTATOR_CLOSED:OD,ICON_LABEL_MUTATOR_OPEN:kD,ICON_LABEL_WARNING_CLOSED:AD,ICON_LABEL_WARNING_OPEN:jD,ARIA_LABEL_COMMENT:MD,ARIA_LABEL_COMMENT_COLLAPSE:ND,ARIA_LABEL_COMMENT_EXPAND:PD,SCREENREADER_MODE_ENABLED:FD,SCREENREADER_MODE_DISABLED:ID,CURRENT_BLOCK_ANNOUNCEMENT:LD,PARENT_BLOCKS_ANNOUNCEMENT:RD,NO_PARENT_ANNOUNCEMENT:zD,SCREENREADER_HINT:BD,ARIA_LABEL_ADD_ELSE_IF:VD,ARIA_LABEL_REMOVE_ELSE_IF:HD,ARIA_LABEL_ADD_LIST_ITEM:UD,ARIA_LABEL_REMOVE_LIST_ITEM:WD,ARIA_LABEL_ADD_TEXT:GD,ARIA_LABEL_REMOVE_TEXT:KD,ARIA_LABEL_ADD_INPUT:qD,ARIA_LABEL_REMOVE_INPUT:JD,ARIA_TYPE_FIELD_ANGLE:YD,ARIA_LABEL_FIELD_ANGLE:XD,ARIA_TYPE_FIELD_DATE:ZD,ARIA_TYPE_FIELD_COLOUR:QD,ARIA_TYPE_FIELD_BITMAP:$D,ARIA_TYPE_FIELD_GRID:eO,FIELD_BITMAP_BUTTON_LABEL_RANDOMIZE:tO,FIELD_BITMAP_BUTTON_LABEL_CLEAR:nO,FIELD_BITMAP_PIXEL_ON:rO,FIELD_BITMAP_PIXEL_OFF:iO,FIELD_BITMAP_PIXEL_LABEL:aO,FIELD_BITMAP_ARIA_VALUE:oO,OPEN_BACKPACK:sO,CLOSE_BACKPACK:cO,COPY_ALL_TO_BACKPACK:lO,COPY_TO_BACKPACK:uO,EMPTY_BACKPACK:dO,PASTE_ALL_FROM_BACKPACK:fO,REMOVE_FROM_BACKPACK:pO,FIELD_MULTILINEINPUT_FINISH_EDITING:mO,FIELD_MULTILINEINPUT_NEW_LINE:hO,ZOOM_TO_FIT_ARIA_LABEL:gO,MINIMAP_ARIA_LABEL:_O,ARIA_LABEL_TRASH_EMPTY:vO}=t(Vh(),1).default,yO=[{id:`blocks_words`,source:`module`},{id:`blocks_procedures`,source:`module`},{id:`blocks_logic`,source:`module`},{id:`blocks_switch`,source:`module`},{id:`blocks_text`,source:`module`},{id:`blocks_number`,source:`module`},{id:`field_oid`,source:`module`},{id:`field_cron`,source:`module`},{id:`field_script`,source:`module`},{id:`blocks_system`,source:`module`},{id:`blocks_action`,source:`module`},{id:`blocks_sendto`,source:`module`},{id:`blocks_time`,source:`module`},{id:`blocks_convert`,source:`module`},{id:`blocks_trigger`,source:`module`},{id:`blocks_timeout`,source:`module`},{id:`blocks_object`,source:`module`}],bO={blocks_action:()=>o(()=>import(`./blocks_action-HH802DF8.js`),__vite__mapDeps([9,10,11,12]),import.meta.url),blocks_convert:()=>o(()=>import(`./blocks_convert-B1CD0UVU.js`),__vite__mapDeps([13,10,11,12]),import.meta.url),blocks_words:()=>o(()=>import(`./blocks_words-BhHIf_1o.js`),[],import.meta.url),blocks_logic:()=>o(()=>import(`./blocks_logic-Cyd7_0kb.js`),__vite__mapDeps([14,10,11,12]),import.meta.url),blocks_number:()=>o(()=>import(`./blocks_number-lMRwWLtK.js`),__vite__mapDeps([15,10,11]),import.meta.url),blocks_procedures:()=>o(()=>import(`./blocks_procedures-Cxfr0wu8.js`),__vite__mapDeps([16,10,17]),import.meta.url),blocks_sendto:()=>o(()=>import(`./blocks_sendto-CbTqmkT5.js`),__vite__mapDeps([18,10,11,12]),import.meta.url),blocks_system:()=>o(()=>import(`./blocks_system-9p9UhPDv.js`),__vite__mapDeps([19,10,12,20]),import.meta.url),field_cron:()=>o(()=>import(`./field_cron-BJLkgNzf.js`),__vite__mapDeps([21,10]),import.meta.url),field_oid:()=>o(()=>import(`./field_oid-CJZIeruf.js`),__vite__mapDeps([20,10]),import.meta.url),field_script:()=>o(()=>import(`./field_script-4IGidWJ7.js`),__vite__mapDeps([17,10]),import.meta.url),blocks_object:()=>o(()=>import(`./blocks_object-DCupwas8.js`),__vite__mapDeps([22,10,11,12]),import.meta.url),blocks_switch:()=>o(()=>import(`./blocks_switch-55ZePjfL.js`),__vite__mapDeps([23,10,11]),import.meta.url),blocks_text:()=>o(()=>import(`./blocks_text-BkD85XTp.js`),__vite__mapDeps([24,10,11]),import.meta.url),blocks_time:()=>o(()=>import(`./blocks_time-CD9NP7Te.js`),__vite__mapDeps([25,10,11,12]),import.meta.url),blocks_trigger:()=>o(()=>import(`./blocks_trigger-FHBUZCQ8.js`),__vite__mapDeps([26,10,12,20,21]),import.meta.url),blocks_timeout:()=>o(()=>import(`./blocks_timeout-D4yZ2uPk.js`),__vite__mapDeps([27,10,11,12]),import.meta.url)},xO={...dn,JavaScript:Bh};pn(Hh),window.Blockly=xO,window.goog||={provide:()=>{},require:()=>{}};function SO(e){return new Promise(t=>{let n=window.document.createElement(`script`);n.src=e,n.onload=()=>t(),n.onerror=()=>{console.error(`Cannot load ${e}`),t()},window.document.head.appendChild(n)})}var CO=null;function wO(){return CO||=(async()=>{for(let e of yO)if(e.source===`module`){let t=bO[e.id];if(!t){console.error(`No module registered for "${e.id}" - check BLOCK_MODULES in bridge.ts`);continue}(await t()).install()}else await SO(`google-blockly/own/${e.id}.js`)})(),CO}var X=window.Blockly,TO=class extends Error{constructor(){super(`The field has not yet been attached to its input. Call appendField to attach it.`)}},EO=class e extends X.Field{constructor(e,t,n){super(e),N(this,`textGroup`,null),N(this,`borderRect_`,null),N(this,`maxLines_`,1/0),N(this,`isOverflowedY_`,!1),e!==Symbol(`SKIP_SETUP`)&&(n&&this.configure_(n),this.SERIALIZABLE=!0,this.setValue((e==null?void 0:e.toString())||``),t&&this.setValidator(t))}configure_(e){super.configure_(e),e.maxLines&&this.setMaxLines(e.maxLines)}toXml(e){return e.textContent=this.getValue().replace(/\n/g,` `),e}fromXml(e){this.setValue(e.textContent.replace(/ /g,` `))}saveState(){let t=this.saveLegacyState(e);return t===null?this.getValue():t}loadState(e){this.loadLegacyState(X.Field,e)||this.setValue(e)}initView(){this.createBorderRect_(),this.textGroup=X.utils.dom.createSvgElement(X.utils.Svg.G,{class:`blocklyEditableText`},this.fieldGroup_)}onHtmlInputKeyDownSuper_(e){e.key===`Enter`?(X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation()):e.key===`Escape`?(this.setValue(this.htmlInput_.getAttribute(`data-untyped-default-value`),!1),X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation()):e.key===`Tab`&&(X.WidgetDiv.hideIfOwner(this),X.dropDownDiv.hideWithoutAnimation(),this.sourceBlock_.tab(this,!e.shiftKey),e.preventDefault())}onHtmlInputChange_(e){let t=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1),this.sourceBlock_&&X.Events.isEnabled()&&this.value_!==t&&X.Events.fire(new(X.Events.get(`block_field_intermediate_change`))(this.sourceBlock_,this.name||null,t,this.value_))}onFinishEditing_(e){}getValueFromEditorText_(e){return e}bindInputEvents_(e){this.onKeyDownWrapper_=X.browserEvents.conditionalBind(e,`keydown`,this,this.onHtmlInputKeyDown_),this.onKeyInputWrapper_=X.browserEvents.conditionalBind(e,`input`,this,this.onHtmlInputChange_)}getDisplayText_(){let e=this.getSourceBlock();if(!e)throw Error(`The field has not yet been attached to its input. Call appendField to attach it.`);let t=this.getText();if(!t)return X.Field.NBSP;let n=t.split(` `);t=``;let r=this.isOverflowedY_?this.maxLines_:n.length;for(let e=0;ethis.maxDisplayLength?i=`${i.substring(0,this.maxDisplayLength-4)}...`:this.isOverflowedY_&&e===r-1&&(i=`${i.substring(0,i.length-3)}...`),i=i.replace(/\s/g,X.Field.NBSP),t+=i,e!==r-1&&(t+=` `)}return e.RTL&&(t+=`‏`),t}doValueUpdate_(e){super.doValueUpdate_(e),this.value_!==null&&(this.isOverflowedY_=this.value_.split(` diff --git a/admin/assets/mf-entry-bootstrap-0-670c2619.js b/admin/assets/mf-entry-bootstrap-0-515477cc.js similarity index 96% rename from admin/assets/mf-entry-bootstrap-0-670c2619.js rename to admin/assets/mf-entry-bootstrap-0-515477cc.js index 6e1d89f2..8b2dee0d 100644 --- a/admin/assets/mf-entry-bootstrap-0-670c2619.js +++ b/admin/assets/mf-entry-bootstrap-0-515477cc.js @@ -38,4 +38,4 @@ const __mfImport = (src) => if (__mfReactServerModuleCache?.pendingShareLoads) { await Promise.all(__mfReactServerModuleCache.pendingShareLoads); } -})().then(() => __mfImport("./index-sJ01GB6X.js")); +})().then(() => __mfImport("./index-DlFpMLlN.js")); diff --git a/admin/mf-stats.json b/admin/mf-stats.json index 3d5f861d..0b816bc9 100644 --- a/admin/mf-stats.json +++ b/admin/mf-stats.json @@ -1 +1 @@ -{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.3.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.1.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-B3IjMQKW.js","type":"chunk","isEntry":false,"size":2534},{"fileName":"assets/index-sJ01GB6X.js","type":"chunk","isEntry":true,"size":1065970},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-BFtl-m3b.js","type":"chunk","isEntry":false,"size":68507},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-DtbcD6Yx.js","type":"chunk","isEntry":false,"size":1503},{"fileName":"assets/AiInlineProvider-CaHd2G2Q.js","type":"chunk","isEntry":false,"size":2404},{"fileName":"assets/Debugger-C6H0IK4l.js","type":"chunk","isEntry":false,"size":146848},{"fileName":"assets/Error-1oeF0cix.js","type":"chunk","isEntry":false,"size":1018},{"fileName":"assets/Import-BH2X_ziv.js","type":"chunk","isEntry":false,"size":6256},{"fileName":"assets/RulesEditor-C8w1UaWO.js","type":"chunk","isEntry":false,"size":26876},{"fileName":"assets/ScriptEditor-1vbWtjKB.js","type":"chunk","isEntry":false,"size":2192},{"fileName":"assets/ScriptEditorVanillaMonaco-BJVSL-yc.js","type":"chunk","isEntry":false,"size":25070},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-BK6m6sZx.js","type":"chunk","isEntry":false,"size":4746},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js","type":"chunk","isEntry":false,"size":2471487},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js","type":"chunk","isEntry":false,"size":181305},{"fileName":"assets/aiPromptBuilder-HfYvjqbs.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-DBw-ytY1.js","type":"chunk","isEntry":false,"size":632009},{"fileName":"assets/blocks_action-C3rgCWyA.js","type":"chunk","isEntry":false,"size":10226},{"fileName":"assets/blocks_convert-DpPMvgqR.js","type":"chunk","isEntry":false,"size":8698},{"fileName":"assets/blocks_logic-CDtLDgvr.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-Dtveo3bM.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-B6SUr8HP.js","type":"chunk","isEntry":false,"size":6446},{"fileName":"assets/blocks_procedures-DkNQY-Dy.js","type":"chunk","isEntry":false,"size":9317},{"fileName":"assets/blocks_sendto-CgDyguqB.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-CcBSyo3I.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-CKoiEzef.js","type":"chunk","isEntry":false,"size":22801},{"fileName":"assets/blocks_text-DqsVhl4Q.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-DJfyX0NT.js","type":"chunk","isEntry":false,"size":12603},{"fileName":"assets/blocks_timeout-BCswLlY9.js","type":"chunk","isEntry":false,"size":5332},{"fileName":"assets/blocks_trigger-DoyYYWM8.js","type":"chunk","isEntry":false,"size":22895},{"fileName":"assets/blocks_words-BhHIf_1o.js","type":"chunk","isEntry":false,"size":137965},{"fileName":"assets/cronHoverProvider-BhX-SvkB.js","type":"chunk","isEntry":false,"size":1950},{"fileName":"assets/dist-CaOsN0XW.js","type":"chunk","isEntry":false,"size":63684},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-BJLkgNzf.js","type":"chunk","isEntry":false,"size":697},{"fileName":"assets/field_oid-CJZIeruf.js","type":"chunk","isEntry":false,"size":9049},{"fileName":"assets/field_script-4IGidWJ7.js","type":"chunk","isEntry":false,"size":1594},{"fileName":"assets/helpers-BPUU5RuQ.js","type":"chunk","isEntry":false,"size":2964},{"fileName":"assets/inlineChatWidget-CBVgT6FZ.js","type":"chunk","isEntry":false,"size":6857},{"fileName":"assets/inlineDiffController-DianrKl1.js","type":"chunk","isEntry":false,"size":7288},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-CIFNrLee.js","type":"chunk","isEntry":false,"size":144294},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js","type":"chunk","isEntry":false,"size":17801},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-B7qeedMF.js","type":"chunk","isEntry":false,"size":1243},{"fileName":"assets/RulesEditor-BcGsf9n4.css","type":"asset","isEntry":false,"size":14095},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":21986},{"fileName":"assets/mf-entry-bootstrap-0-670c2619.js","type":"asset","isEntry":false,"size":1566}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"],"async":[]},"css":{"sync":[],"async":[]}}}} \ No newline at end of file +{"id":"iobroker_javascript","name":"iobroker_javascript","metaData":{"name":"iobroker_javascript","type":"app","buildInfo":{"buildVersion":"1.0.0","buildName":"iobroker_javascript"},"remoteEntry":{"name":"remoteEntry.js","path":"","type":"module"},"ssrRemoteEntry":{"name":"remoteEntry.ssr.js","path":"","type":"module"},"types":{"path":"","name":"","zip":"@mf-types.zip","api":"@mf-types.d.ts"},"globalName":"iobroker_javascript","pluginVersion":"0.2.5","publicPath":"auto"},"shared":[{"id":"iobroker_javascript:react","name":"react","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom","name":"react-dom","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@mui/material","name":"@mui/material","version":"9.3.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:prop-types","name":"prop-types","version":"15.8.1","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:@iobroker/gui-components","name":"@iobroker/gui-components","version":"10.1.0","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react/jsx-runtime","name":"react/jsx-runtime","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"]},"css":{"async":[],"sync":[]}}},{"id":"iobroker_javascript:react-dom/client","name":"react-dom/client","version":"19.2.8","singleton":true,"requiredVersion":"*","assets":{"js":{"async":[],"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"]},"css":{"async":[],"sync":[]}}}],"remotes":[],"exposes":[],"buildOutput":[{"fileName":"assets/hostInit-B3IjMQKW.js","type":"chunk","isEntry":false,"size":2534},{"fileName":"assets/index-DlFpMLlN.js","type":"chunk","isEntry":true,"size":1065970},{"fileName":"assets/virtualExposes-DgGB-18P.js","type":"chunk","isEntry":false,"size":126},{"fileName":"remoteEntry.js","type":"chunk","isEntry":false,"size":957},{"fileName":"assets/AiChatPanel-9G6bIR9k.js","type":"chunk","isEntry":false,"size":68507},{"fileName":"assets/AiDatapointProvider-DzFpUKkT.js","type":"chunk","isEntry":false,"size":2429},{"fileName":"assets/AiDiffView-DtbcD6Yx.js","type":"chunk","isEntry":false,"size":1503},{"fileName":"assets/AiInlineProvider-CaHd2G2Q.js","type":"chunk","isEntry":false,"size":2404},{"fileName":"assets/Debugger-CCdzg9pi.js","type":"chunk","isEntry":false,"size":146848},{"fileName":"assets/Error-1oeF0cix.js","type":"chunk","isEntry":false,"size":1018},{"fileName":"assets/Import-BH2X_ziv.js","type":"chunk","isEntry":false,"size":6256},{"fileName":"assets/RulesEditor-B84Rh__9.js","type":"chunk","isEntry":false,"size":26876},{"fileName":"assets/ScriptEditor-COVJ2tCs.js","type":"chunk","isEntry":false,"size":2192},{"fileName":"assets/ScriptEditorVanillaMonaco-0Mwut6ZY.js","type":"chunk","isEntry":false,"size":25070},{"fileName":"assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-BK6m6sZx.js","type":"chunk","isEntry":false,"size":4746},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js","type":"chunk","isEntry":false,"size":2471487},{"fileName":"assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js","type":"chunk","isEntry":false,"size":181305},{"fileName":"assets/aiPromptBuilder-CBfkFGhG.js","type":"chunk","isEntry":false,"size":77},{"fileName":"assets/applyCodeEdit-D3nb7erO.js","type":"chunk","isEntry":false,"size":633},{"fileName":"assets/blockly-DBw-ytY1.js","type":"chunk","isEntry":false,"size":632009},{"fileName":"assets/blocks_action-HH802DF8.js","type":"chunk","isEntry":false,"size":10231},{"fileName":"assets/blocks_convert-B1CD0UVU.js","type":"chunk","isEntry":false,"size":8703},{"fileName":"assets/blocks_logic-Cyd7_0kb.js","type":"chunk","isEntry":false,"size":3949},{"fileName":"assets/blocks_number-lMRwWLtK.js","type":"chunk","isEntry":false,"size":700},{"fileName":"assets/blocks_object-DCupwas8.js","type":"chunk","isEntry":false,"size":6451},{"fileName":"assets/blocks_procedures-Cxfr0wu8.js","type":"chunk","isEntry":false,"size":9340},{"fileName":"assets/blocks_sendto-CbTqmkT5.js","type":"chunk","isEntry":false,"size":10968},{"fileName":"assets/blocks_switch-55ZePjfL.js","type":"chunk","isEntry":false,"size":4639},{"fileName":"assets/blocks_system-9p9UhPDv.js","type":"chunk","isEntry":false,"size":22796},{"fileName":"assets/blocks_text-BkD85XTp.js","type":"chunk","isEntry":false,"size":1736},{"fileName":"assets/blocks_time-CD9NP7Te.js","type":"chunk","isEntry":false,"size":12608},{"fileName":"assets/blocks_timeout-D4yZ2uPk.js","type":"chunk","isEntry":false,"size":5345},{"fileName":"assets/blocks_trigger-FHBUZCQ8.js","type":"chunk","isEntry":false,"size":22883},{"fileName":"assets/blocks_words-BhHIf_1o.js","type":"chunk","isEntry":false,"size":137965},{"fileName":"assets/cronHoverProvider-BhX-SvkB.js","type":"chunk","isEntry":false,"size":1950},{"fileName":"assets/dist-CaOsN0XW.js","type":"chunk","isEntry":false,"size":63684},{"fileName":"assets/docs-compact-D7rpMc7r.js","type":"chunk","isEntry":false,"size":13791},{"fileName":"assets/field_cron-BJLkgNzf.js","type":"chunk","isEntry":false,"size":697},{"fileName":"assets/field_oid-CJZIeruf.js","type":"chunk","isEntry":false,"size":9049},{"fileName":"assets/field_script-4IGidWJ7.js","type":"chunk","isEntry":false,"size":1594},{"fileName":"assets/helpers-n7EZ1fEP.js","type":"chunk","isEntry":false,"size":3099},{"fileName":"assets/inlineChatWidget-CBVgT6FZ.js","type":"chunk","isEntry":false,"size":6857},{"fileName":"assets/inlineDiffController-DianrKl1.js","type":"chunk","isEntry":false,"size":7288},{"fileName":"assets/rolldown-runtime-C0FnF6B9.js","type":"chunk","isEntry":false,"size":1291},{"fileName":"assets/stateHoverProvider-CIFNrLee.js","type":"chunk","isEntry":false,"size":144294},{"fileName":"assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-BO-WKj5V.js","type":"chunk","isEntry":false,"size":17801},{"fileName":"assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js","type":"chunk","isEntry":false,"size":24},{"fileName":"assets/vite-preload-helper-B7qeedMF.js","type":"chunk","isEntry":false,"size":1243},{"fileName":"assets/RulesEditor-BcGsf9n4.css","type":"asset","isEntry":false,"size":14095},{"fileName":"assets/blockly2js-B3Jxf2e-.svg","type":"asset","isEntry":false,"size":8421},{"fileName":"assets/hysteresis-CLhhemcG.png","type":"asset","isEntry":false,"size":12163},{"fileName":"assets/index-Z8Hkv58g.css","type":"asset","isEntry":false,"size":7849},{"fileName":"assets/rules2js-DnYyR8mI.svg","type":"asset","isEntry":false,"size":6950},{"fileName":"assets/tileBlockly-BMpdinN3.png","type":"asset","isEntry":false,"size":12893},{"fileName":"assets/tileJS-C48gYbHw.png","type":"asset","isEntry":false,"size":17266},{"fileName":"assets/tileRules-BkbaFIhs.png","type":"asset","isEntry":false,"size":83463},{"fileName":"assets/tileTS-CsXmgy4B.png","type":"asset","isEntry":false,"size":13415},{"fileName":"index.html","type":"asset","isEntry":false,"size":21986},{"fileName":"assets/mf-entry-bootstrap-0-515477cc.js","type":"asset","isEntry":false,"size":1566}],"assetAnalysis":{"react":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react/jsx-runtime":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"prop-types":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@mui/material":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"@iobroker/gui-components":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DezK0U6r.js"],"async":[]},"css":{"sync":[],"async":[]}},"react-dom/client":{"js":{"sync":["assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_q6w9ugW.js"],"async":[]},"css":{"sync":[],"async":[]}}}} \ No newline at end of file diff --git a/admin/tab.html b/admin/tab.html index 12540ffb..64e5dc41 100644 --- a/admin/tab.html +++ b/admin/tab.html @@ -27,12 +27,12 @@ Scripts - + - + Scripts - + - +